@doist/typist 10.0.0-next.1 → 10.0.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.
- package/CHANGELOG.md +12 -0
- package/dist/components/typist-editor.d.ts +126 -123
- package/dist/components/typist-editor.d.ts.map +1 -1
- package/dist/components/typist-editor.helper.d.ts +8 -11
- package/dist/components/typist-editor.helper.d.ts.map +1 -1
- package/dist/components/typist-editor.helper.js +21 -19
- package/dist/components/typist-editor.helper.js.map +1 -0
- package/dist/components/typist-editor.js +133 -135
- package/dist/components/typist-editor.js.map +1 -0
- package/dist/constants/common.js +9 -5
- package/dist/constants/common.js.map +1 -0
- package/dist/constants/extension-priorities.d.ts +3 -1
- package/dist/constants/extension-priorities.d.ts.map +1 -1
- package/dist/constants/extension-priorities.js +34 -30
- package/dist/constants/extension-priorities.js.map +1 -0
- package/dist/constants/regular-expressions.js +14 -10
- package/dist/constants/regular-expressions.js.map +1 -0
- package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts +12 -9
- package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts.map +1 -1
- package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js +16 -19
- package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js.map +1 -0
- package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts +12 -9
- package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts.map +1 -1
- package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js +25 -28
- package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js.map +1 -0
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts +24 -22
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts.map +1 -1
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js +34 -36
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js.map +1 -0
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts +23 -20
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts.map +1 -1
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js +15 -8
- package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js.map +1 -0
- package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js +22 -18
- package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js.map +1 -0
- package/dist/extensions/core/view-event-handlers.d.ts +14 -13
- package/dist/extensions/core/view-event-handlers.d.ts.map +1 -1
- package/dist/extensions/core/view-event-handlers.js +33 -31
- package/dist/extensions/core/view-event-handlers.js.map +1 -0
- package/dist/extensions/plain-text/paste-multiline-text.js +45 -59
- package/dist/extensions/plain-text/paste-multiline-text.js.map +1 -0
- package/dist/extensions/plain-text/plain-text-document.d.ts +7 -7
- package/dist/extensions/plain-text/plain-text-document.d.ts.map +1 -1
- package/dist/extensions/plain-text/plain-text-document.js +14 -13
- package/dist/extensions/plain-text/plain-text-document.js.map +1 -0
- package/dist/extensions/plain-text/plain-text-kit.d.ts +35 -33
- package/dist/extensions/plain-text/plain-text-kit.d.ts.map +1 -1
- package/dist/extensions/plain-text/plain-text-kit.js +33 -48
- package/dist/extensions/plain-text/plain-text-kit.js.map +1 -0
- package/dist/extensions/plain-text/plain-text-paragraph.d.ts +2 -9
- package/dist/extensions/plain-text/plain-text-paragraph.js +11 -11
- package/dist/extensions/plain-text/plain-text-paragraph.js.map +1 -0
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js +37 -81
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js.map +1 -0
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js +32 -42
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js.map +1 -0
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js +24 -37
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js.map +1 -0
- package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js +21 -13
- package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js.map +1 -0
- package/dist/extensions/rich-text/bold-and-italics.js +42 -40
- package/dist/extensions/rich-text/bold-and-italics.js.map +1 -0
- package/dist/extensions/rich-text/curvenote-codemark.js +16 -14
- package/dist/extensions/rich-text/curvenote-codemark.js.map +1 -0
- package/dist/extensions/rich-text/paste-emojis.js +20 -22
- package/dist/extensions/rich-text/paste-emojis.js.map +1 -0
- package/dist/extensions/rich-text/paste-markdown.js +46 -86
- package/dist/extensions/rich-text/paste-markdown.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-bullet-list.d.ts +10 -9
- package/dist/extensions/rich-text/rich-text-bullet-list.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-bullet-list.js +42 -56
- package/dist/extensions/rich-text/rich-text-bullet-list.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-code.js +34 -34
- package/dist/extensions/rich-text/rich-text-code.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-document.d.ts +7 -7
- package/dist/extensions/rich-text/rich-text-document.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-document.js +14 -13
- package/dist/extensions/rich-text/rich-text-document.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-heading.d.ts +5 -4
- package/dist/extensions/rich-text/rich-text-heading.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-heading.js +25 -25
- package/dist/extensions/rich-text/rich-text-heading.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-image.d.ts +53 -52
- package/dist/extensions/rich-text/rich-text-image.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-image.js +88 -105
- package/dist/extensions/rich-text/rich-text-image.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-kit.d.ts +127 -125
- package/dist/extensions/rich-text/rich-text-kit.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-kit.js +73 -135
- package/dist/extensions/rich-text/rich-text-kit.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-link.d.ts +5 -4
- package/dist/extensions/rich-text/rich-text-link.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-link.js +82 -90
- package/dist/extensions/rich-text/rich-text-link.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-ordered-list.d.ts +10 -9
- package/dist/extensions/rich-text/rich-text-ordered-list.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-ordered-list.js +42 -56
- package/dist/extensions/rich-text/rich-text-ordered-list.js.map +1 -0
- package/dist/extensions/rich-text/rich-text-strikethrough.d.ts +5 -4
- package/dist/extensions/rich-text/rich-text-strikethrough.d.ts.map +1 -1
- package/dist/extensions/rich-text/rich-text-strikethrough.js +10 -10
- package/dist/extensions/rich-text/rich-text-strikethrough.js.map +1 -0
- package/dist/extensions/shared/copy-markdown-source.js +22 -31
- package/dist/extensions/shared/copy-markdown-source.js.map +1 -0
- package/dist/extensions/shared/paste-html-table-as-string.js +47 -60
- package/dist/extensions/shared/paste-html-table-as-string.js.map +1 -0
- package/dist/extensions/shared/paste-singleline-text.js +31 -39
- package/dist/extensions/shared/paste-singleline-text.js.map +1 -0
- package/dist/factories/create-suggestion-extension.d.ts +74 -74
- package/dist/factories/create-suggestion-extension.d.ts.map +1 -1
- package/dist/factories/create-suggestion-extension.js +139 -161
- package/dist/factories/create-suggestion-extension.js.map +1 -0
- package/dist/helpers/dom.js +9 -5
- package/dist/helpers/dom.js.map +1 -0
- package/dist/helpers/schema.d.ts +5 -3
- package/dist/helpers/schema.d.ts.map +1 -1
- package/dist/helpers/schema.js +25 -21
- package/dist/helpers/schema.js.map +1 -0
- package/dist/helpers/serializer.js +24 -28
- package/dist/helpers/serializer.js.map +1 -0
- package/dist/helpers/unified.js +24 -17
- package/dist/helpers/unified.js.map +1 -0
- package/dist/hooks/use-editor.js +50 -53
- package/dist/hooks/use-editor.js.map +1 -0
- package/dist/index.d.ts +25 -31
- package/dist/index.js +24 -24
- package/dist/serializers/html/html.d.ts +12 -10
- package/dist/serializers/html/html.d.ts.map +1 -1
- package/dist/serializers/html/html.js +67 -127
- package/dist/serializers/html/html.js.map +1 -0
- package/dist/serializers/html/plugins/rehype-code-block.js +17 -17
- package/dist/serializers/html/plugins/rehype-code-block.js.map +1 -0
- package/dist/serializers/html/plugins/rehype-image.js +20 -30
- package/dist/serializers/html/plugins/rehype-image.js.map +1 -0
- package/dist/serializers/html/plugins/rehype-suggestions.js +31 -32
- package/dist/serializers/html/plugins/rehype-suggestions.js.map +1 -0
- package/dist/serializers/html/plugins/rehype-task-list.js +31 -32
- package/dist/serializers/html/plugins/rehype-task-list.js.map +1 -0
- package/dist/serializers/html/plugins/remark-autolink-literal.d.ts +4 -1
- package/dist/serializers/html/plugins/remark-autolink-literal.d.ts.map +1 -1
- package/dist/serializers/html/plugins/remark-autolink-literal.js +25 -21
- package/dist/serializers/html/plugins/remark-autolink-literal.js.map +1 -0
- package/dist/serializers/html/plugins/remark-disable-constructs.js +21 -41
- package/dist/serializers/html/plugins/remark-disable-constructs.js.map +1 -0
- package/dist/serializers/html/plugins/remark-strikethrough.d.ts +5 -2
- package/dist/serializers/html/plugins/remark-strikethrough.d.ts.map +1 -1
- package/dist/serializers/html/plugins/remark-strikethrough.js +25 -21
- package/dist/serializers/html/plugins/remark-strikethrough.js.map +1 -0
- package/dist/serializers/markdown/markdown.d.ts +13 -12
- package/dist/serializers/markdown/markdown.d.ts.map +1 -1
- package/dist/serializers/markdown/markdown.js +78 -154
- package/dist/serializers/markdown/markdown.js.map +1 -0
- package/dist/serializers/markdown/plugins/image.js +27 -24
- package/dist/serializers/markdown/plugins/image.js.map +1 -0
- package/dist/serializers/markdown/plugins/list-item.js +32 -37
- package/dist/serializers/markdown/plugins/list-item.js.map +1 -0
- package/dist/serializers/markdown/plugins/paragraph.js +19 -19
- package/dist/serializers/markdown/plugins/paragraph.js.map +1 -0
- package/dist/serializers/markdown/plugins/strikethrough.js +23 -19
- package/dist/serializers/markdown/plugins/strikethrough.js.map +1 -0
- package/dist/serializers/markdown/plugins/suggestion.js +21 -19
- package/dist/serializers/markdown/plugins/suggestion.js.map +1 -0
- package/dist/serializers/markdown/plugins/task-item.js +31 -35
- package/dist/serializers/markdown/plugins/task-item.js.map +1 -0
- package/dist/utilities/can-insert-node-at.d.ts +12 -5
- package/dist/utilities/can-insert-node-at.d.ts.map +1 -1
- package/dist/utilities/can-insert-node-at.js +10 -8
- package/dist/utilities/can-insert-node-at.js.map +1 -0
- package/dist/utilities/can-insert-suggestion.d.ts +11 -5
- package/dist/utilities/can-insert-suggestion.d.ts.map +1 -1
- package/dist/utilities/can-insert-suggestion.js +15 -12
- package/dist/utilities/can-insert-suggestion.js.map +1 -0
- package/package.json +4 -3
- package/dist/constants/common.d.ts +0 -10
- package/dist/constants/common.d.ts.map +0 -1
- package/dist/constants/regular-expressions.d.ts +0 -18
- package/dist/constants/regular-expressions.d.ts.map +0 -1
- package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts +0 -9
- package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts.map +0 -1
- package/dist/extensions/plain-text/paste-multiline-text.d.ts +0 -10
- package/dist/extensions/plain-text/paste-multiline-text.d.ts.map +0 -1
- package/dist/extensions/plain-text/plain-text-paragraph.d.ts.map +0 -1
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts +0 -9
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts.map +0 -1
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts +0 -9
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts.map +0 -1
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts +0 -9
- package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts.map +0 -1
- package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts +0 -8
- package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts.map +0 -1
- package/dist/extensions/rich-text/bold-and-italics.d.ts +0 -8
- package/dist/extensions/rich-text/bold-and-italics.d.ts.map +0 -1
- package/dist/extensions/rich-text/curvenote-codemark.d.ts +0 -11
- package/dist/extensions/rich-text/curvenote-codemark.d.ts.map +0 -1
- package/dist/extensions/rich-text/paste-emojis.d.ts +0 -9
- package/dist/extensions/rich-text/paste-emojis.d.ts.map +0 -1
- package/dist/extensions/rich-text/paste-markdown.d.ts +0 -11
- package/dist/extensions/rich-text/paste-markdown.d.ts.map +0 -1
- package/dist/extensions/rich-text/rich-text-code.d.ts +0 -17
- package/dist/extensions/rich-text/rich-text-code.d.ts.map +0 -1
- package/dist/extensions/shared/copy-markdown-source.d.ts +0 -20
- package/dist/extensions/shared/copy-markdown-source.d.ts.map +0 -1
- package/dist/extensions/shared/paste-html-table-as-string.d.ts +0 -20
- package/dist/extensions/shared/paste-html-table-as-string.d.ts.map +0 -1
- package/dist/extensions/shared/paste-singleline-text.d.ts +0 -10
- package/dist/extensions/shared/paste-singleline-text.d.ts.map +0 -1
- package/dist/helpers/dom.d.ts +0 -8
- package/dist/helpers/dom.d.ts.map +0 -1
- package/dist/helpers/serializer.d.ts +0 -21
- package/dist/helpers/serializer.d.ts.map +0 -1
- package/dist/helpers/unified.d.ts +0 -21
- package/dist/helpers/unified.d.ts.map +0 -1
- package/dist/hooks/use-editor.d.ts +0 -19
- package/dist/hooks/use-editor.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/serializers/html/plugins/rehype-code-block.d.ts +0 -10
- package/dist/serializers/html/plugins/rehype-code-block.d.ts.map +0 -1
- package/dist/serializers/html/plugins/rehype-image.d.ts +0 -11
- package/dist/serializers/html/plugins/rehype-image.d.ts.map +0 -1
- package/dist/serializers/html/plugins/rehype-suggestions.d.ts +0 -10
- package/dist/serializers/html/plugins/rehype-suggestions.d.ts.map +0 -1
- package/dist/serializers/html/plugins/rehype-task-list.d.ts +0 -7
- package/dist/serializers/html/plugins/rehype-task-list.d.ts.map +0 -1
- package/dist/serializers/html/plugins/remark-disable-constructs.d.ts +0 -11
- package/dist/serializers/html/plugins/remark-disable-constructs.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/image.d.ts +0 -12
- package/dist/serializers/markdown/plugins/image.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/list-item.d.ts +0 -14
- package/dist/serializers/markdown/plugins/list-item.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/paragraph.d.ts +0 -13
- package/dist/serializers/markdown/plugins/paragraph.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/strikethrough.d.ts +0 -13
- package/dist/serializers/markdown/plugins/strikethrough.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/suggestion.d.ts +0 -11
- package/dist/serializers/markdown/plugins/suggestion.d.ts.map +0 -1
- package/dist/serializers/markdown/plugins/task-item.d.ts +0 -14
- package/dist/serializers/markdown/plugins/task-item.d.ts.map +0 -1
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ListItem } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { Fragment, Slice } from "@tiptap/pm/model";
|
|
2
|
+
import { ListItem } from "@tiptap/extension-list-item";
|
|
3
|
+
import { BulletList } from "@tiptap/extension-bullet-list";
|
|
4
|
+
import { TextStyle } from "@tiptap/extension-text-style";
|
|
5
|
+
//#region src/extensions/rich-text/rich-text-bullet-list.ts
|
|
5
6
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
* Custom extension that extends the built-in `BulletList` extension to add an option for smart
|
|
8
|
+
* toggling, which takes into account hard breaks in the selection, and converts them into
|
|
9
|
+
* paragraphs before toggling the selection into a bullet list.
|
|
10
|
+
*/
|
|
10
11
|
const RichTextBulletList = BulletList.extend({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
schema.nodes.paragraph.create(),
|
|
42
|
-
schema.nodes.paragraph.create(),
|
|
43
|
-
])));
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
// Toggle the selection into a bullet list, optionally keeping attributes
|
|
47
|
-
// (this is a verbatim copy of the built-in `toggleBulletList` command)
|
|
48
|
-
if (options.keepAttributes) {
|
|
49
|
-
return chain()
|
|
50
|
-
.toggleList(name, options.itemTypeName, options.keepMarks)
|
|
51
|
-
.updateAttributes(ListItem.name, editor.getAttributes(TextStyle.name))
|
|
52
|
-
.run();
|
|
53
|
-
}
|
|
54
|
-
return commands.toggleList(name, options.itemTypeName, options.keepMarks);
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
},
|
|
12
|
+
addOptions() {
|
|
13
|
+
return {
|
|
14
|
+
...this.parent?.(),
|
|
15
|
+
smartToggle: false
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
addCommands() {
|
|
19
|
+
const { editor, name, options } = this;
|
|
20
|
+
return {
|
|
21
|
+
...this.parent?.(),
|
|
22
|
+
toggleBulletList() {
|
|
23
|
+
return ({ commands, state, tr, chain }) => {
|
|
24
|
+
if (options.smartToggle) {
|
|
25
|
+
const { schema } = state;
|
|
26
|
+
const { selection } = tr;
|
|
27
|
+
const { $from, $to } = selection;
|
|
28
|
+
const hardBreakPositions = [];
|
|
29
|
+
tr.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
|
|
30
|
+
if (node.type.name === "hardBreak") hardBreakPositions.push(pos);
|
|
31
|
+
});
|
|
32
|
+
hardBreakPositions.reverse().forEach((pos) => {
|
|
33
|
+
tr.replace(pos, pos + 1, Slice.maxOpen(Fragment.fromArray([schema.nodes.paragraph.create(), schema.nodes.paragraph.create()])));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (options.keepAttributes) return chain().toggleList(name, options.itemTypeName, options.keepMarks).updateAttributes(ListItem.name, editor.getAttributes(TextStyle.name)).run();
|
|
37
|
+
return commands.toggleList(name, options.itemTypeName, options.keepMarks);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
59
42
|
});
|
|
43
|
+
//#endregion
|
|
60
44
|
export { RichTextBulletList };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=rich-text-bullet-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-bullet-list.js","names":[],"sources":["../../../src/extensions/rich-text/rich-text-bullet-list.ts"],"sourcesContent":["import { BulletList } from '@tiptap/extension-bullet-list'\nimport { ListItem } from '@tiptap/extension-list-item'\nimport { TextStyle } from '@tiptap/extension-text-style'\nimport { Fragment, Slice } from '@tiptap/pm/model'\n\nimport type { BulletListOptions } from '@tiptap/extension-bullet-list'\n\n/**\n * The options available to customize the `RichTextBulletList` extension.\n */\ntype RichTextBulletListOptions = {\n /**\n * Replace hard breaks in the selection with paragraphs before toggling the selection into a\n * bullet list. By default, hard breaks are not replaced.\n */\n smartToggle: boolean\n} & BulletListOptions\n\n/**\n * Custom extension that extends the built-in `BulletList` extension to add an option for smart\n * toggling, which takes into account hard breaks in the selection, and converts them into\n * paragraphs before toggling the selection into a bullet list.\n */\nconst RichTextBulletList = BulletList.extend<RichTextBulletListOptions>({\n addOptions() {\n return {\n ...this.parent?.(),\n smartToggle: false,\n }\n },\n\n addCommands() {\n const { editor, name, options } = this\n\n return {\n ...this.parent?.(),\n toggleBulletList() {\n return ({ commands, state, tr, chain }) => {\n // Replace hard breaks in the selection with paragraphs before toggling?\n if (options.smartToggle) {\n const { schema } = state\n const { selection } = tr\n const { $from, $to } = selection\n\n const hardBreakPositions: number[] = []\n\n // Find and store the positions of all hard breaks in the selection\n tr.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {\n if (node.type.name === 'hardBreak') {\n hardBreakPositions.push(pos)\n }\n })\n\n // Replace each hard break with a slice that closes and re-opens a paragraph,\n // effectively inserting a \"paragraph break\" in place of a \"hard break\"\n // (this is performed in reverse order to compensate for content shifting that\n // occurs with each replacement, ensuring accurate insertion points)\n hardBreakPositions.reverse().forEach((pos) => {\n tr.replace(\n pos,\n pos + 1,\n Slice.maxOpen(\n Fragment.fromArray([\n schema.nodes.paragraph.create(),\n schema.nodes.paragraph.create(),\n ]),\n ),\n )\n })\n }\n\n // Toggle the selection into a bullet list, optionally keeping attributes\n // (this is a verbatim copy of the built-in `toggleBulletList` command)\n\n if (options.keepAttributes) {\n return chain()\n .toggleList(name, options.itemTypeName, options.keepMarks)\n .updateAttributes(ListItem.name, editor.getAttributes(TextStyle.name))\n .run()\n }\n\n return commands.toggleList(name, options.itemTypeName, options.keepMarks)\n }\n },\n }\n },\n})\n\nexport { RichTextBulletList }\n\nexport type { RichTextBulletListOptions }\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,qBAAqB,WAAW,OAAkC;CACpE,aAAa;AACT,SAAO;GACH,GAAG,KAAK,UAAU;GAClB,aAAa;GAChB;;CAGL,cAAc;EACV,MAAM,EAAE,QAAQ,MAAM,YAAY;AAElC,SAAO;GACH,GAAG,KAAK,UAAU;GAClB,mBAAmB;AACf,YAAQ,EAAE,UAAU,OAAO,IAAI,YAAY;AAEvC,SAAI,QAAQ,aAAa;MACrB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,cAAc;MACtB,MAAM,EAAE,OAAO,QAAQ;MAEvB,MAAM,qBAA+B,EAAE;AAGvC,SAAG,IAAI,aAAa,MAAM,KAAK,IAAI,MAAM,MAAM,QAAQ;AACnD,WAAI,KAAK,KAAK,SAAS,YACnB,oBAAmB,KAAK,IAAI;QAElC;AAMF,yBAAmB,SAAS,CAAC,SAAS,QAAQ;AAC1C,UAAG,QACC,KACA,MAAM,GACN,MAAM,QACF,SAAS,UAAU,CACf,OAAO,MAAM,UAAU,QAAQ,EAC/B,OAAO,MAAM,UAAU,QAAQ,CAClC,CAAC,CACL,CACJ;QACH;;AAMN,SAAI,QAAQ,eACR,QAAO,OAAO,CACT,WAAW,MAAM,QAAQ,cAAc,QAAQ,UAAU,CACzD,iBAAiB,SAAS,MAAM,OAAO,cAAc,UAAU,KAAK,CAAC,CACrE,KAAK;AAGd,YAAO,SAAS,WAAW,MAAM,QAAQ,cAAc,QAAQ,UAAU;;;GAGpF;;CAER,CAAC"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import "../../constants/extension-priorities.js";
|
|
2
|
+
import { markInputRule, markPasteRule } from "@tiptap/core";
|
|
3
|
+
import { Code } from "@tiptap/extension-code";
|
|
4
|
+
//#region src/extensions/rich-text/rich-text-code.ts
|
|
4
5
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* The original input regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue
|
|
7
|
+
* introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998
|
|
8
|
+
*/
|
|
8
9
|
const inputRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/;
|
|
9
10
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* The original paste regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue
|
|
12
|
+
* introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998
|
|
13
|
+
*/
|
|
13
14
|
const pasteRegex = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g;
|
|
14
15
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
* Custom extension that extends the built-in `Code` extension to allow all marks (e.g., Bold,
|
|
17
|
+
* Italic, and Strikethrough) to coexist with the `Code` mark (as opposed to disallowing all any
|
|
18
|
+
* other mark by default).
|
|
19
|
+
*
|
|
20
|
+
* @see https://tiptap.dev/api/schema#excludes
|
|
21
|
+
* @see https://prosemirror.net/docs/ref/#model.MarkSpec.excludes
|
|
22
|
+
*/
|
|
22
23
|
const RichTextCode = Code.extend({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
type: this.type,
|
|
38
|
-
}),
|
|
39
|
-
];
|
|
40
|
-
},
|
|
24
|
+
priority: 99,
|
|
25
|
+
excludes: Code.name,
|
|
26
|
+
addInputRules() {
|
|
27
|
+
return [markInputRule({
|
|
28
|
+
find: inputRegex,
|
|
29
|
+
type: this.type
|
|
30
|
+
})];
|
|
31
|
+
},
|
|
32
|
+
addPasteRules() {
|
|
33
|
+
return [markPasteRule({
|
|
34
|
+
find: pasteRegex,
|
|
35
|
+
type: this.type
|
|
36
|
+
})];
|
|
37
|
+
}
|
|
41
38
|
});
|
|
39
|
+
//#endregion
|
|
42
40
|
export { RichTextCode };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=rich-text-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-code.js","names":[],"sources":["../../../src/extensions/rich-text/rich-text-code.ts"],"sourcesContent":["import { markInputRule, markPasteRule } from '@tiptap/core'\nimport { Code } from '@tiptap/extension-code'\n\nimport { CODE_EXTENSION_PRIORITY } from '../../constants/extension-priorities'\n\nimport type { CodeOptions } from '@tiptap/extension-code'\n\n/**\n * The options available to customize the `RichTextCode` extension.\n */\ntype RichTextCodeOptions = CodeOptions\n\n/**\n * The original input regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue\n * introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998\n */\nconst inputRegex = /(?:^|\\s)(`(?!\\s+`)((?:[^`]+))`(?!\\s+`))$/\n\n/**\n * The original paste regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue\n * introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998\n */\nconst pasteRegex = /(?:^|\\s)(`(?!\\s+`)((?:[^`]+))`(?!\\s+`))/g\n\n/**\n * Custom extension that extends the built-in `Code` extension to allow all marks (e.g., Bold,\n * Italic, and Strikethrough) to coexist with the `Code` mark (as opposed to disallowing all any\n * other mark by default).\n *\n * @see https://tiptap.dev/api/schema#excludes\n * @see https://prosemirror.net/docs/ref/#model.MarkSpec.excludes\n */\nconst RichTextCode = Code.extend<RichTextCodeOptions>({\n priority: CODE_EXTENSION_PRIORITY,\n excludes: Code.name,\n addInputRules() {\n return [\n markInputRule({\n find: inputRegex,\n type: this.type,\n }),\n ]\n },\n addPasteRules() {\n return [\n markPasteRule({\n find: pasteRegex,\n type: this.type,\n }),\n ]\n },\n})\n\nexport { RichTextCode }\n\nexport type { RichTextCodeOptions }\n"],"mappings":";;;;;;;;AAgBA,MAAM,aAAa;;;;;AAMnB,MAAM,aAAa;;;;;;;;;AAUnB,MAAM,eAAe,KAAK,OAA4B;CAClD,UAAA;CACA,UAAU,KAAK;CACf,gBAAgB;AACZ,SAAO,CACH,cAAc;GACV,MAAM;GACN,MAAM,KAAK;GACd,CAAC,CACL;;CAEL,gBAAgB;AACZ,SAAO,CACH,cAAc;GACV,MAAM;GACN,MAAM,KAAK;GACd,CAAC,CACL;;CAER,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
//#region src/extensions/rich-text/rich-text-document.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* The options available to customize the `RichTextDocumentOptions` extension.
|
|
3
4
|
*/
|
|
4
5
|
type RichTextDocumentOptions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Indicates whether the document accepts multiple lines of input or only a single line.
|
|
8
|
+
*/
|
|
9
|
+
multiline: boolean;
|
|
9
10
|
};
|
|
10
11
|
/**
|
|
11
12
|
* Custom extension that extends the built-in `Document` extension to define a schema for multiline
|
|
12
13
|
* or singleline rich-text documents (as opposed to the multiple block nodes by default).
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
export type { RichTextDocumentOptions };
|
|
15
|
+
//#endregion
|
|
16
|
+
export { type RichTextDocumentOptions };
|
|
17
17
|
//# sourceMappingURL=rich-text-document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-document.d.ts","
|
|
1
|
+
{"version":3,"file":"rich-text-document.d.ts","names":[],"sources":["../../../src/extensions/rich-text/rich-text-document.ts"],"mappings":";;;;KAKK,uBAAA;EAAuB;;;EAIxB,SAAA;AAAA"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { Document } from
|
|
1
|
+
import { Document } from "@tiptap/extension-document";
|
|
2
|
+
//#region src/extensions/rich-text/rich-text-document.ts
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* Custom extension that extends the built-in `Document` extension to define a schema for multiline
|
|
5
|
+
* or singleline rich-text documents (as opposed to the multiple block nodes by default).
|
|
6
|
+
*/
|
|
6
7
|
const RichTextDocument = Document.extend({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// ref: https://tiptap.dev/api/schema#content
|
|
14
|
-
return `block${this.options.multiline ? '+' : ''}`;
|
|
15
|
-
},
|
|
8
|
+
addOptions() {
|
|
9
|
+
return { multiline: true };
|
|
10
|
+
},
|
|
11
|
+
content() {
|
|
12
|
+
return `block${this.options.multiline ? "+" : ""}`;
|
|
13
|
+
}
|
|
16
14
|
});
|
|
15
|
+
//#endregion
|
|
17
16
|
export { RichTextDocument };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=rich-text-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-document.js","names":[],"sources":["../../../src/extensions/rich-text/rich-text-document.ts"],"sourcesContent":["import { Document } from '@tiptap/extension-document'\n\n/**\n * The options available to customize the `RichTextDocumentOptions` extension.\n */\ntype RichTextDocumentOptions = {\n /**\n * Indicates whether the document accepts multiple lines of input or only a single line.\n */\n multiline: boolean\n}\n\n/**\n * Custom extension that extends the built-in `Document` extension to define a schema for multiline\n * or singleline rich-text documents (as opposed to the multiple block nodes by default).\n */\nconst RichTextDocument = Document.extend<RichTextDocumentOptions>({\n addOptions() {\n return {\n multiline: true,\n }\n },\n content() {\n // ref: https://tiptap.dev/api/schema#content\n return `block${this.options.multiline ? '+' : ''}`\n },\n})\n\nexport { RichTextDocument }\n\nexport type { RichTextDocumentOptions }\n"],"mappings":";;;;;;AAgBA,MAAM,mBAAmB,SAAS,OAAgC;CAC9D,aAAa;AACT,SAAO,EACH,WAAW,MACd;;CAEL,UAAU;AAEN,SAAO,QAAQ,KAAK,QAAQ,YAAY,MAAM;;CAErD,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { HeadingOptions } from "@tiptap/extension-heading";
|
|
2
|
+
|
|
3
|
+
//#region src/extensions/rich-text/rich-text-heading.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* The options available to customize the `RichTextHeading` extension.
|
|
4
6
|
*/
|
|
@@ -14,7 +16,6 @@ type RichTextHeadingOptions = HeadingOptions;
|
|
|
14
16
|
* @see https://github.com/ueberdosis/tiptap/issues/2570
|
|
15
17
|
* @see https://github.com/ueberdosis/tiptap/pull/6832
|
|
16
18
|
*/
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
export type { RichTextHeadingOptions };
|
|
19
|
+
//#endregion
|
|
20
|
+
export { type RichTextHeadingOptions };
|
|
20
21
|
//# sourceMappingURL=rich-text-heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-heading.d.ts","
|
|
1
|
+
{"version":3,"file":"rich-text-heading.d.ts","names":[],"sources":["../../../src/extensions/rich-text/rich-text-heading.ts"],"mappings":";;;;;;KAQK,sBAAA,GAAyB,cAAA"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { textblockTypeInputRule } from "@tiptap/react";
|
|
2
|
+
import { Heading } from "@tiptap/extension-heading";
|
|
3
|
+
//#region src/extensions/rich-text/rich-text-heading.ts
|
|
3
4
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const RichTextHeading = Heading.extend({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
},
|
|
26
|
-
});
|
|
5
|
+
* Custom extension that extends the built-in `Heading` extension to override the input rule for
|
|
6
|
+
* headings to trigger only on space (e.g., `## `), preventing conflicts with suggestion extensions
|
|
7
|
+
* that use `#` as their trigger character.
|
|
8
|
+
*
|
|
9
|
+
* This was properly fixed in Tiptap v3 where input rules respect extension priorities, making this
|
|
10
|
+
* extension likely unnecessary after migrating.
|
|
11
|
+
*
|
|
12
|
+
* @see https://github.com/ueberdosis/tiptap/issues/2570
|
|
13
|
+
* @see https://github.com/ueberdosis/tiptap/pull/6832
|
|
14
|
+
*/
|
|
15
|
+
const RichTextHeading = Heading.extend({ addInputRules() {
|
|
16
|
+
return this.options.levels.map((level) => {
|
|
17
|
+
return textblockTypeInputRule({
|
|
18
|
+
find: new RegExp(`^(#{1,${level}}) $`),
|
|
19
|
+
type: this.type,
|
|
20
|
+
getAttributes: { level }
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
} });
|
|
24
|
+
//#endregion
|
|
27
25
|
export { RichTextHeading };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=rich-text-heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-heading.js","names":[],"sources":["../../../src/extensions/rich-text/rich-text-heading.ts"],"sourcesContent":["import { Heading } from '@tiptap/extension-heading'\nimport { textblockTypeInputRule } from '@tiptap/react'\n\nimport type { HeadingOptions } from '@tiptap/extension-heading'\n\n/**\n * The options available to customize the `RichTextHeading` extension.\n */\ntype RichTextHeadingOptions = HeadingOptions\n\n/**\n * Custom extension that extends the built-in `Heading` extension to override the input rule for\n * headings to trigger only on space (e.g., `## `), preventing conflicts with suggestion extensions\n * that use `#` as their trigger character.\n *\n * This was properly fixed in Tiptap v3 where input rules respect extension priorities, making this\n * extension likely unnecessary after migrating.\n *\n * @see https://github.com/ueberdosis/tiptap/issues/2570\n * @see https://github.com/ueberdosis/tiptap/pull/6832\n */\nconst RichTextHeading = Heading.extend<RichTextHeadingOptions>({\n addInputRules() {\n return this.options.levels.map((level: number) => {\n return textblockTypeInputRule({\n find: new RegExp(`^(#{1,${level}}) $`),\n type: this.type,\n getAttributes: {\n level,\n },\n })\n })\n },\n})\n\nexport { RichTextHeading }\n\nexport type { RichTextHeadingOptions }\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAM,kBAAkB,QAAQ,OAA+B,EAC3D,gBAAgB;AACZ,QAAO,KAAK,QAAQ,OAAO,KAAK,UAAkB;AAC9C,SAAO,uBAAuB;GAC1B,MAAM,IAAI,OAAO,SAAS,MAAM,MAAM;GACtC,MAAM,KAAK;GACX,eAAe,EACX,OACH;GACJ,CAAC;GACJ;GAET,CAAC"}
|
|
@@ -1,75 +1,76 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactNodeViewProps } from "@tiptap/react";
|
|
2
|
+
|
|
3
|
+
//#region src/extensions/rich-text/rich-text-image.d.ts
|
|
2
4
|
/**
|
|
3
5
|
* The properties that describe `RichTextImage` node attributes.
|
|
4
6
|
*/
|
|
5
7
|
type RichTextImageAttributes = {
|
|
8
|
+
/**
|
|
9
|
+
* Additional metadata about an image attachment upload.
|
|
10
|
+
*/
|
|
11
|
+
metadata?: {
|
|
6
12
|
/**
|
|
7
|
-
*
|
|
13
|
+
* A unique ID for the image attachment.
|
|
8
14
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* The upload progress for the image attachment.
|
|
20
|
-
*/
|
|
21
|
-
uploadProgress: number;
|
|
22
|
-
};
|
|
15
|
+
attachmentId: string;
|
|
16
|
+
/**
|
|
17
|
+
* Specifies if the image attachment failed to upload.
|
|
18
|
+
*/
|
|
19
|
+
isUploadFailed: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The upload progress for the image attachment.
|
|
22
|
+
*/
|
|
23
|
+
uploadProgress: number;
|
|
24
|
+
};
|
|
23
25
|
} & Pick<HTMLImageElement, 'src'> & Pick<Partial<HTMLImageElement>, 'alt' | 'title'>;
|
|
24
26
|
/**
|
|
25
27
|
* Augment the official `@tiptap/core` module with extra commands, relevant for this extension, so
|
|
26
28
|
* that the compiler knows about them.
|
|
27
29
|
*/
|
|
28
30
|
declare module '@tiptap/core' {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
richTextImage: {
|
|
33
|
+
/**
|
|
34
|
+
* Inserts an image into the editor with the given attributes.
|
|
35
|
+
*/
|
|
36
|
+
insertImage: (attributes: RichTextImageAttributes) => ReturnType;
|
|
37
|
+
/**
|
|
38
|
+
* Updates the attributes for an existing image in the editor.
|
|
39
|
+
*/
|
|
40
|
+
updateImage: (attributes: Partial<RichTextImageAttributes> & Required<Pick<RichTextImageAttributes, 'metadata'>>) => ReturnType;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
41
43
|
}
|
|
42
44
|
/**
|
|
43
45
|
* The options available to customize the `RichTextImage` extension.
|
|
44
46
|
*/
|
|
45
47
|
type RichTextImageOptions = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
48
|
+
/**
|
|
49
|
+
* A list of accepted MIME types for images pasting.
|
|
50
|
+
*/
|
|
51
|
+
acceptedImageMimeTypes: string[];
|
|
52
|
+
/**
|
|
53
|
+
* Renders the image node inline (e.g., <p><img src="doist.jpg"></p>). By default images are on
|
|
54
|
+
* the same level as paragraphs.
|
|
55
|
+
*/
|
|
56
|
+
inline: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Custom HTML attributes that should be added to the rendered HTML tag.
|
|
59
|
+
*/
|
|
60
|
+
HTMLAttributes: Record<string, string>;
|
|
61
|
+
/**
|
|
62
|
+
* A React component to render inside the interactive node view.
|
|
63
|
+
*/
|
|
64
|
+
NodeViewComponent?: React.ComponentType<ReactNodeViewProps>;
|
|
65
|
+
/**
|
|
66
|
+
* The event handler that is fired when an image file is pasted.
|
|
67
|
+
*/
|
|
68
|
+
onImageFilePaste?: (file: File) => void;
|
|
67
69
|
};
|
|
68
70
|
/**
|
|
69
71
|
* Custom extension that extends the built-in `Image` extension to add support for image pasting,
|
|
70
72
|
* and also adds the ability to pass aditional metadata about an image attachment upload.
|
|
71
73
|
*/
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
export type { RichTextImageAttributes, RichTextImageOptions };
|
|
74
|
+
//#endregion
|
|
75
|
+
export { type RichTextImageAttributes, type RichTextImageOptions };
|
|
75
76
|
//# sourceMappingURL=rich-text-image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-image.d.ts","
|
|
1
|
+
{"version":3,"file":"rich-text-image.d.ts","names":[],"sources":["../../../src/extensions/rich-text/rich-text-image.ts"],"mappings":";;;;;;KAUK,uBAAA;EAAuB;;;EAIxB,QAAA;IAiBa;;;IAbT,YAAA;IAaA;;;IARA,cAAA;IAKA;;;IAAA,cAAA;EAAA;AAAA,IAEJ,IAAA,CAAK,gBAAA,WACL,IAAA,CAAK,OAAA,CAAQ,gBAAA;;;AAAgB;;;YAOnB,QAAA;IACN,aAAA;MAU4B;;;MANxB,WAAA,GAAc,UAAA,EAAY,uBAAA,KAA4B,UAAA;MAO9C;;;MAFR,WAAA,GACI,UAAA,EAAY,OAAA,CAAQ,uBAAA,IAChB,QAAA,CAAS,IAAA,CAAK,uBAAA,mBACjB,UAAA;IAAA;EAAA;AAAA;;;;KAQZ,oBAAA;EAXO;;;EAeR,sBAAA;EAbyB;;;;EAmBzB,MAAA;EAlBuB;;AAAA;EAuBvB,cAAA,EAAgB,MAAA;;;;EAKhB,iBAAA,GAAoB,KAAA,CAAM,aAAA,CAAc,kBAAA;EAKd;;;EAA1B,gBAAA,IAAoB,IAAA,EAAM,IAAA;AAAA"}
|