reactjs-tiptap-editor 0.3.30 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/README.md +8 -2
  2. package/lib/{ActionMenuButton-wiDnIxE2.cjs → ActionMenuButton-CYdM1xx5.cjs} +1 -1
  3. package/lib/{ActionMenuButton-B6fitGKu.js → ActionMenuButton-DKRF6oa0.js} +5 -5
  4. package/lib/Attachment.cjs +2 -2
  5. package/lib/Attachment.d.cts +47 -51
  6. package/lib/Attachment.d.ts +47 -51
  7. package/lib/Attachment.js +7 -6
  8. package/lib/BaseKit.cjs +3 -0
  9. package/lib/BaseKit.d.cts +481 -0
  10. package/lib/BaseKit.d.ts +481 -0
  11. package/lib/BaseKit.js +132 -0
  12. package/lib/Blockquote.cjs +5 -1
  13. package/lib/Blockquote.d.cts +47 -51
  14. package/lib/Blockquote.d.ts +47 -51
  15. package/lib/Blockquote.js +33 -17
  16. package/lib/Bold.cjs +1 -1
  17. package/lib/Bold.d.cts +47 -51
  18. package/lib/Bold.d.ts +47 -51
  19. package/lib/Bold.js +23 -16
  20. package/lib/BulletList.cjs +1 -1
  21. package/lib/BulletList.d.cts +48 -52
  22. package/lib/BulletList.d.ts +48 -52
  23. package/lib/BulletList.js +11 -57
  24. package/lib/Clear.cjs +1 -1
  25. package/lib/Clear.d.cts +47 -51
  26. package/lib/Clear.d.ts +47 -51
  27. package/lib/Clear.js +4 -2
  28. package/lib/Code.cjs +1 -1
  29. package/lib/Code.d.cts +47 -51
  30. package/lib/Code.d.ts +47 -51
  31. package/lib/Code.js +29 -25
  32. package/lib/CodeBlock.cjs +2 -2
  33. package/lib/CodeBlock.d.cts +47 -51
  34. package/lib/CodeBlock.d.ts +47 -51
  35. package/lib/CodeBlock.js +5 -4
  36. package/lib/CodeView.cjs +1 -1
  37. package/lib/CodeView.d.cts +47 -51
  38. package/lib/CodeView.d.ts +47 -51
  39. package/lib/CodeView.js +3 -2
  40. package/lib/Color.cjs +1 -1
  41. package/lib/Color.d.cts +48 -52
  42. package/lib/Color.d.ts +48 -52
  43. package/lib/Color.js +42 -74
  44. package/lib/Document.cjs +1 -1
  45. package/lib/Document.d.cts +47 -51
  46. package/lib/Document.d.ts +47 -51
  47. package/lib/Document.js +4 -8
  48. package/lib/{Drawer-BKTU9CpU.js → Drawer-CaAfmqNo.js} +268 -265
  49. package/lib/Drawer-CdvCMSzN.cjs +1 -0
  50. package/lib/Drawer.cjs +1 -1
  51. package/lib/Drawer.d.cts +47 -51
  52. package/lib/Drawer.d.ts +47 -51
  53. package/lib/Drawer.js +4 -4
  54. package/lib/Emoji.cjs +1 -1
  55. package/lib/Emoji.d.cts +50 -52
  56. package/lib/Emoji.d.ts +50 -52
  57. package/lib/Emoji.js +19790 -178
  58. package/lib/Excalidraw-BbMQhNvs.cjs +1 -0
  59. package/lib/Excalidraw-CVWz2Vyn.js +290 -0
  60. package/lib/Excalidraw.cjs +1 -1
  61. package/lib/Excalidraw.d.cts +47 -51
  62. package/lib/Excalidraw.d.ts +47 -51
  63. package/lib/Excalidraw.js +3 -3
  64. package/lib/ExportPdf.cjs +1 -1
  65. package/lib/ExportPdf.d.cts +47 -51
  66. package/lib/ExportPdf.d.ts +47 -51
  67. package/lib/ExportPdf.js +4 -2
  68. package/lib/ExportWord.cjs +1 -1
  69. package/lib/ExportWord.d.cts +47 -51
  70. package/lib/ExportWord.d.ts +47 -51
  71. package/lib/ExportWord.js +22 -51
  72. package/lib/FontFamily.cjs +1 -1
  73. package/lib/FontFamily.d.cts +48 -52
  74. package/lib/FontFamily.d.ts +48 -52
  75. package/lib/FontFamily.js +46 -74
  76. package/lib/FontSize.cjs +1 -1
  77. package/lib/FontSize.d.cts +47 -51
  78. package/lib/FontSize.d.ts +47 -51
  79. package/lib/FontSize.js +11 -8
  80. package/lib/FormatPainter.cjs +1 -1
  81. package/lib/FormatPainter.d.cts +47 -51
  82. package/lib/FormatPainter.d.ts +47 -51
  83. package/lib/FormatPainter.js +4 -2
  84. package/lib/Heading.cjs +1 -1
  85. package/lib/Heading.d.cts +47 -51
  86. package/lib/Heading.d.ts +47 -51
  87. package/lib/Heading.js +77 -65
  88. package/lib/Highlight.cjs +1 -1
  89. package/lib/Highlight.d.cts +47 -51
  90. package/lib/Highlight.d.ts +47 -51
  91. package/lib/Highlight.js +5 -4
  92. package/lib/History.cjs +1 -1
  93. package/lib/History.d.cts +49 -53
  94. package/lib/History.d.ts +49 -53
  95. package/lib/History.js +39 -403
  96. package/lib/HorizontalRule.cjs +1 -1
  97. package/lib/HorizontalRule.d.cts +47 -51
  98. package/lib/HorizontalRule.d.ts +47 -51
  99. package/lib/HorizontalRule.js +16 -65
  100. package/lib/Iframe.cjs +1 -1
  101. package/lib/Iframe.d.cts +47 -51
  102. package/lib/Iframe.d.ts +47 -51
  103. package/lib/Iframe.js +4 -4
  104. package/lib/Image.cjs +1 -1
  105. package/lib/Image.d.cts +47 -51
  106. package/lib/Image.d.ts +47 -51
  107. package/lib/Image.js +3 -3
  108. package/lib/ImageGif.cjs +1 -1
  109. package/lib/ImageGif.d.cts +47 -51
  110. package/lib/ImageGif.d.ts +47 -51
  111. package/lib/ImageGif.js +5 -5
  112. package/lib/ImportWord.cjs +72 -72
  113. package/lib/ImportWord.d.cts +47 -51
  114. package/lib/ImportWord.d.ts +47 -51
  115. package/lib/ImportWord.js +5654 -5616
  116. package/lib/Indent.cjs +1 -1
  117. package/lib/Indent.d.cts +47 -51
  118. package/lib/Indent.d.ts +47 -51
  119. package/lib/Indent.js +4 -2
  120. package/lib/Italic.cjs +1 -1
  121. package/lib/Italic.d.cts +47 -51
  122. package/lib/Italic.d.ts +47 -51
  123. package/lib/Italic.js +20 -14
  124. package/lib/Katex.cjs +1 -1
  125. package/lib/Katex.d.cts +47 -51
  126. package/lib/Katex.d.ts +47 -51
  127. package/lib/Katex.js +49 -48
  128. package/lib/LineHeight.cjs +1 -1
  129. package/lib/LineHeight.d.cts +47 -51
  130. package/lib/LineHeight.d.ts +47 -51
  131. package/lib/LineHeight.js +21 -18
  132. package/lib/Link.cjs +1 -1
  133. package/lib/Link.d.cts +47 -51
  134. package/lib/Link.d.ts +47 -51
  135. package/lib/Link.js +4 -4
  136. package/lib/ListItem.cjs +1 -1
  137. package/lib/ListItem.d.cts +52 -52
  138. package/lib/ListItem.d.ts +52 -52
  139. package/lib/ListItem.js +4 -30
  140. package/lib/Mention.cjs +1 -1
  141. package/lib/Mention.d.cts +47 -51
  142. package/lib/Mention.d.ts +47 -51
  143. package/lib/Mention.js +161 -132
  144. package/lib/Mermaid.cjs +2 -2
  145. package/lib/Mermaid.d.cts +47 -51
  146. package/lib/Mermaid.d.ts +47 -51
  147. package/lib/Mermaid.js +150 -147
  148. package/lib/MoreMark.cjs +1 -1
  149. package/lib/MoreMark.d.cts +47 -51
  150. package/lib/MoreMark.d.ts +47 -51
  151. package/lib/MoreMark.js +5 -3
  152. package/lib/MultiColumn.cjs +1 -1
  153. package/lib/MultiColumn.d.cts +47 -51
  154. package/lib/MultiColumn.d.ts +47 -51
  155. package/lib/MultiColumn.js +2 -2
  156. package/lib/OrderedList.cjs +1 -1
  157. package/lib/OrderedList.d.cts +48 -52
  158. package/lib/OrderedList.d.ts +48 -52
  159. package/lib/OrderedList.js +11 -75
  160. package/lib/RichTextEditor-CxvwGvQG.cjs +142 -0
  161. package/lib/RichTextEditor-DGcKEUGr.js +22166 -0
  162. package/lib/SearchAndReplace.cjs +1 -1
  163. package/lib/SearchAndReplace.d.cts +60 -134
  164. package/lib/SearchAndReplace.d.ts +60 -134
  165. package/lib/SearchAndReplace.js +207 -194
  166. package/lib/Selection.cjs +1 -1
  167. package/lib/Selection.d.cts +47 -51
  168. package/lib/Selection.d.ts +47 -51
  169. package/lib/Selection.js +1 -1
  170. package/lib/SlashCommand.cjs +1 -1
  171. package/lib/SlashCommand.d.cts +47 -51
  172. package/lib/SlashCommand.d.ts +47 -51
  173. package/lib/SlashCommand.js +177 -222
  174. package/lib/Strike.cjs +1 -1
  175. package/lib/Strike.d.cts +47 -51
  176. package/lib/Strike.d.ts +47 -51
  177. package/lib/Strike.js +20 -14
  178. package/lib/SubAndSuperScript.cjs +1 -1
  179. package/lib/SubAndSuperScript.d.cts +47 -51
  180. package/lib/SubAndSuperScript.d.ts +47 -51
  181. package/lib/SubAndSuperScript.js +5 -3
  182. package/lib/Table.cjs +8 -10
  183. package/lib/Table.d.cts +50 -54
  184. package/lib/Table.d.ts +50 -54
  185. package/lib/Table.js +382 -2021
  186. package/lib/TableOfContent.cjs +1 -1
  187. package/lib/TableOfContent.d.cts +47 -51
  188. package/lib/TableOfContent.d.ts +47 -51
  189. package/lib/TableOfContent.js +53 -52
  190. package/lib/TaskList.cjs +1 -1
  191. package/lib/TaskList.d.cts +49 -53
  192. package/lib/TaskList.d.ts +49 -53
  193. package/lib/TaskList.js +12 -154
  194. package/lib/TextAlign.cjs +1 -1
  195. package/lib/TextAlign.d.cts +47 -51
  196. package/lib/TextAlign.d.ts +47 -51
  197. package/lib/TextAlign.js +11 -8
  198. package/lib/TextBubble.cjs +1 -1
  199. package/lib/TextBubble.d.cts +47 -51
  200. package/lib/TextBubble.d.ts +47 -51
  201. package/lib/TextBubble.js +5 -3
  202. package/lib/TextDirection.cjs +1 -1
  203. package/lib/TextDirection.d.cts +47 -51
  204. package/lib/TextDirection.d.ts +47 -51
  205. package/lib/TextDirection.js +15 -15
  206. package/lib/TextUnderline.cjs +1 -1
  207. package/lib/TextUnderline.d.cts +47 -51
  208. package/lib/TextUnderline.d.ts +47 -51
  209. package/lib/TextUnderline.js +40 -12
  210. package/lib/TrailingNode.cjs +1 -1
  211. package/lib/TrailingNode.d.cts +47 -51
  212. package/lib/TrailingNode.d.ts +47 -51
  213. package/lib/TrailingNode.js +1 -1
  214. package/lib/Twitter-BFULyqdR.js +1628 -0
  215. package/lib/Twitter-Cutpkh3h.cjs +1 -0
  216. package/lib/Twitter.cjs +1 -1
  217. package/lib/Twitter.d.cts +47 -51
  218. package/lib/Twitter.d.ts +47 -51
  219. package/lib/Twitter.js +3 -3
  220. package/lib/Video.cjs +1 -1
  221. package/lib/Video.d.cts +47 -51
  222. package/lib/Video.d.ts +47 -51
  223. package/lib/Video.js +3 -3
  224. package/lib/bubble-extra.cjs +2 -2
  225. package/lib/bubble-extra.d.cts +47 -51
  226. package/lib/bubble-extra.d.ts +47 -51
  227. package/lib/bubble-extra.js +200 -192
  228. package/lib/dom-dataset-_6-diIRQ.cjs +33 -0
  229. package/lib/dom-dataset-lYeH6gfI.js +2361 -0
  230. package/lib/index-5iBZLua9.cjs +12 -0
  231. package/lib/index-6D1J-A-o.cjs +1 -0
  232. package/lib/index-B96Cclrj.cjs +3 -0
  233. package/lib/index-BBz7Nmv9.js +55 -0
  234. package/lib/index-BeCTd5v2.cjs +1 -0
  235. package/lib/index-ByurDDMv.js +237 -0
  236. package/lib/index-CUogRI7j.cjs +1 -0
  237. package/lib/index-Ch6dBBad.js +709 -0
  238. package/lib/index-DF2Lp4HZ.cjs +100 -0
  239. package/lib/{index-LUL9mqY4.js → index-D_L6n8O8.js} +4 -4
  240. package/lib/index-Dbvi-Bvh.cjs +1 -0
  241. package/lib/index-DpCrt7xs.cjs +1 -0
  242. package/lib/index-DsAX1Vq8.cjs +1 -0
  243. package/lib/index-Dy4DlW9o.js +12 -0
  244. package/lib/index-J3jHHZ4d.js +200 -0
  245. package/lib/{index-CsK90iVd.js → index-LmrOdnen.js} +302 -389
  246. package/lib/index-VvXaaKe3.js +898 -0
  247. package/lib/index-kbO3iWqL.js +13432 -0
  248. package/lib/index.cjs +1 -2
  249. package/lib/index.d.cts +49 -251
  250. package/lib/index.d.ts +49 -251
  251. package/lib/index.js +2 -588
  252. package/lib/jsx-runtime-CT7Pcg-t.js +13 -0
  253. package/lib/jsx-runtime-C_NLcKys.cjs +1 -0
  254. package/lib/locale-bundle.cjs +1 -1
  255. package/lib/locale-bundle.d.cts +47 -51
  256. package/lib/locale-bundle.d.ts +47 -51
  257. package/lib/locale-bundle.js +1 -1
  258. package/lib/style.css +1 -1
  259. package/lib/{textarea-D5WVZMgt.cjs → textarea-DFo_aXnj.cjs} +1 -1
  260. package/lib/{textarea-BglwYF6b.js → textarea-aPtytkDx.js} +1 -1
  261. package/package.json +76 -70
  262. package/lib/Drawer-CmoEF-Zg.cjs +0 -1
  263. package/lib/Excalidraw-CM74U5tG.js +0 -289
  264. package/lib/Excalidraw-DAPP9qgY.cjs +0 -1
  265. package/lib/RichTextEditor-BQN2eLD_.js +0 -12775
  266. package/lib/RichTextEditor-C8Sm1E6J.cjs +0 -140
  267. package/lib/Twitter-CL2pu4QM.cjs +0 -17
  268. package/lib/Twitter-Dg6WWauX.js +0 -1743
  269. package/lib/dom-dataset-Byuf1YmW.cjs +0 -33
  270. package/lib/dom-dataset-Di3tIRrR.js +0 -1031
  271. package/lib/index-BI-IcZcN.cjs +0 -1
  272. package/lib/index-ByRfqzMr.cjs +0 -89
  273. package/lib/index-C1fzuXpN.js +0 -46
  274. package/lib/index-CbQQFj2T.js +0 -133
  275. package/lib/index-DI9T3iLd.js +0 -12354
  276. package/lib/index-D_A0TBRA.cjs +0 -1
  277. package/lib/index-DclQSrIx.cjs +0 -1
  278. package/lib/index-Z4b9rzn-.cjs +0 -1
