reactjs-tiptap-editor 0.3.30 → 0.3.31

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 (224) hide show
  1. package/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-BCgqJsST.cjs} +1 -1
  2. package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-D97K0UWT.js} +5 -5
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.d.cts +15 -15
  5. package/lib/Attachment.d.ts +15 -15
  6. package/lib/Attachment.js +1 -1
  7. package/lib/Blockquote.cjs +1 -1
  8. package/lib/Blockquote.d.cts +15 -15
  9. package/lib/Blockquote.d.ts +15 -15
  10. package/lib/Blockquote.js +1 -1
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +15 -15
  13. package/lib/Bold.d.ts +15 -15
  14. package/lib/Bold.js +1 -1
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +15 -15
  17. package/lib/BulletList.d.ts +15 -15
  18. package/lib/BulletList.js +1 -1
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +15 -15
  21. package/lib/Clear.d.ts +15 -15
  22. package/lib/Clear.js +1 -1
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +15 -15
  25. package/lib/Code.d.ts +15 -15
  26. package/lib/Code.js +1 -1
  27. package/lib/CodeBlock.cjs +1 -1
  28. package/lib/CodeBlock.d.cts +15 -15
  29. package/lib/CodeBlock.d.ts +15 -15
  30. package/lib/CodeBlock.js +3 -2
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +15 -15
  33. package/lib/CodeView.d.ts +15 -15
  34. package/lib/CodeView.js +1 -1
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +15 -15
  37. package/lib/Color.d.ts +15 -15
  38. package/lib/Color.js +2 -2
  39. package/lib/Document.d.cts +15 -15
  40. package/lib/Document.d.ts +15 -15
  41. package/lib/Drawer-5Q_-WRhc.cjs +1 -0
  42. package/lib/{Drawer-BKTU9CpU.js → Drawer-BHkje8ys.js} +250 -249
  43. package/lib/Drawer.cjs +1 -1
  44. package/lib/Drawer.d.cts +15 -15
  45. package/lib/Drawer.d.ts +15 -15
  46. package/lib/Drawer.js +2 -2
  47. package/lib/Emoji.cjs +1 -1
  48. package/lib/Emoji.d.cts +15 -15
  49. package/lib/Emoji.d.ts +15 -15
  50. package/lib/Emoji.js +22 -21
  51. package/lib/Excalidraw-CG498239.js +290 -0
  52. package/lib/Excalidraw-GUVW-IqC.cjs +1 -0
  53. package/lib/Excalidraw.cjs +1 -1
  54. package/lib/Excalidraw.d.cts +15 -15
  55. package/lib/Excalidraw.d.ts +15 -15
  56. package/lib/Excalidraw.js +1 -1
  57. package/lib/ExportPdf.cjs +1 -1
  58. package/lib/ExportPdf.d.cts +15 -15
  59. package/lib/ExportPdf.d.ts +15 -15
  60. package/lib/ExportPdf.js +1 -1
  61. package/lib/ExportWord.cjs +1 -1
  62. package/lib/ExportWord.d.cts +15 -15
  63. package/lib/ExportWord.d.ts +15 -15
  64. package/lib/ExportWord.js +1 -1
  65. package/lib/FontFamily.cjs +1 -1
  66. package/lib/FontFamily.d.cts +15 -15
  67. package/lib/FontFamily.d.ts +15 -15
  68. package/lib/FontFamily.js +11 -10
  69. package/lib/FontSize.cjs +1 -1
  70. package/lib/FontSize.d.cts +15 -15
  71. package/lib/FontSize.d.ts +15 -15
  72. package/lib/FontSize.js +6 -5
  73. package/lib/FormatPainter.cjs +1 -1
  74. package/lib/FormatPainter.d.cts +15 -15
  75. package/lib/FormatPainter.d.ts +15 -15
  76. package/lib/FormatPainter.js +1 -1
  77. package/lib/Heading.cjs +1 -1
  78. package/lib/Heading.d.cts +15 -15
  79. package/lib/Heading.d.ts +15 -15
  80. package/lib/Heading.js +32 -31
  81. package/lib/Highlight.cjs +1 -1
  82. package/lib/Highlight.d.cts +15 -15
  83. package/lib/Highlight.d.ts +15 -15
  84. package/lib/Highlight.js +1 -1
  85. package/lib/History.cjs +1 -1
  86. package/lib/History.d.cts +15 -15
  87. package/lib/History.d.ts +15 -15
  88. package/lib/History.js +1 -1
  89. package/lib/HorizontalRule.cjs +1 -1
  90. package/lib/HorizontalRule.d.cts +15 -15
  91. package/lib/HorizontalRule.d.ts +15 -15
  92. package/lib/HorizontalRule.js +1 -1
  93. package/lib/Iframe.cjs +1 -1
  94. package/lib/Iframe.d.cts +15 -15
  95. package/lib/Iframe.d.ts +15 -15
  96. package/lib/Iframe.js +1 -1
  97. package/lib/Image.cjs +1 -1
  98. package/lib/Image.d.cts +15 -15
  99. package/lib/Image.d.ts +15 -15
  100. package/lib/Image.js +1 -1
  101. package/lib/ImageGif.cjs +1 -1
  102. package/lib/ImageGif.d.cts +15 -15
  103. package/lib/ImageGif.d.ts +15 -15
  104. package/lib/ImageGif.js +1 -1
  105. package/lib/ImportWord.cjs +2 -2
  106. package/lib/ImportWord.d.cts +15 -15
  107. package/lib/ImportWord.d.ts +15 -15
  108. package/lib/ImportWord.js +3 -2
  109. package/lib/Indent.cjs +1 -1
  110. package/lib/Indent.d.cts +15 -15
  111. package/lib/Indent.d.ts +15 -15
  112. package/lib/Indent.js +1 -1
  113. package/lib/Italic.cjs +1 -1
  114. package/lib/Italic.d.cts +15 -15
  115. package/lib/Italic.d.ts +15 -15
  116. package/lib/Italic.js +1 -1
  117. package/lib/Katex.cjs +1 -1
  118. package/lib/Katex.d.cts +15 -15
  119. package/lib/Katex.d.ts +15 -15
  120. package/lib/Katex.js +41 -40
  121. package/lib/LineHeight.cjs +1 -1
  122. package/lib/LineHeight.d.cts +15 -15
  123. package/lib/LineHeight.d.ts +15 -15
  124. package/lib/LineHeight.js +17 -16
  125. package/lib/Link.cjs +1 -1
  126. package/lib/Link.d.cts +15 -15
  127. package/lib/Link.d.ts +15 -15
  128. package/lib/Link.js +1 -1
  129. package/lib/ListItem.d.cts +15 -15
  130. package/lib/ListItem.d.ts +15 -15
  131. package/lib/Mention.d.cts +15 -15
  132. package/lib/Mention.d.ts +15 -15
  133. package/lib/Mermaid.cjs +2 -2
  134. package/lib/Mermaid.d.cts +15 -15
  135. package/lib/Mermaid.d.ts +15 -15
  136. package/lib/Mermaid.js +138 -137
  137. package/lib/MoreMark.cjs +1 -1
  138. package/lib/MoreMark.d.cts +15 -15
  139. package/lib/MoreMark.d.ts +15 -15
  140. package/lib/MoreMark.js +1 -1
  141. package/lib/MultiColumn.cjs +1 -1
  142. package/lib/MultiColumn.d.cts +15 -15
  143. package/lib/MultiColumn.d.ts +15 -15
  144. package/lib/MultiColumn.js +1 -1
  145. package/lib/OrderedList.cjs +1 -1
  146. package/lib/OrderedList.d.cts +15 -15
  147. package/lib/OrderedList.d.ts +15 -15
  148. package/lib/OrderedList.js +1 -1
  149. package/lib/{RichTextEditor-C8Sm1E6J.cjs → RichTextEditor-DWlLqTl9.cjs} +4 -4
  150. package/lib/{RichTextEditor-BQN2eLD_.js → RichTextEditor-KP2Rgcqe.js} +15 -39
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +15 -15
  153. package/lib/SearchAndReplace.d.ts +15 -15
  154. package/lib/SearchAndReplace.js +68 -67
  155. package/lib/Selection.d.cts +15 -15
  156. package/lib/Selection.d.ts +15 -15
  157. package/lib/SlashCommand.cjs +1 -1
  158. package/lib/SlashCommand.d.cts +15 -15
  159. package/lib/SlashCommand.d.ts +15 -15
  160. package/lib/SlashCommand.js +1 -1
  161. package/lib/Strike.cjs +1 -1
  162. package/lib/Strike.d.cts +15 -15
  163. package/lib/Strike.d.ts +15 -15
  164. package/lib/Strike.js +1 -1
  165. package/lib/SubAndSuperScript.cjs +1 -1
  166. package/lib/SubAndSuperScript.d.cts +15 -15
  167. package/lib/SubAndSuperScript.d.ts +15 -15
  168. package/lib/SubAndSuperScript.js +1 -1
  169. package/lib/Table.cjs +1 -1
  170. package/lib/Table.d.cts +15 -15
  171. package/lib/Table.d.ts +15 -15
  172. package/lib/Table.js +2 -1
  173. package/lib/TableOfContent.cjs +1 -1
  174. package/lib/TableOfContent.d.cts +15 -15
  175. package/lib/TableOfContent.d.ts +15 -15
  176. package/lib/TableOfContent.js +50 -49
  177. package/lib/TaskList.cjs +1 -1
  178. package/lib/TaskList.d.cts +15 -15
  179. package/lib/TaskList.d.ts +15 -15
  180. package/lib/TaskList.js +1 -1
  181. package/lib/TextAlign.cjs +1 -1
  182. package/lib/TextAlign.d.cts +15 -15
  183. package/lib/TextAlign.d.ts +15 -15
  184. package/lib/TextAlign.js +8 -7
  185. package/lib/TextBubble.cjs +1 -1
  186. package/lib/TextBubble.d.cts +15 -15
  187. package/lib/TextBubble.d.ts +15 -15
  188. package/lib/TextBubble.js +1 -1
  189. package/lib/TextDirection.cjs +1 -1
  190. package/lib/TextDirection.d.cts +15 -15
  191. package/lib/TextDirection.d.ts +15 -15
  192. package/lib/TextDirection.js +14 -13
  193. package/lib/TextUnderline.cjs +1 -1
  194. package/lib/TextUnderline.d.cts +15 -15
  195. package/lib/TextUnderline.d.ts +15 -15
  196. package/lib/TextUnderline.js +1 -1
  197. package/lib/TrailingNode.d.cts +15 -15
  198. package/lib/TrailingNode.d.ts +15 -15
  199. package/lib/{Twitter-Dg6WWauX.js → Twitter-99ivY5qv.js} +62 -61
  200. package/lib/{Twitter-CL2pu4QM.cjs → Twitter-BvfvUtNT.cjs} +2 -2
  201. package/lib/Twitter.cjs +1 -1
  202. package/lib/Twitter.d.cts +15 -15
  203. package/lib/Twitter.d.ts +15 -15
  204. package/lib/Twitter.js +1 -1
  205. package/lib/Video.cjs +1 -1
  206. package/lib/Video.d.cts +15 -15
  207. package/lib/Video.d.ts +15 -15
  208. package/lib/Video.js +1 -1
  209. package/lib/bubble-extra.cjs +1 -1
  210. package/lib/bubble-extra.d.cts +15 -15
  211. package/lib/bubble-extra.d.ts +15 -15
  212. package/lib/bubble-extra.js +5 -5
  213. package/lib/index.cjs +1 -1
  214. package/lib/index.d.cts +16 -15
  215. package/lib/index.d.ts +16 -15
  216. package/lib/index.js +2 -2
  217. package/lib/locale-bundle.d.cts +15 -15
  218. package/lib/locale-bundle.d.ts +15 -15
  219. package/lib/{textarea-BglwYF6b.js → textarea-CktfkXNe.js} +1 -1
  220. package/lib/{textarea-D5WVZMgt.cjs → textarea-DdH64g04.cjs} +1 -1
  221. package/package.json +1 -1
  222. package/lib/Drawer-CmoEF-Zg.cjs +0 -1
  223. package/lib/Excalidraw-CM74U5tG.js +0 -289
  224. package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
