@remarkablejames/editor 0.0.6 → 0.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 (134) hide show
  1. package/README.md +1 -1
  2. package/lib/{ActionMenuButton-NfiUDE60.cjs → ActionMenuButton-DI9_8wC0.cjs} +1 -1
  3. package/lib/{ActionMenuButton-CpmEfz31.js → ActionMenuButton-DL05l66z.js} +1 -1
  4. package/lib/Attachment.cjs +1 -1
  5. package/lib/Attachment.js +2 -2
  6. package/lib/Blockquote.cjs +1 -1
  7. package/lib/Blockquote.js +1 -1
  8. package/lib/Bold.cjs +1 -1
  9. package/lib/Bold.js +1 -1
  10. package/lib/BulletList.cjs +1 -1
  11. package/lib/BulletList.js +1 -1
  12. package/lib/Callout.cjs +1 -1
  13. package/lib/Callout.js +16 -15
  14. package/lib/Clear.cjs +1 -1
  15. package/lib/Clear.js +1 -1
  16. package/lib/Code.cjs +1 -1
  17. package/lib/Code.js +1 -1
  18. package/lib/CodeBlock.cjs +1 -1
  19. package/lib/CodeBlock.js +32 -31
  20. package/lib/CodeView.cjs +1 -1
  21. package/lib/CodeView.js +1 -1
  22. package/lib/Color.cjs +1 -1
  23. package/lib/Color.js +2 -2
  24. package/lib/Column.cjs +1 -1
  25. package/lib/Column.js +1 -1
  26. package/lib/{Drawer-DlgdaO_B.cjs → Drawer-DEzhWKwY.cjs} +1 -1
  27. package/lib/{Drawer-CayP4Ww4.js → Drawer-DhM1qM6R.js} +15 -15
  28. package/lib/Drawer.cjs +1 -1
  29. package/lib/Drawer.js +2 -2
  30. package/lib/Emoji.cjs +1 -1
  31. package/lib/Emoji.js +8 -8
  32. package/lib/Excalidraw.cjs +1 -1
  33. package/lib/Excalidraw.js +36 -36
  34. package/lib/ExportPdf.cjs +1 -1
  35. package/lib/ExportPdf.js +1 -1
  36. package/lib/ExportWord.cjs +1 -1
  37. package/lib/ExportWord.js +1 -1
  38. package/lib/FontFamily.cjs +1 -1
  39. package/lib/FontFamily.js +3 -3
  40. package/lib/FontSize.cjs +1 -1
  41. package/lib/FontSize.js +3 -3
  42. package/lib/Heading.cjs +1 -1
  43. package/lib/Heading.js +8 -8
  44. package/lib/Highlight.cjs +1 -1
  45. package/lib/Highlight.js +2 -2
  46. package/lib/History.cjs +1 -1
  47. package/lib/History.js +1 -1
  48. package/lib/HorizontalRule.cjs +1 -1
  49. package/lib/HorizontalRule.js +1 -1
  50. package/lib/{Iframe-CANdxSpV.cjs → Iframe-DbYJ82AI.cjs} +1 -1
  51. package/lib/{Iframe-C6Sb97KS.js → Iframe-yDX_zHls.js} +1 -1
  52. package/lib/Iframe.cjs +1 -1
  53. package/lib/Iframe.js +2 -2
  54. package/lib/Image.cjs +1 -1
  55. package/lib/Image.js +3 -3
  56. package/lib/ImageGif.cjs +1 -1
  57. package/lib/ImageGif.js +28 -28
  58. package/lib/ImportWord.cjs +1 -1
  59. package/lib/ImportWord.js +12 -12
  60. package/lib/{Indent-CcFe8py3.js → Indent-CA46zsbb.js} +1 -1
  61. package/lib/{Indent-DuB2U6Cs.cjs → Indent-CYaCq_Mv.cjs} +1 -1
  62. package/lib/Indent.cjs +1 -1
  63. package/lib/Indent.js +1 -1
  64. package/lib/Italic.cjs +1 -1
  65. package/lib/Italic.js +1 -1
  66. package/lib/Katex-Dh-kTBjf.cjs +4 -0
  67. package/lib/{Katex-Bp6AnIUF.js → Katex-g3ZS3zUf.js} +4 -3
  68. package/lib/Katex.cjs +1 -1
  69. package/lib/Katex.js +1 -1
  70. package/lib/LineHeight.cjs +1 -1
  71. package/lib/LineHeight.js +2 -2
  72. package/lib/Link.cjs +1 -1
  73. package/lib/Link.js +1 -1
  74. package/lib/{LinkEditBlock-C2zX0WVK.cjs → LinkEditBlock-ClqpI1FH.cjs} +1 -1
  75. package/lib/{LinkEditBlock-BiHumIJR.js → LinkEditBlock-qE5KHPQs.js} +7 -7
  76. package/lib/Mermaid-BmUChJSB.cjs +2 -0
  77. package/lib/{Mermaid-Dlx0XTJj.js → Mermaid-CefRECZY.js} +24 -23
  78. package/lib/Mermaid.cjs +1 -1
  79. package/lib/Mermaid.js +1 -1
  80. package/lib/MoreMark.cjs +1 -1
  81. package/lib/MoreMark.js +2 -2
  82. package/lib/OrderedList.cjs +1 -1
  83. package/lib/OrderedList.js +1 -1
  84. package/lib/PaywallSeparator.cjs +1 -1
  85. package/lib/PaywallSeparator.js +1 -1
  86. package/lib/SearchAndReplace.cjs +1 -1
  87. package/lib/SearchAndReplace.js +7 -7
  88. package/lib/SlashCommand.cjs +1 -1
  89. package/lib/SlashCommand.js +2 -2
  90. package/lib/{SlashCommandNodeView-DzmsYaNc.js → SlashCommandNodeView-BsIrWlhS.js} +5 -5
  91. package/lib/{SlashCommandNodeView-BfWNWGRr.cjs → SlashCommandNodeView-DpXsfGmo.cjs} +1 -1
  92. package/lib/Strike.cjs +1 -1
  93. package/lib/Strike.js +1 -1
  94. package/lib/{Table-BfM6ywrZ.cjs → Table-B-0TePQ3.cjs} +1 -1
  95. package/lib/{Table-IH34r4jd.js → Table-CG0nisk4.js} +2 -2
  96. package/lib/Table.cjs +1 -1
  97. package/lib/Table.js +1 -1
  98. package/lib/TaskList.cjs +1 -1
  99. package/lib/TaskList.js +1 -1
  100. package/lib/TextAlign.cjs +1 -1
  101. package/lib/TextAlign.js +2 -2
  102. package/lib/TextDirection.cjs +1 -1
  103. package/lib/TextDirection.js +2 -2
  104. package/lib/TextUnderline.cjs +1 -1
  105. package/lib/TextUnderline.js +1 -1
  106. package/lib/{Twitter-FVQKPaq6.js → Twitter-DlGSWdh7.js} +7 -7
  107. package/lib/{Twitter-axcoCgD7.cjs → Twitter-DvMmVNMF.cjs} +1 -1
  108. package/lib/Twitter.cjs +1 -1
  109. package/lib/Twitter.js +1 -1
  110. package/lib/Video.cjs +1 -1
  111. package/lib/Video.js +3 -3
  112. package/lib/bubble.cjs +3 -3
  113. package/lib/bubble.js +83 -81
  114. package/lib/components/RichTextProvider.d.ts +1 -1
  115. package/lib/{dropdown-menu-Ce2TorkG.js → dropdown-menu-D-mNjyKn.js} +1 -1
  116. package/lib/{dropdown-menu-DirUyRAI.cjs → dropdown-menu-gOopBX-L.cjs} +1 -1
  117. package/lib/index-CUnpdrCy.cjs +28 -0
  118. package/lib/{index-CnKgiZFQ.js → index-CelRl0mr.js} +1062 -1191
  119. package/lib/index.cjs +3 -3
  120. package/lib/index.js +61 -59
  121. package/lib/{popover-BdLwAlrM.cjs → popover-DEMkixfo.cjs} +1 -1
  122. package/lib/{popover-BzJyaFvy.js → popover-SMtif0E1.js} +1 -1
  123. package/lib/select-BqlizSg4.cjs +1 -0
  124. package/lib/select-Dc3RkAhQ.js +120 -0
  125. package/lib/{separator-D-fyzbfx.js → separator-DWLSmuSh.js} +14 -14
  126. package/lib/{separator-CoQaQmFK.cjs → separator-DuP4NoiV.cjs} +1 -1
  127. package/lib/textarea-C89l2GRG.cjs +1 -0
  128. package/lib/textarea-DvciwVxS.js +20 -0
  129. package/lib/theme.cjs +1 -1
  130. package/lib/theme.js +18 -18
  131. package/package.json +21 -32
  132. package/lib/Katex-DFU1unCm.cjs +0 -4
  133. package/lib/Mermaid-B8lQSOGn.cjs +0 -2
  134. package/lib/index-BynXHtjJ.cjs +0 -28
