reactjs-tiptap-editor 0.3.21 → 0.3.22

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 (222) hide show
  1. package/lib/{ActionMenuButton-BTFBZyG2.cjs → ActionMenuButton-B81uYOvt.cjs} +1 -1
  2. package/lib/{ActionMenuButton-DXwnYZhJ.js → ActionMenuButton-CtcDNq-L.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +41 -41
  5. package/lib/Attachment.d.ts +41 -41
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +41 -41
  9. package/lib/Blockquote.d.ts +41 -41
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +41 -41
  13. package/lib/Bold.d.ts +41 -41
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +41 -41
  17. package/lib/BulletList.d.ts +41 -41
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +41 -41
  21. package/lib/Clear.d.ts +41 -41
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +41 -41
  25. package/lib/Code.d.ts +41 -41
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +41 -41
  29. package/lib/CodeBlock.d.ts +41 -41
  30. package/lib/CodeBlock.js +1 -1
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +41 -41
  33. package/lib/CodeView.d.ts +41 -41
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +41 -41
  37. package/lib/Color.d.ts +41 -41
  38. package/lib/Color.js +1 -1
  39. package/lib/Document.d.cts +41 -41
  40. package/lib/Document.d.ts +41 -41
  41. package/lib/{Drawer-CVuwyG50.js → Drawer-BI_9XSqI.js} +1 -1
  42. package/lib/{Drawer-BrHHs2E9.cjs → Drawer-CHGZ5D6j.cjs} +1 -1
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +41 -41
  45. package/lib/Drawer.d.ts +41 -41
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +41 -41
  49. package/lib/Emoji.d.ts +41 -41
  50. package/lib/Emoji.js +116 -109
  51. package/lib/{Excalidraw-frMX4K62.js → Excalidraw-AIzEaOzF.js} +1 -1
  52. package/lib/{Excalidraw-Be_GDV4Q.cjs → Excalidraw-DOJiMnFl.cjs} +1 -1
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +41 -41
  55. package/lib/Excalidraw.d.ts +41 -41
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +1 -1
  58. package/lib/ExportPdf.d.cts +41 -41
  59. package/lib/ExportPdf.d.ts +41 -41
  60. package/lib/ExportPdf.js +1 -1
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +41 -41
  63. package/lib/ExportWord.d.ts +41 -41
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +41 -41
  67. package/lib/FontFamily.d.ts +41 -41
  68. package/lib/FontFamily.js +2 -2
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +41 -41
  71. package/lib/FontSize.d.ts +41 -41
  72. package/lib/FontSize.js +2 -2
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +41 -41
  75. package/lib/FormatPainter.d.ts +41 -41
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +41 -41
  79. package/lib/Heading.d.ts +41 -41
  80. package/lib/Heading.js +2 -2
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +41 -41
  83. package/lib/Highlight.d.ts +41 -41
  84. package/lib/Highlight.js +1 -1
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +41 -41
  87. package/lib/History.d.ts +41 -41
  88. package/lib/History.js +1 -1
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +41 -41
  91. package/lib/HorizontalRule.d.ts +41 -41
  92. package/lib/HorizontalRule.js +1 -1
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +41 -41
  95. package/lib/Iframe.d.ts +41 -41
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +41 -41
  99. package/lib/Image.d.ts +41 -41
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +41 -41
  103. package/lib/ImageGif.d.ts +41 -41
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +1 -1
  106. package/lib/ImportWord.d.cts +41 -41
  107. package/lib/ImportWord.d.ts +41 -41
  108. package/lib/ImportWord.js +1 -1
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +41 -41
  111. package/lib/Indent.d.ts +41 -41
  112. package/lib/Indent.js +1 -1
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +41 -41
  115. package/lib/Italic.d.ts +41 -41
  116. package/lib/Italic.js +1 -1
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +41 -41
  119. package/lib/Katex.d.ts +41 -41
  120. package/lib/Katex.js +2 -2
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +41 -41
  123. package/lib/LineHeight.d.ts +41 -41
  124. package/lib/LineHeight.js +1 -1
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +41 -41
  127. package/lib/Link.d.ts +41 -41
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +41 -41
  130. package/lib/ListItem.d.ts +41 -41
  131. package/lib/Mention.d.cts +41 -41
  132. package/lib/Mention.d.ts +41 -41
  133. package/lib/Mermaid.cjs +1 -1
  134. package/lib/Mermaid.d.cts +41 -41
  135. package/lib/Mermaid.d.ts +41 -41
  136. package/lib/Mermaid.js +2 -2
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +41 -41
  139. package/lib/MoreMark.d.ts +41 -41
  140. package/lib/MoreMark.js +1 -1
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +41 -41
  143. package/lib/MultiColumn.d.ts +41 -41
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +41 -41
  147. package/lib/OrderedList.d.ts +41 -41
  148. package/lib/OrderedList.js +1 -1
  149. package/lib/{RichTextEditor-DjTnd5Uu.js → RichTextEditor-CtxIf8pq.js} +5 -2
  150. package/lib/{RichTextEditor-CAxwVWUE.cjs → RichTextEditor-DtxJlApT.cjs} +5 -2
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +41 -41
  153. package/lib/SearchAndReplace.d.ts +41 -41
  154. package/lib/SearchAndReplace.js +1 -1
  155. package/lib/Selection.d.cts +41 -41
  156. package/lib/Selection.d.ts +41 -41
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +41 -41
  159. package/lib/SlashCommand.d.ts +41 -41
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +41 -41
  163. package/lib/Strike.d.ts +41 -41
  164. package/lib/Strike.js +1 -1
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +41 -41
  167. package/lib/SubAndSuperScript.d.ts +41 -41
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +41 -41
  171. package/lib/Table.d.ts +41 -41
  172. package/lib/Table.js +1 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +41 -41
  175. package/lib/TableOfContent.d.ts +41 -41
  176. package/lib/TableOfContent.js +1 -1
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +41 -41
  179. package/lib/TaskList.d.ts +41 -41
  180. package/lib/TaskList.js +1 -1
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +41 -41
  183. package/lib/TextAlign.d.ts +41 -41
  184. package/lib/TextAlign.js +1 -1
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +41 -41
  187. package/lib/TextBubble.d.ts +41 -41
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +41 -41
  191. package/lib/TextDirection.d.ts +41 -41
  192. package/lib/TextDirection.js +1 -1
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +41 -41
  195. package/lib/TextUnderline.d.ts +41 -41
  196. package/lib/TextUnderline.js +1 -1
  197. package/lib/TrailingNode.d.cts +41 -41
  198. package/lib/TrailingNode.d.ts +41 -41
  199. package/lib/{Twitter-dRxbZOad.js → Twitter-CJIud-WM.js} +1 -1
  200. package/lib/{Twitter-V0OzBT_E.cjs → Twitter-DBA28WG3.cjs} +1 -1
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +41 -41
  203. package/lib/Twitter.d.ts +41 -41
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +41 -41
  207. package/lib/Video.d.ts +41 -41
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +41 -41
  211. package/lib/bubble-extra.d.ts +41 -41
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +41 -41
  215. package/lib/index.d.ts +41 -41
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +41 -41
  218. package/lib/locale-bundle.d.ts +41 -41
  219. package/lib/style.css +1 -1
  220. package/lib/{textarea-BsJTSgT-.cjs → textarea-9iN67tad.cjs} +1 -1
  221. package/lib/{textarea-6c8drwXJ.js → textarea-BhTw-eGz.js} +1 -1
  222. package/package.json +2 -2
@@ -61,11 +61,9 @@ declare module '@tiptap/core' {
61
61
 
62
62
  declare module '@tiptap/core' {
63
63
  interface Commands<ReturnType> {
64
- emoji: {
65
- setEmoji: (emoji: {
66
- name: string;
67
- emoji: string;
68
- }) => ReturnType;
64
+ drawer: {
65
+ setDrawer: (options: any, replace?: any) => ReturnType;
66
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
69
67
  };
70
68
  }
71
69
  }
@@ -73,9 +71,11 @@ declare module '@tiptap/core' {
73
71
 
74
72
  declare module '@tiptap/core' {
75
73
  interface Commands<ReturnType> {
76
- drawer: {
77
- setDrawer: (options: any, replace?: any) => ReturnType;
78
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
74
+ emoji: {
75
+ setEmoji: (emoji: {
76
+ name: string;
77
+ emoji: string;
78
+ }) => ReturnType;
79
79
  };
80
80
  }
81
81
  }
@@ -126,6 +126,21 @@ declare module '@tiptap/core' {
126
126
  }
127
127
 
128
128
 
129
+ declare module '@tiptap/core' {
130
+ interface Commands<ReturnType> {
131
+ iframe: {
132
+ /**
133
+ * Add an iframe
134
+ */
135
+ setIframe: (options: {
136
+ src: string;
137
+ service: string;
138
+ }) => ReturnType;
139
+ };
140
+ }
141
+ }
142
+
143
+
129
144
  declare module '@tiptap/core' {
130
145
  interface Commands<ReturnType> {
131
146
  imageUpload: {
@@ -146,21 +161,6 @@ declare module '@tiptap/core' {
146
161
  }
147
162
 
148
163
 
149
- declare module '@tiptap/core' {
150
- interface Commands<ReturnType> {
151
- iframe: {
152
- /**
153
- * Add an iframe
154
- */
155
- setIframe: (options: {
156
- src: string;
157
- service: string;
158
- }) => ReturnType;
159
- };
160
- }
161
- }
162
-
163
-
164
164
  declare module '@tiptap/core' {
165
165
  interface Commands<ReturnType> {
166
166
  imageGifUpload: {
@@ -199,9 +199,8 @@ declare module '@tiptap/core' {
199
199
 
200
200
  declare module '@tiptap/core' {
201
201
  interface Commands<ReturnType> {
202
- lineHeight: {
203
- setLineHeight: (lineHeight: string) => ReturnType;
204
- unsetLineHeight: () => ReturnType;
202
+ katex: {
203
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
205
204
  };
206
205
  }
207
206
  }
@@ -209,8 +208,9 @@ declare module '@tiptap/core' {
209
208
 
210
209
  declare module '@tiptap/core' {
211
210
  interface Commands<ReturnType> {
212
- katex: {
213
- setKatex: (arg?: IKatexAttrs) => ReturnType;
211
+ lineHeight: {
212
+ setLineHeight: (lineHeight: string) => ReturnType;
213
+ unsetLineHeight: () => ReturnType;
214
214
  };
215
215
  }
216
216
  }
@@ -267,14 +267,15 @@ declare module '@tiptap/core' {
267
267
 
268
268
  declare module '@tiptap/core' {
269
269
  interface Commands<ReturnType> {
270
- twitter: {
270
+ video: {
271
271
  /**
272
- * Insert a tweet
273
- * @param options The tweet attributes
274
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
272
+ * Add an video
275
273
  */
276
- setTweet: (options: SetTweetOptions) => ReturnType;
277
- updateTweet: (options: SetTweetOptions) => ReturnType;
274
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
275
+ /**
276
+ * Update an video
277
+ */
278
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
278
279
  };
279
280
  }
280
281
  }
@@ -282,15 +283,14 @@ declare module '@tiptap/core' {
282
283
 
283
284
  declare module '@tiptap/core' {
284
285
  interface Commands<ReturnType> {
285
- video: {
286
- /**
287
- * Add an video
288
- */
289
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
286
+ twitter: {
290
287
  /**
291
- * Update an video
288
+ * Insert a tweet
289
+ * @param options The tweet attributes
290
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
292
291
  */
293
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
292
+ setTweet: (options: SetTweetOptions) => ReturnType;
293
+ updateTweet: (options: SetTweetOptions) => ReturnType;
294
294
  };
295
295
  }
296
296
  }
@@ -1,17 +1,17 @@
1
1
  import { jsxs as b, jsx as t, Fragment as v } from "react/jsx-runtime";
2
2
  import { useState as y, useRef as L, useCallback as w, useEffect as T, useMemo as W, Fragment as G } from "react";
3
3
  import { B as z } from "./dom-dataset-Di3tIRrR.js";
4
- import { w as Z, x as J, A as S, y as Q, z as X, F as Y, B as H, G as ee, O as D, a1 as ce, a2 as te, a3 as R, a4 as se, a5 as le } from "./RichTextEditor-DjTnd5Uu.js";
4
+ import { w as Z, x as J, A as S, y as Q, z as X, F as Y, B as H, G as ee, O as D, a1 as ce, a2 as te, a3 as R, a4 as se, a5 as le } from "./RichTextEditor-CtxIf8pq.js";
5
5
  import { Mermaid as j } from "./Mermaid.js";
6
6
  import { s as re, i as ne } from "./shortId-WJVkrvml.js";
7
- import { T as ie } from "./textarea-6c8drwXJ.js";
7
+ import { T as ie } from "./textarea-BhTw-eGz.js";
8
8
  import { u as O } from "./index-Tj3Ci7xM.js";
9
- import { E as I, t as de } from "./Excalidraw-frMX4K62.js";
10
- import { T as K, F as he } from "./Twitter-dRxbZOad.js";
9
+ import { E as I, t as de } from "./Excalidraw-AIzEaOzF.js";
10
+ import { T as K, F as he } from "./Twitter-CJIud-WM.js";
11
11
  import ue from "katex";
12
12
  import { HelpCircle as me, Pencil as xe, Trash2 as fe } from "lucide-react";
13
13
  import { Katex as P } from "./Katex.js";
14
- import { C as pe, D as _ } from "./Drawer-CVuwyG50.js";
14
+ import { C as pe, D as _ } from "./Drawer-BI_9XSqI.js";
15
15
  import { Editor as ge, makeDropdownToolbar as be } from "easydrawer";
16
16
  const q = `graph TB
17
17
  a-->b`, we = ({ editor: e, attrs: s, extension: o }) => {
package/lib/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),C=require("./RichTextEditor-CAxwVWUE.cjs"),x=require("./dom-dataset-Byuf1YmW.cjs"),a=require("./index-ByRfqzMr.cjs"),b=require("./ListItem.cjs"),S=require("./index-DclQSrIx.cjs"),v=require("./Document.cjs"),k=require("./Selection.cjs"),P=require("./TextBubble.cjs"),M=require("./TrailingNode.cjs"),m=require("./index-C19MB4Al.cjs");function T(){var l;const t=p.useRef({editor:null}),[e,i]=p.useState(!1),[o,r]=p.useState(null);return p.useEffect(()=>{var s;(s=t.current)!=null&&s.editor&&(i(!0),r(t.current.editor))},[t,(l=t.current)==null?void 0:l.editor]),{isReady:e,editor:o,editorRef:t}}const E=a.Extension.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const o=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(o)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,i=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(i)}},addProseMirrorPlugins(){let t=!1;return[new a.Plugin({key:new a.PluginKey("characterCount"),appendTransaction:(e,i,o)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const l=this.storage.characters({node:o.doc});if(l>r){const s=l-r,n=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=o.tr.deleteRange(n,c);return t=!0,u}t=!0},filterTransaction:(e,i)=>{const o=this.options.limit;if(!e.docChanged||o===0||o===null||o===void 0)return!0;const r=this.storage.characters({node:i.doc}),l=this.storage.characters({node:e.doc});if(l<=o||r>o&&l>o&&l<=r)return!0;if(r>o&&l>o&&l>r||!e.getMeta("paste"))return!1;const n=e.selection.$head.pos,c=l-o,u=n-c,h=n;return e.deleteRange(u,h),!(this.storage.characters({node:e.doc})>o)}})]}});function A(t={}){return new a.Plugin({view(e){return new O(e,t)}})}class O{constructor(e,i){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=i.width)!==null&&o!==void 0?o:1,this.color=i.color===!1?void 0:i.color||"black",this.class=i.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let l=s=>{this[r](s)};return e.dom.addEventListener(r,l),{name:r,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:i})=>this.editorView.dom.removeEventListener(e,i))}update(e,i){this.cursorPos!=null&&i.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),i=!e.parent.inlineContent,o;if(i){let n=e.nodeBefore,c=e.nodeAfter;if(n||c){let u=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(u){let h=u.getBoundingClientRect(),f=n?h.bottom:h.top;n&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),o={left:h.left,right:h.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!o){let n=this.editorView.coordsAtPos(this.cursorPos);o={left:n.left-this.width/2,right:n.left+this.width/2,top:n.top,bottom:n.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",i),this.element.classList.toggle("prosemirror-dropcursor-inline",!i);let l,s;if(!r||r==document.body&&getComputedStyle(r).position=="static")l=-pageXOffset,s=-pageYOffset;else{let n=r.getBoundingClientRect();l=n.left-r.scrollLeft,s=n.top-r.scrollTop}this.element.style.left=o.left-l+"px",this.element.style.top=o.top-s+"px",this.element.style.width=o.right-o.left+"px",this.element.style.height=o.bottom-o.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let i=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=i&&i.inside>=0&&this.editorView.state.doc.nodeAt(i.inside),r=o&&o.type.spec.disableDropCursor,l=typeof r=="function"?r(this.editorView,i,e):r;if(i&&!l){let s=i.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=a.dropPoint(this.editorView.state.doc,s,this.editorView.dragging.slice);n!=null&&(s=n)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const B=a.Extension.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[A(this.options)]}}),N=a.Extension.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:i,isFocused:o}=this.editor,{anchor:r}=e,l=[];if(!i||!o)return a.DecorationSet.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;s+=1});let n=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(n+=1,this.options.mode==="deepest"&&s-n>0||this.options.mode==="shallowest"&&n>1)return this.options.mode==="deepest";l.push(a.Decoration.node(u,u+c.nodeSize,{class:this.options.className}))}),a.DecorationSet.create(t,l)}}})]}});class d extends a.Selection{constructor(e){super(e,e)}map(e,i){let o=e.resolve(i.map(this.head));return d.valid(o)?new d(o):a.Selection.near(o)}content(){return a.Slice.empty}eq(e){return e instanceof d&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new d(e.resolve(i.pos))}getBookmark(){return new y(this.anchor)}static valid(e){let i=e.parent;if(i.isTextblock||!z(e)||!D(e))return!1;let o=i.type.spec.allowGapCursor;if(o!=null)return o;let r=i.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,i,o=!1){e:for(;;){if(!o&&d.valid(e))return e;let r=e.pos,l=null;for(let s=e.depth;;s--){let n=e.node(s);if(i>0?e.indexAfter(s)<n.childCount:e.index(s)>0){l=n.child(i>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;r+=i;let c=e.doc.resolve(r);if(d.valid(c))return c}for(;;){let s=i>0?l.firstChild:l.lastChild;if(!s){if(l.isAtom&&!l.isText&&!a.NodeSelection.isSelectable(l)){e=e.doc.resolve(r+l.nodeSize*i),o=!1;continue e}break}l=s,r+=i;let n=e.doc.resolve(r);if(d.valid(n))return n}return null}}}d.prototype.visible=!1;d.findFrom=d.findGapCursorFrom;a.Selection.jsonID("gapcursor",d);class y{constructor(e){this.pos=e}map(e){return new y(e.map(this.pos))}resolve(e){let i=e.resolve(this.pos);return d.valid(i)?new d(i):a.Selection.near(i)}}function z(t){for(let e=t.depth;e>=0;e--){let i=t.index(e),o=t.node(e);if(i==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function D(t){for(let e=t.depth;e>=0;e--){let i=t.indexAfter(e),o=t.node(e);if(i==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function L(){return new a.Plugin({props:{decorations:q,createSelectionBetween(t,e,i){return e.pos==i.pos&&d.valid(i)?new d(i):null},handleClick:V,handleKeyDown:R,handleDOMEvents:{beforeinput:H}}})}const R=a.keydownHandler({ArrowLeft:g("horiz",-1),ArrowRight:g("horiz",1),ArrowUp:g("vert",-1),ArrowDown:g("vert",1)});function g(t,e){const i=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,r,l){let s=o.selection,n=e>0?s.$to:s.$from,c=s.empty;if(s instanceof a.TextSelection){if(!l.endOfTextblock(i)||n.depth==0)return!1;c=!1,n=o.doc.resolve(e>0?n.after():n.before())}let u=d.findGapCursorFrom(n,e,c);return u?(r&&r(o.tr.setSelection(new d(u))),!0):!1}}function V(t,e,i){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!d.valid(o))return!1;let r=t.posAtCoords({left:i.clientX,top:i.clientY});return r&&r.inside>-1&&a.NodeSelection.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new d(o))),!0)}function H(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof d))return!1;let{$from:i}=t.state.selection,o=i.parent.contentMatchAt(i.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let r=a.Fragment.empty;for(let s=o.length-1;s>=0;s--)r=a.Fragment.from(o[s].createAndFill(null,r));let l=t.state.tr.replace(i.pos,i.pos,new a.Slice(r,0,0));return l.setSelection(a.TextSelection.near(l.doc.resolve(i.pos+1))),t.dispatch(l),!1}function q(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",a.DecorationSet.create(t.doc,[a.Decoration.widget(t.selection.head,e,{key:"gapcursor"})])}const F=a.Extension.create({name:"gapCursor",addProseMirrorPlugins(){return[L()]},extendNodeSchema(t){var e;const i={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=a.callOrReturn(a.getExtensionField(t,"allowGapCursor",i)))!==null&&e!==void 0?e:null}}}),I=a.Node.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",a.mergeAttributes(this.options.HTMLAttributes,t)]},renderText(){return`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("react"),C=require("./RichTextEditor-DtxJlApT.cjs"),x=require("./dom-dataset-Byuf1YmW.cjs"),a=require("./index-ByRfqzMr.cjs"),b=require("./ListItem.cjs"),S=require("./index-DclQSrIx.cjs"),v=require("./Document.cjs"),k=require("./Selection.cjs"),P=require("./TextBubble.cjs"),M=require("./TrailingNode.cjs"),m=require("./index-C19MB4Al.cjs");function T(){var l;const t=p.useRef({editor:null}),[e,i]=p.useState(!1),[o,r]=p.useState(null);return p.useEffect(()=>{var s;(s=t.current)!=null&&s.editor&&(i(!0),r(t.current.editor))},[t,(l=t.current)==null?void 0:l.editor]),{isReady:e,editor:o,editorRef:t}}const E=a.Extension.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const o=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(o)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,i=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(i)}},addProseMirrorPlugins(){let t=!1;return[new a.Plugin({key:new a.PluginKey("characterCount"),appendTransaction:(e,i,o)=>{if(t)return;const r=this.options.limit;if(r==null||r===0){t=!0;return}const l=this.storage.characters({node:o.doc});if(l>r){const s=l-r,n=0,c=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const u=o.tr.deleteRange(n,c);return t=!0,u}t=!0},filterTransaction:(e,i)=>{const o=this.options.limit;if(!e.docChanged||o===0||o===null||o===void 0)return!0;const r=this.storage.characters({node:i.doc}),l=this.storage.characters({node:e.doc});if(l<=o||r>o&&l>o&&l<=r)return!0;if(r>o&&l>o&&l>r||!e.getMeta("paste"))return!1;const n=e.selection.$head.pos,c=l-o,u=n-c,h=n;return e.deleteRange(u,h),!(this.storage.characters({node:e.doc})>o)}})]}});function A(t={}){return new a.Plugin({view(e){return new O(e,t)}})}class O{constructor(e,i){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=i.width)!==null&&o!==void 0?o:1,this.color=i.color===!1?void 0:i.color||"black",this.class=i.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let l=s=>{this[r](s)};return e.dom.addEventListener(r,l),{name:r,handler:l}})}destroy(){this.handlers.forEach(({name:e,handler:i})=>this.editorView.dom.removeEventListener(e,i))}update(e,i){this.cursorPos!=null&&i.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),i=!e.parent.inlineContent,o;if(i){let n=e.nodeBefore,c=e.nodeAfter;if(n||c){let u=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(u){let h=u.getBoundingClientRect(),f=n?h.bottom:h.top;n&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),o={left:h.left,right:h.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!o){let n=this.editorView.coordsAtPos(this.cursorPos);o={left:n.left-this.width/2,right:n.left+this.width/2,top:n.top,bottom:n.bottom}}let r=this.editorView.dom.offsetParent;this.element||(this.element=r.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",i),this.element.classList.toggle("prosemirror-dropcursor-inline",!i);let l,s;if(!r||r==document.body&&getComputedStyle(r).position=="static")l=-pageXOffset,s=-pageYOffset;else{let n=r.getBoundingClientRect();l=n.left-r.scrollLeft,s=n.top-r.scrollTop}this.element.style.left=o.left-l+"px",this.element.style.top=o.top-s+"px",this.element.style.width=o.right-o.left+"px",this.element.style.height=o.bottom-o.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let i=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=i&&i.inside>=0&&this.editorView.state.doc.nodeAt(i.inside),r=o&&o.type.spec.disableDropCursor,l=typeof r=="function"?r(this.editorView,i,e):r;if(i&&!l){let s=i.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let n=a.dropPoint(this.editorView.state.doc,s,this.editorView.dragging.slice);n!=null&&(s=n)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const B=a.Extension.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[A(this.options)]}}),N=a.Extension.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:i,isFocused:o}=this.editor,{anchor:r}=e,l=[];if(!i||!o)return a.DecorationSet.create(t,[]);let s=0;this.options.mode==="deepest"&&t.descendants((c,u)=>{if(c.isText)return;if(!(r>=u&&r<=u+c.nodeSize-1))return!1;s+=1});let n=0;return t.descendants((c,u)=>{if(c.isText||!(r>=u&&r<=u+c.nodeSize-1))return!1;if(n+=1,this.options.mode==="deepest"&&s-n>0||this.options.mode==="shallowest"&&n>1)return this.options.mode==="deepest";l.push(a.Decoration.node(u,u+c.nodeSize,{class:this.options.className}))}),a.DecorationSet.create(t,l)}}})]}});class d extends a.Selection{constructor(e){super(e,e)}map(e,i){let o=e.resolve(i.map(this.head));return d.valid(o)?new d(o):a.Selection.near(o)}content(){return a.Slice.empty}eq(e){return e instanceof d&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,i){if(typeof i.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new d(e.resolve(i.pos))}getBookmark(){return new y(this.anchor)}static valid(e){let i=e.parent;if(i.isTextblock||!z(e)||!D(e))return!1;let o=i.type.spec.allowGapCursor;if(o!=null)return o;let r=i.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,i,o=!1){e:for(;;){if(!o&&d.valid(e))return e;let r=e.pos,l=null;for(let s=e.depth;;s--){let n=e.node(s);if(i>0?e.indexAfter(s)<n.childCount:e.index(s)>0){l=n.child(i>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;r+=i;let c=e.doc.resolve(r);if(d.valid(c))return c}for(;;){let s=i>0?l.firstChild:l.lastChild;if(!s){if(l.isAtom&&!l.isText&&!a.NodeSelection.isSelectable(l)){e=e.doc.resolve(r+l.nodeSize*i),o=!1;continue e}break}l=s,r+=i;let n=e.doc.resolve(r);if(d.valid(n))return n}return null}}}d.prototype.visible=!1;d.findFrom=d.findGapCursorFrom;a.Selection.jsonID("gapcursor",d);class y{constructor(e){this.pos=e}map(e){return new y(e.map(this.pos))}resolve(e){let i=e.resolve(this.pos);return d.valid(i)?new d(i):a.Selection.near(i)}}function z(t){for(let e=t.depth;e>=0;e--){let i=t.index(e),o=t.node(e);if(i==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function D(t){for(let e=t.depth;e>=0;e--){let i=t.indexAfter(e),o=t.node(e);if(i==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(i);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}function L(){return new a.Plugin({props:{decorations:q,createSelectionBetween(t,e,i){return e.pos==i.pos&&d.valid(i)?new d(i):null},handleClick:V,handleKeyDown:R,handleDOMEvents:{beforeinput:H}}})}const R=a.keydownHandler({ArrowLeft:g("horiz",-1),ArrowRight:g("horiz",1),ArrowUp:g("vert",-1),ArrowDown:g("vert",1)});function g(t,e){const i=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,r,l){let s=o.selection,n=e>0?s.$to:s.$from,c=s.empty;if(s instanceof a.TextSelection){if(!l.endOfTextblock(i)||n.depth==0)return!1;c=!1,n=o.doc.resolve(e>0?n.after():n.before())}let u=d.findGapCursorFrom(n,e,c);return u?(r&&r(o.tr.setSelection(new d(u))),!0):!1}}function V(t,e,i){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!d.valid(o))return!1;let r=t.posAtCoords({left:i.clientX,top:i.clientY});return r&&r.inside>-1&&a.NodeSelection.isSelectable(t.state.doc.nodeAt(r.inside))?!1:(t.dispatch(t.state.tr.setSelection(new d(o))),!0)}function H(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof d))return!1;let{$from:i}=t.state.selection,o=i.parent.contentMatchAt(i.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let r=a.Fragment.empty;for(let s=o.length-1;s>=0;s--)r=a.Fragment.from(o[s].createAndFill(null,r));let l=t.state.tr.replace(i.pos,i.pos,new a.Slice(r,0,0));return l.setSelection(a.TextSelection.near(l.doc.resolve(i.pos+1))),t.dispatch(l),!1}function q(t){if(!(t.selection instanceof d))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",a.DecorationSet.create(t.doc,[a.Decoration.widget(t.selection.head,e,{key:"gapcursor"})])}const F=a.Extension.create({name:"gapCursor",addProseMirrorPlugins(){return[L()]},extendNodeSchema(t){var e;const i={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=a.callOrReturn(a.getExtensionField(t,"allowGapCursor",i)))!==null&&e!==void 0?e:null}}}),I=a.Node.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",a.mergeAttributes(this.options.HTMLAttributes,t)]},renderText(){return`
2
2
  `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:i,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:r,storedMarks:l}=i;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:n}=o.extensionManager,c=l||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:h})=>{if(h&&c&&s){const f=c.filter(w=>n.includes(w.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),K=a.Node.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",a.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),W=a.Extension.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new a.Plugin({key:new a.PluginKey("placeholder"),props:{decorations:({doc:t,selection:e})=>{const i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,r=[];if(!i)return null;const l=this.editor.isEmpty;return t.descendants((s,n)=>{const c=o>=n&&o<=n+s.nodeSize,u=!s.isLeaf&&a.isNodeEmpty(s);if((c||!this.options.showOnlyCurrent)&&u){const h=[this.options.emptyNodeClass];l&&h.push(this.options.emptyEditorClass);const f=a.Decoration.node(n,n+s.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:n,hasAnchor:c}):this.options.placeholder});r.push(f)}return this.options.includeChildren}),a.DecorationSet.create(t,r)}}})]}}),G=a.Node.create({name:"text",group:"inline"}),J=a.Extension.create({name:"base-kit",addExtensions(){const t=[];return this.options.document!==!1&&t.push(v.Document.configure()),this.options.placeholder!==!1&&t.push(W.configure({placeholder:({node:e,pos:i,editor:o})=>{var r,l,s,n,c;return((r=e==null?void 0:e.type)==null?void 0:r.name)==="columns"||((l=e==null?void 0:e.content)==null?void 0:l.size)!==0?"":((s=e==null?void 0:e.type)==null?void 0:s.name)==="heading"?`${m.localeActions.t(`editor.heading.h${e.attrs.level}.tooltip`)}`:((n=e==null?void 0:e.type)==null?void 0:n.name)==="codeBlock"||((c=e==null?void 0:e.type)==null?void 0:c.name)==="table"?"":o.extensionManager.extensions.some(u=>u.name==="slashCommand")?m.localeActions.t("editor.slash"):m.localeActions.t("editor.content")},...this.options.placeholder})),this.options.focus!==!1&&t.push(N.configure({className:"focus",...this.options.focus})),this.options.text!==!1&&t.push(G.configure()),this.options.textBubble!==!1&&t.push(P.TextBubble.configure()),this.options.gapcursor!==!1&&t.push(F.configure()),this.options.dropcursor!==!1&&t.push(B.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&t.push(E.configure(this.options.characterCount)),this.options.paragraph!==!1&&t.push(K.configure(this.options.paragraph)),this.options.hardBreak!==!1&&t.push(I.configure(this.options.hardBreak)),this.options.listItem!==!1&&t.push(b.ListItem.configure(this.options.listItem)),this.options.textStyle!==!1&&t.push(S.TextStyle.configure(this.options.textStyle)),this.options.trailingNode!==!1&&t.push(M.TrailingNode.configure(this.options.trailingNode)),this.options.selection!==!1&&t.push(k.Selection),this.options.multiColumn!==!1&&t.push(C.Column,C.MultiColumn),t}});exports.default=C.RichTextEditor;exports.BubbleMenu=x.BubbleMenu;exports.BaseKit=J;exports.useEditorState=T;
package/lib/index.d.cts CHANGED
@@ -472,11 +472,9 @@ declare module '@tiptap/core' {
472
472
 
473
473
  declare module '@tiptap/core' {
474
474
  interface Commands<ReturnType> {
475
- emoji: {
476
- setEmoji: (emoji: {
477
- name: string;
478
- emoji: string;
479
- }) => ReturnType;
475
+ drawer: {
476
+ setDrawer: (options: any, replace?: any) => ReturnType;
477
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
480
478
  };
481
479
  }
482
480
  }
@@ -484,9 +482,11 @@ declare module '@tiptap/core' {
484
482
 
485
483
  declare module '@tiptap/core' {
486
484
  interface Commands<ReturnType> {
487
- drawer: {
488
- setDrawer: (options: any, replace?: any) => ReturnType;
489
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
485
+ emoji: {
486
+ setEmoji: (emoji: {
487
+ name: string;
488
+ emoji: string;
489
+ }) => ReturnType;
490
490
  };
491
491
  }
492
492
  }
@@ -537,6 +537,21 @@ declare module '@tiptap/core' {
537
537
  }
538
538
 
539
539
 
540
+ declare module '@tiptap/core' {
541
+ interface Commands<ReturnType> {
542
+ iframe: {
543
+ /**
544
+ * Add an iframe
545
+ */
546
+ setIframe: (options: {
547
+ src: string;
548
+ service: string;
549
+ }) => ReturnType;
550
+ };
551
+ }
552
+ }
553
+
554
+
540
555
  declare module '@tiptap/core' {
541
556
  interface Commands<ReturnType> {
542
557
  imageUpload: {
@@ -557,21 +572,6 @@ declare module '@tiptap/core' {
557
572
  }
558
573
 
559
574
 
560
- declare module '@tiptap/core' {
561
- interface Commands<ReturnType> {
562
- iframe: {
563
- /**
564
- * Add an iframe
565
- */
566
- setIframe: (options: {
567
- src: string;
568
- service: string;
569
- }) => ReturnType;
570
- };
571
- }
572
- }
573
-
574
-
575
575
  declare module '@tiptap/core' {
576
576
  interface Commands<ReturnType> {
577
577
  imageGifUpload: {
@@ -610,9 +610,8 @@ declare module '@tiptap/core' {
610
610
 
611
611
  declare module '@tiptap/core' {
612
612
  interface Commands<ReturnType> {
613
- lineHeight: {
614
- setLineHeight: (lineHeight: string) => ReturnType;
615
- unsetLineHeight: () => ReturnType;
613
+ katex: {
614
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
616
615
  };
617
616
  }
618
617
  }
@@ -620,8 +619,9 @@ declare module '@tiptap/core' {
620
619
 
621
620
  declare module '@tiptap/core' {
622
621
  interface Commands<ReturnType> {
623
- katex: {
624
- setKatex: (arg?: IKatexAttrs) => ReturnType;
622
+ lineHeight: {
623
+ setLineHeight: (lineHeight: string) => ReturnType;
624
+ unsetLineHeight: () => ReturnType;
625
625
  };
626
626
  }
627
627
  }
@@ -678,14 +678,15 @@ declare module '@tiptap/core' {
678
678
 
679
679
  declare module '@tiptap/core' {
680
680
  interface Commands<ReturnType> {
681
- twitter: {
681
+ video: {
682
682
  /**
683
- * Insert a tweet
684
- * @param options The tweet attributes
685
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
683
+ * Add an video
686
684
  */
687
- setTweet: (options: SetTweetOptions) => ReturnType;
688
- updateTweet: (options: SetTweetOptions) => ReturnType;
685
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
686
+ /**
687
+ * Update an video
688
+ */
689
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
689
690
  };
690
691
  }
691
692
  }
@@ -693,15 +694,14 @@ declare module '@tiptap/core' {
693
694
 
694
695
  declare module '@tiptap/core' {
695
696
  interface Commands<ReturnType> {
696
- video: {
697
- /**
698
- * Add an video
699
- */
700
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
697
+ twitter: {
701
698
  /**
702
- * Update an video
699
+ * Insert a tweet
700
+ * @param options The tweet attributes
701
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
703
702
  */
704
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
703
+ setTweet: (options: SetTweetOptions) => ReturnType;
704
+ updateTweet: (options: SetTweetOptions) => ReturnType;
705
705
  };
706
706
  }
707
707
  }
package/lib/index.d.ts CHANGED
@@ -472,11 +472,9 @@ declare module '@tiptap/core' {
472
472
 
473
473
  declare module '@tiptap/core' {
474
474
  interface Commands<ReturnType> {
475
- emoji: {
476
- setEmoji: (emoji: {
477
- name: string;
478
- emoji: string;
479
- }) => ReturnType;
475
+ drawer: {
476
+ setDrawer: (options: any, replace?: any) => ReturnType;
477
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
480
478
  };
481
479
  }
482
480
  }
@@ -484,9 +482,11 @@ declare module '@tiptap/core' {
484
482
 
485
483
  declare module '@tiptap/core' {
486
484
  interface Commands<ReturnType> {
487
- drawer: {
488
- setDrawer: (options: any, replace?: any) => ReturnType;
489
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
485
+ emoji: {
486
+ setEmoji: (emoji: {
487
+ name: string;
488
+ emoji: string;
489
+ }) => ReturnType;
490
490
  };
491
491
  }
492
492
  }
@@ -537,6 +537,21 @@ declare module '@tiptap/core' {
537
537
  }
538
538
 
539
539
 
540
+ declare module '@tiptap/core' {
541
+ interface Commands<ReturnType> {
542
+ iframe: {
543
+ /**
544
+ * Add an iframe
545
+ */
546
+ setIframe: (options: {
547
+ src: string;
548
+ service: string;
549
+ }) => ReturnType;
550
+ };
551
+ }
552
+ }
553
+
554
+
540
555
  declare module '@tiptap/core' {
541
556
  interface Commands<ReturnType> {
542
557
  imageUpload: {
@@ -557,21 +572,6 @@ declare module '@tiptap/core' {
557
572
  }
558
573
 
559
574
 
560
- declare module '@tiptap/core' {
561
- interface Commands<ReturnType> {
562
- iframe: {
563
- /**
564
- * Add an iframe
565
- */
566
- setIframe: (options: {
567
- src: string;
568
- service: string;
569
- }) => ReturnType;
570
- };
571
- }
572
- }
573
-
574
-
575
575
  declare module '@tiptap/core' {
576
576
  interface Commands<ReturnType> {
577
577
  imageGifUpload: {
@@ -610,9 +610,8 @@ declare module '@tiptap/core' {
610
610
 
611
611
  declare module '@tiptap/core' {
612
612
  interface Commands<ReturnType> {
613
- lineHeight: {
614
- setLineHeight: (lineHeight: string) => ReturnType;
615
- unsetLineHeight: () => ReturnType;
613
+ katex: {
614
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
616
615
  };
617
616
  }
618
617
  }
@@ -620,8 +619,9 @@ declare module '@tiptap/core' {
620
619
 
621
620
  declare module '@tiptap/core' {
622
621
  interface Commands<ReturnType> {
623
- katex: {
624
- setKatex: (arg?: IKatexAttrs) => ReturnType;
622
+ lineHeight: {
623
+ setLineHeight: (lineHeight: string) => ReturnType;
624
+ unsetLineHeight: () => ReturnType;
625
625
  };
626
626
  }
627
627
  }
@@ -678,14 +678,15 @@ declare module '@tiptap/core' {
678
678
 
679
679
  declare module '@tiptap/core' {
680
680
  interface Commands<ReturnType> {
681
- twitter: {
681
+ video: {
682
682
  /**
683
- * Insert a tweet
684
- * @param options The tweet attributes
685
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
683
+ * Add an video
686
684
  */
687
- setTweet: (options: SetTweetOptions) => ReturnType;
688
- updateTweet: (options: SetTweetOptions) => ReturnType;
685
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
686
+ /**
687
+ * Update an video
688
+ */
689
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
689
690
  };
690
691
  }
691
692
  }
@@ -693,15 +694,14 @@ declare module '@tiptap/core' {
693
694
 
694
695
  declare module '@tiptap/core' {
695
696
  interface Commands<ReturnType> {
696
- video: {
697
- /**
698
- * Add an video
699
- */
700
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
697
+ twitter: {
701
698
  /**
702
- * Update an video
699
+ * Insert a tweet
700
+ * @param options The tweet attributes
701
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
703
702
  */
704
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
703
+ setTweet: (options: SetTweetOptions) => ReturnType;
704
+ updateTweet: (options: SetTweetOptions) => ReturnType;
705
705
  };
706
706
  }
707
707
  }
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useRef as O, useState as S, useEffect as B } from "react";
2
- import { a6 as z, a7 as N } from "./RichTextEditor-DjTnd5Uu.js";
3
- import { a8 as ve } from "./RichTextEditor-DjTnd5Uu.js";
2
+ import { a6 as z, a7 as N } from "./RichTextEditor-CtxIf8pq.js";
3
+ import { a8 as ve } from "./RichTextEditor-CtxIf8pq.js";
4
4
  import { B as ke } from "./dom-dataset-Di3tIRrR.js";
5
5
  import { E as f, P as p, a as w, s as L, D as C, b, u as R, F as k, S as P, T as M, g as T, v as y, x as D, y as V, N as x, m as A, z as H } from "./index-DI9T3iLd.js";
6
6
  import { ListItem as F } from "./ListItem.js";
@@ -946,11 +946,9 @@ declare module '@tiptap/core' {
946
946
 
947
947
  declare module '@tiptap/core' {
948
948
  interface Commands<ReturnType> {
949
- emoji: {
950
- setEmoji: (emoji: {
951
- name: string;
952
- emoji: string;
953
- }) => ReturnType;
949
+ drawer: {
950
+ setDrawer: (options: any, replace?: any) => ReturnType;
951
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
954
952
  };
955
953
  }
956
954
  }
@@ -958,9 +956,11 @@ declare module '@tiptap/core' {
958
956
 
959
957
  declare module '@tiptap/core' {
960
958
  interface Commands<ReturnType> {
961
- drawer: {
962
- setDrawer: (options: any, replace?: any) => ReturnType;
963
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
959
+ emoji: {
960
+ setEmoji: (emoji: {
961
+ name: string;
962
+ emoji: string;
963
+ }) => ReturnType;
964
964
  };
965
965
  }
966
966
  }
@@ -1011,6 +1011,21 @@ declare module '@tiptap/core' {
1011
1011
  }
1012
1012
 
1013
1013
 
1014
+ declare module '@tiptap/core' {
1015
+ interface Commands<ReturnType> {
1016
+ iframe: {
1017
+ /**
1018
+ * Add an iframe
1019
+ */
1020
+ setIframe: (options: {
1021
+ src: string;
1022
+ service: string;
1023
+ }) => ReturnType;
1024
+ };
1025
+ }
1026
+ }
1027
+
1028
+
1014
1029
  declare module '@tiptap/core' {
1015
1030
  interface Commands<ReturnType> {
1016
1031
  imageUpload: {
@@ -1031,21 +1046,6 @@ declare module '@tiptap/core' {
1031
1046
  }
1032
1047
 
1033
1048
 
1034
- declare module '@tiptap/core' {
1035
- interface Commands<ReturnType> {
1036
- iframe: {
1037
- /**
1038
- * Add an iframe
1039
- */
1040
- setIframe: (options: {
1041
- src: string;
1042
- service: string;
1043
- }) => ReturnType;
1044
- };
1045
- }
1046
- }
1047
-
1048
-
1049
1049
  declare module '@tiptap/core' {
1050
1050
  interface Commands<ReturnType> {
1051
1051
  imageGifUpload: {
@@ -1084,9 +1084,8 @@ declare module '@tiptap/core' {
1084
1084
 
1085
1085
  declare module '@tiptap/core' {
1086
1086
  interface Commands<ReturnType> {
1087
- lineHeight: {
1088
- setLineHeight: (lineHeight: string) => ReturnType;
1089
- unsetLineHeight: () => ReturnType;
1087
+ katex: {
1088
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
1090
1089
  };
1091
1090
  }
1092
1091
  }
@@ -1094,8 +1093,9 @@ declare module '@tiptap/core' {
1094
1093
 
1095
1094
  declare module '@tiptap/core' {
1096
1095
  interface Commands<ReturnType> {
1097
- katex: {
1098
- setKatex: (arg?: IKatexAttrs) => ReturnType;
1096
+ lineHeight: {
1097
+ setLineHeight: (lineHeight: string) => ReturnType;
1098
+ unsetLineHeight: () => ReturnType;
1099
1099
  };
1100
1100
  }
1101
1101
  }
@@ -1152,14 +1152,15 @@ declare module '@tiptap/core' {
1152
1152
 
1153
1153
  declare module '@tiptap/core' {
1154
1154
  interface Commands<ReturnType> {
1155
- twitter: {
1155
+ video: {
1156
1156
  /**
1157
- * Insert a tweet
1158
- * @param options The tweet attributes
1159
- * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1157
+ * Add an video
1160
1158
  */
1161
- setTweet: (options: SetTweetOptions) => ReturnType;
1162
- updateTweet: (options: SetTweetOptions) => ReturnType;
1159
+ setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1160
+ /**
1161
+ * Update an video
1162
+ */
1163
+ updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1163
1164
  };
1164
1165
  }
1165
1166
  }
@@ -1167,15 +1168,14 @@ declare module '@tiptap/core' {
1167
1168
 
1168
1169
  declare module '@tiptap/core' {
1169
1170
  interface Commands<ReturnType> {
1170
- video: {
1171
- /**
1172
- * Add an video
1173
- */
1174
- setVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1171
+ twitter: {
1175
1172
  /**
1176
- * Update an video
1173
+ * Insert a tweet
1174
+ * @param options The tweet attributes
1175
+ * @example editor.commands.setTweet({ src: 'https://x.com/seanpk/status/1800145949580517852' })
1177
1176
  */
1178
- updateVideo: (options: Partial<SetVideoOptions>) => ReturnType;
1177
+ setTweet: (options: SetTweetOptions) => ReturnType;
1178
+ updateTweet: (options: SetTweetOptions) => ReturnType;
1179
1179
  };
1180
1180
  }
1181
1181
  }