@@ -197,6 +197,21 @@ declare module '@tiptap/core' {
197
197
  }
198
198
 
199
199
 
200
+ declare module '@tiptap/core' {
201
+ interface Commands<ReturnType> {
202
+ iframe: {
203
+ /**
204
+ * Add an iframe
205
+ */
206
+ setIframe: (options: {
207
+ src: string;
208
+ service: string;
209
+ }) => ReturnType;
210
+ };
211
+ }
212
+ }
213
+
214
+
200
215
  declare module '@tiptap/core' {
201
216
  interface Commands<ReturnType> {
202
217
  imageUpload: {
@@ -217,21 +232,6 @@ declare module '@tiptap/core' {
217
232
  }
218
233
 
219
234
 
220
- declare module '@tiptap/core' {
221
- interface Commands<ReturnType> {
222
- iframe: {
223
- /**
224
- * Add an iframe
225
- */
226
- setIframe: (options: {
227
- src: string;
228
- service: string;
229
- }) => ReturnType;
230
- };
231
- }
232
- }
233
-
234
-
235
235
  declare module '@tiptap/core' {
236
236
  interface Commands<ReturnType> {
237
237
  imageGifUpload: {
package/lib/FontFamily.js CHANGED
@@ -3,8 +3,8 @@ import { E as c } from "./index-DI9T3iLd.js";
3
3
  import { u as y, h as F } from "./index-CsK90iVd.js";
4
4
  import { jsxs as r, jsx as a } from "react/jsx-runtime";
5
5
  import { useMemo as h, Fragment as b } from "react";
6
- import { A as x } from "./ActionMenuButton-B6fitGKu.js";
7
- import { D as M, e as A, f as L, h as g, u as D, j as S } from "./RichTextEditor-BQN2eLD_.js";
6
+ import { A as x } from "./ActionMenuButton-D97K0UWT.js";
7
+ import { D as M, e as A, f as L, h as g, u as D, j as S } from "./RichTextEditor-KP2Rgcqe.js";
8
8
  const w = c.create({
9
9
  name: "fontFamily",
10
10
  addOptions() {
@@ -36,8 +36,8 @@ const w = c.create({
36
36
  }
37
37
  });
38
38
  function T(t) {
39
- var m, u, f;
40
- const { t: i, lang: s } = y(), n = h(() => {
39
+ var m, u, s;
40
+ const { t: i, lang: f } = y(), n = h(() => {
41
41
  var o;
42
42
  const e = (o = t == null ? void 0 : t.items) == null ? void 0 : o.find((l) => l.isActive());
43
43
  return e && !e.default ? {
@@ -49,7 +49,7 @@ function T(t) {
49
49
  disabled: !1,
50
50
  action: () => t.editor.chain().focus().unsetFontFamily().run()
51
51
  };
52
- }, [i, s, t]);
52
+ }, [i, f, t]);
53
53
  return /* @__PURE__ */ r(M, { children: [
54
54
  /* @__PURE__ */ a(
55
55
  A,
@@ -62,12 +62,13 @@ function T(t) {
62
62
  disabled: t == null ? void 0 : t.disabled,
63
63
  icon: "MenuDown",
64
64
  title: ((m = n == null ? void 0 : n.font) == null ? void 0 : m.length) > 7 ? `${(u = n == null ? void 0 : n.font) == null ? void 0 : u.slice(0, 6)}...` : n == null ? void 0 : n.font,
65
- tooltip: t == null ? void 0 : t.tooltip
65
+ tooltip: t == null ? void 0 : t.tooltip,
66
+ tooltipOptions: t == null ? void 0 : t.tooltipOptions
66
67
  }
67
68
  )
68
69
  }
69
70
  ),
70
- /* @__PURE__ */ a(L, { className: "richtext-w-full", children: (f = t == null ? void 0 : t.items) == null ? void 0 : f.map((e, d) => {
71
+ /* @__PURE__ */ a(L, { className: "richtext-w-full", children: (s = t == null ? void 0 : t.items) == null ? void 0 : s.map((e, d) => {
71
72
  const o = e.font === i("editor.fontFamily.default.tooltip") ? {} : { fontFamily: e.font };
72
73
  return /* @__PURE__ */ r(b, { children: [
73
74
  /* @__PURE__ */ a(
@@ -96,9 +97,9 @@ const j = /* @__PURE__ */ w.extend({
96
97
  return {
97
98
  ...(t = this.parent) == null ? void 0 : t.call(this),
98
99
  fontFamilyList: F,
99
- button({ editor: i, extension: s, t: n }) {
100
+ button({ editor: i, extension: f, t: n }) {
100
101
  var o;
101
- const { extensions: m = [] } = i.extensionManager ?? [], u = S(((o = s == null ? void 0 : s.options) == null ? void 0 : o.fontFamilyList) || []), f = m.find(
102
+ const { extensions: m = [] } = i.extensionManager ?? [], u = S(((o = f == null ? void 0 : f.options) == null ? void 0 : o.fontFamilyList) || []), s = m.find(
102
103
  (l) => l.name === "base-kit"
103
104
  ), e = u.map((l) => ({
104
105
  action: () => {
@@ -109,7 +110,7 @@ const j = /* @__PURE__ */ w.extend({
109
110
  title: l.name,
110
111
  font: l.value
111
112
  }));
112
- f && f.options.textStyle !== !1 && e.unshift({
113
+ s && s.options.textStyle !== !1 && e.unshift({
113
114
  action: () => i.chain().focus().unsetFontFamily().run(),
114
115
  isActive: () => !1,
115
116
  disabled: !1,
package/lib/FontSize.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-ByRfqzMr.cjs"),r=require("./index-D_A0TBRA.cjs"),s=require("./RichTextEditor-C8Sm1E6J.cjs"),u=require("react/jsx-runtime"),m=require("react"),z=require("./ActionMenuButton-wiDnIxE2.cjs");function x(e){var a;const{t}=r.useLocale(),l=m.useMemo(()=>{const i=(e.items||[]).find(c=>c.isActive());return i||{title:t("editor.fontSize.default.tooltip"),isActive:()=>!1}},[e]);return u.jsxs(s.DropdownMenu,{children:[u.jsx(s.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:u.jsx(z.ActionMenuButton,{disabled:e==null?void 0:e.disabled,icon:"MenuDown",title:l==null?void 0:l.title,tooltip:`${e==null?void 0:e.tooltip}`})}),u.jsx(s.DropdownMenuContent,{className:"richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto",children:(a=e==null?void 0:e.items)==null?void 0:a.map((i,o)=>u.jsx(s.DropdownMenuCheckboxItem,{checked:l.title===i.title,onClick:i.action,children:u.jsx("div",{className:"richtext-ml-1 richtext-h-full",children:i.title})},`font-size-${o}`))})]})}const v=f.Extension.create({name:"fontSize",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["textStyle"],fontSizes:[...r.DEFAULT_FONT_SIZE_LIST],button({editor:t,extension:l,t:a}){var d;const i=s.ensureNameValueOptions(((d=l.options)==null?void 0:d.fontSizes)||r.DEFAULT_FONT_SIZE_VALUE),o=s.ensureNameValueOptions([r.DEFAULT_FONT_SIZE_VALUE])[0],c=i.map(n=>({title:n.value===o.value?a("editor.fontSize.default.tooltip"):String(n.name),isActive:()=>{const{fontSize:S}=t.getAttributes("textStyle");return n.value===o.value&&S===void 0?!0:t.isActive({fontSize:String(n.value)})||!1},action:()=>{if(n.value===o.value){t.commands.unsetFontSize();return}t.commands.setFontSize(String(n.value))},disabled:!t.can().setFontSize(String(n.value)),divider:n.value===o.value||!1,default:n.value===o.value||!1}));return{component:x,componentProps:{editor:t,tooltip:a("editor.fontSize.tooltip"),disabled:!1,items:c,maxHeight:280}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize.replaceAll(/["']+/g,""),renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});exports.DEFAULT_FONT_SIZE_LIST=r.DEFAULT_FONT_SIZE_LIST;exports.FontSize=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./index-ByRfqzMr.cjs"),r=require("./index-D_A0TBRA.cjs"),a=require("./RichTextEditor-DWlLqTl9.cjs"),u=require("react/jsx-runtime"),m=require("react"),z=require("./ActionMenuButton-BCgqJsST.cjs");function x(t){var s;const{t:e}=r.useLocale(),l=m.useMemo(()=>{const i=(t.items||[]).find(c=>c.isActive());return i||{title:e("editor.fontSize.default.tooltip"),isActive:()=>!1}},[t]);return u.jsxs(a.DropdownMenu,{children:[u.jsx(a.DropdownMenuTrigger,{asChild:!0,disabled:t==null?void 0:t.disabled,children:u.jsx(z.ActionMenuButton,{disabled:t==null?void 0:t.disabled,icon:"MenuDown",title:l==null?void 0:l.title,tooltip:`${t==null?void 0:t.tooltip}`,tooltipOptions:t==null?void 0:t.tooltipOptions})}),u.jsx(a.DropdownMenuContent,{className:"richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto",children:(s=t==null?void 0:t.items)==null?void 0:s.map((i,o)=>u.jsx(a.DropdownMenuCheckboxItem,{checked:l.title===i.title,onClick:i.action,children:u.jsx("div",{className:"richtext-ml-1 richtext-h-full",children:i.title})},`font-size-${o}`))})]})}const v=f.Extension.create({name:"fontSize",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontSizes:[...r.DEFAULT_FONT_SIZE_LIST],button({editor:e,extension:l,t:s}){var d;const i=a.ensureNameValueOptions(((d=l.options)==null?void 0:d.fontSizes)||r.DEFAULT_FONT_SIZE_VALUE),o=a.ensureNameValueOptions([r.DEFAULT_FONT_SIZE_VALUE])[0],c=i.map(n=>({title:n.value===o.value?s("editor.fontSize.default.tooltip"):String(n.name),isActive:()=>{const{fontSize:S}=e.getAttributes("textStyle");return n.value===o.value&&S===void 0?!0:e.isActive({fontSize:String(n.value)})||!1},action:()=>{if(n.value===o.value){e.commands.unsetFontSize();return}e.commands.setFontSize(String(n.value))},disabled:!e.can().setFontSize(String(n.value)),divider:n.value===o.value||!1,default:n.value===o.value||!1}));return{component:x,componentProps:{editor:e,tooltip:s("editor.fontSize.tooltip"),disabled:!1,items:c,maxHeight:280}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>t.style.fontSize.replaceAll(/["']+/g,""),renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}});exports.DEFAULT_FONT_SIZE_LIST=r.DEFAULT_FONT_SIZE_LIST;exports.FontSize=v;
@@ -202,6 +202,21 @@ declare module '@tiptap/core' {
202
202
  }
203
203
 
204
204
 
205
+ declare module '@tiptap/core' {
206
+ interface Commands<ReturnType> {
207
+ iframe: {
208
+ /**
209
+ * Add an iframe
210
+ */
211
+ setIframe: (options: {
212
+ src: string;
213
+ service: string;
214
+ }) => ReturnType;
215
+ };
216
+ }
217
+ }
218
+
219
+
205
220
  declare module '@tiptap/core' {
206
221
  interface Commands<ReturnType> {
207
222
  imageUpload: {
@@ -222,21 +237,6 @@ declare module '@tiptap/core' {
222
237
  }
223
238
 
224
239
 
225
- declare module '@tiptap/core' {
226
- interface Commands<ReturnType> {
227
- iframe: {
228
- /**
229
- * Add an iframe
230
- */
231
- setIframe: (options: {
232
- src: string;
233
- service: string;
234
- }) => ReturnType;
235
- };
236
- }
237
- }
238
-
239
-
240
240
  declare module '@tiptap/core' {
241
241
  interface Commands<ReturnType> {
242
242
  imageGifUpload: {
package/lib/FontSize.d.ts CHANGED
@@ -202,6 +202,21 @@ declare module '@tiptap/core' {
202
202
  }
203
203
 
204
204
 
205
+ declare module '@tiptap/core' {
206
+ interface Commands<ReturnType> {
207
+ iframe: {
208
+ /**
209
+ * Add an iframe
210
+ */
211
+ setIframe: (options: {
212
+ src: string;
213
+ service: string;
214
+ }) => ReturnType;
215
+ };
216
+ }
217
+ }
218
+
219
+
205
220
  declare module '@tiptap/core' {
206
221
  interface Commands<ReturnType> {
207
222
  imageUpload: {
@@ -222,21 +237,6 @@ declare module '@tiptap/core' {
222
237
  }
223
238
 
224
239
 
225
- declare module '@tiptap/core' {
226
- interface Commands<ReturnType> {
227
- iframe: {
228
- /**
229
- * Add an iframe
230
- */
231
- setIframe: (options: {
232
- src: string;
233
- service: string;
234
- }) => ReturnType;
235
- };
236
- }
237
- }
238
-
239
-
240
240
  declare module '@tiptap/core' {
241
241
  interface Commands<ReturnType> {
242
242
  imageGifUpload: {
package/lib/FontSize.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { E as m } from "./index-DI9T3iLd.js";
2
2
  import { u as S, D as z, g as f } from "./index-CsK90iVd.js";
3
- import { D as v, e as h, f as x, h as F, j as c } from "./RichTextEditor-BQN2eLD_.js";
3
+ import { D as v, e as h, f as x, h as F, j as c } from "./RichTextEditor-KP2Rgcqe.js";
4
4
  import { jsxs as y, jsx as u } from "react/jsx-runtime";
5
5
  import { useMemo as A } from "react";
6
- import { A as M } from "./ActionMenuButton-B6fitGKu.js";
6
+ import { A as M } from "./ActionMenuButton-D97K0UWT.js";
7
7
  function b(t) {
8
8
  var a;
9
9
  const { t: e } = S(), l = A(() => {
@@ -25,7 +25,8 @@ function b(t) {
25
25
  disabled: t == null ? void 0 : t.disabled,
26
26
  icon: "MenuDown",
27
27
  title: l == null ? void 0 : l.title,
28
- tooltip: `${t == null ? void 0 : t.tooltip}`
28
+ tooltip: `${t == null ? void 0 : t.tooltip}`,
29
+ tooltipOptions: t == null ? void 0 : t.tooltipOptions
29
30
  }
30
31
  )
31
32
  }
@@ -41,7 +42,7 @@ function b(t) {
41
42
  )) })
42
43
  ] });
43
44
  }
44
- const N = /* @__PURE__ */ m.create({
45
+ const C = /* @__PURE__ */ m.create({
45
46
  name: "fontSize",
46
47
  addOptions() {
47
48
  var t;
@@ -106,5 +107,5 @@ const N = /* @__PURE__ */ m.create({
106
107
  });
107
108
  export {
108
109
  z as DEFAULT_FONT_SIZE_LIST,
109
- N as FontSize
110
+ C as FontSize
110
111
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-ByRfqzMr.cjs"),c=require("./RichTextEditor-C8Sm1E6J.cjs"),m=i.Extension.create({name:"painter",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),button:({editor:t,t:e})=>({component:c.ActionButton,componentProps:{action:()=>{t.commands.setPainter(t==null?void 0:t.state.selection.$head.marks())},icon:"PaintRoller",tooltip:e("editor.format")}})}},addCommands(){return{setPainter:n=>({view:{dispatch:t,state:{tr:e},dom:s}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return s.style.cursor=a,t(e.setMeta("painterAction",{type:"start",marks:n})),!0}}},addProseMirrorPlugins(){return[new i.Plugin({key:new i.PluginKey("format-painter"),state:{init:()=>[],apply:(n,t)=>{const e=n.getMeta("painterAction");return e&&e.type==="start"?t=e.marks:e&&e.type==="end"&&(t=[]),t}},props:{handleDOMEvents:{mousedown(n){const t=this.getState(n.state);if(!t||t.length===0)return n.dom.style.cursor="",!1;const e=()=>{document.removeEventListener("mouseup",e);let{dispatch:s,state:{tr:r,selection:o},dom:a}=n;a.style.cursor="",r=r.removeMark(o.from,o.to);for(const u of t)u.type.name!=="link"&&(r=r.addMark(o.from,o.to,u));s(r.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",e),!0}}}})]}});exports.FormatPainter=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-ByRfqzMr.cjs"),c=require("./RichTextEditor-DWlLqTl9.cjs"),m=i.Extension.create({name:"painter",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),button:({editor:t,t:e})=>({component:c.ActionButton,componentProps:{action:()=>{t.commands.setPainter(t==null?void 0:t.state.selection.$head.marks())},icon:"PaintRoller",tooltip:e("editor.format")}})}},addCommands(){return{setPainter:n=>({view:{dispatch:t,state:{tr:e},dom:s}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return s.style.cursor=a,t(e.setMeta("painterAction",{type:"start",marks:n})),!0}}},addProseMirrorPlugins(){return[new i.Plugin({key:new i.PluginKey("format-painter"),state:{init:()=>[],apply:(n,t)=>{const e=n.getMeta("painterAction");return e&&e.type==="start"?t=e.marks:e&&e.type==="end"&&(t=[]),t}},props:{handleDOMEvents:{mousedown(n){const t=this.getState(n.state);if(!t||t.length===0)return n.dom.style.cursor="",!1;const e=()=>{document.removeEventListener("mouseup",e);let{dispatch:s,state:{tr:r,selection:o},dom:a}=n;a.style.cursor="",r=r.removeMark(o.from,o.to);for(const u of t)u.type.name!=="link"&&(r=r.addMark(o.from,o.to,u));s(r.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",e),!0}}}})]}});exports.FormatPainter=m;
@@ -196,6 +196,21 @@ declare module '@tiptap/core' {
196
196
  }
197
197
 
198
198
 
199
+ declare module '@tiptap/core' {
200
+ interface Commands<ReturnType> {
201
+ iframe: {
202
+ /**
203
+ * Add an iframe
204
+ */
205
+ setIframe: (options: {
206
+ src: string;
207
+ service: string;
208
+ }) => ReturnType;
209
+ };
210
+ }
211
+ }
212
+
213
+
199
214
  declare module '@tiptap/core' {
200
215
  interface Commands<ReturnType> {
201
216
  imageUpload: {
@@ -216,21 +231,6 @@ declare module '@tiptap/core' {
216
231
  }
217
232
 
218
233
 
219
- declare module '@tiptap/core' {
220
- interface Commands<ReturnType> {
221
- iframe: {
222
- /**
223
- * Add an iframe
224
- */
225
- setIframe: (options: {
226
- src: string;
227
- service: string;
228
- }) => ReturnType;
229
- };
230
- }
231
- }
232
-
233
-
234
234
  declare module '@tiptap/core' {
235
235
  interface Commands<ReturnType> {
236
236
  imageGifUpload: {
@@ -196,6 +196,21 @@ declare module '@tiptap/core' {
196
196
  }
197
197
 
198
198
 
199
+ declare module '@tiptap/core' {
200
+ interface Commands<ReturnType> {
201
+ iframe: {
202
+ /**
203
+ * Add an iframe
204
+ */
205
+ setIframe: (options: {
206
+ src: string;
207
+ service: string;
208
+ }) => ReturnType;
209
+ };
210
+ }
211
+ }
212
+
213
+
199
214
  declare module '@tiptap/core' {
200
215
  interface Commands<ReturnType> {
201
216
  imageUpload: {
@@ -216,21 +231,6 @@ declare module '@tiptap/core' {
216
231
  }
217
232
 
218
233
 
219
- declare module '@tiptap/core' {
220
- interface Commands<ReturnType> {
221
- iframe: {
222
- /**
223
- * Add an iframe
224
- */
225
- setIframe: (options: {
226
- src: string;
227
- service: string;
228
- }) => ReturnType;
229
- };
230
- }
231
- }
232
-
233
-
234
234
  declare module '@tiptap/core' {
235
235
  interface Commands<ReturnType> {
236
236
  imageGifUpload: {
@@ -1,5 +1,5 @@
1
1
  import { E as m, P as u, a as c } from "./index-DI9T3iLd.js";
2
- import { A as p } from "./RichTextEditor-BQN2eLD_.js";
2
+ import { A as p } from "./RichTextEditor-KP2Rgcqe.js";
3
3
  const v = /* @__PURE__ */ m.create({
4
4
  name: "painter",
5
5
  addOptions() {
package/lib/Heading.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-ByRfqzMr.cjs"),s=require("react/jsx-runtime"),m=require("react"),b=require("./ActionMenuButton-wiDnIxE2.cjs"),r=require("./RichTextEditor-C8Sm1E6J.cjs"),x=u.Node.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>u.textblockTypeInputRule({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});function M(e){var l;const t=m.useMemo(()=>{var a;const n=(a=e==null?void 0:e.items)==null?void 0:a.find(o=>o.isActive());return n&&!n.default?{...n}:{title:e.tooltip,level:0,isActive:()=>!1}},[e]);return s.jsxs(r.DropdownMenu,{children:[s.jsx(r.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:s.jsx(b.ActionMenuButton,{disabled:e==null?void 0:e.disabled,icon:"MenuDown",title:t==null?void 0:t.title,tooltip:e==null?void 0:e.tooltip})}),s.jsx(r.DropdownMenuContent,{className:"richtext-w-full",children:(l=e==null?void 0:e.items)==null?void 0:l.map((n,c)=>{var a,o;return s.jsxs(m.Fragment,{children:[s.jsxs(r.DropdownMenuCheckboxItem,{checked:(t==null?void 0:t.title)===n.title,onClick:n.action,children:[s.jsx("div",{className:`heading- richtext-ml-1 richtext-h-full${n.level}`,children:n.title}),!!((a=n==null?void 0:n.shortcutKeys)!=null&&a.length)&&s.jsx(r.DropdownMenuShortcut,{className:"richtext-pl-4",children:(o=n==null?void 0:n.shortcutKeys)==null?void 0:o.map(d=>r.getShortcutKey(d)).join(" ")})]}),n.level===0&&s.jsx(r.DropdownMenuSeparator,{})]},`heading-k-${c}`)})})]})}const A=x.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),levels:[1,2,3,4,5,6],button({editor:t,extension:l,t:n}){var h,g;const{extensions:c=[]}=t.extensionManager??[],a=((h=l.options)==null?void 0:h.levels)||[],o=c.find(i=>i.name==="base-kit"),d=a.map(i=>{var f;return{action:()=>t.commands.toggleHeading({level:i}),isActive:()=>t.isActive("heading",{level:i})||!1,disabled:!t.can().toggleHeading({level:i}),title:n(`editor.heading.h${i}.tooltip`),level:i,shortcutKeys:((f=l.options.shortcutKeys)==null?void 0:f[i])??["alt","mod",`${i}`]}});o&&o.options.paragraph!==!1&&d.unshift({action:()=>t.commands.setParagraph(),isActive:()=>t.isActive("paragraph")||!1,disabled:!t.can().setParagraph(),level:0,title:n("editor.paragraph.tooltip"),shortcutKeys:((g=l.options.shortcutKeys)==null?void 0:g[0])??["alt","mod","0"]});const v=d.filter(i=>i.disabled).length===d.length;return{component:M,componentProps:{tooltip:n("editor.heading.tooltip"),disabled:v,items:d,editor:t}}}}}});exports.Heading=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-ByRfqzMr.cjs"),s=require("react/jsx-runtime"),m=require("react"),b=require("./ActionMenuButton-BCgqJsST.cjs"),d=require("./RichTextEditor-DWlLqTl9.cjs"),x=u.Node.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,u.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>u.textblockTypeInputRule({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});function M(e){var l;const t=m.useMemo(()=>{var a;const n=(a=e==null?void 0:e.items)==null?void 0:a.find(o=>o.isActive());return n&&!n.default?{...n}:{title:e.tooltip,level:0,isActive:()=>!1}},[e]);return s.jsxs(d.DropdownMenu,{children:[s.jsx(d.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:s.jsx(b.ActionMenuButton,{disabled:e==null?void 0:e.disabled,icon:"MenuDown",title:t==null?void 0:t.title,tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions})}),s.jsx(d.DropdownMenuContent,{className:"richtext-w-full",children:(l=e==null?void 0:e.items)==null?void 0:l.map((n,c)=>{var a,o;return s.jsxs(m.Fragment,{children:[s.jsxs(d.DropdownMenuCheckboxItem,{checked:(t==null?void 0:t.title)===n.title,onClick:n.action,children:[s.jsx("div",{className:`heading- richtext-ml-1 richtext-h-full${n.level}`,children:n.title}),!!((a=n==null?void 0:n.shortcutKeys)!=null&&a.length)&&s.jsx(d.DropdownMenuShortcut,{className:"richtext-pl-4",children:(o=n==null?void 0:n.shortcutKeys)==null?void 0:o.map(r=>d.getShortcutKey(r)).join(" ")})]}),n.level===0&&s.jsx(d.DropdownMenuSeparator,{})]},`heading-k-${c}`)})})]})}const A=x.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),levels:[1,2,3,4,5,6],button({editor:t,extension:l,t:n}){var h,g;const{extensions:c=[]}=t.extensionManager??[],a=((h=l.options)==null?void 0:h.levels)||[],o=c.find(i=>i.name==="base-kit"),r=a.map(i=>{var f;return{action:()=>t.commands.toggleHeading({level:i}),isActive:()=>t.isActive("heading",{level:i})||!1,disabled:!t.can().toggleHeading({level:i}),title:n(`editor.heading.h${i}.tooltip`),level:i,shortcutKeys:((f=l.options.shortcutKeys)==null?void 0:f[i])??["alt","mod",`${i}`]}});o&&o.options.paragraph!==!1&&r.unshift({action:()=>t.commands.setParagraph(),isActive:()=>t.isActive("paragraph")||!1,disabled:!t.can().setParagraph(),level:0,title:n("editor.paragraph.tooltip"),shortcutKeys:((g=l.options.shortcutKeys)==null?void 0:g[0])??["alt","mod","0"]});const v=r.filter(i=>i.disabled).length===r.length;return{component:M,componentProps:{tooltip:n("editor.heading.tooltip"),disabled:v,items:r,editor:t}}}}}});exports.Heading=A;
package/lib/Heading.d.cts CHANGED
@@ -186,6 +186,21 @@ declare module '@tiptap/core' {
186
186
  }
187
187
 
188
188
 
189
+ declare module '@tiptap/core' {
190
+ interface Commands<ReturnType> {
191
+ iframe: {
192
+ /**
193
+ * Add an iframe
194
+ */
195
+ setIframe: (options: {
196
+ src: string;
197
+ service: string;
198
+ }) => ReturnType;
199
+ };
200
+ }
201
+ }
202
+
203
+
189
204
  declare module '@tiptap/core' {
190
205
  interface Commands<ReturnType> {
191
206
  imageUpload: {
@@ -206,21 +221,6 @@ declare module '@tiptap/core' {
206
221
  }
207
222
 
208
223
 
209
- declare module '@tiptap/core' {
210
- interface Commands<ReturnType> {
211
- iframe: {
212
- /**
213
- * Add an iframe
214
- */
215
- setIframe: (options: {
216
- src: string;
217
- service: string;
218
- }) => ReturnType;
219
- };
220
- }
221
- }
222
-
223
-
224
224
  declare module '@tiptap/core' {
225
225
  interface Commands<ReturnType> {
226
226
  imageGifUpload: {
package/lib/Heading.d.ts CHANGED
@@ -186,6 +186,21 @@ declare module '@tiptap/core' {
186
186
  }
187
187
 
188
188
 
189
+ declare module '@tiptap/core' {
190
+ interface Commands<ReturnType> {
191
+ iframe: {
192
+ /**
193
+ * Add an iframe
194
+ */
195
+ setIframe: (options: {
196
+ src: string;
197
+ service: string;
198
+ }) => ReturnType;
199
+ };
200
+ }
201
+ }
202
+
203
+
189
204
  declare module '@tiptap/core' {
190
205
  interface Commands<ReturnType> {
191
206
  imageUpload: {
@@ -206,21 +221,6 @@ declare module '@tiptap/core' {
206
221
  }
207
222
 
208
223
 
209
- declare module '@tiptap/core' {
210
- interface Commands<ReturnType> {
211
- iframe: {
212
- /**
213
- * Add an iframe
214
- */
215
- setIframe: (options: {
216
- src: string;
217
- service: string;
218
- }) => ReturnType;
219
- };
220
- }
221
- }
222
-
223
-
224
224
  declare module '@tiptap/core' {
225
225
  interface Commands<ReturnType> {
226
226
  imageGifUpload: {
package/lib/Heading.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { N as f, t as v, m as b } from "./index-DI9T3iLd.js";
2
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { jsxs as c, jsx as d } from "react/jsx-runtime";
3
3
  import { useMemo as M, Fragment as A } from "react";
4
- import { A as x } from "./ActionMenuButton-B6fitGKu.js";
5
- import { D as H, e as p, f as y, h as $, v as w, s as K, u as D } from "./RichTextEditor-BQN2eLD_.js";
6
- const k = f.create({
4
+ import { A as x } from "./ActionMenuButton-D97K0UWT.js";
5
+ import { D as H, e as y, f as $, h as w, v as K, s as D, u as k } from "./RichTextEditor-KP2Rgcqe.js";
6
+ const N = f.create({
7
7
  name: "heading",
8
8
  addOptions() {
9
9
  return {
@@ -53,8 +53,8 @@ const k = f.create({
53
53
  }));
54
54
  }
55
55
  });
56
- function N(t) {
57
- var i;
56
+ function L(t) {
57
+ var s;
58
58
  const e = M(() => {
59
59
  var a;
60
60
  const n = (a = t == null ? void 0 : t.items) == null ? void 0 : a.find((l) => l.isActive());
@@ -67,60 +67,61 @@ function N(t) {
67
67
  };
68
68
  }, [t]);
69
69
  return /* @__PURE__ */ c(H, { children: [
70
- /* @__PURE__ */ r(
71
- p,
70
+ /* @__PURE__ */ d(
71
+ y,
72
72
  {
73
73
  asChild: !0,
74
74
  disabled: t == null ? void 0 : t.disabled,
75
- children: /* @__PURE__ */ r(
75
+ children: /* @__PURE__ */ d(
76
76
  x,
77
77
  {
78
78
  disabled: t == null ? void 0 : t.disabled,
79
79
  icon: "MenuDown",
80
80
  title: e == null ? void 0 : e.title,
81
- tooltip: t == null ? void 0 : t.tooltip
81
+ tooltip: t == null ? void 0 : t.tooltip,
82
+ tooltipOptions: t == null ? void 0 : t.tooltipOptions
82
83
  }
83
84
  )
84
85
  }
85
86
  ),
86
- /* @__PURE__ */ r(y, { className: "richtext-w-full", children: (i = t == null ? void 0 : t.items) == null ? void 0 : i.map((n, d) => {
87
+ /* @__PURE__ */ d($, { className: "richtext-w-full", children: (s = t == null ? void 0 : t.items) == null ? void 0 : s.map((n, r) => {
87
88
  var a, l;
88
89
  return /* @__PURE__ */ c(A, { children: [
89
90
  /* @__PURE__ */ c(
90
- $,
91
+ w,
91
92
  {
92
93
  checked: (e == null ? void 0 : e.title) === n.title,
93
94
  onClick: n.action,
94
95
  children: [
95
- /* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${n.level}`, children: n.title }),
96
- !!((a = n == null ? void 0 : n.shortcutKeys) != null && a.length) && /* @__PURE__ */ r(w, { className: "richtext-pl-4", children: (l = n == null ? void 0 : n.shortcutKeys) == null ? void 0 : l.map((o) => K(o)).join(" ") })
96
+ /* @__PURE__ */ d("div", { className: `heading- richtext-ml-1 richtext-h-full${n.level}`, children: n.title }),
97
+ !!((a = n == null ? void 0 : n.shortcutKeys) != null && a.length) && /* @__PURE__ */ d(K, { className: "richtext-pl-4", children: (l = n == null ? void 0 : n.shortcutKeys) == null ? void 0 : l.map((o) => D(o)).join(" ") })
97
98
  ]
98
99
  }
99
100
  ),
100
- n.level === 0 && /* @__PURE__ */ r(D, {})
101
- ] }, `heading-k-${d}`);
101
+ n.level === 0 && /* @__PURE__ */ d(k, {})
102
+ ] }, `heading-k-${r}`);
102
103
  }) })
103
104
  ] });
104
105
  }
105
- const I = /* @__PURE__ */ k.extend({
106
+ const j = /* @__PURE__ */ N.extend({
106
107
  addOptions() {
107
108
  var t;
108
109
  return {
109
110
  ...(t = this.parent) == null ? void 0 : t.call(this),
110
111
  levels: [1, 2, 3, 4, 5, 6],
111
- button({ editor: e, extension: i, t: n }) {
112
+ button({ editor: e, extension: s, t: n }) {
112
113
  var h, u;
113
- const { extensions: d = [] } = e.extensionManager ?? [], a = ((h = i.options) == null ? void 0 : h.levels) || [], l = d.find(
114
- (s) => s.name === "base-kit"
115
- ), o = a.map((s) => {
114
+ const { extensions: r = [] } = e.extensionManager ?? [], a = ((h = s.options) == null ? void 0 : h.levels) || [], l = r.find(
115
+ (i) => i.name === "base-kit"
116
+ ), o = a.map((i) => {
116
117
  var g;
117
118
  return {
118
- action: () => e.commands.toggleHeading({ level: s }),
119
- isActive: () => e.isActive("heading", { level: s }) || !1,
120
- disabled: !e.can().toggleHeading({ level: s }),
121
- title: n(`editor.heading.h${s}.tooltip`),
122
- level: s,
123
- shortcutKeys: ((g = i.options.shortcutKeys) == null ? void 0 : g[s]) ?? ["alt", "mod", `${s}`]
119
+ action: () => e.commands.toggleHeading({ level: i }),
120
+ isActive: () => e.isActive("heading", { level: i }) || !1,
121
+ disabled: !e.can().toggleHeading({ level: i }),
122
+ title: n(`editor.heading.h${i}.tooltip`),
123
+ level: i,
124
+ shortcutKeys: ((g = s.options.shortcutKeys) == null ? void 0 : g[i]) ?? ["alt", "mod", `${i}`]
124
125
  };
125
126
  });
126
127
  l && l.options.paragraph !== !1 && o.unshift({
@@ -129,11 +130,11 @@ const I = /* @__PURE__ */ k.extend({
129
130
  disabled: !e.can().setParagraph(),
130
131
  level: 0,
131
132
  title: n("editor.paragraph.tooltip"),
132
- shortcutKeys: ((u = i.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["alt", "mod", "0"]
133
+ shortcutKeys: ((u = s.options.shortcutKeys) == null ? void 0 : u[0]) ?? ["alt", "mod", "0"]
133
134
  });
134
- const m = o.filter((s) => s.disabled).length === o.length;
135
+ const m = o.filter((i) => i.disabled).length === o.length;
135
136
  return {
136
- component: N,
137
+ component: L,
137
138
  componentProps: {
138
139
  tooltip: n("editor.heading.tooltip"),
139
140
  disabled: m,
@@ -146,5 +147,5 @@ const I = /* @__PURE__ */ k.extend({
146
147
  }
147
148
  });
148
149
  export {
149
- I as Heading
150
+ j as Heading
150
151
  };
package/lib/Highlight.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-ByRfqzMr.cjs"),s=require("./RichTextEditor-C8Sm1E6J.cjs"),u=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,l=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,a=r.Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[r.markInputRule({find:u,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:l,type:this.type})]}}),h=a.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),multicolor:!0,button:({editor:e,t:n,extension:o})=>({component:s.HighlightActionButton,componentProps:{action:i=>{typeof i=="string"&&e.chain().focus().setHighlight({color:i}).run(),i===void 0&&e.chain().focus().unsetHighlight().run()},editor:e,isActive:()=>e.isActive("highlight")||!1,disabled:!1,shortcutKeys:o.options.shortcutKeys??["⇧","mod","H"],tooltip:n("editor.highlight.tooltip"),defaultColor:o.options.defaultColor}})}}});exports.Highlight=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-ByRfqzMr.cjs"),s=require("./RichTextEditor-DWlLqTl9.cjs"),u=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,l=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,a=r.Mark.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",r.mergeAttributes(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[r.markInputRule({find:u,type:this.type})]},addPasteRules(){return[r.markPasteRule({find:l,type:this.type})]}}),h=a.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),multicolor:!0,button:({editor:e,t:n,extension:o})=>({component:s.HighlightActionButton,componentProps:{action:i=>{typeof i=="string"&&e.chain().focus().setHighlight({color:i}).run(),i===void 0&&e.chain().focus().unsetHighlight().run()},editor:e,isActive:()=>e.isActive("highlight")||!1,disabled:!1,shortcutKeys:o.options.shortcutKeys??["⇧","mod","H"],tooltip:n("editor.highlight.tooltip"),defaultColor:o.options.defaultColor}})}}});exports.Highlight=h;
@@ -191,6 +191,21 @@ declare module '@tiptap/core' {
191
191
  }
192
192
 
193
193
 
194
+ declare module '@tiptap/core' {
195
+ interface Commands<ReturnType> {
196
+ iframe: {
197
+ /**
198
+ * Add an iframe
199
+ */
200
+ setIframe: (options: {
201
+ src: string;
202
+ service: string;
203
+ }) => ReturnType;
204
+ };
205
+ }
206
+ }
207
+
208
+
194
209
  declare module '@tiptap/core' {
195
210
  interface Commands<ReturnType> {
196
211
  imageUpload: {
@@ -211,21 +226,6 @@ declare module '@tiptap/core' {
211
226
  }
212
227
 
213
228
 
214
- declare module '@tiptap/core' {
215
- interface Commands<ReturnType> {
216
- iframe: {
217
- /**
218
- * Add an iframe
219
- */
220
- setIframe: (options: {
221
- src: string;
222
- service: string;
223
- }) => ReturnType;
224
- };
225
- }
226
- }
227
-
228
-
229
229
  declare module '@tiptap/core' {
230
230
  interface Commands<ReturnType> {
231
231
  imageGifUpload: {