@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.
Files changed (237) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/typist-editor.d.ts +126 -123
  3. package/dist/components/typist-editor.d.ts.map +1 -1
  4. package/dist/components/typist-editor.helper.d.ts +8 -11
  5. package/dist/components/typist-editor.helper.d.ts.map +1 -1
  6. package/dist/components/typist-editor.helper.js +21 -19
  7. package/dist/components/typist-editor.helper.js.map +1 -0
  8. package/dist/components/typist-editor.js +133 -135
  9. package/dist/components/typist-editor.js.map +1 -0
  10. package/dist/constants/common.js +9 -5
  11. package/dist/constants/common.js.map +1 -0
  12. package/dist/constants/extension-priorities.d.ts +3 -1
  13. package/dist/constants/extension-priorities.d.ts.map +1 -1
  14. package/dist/constants/extension-priorities.js +34 -30
  15. package/dist/constants/extension-priorities.js.map +1 -0
  16. package/dist/constants/regular-expressions.js +14 -10
  17. package/dist/constants/regular-expressions.js.map +1 -0
  18. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts +12 -9
  19. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts.map +1 -1
  20. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js +16 -19
  21. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js.map +1 -0
  22. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts +12 -9
  23. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts.map +1 -1
  24. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js +25 -28
  25. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js.map +1 -0
  26. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts +24 -22
  27. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts.map +1 -1
  28. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js +34 -36
  29. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js.map +1 -0
  30. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts +23 -20
  31. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts.map +1 -1
  32. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js +15 -8
  33. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js.map +1 -0
  34. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js +22 -18
  35. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js.map +1 -0
  36. package/dist/extensions/core/view-event-handlers.d.ts +14 -13
  37. package/dist/extensions/core/view-event-handlers.d.ts.map +1 -1
  38. package/dist/extensions/core/view-event-handlers.js +33 -31
  39. package/dist/extensions/core/view-event-handlers.js.map +1 -0
  40. package/dist/extensions/plain-text/paste-multiline-text.js +45 -59
  41. package/dist/extensions/plain-text/paste-multiline-text.js.map +1 -0
  42. package/dist/extensions/plain-text/plain-text-document.d.ts +7 -7
  43. package/dist/extensions/plain-text/plain-text-document.d.ts.map +1 -1
  44. package/dist/extensions/plain-text/plain-text-document.js +14 -13
  45. package/dist/extensions/plain-text/plain-text-document.js.map +1 -0
  46. package/dist/extensions/plain-text/plain-text-kit.d.ts +35 -33
  47. package/dist/extensions/plain-text/plain-text-kit.d.ts.map +1 -1
  48. package/dist/extensions/plain-text/plain-text-kit.js +33 -48
  49. package/dist/extensions/plain-text/plain-text-kit.js.map +1 -0
  50. package/dist/extensions/plain-text/plain-text-paragraph.d.ts +2 -9
  51. package/dist/extensions/plain-text/plain-text-paragraph.js +11 -11
  52. package/dist/extensions/plain-text/plain-text-paragraph.js.map +1 -0
  53. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js +37 -81
  54. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js.map +1 -0
  55. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js +32 -42
  56. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js.map +1 -0
  57. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js +24 -37
  58. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js.map +1 -0
  59. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js +21 -13
  60. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js.map +1 -0
  61. package/dist/extensions/rich-text/bold-and-italics.js +42 -40
  62. package/dist/extensions/rich-text/bold-and-italics.js.map +1 -0
  63. package/dist/extensions/rich-text/curvenote-codemark.js +16 -14
  64. package/dist/extensions/rich-text/curvenote-codemark.js.map +1 -0
  65. package/dist/extensions/rich-text/paste-emojis.js +20 -22
  66. package/dist/extensions/rich-text/paste-emojis.js.map +1 -0
  67. package/dist/extensions/rich-text/paste-markdown.js +46 -86
  68. package/dist/extensions/rich-text/paste-markdown.js.map +1 -0
  69. package/dist/extensions/rich-text/rich-text-bullet-list.d.ts +10 -9
  70. package/dist/extensions/rich-text/rich-text-bullet-list.d.ts.map +1 -1
  71. package/dist/extensions/rich-text/rich-text-bullet-list.js +42 -56
  72. package/dist/extensions/rich-text/rich-text-bullet-list.js.map +1 -0
  73. package/dist/extensions/rich-text/rich-text-code.js +34 -34
  74. package/dist/extensions/rich-text/rich-text-code.js.map +1 -0
  75. package/dist/extensions/rich-text/rich-text-document.d.ts +7 -7
  76. package/dist/extensions/rich-text/rich-text-document.d.ts.map +1 -1
  77. package/dist/extensions/rich-text/rich-text-document.js +14 -13
  78. package/dist/extensions/rich-text/rich-text-document.js.map +1 -0
  79. package/dist/extensions/rich-text/rich-text-heading.d.ts +5 -4
  80. package/dist/extensions/rich-text/rich-text-heading.d.ts.map +1 -1
  81. package/dist/extensions/rich-text/rich-text-heading.js +25 -25
  82. package/dist/extensions/rich-text/rich-text-heading.js.map +1 -0
  83. package/dist/extensions/rich-text/rich-text-image.d.ts +53 -52
  84. package/dist/extensions/rich-text/rich-text-image.d.ts.map +1 -1
  85. package/dist/extensions/rich-text/rich-text-image.js +88 -105
  86. package/dist/extensions/rich-text/rich-text-image.js.map +1 -0
  87. package/dist/extensions/rich-text/rich-text-kit.d.ts +127 -125
  88. package/dist/extensions/rich-text/rich-text-kit.d.ts.map +1 -1
  89. package/dist/extensions/rich-text/rich-text-kit.js +73 -135
  90. package/dist/extensions/rich-text/rich-text-kit.js.map +1 -0
  91. package/dist/extensions/rich-text/rich-text-link.d.ts +5 -4
  92. package/dist/extensions/rich-text/rich-text-link.d.ts.map +1 -1
  93. package/dist/extensions/rich-text/rich-text-link.js +82 -90
  94. package/dist/extensions/rich-text/rich-text-link.js.map +1 -0
  95. package/dist/extensions/rich-text/rich-text-ordered-list.d.ts +10 -9
  96. package/dist/extensions/rich-text/rich-text-ordered-list.d.ts.map +1 -1
  97. package/dist/extensions/rich-text/rich-text-ordered-list.js +42 -56
  98. package/dist/extensions/rich-text/rich-text-ordered-list.js.map +1 -0
  99. package/dist/extensions/rich-text/rich-text-strikethrough.d.ts +5 -4
  100. package/dist/extensions/rich-text/rich-text-strikethrough.d.ts.map +1 -1
  101. package/dist/extensions/rich-text/rich-text-strikethrough.js +10 -10
  102. package/dist/extensions/rich-text/rich-text-strikethrough.js.map +1 -0
  103. package/dist/extensions/shared/copy-markdown-source.js +22 -31
  104. package/dist/extensions/shared/copy-markdown-source.js.map +1 -0
  105. package/dist/extensions/shared/paste-html-table-as-string.js +47 -60
  106. package/dist/extensions/shared/paste-html-table-as-string.js.map +1 -0
  107. package/dist/extensions/shared/paste-singleline-text.js +31 -39
  108. package/dist/extensions/shared/paste-singleline-text.js.map +1 -0
  109. package/dist/factories/create-suggestion-extension.d.ts +74 -74
  110. package/dist/factories/create-suggestion-extension.d.ts.map +1 -1
  111. package/dist/factories/create-suggestion-extension.js +139 -161
  112. package/dist/factories/create-suggestion-extension.js.map +1 -0
  113. package/dist/helpers/dom.js +9 -5
  114. package/dist/helpers/dom.js.map +1 -0
  115. package/dist/helpers/schema.d.ts +5 -3
  116. package/dist/helpers/schema.d.ts.map +1 -1
  117. package/dist/helpers/schema.js +25 -21
  118. package/dist/helpers/schema.js.map +1 -0
  119. package/dist/helpers/serializer.js +24 -28
  120. package/dist/helpers/serializer.js.map +1 -0
  121. package/dist/helpers/unified.js +24 -17
  122. package/dist/helpers/unified.js.map +1 -0
  123. package/dist/hooks/use-editor.js +50 -53
  124. package/dist/hooks/use-editor.js.map +1 -0
  125. package/dist/index.d.ts +25 -31
  126. package/dist/index.js +24 -24
  127. package/dist/serializers/html/html.d.ts +12 -10
  128. package/dist/serializers/html/html.d.ts.map +1 -1
  129. package/dist/serializers/html/html.js +67 -127
  130. package/dist/serializers/html/html.js.map +1 -0
  131. package/dist/serializers/html/plugins/rehype-code-block.js +17 -17
  132. package/dist/serializers/html/plugins/rehype-code-block.js.map +1 -0
  133. package/dist/serializers/html/plugins/rehype-image.js +20 -30
  134. package/dist/serializers/html/plugins/rehype-image.js.map +1 -0
  135. package/dist/serializers/html/plugins/rehype-suggestions.js +31 -32
  136. package/dist/serializers/html/plugins/rehype-suggestions.js.map +1 -0
  137. package/dist/serializers/html/plugins/rehype-task-list.js +31 -32
  138. package/dist/serializers/html/plugins/rehype-task-list.js.map +1 -0
  139. package/dist/serializers/html/plugins/remark-autolink-literal.d.ts +4 -1
  140. package/dist/serializers/html/plugins/remark-autolink-literal.d.ts.map +1 -1
  141. package/dist/serializers/html/plugins/remark-autolink-literal.js +25 -21
  142. package/dist/serializers/html/plugins/remark-autolink-literal.js.map +1 -0
  143. package/dist/serializers/html/plugins/remark-disable-constructs.js +21 -41
  144. package/dist/serializers/html/plugins/remark-disable-constructs.js.map +1 -0
  145. package/dist/serializers/html/plugins/remark-strikethrough.d.ts +5 -2
  146. package/dist/serializers/html/plugins/remark-strikethrough.d.ts.map +1 -1
  147. package/dist/serializers/html/plugins/remark-strikethrough.js +25 -21
  148. package/dist/serializers/html/plugins/remark-strikethrough.js.map +1 -0
  149. package/dist/serializers/markdown/markdown.d.ts +13 -12
  150. package/dist/serializers/markdown/markdown.d.ts.map +1 -1
  151. package/dist/serializers/markdown/markdown.js +78 -154
  152. package/dist/serializers/markdown/markdown.js.map +1 -0
  153. package/dist/serializers/markdown/plugins/image.js +27 -24
  154. package/dist/serializers/markdown/plugins/image.js.map +1 -0
  155. package/dist/serializers/markdown/plugins/list-item.js +32 -37
  156. package/dist/serializers/markdown/plugins/list-item.js.map +1 -0
  157. package/dist/serializers/markdown/plugins/paragraph.js +19 -19
  158. package/dist/serializers/markdown/plugins/paragraph.js.map +1 -0
  159. package/dist/serializers/markdown/plugins/strikethrough.js +23 -19
  160. package/dist/serializers/markdown/plugins/strikethrough.js.map +1 -0
  161. package/dist/serializers/markdown/plugins/suggestion.js +21 -19
  162. package/dist/serializers/markdown/plugins/suggestion.js.map +1 -0
  163. package/dist/serializers/markdown/plugins/task-item.js +31 -35
  164. package/dist/serializers/markdown/plugins/task-item.js.map +1 -0
  165. package/dist/utilities/can-insert-node-at.d.ts +12 -5
  166. package/dist/utilities/can-insert-node-at.d.ts.map +1 -1
  167. package/dist/utilities/can-insert-node-at.js +10 -8
  168. package/dist/utilities/can-insert-node-at.js.map +1 -0
  169. package/dist/utilities/can-insert-suggestion.d.ts +11 -5
  170. package/dist/utilities/can-insert-suggestion.d.ts.map +1 -1
  171. package/dist/utilities/can-insert-suggestion.js +15 -12
  172. package/dist/utilities/can-insert-suggestion.js.map +1 -0
  173. package/package.json +4 -3
  174. package/dist/constants/common.d.ts +0 -10
  175. package/dist/constants/common.d.ts.map +0 -1
  176. package/dist/constants/regular-expressions.d.ts +0 -18
  177. package/dist/constants/regular-expressions.d.ts.map +0 -1
  178. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts +0 -9
  179. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts.map +0 -1
  180. package/dist/extensions/plain-text/paste-multiline-text.d.ts +0 -10
  181. package/dist/extensions/plain-text/paste-multiline-text.d.ts.map +0 -1
  182. package/dist/extensions/plain-text/plain-text-paragraph.d.ts.map +0 -1
  183. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts +0 -9
  184. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts.map +0 -1
  185. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts +0 -9
  186. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts.map +0 -1
  187. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts +0 -9
  188. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts.map +0 -1
  189. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts +0 -8
  190. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts.map +0 -1
  191. package/dist/extensions/rich-text/bold-and-italics.d.ts +0 -8
  192. package/dist/extensions/rich-text/bold-and-italics.d.ts.map +0 -1
  193. package/dist/extensions/rich-text/curvenote-codemark.d.ts +0 -11
  194. package/dist/extensions/rich-text/curvenote-codemark.d.ts.map +0 -1
  195. package/dist/extensions/rich-text/paste-emojis.d.ts +0 -9
  196. package/dist/extensions/rich-text/paste-emojis.d.ts.map +0 -1
  197. package/dist/extensions/rich-text/paste-markdown.d.ts +0 -11
  198. package/dist/extensions/rich-text/paste-markdown.d.ts.map +0 -1
  199. package/dist/extensions/rich-text/rich-text-code.d.ts +0 -17
  200. package/dist/extensions/rich-text/rich-text-code.d.ts.map +0 -1
  201. package/dist/extensions/shared/copy-markdown-source.d.ts +0 -20
  202. package/dist/extensions/shared/copy-markdown-source.d.ts.map +0 -1
  203. package/dist/extensions/shared/paste-html-table-as-string.d.ts +0 -20
  204. package/dist/extensions/shared/paste-html-table-as-string.d.ts.map +0 -1
  205. package/dist/extensions/shared/paste-singleline-text.d.ts +0 -10
  206. package/dist/extensions/shared/paste-singleline-text.d.ts.map +0 -1
  207. package/dist/helpers/dom.d.ts +0 -8
  208. package/dist/helpers/dom.d.ts.map +0 -1
  209. package/dist/helpers/serializer.d.ts +0 -21
  210. package/dist/helpers/serializer.d.ts.map +0 -1
  211. package/dist/helpers/unified.d.ts +0 -21
  212. package/dist/helpers/unified.d.ts.map +0 -1
  213. package/dist/hooks/use-editor.d.ts +0 -19
  214. package/dist/hooks/use-editor.d.ts.map +0 -1
  215. package/dist/index.d.ts.map +0 -1
  216. package/dist/serializers/html/plugins/rehype-code-block.d.ts +0 -10
  217. package/dist/serializers/html/plugins/rehype-code-block.d.ts.map +0 -1
  218. package/dist/serializers/html/plugins/rehype-image.d.ts +0 -11
  219. package/dist/serializers/html/plugins/rehype-image.d.ts.map +0 -1
  220. package/dist/serializers/html/plugins/rehype-suggestions.d.ts +0 -10
  221. package/dist/serializers/html/plugins/rehype-suggestions.d.ts.map +0 -1
  222. package/dist/serializers/html/plugins/rehype-task-list.d.ts +0 -7
  223. package/dist/serializers/html/plugins/rehype-task-list.d.ts.map +0 -1
  224. package/dist/serializers/html/plugins/remark-disable-constructs.d.ts +0 -11
  225. package/dist/serializers/html/plugins/remark-disable-constructs.d.ts.map +0 -1
  226. package/dist/serializers/markdown/plugins/image.d.ts +0 -12
  227. package/dist/serializers/markdown/plugins/image.d.ts.map +0 -1
  228. package/dist/serializers/markdown/plugins/list-item.d.ts +0 -14
  229. package/dist/serializers/markdown/plugins/list-item.d.ts.map +0 -1
  230. package/dist/serializers/markdown/plugins/paragraph.d.ts +0 -13
  231. package/dist/serializers/markdown/plugins/paragraph.d.ts.map +0 -1
  232. package/dist/serializers/markdown/plugins/strikethrough.d.ts +0 -13
  233. package/dist/serializers/markdown/plugins/strikethrough.d.ts.map +0 -1
  234. package/dist/serializers/markdown/plugins/suggestion.d.ts +0 -11
  235. package/dist/serializers/markdown/plugins/suggestion.d.ts.map +0 -1
  236. package/dist/serializers/markdown/plugins/task-item.d.ts +0 -14
  237. package/dist/serializers/markdown/plugins/task-item.d.ts.map +0 -1
