reactjs-tiptap-editor 1.0.6 → 1.0.8

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 (176) hide show
  1. package/lib/{ActionMenuButton-htJNI0Fa.js → ActionMenuButton-Cc0vy5hy.js} +10 -13
  2. package/lib/ActionMenuButton-t7e5GCJp.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +23 -25
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +5 -6
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +5 -6
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +11 -12
  11. package/lib/Clear.cjs +1 -1
  12. package/lib/Clear.js +3 -3
  13. package/lib/Code.cjs +1 -1
  14. package/lib/Code.js +9 -10
  15. package/lib/CodeBlock.cjs +39 -39
  16. package/lib/CodeBlock.js +837 -946
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +8 -9
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +18 -19
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +5 -6
  23. package/lib/{Drawer-1211urKj.js → Drawer-C6WTtcd0.js} +16 -17
  24. package/lib/Drawer-DRdsK4f_.cjs +1 -0
  25. package/lib/Drawer.cjs +1 -1
  26. package/lib/Drawer.js +3 -3
  27. package/lib/Emoji.cjs +1 -1
  28. package/lib/Emoji.js +15 -16
  29. package/lib/{Excalidraw-Du3hBR8t.js → Excalidraw-DjO5sCC_.js} +31 -32
  30. package/lib/Excalidraw-gJ99kWdS.cjs +1 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +17 -18
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +5 -6
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +5 -5
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +5 -5
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +15 -15
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +7 -8
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +8 -10
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +5 -6
  49. package/lib/Icon-DHNSWrSX.cjs +1 -0
  50. package/lib/{Icon-C-qYUAS1.js → Icon-prdLEHMN.js} +3 -4
  51. package/lib/{Iframe-DTYTLQE6.js → Iframe-CERKUXQh.js} +13 -14
  52. package/lib/Iframe-CvymVtpM.cjs +1 -0
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +2 -2
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +48 -49
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +22 -23
  59. package/lib/ImportWord.cjs +2 -2
  60. package/lib/ImportWord.js +10 -11
  61. package/lib/{Indent-jOPn3eUM.js → Indent-BfEOOT5B.js} +24 -25
  62. package/lib/Indent-CE6kk62r.cjs +1 -0
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +10 -11
  67. package/lib/{Katex-CERSrcTP.js → Katex-5KNTSK8T.js} +21 -22
  68. package/lib/Katex-CJ2Fmvut.cjs +4 -0
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +2 -2
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +14 -15
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-B5SdhOfa.js → LinkEditBlock-CFkyS2Ze.js} +55 -56
  76. package/lib/{LinkEditBlock-DaxljgJC.cjs → LinkEditBlock-D6z0Yohc.cjs} +2 -2
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +138 -132
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +20 -20
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +22 -24
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +5 -6
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +18 -19
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +13 -13
  89. package/lib/Strike.cjs +1 -1
  90. package/lib/Strike.js +5 -6
  91. package/lib/{Table-39OkCQbu.js → Table-CWbY_hqo.js} +7 -8
  92. package/lib/Table-D9pRzwFU.cjs +9 -0
  93. package/lib/Table.cjs +1 -1
  94. package/lib/Table.js +1 -1
  95. package/lib/TaskList.cjs +1 -1
  96. package/lib/TaskList.js +13 -14
  97. package/lib/TextAlign.cjs +1 -1
  98. package/lib/TextAlign.js +17 -19
  99. package/lib/TextDirection.cjs +1 -1
  100. package/lib/TextDirection.js +17 -19
  101. package/lib/TextUnderline.cjs +1 -1
  102. package/lib/TextUnderline.js +5 -6
  103. package/lib/{Twitter-D7PhLycr.js → Twitter-BV7HA-MO.js} +566 -525
  104. package/lib/Twitter-D7NK3MZe.cjs +1 -0
  105. package/lib/Twitter.cjs +1 -1
  106. package/lib/Twitter.js +2 -2
  107. package/lib/Video.cjs +1 -1
  108. package/lib/Video.js +24 -25
  109. package/lib/bubble.cjs +4 -4
  110. package/lib/bubble.js +433 -423
  111. package/lib/{button-Crm67hfl.js → button-0963_Pa8.js} +3 -4
  112. package/lib/button-Bxfjx9_Y.cjs +1 -0
  113. package/lib/{checkbox-DViVmgJ6.js → checkbox-D4p6-UMt.js} +1 -1
  114. package/lib/{checkbox-NQC2MdGT.cjs → checkbox-Q6FcMQW5.cjs} +1 -1
  115. package/lib/{dialog-Ce9Cjfft.js → dialog-B-9_Z5j2.js} +1 -1
  116. package/lib/{dialog-DaHBd2zw.cjs → dialog-D-oYxagG.cjs} +1 -1
  117. package/lib/{dropdown-menu-CQykJhBs.js → dropdown-menu-par18QL5.js} +1 -1
  118. package/lib/{dropdown-menu-CSCDQtq0.cjs → dropdown-menu-r8XibZQU.cjs} +1 -1
  119. package/lib/extensions/Mention/Mention.d.ts +3 -1
  120. package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
  121. package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
  122. package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
  123. package/lib/index-BFXkgG1P.cjs +7 -0
  124. package/lib/{index-prphFVsp.js → index-BQ6ZdLsu.js} +1 -1
  125. package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
  126. package/lib/{index-D-FhWysc.js → index-BimeTI7q.js} +1 -1
  127. package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
  128. package/lib/{index-nFjllrEl.js → index-CbIQPoF6.js} +19 -18
  129. package/lib/{index-BeUrdBxf.js → index-EKFybgpP.js} +1 -1
  130. package/lib/{index-DuZCJJSp.js → index-pgx8gyoC.js} +1118 -504
  131. package/lib/index.cjs +2 -2
  132. package/lib/index.js +8 -9
  133. package/lib/{input-tU3H__39.cjs → input-CZUkD6wF.cjs} +1 -1
  134. package/lib/{input-DfqFAyKo.js → input-cclJoUeC.js} +1 -1
  135. package/lib/{isNumber-CTm1pIvN.js → isNumber-8HKEgTkA.js} +1 -1
  136. package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
  137. package/lib/label-CFaBdRGz.cjs +1 -0
  138. package/lib/label-aveW7pdK.js +18 -0
  139. package/lib/{popover-CZWSQZ0q.cjs → popover-BWYZO_fD.cjs} +1 -1
  140. package/lib/{popover-CoepUobG.js → popover-D5YZPv2r.js} +1 -1
  141. package/lib/{separator-DCQD8P6s.cjs → separator-B978cwAm.cjs} +1 -1
  142. package/lib/{separator-6SnwzytZ.js → separator-BHjFVmZr.js} +18 -18
  143. package/lib/{store-726Zjszt.cjs → store-BsBiawfz.cjs} +1 -1
  144. package/lib/{store-ibARMQ3h.js → store-BsMMRKFd.js} +1 -1
  145. package/lib/style.css +1 -1
  146. package/lib/{tabs-DrkJL_C2.js → tabs-Bj8EvAkY.js} +1 -1
  147. package/lib/{tabs-B_ArrG09.cjs → tabs-CUMyiV80.cjs} +1 -1
  148. package/lib/{textarea-CmZVZKOo.cjs → textarea-BKb7LDw1.cjs} +1 -1
  149. package/lib/{textarea-CIs52G8B.js → textarea-CClyW-74.js} +1 -1
  150. package/lib/{throttle-CGM5M2yG.js → throttle-BIkZV3Y_.js} +1 -1
  151. package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
  152. package/lib/{updatePosition-DpMKxYdN.js → updatePosition-GLTrgcib.js} +1 -1
  153. package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
  154. package/lib/useButtonProps-B0riSJs9.cjs +1 -0
  155. package/lib/{useButtonProps-D0SrPzuG.js → useButtonProps-StwAz7Ha.js} +35 -47
  156. package/package.json +58 -54
  157. package/lib/ActionMenuButton-DYT5chmX.cjs +0 -1
  158. package/lib/Drawer-DUFUd5BW.cjs +0 -1
  159. package/lib/Excalidraw-CajgZDjU.cjs +0 -1
  160. package/lib/Icon-BjR_or8V.cjs +0 -1
  161. package/lib/Iframe-CM6mRQmv.cjs +0 -1
  162. package/lib/Indent-BmhiEb0S.cjs +0 -1
  163. package/lib/Katex-CUd3LxLh.cjs +0 -4
  164. package/lib/Table-3VstSlg4.cjs +0 -9
  165. package/lib/Twitter-DuHPeVW1.cjs +0 -1
  166. package/lib/button-xNppt_aK.cjs +0 -1
  167. package/lib/index-BQ17A_37.js +0 -393
  168. package/lib/index-CNzHZDls.cjs +0 -7
  169. package/lib/index-DmOTQudI.cjs +0 -1
  170. package/lib/label-DC33TZy_.js +0 -19
  171. package/lib/label-DkDE77kc.cjs +0 -1
  172. package/lib/toggle-DVCNvcqp.cjs +0 -1
  173. package/lib/toggle-xchtz-Kf.js +0 -92
  174. package/lib/tooltip-BTFcHrd9.js +0 -24
  175. package/lib/tooltip-DFjcKu9a.cjs +0 -1
  176. package/lib/useButtonProps-bei1vI37.cjs +0 -1