package/lib/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),q=require("./clsx-CXbNJWDD.cjs"),l=require("react"),a=require("./index-BynXHtjJ.cjs"),_=require("@radix-ui/react-toast"),$=require("lucide-react"),f=require("./theme.cjs");function j(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const x=j(l),s=j(_),V=s.Provider,w=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Viewport,{ref:e,className:a.cn("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",t),...r}));w.displayName=s.Viewport.displayName;const z=a.cva("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),N=x.forwardRef(({className:t,variant:r,...e},n)=>i.jsx(s.Root,{ref:n,className:a.cn(z({variant:r}),t),...e}));N.displayName=s.Root.displayName;const H=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Action,{ref:e,className:a.cn("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",t),...r}));H.displayName=s.Action.displayName;const T=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Close,{ref:e,className:a.cn("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",t),"toast-close":"",...r,children:i.jsx($.X,{className:"richtext-h-4 richtext-w-4"})}));T.displayName=s.Close.displayName;const E=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Title,{ref:e,className:a.cn("richtext-text-sm richtext-font-semibold",t),...r}));E.displayName=s.Title.displayName;const R=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Description,{ref:e,className:a.cn("richtext-text-sm richtext-opacity-90",t),...r}));R.displayName=s.Description.displayName;function L(){const{toasts:t}=a.useToast();return i.jsxs(V,{children:[t.map(({id:r,title:e,description:n,action:o,...u})=>i.jsxs(N,{...u,children:[i.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[e&&i.jsx(E,{children:e}),n&&i.jsx(R,{children:n})]}),o,i.jsx(T,{})]},r)),i.jsx(w,{})]})}const F=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),q=require("./clsx-CXbNJWDD.cjs"),h=require("react"),a=require("./index-CUnpdrCy.cjs"),_=require("@radix-ui/react-toast"),$=require("lucide-react"),f=require("./theme.cjs");function j(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const x=j(h),s=j(_),V=s.Provider,w=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Viewport,{ref:e,className:a.cn("richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",t),...r}));w.displayName=s.Viewport.displayName;const z=a.cva("richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",{variants:{variant:{default:"richtext-border richtext-bg-background richtext-text-foreground",destructive:"richtext-destructive richtext-group richtext-border-destructive richtext-bg-destructive richtext-text-destructive-foreground"}},defaultVariants:{variant:"default"}}),T=x.forwardRef(({className:t,variant:r,...e},n)=>i.jsx(s.Root,{ref:n,className:a.cn(z({variant:r}),t),...e}));T.displayName=s.Root.displayName;const H=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Action,{ref:e,className:a.cn("richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",t),...r}));H.displayName=s.Action.displayName;const N=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Close,{ref:e,className:a.cn("richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",t),"toast-close":"",...r,children:i.jsx($.X,{className:"richtext-h-4 richtext-w-4"})}));N.displayName=s.Close.displayName;const E=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Title,{ref:e,className:a.cn("richtext-text-sm richtext-font-semibold",t),...r}));E.displayName=s.Title.displayName;const R=x.forwardRef(({className:t,...r},e)=>i.jsx(s.Description,{ref:e,className:a.cn("richtext-text-sm richtext-opacity-90",t),...r}));R.displayName=s.Description.displayName;function L(){const{toasts:t}=a.useToast();return i.jsxs(V,{children:[t.map(({id:r,title:e,description:n,action:o,...u})=>i.jsxs(T,{...u,children:[i.jsxs("div",{className:"richtext-grid richtext-gap-1",children:[e&&i.jsx(E,{children:e}),n&&i.jsx(R,{children:n})]}),o,i.jsx(N,{})]},r)),i.jsx(w,{})]})}const F=`
2
2
  .remarkablejames-editor {
3
3
  button,
4
4
  input:where([type=button]),
@@ -105,11 +105,11 @@
105
105
  height: auto;
106
106
  }
107
107
  }