@@ -1,60 +1,46 @@
1
- import { BulletList } from '@tiptap/extension-bullet-list';
2
- import { ListItem } from '@tiptap/extension-list-item';
3
- import { TextStyle } from '@tiptap/extension-text-style';
4
- import { Fragment, Slice } from '@tiptap/pm/model';
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
- * Custom extension that extends the built-in `BulletList` extension to add an option for smart
7
- * toggling, which takes into account hard breaks in the selection, and converts them into
8
- * paragraphs before toggling the selection into a bullet list.
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
- addOptions() {
12
- return {
13
- ...this.parent?.(),
14
- smartToggle: false,
15
- };
16
- },
17
- addCommands() {
18
- const { editor, name, options } = this;
19
- return {
20
- ...this.parent?.(),
21
- toggleBulletList() {
22
- return ({ commands, state, tr, chain }) => {
23
- // Replace hard breaks in the selection with paragraphs before toggling?
24
- if (options.smartToggle) {
25
- const { schema } = state;
26
- const { selection } = tr;
27
- const { $from, $to } = selection;
28
- const hardBreakPositions = [];
29
- // Find and store the positions of all hard breaks in the selection
30
- tr.doc.nodesBetween($from.pos, $to.pos, (node, pos) => {
31
- if (node.type.name === 'hardBreak') {
32
- hardBreakPositions.push(pos);
33
- }
34
- });
35
- // Replace each hard break with a slice that closes and re-opens a paragraph,
36
- // effectively inserting a "paragraph break" in place of a "hard break"
37
- // (this is performed in reverse order to compensate for content shifting that
38
- // occurs with each replacement, ensuring accurate insertion points)
39
- hardBreakPositions.reverse().forEach((pos) => {
40
- tr.replace(pos, pos + 1, Slice.maxOpen(Fragment.fromArray([
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 { markInputRule, markPasteRule } from '@tiptap/core';
2
- import { Code } from '@tiptap/extension-code';
3
- import { CODE_EXTENSION_PRIORITY } from '../../constants/extension-priorities';
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
- * The original input regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue
6
- * introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998
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
- * The original paste regex for Markdown inline code (i.e. `<code>code</code>`) to prevent the issue
11
- * introduced in this PR: https://github.com/ueberdosis/tiptap/pull/4468#issuecomment-2575093998
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
- * Custom extension that extends the built-in `Code` extension to allow all marks (e.g., Bold,
16
- * Italic, and Strikethrough) to coexist with the `Code` mark (as opposed to disallowing all any
17
- * other mark by default).
18
- *
19
- * @see https://tiptap.dev/api/schema#excludes
20
- * @see https://prosemirror.net/docs/ref/#model.MarkSpec.excludes
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
- priority: CODE_EXTENSION_PRIORITY,
24
- excludes: Code.name,
25
- addInputRules() {
26
- return [
27
- markInputRule({
28
- find: inputRegex,
29
- type: this.type,
30
- }),
31
- ];
32
- },
33
- addPasteRules() {
34
- return [
35
- markPasteRule({
36
- find: pasteRegex,
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
- * Indicates whether the document accepts multiple lines of input or only a single line.
7
- */
8
- multiline: boolean;
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
- declare const RichTextDocument: import("@tiptap/core").Node<RichTextDocumentOptions, any>;
15
- export { RichTextDocument };
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","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-document.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC3B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,QAAA,MAAM,gBAAgB,2DAUpB,CAAA;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAA;AAE3B,YAAY,EAAE,uBAAuB,EAAE,CAAA"}
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 '@tiptap/extension-document';
1
+ import { Document } from "@tiptap/extension-document";
2
+ //#region src/extensions/rich-text/rich-text-document.ts
2
3
  /**
3
- * Custom extension that extends the built-in `Document` extension to define a schema for multiline
4
- * or singleline rich-text documents (as opposed to the multiple block nodes by default).
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
- addOptions() {
8
- return {
9
- multiline: true,
10
- };
11
- },
12
- content() {
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 type { HeadingOptions } from '@tiptap/extension-heading';
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
- declare const RichTextHeading: import("@tiptap/core").Node<HeadingOptions, any>;
18
- export { RichTextHeading };
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","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-heading.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D;;GAEG;AACH,KAAK,sBAAsB,GAAG,cAAc,CAAA;AAE5C;;;;;;;;;;GAUG;AACH,QAAA,MAAM,eAAe,kDAYnB,CAAA;AAEF,OAAO,EAAE,eAAe,EAAE,CAAA;AAE1B,YAAY,EAAE,sBAAsB,EAAE,CAAA"}
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 { Heading } from '@tiptap/extension-heading';
2
- import { textblockTypeInputRule } from '@tiptap/react';
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
- * Custom extension that extends the built-in `Heading` extension to override the input rule for
5
- * headings to trigger only on space (e.g., `## `), preventing conflicts with suggestion extensions
6
- * that use `#` as their trigger character.
7
- *
8
- * This was properly fixed in Tiptap v3 where input rules respect extension priorities, making this
9
- * extension likely unnecessary after migrating.
10
- *
11
- * @see https://github.com/ueberdosis/tiptap/issues/2570
12
- * @see https://github.com/ueberdosis/tiptap/pull/6832
13
- */
14
- const RichTextHeading = Heading.extend({
15
- addInputRules() {
16
- return this.options.levels.map((level) => {
17
- return textblockTypeInputRule({
18
- find: new RegExp(`^(#{1,${level}}) $`),
19
- type: this.type,
20
- getAttributes: {
21
- level,
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 type { ReactNodeViewProps } from '@tiptap/react';
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
- * Additional metadata about an image attachment upload.
13
+ * A unique ID for the image attachment.
8
14
  */
9
- metadata?: {
10
- /**
11
- * A unique ID for the image attachment.
12
- */
13
- attachmentId: string;
14
- /**
15
- * Specifies if the image attachment failed to upload.
16
- */
17
- isUploadFailed: boolean;
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
- interface Commands<ReturnType> {
30
- richTextImage: {
31
- /**
32
- * Inserts an image into the editor with the given attributes.
33
- */
34
- insertImage: (attributes: RichTextImageAttributes) => ReturnType;
35
- /**
36
- * Updates the attributes for an existing image in the editor.
37
- */
38
- updateImage: (attributes: Partial<RichTextImageAttributes> & Required<Pick<RichTextImageAttributes, 'metadata'>>) => ReturnType;
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
- * A list of accepted MIME types for images pasting.
48
- */
49
- acceptedImageMimeTypes: string[];
50
- /**
51
- * Renders the image node inline (e.g., <p><img src="doist.jpg"></p>). By default images are on
52
- * the same level as paragraphs.
53
- */
54
- inline: boolean;
55
- /**
56
- * Custom HTML attributes that should be added to the rendered HTML tag.
57
- */
58
- HTMLAttributes: Record<string, string>;
59
- /**
60
- * A React component to render inside the interactive node view.
61
- */
62
- NodeViewComponent?: React.ComponentType<ReactNodeViewProps>;
63
- /**
64
- * The event handler that is fired when an image file is pasted.
65
- */
66
- onImageFilePaste?: (file: File) => void;
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
- declare const RichTextImage: import("@tiptap/core").Node<RichTextImageOptions, any>;
73
- export { RichTextImage };
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","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-image.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAEvD;;GAEG;AACH,KAAK,uBAAuB,GAAG;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP;;WAEG;QACH,YAAY,EAAE,MAAM,CAAA;QAEpB;;WAEG;QACH,cAAc,EAAE,OAAO,CAAA;QAEvB;;WAEG;QACH,cAAc,EAAE,MAAM,CAAA;KACzB,CAAA;CACJ,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,GAC7B,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,CAAA;AAEpD;;;GAGG;AACH,OAAO,QAAQ,cAAc,CAAC;IAC1B,UAAU,QAAQ,CAAC,UAAU;QACzB,aAAa,EAAE;YACX;;eAEG;YACH,WAAW,EAAE,CAAC,UAAU,EAAE,uBAAuB,KAAK,UAAU,CAAA;YAEhE;;eAEG;YACH,WAAW,EAAE,CACT,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,GACxC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC,KACtD,UAAU,CAAA;SAClB,CAAA;KACJ;CACJ;AAED;;GAEG;AACH,KAAK,oBAAoB,GAAG;IACxB;;OAEG;IACH,sBAAsB,EAAE,MAAM,EAAE,CAAA;IAEhC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAA;IAEf;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAEtC;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAA;IAE3D;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED;;;GAGG;AACH,QAAA,MAAM,aAAa,wDAoHjB,CAAA;AAEF,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,CAAA"}
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"}