reactjs-tiptap-editor 1.0.10 → 1.0.12

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 (209) hide show
  1. package/lib/{ActionMenuButton-CKTxYtl7.js → ActionMenuButton-BKqin6Kz.js} +17 -13
  2. package/lib/ActionMenuButton-CPPHERbq.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +24 -21
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +7 -5
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +11 -9
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +14 -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 +11 -9
  15. package/lib/CodeBlock.cjs +22 -22
  16. package/lib/CodeBlock.js +102 -100
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +10 -8
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +20 -18
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +7 -5
  23. package/lib/{Drawer-Cfx115up.js → Drawer-DUPsBE0H.js} +10 -9
  24. package/lib/Drawer-fplzqNI6.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 +11 -9
  29. package/lib/{Excalidraw-CO93Tsmb.js → Excalidraw-BEzpvRLx.js} +20 -19
  30. package/lib/Excalidraw-qjnQspLq.cjs +1 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +2 -2
  34. package/lib/ExportPdf.js +7 -5
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +7 -5
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +9 -8
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +13 -12
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +25 -24
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +9 -7
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +18 -15
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +7 -5
  49. package/lib/Icon-CiR8RqdQ.cjs +1 -0
  50. package/lib/Icon-ONE1AwKo.js +12 -0
  51. package/lib/{Iframe-DwhclppJ.js → Iframe-CBTnv2mk.js} +41 -39
  52. package/lib/Iframe-DsUNJ2n2.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 +25 -23
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +53 -51
  59. package/lib/ImportWord.cjs +31 -31
  60. package/lib/ImportWord.js +8 -6
  61. package/lib/{Indent-BOsymiZ7.js → Indent-B00o0P0M.js} +26 -24
  62. package/lib/Indent-CaGP0qTp.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 +12 -10
  67. package/lib/Katex-XsfpKgJU.cjs +4 -0
  68. package/lib/{Katex-BYK-b9X2.js → Katex-x370CSXZ.js} +12 -10
  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 +10 -8
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-DgrLUMsJ.js → LinkEditBlock-C_ipl3EA.js} +23 -21
  76. package/lib/{LinkEditBlock-4-iRXH7m.cjs → LinkEditBlock-xt88G5fb.cjs} +2 -2
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +3 -3
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +18 -17
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +25 -22
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +10 -8
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +43 -41
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/SlashCommandNodeView-BT5ystah.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-BpNNU7Sm.js → SlashCommandNodeView-DX6axvLs.js} +75 -66
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +7 -5
  93. package/lib/Table-DSRSwtXx.cjs +9 -0
  94. package/lib/{Table-CT9R9Sdq.js → Table-DidusYID.js} +10 -8
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +15 -13
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +20 -17
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +20 -17
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -5
  105. package/lib/Twitter-CBuVBQM1.cjs +1 -0
  106. package/lib/{Twitter-mowilxRd.js → Twitter-D58T0Zt3.js} +51 -49
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +2 -2
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +13 -11
  111. package/lib/bubble.cjs +4 -4
  112. package/lib/bubble.js +403 -407
  113. package/lib/{button-CBO-WDXK.js → button-9_8t7ca7.js} +4 -3
  114. package/lib/button-Cs9TroWr.cjs +1 -0
  115. package/lib/{checkbox-DUcLSGZD.cjs → checkbox-BQRKTXXr.cjs} +1 -1
  116. package/lib/{checkbox-D1h32VWM.js → checkbox-DnkkV6qo.js} +1 -1
  117. package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
  118. package/lib/{index-sVScpCFG.js → clsx-DmuN0U_8.js} +228 -228
  119. package/lib/{dialog-DY868Uji.cjs → dialog-BS3zm-T9.cjs} +1 -1
  120. package/lib/{dialog-DSvgtlDI.js → dialog-DhayAPvV.js} +1 -1
  121. package/lib/{dropdown-menu-BripAeGB.cjs → dropdown-menu-CxwWX0yj.cjs} +1 -1
  122. package/lib/{dropdown-menu-B88Qn2KR.js → dropdown-menu-DQqKeZcx.js} +1 -1
  123. package/lib/events.constant-Dq21NPdV.cjs +1 -0
  124. package/lib/events.constant-do95b767.js +21 -0
  125. package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
  126. package/lib/{index-0OnGZkVF.js → index-BDX1uE62.js} +78 -312
  127. package/lib/index-CBFmXCcU.cjs +1 -0
  128. package/lib/{index-DmPwbBqm.js → index-CKmT9KAQ.js} +1 -1
  129. package/lib/index-CVFzP1Dc.cjs +1 -0
  130. package/lib/index-CX4pNJlH.cjs +1 -0
  131. package/lib/index-CjhjjJsN.cjs +1 -0
  132. package/lib/index-Cs6cp0Y6.cjs +1 -0
  133. package/lib/{index-9A6-kVBM.js → index-D1jd7elj.js} +1 -1
  134. package/lib/{index-BIqaogQg.js → index-D9JOHlso.js} +449 -1216
  135. package/lib/{index-DRHrDScg.js → index-DdEmgiAA.js} +1 -1
  136. package/lib/{index-DKt5wfAc.js → index-DvvwJvau.js} +23 -23
  137. package/lib/index-EAK64CCA.js +425 -0
  138. package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
  139. package/lib/index.cjs +9 -2
  140. package/lib/index.js +142 -26
  141. package/lib/{input-BeD5GdMv.cjs → input-BJ7ihMq-.cjs} +1 -1
  142. package/lib/{input-Bx4uo4gO.js → input-YoheBL2D.js} +1 -1
  143. package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
  144. package/lib/{isNumber-DF0fU3ob.js → isNumber-DmQXlKp3.js} +1 -1
  145. package/lib/label-C8PLcjFI.js +19 -0
  146. package/lib/label-Y7_hvqf2.cjs +1 -0
  147. package/lib/locale-bundle.cjs +1 -1
  148. package/lib/locale-bundle.js +6 -7
  149. package/lib/locales/index.d.ts +3 -4316
  150. package/lib/{popover-Csk538NC.cjs → popover-BiSrlM4j.cjs} +1 -1
  151. package/lib/{popover-BVX8otO9.js → popover-CWmTzHSy.js} +1 -1
  152. package/lib/react-BEoMZB61.cjs +1 -0
  153. package/lib/react-c9FSfB30.js +27 -0
  154. package/lib/separator-C-DKMYmg.js +329 -0
  155. package/lib/separator-CJ_adziN.cjs +1 -0
  156. package/lib/store/EditorEditableReactive.d.ts +1 -0
  157. package/lib/store/ThemeColorReactive.d.ts +1 -0
  158. package/lib/store/commandList.d.ts +1 -1
  159. package/lib/store/store.d.ts +6 -7
  160. package/lib/store-BKMaw1AW.cjs +1 -0
  161. package/lib/store-DG7cMfET.js +10 -0
  162. package/lib/style.css +1 -1
  163. package/lib/{tabs-DOasUMDU.cjs → tabs-DpHSMyF_.cjs} +1 -1
  164. package/lib/{tabs-BKpr0QQB.js → tabs-DxlKKM-N.js} +1 -1
  165. package/lib/{textarea-Ba9OOzba.js → textarea-D7m-apUh.js} +1 -1
  166. package/lib/{textarea-D9egO4qC.cjs → textarea-DU9RMi6u.cjs} +1 -1
  167. package/lib/theme/theme.d.ts +5 -0
  168. package/lib/theme.cjs +1 -1
  169. package/lib/theme.js +37 -8
  170. package/lib/{throttle-DsowOft0.js → throttle-BRtichEP.js} +1 -1
  171. package/lib/throttle-gTTvqDTW.cjs +1 -0
  172. package/lib/toggle-BYvLnjCL.cjs +1 -0
  173. package/lib/toggle-Bxwwb_Kp.js +99 -0
  174. package/lib/tooltip-BTy5CRrN.js +24 -0
  175. package/lib/tooltip-COvf4_R-.cjs +1 -0
  176. package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-CUukgu-Q.js} +2 -2
  177. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  178. package/lib/{useButtonProps-C_bqxmHi.js → useButtonProps-CfYtuEnd.js} +48 -36
  179. package/lib/useButtonProps-CydzndG1.cjs +1 -0
  180. package/lib/utils/customEvents/events.constant.d.ts +0 -5
  181. package/package.json +3 -3
  182. package/lib/ActionMenuButton-BPdRqzDX.cjs +0 -1
  183. package/lib/Drawer-hHj4Opkg.cjs +0 -1
  184. package/lib/Excalidraw-8pWJ17Ye.cjs +0 -1
  185. package/lib/Icon-D7GJZzoa.js +0 -10
  186. package/lib/Icon-gtc3g-VK.cjs +0 -1
  187. package/lib/Iframe-BmXO2c65.cjs +0 -1
  188. package/lib/Indent-DPkMWfcv.cjs +0 -1
  189. package/lib/Katex-B1XbT8-X.cjs +0 -4
  190. package/lib/SlashCommandNodeView-CQvMTXys.cjs +0 -1
  191. package/lib/Table-LnWGm2m8.cjs +0 -9
  192. package/lib/Twitter-Bo4JkBTL.cjs +0 -1
  193. package/lib/button-wt49IYwP.cjs +0 -1
  194. package/lib/events.constant-DQYeJpu5.cjs +0 -1
  195. package/lib/events.constant-wrlJ_7JZ.js +0 -26
  196. package/lib/index-BZ6DfR2r.cjs +0 -1
  197. package/lib/index-BvIJKpX1.cjs +0 -8
  198. package/lib/index-Cv9Z6dyV.cjs +0 -1
  199. package/lib/index-FSRjMsxW.cjs +0 -1
  200. package/lib/label--161UPH6.cjs +0 -1
  201. package/lib/label-uKG7RzFU.js +0 -18
  202. package/lib/separator-DLRVddHS.cjs +0 -1
  203. package/lib/separator-DtrEdjAF.js +0 -241
  204. package/lib/store/ProviderUniqueId.d.ts +0 -6
  205. package/lib/store-B8IkVz1J.cjs +0 -1
  206. package/lib/store-CsIFDUKR.js +0 -10
  207. package/lib/throttle-BM3Bmbf_.cjs +0 -1
  208. package/lib/updatePosition-M2IyqkI1.cjs +0 -1
  209. package/lib/useButtonProps-DEtmDVPr.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";const a=require("react/jsx-runtime"),s=require("react"),p=require("@radix-ui/react-popover"),x=require("./index-BvIJKpX1.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const h=n(s),o=n(p),l=o.Root,m=o.Trigger,c=h.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},d)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:d,sideOffset:e,className:x.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2 !richtext-border-border",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=l;exports.PopoverContent=c;exports.PopoverTrigger=m;
