@remarkablejames/editor 0.0.5 → 0.0.6

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 (139) hide show
  1. package/lib/{ActionMenuButton-DBZjUu-F.js → ActionMenuButton-CpmEfz31.js} +1 -1
  2. package/lib/{ActionMenuButton-C6jGtl3k.cjs → ActionMenuButton-NfiUDE60.cjs} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +2 -2
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +1 -1
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +1 -1
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +1 -1
  11. package/lib/Callout.cjs +1 -1
  12. package/lib/Callout.js +15 -16
  13. package/lib/Clear.cjs +1 -1
  14. package/lib/Clear.js +1 -1
  15. package/lib/Code.cjs +1 -1
  16. package/lib/Code.js +1 -1
  17. package/lib/CodeBlock.cjs +1 -1
  18. package/lib/CodeBlock.js +31 -32
  19. package/lib/CodeView.cjs +1 -1
  20. package/lib/CodeView.js +1 -1
  21. package/lib/Color.cjs +1 -1
  22. package/lib/Color.js +2 -2
  23. package/lib/Column.cjs +1 -1
  24. package/lib/Column.js +1 -1
  25. package/lib/{Drawer-DTCwtJEs.js → Drawer-CayP4Ww4.js} +13 -13
  26. package/lib/{Drawer-B031ezmA.cjs → Drawer-DlgdaO_B.cjs} +1 -1
  27. package/lib/Drawer.cjs +1 -1
  28. package/lib/Drawer.js +2 -2
  29. package/lib/Emoji.cjs +1 -1
  30. package/lib/Emoji.js +8 -8
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +36 -36
  33. package/lib/ExportPdf.cjs +1 -1
  34. package/lib/ExportPdf.js +1 -1
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +1 -1
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +3 -3
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +3 -3
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +8 -8
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +2 -2
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +1 -1
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +1 -1
  49. package/lib/{Iframe-D-UYBxiv.js → Iframe-C6Sb97KS.js} +5 -5
  50. package/lib/{Iframe-BUK2pkOL.cjs → Iframe-CANdxSpV.cjs} +1 -1
  51. package/lib/Iframe.cjs +1 -1
  52. package/lib/Iframe.js +2 -2
  53. package/lib/Image.cjs +1 -1
  54. package/lib/Image.js +3 -3
  55. package/lib/ImageGif.cjs +1 -1
  56. package/lib/ImageGif.js +19 -19
  57. package/lib/ImportWord.cjs +1 -1
  58. package/lib/ImportWord.js +12 -12
  59. package/lib/{Indent-Bvt-Qwar.js → Indent-CcFe8py3.js} +1 -1
  60. package/lib/{Indent-_y6N8MIQ.cjs → Indent-DuB2U6Cs.cjs} +1 -1
  61. package/lib/Indent.cjs +1 -1
  62. package/lib/Indent.js +1 -1
  63. package/lib/Italic.cjs +1 -1
  64. package/lib/Italic.js +1 -1
  65. package/lib/{Katex-CJDtvu-v.js → Katex-Bp6AnIUF.js} +3 -4
  66. package/lib/Katex-DFU1unCm.cjs +4 -0
  67. package/lib/Katex.cjs +1 -1
  68. package/lib/Katex.js +1 -1
  69. package/lib/LineHeight.cjs +1 -1
  70. package/lib/LineHeight.js +2 -2
  71. package/lib/Link.cjs +1 -1
  72. package/lib/Link.js +1 -1
  73. package/lib/{LinkEditBlock-Cdqwj_NU.js → LinkEditBlock-BiHumIJR.js} +7 -7
  74. package/lib/{LinkEditBlock-ewTApx0K.cjs → LinkEditBlock-C2zX0WVK.cjs} +1 -1
  75. package/lib/Mermaid-B8lQSOGn.cjs +2 -0
  76. package/lib/{Mermaid-CnMYVX1P.js → Mermaid-Dlx0XTJj.js} +23 -24
  77. package/lib/Mermaid.cjs +1 -1
  78. package/lib/Mermaid.js +1 -1
  79. package/lib/MoreMark.cjs +1 -1
  80. package/lib/MoreMark.js +2 -2
  81. package/lib/OrderedList.cjs +1 -1
  82. package/lib/OrderedList.js +1 -1
  83. package/lib/PaywallSeparator.cjs +1 -0
  84. package/lib/PaywallSeparator.js +140 -0
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +7 -7
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +2 -2
  89. package/lib/SlashCommandNodeView-BfWNWGRr.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-DcoLvt_6.js → SlashCommandNodeView-DzmsYaNc.js} +73 -57
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +1 -1
  93. package/lib/{Table-B8CHl8jK.cjs → Table-BfM6ywrZ.cjs} +1 -1
  94. package/lib/{Table-Cu12PvQ_.js → Table-IH34r4jd.js} +2 -2
  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 +1 -1
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +2 -2
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +2 -2
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +1 -1
  105. package/lib/{Twitter-CrX4XY1j.js → Twitter-FVQKPaq6.js} +7 -7
  106. package/lib/{Twitter-6HYP_upt.cjs → Twitter-axcoCgD7.cjs} +1 -1
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +1 -1
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +3 -3
  111. package/lib/bubble.cjs +3 -3
  112. package/lib/bubble.js +81 -83
  113. package/lib/{dropdown-menu-CVwXaR3Z.js → dropdown-menu-Ce2TorkG.js} +1 -1
  114. package/lib/{dropdown-menu-XIrQk3jr.cjs → dropdown-menu-DirUyRAI.cjs} +1 -1
  115. package/lib/extensions/PaywallSeparator/PaywallSeparator.d.ts +35 -0
  116. package/lib/extensions/PaywallSeparator/components/PaywallIcon.d.ts +2 -0
  117. package/lib/extensions/PaywallSeparator/components/PaywallSeparatorView.d.ts +17 -0
  118. package/lib/extensions/PaywallSeparator/components/RichTextPaywallSeparator.d.ts +1 -0
  119. package/lib/extensions/PaywallSeparator/components/index.d.ts +2 -0
  120. package/lib/extensions/PaywallSeparator/index.d.ts +1 -0
  121. package/lib/index-BynXHtjJ.cjs +28 -0
  122. package/lib/{index-B0d-u29p.js → index-CnKgiZFQ.js} +1201 -1050
  123. package/lib/index.cjs +1 -1
  124. package/lib/index.js +27 -27
  125. package/lib/{popover-0syCfWYi.cjs → popover-BdLwAlrM.cjs} +1 -1
  126. package/lib/{popover-DDT8YRht.js → popover-BzJyaFvy.js} +1 -1
  127. package/lib/{separator-D8lOAf8f.cjs → separator-CoQaQmFK.cjs} +1 -1
  128. package/lib/{separator-DRGTEiX4.js → separator-D-fyzbfx.js} +14 -14
  129. package/lib/style.css +1 -1
  130. package/lib/types.d.ts +5 -5
  131. package/package.json +14 -1
  132. package/lib/Katex-bJXkt-VP.cjs +0 -4
  133. package/lib/Mermaid-Dwz9o-yM.cjs +0 -2
  134. package/lib/SlashCommandNodeView-BMgQJ4xT.cjs +0 -1
  135. package/lib/index-De9MZVWQ.cjs +0 -28
  136. package/lib/select-D9wQw2qB.js +0 -120
  137. package/lib/select-DTNz0ZeE.cjs +0 -1
  138. package/lib/textarea-DfVzbMr5.js +0 -20
  139. package/lib/textarea-DpkwluT0.cjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import { Slot as n } from "@radix-ui/react-slot";
3
3
  import r from "react";
4
- import { i as d, T as m, a as f, B as s, b as u, g } from "./index-B0d-u29p.js";
4
+ import { i as d, T as m, a as f, B as s, b as u, g } from "./index-CnKgiZFQ.js";
5
5
  import "./theme.js";
