react-reason-editor 1.0.24 → 1.0.26

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 (99) hide show
  1. package/README.md +24 -0
  2. package/dist/{Attachment-DGzsbPZZ.js → Attachment-FN0H4pdR.js} +2 -2
  3. package/dist/Attachment.js +1 -1
  4. package/dist/BulletList.cjs +1 -1
  5. package/dist/{Callout-heY7R-Zu.js → Callout-C6kKHIbW.js} +2 -2
  6. package/dist/Callout.js +1 -1
  7. package/dist/{CodeBlock-B7Wklup8.js → CodeBlock-DLhI2Guf.js} +1 -1
  8. package/dist/{CodeBlock-D2OKvGCF.cjs → CodeBlock-zh4cX5EA.cjs} +1 -1
  9. package/dist/CodeBlock.cjs +1 -1
  10. package/dist/CodeBlock.js +1 -1
  11. package/dist/CodeView.cjs +1 -1
  12. package/dist/CodeView.js +1 -1
  13. package/dist/{Color-BxzxtvJH.cjs → Color-D5zLljFV.cjs} +1 -1
  14. package/dist/Color.cjs +1 -1
  15. package/dist/{Drawer-DxCO6TBr.cjs → Drawer-B0QvuSOf.cjs} +1 -1
  16. package/dist/{Drawer-Dunw22Q1.js → Drawer-bqo2XUCW.js} +12 -12
  17. package/dist/Drawer.cjs +1 -1
  18. package/dist/Drawer.js +1 -1
  19. package/dist/{Drawio-eqEGDkwW.js → Drawio-CIXM-WGy.js} +4 -4
  20. package/dist/Drawio.js +1 -1
  21. package/dist/{Emoji-BU-itkPp.js → Emoji-CTvSFbHz.js} +3 -3
  22. package/dist/Emoji.js +1 -1
  23. package/dist/FontFamily.js +2 -2
  24. package/dist/{Highlight-BeqLxfbY.cjs → Highlight-DQxtCrNN.cjs} +1 -1
  25. package/dist/Highlight.cjs +1 -1
  26. package/dist/{History-C6yBYB2w.js → History-PbMa-usl.js} +1 -1
  27. package/dist/History.js +1 -1
  28. package/dist/Image.js +1 -1
  29. package/dist/{ImageCropper-Dlz4nJQu.js → ImageCropper-CN_GzBBG.js} +5 -5
  30. package/dist/{ImageGif-D5Qw_Xf-.js → ImageGif-D9goI48J.js} +3 -3
  31. package/dist/ImageGif.js +1 -1
  32. package/dist/{ImportWord-BCcs3dYp.js → ImportWord-Bux3L57d.js} +1 -1
  33. package/dist/ImportWord.js +1 -1
  34. package/dist/{Indent-DpTPoZMk.js → Indent-fBwkYx_q.js} +1 -1
  35. package/dist/Indent.js +1 -1
  36. package/dist/{Katex-D_vF5gsD.cjs → Katex-B1xls7hE.cjs} +1 -1
  37. package/dist/{Katex-Bo_vfXrd.js → Katex-D2g86C-B.js} +3 -3
  38. package/dist/Katex.cjs +1 -1
  39. package/dist/Katex.js +1 -1
  40. package/dist/LineHeight.js +1 -1
  41. package/dist/{Link-C0cNnjXo.js → Link-Dpaom2jX.js} +1 -1
  42. package/dist/Link.js +1 -1
  43. package/dist/{Mention-DEkbeL04.js → Mention-D0HVk1SC.js} +1 -1
  44. package/dist/Mention.js +1 -1
  45. package/dist/{Mermaid-BB15qd24.cjs → Mermaid-3vSlkOlc.cjs} +1 -1
  46. package/dist/Mermaid-B3KGZMBo.js +5 -0
  47. package/dist/Mermaid.cjs +1 -1
  48. package/dist/Mermaid.js +1 -1
  49. package/dist/MoreMark.js +1 -1
  50. package/dist/OrderedList.cjs +1 -1
  51. package/dist/SearchAndReplace.cjs +1 -1
  52. package/dist/SearchAndReplace.js +1 -1
  53. package/dist/{SlashCommand-8LkH8bHy.js → SlashCommand-ZFZhrxKb.js} +1 -1
  54. package/dist/SlashCommand.js +1 -1
  55. package/dist/{Table-C9t-k9Qu.js → Table-6kM52sUH.js} +2 -2
  56. package/dist/Table.js +1 -1
  57. package/dist/TaskList.cjs +1 -1
  58. package/dist/{TextAlign-C75gn_OM.js → TextAlign-BKo82ocx.js} +1 -1
  59. package/dist/TextAlign.js +1 -1
  60. package/dist/TextDirection.js +1 -1
  61. package/dist/{Twitter-DyrQT0n4.cjs → Twitter-3yCP2UdP.cjs} +1 -1
  62. package/dist/{Twitter-D5UNfT-K.js → Twitter-D38giVew.js} +2 -2
  63. package/dist/Twitter.cjs +1 -1
  64. package/dist/Twitter.js +1 -1
  65. package/dist/{Video-_YlAC2R_.js → Video-DcfPDZLP.js} +3 -3
  66. package/dist/Video.js +1 -1
  67. package/dist/WordCount.js +1 -1
  68. package/dist/{bubble---c27x7L.js → bubble-4RecyKlX.js} +1 -1
  69. package/dist/bubble.cjs +1 -1
  70. package/dist/bubble.js +1 -1
  71. package/dist/editor-kit.cjs +1 -0
  72. package/dist/editor-kit.d.ts +13 -0
  73. package/dist/editor-kit.js +1 -0
  74. package/dist/editor-views/components/AlignToolbar.d.ts +4 -0
  75. package/dist/editor-views/components/BubbleMenus.d.ts +4 -0
  76. package/dist/editor-views/components/EditorContainer.d.ts +10 -0
  77. package/dist/editor-views/components/Header.d.ts +8 -0
  78. package/dist/editor-views/components/Toolbar.d.ts +26 -0
  79. package/dist/editor-views/components/constants.d.ts +14 -0
  80. package/dist/editor-views/components/extensions.d.ts +8 -0
  81. package/dist/editor-views/components/index.d.ts +9 -0
  82. package/dist/editor-views/config/baseKit.d.ts +7 -0
  83. package/dist/editor-views/config/editorConfig.d.ts +37 -0
  84. package/dist/editor-views/config/pluginRegistry.d.ts +43 -0
  85. package/dist/editorConfig-Cgs4P8O5.js +184 -0
  86. package/dist/editorConfig-CnzPmOCy.cjs +1 -0
  87. package/dist/html-to-docx.esm-DkztZsL5-BqrjWkoQ.cjs +1 -0
  88. package/dist/index.cjs +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/reason-docs.cjs +1 -1
  91. package/dist/reason-docs.js +1 -1
  92. package/dist/{separator-BHN46aj5.cjs → separator-CXjMk9dM.cjs} +1 -1
  93. package/dist/src-73l1pSjp.js +463 -0
  94. package/dist/src-CF0U82SA.cjs +1 -0
  95. package/package.json +12 -2
  96. package/dist/Mermaid-DxpFRVu0.js +0 -5
  97. package/dist/html-to-docx.esm-DkztZsL5-DQYdhD3B.cjs +0 -1
  98. package/dist/src-C7k3RYxJ.js +0 -646
  99. package/dist/src-DYbBlAjR.cjs +0 -1
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./src-DYbBlAjR.cjs");exports.ReasonDocs=e.Index,exports.RichTextProvider=e.RichTextProvider;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./editorConfig-CnzPmOCy.cjs"),r=require("./src-CF0U82SA.cjs");exports.ReasonDocs=r.Index,exports.RichTextProvider=e.RichTextProvider;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{n as s,t as o}from"./src-C7k3RYxJ.js";export{o as ReasonDocs,s as RichTextProvider};
1
+ import{o}from"./editorConfig-Cgs4P8O5.js";import{t as s}from"./src-73l1pSjp.js";export{s as ReasonDocs,o as RichTextProvider};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./src-DYbBlAjR.cjs");exports.ReasonDocs=e.Index;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./src-CF0U82SA.cjs");exports.ReasonDocs=e.Index;
@@ -1 +1 @@
1
- import{t as s}from"./src-C7k3RYxJ.js";export{s as ReasonDocs};
1
+ import{t as s}from"./src-73l1pSjp.js";export{s as ReasonDocs};
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BeavJI0R.cjs"),t=require("./dist-Cn_OUKh6.cjs"),r=require("./locales-Dg9XL0yP.cjs"),i=require("./button-CYMsgP3Y.cjs"),c=require("./input-AvqqajGM.cjs"),o=require("./popover-DEGqjF2J.cjs");let s=require("react"),n=e.__toESM(s,1);s=e.__toESM(s);let l=require("react/jsx-runtime"),a=require("lucide-react"),h=require("react-colorful"),x=require("@radix-ui/react-separator");function d(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:(0,l.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"})})}x=e.__toESM(x,1);var u="undefined"==typeof window;function p(e,t,r=window){const i=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{i.current=t},[t]),(0,n.useEffect)(()=>{if(!r||!r.addEventListener)return;const t=e=>{i.current&&i.current(e)};return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[e,r])}function f(e){const{t:t}=r.useLocale(),{disabled:i=!1,value:c,onChange:s,colors:a=r.COLORS_LIST,highlight:h}=e,[x,f]=(0,n.useState)(!1),v=(0,n.useMemo)(()=>{const e=a,t=[];for(let r=0;r<e.length;r+=10)t.push(e.slice(r,r+10));return t},[a]),[g,b]=function(e,t,r={}){const{initializeWithValue:i=!0}=r,c=(0,n.useCallback)(e=>r.serializer?r.serializer(e):JSON.stringify(e),[r]),o=(0,n.useCallback)(e=>{if(r.deserializer)return r.deserializer(e);if("undefined"===e)return;const i=t instanceof Function?t():t;let c;try{c=JSON.parse(e)}catch(o){return i}return c},[r,t]),s=(0,n.useCallback)(()=>{const r=t instanceof Function?t():t;if(u)return r;try{const t=window.localStorage.getItem(e);return t?o(t):r}catch(i){return r}},[t,e,o]),[l,a]=(0,n.useState)(()=>i?s():t instanceof Function?t():t),h=(0,n.useCallback)(t=>{try{const r=t instanceof Function?t(s()):t;window.localStorage.setItem(e,c(r)),a(r),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))}catch(r){}},[e,c,s]),x=(0,n.useCallback)(()=>{const r=t instanceof Function?t():t;window.localStorage.removeItem(e),a(r),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))},[e,t]);(0,n.useEffect)(()=>{a(s())},[e]);const d=(0,n.useCallback)(t=>{t.key&&t.key!==e||a(s())},[e,s]);return p("storage",d),p("local-storage",d),[l,h,x]}(h?"richtext-recent-highlight":"richtext-recent-colors",[]);function j(e){if(void 0===e)return s?.(e),void f(!1);/^#([\da-f]{3}){1,2}$/i.test(e)&&(s?.(e),(e=>{const t=[...g],r=t.indexOf(e);-1!==r&&t.splice(r,1),t.unshift(e),t.length>10&&t.pop(),b(t)})(e),f(!1))}return(0,l.jsxs)(o.Popover,{modal:!0,onOpenChange:f,open:x,children:[(0,l.jsx)(o.PopoverTrigger,{asChild:!0,className:"!richtext-p-0",disabled:i,children:e?.children}),(0,l.jsx)(o.PopoverContent,{align:"start",className:"richtext-size-full !richtext-p-2",hideWhenDetached:!0,side:"bottom",children:(0,l.jsxs)("div",{className:"richtext-flex richtext-flex-col",children:[(0,l.jsxs)("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{j(void 0)},children:[(0,l.jsx)(d,{}),(0,l.jsx)("span",{className:"richtext-ml-1 richtext-text-sm",children:t(h?"editor.nofill":"editor.default")})]}),v.map((e,t)=>(0,l.jsx)("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:e.map((e,t)=>(0,l.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:()=>j(e),children:(0,l.jsx)("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",style:{backgroundColor:e},children:e===c?(0,l.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:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):(0,l.jsx)("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${t}`))},`color-row-${t}`)),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),(0,l.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?.map((e,t)=>(0,l.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:()=>j(e),children:(0,l.jsx)("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:e},children:(0,l.jsx)("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${t}`))})]}),(0,l.jsx)(m,{setColor:j})]})})]})}function m({setColor:e}){const{t:t}=r.useLocale(),[s,x]=(0,n.useState)(!1),[d,u]=(0,n.useState)("#000000"),p=(0,n.useCallback)(e=>{u(e)},[]);return(0,l.jsxs)(o.Popover,{onOpenChange:x,open:s,children:[(0,l.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,l.jsxs)("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",children:[t("editor.color.more"),"..."]})}),(0,l.jsxs)(o.PopoverContent,{children:[(0,l.jsxs)("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[(0,l.jsx)(h.HexColorPicker,{color:d,onChange:e=>{p(e)}}),(0,l.jsx)(c.Input,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:d.replace("#",""),onChange:e=>{e.preventDefault(),e.stopPropagation(),p(`#${e.target.value}`)}})]}),(0,l.jsx)(v,{className:"richtext-my-[10px]"}),(0,l.jsx)(i.Button,{className:"richtext-w-full",onClick:t=>{t.preventDefault(),t.stopPropagation(),e(d),x(!1)},children:(0,l.jsx)(a.Plus,{size:16})})]})]})}var v=n.forwardRef(({className:e,orientation:r="horizontal",decorative:i=!0,...c},o)=>(0,l.jsx)(x.Root,{ref:o,decorative:i,orientation:r,className:t.cn("richtext-shrink-0 richtext-bg-border","horizontal"===r?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...c}));v.displayName=x.Root.displayName,Object.defineProperty(exports,"ColorPicker",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"Separator",{enumerable:!0,get:function(){return v}});
1
+ const e=require("./rolldown-runtime-BeavJI0R.cjs"),t=require("./dist-Cn_OUKh6.cjs"),r=require("./locales-Dg9XL0yP.cjs"),i=require("./button-CYMsgP3Y.cjs"),c=require("./input-AvqqajGM.cjs"),o=require("./popover-DEGqjF2J.cjs");let s=require("react"),n=e.__toESM(s,1);s=e.__toESM(s);let l=require("react/jsx-runtime"),a=require("lucide-react"),h=require("react-colorful"),x=require("@radix-ui/react-separator");function d(){return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",children:(0,l.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"})})}x=e.__toESM(x,1);var u="undefined"==typeof window;function p(e,t,r=window){const i=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{i.current=t},[t]),(0,n.useEffect)(()=>{if(!r||!r.addEventListener)return;const t=e=>{i.current&&i.current(e)};return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[e,r])}function f(e){const{t:t}=r.useLocale(),{disabled:i=!1,value:c,onChange:s,colors:a=r.COLORS_LIST,highlight:h}=e,[x,f]=(0,n.useState)(!1),v=(0,n.useMemo)(()=>{const e=a,t=[];for(let r=0;r<e.length;r+=10)t.push(e.slice(r,r+10));return t},[a]),[g,j]=function(e,t,r={}){const{initializeWithValue:i=!0}=r,c=(0,n.useCallback)(e=>r.serializer?r.serializer(e):JSON.stringify(e),[r]),o=(0,n.useCallback)(e=>{if(r.deserializer)return r.deserializer(e);if("undefined"===e)return;const i=t instanceof Function?t():t;let c;try{c=JSON.parse(e)}catch(o){return i}return c},[r,t]),s=(0,n.useCallback)(()=>{const r=t instanceof Function?t():t;if(u)return r;try{const t=window.localStorage.getItem(e);return t?o(t):r}catch(i){return r}},[t,e,o]),[l,a]=(0,n.useState)(()=>i?s():t instanceof Function?t():t),h=(0,n.useCallback)(t=>{try{const r=t instanceof Function?t(s()):t;window.localStorage.setItem(e,c(r)),a(r),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))}catch(r){}},[e,c,s]),x=(0,n.useCallback)(()=>{const r=t instanceof Function?t():t;window.localStorage.removeItem(e),a(r),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))},[e,t]);(0,n.useEffect)(()=>{a(s())},[e]);const d=(0,n.useCallback)(t=>{t.key&&t.key!==e||a(s())},[e,s]);return p("storage",d),p("local-storage",d),[l,h,x]}(h?"richtext-recent-highlight":"richtext-recent-colors",[]);function b(e){if(void 0===e)return s?.(e),void f(!1);/^#([\da-f]{3}){1,2}$/i.test(e)&&(s?.(e),(e=>{const t=[...g],r=t.indexOf(e);-1!==r&&t.splice(r,1),t.unshift(e),t.length>10&&t.pop(),j(t)})(e),f(!1))}return(0,l.jsxs)(o.Popover,{modal:!0,onOpenChange:f,open:x,children:[(0,l.jsx)(o.PopoverTrigger,{asChild:!0,className:"!richtext-p-0",disabled:i,children:e?.children}),(0,l.jsx)(o.PopoverContent,{align:"start",className:"richtext-size-full !richtext-p-2",hideWhenDetached:!0,side:"bottom",children:(0,l.jsxs)("div",{className:"richtext-flex richtext-flex-col",children:[(0,l.jsxs)("div",{className:"rd-1 richtext-flex richtext-cursor-pointer richtext-items-center richtext-gap-[4px] richtext-p-1 hover:richtext-bg-accent",onClick:()=>{b(void 0)},children:[(0,l.jsx)(d,{}),(0,l.jsx)("span",{className:"richtext-ml-1 richtext-text-sm",children:t(h?"editor.nofill":"editor.default")})]}),v.map((e,t)=>(0,l.jsx)("span",{className:"richtext-relative richtext-flex richtext-h-auto richtext-w-full richtext-p-0 last:richtext-pb-2",children:e.map((e,t)=>(0,l.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:()=>b(e),children:(0,l.jsx)("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px]",style:{backgroundColor:e},children:e===c?(0,l.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:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})}):(0,l.jsx)("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-${t}`))},`color-row-${t}`)),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"richtext-my-1 richtext-text-sm",children:t("editor.recent")}),(0,l.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?.map((e,t)=>(0,l.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:()=>b(e),children:(0,l.jsx)("span",{className:"richtext-relative richtext-block richtext-size-[18px] richtext-rounded-[2px] richtext-border-transparent",style:{backgroundColor:e},children:(0,l.jsx)("svg",{viewBox:"0 0 18 18",style:{fill:"rgb(255, 255, 255)",display:"none"},children:(0,l.jsx)("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})})},`sub-color-recent-${t}`))})]}),(0,l.jsx)(m,{setColor:b})]})})]})}function m({setColor:e}){const{t:t}=r.useLocale(),[s,x]=(0,n.useState)(!1),[d,u]=(0,n.useState)("#000000"),p=(0,n.useCallback)(e=>{u(e)},[]);return(0,l.jsxs)(o.Popover,{onOpenChange:x,open:s,children:[(0,l.jsx)(o.PopoverTrigger,{asChild:!0,children:(0,l.jsxs)("div",{className:"richtext-p-1.5 richtext-text-sm hover:richtext-cursor-pointer hover:richtext-bg-accent",children:[t("editor.color.more"),"..."]})}),(0,l.jsxs)(o.PopoverContent,{children:[(0,l.jsxs)("div",{className:"richtext-flex richtext-flex-col richtext-items-center richtext-justify-center",children:[(0,l.jsx)(h.HexColorPicker,{color:d,onChange:e=>{p(e)}}),(0,l.jsx)(c.Input,{className:"richtext-mt-[8px] richtext-w-full",type:"text",value:d.replace("#",""),onChange:e=>{e.preventDefault(),e.stopPropagation(),p(`#${e.target.value}`)}})]}),(0,l.jsx)(v,{className:"richtext-my-[10px]"}),(0,l.jsx)(i.Button,{className:"richtext-w-full",onClick:t=>{t.preventDefault(),t.stopPropagation(),e(d),x(!1)},children:(0,l.jsx)(a.Plus,{size:16})})]})]})}var v=n.forwardRef(({className:e,orientation:r="horizontal",decorative:i=!0,...c},o)=>(0,l.jsx)(x.Root,{ref:o,decorative:i,orientation:r,className:t.cn("richtext-shrink-0 richtext-bg-border","horizontal"===r?"richtext-h-[1px] richtext-w-full":"richtext-h-full richtext-w-[1px]",e),...c}));v.displayName=x.Root.displayName,Object.defineProperty(exports,"ColorPicker",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"Separator",{enumerable:!0,get:function(){return v}});