@doist/typist 10.0.0-next.1 → 10.0.0-next.2

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 (236) hide show
  1. package/dist/components/typist-editor.d.ts +126 -123
  2. package/dist/components/typist-editor.d.ts.map +1 -1
  3. package/dist/components/typist-editor.helper.d.ts +8 -11
  4. package/dist/components/typist-editor.helper.d.ts.map +1 -1
  5. package/dist/components/typist-editor.helper.js +21 -19
  6. package/dist/components/typist-editor.helper.js.map +1 -0
  7. package/dist/components/typist-editor.js +133 -135
  8. package/dist/components/typist-editor.js.map +1 -0
  9. package/dist/constants/common.js +9 -5
  10. package/dist/constants/common.js.map +1 -0
  11. package/dist/constants/extension-priorities.d.ts +3 -1
  12. package/dist/constants/extension-priorities.d.ts.map +1 -1
  13. package/dist/constants/extension-priorities.js +34 -30
  14. package/dist/constants/extension-priorities.js.map +1 -0
  15. package/dist/constants/regular-expressions.js +14 -10
  16. package/dist/constants/regular-expressions.js.map +1 -0
  17. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts +12 -9
  18. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.d.ts.map +1 -1
  19. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js +16 -19
  20. package/dist/extensions/core/extra-editor-commands/commands/create-paragraph-end.js.map +1 -0
  21. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts +12 -9
  22. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.d.ts.map +1 -1
  23. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js +25 -28
  24. package/dist/extensions/core/extra-editor-commands/commands/extend-word-range.js.map +1 -0
  25. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts +24 -22
  26. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.d.ts.map +1 -1
  27. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js +34 -36
  28. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content-at.js.map +1 -0
  29. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts +23 -20
  30. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.d.ts.map +1 -1
  31. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js +15 -8
  32. package/dist/extensions/core/extra-editor-commands/commands/insert-markdown-content.js.map +1 -0
  33. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js +22 -18
  34. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.js.map +1 -0
  35. package/dist/extensions/core/view-event-handlers.d.ts +14 -13
  36. package/dist/extensions/core/view-event-handlers.d.ts.map +1 -1
  37. package/dist/extensions/core/view-event-handlers.js +33 -31
  38. package/dist/extensions/core/view-event-handlers.js.map +1 -0
  39. package/dist/extensions/plain-text/paste-multiline-text.js +45 -59
  40. package/dist/extensions/plain-text/paste-multiline-text.js.map +1 -0
  41. package/dist/extensions/plain-text/plain-text-document.d.ts +7 -7
  42. package/dist/extensions/plain-text/plain-text-document.d.ts.map +1 -1
  43. package/dist/extensions/plain-text/plain-text-document.js +14 -13
  44. package/dist/extensions/plain-text/plain-text-document.js.map +1 -0
  45. package/dist/extensions/plain-text/plain-text-kit.d.ts +35 -33
  46. package/dist/extensions/plain-text/plain-text-kit.d.ts.map +1 -1
  47. package/dist/extensions/plain-text/plain-text-kit.js +33 -48
  48. package/dist/extensions/plain-text/plain-text-kit.js.map +1 -0
  49. package/dist/extensions/plain-text/plain-text-paragraph.d.ts +2 -9
  50. package/dist/extensions/plain-text/plain-text-paragraph.js +11 -11
  51. package/dist/extensions/plain-text/plain-text-paragraph.js.map +1 -0
  52. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js +37 -81
  53. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.js.map +1 -0
  54. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js +32 -42
  55. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.js.map +1 -0
  56. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js +24 -37
  57. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.js.map +1 -0
  58. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js +21 -13
  59. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.js.map +1 -0
  60. package/dist/extensions/rich-text/bold-and-italics.js +42 -40
  61. package/dist/extensions/rich-text/bold-and-italics.js.map +1 -0
  62. package/dist/extensions/rich-text/curvenote-codemark.js +16 -14
  63. package/dist/extensions/rich-text/curvenote-codemark.js.map +1 -0
  64. package/dist/extensions/rich-text/paste-emojis.js +20 -22
  65. package/dist/extensions/rich-text/paste-emojis.js.map +1 -0
  66. package/dist/extensions/rich-text/paste-markdown.js +46 -86
  67. package/dist/extensions/rich-text/paste-markdown.js.map +1 -0
  68. package/dist/extensions/rich-text/rich-text-bullet-list.d.ts +10 -9
  69. package/dist/extensions/rich-text/rich-text-bullet-list.d.ts.map +1 -1
  70. package/dist/extensions/rich-text/rich-text-bullet-list.js +42 -56
  71. package/dist/extensions/rich-text/rich-text-bullet-list.js.map +1 -0
  72. package/dist/extensions/rich-text/rich-text-code.js +34 -34
  73. package/dist/extensions/rich-text/rich-text-code.js.map +1 -0
  74. package/dist/extensions/rich-text/rich-text-document.d.ts +7 -7
  75. package/dist/extensions/rich-text/rich-text-document.d.ts.map +1 -1
  76. package/dist/extensions/rich-text/rich-text-document.js +14 -13
  77. package/dist/extensions/rich-text/rich-text-document.js.map +1 -0
  78. package/dist/extensions/rich-text/rich-text-heading.d.ts +5 -4
  79. package/dist/extensions/rich-text/rich-text-heading.d.ts.map +1 -1
  80. package/dist/extensions/rich-text/rich-text-heading.js +25 -25
  81. package/dist/extensions/rich-text/rich-text-heading.js.map +1 -0
  82. package/dist/extensions/rich-text/rich-text-image.d.ts +53 -52
  83. package/dist/extensions/rich-text/rich-text-image.d.ts.map +1 -1
  84. package/dist/extensions/rich-text/rich-text-image.js +88 -105
  85. package/dist/extensions/rich-text/rich-text-image.js.map +1 -0
  86. package/dist/extensions/rich-text/rich-text-kit.d.ts +127 -125
  87. package/dist/extensions/rich-text/rich-text-kit.d.ts.map +1 -1
  88. package/dist/extensions/rich-text/rich-text-kit.js +73 -135
  89. package/dist/extensions/rich-text/rich-text-kit.js.map +1 -0
  90. package/dist/extensions/rich-text/rich-text-link.d.ts +5 -4
  91. package/dist/extensions/rich-text/rich-text-link.d.ts.map +1 -1
  92. package/dist/extensions/rich-text/rich-text-link.js +82 -90
  93. package/dist/extensions/rich-text/rich-text-link.js.map +1 -0
  94. package/dist/extensions/rich-text/rich-text-ordered-list.d.ts +10 -9
  95. package/dist/extensions/rich-text/rich-text-ordered-list.d.ts.map +1 -1
  96. package/dist/extensions/rich-text/rich-text-ordered-list.js +42 -56
  97. package/dist/extensions/rich-text/rich-text-ordered-list.js.map +1 -0
  98. package/dist/extensions/rich-text/rich-text-strikethrough.d.ts +5 -4
  99. package/dist/extensions/rich-text/rich-text-strikethrough.d.ts.map +1 -1
  100. package/dist/extensions/rich-text/rich-text-strikethrough.js +10 -10
  101. package/dist/extensions/rich-text/rich-text-strikethrough.js.map +1 -0
  102. package/dist/extensions/shared/copy-markdown-source.js +22 -31
  103. package/dist/extensions/shared/copy-markdown-source.js.map +1 -0
  104. package/dist/extensions/shared/paste-html-table-as-string.js +47 -60
  105. package/dist/extensions/shared/paste-html-table-as-string.js.map +1 -0
  106. package/dist/extensions/shared/paste-singleline-text.js +31 -39
  107. package/dist/extensions/shared/paste-singleline-text.js.map +1 -0
  108. package/dist/factories/create-suggestion-extension.d.ts +74 -74
  109. package/dist/factories/create-suggestion-extension.d.ts.map +1 -1
  110. package/dist/factories/create-suggestion-extension.js +139 -161
  111. package/dist/factories/create-suggestion-extension.js.map +1 -0
  112. package/dist/helpers/dom.js +9 -5
  113. package/dist/helpers/dom.js.map +1 -0
  114. package/dist/helpers/schema.d.ts +5 -3
  115. package/dist/helpers/schema.d.ts.map +1 -1
  116. package/dist/helpers/schema.js +25 -21
  117. package/dist/helpers/schema.js.map +1 -0
  118. package/dist/helpers/serializer.js +24 -28
  119. package/dist/helpers/serializer.js.map +1 -0
  120. package/dist/helpers/unified.js +24 -17
  121. package/dist/helpers/unified.js.map +1 -0
  122. package/dist/hooks/use-editor.js +50 -53
  123. package/dist/hooks/use-editor.js.map +1 -0
  124. package/dist/index.d.ts +25 -31
  125. package/dist/index.js +24 -24
  126. package/dist/serializers/html/html.d.ts +12 -10
  127. package/dist/serializers/html/html.d.ts.map +1 -1
  128. package/dist/serializers/html/html.js +67 -127
  129. package/dist/serializers/html/html.js.map +1 -0
  130. package/dist/serializers/html/plugins/rehype-code-block.js +17 -17
  131. package/dist/serializers/html/plugins/rehype-code-block.js.map +1 -0
  132. package/dist/serializers/html/plugins/rehype-image.js +20 -30
  133. package/dist/serializers/html/plugins/rehype-image.js.map +1 -0
  134. package/dist/serializers/html/plugins/rehype-suggestions.js +31 -32
  135. package/dist/serializers/html/plugins/rehype-suggestions.js.map +1 -0
  136. package/dist/serializers/html/plugins/rehype-task-list.js +31 -32
  137. package/dist/serializers/html/plugins/rehype-task-list.js.map +1 -0
  138. package/dist/serializers/html/plugins/remark-autolink-literal.d.ts +4 -1
  139. package/dist/serializers/html/plugins/remark-autolink-literal.d.ts.map +1 -1
  140. package/dist/serializers/html/plugins/remark-autolink-literal.js +25 -21
  141. package/dist/serializers/html/plugins/remark-autolink-literal.js.map +1 -0
  142. package/dist/serializers/html/plugins/remark-disable-constructs.js +21 -41
  143. package/dist/serializers/html/plugins/remark-disable-constructs.js.map +1 -0
  144. package/dist/serializers/html/plugins/remark-strikethrough.d.ts +5 -2
  145. package/dist/serializers/html/plugins/remark-strikethrough.d.ts.map +1 -1
  146. package/dist/serializers/html/plugins/remark-strikethrough.js +25 -21
  147. package/dist/serializers/html/plugins/remark-strikethrough.js.map +1 -0
  148. package/dist/serializers/markdown/markdown.d.ts +13 -12
  149. package/dist/serializers/markdown/markdown.d.ts.map +1 -1
  150. package/dist/serializers/markdown/markdown.js +78 -154
  151. package/dist/serializers/markdown/markdown.js.map +1 -0
  152. package/dist/serializers/markdown/plugins/image.js +27 -24
  153. package/dist/serializers/markdown/plugins/image.js.map +1 -0
  154. package/dist/serializers/markdown/plugins/list-item.js +32 -37
  155. package/dist/serializers/markdown/plugins/list-item.js.map +1 -0
  156. package/dist/serializers/markdown/plugins/paragraph.js +19 -19
  157. package/dist/serializers/markdown/plugins/paragraph.js.map +1 -0
  158. package/dist/serializers/markdown/plugins/strikethrough.js +23 -19
  159. package/dist/serializers/markdown/plugins/strikethrough.js.map +1 -0
  160. package/dist/serializers/markdown/plugins/suggestion.js +21 -19
  161. package/dist/serializers/markdown/plugins/suggestion.js.map +1 -0
  162. package/dist/serializers/markdown/plugins/task-item.js +31 -35
  163. package/dist/serializers/markdown/plugins/task-item.js.map +1 -0
  164. package/dist/utilities/can-insert-node-at.d.ts +12 -5
  165. package/dist/utilities/can-insert-node-at.d.ts.map +1 -1
  166. package/dist/utilities/can-insert-node-at.js +10 -8
  167. package/dist/utilities/can-insert-node-at.js.map +1 -0
  168. package/dist/utilities/can-insert-suggestion.d.ts +11 -5
  169. package/dist/utilities/can-insert-suggestion.d.ts.map +1 -1
  170. package/dist/utilities/can-insert-suggestion.js +15 -12
  171. package/dist/utilities/can-insert-suggestion.js.map +1 -0
  172. package/package.json +4 -3
  173. package/dist/constants/common.d.ts +0 -10
  174. package/dist/constants/common.d.ts.map +0 -1
  175. package/dist/constants/regular-expressions.d.ts +0 -18
  176. package/dist/constants/regular-expressions.d.ts.map +0 -1
  177. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts +0 -9
  178. package/dist/extensions/core/extra-editor-commands/extra-editor-commands.d.ts.map +0 -1
  179. package/dist/extensions/plain-text/paste-multiline-text.d.ts +0 -10
  180. package/dist/extensions/plain-text/paste-multiline-text.d.ts.map +0 -1
  181. package/dist/extensions/plain-text/plain-text-paragraph.d.ts.map +0 -1
  182. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts +0 -9
  183. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-lists.d.ts.map +0 -1
  184. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts +0 -9
  185. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-select-wrap.d.ts.map +0 -1
  186. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts +0 -9
  187. package/dist/extensions/plain-text/smart-markdown-typing/plugins/smart-url-pasting.d.ts.map +0 -1
  188. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts +0 -8
  189. package/dist/extensions/plain-text/smart-markdown-typing/smart-markdown-typing.d.ts.map +0 -1
  190. package/dist/extensions/rich-text/bold-and-italics.d.ts +0 -8
  191. package/dist/extensions/rich-text/bold-and-italics.d.ts.map +0 -1
  192. package/dist/extensions/rich-text/curvenote-codemark.d.ts +0 -11
  193. package/dist/extensions/rich-text/curvenote-codemark.d.ts.map +0 -1
  194. package/dist/extensions/rich-text/paste-emojis.d.ts +0 -9
  195. package/dist/extensions/rich-text/paste-emojis.d.ts.map +0 -1
  196. package/dist/extensions/rich-text/paste-markdown.d.ts +0 -11
  197. package/dist/extensions/rich-text/paste-markdown.d.ts.map +0 -1
  198. package/dist/extensions/rich-text/rich-text-code.d.ts +0 -17
  199. package/dist/extensions/rich-text/rich-text-code.d.ts.map +0 -1
  200. package/dist/extensions/shared/copy-markdown-source.d.ts +0 -20
  201. package/dist/extensions/shared/copy-markdown-source.d.ts.map +0 -1
  202. package/dist/extensions/shared/paste-html-table-as-string.d.ts +0 -20
  203. package/dist/extensions/shared/paste-html-table-as-string.d.ts.map +0 -1
  204. package/dist/extensions/shared/paste-singleline-text.d.ts +0 -10
  205. package/dist/extensions/shared/paste-singleline-text.d.ts.map +0 -1
  206. package/dist/helpers/dom.d.ts +0 -8
  207. package/dist/helpers/dom.d.ts.map +0 -1
  208. package/dist/helpers/serializer.d.ts +0 -21
  209. package/dist/helpers/serializer.d.ts.map +0 -1
  210. package/dist/helpers/unified.d.ts +0 -21
  211. package/dist/helpers/unified.d.ts.map +0 -1
  212. package/dist/hooks/use-editor.d.ts +0 -19
  213. package/dist/hooks/use-editor.d.ts.map +0 -1
  214. package/dist/index.d.ts.map +0 -1
  215. package/dist/serializers/html/plugins/rehype-code-block.d.ts +0 -10
  216. package/dist/serializers/html/plugins/rehype-code-block.d.ts.map +0 -1
  217. package/dist/serializers/html/plugins/rehype-image.d.ts +0 -11
  218. package/dist/serializers/html/plugins/rehype-image.d.ts.map +0 -1
  219. package/dist/serializers/html/plugins/rehype-suggestions.d.ts +0 -10
  220. package/dist/serializers/html/plugins/rehype-suggestions.d.ts.map +0 -1
  221. package/dist/serializers/html/plugins/rehype-task-list.d.ts +0 -7
  222. package/dist/serializers/html/plugins/rehype-task-list.d.ts.map +0 -1
  223. package/dist/serializers/html/plugins/remark-disable-constructs.d.ts +0 -11
  224. package/dist/serializers/html/plugins/remark-disable-constructs.d.ts.map +0 -1
  225. package/dist/serializers/markdown/plugins/image.d.ts +0 -12
  226. package/dist/serializers/markdown/plugins/image.d.ts.map +0 -1
  227. package/dist/serializers/markdown/plugins/list-item.d.ts +0 -14
  228. package/dist/serializers/markdown/plugins/list-item.d.ts.map +0 -1
  229. package/dist/serializers/markdown/plugins/paragraph.d.ts +0 -13
  230. package/dist/serializers/markdown/plugins/paragraph.d.ts.map +0 -1
  231. package/dist/serializers/markdown/plugins/strikethrough.d.ts +0 -13
  232. package/dist/serializers/markdown/plugins/strikethrough.d.ts.map +0 -1
  233. package/dist/serializers/markdown/plugins/suggestion.d.ts +0 -11
  234. package/dist/serializers/markdown/plugins/suggestion.d.ts.map +0 -1
  235. package/dist/serializers/markdown/plugins/task-item.d.ts +0 -14
  236. package/dist/serializers/markdown/plugins/task-item.d.ts.map +0 -1