package/lib/TextAlign.js CHANGED
@@ -1,12 +1,10 @@
1
- import { E as C } from "./index-nFjllrEl.js";
1
+ import { E as C } from "./index-CbIQPoF6.js";
2
2
  import { jsx as o, Fragment as K, jsxs as A } from "react/jsx-runtime";
3
3
  import M, { useMemo as v } from "react";
4
- import { A as S, T as j } from "./toggle-xchtz-Kf.js";
5
- import "./index-DuZCJJSp.js";
6
- import { u as P, b as w, h as N } from "./useButtonProps-D0SrPzuG.js";
7
- import { P as z, a as L, b as O } from "./popover-CoepUobG.js";
8
- import { I as b } from "./Icon-C-qYUAS1.js";
9
- import { T as R, a as _, b as $ } from "./tooltip-BTFcHrd9.js";
4
+ import { A as S, T as j, a as P, f as w, b as N, h as z } from "./index-pgx8gyoC.js";
5
+ import { P as L, a as O, b as R } from "./popover-D5YZPv2r.js";
6
+ import { u as _, b as $ } from "./useButtonProps-StwAz7Ha.js";
7
+ import { I as b } from "./Icon-prdLEHMN.js";
10
8
  var E = C.create({
11
9
  name: "textAlign",
12
10
  addOptions() {
@@ -49,22 +47,22 @@ var E = C.create({
49
47
  };
50
48
  }
51
49
  }), J = E;
52
- function W() {
53
- const [e, t] = M.useState(!1), n = P(B.name), {
50
+ function U() {
51
+ const [e, t] = M.useState(!1), n = _(B.name), {
54
52
  icon: p = void 0,
55
53
  tooltip: x = void 0,
56
54
  items: r = [],
57
55
  isActive: m = void 0
58
- } = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } = w(m), h = v(() => (a == null ? void 0 : a.title) || "", [a]), g = v(() => r == null ? void 0 : r.some((i) => i.title === h), [r, h]);
56
+ } = (n == null ? void 0 : n.componentProps) ?? {}, { disabled: l, dataState: a } = $(m), h = v(() => (a == null ? void 0 : a.title) || "", [a]), g = v(() => r == null ? void 0 : r.some((i) => i.title === h), [r, h]);
59
57
  return n ? /* @__PURE__ */ A(
60
- z,
58
+ L,
61
59
  {
62
60
  modal: !0,
63
61
  onOpenChange: t,
64
62
  open: e,
65
63
  children: [
66
64
  /* @__PURE__ */ o(
67
- L,
65
+ O,
68
66
  {
69
67
  asChild: !0,
70
68
  className: "hover:richtext-bg-accent data-[state=on]:richtext-bg-accent",
@@ -89,16 +87,16 @@ function W() {
89
87
  }
90
88
  ),
91
89
  /* @__PURE__ */ o(
92
- O,
90
+ R,
93
91
  {
94
92
  align: "start",
95
93
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
96
94
  side: "bottom",
97
95
  children: r == null ? void 0 : r.map((i, d) => {
98
96
  var s, c;
99
- return /* @__PURE__ */ A(R, { children: [
100
- /* @__PURE__ */ o(_, { asChild: !0, children: /* @__PURE__ */ o(
101
- j,
97
+ return /* @__PURE__ */ A(j, { children: [
98
+ /* @__PURE__ */ o(P, { asChild: !0, children: /* @__PURE__ */ o(
99
+ w,
102
100
  {
103
101
  className: "richtext-size-7 richtext-p-1",
104
102
  "data-state": h === i.title ? "on" : "off",
@@ -109,9 +107,9 @@ function W() {
109
107
  children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(b, { name: i.icon })
110
108
  }
111
109
  ) }),
112
- /* @__PURE__ */ A($, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
110
+ /* @__PURE__ */ A(N, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
113
111
  /* @__PURE__ */ o("span", { children: i.title }),
114
- !!((s = i.shortcutKeys) != null && s.length) && /* @__PURE__ */ o("span", { children: (c = i.shortcutKeys) == null ? void 0 : c.map((u) => N(u)).join(" ") })
112
+ !!((s = i.shortcutKeys) != null && s.length) && /* @__PURE__ */ o("span", { children: (c = i.shortcutKeys) == null ? void 0 : c.map((u) => z(u)).join(" ") })
115
113
  ] })
116
114
  ] }, `text-align-${d}`);
117
115
  })
@@ -172,6 +170,6 @@ const B = /* @__PURE__ */ J.extend({
172
170
  }
173
171
  });
174
172
  export {
175
- W as RichTextAlign,
173
+ U as RichTextAlign,
176
174
  B as TextAlign
177
175
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-DLqogznp.cjs"),e=require("react/jsx-runtime"),j=require("react"),m=require("./toggle-DVCNvcqp.cjs");require("./index-CNzHZDls.cjs");const d=require("./useButtonProps-bei1vI37.cjs"),T=require("./popover-CZWSQZ0q.cjs"),D=require("./Icon-BjR_or8V.cjs"),g=require("./tooltip-DFjcKu9a.cjs");function b(){const i=d.useButtonProps(v.name),[c,x]=j.useState(!1),{icon:u=void 0,tooltip:h=void 0,items:s=[],isActive:p=void 0}=(i==null?void 0:i.componentProps)??{},{editorDisabled:l,dataState:o}=d.useActive(p),n=j.useMemo(()=>(o==null?void 0:o.dir)||"unset",[o]);return i?e.jsxs(T.Popover,{open:c,onOpenChange:x,modal:!0,children:[e.jsx(T.PopoverTrigger,{asChild:!0,disabled:l,children:e.jsx(m.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:l,icon:u,tooltip:h,children:e.jsx(D.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),e.jsx(T.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",hideWhenDetached:!0,children:s==null?void 0:s.map((t,r)=>{var a,f;return e.jsxs(g.Tooltip,{children:[e.jsx(g.TooltipTrigger,{"data-state":n===t.value?"on":"off",asChild:!0,children:e.jsx(m.Toggle,{className:"richtext-size-7 richtext-p-1",onClick:()=>{t==null||t.action(),x(!1)},size:"sm",children:(t==null?void 0:t.icon)&&e.jsx(D.IconComponent,{name:t.icon})})}),e.jsxs(g.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[e.jsx("span",{children:t.title}),!!((a=t.shortcutKeys)!=null&&a.length)&&e.jsx("span",{children:(f=t.shortcutKeys)==null?void 0:f.map(q=>d.getShortcutKey(q)).join(" ")})]})]},`text-direction-${r}`)})})]}):e.jsx(e.Fragment,{})}const v=C.Extension.create({name:"richTextTextDirection",addOptions(){var i;return{...(i=this.parent)==null?void 0:i.call(this),directions:["auto","ltr","rtl","unset"],defaultDirection:"auto",button({editor:c,extension:x,t:u}){var l;const h=((l=x.options)==null?void 0:l.directions)||[],s={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft",unset:"X"},p=h.map(o=>({title:u(`editor.textDirection.${o}.tooltip`),value:o,icon:s[o],action:()=>{var n,t,r,a;if(o==="unset"){(t=(n=c.commands)==null?void 0:n.unsetTextDirection)==null||t.call(n);return}(a=(r=c.commands)==null?void 0:r.setTextDirection)==null||a.call(r,o)},disabled:!1}));return{componentProps:{icon:"TextDirection",tooltip:u("editor.textDirection.tooltip"),items:p,isActive:()=>c.getAttributes("paragraph")}}}}}});exports.RichTextTextDirection=b;exports.TextDirection=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("./index-BBNITgNi.cjs"),e=require("react/jsx-runtime"),f=require("react"),c=require("./index-BFXkgG1P.cjs"),T=require("./popover-BWYZO_fD.cjs"),j=require("./useButtonProps-B0riSJs9.cjs"),m=require("./Icon-DHNSWrSX.cjs");function b(){const n=j.useButtonProps(D.name),[s,u]=f.useState(!1),{icon:h=void 0,tooltip:d=void 0,items:l=[],isActive:p=void 0}=(n==null?void 0:n.componentProps)??{},{editorDisabled:a,dataState:o}=j.useActive(p),i=f.useMemo(()=>(o==null?void 0:o.dir)||"unset",[o]);return n?e.jsxs(T.Popover,{open:s,onOpenChange:u,modal:!0,children:[e.jsx(T.PopoverTrigger,{asChild:!0,disabled:a,children:e.jsx(c.ActionButton,{customClass:"!richtext-w-12 richtext-h-12",disabled:a,icon:h,tooltip:d,children:e.jsx(m.IconComponent,{className:"richtext-ml-1 richtext-size-3 richtext-text-zinc-500",name:"MenuDown"})})}),e.jsx(T.PopoverContent,{align:"start",className:"richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",side:"bottom",hideWhenDetached:!0,children:l==null?void 0:l.map((t,r)=>{var x,g;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{"data-state":i===t.value?"on":"off",asChild:!0,children:e.jsx(c.Toggle,{className:"richtext-size-7 richtext-p-1",onClick:()=>{t==null||t.action(),u(!1)},size:"sm",children:(t==null?void 0:t.icon)&&e.jsx(m.IconComponent,{name:t.icon})})}),e.jsxs(c.TooltipContent,{className:"richtext-flex richtext-flex-col richtext-items-center",children:[e.jsx("span",{children:t.title}),!!((x=t.shortcutKeys)!=null&&x.length)&&e.jsx("span",{children:(g=t.shortcutKeys)==null?void 0:g.map(v=>c.getShortcutKey(v)).join(" ")})]})]},`text-direction-${r}`)})})]}):e.jsx(e.Fragment,{})}const D=C.Extension.create({name:"richTextTextDirection",addOptions(){var n;return{...(n=this.parent)==null?void 0:n.call(this),directions:["auto","ltr","rtl","unset"],defaultDirection:"auto",button({editor:s,extension:u,t:h}){var a;const d=((a=u.options)==null?void 0:a.directions)||[],l={auto:"TextDirection",ltr:"LeftToRight",rtl:"RightToLeft",unset:"X"},p=d.map(o=>({title:h(`editor.textDirection.${o}.tooltip`),value:o,icon:l[o],action:()=>{var i,t,r,x;if(o==="unset"){(t=(i=s.commands)==null?void 0:i.unsetTextDirection)==null||t.call(i);return}(x=(r=s.commands)==null?void 0:r.setTextDirection)==null||x.call(r,o)},disabled:!1}));return{componentProps:{icon:"TextDirection",tooltip:h("editor.textDirection.tooltip"),items:p,isActive:()=>s.getAttributes("paragraph")}}}}}});exports.RichTextTextDirection=b;exports.TextDirection=D;
@@ -1,28 +1,26 @@
1
- import { E as g } from "./index-nFjllrEl.js";
1
+ import { E as g } from "./index-CbIQPoF6.js";
2
2
  import { jsx as o, Fragment as D, jsxs as x } from "react/jsx-runtime";
3
3
  import v, { useMemo as b } from "react";
4
- import { A as C, T as A } from "./toggle-xchtz-Kf.js";
5
- import "./index-DuZCJJSp.js";
6
- import { u as P, b as w, h as z } from "./useButtonProps-D0SrPzuG.js";
7
- import { P as N, a as R, b as j } from "./popover-CoepUobG.js";
8
- import { I as f } from "./Icon-C-qYUAS1.js";
9
- import { T as y, a as K, b as M } from "./tooltip-BTFcHrd9.js";
10
- function X() {
11
- const i = P(O.name), [c, h] = v.useState(!1), {
4
+ import { A as C, T as A, a as P, f as w, b as z, h as N } from "./index-pgx8gyoC.js";
5
+ import { P as R, a as j, b as y } from "./popover-D5YZPv2r.js";
6
+ import { u as K, b as M } from "./useButtonProps-StwAz7Ha.js";
7
+ import { I as f } from "./Icon-prdLEHMN.js";
8
+ function S() {
9
+ const i = K(O.name), [c, h] = v.useState(!1), {
12
10
  icon: p = void 0,
13
11
  tooltip: u = void 0,
14
12
  items: s = [],
15
13
  isActive: d = void 0
16
- } = (i == null ? void 0 : i.componentProps) ?? {}, { editorDisabled: a, dataState: e } = w(d), r = b(() => (e == null ? void 0 : e.dir) || "unset", [e]);
14
+ } = (i == null ? void 0 : i.componentProps) ?? {}, { editorDisabled: a, dataState: e } = M(d), r = b(() => (e == null ? void 0 : e.dir) || "unset", [e]);
17
15
  return i ? /* @__PURE__ */ x(
18
- N,
16
+ R,
19
17
  {
20
18
  open: c,
21
19
  onOpenChange: h,
22
20
  modal: !0,
23
21
  children: [
24
22
  /* @__PURE__ */ o(
25
- R,
23
+ j,
26
24
  {
27
25
  asChild: !0,
28
26
  disabled: a,
@@ -45,7 +43,7 @@ function X() {
45
43
  }
46
44
  ),
47
45
  /* @__PURE__ */ o(
48
- j,
46
+ y,
49
47
  {
50
48
  align: "start",
51
49
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
@@ -53,14 +51,14 @@ function X() {
53
51
  hideWhenDetached: !0,
54
52
  children: s == null ? void 0 : s.map((t, n) => {
55
53
  var l, m;
56
- return /* @__PURE__ */ x(y, { children: [
54
+ return /* @__PURE__ */ x(A, { children: [
57
55
  /* @__PURE__ */ o(
58
- K,
56
+ P,
59
57
  {
60
58
  "data-state": r === t.value ? "on" : "off",
61
59
  asChild: !0,
62
60
  children: /* @__PURE__ */ o(
63
- A,
61
+ w,
64
62
  {
65
63
  className: "richtext-size-7 richtext-p-1",
66
64
  onClick: () => {
@@ -72,9 +70,9 @@ function X() {
72
70
  )
73
71
  }
74
72
  ),
75
- /* @__PURE__ */ x(M, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
73
+ /* @__PURE__ */ x(z, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
76
74
  /* @__PURE__ */ o("span", { children: t.title }),
77
- !!((l = t.shortcutKeys) != null && l.length) && /* @__PURE__ */ o("span", { children: (m = t.shortcutKeys) == null ? void 0 : m.map((T) => z(T)).join(" ") })
75
+ !!((l = t.shortcutKeys) != null && l.length) && /* @__PURE__ */ o("span", { children: (m = t.shortcutKeys) == null ? void 0 : m.map((T) => N(T)).join(" ") })
78
76
  ] })
79
77
  ] }, `text-direction-${n}`);
80
78
  })
@@ -130,6 +128,6 @@ const O = /* @__PURE__ */ g.create({
130
128
  }
131
129
  });
132
130
  export {
133
- X as RichTextTextDirection,
131
+ S as RichTextTextDirection,
134
132
  O as TextDirection
135
133
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-DLqogznp.cjs"),s=require("react/jsx-runtime"),h=require("./toggle-DVCNvcqp.cjs");require("react");require("./index-CNzHZDls.cjs");const a=require("./useButtonProps-bei1vI37.cjs");var k=u.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",u.mergeAttributes(this.options.HTMLAttributes,e),0]},parseMarkdown(e,n){return n.applyMark(this.name||"underline",n.parseInline(e.tokens||[]))},renderMarkdown(e,n){return`++${n.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,n,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),v=k;function x(){const e=a.useButtonProps(l.name),{icon:n=void 0,tooltip:t=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:i=void 0,isActive:c=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:m,disabled:d,update:p}=a.useToggleActive(c),g=()=>{d||i&&(i(),p())};return e?s.jsx(h.ActionButton,{action:g,dataState:m,disabled:d,icon:n,shortcutKeys:o,tooltip:t,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:n,t,extension:o}){return{componentProps:{action:()=>n.commands.toggleUnderline(),isActive:()=>n.isActive("underline")||!1,disabled:!1,icon:"Underline",shortcutKeys:o.options.shortcutKeys??["mod","U"],tooltip:t("editor.underline.tooltip")}}}}}});exports.RichTextUnderline=x;exports.TextUnderline=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index-BBNITgNi.cjs"),s=require("react/jsx-runtime"),h=require("./index-BFXkgG1P.cjs");require("react");const a=require("./useButtonProps-B0riSJs9.cjs");var x=u.Mark.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",u.mergeAttributes(this.options.HTMLAttributes,e),0]},parseMarkdown(e,n){return n.applyMark(this.name||"underline",n.parseInline(e.tokens||[]))},renderMarkdown(e,n){return`++${n.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,n,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),k=x;function v(){const e=a.useButtonProps(l.name),{icon:n=void 0,tooltip:t=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:i=void 0,isActive:c=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:m,disabled:d,update:p}=a.useToggleActive(c),g=()=>{d||i&&(i(),p())};return e?s.jsx(h.ActionButton,{action:g,dataState:m,disabled:d,icon:n,shortcutKeys:o,tooltip:t,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=k.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:n,t,extension:o}){return{componentProps:{action:()=>n.commands.toggleUnderline(),isActive:()=>n.isActive("underline")||!1,disabled:!1,icon:"Underline",shortcutKeys:o.options.shortcutKeys??["mod","U"],tooltip:t("editor.underline.tooltip")}}}}}});exports.RichTextUnderline=v;exports.TextUnderline=l;
@@ -1,9 +1,8 @@
1
- import { M as m, m as p } from "./index-nFjllrEl.js";
1
+ import { M as m, m as p } from "./index-CbIQPoF6.js";
2
2
  import { jsx as d, Fragment as g } from "react/jsx-runtime";
3
- import { A as f } from "./toggle-xchtz-Kf.js";
3
+ import { A as f } from "./index-pgx8gyoC.js";
4
4
  import "react";
5
- import "./index-DuZCJJSp.js";
6
- import { u as h, a as k } from "./useButtonProps-D0SrPzuG.js";
5
+ import { u as h, a as k } from "./useButtonProps-StwAz7Ha.js";
7
6
  var M = m.create({
8
7
  name: "underline",
9
8
  addOptions() {
@@ -65,7 +64,7 @@ var M = m.create({
65
64
  };
66
65
  }
67
66
  }), v = M;
68
- function H() {
67
+ function w() {
69
68
  const e = h(U.name), {
70
69
  icon: t = void 0,
71
70
  tooltip: n = void 0,
@@ -112,6 +111,6 @@ const U = /* @__PURE__ */ v.extend({
112
111
  }
113
112
  });
114
113
  export {
115
- H as RichTextUnderline,
114
+ w as RichTextUnderline,
116
115
  U as TextUnderline
117
116
  };