Skip to content

Commit

Permalink
fix: markdown extensions should be flat (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Sep 26, 2024
1 parent dbb5c51 commit 60a60b1
Show file tree
Hide file tree
Showing 46 changed files with 80 additions and 230 deletions.
3 changes: 2 additions & 1 deletion projects/editor/extensions/markdown/clipboard/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {tuiElementFromString} from '@taiga-ui/editor/extensions/markdown/util';
import {Extension} from '@tiptap/core';
import type {Slice} from '@tiptap/pm/model';
import {DOMParser} from '@tiptap/pm/model';
import {Plugin, PluginKey} from '@tiptap/pm/state';

import {tuiElementFromString} from '../util/dom';

export const TuiMarkdownClipboard = Extension.create({
name: 'markdownClipboard',
addOptions() {
Expand Down
5 changes: 0 additions & 5 deletions projects/editor/extensions/markdown/clipboard/ng-package.json

This file was deleted.

9 changes: 5 additions & 4 deletions projects/editor/extensions/markdown/extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {TuiMarkdownClipboard} from '@taiga-ui/editor/extensions/markdown/clipboard';
import {TuiEditorMarkdownParser} from '@taiga-ui/editor/extensions/markdown/parse';
import {TuiMarkdownSerializer} from '@taiga-ui/editor/extensions/markdown/serialize';
import {TuiMarkdownTightLists} from '@taiga-ui/editor/extensions/markdown/tight-lists';
import {Extension, extensions} from '@tiptap/core';

import {TuiMarkdownClipboard} from '../clipboard';
import {TuiEditorMarkdownParser} from '../parse';
import {TuiMarkdownSerializer} from '../serialize';
import {TuiMarkdownTightLists} from '../tight-lists';

export const TuiMarkdown = Extension.create({
name: 'markdown',
priority: 50,
Expand Down
5 changes: 0 additions & 5 deletions projects/editor/extensions/markdown/extension/ng-package.json

This file was deleted.

6 changes: 3 additions & 3 deletions projects/editor/extensions/markdown/extensions/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes';
export * from '@taiga-ui/editor/extensions/markdown/extensions/util';
export * from './marks';
export * from './nodes';
export * from './util';

This file was deleted.

This file was deleted.

This file was deleted.

12 changes: 6 additions & 6 deletions projects/editor/extensions/markdown/extensions/marks/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/bold';
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/code';
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/html';
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/italic';
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/link';
export * from '@taiga-ui/editor/extensions/markdown/extensions/marks/strike';
export * from './bold';
export * from './code';
export * from './html';
export * from './italic';
export * from './link';
export * from './strike';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import HTMLNode from '@taiga-ui/editor/extensions/markdown/extensions/nodes/html';
import {Node} from '@tiptap/core';
import type {Node as ProseNode} from '@tiptap/pm/model';

import HTMLNode from '../html';

export default Node.create({
name: 'hardBreak',
}).extend({
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {tuiElementFromString} from '@taiga-ui/editor/extensions/markdown/util';
import type {Editor} from '@tiptap/core';
import {getHTMLFromFragment, Node} from '@tiptap/core';
import type {Node as ProseNode} from '@tiptap/pm/model';
import {Fragment} from '@tiptap/pm/model';

import {tuiElementFromString} from '../../../util/dom';

export default Node.create({
name: 'markdownHTMLNode',
addStorage() {
Expand Down

This file was deleted.

This file was deleted.

30 changes: 15 additions & 15 deletions projects/editor/extensions/markdown/extensions/nodes/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/blockquote';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/bullet-list';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/code-block';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/hard-break';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/heading';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/horizontal-rule';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/html';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/image';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/list-item';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/ordered-list';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/paragraph';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/table';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/task-item';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/task-list';
export * from '@taiga-ui/editor/extensions/markdown/extensions/nodes/text';
export * from './blockquote';
export * from './bullet-list';
export * from './code-block';
export * from './hard-break';
export * from './heading';
export * from './horizontal-rule';
export * from './html';
export * from './image';
export * from './list-item';
export * from './ordered-list';
export * from './paragraph';
export * from './table';
export * from './task-item';
export * from './task-list';
export * from './text';

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import HTMLNode from '@taiga-ui/editor/extensions/markdown/extensions/nodes/html';
import {tuiChildNodes} from '@taiga-ui/editor/extensions/markdown/util';
import {Node} from '@tiptap/core';
import type {Node as ProseNode} from '@tiptap/pm/model';

import {tuiChildNodes} from '../../../util/prosemirror';
import HTMLNode from '../html';

export default Node.create({
name: 'table',
}).extend({
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import BulletList from '@taiga-ui/editor/extensions/markdown/extensions/nodes/bullet-list';
import {tuiMarkdownItTaskList} from '@taiga-ui/editor/extensions/markdown/util';
import {Node} from '@tiptap/core';
import type MarkdownIt from 'markdown-it';

import {tuiMarkdownItTaskList} from '../../../util/markdown-it-task-lists';
import BulletList from '../bullet-list';

export default Node.create({
name: 'taskList',
}).extend({
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {tuiEscapeHTML} from '@taiga-ui/editor/extensions/markdown/util';
import {Node} from '@tiptap/core';
import type {Node as ProseNode} from '@tiptap/pm/model';

import {tuiEscapeHTML} from '../../../util/dom';

export default Node.create({
name: 'text',
}).extend({
Expand Down

This file was deleted.

42 changes: 21 additions & 21 deletions projects/editor/extensions/markdown/extensions/util/index.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Bold from '@taiga-ui/editor/extensions/markdown/extensions/marks/bold';
import Code from '@taiga-ui/editor/extensions/markdown/extensions/marks/code';
import HTMLMark from '@taiga-ui/editor/extensions/markdown/extensions/marks/html';
import Italic from '@taiga-ui/editor/extensions/markdown/extensions/marks/italic';
import Link from '@taiga-ui/editor/extensions/markdown/extensions/marks/link';
import Strike from '@taiga-ui/editor/extensions/markdown/extensions/marks/strike';
import Blockquote from '@taiga-ui/editor/extensions/markdown/extensions/nodes/blockquote';
import BulletList from '@taiga-ui/editor/extensions/markdown/extensions/nodes/bullet-list';
import CodeBlock from '@taiga-ui/editor/extensions/markdown/extensions/nodes/code-block';
import HardBreak from '@taiga-ui/editor/extensions/markdown/extensions/nodes/hard-break';
import Heading from '@taiga-ui/editor/extensions/markdown/extensions/nodes/heading';
import HorizontalRule from '@taiga-ui/editor/extensions/markdown/extensions/nodes/horizontal-rule';
import HTMLNode from '@taiga-ui/editor/extensions/markdown/extensions/nodes/html';
import Image from '@taiga-ui/editor/extensions/markdown/extensions/nodes/image';
import ListItem from '@taiga-ui/editor/extensions/markdown/extensions/nodes/list-item';
import OrderedList from '@taiga-ui/editor/extensions/markdown/extensions/nodes/ordered-list';
import Paragraph from '@taiga-ui/editor/extensions/markdown/extensions/nodes/paragraph';
import Table from '@taiga-ui/editor/extensions/markdown/extensions/nodes/table';
import TaskItem from '@taiga-ui/editor/extensions/markdown/extensions/nodes/task-item';
import TaskList from '@taiga-ui/editor/extensions/markdown/extensions/nodes/task-list';
import Text from '@taiga-ui/editor/extensions/markdown/extensions/nodes/text';
import Bold from '../marks/bold';
import Code from '../marks/code';
import HTMLMark from '../marks/html';
import Italic from '../marks/italic';
import Link from '../marks/link';
import Strike from '../marks/strike';
import Blockquote from '../nodes/blockquote';
import BulletList from '../nodes/bullet-list';
import CodeBlock from '../nodes/code-block';
import HardBreak from '../nodes/hard-break';
import Heading from '../nodes/heading';
import HorizontalRule from '../nodes/horizontal-rule';
import HTMLNode from '../nodes/html';
import Image from '../nodes/image';
import ListItem from '../nodes/list-item';
import OrderedList from '../nodes/ordered-list';
import Paragraph from '../nodes/paragraph';
import Table from '../nodes/table';
import TaskItem from '../nodes/task-item';
import TaskList from '../nodes/task-list';
import Text from '../nodes/text';

const extensions = [
Blockquote,
Expand Down

This file was deleted.

14 changes: 7 additions & 7 deletions projects/editor/extensions/markdown/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from '@taiga-ui/editor/extensions/markdown/clipboard';
export * from '@taiga-ui/editor/extensions/markdown/extension';
export * from '@taiga-ui/editor/extensions/markdown/extensions';
export * from '@taiga-ui/editor/extensions/markdown/parse';
export * from '@taiga-ui/editor/extensions/markdown/serialize';
export * from '@taiga-ui/editor/extensions/markdown/tight-lists';
export * from '@taiga-ui/editor/extensions/markdown/util';
export * from './clipboard';
export * from './extension';
export * from './extensions';
export * from './parse';
export * from './serialize';
export * from './tight-lists';
export * from './util';
9 changes: 3 additions & 6 deletions projects/editor/extensions/markdown/parse/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import {tuiGetMarkdownSpec} from '@taiga-ui/editor/extensions/markdown/extensions/util';
import {
tuiElementFromString,
tuiExtractElement,
tuiUnwrapElement,
} from '@taiga-ui/editor/extensions/markdown/util';
import type {Editor} from '@tiptap/core';
import MarkdownIt from 'markdown-it';

import {tuiGetMarkdownSpec} from '../extensions/util';
import {tuiElementFromString, tuiExtractElement, tuiUnwrapElement} from '../util/dom';

export class TuiEditorMarkdownParser {
protected readonly md: MarkdownIt;

Expand Down
5 changes: 0 additions & 5 deletions projects/editor/extensions/markdown/parse/ng-package.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import HTMLMark from '@taiga-ui/editor/extensions/markdown/extensions/marks/html';
import HardBreak from '@taiga-ui/editor/extensions/markdown/extensions/nodes/hard-break';
import HTMLNode from '@taiga-ui/editor/extensions/markdown/extensions/nodes/html';
import {tuiGetMarkdownSpec} from '@taiga-ui/editor/extensions/markdown/extensions/util';
import type {Editor, Mark as Mark2, Node as Node2} from '@tiptap/core';
import type {Mark, Node} from '@tiptap/pm/model';

import HTMLMark from '../extensions/marks/html';
import HardBreak from '../extensions/nodes/hard-break';
import HTMLNode from '../extensions/nodes/html';
import {tuiGetMarkdownSpec} from '../extensions/util';
import {TuiMarkdownSerializerState} from './state';

export class TuiMarkdownSerializer {
Expand Down
5 changes: 0 additions & 5 deletions projects/editor/extensions/markdown/serialize/ng-package.json

This file was deleted.

Loading

0 comments on commit 60a60b1

Please sign in to comment.