108
- `;function Q({editor:t}){const r=a.useStoreEditableEditor();l.useEffect(()=>{r(t==null?void 0:t.isEditable)},[t==null?void 0:t.isEditable]);const e=()=>{r(t==null?void 0:t.isEditable)};return l.useEffect(()=>(t&&t.on("update",e),()=>{t&&t.off("update",e)}),[t]),i.jsx(i.Fragment,{})}const v="data-rc-order",y="data-rc-priority",I="rc-util-key",p=new Map;function Y(t,r){if(!t)return!1;if(t.contains)return t.contains(r);let e=r;for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function S({mark:t}={}){return t?t.startsWith("data-")?t:`data-${t}`:I}function m(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function B(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function P(t){return[...(p.get(t)||t).children].filter(r=>r.tagName==="STYLE")}function C(t,r={}){const{csp:e,prepend:n,priority:o=0}=r,u=B(n),d=u==="prependQueue",c=document.createElement("style");c.setAttribute(v,u),d&&o&&c.setAttribute(y,`${o}`),e!=null&&e.nonce&&(c.nonce=e==null?void 0:e.nonce),c.innerHTML=t;const h=m(r),{firstChild:k}=h;if(n){if(d){const g=P(h).filter(b=>{if(!["prepend","prependQueue"].includes(b.getAttribute(v)))return!1;const D=Number(b.getAttribute(y)||0);return o>=D});if(g.length>0)return h.insertBefore(c,g.at(-1).nextSibling),c}k.before(c)}else h.append(c);return c}function M(t,r={}){const e=m(r);return P(e).find(n=>n.getAttribute(S(r))===t)}function A(t,r={}){const e=M(t,r);e&&e.remove()}function K(t,r){const e=p.get(t);if(!e||!Y(document,e)){const n=C("",r),{parentNode:o}=n;p.set(t,o),n.remove()}}function O(t,r,e={}){var d,c,h;const n=m(e);K(n,e);const o=M(r,e);if(o)return(d=e.csp)!=null&&d.nonce&&o.nonce!==((c=e.csp)==null?void 0:c.nonce)&&(o.nonce=(h=e.csp)==null?void 0:h.nonce),o.innerHTML!==t&&(o.innerHTML=t),o;const u=C(t,e);return u.setAttribute(S(e),r),u}function W(){const{theme:t,color:r,borderRadius:e}=f.useTheme();return l.useEffect(()=>{const n=t||"light",o=r||"default";let u=f.THEME[n][o];if(!u){u=f.THEME.light.default;return}return O(`
108
+ `;function Q({editor:t}){const r=a.useStoreEditableEditor();h.useEffect(()=>{r(t==null?void 0:t.isEditable)},[t==null?void 0:t.isEditable]);const e=()=>{r(t==null?void 0:t.isEditable)};return h.useEffect(()=>(t&&t.on("update",e),()=>{t&&t.off("update",e)}),[t]),i.jsx(i.Fragment,{})}const v="data-rc-order",y="data-rc-priority",I="rc-util-key",p=new Map;function Y(t,r){if(!t)return!1;if(t.contains)return t.contains(r);let e=r;for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function S({mark:t}={}){return t?t.startsWith("data-")?t:`data-${t}`:I}function m(t){return t.attachTo?t.attachTo:document.querySelector("head")||document.body}function B(t){return t==="queue"?"prependQueue":t?"prepend":"append"}function P(t){return[...(p.get(t)||t).children].filter(r=>r.tagName==="STYLE")}function C(t,r={}){const{csp:e,prepend:n,priority:o=0}=r,u=B(n),d=u==="prependQueue",c=document.createElement("style");c.setAttribute(v,u),d&&o&&c.setAttribute(y,`${o}`),e!=null&&e.nonce&&(c.nonce=e==null?void 0:e.nonce),c.innerHTML=t;const l=m(r),{firstChild:k}=l;if(n){if(d){const g=P(l).filter(b=>{if(!["prepend","prependQueue"].includes(b.getAttribute(v)))return!1;const D=Number(b.getAttribute(y)||0);return o>=D});if(g.length>0)return l.insertBefore(c,g.at(-1).nextSibling),c}k.before(c)}else l.append(c);return c}function A(t,r={}){const e=m(r);return P(e).find(n=>n.getAttribute(S(r))===t)}function M(t,r={}){const e=A(t,r);e&&e.remove()}function K(t,r){const e=p.get(t);if(!e||!Y(document,e)){const n=C("",r),{parentNode:o}=n;p.set(t,o),n.remove()}}function O(t,r,e={}){var d,c,l;const n=m(e);K(n,e);const o=A(r,e);if(o)return(d=e.csp)!=null&&d.nonce&&o.nonce!==((c=e.csp)==null?void 0:c.nonce)&&(o.nonce=(l=e.csp)==null?void 0:l.nonce),o.innerHTML!==t&&(o.innerHTML=t),o;const u=C(t,e);return u.setAttribute(S(e),r),u}function W(){const{theme:t,color:r,borderRadius:e}=f.useTheme();return h.useEffect(()=>{const n=t||"light",o=r||"default";let u=f.THEME[n][o];if(!u){u=f.THEME.light.default;return}return O(`
109
109
  .remarkablejames-editor, .remarkablejames-editor *,
110
110
  .remarkablejames-editor-theme, .remarkablejames-editor-theme *,
111
111
  div[data-richtext-portal], div[data-richtext-portal] * {
112
112
  ${Object.entries(u).map(([d,c])=>typeof e=="string"&&d==="radius"?`--${d}: ${e};`:`--${d}: ${c};`).join(`
113
113
  `)}
114
114
  }
115
- `,"richtext-theme",{priority:50}),()=>{A("richtext-theme")}},[t,r,e]),i.jsx(i.Fragment,{})}function X({editor:t,children:r}){const e=l.useId();return l.useEffect(()=>(O(F,"react-tiptap-reset"),()=>{A("react-tiptap-reset")}),[]),l.useEffect(()=>{t&&(t.id=e)},[e,t]),t?i.jsx("div",{className:"remarkablejames-editor",children:i.jsx(a.ReactBusProvider,{children:i.jsxs(q.EditorContext.Provider,{value:{editor:t},children:[i.jsx(a.TooltipProvider,{delayDuration:0,disableHoverableContent:!0,children:r}),i.jsx(Q,{editor:t}),i.jsx(a.SlashDialogTrigger,{}),i.jsx(W,{}),i.jsx(L,{})]})})}):i.jsx(i.Fragment,{})}exports.TooltipProvider=a.TooltipProvider;exports.RichTextProvider=X;
115
+ `,"richtext-theme",{priority:50}),()=>{M("richtext-theme")}},[t,r,e]),i.jsx(i.Fragment,{})}function X({editor:t,children:r,dark:e}){const n=h.useId();return h.useEffect(()=>(O(F,"react-tiptap-reset"),()=>{M("react-tiptap-reset")}),[]),h.useEffect(()=>{t&&(t.id=n)},[n,t]),h.useEffect(()=>{typeof e=="boolean"&&f.themeActions.setTheme(e?"dark":"light")},[e]),t?i.jsx("div",{className:a.cn("remarkablejames-editor",e&&"dark"),children:i.jsx(a.ReactBusProvider,{children:i.jsxs(q.EditorContext.Provider,{value:{editor:t},children:[i.jsx(a.TooltipProvider,{delayDuration:0,disableHoverableContent:!0,children:r}),i.jsx(Q,{editor:t}),i.jsx(a.SlashDialogTrigger,{}),i.jsx(W,{}),i.jsx(L,{})]})})}):i.jsx(i.Fragment,{})}exports.TooltipProvider=a.TooltipProvider;exports.RichTextProvider=X;
package/lib/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  import { jsx as i, jsxs as f, Fragment as m } from "react/jsx-runtime";
2
2
  import { K as O } from "./clsx-BUPZHhq3.js";