1
+ "use strict";const a=require("react/jsx-runtime"),s=require("react"),p=require("@radix-ui/react-popover"),x=require("./index-CX4pNJlH.cjs");function n(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const h=n(s),o=n(p),l=o.Root,m=o.Trigger,c=h.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},d)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:d,sideOffset:e,className:x.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2 !richtext-border-border",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=l;exports.PopoverContent=c;exports.PopoverTrigger=m;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import * as c from "react";
3
3
  import * as t from "@radix-ui/react-popover";
4
- import { c as s } from "./index-BIqaogQg.js";
4
+ import { c as s } from "./index-D9JOHlso.js";
5
5
  const x = t.Root, p = t.Trigger, n = c.forwardRef(({ className: o, align: r = "center", sideOffset: i = 4, ...a }, d) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ e(
6
6
  t.Content,
7
7
  {
@@ -0,0 +1 @@
1
+ "use strict";const u=require("react"),S=t=>{let e;const n=new Set,o=(s,r)=>{const c=typeof s=="function"?s(e):s;if(!Object.is(c,e)){const g=e;e=r??(typeof c!="object"||c===null)?c:Object.assign({},e,c),n.forEach(f=>f(e,g))}},i=()=>e,a={setState:o,getState:i,getInitialState:()=>l,subscribe:s=>(n.add(s),()=>n.delete(s))},l=e=t(o,i,a);return a},d=(t=>t?S(t):S),I=t=>t;function j(t,e=I){const n=u.useSyncExternalStore(t.subscribe,u.useCallback(()=>e(t.getState()),[t,e]),u.useCallback(()=>e(t.getInitialState()),[t,e]));return u.useDebugValue(n),n}const b=t=>{const e=d(t),n=o=>j(e,o);return Object.assign(n,e),n},y=(t=>t?b(t):b);exports.create=y;
@@ -0,0 +1,27 @@
1
+ import u from "react";
2
+ const l = (t) => {
3
+ let e;
4
+ const n = /* @__PURE__ */ new Set(), o = (s, r) => {
5
+ const c = typeof s == "function" ? s(e) : s;
6
+ if (!Object.is(c, e)) {
7
+ const f = e;
8
+ e = r ?? (typeof c != "object" || c === null) ? c : Object.assign({}, e, c), n.forEach((g) => g(e, f));
9
+ }
10
+ }, a = () => e, i = { setState: o, getState: a, getInitialState: () => b, subscribe: (s) => (n.add(s), () => n.delete(s)) }, b = e = t(o, a, i);
11
+ return i;
12
+ }, d = ((t) => t ? l(t) : l), I = (t) => t;
13
+ function j(t, e = I) {
14
+ const n = u.useSyncExternalStore(
15
+ t.subscribe,
16
+ u.useCallback(() => e(t.getState()), [t, e]),
17
+ u.useCallback(() => e(t.getInitialState()), [t, e])
18
+ );
19
+ return u.useDebugValue(n), n;
20
+ }
21
+ const S = (t) => {
22
+ const e = d(t), n = (o) => j(e, o);
23
+ return Object.assign(n, e), n;
24
+ }, O = ((t) => t ? S(t) : S);
25
+ export {
26
+ O as c
27
+ };
@@ -0,0 +1,329 @@
1
+ import { jsx as t, jsxs as p } from "react/jsx-runtime";
2
+ import * as k from "react";
3
+ import { useCallback as m, useState as w, useEffect as L, useRef as $, useMemo as M } from "react";
4
+ import { Plus as I } from "lucide-react";
5
+ import { HexColorPicker as B } from "react-colorful";
6
+ import { c as F } from "./index-D9JOHlso.js";
7
+ import "./theme.js";
8
+ import { B as _ } from "./button-9_8t7ca7.js";
9
+ import { I as T } from "./input-YoheBL2D.js";
10
+ import { P as N, a as z, b as E } from "./popover-CWmTzHSy.js";
11
+ import * as y from "@radix-ui/react-separator";
12
+ import { u as R, C as j } from "./index-BDX1uE62.js";
13
+ function D() {
14
+ return /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { fill: "currentColor", d: "M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z" }) });
15
+ }
16
+ const C = typeof window > "u";
17
+ function S(e, r, c = window) {
18
+ const d = $(void 0);
19
+ L(() => {
20
+ d.current = r;
21
+ }, [r]), L(() => {
22
+ if (!(c && c.addEventListener)) return;
23
+ const u = (a) => {
24
+ d.current && d.current(a);
25
+ };
26
+ return c.addEventListener(e, u), () => {
27
+ c.removeEventListener(e, u);
28
+ };
29
+ }, [e, c]);
30
+ }
31
+ function J(e, r, c = {}) {
32
+ const { initializeWithValue: d = !0 } = c, n = m(
33
+ (o) => c.serializer ? c.serializer(o) : JSON.stringify(o),
34
+ [c]
35
+ ), u = m(
36
+ (o) => {
37
+ if (c.deserializer)
38
+ return c.deserializer(o);
39
+ if (o === "undefined")
40
+ return;
41
+ const s = r instanceof Function ? r() : r;
42
+ let i;
43
+ try {
44
+ i = JSON.parse(o);
45
+ } catch (l) {
46
+ return console.error("Error parsing JSON:", l), s;
47
+ }
48
+ return i;
49
+ },
50
+ [c, r]
51
+ ), a = m(() => {
52
+ const o = r instanceof Function ? r() : r;
53
+ if (C)
54
+ return o;
55
+ try {
56
+ const s = window.localStorage.getItem(e);
57
+ return s ? u(s) : o;
58
+ } catch (s) {
59
+ return console.warn(
60
+ `Error reading localStorage key “${e}”:`,
61
+ s
62
+ ), o;
63
+ }
64
+ }, [r, e, u]), [h, f] = w(() => d ? a() : r instanceof Function ? r() : r), b = m((o) => {
65
+ C && console.warn(
66
+ `Tried setting localStorage key “${e}” even though environment is not a client`
67
+ );
68
+ try {
69
+ const s = o instanceof Function ? o(a()) : o;
70
+ window.localStorage.setItem(e, n(s)), f(s), window.dispatchEvent(
71
+ new StorageEvent("local-storage", {
72
+ key: e
73
+ })
74
+ );
75
+ } catch (s) {
76
+ console.warn(
77
+ `Error setting localStorage key “${e}”:`,
78
+ s
79
+ );
80
+ }
81
+ }, [e, n, a]), g = m(() => {
82
+ C && console.warn(
83
+ `Tried removing localStorage key “${e}” even though environment is not a client`
84
+ );
85
+ const o = r instanceof Function ? r() : r;
86
+ window.localStorage.removeItem(e), f(o), window.dispatchEvent(
87
+ new StorageEvent("local-storage", {
88
+ key: e
89
+ })
90
+ );
91
+ }, [e, r]);
92
+ L(() => {
93
+ f(a());
94
+ }, [e]);
95
+ const v = m(
96
+ (o) => {
97
+ o.key && o.key !== e || f(a());
98
+ },
99
+ [e, a]
100
+ );
101
+ return S("storage", v), S("local-storage", v), [h, b, g];
102
+ }
103
+ function V(e) {
104
+ const { t: r } = R(), {
105
+ disabled: c = !1,
106
+ value: d,
107
+ onChange: n,
108
+ colors: u = j,
109
+ highlight: a
110
+ } = e, [h, f] = w(!1), b = M(() => {
111
+ const i = u, l = [];
112
+ for (let x = 0; x < i.length; x += 10)
113
+ l.push(i.slice(x, x + 10));
114
+ return l;
115
+ }, [u]), [g, v] = J(a ? "richtext-recent-highlight" : "richtext-recent-colors", []), o = (i) => {
116
+ const l = [...g], x = l.indexOf(i);
117
+ x !== -1 && l.splice(x, 1), l.unshift(i), l.length > 10 && l.pop(), v(l);
118
+ };
119
+ function s(i) {
120
+ if (i === void 0) {
121
+ n == null || n(i), f(!1);
122
+ return;
123
+ }
124
+ /^#([\da-f]{3}){1,2}$/i.test(i) && (n == null || n(i), o(i), f(!1));
125
+ }
126
+ return /* @__PURE__ */ p(
127
+ N,
128
+ {
129
+ modal: !0,
130
+ onOpenChange: f,
131
+ open: h,
132
+ children: [
133
+ /* @__PURE__ */ t(
134
+ z,
135
+ {
136
+ asChild: !0,
137
+ className: "!richtext-p-0",
138
+ disabled: c,
139
+ children: e == null ? void 0 : e.children
140
+ }
141
+ ),
142
+ /* @__PURE__ */ t(
143
+ E,
144
+ {
145
+ align: "start",
146
+ className: "richtext-size-full !richtext-p-2",
147
+ hideWhenDetached: !0,
148
+ side: "bottom",
149
+ children: /* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-col", children: [
150
+ /* @__PURE__ */ p(
151
+ "div",
152
+ {
153
+ className: "rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",
154
+ onClick: () => {
155
+ s(void 0);
156
+ },
157
+ children: [
158
+ /* @__PURE__ */ t(D, {}),
159
+ /* @__PURE__ */ t("span", { className: "richtext-ml-1 richtext-text-sm", children: r(a ? "editor.nofill" : "editor.default") })
160
+ ]
161
+ }
162
+ ),
163
+ b.map((i, l) => /* @__PURE__ */ t(
164
+ "span",
165
+ {
166
+ className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",
167
+ children: i.map((x, P) => /* @__PURE__ */ t(
168
+ "span",
169
+ {
170
+ className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-solid !richtext-border-transparent richtext-p-0.5 hover:!richtext-border-border",
171
+ onClick: () => s(x),
172
+ children: /* @__PURE__ */ t(
173
+ "span",
174
+ {
175
+ className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",
176
+ style: {
177
+ backgroundColor: x
178
+ },
179
+ children: x === d ? /* @__PURE__ */ t(
180
+ "svg",
181
+ {
182
+ className: "richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",
183
+ viewBox: "0 0 18 18",
184
+ style: {
185
+ fill: "rgb(255, 255, 255)"
186
+ },
187
+ children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
188
+ }
189
+ ) : /* @__PURE__ */ t(
190
+ "svg",
191
+ {
192
+ viewBox: "0 0 18 18",
193
+ style: {
194
+ fill: "rgb(255, 255, 255)",
195
+ display: "none"
196
+ },
197
+ children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
198
+ }
199
+ )
200
+ }
201
+ )
202
+ },
203
+ `sub-color-${P}`
204
+ ))
205
+ },
206
+ `color-row-${l}`
207
+ )),
208
+ /* @__PURE__ */ p("div", { children: [
209
+ /* @__PURE__ */ t("div", { className: "richtext-my-1 richtext-text-sm", children: r("editor.recent") }),
210
+ /* @__PURE__ */ t("span", { className: "richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-flex-wrap richtext-p-0 last:richtext-pb-2", children: g == null ? void 0 : g.map((i, l) => /* @__PURE__ */ t(
211
+ "span",
212
+ {
213
+ className: "richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",
214
+ onClick: () => s(i),
215
+ children: /* @__PURE__ */ t(
216
+ "span",
217
+ {
218
+ className: "richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",
219
+ style: {
220
+ backgroundColor: i
221
+ },
222
+ children: /* @__PURE__ */ t(
223
+ "svg",
224
+ {
225
+ viewBox: "0 0 18 18",
226
+ style: {
227
+ fill: "rgb(255, 255, 255)",
228
+ display: "none"
229
+ },
230
+ children: /* @__PURE__ */ t("path", { d: "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" })
231
+ }
232
+ )
233
+ }
234
+ )
235
+ },
236
+ `sub-color-recent-${l}`
237
+ )) })
238
+ ] }),
239
+ /* @__PURE__ */ t(Z, { setColor: s })
240
+ ] })
241
+ }
242
+ )
243
+ ]
244
+ }
245
+ );
246
+ }
247
+ function Z({ setColor: e }) {
248
+ const { t: r } = R(), [c, d] = w(!1), [n, u] = w("#000000"), a = m(
249
+ (h) => {
250
+ u(h);
251
+ },
252
+ []
253
+ );
254
+ return /* @__PURE__ */ p(
255
+ N,
256
+ {
257
+ onOpenChange: d,
258
+ open: c,
259
+ children: [
260
+ /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ p(
261
+ "div",
262
+ {
263
+ className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",
264
+ children: [
265
+ r("editor.color.more"),
266
+ "..."
267
+ ]
268
+ }
269
+ ) }),
270
+ /* @__PURE__ */ p(E, { children: [
271
+ /* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
272
+ /* @__PURE__ */ t(
273
+ B,
274
+ {
275
+ color: n,
276
+ onChange: (h) => {
277
+ a(h);
278
+ }
279
+ }
280
+ ),
281
+ /* @__PURE__ */ t(
282
+ T,
283
+ {
284
+ className: "richtext-mt-[8px] richtext-w-full",
285
+ type: "text",
286
+ value: n.replace("#", ""),
287
+ onChange: (h) => {
288
+ h.preventDefault(), h.stopPropagation(), a(`#${h.target.value}`);
289
+ }
290
+ }
291
+ )
292
+ ] }),
293
+ /* @__PURE__ */ t(O, { className: "richtext-my-[10px]" }),
294
+ /* @__PURE__ */ t(
295
+ _,
296
+ {
297
+ className: "richtext-w-full",
298
+ onClick: (h) => {
299
+ h.preventDefault(), h.stopPropagation(), e(n), d(!1);
300
+ },
301
+ children: /* @__PURE__ */ t(I, { size: 16 })
302
+ }
303
+ )
304
+ ] })
305
+ ]
306
+ }
307
+ );
308
+ }
309
+ const O = k.forwardRef(
310
+ ({ className: e, orientation: r = "horizontal", decorative: c = !0, ...d }, n) => /* @__PURE__ */ t(
311
+ y.Root,
312
+ {
313
+ ref: n,
314
+ decorative: c,
315
+ orientation: r,
316
+ className: F(
317
+ "richtext-shrink-0 richtext-bg-border",
318
+ r === "horizontal" ? "richtext-h-[1px] richtext-w-full" : "richtext-h-full richtext-w-[1px]",
319
+ e
320
+ ),
321
+ ...d
322
+ }
323
+ )
324
+ );
325
+ O.displayName = y.Root.displayName;
326
+ export {
327
+ V as C,
328
+ O as S
329
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("react/jsx-runtime"),n=require("react"),k=require("lucide-react"),E=require("react-colorful"),P=require("./index-CX4pNJlH.cjs");require("./theme.cjs");const O=require("./button-Cs9TroWr.cjs"),y=require("./input-BJ7ihMq-.cjs"),v=require("./popover-BiSrlM4j.cjs"),R=require("@radix-ui/react-separator"),j=require("./index-CVFzP1Dc.cjs");function L(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const c in t)if(c!=="default"){const h=Object.getOwnPropertyDescriptor(t,c);Object.defineProperty(r,c,h.get?h:{enumerable:!0,get:()=>t[c]})}}return r.default=t,Object.freeze(r)}const q=L(n),N=L(R);function _(){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"currentColor",d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5L5.27 5.27L4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6c1.52 0 2.9-.57 3.96-1.5l2.63 2.63l1.27-1.27z"})})}const w=typeof window>"u";function S(t,r,c=window){const h=n.useRef(void 0);n.useEffect(()=>{h.current=r},[r]),n.useEffect(()=>{if(!(c&&c.addEventListener))return;const f=x=>{h.current&&h.current(x)};return c.addEventListener(t,f),()=>{c.removeEventListener(t,f)}},[t,c])}function $(t,r,c={}){const{initializeWithValue:h=!0}=c,i=n.useCallback(o=>c.serializer?c.serializer(o):JSON.stringify(o),[c]),f=n.useCallback(o=>{if(c.deserializer)return c.deserializer(o);if(o==="undefined")return;const l=r instanceof Function?r():r;let s;try{s=JSON.parse(o)}catch(a){return console.error("Error parsing JSON:",a),l}return s},[c,r]),x=n.useCallback(()=>{const o=r instanceof Function?r():r;if(w)return o;try{const l=window.localStorage.getItem(t);return l?f(l):o}catch(l){return console.warn(`Error reading localStorage key “${t}”:`,l),o}},[r,t,f]),[d,p]=n.useState(()=>h?x():r instanceof Function?r():r),b=n.useCallback(o=>{w&&console.warn(`Tried setting localStorage key “${t}” even though environment is not a client`);try{const l=o instanceof Function?o(x()):o;window.localStorage.setItem(t,i(l)),p(l),window.dispatchEvent(new StorageEvent("local-storage",{key:t}))}catch(l){console.warn(`Error setting localStorage key “${t}”:`,l)}},[t,i,x]),g=n.useCallback(()=>{w&&console.warn(`Tried removing localStorage key “${t}” even though environment is not a client`);const o=r instanceof Function?r():r;window.localStorage.removeItem(t),p(o),window.dispatchEvent(new StorageEvent("local-storage",{key:t}))},[t,r]);n.useEffect(()=>{p(x())},[t]);const m=n.useCallback(o=>{o.key&&o.key!==t||p(x())},[t,x]);return S("storage",m),S("local-storage",m),[d,b,g]}function M(t){const{t:r}=j.useLocale(),{disabled:c=!1,value:h,onChange:i,colors:f=j.COLORS_LIST,highlight:x}=t,[d,p]=n.useState(!1),b=n.useMemo(()=>{const s=f,a=[];for(let u=0;u<s.length;u+=10)a.push(s.slice(u,u+10));return a},[f]),[g,m]=$(x?"richtext-recent-highlight":"richtext-recent-colors",[]),o=s=>{const a=[...g],u=a.indexOf(s);u!==-1&&a.splice(u,1),a.unshift(s),a.length>10&&a.pop(),m(a)};function l(s){if(s===void 0){i==null||i(s),p(!1);return}/^#([\da-f]{3}){1,2}$/i.test(s)&&(i==null||i(s),o(s),p(!1))}return e.jsxs(v.Popover,{modal:!0,onOpenChange:p,open:d,children:[e.jsx(v.PopoverTrigger,{asChild:!0,className:"!richtext-p-0",disabled:c,children:t==null?void 0:t.children}),e.jsx(v.PopoverContent,{align:"start",className:"richtext-size-full !richtext-p-2",hideWhenDetached:!0,side:"bottom",children:e.jsxs("div",{className:"richtext-flex richtext-flex-col",children:[e.jsxs("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{l(void 0)},children:[e.jsx(_,{}),e.jsx("span",{className:"richtext-ml-1 richtext-text-sm",children:r(x?"editor.nofill":"editor.default")})]}),b.map((s,a)=>e.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:s.map((u,z)=>e.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-solid !richtext-border-transparent richtext-p-0.5 hover:!richtext-border-border",onClick:()=>l(u),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",style:{backgroundColor:u},children:u===h?e.jsx("svg",{className:"richtext-absolute -richtext-top-px richtext-left-px richtext-block richtext-size-3",viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${z}`))},`color-row-${a}`)),e.jsxs("div",{children:[e.jsx("div",{className:"richtext-my-1 richtext-text-sm",children:r("editor.recent")}),e.jsx("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-flex-wrap richtext-p-0 last:richtext-pb-2",children:g==null?void 0:g.map((s,a)=>e.jsx("span",{className:"richtext-inline-block richtext-size-6 richtext-flex-[0_0_auto] richtext-cursor-pointer richtext-rounded-sm !richtext-border richtext-border-transparent richtext-p-0.5 hover:richtext-border-border hover:richtext-shadow-sm",onClick:()=>l(s),children:e.jsx("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:s},children:e.jsx("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:e.jsx("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${a}`))})]}),e.jsx(T,{setColor:l})]})})]})}function T({setColor:t}){const{t:r}=j.useLocale(),[c,h]=n.useState(!1),[i,f]=n.useState("#000000"),x=n.useCallback(d=>{f(d)},[]);return e.jsxs(v.Popover,{onOpenChange:h,open:c,children:[e.jsx(v.PopoverTrigger,{asChild:!0,children:e.jsxs("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",children:[r("editor.color.more"),"..."]})}),e.jsxs(v.PopoverContent,{children:[e.jsxs("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[e.jsx(E.HexColorPicker,{color:i,onChange:d=>{x(d)}}),e.jsx(y.Input,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:i.replace("#",""),onChange:d=>{d.preventDefault(),d.stopPropagation(),x(`#${d.target.value}`)}})]}),e.jsx(C,{className:"richtext-my-[10px]"}),e.jsx(O.Button,{className:"richtext-w-full",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(i),h(!1)},children:e.jsx(k.Plus,{size:16})})]})]})}const C=q.forwardRef(({className:t,orientation:r="horizontal",decorative:c=!0,...h},i)=>e.jsx(N.Root,{ref:i,decorative:c,orientation:r,className:P.cn("richtext-shrink-0 richtext-bg-border",r==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...h}));C.displayName=N.Root.displayName;exports.ColorPicker=M;exports.Separator=C;
@@ -0,0 +1 @@
1
+ export declare function EditorEditableReactive({ editor }: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ThemeColorReactive(): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { CommandList } from '../extensions/SlashCommand/types';
2
- export declare function useSignalCommandList(): readonly [CommandList[], (val: CommandList[] | ((oldVal: CommandList[]) => CommandList[])) => void];
2
+ export declare function useSignalCommandList(): readonly [CommandList[], (newCommandList: CommandList[]) => void];
@@ -12,12 +12,11 @@ declare const ProviderUploadVideo: ({ children }: {
12
12
  }) => SelectorOutput) => [SelectorOutput, (value: Partial<{
13
13
  value: boolean;
14
14
  }>) => void];
15
- declare const ProviderEditableEditor: ({ children }: {
16
- children: React.ReactNode;
17
- }) => import("react/jsx-runtime").JSX.Element, useStoreEditableEditor: <SelectorOutput>(selector: (store: {
18
- value: boolean;
19
- }) => SelectorOutput) => [SelectorOutput, (value: Partial<{
15
+ declare const useStoreEditableEditor: import('zustand').UseBoundStore<import('zustand').StoreApi<{
20
16
  value: boolean;
21
- }>) => void];
17
+ setEditable: (newValue: {
18
+ value: boolean;
19
+ }) => void;
20
+ }>>;
22
21
  declare function useEditableEditor(): boolean;
23
- export { ProviderUploadImage, useStoreUploadImage, ProviderUploadVideo, useStoreUploadVideo, ProviderEditableEditor, useStoreEditableEditor, useEditableEditor, };
22
+ export { ProviderUploadImage, useStoreUploadImage, ProviderUploadVideo, useStoreUploadVideo, useStoreEditableEditor, useEditableEditor, };
@@ -0,0 +1 @@
1
+ "use strict";require("./index-CX4pNJlH.cjs");const e=require("./events.constant-Dq21NPdV.cjs"),a={setOpen:(t,n)=>{e.dispatchEvent(e.EVENTS.UPLOAD_IMAGE(t),n)}};exports.actionDialogImage=a;
@@ -0,0 +1,10 @@
1
+ import "./index-D9JOHlso.js";
2
+ import { d as o, E as s } from "./events.constant-do95b767.js";
3
+ const p = {
4
+ setOpen: (a, t) => {
5
+ o(s.UPLOAD_IMAGE(a), t);
6
+ }
7
+ };
8
+ export {
9
+ p as a
10
+ };