package/lib/FontFamily.js CHANGED
@@ -1,129 +1,101 @@
1
- import "./index-C1fzuXpN.js";
2
- import { E as c } from "./index-DI9T3iLd.js";
3
- import { u as y, h as F } from "./index-CsK90iVd.js";
4
- import { jsxs as r, jsx as a } from "react/jsx-runtime";
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";
8
- const w = c.create({
9
- name: "fontFamily",
10
- addOptions() {
11
- return {
12
- types: ["textStyle"]
13
- };
14
- },
15
- addGlobalAttributes() {
16
- return [
17
- {
18
- types: this.options.types,
19
- attributes: {
20
- fontFamily: {
21
- default: null,
22
- parseHTML: (t) => t.style.fontFamily,
23
- renderHTML: (t) => t.fontFamily ? {
24
- style: `font-family: ${t.fontFamily}`
25
- } : {}
26
- }
27
- }
28
- }
29
- ];
30
- },
31
- addCommands() {
32
- return {
33
- setFontFamily: (t) => ({ chain: i }) => i().setMark("textStyle", { fontFamily: t }).run(),
34
- unsetFontFamily: () => ({ chain: t }) => t().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
35
- };
36
- }
37
- });
38
- function T(t) {
39
- var m, u, f;
40
- const { t: i, lang: s } = y(), n = h(() => {
1
+ import { F } from "./index-ByurDDMv.js";
2
+ import { u as r, D as h } from "./index-LmrOdnen.js";
3
+ import { jsxs as c, jsx as a } from "react/jsx-runtime";
4
+ import { useMemo as y, Fragment as b } from "react";
5
+ import { A as M } from "./ActionMenuButton-DKRF6oa0.js";
6
+ import { D as x, h as A, j as D, k as g, l as w, m as L } from "./RichTextEditor-DGcKEUGr.js";
7
+ function k(t) {
8
+ var m, s, d;
9
+ const { t: e, lang: f } = r(), n = y(() => {
41
10
  var o;
42
- const e = (o = t == null ? void 0 : t.items) == null ? void 0 : o.find((l) => l.isActive());
43
- return e && !e.default ? {
44
- ...e
11
+ const i = (o = t == null ? void 0 : t.items) == null ? void 0 : o.find((l) => l.isActive());
12
+ return i && !i.default ? {
13
+ ...i
45
14
  } : {
46
15
  title: t.tooltip,
47
- font: i("editor.fontFamily.default.tooltip"),
16
+ font: e("editor.fontFamily.default.tooltip"),
48
17
  isActive: () => !1,
49
18
  disabled: !1,
50
19
  action: () => t.editor.chain().focus().unsetFontFamily().run()
51
20
  };
52
- }, [i, s, t]);
53
- return /* @__PURE__ */ r(M, { children: [
21
+ }, [e, f, t]);
22
+ return /* @__PURE__ */ c(x, { children: [
54
23
  /* @__PURE__ */ a(
55
24
  A,
56
25
  {
57
26
  asChild: !0,
58
27
  disabled: t == null ? void 0 : t.disabled,
59
28
  children: /* @__PURE__ */ a(
60
- x,
29
+ M,
61
30
  {
62
31
  disabled: t == null ? void 0 : t.disabled,
63
32
  icon: "MenuDown",
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
33
+ title: ((m = n == null ? void 0 : n.font) == null ? void 0 : m.length) > 7 ? `${(s = n == null ? void 0 : n.font) == null ? void 0 : s.slice(0, 6)}...` : n == null ? void 0 : n.font,
34
+ tooltip: t == null ? void 0 : t.tooltip,
35
+ tooltipOptions: t == null ? void 0 : t.tooltipOptions
66
36
  }
67
37
  )
68
38
  }
69
39
  ),
70
- /* @__PURE__ */ a(L, { className: "richtext-w-full", children: (f = t == null ? void 0 : t.items) == null ? void 0 : f.map((e, d) => {
71
- const o = e.font === i("editor.fontFamily.default.tooltip") ? {} : { fontFamily: e.font };
72
- return /* @__PURE__ */ r(b, { children: [
40
+ /* @__PURE__ */ a(D, { className: "richtext-w-full", children: (d = t == null ? void 0 : t.items) == null ? void 0 : d.map((i, u) => {
41
+ const o = i.font === e("editor.fontFamily.default.tooltip") ? {} : { fontFamily: i.font };
42
+ return /* @__PURE__ */ c(b, { children: [
73
43
  /* @__PURE__ */ a(
74
44
  g,
75
45
  {
76
- checked: (n == null ? void 0 : n.font) === e.font,
77
- onClick: e.action,
46
+ checked: (n == null ? void 0 : n.font) === i.font,
47
+ onClick: i.action,
78
48
  children: /* @__PURE__ */ a(
79
49
  "div",
80
50
  {
81
51
  className: "richtext-ml-1 richtext-h-full",
82
52
  style: o,
83
- children: e.font
53
+ children: i.font
84
54
  }
85
55
  )
86
56
  }
87
57
  ),
88
- e.font === i("editor.fontFamily.default.tooltip") && /* @__PURE__ */ a(D, {})
89
- ] }, `font-family-${d}`);
58
+ i.font === e("editor.fontFamily.default.tooltip") && /* @__PURE__ */ a(w, {})
59
+ ] }, `font-family-${u}`);
90
60
  }) })
91
61
  ] });
92
62
  }
93
- const j = /* @__PURE__ */ w.extend({
63
+ const v = /* @__PURE__ */ F.extend({
64
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
65
+ //@ts-expect-error
94
66
  addOptions() {
95
67
  var t;
96
68
  return {
97
69
  ...(t = this.parent) == null ? void 0 : t.call(this),
98
- fontFamilyList: F,
99
- button({ editor: i, extension: s, t: n }) {
70
+ fontFamilyList: h,
71
+ button({ editor: e, extension: f, t: n }) {
100
72
  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(
73
+ const { extensions: m = [] } = e.extensionManager ?? [], s = L(((o = f == null ? void 0 : f.options) == null ? void 0 : o.fontFamilyList) || []), d = m.find(
102
74
  (l) => l.name === "base-kit"
103
- ), e = u.map((l) => ({
75
+ ), i = s.map((l) => ({
104
76
  action: () => {
105
- i.chain().focus().setFontFamily(l.value).run();
77
+ e.chain().focus().setFontFamily(l.value).run();
106
78
  },
107
- isActive: () => i.isActive("textStyle", { fontFamily: l.value }) || !1,
108
- disabled: !i.can().setFontFamily(l.value),
79
+ isActive: () => e.isActive("textStyle", { fontFamily: l.value }) || !1,
80
+ disabled: !e.can().setFontFamily(l.value),
109
81
  title: l.name,
110
82
  font: l.value
111
83
  }));
112
- f && f.options.textStyle !== !1 && e.unshift({
113
- action: () => i.chain().focus().unsetFontFamily().run(),
84
+ d && d.options.textStyle !== !1 && i.unshift({
85
+ action: () => e.chain().focus().unsetFontFamily().run(),
114
86
  isActive: () => !1,
115
87
  disabled: !1,
116
88
  font: n("editor.fontFamily.default.tooltip"),
117
89
  title: n("editor.fontFamily.tooltip")
118
90
  });
119
- const d = e.filter((l) => l.disabled).length === e.length;
91
+ const u = i.filter((l) => l.disabled).length === i.length;
120
92
  return {
121
- component: T,
93
+ component: k,
122
94
  componentProps: {
123
95
  tooltip: n("editor.fontFamily.tooltip"),
124
- disabled: d,
125
- items: e,
126
- editor: i
96
+ disabled: u,
97
+ items: i,
98
+ editor: e
127
99
  }
128
100
  };
129
101
  }
@@ -131,6 +103,6 @@ const j = /* @__PURE__ */ w.extend({
131
103
  }
132
104
  });
133
105
  export {
134
- F as DEFAULT_FONT_FAMILY_LIST,
135
- j as FontFamily
106
+ h as DEFAULT_FONT_FAMILY_LIST,
107
+ v as FontFamily
136
108
  };
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-DF2Lp4HZ.cjs"),r=require("./index-6D1J-A-o.cjs"),a=require("./RichTextEditor-CxvwGvQG.cjs"),u=require("react/jsx-runtime"),m=require("react"),z=require("./ActionMenuButton-CYdM1xx5.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;
@@ -128,9 +128,8 @@ declare module '@tiptap/core' {
128
128
 
129
129
  declare module '@tiptap/core' {
130
130
  interface Commands<ReturnType> {
131
- drawer: {
132
- setDrawer: (options: any, replace?: any) => ReturnType;
133
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
131
+ excalidraw: {
132
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
134
133
  };
135
134
  }
136
135
  }
@@ -138,11 +137,9 @@ declare module '@tiptap/core' {
138
137
 
139
138
  declare module '@tiptap/core' {
140
139
  interface Commands<ReturnType> {
141
- emoji: {
142
- setEmoji: (emoji: {
143
- name: string;
144
- emoji: string;
145
- }) => ReturnType;
140
+ drawer: {
141
+ setDrawer: (options: any, replace?: any) => ReturnType;
142
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
146
143
  };
147
144
  }
148
145
  }
@@ -150,8 +147,8 @@ declare module '@tiptap/core' {
150
147
 
151
148
  declare module '@tiptap/core' {
152
149
  interface Commands<ReturnType> {
153
- excalidraw: {
154
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
150
+ exportPdf: {
151
+ exportToPdf: () => ReturnType;
155
152
  };
156
153
  }
157
154
  }
@@ -159,8 +156,8 @@ declare module '@tiptap/core' {
159
156
 
160
157
  declare module '@tiptap/core' {
161
158
  interface Commands<ReturnType> {
162
- exportPdf: {
163
- exportToPdf: () => ReturnType;
159
+ exportWord: {
160
+ exportToWord: () => ReturnType;
164
161
  };
165
162
  }
166
163
  }
@@ -168,8 +165,8 @@ declare module '@tiptap/core' {
168
165
 
169
166
  declare module '@tiptap/core' {
170
167
  interface Commands<ReturnType> {
171
- exportWord: {
172
- exportToWord: () => ReturnType;
168
+ painter: {
169
+ setPainter: (marks: Mark[]) => ReturnType;
173
170
  };
174
171
  }
175
172
  }
@@ -195,8 +192,14 @@ declare module '@tiptap/core' {
195
192
 
196
193
  declare module '@tiptap/core' {
197
194
  interface Commands<ReturnType> {
198
- painter: {
199
- setPainter: (marks: Mark[]) => ReturnType;
195
+ iframe: {
196
+ /**
197
+ * Add an iframe
198
+ */
199
+ setIframe: (options: {
200
+ src: string;
201
+ service: string;
202
+ }) => ReturnType;
200
203
  };
201
204
  }
202
205
  }
@@ -222,21 +225,6 @@ declare module '@tiptap/core' {
222
225
  }
223
226
 
224
227
 
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
228
  declare module '@tiptap/core' {
241
229
  interface Commands<ReturnType> {
242
230
  imageGifUpload: {
@@ -257,6 +245,15 @@ declare module '@tiptap/core' {
257
245
  }
258
246
 
259
247
 
248
+ declare module '@tiptap/core' {
249
+ interface Commands<ReturnType> {
250
+ katex: {
251
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
252
+ };
253
+ }
254
+ }
255
+
256
+
260
257
  declare module '@tiptap/core' {
261
258
  interface Commands<ReturnType> {
262
259
  indent: {
@@ -275,8 +272,9 @@ declare module '@tiptap/core' {
275
272
 
276
273
  declare module '@tiptap/core' {
277
274
  interface Commands<ReturnType> {
278
- katex: {
279
- setKatex: (arg?: IKatexAttrs) => ReturnType;
275
+ lineHeight: {
276
+ setLineHeight: (lineHeight: string) => ReturnType;
277
+ unsetLineHeight: () => ReturnType;
280
278
  };
281
279
  }
282
280
  }
@@ -284,9 +282,13 @@ declare module '@tiptap/core' {
284
282
 
285
283
  declare module '@tiptap/core' {
286
284
  interface Commands<ReturnType> {
287
- lineHeight: {
288
- setLineHeight: (lineHeight: string) => ReturnType;
289
- unsetLineHeight: () => ReturnType;
285
+ columns: {
286
+ insertColumns: (attrs?: {
287
+ cols: number;
288
+ }) => ReturnType;
289
+ addColBefore: () => ReturnType;
290
+ addColAfter: () => ReturnType;
291
+ deleteCol: () => ReturnType;
290
292
  };
291
293
  }
292
294
  }
@@ -304,13 +306,9 @@ declare module '@tiptap/core' {
304
306
 
305
307
  declare module '@tiptap/core' {
306
308
  interface Commands<ReturnType> {
307
- columns: {
308
- insertColumns: (attrs?: {
309
- cols: number;
310
- }) => ReturnType;
311
- addColBefore: () => ReturnType;
312
- addColAfter: () => ReturnType;
313
- deleteCol: () => ReturnType;
309
+ tableOfContents: {
310
+ setTableOfContents: () => ReturnType;
311
+ removeTableOfContents: () => ReturnType;
314
312
  };
315
313
  }
316
314
  }
@@ -321,22 +319,20 @@ declare module '@tiptap/core' {
321
319
  search: {
322
320
  setSearchTerm: (searchTerm: string) => ReturnType;
323
321
  setReplaceTerm: (replaceTerm: string) => ReturnType;
322
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
323
+ resetIndex: () => ReturnType;
324
+ nextSearchResult: () => ReturnType;
325
+ previousSearchResult: () => ReturnType;
324
326
  replace: () => ReturnType;
325
327
  replaceAll: () => ReturnType;
326
- goToPrevSearchResult: () => void;
327
- goToNextSearchResult: () => void;
328
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
329
328
  };
330
329
  }
331
330
  }
332
331
 
333
332
 
334
333
  declare module '@tiptap/core' {
335
- interface Commands<ReturnType> {
336
- tableOfContents: {
337
- setTableOfContents: () => ReturnType;
338
- removeTableOfContents: () => ReturnType;
339
- };
334
+ interface Storage {
335
+ searchAndReplace: SearchAndReplaceStorage;
340
336
  }
341
337
  }
342
338
 
package/lib/FontSize.d.ts CHANGED
@@ -128,9 +128,8 @@ declare module '@tiptap/core' {
128
128
 
129
129
  declare module '@tiptap/core' {
130
130
  interface Commands<ReturnType> {
131
- drawer: {
132
- setDrawer: (options: any, replace?: any) => ReturnType;
133
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
131
+ excalidraw: {
132
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
134
133
  };
135
134
  }
136
135
  }
@@ -138,11 +137,9 @@ declare module '@tiptap/core' {
138
137
 
139
138
  declare module '@tiptap/core' {
140
139
  interface Commands<ReturnType> {
141
- emoji: {
142
- setEmoji: (emoji: {
143
- name: string;
144
- emoji: string;
145
- }) => ReturnType;
140
+ drawer: {
141
+ setDrawer: (options: any, replace?: any) => ReturnType;
142
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
146
143
  };
147
144
  }
148
145
  }
@@ -150,8 +147,8 @@ declare module '@tiptap/core' {
150
147
 
151
148
  declare module '@tiptap/core' {
152
149
  interface Commands<ReturnType> {
153
- excalidraw: {
154
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
150
+ exportPdf: {
151
+ exportToPdf: () => ReturnType;
155
152
  };
156
153
  }
157
154
  }
@@ -159,8 +156,8 @@ declare module '@tiptap/core' {
159
156
 
160
157
  declare module '@tiptap/core' {
161
158
  interface Commands<ReturnType> {
162
- exportPdf: {
163
- exportToPdf: () => ReturnType;
159
+ exportWord: {
160
+ exportToWord: () => ReturnType;
164
161
  };
165
162
  }
166
163
  }
@@ -168,8 +165,8 @@ declare module '@tiptap/core' {
168
165
 
169
166
  declare module '@tiptap/core' {
170
167
  interface Commands<ReturnType> {
171
- exportWord: {
172
- exportToWord: () => ReturnType;
168
+ painter: {
169
+ setPainter: (marks: Mark[]) => ReturnType;
173
170
  };
174
171
  }
175
172
  }
@@ -195,8 +192,14 @@ declare module '@tiptap/core' {
195
192
 
196
193
  declare module '@tiptap/core' {
197
194
  interface Commands<ReturnType> {
198
- painter: {
199
- setPainter: (marks: Mark[]) => ReturnType;
195
+ iframe: {
196
+ /**
197
+ * Add an iframe
198
+ */
199
+ setIframe: (options: {
200
+ src: string;
201
+ service: string;
202
+ }) => ReturnType;
200
203
  };
201
204
  }
202
205
  }
@@ -222,21 +225,6 @@ declare module '@tiptap/core' {
222
225
  }
223
226
 
224
227
 
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
228
  declare module '@tiptap/core' {
241
229
  interface Commands<ReturnType> {
242
230
  imageGifUpload: {
@@ -257,6 +245,15 @@ declare module '@tiptap/core' {
257
245
  }
258
246
 
259
247
 
248
+ declare module '@tiptap/core' {
249
+ interface Commands<ReturnType> {
250
+ katex: {
251
+ setKatex: (arg?: IKatexAttrs) => ReturnType;
252
+ };
253
+ }
254
+ }
255
+
256
+
260
257
  declare module '@tiptap/core' {
261
258
  interface Commands<ReturnType> {
262
259
  indent: {
@@ -275,8 +272,9 @@ declare module '@tiptap/core' {
275
272
 
276
273
  declare module '@tiptap/core' {
277
274
  interface Commands<ReturnType> {
278
- katex: {
279
- setKatex: (arg?: IKatexAttrs) => ReturnType;
275
+ lineHeight: {
276
+ setLineHeight: (lineHeight: string) => ReturnType;
277
+ unsetLineHeight: () => ReturnType;
280
278
  };
281
279
  }
282
280
  }
@@ -284,9 +282,13 @@ declare module '@tiptap/core' {
284
282
 
285
283
  declare module '@tiptap/core' {
286
284
  interface Commands<ReturnType> {
287
- lineHeight: {
288
- setLineHeight: (lineHeight: string) => ReturnType;
289
- unsetLineHeight: () => ReturnType;
285
+ columns: {
286
+ insertColumns: (attrs?: {
287
+ cols: number;
288
+ }) => ReturnType;
289
+ addColBefore: () => ReturnType;
290
+ addColAfter: () => ReturnType;
291
+ deleteCol: () => ReturnType;
290
292
  };
291
293
  }
292
294
  }
@@ -304,13 +306,9 @@ declare module '@tiptap/core' {
304
306
 
305
307
  declare module '@tiptap/core' {
306
308
  interface Commands<ReturnType> {
307
- columns: {
308
- insertColumns: (attrs?: {
309
- cols: number;
310
- }) => ReturnType;
311
- addColBefore: () => ReturnType;
312
- addColAfter: () => ReturnType;
313
- deleteCol: () => ReturnType;
309
+ tableOfContents: {
310
+ setTableOfContents: () => ReturnType;
311
+ removeTableOfContents: () => ReturnType;
314
312
  };
315
313
  }
316
314
  }
@@ -321,22 +319,20 @@ declare module '@tiptap/core' {
321
319
  search: {
322
320
  setSearchTerm: (searchTerm: string) => ReturnType;
323
321
  setReplaceTerm: (replaceTerm: string) => ReturnType;
322
+ setCaseSensitive: (caseSensitive: boolean) => ReturnType;
323
+ resetIndex: () => ReturnType;
324
+ nextSearchResult: () => ReturnType;
325
+ previousSearchResult: () => ReturnType;
324
326
  replace: () => ReturnType;
325
327
  replaceAll: () => ReturnType;
326
- goToPrevSearchResult: () => void;
327
- goToNextSearchResult: () => void;
328
- setCaseSensitive: (caseSensitive: boolean) => ReturnType;
329
328
  };
330
329
  }
331
330
  }
332
331
 
333
332
 
334
333
  declare module '@tiptap/core' {
335
- interface Commands<ReturnType> {
336
- tableOfContents: {
337
- setTableOfContents: () => ReturnType;
338
- removeTableOfContents: () => ReturnType;
339
- };
334
+ interface Storage {
335
+ searchAndReplace: SearchAndReplaceStorage;
340
336
  }
341
337
  }
342
338
 
package/lib/FontSize.js CHANGED
@@ -1,9 +1,9 @@
1
- import { E as m } from "./index-DI9T3iLd.js";
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";
1
+ import { E as m } from "./index-kbO3iWqL.js";
2
+ import { u as S, g as z, h as c } from "./index-LmrOdnen.js";
3
+ import { D as v, h, j as x, k as F, m as f } from "./RichTextEditor-DGcKEUGr.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-DKRF6oa0.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,8 +42,10 @@ 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",
47
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
48
+ //@ts-expect-error
46
49
  addOptions() {
47
50
  var t;
48
51
  return {
@@ -51,7 +54,7 @@ const N = /* @__PURE__ */ m.create({
51
54
  fontSizes: [...z],
52
55
  button({ editor: e, extension: l, t: a }) {
53
56
  var r;
54
- const i = c(((r = l.options) == null ? void 0 : r.fontSizes) || f), o = c([f])[0], s = i.map((n) => ({
57
+ const i = f(((r = l.options) == null ? void 0 : r.fontSizes) || c), o = f([c])[0], s = i.map((n) => ({
55
58
  title: n.value === o.value ? a("editor.fontSize.default.tooltip") : String(n.name),
56
59
  isActive: () => {
57
60
  const { fontSize: d } = e.getAttributes("textStyle");
@@ -106,5 +109,5 @@ const N = /* @__PURE__ */ m.create({
106
109
  });
107
110
  export {
108
111
  z as DEFAULT_FONT_SIZE_LIST,
109
- N as FontSize
112
+ C as FontSize
110
113
  };
@@ -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-DF2Lp4HZ.cjs"),c=require("./RichTextEditor-CxvwGvQG.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;