@@ -1,109 +1,92 @@
1
- import { Image } from '@tiptap/extension-image';
2
- import { Plugin, PluginKey, Selection } from '@tiptap/pm/state';
3
- import { ReactNodeViewRenderer } from '@tiptap/react';
1
+ import { ReactNodeViewRenderer } from "@tiptap/react";
2
+ import { Plugin, PluginKey, Selection } from "@tiptap/pm/state";
3
+ import { Image } from "@tiptap/extension-image";
4
+ //#region src/extensions/rich-text/rich-text-image.ts
4
5
  /**
5
- * Custom extension that extends the built-in `Image` extension to add support for image pasting,
6
- * and also adds the ability to pass aditional metadata about an image attachment upload.
7
- */
6
+ * Custom extension that extends the built-in `Image` extension to add support for image pasting,
7
+ * and also adds the ability to pass aditional metadata about an image attachment upload.
8
+ */
8
9
  const RichTextImage = Image.extend({
9
- draggable: true,
10
- addOptions() {
11
- return {
12
- ...this.parent?.(),
13
- acceptedImageMimeTypes: ['image/gif', 'image/jpeg', 'image/jpg', 'image/png'],
14
- NodeViewComponent: undefined,
15
- };
16
- },
17
- addAttributes() {
18
- return {
19
- ...this.parent?.(),
20
- metadata: {
21
- default: null,
22
- rendered: false,
23
- },
24
- };
25
- },
26
- addCommands() {
27
- const { name: nodeTypeName } = this;
28
- return {
29
- ...this.parent?.(),
30
- insertImage(attributes) {
31
- return ({ editor, commands }) => {
32
- const selectionAtEnd = Selection.atEnd(editor.state.doc);
33
- return commands.insertContent([
34
- {
35
- type: nodeTypeName,
36
- attrs: attributes,
37
- },
38
- // Insert a blank paragraph after the image when at the end of the document
39
- ...(editor.state.selection.to === selectionAtEnd.to
40
- ? [{ type: 'paragraph' }]
41
- : []),
42
- ]);
43
- };
44
- },
45
- updateImage(attributes) {
46
- return ({ commands }) => {
47
- return commands.command(({ tr }) => {
48
- tr.doc.descendants((node, position) => {
49
- const { metadata } = node.attrs;
50
- // Update the image attributes to the corresponding node
51
- if (node.type.name === nodeTypeName &&
52
- metadata?.attachmentId === attributes.metadata?.attachmentId) {
53
- tr.setNodeMarkup(position, node.type, {
54
- ...node.attrs,
55
- ...attributes,
56
- });
57
- }
58
- });
59
- return true;
60
- });
61
- };
62
- },
63
- };
64
- },
65
- addNodeView() {
66
- const { NodeViewComponent } = this.options;
67
- // Do not add a node view if component was not specified
68
- if (!NodeViewComponent) {
69
- return () => ({});
70
- }
71
- // Render the node view with the provided React component
72
- return ReactNodeViewRenderer(NodeViewComponent, {
73
- as: 'div',
74
- className: `Typist-${this.type.name}`,
75
- });
76
- },
77
- addProseMirrorPlugins() {
78
- const { acceptedImageMimeTypes, onImageFilePaste } = this.options;
79
- return [
80
- new Plugin({
81
- key: new PluginKey(this.name),
82
- props: {
83
- handlePaste(_, event) {
84
- // Do not handle the event if we don't have a callback
85
- if (!onImageFilePaste) {
86
- return false;
87
- }
88
- const pastedFiles = Array.from(event.clipboardData?.files || []);
89
- // Do not handle the event if no files were pasted
90
- if (pastedFiles.length === 0) {
91
- return false;
92
- }
93
- let wasPasteHandled = false;
94
- // Invoke the callback for every pasted file that is an accepted image type
95
- pastedFiles.forEach((pastedFile) => {
96
- if (acceptedImageMimeTypes.includes(pastedFile.type)) {
97
- onImageFilePaste(pastedFile);
98
- wasPasteHandled = true;
99
- }
100
- });
101
- // Suppress the default handling behaviour if at least one image was handled
102
- return wasPasteHandled;
103
- },
104
- },
105
- }),
106
- ];
107
- },
10
+ draggable: true,
11
+ addOptions() {
12
+ return {
13
+ ...this.parent?.(),
14
+ acceptedImageMimeTypes: [
15
+ "image/gif",
16
+ "image/jpeg",
17
+ "image/jpg",
18
+ "image/png"
19
+ ],
20
+ NodeViewComponent: void 0
21
+ };
22
+ },
23
+ addAttributes() {
24
+ return {
25
+ ...this.parent?.(),
26
+ metadata: {
27
+ default: null,
28
+ rendered: false
29
+ }
30
+ };
31
+ },
32
+ addCommands() {
33
+ const { name: nodeTypeName } = this;
34
+ return {
35
+ ...this.parent?.(),
36
+ insertImage(attributes) {
37
+ return ({ editor, commands }) => {
38
+ const selectionAtEnd = Selection.atEnd(editor.state.doc);
39
+ return commands.insertContent([{
40
+ type: nodeTypeName,
41
+ attrs: attributes
42
+ }, ...editor.state.selection.to === selectionAtEnd.to ? [{ type: "paragraph" }] : []]);
43
+ };
44
+ },
45
+ updateImage(attributes) {
46
+ return ({ commands }) => {
47
+ return commands.command(({ tr }) => {
48
+ tr.doc.descendants((node, position) => {
49
+ const { metadata } = node.attrs;
50
+ if (node.type.name === nodeTypeName && metadata?.attachmentId === attributes.metadata?.attachmentId) tr.setNodeMarkup(position, node.type, {
51
+ ...node.attrs,
52
+ ...attributes
53
+ });
54
+ });
55
+ return true;
56
+ });
57
+ };
58
+ }
59
+ };
60
+ },
61
+ addNodeView() {
62
+ const { NodeViewComponent } = this.options;
63
+ if (!NodeViewComponent) return () => ({});
64
+ return ReactNodeViewRenderer(NodeViewComponent, {
65
+ as: "div",
66
+ className: `Typist-${this.type.name}`
67
+ });
68
+ },
69
+ addProseMirrorPlugins() {
70
+ const { acceptedImageMimeTypes, onImageFilePaste } = this.options;
71
+ return [new Plugin({
72
+ key: new PluginKey(this.name),
73
+ props: { handlePaste(_, event) {
74
+ if (!onImageFilePaste) return false;
75
+ const pastedFiles = Array.from(event.clipboardData?.files || []);
76
+ if (pastedFiles.length === 0) return false;
77
+ let wasPasteHandled = false;
78
+ pastedFiles.forEach((pastedFile) => {
79
+ if (acceptedImageMimeTypes.includes(pastedFile.type)) {
80
+ onImageFilePaste(pastedFile);
81
+ wasPasteHandled = true;
82
+ }
83
+ });
84
+ return wasPasteHandled;
85
+ } }
86
+ })];
87
+ }
108
88
  });
