react-reason-editor 1.0.96 → 1.0.98

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 (31) hide show
  1. package/dist/{BubbleMenus-F5PFH6eV.cjs → BubbleMenus-3RiQc4lw.cjs} +1 -1
  2. package/dist/{BubbleMenus-eYDoohA4.js → BubbleMenus-CFzQBrVG.js} +1 -1
  3. package/dist/{ImportWord-cr386RpI.js → ImportWord-DtON-y5N.js} +1 -1
  4. package/dist/ImportWord.cjs +1 -1
  5. package/dist/ImportWord.js +1 -1
  6. package/dist/{Pagination-yjRu_qJK.cjs → Pagination-CGxVvD1Y.cjs} +1 -1
  7. package/dist/{Pagination-B8rfYYi_.js → Pagination-DYCCm6cp.js} +1 -1
  8. package/dist/Pagination.cjs +1 -1
  9. package/dist/Pagination.js +1 -1
  10. package/dist/{ReasonDocs-D_c14vkF.js → ReasonDocs-BXtUm4zk.js} +2 -2
  11. package/dist/{ReasonDocs-cELUZvnA.cjs → ReasonDocs-CsmZMk6W.cjs} +1 -1
  12. package/dist/{RichTextProvider-B5fdgtFs.js → RichTextProvider-BcsYTR6Z.js} +1 -1
  13. package/dist/{RichTextProvider-DJWvDmyS.cjs → RichTextProvider-KRSFedCE.cjs} +1 -1
  14. package/dist/docs-agent/plate/kits/markdown-kit.d.ts +8 -0
  15. package/dist/docs-agent/plate/plate-editor-config.d.ts +30 -0
  16. package/dist/docs-agent.cjs +1 -1
  17. package/dist/docs-agent.js +1 -1
  18. package/dist/editor-kit.cjs +1 -1
  19. package/dist/editor-kit.js +1 -1
  20. package/dist/{editorConfig-Duji4hwm.js → editorConfig-9-ZxkRbw.js} +1 -1
  21. package/dist/{editorConfig-2pHxtmeI.cjs → editorConfig-DF8EAH_P.cjs} +1 -1
  22. package/dist/extensions/Twitter/Twitter.d.ts +6 -1
  23. package/dist/{html-to-docx.esm-BLUcO7pp-DLRiI93_.cjs → html-to-docx.esm-BLUcO7pp-BKB2FJoB.cjs} +1 -1
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +1 -1
  26. package/dist/reason-docs.cjs +1 -1
  27. package/dist/reason-docs.js +1 -1
  28. package/dist/reason-toolbar-skin-DY4w9SRA.cjs +1 -0
  29. package/dist/{reason-toolbar-skin-CQzJJqJy.js → reason-toolbar-skin-DarRq6V-.js} +4 -4
  30. package/package.json +3 -3
  31. package/dist/reason-toolbar-skin-SPGcsiuT.cjs +0 -1
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./rolldown-runtime-Drgf5FY8.js";import{o as r}from"./dist-DmY5xFkC.js";import{i,n as s,r as o,t as a}from"./tooltip-G11f5UOp.js";import{i as c,n as l,t as h}from"./editorConfig-Duji4hwm.js";import{A as d,B as u,C as f,D as g,E as p,F as m,G as y,H as b,I as w,J as v,K as _,L as k,M as C,N as S,O as E,P as A,Q as T,R as x,S as R,T as D,U as O,V as P,W as L,X as M,Y as N,Z as I,_ as U,a as j,at as F,b as B,c as W,d as H,et as q,f as V,g as z,h as $,i as Y,it as J,j as Q,k as K,l as G,m as X,n as Z,nt as ee,o as te,p as ne,q as re,r as ie,rt as se,s as oe,t as ae,tt as ce,u as le,v as he,w as de,x as ue,y as fe,z as ge}from"./reason-toolbar-skin-CQzJJqJy.js";import{a as pe,f as me,h as ye,m as be,o as we,p as ve,r as _e,s as ke,t as Ce,u as Se}from"./dropdown-menu-tmQwCqOR.js";import{getTranscribeStorage as Ee,isTranscriptionSupported as Ae,subscribeTranscribe as Te}from"./Transcribe.js";import{$ as xe,A as Re,At as De,B as Oe,Bt as Pe,C as Le,Ct as Me,D as Ne,Dt as Ie,E as Ue,Et as je,F as Fe,Ft as Be,G as We,Gt as He,H as qe,Ht as Ve,I as ze,It as $e,J as Ye,K as Je,Kt as Qe,L as Ke,Lt as Ge,M as Xe,Mt as Ze,N as et,Nt as tt,O as nt,Ot as rt,P as it,Pt as st,Q as ot,R as at,Rt as ct,S as lt,St as ht,T as dt,Tt as ut,U as ft,Ut as gt,V as pt,Vt as mt,W as yt,Wt as bt,X as wt,Y as vt,Z as _t,_ as kt,_t as Ct,at as St,b as Et,bt as At,c as Tt,ct as xt,d as Rt,dt as Dt,et as Ot,f as Pt,ft as Lt,g as Mt,gt as Nt,h as It,ht as Ut,i as jt,it as Ft,j as Bt,jt as Wt,k as Ht,kt as qt,l as Vt,lt as zt,m as $t,mt as Yt,nt as Jt,o as Qt,ot as Kt,p as Gt,pt as Xt,q as Zt,qt as en,rt as tn,st as nn,t as rn,tt as sn,u as on,ut as an,v as cn,vt as ln,w as hn,wt as dn,x as un,xt as fn,y as gn,yt as pn,z as mn,zt as yn}from"./dist-kbEzWzhg.js";import*as bn from"react";import{useCallback as wn,useEffect as vn,useLayoutEffect as _n,useMemo as kn,useReducer as Cn,useRef as Sn,useState as En}from"react";import{Extension as An}from"@tiptap/core";import{Plugin as Tn,PluginKey as xn}from"@tiptap/pm/state";import{Fragment as Rn,jsx as Dn,jsxs as On}from"react/jsx-runtime";import{AlignCenter as Pn,AlignJustify as Ln,AlignLeft as Mn,AlignRight as Nn,Baseline as In,Bold as Un,Braces as jn,Code as Fn,Code2 as Bn,Columns2 as Wn,Eraser as Hn,FileText as qn,Heading1 as Vn,Heading2 as zn,Heading3 as $n,Heading4 as Yn,Heading5 as Jn,Heading6 as Qn,Highlighter as Kn,Image as Gn,IndentDecrease as Xn,IndentIncrease as Zn,Info as er,Italic as tr,Link2 as nr,List as rr,ListChecks as ir,ListOrdered as sr,Mic as or,Minus as ar,Pencil as cr,Pilcrow as lr,Plus as hr,Quote as dr,Redo2 as ur,Rows3 as fr,Sigma as gr,Smile as pr,Strikethrough as mr,Subscript as yr,Superscript as br,Table2 as wr,Trash2 as vr,Type as _r,Underline as kr,Undo2 as Cr,Video as Sr}from"lucide-react";import{useSyncExternalStore as Er}from"use-sync-external-store/shim";import"use-sync-external-store/shim/with-selector";var Ar=class extends $e{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=/* @__PURE__ */new Map,this.meta=/* @__PURE__ */new Map,this._checkInterval=setInterval(()=>{const e=wt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&Tr(this,t,"timeout")},Ze(3e3)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,i=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:wt()});const s=[],o=[],a=[],c=[];null===e?c.push(t):null==i?null!=e&&s.push(t):(o.push(t),Ke(i,e)||a.push(t)),(s.length>0||a.length>0||c.length>0)&&this.emit("change",[{added:s,updated:a,removed:c},"local"]),this.emit("update",[{added:s,updated:o,removed:c},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},Tr=(e,t,n)=>{const r=[];for(let i=0;i<t.length;i++){const n=t[i];if(e.states.has(n)){if(e.states.delete(n),n===e.clientID){const t=e.meta.get(n);e.meta.set(n,{clock:t.clock+1,lastUpdated:wt()})}r.push(n)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},xr=(e,t,n=e.states)=>{const r=t.length,i=At();rt(i,r);for(let s=0;s<r;s++){const r=t[s],o=n.get(r)||null,a=e.meta.get(r).clock;rt(i,r),rt(i,a),Ie(i,JSON.stringify(o))}return ht(i)};function Rr(e){return{engine:e,execute(){},isActive:()=>!1,isEnabled:()=>!1,getValue(){},subscribe:()=>()=>{}}}var Dr=[{kind:"button",id:"undo",label:"Undo",icon:Cr,shortcut:"⌘Z"},{kind:"button",id:"redo",label:"Redo",icon:ur,shortcut:"⇧⌘Z"},{kind:"separator",id:"history-divider"},{kind:"button",id:"bold",label:"Bold",icon:Un,shortcut:"⌘B"},{kind:"button",id:"italic",label:"Italic",icon:tr,shortcut:"⌘I"},{kind:"button",id:"underline",label:"Underline",icon:kr,shortcut:"⌘U"},{kind:"button",id:"highlight",label:"Highlight",icon:Kn,shortcut:"⌘⇧H"},{kind:"separator",id:"marks-divider"},{kind:"menu",id:"block-format",label:"Block Format",icon:fr,children:[{kind:"button",id:"paragraph",label:"Paragraph",icon:lr},{kind:"button",id:"heading-1",label:"Heading 1",icon:Vn,shortcut:"Ctrl+Alt+1"},{kind:"button",id:"heading-2",label:"Heading 2",icon:zn,shortcut:"Ctrl+Alt+2"},{kind:"button",id:"heading-3",label:"Heading 3",icon:$n,shortcut:"Ctrl+Alt+3"},{kind:"button",id:"heading-4",label:"Heading 4",icon:Yn,shortcut:"Ctrl+Alt+4"},{kind:"button",id:"heading-5",label:"Heading 5",icon:Jn,shortcut:"Ctrl+Alt+5"},{kind:"button",id:"heading-6",label:"Heading 6",icon:Qn,shortcut:"Ctrl+Alt+6"},{kind:"separator",id:"block-format-lists-divider"},{kind:"button",id:"bullet-list",label:"Bullet List",icon:rr,shortcut:"Ctrl+Shift+8"},{kind:"button",id:"ordered-list",label:"Ordered List",icon:sr,shortcut:"Ctrl+Shift+7"},{kind:"button",id:"task-list",label:"Check List",icon:ir,shortcut:"Ctrl+Shift+9"},{kind:"separator",id:"block-format-quote-divider"},{kind:"button",id:"blockquote",label:"Blockquote",icon:dr,shortcut:"Ctrl+Shift+B"},{kind:"button",id:"code-block",label:"Code Block",icon:Bn,shortcut:"Ctrl+Alt+C"},{kind:"separator",id:"block-format-clear-divider"},{kind:"button",id:"clear-formatting",label:"Clear Format",icon:Hn}]},{kind:"menu",id:"text-styles",label:"Text Styles",icon:_r,children:[{kind:"group-label",id:"text-styles-label",label:"Text Styles"},{kind:"button",id:"strike",label:"Strikethrough",icon:mr,shortcut:"Ctrl+Shift+S"},{kind:"button",id:"code",label:"Inline Code",icon:Fn,shortcut:"Ctrl+E"},{kind:"button",id:"text-color",label:"Text Color",icon:In,shortcut:"Alt+Shift+C"},{kind:"button",id:"superscript",label:"Superscript",icon:br,shortcut:"Ctrl+."},{kind:"button",id:"subscript",label:"Subscript",icon:yr,shortcut:"Ctrl+,"},{kind:"separator",id:"text-styles-indent-divider"},{kind:"button",id:"indent",label:"Indent",icon:Zn},{kind:"button",id:"outdent",label:"Outdent",icon:Xn},{kind:"menu",id:"alignment",label:"Alignment",icon:Mn,children:[{kind:"button",id:"align-left",label:"Align Left",icon:Mn},{kind:"button",id:"align-center",label:"Align Center",icon:Pn},{kind:"button",id:"align-right",label:"Align Right",icon:Nn},{kind:"button",id:"align-justify",label:"Justify",icon:Ln}]}]},{kind:"menu",id:"insert",label:"Insert",icon:hr,children:[{kind:"group-label",id:"insert-label",label:"Insert"},{kind:"button",id:"link",label:"Link",icon:nr},{kind:"button",id:"emoji",label:"Emoji",icon:pr},{kind:"button",id:"table",label:"Table",icon:wr},{kind:"button",id:"image",label:"Image",icon:Gn},{kind:"button",id:"columns",label:"Columns",icon:Wn,shortcut:"Ctrl+Alt+G"},{kind:"button",id:"callout",label:"Callout",icon:er},{kind:"button",id:"horizontal-rule",label:"Divider",icon:ar,shortcut:"Ctrl+Alt+S"},{kind:"button",id:"video",label:"Video",icon:Sr},{kind:"button",id:"math",label:"Math",icon:gr}]},{kind:"separator",id:"voice-divider"},{kind:"button",id:"transcribe",label:"Dictate",icon:or,shortcut:"Ctrl+Shift+D"},{kind:"menu",id:"table-tools",label:"Table",icon:wr,visibleWhenActive:"table",children:[{kind:"group-label",id:"table-rows-label",label:"Rows"},{kind:"button",id:"table.add-row-before",label:"Insert Row Above",icon:fr},{kind:"button",id:"table.add-row-after",label:"Insert Row Below",icon:fr},{kind:"button",id:"table.delete-row",label:"Delete Row",icon:vr},{kind:"separator",id:"table-columns-divider"},{kind:"group-label",id:"table-columns-label",label:"Columns"},{kind:"button",id:"table.add-column-before",label:"Insert Column Left",icon:Wn},{kind:"button",id:"table.add-column-after",label:"Insert Column Right",icon:Wn},{kind:"button",id:"table.delete-column",label:"Delete Column",icon:vr},{kind:"separator",id:"table-cells-divider"},{kind:"group-label",id:"table-cells-label",label:"Cells"},{kind:"button",id:"table.merge-cells",label:"Merge Cells",icon:jn},{kind:"button",id:"table.split-cell",label:"Split Cell",icon:jn},{kind:"button",id:"table.toggle-header-row",label:"Toggle Header Row",icon:fr},{kind:"separator",id:"table-delete-divider"},{kind:"button",id:"table.delete",label:"Delete Table",icon:vr}]}];function Or(e=Dr){const t=[];for(const n of e)"button"===n.kind&&t.push(n.id),"menu"===n.kind&&t.push(...Or(n.children));return t}var Pr="flex items-center justify-center rounded p-1.5 text-gray-600 transition-colors dark:text-gray-300 disabled:cursor-not-allowed disabled:opacity-40 hover:enabled:bg-gray-100 dark:hover:enabled:bg-slate-800",Lr="bg-gray-200 text-gray-900 dark:bg-slate-700 dark:text-white",Mr="flex w-full cursor-pointer items-center gap-2 text-xs data-disabled:cursor-not-allowed data-disabled:opacity-40";function Nr({shortcut:e}){return e?/* @__PURE__ */Dn("span",{className:"ml-auto pl-4 text-[10px] tracking-widest text-gray-400 dark:text-gray-500",children:e}):null}function Ir({items:e,adapter:t}){/* @__PURE__ */
1
+ import{i as e,o as t,t as n}from"./rolldown-runtime-Drgf5FY8.js";import{o as r}from"./dist-DmY5xFkC.js";import{i,n as s,r as o,t as a}from"./tooltip-G11f5UOp.js";import{i as c,n as l,t as h}from"./editorConfig-9-ZxkRbw.js";import{A as d,B as u,C as f,D as g,E as p,F as m,G as y,H as b,I as w,J as v,K as _,L as k,M as C,N as S,O as E,P as A,Q as T,R as x,S as R,T as D,U as O,V as P,W as L,X as M,Y as N,Z as I,_ as U,a as j,at as F,b as B,c as W,d as H,et as q,f as V,g as z,h as $,i as Y,it as J,j as Q,k as K,l as G,m as X,n as Z,nt as ee,o as te,p as ne,q as re,r as ie,rt as se,s as oe,t as ae,tt as ce,u as le,v as he,w as de,x as ue,y as fe,z as ge}from"./reason-toolbar-skin-DarRq6V-.js";import{a as pe,f as me,h as ye,m as be,o as we,p as ve,r as _e,s as ke,t as Ce,u as Se}from"./dropdown-menu-tmQwCqOR.js";import{getTranscribeStorage as Ee,isTranscriptionSupported as Ae,subscribeTranscribe as Te}from"./Transcribe.js";import{$ as xe,A as Re,At as De,B as Oe,Bt as Pe,C as Le,Ct as Me,D as Ne,Dt as Ie,E as Ue,Et as je,F as Fe,Ft as Be,G as We,Gt as He,H as qe,Ht as Ve,I as ze,It as $e,J as Ye,K as Je,Kt as Qe,L as Ke,Lt as Ge,M as Xe,Mt as Ze,N as et,Nt as tt,O as nt,Ot as rt,P as it,Pt as st,Q as ot,R as at,Rt as ct,S as lt,St as ht,T as dt,Tt as ut,U as ft,Ut as gt,V as pt,Vt as mt,W as yt,Wt as bt,X as wt,Y as vt,Z as _t,_ as kt,_t as Ct,at as St,b as Et,bt as At,c as Tt,ct as xt,d as Rt,dt as Dt,et as Ot,f as Pt,ft as Lt,g as Mt,gt as Nt,h as It,ht as Ut,i as jt,it as Ft,j as Bt,jt as Wt,k as Ht,kt as qt,l as Vt,lt as zt,m as $t,mt as Yt,nt as Jt,o as Qt,ot as Kt,p as Gt,pt as Xt,q as Zt,qt as en,rt as tn,st as nn,t as rn,tt as sn,u as on,ut as an,v as cn,vt as ln,w as hn,wt as dn,x as un,xt as fn,y as gn,yt as pn,z as mn,zt as yn}from"./dist-kbEzWzhg.js";import*as bn from"react";import{useCallback as wn,useEffect as vn,useLayoutEffect as _n,useMemo as kn,useReducer as Cn,useRef as Sn,useState as En}from"react";import{Extension as An}from"@tiptap/core";import{Plugin as Tn,PluginKey as xn}from"@tiptap/pm/state";import{Fragment as Rn,jsx as Dn,jsxs as On}from"react/jsx-runtime";import{AlignCenter as Pn,AlignJustify as Ln,AlignLeft as Mn,AlignRight as Nn,Baseline as In,Bold as Un,Braces as jn,Code as Fn,Code2 as Bn,Columns2 as Wn,Eraser as Hn,FileText as qn,Heading1 as Vn,Heading2 as zn,Heading3 as $n,Heading4 as Yn,Heading5 as Jn,Heading6 as Qn,Highlighter as Kn,Image as Gn,IndentDecrease as Xn,IndentIncrease as Zn,Info as er,Italic as tr,Link2 as nr,List as rr,ListChecks as ir,ListOrdered as sr,Mic as or,Minus as ar,Pencil as cr,Pilcrow as lr,Plus as hr,Quote as dr,Redo2 as ur,Rows3 as fr,Sigma as gr,Smile as pr,Strikethrough as mr,Subscript as yr,Superscript as br,Table2 as wr,Trash2 as vr,Type as _r,Underline as kr,Undo2 as Cr,Video as Sr}from"lucide-react";import{useSyncExternalStore as Er}from"use-sync-external-store/shim";import"use-sync-external-store/shim/with-selector";var Ar=class extends $e{constructor(e){super(),this.doc=e,this.clientID=e.clientID,this.states=/* @__PURE__ */new Map,this.meta=/* @__PURE__ */new Map,this._checkInterval=setInterval(()=>{const e=wt();null!==this.getLocalState()&&15e3<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const t=[];this.meta.forEach((n,r)=>{r!==this.clientID&&3e4<=e-n.lastUpdated&&this.states.has(r)&&t.push(r)}),t.length>0&&Tr(this,t,"timeout")},Ze(3e3)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){const t=this.clientID,n=this.meta.get(t),r=void 0===n?0:n.clock+1,i=this.states.get(t);null===e?this.states.delete(t):this.states.set(t,e),this.meta.set(t,{clock:r,lastUpdated:wt()});const s=[],o=[],a=[],c=[];null===e?c.push(t):null==i?null!=e&&s.push(t):(o.push(t),Ke(i,e)||a.push(t)),(s.length>0||a.length>0||c.length>0)&&this.emit("change",[{added:s,updated:a,removed:c},"local"]),this.emit("update",[{added:s,updated:o,removed:c},"local"])}setLocalStateField(e,t){const n=this.getLocalState();null!==n&&this.setLocalState({...n,[e]:t})}getStates(){return this.states}},Tr=(e,t,n)=>{const r=[];for(let i=0;i<t.length;i++){const n=t[i];if(e.states.has(n)){if(e.states.delete(n),n===e.clientID){const t=e.meta.get(n);e.meta.set(n,{clock:t.clock+1,lastUpdated:wt()})}r.push(n)}}r.length>0&&(e.emit("change",[{added:[],updated:[],removed:r},n]),e.emit("update",[{added:[],updated:[],removed:r},n]))},xr=(e,t,n=e.states)=>{const r=t.length,i=At();rt(i,r);for(let s=0;s<r;s++){const r=t[s],o=n.get(r)||null,a=e.meta.get(r).clock;rt(i,r),rt(i,a),Ie(i,JSON.stringify(o))}return ht(i)};function Rr(e){return{engine:e,execute(){},isActive:()=>!1,isEnabled:()=>!1,getValue(){},subscribe:()=>()=>{}}}var Dr=[{kind:"button",id:"undo",label:"Undo",icon:Cr,shortcut:"⌘Z"},{kind:"button",id:"redo",label:"Redo",icon:ur,shortcut:"⇧⌘Z"},{kind:"separator",id:"history-divider"},{kind:"button",id:"bold",label:"Bold",icon:Un,shortcut:"⌘B"},{kind:"button",id:"italic",label:"Italic",icon:tr,shortcut:"⌘I"},{kind:"button",id:"underline",label:"Underline",icon:kr,shortcut:"⌘U"},{kind:"button",id:"highlight",label:"Highlight",icon:Kn,shortcut:"⌘⇧H"},{kind:"separator",id:"marks-divider"},{kind:"menu",id:"block-format",label:"Block Format",icon:fr,children:[{kind:"button",id:"paragraph",label:"Paragraph",icon:lr},{kind:"button",id:"heading-1",label:"Heading 1",icon:Vn,shortcut:"Ctrl+Alt+1"},{kind:"button",id:"heading-2",label:"Heading 2",icon:zn,shortcut:"Ctrl+Alt+2"},{kind:"button",id:"heading-3",label:"Heading 3",icon:$n,shortcut:"Ctrl+Alt+3"},{kind:"button",id:"heading-4",label:"Heading 4",icon:Yn,shortcut:"Ctrl+Alt+4"},{kind:"button",id:"heading-5",label:"Heading 5",icon:Jn,shortcut:"Ctrl+Alt+5"},{kind:"button",id:"heading-6",label:"Heading 6",icon:Qn,shortcut:"Ctrl+Alt+6"},{kind:"separator",id:"block-format-lists-divider"},{kind:"button",id:"bullet-list",label:"Bullet List",icon:rr,shortcut:"Ctrl+Shift+8"},{kind:"button",id:"ordered-list",label:"Ordered List",icon:sr,shortcut:"Ctrl+Shift+7"},{kind:"button",id:"task-list",label:"Check List",icon:ir,shortcut:"Ctrl+Shift+9"},{kind:"separator",id:"block-format-quote-divider"},{kind:"button",id:"blockquote",label:"Blockquote",icon:dr,shortcut:"Ctrl+Shift+B"},{kind:"button",id:"code-block",label:"Code Block",icon:Bn,shortcut:"Ctrl+Alt+C"},{kind:"separator",id:"block-format-clear-divider"},{kind:"button",id:"clear-formatting",label:"Clear Format",icon:Hn}]},{kind:"menu",id:"text-styles",label:"Text Styles",icon:_r,children:[{kind:"group-label",id:"text-styles-label",label:"Text Styles"},{kind:"button",id:"strike",label:"Strikethrough",icon:mr,shortcut:"Ctrl+Shift+S"},{kind:"button",id:"code",label:"Inline Code",icon:Fn,shortcut:"Ctrl+E"},{kind:"button",id:"text-color",label:"Text Color",icon:In,shortcut:"Alt+Shift+C"},{kind:"button",id:"superscript",label:"Superscript",icon:br,shortcut:"Ctrl+."},{kind:"button",id:"subscript",label:"Subscript",icon:yr,shortcut:"Ctrl+,"},{kind:"separator",id:"text-styles-indent-divider"},{kind:"button",id:"indent",label:"Indent",icon:Zn},{kind:"button",id:"outdent",label:"Outdent",icon:Xn},{kind:"menu",id:"alignment",label:"Alignment",icon:Mn,children:[{kind:"button",id:"align-left",label:"Align Left",icon:Mn},{kind:"button",id:"align-center",label:"Align Center",icon:Pn},{kind:"button",id:"align-right",label:"Align Right",icon:Nn},{kind:"button",id:"align-justify",label:"Justify",icon:Ln}]}]},{kind:"menu",id:"insert",label:"Insert",icon:hr,children:[{kind:"group-label",id:"insert-label",label:"Insert"},{kind:"button",id:"link",label:"Link",icon:nr},{kind:"button",id:"emoji",label:"Emoji",icon:pr},{kind:"button",id:"table",label:"Table",icon:wr},{kind:"button",id:"image",label:"Image",icon:Gn},{kind:"button",id:"columns",label:"Columns",icon:Wn,shortcut:"Ctrl+Alt+G"},{kind:"button",id:"callout",label:"Callout",icon:er},{kind:"button",id:"horizontal-rule",label:"Divider",icon:ar,shortcut:"Ctrl+Alt+S"},{kind:"button",id:"video",label:"Video",icon:Sr},{kind:"button",id:"math",label:"Math",icon:gr}]},{kind:"separator",id:"voice-divider"},{kind:"button",id:"transcribe",label:"Dictate",icon:or,shortcut:"Ctrl+Shift+D"},{kind:"menu",id:"table-tools",label:"Table",icon:wr,visibleWhenActive:"table",children:[{kind:"group-label",id:"table-rows-label",label:"Rows"},{kind:"button",id:"table.add-row-before",label:"Insert Row Above",icon:fr},{kind:"button",id:"table.add-row-after",label:"Insert Row Below",icon:fr},{kind:"button",id:"table.delete-row",label:"Delete Row",icon:vr},{kind:"separator",id:"table-columns-divider"},{kind:"group-label",id:"table-columns-label",label:"Columns"},{kind:"button",id:"table.add-column-before",label:"Insert Column Left",icon:Wn},{kind:"button",id:"table.add-column-after",label:"Insert Column Right",icon:Wn},{kind:"button",id:"table.delete-column",label:"Delete Column",icon:vr},{kind:"separator",id:"table-cells-divider"},{kind:"group-label",id:"table-cells-label",label:"Cells"},{kind:"button",id:"table.merge-cells",label:"Merge Cells",icon:jn},{kind:"button",id:"table.split-cell",label:"Split Cell",icon:jn},{kind:"button",id:"table.toggle-header-row",label:"Toggle Header Row",icon:fr},{kind:"separator",id:"table-delete-divider"},{kind:"button",id:"table.delete",label:"Delete Table",icon:vr}]}];function Or(e=Dr){const t=[];for(const n of e)"button"===n.kind&&t.push(n.id),"menu"===n.kind&&t.push(...Or(n.children));return t}var Pr="flex items-center justify-center rounded p-1.5 text-gray-600 transition-colors dark:text-gray-300 disabled:cursor-not-allowed disabled:opacity-40 hover:enabled:bg-gray-100 dark:hover:enabled:bg-slate-800",Lr="bg-gray-200 text-gray-900 dark:bg-slate-700 dark:text-white",Mr="flex w-full cursor-pointer items-center gap-2 text-xs data-disabled:cursor-not-allowed data-disabled:opacity-40";function Nr({shortcut:e}){return e?/* @__PURE__ */Dn("span",{className:"ml-auto pl-4 text-[10px] tracking-widest text-gray-400 dark:text-gray-500",children:e}):null}function Ir({items:e,adapter:t}){/* @__PURE__ */
2
2
  return Dn(Rn,{children:e.map(e=>{if("separator"===e.kind)/* @__PURE__ */return Dn(Se,{},e.id);if("group-label"===e.kind)/* @__PURE__ */return Dn(we,{className:"px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-gray-400",children:e.label},e.id);if("menu"===e.kind){const n=e.icon;/* @__PURE__ */
3
3
  return On(me,{children:[/* @__PURE__ */On(be,{className:Mr,children:[/* @__PURE__ */Dn(n,{className:"size-3.5 shrink-0 text-gray-500 dark:text-gray-400"}),e.label]}),/* @__PURE__ */Dn(ke,{children:/* @__PURE__ */Dn(ve,{className:"min-w-[200px]",children:/* @__PURE__ */Dn(Ir,{items:e.children,adapter:t})})})]},e.id)}const n=e.icon,i=t.isActive(e.id);/* @__PURE__ */
4
4
  return On(pe,{"aria-pressed":i,className:r(Mr,i&&Lr),"data-command":e.id,"data-state":i?"active":"inactive",disabled:!t.isEnabled(e.id),onSelect:()=>{t.execute(e.id)},children:[
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./tooltip-DSRLxJD_.cjs"),t=require("./editorConfig-2pHxtmeI.cjs"),r=require("./BubbleMenus-F5PFH6eV.cjs"),o=require("./RichTextProvider-DJWvDmyS.cjs"),s=require("./externalLibsMode-aLfijcGX.cjs");exports.BubbleMenus=r.BubbleMenus,exports.NovelEditor=t.NovelEditor,exports.RichTextProvider=o.RichTextProvider,exports.RichTextToolbar=r.RichTextToolbar,exports.SHORTCUTS_STORAGE_KEY=e.SHORTCUTS_STORAGE_KEY,exports.SHORTCUT_ACTIONS=e.SHORTCUT_ACTIONS,exports.ShortcutOverrides=t.ShortcutOverrides,exports.buildExtensions=t.buildExtensions,exports.createDefaultConfig=t.createDefaultConfig,exports.debounce=t.debounce,exports.externalLibsModeActions=s.externalLibsModeActions,exports.findActionByCurrentKeys=e.findActionByCurrentKeys,exports.findActionByDefaultKeys=e.findActionByDefaultKeys,exports.getExternalLibsMode=s.getExternalLibsMode,exports.getShortcutAction=e.getShortcutAction,exports.getShortcutBinding=e.getShortcutBinding,exports.getShortcutOverrides=e.getShortcutOverrides,exports.handleShortcutKeyDown=t.handleShortcutKeyDown,exports.hasCommandModifier=e.hasCommandModifier,exports.isShortcutOverridden=e.isShortcutOverridden,exports.keysFromEvent=e.keysFromEvent,exports.normalizeKeys=e.normalizeKeys,exports.resetAllShortcuts=e.resetAllShortcuts,exports.serializeKeys=e.serializeKeys,exports.setShortcutBinding=e.setShortcutBinding,exports.subscribeShortcuts=e.subscribeShortcuts,exports.useExternalLibsMode=s.useExternalLibsMode,exports.useLiveShortcutKeys=e.useLiveShortcutKeys,exports.useNovelEditor=t.useNovelEditor,exports.useShortcutOverrides=e.useShortcutOverrides;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./rolldown-runtime-BeavJI0R.cjs");const e=require("./tooltip-DSRLxJD_.cjs"),t=require("./editorConfig-DF8EAH_P.cjs"),r=require("./BubbleMenus-3RiQc4lw.cjs"),o=require("./RichTextProvider-KRSFedCE.cjs"),s=require("./externalLibsMode-aLfijcGX.cjs");exports.BubbleMenus=r.BubbleMenus,exports.NovelEditor=t.NovelEditor,exports.RichTextProvider=o.RichTextProvider,exports.RichTextToolbar=r.RichTextToolbar,exports.SHORTCUTS_STORAGE_KEY=e.SHORTCUTS_STORAGE_KEY,exports.SHORTCUT_ACTIONS=e.SHORTCUT_ACTIONS,exports.ShortcutOverrides=t.ShortcutOverrides,exports.buildExtensions=t.buildExtensions,exports.createDefaultConfig=t.createDefaultConfig,exports.debounce=t.debounce,exports.externalLibsModeActions=s.externalLibsModeActions,exports.findActionByCurrentKeys=e.findActionByCurrentKeys,exports.findActionByDefaultKeys=e.findActionByDefaultKeys,exports.getExternalLibsMode=s.getExternalLibsMode,exports.getShortcutAction=e.getShortcutAction,exports.getShortcutBinding=e.getShortcutBinding,exports.getShortcutOverrides=e.getShortcutOverrides,exports.handleShortcutKeyDown=t.handleShortcutKeyDown,exports.hasCommandModifier=e.hasCommandModifier,exports.isShortcutOverridden=e.isShortcutOverridden,exports.keysFromEvent=e.keysFromEvent,exports.normalizeKeys=e.normalizeKeys,exports.resetAllShortcuts=e.resetAllShortcuts,exports.serializeKeys=e.serializeKeys,exports.setShortcutBinding=e.setShortcutBinding,exports.subscribeShortcuts=e.subscribeShortcuts,exports.useExternalLibsMode=s.useExternalLibsMode,exports.useLiveShortcutKeys=e.useLiveShortcutKeys,exports.useNovelEditor=t.useNovelEditor,exports.useShortcutOverrides=e.useShortcutOverrides;
@@ -1 +1 @@
1
- import{C as s,S as a,_ as o,b as r,c as t,d as i,f as m,g as e,h as p,l as f,m as n,p as j,u as b,v as d,w as l,x,y as g}from"./tooltip-G11f5UOp.js";import{a as h,g as u,h as c,i as v,n as w,r as C,t as M}from"./editorConfig-Duji4hwm.js";import{n as y,t as B}from"./BubbleMenus-eYDoohA4.js";import{t as L}from"./RichTextProvider-B5fdgtFs.js";import{n as P,r as R,t as S}from"./externalLibsMode-DEDBnK98.js";export{B as BubbleMenus,v as NovelEditor,L as RichTextProvider,y as RichTextToolbar,t as SHORTCUTS_STORAGE_KEY,f as SHORTCUT_ACTIONS,c as ShortcutOverrides,M as buildExtensions,w as createDefaultConfig,C as debounce,S as externalLibsModeActions,b as findActionByCurrentKeys,i as findActionByDefaultKeys,P as getExternalLibsMode,m as getShortcutAction,j as getShortcutBinding,n as getShortcutOverrides,u as handleShortcutKeyDown,p as hasCommandModifier,e as isShortcutOverridden,o as keysFromEvent,d as normalizeKeys,g as resetAllShortcuts,r as serializeKeys,x as setShortcutBinding,a as subscribeShortcuts,R as useExternalLibsMode,s as useLiveShortcutKeys,h as useNovelEditor,l as useShortcutOverrides};
1
+ import{C as s,S as a,_ as o,b as r,c as t,d as i,f as m,g as e,h as p,l as f,m as n,p as j,u as b,v as d,w as l,x,y as g}from"./tooltip-G11f5UOp.js";import{a as h,g as u,h as c,i as v,n as w,r as C,t as M}from"./editorConfig-9-ZxkRbw.js";import{n as y,t as B}from"./BubbleMenus-CFzQBrVG.js";import{t as L}from"./RichTextProvider-BcsYTR6Z.js";import{n as P,r as R,t as S}from"./externalLibsMode-DEDBnK98.js";export{B as BubbleMenus,v as NovelEditor,L as RichTextProvider,y as RichTextToolbar,t as SHORTCUTS_STORAGE_KEY,f as SHORTCUT_ACTIONS,c as ShortcutOverrides,M as buildExtensions,w as createDefaultConfig,C as debounce,S as externalLibsModeActions,b as findActionByCurrentKeys,i as findActionByDefaultKeys,P as getExternalLibsMode,m as getShortcutAction,j as getShortcutBinding,n as getShortcutOverrides,u as handleShortcutKeyDown,p as hasCommandModifier,e as isShortcutOverridden,o as keysFromEvent,d as normalizeKeys,g as resetAllShortcuts,r as serializeKeys,x as setShortcutBinding,a as subscribeShortcuts,R as useExternalLibsMode,s as useLiveShortcutKeys,h as useNovelEditor,l as useShortcutOverrides};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-Drgf5FY8.js";import{_ as t,b as n,h as a,l as r,p as o,r as i}from"./tooltip-G11f5UOp.js";import{n as s}from"./locales-rT_qjKW9.js";import{t as l}from"./Icon-B4rxamCu.js";import{c,s as d,t as u}from"./Comment-DcnVhRwn.js";import{t as m}from"./button-D_m2J53A.js";import{t as p}from"./checkbox-3vQdQTmi.js";import{a as g,n as h,t as f}from"./dialog-B9I9biS2.js";import{t as _}from"./input-BpHg1W4N.js";import{t as b}from"./label-BUOJNbea.js";import{t as y}from"./Callout-BLkbFKjv.js";import{i as w,n as k,r as v,t as x}from"./tabs-AkSfAjgK.js";import{a as E,n as A,o as S,r as N,t as C}from"./ImageCropper-BKS8Wf7X.js";import{i as M,n as T,t as L}from"./events.constant-DYciHxmk.js";import{o as j}from"./throttle-DxIKJnXC.js";import{c as I,d as R,o as O,u as z}from"./useButtonProps-Codtb0k0.js";import{r as P,t as B}from"./Video-5nw_Zeob.js";import{THEME as D,useTheme as H}from"./theme.js";import{i as $}from"./dist-CZLqkIGC.js";import{r as F,t as U}from"./Highlight-uXDlNgw3.js";import{i as q,r as K,t as W}from"./HorizontalRule-C7mAKdzL.js";import{i as Z,t as G}from"./Link-Cp3t5QrH.js";import{a as V,c as X,i as Q,o as Y,s as J,t as ee}from"./History-Cfbj6xTl.js";import{i as te,n as ne,r as ae,t as re}from"./dist-DmsQb3DT.js";import{r as oe,t as ie}from"./TextUnderline-Cqm5NQVW.js";import{r as se,t as le}from"./Blockquote-XivvfRm3.js";import{r as ce,t as de}from"./Bold-BqGD33ge.js";import{r as ue,t as me}from"./Code-DvYJ892R.js";import{r as pe,t as ge}from"./CodeBlock-DQsPPAcS.js";import{r as he,t as fe}from"./Heading-Dv1_d7LY.js";import{r as _e,t as be}from"./Italic-3mlmsxqN.js";import{r as ye,t as we}from"./Strike-CSxbYwpk.js";import{r as ke}from"./updatePosition-9oE0_0I2.js";import{t as ve}from"./ExportWord--CMls-Qy.js";import{OrderedList as xe}from"./OrderedList.js";import{BulletList as Ee}from"./BulletList.js";import{TaskList as Ae}from"./TaskList.js";import{Clear as Se}from"./Clear.js";import{FontFamily as Ne}from"./FontFamily.js";import{FontSize as Ce}from"./FontSize.js";import{t as Me}from"./Color-aQTmRpkX.js";import{t as Te}from"./Indent-BIk98fDV.js";import{t as Le}from"./TextAlign-Dun3_Ozv.js";import{LineHeight as je}from"./LineHeight.js";import{n as Ie}from"./Emoji-CTKm00BR.js";import{t as Re}from"./Attachment-BmQoshq_.js";import{t as Oe}from"./Katex-DRPWO2AM.js";import{t as ze}from"./ImageGif-DoRfosdY.js";import{t as Pe}from"./Table-Ol6ZySzq.js";import{n as Be,r as De,t as He}from"./Column-DO6MfrOQ.js";import{t as $e}from"./Twitter-CZHAICpz.js";import{t as Fe}from"./Mermaid-Xepkcc7M.js";import{SearchAndReplace as Ue}from"./SearchAndReplace.js";import{CodeView as qe}from"./CodeView.js";import{t as Ke}from"./ImportWord-cr386RpI.js";import{t as We}from"./ExportPdf-CrQVmD4l.js";import{t as Ze}from"./Harper--4-ylRQo.js";import{s as Ge,t as Ve,u as Xe}from"./Ai-B_8fziaT.js";import{t as Qe}from"./Drawio-s-Xgqy7a.js";import{ReadAloud as Ye}from"./ReadAloud.js";import{Transcribe as Je}from"./Transcribe.js";import{SelectSimilar as et}from"./SelectSimilar.js";import{t as tt}from"./Drawer-DxQEJt0B.js";import{t as nt}from"./Iframe-D_IjezyZ.js";import{t as at}from"./SlashCommand-Dqp5cELd.js";import{MarkdownPaste as rt}from"./MarkdownPaste.js";import{t as ot}from"./Mention-zOj4OhQe.js";import{t as it}from"./MoreMark-DOhnB4xI.js";import{TextDirection as st}from"./TextDirection.js";import{WordCount as lt}from"./WordCount.js";import{t as ct}from"./OfficePaste-BmPshTAb.js";import{t as dt}from"./Pagination-B8rfYYi_.js";import{EditorContext as ut,EditorProvider as mt,NodeViewWrapper as pt,ReactNodeViewRenderer as gt,ReactRenderer as ht,isNodeSelection as ft,useCurrentEditor as _t}from"@tiptap/react";import*as bt from"react";import yt,{createContext as wt,createElement as kt,forwardRef as vt,useCallback as xt,useContext as Et,useDebugValue as At,useEffect as St,useId as Nt,useMemo as Ct,useReducer as Mt,useRef as Tt,useState as Lt}from"react";import{Slot as jt}from"@radix-ui/react-slot";import{Extension as It,InputRule as Rt,Mark as Ot,Node as zt,createAtomBlockMarkdownSpec as Pt,markInputRule as Bt,markPasteRule as Dt,mergeAttributes as Ht,nodePasteRule as $t}from"@tiptap/core";import{NodeSelection as Ft,Plugin as Ut,PluginKey as qt,TextSelection as Kt}from"@tiptap/pm/state";import{Fragment as Wt,jsx as Zt,jsxs as Gt}from"react/jsx-runtime";import*as Vt from"@radix-ui/react-dialog";import{BubbleMenu as Xt}from"@tiptap/react/menus";import Qt from"use-sync-external-store/shim/with-selector.js";import*as Yt from"@tiptap/pm/view";import{Decoration as Jt,DecorationSet as en}from"@tiptap/pm/view";import{Fragment as tn,Slice as nn}from"@tiptap/pm/model";import an from"katex";import{Tweet as rn}from"react-tweet";import{createLowlight as on}from"lowlight";function sn(e,i){const s=t(i);if(!s)return!1;const l=n(s);for(const t of r){if(!t.run)continue;const r=n(t.defaultKeys),s=n(o(t.id)),c=s!==r;if(c||t.alwaysHandle){if(l===s)return i.preventDefault(),t.run(e),!0;if(c&&l===r&&a(t.defaultKeys))return i.preventDefault(),!0}}return!1}var ln=It.create({name:"shortcutOverrides",priority:1e4,addProseMirrorPlugins(){const e=this.editor;return[new Ut({key:new qt("shortcutOverrides"),props:{handleKeyDown:(t,n)=>sn(e,n)}})]}}),cn=Object.defineProperty,dn=(e,t)=>cn(e,"name",{value:t,configurable:!0});function un(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function mn(...e){return t=>{let n=!1;const a=e.map(e=>{const a=un(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t];"function"==typeof n?n():un(e[t],null)}}}}function pn(...e){return bt.useCallback(mn(...e),e)}dn(un,"setRef"),dn(mn,"composeRefs"),dn(pn,"useComposedRefs");var gn=Object.defineProperty,hn=bt[" useId ".trim().toString()]||(()=>{}),fn=0;function _n(e){const[t,n]=bt.useState(hn());return c(()=>{e||n(e=>e??String(fn++))},[e]),e||(t?`radix-${t}`:"")}function bn(){const{t:e}=s(),{toast:t}=S(),n=R(),{editorDisabled:a}=I(),[r,o]=Lt(!1),i=L.UPLOAD_IMAGE(n.id);M(o,[i]);const[c,d]=Lt(!1),u=O(N.name),[y,T]=Lt(""),[j,z]=Lt(""),P=Tt(null),B=u?.options.defaultInline||!1,[D,H]=Lt(B),$=Ct(()=>u?.options||A,[u]);return a?/* @__PURE__ */Zt(Wt,{}):/* @__PURE__ */Zt(f,{onOpenChange:o,open:r,children:/* @__PURE__ */Gt(h,{children:[/* @__PURE__ */Zt(g,{children:e("editor.image.dialog.title")}),/* @__PURE__ */Gt(x,{activationMode:"manual",defaultValue:"both"===$.resourceImage||"upload"===$.resourceImage?"upload":"link",children:["both"===$.resourceImage&&/* @__PURE__ */Gt(v,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[/* @__PURE__ */Zt(w,{value:"upload",children:e("editor.image.dialog.tab.upload")}),/* @__PURE__ */Zt(w,{value:"link",children:e("editor.image.dialog.tab.url")})]}),
1
+ import{r as e}from"./rolldown-runtime-Drgf5FY8.js";import{_ as t,b as n,h as a,l as r,p as o,r as i}from"./tooltip-G11f5UOp.js";import{n as s}from"./locales-rT_qjKW9.js";import{t as l}from"./Icon-B4rxamCu.js";import{c,s as d,t as u}from"./Comment-DcnVhRwn.js";import{t as m}from"./button-D_m2J53A.js";import{t as p}from"./checkbox-3vQdQTmi.js";import{a as g,n as h,t as f}from"./dialog-B9I9biS2.js";import{t as _}from"./input-BpHg1W4N.js";import{t as b}from"./label-BUOJNbea.js";import{t as y}from"./Callout-BLkbFKjv.js";import{i as w,n as k,r as v,t as x}from"./tabs-AkSfAjgK.js";import{a as E,n as A,o as S,r as N,t as C}from"./ImageCropper-BKS8Wf7X.js";import{i as M,n as T,t as L}from"./events.constant-DYciHxmk.js";import{o as j}from"./throttle-DxIKJnXC.js";import{c as I,d as R,o as O,u as z}from"./useButtonProps-Codtb0k0.js";import{r as P,t as B}from"./Video-5nw_Zeob.js";import{THEME as D,useTheme as H}from"./theme.js";import{i as $}from"./dist-CZLqkIGC.js";import{r as F,t as U}from"./Highlight-uXDlNgw3.js";import{i as q,r as K,t as W}from"./HorizontalRule-C7mAKdzL.js";import{i as Z,t as G}from"./Link-Cp3t5QrH.js";import{a as V,c as X,i as Q,o as Y,s as J,t as ee}from"./History-Cfbj6xTl.js";import{i as te,n as ne,r as ae,t as re}from"./dist-DmsQb3DT.js";import{r as oe,t as ie}from"./TextUnderline-Cqm5NQVW.js";import{r as se,t as le}from"./Blockquote-XivvfRm3.js";import{r as ce,t as de}from"./Bold-BqGD33ge.js";import{r as ue,t as me}from"./Code-DvYJ892R.js";import{r as pe,t as ge}from"./CodeBlock-DQsPPAcS.js";import{r as he,t as fe}from"./Heading-Dv1_d7LY.js";import{r as _e,t as be}from"./Italic-3mlmsxqN.js";import{r as ye,t as we}from"./Strike-CSxbYwpk.js";import{r as ke}from"./updatePosition-9oE0_0I2.js";import{t as ve}from"./ExportWord--CMls-Qy.js";import{OrderedList as xe}from"./OrderedList.js";import{BulletList as Ee}from"./BulletList.js";import{TaskList as Ae}from"./TaskList.js";import{Clear as Se}from"./Clear.js";import{FontFamily as Ne}from"./FontFamily.js";import{FontSize as Ce}from"./FontSize.js";import{t as Me}from"./Color-aQTmRpkX.js";import{t as Te}from"./Indent-BIk98fDV.js";import{t as Le}from"./TextAlign-Dun3_Ozv.js";import{LineHeight as je}from"./LineHeight.js";import{n as Ie}from"./Emoji-CTKm00BR.js";import{t as Re}from"./Attachment-BmQoshq_.js";import{t as Oe}from"./Katex-DRPWO2AM.js";import{t as ze}from"./ImageGif-DoRfosdY.js";import{t as Pe}from"./Table-Ol6ZySzq.js";import{n as Be,r as De,t as He}from"./Column-DO6MfrOQ.js";import{t as $e}from"./Twitter-CZHAICpz.js";import{t as Fe}from"./Mermaid-Xepkcc7M.js";import{SearchAndReplace as Ue}from"./SearchAndReplace.js";import{CodeView as qe}from"./CodeView.js";import{t as Ke}from"./ImportWord-DtON-y5N.js";import{t as We}from"./ExportPdf-CrQVmD4l.js";import{t as Ze}from"./Harper--4-ylRQo.js";import{s as Ge,t as Ve,u as Xe}from"./Ai-B_8fziaT.js";import{t as Qe}from"./Drawio-s-Xgqy7a.js";import{ReadAloud as Ye}from"./ReadAloud.js";import{Transcribe as Je}from"./Transcribe.js";import{SelectSimilar as et}from"./SelectSimilar.js";import{t as tt}from"./Drawer-DxQEJt0B.js";import{t as nt}from"./Iframe-D_IjezyZ.js";import{t as at}from"./SlashCommand-Dqp5cELd.js";import{MarkdownPaste as rt}from"./MarkdownPaste.js";import{t as ot}from"./Mention-zOj4OhQe.js";import{t as it}from"./MoreMark-DOhnB4xI.js";import{TextDirection as st}from"./TextDirection.js";import{WordCount as lt}from"./WordCount.js";import{t as ct}from"./OfficePaste-BmPshTAb.js";import{t as dt}from"./Pagination-DYCCm6cp.js";import{EditorContext as ut,EditorProvider as mt,NodeViewWrapper as pt,ReactNodeViewRenderer as gt,ReactRenderer as ht,isNodeSelection as ft,useCurrentEditor as _t}from"@tiptap/react";import*as bt from"react";import yt,{createContext as wt,createElement as kt,forwardRef as vt,useCallback as xt,useContext as Et,useDebugValue as At,useEffect as St,useId as Nt,useMemo as Ct,useReducer as Mt,useRef as Tt,useState as Lt}from"react";import{Slot as jt}from"@radix-ui/react-slot";import{Extension as It,InputRule as Rt,Mark as Ot,Node as zt,createAtomBlockMarkdownSpec as Pt,markInputRule as Bt,markPasteRule as Dt,mergeAttributes as Ht,nodePasteRule as $t}from"@tiptap/core";import{NodeSelection as Ft,Plugin as Ut,PluginKey as qt,TextSelection as Kt}from"@tiptap/pm/state";import{Fragment as Wt,jsx as Zt,jsxs as Gt}from"react/jsx-runtime";import*as Vt from"@radix-ui/react-dialog";import{BubbleMenu as Xt}from"@tiptap/react/menus";import Qt from"use-sync-external-store/shim/with-selector.js";import*as Yt from"@tiptap/pm/view";import{Decoration as Jt,DecorationSet as en}from"@tiptap/pm/view";import{Fragment as tn,Slice as nn}from"@tiptap/pm/model";import an from"katex";import{Tweet as rn}from"react-tweet";import{createLowlight as on}from"lowlight";function sn(e,i){const s=t(i);if(!s)return!1;const l=n(s);for(const t of r){if(!t.run)continue;const r=n(t.defaultKeys),s=n(o(t.id)),c=s!==r;if(c||t.alwaysHandle){if(l===s)return i.preventDefault(),t.run(e),!0;if(c&&l===r&&a(t.defaultKeys))return i.preventDefault(),!0}}return!1}var ln=It.create({name:"shortcutOverrides",priority:1e4,addProseMirrorPlugins(){const e=this.editor;return[new Ut({key:new qt("shortcutOverrides"),props:{handleKeyDown:(t,n)=>sn(e,n)}})]}}),cn=Object.defineProperty,dn=(e,t)=>cn(e,"name",{value:t,configurable:!0});function un(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function mn(...e){return t=>{let n=!1;const a=e.map(e=>{const a=un(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t<a.length;t++){const n=a[t];"function"==typeof n?n():un(e[t],null)}}}}function pn(...e){return bt.useCallback(mn(...e),e)}dn(un,"setRef"),dn(mn,"composeRefs"),dn(pn,"useComposedRefs");var gn=Object.defineProperty,hn=bt[" useId ".trim().toString()]||(()=>{}),fn=0;function _n(e){const[t,n]=bt.useState(hn());return c(()=>{e||n(e=>e??String(fn++))},[e]),e||(t?`radix-${t}`:"")}function bn(){const{t:e}=s(),{toast:t}=S(),n=R(),{editorDisabled:a}=I(),[r,o]=Lt(!1),i=L.UPLOAD_IMAGE(n.id);M(o,[i]);const[c,d]=Lt(!1),u=O(N.name),[y,T]=Lt(""),[j,z]=Lt(""),P=Tt(null),B=u?.options.defaultInline||!1,[D,H]=Lt(B),$=Ct(()=>u?.options||A,[u]);return a?/* @__PURE__ */Zt(Wt,{}):/* @__PURE__ */Zt(f,{onOpenChange:o,open:r,children:/* @__PURE__ */Gt(h,{children:[/* @__PURE__ */Zt(g,{children:e("editor.image.dialog.title")}),/* @__PURE__ */Gt(x,{activationMode:"manual",defaultValue:"both"===$.resourceImage||"upload"===$.resourceImage?"upload":"link",children:["both"===$.resourceImage&&/* @__PURE__ */Gt(v,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[/* @__PURE__ */Zt(w,{value:"upload",children:e("editor.image.dialog.tab.upload")}),/* @__PURE__ */Zt(w,{value:"link",children:e("editor.image.dialog.tab.url")})]}),
2
2
  /* @__PURE__ */Gt("div",{className:"richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]",children:[/* @__PURE__ */Zt(p,{checked:D,onCheckedChange:e=>{H(e)}}),/* @__PURE__ */Zt(b,{children:e("editor.link.dialog.inline")})]}),$.enableAlt&&/* @__PURE__ */Gt("div",{className:"richtext-my-[10px]",children:[/* @__PURE__ */Zt(b,{className:"mb-[6px]",children:e("editor.imageUpload.alt")}),/* @__PURE__ */Zt(_,{onChange:e=>z(e.target.value),required:!0,type:"text",value:j})]}),
3
3
  /* @__PURE__ */Gt(k,{value:"upload",children:[/* @__PURE__ */Gt("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:[/* @__PURE__ */Zt(m,{className:"richtext-mt-1 richtext-w-full",disabled:c,onClick:function(e){e.preventDefault(),P.current?.click()},size:"sm",children:c?/* @__PURE__ */Gt(Wt,{children:[e("editor.imageUpload.uploading"),/* @__PURE__ */Zt(l,{className:"richtext-ml-1 richtext-animate-spin",name:"Loader"})]}):e("editor.image.dialog.tab.upload")}),/* @__PURE__ */Zt(C,{alt:j,disabled:c,editor:n,imageInline:D,onClose:()=>{z("")}})]}),/* @__PURE__ */Zt("input",{accept:$?.acceptMimes?.join(",")||"image/*",multiple:$.multiple,onChange:async function(a){const r=a?.target?.files;if(!n||n.isDestroyed||0===r.length||c)return void(a.target.value="");const i=E(r,{acceptMimes:$?.acceptMimes,maxSize:$?.maxSize,t:e,toast:t,onError:$.onError});if(i.length<=0)a.target.value="";else{d(!0);try{if($?.multiple){const e=i.map(async e=>{let t="";return t=$.upload?await $.upload(e):URL.createObjectURL(e),t});(await Promise.all(e)).forEach(e=>{n.chain().focus().setImageInline({src:e,inline:D,alt:j}).run()})}else{const e=i[0];let t="";t=$.upload?await $.upload(e):URL.createObjectURL(e),n.chain().focus().setImageInline({src:t,inline:D,alt:j}).run()}o(!1),z(""),H(B)}catch(s){$.onError?$.onError({type:"upload",message:e("editor.upload.error")}):t({variant:"destructive",title:e("editor.upload.error")})}finally{d(!1),a.target.value=""}}},ref:P,style:{display:"none"},type:"file"})]}),
4
4
  /* @__PURE__ */Zt(k,{value:"link",children:/* @__PURE__ */Zt("form",{onSubmit:function(e){e.preventDefault(),e.stopPropagation(),n.chain().focus().setImageInline({src:y,inline:D,alt:j}).run(),o(!1),H(B),T(""),z("")},children:/* @__PURE__ */Gt("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[/* @__PURE__ */Zt(_,{autoFocus:!0,onChange:e=>T(e.target.value),placeholder:e("editor.image.dialog.placeholder"),required:!0,type:"url",value:y}),/* @__PURE__ */Zt(m,{type:"submit",children:e("editor.image.dialog.button.apply")})]})})})]})]})})}function yn(){const{t:e}=s(),t=R(),{editorDisabled:n}=I(),[a,r]=Lt(""),o=Tt(null),[i,l]=Lt(""),[c,d]=Lt(!1),u=O(B.name),p=L.UPLOAD_VIDEO(t.id);M(d,[p]);const b=Ct(()=>u?.options??{},[u]);return n?/* @__PURE__ */Zt(Wt,{}):/* @__PURE__ */Zt(f,{onOpenChange:d,open:c,children:/* @__PURE__ */Gt(h,{children:[/* @__PURE__ */Zt(g,{children:e("editor.video.dialog.title")}),/* @__PURE__ */Gt(x,{activationMode:"manual",defaultValue:"both"===b?.resourceVideo||"upload"===b?.resourceVideo?"upload":"link",children:[