6
6
  const C = r.forwardRef(
7
7
  ({ asChild: x = !1, tooltip: i, ...t }, l) => {
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-De9MZVWQ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
1
+ "use strict";const e=require("react/jsx-runtime"),a=require("@radix-ui/react-slot"),d=require("react"),c=require("./index-BynXHtjJ.cjs");require("./theme.cjs");const s=d.forwardRef(({asChild:h=!1,tooltip:i,...t},l)=>{var n;const x=c.icons[t.icon],r=h?a.Slot:c.Button;return e.jsxs(c.Tooltip,{children:[e.jsx(c.TooltipTrigger,{asChild:!0,children:e.jsx(r,{className:"richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0","data-state":t!=null&&t.dataState?"on":"off",disabled:t==null?void 0:t.disabled,ref:l,variant:"ghost",...t,children:e.jsxs("div",{className:"richtext-flex richtext-h-full richtext-items-center richtext-font-normal",children:[(t==null?void 0:t.title)&&e.jsx("div",{className:"richtext-grow richtext-truncate richtext-text-left richtext-text-sm",children:t==null?void 0:t.title}),x&&e.jsx(x,{className:"richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500"})]})})}),i&&e.jsx(c.TooltipContent,{children:e.jsxs("div",{className:"richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center",children:[i&&e.jsx("div",{children:i}),e.jsx("div",{className:"richtext-flex",children:!!((n=t==null?void 0:t.shortcutKeys)!=null&&n.length)&&e.jsx("span",{children:c.getShortcutKeys(t==null?void 0:t.shortcutKeys)})})]})})]})});exports.ActionMenuButton=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-De9MZVWQ.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");exports.Attachment=e.Attachment;exports.RichTextAttachment=e.RichTextAttachment;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./clsx-CXbNJWDD.cjs");const e=require("./index-BynXHtjJ.cjs");require("react/jsx-runtime");require("react");require("./theme.cjs");exports.Attachment=e.Attachment;exports.RichTextAttachment=e.RichTextAttachment;
package/lib/Attachment.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import "./clsx-BUPZHhq3.js";
2
- import { X as a, Y as e } from "./index-B0d-u29p.js";
2
+ import { a2 as p, a3 as e } from "./index-CnKgiZFQ.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  export {
7
- a as Attachment,
7
+ p as Attachment,
8
8
  e as RichTextAttachment
9
9
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-De9MZVWQ.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,g=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./clsx-CXbNJWDD.cjs"),p=require("./jsx-runtime-C_NLcKys.cjs"),l=require("react/jsx-runtime"),a=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var m=/^\s*>\s$/,g=c.Node3.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return p.h("blockquote",{...c.mergeAttributes(this.options.HTMLAttributes,t),children:p.h("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const o=">",n=[];return t.content.forEach(i=>{const u=e.renderChildren([i]).split(`
2
2
  `).map(r=>r.trim()===""?o:`${o} ${r}`);n.push(u.join(`
3
3
  `))}),n.join(`
4
4
  ${o}
package/lib/Blockquote.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { N as m, w as h, m as k } from "./clsx-BUPZHhq3.js";
2
2
  import { h as a } from "./jsx-runtime-CT7Pcg-t.js";
3
3
  import { jsx as d, Fragment as g } from "react/jsx-runtime";
4
- import { u as f, d as b, A as q } from "./index-B0d-u29p.js";
4
+ import { u as f, d as b, A as q } from "./index-CnKgiZFQ.js";
5
5
  import "react";
6
6
  import "./theme.js";
7
7
  var v = /^\s*>\s$/, B = m.create({
package/lib/Bold.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-De9MZVWQ.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),u=require("./jsx-runtime-C_NLcKys.cjs"),r=require("./index-BynXHtjJ.cjs"),i=require("react/jsx-runtime");require("react");require("./theme.cjs");var y=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,_=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,B=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,v=o.Mark.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return u.h("strong",{...o.mergeAttributes(this.options.HTMLAttributes,t),children:u.h("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[o.markInputRule({find:y,type:this.type}),o.markInputRule({find:B,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:_,type:this.type}),o.markPasteRule({find:k,type:this.type})]}});function M(){const t=r.useButtonProps(l.name),{icon:e=void 0,tooltip:n=void 0,shortcutKeys:s=void 0,tooltipOptions:c={},action:a=void 0,isActive:p=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:g,disabled:d,update:m}=r.useToggleActive(p),h=()=>{d||a&&(a(),m())};return t?i.jsx(r.ActionButton,{action:h,dataState:g,disabled:d,icon:e,shortcutKeys:s,tooltip:n,tooltipOptions:c}):i.jsx(i.Fragment,{})}const l=v.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n,extension:s})=>({component:r.ActionButton,componentProps:{action:()=>e.commands.toggleBold(),isActive:()=>e.isActive("bold"),icon:"Bold",shortcutKeys:s.options.shortcutKeys??["mod","B"],tooltip:n("editor.bold.tooltip")}})}}});exports.Bold=l;exports.RichTextBold=M;
package/lib/Bold.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { M as _, e as a, f as i, m as y } from "./clsx-BUPZHhq3.js";
2
2
  import { h as d } from "./jsx-runtime-CT7Pcg-t.js";
3
- import { u as f, d as M, A as l } from "./index-B0d-u29p.js";
3
+ import { u as f, d as M, A as l } from "./index-CnKgiZFQ.js";
4
4
  import { jsx as u, Fragment as v } from "react/jsx-runtime";
5
5
  import "react";
6
6
  import "./theme.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-De9MZVWQ.cjs");require("react");require("./theme.cjs");function h(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-BCzvbrf5.cjs"),s=require("react/jsx-runtime"),n=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function h(){const t=n.useButtonProps(l.name),{icon:e=void 0,tooltip:i=void 0,shortcutKeys:o=void 0,tooltipOptions:r={},action:c=void 0,isActive:d=void 0}=(t==null?void 0:t.componentProps)??{},{dataState:a,disabled:u,update:p}=n.useToggleActive(d),m=()=>{u||c&&(c(),p())};return t?s.jsx(n.ActionButton,{action:m,dataState:a,disabled:u,icon:e,shortcutKeys:o,tooltip:i,tooltipOptions:r}):s.jsx(s.Fragment,{})}const l=v.BulletList.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:i,extension:o})=>({componentProps:{action:()=>e.commands.toggleBulletList(),isActive:()=>e.isActive("bulletList"),disabled:!1,shortcutKeys:o.options.shortcutKeys??["shift","mod","8"],icon:"List",tooltip:i("editor.bulletlist.tooltip")}})}}});exports.BulletList=l;exports.RichTextBulletList=h;
package/lib/BulletList.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { B as d } from "./index-DZj2z9_1.js";
2
2
  import { jsx as c, Fragment as m } from "react/jsx-runtime";
3
- import { u as f, d as v, A } from "./index-B0d-u29p.js";
3
+ import { u as f, d as v, A } from "./index-CnKgiZFQ.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  function y() {
package/lib/Callout.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),o=require("./index-De9MZVWQ.cjs"),t=require("react/jsx-runtime"),x=require("react");require("./theme.cjs");const c=require("lucide-react"),s=require("./select-DTNz0ZeE.cjs"),k=require("./index-DgOXAdKt.cjs"),j=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function q({node:e}){const{type:l="note",title:r="",body:u=""}=e.attrs,d=(j.find(h=>h.value===l)||j[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":l==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":l==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":l==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":l==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":l==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":l==="note","richtext-text-[#238636]":l==="tip","richtext-text-[#ab7df8]":l==="important","richtext-text-[#d29922]":l==="warning","richtext-text-[#f85149]":l==="caution"}),children:[t.jsx(d,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:r})]}),u&&t.jsx("p",{className:"richtext-pl-[28px]",children:u})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:e}=k.useLocale(),l=o.useEditorInstance(),r=o.useButtonProps(C.name),[u,n]=x.useState(!1),[d,h]=x.useState("note"),[b,g]=x.useState(""),[f,v]=x.useState(""),{icon:y=void 0,tooltip:T=void 0,shortcutKeys:A=void 0,tooltipOptions:L={},isActive:N=void 0}=(r==null?void 0:r.componentProps)??{},{dataState:S,disabled:m}=o.useToggleActive(N),I=()=>{l&&(l.chain().focus().setCallout({type:d,title:b,body:f}).run(),n(!1),h("note"),g(""),v(""))},O=()=>{m||n(!0)};return r?t.jsxs(o.Dialog,{onOpenChange:n,open:u,children:[t.jsx(o.DialogTrigger,{asChild:!0,children:t.jsx(o.ActionButton,{action:O,dataState:S,disabled:m,icon:y,shortcutKeys:A,tooltip:T,tooltipOptions:L})}),t.jsxs(o.DialogContent,{children:[t.jsx(o.DialogTitle,{children:e("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.type")}),t.jsxs(s.Select,{onValueChange:h,value:d,children:[t.jsx(s.SelectTrigger,{children:t.jsx(s.SelectValue,{placeholder:e("editor.callout.dialog.type.placeholder")})}),t.jsx(s.SelectContent,{children:w.map(i=>t.jsx(s.SelectItem,{value:i.value,children:e(`editor.callout.type.${i.value}`)},i.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.title.label")}),t.jsx(o.Input,{onChange:i=>g(i.target.value),placeholder:e("editor.callout.dialog.title.placeholder"),value:b})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(o.Label,{children:e("editor.callout.dialog.body.label")}),t.jsx(o.Input,{onChange:i=>v(i.target.value),placeholder:e("editor.callout.dialog.body.placeholder"),value:f})]})]}),t.jsxs(o.DialogFooter,{children:[t.jsx(o.Button,{onClick:()=>n(!1),variant:"outline",children:e("editor.callout.dialog.button.cancel")}),t.jsx(o.Button,{onClick:I,children:e("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function p(e){return l=>l.getAttribute(e)}const C=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"callout"},button:({editor:l,t:r})=>({component:o.ActionButton,componentProps:{action:()=>!0,isActive:()=>l.isActive("callout"),disabled:!1,icon:"Callout",tooltip:r("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:e}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},e)]},addAttributes(){return{type:{default:"",parseHTML:p("type")},title:{default:"",parseHTML:p("title")},body:{default:"",parseHTML:p("body")}}},addCommands(){return{setCallout:e=>({chain:l})=>l().insertContent({type:this.name,attrs:e}).run()}},addNodeView(){return a.ReactNodeViewRenderer(q)}});exports.Callout=C;exports.RichTextCallout=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./clsx-CXbNJWDD.cjs"),e=require("./index-BynXHtjJ.cjs"),t=require("react/jsx-runtime"),h=require("react");require("./theme.cjs");const c=require("lucide-react"),O=require("./index-DgOXAdKt.cjs"),m=[{value:"note",label:"Note",icon:c.Info,color:"#1f6feb",background:"#1f6feb1f"},{value:"tip",label:"Tip",icon:c.Lightbulb,color:"#238636",background:"#2386361f"},{value:"important",label:"Important",icon:c.AlertCircle,color:"#ab7df8",background:"#ab7df81f"},{value:"warning",label:"Warning",icon:c.TriangleAlert,color:"#d29922",background:"#d299221f"},{value:"caution",label:"Caution",icon:c.OctagonAlert,color:"#f85149",background:"#f851491f"}];function k({node:l}){const{type:o="note",title:i="",body:s=""}=l.attrs,u=(m.find(d=>d.value===o)||m[0]).icon;return t.jsx(a.NodeViewWrapper,{children:t.jsxs("div",{className:a.clsx("richtext-relative richtext-my-4 richtext-rounded-lg richtext-border richtext-p-4",{"richtext-bg-[#1f6feb1f] richtext-border-[#1f6feb]":o==="note","richtext-bg-[#2386361f] richtext-border-[#238636]":o==="tip","richtext-bg-[#ab7df81f] richtext-border-[#ab7df8]":o==="important","richtext-bg-[#d299221f] richtext-border-[#d29922]":o==="warning","richtext-bg-[#f851491f] richtext-border-[#f85149]":o==="caution"}),children:[t.jsxs("div",{className:a.clsx("richtext-mb-2 richtext-flex richtext-items-center richtext-gap-2",{"richtext-text-[#1f6feb]":o==="note","richtext-text-[#238636]":o==="tip","richtext-text-[#ab7df8]":o==="important","richtext-text-[#d29922]":o==="warning","richtext-text-[#f85149]":o==="caution"}),children:[t.jsx(u,{className:"richtext-size-5"}),t.jsx("span",{className:"richtext-font-semibold",children:i})]}),s&&t.jsx("p",{className:"richtext-pl-[28px]",children:s})]})})}const w=[{value:"note",label:"Note",icon:"Info"},{value:"tip",label:"Tip",icon:"Lightbulb"},{value:"important",label:"Important",icon:"AlertCircle"},{value:"warning",label:"Warning",icon:"TriangleAlert"},{value:"caution",label:"Caution",icon:"OctagonAlert"}];function M(){const{t:l}=O.useLocale(),o=e.useEditorInstance(),i=e.useButtonProps(j.name),[s,n]=h.useState(!1),[u,d]=h.useState("note"),[p,b]=h.useState(""),[g,f]=h.useState(""),{icon:C=void 0,tooltip:y=void 0,shortcutKeys:T=void 0,tooltipOptions:A={},isActive:L=void 0}=(i==null?void 0:i.componentProps)??{},{dataState:N,disabled:v}=e.useToggleActive(L),S=()=>{o&&(o.chain().focus().setCallout({type:u,title:p,body:g}).run(),n(!1),d("note"),b(""),f(""))},I=()=>{v||n(!0)};return i?t.jsxs(e.Dialog,{onOpenChange:n,open:s,children:[t.jsx(e.DialogTrigger,{asChild:!0,children:t.jsx(e.ActionButton,{action:I,dataState:N,disabled:v,icon:C,shortcutKeys:T,tooltip:y,tooltipOptions:A})}),t.jsxs(e.DialogContent,{children:[t.jsx(e.DialogTitle,{children:l("editor.callout.dialog.title")}),t.jsxs("div",{className:"richtext-space-y-4 richtext-py-4",children:[t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.type")}),t.jsxs(e.Select,{onValueChange:d,value:u,children:[t.jsx(e.SelectTrigger,{children:t.jsx(e.SelectValue,{placeholder:l("editor.callout.dialog.type.placeholder")})}),t.jsx(e.SelectContent,{children:w.map(r=>t.jsx(e.SelectItem,{value:r.value,children:l(`editor.callout.type.${r.value}`)},r.value))})]})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.title.label")}),t.jsx(e.Input,{onChange:r=>b(r.target.value),placeholder:l("editor.callout.dialog.title.placeholder"),value:p})]}),t.jsxs("div",{className:"richtext-space-y-2",children:[t.jsx(e.Label,{children:l("editor.callout.dialog.body.label")}),t.jsx(e.Input,{onChange:r=>f(r.target.value),placeholder:l("editor.callout.dialog.body.placeholder"),value:g})]})]}),t.jsxs(e.DialogFooter,{children:[t.jsx(e.Button,{onClick:()=>n(!1),variant:"outline",children:l("editor.callout.dialog.button.cancel")}),t.jsx(e.Button,{onClick:S,children:l("editor.callout.dialog.button.apply")})]})]})]}):t.jsx(t.Fragment,{})}function x(l){return o=>o.getAttribute(l)}const j=a.Node3.create({name:"callout",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addOptions(){var l;return{...(l=this.parent)==null?void 0:l.call(this),HTMLAttributes:{class:"callout"},button:({editor:o,t:i})=>({component:e.ActionButton,componentProps:{action:()=>!0,isActive:()=>o.isActive("callout"),disabled:!1,icon:"Callout",tooltip:i("editor.callout.tooltip")}})}},parseHTML(){return[{tag:"div.callout"}]},renderHTML({HTMLAttributes:l}){return["div",a.mergeAttributes(this.options&&this.options.HTMLAttributes||{},l)]},addAttributes(){return{type:{default:"",parseHTML:x("type")},title:{default:"",parseHTML:x("title")},body:{default:"",parseHTML:x("body")}}},addCommands(){return{setCallout:l=>({chain:o})=>o().insertContent({type:this.name,attrs:l}).run()}},addNodeView(){return a.ReactNodeViewRenderer(k)}});exports.Callout=j;exports.RichTextCallout=M;
package/lib/Callout.js CHANGED
@@ -1,44 +1,43 @@
1
1
  import { h as D, j as x, N as H, k as M, m as B } from "./clsx-BUPZHhq3.js";
2
- import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, j as v, p as U, B as C } from "./index-B0d-u29p.js";
3
- import { jsx as o, jsxs as l, Fragment as Y } from "react/jsx-runtime";
2
+ import { h as V, u as j, d as P, D as E, m as R, A as T, n as W, o as F, L as u, S as U, p as Y, q as _, r as $, s as q, j as v, t as z, B as C } from "./index-CnKgiZFQ.js";
3
+ import { jsx as o, jsxs as l, Fragment as K } from "react/jsx-runtime";
4
4
  import { useState as s } from "react";
5
5
  import "./theme.js";
6
- import { Info as _, Lightbulb as $, AlertCircle as z, TriangleAlert as K, OctagonAlert as q } from "lucide-react";
7
- import { S as G, a as J, b as Q, c as X, d as Z } from "./select-D9wQw2qB.js";
6
+ import { Info as G, Lightbulb as J, AlertCircle as Q, TriangleAlert as X, OctagonAlert as Z } from "lucide-react";
8
7
  import { u as tt } from "./index-BGd2HiwP.js";
9
8
  const y = [
10
9
  {
11
10
  value: "note",
12
11
  label: "Note",
13
- icon: _,
12
+ icon: G,
14
13
  color: "#1f6feb",
15
14
  background: "#1f6feb1f"
16
15
  },
17
16
  {
18
17
  value: "tip",
19
18
  label: "Tip",
20
- icon: $,
19
+ icon: J,
21
20
  color: "#238636",
22
21
  background: "#2386361f"
23
22
  },
24
23
  {
25
24
  value: "important",
26
25
  label: "Important",
27
- icon: z,
26
+ icon: Q,
28
27
  color: "#ab7df8",
29
28
  background: "#ab7df81f"
30
29
  },
31
30
  {
32
31
  value: "warning",
33
32
  label: "Warning",
34
- icon: K,
33
+ icon: X,
35
34
  color: "#d29922",
36
35
  background: "#d299221f"
37
36
  },
38
37
  {
39
38
  value: "caution",
40
39
  label: "Caution",
41
- icon: q,
40
+ icon: Z,
42
41
  color: "#f85149",
43
42
  background: "#f851491f"
44
43
  }
@@ -87,7 +86,7 @@ const ot = [
87
86
  { value: "warning", label: "Warning", icon: "TriangleAlert" },
88
87
  { value: "caution", label: "Caution", icon: "OctagonAlert" }
89
88
  ];
90
- function ht() {
89
+ function ut() {
91
90
  const { t } = tt(), e = V(), a = j(lt.name), [n, i] = s(!1), [c, d] = s("note"), [p, b] = s(""), [g, f] = s(""), {
92
91
  icon: A = void 0,
93
92
  tooltip: N = void 0,
@@ -117,9 +116,9 @@ function ht() {
117
116
  /* @__PURE__ */ l("div", { className: "richtext-space-y-4 richtext-py-4", children: [
118
117
  /* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
119
118
  /* @__PURE__ */ o(u, { children: t("editor.callout.dialog.type") }),
120
- /* @__PURE__ */ l(G, { onValueChange: d, value: c, children: [
121
- /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(Q, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
122
- /* @__PURE__ */ o(X, { children: ot.map((r) => /* @__PURE__ */ o(Z, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
119
+ /* @__PURE__ */ l(U, { onValueChange: d, value: c, children: [
120
+ /* @__PURE__ */ o(Y, { children: /* @__PURE__ */ o(_, { placeholder: t("editor.callout.dialog.type.placeholder") }) }),
121
+ /* @__PURE__ */ o($, { children: ot.map((r) => /* @__PURE__ */ o(q, { value: r.value, children: t(`editor.callout.type.${r.value}`) }, r.value)) })
123
122
  ] })
124
123
  ] }),
125
124
  /* @__PURE__ */ l("div", { className: "richtext-space-y-2", children: [
@@ -145,12 +144,12 @@ function ht() {
145
144
  )
146
145
  ] })
147
146
  ] }),
148
- /* @__PURE__ */ l(U, { children: [
147
+ /* @__PURE__ */ l(z, { children: [
149
148
  /* @__PURE__ */ o(C, { onClick: () => i(!1), variant: "outline", children: t("editor.callout.dialog.button.cancel") }),
150
149
  /* @__PURE__ */ o(C, { onClick: w, children: t("editor.callout.dialog.button.apply") })
151
150
  ] })
152
151
  ] })
153
- ] }) : /* @__PURE__ */ o(Y, {});
152
+ ] }) : /* @__PURE__ */ o(K, {});
154
153
  }
155
154
  function h(t) {
156
155
  return (e) => e.getAttribute(t);
@@ -221,5 +220,5 @@ const lt = /* @__PURE__ */ H.create({
221
220
  });
222
221
  export {
223
222
  lt as Callout,
224
- ht as RichTextCallout
223
+ ut as RichTextCallout
225
224
  };
package/lib/Clear.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-De9MZVWQ.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:c=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=i.useActive(l),d=()=>{r||c&&c()};return t?n.jsx(i.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),i=require("./index-BynXHtjJ.cjs");function v(){const t=i.useButtonProps(s.name),{icon:e=void 0,tooltip:o=void 0,shortcutKeys:a=void 0,tooltipOptions:u={},action:c=void 0,isActive:l=void 0}=(t==null?void 0:t.componentProps)??{},{disabled:r}=i.useActive(l),d=()=>{r||c&&c()};return t?n.jsx(i.ActionButton,{action:d,disabled:r,icon:e,shortcutKeys:a,tooltip:o,tooltipOptions:u}):n.jsx(n.Fragment,{})}const s=p.Node3.create({name:"clear",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:o})=>({componentProps:{action:()=>e.chain().focus().clearNodes().unsetAllMarks().run(),isActive:()=>e.can().chain().focus().clearNodes().unsetAllMarks().run(),icon:"Eraser",tooltip:o("editor.clear.tooltip")}})}}});exports.Clear=s;exports.RichTextClear=v;
package/lib/Clear.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { N as l } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as r, Fragment as p } from "react/jsx-runtime";
3
- import { u as d, e as m, A as f } from "./index-B0d-u29p.js";
3
+ import { u as d, e as m, A as f } from "./index-CnKgiZFQ.js";
4
4
  function x() {
5
5
  const o = d(v.name), {
6
6
  icon: t = void 0,
package/lib/Code.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-De9MZVWQ.cjs");require("react");require("./theme.cjs");var h=/(^|[^`])`([^`]+)`(?!`)$/,x=/(^|[^`])`([^`]+)`(?!`)/g,C=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:x,type:this.type})]}});function v(){const e=s.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=s.useToggleActive(p),g=()=>{a||d&&(d(),m())};return e?i.jsx(s.ActionButton,{action:g,dataState:l,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./clsx-CXbNJWDD.cjs"),i=require("react/jsx-runtime"),s=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");var h=/(^|[^`])`([^`]+)`(?!`)$/,x=/(^|[^`])`([^`]+)`(?!`)/g,C=o.Mark.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",o.mergeAttributes(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[o.markInputRule({find:h,type:this.type})]},addPasteRules(){return[o.markPasteRule({find:x,type:this.type})]}});function v(){const e=s.useButtonProps(u.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:d=void 0,isActive:p=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:a,update:m}=s.useToggleActive(p),g=()=>{a||d&&(d(),m())};return e?i.jsx(s.ActionButton,{action:g,dataState:l,disabled:a,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):i.jsx(i.Fragment,{})}const u=C.extend({addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r,extension:n})=>({componentProps:{action:()=>t.commands.toggleCode(),isActive:()=>t.isActive("code"),disabled:!t.can().toggleCode(),icon:"Code",shortcutKeys:n.options.shortcutKeys??["mod","E"],tooltip:r("editor.code.tooltip")}})}}});exports.Code=u;exports.RichTextCode=v;
package/lib/Code.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { M as m, e as l, f as g, m as h } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as a, Fragment as M } from "react/jsx-runtime";
3
- import { u as v, d as C, A as f } from "./index-B0d-u29p.js";
3
+ import { u as v, d as C, A as f } from "./index-CnKgiZFQ.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  var k = /(^|[^`])`([^`]+)`(?!`)$/, x = /(^|[^`])`([^`]+)`(?!`)/g, y = m.create({
package/lib/CodeBlock.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./clsx-CXbNJWDD.cjs"),r=require("react/jsx-runtime"),u=require("./index-De9MZVWQ.cjs"),x=require("react");require("./theme.cjs");const S=require("prism-code-editor-lightweight"),p=require("prism-code-editor-lightweight/commands"),T=require("prism-code-editor-lightweight/cursor"),I=require("prism-code-editor-lightweight/guides"),B=require("prism-code-editor-lightweight/highlight-brackets"),R=require("prism-code-editor-lightweight/match-brackets"),E=require("prism-code-editor-lightweight/match-tags"),s=require("./select-DTNz0ZeE.cjs"),z=require("./delete-node-CosiBes5.cjs");require("prism-code-editor-lightweight/prism/languages/bash");require("prism-code-editor-lightweight/prism/languages/css");require("prism-code-editor-lightweight/prism/languages/css-extras");require("prism-code-editor-lightweight/prism/languages/ini");require("prism-code-editor-lightweight/prism/languages/kotlin");require("prism-code-editor-lightweight/prism/languages/xml");require("prism-code-editor-lightweight/prism/languages/markup");require("prism-code-editor-lightweight/prism/languages/r");require("prism-code-editor-lightweight/prism/languages/basic");require("prism-code-editor-lightweight/prism/languages/vbnet");require("prism-code-editor-lightweight/prism/languages/c");require("prism-code-editor-lightweight/prism/languages/opencl");require("prism-code-editor-lightweight/prism/languages/diff");require("prism-code-editor-lightweight/prism/languages/java");require("prism-code-editor-lightweight/prism/languages/less");require("prism-code-editor-lightweight/prism/languages/objectivec");require("prism-code-editor-lightweight/prism/languages/ruby");require("prism-code-editor-lightweight/prism/languages/sql");require("prism-code-editor-lightweight/prism/languages/wasm");require("prism-code-editor-lightweight/prism/languages/cpp");require("prism-code-editor-lightweight/prism/languages/go");require("prism-code-editor-lightweight/prism/languages/javascript");require("prism-code-editor-lightweight/prism/languages/js-templates");require("prism-code-editor-lightweight/prism/languages/jsx");require("prism-code-editor-lightweight/prism/languages/lua");require("prism-code-editor-lightweight/prism/languages/perl");require("prism-code-editor-lightweight/prism/languages/python");require("prism-code-editor-lightweight/prism/languages/rust");require("prism-code-editor-lightweight/prism/languages/swift");require("prism-code-editor-lightweight/prism/languages/clike");require("prism-code-editor-lightweight/prism/languages/csharp");require("prism-code-editor-lightweight/prism/languages/graphql");require("prism-code-editor-lightweight/prism/languages/json");require("prism-code-editor-lightweight/prism/languages/makefile");require("prism-code-editor-lightweight/prism/languages/scss");require("prism-code-editor-lightweight/prism/languages/typescript");require("prism-code-editor-lightweight/prism/languages/tsx");require("prism-code-editor-lightweight/prism/languages/yaml");require("prism-code-editor-lightweight/prism/languages/regex");require("prism-code-editor-lightweight/prism/languages/php");require("prism-code-editor-lightweight/prism/languages/markdown");function L(){const e=u.useButtonProps(C.name),{icon:a=void 0,tooltip:n=void 0,tooltipOptions:h={},action:c=void 0,isActive:m=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:o,disabled:b,update:v}=u.useToggleActive(m),f=()=>{b||c&&(c(),v())};return e?r.jsx(u.ActionButton,{action:f,dataState:o,disabled:b,icon:a,tooltip:n,tooltipOptions:h}):r.jsx(r.Fragment,{})}const M="_wrap_1x3wi_1",W="_blockInfoEditable_1x3wi_30",N={wrap:M,blockInfoEditable:W},g=[{value:"plaintext",label:"plaintext"},{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"cpp",label:"C++"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"sql",label:"SQL"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"bash",label:"Bash"},{value:"php",label:"PHP"}],q=[2,4,8];function H(e){const a=u.useEditableEditor(),n=x.useRef(null),h=x.useCallback(()=>z.deleteNode(C.name,e==null?void 0:e.editor),[e==null?void 0:e.editor]),c=x.useRef(null),m=e.node.attrs.code||e.node.textContent||"",o=x.useCallback(t=>{t==null||t.stopPropagation(),setTimeout(()=>{var i,d,j;(j=(d=(i=c.current)==null?void 0:i.textarea)==null?void 0:d.focus)==null||j.call(d)},0)},[]),b=async()=>{if(m)try{if(navigator.clipboard)await navigator.clipboard.writeText(m);else{const t=document.createElement("textarea");t.value=m,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}catch(t){console.error("Error:",t)}finally{o()}},v=()=>{e.updateAttributes({lineNumbers:!e.node.attrs.lineNumbers}),o()},f=()=>{e.updateAttributes({wordWrap:!e.node.attrs.wordWrap}),o()},k=t=>{const i={...t};return i.language&&!g.some(d=>d.value===i.language)&&(i.language="plaintext",e.updateAttributes({language:"plaintext"})),i},w=x.useCallback(t=>{o(t)},[o]);return x.useEffect(()=>{if(n.current){const t=k(e.node.attrs);c.current=S.createEditor(n.current,{readOnly:!a,language:t.language||"plaintext",tabSize:t.tabSize??2,lineNumbers:t.lineNumbers??!0,wordWrap:t.wordWrap??!1,value:m,rtl:!1,onUpdate(i){queueMicrotask(()=>{e.updateAttributes({code:i})})}}),c.current.addExtensions(R.matchBrackets(),E.matchTags(),I.indentGuides(),B.highlightBracketPairs(),T.cursorPosition(),p.defaultCommands(),p.editHistory()),e.node.attrs.shouldFocus&&setTimeout(()=>{o(),e.updateAttributes({shouldFocus:!1})},0)}return()=>{var t,i;(t=c.current)!=null&&t.remove&&((i=c.current)==null||i.remove())}},[n]),x.useEffect(()=>{var t,i;if((t=c.current)!=null&&t.setOptions){const d=k(e.node.attrs);(i=c.current)==null||i.setOptions(d)}},[c,e.node.attrs]),r.jsx(l.NodeViewWrapper,{className:l.clsx(N.wrap,"render-wrapper"),children:r.jsx("div",{onClick:w,ref:n,className:l.clsx("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block !richtext-my-[10px]",{[N.blockInfoEditable]:!a}),children:r.jsxs("div",{className:"richtext-code-block-toolbar",children:[r.jsx("div",{children:r.jsxs(s.Select,{defaultValue:e.node.attrs.language,disabled:!a,onValueChange:t=>{e.updateAttributes({language:t}),o()},children:[r.jsx(s.SelectTrigger,{className:"richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(s.SelectValue,{placeholder:"Select language"})}),r.jsx(s.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:g==null?void 0:g.map(t=>r.jsx(s.SelectItem,{value:t.value,children:t.label},t.value))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:b,children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"Copy"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:v,className:l.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.lineNumbers}),children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"List"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:f,className:l.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.wordWrap}),children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"WrapText"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{children:r.jsxs(s.Select,{defaultValue:e.node.attrs.tabSize,disabled:!a,onValueChange:t=>{e.updateAttributes({tabSize:t}),o()},children:[r.jsx(s.SelectTrigger,{className:"richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"IndentIncrease"})}),r.jsx(s.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:q==null?void 0:q.map(t=>r.jsx(s.SelectItem,{value:t,children:t},t))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:h,children:r.jsx(u.IconComponent,{className:"richtext-size-4",name:"Trash2"})})]})})})}const y=/^`{3}([a-z]+)?\s$/,A=/^~{3}([a-z]+)?\s$/,C=l.Node3.create({name:"codeBlock",group:"block",atom:!0,content:"text*",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),languages:[],button:({editor:a,t:n})=>({componentProps:{action:()=>a.commands.setCodeBlock({}),isActive:()=>a.isActive("codeBlock"),disabled:!1,icon:"Code2",tooltip:n("editor.codeblock.tooltip")}})}},addAttributes(){return{code:{default:"",parseHTML:e=>e.textContent||""},language:{default:"plaintext"},lineNumbers:{default:!0},wordWrap:{default:!1},tabSize:{default:2},shouldFocus:{default:!0,parseHTML:()=>!1,renderHTML:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})},{tag:"pre code",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})}]},renderHTML({HTMLAttributes:e,node:a}){var h;const n=a.attrs.code||((h=a.content.firstChild)==null?void 0:h.text)||"";return["pre",l.mergeAttributes(this.options.HTMLAttributes,e),["code",{},n]]},addNodeView(){return l.ReactNodeViewRenderer(H)},addCommands(){return{setCodeBlock:e=>({commands:a})=>a.insertContent({type:this.name,attrs:{...e,shouldFocus:!0}})}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.setCodeBlock({})}},addInputRules(){return[l.textblockTypeInputRule({find:y,type:this.type,getAttributes:e=>({language:e[1]})}),l.textblockTypeInputRule({find:A,type:this.type,getAttributes:e=>({language:e[1]})})]}});exports.CodeBlock=C;exports.RichTextCodeBlock=L;exports.backtickInputRegex=y;exports.tildeInputRegex=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./clsx-CXbNJWDD.cjs"),r=require("react/jsx-runtime"),i=require("./index-BynXHtjJ.cjs"),d=require("react");require("./theme.cjs");const w=require("prism-code-editor-lightweight"),j=require("prism-code-editor-lightweight/commands"),S=require("prism-code-editor-lightweight/cursor"),T=require("prism-code-editor-lightweight/guides"),I=require("prism-code-editor-lightweight/highlight-brackets"),B=require("prism-code-editor-lightweight/match-brackets"),R=require("prism-code-editor-lightweight/match-tags"),E=require("./delete-node-CosiBes5.cjs");require("prism-code-editor-lightweight/prism/languages/bash");require("prism-code-editor-lightweight/prism/languages/css");require("prism-code-editor-lightweight/prism/languages/css-extras");require("prism-code-editor-lightweight/prism/languages/ini");require("prism-code-editor-lightweight/prism/languages/kotlin");require("prism-code-editor-lightweight/prism/languages/xml");require("prism-code-editor-lightweight/prism/languages/markup");require("prism-code-editor-lightweight/prism/languages/r");require("prism-code-editor-lightweight/prism/languages/basic");require("prism-code-editor-lightweight/prism/languages/vbnet");require("prism-code-editor-lightweight/prism/languages/c");require("prism-code-editor-lightweight/prism/languages/opencl");require("prism-code-editor-lightweight/prism/languages/diff");require("prism-code-editor-lightweight/prism/languages/java");require("prism-code-editor-lightweight/prism/languages/less");require("prism-code-editor-lightweight/prism/languages/objectivec");require("prism-code-editor-lightweight/prism/languages/ruby");require("prism-code-editor-lightweight/prism/languages/sql");require("prism-code-editor-lightweight/prism/languages/wasm");require("prism-code-editor-lightweight/prism/languages/cpp");require("prism-code-editor-lightweight/prism/languages/go");require("prism-code-editor-lightweight/prism/languages/javascript");require("prism-code-editor-lightweight/prism/languages/js-templates");require("prism-code-editor-lightweight/prism/languages/jsx");require("prism-code-editor-lightweight/prism/languages/lua");require("prism-code-editor-lightweight/prism/languages/perl");require("prism-code-editor-lightweight/prism/languages/python");require("prism-code-editor-lightweight/prism/languages/rust");require("prism-code-editor-lightweight/prism/languages/swift");require("prism-code-editor-lightweight/prism/languages/clike");require("prism-code-editor-lightweight/prism/languages/csharp");require("prism-code-editor-lightweight/prism/languages/graphql");require("prism-code-editor-lightweight/prism/languages/json");require("prism-code-editor-lightweight/prism/languages/makefile");require("prism-code-editor-lightweight/prism/languages/scss");require("prism-code-editor-lightweight/prism/languages/typescript");require("prism-code-editor-lightweight/prism/languages/tsx");require("prism-code-editor-lightweight/prism/languages/yaml");require("prism-code-editor-lightweight/prism/languages/regex");require("prism-code-editor-lightweight/prism/languages/php");require("prism-code-editor-lightweight/prism/languages/markdown");function z(){const e=i.useButtonProps(q.name),{icon:c=void 0,tooltip:o=void 0,tooltipOptions:x={},action:n=void 0,isActive:h=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:l,disabled:m,update:g}=i.useToggleActive(h),v=()=>{m||n&&(n(),g())};return e?r.jsx(i.ActionButton,{action:v,dataState:l,disabled:m,icon:c,tooltip:o,tooltipOptions:x}):r.jsx(r.Fragment,{})}const L="_wrap_1x3wi_1",M="_blockInfoEditable_1x3wi_30",p={wrap:L,blockInfoEditable:M},b=[{value:"plaintext",label:"plaintext"},{value:"javascript",label:"JavaScript"},{value:"typescript",label:"TypeScript"},{value:"html",label:"HTML"},{value:"css",label:"CSS"},{value:"python",label:"Python"},{value:"java",label:"Java"},{value:"cpp",label:"C++"},{value:"go",label:"Go"},{value:"rust",label:"Rust"},{value:"sql",label:"SQL"},{value:"json",label:"JSON"},{value:"yaml",label:"YAML"},{value:"markdown",label:"Markdown"},{value:"bash",label:"Bash"},{value:"php",label:"PHP"}],f=[2,4,8];function W(e){const c=i.useEditableEditor(),o=d.useRef(null),x=d.useCallback(()=>E.deleteNode(q.name,e==null?void 0:e.editor),[e==null?void 0:e.editor]),n=d.useRef(null),h=e.node.attrs.code||e.node.textContent||"",l=d.useCallback(t=>{t==null||t.stopPropagation(),setTimeout(()=>{var a,u,k;(k=(u=(a=n.current)==null?void 0:a.textarea)==null?void 0:u.focus)==null||k.call(u)},0)},[]),m=async()=>{if(h)try{if(navigator.clipboard)await navigator.clipboard.writeText(h);else{const t=document.createElement("textarea");t.value=h,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}catch(t){console.error("Error:",t)}finally{l()}},g=()=>{e.updateAttributes({lineNumbers:!e.node.attrs.lineNumbers}),l()},v=()=>{e.updateAttributes({wordWrap:!e.node.attrs.wordWrap}),l()},C=t=>{const a={...t};return a.language&&!b.some(u=>u.value===a.language)&&(a.language="plaintext",e.updateAttributes({language:"plaintext"})),a},A=d.useCallback(t=>{l(t)},[l]);return d.useEffect(()=>{if(o.current){const t=C(e.node.attrs);n.current=w.createEditor(o.current,{readOnly:!c,language:t.language||"plaintext",tabSize:t.tabSize??2,lineNumbers:t.lineNumbers??!0,wordWrap:t.wordWrap??!1,value:h,rtl:!1,onUpdate(a){queueMicrotask(()=>{e.updateAttributes({code:a})})}}),n.current.addExtensions(B.matchBrackets(),R.matchTags(),T.indentGuides(),I.highlightBracketPairs(),S.cursorPosition(),j.defaultCommands(),j.editHistory()),e.node.attrs.shouldFocus&&setTimeout(()=>{l(),e.updateAttributes({shouldFocus:!1})},0)}return()=>{var t,a;(t=n.current)!=null&&t.remove&&((a=n.current)==null||a.remove())}},[o]),d.useEffect(()=>{var t,a;if((t=n.current)!=null&&t.setOptions){const u=C(e.node.attrs);(a=n.current)==null||a.setOptions(u)}},[n,e.node.attrs]),r.jsx(s.NodeViewWrapper,{className:s.clsx(p.wrap,"render-wrapper"),children:r.jsx("div",{onClick:A,ref:o,className:s.clsx("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block !richtext-my-[10px]",{[p.blockInfoEditable]:!c}),children:r.jsxs("div",{className:"richtext-code-block-toolbar",children:[r.jsx("div",{children:r.jsxs(i.Select,{defaultValue:e.node.attrs.language,disabled:!c,onValueChange:t=>{e.updateAttributes({language:t}),l()},children:[r.jsx(i.SelectTrigger,{className:"richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(i.SelectValue,{placeholder:"Select language"})}),r.jsx(i.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:b==null?void 0:b.map(t=>r.jsx(i.SelectItem,{value:t.value,children:t.label},t.value))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:m,children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"Copy"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:g,className:s.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.lineNumbers}),children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"List"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{onClick:v,className:s.clsx("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",{"richtext-bg-[#5a5d5e4f]":e==null?void 0:e.node.attrs.wordWrap}),children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"WrapText"})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{children:r.jsxs(i.Select,{defaultValue:e.node.attrs.tabSize,disabled:!c,onValueChange:t=>{e.updateAttributes({tabSize:t}),l()},children:[r.jsx(i.SelectTrigger,{className:"richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]",children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"IndentIncrease"})}),r.jsx(i.SelectContent,{onCloseAutoFocus:t=>t.preventDefault(),children:f==null?void 0:f.map(t=>r.jsx(i.SelectItem,{value:t,children:t},t))})]})}),r.jsx("div",{className:"toolbar-divider"}),r.jsx("div",{className:"richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",onClick:x,children:r.jsx(i.IconComponent,{className:"richtext-size-4",name:"Trash2"})})]})})})}const N=/^`{3}([a-z]+)?\s$/,y=/^~{3}([a-z]+)?\s$/,q=s.Node3.create({name:"codeBlock",group:"block",atom:!0,content:"text*",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),languages:[],button:({editor:c,t:o})=>({componentProps:{action:()=>c.commands.setCodeBlock({}),isActive:()=>c.isActive("codeBlock"),disabled:!1,icon:"Code2",tooltip:o("editor.codeblock.tooltip")}})}},addAttributes(){return{code:{default:"",parseHTML:e=>e.textContent||""},language:{default:"plaintext"},lineNumbers:{default:!0},wordWrap:{default:!1},tabSize:{default:2},shouldFocus:{default:!0,parseHTML:()=>!1,renderHTML:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})},{tag:"pre code",preserveWhitespace:"full",getAttrs:e=>({code:e.textContent||""})}]},renderHTML({HTMLAttributes:e,node:c}){var x;const o=c.attrs.code||((x=c.content.firstChild)==null?void 0:x.text)||"";return["pre",s.mergeAttributes(this.options.HTMLAttributes,e),["code",{},o]]},addNodeView(){return s.ReactNodeViewRenderer(W)},addCommands(){return{setCodeBlock:e=>({commands:c})=>c.insertContent({type:this.name,attrs:{...e,shouldFocus:!0}})}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.setCodeBlock({})}},addInputRules(){return[s.textblockTypeInputRule({find:N,type:this.type,getAttributes:e=>({language:e[1]})}),s.textblockTypeInputRule({find:y,type:this.type,getAttributes:e=>({language:e[1]})})]}});exports.CodeBlock=q;exports.RichTextCodeBlock=z;exports.backtickInputRegex=N;exports.tildeInputRegex=y;
package/lib/CodeBlock.js CHANGED
@@ -1,16 +1,15 @@
1
1
  import { h as L, j as h, N as M, t as k, k as W, m as j } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as r, Fragment as R, jsxs as f } from "react/jsx-runtime";
3
- import { u as H, d as V, A as P, w as F, I as u } from "./index-B0d-u29p.js";
4
- import { useRef as y, useCallback as v, useEffect as A } from "react";
3
+ import { u as H, d as V, A as P, G as F, S as y, p as A, q as O, r as w, s as S, I as u } from "./index-CnKgiZFQ.js";
4
+ import { useRef as T, useCallback as v, useEffect as E } from "react";
5
5
  import "./theme.js";
6
- import { createEditor as O } from "prism-code-editor-lightweight";
7
- import { defaultCommands as _, editHistory as J } from "prism-code-editor-lightweight/commands";
8
- import { cursorPosition as q } from "prism-code-editor-lightweight/cursor";
6
+ import { createEditor as _ } from "prism-code-editor-lightweight";
7
+ import { defaultCommands as q, editHistory as G } from "prism-code-editor-lightweight/commands";
8
+ import { cursorPosition as J } from "prism-code-editor-lightweight/cursor";
9
9
  import { indentGuides as D } from "prism-code-editor-lightweight/guides";
10
- import { highlightBracketPairs as G } from "prism-code-editor-lightweight/highlight-brackets";
11
- import { matchBrackets as U } from "prism-code-editor-lightweight/match-brackets";
12
- import { matchTags as $ } from "prism-code-editor-lightweight/match-tags";
13
- import { S as w, a as S, b as K, c as T, d as E } from "./select-D9wQw2qB.js";
10
+ import { highlightBracketPairs as U } from "prism-code-editor-lightweight/highlight-brackets";
11
+ import { matchBrackets as $ } from "prism-code-editor-lightweight/match-brackets";
12
+ import { matchTags as K } from "prism-code-editor-lightweight/match-tags";
14
13
  import { d as Q } from "./delete-node-eQHsyyhR.js";
15
14
  import "prism-code-editor-lightweight/prism/languages/bash";
16
15
  import "prism-code-editor-lightweight/prism/languages/css";
@@ -53,20 +52,20 @@ import "prism-code-editor-lightweight/prism/languages/yaml";
53
52
  import "prism-code-editor-lightweight/prism/languages/regex";
54
53
  import "prism-code-editor-lightweight/prism/languages/php";
55
54
  import "prism-code-editor-lightweight/prism/languages/markdown";
56
- function at() {
55
+ function rt() {
57
56
  const e = H(B.name), {
58
57
  icon: i = void 0,
59
58
  tooltip: n = void 0,
60
59
  tooltipOptions: s = {},
61
60
  action: o = void 0,
62
61
  isActive: d = void 0
63
- } = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: c, disabled: m, update: b } = V(d), p = () => {
64
- m || o && (o(), b());
62
+ } = (e == null ? void 0 : e.componentProps) ?? {}, { dataState: c, disabled: m, update: p } = V(d), b = () => {
63
+ m || o && (o(), p());
65
64
  };
66
65
  return e ? /* @__PURE__ */ r(
67
66
  P,
68
67
  {
69
- action: p,
68
+ action: b,
70
69
  dataState: c,
71
70
  disabled: m,
72
71
  icon: i,
@@ -97,7 +96,7 @@ const Y = "_wrap_1x3wi_1", X = "_blockInfoEditable_1x3wi_30", z = {
97
96
  { value: "php", label: "PHP" }
98
97
  ], g = [2, 4, 8];
99
98
  function Z(e) {
100
- const i = F(), n = y(null), s = v(() => Q(B.name, e == null ? void 0 : e.editor), [e == null ? void 0 : e.editor]), o = y(null), d = e.node.attrs.code || e.node.textContent || "", c = v((t) => {
99
+ const i = F(), n = T(null), s = v(() => Q(B.name, e == null ? void 0 : e.editor), [e == null ? void 0 : e.editor]), o = T(null), d = e.node.attrs.code || e.node.textContent || "", c = v((t) => {
101
100
  t == null || t.stopPropagation(), setTimeout(() => {
102
101
  var a, l, N;
103
102
  (N = (l = (a = o.current) == null ? void 0 : a.textarea) == null ? void 0 : l.focus) == null || N.call(l);
@@ -116,11 +115,11 @@ function Z(e) {
116
115
  } finally {
117
116
  c();
118
117
  }
119
- }, b = () => {
118
+ }, p = () => {
120
119
  e.updateAttributes({
121
120
  lineNumbers: !e.node.attrs.lineNumbers
122
121
  }), c();
123
- }, p = () => {
122
+ }, b = () => {
124
123
  e.updateAttributes({
125
124
  wordWrap: !e.node.attrs.wordWrap
126
125
  }), c();
@@ -135,10 +134,10 @@ function Z(e) {
135
134
  },
136
135
  [c]
137
136
  );
138
- return A(() => {
137
+ return E(() => {
139
138
  if (n.current) {
140
139
  const t = C(e.node.attrs);
141
- o.current = O(n.current, {
140
+ o.current = _(n.current, {
142
141
  readOnly: !i,
143
142
  language: t.language || "plaintext",
144
143
  tabSize: t.tabSize ?? 2,
@@ -152,13 +151,13 @@ function Z(e) {
152
151
  });
153
152
  }
154
153
  }), o.current.addExtensions(
155
- U(),
156
154
  $(),
155
+ K(),
157
156
  D(),
158
- G(),
157
+ U(),
158
+ J(),
159
159
  q(),
160
- _(),
161
- J()
160
+ G()
162
161
  ), e.node.attrs.shouldFocus && setTimeout(() => {
163
162
  c(), e.updateAttributes({
164
163
  shouldFocus: !1
@@ -169,7 +168,7 @@ function Z(e) {
169
168
  var t, a;
170
169
  (t = o.current) != null && t.remove && ((a = o.current) == null || a.remove());
171
170
  };
172
- }, [n]), A(() => {
171
+ }, [n]), E(() => {
173
172
  var t, a;
174
173
  if ((t = o.current) != null && t.setOptions) {
175
174
  const l = C(e.node.attrs);
@@ -188,7 +187,7 @@ function Z(e) {
188
187
  ),
189
188
  children: /* @__PURE__ */ f("div", { className: "richtext-code-block-toolbar", children: [
190
189
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ f(
191
- w,
190
+ y,
192
191
  {
193
192
  defaultValue: e.node.attrs.language,
194
193
  disabled: !i,
@@ -198,8 +197,8 @@ function Z(e) {
198
197
  }), c();
199
198
  },
200
199
  children: [
201
- /* @__PURE__ */ r(S, { className: "richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(K, { placeholder: "Select language" }) }),
202
- /* @__PURE__ */ r(T, { onCloseAutoFocus: (t) => t.preventDefault(), children: x == null ? void 0 : x.map((t) => /* @__PURE__ */ r(E, { value: t.value, children: t.label }, t.value)) })
200
+ /* @__PURE__ */ r(A, { className: "richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(O, { placeholder: "Select language" }) }),
201
+ /* @__PURE__ */ r(w, { onCloseAutoFocus: (t) => t.preventDefault(), children: x == null ? void 0 : x.map((t) => /* @__PURE__ */ r(S, { value: t.value, children: t.label }, t.value)) })
203
202
  ]
204
203
  }
205
204
  ) }),
@@ -216,7 +215,7 @@ function Z(e) {
216
215
  /* @__PURE__ */ r(
217
216
  "div",
218
217
  {
219
- onClick: b,
218
+ onClick: p,
220
219
  className: h(
221
220
  "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
222
221
  {
@@ -230,7 +229,7 @@ function Z(e) {
230
229
  /* @__PURE__ */ r(
231
230
  "div",
232
231
  {
233
- onClick: p,
232
+ onClick: b,
234
233
  className: h(
235
234
  "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
236
235
  {
@@ -242,7 +241,7 @@ function Z(e) {
242
241
  ),
243
242
  /* @__PURE__ */ r("div", { className: "toolbar-divider" }),
244
243
  /* @__PURE__ */ r("div", { children: /* @__PURE__ */ f(
245
- w,
244
+ y,
246
245
  {
247
246
  defaultValue: e.node.attrs.tabSize,
248
247
  disabled: !i,
@@ -252,8 +251,8 @@ function Z(e) {
252
251
  }), c();
253
252
  },
254
253
  children: [
255
- /* @__PURE__ */ r(S, { className: "richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(u, { className: "richtext-size-4", name: "IndentIncrease" }) }),
256
- /* @__PURE__ */ r(T, { onCloseAutoFocus: (t) => t.preventDefault(), children: g == null ? void 0 : g.map((t) => /* @__PURE__ */ r(E, { value: t, children: t }, t)) })
254
+ /* @__PURE__ */ r(A, { className: "richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ r(u, { className: "richtext-size-4", name: "IndentIncrease" }) }),
255
+ /* @__PURE__ */ r(w, { onCloseAutoFocus: (t) => t.preventDefault(), children: g == null ? void 0 : g.map((t) => /* @__PURE__ */ r(S, { value: t, children: t }, t)) })
257
256
  ]
258
257
  }
259
258
  ) }),
@@ -383,7 +382,7 @@ const ee = /^`{3}([a-z]+)?\s$/, te = /^~{3}([a-z]+)?\s$/, B = /* @__PURE__ */ M.
383
382
  });