89
+ //#endregion
109
90
  export { RichTextImage };
91
+
92
+ //# sourceMappingURL=rich-text-image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rich-text-image.js","names":[],"sources":["../../../src/extensions/rich-text/rich-text-image.ts"],"sourcesContent":["import { Image } from '@tiptap/extension-image'\nimport { Plugin, PluginKey, Selection } from '@tiptap/pm/state'\nimport { ReactNodeViewRenderer } from '@tiptap/react'\n\nimport type { NodeView } from '@tiptap/pm/view'\nimport type { ReactNodeViewProps } from '@tiptap/react'\n\n/**\n * The properties that describe `RichTextImage` node attributes.\n */\ntype RichTextImageAttributes = {\n /**\n * Additional metadata about an image attachment upload.\n */\n metadata?: {\n /**\n * A unique ID for the image attachment.\n */\n attachmentId: string\n\n /**\n * Specifies if the image attachment failed to upload.\n */\n isUploadFailed: boolean\n\n /**\n * The upload progress for the image attachment.\n */\n uploadProgress: number\n }\n} & Pick<HTMLImageElement, 'src'> &\n Pick<Partial<HTMLImageElement>, 'alt' | 'title'>\n\n/**\n * Augment the official `@tiptap/core` module with extra commands, relevant for this extension, so\n * that the compiler knows about them.\n */\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n richTextImage: {\n /**\n * Inserts an image into the editor with the given attributes.\n */\n insertImage: (attributes: RichTextImageAttributes) => ReturnType\n\n /**\n * Updates the attributes for an existing image in the editor.\n */\n updateImage: (\n attributes: Partial<RichTextImageAttributes> &\n Required<Pick<RichTextImageAttributes, 'metadata'>>,\n ) => ReturnType\n }\n }\n}\n\n/**\n * The options available to customize the `RichTextImage` extension.\n */\ntype RichTextImageOptions = {\n /**\n * A list of accepted MIME types for images pasting.\n */\n acceptedImageMimeTypes: string[]\n\n /**\n * Renders the image node inline (e.g., <p><img src=\"doist.jpg\"></p>). By default images are on\n * the same level as paragraphs.\n */\n inline: boolean\n\n /**\n * Custom HTML attributes that should be added to the rendered HTML tag.\n */\n HTMLAttributes: Record<string, string>\n\n /**\n * A React component to render inside the interactive node view.\n */\n NodeViewComponent?: React.ComponentType<ReactNodeViewProps>\n\n /**\n * The event handler that is fired when an image file is pasted.\n */\n onImageFilePaste?: (file: File) => void\n}\n\n/**\n * Custom extension that extends the built-in `Image` extension to add support for image pasting,\n * and also adds the ability to pass aditional metadata about an image attachment upload.\n */\nconst RichTextImage = Image.extend<RichTextImageOptions>({\n draggable: true,\n addOptions() {\n return {\n ...this.parent?.(),\n acceptedImageMimeTypes: ['image/gif', 'image/jpeg', 'image/jpg', 'image/png'],\n NodeViewComponent: undefined,\n }\n },\n addAttributes() {\n return {\n ...this.parent?.(),\n metadata: {\n default: null,\n rendered: false,\n },\n }\n },\n addCommands() {\n const { name: nodeTypeName } = this\n\n return {\n ...this.parent?.(),\n insertImage(attributes) {\n return ({ editor, commands }) => {\n const selectionAtEnd = Selection.atEnd(editor.state.doc)\n\n return commands.insertContent([\n {\n type: nodeTypeName,\n attrs: attributes,\n },\n // Insert a blank paragraph after the image when at the end of the document\n ...(editor.state.selection.to === selectionAtEnd.to\n ? [{ type: 'paragraph' }]\n : []),\n ])\n }\n },\n updateImage(attributes) {\n return ({ commands }) => {\n return commands.command(({ tr }) => {\n tr.doc.descendants((node, position) => {\n const { metadata } = node.attrs as {\n metadata: RichTextImageAttributes['metadata']\n }\n\n // Update the image attributes to the corresponding node\n if (\n node.type.name === nodeTypeName &&\n metadata?.attachmentId === attributes.metadata?.attachmentId\n ) {\n tr.setNodeMarkup(position, node.type, {\n ...node.attrs,\n ...attributes,\n })\n }\n })\n\n return true\n })\n }\n },\n }\n },\n addNodeView() {\n const { NodeViewComponent } = this.options\n\n // Do not add a node view if component was not specified\n if (!NodeViewComponent) {\n return () => ({}) as NodeView\n }\n\n // Render the node view with the provided React component\n return ReactNodeViewRenderer(NodeViewComponent, {\n as: 'div',\n className: `Typist-${this.type.name}`,\n })\n },\n addProseMirrorPlugins() {\n const { acceptedImageMimeTypes, onImageFilePaste } = this.options\n\n return [\n new Plugin({\n key: new PluginKey(this.name),\n props: {\n handlePaste(_, event) {\n // Do not handle the event if we don't have a callback\n if (!onImageFilePaste) {\n return false\n }\n\n const pastedFiles = Array.from(event.clipboardData?.files || [])\n\n // Do not handle the event if no files were pasted\n if (pastedFiles.length === 0) {\n return false\n }\n\n let wasPasteHandled = false\n\n // Invoke the callback for every pasted file that is an accepted image type\n pastedFiles.forEach((pastedFile) => {\n if (acceptedImageMimeTypes.includes(pastedFile.type)) {\n onImageFilePaste(pastedFile)\n wasPasteHandled = true\n }\n })\n\n // Suppress the default handling behaviour if at least one image was handled\n return wasPasteHandled\n },\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K;AAE1D,SAAO,CACH,IAAI,OAAO;GACP,KAAK,IAAI,UAAU,KAAK,KAAK;GAC7B,OAAO,EACH,YAAY,GAAG,OAAO;AAElB,QAAI,CAAC,iBACD,QAAO;IAGX,MAAM,cAAc,MAAM,KAAK,MAAM,eAAe,SAAS,EAAE,CAAC;AAGhE,QAAI,YAAY,WAAW,EACvB,QAAO;IAGX,IAAI,kBAAkB;AAGtB,gBAAY,SAAS,eAAe;AAChC,SAAI,uBAAuB,SAAS,WAAW,KAAK,EAAE;AAClD,uBAAiB,WAAW;AAC5B,wBAAkB;;MAExB;AAGF,WAAO;MAEd;GACJ,CAAC,CACL;;CAER,CAAC"}
@@ -1,131 +1,133 @@
1
- import { Extension } from '@tiptap/core';
2
- import { RichTextHeadingOptions } from './rich-text-heading';
3
- import type { BlockquoteOptions } from '@tiptap/extension-blockquote';
4
- import type { BoldOptions } from '@tiptap/extension-bold';
5
- import type { CodeOptions } from '@tiptap/extension-code';
6
- import type { CodeBlockOptions } from '@tiptap/extension-code-block';
7
- import type { DropcursorOptions } from '@tiptap/extension-dropcursor';
8
- import type { HardBreakOptions } from '@tiptap/extension-hard-break';
9
- import type { HistoryOptions } from '@tiptap/extension-history';
10
- import type { HorizontalRuleOptions } from '@tiptap/extension-horizontal-rule';
11
- import type { ItalicOptions } from '@tiptap/extension-italic';
12
- import type { ListItemOptions } from '@tiptap/extension-list-item';
13
- import type { ListKeymapOptions } from '@tiptap/extension-list-keymap';
14
- import type { ParagraphOptions } from '@tiptap/extension-paragraph';
15
- import type { RichTextBulletListOptions } from './rich-text-bullet-list';
16
- import type { RichTextDocumentOptions } from './rich-text-document';
17
- import type { RichTextImageOptions } from './rich-text-image';
18
- import type { RichTextLinkOptions } from './rich-text-link';
19
- import type { RichTextOrderedListOptions } from './rich-text-ordered-list';
20
- import type { RichTextStrikethroughOptions } from './rich-text-strikethrough';
1
+ import { RichTextImageOptions } from "./rich-text-image.js";
2
+ import { RichTextHeadingOptions } from "./rich-text-heading.js";
3
+ import { RichTextBulletListOptions } from "./rich-text-bullet-list.js";
4
+ import { RichTextDocumentOptions } from "./rich-text-document.js";
5
+ import { RichTextLinkOptions } from "./rich-text-link.js";
6
+ import { RichTextOrderedListOptions } from "./rich-text-ordered-list.js";
7
+ import { RichTextStrikethroughOptions } from "./rich-text-strikethrough.js";
8
+ import { Extension } from "@tiptap/core";
9
+ import { HistoryOptions } from "@tiptap/extension-history";
10
+ import { ParagraphOptions } from "@tiptap/extension-paragraph";
11
+ import { BlockquoteOptions } from "@tiptap/extension-blockquote";
12
+ import { BoldOptions } from "@tiptap/extension-bold";
13
+ import { CodeBlockOptions } from "@tiptap/extension-code-block";
14
+ import { DropcursorOptions } from "@tiptap/extension-dropcursor";
15
+ import { HardBreakOptions } from "@tiptap/extension-hard-break";
16
+ import { HorizontalRuleOptions } from "@tiptap/extension-horizontal-rule";
17
+ import { ItalicOptions } from "@tiptap/extension-italic";
18
+ import { ListItemOptions } from "@tiptap/extension-list-item";
19
+ import { ListKeymapOptions } from "@tiptap/extension-list-keymap";
20
+ import { CodeOptions } from "@tiptap/extension-code";
21
+
22
+ //#region src/extensions/rich-text/rich-text-kit.d.ts
21
23
  /**
22
24
  * The options available to customize the `RichTextKit` extension.
23
25
  */
