reactjs-tiptap-editor 1.0.11 → 1.0.13
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.
- package/lib/ActionMenuButton-DNj0f_A4.cjs +1 -0
- package/lib/{ActionMenuButton-DTXFBdGX.js → ActionMenuButton-l5rSmAO_.js} +18 -14
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +24 -21
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +7 -5
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +11 -9
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +14 -12
- package/lib/Callout.cjs +1 -0
- package/lib/Callout.js +230 -0
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +11 -9
- package/lib/CodeBlock.cjs +39 -39
- package/lib/CodeBlock.js +840 -945
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +10 -8
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +20 -18
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +7 -5
- package/lib/{Drawer-D0yQ0wR7.js → Drawer-Cbi_MURj.js} +10 -9
- package/lib/Drawer-DKU32YW_.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +11 -9
- package/lib/{Excalidraw-CO4IRHmG.js → Excalidraw-CWrVL5hs.js} +28 -27
- package/lib/Excalidraw-Kb-TRcWY.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +2 -2
- package/lib/ExportPdf.js +7 -5
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +7 -5
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +9 -8
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +13 -12
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +20 -19
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +9 -7
- package/lib/History.cjs +1 -1
- package/lib/History.js +11 -8
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +7 -5
- package/lib/Icon-Ctva8VeB.js +12 -0
- package/lib/Icon-yqCglrdK.cjs +1 -0
- package/lib/Iframe-BczF8Hex.cjs +1 -0
- package/lib/{Iframe-BEO28NPs.js → Iframe-C942bNjs.js} +42 -40
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +25 -23
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +50 -48
- package/lib/ImportWord.cjs +31 -31
- package/lib/ImportWord.js +8 -6
- package/lib/{Indent-CXurBbOr.js → Indent-C_O5WdyR.js} +26 -24
- package/lib/Indent-CkEC7x36.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +12 -10
- package/lib/{Katex-Bvj469K1.js → Katex-D3PEWimM.js} +12 -10
- package/lib/Katex-DW_HjgNM.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +10 -8
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-8ePAZ-G1.cjs → LinkEditBlock-DL1e2ILk.cjs} +1 -1
- package/lib/{LinkEditBlock-DjXUEubR.js → LinkEditBlock-h5054QDo.js} +22 -20
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +3 -3
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +8 -8
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +25 -22
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +10 -8
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +43 -41
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +6 -6
- package/lib/SlashCommandNodeView-BqrmHCpu.cjs +1 -0
- package/lib/{SlashCommandNodeView-CcqL8ymb.js → SlashCommandNodeView-DXUqkx82.js} +75 -66
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +7 -5
- package/lib/{Table-9Y0Cg8Ab.js → Table-DdrY4jcM.js} +10 -8
- package/lib/Table-kY0nbqJo.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +15 -13
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +20 -17
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +20 -17
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +7 -5
- package/lib/{Twitter-DWwd0vHR.js → Twitter-B-JQ3ZJ1.js} +51 -49
- package/lib/Twitter-DjZcVa3l.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +13 -11
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +2084 -1949
- package/lib/button-BS3n6_Aq.cjs +1 -0
- package/lib/{button-RnHbJfd-.js → button-Uv01FNnd.js} +9 -8
- package/lib/{checkbox-CTEN0q4y.cjs → checkbox-C8ByRi7-.cjs} +1 -1
- package/lib/{checkbox-CLSoR1Qj.js → checkbox-DEFNwGwb.js} +1 -1
- package/lib/{index-sVScpCFG.js → clsx-BWSGDJNJ.js} +224 -224
- package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
- package/lib/components/Bubble/RichTextBubbleCallout.d.ts +1 -0
- package/lib/components/Bubble/index.d.ts +1 -0
- package/lib/components/ui/index.d.ts +1 -0
- package/lib/{dialog-CMC9hsCo.cjs → dialog-Bt5zwGYB.cjs} +1 -1
- package/lib/{dialog-D_HCtKvc.js → dialog-DwTMZSt6.js} +1 -1
- package/lib/{dropdown-menu-66q7Ofc5.js → dropdown-menu-BetI14G6.js} +1 -1
- package/lib/{dropdown-menu-DKSAS-w_.cjs → dropdown-menu-Bo68IEOT.cjs} +1 -1
- package/lib/events.constant-Dq21NPdV.cjs +1 -0
- package/lib/events.constant-do95b767.js +21 -0
- package/lib/extensions/Callout/Callout.d.ts +18 -0
- package/lib/extensions/Callout/components/NodeViewCallout/NodeViewCallout.d.ts +1 -0
- package/lib/extensions/Callout/components/RichTextCallout.d.ts +1 -0
- package/lib/extensions/Callout/index.d.ts +1 -0
- package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
- package/lib/{index-9A6-kVBM.js → index-BDKHXe7R.js} +1 -1
- package/lib/{index-DmPwbBqm.js → index-CHKWG6E8.js} +1 -1
- package/lib/index-CcoWj0mF.js +426 -0
- package/lib/index-CjhjjJsN.cjs +1 -0
- package/lib/index-Cs6cp0Y6.cjs +1 -0
- package/lib/index-D3RLYf-J.cjs +1 -0
- package/lib/{index-C3zg3DPB.js → index-DF5ZPtWM.js} +371 -1177
- package/lib/{index-DRHrDScg.js → index-DJbmnBzK.js} +1 -1
- package/lib/index-Doks9cbR.cjs +1 -0
- package/lib/{index-0OnGZkVF.js → index-Dujzr6bY.js} +179 -317
- package/lib/index-VhKd73hZ.cjs +1 -0
- package/lib/{index-DKt5wfAc.js → index-mR8PNv5P.js} +1 -1
- package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
- package/lib/index.cjs +9 -2
- package/lib/index.js +142 -26
- package/lib/{input-CvyMYMZG.js → input-DUBdJD3L.js} +5 -5
- package/lib/{input-D555880-.cjs → input-Dt_BA_9B.cjs} +1 -1
- package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
- package/lib/{isNumber-DF0fU3ob.js → isNumber-CIgubz2e.js} +1 -1
- package/lib/label-JNOksCA-.cjs +1 -0
- package/lib/label-topD46-u.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.js +6 -7
- package/lib/locales/en.d.ts +16 -0
- package/lib/locales/fi.d.ts +16 -0
- package/lib/locales/hu.d.ts +16 -0
- package/lib/locales/index.d.ts +99 -4316
- package/lib/locales/pt-br.d.ts +16 -0
- package/lib/locales/vi.d.ts +16 -0
- package/lib/locales/zh-cn.d.ts +16 -0
- package/lib/{popover-B7ec5-u2.js → popover-LfNBhRyz.js} +1 -1
- package/lib/{popover-BSzR_R01.cjs → popover-mL-2sX5r.cjs} +1 -1
- package/lib/react-BEoMZB61.cjs +1 -0
- package/lib/react-c9FSfB30.js +27 -0
- package/lib/select-CwGYPsPq.cjs +1 -0
- package/lib/select-DctYuHLH.js +117 -0
- package/lib/separator-Ddfrhn4D.js +329 -0
- package/lib/separator-NoH_SLRW.cjs +1 -0
- package/lib/store/EditorEditableReactive.d.ts +1 -0
- package/lib/store/ThemeColorReactive.d.ts +1 -0
- package/lib/store/commandList.d.ts +1 -1
- package/lib/store/store.d.ts +6 -7
- package/lib/store-CkjKIgjQ.cjs +1 -0
- package/lib/store-DNpS8vXA.js +10 -0
- package/lib/style.css +1 -1
- package/lib/{tabs-CWr9HYaM.js → tabs-BT3AeqQQ.js} +1 -1
- package/lib/{tabs-BTwiZkWd.cjs → tabs-DRSwUeKP.cjs} +1 -1
- package/lib/{textarea-Yetl_PZi.cjs → textarea-BDO6XQoF.cjs} +1 -1
- package/lib/{textarea-BdeLXbp8.js → textarea-DZzMEDfZ.js} +1 -1
- package/lib/theme/theme.d.ts +5 -0
- package/lib/theme.cjs +1 -1
- package/lib/theme.js +37 -8
- package/lib/{throttle-DsowOft0.js → throttle-IERhwcLa.js} +1 -1
- package/lib/throttle-gTTvqDTW.cjs +1 -0
- package/lib/toggle-BQHMh_Q-.cjs +1 -0
- package/lib/toggle-DKHg5sLm.js +99 -0
- package/lib/tooltip-BYtGp6FM.cjs +1 -0
- package/lib/tooltip-DNKq7zgN.js +24 -0
- package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-Bie75EFq.js} +2 -2
- package/lib/updatePosition-Cjuj2E26.cjs +1 -0
- package/lib/useButtonProps-DBJkNDS2.cjs +1 -0
- package/lib/{useButtonProps-cMoicZgd.js → useButtonProps-DVP4s_ER.js} +48 -36
- package/lib/utils/customEvents/events.constant.d.ts +0 -5
- package/package.json +3 -3
- package/lib/ActionMenuButton-BLlse5KO.cjs +0 -1
- package/lib/Drawer-kv6BU_6O.cjs +0 -1
- package/lib/Excalidraw-B82ThkJA.cjs +0 -1
- package/lib/Icon-DRuJhcHK.js +0 -10
- package/lib/Icon-DXePECFW.cjs +0 -1
- package/lib/Iframe-03dn9wcM.cjs +0 -1
- package/lib/Indent-Cqjdn3Jt.cjs +0 -1
- package/lib/Katex-DdWTV5NJ.cjs +0 -4
- package/lib/SlashCommandNodeView-Bl_gwZJB.cjs +0 -1
- package/lib/Table-DBGjezZK.cjs +0 -9
- package/lib/Twitter-Cnvt7GBg.cjs +0 -1
- package/lib/button-BW5bDPz_.cjs +0 -1
- package/lib/events.constant-DQYeJpu5.cjs +0 -1
- package/lib/events.constant-wrlJ_7JZ.js +0 -26
- package/lib/index-BZ6DfR2r.cjs +0 -1
- package/lib/index-C838s-or.cjs +0 -8
- package/lib/index-Cv9Z6dyV.cjs +0 -1
- package/lib/index-FSRjMsxW.cjs +0 -1
- package/lib/label-DsOYPjAo.js +0 -18
- package/lib/label-E6jF3Xud.cjs +0 -1
- package/lib/separator-JaTTqb3J.js +0 -241
- package/lib/separator-PGnA-6Hr.cjs +0 -1
- package/lib/store/ProviderUniqueId.d.ts +0 -6
- package/lib/store-Cf7tFiiI.js +0 -10
- package/lib/store-oDk-lTPM.cjs +0 -1
- package/lib/throttle-BM3Bmbf_.cjs +0 -1
- package/lib/updatePosition-M2IyqkI1.cjs +0 -1
- package/lib/useButtonProps-DfnJiJLV.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const u=require("./index-BBNITgNi.cjs");var P={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},J={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lt=typeof navigator<"u"&&/Mac/.test(navigator.platform),st=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var y=0;y<10;y++)P[48+y]=P[96+y]=String(y);for(var y=1;y<=24;y++)P[y+111]="F"+y;for(var y=65;y<=90;y++)P[y]=String.fromCharCode(y+32),J[y]=String.fromCharCode(y);for(var te in P)J.hasOwnProperty(te)||(J[te]=P[te]);function it(e){var n=lt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||st&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",t=!n&&e.key||(e.shiftKey?J:P)[e.keyCode]||e.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const at=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ct=typeof navigator<"u"&&/Win/.test(navigator.platform);function ft(e){let n=e.split(/-(?!$)/),t=n[n.length-1];t=="Space"&&(t=" ");let r,o,l,s;for(let i=0;i<n.length-1;i++){let a=n[i];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))l=!0;else if(/^mod$/i.test(a))at?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(t="Alt-"+t),o&&(t="Ctrl-"+t),s&&(t="Meta-"+t),l&&(t="Shift-"+t),t}function dt(e){let n=Object.create(null);for(let t in e)n[ft(t)]=e[t];return n}function ne(e,n,t=!0){return n.altKey&&(e="Alt-"+e),n.ctrlKey&&(e="Ctrl-"+e),n.metaKey&&(e="Meta-"+e),t&&n.shiftKey&&(e="Shift-"+e),e}function ut(e){let n=dt(e);return function(t,r){let o=it(r),l,s=n[ne(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let i=n[ne(o,r,!1)];if(i&&i(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ct&&r.ctrlKey&&r.altKey)&&(l=P[r.keyCode])&&l!=o){let i=n[ne(l,r)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}const z=function(e){for(var n=0;;n++)if(e=e.previousSibling,!e)return n},Le=function(e,n,t,r){return t&&(Ne(e,n,t,r,-1)||Ne(e,n,t,r,1))},pt=/^(img|br|input|textarea|hr)$/i;function Ne(e,n,t,r,o){for(var l;;){if(e==t&&n==r)return!0;if(n==(o<0?0:G(e))){let s=e.parentNode;if(!s||s.nodeType!=1||ue(e)||pt.test(e.nodeName)||e.contentEditable=="false")return!1;n=z(e)+(o<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[n+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((l=s.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)n+=o;else return!1;else e=s,n=o<0?G(e):0}else return!1}}function G(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ht(e,n,t){for(let r=n==0,o=n==G(e);r||o;){if(e==t)return!0;let l=z(e);if(e=e.parentNode,!e)return!1;r=r&&l==0,o=o&&l==G(e)}}function ue(e){let n;for(let t=e;t&&!(n=t.pmViewDesc);t=t.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==e||n.contentDOM==e)}const ze=function(e){return e.focusNode&&Le(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ve(e,n){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=e,t.key=t.code=n,t}const x=typeof navigator<"u"?navigator:null,De=typeof document<"u"?document:null,$=x&&x.userAgent||"",le=/Edge\/(\d+)/.exec($),Fe=/MSIE \d/.exec($),se=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($),j=!!(Fe||se||le),Be=Fe?document.documentMode:se?+se[1]:le?+le[1]:0,v=!j&&/gecko\/(\d+)/i.test($);v&&+(/Firefox\/(\d+)/.exec($)||[0,0])[1];const ie=!j&&/Chrome\/(\d+)/.exec($),K=!!ie,qe=ie?+ie[1]:0,V=!j&&!!x&&/Apple Computer/.test(x.vendor),pe=V&&(/Mobile\/\w+/.test($)||!!x&&x.maxTouchPoints>2),C=pe||(x?/Mac/.test(x.platform):!1),mt=x?/Win/.test(x.platform):!1,X=/Android \d/.test($),he=!!De&&"webkitFontSmoothing"in De.documentElement.style,gt=he?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function yt(e,n=null){let t=e.domSelectionRange(),r=e.state.doc;if(!t.focusNode)return null;let o=e.docView.nearestDesc(t.focusNode),l=o&&o.size==0,s=e.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let i=r.resolve(s),a,c;if(ze(t)){for(a=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&u.NodeSelection.isSelectable(d)&&o.parent&&!(d.isInline&&ht(t.focusNode,t.focusOffset,o.dom))){let p=o.posBefore;c=new u.NodeSelection(s==p?i:r.resolve(p))}}else{if(t instanceof e.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=s,p=s;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);d=Math.min(d,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(d<0)return null;[a,s]=p==e.state.selection.anchor?[p,d]:[d,p],i=r.resolve(s)}else a=e.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let f=r.resolve(a);if(!c){let d=n=="pointer"||e.state.selection.head<i.pos&&!l?1:-1;c=We(e,f,i,d)}return c}function He(e){return e.editable?e.hasFocus():Nt(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function me(e,n=!1){let t=e.state.selection;if(Ct(e,t),!!He(e)){if(!n&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&K){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Le(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)St(e);else{let{anchor:r,head:o}=t,l,s;ke&&!(t instanceof u.TextSelection)&&(t.$from.parent.inlineContent||(l=Te(e,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=Te(e,t.to))),e.docView.setSelection(r,o,e,n),ke&&(l&&xe(l),s&&xe(s)),t.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&bt(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const ke=V||K&&qe<63;function Te(e,n){let{node:t,offset:r}=e.docView.domFromPos(n,0),o=r<t.childNodes.length?t.childNodes[r]:null,l=r?t.childNodes[r-1]:null;if(V&&o&&o.contentEditable=="false")return re(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return re(o);if(l)return re(l)}}function re(e){return e.contentEditable="true",V&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function xe(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function bt(e){let n=e.dom.ownerDocument;n.removeEventListener("selectionchange",e.input.hideSelectionGuard);let t=e.domSelectionRange(),r=t.anchorNode,o=t.anchorOffset;n.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=o)&&(n.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!He(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function St(e){let n=e.domSelection();if(!n)return;let t=e.cursorWrapper.dom,r=t.nodeName=="IMG";r?n.collapse(t.parentNode,z(t)+1):n.collapse(t,0),!r&&!e.state.selection.visible&&j&&Be<=11&&(t.disabled=!0,t.disabled=!1)}function Ct(e,n){if(n instanceof u.NodeSelection){let t=e.docView.descAt(n.from);t!=e.lastSelectedViewDesc&&(Ee(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else Ee(e)}function Ee(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function We(e,n,t,r){return e.someProp("createSelectionBetween",o=>o(e,n,t))||u.TextSelection.between(n,t,r)}function Nt(e){let n=e.domSelectionRange();if(!n.anchorNode)return!1;try{return e.dom.contains(n.anchorNode.nodeType==3?n.anchorNode.parentNode:n.anchorNode)&&(e.editable||e.dom.contains(n.focusNode.nodeType==3?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function ae(e,n){let{$anchor:t,$head:r}=e.selection,o=n>0?t.max(r):t.min(r),l=o.parent.inlineContent?o.depth?e.doc.resolve(n>0?o.after():o.before()):null:o;return l&&u.Selection.findFrom(l,n)}function O(e,n){return e.dispatch(e.state.tr.setSelection(n).scrollIntoView()),!0}function Oe(e,n,t){let r=e.state.selection;if(r instanceof u.TextSelection)if(t.indexOf("s")>-1){let{$head:o}=r,l=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+l.nodeSize*(n<0?-1:1));return O(e,new u.TextSelection(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(n>0?"forward":"backward")){let o=ae(e.state,n);return o&&o instanceof u.NodeSelection?O(e,o):!1}else if(!(C&&t.indexOf("m")>-1)){let o=r.$head,l=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter,s;if(!l||l.isText)return!1;let i=n<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(s=e.docView.descAt(i))&&!s.contentDOM?u.NodeSelection.isSelectable(l)?O(e,new u.NodeSelection(n<0?e.state.doc.resolve(o.pos-l.nodeSize):o)):he?O(e,new u.TextSelection(e.state.doc.resolve(n<0?i:i+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof u.NodeSelection&&r.node.isInline)return O(e,new u.TextSelection(n>0?r.$to:r.$from));{let o=ae(e.state,n);return o?O(e,o):!1}}}function Q(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function H(e,n){let t=e.pmViewDesc;return t&&t.size==0&&(n<0||e.nextSibling||e.nodeName!="BR")}function F(e,n){return n<0?Dt(e):kt(e)}function Dt(e){let n=e.domSelectionRange(),t=n.focusNode,r=n.focusOffset;if(!t)return;let o,l,s=!1;for(v&&t.nodeType==1&&r<Q(t)&&H(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let i=t.childNodes[r-1];if(H(i,-1))o=t,l=--r;else if(i.nodeType==3)t=i,r=t.nodeValue.length;else break}}else{if(Ue(t))break;{let i=t.previousSibling;for(;i&&H(i,-1);)o=t.parentNode,l=z(i),i=i.previousSibling;if(i)t=i,r=Q(t);else{if(t=t.parentNode,t==e.dom)break;r=0}}}s?ce(e,t,r):o&&ce(e,o,l)}function kt(e){let n=e.domSelectionRange(),t=n.focusNode,r=n.focusOffset;if(!t)return;let o=Q(t),l,s;for(;;)if(r<o){if(t.nodeType!=1)break;let i=t.childNodes[r];if(H(i,1))l=t,s=++r;else break}else{if(Ue(t))break;{let i=t.nextSibling;for(;i&&H(i,1);)l=i.parentNode,s=z(i)+1,i=i.nextSibling;if(i)t=i,r=0,o=Q(t);else{if(t=t.parentNode,t==e.dom)break;r=o=0}}}l&&ce(e,l,s)}function Ue(e){let n=e.pmViewDesc;return n&&n.node&&n.node.isBlock}function Tt(e,n){for(;e&&n==e.childNodes.length&&!ue(e);)n=z(e)+1,e=e.parentNode;for(;e&&n<e.childNodes.length;){let t=e.childNodes[n];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;e=t,n=0}}function xt(e,n){for(;e&&!n&&!ue(e);)n=z(e),e=e.parentNode;for(;e&&n;){let t=e.childNodes[n-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;e=t,n=e.childNodes.length}}function ce(e,n,t){if(n.nodeType!=3){let l,s;(s=Tt(n,t))?(n=s,t=0):(l=xt(n,t))&&(n=l,t=l.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ze(r)){let l=document.createRange();l.setEnd(n,t),l.setStart(n,t),r.removeAllRanges(),r.addRange(l)}else r.extend&&r.extend(n,t);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&me(e)},50)}function Ae(e,n){let t=e.state.doc.resolve(n);if(!(K||mt)&&t.parent.inlineContent){let o=e.coordsAtPos(n);if(n>t.start()){let l=e.coordsAtPos(n-1),s=(l.top+l.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(n<t.end()){let l=e.coordsAtPos(n+1),s=(l.top+l.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Me(e,n,t){let r=e.state.selection;if(r instanceof u.TextSelection&&!r.empty||t.indexOf("s")>-1||C&&t.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||e.endOfTextblock(n<0?"up":"down")){let s=ae(e.state,n);if(s&&s instanceof u.NodeSelection)return O(e,s)}if(!o.parent.inlineContent){let s=n<0?o:l,i=r instanceof u.AllSelection?u.Selection.near(s,n):u.Selection.findFrom(s,n);return i?O(e,i):!1}return!1}function Pe(e,n){if(!(e.state.selection instanceof u.TextSelection))return!0;let{$head:t,$anchor:r,empty:o}=e.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(n>0?"forward":"backward"))return!0;let l=!t.textOffset&&(n<0?t.nodeBefore:t.nodeAfter);if(l&&!l.isText){let s=e.state.tr;return n<0?s.delete(t.pos-l.nodeSize,t.pos):s.delete(t.pos,t.pos+l.nodeSize),e.dispatch(s),!0}return!1}function $e(e,n,t){e.domObserver.stop(),n.contentEditable=t,e.domObserver.start()}function Et(e){if(!V||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:t}=e.domSelectionRange();if(n&&n.nodeType==1&&t==0&&n.firstChild&&n.firstChild.contentEditable=="false"){let r=n.firstChild;$e(e,r,"true"),setTimeout(()=>$e(e,r,"false"),20)}return!1}function Ot(e){let n="";return e.ctrlKey&&(n+="c"),e.metaKey&&(n+="m"),e.altKey&&(n+="a"),e.shiftKey&&(n+="s"),n}function At(e,n){let t=n.keyCode,r=Ot(n);if(t==8||C&&t==72&&r=="c")return Pe(e,-1)||F(e,-1);if(t==46&&!n.shiftKey||C&&t==68&&r=="c")return Pe(e,1)||F(e,1);if(t==13||t==27)return!0;if(t==37||C&&t==66&&r=="c"){let o=t==37?Ae(e,e.state.selection.from)=="ltr"?-1:1:-1;return Oe(e,o,r)||F(e,o)}else if(t==39||C&&t==70&&r=="c"){let o=t==39?Ae(e,e.state.selection.from)=="ltr"?1:-1:1;return Oe(e,o,r)||F(e,o)}else{if(t==38||C&&t==80&&r=="c")return Me(e,-1,r)||F(e,-1);if(t==40||C&&t==78&&r=="c")return Et(e)||Me(e,1,r)||F(e,1);if(r==(C?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function je(e,n){e.someProp("transformCopied",h=>{n=h(n,e)});let t=[],{content:r,openStart:o,openEnd:l}=n;for(;o>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,l--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||u.DOMSerializer.fromSchema(e.state.schema),i=Ze(),a=i.createElement("div");a.appendChild(s.serializeFragment(r,{document:i}));let c=a.firstChild,f,d=0;for(;c&&c.nodeType==1&&(f=Qe[c.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=i.createElement(f[h]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${l}${d?` -${d}`:""} ${JSON.stringify(t)}`);let p=e.someProp("clipboardTextSerializer",h=>h(n,e))||n.content.textBetween(0,n.content.size,`
|
|
1
|
+
"use strict";const d=require("./clsx-CXbNJWDD.cjs");var P={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},J={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},lt=typeof navigator<"u"&&/Mac/.test(navigator.platform),st=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var y=0;y<10;y++)P[48+y]=P[96+y]=String(y);for(var y=1;y<=24;y++)P[y+111]="F"+y;for(var y=65;y<=90;y++)P[y]=String.fromCharCode(y+32),J[y]=String.fromCharCode(y);for(var te in P)J.hasOwnProperty(te)||(J[te]=P[te]);function it(e){var n=lt&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||st&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",t=!n&&e.key||(e.shiftKey?J:P)[e.keyCode]||e.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const at=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ct=typeof navigator<"u"&&/Win/.test(navigator.platform);function ft(e){let n=e.split(/-(?!$)/),t=n[n.length-1];t=="Space"&&(t=" ");let r,o,l,s;for(let i=0;i<n.length-1;i++){let a=n[i];if(/^(cmd|meta|m)$/i.test(a))s=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))o=!0;else if(/^s(hift)?$/i.test(a))l=!0;else if(/^mod$/i.test(a))at?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(t="Alt-"+t),o&&(t="Ctrl-"+t),s&&(t="Meta-"+t),l&&(t="Shift-"+t),t}function ut(e){let n=Object.create(null);for(let t in e)n[ft(t)]=e[t];return n}function ne(e,n,t=!0){return n.altKey&&(e="Alt-"+e),n.ctrlKey&&(e="Ctrl-"+e),n.metaKey&&(e="Meta-"+e),t&&n.shiftKey&&(e="Shift-"+e),e}function dt(e){let n=ut(e);return function(t,r){let o=it(r),l,s=n[ne(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let i=n[ne(o,r,!1)];if(i&&i(t.state,t.dispatch,t))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(ct&&r.ctrlKey&&r.altKey)&&(l=P[r.keyCode])&&l!=o){let i=n[ne(l,r)];if(i&&i(t.state,t.dispatch,t))return!0}}return!1}}const z=function(e){for(var n=0;;n++)if(e=e.previousSibling,!e)return n},Le=function(e,n,t,r){return t&&(Ne(e,n,t,r,-1)||Ne(e,n,t,r,1))},pt=/^(img|br|input|textarea|hr)$/i;function Ne(e,n,t,r,o){for(var l;;){if(e==t&&n==r)return!0;if(n==(o<0?0:G(e))){let s=e.parentNode;if(!s||s.nodeType!=1||de(e)||pt.test(e.nodeName)||e.contentEditable=="false")return!1;n=z(e)+(o<0?0:1),e=s}else if(e.nodeType==1){let s=e.childNodes[n+(o<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((l=s.pmViewDesc)===null||l===void 0)&&l.ignoreForSelection)n+=o;else return!1;else e=s,n=o<0?G(e):0}else return!1}}function G(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ht(e,n,t){for(let r=n==0,o=n==G(e);r||o;){if(e==t)return!0;let l=z(e);if(e=e.parentNode,!e)return!1;r=r&&l==0,o=o&&l==G(e)}}function de(e){let n;for(let t=e;t&&!(n=t.pmViewDesc);t=t.parentNode);return n&&n.node&&n.node.isBlock&&(n.dom==e||n.contentDOM==e)}const ze=function(e){return e.focusNode&&Le(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ve(e,n){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=e,t.key=t.code=n,t}const x=typeof navigator<"u"?navigator:null,De=typeof document<"u"?document:null,$=x&&x.userAgent||"",le=/Edge\/(\d+)/.exec($),Fe=/MSIE \d/.exec($),se=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($),j=!!(Fe||se||le),Be=Fe?document.documentMode:se?+se[1]:le?+le[1]:0,v=!j&&/gecko\/(\d+)/i.test($);v&&+(/Firefox\/(\d+)/.exec($)||[0,0])[1];const ie=!j&&/Chrome\/(\d+)/.exec($),K=!!ie,qe=ie?+ie[1]:0,V=!j&&!!x&&/Apple Computer/.test(x.vendor),pe=V&&(/Mobile\/\w+/.test($)||!!x&&x.maxTouchPoints>2),C=pe||(x?/Mac/.test(x.platform):!1),mt=x?/Win/.test(x.platform):!1,X=/Android \d/.test($),he=!!De&&"webkitFontSmoothing"in De.documentElement.style,gt=he?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function yt(e,n=null){let t=e.domSelectionRange(),r=e.state.doc;if(!t.focusNode)return null;let o=e.docView.nearestDesc(t.focusNode),l=o&&o.size==0,s=e.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let i=r.resolve(s),a,c;if(ze(t)){for(a=s;o&&!o.node;)o=o.parent;let u=o.node;if(o&&u.isAtom&&d.NodeSelection.isSelectable(u)&&o.parent&&!(u.isInline&&ht(t.focusNode,t.focusOffset,o.dom))){let p=o.posBefore;c=new d.NodeSelection(s==p?i:r.resolve(p))}}else{if(t instanceof e.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let u=s,p=s;for(let h=0;h<t.rangeCount;h++){let m=t.getRangeAt(h);u=Math.min(u,e.docView.posFromDOM(m.startContainer,m.startOffset,1)),p=Math.max(p,e.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(u<0)return null;[a,s]=p==e.state.selection.anchor?[p,u]:[u,p],i=r.resolve(s)}else a=e.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(a<0)return null}let f=r.resolve(a);if(!c){let u=n=="pointer"||e.state.selection.head<i.pos&&!l?1:-1;c=We(e,f,i,u)}return c}function He(e){return e.editable?e.hasFocus():Nt(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function me(e,n=!1){let t=e.state.selection;if(Ct(e,t),!!He(e)){if(!n&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&K){let r=e.domSelectionRange(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&Le(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)St(e);else{let{anchor:r,head:o}=t,l,s;ke&&!(t instanceof d.TextSelection)&&(t.$from.parent.inlineContent||(l=Te(e,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(s=Te(e,t.to))),e.docView.setSelection(r,o,e,n),ke&&(l&&xe(l),s&&xe(s)),t.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&bt(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const ke=V||K&&qe<63;function Te(e,n){let{node:t,offset:r}=e.docView.domFromPos(n,0),o=r<t.childNodes.length?t.childNodes[r]:null,l=r?t.childNodes[r-1]:null;if(V&&o&&o.contentEditable=="false")return re(o);if((!o||o.contentEditable=="false")&&(!l||l.contentEditable=="false")){if(o)return re(o);if(l)return re(l)}}function re(e){return e.contentEditable="true",V&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function xe(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function bt(e){let n=e.dom.ownerDocument;n.removeEventListener("selectionchange",e.input.hideSelectionGuard);let t=e.domSelectionRange(),r=t.anchorNode,o=t.anchorOffset;n.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=o)&&(n.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!He(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function St(e){let n=e.domSelection();if(!n)return;let t=e.cursorWrapper.dom,r=t.nodeName=="IMG";r?n.collapse(t.parentNode,z(t)+1):n.collapse(t,0),!r&&!e.state.selection.visible&&j&&Be<=11&&(t.disabled=!0,t.disabled=!1)}function Ct(e,n){if(n instanceof d.NodeSelection){let t=e.docView.descAt(n.from);t!=e.lastSelectedViewDesc&&(Ee(e),t&&t.selectNode(),e.lastSelectedViewDesc=t)}else Ee(e)}function Ee(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function We(e,n,t,r){return e.someProp("createSelectionBetween",o=>o(e,n,t))||d.TextSelection.between(n,t,r)}function Nt(e){let n=e.domSelectionRange();if(!n.anchorNode)return!1;try{return e.dom.contains(n.anchorNode.nodeType==3?n.anchorNode.parentNode:n.anchorNode)&&(e.editable||e.dom.contains(n.focusNode.nodeType==3?n.focusNode.parentNode:n.focusNode))}catch{return!1}}function ae(e,n){let{$anchor:t,$head:r}=e.selection,o=n>0?t.max(r):t.min(r),l=o.parent.inlineContent?o.depth?e.doc.resolve(n>0?o.after():o.before()):null:o;return l&&d.Selection.findFrom(l,n)}function O(e,n){return e.dispatch(e.state.tr.setSelection(n).scrollIntoView()),!0}function Oe(e,n,t){let r=e.state.selection;if(r instanceof d.TextSelection)if(t.indexOf("s")>-1){let{$head:o}=r,l=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter;if(!l||l.isText||!l.isLeaf)return!1;let s=e.state.doc.resolve(o.pos+l.nodeSize*(n<0?-1:1));return O(e,new d.TextSelection(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(n>0?"forward":"backward")){let o=ae(e.state,n);return o&&o instanceof d.NodeSelection?O(e,o):!1}else if(!(C&&t.indexOf("m")>-1)){let o=r.$head,l=o.textOffset?null:n<0?o.nodeBefore:o.nodeAfter,s;if(!l||l.isText)return!1;let i=n<0?o.pos-l.nodeSize:o.pos;return l.isAtom||(s=e.docView.descAt(i))&&!s.contentDOM?d.NodeSelection.isSelectable(l)?O(e,new d.NodeSelection(n<0?e.state.doc.resolve(o.pos-l.nodeSize):o)):he?O(e,new d.TextSelection(e.state.doc.resolve(n<0?i:i+l.nodeSize))):!1:!1}}else return!1;else{if(r instanceof d.NodeSelection&&r.node.isInline)return O(e,new d.TextSelection(n>0?r.$to:r.$from));{let o=ae(e.state,n);return o?O(e,o):!1}}}function Q(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function H(e,n){let t=e.pmViewDesc;return t&&t.size==0&&(n<0||e.nextSibling||e.nodeName!="BR")}function F(e,n){return n<0?Dt(e):kt(e)}function Dt(e){let n=e.domSelectionRange(),t=n.focusNode,r=n.focusOffset;if(!t)return;let o,l,s=!1;for(v&&t.nodeType==1&&r<Q(t)&&H(t.childNodes[r],-1)&&(s=!0);;)if(r>0){if(t.nodeType!=1)break;{let i=t.childNodes[r-1];if(H(i,-1))o=t,l=--r;else if(i.nodeType==3)t=i,r=t.nodeValue.length;else break}}else{if(Ue(t))break;{let i=t.previousSibling;for(;i&&H(i,-1);)o=t.parentNode,l=z(i),i=i.previousSibling;if(i)t=i,r=Q(t);else{if(t=t.parentNode,t==e.dom)break;r=0}}}s?ce(e,t,r):o&&ce(e,o,l)}function kt(e){let n=e.domSelectionRange(),t=n.focusNode,r=n.focusOffset;if(!t)return;let o=Q(t),l,s;for(;;)if(r<o){if(t.nodeType!=1)break;let i=t.childNodes[r];if(H(i,1))l=t,s=++r;else break}else{if(Ue(t))break;{let i=t.nextSibling;for(;i&&H(i,1);)l=i.parentNode,s=z(i)+1,i=i.nextSibling;if(i)t=i,r=0,o=Q(t);else{if(t=t.parentNode,t==e.dom)break;r=o=0}}}l&&ce(e,l,s)}function Ue(e){let n=e.pmViewDesc;return n&&n.node&&n.node.isBlock}function Tt(e,n){for(;e&&n==e.childNodes.length&&!de(e);)n=z(e)+1,e=e.parentNode;for(;e&&n<e.childNodes.length;){let t=e.childNodes[n];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;e=t,n=0}}function xt(e,n){for(;e&&!n&&!de(e);)n=z(e),e=e.parentNode;for(;e&&n;){let t=e.childNodes[n-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;e=t,n=e.childNodes.length}}function ce(e,n,t){if(n.nodeType!=3){let l,s;(s=Tt(n,t))?(n=s,t=0):(l=xt(n,t))&&(n=l,t=l.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ze(r)){let l=document.createRange();l.setEnd(n,t),l.setStart(n,t),r.removeAllRanges(),r.addRange(l)}else r.extend&&r.extend(n,t);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&me(e)},50)}function Ae(e,n){let t=e.state.doc.resolve(n);if(!(K||mt)&&t.parent.inlineContent){let o=e.coordsAtPos(n);if(n>t.start()){let l=e.coordsAtPos(n-1),s=(l.top+l.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(l.left-o.left)>1)return l.left<o.left?"ltr":"rtl"}if(n<t.end()){let l=e.coordsAtPos(n+1),s=(l.top+l.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(l.left-o.left)>1)return l.left>o.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Me(e,n,t){let r=e.state.selection;if(r instanceof d.TextSelection&&!r.empty||t.indexOf("s")>-1||C&&t.indexOf("m")>-1)return!1;let{$from:o,$to:l}=r;if(!o.parent.inlineContent||e.endOfTextblock(n<0?"up":"down")){let s=ae(e.state,n);if(s&&s instanceof d.NodeSelection)return O(e,s)}if(!o.parent.inlineContent){let s=n<0?o:l,i=r instanceof d.AllSelection?d.Selection.near(s,n):d.Selection.findFrom(s,n);return i?O(e,i):!1}return!1}function Pe(e,n){if(!(e.state.selection instanceof d.TextSelection))return!0;let{$head:t,$anchor:r,empty:o}=e.state.selection;if(!t.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(n>0?"forward":"backward"))return!0;let l=!t.textOffset&&(n<0?t.nodeBefore:t.nodeAfter);if(l&&!l.isText){let s=e.state.tr;return n<0?s.delete(t.pos-l.nodeSize,t.pos):s.delete(t.pos,t.pos+l.nodeSize),e.dispatch(s),!0}return!1}function $e(e,n,t){e.domObserver.stop(),n.contentEditable=t,e.domObserver.start()}function Et(e){if(!V||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:n,focusOffset:t}=e.domSelectionRange();if(n&&n.nodeType==1&&t==0&&n.firstChild&&n.firstChild.contentEditable=="false"){let r=n.firstChild;$e(e,r,"true"),setTimeout(()=>$e(e,r,"false"),20)}return!1}function Ot(e){let n="";return e.ctrlKey&&(n+="c"),e.metaKey&&(n+="m"),e.altKey&&(n+="a"),e.shiftKey&&(n+="s"),n}function At(e,n){let t=n.keyCode,r=Ot(n);if(t==8||C&&t==72&&r=="c")return Pe(e,-1)||F(e,-1);if(t==46&&!n.shiftKey||C&&t==68&&r=="c")return Pe(e,1)||F(e,1);if(t==13||t==27)return!0;if(t==37||C&&t==66&&r=="c"){let o=t==37?Ae(e,e.state.selection.from)=="ltr"?-1:1:-1;return Oe(e,o,r)||F(e,o)}else if(t==39||C&&t==70&&r=="c"){let o=t==39?Ae(e,e.state.selection.from)=="ltr"?1:-1:1;return Oe(e,o,r)||F(e,o)}else{if(t==38||C&&t==80&&r=="c")return Me(e,-1,r)||F(e,-1);if(t==40||C&&t==78&&r=="c")return Et(e)||Me(e,1,r)||F(e,1);if(r==(C?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function je(e,n){e.someProp("transformCopied",h=>{n=h(n,e)});let t=[],{content:r,openStart:o,openEnd:l}=n;for(;o>1&&l>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,l--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=e.someProp("clipboardSerializer")||d.DOMSerializer.fromSchema(e.state.schema),i=Ze(),a=i.createElement("div");a.appendChild(s.serializeFragment(r,{document:i}));let c=a.firstChild,f,u=0;for(;c&&c.nodeType==1&&(f=Qe[c.nodeName.toLowerCase()]);){for(let h=f.length-1;h>=0;h--){let m=i.createElement(f[h]);for(;a.firstChild;)m.appendChild(a.firstChild);a.appendChild(m),u++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${l}${u?` -${u}`:""} ${JSON.stringify(t)}`);let p=e.someProp("clipboardTextSerializer",h=>h(n,e))||n.content.textBetween(0,n.content.size,`
|
|
2
2
|
|
|
3
|
-
`);return{dom:a,text:p,slice:n}}function Xe(e,n,t,r,o){let l=o.parent.type.spec.code,s,i;if(!t&&!n)return null;let a=!!n&&(r||l||!t);if(a){if(e.someProp("transformPastedText",p=>{n=p(n,l||r,e)}),l)return i=new
|
|
4
|
-
`))),0,0),e.someProp("transformPasted",p=>{i=p(i,e,!0)}),i;let d=e.someProp("clipboardTextParser",p=>p(n,o,r,e));if(d)i=d;else{let p=o.marks(),{schema:h}=e.state,m=u.DOMSerializer.fromSchema(h);s=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=s.appendChild(document.createElement("p"));E&&N.appendChild(m.serializeNode(h.text(E,p)))})}}else e.someProp("transformPastedHTML",d=>{t=d(t,e)}),s=Kt(t),he&&It(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let d=+f[3];d>0;d--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(i||(i=(e.someProp("clipboardParser")||e.someProp("domParser")||u.DOMParser.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||f),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Mt.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)i=Rt(Ke(i,+f[1],+f[2]),f[4]);else if(i=u.Slice.maxOpen(Pt(i.content,o),!0),i.openStart||i.openEnd){let d=0,p=0;for(let h=i.content.firstChild;d<i.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=i.content.lastChild;p<i.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);i=Ke(i,d,p)}return e.someProp("transformPasted",d=>{i=d(i,e,a)}),i}const Mt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Pt(e,n){if(e.childCount<2)return e;for(let t=n.depth;t>=0;t--){let o=n.node(t).contentMatchAt(n.index(t)),l,s=[];if(e.forEach(i=>{if(!s)return;let a=o.findWrapping(i.type),c;if(!a)return s=null;if(c=s.length&&l.length&&Je(a,l,i,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Ge(s[s.length-1],l.length));let f=Ye(i,a);s.push(f),o=o.matchType(f.type),l=a}}),s)return u.Fragment.from(s)}return e}function Ye(e,n,t=0){for(let r=n.length-1;r>=t;r--)e=n[r].create(null,u.Fragment.from(e));return e}function Je(e,n,t,r,o){if(o<e.length&&o<n.length&&e[o]==n[o]){let l=Je(e,n,t,r.lastChild,o+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?t.type:e[o+1]))return r.copy(r.content.append(u.Fragment.from(Ye(t,e,o+1))))}}function Ge(e,n){if(n==0)return e;let t=e.content.replaceChild(e.childCount-1,Ge(e.lastChild,n-1)),r=e.contentMatchAt(e.childCount).fillBefore(u.Fragment.empty,!0);return e.copy(t.append(r))}function fe(e,n,t,r,o,l){let s=n<0?e.firstChild:e.lastChild,i=s.content;return e.childCount>1&&(l=0),o<r-1&&(i=fe(i,n,t,r,o+1,l)),o>=t&&(i=n<0?s.contentMatchAt(0).fillBefore(i,l<=o).append(i):i.append(s.contentMatchAt(s.childCount).fillBefore(u.Fragment.empty,!0))),e.replaceChild(n<0?0:e.childCount-1,s.copy(i))}function Ke(e,n,t){return n<e.openStart&&(e=new u.Slice(fe(e.content,-1,n,e.openStart,0,e.openEnd),n,e.openEnd)),t<e.openEnd&&(e=new u.Slice(fe(e.content,1,t,e.openEnd,0,0),e.openStart,t)),e}const Qe={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ie=null;function Ze(){return Ie||(Ie=document.implementation.createHTMLDocument("title"))}let oe=null;function $t(e){let n=window.trustedTypes;return n?(oe||(oe=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),oe.createHTML(e)):e}function Kt(e){let n=/^(\s*<meta [^>]*>)*/.exec(e);n&&(e=e.slice(n[0].length));let t=Ze().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&Qe[r[1].toLowerCase()])&&(e=o.map(l=>"<"+l+">").join("")+e+o.map(l=>"</"+l+">").reverse().join("")),t.innerHTML=$t(e),o)for(let l=0;l<o.length;l++)t=t.querySelector(o[l])||t;return t}function It(e){let n=e.querySelectorAll(K?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<n.length;t++){let r=n[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Rt(e,n){if(!e.size)return e;let t=e.content.firstChild.type.schema,r;try{r=JSON.parse(n)}catch{return e}let{content:o,openStart:l,openEnd:s}=e;for(let i=r.length-2;i>=0;i-=2){let a=t.nodes[r[i]];if(!a||a.hasRequiredAttrs())break;o=u.Fragment.from(a.create(r[i+1],o)),l++,s++}return new u.Slice(o,l,s)}const k={},S={};function A(e,n){e.input.lastSelectionOrigin=n,e.input.lastSelectionTime=Date.now()}S.keydown=(e,n)=>{let t=n;if(e.input.shiftKey=t.keyCode==16||t.shiftKey,!we(e,t)&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!(X&&K&&t.keyCode==13)))if(t.keyCode!=229&&e.domObserver.forceFlush(),pe&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,Ve(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,t))||At(e,t)?t.preventDefault():A(e,"key")};S.keyup=(e,n)=>{n.keyCode==16&&(e.input.shiftKey=!1)};S.keypress=(e,n)=>{let t=n;if(we(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||C&&t.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,t))){t.preventDefault();return}let r=e.state.selection;if(!(r instanceof u.TextSelection)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode),l=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,o,l))&&e.dispatch(l()),t.preventDefault()}};function ee(e){return{left:e.clientX,top:e.clientY}}function Lt(e,n){let t=n.x-e.clientX,r=n.y-e.clientY;return t*t+r*r<100}function ge(e,n,t,r,o){if(r==-1)return!1;let l=e.state.doc.resolve(r);for(let s=l.depth+1;s>0;s--)if(e.someProp(n,i=>s>l.depth?i(e,t,l.nodeAfter,l.before(s),o,!0):i(e,t,l.node(s),l.before(s),o,!1)))return!0;return!1}function q(e,n,t){if(e.focused||e.focus(),e.state.selection.eq(n))return;let r=e.state.tr.setSelection(n);r.setMeta("pointer",!0),e.dispatch(r)}function zt(e,n){if(n==-1)return!1;let t=e.state.doc.resolve(n),r=t.nodeAfter;return r&&r.isAtom&&u.NodeSelection.isSelectable(r)?(q(e,new u.NodeSelection(t)),!0):!1}function Vt(e,n){if(n==-1)return!1;let t=e.state.selection,r,o;t instanceof u.NodeSelection&&(r=t.node);let l=e.state.doc.resolve(n);for(let s=l.depth+1;s>0;s--){let i=s>l.depth?l.nodeAfter:l.node(s);if(u.NodeSelection.isSelectable(i)){r&&t.$from.depth>0&&s>=t.$from.depth&&l.before(t.$from.depth+1)==t.$from.pos?o=l.before(t.$from.depth):o=l.before(s);break}}return o!=null?(q(e,u.NodeSelection.create(e.state.doc,o)),!0):!1}function Ft(e,n,t,r,o){return ge(e,"handleClickOn",n,t,r)||e.someProp("handleClick",l=>l(e,n,r))||(o?Vt(e,t):zt(e,t))}function Bt(e,n,t,r){return ge(e,"handleDoubleClickOn",n,t,r)||e.someProp("handleDoubleClick",o=>o(e,n,r))}function qt(e,n,t,r){return ge(e,"handleTripleClickOn",n,t,r)||e.someProp("handleTripleClick",o=>o(e,n,r))||Ht(e,t,r)}function Ht(e,n,t){if(t.button!=0)return!1;let r=e.state.doc;if(n==-1)return r.inlineContent?(q(e,u.TextSelection.create(r,0,r.content.size)),!0):!1;let o=r.resolve(n);for(let l=o.depth+1;l>0;l--){let s=l>o.depth?o.nodeAfter:o.node(l),i=o.before(l);if(s.inlineContent)q(e,u.TextSelection.create(r,i+1,i+1+s.content.size));else if(u.NodeSelection.isSelectable(s))q(e,u.NodeSelection.create(r,i));else continue;return!0}}function ye(e){return Z(e)}const _e=C?"metaKey":"ctrlKey";k.mousedown=(e,n)=>{let t=n;e.input.shiftKey=t.shiftKey;let r=ye(e),o=Date.now(),l="singleClick";o-e.input.lastClick.time<500&&Lt(t,e.input.lastClick)&&!t[_e]&&e.input.lastClick.button==t.button&&(e.input.lastClick.type=="singleClick"?l="doubleClick":e.input.lastClick.type=="doubleClick"&&(l="tripleClick")),e.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:l,button:t.button};let s=e.posAtCoords(ee(t));s&&(l=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Wt(e,s,t,!!r)):(l=="doubleClick"?Bt:qt)(e,s.pos,s.inside,t)?t.preventDefault():A(e,"pointer"))};class Wt{constructor(n,t,r,o){this.view=n,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=n.state.doc,this.selectNode=!!r[_e],this.allowDefault=r.shiftKey;let l,s;if(t.inside>-1)l=n.state.doc.nodeAt(t.inside),s=t.inside;else{let f=n.state.doc.resolve(t.pos);l=f.parent,s=f.depth?f.before():0}const i=o?null:r.target,a=i?n.docView.nearestDesc(i,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=n.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||c instanceof u.NodeSelection&&c.from<=s&&c.to>s)&&(this.mightDrag={node:l,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&v&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),n.root.addEventListener("mouseup",this.up=this.up.bind(this)),n.root.addEventListener("mousemove",this.move=this.move.bind(this)),A(n,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>me(this.view)),this.view.input.mouseDown=null}up(n){if(this.done(),!this.view.dom.contains(n.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ee(n))),this.updateAllowDefault(n),this.allowDefault||!t?A(this.view,"pointer"):Ft(this.view,t.pos,t.inside,n,this.selectNode)?n.preventDefault():n.button==0&&(this.flushed||V&&this.mightDrag&&!this.mightDrag.node.isAtom||K&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(q(this.view,u.Selection.near(this.view.state.doc.resolve(t.pos))),n.preventDefault()):A(this.view,"pointer")}move(n){this.updateAllowDefault(n),A(this.view,"pointer"),n.buttons==0&&this.done()}updateAllowDefault(n){!this.allowDefault&&(Math.abs(this.event.x-n.clientX)>4||Math.abs(this.event.y-n.clientY)>4)&&(this.allowDefault=!0)}}k.touchstart=e=>{e.input.lastTouch=Date.now(),ye(e),A(e,"pointer")};k.touchmove=e=>{e.input.lastTouch=Date.now(),A(e,"pointer")};k.contextmenu=e=>ye(e);function we(e,n){return e.composing?!0:V&&Math.abs(n.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Ut=X?5e3:-1;S.compositionstart=S.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:n}=e,t=n.selection.$to;if(n.selection instanceof u.TextSelection&&(n.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||t.marks(),Z(e,!0),e.markCursor=null;else if(Z(e,!n.selection.empty),v&&n.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,l=r.focusOffset;o&&o.nodeType==1&&l!=0;){let s=l<0?o.lastChild:o.childNodes[l-1];if(!s)break;if(s.nodeType==3){let i=e.domSelection();i&&i.collapse(s,s.nodeValue.length);break}else o=s,l=-1}}e.input.composing=!0}ve(e,Ut)};S.compositionend=(e,n)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=n.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,ve(e,20))};function ve(e,n){clearTimeout(e.input.composingTimeout),n>-1&&(e.input.composingTimeout=setTimeout(()=>Z(e),n))}function jt(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Xt());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xt(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Z(e,n=!1){if(!(X&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),jt(e),n||e.docView&&e.docView.dirty){let t=yt(e),r=e.state.selection;return t&&!t.eq(r)?e.dispatch(e.state.tr.setSelection(t)):(e.markCursor||n)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Yt(e,n){if(!e.dom.parentNode)return;let t=e.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(n),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(n),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),e.focus()},50)}const W=j&&Be<15||pe&><604;k.copy=S.cut=(e,n)=>{let t=n,r=e.state.selection,o=t.type=="cut";if(r.empty)return;let l=W?null:t.clipboardData,s=r.content(),{dom:i,text:a}=je(e,s);l?(t.preventDefault(),l.clearData(),l.setData("text/html",i.innerHTML),l.setData("text/plain",a)):Yt(e,i),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Jt(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Gt(e,n){if(!e.dom.parentNode)return;let t=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),t?de(e,r.value,null,o,n):de(e,r.textContent,r.innerHTML,o,n)},50)}function de(e,n,t,r,o){let l=Xe(e,n,t,r,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,o,l||u.Slice.empty)))return!0;if(!l)return!1;let s=Jt(l),i=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(l);return e.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function et(e){let n=e.getData("text/plain")||e.getData("Text");if(n)return n;let t=e.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}S.paste=(e,n)=>{let t=n;if(e.composing&&!X)return;let r=W?null:t.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&de(e,et(r),r.getData("text/html"),o,t)?t.preventDefault():Gt(e,t)};class Qt{constructor(n,t,r){this.slice=n,this.move=t,this.node=r}}const Zt=C?"altKey":"ctrlKey";function tt(e,n){let t=e.someProp("dragCopies",r=>!r(n));return t??!n[Zt]}k.dragstart=(e,n)=>{let t=n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=e.state.selection,l=o.empty?null:e.posAtCoords(ee(t)),s;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof u.NodeSelection?o.to-1:o.to))){if(r&&r.mightDrag)s=u.NodeSelection.create(e.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=e.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(s=u.NodeSelection.create(e.state.doc,d.posBefore))}}let i=(s||e.state.selection).content(),{dom:a,text:c,slice:f}=je(e,i);(!t.dataTransfer.files.length||!K||qe>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(W?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",W||t.dataTransfer.setData("text/plain",c),e.dragging=new Qt(f,tt(e,t),s)};k.dragend=e=>{let n=e.dragging;window.setTimeout(()=>{e.dragging==n&&(e.dragging=null)},50)};S.dragover=S.dragenter=(e,n)=>n.preventDefault();S.drop=(e,n)=>{let t=n,r=e.dragging;if(e.dragging=null,!t.dataTransfer)return;let o=e.posAtCoords(ee(t));if(!o)return;let l=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",m=>{s=m(s,e,!1)}):s=Xe(e,et(t.dataTransfer),W?null:t.dataTransfer.getData("text/html"),!1,l);let i=!!(r&&tt(e,t));if(e.someProp("handleDrop",m=>m(e,t,s||u.Slice.empty,i))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?u.dropPoint(e.state.doc,l.pos,s):l.pos;a==null&&(a=l.pos);let c=e.state.tr;if(i){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let f=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(f,f,s.content.firstChild):c.replaceRange(f,f,s),c.doc.eq(p))return;let h=c.doc.resolve(f);if(d&&u.NodeSelection.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new u.NodeSelection(h));else{let m=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((E,N,D,Y)=>m=Y),c.setSelection(We(e,h,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};k.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&me(e)},20))};k.blur=(e,n)=>{let t=n;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};k.beforeinput=(e,n)=>{if(K&&X&&n.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",l=>l(e,Ve(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in S)k[e]=S[e];function U(e,n){if(e==n)return!0;for(let t in e)if(e[t]!==n[t])return!1;for(let t in n)if(!(t in e))return!1;return!0}class _{constructor(n,t){this.toDOM=n,this.spec=t||R,this.side=this.spec.side||0}map(n,t,r,o){let{pos:l,deleted:s}=n.mapResult(t.from+o,this.side<0?-1:1);return s?null:new T(l-r,l-r,this)}valid(){return!0}eq(n){return this==n||n instanceof _&&(this.spec.key&&this.spec.key==n.spec.key||this.toDOM==n.toDOM&&U(this.spec,n.spec))}destroy(n){this.spec.destroy&&this.spec.destroy(n)}}class M{constructor(n,t){this.attrs=n,this.spec=t||R}map(n,t,r,o){let l=n.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=n.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return l>=s?null:new T(l,s,this)}valid(n,t){return t.from<t.to}eq(n){return this==n||n instanceof M&&U(this.attrs,n.attrs)&&U(this.spec,n.spec)}static is(n){return n.type instanceof M}destroy(){}}class be{constructor(n,t){this.attrs=n,this.spec=t||R}map(n,t,r,o){let l=n.mapResult(t.from+o,1);if(l.deleted)return null;let s=n.mapResult(t.to+o,-1);return s.deleted||s.pos<=l.pos?null:new T(l.pos-r,s.pos-r,this)}valid(n,t){let{index:r,offset:o}=n.content.findIndex(t.from),l;return o==t.from&&!(l=n.child(r)).isText&&o+l.nodeSize==t.to}eq(n){return this==n||n instanceof be&&U(this.attrs,n.attrs)&&U(this.spec,n.spec)}destroy(){}}class T{constructor(n,t,r){this.from=n,this.to=t,this.type=r}copy(n,t){return new T(n,t,this.type)}eq(n,t=0){return this.type.eq(n.type)&&this.from+t==n.from&&this.to+t==n.to}map(n,t,r){return this.type.map(n,this,t,r)}static widget(n,t,r){return new T(n,n,new _(t,r))}static inline(n,t,r,o){return new T(n,t,new M(r,o))}static node(n,t,r,o){return new T(n,t,new be(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof M}get widget(){return this.type instanceof _}}const B=[],R={};class g{constructor(n,t){this.local=n.length?n:B,this.children=t.length?t:B}static create(n,t){return t.length?w(t,n,0,R):b}find(n,t,r){let o=[];return this.findInner(n??0,t??1e9,o,0,r),o}findInner(n,t,r,o,l){for(let s=0;s<this.local.length;s++){let i=this.local[s];i.from<=t&&i.to>=n&&(!l||l(i.spec))&&r.push(i.copy(i.from+o,i.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>n){let i=this.children[s]+1;this.children[s+2].findInner(n-i,t-i,r,o+i,l)}}map(n,t,r){return this==b||n.maps.length==0?this:this.mapInner(n,t,0,0,r||R)}mapInner(n,t,r,o,l){let s;for(let i=0;i<this.local.length;i++){let a=this.local[i].map(n,r,o);a&&a.type.valid(t,a)?(s||(s=[])).push(a):l.onRemove&&l.onRemove(this.local[i].spec)}return this.children.length?_t(this.children,s||[],n,t,r,o,l):s?new g(s.sort(L),B):b}add(n,t){return t.length?this==b?g.create(n,t):this.addInner(n,t,0):this}addInner(n,t,r){let o,l=0;n.forEach((i,a)=>{let c=a+r,f;if(f=rt(t,i,c)){for(o||(o=this.children.slice());l<o.length&&o[l]<a;)l+=3;o[l]==a?o[l+2]=o[l+2].addInner(i,f,c+1):o.splice(l,0,a,a+i.nodeSize,w(f,i,c+1,R)),l+=3}});let s=nt(l?ot(t):t,-r);for(let i=0;i<s.length;i++)s[i].type.valid(n,s[i])||s.splice(i--,1);return new g(s.length?this.local.concat(s).sort(L):this.local,o||this.children)}remove(n){return n.length==0||this==b?this:this.removeInner(n,0)}removeInner(n,t){let r=this.children,o=this.local;for(let l=0;l<r.length;l+=3){let s,i=r[l]+t,a=r[l+1]+t;for(let f=0,d;f<n.length;f++)(d=n[f])&&d.from>i&&d.to<a&&(n[f]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[l+2].removeInner(s,i+1);c!=b?r[l+2]=c:(r.splice(l,3),l-=3)}if(o.length){for(let l=0,s;l<n.length;l++)if(s=n[l])for(let i=0;i<o.length;i++)o[i].eq(s,t)&&(o==this.local&&(o=this.local.slice()),o.splice(i--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new g(o,r):b}forChild(n,t){if(this==b)return this;if(t.isLeaf)return g.empty;let r,o;for(let i=0;i<this.children.length;i+=3)if(this.children[i]>=n){this.children[i]==n&&(r=this.children[i+2]);break}let l=n+1,s=l+t.content.size;for(let i=0;i<this.local.length;i++){let a=this.local[i];if(a.from<s&&a.to>l&&a.type instanceof M){let c=Math.max(l,a.from)-l,f=Math.min(s,a.to)-l;c<f&&(o||(o=[])).push(a.copy(c,f))}}if(o){let i=new g(o.sort(L),B);return r?new I([i,r]):i}return r||b}eq(n){if(this==n)return!0;if(!(n instanceof g)||this.local.length!=n.local.length||this.children.length!=n.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(n.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=n.children[t]||this.children[t+1]!=n.children[t+1]||!this.children[t+2].eq(n.children[t+2]))return!1;return!0}locals(n){return Se(this.localsInner(n))}localsInner(n){if(this==b)return B;if(n.inlineContent||!this.local.some(M.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof M||t.push(this.local[r]);return t}forEachSet(n){n(this)}}g.empty=new g([],[]);g.removeOverlap=Se;const b=g.empty;class I{constructor(n){this.members=n}map(n,t){const r=this.members.map(o=>o.map(n,t,R));return I.from(r)}forChild(n,t){if(t.isLeaf)return g.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(n,t);l!=b&&(l instanceof I?r=r.concat(l.members):r.push(l))}return I.from(r)}eq(n){if(!(n instanceof I)||n.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(n.members[t]))return!1;return!0}locals(n){let t,r=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(n);if(l.length)if(!t)t=l;else{r&&(t=t.slice(),r=!1);for(let s=0;s<l.length;s++)t.push(l[s])}}return t?Se(r?t:t.sort(L)):B}static from(n){switch(n.length){case 0:return b;case 1:return n[0];default:return new I(n.every(t=>t instanceof g)?n:n.reduce((t,r)=>t.concat(r instanceof g?r:r.members),[]))}}forEachSet(n){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(n)}}function _t(e,n,t,r,o,l,s){let i=e.slice();for(let c=0,f=l;c<t.maps.length;c++){let d=0;t.maps[c].forEach((p,h,m,E)=>{let N=E-m-(h-p);for(let D=0;D<i.length;D+=3){let Y=i[D+1];if(Y<0||p>Y+f-d)continue;let Ce=i[D]+f-d;h>=Ce?i[D+1]=p<=Ce?-2:-1:p>=f&&N&&(i[D]+=N,i[D+1]+=N)}d+=N}),f=t.maps[c].map(f,-1)}let a=!1;for(let c=0;c<i.length;c+=3)if(i[c+1]<0){if(i[c+1]==-2){a=!0,i[c+1]=-1;continue}let f=t.map(e[c]+l),d=f-o;if(d<0||d>=r.content.size){a=!0;continue}let p=t.map(e[c+1]+l,-1),h=p-o,{index:m,offset:E}=r.content.findIndex(d),N=r.maybeChild(m);if(N&&E==d&&E+N.nodeSize==h){let D=i[c+2].mapInner(t,N,f+1,e[c]+l+1,s);D!=b?(i[c]=d,i[c+1]=h,i[c+2]=D):(i[c+1]=-2,a=!0)}else a=!0}if(a){let c=wt(i,e,n,t,o,l,s),f=w(c,r,0,s);n=f.local;for(let d=0;d<i.length;d+=3)i[d+1]<0&&(i.splice(d,3),d-=3);for(let d=0,p=0;d<f.children.length;d+=3){let h=f.children[d];for(;p<i.length&&i[p]<h;)p+=3;i.splice(p,0,f.children[d],f.children[d+1],f.children[d+2])}}return new g(n.sort(L),i)}function nt(e,n){if(!n||!e.length)return e;let t=[];for(let r=0;r<e.length;r++){let o=e[r];t.push(new T(o.from+n,o.to+n,o.type))}return t}function wt(e,n,t,r,o,l,s){function i(a,c){for(let f=0;f<a.local.length;f++){let d=a.local[f].map(r,o,c);d?t.push(d):s.onRemove&&s.onRemove(a.local[f].spec)}for(let f=0;f<a.children.length;f+=3)i(a.children[f+2],a.children[f]+c+1)}for(let a=0;a<e.length;a+=3)e[a+1]==-1&&i(e[a+2],n[a]+l+1);return t}function rt(e,n,t){if(n.isLeaf)return null;let r=t+n.nodeSize,o=null;for(let l=0,s;l<e.length;l++)(s=e[l])&&s.from>t&&s.to<r&&((o||(o=[])).push(s),e[l]=null);return o}function ot(e){let n=[];for(let t=0;t<e.length;t++)e[t]!=null&&n.push(e[t]);return n}function w(e,n,t,r){let o=[],l=!1;n.forEach((i,a)=>{let c=rt(e,i,a+t);if(c){l=!0;let f=w(c,i,t+a+1,r);f!=b&&o.push(a,a+i.nodeSize,f)}});let s=nt(l?ot(e):e,-t).sort(L);for(let i=0;i<s.length;i++)s[i].type.valid(n,s[i])||(r.onRemove&&r.onRemove(s[i].spec),s.splice(i--,1));return s.length||o.length?new g(s,o):b}function L(e,n){return e.from-n.from||e.to-n.to}function Se(e){let n=e;for(let t=0;t<n.length-1;t++){let r=n[t];if(r.from!=r.to)for(let o=t+1;o<n.length;o++){let l=n[o];if(l.from==r.from){l.to!=r.to&&(n==e&&(n=e.slice()),n[o]=l.copy(l.from,r.to),Re(n,o+1,l.copy(r.to,l.to)));continue}else{l.from<r.to&&(n==e&&(n=e.slice()),n[t]=r.copy(r.from,l.from),Re(n,o,r.copy(l.from,r.to)));break}}}return n}function Re(e,n,t){for(;n<e.length&&L(t,e[n])>0;)n++;e.splice(n,0,t)}exports.Decoration=T;exports.DecorationSet=g;exports.keydownHandler=ut;
|
|
3
|
+
`);return{dom:a,text:p,slice:n}}function Xe(e,n,t,r,o){let l=o.parent.type.spec.code,s,i;if(!t&&!n)return null;let a=!!n&&(r||l||!t);if(a){if(e.someProp("transformPastedText",p=>{n=p(n,l||r,e)}),l)return i=new d.Slice(d.Fragment.from(e.state.schema.text(n.replace(/\r\n?/g,`
|
|
4
|
+
`))),0,0),e.someProp("transformPasted",p=>{i=p(i,e,!0)}),i;let u=e.someProp("clipboardTextParser",p=>p(n,o,r,e));if(u)i=u;else{let p=o.marks(),{schema:h}=e.state,m=d.DOMSerializer.fromSchema(h);s=document.createElement("div"),n.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=s.appendChild(document.createElement("p"));E&&N.appendChild(m.serializeNode(h.text(E,p)))})}}else e.someProp("transformPastedHTML",u=>{t=u(t,e)}),s=Kt(t),he&&It(s);let c=s&&s.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let u=+f[3];u>0;u--){let p=s.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;s=p}if(i||(i=(e.someProp("clipboardParser")||e.someProp("domParser")||d.DOMParser.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||f),context:o,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!Mt.test(p.parentNode.nodeName)?{ignore:!0}:null}})),f)i=Rt(Ke(i,+f[1],+f[2]),f[4]);else if(i=d.Slice.maxOpen(Pt(i.content,o),!0),i.openStart||i.openEnd){let u=0,p=0;for(let h=i.content.firstChild;u<i.openStart&&!h.type.spec.isolating;u++,h=h.firstChild);for(let h=i.content.lastChild;p<i.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);i=Ke(i,u,p)}return e.someProp("transformPasted",u=>{i=u(i,e,a)}),i}const Mt=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Pt(e,n){if(e.childCount<2)return e;for(let t=n.depth;t>=0;t--){let o=n.node(t).contentMatchAt(n.index(t)),l,s=[];if(e.forEach(i=>{if(!s)return;let a=o.findWrapping(i.type),c;if(!a)return s=null;if(c=s.length&&l.length&&Je(a,l,i,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Ge(s[s.length-1],l.length));let f=Ye(i,a);s.push(f),o=o.matchType(f.type),l=a}}),s)return d.Fragment.from(s)}return e}function Ye(e,n,t=0){for(let r=n.length-1;r>=t;r--)e=n[r].create(null,d.Fragment.from(e));return e}function Je(e,n,t,r,o){if(o<e.length&&o<n.length&&e[o]==n[o]){let l=Je(e,n,t,r.lastChild,o+1);if(l)return r.copy(r.content.replaceChild(r.childCount-1,l));if(r.contentMatchAt(r.childCount).matchType(o==e.length-1?t.type:e[o+1]))return r.copy(r.content.append(d.Fragment.from(Ye(t,e,o+1))))}}function Ge(e,n){if(n==0)return e;let t=e.content.replaceChild(e.childCount-1,Ge(e.lastChild,n-1)),r=e.contentMatchAt(e.childCount).fillBefore(d.Fragment.empty,!0);return e.copy(t.append(r))}function fe(e,n,t,r,o,l){let s=n<0?e.firstChild:e.lastChild,i=s.content;return e.childCount>1&&(l=0),o<r-1&&(i=fe(i,n,t,r,o+1,l)),o>=t&&(i=n<0?s.contentMatchAt(0).fillBefore(i,l<=o).append(i):i.append(s.contentMatchAt(s.childCount).fillBefore(d.Fragment.empty,!0))),e.replaceChild(n<0?0:e.childCount-1,s.copy(i))}function Ke(e,n,t){return n<e.openStart&&(e=new d.Slice(fe(e.content,-1,n,e.openStart,0,e.openEnd),n,e.openEnd)),t<e.openEnd&&(e=new d.Slice(fe(e.content,1,t,e.openEnd,0,0),e.openStart,t)),e}const Qe={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Ie=null;function Ze(){return Ie||(Ie=document.implementation.createHTMLDocument("title"))}let oe=null;function $t(e){let n=window.trustedTypes;return n?(oe||(oe=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),oe.createHTML(e)):e}function Kt(e){let n=/^(\s*<meta [^>]*>)*/.exec(e);n&&(e=e.slice(n[0].length));let t=Ze().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),o;if((o=r&&Qe[r[1].toLowerCase()])&&(e=o.map(l=>"<"+l+">").join("")+e+o.map(l=>"</"+l+">").reverse().join("")),t.innerHTML=$t(e),o)for(let l=0;l<o.length;l++)t=t.querySelector(o[l])||t;return t}function It(e){let n=e.querySelectorAll(K?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<n.length;t++){let r=n[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Rt(e,n){if(!e.size)return e;let t=e.content.firstChild.type.schema,r;try{r=JSON.parse(n)}catch{return e}let{content:o,openStart:l,openEnd:s}=e;for(let i=r.length-2;i>=0;i-=2){let a=t.nodes[r[i]];if(!a||a.hasRequiredAttrs())break;o=d.Fragment.from(a.create(r[i+1],o)),l++,s++}return new d.Slice(o,l,s)}const k={},S={};function A(e,n){e.input.lastSelectionOrigin=n,e.input.lastSelectionTime=Date.now()}S.keydown=(e,n)=>{let t=n;if(e.input.shiftKey=t.keyCode==16||t.shiftKey,!we(e,t)&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!(X&&K&&t.keyCode==13)))if(t.keyCode!=229&&e.domObserver.forceFlush(),pe&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",o=>o(e,Ve(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,t))||At(e,t)?t.preventDefault():A(e,"key")};S.keyup=(e,n)=>{n.keyCode==16&&(e.input.shiftKey=!1)};S.keypress=(e,n)=>{let t=n;if(we(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||C&&t.metaKey)return;if(e.someProp("handleKeyPress",o=>o(e,t))){t.preventDefault();return}let r=e.state.selection;if(!(r instanceof d.TextSelection)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(t.charCode),l=()=>e.state.tr.insertText(o).scrollIntoView();!/[\r\n]/.test(o)&&!e.someProp("handleTextInput",s=>s(e,r.$from.pos,r.$to.pos,o,l))&&e.dispatch(l()),t.preventDefault()}};function ee(e){return{left:e.clientX,top:e.clientY}}function Lt(e,n){let t=n.x-e.clientX,r=n.y-e.clientY;return t*t+r*r<100}function ge(e,n,t,r,o){if(r==-1)return!1;let l=e.state.doc.resolve(r);for(let s=l.depth+1;s>0;s--)if(e.someProp(n,i=>s>l.depth?i(e,t,l.nodeAfter,l.before(s),o,!0):i(e,t,l.node(s),l.before(s),o,!1)))return!0;return!1}function q(e,n,t){if(e.focused||e.focus(),e.state.selection.eq(n))return;let r=e.state.tr.setSelection(n);r.setMeta("pointer",!0),e.dispatch(r)}function zt(e,n){if(n==-1)return!1;let t=e.state.doc.resolve(n),r=t.nodeAfter;return r&&r.isAtom&&d.NodeSelection.isSelectable(r)?(q(e,new d.NodeSelection(t)),!0):!1}function Vt(e,n){if(n==-1)return!1;let t=e.state.selection,r,o;t instanceof d.NodeSelection&&(r=t.node);let l=e.state.doc.resolve(n);for(let s=l.depth+1;s>0;s--){let i=s>l.depth?l.nodeAfter:l.node(s);if(d.NodeSelection.isSelectable(i)){r&&t.$from.depth>0&&s>=t.$from.depth&&l.before(t.$from.depth+1)==t.$from.pos?o=l.before(t.$from.depth):o=l.before(s);break}}return o!=null?(q(e,d.NodeSelection.create(e.state.doc,o)),!0):!1}function Ft(e,n,t,r,o){return ge(e,"handleClickOn",n,t,r)||e.someProp("handleClick",l=>l(e,n,r))||(o?Vt(e,t):zt(e,t))}function Bt(e,n,t,r){return ge(e,"handleDoubleClickOn",n,t,r)||e.someProp("handleDoubleClick",o=>o(e,n,r))}function qt(e,n,t,r){return ge(e,"handleTripleClickOn",n,t,r)||e.someProp("handleTripleClick",o=>o(e,n,r))||Ht(e,t,r)}function Ht(e,n,t){if(t.button!=0)return!1;let r=e.state.doc;if(n==-1)return r.inlineContent?(q(e,d.TextSelection.create(r,0,r.content.size)),!0):!1;let o=r.resolve(n);for(let l=o.depth+1;l>0;l--){let s=l>o.depth?o.nodeAfter:o.node(l),i=o.before(l);if(s.inlineContent)q(e,d.TextSelection.create(r,i+1,i+1+s.content.size));else if(d.NodeSelection.isSelectable(s))q(e,d.NodeSelection.create(r,i));else continue;return!0}}function ye(e){return Z(e)}const _e=C?"metaKey":"ctrlKey";k.mousedown=(e,n)=>{let t=n;e.input.shiftKey=t.shiftKey;let r=ye(e),o=Date.now(),l="singleClick";o-e.input.lastClick.time<500&&Lt(t,e.input.lastClick)&&!t[_e]&&e.input.lastClick.button==t.button&&(e.input.lastClick.type=="singleClick"?l="doubleClick":e.input.lastClick.type=="doubleClick"&&(l="tripleClick")),e.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:l,button:t.button};let s=e.posAtCoords(ee(t));s&&(l=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Wt(e,s,t,!!r)):(l=="doubleClick"?Bt:qt)(e,s.pos,s.inside,t)?t.preventDefault():A(e,"pointer"))};class Wt{constructor(n,t,r,o){this.view=n,this.pos=t,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=n.state.doc,this.selectNode=!!r[_e],this.allowDefault=r.shiftKey;let l,s;if(t.inside>-1)l=n.state.doc.nodeAt(t.inside),s=t.inside;else{let f=n.state.doc.resolve(t.pos);l=f.parent,s=f.depth?f.before():0}const i=o?null:r.target,a=i?n.docView.nearestDesc(i,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=n.state;(r.button==0&&l.type.spec.draggable&&l.type.spec.selectable!==!1||c instanceof d.NodeSelection&&c.from<=s&&c.to>s)&&(this.mightDrag={node:l,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&v&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),n.root.addEventListener("mouseup",this.up=this.up.bind(this)),n.root.addEventListener("mousemove",this.move=this.move.bind(this)),A(n,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>me(this.view)),this.view.input.mouseDown=null}up(n){if(this.done(),!this.view.dom.contains(n.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ee(n))),this.updateAllowDefault(n),this.allowDefault||!t?A(this.view,"pointer"):Ft(this.view,t.pos,t.inside,n,this.selectNode)?n.preventDefault():n.button==0&&(this.flushed||V&&this.mightDrag&&!this.mightDrag.node.isAtom||K&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(q(this.view,d.Selection.near(this.view.state.doc.resolve(t.pos))),n.preventDefault()):A(this.view,"pointer")}move(n){this.updateAllowDefault(n),A(this.view,"pointer"),n.buttons==0&&this.done()}updateAllowDefault(n){!this.allowDefault&&(Math.abs(this.event.x-n.clientX)>4||Math.abs(this.event.y-n.clientY)>4)&&(this.allowDefault=!0)}}k.touchstart=e=>{e.input.lastTouch=Date.now(),ye(e),A(e,"pointer")};k.touchmove=e=>{e.input.lastTouch=Date.now(),A(e,"pointer")};k.contextmenu=e=>ye(e);function we(e,n){return e.composing?!0:V&&Math.abs(n.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Ut=X?5e3:-1;S.compositionstart=S.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:n}=e,t=n.selection.$to;if(n.selection instanceof d.TextSelection&&(n.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||t.marks(),Z(e,!0),e.markCursor=null;else if(Z(e,!n.selection.empty),v&&n.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=e.domSelectionRange();for(let o=r.focusNode,l=r.focusOffset;o&&o.nodeType==1&&l!=0;){let s=l<0?o.lastChild:o.childNodes[l-1];if(!s)break;if(s.nodeType==3){let i=e.domSelection();i&&i.collapse(s,s.nodeValue.length);break}else o=s,l=-1}}e.input.composing=!0}ve(e,Ut)};S.compositionend=(e,n)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=n.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,ve(e,20))};function ve(e,n){clearTimeout(e.input.composingTimeout),n>-1&&(e.input.composingTimeout=setTimeout(()=>Z(e),n))}function jt(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Xt());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Xt(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function Z(e,n=!1){if(!(X&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),jt(e),n||e.docView&&e.docView.dirty){let t=yt(e),r=e.state.selection;return t&&!t.eq(r)?e.dispatch(e.state.tr.setSelection(t)):(e.markCursor||n)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Yt(e,n){if(!e.dom.parentNode)return;let t=e.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(n),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(n),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),e.focus()},50)}const W=j&&Be<15||pe&><604;k.copy=S.cut=(e,n)=>{let t=n,r=e.state.selection,o=t.type=="cut";if(r.empty)return;let l=W?null:t.clipboardData,s=r.content(),{dom:i,text:a}=je(e,s);l?(t.preventDefault(),l.clearData(),l.setData("text/html",i.innerHTML),l.setData("text/plain",a)):Yt(e,i),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Jt(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Gt(e,n){if(!e.dom.parentNode)return;let t=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ue(e,r.value,null,o,n):ue(e,r.textContent,r.innerHTML,o,n)},50)}function ue(e,n,t,r,o){let l=Xe(e,n,t,r,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,o,l||d.Slice.empty)))return!0;if(!l)return!1;let s=Jt(l),i=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(l);return e.dispatch(i.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function et(e){let n=e.getData("text/plain")||e.getData("Text");if(n)return n;let t=e.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}S.paste=(e,n)=>{let t=n;if(e.composing&&!X)return;let r=W?null:t.clipboardData,o=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&ue(e,et(r),r.getData("text/html"),o,t)?t.preventDefault():Gt(e,t)};class Qt{constructor(n,t,r){this.slice=n,this.move=t,this.node=r}}const Zt=C?"altKey":"ctrlKey";function tt(e,n){let t=e.someProp("dragCopies",r=>!r(n));return t??!n[Zt]}k.dragstart=(e,n)=>{let t=n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=e.state.selection,l=o.empty?null:e.posAtCoords(ee(t)),s;if(!(l&&l.pos>=o.from&&l.pos<=(o instanceof d.NodeSelection?o.to-1:o.to))){if(r&&r.mightDrag)s=d.NodeSelection.create(e.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=e.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=e.docView&&(s=d.NodeSelection.create(e.state.doc,u.posBefore))}}let i=(s||e.state.selection).content(),{dom:a,text:c,slice:f}=je(e,i);(!t.dataTransfer.files.length||!K||qe>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(W?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",W||t.dataTransfer.setData("text/plain",c),e.dragging=new Qt(f,tt(e,t),s)};k.dragend=e=>{let n=e.dragging;window.setTimeout(()=>{e.dragging==n&&(e.dragging=null)},50)};S.dragover=S.dragenter=(e,n)=>n.preventDefault();S.drop=(e,n)=>{let t=n,r=e.dragging;if(e.dragging=null,!t.dataTransfer)return;let o=e.posAtCoords(ee(t));if(!o)return;let l=e.state.doc.resolve(o.pos),s=r&&r.slice;s?e.someProp("transformPasted",m=>{s=m(s,e,!1)}):s=Xe(e,et(t.dataTransfer),W?null:t.dataTransfer.getData("text/html"),!1,l);let i=!!(r&&tt(e,t));if(e.someProp("handleDrop",m=>m(e,t,s||d.Slice.empty,i))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?d.dropPoint(e.state.doc,l.pos,s):l.pos;a==null&&(a=l.pos);let c=e.state.tr;if(i){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let f=c.mapping.map(a),u=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(u?c.replaceRangeWith(f,f,s.content.firstChild):c.replaceRange(f,f,s),c.doc.eq(p))return;let h=c.doc.resolve(f);if(u&&d.NodeSelection.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new d.NodeSelection(h));else{let m=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((E,N,D,Y)=>m=Y),c.setSelection(We(e,h,c.doc.resolve(m)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};k.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&me(e)},20))};k.blur=(e,n)=>{let t=n;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};k.beforeinput=(e,n)=>{if(K&&X&&n.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",l=>l(e,Ve(8,"Backspace")))))return;let{$cursor:o}=e.state.selection;o&&o.pos>0&&e.dispatch(e.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let e in S)k[e]=S[e];function U(e,n){if(e==n)return!0;for(let t in e)if(e[t]!==n[t])return!1;for(let t in n)if(!(t in e))return!1;return!0}class _{constructor(n,t){this.toDOM=n,this.spec=t||R,this.side=this.spec.side||0}map(n,t,r,o){let{pos:l,deleted:s}=n.mapResult(t.from+o,this.side<0?-1:1);return s?null:new T(l-r,l-r,this)}valid(){return!0}eq(n){return this==n||n instanceof _&&(this.spec.key&&this.spec.key==n.spec.key||this.toDOM==n.toDOM&&U(this.spec,n.spec))}destroy(n){this.spec.destroy&&this.spec.destroy(n)}}class M{constructor(n,t){this.attrs=n,this.spec=t||R}map(n,t,r,o){let l=n.map(t.from+o,this.spec.inclusiveStart?-1:1)-r,s=n.map(t.to+o,this.spec.inclusiveEnd?1:-1)-r;return l>=s?null:new T(l,s,this)}valid(n,t){return t.from<t.to}eq(n){return this==n||n instanceof M&&U(this.attrs,n.attrs)&&U(this.spec,n.spec)}static is(n){return n.type instanceof M}destroy(){}}class be{constructor(n,t){this.attrs=n,this.spec=t||R}map(n,t,r,o){let l=n.mapResult(t.from+o,1);if(l.deleted)return null;let s=n.mapResult(t.to+o,-1);return s.deleted||s.pos<=l.pos?null:new T(l.pos-r,s.pos-r,this)}valid(n,t){let{index:r,offset:o}=n.content.findIndex(t.from),l;return o==t.from&&!(l=n.child(r)).isText&&o+l.nodeSize==t.to}eq(n){return this==n||n instanceof be&&U(this.attrs,n.attrs)&&U(this.spec,n.spec)}destroy(){}}class T{constructor(n,t,r){this.from=n,this.to=t,this.type=r}copy(n,t){return new T(n,t,this.type)}eq(n,t=0){return this.type.eq(n.type)&&this.from+t==n.from&&this.to+t==n.to}map(n,t,r){return this.type.map(n,this,t,r)}static widget(n,t,r){return new T(n,n,new _(t,r))}static inline(n,t,r,o){return new T(n,t,new M(r,o))}static node(n,t,r,o){return new T(n,t,new be(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof M}get widget(){return this.type instanceof _}}const B=[],R={};class g{constructor(n,t){this.local=n.length?n:B,this.children=t.length?t:B}static create(n,t){return t.length?w(t,n,0,R):b}find(n,t,r){let o=[];return this.findInner(n??0,t??1e9,o,0,r),o}findInner(n,t,r,o,l){for(let s=0;s<this.local.length;s++){let i=this.local[s];i.from<=t&&i.to>=n&&(!l||l(i.spec))&&r.push(i.copy(i.from+o,i.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>n){let i=this.children[s]+1;this.children[s+2].findInner(n-i,t-i,r,o+i,l)}}map(n,t,r){return this==b||n.maps.length==0?this:this.mapInner(n,t,0,0,r||R)}mapInner(n,t,r,o,l){let s;for(let i=0;i<this.local.length;i++){let a=this.local[i].map(n,r,o);a&&a.type.valid(t,a)?(s||(s=[])).push(a):l.onRemove&&l.onRemove(this.local[i].spec)}return this.children.length?_t(this.children,s||[],n,t,r,o,l):s?new g(s.sort(L),B):b}add(n,t){return t.length?this==b?g.create(n,t):this.addInner(n,t,0):this}addInner(n,t,r){let o,l=0;n.forEach((i,a)=>{let c=a+r,f;if(f=rt(t,i,c)){for(o||(o=this.children.slice());l<o.length&&o[l]<a;)l+=3;o[l]==a?o[l+2]=o[l+2].addInner(i,f,c+1):o.splice(l,0,a,a+i.nodeSize,w(f,i,c+1,R)),l+=3}});let s=nt(l?ot(t):t,-r);for(let i=0;i<s.length;i++)s[i].type.valid(n,s[i])||s.splice(i--,1);return new g(s.length?this.local.concat(s).sort(L):this.local,o||this.children)}remove(n){return n.length==0||this==b?this:this.removeInner(n,0)}removeInner(n,t){let r=this.children,o=this.local;for(let l=0;l<r.length;l+=3){let s,i=r[l]+t,a=r[l+1]+t;for(let f=0,u;f<n.length;f++)(u=n[f])&&u.from>i&&u.to<a&&(n[f]=null,(s||(s=[])).push(u));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[l+2].removeInner(s,i+1);c!=b?r[l+2]=c:(r.splice(l,3),l-=3)}if(o.length){for(let l=0,s;l<n.length;l++)if(s=n[l])for(let i=0;i<o.length;i++)o[i].eq(s,t)&&(o==this.local&&(o=this.local.slice()),o.splice(i--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new g(o,r):b}forChild(n,t){if(this==b)return this;if(t.isLeaf)return g.empty;let r,o;for(let i=0;i<this.children.length;i+=3)if(this.children[i]>=n){this.children[i]==n&&(r=this.children[i+2]);break}let l=n+1,s=l+t.content.size;for(let i=0;i<this.local.length;i++){let a=this.local[i];if(a.from<s&&a.to>l&&a.type instanceof M){let c=Math.max(l,a.from)-l,f=Math.min(s,a.to)-l;c<f&&(o||(o=[])).push(a.copy(c,f))}}if(o){let i=new g(o.sort(L),B);return r?new I([i,r]):i}return r||b}eq(n){if(this==n)return!0;if(!(n instanceof g)||this.local.length!=n.local.length||this.children.length!=n.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(n.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=n.children[t]||this.children[t+1]!=n.children[t+1]||!this.children[t+2].eq(n.children[t+2]))return!1;return!0}locals(n){return Se(this.localsInner(n))}localsInner(n){if(this==b)return B;if(n.inlineContent||!this.local.some(M.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof M||t.push(this.local[r]);return t}forEachSet(n){n(this)}}g.empty=new g([],[]);g.removeOverlap=Se;const b=g.empty;class I{constructor(n){this.members=n}map(n,t){const r=this.members.map(o=>o.map(n,t,R));return I.from(r)}forChild(n,t){if(t.isLeaf)return g.empty;let r=[];for(let o=0;o<this.members.length;o++){let l=this.members[o].forChild(n,t);l!=b&&(l instanceof I?r=r.concat(l.members):r.push(l))}return I.from(r)}eq(n){if(!(n instanceof I)||n.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(n.members[t]))return!1;return!0}locals(n){let t,r=!0;for(let o=0;o<this.members.length;o++){let l=this.members[o].localsInner(n);if(l.length)if(!t)t=l;else{r&&(t=t.slice(),r=!1);for(let s=0;s<l.length;s++)t.push(l[s])}}return t?Se(r?t:t.sort(L)):B}static from(n){switch(n.length){case 0:return b;case 1:return n[0];default:return new I(n.every(t=>t instanceof g)?n:n.reduce((t,r)=>t.concat(r instanceof g?r:r.members),[]))}}forEachSet(n){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(n)}}function _t(e,n,t,r,o,l,s){let i=e.slice();for(let c=0,f=l;c<t.maps.length;c++){let u=0;t.maps[c].forEach((p,h,m,E)=>{let N=E-m-(h-p);for(let D=0;D<i.length;D+=3){let Y=i[D+1];if(Y<0||p>Y+f-u)continue;let Ce=i[D]+f-u;h>=Ce?i[D+1]=p<=Ce?-2:-1:p>=f&&N&&(i[D]+=N,i[D+1]+=N)}u+=N}),f=t.maps[c].map(f,-1)}let a=!1;for(let c=0;c<i.length;c+=3)if(i[c+1]<0){if(i[c+1]==-2){a=!0,i[c+1]=-1;continue}let f=t.map(e[c]+l),u=f-o;if(u<0||u>=r.content.size){a=!0;continue}let p=t.map(e[c+1]+l,-1),h=p-o,{index:m,offset:E}=r.content.findIndex(u),N=r.maybeChild(m);if(N&&E==u&&E+N.nodeSize==h){let D=i[c+2].mapInner(t,N,f+1,e[c]+l+1,s);D!=b?(i[c]=u,i[c+1]=h,i[c+2]=D):(i[c+1]=-2,a=!0)}else a=!0}if(a){let c=wt(i,e,n,t,o,l,s),f=w(c,r,0,s);n=f.local;for(let u=0;u<i.length;u+=3)i[u+1]<0&&(i.splice(u,3),u-=3);for(let u=0,p=0;u<f.children.length;u+=3){let h=f.children[u];for(;p<i.length&&i[p]<h;)p+=3;i.splice(p,0,f.children[u],f.children[u+1],f.children[u+2])}}return new g(n.sort(L),i)}function nt(e,n){if(!n||!e.length)return e;let t=[];for(let r=0;r<e.length;r++){let o=e[r];t.push(new T(o.from+n,o.to+n,o.type))}return t}function wt(e,n,t,r,o,l,s){function i(a,c){for(let f=0;f<a.local.length;f++){let u=a.local[f].map(r,o,c);u?t.push(u):s.onRemove&&s.onRemove(a.local[f].spec)}for(let f=0;f<a.children.length;f+=3)i(a.children[f+2],a.children[f]+c+1)}for(let a=0;a<e.length;a+=3)e[a+1]==-1&&i(e[a+2],n[a]+l+1);return t}function rt(e,n,t){if(n.isLeaf)return null;let r=t+n.nodeSize,o=null;for(let l=0,s;l<e.length;l++)(s=e[l])&&s.from>t&&s.to<r&&((o||(o=[])).push(s),e[l]=null);return o}function ot(e){let n=[];for(let t=0;t<e.length;t++)e[t]!=null&&n.push(e[t]);return n}function w(e,n,t,r){let o=[],l=!1;n.forEach((i,a)=>{let c=rt(e,i,a+t);if(c){l=!0;let f=w(c,i,t+a+1,r);f!=b&&o.push(a,a+i.nodeSize,f)}});let s=nt(l?ot(e):e,-t).sort(L);for(let i=0;i<s.length;i++)s[i].type.valid(n,s[i])||(r.onRemove&&r.onRemove(s[i].spec),s.splice(i--,1));return s.length||o.length?new g(s,o):b}function L(e,n){return e.from-n.from||e.to-n.to}function Se(e){let n=e;for(let t=0;t<n.length-1;t++){let r=n[t];if(r.from!=r.to)for(let o=t+1;o<n.length;o++){let l=n[o];if(l.from==r.from){l.to!=r.to&&(n==e&&(n=e.slice()),n[o]=l.copy(l.from,r.to),Re(n,o+1,l.copy(r.to,l.to)));continue}else{l.from<r.to&&(n==e&&(n=e.slice()),n[t]=r.copy(r.from,l.from),Re(n,o,r.copy(l.from,r.to)));break}}}return n}function Re(e,n,t){for(;n<e.length&&L(t,e[n])>0;)n++;e.splice(n,0,t)}exports.Decoration=T;exports.DecorationSet=g;exports.keydownHandler=dt;
|
package/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),w=require("./clsx-CXbNJWDD.cjs"),C=require("./index-D3RLYf-J.cjs"),d=require("./theme.cjs"),M=require("./tooltip-BYtGp6FM.cjs"),N=`
|
|
2
2
|
.reactjs-tiptap-editor {
|
|
3
3
|
button,
|
|
4
4
|
input:where([type=button]),
|
|
@@ -105,4 +105,11 @@
|
|
|
105
105
|
height: auto;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
`;function
|
|
108
|
+
`;function P({editor:e}){const n=C.useStoreEditableEditor(o=>o.setEditable);l.useEffect(()=>{n({value:e==null?void 0:e.isEditable})},[e==null?void 0:e.isEditable]);const t=()=>{n({value:e==null?void 0:e.isEditable})};return l.useEffect(()=>(e&&e.on("update",t),()=>{e&&e.off("update",t)}),[e]),a.jsx(a.Fragment,{})}const g="data-rc-order",m="data-rc-priority",A="rc-util-key",f=new Map;function q(e,n){if(!e)return!1;if(e.contains)return e.contains(n);let t=n;for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function x({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:A}function h(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function $(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function E(e){return[...(f.get(e)||e).children].filter(n=>n.tagName==="STYLE")}function v(e,n={}){const{csp:t,prepend:o,priority:r=0}=n,c=$(o),s=c==="prependQueue",i=document.createElement("style");i.setAttribute(g,c),s&&r&&i.setAttribute(m,`${r}`),t!=null&&t.nonce&&(i.nonce=t==null?void 0:t.nonce),i.innerHTML=e;const u=h(n),{firstChild:R}=u;if(o){if(s){const p=E(u).filter(b=>{if(!["prepend","prependQueue"].includes(b.getAttribute(g)))return!1;const T=Number(b.getAttribute(m)||0);return r>=T});if(p.length>0)return u.insertBefore(i,p.at(-1).nextSibling),i}R.before(i)}else u.append(i);return i}function y(e,n={}){const t=h(n);return E(t).find(o=>o.getAttribute(x(n))===e)}function j(e,n={}){const t=y(e,n);t&&t.remove()}function O(e,n){const t=f.get(e);if(!t||!q(document,t)){const o=v("",n),{parentNode:r}=o;f.set(e,r),o.remove()}}function S(e,n,t={}){var s,i,u;const o=h(t);O(o,t);const r=y(n,t);if(r)return(s=t.csp)!=null&&s.nonce&&r.nonce!==((i=t.csp)==null?void 0:i.nonce)&&(r.nonce=(u=t.csp)==null?void 0:u.nonce),r.innerHTML!==e&&(r.innerHTML=e),r;const c=v(e,t);return c.setAttribute(x(t),n),c}function H(){const{theme:e,color:n,borderRadius:t}=d.useTheme();return l.useEffect(()=>{const o=e||"light",r=n||"default";let c=d.THEME[o][r];if(!c){c=d.THEME.light.default;return}return S(`
|
|
109
|
+
.reactjs-tiptap-editor, .reactjs-tiptap-editor *,
|
|
110
|
+
.reactjs-tiptap-editor-theme, .reactjs-tiptap-editor-theme *,
|
|
111
|
+
div[data-richtext-portal], div[data-richtext-portal] * {
|
|
112
|
+
${Object.entries(c).map(([s,i])=>typeof t=="string"&&s==="radius"?`--${s}: ${t};`:`--${s}: ${i};`).join(`
|
|
113
|
+
`)}
|
|
114
|
+
}
|
|
115
|
+
`,"richtext-theme",{priority:50}),()=>{j("richtext-theme")}},[e,n,t]),a.jsx(a.Fragment,{})}function L({editor:e,children:n}){const t=l.useId();return l.useEffect(()=>(S(N,"react-tiptap-reset"),()=>{j("react-tiptap-reset")}),[]),l.useEffect(()=>{e&&(e.id=t)},[t,e]),e?a.jsx("div",{className:"reactjs-tiptap-editor",children:a.jsxs(w.EditorContext.Provider,{value:{editor:e},children:[a.jsx(M.TooltipProvider,{delayDuration:0,disableHoverableContent:!0,children:n}),a.jsx(P,{editor:e}),a.jsx(H,{})]})}):a.jsx(a.Fragment,{})}exports.RichTextProvider=L;
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { jsx as u, Fragment as d, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as l, useId as T } from "react";
|
|
3
|
+
import { C as M } from "./clsx-BWSGDJNJ.js";
|
|
4
|
+
import { u as P } from "./index-DF5ZPtWM.js";
|
|
5
|
+
import { useTheme as A, THEME as m } from "./theme.js";
|
|
6
|
+
import { c as $ } from "./tooltip-DNKq7zgN.js";
|
|
7
|
+
const O = `
|
|
6
8
|
.reactjs-tiptap-editor {
|
|
7
9
|
button,
|
|
8
10
|
input:where([type=button]),
|
|
@@ -110,28 +112,142 @@ const d = `
|
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
`;
|
|
113
|
-
function
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
115
|
+
function H({ editor: e }) {
|
|
116
|
+
const n = P((o) => o.setEditable);
|
|
117
|
+
l(() => {
|
|
118
|
+
n({
|
|
119
|
+
value: e == null ? void 0 : e.isEditable
|
|
120
|
+
});
|
|
121
|
+
}, [e == null ? void 0 : e.isEditable]);
|
|
122
|
+
const t = () => {
|
|
123
|
+
n({
|
|
124
|
+
value: e == null ? void 0 : e.isEditable
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
return l(() => (e && e.on("update", t), () => {
|
|
128
|
+
e && e.off("update", t);
|
|
129
|
+
}), [e]), /* @__PURE__ */ u(d, {});
|
|
130
|
+
}
|
|
131
|
+
const g = "data-rc-order", v = "data-rc-priority", L = "rc-util-key", f = /* @__PURE__ */ new Map();
|
|
132
|
+
function z(e, n) {
|
|
133
|
+
if (!e)
|
|
134
|
+
return !1;
|
|
135
|
+
if (e.contains)
|
|
136
|
+
return e.contains(n);
|
|
137
|
+
let t = n;
|
|
138
|
+
for (; t; ) {
|
|
139
|
+
if (t === e)
|
|
140
|
+
return !0;
|
|
141
|
+
t = t.parentNode;
|
|
142
|
+
}
|
|
143
|
+
return !1;
|
|
144
|
+
}
|
|
145
|
+
function E({ mark: e } = {}) {
|
|
146
|
+
return e ? e.startsWith("data-") ? e : `data-${e}` : L;
|
|
147
|
+
}
|
|
148
|
+
function p(e) {
|
|
149
|
+
return e.attachTo ? e.attachTo : document.querySelector("head") || document.body;
|
|
150
|
+
}
|
|
151
|
+
function D(e) {
|
|
152
|
+
return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
|
|
153
|
+
}
|
|
154
|
+
function x(e) {
|
|
155
|
+
return [...(f.get(e) || e).children].filter(
|
|
156
|
+
(n) => n.tagName === "STYLE"
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
function y(e, n = {}) {
|
|
160
|
+
const { csp: t, prepend: o, priority: r = 0 } = n, a = D(o), c = a === "prependQueue", i = document.createElement("style");
|
|
161
|
+
i.setAttribute(g, a), c && r && i.setAttribute(v, `${r}`), t != null && t.nonce && (i.nonce = t == null ? void 0 : t.nonce), i.innerHTML = e;
|
|
162
|
+
const s = p(n), { firstChild: j } = s;
|
|
163
|
+
if (o) {
|
|
164
|
+
if (c) {
|
|
165
|
+
const h = x(s).filter((b) => {
|
|
166
|
+
if (!["prepend", "prependQueue"].includes(b.getAttribute(g)))
|
|
167
|
+
return !1;
|
|
168
|
+
const N = Number(b.getAttribute(v) || 0);
|
|
169
|
+
return r >= N;
|
|
170
|
+
});
|
|
171
|
+
if (h.length > 0)
|
|
172
|
+
return s.insertBefore(i, h.at(-1).nextSibling), i;
|
|
132
173
|
}
|
|
133
|
-
|
|
174
|
+
j.before(i);
|
|
175
|
+
} else
|
|
176
|
+
s.append(i);
|
|
177
|
+
return i;
|
|
178
|
+
}
|
|
179
|
+
function S(e, n = {}) {
|
|
180
|
+
const t = p(n);
|
|
181
|
+
return x(t).find((o) => o.getAttribute(E(n)) === e);
|
|
182
|
+
}
|
|
183
|
+
function C(e, n = {}) {
|
|
184
|
+
const t = S(e, n);
|
|
185
|
+
t && t.remove();
|
|
186
|
+
}
|
|
187
|
+
function Q(e, n) {
|
|
188
|
+
const t = f.get(e);
|
|
189
|
+
if (!t || !z(document, t)) {
|
|
190
|
+
const o = y("", n), { parentNode: r } = o;
|
|
191
|
+
f.set(e, r), o.remove();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function w(e, n, t = {}) {
|
|
195
|
+
var c, i, s;
|
|
196
|
+
const o = p(t);
|
|
197
|
+
Q(o, t);
|
|
198
|
+
const r = S(n, t);
|
|
199
|
+
if (r)
|
|
200
|
+
return (c = t.csp) != null && c.nonce && r.nonce !== ((i = t.csp) == null ? void 0 : i.nonce) && (r.nonce = (s = t.csp) == null ? void 0 : s.nonce), r.innerHTML !== e && (r.innerHTML = e), r;
|
|
201
|
+
const a = y(e, t);
|
|
202
|
+
return a.setAttribute(E(t), n), a;
|
|
203
|
+
}
|
|
204
|
+
function _() {
|
|
205
|
+
const { theme: e, color: n, borderRadius: t } = A();
|
|
206
|
+
return l(() => {
|
|
207
|
+
const o = e || "light", r = n || "default";
|
|
208
|
+
let a = m[o][r];
|
|
209
|
+
if (!a) {
|
|
210
|
+
a = m.light.default;
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
return w(`
|
|
214
|
+
.reactjs-tiptap-editor, .reactjs-tiptap-editor *,
|
|
215
|
+
.reactjs-tiptap-editor-theme, .reactjs-tiptap-editor-theme *,
|
|
216
|
+
div[data-richtext-portal], div[data-richtext-portal] * {
|
|
217
|
+
${Object.entries(a).map(([c, i]) => typeof t == "string" && c === "radius" ? `--${c}: ${t};` : `--${c}: ${i};`).join(`
|
|
218
|
+
`)}
|
|
219
|
+
}
|
|
220
|
+
`, "richtext-theme", {
|
|
221
|
+
priority: 50
|
|
222
|
+
}), () => {
|
|
223
|
+
C("richtext-theme");
|
|
224
|
+
};
|
|
225
|
+
}, [e, n, t]), /* @__PURE__ */ u(d, {});
|
|
226
|
+
}
|
|
227
|
+
function k({ editor: e, children: n }) {
|
|
228
|
+
const t = T();
|
|
229
|
+
return l(() => (w(O, "react-tiptap-reset"), () => {
|
|
230
|
+
C("react-tiptap-reset");
|
|
231
|
+
}), []), l(() => {
|
|
232
|
+
e && (e.id = t);
|
|
233
|
+
}, [t, e]), e ? /* @__PURE__ */ u("div", { className: "reactjs-tiptap-editor", children: /* @__PURE__ */ R(M.Provider, { value: { editor: e }, children: [
|
|
234
|
+
/* @__PURE__ */ u(
|
|
235
|
+
$,
|
|
236
|
+
{
|
|
237
|
+
delayDuration: 0,
|
|
238
|
+
disableHoverableContent: !0,
|
|
239
|
+
children: n
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ u(
|
|
243
|
+
H,
|
|
244
|
+
{
|
|
245
|
+
editor: e
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ u(_, {})
|
|
249
|
+
] }) }) : /* @__PURE__ */ u(d, {});
|
|
134
250
|
}
|
|
135
251
|
export {
|
|
136
|
-
|
|
252
|
+
k as RichTextProvider
|
|
137
253
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import * as o from "react";
|
|
3
|
-
import { c as x } from "./index-
|
|
4
|
-
const
|
|
3
|
+
import { c as x } from "./index-DF5ZPtWM.js";
|
|
4
|
+
const h = o.forwardRef(
|
|
5
5
|
({ className: t, type: e, ...r }, i) => /* @__PURE__ */ c(
|
|
6
6
|
"input",
|
|
7
7
|
{
|
|
8
8
|
ref: i,
|
|
9
9
|
type: e,
|
|
10
10
|
className: x(
|
|
11
|
-
"richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 ",
|
|
11
|
+
"richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 richtext-text-foreground",
|
|
12
12
|
t
|
|
13
13
|
),
|
|
14
14
|
...r
|
|
15
15
|
}
|
|
16
16
|
)
|
|
17
17
|
);
|
|
18
|
-
|
|
18
|
+
h.displayName = "Input";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
h as I
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),o=require("react"),s=require("./index-
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),o=require("react"),s=require("./index-D3RLYf-J.cjs");function u(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const x=u(o),c=x.forwardRef(({className:t,type:r,...e},i)=>n.jsx("input",{ref:i,type:r,className:s.cn("richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md !richtext-border richtext-border-input richtext-bg-transparent richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background file:richtext-border-0 file:richtext-bg-transparent file:richtext-text-sm file:richtext-font-medium placeholder:richtext-text-muted-foreground focus-visible:richtext-outline-none focus-visible:richtext-ring-1 focus-visible:richtext-ring-ring focus-visible:richtext-ring-offset-1 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 richtext-text-foreground",t),...e}));c.displayName="Input";exports.Input=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("./throttle-
|
|
1
|
+
"use strict";const n=require("./throttle-gTTvqDTW.cjs");function d(i,t,f){return i===i&&(f!==void 0&&(i=i<=f?i:f),t!==void 0&&(i=i>=t?i:t)),i}function c(i,t,f){return f===void 0&&(f=t,t=void 0),f!==void 0&&(f=n.toNumber(f),f=f===f?f:0),t!==void 0&&(t=n.toNumber(t),t=t===t?t:0),d(n.toNumber(i),t,f)}var s="[object Number]";function a(i){return typeof i=="number"||n.isObjectLike(i)&&n.baseGetTag(i)==s}exports.clamp=c;exports.isNumber=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),s=require("react"),l=require("@radix-ui/react-label"),u=require("./index-VhKd73hZ.cjs"),d=require("./index-D3RLYf-J.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const m=c(s),n=c(l),b=u.cva("richtext-text-sm richtext-font-medium richtext-leading-none richtext-text-foreground peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"),a=m.forwardRef(({className:e,...r},t)=>o.jsx(n.Root,{className:d.cn(b(),e),ref:t,...r}));a.displayName=n.Root.displayName;exports.Label=a;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as t from "@radix-ui/react-label";
|
|
4
|
+
import { c as m } from "./index-CcoWj0mF.js";
|
|
5
|
+
import { c as s } from "./index-DF5ZPtWM.js";
|
|
6
|
+
const c = m(
|
|
7
|
+
"richtext-text-sm richtext-font-medium richtext-leading-none richtext-text-foreground peer-disabled:richtext-cursor-not-allowed peer-disabled:richtext-opacity-70"
|
|
8
|
+
), l = i.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ a(
|
|
9
|
+
t.Root,
|
|
10
|
+
{
|
|
11
|
+
className: s(c(), e),
|
|
12
|
+
ref: o,
|
|
13
|
+
...r
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
l.displayName = t.Root.displayName;
|
|
17
|
+
export {
|
|
18
|
+
l as L
|
|
19
|
+
};
|
package/lib/locale-bundle.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Doks9cbR.cjs");exports.en=e.locale;exports.fi=e.locale$5;exports.hu_HU=e.locale$1;exports.localeActions=e.localeActions;exports.pt_BR=e.locale$4;exports.useLocale=e.useLocale;exports.vi=e.locale$2;exports.zh_CN=e.locale$3;
|
package/lib/locale-bundle.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { a as e,
|
|
1
|
+
import { a as e, f as o, b as c, l, e as f, u as i, c as t, d as u } from "./index-Dujzr6bY.js";
|
|
2
2
|
export {
|
|
3
|
-
e as
|
|
4
|
-
o as
|
|
5
|
-
c as
|
|
6
|
-
l as
|
|
7
|
-
t as localeActions,
|
|
3
|
+
e as en,
|
|
4
|
+
o as fi,
|
|
5
|
+
c as hu_HU,
|
|
6
|
+
l as localeActions,
|
|
8
7
|
f as pt_BR,
|
|
9
8
|
i as useLocale,
|
|
10
|
-
|
|
9
|
+
t as vi,
|
|
11
10
|
u as zh_CN
|
|
12
11
|
};
|
package/lib/locales/en.d.ts
CHANGED
|
@@ -176,5 +176,21 @@ declare const locale: {
|
|
|
176
176
|
'editor.upload.fileTypeNotSupported': string;
|
|
177
177
|
'editor.upload.fileSizeTooBig': string;
|
|
178
178
|
'editor.upload.error': string;
|
|
179
|
+
'editor.callout.tooltip': string;
|
|
180
|
+
'editor.callout.dialog.title': string;
|
|
181
|
+
'editor.callout.dialog.type': string;
|
|
182
|
+
'editor.callout.dialog.type.placeholder': string;
|
|
183
|
+
'editor.callout.dialog.title.label': string;
|
|
184
|
+
'editor.callout.dialog.title.placeholder': string;
|
|
185
|
+
'editor.callout.dialog.body.label': string;
|
|
186
|
+
'editor.callout.dialog.body.placeholder': string;
|
|
187
|
+
'editor.callout.dialog.button.apply': string;
|
|
188
|
+
'editor.callout.dialog.button.cancel': string;
|
|
189
|
+
'editor.callout.edit.title': string;
|
|
190
|
+
'editor.callout.type.note': string;
|
|
191
|
+
'editor.callout.type.tip': string;
|
|
192
|
+
'editor.callout.type.important': string;
|
|
193
|
+
'editor.callout.type.warning': string;
|
|
194
|
+
'editor.callout.type.caution': string;
|
|
179
195
|
};
|
|
180
196
|
export default locale;
|
package/lib/locales/fi.d.ts
CHANGED
|
@@ -176,5 +176,21 @@ declare const locale: {
|
|
|
176
176
|
'editor.upload.fileTypeNotSupported': string;
|
|
177
177
|
'editor.upload.fileSizeTooBig': string;
|
|
178
178
|
'editor.upload.error': string;
|
|
179
|
+
'editor.callout.tooltip': string;
|
|
180
|
+
'editor.callout.dialog.title': string;
|
|
181
|
+
'editor.callout.dialog.type': string;
|
|
182
|
+
'editor.callout.dialog.type.placeholder': string;
|
|
183
|
+
'editor.callout.dialog.title.label': string;
|
|
184
|
+
'editor.callout.dialog.title.placeholder': string;
|
|
185
|
+
'editor.callout.dialog.body.label': string;
|
|
186
|
+
'editor.callout.dialog.body.placeholder': string;
|
|
187
|
+
'editor.callout.dialog.button.apply': string;
|
|
188
|
+
'editor.callout.dialog.button.cancel': string;
|
|
189
|
+
'editor.callout.edit.title': string;
|
|
190
|
+
'editor.callout.type.note': string;
|
|
191
|
+
'editor.callout.type.tip': string;
|
|
192
|
+
'editor.callout.type.important': string;
|
|
193
|
+
'editor.callout.type.warning': string;
|
|
194
|
+
'editor.callout.type.caution': string;
|
|
179
195
|
};
|
|
180
196
|
export default locale;
|
package/lib/locales/hu.d.ts
CHANGED
|
@@ -176,5 +176,21 @@ declare const locale: {
|
|
|
176
176
|
'editor.upload.fileTypeNotSupported': string;
|
|
177
177
|
'editor.upload.fileSizeTooBig': string;
|
|
178
178
|
'editor.upload.error': string;
|
|
179
|
+
'editor.callout.tooltip': string;
|
|
180
|
+
'editor.callout.dialog.title': string;
|
|
181
|
+
'editor.callout.dialog.type': string;
|
|
182
|
+
'editor.callout.dialog.type.placeholder': string;
|
|
183
|
+
'editor.callout.dialog.title.label': string;
|
|
184
|
+
'editor.callout.dialog.title.placeholder': string;
|
|
185
|
+
'editor.callout.dialog.body.label': string;
|
|
186
|
+
'editor.callout.dialog.body.placeholder': string;
|
|
187
|
+
'editor.callout.dialog.button.apply': string;
|
|
188
|
+
'editor.callout.dialog.button.cancel': string;
|
|
189
|
+
'editor.callout.edit.title': string;
|
|
190
|
+
'editor.callout.type.note': string;
|
|
191
|
+
'editor.callout.type.tip': string;
|
|
192
|
+
'editor.callout.type.important': string;
|
|
193
|
+
'editor.callout.type.warning': string;
|
|
194
|
+
'editor.callout.type.caution': string;
|
|
179
195
|
};
|
|
180
196
|
export default locale;
|