384
383
  export {
385
384
  B as CodeBlock,
386
- at as RichTextCodeBlock,
385
+ rt as RichTextCodeBlock,
387
386
  ee as backtickInputRegex,
388
387
  te as tildeInputRegex
389
388
  };
package/lib/CodeView.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),c=require("./index-De9MZVWQ.cjs");require("react");require("./theme.cjs");function v(){const e=c.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:u,disabled:r,update:p}=c.useToggleActive(l),g=()=>{r||s&&(s(),p())};return e?n.jsx(c.ActionButton,{action:g,dataState:u,disabled:r,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./clsx-CXbNJWDD.cjs"),n=require("react/jsx-runtime"),c=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function v(){const e=c.useButtonProps(a.name),{icon:t=void 0,tooltip:o=void 0,shortcutKeys:i=void 0,tooltipOptions:d={},action:s=void 0,isActive:l=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:u,disabled:r,update:p}=c.useToggleActive(l),g=()=>{r||s&&(s(),p())};return e?n.jsx(c.ActionButton,{action:g,dataState:u,disabled:r,icon:t,shortcutKeys:i,tooltip:o,tooltipOptions:d}):n.jsx(n.Fragment,{})}const a=m.Extension.create({name:"codeView",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:t,t:o}){return{componentProps:{action:()=>{t.commands.toggleCodeView()},isActive:()=>t.storage.codeView.isActive,disabled:!1,icon:"Html",tooltip:o("editor.codeView.tooltip")||"View HTML Code",customClass:"tiptap-code-view-button"}}}}},addStorage(){return{isActive:!1,originalContent:""}},addCommands(){return{toggleCodeView:()=>({editor:e})=>{const t=e.storage.codeView.isActive;if(t)e.commands.setContent(e.getText());else{const o=e.getHTML();e.storage.codeView.originalContent=o;const i=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;");e.commands.setContent(`<div class="tiptap-code-view-wrapper">${i}</div>`)}return e.storage.codeView.isActive=!t,!0}}}});exports.CodeView=a;exports.RichTextCodeView=v;
package/lib/CodeView.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { E as l } from "./clsx-BUPZHhq3.js";
2
2
  import { jsx as c, Fragment as g } from "react/jsx-runtime";