24
26
  type RichTextKitOptions = {
25
- /**
26
- * Set options for the `Blockquote` extension, or `false` to disable.
27
- */
28
- blockquote: Partial<BlockquoteOptions> | false;
29
- /**
30
- * Set options for the `Bold` extension, or `false` to disable.
31
- */
32
- bold: Partial<BoldOptions> | false;
33
- /**
34
- * Set options for the `BulletList` extension, or `false` to disable.
35
- */
36
- bulletList: Partial<RichTextBulletListOptions> | false;
37
- /**
38
- * Set options for the `Code` extension, or `false` to disable.
39
- */
40
- code: Partial<CodeOptions> | false;
41
- /**
42
- * Set options for the `CodeBlock` extension, or `false` to disable.
43
- */
44
- codeBlock: Partial<CodeBlockOptions> | false;
45
- /**
46
- * Set options for the `Document` extension, or `false` to disable.
47
- */
48
- document: Partial<RichTextDocumentOptions> | false;
49
- /**
50
- * Set options for the `Dropcursor` extension, or `false` to disable.
51
- */
52
- dropCursor: Partial<DropcursorOptions> | false;
53
- /**
54
- * Set to `false` to disable the `Gapcursor` extension.
55
- */
56
- gapCursor: false;
57
- /**
58
- * Set options for the `HardBreak` extension, or `false` to disable.
59
- */
60
- hardBreak: Partial<HardBreakOptions> | false;
61
- /**
62
- * Set options for the `Heading` extension, or `false` to disable.
63
- */
64
- heading: Partial<RichTextHeadingOptions> | false;
65
- /**
66
- * Set options for the `History` extension, or `false` to disable.
67
- */
68
- history: Partial<HistoryOptions> | false;
69
- /**
70
- * Set options for the `HorizontalRule` extension, or `false` to disable.
71
- */
72
- horizontalRule: Partial<HorizontalRuleOptions> | false;
73
- /**
74
- * Set options for the `Image` extension, or `false` to disable.
75
- */
76
- image: Partial<RichTextImageOptions> | false;
77
- /**
78
- * Set options for the `Italic` extension, or `false` to disable.
79
- */
80
- italic: Partial<ItalicOptions> | false;
81
- /**
82
- * Set options for the `Link` extension, or `false` to disable.
83
- */
84
- link: Partial<RichTextLinkOptions> | false;
85
- /**
86
- * Set options for the `ListItem` extension, or `false` to disable.
87
- */
88
- listItem: Partial<ListItemOptions> | false;
89
- /**
90
- * Set options for the `ListKeymap` extension, or `false` to disable.
91
- */
92
- listKeymap: Partial<ListKeymapOptions> | false;
93
- /**
94
- * Set options for the `OrderedList` extension, or `false` to disable.
95
- */
96
- orderedList: Partial<RichTextOrderedListOptions> | false;
97
- /**
98
- * Set options for the `Paragraph` extension, or `false` to disable.
99
- */
100
- paragraph: Partial<ParagraphOptions> | false;
101
- /**
102
- * Set to `false` to disable the `PasteEmojis` extension.
103
- */
104
- pasteEmojis: false;
105
- /**
106
- * Set to `false` to disable the `PasteMarkdown` extension.
107
- */
108
- pasteMarkdown: false;
109
- /**
110
- * Set to `false` to disable the `PasteSinglelineText` extension.
111
- */
112
- pasteSinglelineText: false;
113
- /**
114
- * Set to `false` to disable the `PasteHTMLTableAsString` extension.
115
- */
116
- pasteHTMLTableAsString: false;
117
- /**
118
- * Set options for the `Strike` extension, or `false` to disable.
119
- */
120
- strike: Partial<RichTextStrikethroughOptions> | false;
121
- /**
122
- * Set to `false` to disable the `Text` extension.
123
- */
124
- text: false;
125
- /**
126
- * Set to `false` to disable the `Typography` extension.
127
- */
128
- typography: false;
27
+ /**
28
+ * Set options for the `Blockquote` extension, or `false` to disable.
29
+ */
30
+ blockquote: Partial<BlockquoteOptions> | false;
31
+ /**
32
+ * Set options for the `Bold` extension, or `false` to disable.
33
+ */
34
+ bold: Partial<BoldOptions> | false;
35
+ /**
36
+ * Set options for the `BulletList` extension, or `false` to disable.
37
+ */
38
+ bulletList: Partial<RichTextBulletListOptions> | false;
39
+ /**
40
+ * Set options for the `Code` extension, or `false` to disable.
41
+ */
42
+ code: Partial<CodeOptions> | false;
43
+ /**
44
+ * Set options for the `CodeBlock` extension, or `false` to disable.
45
+ */
46
+ codeBlock: Partial<CodeBlockOptions> | false;
47
+ /**
48
+ * Set options for the `Document` extension, or `false` to disable.
49
+ */
50
+ document: Partial<RichTextDocumentOptions> | false;
51
+ /**
52
+ * Set options for the `Dropcursor` extension, or `false` to disable.
53
+ */
54
+ dropCursor: Partial<DropcursorOptions> | false;
55
+ /**
56
+ * Set to `false` to disable the `Gapcursor` extension.
57
+ */
58
+ gapCursor: false;
59
+ /**
60
+ * Set options for the `HardBreak` extension, or `false` to disable.
61
+ */
62
+ hardBreak: Partial<HardBreakOptions> | false;
63
+ /**
64
+ * Set options for the `Heading` extension, or `false` to disable.
65
+ */
66
+ heading: Partial<RichTextHeadingOptions> | false;
67
+ /**
68
+ * Set options for the `History` extension, or `false` to disable.
69
+ */
70
+ history: Partial<HistoryOptions> | false;
71
+ /**
72
+ * Set options for the `HorizontalRule` extension, or `false` to disable.
73
+ */
74
+ horizontalRule: Partial<HorizontalRuleOptions> | false;
75
+ /**
76
+ * Set options for the `Image` extension, or `false` to disable.
77
+ */
78
+ image: Partial<RichTextImageOptions> | false;
79
+ /**
80
+ * Set options for the `Italic` extension, or `false` to disable.
81
+ */
82
+ italic: Partial<ItalicOptions> | false;
83
+ /**
84
+ * Set options for the `Link` extension, or `false` to disable.
85
+ */
86
+ link: Partial<RichTextLinkOptions> | false;
87
+ /**
88
+ * Set options for the `ListItem` extension, or `false` to disable.
89
+ */
90
+ listItem: Partial<ListItemOptions> | false;
91
+ /**
92
+ * Set options for the `ListKeymap` extension, or `false` to disable.
93
+ */
94
+ listKeymap: Partial<ListKeymapOptions> | false;
95
+ /**
96
+ * Set options for the `OrderedList` extension, or `false` to disable.
97
+ */
98
+ orderedList: Partial<RichTextOrderedListOptions> | false;
99
+ /**
100
+ * Set options for the `Paragraph` extension, or `false` to disable.
101
+ */
102
+ paragraph: Partial<ParagraphOptions> | false;
103
+ /**
104
+ * Set to `false` to disable the `PasteEmojis` extension.
105
+ */
106
+ pasteEmojis: false;
107
+ /**
108
+ * Set to `false` to disable the `PasteMarkdown` extension.
109
+ */
110
+ pasteMarkdown: false;
111
+ /**
112
+ * Set to `false` to disable the `PasteSinglelineText` extension.
113
+ */
114
+ pasteSinglelineText: false;
115
+ /**
116
+ * Set to `false` to disable the `PasteHTMLTableAsString` extension.
117
+ */
118
+ pasteHTMLTableAsString: false;
119
+ /**
120
+ * Set options for the `Strike` extension, or `false` to disable.
121
+ */
122
+ strike: Partial<RichTextStrikethroughOptions> | false;
123
+ /**
124
+ * Set to `false` to disable the `Text` extension.
125
+ */
126
+ text: false;
127
+ /**
128
+ * Set to `false` to disable the `Typography` extension.
129
+ */
130
+ typography: false;
129
131
  };
130
132
  /**
131
133
  * The `RichTextKit` extension is a collection of the minimal required extensions to have a full
@@ -133,6 +135,6 @@ type RichTextKitOptions = {
133
135
  * implementation, allowing almost every extension to be customized or disabled.
134
136
  */
135
137
  declare const RichTextKit: Extension<RichTextKitOptions, any>;
138
+ //#endregion
136
139
  export { RichTextKit };
137
- export type { RichTextKitOptions };
138
140
  //# sourceMappingURL=rich-text-kit.d.ts.map
@@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