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
package/lib/Katex.js CHANGED
@@ -1,29 +1,29 @@
1
1
  import { N as b, n as g, m as w } from "./index-DI9T3iLd.js";
2
2
  import { N as k, R as N } from "./dom-dataset-Di3tIRrR.js";
3
- import { jsx as n, jsxs as u } from "react/jsx-runtime";
4
- import { useState as T, useCallback as $, useEffect as v, useMemo as c } from "react";
3
+ import { jsx as n, jsxs as c } from "react/jsx-runtime";
4
+ import { useState as T, useCallback as $, useEffect as v, useMemo as l } from "react";
5
5
  import x from "katex";
6
6
  import { HelpCircle as A } from "lucide-react";
7
- import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-BQN2eLD_.js";
8
- import { T as K } from "./textarea-BglwYF6b.js";
7
+ import { O as S, P as L, m as P, A as C, n as H, L as I, B as M, Q as y } from "./RichTextEditor-KP2Rgcqe.js";
8
+ import { T as K } from "./textarea-CktfkXNe.js";
9
9
  import { u as R } from "./index-CsK90iVd.js";
10
- function V({ editor: t, ...e }) {
11
- const { t: a } = R(), o = S(t, h.name, {
10
+ function V({ editor: e, ...t }) {
11
+ const { t: a } = R(), o = S(e, h.name, {
12
12
  text: "",
13
13
  defaultShowPicker: !1
14
- }), { text: s, defaultShowPicker: r } = o, [i, l] = T(""), f = $(() => {
15
- t.chain().focus().setKatex({ text: i }).run(), l("");
16
- }, [t, i]);
14
+ }), { text: s, defaultShowPicker: r } = o, [i, u] = T(""), f = $(() => {
15
+ e.chain().focus().setKatex({ text: i }).run(), u("");
16
+ }, [e, i]);
17
17
  v(() => {
18
- r && t.chain().updateAttributes(h.name, { defaultShowPicker: !1 }).focus().run();
19
- }, [t, r]);
20
- const m = c(() => {
18
+ r && e.chain().updateAttributes(h.name, { defaultShowPicker: !1 }).focus().run();
19
+ }, [e, r]);
20
+ const m = l(() => {
21
21
  try {
22
22
  return x.renderToString(`${i}`);
23
23
  } catch {
24
24
  return i;
25
25
  }
26
- }, [i]), d = c(
26
+ }, [i]), d = l(
27
27
  () => `${i}`.trim() ? /* @__PURE__ */ n(
28
28
  "span",
29
29
  {
@@ -33,15 +33,16 @@ function V({ editor: t, ...e }) {
33
33
  ) : null,
34
34
  [i, m]
35
35
  );
36
- return /* @__PURE__ */ u(L, { modal: !0, children: [
36
+ return /* @__PURE__ */ c(L, { modal: !0, children: [
37
37
  /* @__PURE__ */ n(P, { asChild: !0, children: /* @__PURE__ */ n(
38
38
  C,
39
39
  {
40
- icon: e == null ? void 0 : e.icon,
41
- tooltip: e == null ? void 0 : e.tooltip
40
+ icon: t == null ? void 0 : t.icon,
41
+ tooltip: t == null ? void 0 : t.tooltip,
42
+ tooltipOptions: t == null ? void 0 : t.tooltipOptions
42
43
  }
43
44
  ) }),
44
- /* @__PURE__ */ u(
45
+ /* @__PURE__ */ c(
45
46
  H,
46
47
  {
47
48
  align: "start",
@@ -56,7 +57,7 @@ function V({ editor: t, ...e }) {
56
57
  autoFocus: !0,
57
58
  className: "richtext-w-full",
58
59
  defaultValue: s,
59
- onChange: (p) => l(p.target.value),
60
+ onChange: (p) => u(p.target.value),
60
61
  placeholder: "Text",
61
62
  required: !0,
62
63
  rows: 3,
@@ -64,7 +65,7 @@ function V({ editor: t, ...e }) {
64
65
  }
65
66
  ) }) }),
66
67
  d && /* @__PURE__ */ n("div", { className: "richtext-my-[10px] richtext-max-w-[286px] richtext-overflow-auto richtext-whitespace-nowrap richtext-rounded-[6px] !richtext-border richtext-p-[10px]", children: d }),
67
- /* @__PURE__ */ u("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
68
+ /* @__PURE__ */ c("div", { className: "richtext-flex richtext-items-center richtext-justify-between richtext-gap-[6px]", children: [
68
69
  /* @__PURE__ */ n(
69
70
  M,
70
71
  {
@@ -88,29 +89,29 @@ function V({ editor: t, ...e }) {
88
89
  )
89
90
  ] });
90
91
  }
91
- function B(t, e = 1) {
92
+ function B(e, t = 1) {
92
93
  let a = 0, o = 0, s = 0;
93
- if (t.startsWith("rgb")) {
94
- const r = t.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
94
+ if (e.startsWith("rgb")) {
95
+ const r = e.replace(/\s/g, "").match(/rgb\((.*)\)$/)[1].split(",");
95
96
  a = +r[0], o = +r[1], s = +r[2];
96
- } else if (t.startsWith("#")) {
97
- let r = t.replace("#", "");
97
+ } else if (e.startsWith("#")) {
98
+ let r = e.replace("#", "");
98
99
  r.length === 3 && (r = `${r[0]}${r[0]}${r[1]}${r[1]}${r[2]}${r[2]}`), a = Number.parseInt(r.substring(0, 2), 16), o = Number.parseInt(r.substring(2, 4), 16), s = Number.parseInt(r.substring(4, 6), 16);
99
100
  } else
100
- return t;
101
- return e > 1 && e <= 100 && (e = e / 100), `rgba(${a},${o},${s},${e})`;
101
+ return e;
102
+ return t > 1 && t <= 100 && (t = t / 100), `rgba(${a},${o},${s},${t})`;
102
103
  }
103
- function W({ node: t }) {
104
- const e = y(), { text: a } = t.attrs, o = c(() => {
104
+ function W({ node: e }) {
105
+ const t = y(), { text: a } = e.attrs, o = l(() => {
105
106
  const i = "rgb(254, 242, 237)";
106
- return e === "dark" ? B(i, 0.75) : i;
107
- }, [e]), s = c(() => {
107
+ return t === "dark" ? B(i, 0.75) : i;
108
+ }, [t]), s = l(() => {
108
109
  try {
109
110
  return x.renderToString(`${a}`);
110
111
  } catch {
111
112
  return a;
112
113
  }
113
- }, [a]), r = c(
114
+ }, [a]), r = l(
114
115
  () => a.trim() ? /* @__PURE__ */ n("span", { contentEditable: !1, dangerouslySetInnerHTML: { __html: s } }) : /* @__PURE__ */ n("span", { contentEditable: !1, children: "Not enter a formula" }),
115
116
  [a, s]
116
117
  );
@@ -126,8 +127,8 @@ function W({ node: t }) {
126
127
  }
127
128
  );
128
129
  }
129
- function _(t) {
130
- return (e) => e.getAttribute(t);
130
+ function _(e) {
131
+ return (t) => t.getAttribute(e);
131
132
  }
132
133
  const h = /* @__PURE__ */ b.create({
133
134
  name: "katex",
@@ -141,15 +142,15 @@ const h = /* @__PURE__ */ b.create({
141
142
  HTMLAttributes: {
142
143
  class: "katex"
143
144
  },
144
- button: ({ editor: t, t: e }) => ({
145
+ button: ({ editor: e, t }) => ({
145
146
  component: V,
146
147
  componentProps: {
147
- editor: t,
148
+ editor: e,
148
149
  action: () => !0,
149
150
  isActive: () => !1,
150
151
  disabled: !1,
151
152
  icon: "KatexIcon",
152
- tooltip: e("editor.katex.tooltip")
153
+ tooltip: t("editor.katex.tooltip")
153
154
  }
154
155
  })
155
156
  };
@@ -168,14 +169,14 @@ const h = /* @__PURE__ */ b.create({
168
169
  parseHTML() {
169
170
  return [{ tag: "span.katex" }];
170
171
  },
171
- renderHTML({ HTMLAttributes: t }) {
172
- return ["span", w(this.options && this.options.HTMLAttributes || {}, t)];
172
+ renderHTML({ HTMLAttributes: e }) {
173
+ return ["span", w(this.options && this.options.HTMLAttributes || {}, e)];
173
174
  },
174
175
  addCommands() {
175
176
  return {
176
- setKatex: (t) => ({ commands: e }) => e.insertContent({
177
+ setKatex: (e) => ({ commands: t }) => t.insertContent({
177
178
  type: this.name,
178
- attrs: t
179
+ attrs: e
179
180
  })
180
181
  };
181
182
  },
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ByRfqzMr.cjs"),g=require("./index-D_A0TBRA.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-C8Sm1E6J.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,r]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),r(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:r}=e;if(!n||!r||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(r.nodesBetween(o,d,(s,l)=>{const a=s.type;return _.includes(a.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:a}),a.name!=="list_item"&&a.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:a,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(a,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:r}=t;let{tr:o}=t;return o=o.setSelection(r),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./index-ByRfqzMr.cjs"),g=require("./index-D_A0TBRA.cjs"),c=require("react/jsx-runtime"),L=require("react"),u=require("./RichTextEditor-DWlLqTl9.cjs");function T(e){return Number.parseFloat(e.replace("%",""))/100}function x(e){const{t}=g.useLocale(),[n,a]=L.useState("default");function o(i){i==="default"?e.editor.commands.unsetLineHeight():e.editor.commands.setLineHeight(i),a(i)}const d=L.useMemo(()=>{const s=e.editor.extensionManager.extensions.find(l=>l.name==="lineHeight").options.lineHeights.map(l=>({label:T(l),value:l}));return s.unshift({label:t("editor.default"),value:"default"}),s},[e]);return c.jsxs(u.DropdownMenu,{children:[c.jsx(u.DropdownMenuTrigger,{asChild:!0,disabled:e==null?void 0:e.disabled,children:c.jsx(u.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:e==null?void 0:e.disabled,icon:"LineHeight",tooltip:e==null?void 0:e.tooltip,tooltipOptions:e==null?void 0:e.tooltipOptions,children:c.jsx(u.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),c.jsx(u.DropdownMenuContent,{className:"richtext-min-w-24",children:d==null?void 0:d.map((i,h)=>c.jsx(u.DropdownMenuCheckboxItem,{checked:i.value===n,onClick:()=>o(i.value),children:i.label},`lineHeight-${h}`))})]})}const _=["paragraph","heading","list_item","todo_item"];function E(e,t){const{selection:n,doc:a}=e;if(!n||!a||!(n instanceof m.TextSelection||n instanceof m.AllSelection))return e;const{from:o,to:d}=n,i=[],h=t&&t!==g.DEFAULT_LINE_HEIGHT?t:null;if(a.nodesBetween(o,d,(s,l)=>{const r=s.type;return _.includes(r.name)?((s.attrs.lineHeight||null)!==h&&i.push({node:s,pos:l,nodeType:r}),r.name!=="list_item"&&r.name!=="todo_item"):!0}),i.length===0)return e;for(const s of i){const{node:l,pos:r,nodeType:f}=s;let{attrs:H}=l;H={...H,lineHeight:h},e=e.setNodeMarkup(r,f,H,l.marks)}return e}function b(e){return({state:t,dispatch:n})=>{const{selection:a}=t;let{tr:o}=t;return o=o.setSelection(a),o=E(o,e),o.docChanged?(n&&n(o),!0):!1}}const I=m.Extension.create({name:"lineHeight",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:g.DEFAULT_LINE_HEIGHT_LIST,defaultHeight:g.DEFAULT_LINE_HEIGHT,button({editor:t,t:n}){return{component:x,componentProps:{editor:t,tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight||this.options.defaultHeight,renderHTML:e=>e.lineHeight===this.options.defaultHeight||!e.lineHeight?{}:{style:`line-height: ${e.lineHeight}`}}}}]},addCommands(){return{setLineHeight:e=>b(e),unsetLineHeight:()=>({commands:e})=>this.options.types.every(t=>e.resetAttributes(t,"lineHeight"))}}});exports.DEFAULT_LINE_HEIGHT_LIST=g.DEFAULT_LINE_HEIGHT_LIST;exports.LineHeight=I;
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
190
190
  }
191
191
 
192
192
 
193
+ declare module '@tiptap/core' {
194
+ interface Commands<ReturnType> {
195
+ iframe: {
196
+ /**
197
+ * Add an iframe
198
+ */
199
+ setIframe: (options: {
200
+ src: string;
201
+ service: string;
202
+ }) => ReturnType;
203
+ };
204
+ }
205
+ }
206
+
207
+
193
208
  declare module '@tiptap/core' {
194
209
  interface Commands<ReturnType> {
195
210
  imageUpload: {
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
210
225
  }
211
226
 
212
227
 
213
- declare module '@tiptap/core' {
214
- interface Commands<ReturnType> {
215
- iframe: {
216
- /**
217
- * Add an iframe
218
- */
219
- setIframe: (options: {
220
- src: string;
221
- service: string;
222
- }) => ReturnType;
223
- };
224
- }
225
- }
226
-
227
-
228
228
  declare module '@tiptap/core' {
229
229
  interface Commands<ReturnType> {
230
230
  imageGifUpload: {
@@ -190,6 +190,21 @@ declare module '@tiptap/core' {
190
190
  }
191
191
 
192
192
 
193
+ declare module '@tiptap/core' {
194
+ interface Commands<ReturnType> {
195
+ iframe: {
196
+ /**
197
+ * Add an iframe
198
+ */
199
+ setIframe: (options: {
200
+ src: string;
201
+ service: string;
202
+ }) => ReturnType;
203
+ };
204
+ }
205
+ }
206
+
207
+
193
208
  declare module '@tiptap/core' {
194
209
  interface Commands<ReturnType> {
195
210
  imageUpload: {
@@ -210,21 +225,6 @@ declare module '@tiptap/core' {
210
225
  }
211
226
 
212
227
 
213
- declare module '@tiptap/core' {
214
- interface Commands<ReturnType> {
215
- iframe: {
216
- /**
217
- * Add an iframe
218
- */
219
- setIframe: (options: {
220
- src: string;
221
- service: string;
222
- }) => ReturnType;
223
- };
224
- }
225
- }
226
-
227
-
228
228
  declare module '@tiptap/core' {
229
229
  interface Commands<ReturnType> {
230
230
  imageGifUpload: {
package/lib/LineHeight.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { T as f, A as H, E as L } from "./index-DI9T3iLd.js";
2
2
  import { u as x, k as g, m as T } from "./index-CsK90iVd.js";
3
3
  import { jsxs as b, jsx as h } from "react/jsx-runtime";
4
- import { useState as p, useMemo as _ } from "react";
5
- import { D, e as E, A as M, k as w, f as A, h as C } from "./RichTextEditor-BQN2eLD_.js";
6
- function y(e) {
4
+ import { useState as _, useMemo as D } from "react";
5
+ import { D as E, e as M, A as w, k as A, f as C, h as y } from "./RichTextEditor-KP2Rgcqe.js";
6
+ function k(e) {
7
7
  return Number.parseFloat(e.replace("%", "")) / 100;
8
8
  }
9
- function k(e) {
10
- const { t } = x(), [n, s] = p("default");
9
+ function p(e) {
10
+ const { t } = x(), [n, s] = _("default");
11
11
  function o(i) {
12
12
  i === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(i), s(i);
13
13
  }
14
- const c = _(() => {
14
+ const c = D(() => {
15
15
  const a = e.editor.extensionManager.extensions.find(
16
16
  (l) => l.name === "lineHeight"
17
17
  ).options.lineHeights.map((l) => ({
18
- label: y(l),
18
+ label: k(l),
19
19
  value: l
20
20
  }));
21
21
  return a.unshift({
@@ -23,21 +23,22 @@ function k(e) {
23
23
  value: "default"
24
24
  }), a;
25
25
  }, [e]);
26
- return /* @__PURE__ */ b(D, { children: [
26
+ return /* @__PURE__ */ b(E, { children: [
27
27
  /* @__PURE__ */ h(
28
- E,
28
+ M,
29
29
  {
30
30
  asChild: !0,
31
31
  disabled: e == null ? void 0 : e.disabled,
32
32
  children: /* @__PURE__ */ h(
33
- M,
33
+ w,
34
34
  {
35
35
  customClass: "!richtext-w-12 richtext-h-12",
36
36
  disabled: e == null ? void 0 : e.disabled,
37
37
  icon: "LineHeight",
38
38
  tooltip: e == null ? void 0 : e.tooltip,
39
+ tooltipOptions: e == null ? void 0 : e.tooltipOptions,
39
40
  children: /* @__PURE__ */ h(
40
- w,
41
+ A,
41
42
  {
42
43
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
43
44
  name: "MenuDown"
@@ -47,8 +48,8 @@ function k(e) {
47
48
  )
48
49
  }
49
50
  ),
50
- /* @__PURE__ */ h(A, { className: "richtext-min-w-24", children: c == null ? void 0 : c.map((i, u) => /* @__PURE__ */ h(
51
- C,
51
+ /* @__PURE__ */ h(C, { className: "richtext-min-w-24", children: c == null ? void 0 : c.map((i, u) => /* @__PURE__ */ h(
52
+ y,
52
53
  {
53
54
  checked: i.value === n,
54
55
  onClick: () => o(i.value),
@@ -83,7 +84,7 @@ function N(e, t) {
83
84
  }
84
85
  return e;
85
86
  }
86
- function v(e) {
87
+ function O(e) {
87
88
  return ({ state: t, dispatch: n }) => {
88
89
  const { selection: s } = t;
89
90
  let { tr: o } = t;
@@ -101,7 +102,7 @@ const z = /* @__PURE__ */ L.create({
101
102
  defaultHeight: g,
102
103
  button({ editor: t, t: n }) {
103
104
  return {
104
- component: k,
105
+ component: p,
105
106
  componentProps: {
106
107
  editor: t,
107
108
  tooltip: n("editor.lineheight.tooltip")
@@ -126,7 +127,7 @@ const z = /* @__PURE__ */ L.create({
126
127
  },
127
128
  addCommands() {
128
129
  return {
129
- setLineHeight: (e) => v(e),
130
+ setLineHeight: (e) => O(e),
130
131
  unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
131
132
  };
132
133
  }
package/lib/Link.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-C8Sm1E6J.cjs");exports.Link=e.Link;exports.default=e.Link;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("./index-ByRfqzMr.cjs");const e=require("./RichTextEditor-DWlLqTl9.cjs");exports.Link=e.Link;exports.default=e.Link;
package/lib/Link.d.cts CHANGED
@@ -188,6 +188,21 @@ declare module '@tiptap/core' {
188
188
  }
189
189
 
190
190
 
191
+ declare module '@tiptap/core' {
192
+ interface Commands<ReturnType> {
193
+ iframe: {
194
+ /**
195
+ * Add an iframe
196
+ */
197
+ setIframe: (options: {
198
+ src: string;
199
+ service: string;
200
+ }) => ReturnType;
201
+ };
202
+ }
203
+ }
204
+
205
+
191
206
  declare module '@tiptap/core' {
192
207
  interface Commands<ReturnType> {
193
208
  imageUpload: {
@@ -208,21 +223,6 @@ declare module '@tiptap/core' {
208
223
  }
209
224
 
210
225
 
211
- declare module '@tiptap/core' {
212
- interface Commands<ReturnType> {
213
- iframe: {
214
- /**
215
- * Add an iframe
216
- */
217
- setIframe: (options: {
218
- src: string;
219
- service: string;
220
- }) => ReturnType;
221
- };
222
- }
223
- }
224
-
225
-
226
226
  declare module '@tiptap/core' {
227
227
  interface Commands<ReturnType> {
228
228
  imageGifUpload: {
package/lib/Link.d.ts CHANGED
@@ -188,6 +188,21 @@ declare module '@tiptap/core' {
188
188
  }
189
189
 
190
190
 
191
+ declare module '@tiptap/core' {
192
+ interface Commands<ReturnType> {
193
+ iframe: {
194
+ /**
195
+ * Add an iframe
196
+ */
197
+ setIframe: (options: {
198
+ src: string;
199
+ service: string;
200
+ }) => ReturnType;
201
+ };
202
+ }
203
+ }
204
+
205
+
191
206
  declare module '@tiptap/core' {
192
207
  interface Commands<ReturnType> {
193
208
  imageUpload: {
@@ -208,21 +223,6 @@ declare module '@tiptap/core' {
208
223
  }
209
224
 
210
225
 
211
- declare module '@tiptap/core' {
212
- interface Commands<ReturnType> {
213
- iframe: {
214
- /**
215
- * Add an iframe
216
- */
217
- setIframe: (options: {
218
- src: string;
219
- service: string;
220
- }) => ReturnType;
221
- };
222
- }
223
- }
224
-
225
-
226
226
  declare module '@tiptap/core' {
227
227
  interface Commands<ReturnType> {
228
228
  imageGifUpload: {
package/lib/Link.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./index-DI9T3iLd.js";
2
- import { ae as r, ae as t } from "./RichTextEditor-BQN2eLD_.js";
2
+ import { ae as r, ae as t } from "./RichTextEditor-KP2Rgcqe.js";
3
3
  export {
4
4
  r as Link,
5
5
  t as default
@@ -110,6 +110,21 @@ declare module '@tiptap/core' {
110
110
  }
111
111
 
112
112
 
113
+ declare module '@tiptap/core' {
114
+ interface Commands<ReturnType> {
115
+ iframe: {
116
+ /**
117
+ * Add an iframe
118
+ */
119
+ setIframe: (options: {
120
+ src: string;
121
+ service: string;
122
+ }) => ReturnType;
123
+ };
124
+ }
125
+ }
126
+
127
+
113
128
  declare module '@tiptap/core' {
114
129
  interface Commands<ReturnType> {
115
130
  imageUpload: {
@@ -130,21 +145,6 @@ declare module '@tiptap/core' {
130
145
  }
131
146
 
132
147
 
133
- declare module '@tiptap/core' {
134
- interface Commands<ReturnType> {
135
- iframe: {
136
- /**
137
- * Add an iframe
138
- */
139
- setIframe: (options: {
140
- src: string;
141
- service: string;
142
- }) => ReturnType;
143
- };
144
- }
145
- }
146
-
147
-
148
148
  declare module '@tiptap/core' {
149
149
  interface Commands<ReturnType> {
150
150
  imageGifUpload: {
package/lib/ListItem.d.ts CHANGED
@@ -110,6 +110,21 @@ declare module '@tiptap/core' {
110
110
  }
111
111
 
112
112
 
113
+ declare module '@tiptap/core' {
114
+ interface Commands<ReturnType> {
115
+ iframe: {
116
+ /**
117
+ * Add an iframe
118
+ */
119
+ setIframe: (options: {
120
+ src: string;
121
+ service: string;
122
+ }) => ReturnType;
123
+ };
124
+ }
125
+ }
126
+
127
+
113
128
  declare module '@tiptap/core' {
114
129
  interface Commands<ReturnType> {
115
130
  imageUpload: {
@@ -130,21 +145,6 @@ declare module '@tiptap/core' {
130
145
  }
131
146
 
132
147
 
133
- declare module '@tiptap/core' {
134
- interface Commands<ReturnType> {
135
- iframe: {
136
- /**
137
- * Add an iframe
138
- */
139
- setIframe: (options: {
140
- src: string;
141
- service: string;
142
- }) => ReturnType;
143
- };
144
- }
145
- }
146
-
147
-
148
148
  declare module '@tiptap/core' {
149
149
  interface Commands<ReturnType> {
150
150
  imageGifUpload: {
package/lib/Mention.d.cts CHANGED
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
113
113
  }
114
114
 
115
115
 
116
+ declare module '@tiptap/core' {
117
+ interface Commands<ReturnType> {
118
+ iframe: {
119
+ /**
120
+ * Add an iframe
121
+ */
122
+ setIframe: (options: {
123
+ src: string;
124
+ service: string;
125
+ }) => ReturnType;
126
+ };
127
+ }
128
+ }
129
+
130
+
116
131
  declare module '@tiptap/core' {
117
132
  interface Commands<ReturnType> {
118
133
  imageUpload: {
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
133
148
  }
134
149
 
135
150
 
136
- declare module '@tiptap/core' {
137
- interface Commands<ReturnType> {
138
- iframe: {
139
- /**
140
- * Add an iframe
141
- */
142
- setIframe: (options: {
143
- src: string;
144
- service: string;
145
- }) => ReturnType;
146
- };
147
- }
148
- }
149
-
150
-
151
151
  declare module '@tiptap/core' {
152
152
  interface Commands<ReturnType> {
153
153
  imageGifUpload: {
package/lib/Mention.d.ts CHANGED
@@ -113,6 +113,21 @@ declare module '@tiptap/core' {
113
113
  }
114
114
 
115
115
 
116
+ declare module '@tiptap/core' {
117
+ interface Commands<ReturnType> {
118
+ iframe: {
119
+ /**
120
+ * Add an iframe
121
+ */
122
+ setIframe: (options: {
123
+ src: string;
124
+ service: string;
125
+ }) => ReturnType;
126
+ };
127
+ }
128
+ }
129
+
130
+
116
131
  declare module '@tiptap/core' {
117
132
  interface Commands<ReturnType> {
118
133
  imageUpload: {
@@ -133,21 +148,6 @@ declare module '@tiptap/core' {
133
148
  }
134
149
 
135
150
 
136
- declare module '@tiptap/core' {
137
- interface Commands<ReturnType> {
138
- iframe: {
139
- /**
140
- * Add an iframe
141
- */
142
- setIframe: (options: {
143
- src: string;
144
- service: string;
145
- }) => ReturnType;
146
- };
147
- }
148
- }
149
-
150
-
151
151
  declare module '@tiptap/core' {
152
152
  interface Commands<ReturnType> {
153
153
  imageGifUpload: {