@yiitap/vue 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/index.cjs +270 -22
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +270 -22
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +52672 -25834
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/vue.css +1 -1
  8. package/package.json +55 -58
  9. package/types/components/YiiEditor.vue.d.ts +8 -12
  10. package/types/components/buttons/OExtensionDropdown.vue.d.ts +11 -0
  11. package/types/components/common/OBlockPlaceholder.vue.d.ts +1 -1
  12. package/types/components/common/OBlockPopover.vue.d.ts +1 -1
  13. package/types/components/common/OCommandBtn.vue.d.ts +8 -8
  14. package/types/components/common/OCommonBtn.vue.d.ts +8 -8
  15. package/types/components/common/OMenubarBtn.vue.d.ts +7 -7
  16. package/types/components/common/OMetaInput.vue.d.ts +1 -1
  17. package/types/components/common/ONodeView.vue.d.ts +4 -8
  18. package/types/components/index.d.ts +1 -0
  19. package/types/components/menus/OSideMenu.vue.d.ts +9 -0
  20. package/types/components/ui/OBtn.vue.d.ts +3 -3
  21. package/types/components/ui/OBtnGroup.vue.d.ts +3 -3
  22. package/types/components/ui/OCheckbox.vue.d.ts +1 -1
  23. package/types/components/ui/ODialog.vue.d.ts +2 -2
  24. package/types/components/ui/OIcon.vue.d.ts +1 -1
  25. package/types/components/ui/OImageViewer.vue.d.ts +1 -1
  26. package/types/components/ui/OInput.vue.d.ts +2 -2
  27. package/types/components/ui/OPopover.vue.d.ts +4 -4
  28. package/types/components/ui/OTextarea.vue.d.ts +2 -2
  29. package/types/components/ui/OTooltip.vue.d.ts +1 -1
  30. package/types/constants/brand-color.d.ts +4 -0
  31. package/types/constants/empty-block.d.ts +75 -5
  32. package/types/constants/index.d.ts +1 -1
  33. package/types/extensions/audio/index.d.ts +4 -0
  34. package/types/extensions/blockquote/index.d.ts +1 -1
  35. package/types/extensions/char-command/emoji/view.vue.d.ts +2 -2
  36. package/types/extensions/char-command/index.d.ts +4 -0
  37. package/types/extensions/char-command/slash/view.vue.d.ts +1 -1
  38. package/types/extensions/code-block/index.d.ts +3 -3
  39. package/types/extensions/details/index.d.ts +1 -1
  40. package/types/extensions/extensions.d.ts +55 -0
  41. package/types/extensions/factory.d.ts +111 -0
  42. package/types/extensions/horizontal-rule/index.d.ts +3 -1
  43. package/types/extensions/index.d.ts +3 -51
  44. package/types/extensions/multi-column/__tests__/index.spec.d.ts +1 -0
  45. package/types/extensions/multi-column/core/dom.d.ts +13 -0
  46. package/types/extensions/multi-column/core/keymap.d.ts +3 -0
  47. package/types/extensions/multi-column/core/schema.d.ts +3 -0
  48. package/types/extensions/multi-column/core/state.d.ts +16 -0
  49. package/types/extensions/multi-column/extensions/column-container.d.ts +5 -0
  50. package/types/extensions/multi-column/extensions/column-dropcursor.d.ts +5 -0
  51. package/types/extensions/multi-column/extensions/column.d.ts +5 -0
  52. package/types/extensions/multi-column/extensions/multi-column.d.ts +20 -0
  53. package/types/extensions/multi-column/index.d.ts +4 -0
  54. package/types/extensions/multi-column/plugins/resize.d.ts +6 -0
  55. package/types/extensions/multi-column/utils/utils.d.ts +15 -0
  56. package/types/extensions/paragraph/index.d.ts +3 -1
  57. package/types/extensions/side-menu/utils.d.ts +9 -0
  58. package/types/extensions/starter-kit.d.ts +20 -0
  59. package/types/index.d.ts +1 -0
  60. package/types/components/common/o-side-node/AddNode.vue.d.ts +0 -92
  61. package/types/components/common/o-side-node/AddNodeView.vue.d.ts +0 -96
  62. package/types/components/common/o-side-node/DragNode.vue.d.ts +0 -96
  63. package/types/components/common/o-side-node/DragNodeView.vue.d.ts +0 -96
  64. package/types/components/common/o-side-node/index.vue.d.ts +0 -96
  65. package/types/constants/color.d.ts +0 -5
  66. package/types/extensions/dynamic.d.ts +0 -8
  67. package/types/extensions/heading/index.d.ts +0 -7
  68. /package/types/extensions/{heading → audio}/view.vue.d.ts +0 -0
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Color
3
+ */
4
+ export declare const BrandColor: Indexable;
@@ -5,20 +5,45 @@ export declare const EmptyParagraph: {
5
5
  type: string;
6
6
  content: any[];
7
7
  }[];