3
- import * as u from "react";
4
- import { useEffect as x, useId as z } from "react";
5
- import { c as l, W as H, w as L, X as _, Y as Q, Z as Y, _ as I } from "./index-CnKgiZFQ.js";
3
+ import * as x from "react";
4
+ import { useEffect as l, useId as z } from "react";
5
+ import { c as u, P as H, r as L, Q, R as _, S as I, U as K } from "./index-CelRl0mr.js";
6
6
  import * as c from "@radix-ui/react-toast";
7
- import { X as K } from "lucide-react";
8
- import { useTheme as q, THEME as y } from "./theme.js";
9
- const B = c.Provider, T = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
7
+ import { X as Y } from "lucide-react";
8
+ import { useTheme as q, THEME as y, themeActions as B } from "./theme.js";
9
+ const F = c.Provider, T = x.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
10
10
  c.Viewport,
11
11
  {
12
12
  ref: e,
13
- className: l(
13
+ className: u(
14
14
  "richtext-fixed richtext-top-0 richtext-z-[100] richtext-flex richtext-max-h-screen richtext-w-full richtext-flex-col-reverse richtext-p-4 sm:richtext-bottom-0 sm:richtext-right-0 sm:richtext-top-auto sm:richtext-flex-col md:richtext-max-w-[420px]",
15
15
  t
16
16
  ),
@@ -18,7 +18,7 @@ const B = c.Provider, T = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE
18
18
  }
19
19
  ));
20
20
  T.displayName = c.Viewport.displayName;
21
- const F = H(
21
+ const U = H(
22
22
  "richtext-group richtext-pointer-events-auto richtext-relative richtext-flex richtext-w-full richtext-items-center richtext-justify-between richtext-space-x-4 richtext-overflow-hidden richtext-rounded-md !richtext-border richtext-p-6 richtext-pr-8 richtext-shadow-lg richtext-transition-all data-[swipe=cancel]:richtext-translate-x-0 data-[swipe=end]:richtext-translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:richtext-translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:richtext-transition-none data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[swipe=end]:richtext-animate-out data-[state=closed]:richtext-fade-out-80 data-[state=closed]:richtext-slide-out-to-right-full data-[state=open]:richtext-slide-in-from-top-full data-[state=open]:sm:richtext-slide-in-from-bottom-full",
23
23
  {
24
24
  variants: {
@@ -31,20 +31,20 @@ const F = H(
31
31
  variant: "default"
32
32
  }
33
33
  }
34
- ), R = u.forwardRef(({ className: t, variant: r, ...e }, n) => /* @__PURE__ */ i(
34
+ ), R = x.forwardRef(({ className: t, variant: r, ...e }, n) => /* @__PURE__ */ i(
35
35
  c.Root,
36
36
  {
37
37
  ref: n,
38
- className: l(F({ variant: r }), t),
38
+ className: u(U({ variant: r }), t),
39
39
  ...e
40
40
  }
41
41
  ));
42
42
  R.displayName = c.Root.displayName;
43
- const W = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
43
+ const W = x.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
44
44
  c.Action,
45
45
  {
46
46
  ref: e,
47
- className: l(
47
+ className: u(
48
48
  "richtext-inline-flex richtext-h-8 richtext-shrink-0 richtext-items-center richtext-justify-center richtext-rounded-md !richtext-border richtext-bg-transparent richtext-px-3 richtext-text-sm richtext-font-medium richtext-ring-offset-background richtext-transition-colors hover:richtext-bg-secondary focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-pointer-events-none disabled:richtext-opacity-50 group-[.destructive]:richtext-border-muted/40 group-[.destructive]:hover:richtext-border-destructive/30 group-[.destructive]:hover:richtext-bg-destructive group-[.destructive]:hover:richtext-text-destructive-foreground group-[.destructive]:focus:richtext-ring-destructive",
49
49
  t
50
50
  ),
@@ -52,45 +52,45 @@ const W = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
52
52
  }
53
53
  ));
54
54
  W.displayName = c.Action.displayName;
55
- const E = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
55
+ const E = x.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
56
56
  c.Close,
57
57
  {
58
58
  ref: e,
59
- className: l(
59
+ className: u(
60
60
  "richtext-absolute richtext-right-2 richtext-top-2 richtext-rounded-md richtext-p-1 richtext-text-foreground/50 richtext-opacity-0 richtext-transition-opacity hover:richtext-text-foreground focus:richtext-opacity-100 focus:richtext-outline-none focus:richtext-ring-2 group-hover:richtext-opacity-100 group-[.destructive]:richtext-text-red-300 group-[.destructive]:hover:richtext-text-red-50 group-[.destructive]:focus:richtext-ring-red-400 group-[.destructive]:focus:richtext-ring-offset-red-600",
61
61
  t
62
62
  ),
63
63
  "toast-close": "",
64
64
  ...r,
65
- children: /* @__PURE__ */ i(K, { className: "richtext-h-4 richtext-w-4" })
65
+ children: /* @__PURE__ */ i(Y, { className: "richtext-h-4 richtext-w-4" })
66
66
  }
67
67
  ));
68
68
  E.displayName = c.Close.displayName;
69
- const C = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
69
+ const S = x.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
70
70
  c.Title,
71
71
  {
72
72
  ref: e,
73
- className: l("richtext-text-sm richtext-font-semibold", t),
73
+ className: u("richtext-text-sm richtext-font-semibold", t),
74
74
  ...r
75
75
  }
76
76
  ));