3
- import { u, d as v, A as w } from "./index-B0d-u29p.js";
3
+ import { u, d as v, A as w } from "./index-CnKgiZFQ.js";
4
4
  import "react";
5
5
  import "./theme.js";
6
6
  function h() {
package/lib/Color.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),l=require("./index-De9MZVWQ.cjs"),g=require("./separator-D8lOAf8f.cjs");require("./theme.cjs");function v({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function j(){const e=l.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:c,dataState:u}=l.useActive(s),[f,a]=d.useState(r);d.useEffect(()=>{a(u)},[u]);function x(h){c||i&&(i==null||i(h),a(h))}return e?t.jsx(g.ColorPicker,{colors:n,disabled:c,onChange:x,value:f,children:t.jsx(l.ActionButton,{disabled:c,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(v,{fill:u}),t.jsx(l.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./index-CjhjjJsN.cjs"),t=require("react/jsx-runtime"),d=require("react"),l=require("./index-BynXHtjJ.cjs"),g=require("./separator-CoQaQmFK.cjs");require("./theme.cjs");function v({fill:e}){return t.jsx("svg",{height:"18px",version:"1.1",viewBox:"0 0 240 240",width:"18px",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,children:t.jsx("g",{transform:"translate(0.000000, 0.500000)",children:t.jsxs("g",{transform:"translate(39.000000, 17.353553)",children:[t.jsx("path",{d:"M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",fill:typeof e=="string"?e:"#000",fillRule:"evenodd"}),t.jsx("path",{d:"M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",fill:"currentColor",fillRule:"nonzero"}),t.jsx("path",{d:"M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",fill:"currentColor",fillRule:"nonzero"})]})})})})}function j(){const e=l.useButtonProps(C.name),{tooltip:o=void 0,isActive:s=void 0,defaultColor:r=void 0,colors:n,action:i}=(e==null?void 0:e.componentProps)??{},{disabled:c,dataState:u}=l.useActive(s),[f,a]=d.useState(r);d.useEffect(()=>{a(u)},[u]);function x(h){c||i&&(i==null||i(h),a(h))}return e?t.jsx(g.ColorPicker,{colors:n,disabled:c,onChange:x,value:f,children:t.jsx(l.ActionButton,{disabled:c,tooltip:o,children:t.jsxs("span",{className:"richtext-flex richtext-items-center richtext-justify-center richtext-gap-[4px] richtext-text-sm",children:[t.jsx(v,{fill:u}),t.jsx(l.IconComponent,{className:"!richtext-h-3 !richtext-w-3 richtext-text-zinc-500",name:"MenuDown"})]})})}):t.jsx(t.Fragment,{})}const C=p.Color.extend({addStorage(){return{currentColor:this.options.defaultColor||void 0}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button({editor:o,t:s,extension:r}){return{componentProps:{colors:r.options.colors,defaultColor:r.options.defaultColor,action:n=>{if(typeof n=="string"){o.storage.color.currentColor=n,o.chain().focus().setColor(n).run();return}o.chain().focus().unsetColor().run()},isActive:()=>{const{color:n}=o.getAttributes("textStyle");return n},disabled:!1,shortcutKeys:r.options.shortcutKeys??["⇧","alt","C"],tooltip:s("editor.color.tooltip")}}}}},addKeyboardShortcuts(){var e;return{...(e=this.parent)==null?void 0:e.call(this),"Alt-Shift-c":()=>{const o=this.storage.currentColor||this.options.defaultColor;if(!o){const{color:r}=this.editor.getAttributes("textStyle");return r?this.editor.chain().focus().unsetColor().run():!1}return this.editor.isActive("textStyle",{color:o})?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().setColor(o).run()}}}});exports.Color=C;exports.RichTextColor=j;
package/lib/Color.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as d } from "./index-Dl3OjzmR.js";
2
2
  import { jsx as o, jsxs as h, Fragment as p } from "react/jsx-runtime";
3
3
  import { useState as x, useEffect as m } from "react";
4
- import { u as g, e as v, A as L, I as A } from "./index-B0d-u29p.js";
5
- import { C as y } from "./separator-DRGTEiX4.js";
4
+ import { u as g, e as v, A as L, I as A } from "./index-CnKgiZFQ.js";
5
+ import { C as y } from "./separator-D-fyzbfx.js";
6
6
  import "./theme.js";
7
7
  function S({ fill: t }) {
8
8
  return /* @__PURE__ */ o(
package/lib/Column.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),x=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),h=require("./index-De9MZVWQ.cjs");require("react");require("./theme.cjs");function v(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function M(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function H(e,t,r=null){const n=M(e),c=[];for(let o=0;o<t;o+=1){const s=v(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function C({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,y)=>{m.attrs.index=y});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,y,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(x.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function S({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(x.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function O(){const e=h.useButtonProps(g.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=h.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(h.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const L=200,g=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),T=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),b=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:L,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=H(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(x.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=g;exports.ColumnNode=T;exports.MultipleColumnNode=b;exports.RichTextColumn=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./clsx-CXbNJWDD.cjs"),x=require("@tiptap/pm/state"),A=require("@tiptap/pm/model"),f=require("react/jsx-runtime"),h=require("./index-BynXHtjJ.cjs");require("react");require("./theme.cjs");function v(e,t,r=null){return r?e.createChecked({index:t},r):e.createAndFill({index:t})}function M(e){if(e.cached.columnsNodeTypes)return e.cached.columnsNodeTypes;const t={columns:e.nodes.columns,column:e.nodes.column};return e.cached.columnsNodeTypes=t,t}function H(e,t,r=null){const n=M(e),c=[];for(let o=0;o<t;o+=1){const s=v(n.column,o,r);s&&c.push(s)}return n.columns.createChecked({cols:t},c)}function C({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index,i=o.toJSON();let l=s;r==="delete"?(l=s-1,i.content.splice(s,1)):(l=r==="addBefore"?s:s+1,i.content.splice(l,0,{type:"column",attrs:{index:s},content:[{type:"paragraph"}]})),i.attrs.cols=i.content.length,i.content.forEach((m,y)=>{m.attrs.index=y});const d=A.Node.fromJSON(e.schema,i);let a=n.pos;d.content.forEach((m,y,N)=>{N<l&&(a+=m.nodeSize)});const p=e.tr.setTime(Date.now());p.replaceWith(n.pos,n.pos+n.node.nodeSize,d).setSelection(x.TextSelection.near(p.doc.resolve(a))),t(p)}return!0}function S({state:e,dispatch:t,type:r}){const n=u.findParentNode(o=>o.type.name===b.name)(e.selection),c=u.findParentNode(o=>o.type.name===T.name)(e.selection);if(t&&n&&c){const o=n.node,s=c.node.attrs.index;let i=0;r==="before"?i=(s-1+o.attrs.cols)%o.attrs.cols:i=(s+1)%o.attrs.cols;let l=n.pos;o.content.forEach((a,p,m)=>{m<i&&(l+=a.nodeSize)});const d=e.tr.setTime(Date.now());return d.setSelection(x.TextSelection.near(d.doc.resolve(l))),t(d),!0}return!1}function O(){const e=h.useButtonProps(g.name),{icon:t=void 0,tooltip:r=void 0,shortcutKeys:n=void 0,tooltipOptions:c={},action:o=void 0,isActive:s=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:i,disabled:l,update:d}=h.useToggleActive(s),a=()=>{l||o&&(o(),d())};return e?f.jsx(h.ActionButton,{action:a,dataState:i,disabled:l,icon:t,shortcutKeys:n,tooltip:r,tooltipOptions:c}):f.jsx(f.Fragment,{})}const L=200,g=u.Extension.create({name:"richtextColumnExtension",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),button:({editor:t,t:r})=>({componentProps:{action:()=>{t.chain().focus().insertColumns({cols:2}).run()},icon:"Columns",tooltip:r("editor.columns.tooltip")}})}}}),T=u.Node3.create({name:"column",content:"block+",isolating:!0,addOptions(){return{HTMLAttributes:{class:"column"}}},addAttributes(){return{index:{default:0,parseHTML:e=>e.getAttribute("index")}}},parseHTML(){return[{tag:"div[class=column]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),b=u.Node3.create({name:"columns",group:"block",defining:!0,isolating:!0,allowGapCursor:!1,content:"column{1,}",priority:L,addOptions(){return{HTMLAttributes:{class:"columns"}}},addAttributes(){return{cols:{default:2,parseHTML:e=>e.getAttribute("cols")}}},parseHTML(){return[{tag:"div[class=grid]"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]},addCommands(){return{insertColumns:e=>({tr:t,dispatch:r,editor:n})=>{const c=H(n.schema,e&&e.cols||3);if(r){const o=t.selection.anchor+1;t.replaceSelectionWith(c).scrollIntoView().setSelection(x.TextSelection.near(t.doc.resolve(o)))}return!0},addColBefore:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addBefore"}),addColAfter:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"addAfter"}),deleteCol:()=>({dispatch:e,state:t})=>C({dispatch:e,state:t,type:"delete"})}},addKeyboardShortcuts(){return{"Mod-Alt-G":()=>this.editor.commands.insertColumns(),Tab:()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"after"}),"Shift-Tab":()=>S({state:this.editor.state,dispatch:this.editor.view.dispatch,type:"before"})}}});exports.Column=g;exports.ColumnNode=T;exports.MultipleColumnNode=b;exports.RichTextColumn=O;
package/lib/Column.js CHANGED
@@ -2,7 +2,7 @@ import { l as p, E as v, N as b, m as y } from "./clsx-BUPZHhq3.js";
2
2
  import { TextSelection as h } from "@tiptap/pm/state";
3
3
  import { Node as N } from "@tiptap/pm/model";
4
4
  import { jsx as T, Fragment as H } from "react/jsx-runtime";
5
- import { u as M, d as L, A as O } from "./index-B0d-u29p.js";
5
+ import { u as M, d as L, A as O } from "./index-CnKgiZFQ.js";
6
6
  import "react";
7
7
  import "./theme.js";
8
8
  function E(e, t, r = null) {