8
- export declare const EmptyListItem: {
8
+ export declare const EmptyAiBlock: {
9
9
  type: string;
10
10
  content: {
11
11
  type: string;
12
12
  content: any[];
13
13
  }[];
14
- }[];
15
- export declare const EmptyTaskItem: {
14
+ };
15
+ export declare const EmptyAudio: {
16
+ type: string;
17
+ attrs: {
18
+ src: string;
19
+ };
20
+ };
21
+ export declare const EmptyBlockquote: {
16
22
  type: string;
17
23
  content: {
18
24
  type: string;
19
25
  content: any[];
20
26
  }[];
21
- }[];
27
+ };
28
+ export declare const EmptyCallout: {
29
+ type: string;
30
+ attrs: {
31
+ icon: string;
32
+ };
33
+ content: {
34
+ type: string;
35
+ content: any[];
36
+ }[];
37
+ };
38
+ export declare const EmptyCodeblock: {
39
+ type: string;
40
+ attrs: {
41
+ attrs: {
42
+ language: string;
43
+ };
44
+ };
45
+ content: any[];
46
+ };
22
47
  export declare const EmptyDetails: {
23
48
  type: string;
24
49
  attrs: {
@@ -31,7 +56,7 @@ export declare const EmptyDetails: {
31
56
  content: any[];
32
57
  }[];
33
58
  }[];
34
- }[];
59
+ };
35
60
  export declare const EmptyDiagram: {
36
61
  type: string;
37
62
  attrs: {
@@ -41,4 +66,49 @@ export declare const EmptyDiagram: {
41
66
  type: string;
42
67
  text: string;
43
68
  }[];
69
+ };
70
+ export declare const EmptyEmoji: {
71
+ type: string;
72
+ content: {
73
+ type: string;
74
+ text: string;
75
+ }[];
76
+ };
77
+ export declare const EmptyImage: {
78
+ type: string;
79
+ attrs: {
80
+ src: string;
81
+ };
82
+ };
83
+ export declare const EmptyListItem: {
84
+ type: string;
85
+ content: {
86
+ type: string;
87
+ content: any[];
88
+ }[];
44
89
  }[];
90
+ export declare const EmptyTable: {
91
+ type: string;
92
+ content: {
93
+ type: string;
94
+ content: {
95
+ type: string;
96
+ content: {
97
+ type: string;
98
+ }[];
99
+ }[];
100
+ }[];
101
+ };
102
+ export declare const EmptyTaskItem: {
103
+ type: string;
104
+ content: {
105
+ type: string;
106
+ content: any[];
107
+ }[];
108
+ }[];
109
+ export declare const EmptyVideo: {
110
+ type: string;
111
+ attrs: {
112
+ src: string;
113
+ };
114
+ };
@@ -1,4 +1,4 @@
1
1
  export * from './ai';
2
2
  export * from './block';
3
- export * from './color';
3
+ export * from './brand-color';
4
4
  export * from './menu';
@@ -0,0 +1,4 @@
1
+ import { type AudioOptions } from '@tiptap/extension-audio';
2
+ export declare const OAudio: import("@tiptap/core").Node<AudioOptions, any>;
3
+ export default OAudio;
4
+ export type { AudioOptions };
@@ -1,5 +1,5 @@
1
1
  import type { BlockquoteOptions } from '@tiptap/extension-blockquote';
2
- interface OBlockquoteOptions extends BlockquoteOptions {
2
+ export interface OBlockquoteOptions extends BlockquoteOptions {
3
3
  triggerCharacters: string[];
4
4
  }
5
5
  declare const OBlockquote: import("@tiptap/core").Node<OBlockquoteOptions, any>;
@@ -1,6 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  items: {
3
- type: ArrayConstructor;
3
+ type: () => Indexable[];
4
4
  required: true;
5
5
  };
6
6
  command: {
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
23
23
  selectItem(index: any): void;
24
24
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
25
  items: {
26
- type: ArrayConstructor;
26
+ type: () => Indexable[];
27
27
  required: true;
28
28
  };
29
29
  command: {
@@ -0,0 +1,4 @@
1
+ import ColonSuggestion from './colon/suggestion';
2
+ import SlashSuggestion from './slash/suggestion';
3
+ import EmojiSuggestion from './emoji/suggestion';
4
+ export { ColonSuggestion, SlashSuggestion, EmojiSuggestion };
@@ -94,8 +94,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
94
94
  default: boolean;
95
95
  };
96
96
  }>> & Readonly<{}>, {
97
- small: boolean;
98
97
  name: string;
98
+ small: boolean;
99
99
  color: string;
100
100
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
101
101
  OList: {
@@ -1,6 +1,6 @@
1
1
  import type { CodeBlockLowlightOptions } from '@tiptap/extension-code-block-lowlight';
2
- interface OCodeBlockOptions extends CodeBlockLowlightOptions {
2
+ export interface OCodeBlockOptions extends CodeBlockLowlightOptions {
3
3
  diagramTheme: string;
4
4
  }
5
- declare const OCodeBlockOptions: import("@tiptap/core").Node<OCodeBlockOptions, any>;
6
- export default OCodeBlockOptions;
5
+ declare const OCodeBlock: import("@tiptap/core").Node<OCodeBlockOptions, any>;
6
+ export default OCodeBlock;
@@ -1,5 +1,5 @@
1
1
  import type { DetailsOptions } from '@tiptap/extension-details';
2
- interface ODetailsOptions extends DetailsOptions {
2
+ export interface ODetailsOptions extends DetailsOptions {
3
3
  triggerCharacters: string[];
4
4
  }
5
5
  declare const ODetails: import("@tiptap/core").Node<ODetailsOptions, any>;
@@ -0,0 +1,55 @@
1
+ import type { AnyExtension } from '@tiptap/core';
2
+ import { Focus, type FocusOptions } from '@tiptap/extensions';
3
+ import { Details, DetailsContent, DetailsSummary } from '@tiptap/extension-details';
4
+ import { TaskItem, TaskList, type TaskItemOptions, type TaskListOptions } from '@tiptap/extension-list';
5
+ import { BlockMath, InlineMath, type BlockMathOptions, type InlineMathOptions } from '@tiptap/extension-mathematics';
6
+ import { Table, TableRow, TableCell, TableHeader } from '@tiptap/extension-table';
7
+ import { BackgroundColor, Color, FontFamily, TextStyle, type BackgroundColorOptions, type ColorOptions, type FontFamilyOptions, type TextStyleOptions } from '@tiptap/extension-text-style';
8
+ import { Markdown, type MarkdownExtensionOptions } from '@tiptap/markdown';
9
+ import Collaboration, { type CollaborationOptions } from '@tiptap/extension-collaboration';
10
+ import CollaborationCaret, { type CollaborationCaretOptions } from '@tiptap/extension-collaboration-caret';
11
+ import Highlight, { type HighlightOptions } from '@tiptap/extension-highlight';
12
+ import { type HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
13
+ import Image, { type ImageOptions } from '@tiptap/extension-image';
14
+ import Link, { type LinkOptions } from '@tiptap/extension-link';
15
+ import Mention, { type MentionOptions } from '@tiptap/extension-mention';
16
+ import Subscript, { type SubscriptExtensionOptions } from '@tiptap/extension-subscript';
17
+ import Superscript, { type SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
18
+ import TextAlign, { type TextAlignOptions } from '@tiptap/extension-text-align';
19
+ import Typography, { type TypographyOptions } from '@tiptap/extension-typography';
20
+ import Underline, { type UnderlineOptions } from '@tiptap/extension-underline';
21
+ import UniqueID, { type UniqueIDOptions } from '@tiptap/extension-unique-id';
22
+ import type { AiBlockOptions } from '@yiitap/extension-ai-block';
23
+ import type { CalloutOptions } from '@yiitap/extension-callout';
24
+ import OColorHighlighter from '@yiitap/extension-color-highlighter';
25
+ import OInlinePlaceholder from '@yiitap/extension-inline-placeholder';
26
+ import { Column, ColumnContainer, MultiColumn, ColumnDropCursor } from '@yiitap/extension-multi-column';
27
+ import type { MultiColumnOptions, ColumnDropCursorOptions } from '@yiitap/extension-multi-column';
28
+ import OPlaceholder from '@yiitap/extension-placeholder';
29
+ import OSelectionDecoration from '@yiitap/extension-selection-decoration';
30
+ import OShortcut, { type ShortcutOptions } from '@yiitap/extension-shortcut';
31
+ import OTable from '@yiitap/extension-table';
32
+ import OTaskItem from '@yiitap/extension-task-item';
33
+ import OCharCommand from '@yiitap/extension-char-command';
34
+ import { ColonCommand as OColonCommand, SlashCommand as OSlashCommand, SlashZhCommand as OSlashZhCommand } from '@yiitap/extension-char-command';
35
+ import { ColonSuggestion, SlashSuggestion, EmojiSuggestion } from './char-command';
36
+ import OAiBlock from './ai-block';
37
+ import OAudio, { type AudioOptions } from './audio';
38
+ import OBlockMath from './block-math';
39
+ import OBlockquote, { type OBlockquoteOptions } from './blockquote';
40
+ import OCallout from './callout';
41
+ import OCodeBlock, { type OCodeBlockOptions } from './code-block';
42
+ import ODetails, { type ODetailsOptions } from './details';
43
+ import OHorizontalRule from './horizontal-rule';
44
+ import OImage from './image';
45
+ import OLink from './link';
46
+ import OTableCell from './table-cell';
47
+ import OTableHeader from './table-header';
48
+ import OTableWrapper from './table-wrapper';
49
+ import OVideo from './video';
50
+ /**
51
+ * Default extensions enabled via StarterKit
52
+ */
53
+ export declare const DefaultExtensionNames: string[];
54
+ export { BackgroundColor, BlockMath, Collaboration, CollaborationCaret, Color, Details, DetailsContent, DetailsSummary, Focus, FontFamily, Highlight, Image, InlineMath, Link, Markdown, Mention, Subscript, Superscript, Table, TableHeader, TableCell, TableRow, TaskItem, TaskList, TextAlign, TextStyle, Typography, Underline, UniqueID, OAiBlock, OAudio, OBlockMath, OBlockquote, OCallout, OCharCommand, OCodeBlock, OColonCommand, OColorHighlighter, ODetails, OHorizontalRule, OImage, OInlinePlaceholder, OLink, OPlaceholder, OSelectionDecoration, OShortcut, OSlashCommand, OSlashZhCommand, OTable, OTableCell, OTableHeader, OTableWrapper, OTaskItem, OVideo, Column, ColumnContainer, MultiColumn, ColumnDropCursor, ColonSuggestion, SlashSuggestion, EmojiSuggestion, };
55
+ export type { AnyExtension, BackgroundColorOptions, BlockMathOptions, CollaborationOptions, CollaborationCaretOptions, ColorOptions, FocusOptions, FontFamilyOptions, HighlightOptions, HorizontalRuleOptions, ImageOptions, InlineMathOptions, LinkOptions, MarkdownExtensionOptions, MentionOptions, SubscriptExtensionOptions, SuperscriptExtensionOptions, TaskItemOptions, TaskListOptions, TextAlignOptions, TextStyleOptions, TypographyOptions, UnderlineOptions, UniqueIDOptions, AiBlockOptions, AudioOptions, CalloutOptions, OBlockquoteOptions, OCodeBlockOptions, ODetailsOptions, ColumnDropCursorOptions, MultiColumnOptions, ShortcutOptions, };
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Extensions Registry Factory
3
+ */
4
+ import type { AnyExtension, BackgroundColorOptions, BlockMathOptions, CollaborationOptions, CollaborationCaretOptions, ColorOptions, FocusOptions, FontFamilyOptions, HighlightOptions, HorizontalRuleOptions, ImageOptions, InlineMathOptions, LinkOptions, MarkdownExtensionOptions, MentionOptions, SubscriptExtensionOptions, SuperscriptExtensionOptions, TaskItemOptions, TaskListOptions, TextAlignOptions, TextStyleOptions, TypographyOptions, UnderlineOptions, UniqueIDOptions, AiBlockOptions, AudioOptions, CalloutOptions, OBlockquoteOptions, OCodeBlockOptions, ODetailsOptions, ColumnDropCursorOptions, MultiColumnOptions, ShortcutOptions } from './extensions';
5
+ /**
6
+ * Define the factory type to hide internal Tiptap/Yiitap option types.
7
+ * This prevents "name from external module" errors.
8
+ */
9
+ type ExtensionFactory<K extends keyof ExtensionOptions = any> = (opts?: ExtensionOptions[K]) => AnyExtension | AnyExtension[];
10
+ /**
11
+ * Detailed options for each extension to provide full IntelliSense
12
+ */
13
+ export interface ExtensionOptions {
14
+ BackgroundColor: BackgroundColorOptions;
15
+ BlockMath: BlockMathOptions;
16
+ Collaboration: CollaborationOptions;
17
+ CollaborationCaret: CollaborationCaretOptions;
18
+ Color: ColorOptions;
19
+ Focus: FocusOptions;
20
+ FontFamily: FontFamilyOptions;
21
+ Highlight: HighlightOptions;
22
+ Image: ImageOptions;
23
+ InlineMath: InlineMathOptions;
24
+ Link: LinkOptions;
25
+ Markdown: MarkdownExtensionOptions;
26
+ Mention: MentionOptions;
27
+ Subscript: SubscriptExtensionOptions;
28
+ Superscript: SuperscriptExtensionOptions;
29
+ TaskItem: TaskItemOptions;
30
+ TaskList: TaskListOptions;
31
+ TextAlign: TextAlignOptions;
32
+ TextStyle: TextStyleOptions;
33
+ Typography: TypographyOptions;
34
+ Underline: UnderlineOptions;
35
+ UniqueID: UniqueIDOptions;
36
+ OAiBlock: AiBlockOptions;
37
+ OAudio: AudioOptions;
38
+ OBlockMath: BlockMathOptions;
39
+ OColon: {
40
+ suggestion?: any;
41
+ HTMLAttributes?: Record<string, any>;
42
+ };
43
+ OSlash: {
44
+ suggestion?: any;
45
+ HTMLAttributes?: Record<string, any>;
46
+ };
47
+ OSlashZh: {
48
+ suggestion?: any;
49
+ HTMLAttributes?: Record<string, any>;
50
+ };
51
+ OBlockquote: OBlockquoteOptions;
52
+ OCallout: CalloutOptions;
53
+ OCodeBlock: OCodeBlockOptions;
54
+ OColorHighlighter: any;
55
+ OHorizontalRule: HorizontalRuleOptions;
56
+ OImage: ImageOptions;
57
+ OInlinePlaceholder: {
58
+ char?: string;
59
+ HTMLAttributes?: Record<string, any>;
60
+ };
61
+ OLink: LinkOptions;
62
+ OMultiColumn: MultiColumnOptions;
63
+ OColumnDropCursor: ColumnDropCursorOptions;
64
+ OShortcut: ShortcutOptions;
65
+ OSelectionDecoration: any;
66
+ OVideo: {
67
+ allowFullscreen?: boolean;
68
+ HTMLAttributes?: Record<string, any>;
69
+ };
70
+ ODetails: ODetailsOptions;
71
+ OTable: {
72
+ resizable?: boolean;
73
+ handleWidth?: number;
74
+ cellMinWidth?: number;
75
+ HTMLAttributes?: Record<string, any>;
76
+ };
77
+ [key: string]: any;
78
+ }
79
+ /**
80
+ * Extension Factory Registry
81
+ * Stores functions that return a configured extension instance
82
+ */
83
+ export declare const extensionRegistry: {
84
+ [K in keyof ExtensionOptions]?: ExtensionFactory<K>;
85
+ };
86
+ /**
87
+ * Derived Types for IntelliSense
88
+ */
89
+ export type ExtensionName = keyof typeof extensionRegistry;
90
+ /**
91
+ * A unified structure combining Name and its specific Config
92
+ */
93
+ export type ExtensionItem<T extends ExtensionName = ExtensionName> = {
94
+ name: T;
95
+ configure?: T extends keyof ExtensionOptions ? Partial<ExtensionOptions[T]> : any;
96
+ };
97
+ /**
98
+ * Custom Type Guard to check if an item is a Tiptap Extension instance
99
+ */
100
+ export declare const isExtensionInstance: (item: any) => item is AnyExtension;
101
+ /**
102
+ * Create a single extension from a unified item object
103
+ * @param item - An object containing both name and optional config
104
+ */
105
+ export declare const createExtension: <T extends ExtensionName>(item: ExtensionItem<T>) => AnyExtension | AnyExtension[];
106
+ /**
107
+ * Create a flattened list from a mix of names and configured items
108
+ * Allows passing either a simple string or a full { name, configure } object
109
+ */
110
+ export declare const createExtensionList: (items: (ExtensionName | ExtensionItem)[]) => AnyExtension[];
111
+ export {};
@@ -1,2 +1,4 @@
1
- declare const OHorizontalRule: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
1
+ import { type HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
2
+ declare const OHorizontalRule: import("@tiptap/core").Node<HorizontalRuleOptions, any>;
2
3
  export default OHorizontalRule;
4
+ export type { HorizontalRuleOptions };
@@ -1,51 +1,3 @@
1
- import { Focus } from '@tiptap/extensions';
2
- import { Details, DetailsContent, DetailsSummary } from '@tiptap/extension-details';
3
- import { TaskItem, TaskList } from '@tiptap/extension-list';
4
- import { BlockMath, InlineMath } from '@tiptap/extension-mathematics';
5
- import { Table, TableRow, TableCell, TableHeader } from '@tiptap/extension-table';
6
- import { BackgroundColor, Color, FontFamily, TextStyle } from '@tiptap/extension-text-style';
7
- import { Markdown } from '@tiptap/markdown';
8
- import Highlight from '@tiptap/extension-highlight';
9
- import Emoji from '@tiptap/extension-emoji';
10
- import Image from '@tiptap/extension-image';
11
- import Link from '@tiptap/extension-link';
12
- import Mention from '@tiptap/extension-mention';
13
- import Subscript from '@tiptap/extension-subscript';
14
- import Superscript from '@tiptap/extension-superscript';
15
- import TextAlign from '@tiptap/extension-text-align';
16
- import Typography from '@tiptap/extension-typography';
17
- import Underline from '@tiptap/extension-underline';
18
- import UniqueID from '@tiptap/extension-unique-id';
19
- import OColorHighlighter from '@yiitap/extension-color-highlighter';
20
- import OFocus from '@yiitap/extension-focus';
21
- import OInlinePlaceholder from '@yiitap/extension-inline-placeholder';
22
- import OPlaceholder from '@yiitap/extension-placeholder';
23
- import OSelectionDecoration from '@yiitap/extension-selection-decoration';
24
- import OShortcut from '@yiitap/extension-shortcut';
25
- import OTable from '@yiitap/extension-table';
26
- import OTaskItem from '@yiitap/extension-task-item';
27
- import OCharCommand from '@yiitap/extension-char-command';
28
- import { ColonCommand as OColonCommand, SlashCommand as OSlashCommand, SlashZhCommand as OSlashZhCommand } from '@yiitap/extension-char-command';
29
- import OAiBlock from './ai-block';
30
- import OBlockMath from './block-math';
31
- import OBlockquote from './blockquote';
32
- import OCallout from './callout';
33
- import OCodeBlock from './code-block';
34
- import ODetails from './details';
35
- import OHeading from './heading';
36
- import OHorizontalRule from './horizontal-rule';
37
- import OImage from './image';
38
- import OLink from './link';
39
- import OParagraph from './paragraph';
40
- import OTableCell from './table-cell';
41
- import OTableHeader from './table-header';
42
- import OTableWrapper from './table-wrapper';
43
- import OVideo from './video';
44
- /**
45
- * Enable by default
46
- */
47
- export declare const DefaultExtensionNames: string[];
48
- export declare const TiptapExtensionNames: string[];
49
- export declare const YiitapExtensionNames: string[];
50
- export declare const BuiltinExtensionNames: string[];
51
- export { BackgroundColor, BlockMath, Color, Details, DetailsContent, DetailsSummary, Emoji, Focus, FontFamily, Highlight, Image, InlineMath, Link, Markdown, Mention, Subscript, Superscript, Table, TableHeader, TableCell, TableRow, TaskItem, TaskList, TextAlign, TextStyle, Typography, Underline, UniqueID, OAiBlock, OBlockMath, OBlockquote, OCallout, OCharCommand, OCodeBlock, OColonCommand, OColorHighlighter, ODetails, OFocus, OInlinePlaceholder, OHeading, OHorizontalRule, OImage, OLink, OParagraph, OPlaceholder, OSelectionDecoration, OShortcut, OSlashCommand, OSlashZhCommand, OTable, OTableCell, OTableHeader, OTableWrapper, OTaskItem, OVideo, };
1
+ export * from './extensions';
2
+ export * from './factory';
3
+ export * from './starter-kit';
@@ -0,0 +1,13 @@
1
+ import { EditorState } from '@tiptap/pm/state';
2
+ import { DecorationSet, EditorView } from '@tiptap/pm/view';
3
+ export declare function handleMouseMove(view: any, event: any, handleWidth: any): boolean;
4
+ export declare function handleMouseLeave(view: EditorView): boolean;
5
+ /**
6
+ * Handles the mousedown event to initialize the resizing process.
7
+ * @param {EditorView} view - The ProseMirror editor view.
8
+ * @param {MouseEvent} event - The native mouse event.
9
+ * @param {number} minFlex - The minimum flex-grow value allowed for a column.
10
+ */
11
+ export declare function handleMouseDown(view: EditorView, event: MouseEvent, minFlex?: number): boolean;
12
+ export declare function handleGridDecorations(state: EditorState, boundaryPos: number): DecorationSet;
13
+ export declare function handleMouseUp(view: EditorView, event: MouseEvent): boolean;
@@ -0,0 +1,3 @@
1
+ import { type Command } from '@tiptap/pm/state';
2
+ export declare const liftEmptyBlock: Command;
3
+ export declare const columnsKeymap: import("@tiptap/pm/state").Plugin<any>;
@@ -0,0 +1,3 @@
1
+ import type { NodeSpec } from '@tiptap/pm/model';
2
+ export type ColumnNodes = Record<'column' | 'columns', NodeSpec>;
3
+ export declare function columnNodes(): ColumnNodes;
@@ -0,0 +1,16 @@
1
+ import { PluginKey } from '@tiptap/pm/state';
2
+ export declare const gridResizingPluginKey: PluginKey<GridResizeState>;
3
+ export type Dragging = {
4
+ startX: number;
5
+ startFlex: number;
6
+ nextColFlex: number | null;
7
+ nextColPos: number | null;
8
+ totalFlex: number;
9
+ containerWidth: number;
10
+ };
11
+ export declare class GridResizeState {
12
+ activeHandle: number;
13
+ dragging: Dragging | null;
14
+ constructor(activeHandle: number, dragging: Dragging | null);
15
+ apply(tr: any): GridResizeState;
16
+ }
@@ -0,0 +1,5 @@
1
+ import { Node } from '@tiptap/core';
2
+ export interface ColumnContainerOptions {
3
+ HTMLAttributes: Record<string, any>;
4
+ }
5
+ export declare const ColumnContainer: Node<ColumnContainerOptions, any>;
@@ -0,0 +1,5 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export interface ColumnDropCursorOptions {
3
+ HTMLAttributes: Record<string, any>;
4
+ }
5
+ export declare const ColumnDropCursor: Extension<ColumnDropCursorOptions, any>;
@@ -0,0 +1,5 @@
1
+ import { Node } from '@tiptap/core';
2
+ export interface ColumnOptions {
3
+ HTMLAttributes: Record<string, any>;
4
+ }
5
+ export declare const Column: Node<ColumnOptions, any>;
@@ -0,0 +1,20 @@
1
+ import { Extension } from '@tiptap/core';
2
+ export interface MultiColumnOptions {
3
+ HTMLAttributes: Record<string, any>;
4
+ }
5
+ /**
6
+ * Define the structure for the insertMultiColumn command.
7
+ * Default: Creates a container with 2 columns, each containing 1 paragraph.
8
+ */
9
+ declare module '@tiptap/core' {
10
+ interface Commands<ReturnType> {
11
+ multiColumn: {
12
+ /**
13
+ * Insert a multi-column layout.
14
+ * @param num - Number of columns (default: 2)
15
+ */
16
+ insertMultiColumn: (num?: number) => ReturnType;
17
+ };
18
+ }
19
+ }
20
+ export declare const MultiColumn: Extension<MultiColumnOptions, any>;
@@ -0,0 +1,4 @@
1
+ export * from './extensions/column';
2
+ export * from './extensions/column-container';
3
+ export * from './extensions/column-dropcursor';
4
+ export * from './extensions/multi-column';
@@ -0,0 +1,6 @@
1
+ import { Plugin } from '@tiptap/pm/state';
2
+ import { GridResizeState } from '../core/state';
3
+ export declare function gridResizingPlugin(options?: {
4
+ handleWidth?: number;
5
+ minColumnFlex?: number;
6
+ }): Plugin<GridResizeState>;
@@ -0,0 +1,15 @@
1
+ import { EditorView } from '@tiptap/pm/view';
2
+ export declare function findBoundaryPosition(view: EditorView, event: MouseEvent, handleWidth: number): number;
3
+ /**
4
+ * 更新节点的 flexGrow 属性
5
+ */
6
+ export declare function updateColumnNodeFlex(view: any, pos: any, flex: any): void;
7
+ /**
8
+ * 获取当前位置的列信息
9
+ */
10
+ export declare function getColumnInfoAtPos(view: EditorView, boundaryPos: number): {
11
+ $pos: import("@tiptap/pm/model").ResolvedPos;
12
+ node: import("@tiptap/pm/model").Node;
13
+ columnEl: HTMLElement;
14
+ domWidth: number;
15
+ };
@@ -1,2 +1,4 @@
1
- declare const OParagraph: import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
1
+ import { type ParagraphOptions } from '@tiptap/extension-paragraph';
2
+ declare const OParagraph: import("@tiptap/core").Node<ParagraphOptions, any>;
2
3
  export default OParagraph;
4
+ export type { ParagraphOptions };
@@ -44,6 +44,15 @@ export type NodeInfo = {
44
44
  node: Node | null;
45
45
  pos: number;
46
46
  };
47
+ /**
48
+ * Get top level node
49
+ * @param coords
50
+ * @param editor
51
+ */
52
+ export declare function getTopNodeFromCoords(coords: {
53
+ left: number;
54
+ top: number;
55
+ }, editor: Editor): NodeInfo;
47
56
  export declare function getNodeFromCoords(coords: {
48
57
  left: number;
49
58
  top: number;
@@ -0,0 +1,20 @@
1
+ import { type ExtensionName, type ExtensionOptions } from './factory';
2
+ import { type AnyExtension } from './extensions';
3
+ /**
4
+ * Options for the custom StarterKit.
5
+ * Allows users to pass configuration objects for each extension,
6
+ * or set them to false to disable specific features.
7
+ */
8
+ export type StarterKitOptions = {
9
+ [K in ExtensionName]?: ExtensionOptions[K] | false;
10
+ };
11
+ /**
12
+ * StarterKit implementation
13
+ * This function returns a flattened array of extensions based on your DefaultExtensionNames.
14
+ */
15
+ export declare const OStarterKit: {
16
+ /**
17
+ * Configure and return the default suite of extensions
18
+ */
19
+ configure(options?: StarterKitOptions): AnyExtension[];
20
+ };
package/types/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export { YiiEditor, YiiEditorPlugin };
9
9
  export * from './components';
10
10
  export * from './constants';
11
11
  export * from './hooks';
12
+ export * from './extensions';