@toantranmei/editor 0.0.0-stage → 0.1.1
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.
- package/LICENSE +21 -0
- package/README.md +363 -2
- package/dist/css-CaicG2fA.js +580 -0
- package/dist/css-CaicG2fA.js.map +1 -0
- package/dist/index.js +6481 -0
- package/dist/index.js.map +1 -0
- package/dist/nuxt.js +78 -0
- package/dist/nuxt.js.map +1 -0
- package/dist/style.css +2 -0
- package/dist/types/block-items.d.ts +38 -0
- package/dist/types/block-names.d.ts +5 -0
- package/dist/types/block-ops.d.ts +66 -0
- package/dist/types/blocks/advanced.d.ts +7 -0
- package/dist/types/blocks/basic.d.ts +10 -0
- package/dist/types/blocks/extras.d.ts +23 -0
- package/dist/types/blocks/index.d.ts +13 -0
- package/dist/types/blocks/media.d.ts +3 -0
- package/dist/types/colors.d.ts +3 -0
- package/dist/types/components/BlockMenu.vue.d.ts +16 -0
- package/dist/types/components/ColorList.vue.d.ts +37 -0
- package/dist/types/components/DatePicker.vue.d.ts +22 -0
- package/dist/types/components/EmojiMenu.vue.d.ts +13 -0
- package/dist/types/components/FormatMenu.vue.d.ts +7 -0
- package/dist/types/components/ImageCropper.vue.d.ts +25 -0
- package/dist/types/components/ImageLightbox.vue.d.ts +16 -0
- package/dist/types/components/MeiEditor.vue.d.ts +72 -0
- package/dist/types/components/MeiOutline.vue.d.ts +14 -0
- package/dist/types/components/MentionMenu.vue.d.ts +13 -0
- package/dist/types/components/MermaidDiagram.vue.d.ts +9 -0
- package/dist/types/components/SlashMenu.vue.d.ts +14 -0
- package/dist/types/components/TableControls.vue.d.ts +13 -0
- package/dist/types/composables/useClickOutside.d.ts +5 -0
- package/dist/types/composables/useEditable.d.ts +7 -0
- package/dist/types/composables/useScope.d.ts +9 -0
- package/dist/types/config.d.ts +30 -0
- package/dist/types/content.d.ts +27 -0
- package/dist/types/date-utils.d.ts +38 -0
- package/dist/types/define-block.d.ts +43 -0
- package/dist/types/emoji-data.d.ts +9 -0
- package/dist/types/extensions/block-drop.d.ts +28 -0
- package/dist/types/extensions/block-id.d.ts +21 -0
- package/dist/types/extensions/block-selection.d.ts +24 -0
- package/dist/types/extensions/callout.d.ts +12 -0
- package/dist/types/extensions/code-block.d.ts +20 -0
- package/dist/types/extensions/color-marks.d.ts +24 -0
- package/dist/types/extensions/columns.d.ts +10 -0
- package/dist/types/extensions/embed.d.ts +13 -0
- package/dist/types/extensions/emoji.d.ts +5 -0
- package/dist/types/extensions/file-block.d.ts +17 -0
- package/dist/types/extensions/html-block.d.ts +39 -0
- package/dist/types/extensions/image-block.d.ts +1 -0
- package/dist/types/extensions/index.d.ts +13 -0
- package/dist/types/extensions/math.d.ts +13 -0
- package/dist/types/extensions/mention.d.ts +43 -0
- package/dist/types/extensions/mermaid.d.ts +4 -0
- package/dist/types/extensions/slash-command.d.ts +4 -0
- package/dist/types/extensions/suggestion-renderer.d.ts +11 -0
- package/dist/types/extensions/table.d.ts +1 -0
- package/dist/types/extensions/toc.d.ts +10 -0
- package/dist/types/extensions/toggle.d.ts +6 -0
- package/dist/types/extensions/unknown.d.ts +3 -0
- package/dist/types/index.d.ts +34 -0
- package/dist/types/keys.d.ts +3 -0
- package/dist/types/lazy.d.ts +12 -0
- package/dist/types/locale.d.ts +226 -0
- package/dist/types/nodeviews/CalloutView.vue.d.ts +93 -0
- package/dist/types/nodeviews/CodeBlockView.vue.d.ts +93 -0
- package/dist/types/nodeviews/EmbedView.vue.d.ts +93 -0
- package/dist/types/nodeviews/FileView.vue.d.ts +93 -0
- package/dist/types/nodeviews/HtmlView.vue.d.ts +93 -0
- package/dist/types/nodeviews/ImageView.vue.d.ts +93 -0
- package/dist/types/nodeviews/MathView.vue.d.ts +93 -0
- package/dist/types/nodeviews/MentionView.vue.d.ts +93 -0
- package/dist/types/nodeviews/TocView.vue.d.ts +93 -0
- package/dist/types/nodeviews/renderer.d.ts +12 -0
- package/dist/types/nuxt.d.ts +36 -0
- package/dist/types/plugin-key.d.ts +7 -0
- package/dist/types/plugin.d.ts +20 -0
- package/dist/types/recent.d.ts +24 -0
- package/dist/types/slash-items.d.ts +24 -0
- package/dist/types/table-ops.d.ts +32 -0
- package/dist/types/theme/css.d.ts +20 -0
- package/dist/types/theme/define.d.ts +18 -0
- package/dist/types/theme/index.d.ts +7 -0
- package/dist/types/theme/read.d.ts +5 -0
- package/dist/types/theme/tokens.d.ts +515 -0
- package/package.json +119 -3
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
editor: {
|
|
3
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
node: {
|
|
7
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
decorations: {
|
|
11
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
selected: {
|
|
15
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
extension: {
|
|
19
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
getPos: {
|
|
23
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
updateAttributes: {
|
|
27
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
deleteNode: {
|
|
31
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
view: {
|
|
35
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
36
|
+
required: true;
|
|
37
|
+
};
|
|
38
|
+
innerDecorations: {
|
|
39
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
HTMLAttributes: {
|
|
43
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
47
|
+
editor: {
|
|
48
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["editor"]>;
|
|
49
|
+
required: true;
|
|
50
|
+
};
|
|
51
|
+
node: {
|
|
52
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["node"]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
decorations: {
|
|
56
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["decorations"]>;
|
|
57
|
+
required: true;
|
|
58
|
+
};
|
|
59
|
+
selected: {
|
|
60
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["selected"]>;
|
|
61
|
+
required: true;
|
|
62
|
+
};
|
|
63
|
+
extension: {
|
|
64
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["extension"]>;
|
|
65
|
+
required: true;
|
|
66
|
+
};
|
|
67
|
+
getPos: {
|
|
68
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["getPos"]>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
updateAttributes: {
|
|
72
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["updateAttributes"]>;
|
|
73
|
+
required: true;
|
|
74
|
+
};
|
|
75
|
+
deleteNode: {
|
|
76
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["deleteNode"]>;
|
|
77
|
+
required: true;
|
|
78
|
+
};
|
|
79
|
+
view: {
|
|
80
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["view"]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
innerDecorations: {
|
|
84
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["innerDecorations"]>;
|
|
85
|
+
required: true;
|
|
86
|
+
};
|
|
87
|
+
HTMLAttributes: {
|
|
88
|
+
type: import("vue").PropType<import("@tiptap/core").NodeViewProps["HTMLAttributes"]>;
|
|
89
|
+
required: true;
|
|
90
|
+
};
|
|
91
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
92
|
+
declare const _default: typeof __VLS_export;
|
|
93
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* VueNodeViewRenderer with two fixes for block node views (image, embed, callout, code…):
|
|
4
|
+
*
|
|
5
|
+
* 1. Lets `mousemove` through from the node view's own UI. Tiptap stops those events
|
|
6
|
+
* by default, which keeps the drag handle from appearing while hovering them.
|
|
7
|
+
* 2. Skips the per-keystroke selection check while typing. Every node view listens to
|
|
8
|
+
* selection changes and calls getPos(), which scans sibling blocks — with thousands
|
|
9
|
+
* of node views that made each keystroke O(views × blocks). A plain caret can't
|
|
10
|
+
* select a node view, so it only needs checking when one is currently selected.
|
|
11
|
+
*/
|
|
12
|
+
export declare function blockNodeView(component: Component): import("@tiptap/core").NodeViewRenderer;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { NuxtModule } from '@nuxt/schema';
|
|
2
|
+
import type { ThemeTokens } from './theme/tokens';
|
|
3
|
+
import { type BlockName } from './block-names';
|
|
4
|
+
/**
|
|
5
|
+
* Bare imports in dist/index.js (everything except `vue`). Keep in sync when adding
|
|
6
|
+
* imports; `pnpm --filter @toantranmei/editor check:deps` verifies it after a build.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RUNTIME_DEPS: string[];
|
|
9
|
+
export interface ModuleOptions {
|
|
10
|
+
/** Name of the auto-registered component. */
|
|
11
|
+
componentName: string;
|
|
12
|
+
/** Add the editor stylesheet to the app automatically. */
|
|
13
|
+
css: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Pre-bundle the editor and its Tiptap/ProseMirror deps in Vite dev. Keeps a single
|
|
16
|
+
* ProseMirror instance and converts highlight.js (CommonJS). Disable only when
|
|
17
|
+
* consuming the editor's source directly (like the monorepo playground).
|
|
18
|
+
*/
|
|
19
|
+
prebundle: boolean;
|
|
20
|
+
/** Token overrides applied to every editor in the app (typed, with autocomplete). */
|
|
21
|
+
tokens?: ThemeTokens;
|
|
22
|
+
/**
|
|
23
|
+
* Blocks loaded by every editor without a `blocks` prop, e.g. `['default', 'math', 'toc']`.
|
|
24
|
+
* Only the listed blocks are imported. For blocks with options (`file`, `mention`), use
|
|
25
|
+
* a Nuxt plugin with `app.use(MeiEditorPlugin, { component: false, blocks: [...] })` instead.
|
|
26
|
+
*/
|
|
27
|
+
blocks?: BlockName[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Nuxt module: registers <MeiEditor> as a client-only component and adds its CSS.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* export default defineNuxtConfig({ modules: ['@toantranmei/editor/nuxt'] })
|
|
34
|
+
*/
|
|
35
|
+
declare const module: NuxtModule<ModuleOptions>;
|
|
36
|
+
export default module;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { BlockDefinition } from './define-block';
|
|
3
|
+
import type { ThemeTokens } from './theme/tokens';
|
|
4
|
+
/** App-wide token overrides provided by the Vue plugin (`app.use(MeiEditorPlugin, { tokens })`). */
|
|
5
|
+
export declare const GLOBAL_TOKENS_KEY: InjectionKey<Ref<ThemeTokens | undefined>>;
|
|
6
|
+
/** App-wide blocks provided by the Vue plugin / Nuxt module. */
|
|
7
|
+
export declare const GLOBAL_BLOCKS_KEY: InjectionKey<BlockDefinition[]>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Plugin } from 'vue';
|
|
2
|
+
import type { BlockDefinition } from './define-block';
|
|
3
|
+
import type { ThemeTokens } from './theme/tokens';
|
|
4
|
+
export interface MeiEditorPluginOptions {
|
|
5
|
+
/** Global component name. */
|
|
6
|
+
componentName?: string;
|
|
7
|
+
/** Token overrides applied to every editor in the app. */
|
|
8
|
+
tokens?: ThemeTokens;
|
|
9
|
+
/** Blocks loaded by every editor that has no `blocks` prop. */
|
|
10
|
+
blocks?: BlockDefinition[];
|
|
11
|
+
/** Register <MeiEditor> globally (set false when the Nuxt module already does). */
|
|
12
|
+
component?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Vue plugin that registers <MeiEditor> globally and sets app-wide tokens.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* app.use(MeiEditorPlugin, { tokens: { color: { accent: '#7c3aed' } } })
|
|
19
|
+
*/
|
|
20
|
+
export declare const MeiEditorPlugin: Plugin<[MeiEditorPluginOptions?]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ColorName } from './colors';
|
|
2
|
+
/** Recently used colors and blocks, shared by all editors and kept in localStorage. */
|
|
3
|
+
export interface RecentColor {
|
|
4
|
+
kind: 'text' | 'bg';
|
|
5
|
+
color: ColorName;
|
|
6
|
+
}
|
|
7
|
+
export declare const recent: import("vue").Ref<{
|
|
8
|
+
colors: {
|
|
9
|
+
kind: "text" | "bg";
|
|
10
|
+
color: ColorName;
|
|
11
|
+
}[];
|
|
12
|
+
blocks: string[];
|
|
13
|
+
}, {
|
|
14
|
+
colors: RecentColor[];
|
|
15
|
+
blocks: string[];
|
|
16
|
+
} | {
|
|
17
|
+
colors: {
|
|
18
|
+
kind: "text" | "bg";
|
|
19
|
+
color: ColorName;
|
|
20
|
+
}[];
|
|
21
|
+
blocks: string[];
|
|
22
|
+
}>;
|
|
23
|
+
export declare function pushRecentColor(entry: RecentColor): void;
|
|
24
|
+
export declare function pushRecentBlock(id: string): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
/** One row of the slash menu: a block type or a color command. */
|
|
4
|
+
export interface SlashItem {
|
|
5
|
+
key: string;
|
|
6
|
+
/** Section label shown above the row. */
|
|
7
|
+
group: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
icon?: Component;
|
|
11
|
+
swatch?: {
|
|
12
|
+
kind: 'text' | 'bg';
|
|
13
|
+
color: string;
|
|
14
|
+
};
|
|
15
|
+
shortcut?: string;
|
|
16
|
+
terms: string[];
|
|
17
|
+
/** Runs after the `/query` text has been removed. */
|
|
18
|
+
apply: (editor: Editor) => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Items for the slash menu. Without a query: recently used blocks, all blocks by group,
|
|
22
|
+
* then colors. With a query: everything ranked (exact term > word prefix > substring).
|
|
23
|
+
*/
|
|
24
|
+
export declare function slashItems(editor: Editor, query: string): SlashItem[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table operations used by the table controls (row/column handles, add buttons,
|
|
3
|
+
* cell toolbar). Rows and columns are addressed by index within a table at `tablePos`.
|
|
4
|
+
*/
|
|
5
|
+
import type { Editor } from '@tiptap/core';
|
|
6
|
+
import type { Node as PMNode } from '@tiptap/pm/model';
|
|
7
|
+
import { TableMap } from '@tiptap/pm/tables';
|
|
8
|
+
export interface TableRef {
|
|
9
|
+
pos: number;
|
|
10
|
+
node: PMNode;
|
|
11
|
+
map: TableMap;
|
|
12
|
+
}
|
|
13
|
+
export declare function tableAt(editor: Editor, pos: number): TableRef | null;
|
|
14
|
+
/** Document position of the cell at (row, col). */
|
|
15
|
+
export declare function cellPos(t: TableRef, row: number, col: number): number;
|
|
16
|
+
export declare function selectRow(editor: Editor, t: TableRef, row: number): void;
|
|
17
|
+
export declare function selectColumn(editor: Editor, t: TableRef, col: number): void;
|
|
18
|
+
export declare function insertRow(editor: Editor, t: TableRef, row: number, where: 'before' | 'after'): void;
|
|
19
|
+
export declare function insertColumn(editor: Editor, t: TableRef, col: number, where: 'before' | 'after'): void;
|
|
20
|
+
export declare function deleteRow(editor: Editor, t: TableRef, row: number): boolean | undefined;
|
|
21
|
+
export declare function deleteColumn(editor: Editor, t: TableRef, col: number): boolean | undefined;
|
|
22
|
+
export declare function moveRow(editor: Editor, t: TableRef, from: number, to: number): void;
|
|
23
|
+
export declare function moveColumn(editor: Editor, t: TableRef, from: number, to: number): void;
|
|
24
|
+
export declare function duplicateRow(editor: Editor, t: TableRef, row: number): void;
|
|
25
|
+
/** Copies a column to its right. Skips cells that span several columns. */
|
|
26
|
+
export declare function duplicateColumn(editor: Editor, t: TableRef, col: number): void;
|
|
27
|
+
/** Empties the cells of the current cell selection. */
|
|
28
|
+
export declare function clearSelectedCells(editor: Editor): void;
|
|
29
|
+
export declare function colorSelectedCells(editor: Editor, color: string | null): void;
|
|
30
|
+
export declare const hasHeaderRow: (t: TableRef) => boolean;
|
|
31
|
+
export declare const hasHeaderColumn: (t: TableRef) => boolean;
|
|
32
|
+
export declare function toggleHeader(editor: Editor, t: TableRef, kind: 'row' | 'column'): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ThemeTokens } from './tokens';
|
|
2
|
+
/** CSS cascade layer for all library styles; app CSS outside layers always wins. */
|
|
3
|
+
export declare const LAYER = "mei-editor";
|
|
4
|
+
/**
|
|
5
|
+
* Layer order declared wherever library CSS loads. Whichever sheet the browser sees
|
|
6
|
+
* first fixes the order, so every entry point repeats it: resets (`base`, e.g.
|
|
7
|
+
* Tailwind preflight) lose to the editor, while app `components`/`utilities` win.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LAYER_ORDER = "@layer theme, base, mei-editor, components, utilities;";
|
|
10
|
+
/** Default tokens (light + dark) plus palette mappings, generated from tokens.ts. */
|
|
11
|
+
export declare function baseTokensCss(): string;
|
|
12
|
+
/**
|
|
13
|
+
* CSS that applies token overrides to every editor matching `scope`
|
|
14
|
+
* (unlayered, so it beats the defaults). Returns '' when there is nothing to override.
|
|
15
|
+
*/
|
|
16
|
+
export declare function overridesCss(tokens: ThemeTokens | undefined, scope?: string): string;
|
|
17
|
+
/** Adds or replaces a <style> tag in <head>. Pass empty css to remove it. */
|
|
18
|
+
export declare function injectStyle(id: string, css: string): void;
|
|
19
|
+
/** Injects the default tokens once per document. */
|
|
20
|
+
export declare function installBaseTokens(): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Helpers to turn token objects into CSS custom properties. No values live here. */
|
|
2
|
+
export interface TokenTree {
|
|
3
|
+
[key: string]: string | TokenTree;
|
|
4
|
+
}
|
|
5
|
+
export type DeepPartial<T> = {
|
|
6
|
+
[K in keyof T]?: T[K] extends string ? string : DeepPartial<T[K]>;
|
|
7
|
+
};
|
|
8
|
+
/** Loosens literal string types so token objects can be compared/overridden. */
|
|
9
|
+
export type Widen<T> = {
|
|
10
|
+
[K in keyof T]: T[K] extends string ? string : Widen<T[K]>;
|
|
11
|
+
};
|
|
12
|
+
/** `'menu.itemHeight'` → `'--me-menu-item-height'` */
|
|
13
|
+
export declare const cssVar: (path: string) => string;
|
|
14
|
+
/** Reference another token: `ref('color.text')` → `'var(--me-color-text)'` */
|
|
15
|
+
export declare const ref: (path: string) => string;
|
|
16
|
+
/** Flattens a token tree into `[cssVarName, value]` pairs. */
|
|
17
|
+
export declare function flatten(tree: TokenTree, prefix?: string): [string, string][];
|
|
18
|
+
export declare const declarations: (pairs: [string, string][]) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { component, PALETTE_NAMES, primitive, semanticBase, semanticDark, semanticLight, type PaletteName, type ThemeTokens } from './tokens';
|
|
2
|
+
export { baseTokensCss, installBaseTokens, injectStyle, LAYER, overridesCss } from './css';
|
|
3
|
+
export { cssVar, ref } from './define';
|
|
4
|
+
/** Light / dark mode of an editor. `auto` follows `<html class="dark">`. */
|
|
5
|
+
export type ThemeMode = 'light' | 'dark' | 'auto';
|
|
6
|
+
/** Identity helper for typed token overrides: `defineTokens({ color: { accent: '#7c3aed' } })`. */
|
|
7
|
+
export declare const defineTokens: <T extends import("./tokens").ThemeTokens>(tokens: T) => T;
|