77
- C.displayName = c.Title.displayName;
78
- const S = u.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
77
+ S.displayName = c.Title.displayName;
78
+ const C = x.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ i(
79
79
  c.Description,
80
80
  {
81
81
  ref: e,
82
- className: l("richtext-text-sm richtext-opacity-90", t),
82
+ className: u("richtext-text-sm richtext-opacity-90", t),
83
83
  ...r
84
84
  }
85
85
  ));
86
- S.displayName = c.Description.displayName;
86
+ C.displayName = c.Description.displayName;
87
87
  function X() {
88
88
  const { toasts: t } = L();
89
- return /* @__PURE__ */ f(B, { children: [
89
+ return /* @__PURE__ */ f(F, { children: [
90
90
  t.map(({ id: r, title: e, description: n, action: o, ...s }) => /* @__PURE__ */ f(R, { ...s, children: [
91
91
  /* @__PURE__ */ f("div", { className: "richtext-grid richtext-gap-1", children: [
92
- e && /* @__PURE__ */ i(C, { children: e }),
93
- n && /* @__PURE__ */ i(S, { children: n })
92
+ e && /* @__PURE__ */ i(S, { children: e }),
93
+ n && /* @__PURE__ */ i(C, { children: n })
94
94
  ] }),
95
95
  o,
96
96
  /* @__PURE__ */ i(E, {})
@@ -98,7 +98,7 @@ function X() {
98
98
  /* @__PURE__ */ i(T, {})
99
99
  ] });
100
100
  }
101
- const Z = `
101
+ const G = `
102
102
  .remarkablejames-editor {
103
103
  button,
104
104
  input:where([type=button]),
@@ -206,20 +206,20 @@ const Z = `
206
206
  }
207
207
  }
208
208
  `;
209
- function G({ editor: t }) {
210
- const r = _();
211
- x(() => {
209
+ function J({ editor: t }) {
210
+ const r = Q();
211
+ l(() => {
212
212
  r(t == null ? void 0 : t.isEditable);
213
213
  }, [t == null ? void 0 : t.isEditable]);
214
214
  const e = () => {
215
215
  r(t == null ? void 0 : t.isEditable);
216
216
  };
217
- return x(() => (t && t.on("update", e), () => {
217
+ return l(() => (t && t.on("update", e), () => {
218
218
  t && t.off("update", e);
219
219
  }), [t]), /* @__PURE__ */ i(m, {});
220
220
  }
221
- const w = "data-rc-order", N = "data-rc-priority", J = "rc-util-key", p = /* @__PURE__ */ new Map();
222
- function U(t, r) {
221
+ const w = "data-rc-order", N = "data-rc-priority", Z = "rc-util-key", p = /* @__PURE__ */ new Map();
222
+ function tt(t, r) {
223
223
  if (!t)
224
224
  return !1;
225
225
  if (t.contains)
@@ -233,12 +233,12 @@ function U(t, r) {
233
233
  return !1;
234
234
  }
235
235
  function j({ mark: t } = {}) {
236
- return t ? t.startsWith("data-") ? t : `data-${t}` : J;
236
+ return t ? t.startsWith("data-") ? t : `data-${t}` : Z;
237
237
  }
238
238
  function g(t) {
239
239
  return t.attachTo ? t.attachTo : document.querySelector("head") || document.body;
240
240
  }
241
- function tt(t) {
241
+ function et(t) {
242
242
  return t === "queue" ? "prependQueue" : t ? "prepend" : "append";
243
243
  }
244
244
  function P(t) {
@@ -247,23 +247,23 @@ function P(t) {
247
247
  );
248
248
  }
249
249
  function A(t, r = {}) {
250
- const { csp: e, prepend: n, priority: o = 0 } = r, s = tt(n), d = s === "prependQueue", a = document.createElement("style");
251
- a.setAttribute(w, s), d && o && a.setAttribute(N, `${o}`), e != null && e.nonce && (a.nonce = e == null ? void 0 : e.nonce), a.innerHTML = t;
252
- const h = g(r), { firstChild: V } = h;
250
+ const { csp: e, prepend: n, priority: o = 0 } = r, s = et(n), h = s === "prependQueue", a = document.createElement("style");
251
+ a.setAttribute(w, s), h && o && a.setAttribute(N, `${o}`), e != null && e.nonce && (a.nonce = e == null ? void 0 : e.nonce), a.innerHTML = t;
252
+ const d = g(r), { firstChild: V } = d;
253
253
  if (n) {
254
- if (d) {
255
- const b = P(h).filter((v) => {
254
+ if (h) {
255
+ const b = P(d).filter((v) => {
256
256
  if (!["prepend", "prependQueue"].includes(v.getAttribute(w)))
257
257
  return !1;
258
258
  const $ = Number(v.getAttribute(N) || 0);
259
259
  return o >= $;
260
260
  });
261
261
  if (b.length > 0)
262
- return h.insertBefore(a, b.at(-1).nextSibling), a;
262
+ return d.insertBefore(a, b.at(-1).nextSibling), a;
263
263
  }
264
264
  V.before(a);
265
265
  } else
266
- h.append(a);
266
+ d.append(a);
267
267
  return a;
268
268
  }
269
269
  function M(t, r = {}) {
@@ -274,26 +274,26 @@ function k(t, r = {}) {
274
274
  const e = M(t, r);
275
275
  e && e.remove();
276
276
  }
277
- function et(t, r) {
277
+ function rt(t, r) {
278
278
  const e = p.get(t);
279
- if (!e || !U(document, e)) {
279
+ if (!e || !tt(document, e)) {
280
280
  const n = A("", r), { parentNode: o } = n;
281
281
  p.set(t, o), n.remove();
282
282
  }
283
283
  }
284
284
  function D(t, r, e = {}) {
285
- var d, a, h;
285
+ var h, a, d;
286
286
  const n = g(e);
287
- et(n, e);
287
+ rt(n, e);
288
288
  const o = M(r, e);
289
289
  if (o)
290
- return (d = e.csp) != null && d.nonce && o.nonce !== ((a = e.csp) == null ? void 0 : a.nonce) && (o.nonce = (h = e.csp) == null ? void 0 : h.nonce), o.innerHTML !== t && (o.innerHTML = t), o;
290
+ return (h = e.csp) != null && h.nonce && o.nonce !== ((a = e.csp) == null ? void 0 : a.nonce) && (o.nonce = (d = e.csp) == null ? void 0 : d.nonce), o.innerHTML !== t && (o.innerHTML = t), o;
291
291
  const s = A(t, e);
292
292
  return s.setAttribute(j(e), r), s;
293
293
  }
294
- function rt() {
294
+ function it() {
295
295
  const { theme: t, color: r, borderRadius: e } = q();
296
- return x(() => {
296
+ return l(() => {
297
297
  const n = t || "light", o = r || "default";
298
298
  let s = y[n][o];
299
299
  if (!s) {
@@ -305,7 +305,7 @@ function rt() {
305
305
  .remarkablejames-editor, .remarkablejames-editor *,
306
306
  .remarkablejames-editor-theme, .remarkablejames-editor-theme *,
307
307
  div[data-richtext-portal], div[data-richtext-portal] * {
308
- ${Object.entries(s).map(([d, a]) => typeof e == "string" && d === "radius" ? `--${d}: ${e};` : `--${d}: ${a};`).join(`
308
+ ${Object.entries(s).map(([h, a]) => typeof e == "string" && h === "radius" ? `--${h}: ${e};` : `--${h}: ${a};`).join(`
309
309
  `)}
310
310
  }
311
311
  `,
@@ -318,21 +318,23 @@ function rt() {
318
318
  };
319
319
  }, [t, r, e]), /* @__PURE__ */ i(m, {});
320
320
  }
321
- function dt({ editor: t, children: r }) {
322
- const e = z();
323
- return x(() => (D(Z, "react-tiptap-reset"), () => {
321
+ function dt({ editor: t, children: r, dark: e }) {
322
+ const n = z();
323
+ return l(() => (D(G, "react-tiptap-reset"), () => {
324
324
  k("react-tiptap-reset");
325
- }), []), x(() => {
326
- t && (t.id = e);
327
- }, [e, t]), t ? /* @__PURE__ */ i("div", { className: "remarkablejames-editor", children: /* @__PURE__ */ i(Q, { children: /* @__PURE__ */ f(O.Provider, { value: { editor: t }, children: [
328
- /* @__PURE__ */ i(Y, { delayDuration: 0, disableHoverableContent: !0, children: r }),
329
- /* @__PURE__ */ i(G, { editor: t }),
330
- /* @__PURE__ */ i(I, {}),
331
- /* @__PURE__ */ i(rt, {}),
325
+ }), []), l(() => {
326
+ t && (t.id = n);
327
+ }, [n, t]), l(() => {
328
+ typeof e == "boolean" && B.setTheme(e ? "dark" : "light");
329
+ }, [e]), t ? /* @__PURE__ */ i("div", { className: u("remarkablejames-editor", e && "dark"), children: /* @__PURE__ */ i(_, { children: /* @__PURE__ */ f(O.Provider, { value: { editor: t }, children: [
330
+ /* @__PURE__ */ i(I, { delayDuration: 0, disableHoverableContent: !0, children: r }),
331
+ /* @__PURE__ */ i(J, { editor: t }),
332
+ /* @__PURE__ */ i(K, {}),
333
+ /* @__PURE__ */ i(it, {}),
332
334
  /* @__PURE__ */ i(X, {})
333
335
  ] }) }) }) : /* @__PURE__ */ i(m, {});
334
336
  }
335
337
  export {
336
338
  dt as RichTextProvider,
337
- Y as TooltipProvider
339
+ I as TooltipProvider
338
340
  };
@@ -1 +1 @@
1
- "use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-BynXHtjJ.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 o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-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",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
1
+ "use strict";const a=require("react/jsx-runtime"),d=require("@radix-ui/react-popover"),p=require("react"),h=require("./index-CUnpdrCy.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 o=n(d),l=n(p),x=o.Root,m=o.Trigger,c=l.forwardRef(({className:t,align:r="center",sideOffset:e=4,...i},s)=>a.jsx(o.Portal,{children:a.jsx(o.Content,{align:r,"data-richtext-portal":!0,ref:s,sideOffset:e,className:h.cn("richtext-z-50 richtext-w-72 richtext-rounded-md !richtext-border !richtext-border-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",t),...i})}));c.displayName=o.Content.displayName;exports.Popover=x;exports.PopoverContent=c;exports.PopoverTrigger=m;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import * as t from "@radix-ui/react-popover";
3
3
  import * as c from "react";
4
- import { c as s } from "./index-CnKgiZFQ.js";
4
+ import { c as s } from "./index-CelRl0mr.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 c=require("react/jsx-runtime"),f=require("@radix-ui/react-select"),x=require("lucide-react"),g=require("react"),s=require("./index-CUnpdrCy.cjs");function l(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,a.get?a:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const t=l(f),o=l(g),y=t.Root,b=t.Value,n=o.forwardRef(({className:r,children:i,...e},a)=>c.jsxs(t.Trigger,{ref:a,className:s.cn("richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",r),...e,children:[i,c.jsx(t.Icon,{asChild:!0,children:c.jsx(x.ChevronDown,{className:"richtext-size-4 richtext-opacity-50"})})]}));n.displayName=t.Trigger.displayName;const h=o.forwardRef(({className:r,...i},e)=>c.jsx(t.ScrollUpButton,{ref:e,className:s.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",r),...i,children:c.jsx(x.ChevronUp,{className:"richtext-size-4"})}));h.displayName=t.ScrollUpButton.displayName;const d=o.forwardRef(({className:r,...i},e)=>c.jsx(t.ScrollDownButton,{ref:e,className:s.cn("richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",r),...i,children:c.jsx(x.ChevronDown,{className:"richtext-size-4"})}));d.displayName=t.ScrollDownButton.displayName;const m=o.forwardRef(({className:r,children:i,position:e="popper",...a},u)=>c.jsx(t.Portal,{children:c.jsxs(t.Content,{"data-richtext-portal":!0,position:e,ref:u,className:s.cn("richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md 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",e==="popper"&&"data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",r),...a,children:[c.jsx(h,{}),c.jsx(t.Viewport,{className:s.cn("richtext-p-1",e==="popper"&&"richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"),children:i}),c.jsx(d,{})]})}));m.displayName=t.Content.displayName;const j=o.forwardRef(({className:r,...i},e)=>c.jsx(t.Label,{className:s.cn("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",r),ref:e,...i}));j.displayName=t.Label.displayName;const p=o.forwardRef(({className:r,children:i,...e},a)=>c.jsxs(t.Item,{ref:a,className:s.cn("richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",r),...e,children:[c.jsx("span",{className:"richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center",children:c.jsx(t.ItemIndicator,{children:c.jsx(x.Check,{className:"richtext-size-4"})})}),c.jsx(t.ItemText,{children:i})]}));p.displayName=t.Item.displayName;const N=o.forwardRef(({className:r,...i},e)=>c.jsx(t.Separator,{className:s.cn("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted",r),ref:e,...i}));N.displayName=t.Separator.displayName;exports.Select=y;exports.SelectContent=m;exports.SelectItem=p;exports.SelectTrigger=n;exports.SelectValue=b;
@@ -0,0 +1,120 @@
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import * as t from "@radix-ui/react-select";
3
+ import { ChevronDown as x, ChevronUp as m, Check as p } from "lucide-react";
4
+ import * as o from "react";
5
+ import { c as a } from "./index-CelRl0mr.js";
6
+ const v = t.Root, R = t.Value, f = o.forwardRef(({ className: i, children: c, ...r }, s) => /* @__PURE__ */ h(
7
+ t.Trigger,
8
+ {
9
+ ref: s,
10
+ className: a(
11
+ "richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-text-foreground richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
12
+ i
13
+ ),
14
+ ...r,
15
+ children: [
16
+ c,
17
+ /* @__PURE__ */ e(t.Icon, { asChild: !0, children: /* @__PURE__ */ e(x, { className: "richtext-size-4 richtext-opacity-50" }) })
18
+ ]
19
+ }
20
+ ));
21
+ f.displayName = t.Trigger.displayName;
22
+ const l = o.forwardRef(({ className: i, ...c }, r) => /* @__PURE__ */ e(
23
+ t.ScrollUpButton,
24
+ {
25
+ ref: r,
26
+ className: a(
27
+ "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
28
+ i
29
+ ),
30
+ ...c,
31
+ children: /* @__PURE__ */ e(m, { className: "richtext-size-4" })
32
+ }
33
+ ));
34
+ l.displayName = t.ScrollUpButton.displayName;
35
+ const d = o.forwardRef(({ className: i, ...c }, r) => /* @__PURE__ */ e(
36
+ t.ScrollDownButton,
37
+ {
38
+ ref: r,
39
+ className: a(
40
+ "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
41
+ i
42
+ ),
43
+ ...c,
44
+ children: /* @__PURE__ */ e(x, { className: "richtext-size-4" })
45
+ }
46
+ ));
47
+ d.displayName = t.ScrollDownButton.displayName;
48
+ const u = o.forwardRef(({ className: i, children: c, position: r = "popper", ...s }, n) => /* @__PURE__ */ e(t.Portal, { children: /* @__PURE__ */ h(
49
+ t.Content,
50
+ {
51
+ "data-richtext-portal": !0,
52
+ position: r,
53
+ ref: n,
54
+ className: a(
55
+ "richtext-relative richtext-z-50 richtext-max-h-60 richtext-min-w-[8rem] richtext-overflow-hidden richtext-overflow-y-auto richtext-rounded-md richtext-border !richtext-border-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md 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",
56
+ r === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
57
+ i
58
+ ),
59
+ ...s,
60
+ children: [
61
+ /* @__PURE__ */ e(l, {}),
62
+ /* @__PURE__ */ e(
63
+ t.Viewport,
64
+ {
65
+ className: a(
66
+ "richtext-p-1",
67
+ r === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
68
+ ),
69
+ children: c
70
+ }
71
+ ),
72
+ /* @__PURE__ */ e(d, {})
73
+ ]
74
+ }
75
+ ) }));
76
+ u.displayName = t.Content.displayName;
77
+ const y = o.forwardRef(({ className: i, ...c }, r) => /* @__PURE__ */ e(
78
+ t.Label,
79
+ {
80
+ className: a(
81
+ "richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold",
82
+ i
83
+ ),
84
+ ref: r,
85
+ ...c
86
+ }
87
+ ));
88
+ y.displayName = t.Label.displayName;
89
+ const g = o.forwardRef(({ className: i, children: c, ...r }, s) => /* @__PURE__ */ h(
90
+ t.Item,
91
+ {
92
+ ref: s,
93
+ className: a(
94
+ "richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
95
+ i
96
+ ),
97
+ ...r,
98
+ children: [
99
+ /* @__PURE__ */ e("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-size-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ e(t.ItemIndicator, { children: /* @__PURE__ */ e(p, { className: "richtext-size-4" }) }) }),
100
+ /* @__PURE__ */ e(t.ItemText, { children: c })
101
+ ]
102
+ }
103
+ ));
104
+ g.displayName = t.Item.displayName;
105
+ const N = o.forwardRef(({ className: i, ...c }, r) => /* @__PURE__ */ e(
106
+ t.Separator,
107
+ {
108
+ className: a("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", i),
109
+ ref: r,
110
+ ...c
111
+ }
112
+ ));
113
+ N.displayName = t.Separator.displayName;
114
+ export {
115
+ v as S,
116
+ f as a,
117
+ R as b,
118
+ u as c,
119
+ g as d
120
+ };
@@ -3,11 +3,11 @@ import { Plus as k } from "lucide-react";
3
3
  import * as $ from "react";
4
4
  import { useCallback as m, useState as w, useEffect as L, useRef as M, useMemo as B } from "react";
5
5
  import { HexColorPicker as F } from "react-colorful";
6
- import { j as I, B as _, c as T } from "./index-CnKgiZFQ.js";
6
+ import { j as I, B as _, c as T } from "./index-CelRl0mr.js";
7
7
  import "./theme.js";
8
- import { P as N, a as z, b as E } from "./popover-BzJyaFvy.js";
9
- import * as y from "@radix-ui/react-separator";
10
- import { u as R, C as j } from "./index-BGd2HiwP.js";
8
+ import { u as N, C as j } from "./index-BGd2HiwP.js";
9
+ import { P as z, a as E, b as y } from "./popover-SMtif0E1.js";
10
+ import * as R from "@radix-ui/react-separator";
11
11
  function D() {
12
12
  return /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", children: /* @__PURE__ */ t(
13
13
  "path",
@@ -102,7 +102,7 @@ function J(e, r, c = {}) {
102
102
  return S("storage", v), S("local-storage", v), [h, b, g];
103
103
  }
104
104
  function X(e) {
105
- const { t: r } = R(), { disabled: c = !1, value: d, onChange: n, colors: u = j, highlight: a } = e, [h, f] = w(!1), b = B(() => {
105
+ const { t: r } = N(), { disabled: c = !1, value: d, onChange: n, colors: u = j, highlight: a } = e, [h, f] = w(!1), b = B(() => {
106
106
  const i = u, l = [];
107
107
  for (let x = 0; x < i.length; x += 10)
108
108
  l.push(i.slice(x, x + 10));
@@ -121,10 +121,10 @@ function X(e) {
121
121
  }
122
122
  /^#([\da-f]{3}){1,2}$/i.test(i) && (n == null || n(i), o(i), f(!1));
123
123
  }
124
- return /* @__PURE__ */ p(N, { modal: !0, onOpenChange: f, open: h, children: [
125
- /* @__PURE__ */ t(z, { asChild: !0, className: "!richtext-p-0", disabled: c, children: e == null ? void 0 : e.children }),
124
+ return /* @__PURE__ */ p(z, { modal: !0, onOpenChange: f, open: h, children: [
125
+ /* @__PURE__ */ t(E, { asChild: !0, className: "!richtext-p-0", disabled: c, children: e == null ? void 0 : e.children }),
126
126
  /* @__PURE__ */ t(
127
- E,
127
+ y,
128
128
  {
129
129
  align: "start",
130
130
  className: "richtext-size-full !richtext-p-2",
@@ -227,15 +227,15 @@ function X(e) {
227
227
  ] });
228
228
  }
229
229
  function Z({ setColor: e }) {
230
- const { t: r } = R(), [c, d] = w(!1), [n, u] = w("#000000"), a = m((h) => {
230
+ const { t: r } = N(), [c, d] = w(!1), [n, u] = w("#000000"), a = m((h) => {
231
231
  u(h);
232
232
  }, []);
233
- return /* @__PURE__ */ p(N, { onOpenChange: d, open: c, children: [
234
- /* @__PURE__ */ t(z, { asChild: !0, children: /* @__PURE__ */ p("div", { className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent", children: [
233
+ return /* @__PURE__ */ p(z, { onOpenChange: d, open: c, children: [
234
+ /* @__PURE__ */ t(E, { asChild: !0, children: /* @__PURE__ */ p("div", { className: "richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent", children: [
235
235
  r("editor.color.more"),
236
236
  "..."
237
237
  ] }) }),
238
- /* @__PURE__ */ p(E, { children: [
238
+ /* @__PURE__ */ p(y, { children: [
239
239
  /* @__PURE__ */ p("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-justify-center", children: [
240
240
  /* @__PURE__ */ t(
241
241
  F,
@@ -273,7 +273,7 @@ function Z({ setColor: e }) {
273
273
  ] });
274
274
  }
275
275
  const O = $.forwardRef(({ className: e, orientation: r = "horizontal", decorative: c = !0, ...d }, n) => /* @__PURE__ */ t(
276
- y.Root,
276
+ R.Root,
277
277
  {
278
278
  ref: n,
279
279
  decorative: c,
@@ -286,7 +286,7 @@ const O = $.forwardRef(({ className: e, orientation: r = "horizontal", decorativ
286
286
  ...d
287
287
  }
288
288
  ));
289
- O.displayName = y.Root.displayName;
289
+ O.displayName = R.Root.displayName;
290
290
  export {
291
291
  X as C,
292
292
  O as S
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),E=require("lucide-react"),n=require("react"),P=require("react-colorful"),j=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const v=require("./popover-BdLwAlrM.cjs"),O=require("@radix-ui/react-separator"),C=require("./index-DgOXAdKt.cjs");function N(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 y=N(n),z=N(O);function R(){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 L(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 L("storage",m),L("local-storage",m),[d,b,g]}function q(t){const{t:r}=C.useLocale(),{disabled:c=!1,value:h,onChange:i,colors:f=C.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(R,{}),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,k)=>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-${k}`))},`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(M,{setColor:l})]})})]})}function M({setColor:t}){const{t:r}=C.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(P.HexColorPicker,{color:i,onChange:d=>{x(d)}}),e.jsx(j.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(S,{className:"richtext-my-[10px]"}),e.jsx(j.Button,{className:"richtext-w-full",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(i),h(!1)},children:e.jsx(E.Plus,{size:16})})]})]})}const S=y.forwardRef(({className:t,orientation:r="horizontal",decorative:c=!0,...h},i)=>e.jsx(z.Root,{ref:i,decorative:c,orientation:r,className:j.cn("richtext-shrink-0 richtext-bg-border",r==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...h}));S.displayName=z.Root.displayName;exports.ColorPicker=q;exports.Separator=S;
1
+ "use strict";const e=require("react/jsx-runtime"),E=require("lucide-react"),n=require("react"),P=require("react-colorful"),j=require("./index-CUnpdrCy.cjs");require("./theme.cjs");const C=require("./index-DgOXAdKt.cjs"),v=require("./popover-DEMkixfo.cjs"),O=require("@radix-ui/react-separator");function N(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 y=N(n),z=N(O);function R(){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 L(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 L("storage",m),L("local-storage",m),[d,b,g]}function q(t){const{t:r}=C.useLocale(),{disabled:c=!1,value:h,onChange:i,colors:f=C.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(R,{}),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,k)=>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-${k}`))},`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(M,{setColor:l})]})})]})}function M({setColor:t}){const{t:r}=C.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(P.HexColorPicker,{color:i,onChange:d=>{x(d)}}),e.jsx(j.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(S,{className:"richtext-my-[10px]"}),e.jsx(j.Button,{className:"richtext-w-full",onClick:d=>{d.preventDefault(),d.stopPropagation(),t(i),h(!1)},children:e.jsx(E.Plus,{size:16})})]})]})}const S=y.forwardRef(({className:t,orientation:r="horizontal",decorative:c=!0,...h},i)=>e.jsx(z.Root,{ref:i,decorative:c,orientation:r,className:j.cn("richtext-shrink-0 richtext-bg-border",r==="horizontal"?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",t),...h}));S.displayName=z.Root.displayName;exports.ColorPicker=q;exports.Separator=S;
@@ -0,0 +1 @@
1
+ "use strict";const n=require("react/jsx-runtime"),o=require("react"),a=require("./index-CUnpdrCy.cjs");function s(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const x=s(o),c=x.forwardRef(({className:e,...r},t)=>n.jsx("textarea",{ref:t,className:a.cn("richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",e),...r}));c.displayName="Textarea";exports.Textarea=c;
@@ -0,0 +1,20 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { c as o } from "./index-CelRl0mr.js";
4
+ const x = c.forwardRef(
5
+ ({ className: t, ...e }, r) => /* @__PURE__ */ i(
6
+ "textarea",
7
+ {
8
+ ref: r,
9
+ className: o(
10
+ "richtext-flex richtext-min-h-[80px] richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-2 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",
11
+ t
12
+ ),
13
+ ...e
14
+ }
15
+ )
16
+ );
17
+ x.displayName = "Textarea";
18
+ export {
19
+ x as T
20
+ };