@aquera/nile-elements 2.0.2 → 2.0.4
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/README.md +19 -0
- package/demo/nxtgen-classes.css +2 -2
- package/demo/nxtgen-properties.css +2 -2
- package/demo/nxtgen-utilities.css +4 -4
- package/demo/nxtgen.css +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1120 -674
- package/dist/nile-empty-state/nile-empty-state.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.cjs.js.map +1 -1
- package/dist/nile-empty-state/nile-empty-state.css.cjs.js +1 -1
- package/dist/nile-empty-state/nile-empty-state.css.cjs.js.map +1 -1
- package/dist/nile-empty-state/nile-empty-state.css.esm.js +129 -6
- package/dist/nile-empty-state/nile-empty-state.esm.js +45 -31
- package/dist/nile-pagination/nile-pagination.cjs.js +1 -1
- package/dist/nile-pagination/nile-pagination.cjs.js.map +1 -1
- package/dist/nile-pagination/nile-pagination.esm.js +25 -25
- package/dist/nile-segmented-progress-bar/index.cjs.js +2 -0
- package/dist/nile-segmented-progress-bar/index.cjs.js.map +1 -0
- package/dist/nile-segmented-progress-bar/index.esm.js +1 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.cjs.js +2 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.cjs.js.map +1 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.css.cjs.js +2 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.css.cjs.js.map +1 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.css.esm.js +243 -0
- package/dist/nile-segmented-progress-bar/nile-segmented-progress-bar.esm.js +69 -0
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.css.js +127 -4
- package/dist/src/nile-empty-state/nile-empty-state.css.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.d.ts +35 -5
- package/dist/src/nile-empty-state/nile-empty-state.js +159 -42
- package/dist/src/nile-empty-state/nile-empty-state.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.d.ts +1 -0
- package/dist/src/nile-empty-state/nile-empty-state.test.js +186 -15
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-pagination/nile-pagination.js +5 -5
- package/dist/src/nile-pagination/nile-pagination.js.map +1 -1
- package/dist/src/nile-segmented-progress-bar/index.d.ts +2 -0
- package/dist/src/nile-segmented-progress-bar/index.js +2 -0
- package/dist/src/nile-segmented-progress-bar/index.js.map +1 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.css.d.ts +9 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.css.js +252 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.css.js.map +1 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.d.ts +135 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.js +373 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.js.map +1 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.test.d.ts +1 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.test.js +961 -0
- package/dist/src/nile-segmented-progress-bar/nile-segmented-progress-bar.test.js.map +1 -0
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/xml-09119317.cjs.js +2 -0
- package/dist/xml-09119317.cjs.js.map +1 -0
- package/dist/{xml-25c4108a.esm.js → xml-9bf771b3.esm.js} +1 -1
- package/package.json +2 -1
- package/src/index.ts +5 -0
- package/src/nile-empty-state/nile-empty-state.css.ts +127 -4
- package/src/nile-empty-state/nile-empty-state.test.ts +192 -15
- package/src/nile-empty-state/nile-empty-state.ts +195 -34
- package/src/nile-pagination/nile-pagination.ts +5 -5
- package/src/nile-segmented-progress-bar/index.ts +5 -0
- package/src/nile-segmented-progress-bar/nile-segmented-progress-bar.css.ts +254 -0
- package/src/nile-segmented-progress-bar/nile-segmented-progress-bar.test.ts +1298 -0
- package/src/nile-segmented-progress-bar/nile-segmented-progress-bar.ts +437 -0
- package/vscode-html-custom-data.json +192 -16
- package/dist/xml-90fd974e.cjs.js +0 -2
- package/dist/xml-90fd974e.cjs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as t,f as e,k as n,S as r,A as i,T as u,i as s,c as o,r as l,d as f,F as c,R as a,g as h,P as d,b as m,n as p}from"../../index-6f3fa4ab.esm.js";import{l as g,a as w,w as v,M as $,b}from"./schema.esm.js";import{d as M,e as y,s as k,m as C,f as j,g as x,h as B,i as A,j as L,l as H}from"../../index-7b1c9857.esm.js";import"./plugins/embeds.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";const S=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function T(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function E(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function F(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const I=(e,n)=>{let{$from:r,$to:i}=e.selection,u=r.blockRange(i),s=u&&t(u);return null!=s&&(n&&n(e.tr.lift(u,s).scrollIntoView()),!0)};function R(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const _=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let u=n.node(-1),s=n.indexAfter(-1),o=R(u.contentMatchAt(s));if(!o||!u.canReplaceWith(s,s,o))return!1;if(e){let i=n.after(),u=t.tr.replaceWith(i,i,o.createAndFill());u.setSelection(r.near(u.doc.resolve(i),1)),e(u.scrollIntoView())}return!0};const D=(t,e)=>{let{$from:n,$to:r}=t.selection;if(t.selection instanceof o&&t.selection.node.isBlock)return!(!n.parentOffset||!s(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let l,f,c=[],a=!1,h=!1;for(let t=n.depth;;t--){if(n.node(t).isBlock){a=n.end(t)==n.pos+(n.depth-t),h=n.start(t)==n.pos-(n.depth-t),f=R(n.node(t-1).contentMatchAt(n.indexAfter(t-1)));let e=O&&O(r.parent,a,n);c.unshift(e||(a&&f?{type:f}:null)),l=t;break}if(1==t)return!1;c.unshift(null)}let d=t.tr;(t.selection instanceof u||t.selection instanceof i)&&d.deleteSelection();let m=d.mapping.map(n.pos),p=s(d.doc,m,c.length,c);if(p||(c[0]=f?{type:f}:null,p=s(d.doc,m,c.length,c)),!p)return!1;if(d.split(m,c.length,c),!a&&h&&n.node(l).type!=f){let t=d.mapping.map(n.before(l)),e=d.doc.resolve(t);f&&n.node(l-1).canReplaceWith(e.index(),e.index()+1,f)&&d.setNodeMarkup(d.mapping.map(n.before(l)),f)}return e&&e(d.scrollIntoView()),!0};var O;function z(e,n,i,u){let s,o,l=n.nodeBefore,d=n.nodeAfter,m=l.type.spec.isolating||d.type.spec.isolating;if(!m&&function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,u=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(u-1,u)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(u,u+1)||!i.isTextblock&&!h(t.doc,e.pos)||(n&&n(t.tr.join(e.pos).scrollIntoView()),0)))}(e,n,i))return!0;let p=!m&&n.parent.canReplace(n.index(),n.index()+1);if(p&&(s=(o=l.contentMatchAt(l.childCount)).findWrapping(d.type))&&o.matchType(s[0]||d.type).validEnd){if(i){let t=n.pos+d.nodeSize,r=c.empty;for(let t=s.length-1;t>=0;t--)r=c.from(s[t].create(null,r));r=c.from(l.copy(r));let u=e.tr.step(new a(n.pos-1,t,n.pos,t,new f(r,1,0),s.length,!0)),o=u.doc.resolve(t+2*s.length);o.nodeAfter&&o.nodeAfter.type==l.type&&h(u.doc,o.pos)&&u.join(o.pos),i(u.scrollIntoView())}return!0}let g=d.type.spec.isolating||u>0&&m?null:r.findFrom(n,1),w=g&&g.$from.blockRange(g.$to),v=w&&t(w);if(null!=v&&v>=n.depth)return i&&i(e.tr.lift(w,v).scrollIntoView()),!0;if(p&&T(d,"start",!0)&&T(l,"end")){let t=l,r=[];for(;r.push(t),!t.isTextblock;)t=t.lastChild;let u=d,s=1;for(;!u.isTextblock;u=u.firstChild)s++;if(t.canReplace(t.childCount,t.childCount,u.content)){if(i){let t=c.empty;for(let e=r.length-1;e>=0;e--)t=c.from(r[e].copy(t));i(e.tr.step(new a(n.pos-r.length,n.pos+d.nodeSize,n.pos+s,n.pos+d.nodeSize-s,new f(t,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function P(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(u.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}const q=P(-1),G=P(1);function U(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(u,s,((r,u)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(u),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(u,s,t,e)}r(i.scrollIntoView())}return!0}}function W(t,e=null,r){let i=!1!==(r&&r.removeWhenPresent),u=!1!==(r&&r.enterInlineAtoms),s=!(r&&r.includeWhitespace);return function(r,o){let{empty:l,$cursor:f,ranges:c}=r.selection;if(l&&!f||!function(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:u,$to:s}=e[i],o=0==u.depth&&t.inlineContent&&t.type.allowsMarkType(n);if(t.nodesBetween(u.pos,s.pos,((t,e)=>{if(o||!r&&t.isAtom&&t.isInline&&e>=u.pos&&e+t.nodeSize<=s.pos)return!1;o=t.inlineContent&&t.type.allowsMarkType(n)})),o)return!0}return!1}(r.doc,c,t,u))return!1;if(o)if(f)t.isInSet(r.storedMarks||f.marks())?o(r.tr.removeStoredMark(t)):o(r.tr.addStoredMark(t.create(e)));else{let l,f=r.tr;u||(c=function(t){let e=[];for(let r=0;r<t.length;r++){let{$from:i,$to:u}=t[r];i.doc.nodesBetween(i.pos,u.pos,((t,r)=>{if(t.isAtom&&t.content.size&&t.isInline&&r>=i.pos&&r+t.nodeSize<=u.pos)return r+1>i.pos&&e.push(new n(i,i.doc.resolve(r+1))),i=i.doc.resolve(r+1+t.content.size),!1})),i.pos<u.pos&&e.push(new n(i,u))}return e}(c)),l=i?!c.some((e=>r.doc.rangeHasMark(e.$from.pos,e.$to.pos,t))):!c.every((e=>{let n=!1;return f.doc.nodesBetween(e.$from.pos,e.$to.pos,((r,i,u)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!u&&u.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))})),!n}));for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(l){let n=r.pos,u=i.pos,o=r.nodeAfter,l=i.nodeBefore,c=s&&o&&o.isText?/^\s*/.exec(o.text)[0].length:0,a=s&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<u&&(n+=c,u-=a),f.addMark(n,u,t.create(e))}else f.removeMark(r.pos,i.pos,t)}o(f.scrollIntoView())}return!0}}function J(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let K=J(S,((e,n,i)=>{let u=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(e,i);if(!u)return!1;let s=E(u);if(!s){let r=u.blockRange(),i=r&&t(r);return null!=i&&(n&&n(e.tr.lift(r,i).scrollIntoView()),!0)}let c=s.nodeBefore;if(z(e,s,n,-1))return!0;if(0==u.parent.content.size&&(T(c,"end")||o.isSelectable(c)))for(let t=u.depth;;t--){let i=l(e.doc,u.before(t),u.after(t),f.empty);if(i&&i.slice.size<i.to-i.from){if(n){let t=e.tr.step(i);t.setSelection(T(c,"end")?r.findFrom(t.doc.resolve(t.mapping.map(s.pos,-1)),-1):o.create(t.doc,s.pos-c.nodeSize)),n(t.scrollIntoView())}return!0}if(1==t||u.node(t-1).childCount>1)break}return!(!c.isAtom||s.depth!=u.depth-1)&&(n&&n(e.tr.delete(s.pos-c.nodeSize,s.pos).scrollIntoView()),!0)}),((t,e,n)=>{let{$head:r,empty:i}=t.selection,u=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;u=E(r)}let s=u&&u.nodeBefore;return!(!s||!o.isSelectable(s))&&(e&&e(t.tr.setSelection(o.create(t.doc,u.pos-s.nodeSize)).scrollIntoView()),!0)})),N=J(S,((t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!i)return!1;let u=F(i);if(!u)return!1;let s=u.nodeAfter;if(z(t,u,e,1))return!0;if(0==i.parent.content.size&&(T(s,"start")||o.isSelectable(s))){let n=l(t.doc,i.before(),i.after(),f.empty);if(n&&n.slice.size<n.to-n.from){if(e){let i=t.tr.step(n);i.setSelection(T(s,"start")?r.findFrom(i.doc.resolve(i.mapping.map(u.pos)),1):o.create(i.doc,i.mapping.map(u.pos))),e(i.scrollIntoView())}return!0}}return!(!s.isAtom||u.depth!=i.depth-1)&&(e&&e(t.tr.delete(u.pos,u.pos+s.nodeSize).scrollIntoView()),!0)}),((t,e,n)=>{let{$head:r,empty:i}=t.selection,u=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;u=F(r)}let s=u&&u.nodeAfter;return!(!s||!o.isSelectable(s))&&(e&&e(t.tr.setSelection(o.create(t.doc,u.pos)).scrollIntoView()),!0)}));const Q={Enter:J(((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof i||r.parent.inlineContent||s.parent.inlineContent)return!1;let o=R(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,i=t.tr.insert(n,o.createAndFill());i.setSelection(u.create(i.doc,n+1)),e(i.scrollIntoView())}return!0}),((e,n)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let t=r.before();if(s(e.doc,t))return n&&n(e.tr.split(t).scrollIntoView()),!0}let i=r.blockRange(),u=i&&t(i);return null!=u&&(n&&n(e.tr.lift(i,u).scrollIntoView()),!0)}),D),"Mod-Enter":_,Backspace:K,"Mod-Backspace":K,"Shift-Backspace":K,Delete:N,"Mod-Delete":N,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new i(t.doc))),!0)},V={"Ctrl-h":Q.Backspace,"Alt-Backspace":Q["Mod-Backspace"],"Ctrl-d":Q.Delete,"Ctrl-Alt-Backspace":Q["Mod-Delete"],"Alt-Delete":Q["Mod-Delete"],"Alt-d":Q["Mod-Delete"],"Ctrl-a":q,"Ctrl-e":G};for(let t in Q)V[t]=Q[t];const X=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?V:Q;var Y=200,Z=function(){};Z.prototype.append=function(t){return t.length?(t=Z.from(t),!this.length&&t||t.length<Y&&this.leafAppend(t)||this.length<Y&&t.leafPrepend(this)||this.appendInner(t)):this},Z.prototype.prepend=function(t){return t.length?Z.from(t).append(this):this},Z.prototype.appendInner=function(t){return new et(this,t)},Z.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Z.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Z.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Z.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Z.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Z.from=function(t){return t instanceof Z?t:t&&t.length?new tt(t):Z.empty};var tt=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Y)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Y)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Z);Z.empty=new tt([]);var et=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;return!(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Z);class nt{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let u,s,o=t.tr,l=[],f=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void f.push(t);if(n){f.push(new rt(t.map));let e,i=t.step.map(n.slice(r));i&&o.maybeStep(i).doc&&(e=o.mapping.maps[o.mapping.maps.length-1],l.push(new rt(e,void 0,void 0,l.length+f.length))),r--,e&&n.appendMap(e,r)}else o.maybeStep(t.step);return t.selection?(u=n?t.selection.map(n.slice(r)):t.selection,s=new nt(this.items.slice(0,i).append(f.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:o,selection:u}}addTransform(t,e,n,r){let i=[],u=this.eventCount,s=this.items,o=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,f=t.steps[n].invert(t.docs[n]),c=new rt(t.mapping.maps[n],f,e);(l=o&&o.merge(c))&&(c=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(c),e&&(u++,e=void 0),r||(o=c)}let l=u-n.depth;return l>ut&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),u-=l),new nt(s.append(i),u)}remapping(t,e){let n=new p;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new nt(this.items.append(t.map((t=>new rt(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,u=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let o=e;this.items.forEach((e=>{let r=i.getMirror(--o);if(null==r)return;u=Math.min(u,r);let l=i.maps[r];if(e.step){let u=t.steps[r].invert(t.docs[r]),f=e.selection&&e.selection.map(i.slice(o+1,r));f&&s++,n.push(new rt(l,u,f))}else n.push(new rt(l))}),r);let l=[];for(let t=e;t<u;t++)l.push(new rt(i.maps[t]));let f=this.items.slice(0,r).append(l).append(n),c=new nt(f,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((u,s)=>{if(s>=t)r.push(u),u.selection&&i++;else if(u.step){let t=u.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let o=u.selection&&u.selection.map(e.slice(n));o&&i++;let l,f=new rt(s.invert(),t,o),c=r.length-1;(l=r.length&&r[c].merge(f))?r[c]=l:r.push(f)}}else u.map&&n--}),this.items.length,0),new nt(Z.from(r.reverse()),i)}}nt.empty=new nt(Z.empty,0);class rt{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new rt(e.getMap().invert(),e,this.selection)}}}class it{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const ut=20;function st(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach(((t,n,r,i)=>e.push(r,i)));return e}function ot(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),u=e.map(t[r+1],-1);i<=u&&n.push(i,u)}return n}let lt=!1,ft=null;function ct(t){let e=t.plugins;if(ft!=e){lt=!1,ft=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){lt=!0;break}}return lt}const at=new d("history"),ht=new d("closeHistory");function dt(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new m({key:at,state:{init:()=>new it(nt.empty,nt.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let i,u=n.getMeta(at);if(u)return u.historyState;n.getMeta(ht)&&(t=new it(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(at))return s.getMeta(at).redo?new it(t.done.addTransform(n,void 0,r,ct(e)),t.undone,st(n.mapping.maps),t.prevTime,t.prevComposition):new it(t.done,t.undone.addTransform(n,void 0,r,ct(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new it(t.done.rebased(n,i),t.undone.rebased(n,i),ot(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new it(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ot(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),u=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)})),n}(n,t.prevRanges)),o=s?ot(t.prevRanges,n.mapping):st(n.mapping.maps);return new it(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,ct(e)),nt.empty,o,n.time,null==i?t.prevComposition:i)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?pt:"historyRedo"==n?gt:null;return!(!r||!t.editable)&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function mt(t,e){return(n,r)=>{let i=at.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let u=function(t,e,n){let r=ct(e),i=at.get(e).spec.config,u=(n?t.undone:t.done).popEvent(e,r);if(!u)return null;let s=u.selection.resolve(u.transform.doc),o=(n?t.done:t.undone).addTransform(u.transform,e.selection.getBookmark(),i,r),l=new it(n?o:u.remaining,n?u.remaining:o,null,0,-1);return u.transform.setSelection(s).setMeta(at,{redo:n,historyState:l})}(i,n,t);u&&r(e?u.scrollIntoView():u)}return!0}}const pt=mt(!1,!0),gt=mt(!0,!0);function wt(t,e){const{parent:n,parentOffset:r}=t,i=n.childAfter(r);if(!i.node||!e.isInSet(i.node.marks))return null;let u=i.index,s=t.start()+i.offset;for(;u>0&&e.isInSet(n.child(u-1).marks);)u-=1,s-=n.child(u).nodeSize;let o=i.index+1,l=s+i.node.nodeSize;for(;o<n.childCount&&e.isInSet(n.child(o).marks);)l+=n.child(o).nodeSize,o+=1;return{from:s,to:l}}function vt(t,e){return(n,r)=>{const{empty:i,ranges:s,$from:o}=n.selection;if(i&&!(n.selection instanceof u&&n.selection.$cursor))return!1;if(!i&&!n.selection.content().content.firstChild)return!1;if(r){const u=n.tr;if(i)u.removeStoredMark(t),e&&u.addStoredMark(t.create(e));else{for(const n of s)u.removeMark(n.$from.pos,n.$to.pos,t),e&&u.addMark(n.$from.pos,n.$to.pos,t.create(e));u.scrollIntoView()}r(u)}return!0}}function $t(t){const{$from:e}=t.selection,{bullet_list:n,ordered_list:r,task_list:i}=t.schema.nodes;for(let t=e.depth;t>0;t-=1){const u=e.node(t);if(u.type===n||u.type===r||u.type===i)return{node:u,pos:e.before(t),depth:t}}return null}function bt(t){const{schema:e}=t;return t===e.nodes.task_list?e.nodes.task_item:e.nodes.list_item}function Mt(t,e){return(n,r,i)=>{const s=$t(n);if(s){if(s.node.type===t)return g(bt(s.node.type))(n,r,i);if(r){const i=bt(s.node.type),o=[];s.node.forEach((t=>{o.push(t.type===i&&i!==e?e.create(null,t.content,t.marks):t)}));const l=t.create(s.node.attrs,o),f=n.tr,{from:c,to:a}=n.selection;f.replaceWith(s.pos,s.pos+s.node.nodeSize,l),f.setSelection(u.create(f.doc,c,a)),r(f)}return!0}return v(t)(n,r,i)}}function yt(t){return(n,r,i)=>function(t,e){const{$from:n}=t.selection;for(let t=n.depth;t>0;t-=1)if(n.node(t).type===e)return!0;return!1}(n,t)?I(n,r):function(t,n=null){return function(r,i){let{$from:u,$to:s}=r.selection,o=u.blockRange(s),l=o&&e(o,t,n);return!!l&&(i&&i(r.tr.wrap(o,l).scrollIntoView()),!0)}}(t)(n,r,i)}function kt(t){return(e,n)=>{const{from:r,to:i}=e.selection,u=[];if(e.doc.nodesBetween(r,i,((e,n)=>{if(e.isTextblock&&e.type.spec.attrs&&"indent"in e.type.spec.attrs){const r=e.attrs.indent??0,i=Math.max(0,Math.min(b,r+t));i!==r&&u.push({pos:n,node:e,next:i})}return!0})),0===u.length)return!1;if(n){const t=e.tr;for(const{pos:e,node:n,next:r}of u)t.setNodeMarkup(e,void 0,{...n.attrs,indent:r});n(t)}return!0}}function Ct(t){const{image:e,figure:n}=t.schema.nodes,r=t.selection;if(r instanceof o){if(r.node.type===e)return{node:r.node,pos:r.from,isFigure:!1};if(r.node.type===n)return{node:r.node,pos:r.from,isFigure:!0}}const{$from:i}=r;for(let t=i.depth;t>0;t-=1)if(i.node(t).type===n)return{node:i.node(t),pos:i.before(t),isFigure:!0};return null}function jt(t){const e=t.selection;return e instanceof o&&e.node.type===t.schema.nodes.embed?{node:e.node,pos:e.from}:null}function xt(t,e,n={}){const{schema:r}=t,{nodes:i,marks:s}=r;switch(e){case"bold":return W(s.bold);case"italic":return W(s.italic);case"underline":return W(s.underline);case"strike":return W(s.strike);case"subscript":return W(s.subscript);case"superscript":return W(s.superscript);case"code":return W(s.code);case"paragraph":return U(i.paragraph);case"heading":return U(i.heading,{level:n.level??1});case"blockquote":return yt(i.blockquote);case"align":return p=n.align??null,(t,e)=>{const{from:n,to:r}=t.selection,i=[];if(t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"align"in t.type.spec.attrs&&i.push({pos:e,node:t}),!0))),0===i.length)return!1;if(e){const n=t.tr;for(const{pos:t,node:e}of i)n.setNodeMarkup(t,void 0,{...e.attrs,align:p});e(n)}return!0};case"lineHeight":return m=n.lineHeight??null,(t,e)=>{const{from:n,to:r}=t.selection,i=[];if(t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"lineHeight"in t.type.spec.attrs&&i.push({pos:e,node:t}),!0))),0===i.length)return!1;if(e){const n=t.tr;for(const{pos:t,node:e}of i)n.setNodeMarkup(t,void 0,{...e.attrs,lineHeight:m});e(n)}return!0};case"bulletList":return Mt(i.bullet_list,i.list_item);case"orderedList":return Mt(i.ordered_list,i.list_item);case"taskList":return Mt(i.task_list,i.task_item);case"indent":return J(w(i.task_item),w(i.list_item),kt(1));case"outdent":return J(g(i.task_item),g(i.list_item),kt(-1),I);case"setListStyle":return d=n.style??null,(t,e)=>{const n=$t(t);if(!n)return!1;let r=n;const{$from:i}=t.selection,u=t.schema.nodes.ordered_list;for(let t=1;t<=i.depth;t+=1){const e=i.node(t);if(e.type===u&&(d===$||e.attrs.style===$)){r={node:e,pos:i.before(t),depth:t};break}}return e&&e(t.tr.setNodeMarkup(r.pos,void 0,{...r.node.attrs,style:d})),!0};case"setListStart":return h=n.start??1,(t,e)=>{const n=$t(t);return!(!n||n.node.type!==t.schema.nodes.ordered_list||(e&&e(t.tr.setNodeMarkup(n.pos,void 0,{...n.node.attrs,order:Math.max(1,Math.round(h))})),0))};case"toggleImageCaption":return function(t){return(e,n)=>{const r=Ct(e);if(!r)return!1;if(n){const i=e.tr;if(r.isFigure){const{src:e,alt:n,title:u,width:s}=r.node.attrs,l=t.nodes.image.create({src:e,alt:n,title:u,width:s});i.replaceWith(r.pos,r.pos+r.node.nodeSize,t.nodes.paragraph.create(null,l)),i.setSelection(o.create(i.doc,r.pos+1))}else{const{src:n,alt:s,title:o,width:l}=r.node.attrs,f=s?t.text(s):null,c=t.nodes.figure.create({src:n,alt:s,title:o,width:l,align:null},f),a=e.doc.resolve(r.pos),h=a.parent,d=1===h.childCount&&"paragraph"===h.type.name,m=d?a.before():r.pos,p=d?a.after():r.pos+r.node.nodeSize;i.replaceWith(m,p,c),i.setSelection(u.create(i.doc,m+1+c.content.size))}n(i.scrollIntoView())}return!0}}(r);case"setImageAlign":return function(t,e){return(n,r)=>{const i=Ct(n);if(!i)return!1;const u="left"===e||"center"===e||"right"===e?e:null;if(r){const e=n.tr;if(i.isFigure)e.setNodeMarkup(i.pos,void 0,{...i.node.attrs,align:u}),n.selection instanceof o&&e.setSelection(o.create(e.doc,i.pos));else{const{src:r,alt:s,title:l,width:f}=i.node.attrs,c=t.nodes.figure.create({src:r,alt:s,title:l,width:f,align:u}),a=n.doc.resolve(i.pos),h=a.parent,d=1===h.childCount&&"paragraph"===h.type.name,m=d?a.before():i.pos,p=d?a.after():i.pos+i.node.nodeSize;e.replaceWith(m,p,c),e.setSelection(o.create(e.doc,m))}r(e.scrollIntoView())}return!0}}(r,n.align??null);case"setImageWidth":return a=n.width??null,(t,e)=>{const n=Ct(t);if(!n)return!1;if(e){const r=t.tr.setNodeMarkup(n.pos,void 0,{...n.node.attrs,width:a&&a>0?Math.round(a):null});t.selection instanceof o&&r.setSelection(o.create(r.doc,n.pos)),e(r)}return!0};case"deleteImage":return(t,e)=>{const n=Ct(t);return!!n&&(e&&e(t.tr.delete(n.pos,n.pos+n.node.nodeSize).scrollIntoView()),!0)};case"setEmbedAlign":return function(t){return(e,n)=>{const r=jt(e);if(!r)return!1;const i="left"===t||"center"===t||"right"===t?t:null;if(n){const t=e.tr.setNodeMarkup(r.pos,void 0,{...r.node.attrs,align:i});t.setSelection(o.create(t.doc,r.pos)),n(t.scrollIntoView())}return!0}}(n.align??null);case"deleteEmbed":return(t,e)=>{const n=jt(t);return!!n&&(e&&e(t.tr.delete(n.pos,n.pos+n.node.nodeSize).scrollIntoView()),!0)};case"link":return function(t,e){return(n,r)=>{if(!e.href)return!1;const{empty:i,$from:u,from:s,to:o}=n.selection;let l={from:s,to:o};if(i){const e=wt(u,t);if(!e)return!1;l=e}if(r){const i=n.tr;i.removeMark(l.from,l.to,t),i.addMark(l.from,l.to,t.create({href:e.href,title:e.title??null,target:e.target??null})),r(i.scrollIntoView())}return!0}}(s.link,n);case"unlink":return c=s.link,(t,e)=>{const{empty:n,$from:r,from:i,to:u}=t.selection;let s={from:i,to:u};if(n){const t=wt(r,c);if(!t)return!1;s=t}else if(!t.doc.rangeHasMark(i,u,c))return!1;return e&&e(t.tr.removeMark(s.from,s.to,c)),!0};case"insertBookmark":return function(t,e){return(n,r)=>{const i=e.id?.trim();if(!i)return!1;if(r){const e=t.nodes.bookmark.create({id:i});r(n.tr.replaceSelectionWith(e,!1).scrollIntoView())}return!0}}(r,n);case"textColor":return vt(s.text_color,n.color?{color:n.color}:null);case"bgColor":return vt(s.bg_color,n.color?{color:n.color}:null);case"fontFamily":return vt(s.font_family,n.family?{family:n.family}:null);case"fontSize":return vt(s.font_size,n.size?{size:n.size}:null);case"horizontalRule":return f=i.horizontal_rule,(t,e)=>(e&&e(t.tr.replaceSelectionWith(f.create()).scrollIntoView()),!0);case"clearFormatting":return(t,e)=>{const{from:n,to:r,empty:i}=t.selection;if(e){const u=t.tr;i||u.removeMark(n,r,null),u.setStoredMarks([]),t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"align"in t.type.spec.attrs&&(t.attrs.align||t.attrs.lineHeight)&&u.setNodeMarkup(e,void 0,{...t.attrs,align:null,lineHeight:null}),!0))),e(u)}return!0};case"undo":return pt;case"redo":return gt;case"codeBlock":return function(t,e){return(n,r,i)=>{const{$from:u}=n.selection;return u.parent.type===t.nodes.code_block?U(t.nodes.paragraph)(n,r,i):U(t.nodes.code_block,{language:e})(n,r,i)}}(r,n.language??null);case"setCodeBlockLanguage":return function(t,e){return(n,r)=>{const{$from:i}=n.selection;for(let u=i.depth;u>0;u-=1)if(i.node(u).type===t.nodes.code_block)return r&&r(n.tr.setNodeMarkup(i.before(u),void 0,{language:e})),!0;return!1}}(r,n.language??null);case"insertEmbed":return function(t,e){return(n,r)=>{if(!e.src)return!1;const i=t.nodes.embed.create({src:e.src,provider:e.provider??null,title:e.title??null});return r&&r(n.tr.replaceSelectionWith(i).scrollIntoView()),!0}}(r,n);case"insertImage":return function(t,e){return(n,r)=>{if(!e.src)return!1;const i=e.src,u=e.alt??null,s=e.title??null,o=null!=e.caption?String(e.caption).trim():"",l=o?t.nodes.figure.create({src:i,alt:u,title:s,width:null,align:null},t.text(o)):t.nodes.image.create({src:i,alt:u,title:s});return r&&r(n.tr.replaceSelectionWith(l).scrollIntoView()),!0}}(r,n);case"updateImage":return function(t,e){return(n,r)=>{const i=Ct(n);if(!i||!e.src)return!1;const u=e.src,s=e.alt??null,l=e.title??null,f=null!=e.caption?String(e.caption).trim():"",c=i.node.attrs.width??null,a=i.isFigure?i.node.attrs.align??null:null;if(r){const e=n.tr;if(f){const r=t.nodes.figure.create({src:u,alt:s,title:l,width:c,align:a},t.text(f));if(i.isFigure)e.replaceWith(i.pos,i.pos+i.node.nodeSize,r),e.setSelection(o.create(e.doc,i.pos));else{const t=n.doc.resolve(i.pos),u=t.parent,s=1===u.childCount&&"paragraph"===u.type.name,l=s?t.before():i.pos,f=s?t.after():i.pos+i.node.nodeSize;e.replaceWith(l,f,r),e.setSelection(o.create(e.doc,l))}}else if(i.isFigure){const n=t.nodes.image.create({src:u,alt:s,title:l,width:c});e.replaceWith(i.pos,i.pos+i.node.nodeSize,t.nodes.paragraph.create(null,n)),e.setSelection(o.create(e.doc,i.pos+1))}else e.setNodeMarkup(i.pos,void 0,{src:u,alt:s,title:l,width:c}),n.selection instanceof o&&e.setSelection(o.create(e.doc,i.pos));r(e.scrollIntoView())}return!0}}(r,n);case"insertTable":return function(t,e){const n=Math.max(1,e.rows??3),r=Math.max(1,e.cols??3),i=e.withHeaderRow??!0;return(e,u)=>{const{table:s,table_row:o,table_cell:l,table_header:f}=t.nodes,c=[];for(let t=0;t<n;t+=1){const e=0===t&&i?f:l,n=[];for(let t=0;t<r;t+=1)n.push(e.createAndFill());c.push(o.create(null,n))}return u&&u(e.tr.replaceSelectionWith(s.create(null,c)).scrollIntoView()),!0}}(r,n);case"addRowBefore":return H;case"addRowAfter":return L;case"addColumnBefore":return A;case"addColumnAfter":return B;case"deleteRow":return x;case"deleteColumn":return j;case"mergeCells":return C;case"splitCell":return k;case"toggleHeaderRow":return y;case"toggleLayoutTable":return(t,e)=>{const{$from:n}=t.selection;for(let r=n.depth;r>0;r-=1){const i=n.node(r);if(i.type===t.schema.nodes.table)return e&&e(t.tr.setNodeMarkup(n.before(r),void 0,{...i.attrs,layout:!i.attrs.layout})),!0}return!1};case"deleteTable":return M;case"changeCase":return l=n.textCase??"upper",(t,e)=>{const{from:n,to:r,empty:i}=t.selection;if(i)return!1;const u=[];if(t.doc.nodesBetween(n,r,((t,e)=>{if(!t.isText||!t.text)return;const i=Math.max(n,e),s=Math.min(r,e+t.nodeSize);if(i>=s)return;const o=t.text.slice(i-e,s-e),f=function(t,e){switch(e){case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();case"title":return t.toLowerCase().replace(/(^|\s)(\p{L})/gu,((t,e,n)=>e+n.toUpperCase()));case"sentence":return t.toLowerCase().replace(/(^|[.!?]\s+)(\p{L})/gu,((t,e,n)=>e+n.toUpperCase()))}}(o,l);f!==o&&u.push({from:i,to:s,text:f,marks:t.marks})})),0===u.length)return!1;if(e){const n=t.tr;for(const e of u.reverse())n.replaceWith(e.from,e.to,t.schema.text(e.text,e.marks));e(n.scrollIntoView())}return!0};case"insertMergeField":return function(t,e){return(n,r)=>{const i=t.nodes.merge_field;if(!i||!e.id)return!1;if(r){const t=i.create({id:e.id,label:e.label??null});r(n.tr.replaceSelectionWith(t).scrollIntoView())}return!0}}(r,n);case"insertMath":return function(t,e){return(n,r)=>{const i=t.nodes.math,u=(e.latex??"").trim();if(!i||!u)return!1;if(r){const t=i.create({latex:u,display:e.mathDisplay??"inline"});r(n.tr.replaceSelectionWith(t).scrollIntoView())}return!0}}(r,n);default:return null}var l,f,c,a,h,d,m,p}export{jt as a,xt as b,J as c,X as d,_ as e,wt as g,dt as h,gt as r,Ct as s,pt as u};
|
|
1
|
+
import{l as t,f as e,k as n,S as r,A as i,T as u,i as s,c as o,r as l,d as f,F as c,R as a,g as h,P as d,b as m,n as p}from"../../index-6f3fa4ab.esm.js";import{l as g,a as w,w as v,M as $,b}from"./schema.esm.js";import{d as M,e as y,s as k,m as C,f as j,g as x,h as B,i as A,j as L,l as H}from"../../index-7b1c9857.esm.js";import"./plugins/embeds.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";const S=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function T(t,e,n=!1){for(let r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function E(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function F(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const I=(e,n)=>{let{$from:r,$to:i}=e.selection,u=r.blockRange(i),s=u&&t(u);return null!=s&&(n&&n(e.tr.lift(u,s).scrollIntoView()),!0)};function R(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const _=(t,e)=>{let{$head:n,$anchor:i}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(i))return!1;let u=n.node(-1),s=n.indexAfter(-1),o=R(u.contentMatchAt(s));if(!o||!u.canReplaceWith(s,s,o))return!1;if(e){let i=n.after(),u=t.tr.replaceWith(i,i,o.createAndFill());u.setSelection(r.near(u.doc.resolve(i),1)),e(u.scrollIntoView())}return!0};const D=(t,e)=>{if(t.selection instanceof o&&t.selection.node.isBlock){let{$from:n}=t.selection;return!(!n.parentOffset||!s(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0))}if(!t.selection.$from.depth)return!1;let n=t.tr;!t.selection.empty&&(t.selection instanceof u||t.selection instanceof i)&&n.deleteSelection();let r,l,{$from:f}=n.selection,c=n.steps.length,a=[],h=!1,d=!1;for(let t=f.depth;;t--){if(f.node(t).isBlock){h=f.end(t)==f.pos+(f.depth-t),d=f.start(t)==f.pos-(f.depth-t),l=R(f.node(t-1).contentMatchAt(f.indexAfter(t-1)));let e=O&&O(f.parent,h,f);a.unshift(e||(h&&l?{type:l}:null)),r=t;break}if(1==t)return!1;a.unshift(null)}let m=f.pos,p=s(n.doc,m,a.length,a);if(p||(a[0]=l?{type:l}:null,p=s(n.doc,m,a.length,a)),!p)return!1;if(n.split(m,a.length,a),!h&&d&&f.node(r).type!=l){let t=n.mapping.slice(c),e=t.map(f.before(r)),i=n.doc.resolve(e);l&&f.node(r-1).canReplaceWith(i.index(),i.index()+1,l)&&n.setNodeMarkup(t.map(f.before(r)),l)}return e&&e(n.scrollIntoView()),!0};var O;function z(e,n,i,u){let s,o,l=n.nodeBefore,d=n.nodeAfter,m=l.type.spec.isolating||d.type.spec.isolating;if(!m&&function(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,u=e.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&e.parent.canReplace(u-1,u)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(u,u+1)||!i.isTextblock&&!h(t.doc,e.pos)||(n&&n(t.tr.join(e.pos).scrollIntoView()),0)))}(e,n,i))return!0;let p=!m&&n.parent.canReplace(n.index(),n.index()+1);if(p&&(s=(o=l.contentMatchAt(l.childCount)).findWrapping(d.type))&&o.matchType(s[0]||d.type).validEnd){if(i){let t=n.pos+d.nodeSize,r=c.empty;for(let t=s.length-1;t>=0;t--)r=c.from(s[t].create(null,r));r=c.from(l.copy(r));let u=e.tr.step(new a(n.pos-1,t,n.pos,t,new f(r,1,0),s.length,!0)),o=u.doc.resolve(t+2*s.length);o.nodeAfter&&o.nodeAfter.type==l.type&&h(u.doc,o.pos)&&u.join(o.pos),i(u.scrollIntoView())}return!0}let g=d.type.spec.isolating||u>0&&m?null:r.findFrom(n,1),w=g&&g.$from.blockRange(g.$to),v=w&&t(w);if(null!=v&&v>=n.depth)return i&&i(e.tr.lift(w,v).scrollIntoView()),!0;if(p&&T(d,"start",!0)&&T(l,"end")){let t=l,r=[];for(;r.push(t),!t.isTextblock;)t=t.lastChild;let u=d,s=1;for(;!u.isTextblock;u=u.firstChild)s++;if(t.canReplace(t.childCount,t.childCount,u.content)){if(i){let t=c.empty;for(let e=r.length-1;e>=0;e--)t=c.from(r[e].copy(t));i(e.tr.step(new a(n.pos-r.length,n.pos+d.nodeSize,n.pos+s,n.pos+d.nodeSize-s,new f(t,r.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function P(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(u.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}const q=P(-1),G=P(1);function U(t,e=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(u,s,((r,u)=>{if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{let e=n.doc.resolve(u),r=e.index();i=e.parent.canReplaceWith(r,r+1,t)}}))}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:u},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(u,s,t,e)}r(i.scrollIntoView())}return!0}}function W(t,e=null,r){let i=!1!==(r&&r.removeWhenPresent),u=!1!==(r&&r.enterInlineAtoms),s=!(r&&r.includeWhitespace);return function(r,o){let{empty:l,$cursor:f,ranges:c}=r.selection;if(l&&!f||!function(t,e,n,r){for(let i=0;i<e.length;i++){let{$from:u,$to:s}=e[i],o=0==u.depth&&t.inlineContent&&t.type.allowsMarkType(n);if(t.nodesBetween(u.pos,s.pos,((t,e)=>{if(o||!r&&t.isAtom&&t.isInline&&e>=u.pos&&e+t.nodeSize<=s.pos)return!1;o=t.inlineContent&&t.type.allowsMarkType(n)})),o)return!0}return!1}(r.doc,c,t,u))return!1;if(o)if(f)t.isInSet(r.storedMarks||f.marks())?o(r.tr.removeStoredMark(t)):o(r.tr.addStoredMark(t.create(e)));else{let l,f=r.tr;u||(c=function(t){let e=[];for(let r=0;r<t.length;r++){let{$from:i,$to:u}=t[r];i.doc.nodesBetween(i.pos,u.pos,((t,r)=>{if(t.isAtom&&t.content.size&&t.isInline&&r>=i.pos&&r+t.nodeSize<=u.pos)return r+1>i.pos&&e.push(new n(i,i.doc.resolve(r+1))),i=i.doc.resolve(r+1+t.content.size),!1})),i.pos<u.pos&&e.push(new n(i,u))}return e}(c)),l=i?!c.some((e=>r.doc.rangeHasMark(e.$from.pos,e.$to.pos,t))):!c.every((e=>{let n=!1;return f.doc.nodesBetween(e.$from.pos,e.$to.pos,((r,i,u)=>{if(n)return!1;n=!t.isInSet(r.marks)&&!!u&&u.type.allowsMarkType(t)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,e.$from.pos-i),Math.min(r.nodeSize,e.$to.pos-i))))})),!n}));for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(l){let n=r.pos,u=i.pos,o=r.nodeAfter,l=i.nodeBefore,c=s&&o&&o.isText?/^\s*/.exec(o.text)[0].length:0,a=s&&l&&l.isText?/\s*$/.exec(l.text)[0].length:0;n+c<u&&(n+=c,u-=a),f.addMark(n,u,t.create(e))}else f.removeMark(r.pos,i.pos,t)}o(f.scrollIntoView())}return!0}}function J(...t){return function(e,n,r){for(let i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}let K=J(S,((e,n,i)=>{let u=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(e,i);if(!u)return!1;let s=E(u);if(!s){let r=u.blockRange(),i=r&&t(r);return null!=i&&(n&&n(e.tr.lift(r,i).scrollIntoView()),!0)}let c=s.nodeBefore;if(z(e,s,n,-1))return!0;if(0==u.parent.content.size&&(T(c,"end")||o.isSelectable(c)))for(let t=u.depth;;t--){let i=l(e.doc,u.before(t),u.after(t),f.empty);if(i&&i.slice.size<i.to-i.from){if(n){let t=e.tr.step(i);t.setSelection(T(c,"end")?r.findFrom(t.doc.resolve(t.mapping.map(s.pos,-1)),-1):o.create(t.doc,s.pos-c.nodeSize)),n(t.scrollIntoView())}return!0}if(1==t||u.node(t-1).childCount>1)break}return!(!c.isAtom||s.depth!=u.depth-1)&&(n&&n(e.tr.delete(s.pos-c.nodeSize,s.pos).scrollIntoView()),!0)}),((t,e,n)=>{let{$head:r,empty:i}=t.selection,u=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;u=E(r)}let s=u&&u.nodeBefore;return!(!s||!o.isSelectable(s))&&(e&&e(t.tr.setSelection(o.create(t.doc,u.pos-s.nodeSize)).scrollIntoView()),!0)})),N=J(S,((t,e,n)=>{let i=function(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!i)return!1;let u=F(i);if(!u)return!1;let s=u.nodeAfter;if(z(t,u,e,1))return!0;if(0==i.parent.content.size&&(T(s,"start")||o.isSelectable(s))){let n=l(t.doc,i.before(),i.after(),f.empty);if(n&&n.slice.size<n.to-n.from){if(e){let i=t.tr.step(n);i.setSelection(T(s,"start")?r.findFrom(i.doc.resolve(i.mapping.map(u.pos)),1):o.create(i.doc,i.mapping.map(u.pos))),e(i.scrollIntoView())}return!0}}return!(!s.isAtom||u.depth!=i.depth-1)&&(e&&e(t.tr.delete(u.pos,u.pos+s.nodeSize).scrollIntoView()),!0)}),((t,e,n)=>{let{$head:r,empty:i}=t.selection,u=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;u=F(r)}let s=u&&u.nodeAfter;return!(!s||!o.isSelectable(s))&&(e&&e(t.tr.setSelection(o.create(t.doc,u.pos)).scrollIntoView()),!0)}));const Q={Enter:J(((t,e)=>{let{$head:n,$anchor:r}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),((t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof i||r.parent.inlineContent||s.parent.inlineContent)return!1;let o=R(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let n=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,i=t.tr.insert(n,o.createAndFill());i.setSelection(u.create(i.doc,n+1)),e(i.scrollIntoView())}return!0}),((e,n)=>{let{$cursor:r}=e.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let t=r.before();if(s(e.doc,t))return n&&n(e.tr.split(t).scrollIntoView()),!0}let i=r.blockRange(),u=i&&t(i);return null!=u&&(n&&n(e.tr.lift(i,u).scrollIntoView()),!0)}),D),"Mod-Enter":_,Backspace:K,"Mod-Backspace":K,"Shift-Backspace":K,Delete:N,"Mod-Delete":N,"Mod-a":(t,e)=>(e&&e(t.tr.setSelection(new i(t.doc))),!0)},V={"Ctrl-h":Q.Backspace,"Alt-Backspace":Q["Mod-Backspace"],"Ctrl-d":Q.Delete,"Ctrl-Alt-Backspace":Q["Mod-Delete"],"Alt-Delete":Q["Mod-Delete"],"Alt-d":Q["Mod-Delete"],"Ctrl-a":q,"Ctrl-e":G};for(let t in Q)V[t]=Q[t];const X=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?V:Q;var Y=200,Z=function(){};Z.prototype.append=function(t){return t.length?(t=Z.from(t),!this.length&&t||t.length<Y&&this.leafAppend(t)||this.length<Y&&t.leafPrepend(this)||this.appendInner(t)):this},Z.prototype.prepend=function(t){return t.length?Z.from(t).append(this):this},Z.prototype.appendInner=function(t){return new et(this,t)},Z.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Z.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Z.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Z.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Z.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Z.from=function(t){return t instanceof Z?t:t&&t.length?new tt(t):Z.empty};var tt=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Y)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Y)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Z);Z.empty=new tt([]);var et=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;return!(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Z);class nt{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(n=this.remapping(i,this.items.length),r=n.maps.length);let u,s,o=t.tr,l=[],f=[];return this.items.forEach(((t,e)=>{if(!t.step)return n||(n=this.remapping(i,e+1),r=n.maps.length),r--,void f.push(t);if(n){f.push(new rt(t.map));let e,i=t.step.map(n.slice(r));i&&o.maybeStep(i).doc&&(e=o.mapping.maps[o.mapping.maps.length-1],l.push(new rt(e,void 0,void 0,l.length+f.length))),r--,e&&n.appendMap(e,r)}else o.maybeStep(t.step);return t.selection?(u=n?t.selection.map(n.slice(r)):t.selection,s=new nt(this.items.slice(0,i).append(f.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:o,selection:u}}addTransform(t,e,n,r){let i=[],u=this.eventCount,s=this.items,o=!r&&s.length?s.get(s.length-1):null;for(let n=0;n<t.steps.length;n++){let l,f=t.steps[n].invert(t.docs[n]),c=new rt(t.mapping.maps[n],f,e);(l=o&&o.merge(c))&&(c=l,n?i.pop():s=s.slice(0,s.length-1)),i.push(c),e&&(u++,e=void 0),r||(o=c)}let l=u-n.depth;return l>ut&&(s=function(t,e){let n;return t.forEach(((t,r)=>{if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,l),u-=l),new nt(s.append(i),u)}remapping(t,e){let n=new p;return this.items.forEach(((e,r)=>{let i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}addMaps(t){return 0==this.eventCount?this:new nt(this.items.append(t.map((t=>new rt(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-e),i=t.mapping,u=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),r);let o=e;this.items.forEach((e=>{let r=i.getMirror(--o);if(null==r)return;u=Math.min(u,r);let l=i.maps[r];if(e.step){let u=t.steps[r].invert(t.docs[r]),f=e.selection&&e.selection.map(i.slice(o+1,r));f&&s++,n.push(new rt(l,u,f))}else n.push(new rt(l))}),r);let l=[];for(let t=e;t<u;t++)l.push(new rt(i.maps[t]));let f=this.items.slice(0,r).append(l).append(n),c=new nt(f,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach(((u,s)=>{if(s>=t)r.push(u),u.selection&&i++;else if(u.step){let t=u.step.map(e.slice(n)),s=t&&t.getMap();if(n--,s&&e.appendMap(s,n),t){let o=u.selection&&u.selection.map(e.slice(n));o&&i++;let l,f=new rt(s.invert(),t,o),c=r.length-1;(l=r.length&&r[c].merge(f))?r[c]=l:r.push(f)}}else u.map&&n--}),this.items.length,0),new nt(Z.from(r.reverse()),i)}}nt.empty=new nt(Z.empty,0);class rt{constructor(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new rt(e.getMap().invert(),e,this.selection)}}}class it{constructor(t,e,n,r,i){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const ut=20;function st(t){let e=[];for(let n=t.length-1;n>=0&&0==e.length;n--)t[n].forEach(((t,n,r,i)=>e.push(r,i)));return e}function ot(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),u=e.map(t[r+1],-1);i<=u&&n.push(i,u)}return n}let lt=!1,ft=null;function ct(t){let e=t.plugins;if(ft!=e){lt=!1,ft=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){lt=!0;break}}return lt}const at=new d("history"),ht=new d("closeHistory");function dt(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new m({key:at,state:{init:()=>new it(nt.empty,nt.empty,null,0,-1),apply:(e,n,r)=>function(t,e,n,r){let i,u=n.getMeta(at);if(u)return u.historyState;n.getMeta(ht)&&(t=new it(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(s&&s.getMeta(at))return s.getMeta(at).redo?new it(t.done.addTransform(n,void 0,r,ct(e)),t.undone,st(n.mapping.maps),t.prevTime,t.prevComposition):new it(t.done,t.undone.addTransform(n,void 0,r,ct(e)),null,t.prevTime,t.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new it(t.done.rebased(n,i),t.undone.rebased(n,i),ot(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new it(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),ot(t.prevRanges,n.mapping),t.prevTime,t.prevComposition);{let i=n.getMeta("composition"),u=0==t.prevTime||!s&&t.prevComposition!=i&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach(((t,r)=>{for(let i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)})),n}(n,t.prevRanges)),o=s?ot(t.prevRanges,n.mapping):st(n.mapping.maps);return new it(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,ct(e)),nt.empty,o,n.time,null==i?t.prevComposition:i)}}(n,r,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let n=e.inputType,r="historyUndo"==n?pt:"historyRedo"==n?gt:null;return!(!r||!t.editable)&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}function mt(t,e){return(n,r)=>{let i=at.getState(n);if(!i||0==(t?i.undone:i.done).eventCount)return!1;if(r){let u=function(t,e,n){let r=ct(e),i=at.get(e).spec.config,u=(n?t.undone:t.done).popEvent(e,r);if(!u)return null;let s=u.selection.resolve(u.transform.doc),o=(n?t.done:t.undone).addTransform(u.transform,e.selection.getBookmark(),i,r),l=new it(n?o:u.remaining,n?u.remaining:o,null,0,-1);return u.transform.setSelection(s).setMeta(at,{redo:n,historyState:l})}(i,n,t);u&&r(e?u.scrollIntoView():u)}return!0}}const pt=mt(!1,!0),gt=mt(!0,!0);function wt(t,e){const{parent:n,parentOffset:r}=t,i=n.childAfter(r);if(!i.node||!e.isInSet(i.node.marks))return null;let u=i.index,s=t.start()+i.offset;for(;u>0&&e.isInSet(n.child(u-1).marks);)u-=1,s-=n.child(u).nodeSize;let o=i.index+1,l=s+i.node.nodeSize;for(;o<n.childCount&&e.isInSet(n.child(o).marks);)l+=n.child(o).nodeSize,o+=1;return{from:s,to:l}}function vt(t,e){return(n,r)=>{const{empty:i,ranges:s,$from:o}=n.selection;if(i&&!(n.selection instanceof u&&n.selection.$cursor))return!1;if(!i&&!n.selection.content().content.firstChild)return!1;if(r){const u=n.tr;if(i)u.removeStoredMark(t),e&&u.addStoredMark(t.create(e));else{for(const n of s)u.removeMark(n.$from.pos,n.$to.pos,t),e&&u.addMark(n.$from.pos,n.$to.pos,t.create(e));u.scrollIntoView()}r(u)}return!0}}function $t(t){const{$from:e}=t.selection,{bullet_list:n,ordered_list:r,task_list:i}=t.schema.nodes;for(let t=e.depth;t>0;t-=1){const u=e.node(t);if(u.type===n||u.type===r||u.type===i)return{node:u,pos:e.before(t),depth:t}}return null}function bt(t){const{schema:e}=t;return t===e.nodes.task_list?e.nodes.task_item:e.nodes.list_item}function Mt(t,e){return(n,r,i)=>{const s=$t(n);if(s){if(s.node.type===t)return g(bt(s.node.type))(n,r,i);if(r){const i=bt(s.node.type),o=[];s.node.forEach((t=>{o.push(t.type===i&&i!==e?e.create(null,t.content,t.marks):t)}));const l=t.create(s.node.attrs,o),f=n.tr,{from:c,to:a}=n.selection;f.replaceWith(s.pos,s.pos+s.node.nodeSize,l),f.setSelection(u.create(f.doc,c,a)),r(f)}return!0}return v(t)(n,r,i)}}function yt(t){return(n,r,i)=>function(t,e){const{$from:n}=t.selection;for(let t=n.depth;t>0;t-=1)if(n.node(t).type===e)return!0;return!1}(n,t)?I(n,r):function(t,n=null){return function(r,i){let{$from:u,$to:s}=r.selection,o=u.blockRange(s),l=o&&e(o,t,n);return!!l&&(i&&i(r.tr.wrap(o,l).scrollIntoView()),!0)}}(t)(n,r,i)}function kt(t){return(e,n)=>{const{from:r,to:i}=e.selection,u=[];if(e.doc.nodesBetween(r,i,((e,n)=>{if(e.isTextblock&&e.type.spec.attrs&&"indent"in e.type.spec.attrs){const r=e.attrs.indent??0,i=Math.max(0,Math.min(b,r+t));i!==r&&u.push({pos:n,node:e,next:i})}return!0})),0===u.length)return!1;if(n){const t=e.tr;for(const{pos:e,node:n,next:r}of u)t.setNodeMarkup(e,void 0,{...n.attrs,indent:r});n(t)}return!0}}function Ct(t){const{image:e,figure:n}=t.schema.nodes,r=t.selection;if(r instanceof o){if(r.node.type===e)return{node:r.node,pos:r.from,isFigure:!1};if(r.node.type===n)return{node:r.node,pos:r.from,isFigure:!0}}const{$from:i}=r;for(let t=i.depth;t>0;t-=1)if(i.node(t).type===n)return{node:i.node(t),pos:i.before(t),isFigure:!0};return null}function jt(t){const e=t.selection;return e instanceof o&&e.node.type===t.schema.nodes.embed?{node:e.node,pos:e.from}:null}function xt(t,e,n={}){const{schema:r}=t,{nodes:i,marks:s}=r;switch(e){case"bold":return W(s.bold);case"italic":return W(s.italic);case"underline":return W(s.underline);case"strike":return W(s.strike);case"subscript":return W(s.subscript);case"superscript":return W(s.superscript);case"code":return W(s.code);case"paragraph":return U(i.paragraph);case"heading":return U(i.heading,{level:n.level??1});case"blockquote":return yt(i.blockquote);case"align":return p=n.align??null,(t,e)=>{const{from:n,to:r}=t.selection,i=[];if(t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"align"in t.type.spec.attrs&&i.push({pos:e,node:t}),!0))),0===i.length)return!1;if(e){const n=t.tr;for(const{pos:t,node:e}of i)n.setNodeMarkup(t,void 0,{...e.attrs,align:p});e(n)}return!0};case"lineHeight":return m=n.lineHeight??null,(t,e)=>{const{from:n,to:r}=t.selection,i=[];if(t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"lineHeight"in t.type.spec.attrs&&i.push({pos:e,node:t}),!0))),0===i.length)return!1;if(e){const n=t.tr;for(const{pos:t,node:e}of i)n.setNodeMarkup(t,void 0,{...e.attrs,lineHeight:m});e(n)}return!0};case"bulletList":return Mt(i.bullet_list,i.list_item);case"orderedList":return Mt(i.ordered_list,i.list_item);case"taskList":return Mt(i.task_list,i.task_item);case"indent":return J(w(i.task_item),w(i.list_item),kt(1));case"outdent":return J(g(i.task_item),g(i.list_item),kt(-1),I);case"setListStyle":return d=n.style??null,(t,e)=>{const n=$t(t);if(!n)return!1;let r=n;const{$from:i}=t.selection,u=t.schema.nodes.ordered_list;for(let t=1;t<=i.depth;t+=1){const e=i.node(t);if(e.type===u&&(d===$||e.attrs.style===$)){r={node:e,pos:i.before(t),depth:t};break}}return e&&e(t.tr.setNodeMarkup(r.pos,void 0,{...r.node.attrs,style:d})),!0};case"setListStart":return h=n.start??1,(t,e)=>{const n=$t(t);return!(!n||n.node.type!==t.schema.nodes.ordered_list||(e&&e(t.tr.setNodeMarkup(n.pos,void 0,{...n.node.attrs,order:Math.max(1,Math.round(h))})),0))};case"toggleImageCaption":return function(t){return(e,n)=>{const r=Ct(e);if(!r)return!1;if(n){const i=e.tr;if(r.isFigure){const{src:e,alt:n,title:u,width:s}=r.node.attrs,l=t.nodes.image.create({src:e,alt:n,title:u,width:s});i.replaceWith(r.pos,r.pos+r.node.nodeSize,t.nodes.paragraph.create(null,l)),i.setSelection(o.create(i.doc,r.pos+1))}else{const{src:n,alt:s,title:o,width:l}=r.node.attrs,f=s?t.text(s):null,c=t.nodes.figure.create({src:n,alt:s,title:o,width:l,align:null},f),a=e.doc.resolve(r.pos),h=a.parent,d=1===h.childCount&&"paragraph"===h.type.name,m=d?a.before():r.pos,p=d?a.after():r.pos+r.node.nodeSize;i.replaceWith(m,p,c),i.setSelection(u.create(i.doc,m+1+c.content.size))}n(i.scrollIntoView())}return!0}}(r);case"setImageAlign":return function(t,e){return(n,r)=>{const i=Ct(n);if(!i)return!1;const u="left"===e||"center"===e||"right"===e?e:null;if(r){const e=n.tr;if(i.isFigure)e.setNodeMarkup(i.pos,void 0,{...i.node.attrs,align:u}),n.selection instanceof o&&e.setSelection(o.create(e.doc,i.pos));else{const{src:r,alt:s,title:l,width:f}=i.node.attrs,c=t.nodes.figure.create({src:r,alt:s,title:l,width:f,align:u}),a=n.doc.resolve(i.pos),h=a.parent,d=1===h.childCount&&"paragraph"===h.type.name,m=d?a.before():i.pos,p=d?a.after():i.pos+i.node.nodeSize;e.replaceWith(m,p,c),e.setSelection(o.create(e.doc,m))}r(e.scrollIntoView())}return!0}}(r,n.align??null);case"setImageWidth":return a=n.width??null,(t,e)=>{const n=Ct(t);if(!n)return!1;if(e){const r=t.tr.setNodeMarkup(n.pos,void 0,{...n.node.attrs,width:a&&a>0?Math.round(a):null});t.selection instanceof o&&r.setSelection(o.create(r.doc,n.pos)),e(r)}return!0};case"deleteImage":return(t,e)=>{const n=Ct(t);return!!n&&(e&&e(t.tr.delete(n.pos,n.pos+n.node.nodeSize).scrollIntoView()),!0)};case"setEmbedAlign":return function(t){return(e,n)=>{const r=jt(e);if(!r)return!1;const i="left"===t||"center"===t||"right"===t?t:null;if(n){const t=e.tr.setNodeMarkup(r.pos,void 0,{...r.node.attrs,align:i});t.setSelection(o.create(t.doc,r.pos)),n(t.scrollIntoView())}return!0}}(n.align??null);case"deleteEmbed":return(t,e)=>{const n=jt(t);return!!n&&(e&&e(t.tr.delete(n.pos,n.pos+n.node.nodeSize).scrollIntoView()),!0)};case"link":return function(t,e){return(n,r)=>{if(!e.href)return!1;const{empty:i,$from:u,from:s,to:o}=n.selection;let l={from:s,to:o};if(i){const e=wt(u,t);if(!e)return!1;l=e}if(r){const i=n.tr;i.removeMark(l.from,l.to,t),i.addMark(l.from,l.to,t.create({href:e.href,title:e.title??null,target:e.target??null})),r(i.scrollIntoView())}return!0}}(s.link,n);case"unlink":return c=s.link,(t,e)=>{const{empty:n,$from:r,from:i,to:u}=t.selection;let s={from:i,to:u};if(n){const t=wt(r,c);if(!t)return!1;s=t}else if(!t.doc.rangeHasMark(i,u,c))return!1;return e&&e(t.tr.removeMark(s.from,s.to,c)),!0};case"insertBookmark":return function(t,e){return(n,r)=>{const i=e.id?.trim();if(!i)return!1;if(r){const e=t.nodes.bookmark.create({id:i});r(n.tr.replaceSelectionWith(e,!1).scrollIntoView())}return!0}}(r,n);case"textColor":return vt(s.text_color,n.color?{color:n.color}:null);case"bgColor":return vt(s.bg_color,n.color?{color:n.color}:null);case"fontFamily":return vt(s.font_family,n.family?{family:n.family}:null);case"fontSize":return vt(s.font_size,n.size?{size:n.size}:null);case"horizontalRule":return f=i.horizontal_rule,(t,e)=>(e&&e(t.tr.replaceSelectionWith(f.create()).scrollIntoView()),!0);case"clearFormatting":return(t,e)=>{const{from:n,to:r,empty:i}=t.selection;if(e){const u=t.tr;i||u.removeMark(n,r,null),u.setStoredMarks([]),t.doc.nodesBetween(n,r,((t,e)=>(t.isTextblock&&t.type.spec.attrs&&"align"in t.type.spec.attrs&&(t.attrs.align||t.attrs.lineHeight)&&u.setNodeMarkup(e,void 0,{...t.attrs,align:null,lineHeight:null}),!0))),e(u)}return!0};case"undo":return pt;case"redo":return gt;case"codeBlock":return function(t,e){return(n,r,i)=>{const{$from:u}=n.selection;return u.parent.type===t.nodes.code_block?U(t.nodes.paragraph)(n,r,i):U(t.nodes.code_block,{language:e})(n,r,i)}}(r,n.language??null);case"setCodeBlockLanguage":return function(t,e){return(n,r)=>{const{$from:i}=n.selection;for(let u=i.depth;u>0;u-=1)if(i.node(u).type===t.nodes.code_block)return r&&r(n.tr.setNodeMarkup(i.before(u),void 0,{language:e})),!0;return!1}}(r,n.language??null);case"insertEmbed":return function(t,e){return(n,r)=>{if(!e.src)return!1;const i=t.nodes.embed.create({src:e.src,provider:e.provider??null,title:e.title??null});return r&&r(n.tr.replaceSelectionWith(i).scrollIntoView()),!0}}(r,n);case"insertImage":return function(t,e){return(n,r)=>{if(!e.src)return!1;const i=e.src,u=e.alt??null,s=e.title??null,o=null!=e.caption?String(e.caption).trim():"",l=o?t.nodes.figure.create({src:i,alt:u,title:s,width:null,align:null},t.text(o)):t.nodes.image.create({src:i,alt:u,title:s});return r&&r(n.tr.replaceSelectionWith(l).scrollIntoView()),!0}}(r,n);case"updateImage":return function(t,e){return(n,r)=>{const i=Ct(n);if(!i||!e.src)return!1;const u=e.src,s=e.alt??null,l=e.title??null,f=null!=e.caption?String(e.caption).trim():"",c=i.node.attrs.width??null,a=i.isFigure?i.node.attrs.align??null:null;if(r){const e=n.tr;if(f){const r=t.nodes.figure.create({src:u,alt:s,title:l,width:c,align:a},t.text(f));if(i.isFigure)e.replaceWith(i.pos,i.pos+i.node.nodeSize,r),e.setSelection(o.create(e.doc,i.pos));else{const t=n.doc.resolve(i.pos),u=t.parent,s=1===u.childCount&&"paragraph"===u.type.name,l=s?t.before():i.pos,f=s?t.after():i.pos+i.node.nodeSize;e.replaceWith(l,f,r),e.setSelection(o.create(e.doc,l))}}else if(i.isFigure){const n=t.nodes.image.create({src:u,alt:s,title:l,width:c});e.replaceWith(i.pos,i.pos+i.node.nodeSize,t.nodes.paragraph.create(null,n)),e.setSelection(o.create(e.doc,i.pos+1))}else e.setNodeMarkup(i.pos,void 0,{src:u,alt:s,title:l,width:c}),n.selection instanceof o&&e.setSelection(o.create(e.doc,i.pos));r(e.scrollIntoView())}return!0}}(r,n);case"insertTable":return function(t,e){const n=Math.max(1,e.rows??3),r=Math.max(1,e.cols??3),i=e.withHeaderRow??!0;return(e,u)=>{const{table:s,table_row:o,table_cell:l,table_header:f}=t.nodes,c=[];for(let t=0;t<n;t+=1){const e=0===t&&i?f:l,n=[];for(let t=0;t<r;t+=1)n.push(e.createAndFill());c.push(o.create(null,n))}return u&&u(e.tr.replaceSelectionWith(s.create(null,c)).scrollIntoView()),!0}}(r,n);case"addRowBefore":return H;case"addRowAfter":return L;case"addColumnBefore":return A;case"addColumnAfter":return B;case"deleteRow":return x;case"deleteColumn":return j;case"mergeCells":return C;case"splitCell":return k;case"toggleHeaderRow":return y;case"toggleLayoutTable":return(t,e)=>{const{$from:n}=t.selection;for(let r=n.depth;r>0;r-=1){const i=n.node(r);if(i.type===t.schema.nodes.table)return e&&e(t.tr.setNodeMarkup(n.before(r),void 0,{...i.attrs,layout:!i.attrs.layout})),!0}return!1};case"deleteTable":return M;case"changeCase":return l=n.textCase??"upper",(t,e)=>{const{from:n,to:r,empty:i}=t.selection;if(i)return!1;const u=[];if(t.doc.nodesBetween(n,r,((t,e)=>{if(!t.isText||!t.text)return;const i=Math.max(n,e),s=Math.min(r,e+t.nodeSize);if(i>=s)return;const o=t.text.slice(i-e,s-e),f=function(t,e){switch(e){case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();case"title":return t.toLowerCase().replace(/(^|\s)(\p{L})/gu,((t,e,n)=>e+n.toUpperCase()));case"sentence":return t.toLowerCase().replace(/(^|[.!?]\s+)(\p{L})/gu,((t,e,n)=>e+n.toUpperCase()))}}(o,l);f!==o&&u.push({from:i,to:s,text:f,marks:t.marks})})),0===u.length)return!1;if(e){const n=t.tr;for(const e of u.reverse())n.replaceWith(e.from,e.to,t.schema.text(e.text,e.marks));e(n.scrollIntoView())}return!0};case"insertMergeField":return function(t,e){return(n,r)=>{const i=t.nodes.merge_field;if(!i||!e.id)return!1;if(r){const t=i.create({id:e.id,label:e.label??null});r(n.tr.replaceSelectionWith(t).scrollIntoView())}return!0}}(r,n);case"insertMath":return function(t,e){return(n,r)=>{const i=t.nodes.math,u=(e.latex??"").trim();if(!i||!u)return!1;if(r){const t=i.create({latex:u,display:e.mathDisplay??"inline"});r(n.tr.replaceSelectionWith(t).scrollIntoView())}return!0}}(r,n);default:return null}var l,f,c,a,h,d,m,p}export{jt as a,xt as b,J as c,X as d,_ as e,wt as g,dt as h,gt as r,Ct as s,pt as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../index-89c520e9.cjs.js","./commands.cjs.js","../../index-c3210a9c.cjs.js","../../index-3ca67627.cjs.js","./keymap.cjs.js","./inputrules.cjs.js","./plugins/placeholder.cjs.js","./plugins/link.cjs.js","./plugins/single-line.cjs.js","./plugins/tables.cjs.js","./plugins/image.cjs.js","./plugins/suggestions.cjs.js","./plugins/find-replace.cjs.js","./plugins/max-length.cjs.js","./plugins/code-highlight.cjs.js","./plugins/embeds.cjs.js","./plugins/paste.cjs.js","./plugins/format-painter.cjs.js","./schema.cjs.js","../../index-178e1e57.cjs.js","../../index-403841c7.cjs.js","./markdown-parse.cjs.js","./serializer.cjs.js","./sanitize.cjs.js","../../xml-90fd974e.cjs.js"],function(_export,_context){"use strict";var t,e,s,r,i,n,o,l,u,a,h,f,c,p,m,g,d,j,w,v,x,b,k,S,y,O,T,z,C,F,L,D,N,R,B;function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function A(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor;}function E(t,e){var s="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,i,n){var o=t.selection,l=e>0?o.$to:o.$from,u=o.empty;if(o instanceof r){if(!n.endOfTextblock(s)||0==l.depth)return!1;u=!1,l=t.doc.resolve(e>0?l.after():l.before());}var a=F.findGapCursorFrom(l,e,u);return!!a&&(i&&i(t.tr.setSelection(new F(a))),!0);};}function M(t,e,s){if(!t||!t.editable)return!1;var r=t.state.doc.resolve(e);if(!F.valid(r))return!1;var n=t.posAtCoords({left:s.clientX,top:s.clientY});return!(n&&n.inside>-1&&i.isSelectable(t.state.doc.nodeAt(n.inside)))&&(t.dispatch(t.state.tr.setSelection(new F(r))),!0);}function P(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof F))return!1;var s=t.state.selection.$from,i=s.parent.contentMatchAt(s.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;var l=n.empty;for(var _t6=i.length-1;_t6>=0;_t6--)l=n.from(i[_t6].createAndFill(null,l));var u=t.state.tr.replace(s.pos,s.pos,new o(l,0,0));return u.setSelection(r.near(u.doc.resolve(s.pos+1))),t.dispatch(u),!1;}function J(t){if(!(t.selection instanceof F))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",f.create(t.doc,[c.widget(t.selection.head,e,{key:"gapcursor"})]);}function G(){var _e$schema,_e$getPlaceholder;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var s=(_e$schema=e.schema)!==null&&_e$schema!==void 0?_e$schema:z,r=[];return e.mentions&&r.push(x(N,e.mentions)),e.slashCommands&&r.push(x(R,_objectSpread(_objectSpread({},e.slashCommands),{},{getTriggers:function getTriggers(){return["/"];},startOfLine:!0}))),e.emoji&&r.push(x(B,_objectSpread(_objectSpread({},e.emoji),{},{getTriggers:function getTriggers(){return[":"];},minQueryLength:2}))),r.push.apply(r,[m(s,{textTransform:e.textTransform})].concat(_toConsumableArray(p(s,{onLinkShortcut:e.onLinkShortcut,onFindShortcut:e.onFindShortcut,onShortcutHelp:e.onShortcutHelp})),[a(),function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new t({view:function view(t){return new C(t,e);}});}(),new t({props:{decorations:J,createSelectionBetween:function createSelectionBetween(t,e,s){return e.pos==s.pos&&F.valid(s)?new F(s):null;},handleClick:M,handleKeyDown:D,handleDOMEvents:{beforeinput:P}}}),g((_e$getPlaceholder=e.getPlaceholder)!==null&&_e$getPlaceholder!==void 0?_e$getPlaceholder:function(){return"";}),d({onOpenLink:e.onOpenLink})],_toConsumableArray(w()),[v({onImageFiles:e.onImageFiles}),b(),S(),y(),T(),O(s,{getForcePlainText:e.getForcePlainText,getMarkdownPaste:e.getMarkdownPaste,getSanitize:e.getSanitize})])),e.getMaxLength&&r.push(k(e.getMaxLength)),e.singleLine&&r.push(j()),e.plugins&&r.push.apply(r,_toConsumableArray(e.plugins)),u.create({schema:s,doc:e.doc,plugins:r});}_export("c",G);return{setters:[function(_index00bCjsJs){t=_index00bCjsJs.b;e=_index00bCjsJs.e;s=_index00bCjsJs.S;r=_index00bCjsJs.T;i=_index00bCjsJs.c;n=_index00bCjsJs.F;o=_index00bCjsJs.d;l=_index00bCjsJs.P;u=_index00bCjsJs.E;},function(_commandsCjsJs){a=_commandsCjsJs.h;},function(_index001CjsJs){h=_index001CjsJs.b;},function(_index00aCjsJs){f=_index00aCjsJs.D;c=_index00aCjsJs.a;},function(_keymapCjsJs){p=_keymapCjsJs.b;},function(_inputrulesCjsJs){m=_inputrulesCjsJs.b;},function(_pluginsPlaceholderCjsJs){g=_pluginsPlaceholderCjsJs.p;},function(_pluginsLinkCjsJs){d=_pluginsLinkCjsJs.l;},function(_pluginsSingleLineCjsJs){j=_pluginsSingleLineCjsJs.s;},function(_pluginsTablesCjsJs){w=_pluginsTablesCjsJs.t;},function(_pluginsImageCjsJs){v=_pluginsImageCjsJs.i;},function(_pluginsSuggestionsCjsJs){x=_pluginsSuggestionsCjsJs.s;},function(_pluginsFindReplaceCjsJs){b=_pluginsFindReplaceCjsJs.f;},function(_pluginsMaxLengthCjsJs){k=_pluginsMaxLengthCjsJs.m;},function(_pluginsCodeHighlightCjsJs){S=_pluginsCodeHighlightCjsJs.c;},function(_pluginsEmbedsCjsJs){y=_pluginsEmbedsCjsJs.e;},function(_pluginsPasteCjsJs){O=_pluginsPasteCjsJs.a;},function(_pluginsFormatPainterCjsJs){T=_pluginsFormatPainterCjsJs.f;},function(_schemaCjsJs){z=_schemaCjsJs.d;},function(_index008CjsJs){},function(_index00dCjsJs){},function(_markdownParseCjsJs){},function(_serializerCjsJs){},function(_sanitizeCjsJs){},function(_xml00cCjsJs){}],execute:function execute(){C=/*#__PURE__*/function(){function C(t,e){var _this=this;_classCallCheck(this,C);var s;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(s=e.width)&&void 0!==s?s:1,this.color=!1===e.color?void 0:e.color||"black",this["class"]=e["class"],this.handlers=["dragover","dragend","drop","dragleave"].map(function(e){var s=function s(t){_this[e](t);};return t.dom.addEventListener(e,s),{name:e,handler:s};});}return _createClass(C,[{key:"destroy",value:function destroy(){var _this2=this;this.handlers.forEach(function(_ref){var t=_ref.name,e=_ref.handler;return _this2.editorView.dom.removeEventListener(t,e);});}},{key:"update",value:function update(t,e){if(null!=this.cursorPos&&e.doc!=t.state.doc)if(this.lastDragEvent){var _t=this.computeTarget(this.lastDragEvent);_t==this.cursorPos?this.updateOverlay():this.setCursor(_t);}else this.updateOverlay();}},{key:"setCursor",value:function setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay());}},{key:"updateOverlay",value:function updateOverlay(){var t,e=this.editorView.state.doc.resolve(this.cursorPos),s=!e.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),n=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(s){var _s=e.nodeBefore,_r=e.nodeAfter;if(_s||_r){var _e=this.editorView.nodeDOM(this.cursorPos-(_s?_s.nodeSize:0));if(_e){var _i=_e.getBoundingClientRect(),_n=_s?_i.bottom:_i.top;_s&&_r&&(_n=(_n+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);var _l=this.width/2*o;t={left:_i.left,right:_i.right,top:_n-_l,bottom:_n+_l};}}}if(!t){var _e2=this.editorView.coordsAtPos(this.cursorPos),_s2=this.width/2*n;t={left:_e2.left-_s2,right:_e2.left+_s2,top:_e2.top,bottom:_e2.bottom};}var l,u,a=this.editorView.dom.offsetParent;if(this.element||(this.element=a.appendChild(document.createElement("div")),this["class"]&&(this.element.className=this["class"]),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",s),this.element.classList.toggle("prosemirror-dropcursor-inline",!s),!a||a==document.body&&"static"==getComputedStyle(a).position)l=-pageXOffset,u=-pageYOffset;else{var _t2=a.getBoundingClientRect(),_e3=_t2.width/a.offsetWidth,_s3=_t2.height/a.offsetHeight;l=_t2.left-a.scrollLeft*_e3,u=_t2.top-a.scrollTop*_s3;}this.element.style.left=(t.left-l)/n+"px",this.element.style.top=(t.top-u)/o+"px",this.element.style.width=(t.right-t.left)/n+"px",this.element.style.height=(t.bottom-t.top)/o+"px";}},{key:"scheduleRemoval",value:function scheduleRemoval(t){var _this3=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return _this3.setCursor(null);},t);}},{key:"computeTarget",value:function computeTarget(t){var s=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=s&&s.inside>=0&&this.editorView.state.doc.nodeAt(s.inside),i=r&&r.type.spec.disableDropCursor,n="function"==typeof i?i(this.editorView,s,t):i;if(!s||n)return null;var o=s.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var _t3=e(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=_t3&&(o=_t3);}return o;}},{key:"dragover",value:function dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;var e=this.computeTarget(t);null!=e&&(this.setCursor(e),this.scheduleRemoval(5e3));}},{key:"dragend",value:function dragend(){this.scheduleRemoval(20);}},{key:"drop",value:function drop(){this.scheduleRemoval(20);}},{key:"dragleave",value:function dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null);}}]);}();F=/*#__PURE__*/function(_s4){function F(t){_classCallCheck(this,F);return _callSuper(this,F,[t,t]);}_inherits(F,_s4);return _createClass(F,[{key:"map",value:function map(t,e){var r=t.resolve(e.map(this.head));return F.valid(r)?new F(r):s.near(r);}},{key:"content",value:function content(){return o.empty;}},{key:"eq",value:function eq(t){return t instanceof F&&t.head==this.head;}},{key:"toJSON",value:function toJSON(){return{type:"gapcursor",pos:this.head};}},{key:"getBookmark",value:function getBookmark(){return new L(this.anchor);}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new F(t.resolve(e.pos));}},{key:"valid",value:function valid(t){var e=t.parent;if(e.inlineContent||!function(t){for(var _e4=t.depth;_e4>=0;_e4--){var _s5=t.index(_e4),_r2=t.node(_e4);if(0!=_s5)for(var _t4=_r2.child(_s5-1);;_t4=_t4.lastChild){if(0==_t4.childCount&&!_t4.inlineContent||A(_t4.type))return!0;if(_t4.inlineContent)return!1;}else if(_r2.type.spec.isolating)return!0;}return!0;}(t)||!function(t){for(var _e5=t.depth;_e5>=0;_e5--){var _s6=t.indexAfter(_e5),_r3=t.node(_e5);if(_s6!=_r3.childCount)for(var _t5=_r3.child(_s6);;_t5=_t5.firstChild){if(0==_t5.childCount&&!_t5.inlineContent||A(_t5.type))return!0;if(_t5.inlineContent)return!1;}else if(_r3.type.spec.isolating)return!0;}return!0;}(t))return!1;var s=e.type.spec.allowGapCursor;if(null!=s)return s;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock;}},{key:"findGapCursorFrom",value:function findGapCursorFrom(t,e){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;t:for(;;){if(!s&&F.valid(t))return t;var _r4=t.pos,_n2=null;for(var _s7=t.depth;;_s7--){var _i2=t.node(_s7);if(e>0?t.indexAfter(_s7)<_i2.childCount:t.index(_s7)>0){_n2=_i2.child(e>0?t.indexAfter(_s7):t.index(_s7)-1);break;}if(0==_s7)return null;_r4+=e;var _o=t.doc.resolve(_r4);if(F.valid(_o))return _o;}for(;;){var _o2=e>0?_n2.firstChild:_n2.lastChild;if(!_o2){if(_n2.isAtom&&!_n2.isText&&!i.isSelectable(_n2)){t=t.doc.resolve(_r4+_n2.nodeSize*e),s=!1;continue t;}break;}_n2=_o2,_r4+=e;var _l2=t.doc.resolve(_r4);if(F.valid(_l2))return _l2;}return null;}}}]);}(s);F.prototype.visible=!1,F.findFrom=F.findGapCursorFrom,s.jsonID("gapcursor",F);L=/*#__PURE__*/function(){function L(t){_classCallCheck(this,L);this.pos=t;}return _createClass(L,[{key:"map",value:function map(t){return new L(t.map(this.pos));}},{key:"resolve",value:function resolve(t){var e=t.resolve(this.pos);return F.valid(e)?new F(e):s.near(e);}}]);}();D=h({ArrowLeft:E("horiz",-1),ArrowRight:E("horiz",1),ArrowUp:E("vert",-1),ArrowDown:E("vert",1)});N=new l("nileMentionSuggest"),R=new l("nileSlashSuggest"),B=new l("nileEmojiSuggest");}};});
|
|
1
|
+
System.register(["../../index-89c520e9.cjs.js","./commands.cjs.js","../../index-c3210a9c.cjs.js","../../index-3ca67627.cjs.js","./keymap.cjs.js","./inputrules.cjs.js","./plugins/placeholder.cjs.js","./plugins/link.cjs.js","./plugins/single-line.cjs.js","./plugins/tables.cjs.js","./plugins/image.cjs.js","./plugins/suggestions.cjs.js","./plugins/find-replace.cjs.js","./plugins/max-length.cjs.js","./plugins/code-highlight.cjs.js","./plugins/embeds.cjs.js","./plugins/paste.cjs.js","./plugins/format-painter.cjs.js","./schema.cjs.js","../../index-178e1e57.cjs.js","../../index-403841c7.cjs.js","./markdown-parse.cjs.js","./serializer.cjs.js","./sanitize.cjs.js","../../xml-09119317.cjs.js"],function(_export,_context){"use strict";var t,e,s,r,i,n,o,l,u,a,h,f,c,p,m,g,d,j,w,v,x,b,k,S,y,O,T,z,C,F,L,D,N,R,B;function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function A(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor;}function E(t,e){var s="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,i,n){var o=t.selection,l=e>0?o.$to:o.$from,u=o.empty;if(o instanceof r){if(!n.endOfTextblock(s)||0==l.depth)return!1;u=!1,l=t.doc.resolve(e>0?l.after():l.before());}var a=F.findGapCursorFrom(l,e,u);return!!a&&(i&&i(t.tr.setSelection(new F(a))),!0);};}function M(t,e,s){if(!t||!t.editable)return!1;var r=t.state.doc.resolve(e);if(!F.valid(r))return!1;var n=t.posAtCoords({left:s.clientX,top:s.clientY});return!(n&&n.inside>-1&&i.isSelectable(t.state.doc.nodeAt(n.inside)))&&(t.dispatch(t.state.tr.setSelection(new F(r))),!0);}function P(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof F))return!1;var s=t.state.selection.$from,i=s.parent.contentMatchAt(s.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;var l=n.empty;for(var _t6=i.length-1;_t6>=0;_t6--)l=n.from(i[_t6].createAndFill(null,l));var u=t.state.tr.replace(s.pos,s.pos,new o(l,0,0));return u.setSelection(r.near(u.doc.resolve(s.pos+1))),t.dispatch(u),!1;}function J(t){if(!(t.selection instanceof F))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",f.create(t.doc,[c.widget(t.selection.head,e,{key:"gapcursor"})]);}function G(){var _e$schema,_e$getPlaceholder;var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var s=(_e$schema=e.schema)!==null&&_e$schema!==void 0?_e$schema:z,r=[];return e.mentions&&r.push(x(N,e.mentions)),e.slashCommands&&r.push(x(R,_objectSpread(_objectSpread({},e.slashCommands),{},{getTriggers:function getTriggers(){return["/"];},startOfLine:!0}))),e.emoji&&r.push(x(B,_objectSpread(_objectSpread({},e.emoji),{},{getTriggers:function getTriggers(){return[":"];},minQueryLength:2}))),r.push.apply(r,[m(s,{textTransform:e.textTransform})].concat(_toConsumableArray(p(s,{onLinkShortcut:e.onLinkShortcut,onFindShortcut:e.onFindShortcut,onShortcutHelp:e.onShortcutHelp})),[a(),function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new t({view:function view(t){return new C(t,e);}});}(),new t({props:{decorations:J,createSelectionBetween:function createSelectionBetween(t,e,s){return e.pos==s.pos&&F.valid(s)?new F(s):null;},handleClick:M,handleKeyDown:D,handleDOMEvents:{beforeinput:P}}}),g((_e$getPlaceholder=e.getPlaceholder)!==null&&_e$getPlaceholder!==void 0?_e$getPlaceholder:function(){return"";}),d({onOpenLink:e.onOpenLink})],_toConsumableArray(w()),[v({onImageFiles:e.onImageFiles}),b(),S(),y(),T(),O(s,{getForcePlainText:e.getForcePlainText,getMarkdownPaste:e.getMarkdownPaste,getSanitize:e.getSanitize})])),e.getMaxLength&&r.push(k(e.getMaxLength)),e.singleLine&&r.push(j()),e.plugins&&r.push.apply(r,_toConsumableArray(e.plugins)),u.create({schema:s,doc:e.doc,plugins:r});}_export("c",G);return{setters:[function(_index00bCjsJs){t=_index00bCjsJs.b;e=_index00bCjsJs.e;s=_index00bCjsJs.S;r=_index00bCjsJs.T;i=_index00bCjsJs.c;n=_index00bCjsJs.F;o=_index00bCjsJs.d;l=_index00bCjsJs.P;u=_index00bCjsJs.E;},function(_commandsCjsJs){a=_commandsCjsJs.h;},function(_index001CjsJs){h=_index001CjsJs.b;},function(_index00aCjsJs){f=_index00aCjsJs.D;c=_index00aCjsJs.a;},function(_keymapCjsJs){p=_keymapCjsJs.b;},function(_inputrulesCjsJs){m=_inputrulesCjsJs.b;},function(_pluginsPlaceholderCjsJs){g=_pluginsPlaceholderCjsJs.p;},function(_pluginsLinkCjsJs){d=_pluginsLinkCjsJs.l;},function(_pluginsSingleLineCjsJs){j=_pluginsSingleLineCjsJs.s;},function(_pluginsTablesCjsJs){w=_pluginsTablesCjsJs.t;},function(_pluginsImageCjsJs){v=_pluginsImageCjsJs.i;},function(_pluginsSuggestionsCjsJs){x=_pluginsSuggestionsCjsJs.s;},function(_pluginsFindReplaceCjsJs){b=_pluginsFindReplaceCjsJs.f;},function(_pluginsMaxLengthCjsJs){k=_pluginsMaxLengthCjsJs.m;},function(_pluginsCodeHighlightCjsJs){S=_pluginsCodeHighlightCjsJs.c;},function(_pluginsEmbedsCjsJs){y=_pluginsEmbedsCjsJs.e;},function(_pluginsPasteCjsJs){O=_pluginsPasteCjsJs.a;},function(_pluginsFormatPainterCjsJs){T=_pluginsFormatPainterCjsJs.f;},function(_schemaCjsJs){z=_schemaCjsJs.d;},function(_index008CjsJs){},function(_index00dCjsJs){},function(_markdownParseCjsJs){},function(_serializerCjsJs){},function(_sanitizeCjsJs){},function(_xml00cCjsJs){}],execute:function execute(){C=/*#__PURE__*/function(){function C(t,e){var _this=this;_classCallCheck(this,C);var s;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(s=e.width)&&void 0!==s?s:1,this.color=!1===e.color?void 0:e.color||"black",this["class"]=e["class"],this.handlers=["dragover","dragend","drop","dragleave"].map(function(e){var s=function s(t){_this[e](t);};return t.dom.addEventListener(e,s),{name:e,handler:s};});}return _createClass(C,[{key:"destroy",value:function destroy(){var _this2=this;this.handlers.forEach(function(_ref){var t=_ref.name,e=_ref.handler;return _this2.editorView.dom.removeEventListener(t,e);});}},{key:"update",value:function update(t,e){if(null!=this.cursorPos&&e.doc!=t.state.doc)if(this.lastDragEvent){var _t=this.computeTarget(this.lastDragEvent);_t==this.cursorPos?this.updateOverlay():this.setCursor(_t);}else this.updateOverlay();}},{key:"setCursor",value:function setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay());}},{key:"updateOverlay",value:function updateOverlay(){var t,e=this.editorView.state.doc.resolve(this.cursorPos),s=!e.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),n=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(s){var _s=e.nodeBefore,_r=e.nodeAfter;if(_s||_r){var _e=this.editorView.nodeDOM(this.cursorPos-(_s?_s.nodeSize:0));if(_e){var _i=_e.getBoundingClientRect(),_n=_s?_i.bottom:_i.top;_s&&_r&&(_n=(_n+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);var _l=this.width/2*o;t={left:_i.left,right:_i.right,top:_n-_l,bottom:_n+_l};}}}if(!t){var _e2=this.editorView.coordsAtPos(this.cursorPos),_s2=this.width/2*n;t={left:_e2.left-_s2,right:_e2.left+_s2,top:_e2.top,bottom:_e2.bottom};}var l,u,a=this.editorView.dom.offsetParent;if(this.element||(this.element=a.appendChild(document.createElement("div")),this["class"]&&(this.element.className=this["class"]),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",s),this.element.classList.toggle("prosemirror-dropcursor-inline",!s),!a||a==document.body&&"static"==getComputedStyle(a).position)l=-pageXOffset,u=-pageYOffset;else{var _t2=a.getBoundingClientRect(),_e3=_t2.width/a.offsetWidth,_s3=_t2.height/a.offsetHeight;l=_t2.left-a.scrollLeft*_e3,u=_t2.top-a.scrollTop*_s3;}this.element.style.left=(t.left-l)/n+"px",this.element.style.top=(t.top-u)/o+"px",this.element.style.width=(t.right-t.left)/n+"px",this.element.style.height=(t.bottom-t.top)/o+"px";}},{key:"scheduleRemoval",value:function scheduleRemoval(t){var _this3=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){return _this3.setCursor(null);},t);}},{key:"computeTarget",value:function computeTarget(t){var s=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=s&&s.inside>=0&&this.editorView.state.doc.nodeAt(s.inside),i=r&&r.type.spec.disableDropCursor,n="function"==typeof i?i(this.editorView,s,t):i;if(!s||n)return null;var o=s.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var _t3=e(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=_t3&&(o=_t3);}return o;}},{key:"dragover",value:function dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;var e=this.computeTarget(t);null!=e&&(this.setCursor(e),this.scheduleRemoval(5e3));}},{key:"dragend",value:function dragend(){this.scheduleRemoval(20);}},{key:"drop",value:function drop(){this.scheduleRemoval(20);}},{key:"dragleave",value:function dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null);}}]);}();F=/*#__PURE__*/function(_s4){function F(t){_classCallCheck(this,F);return _callSuper(this,F,[t,t]);}_inherits(F,_s4);return _createClass(F,[{key:"map",value:function map(t,e){var r=t.resolve(e.map(this.head));return F.valid(r)?new F(r):s.near(r);}},{key:"content",value:function content(){return o.empty;}},{key:"eq",value:function eq(t){return t instanceof F&&t.head==this.head;}},{key:"toJSON",value:function toJSON(){return{type:"gapcursor",pos:this.head};}},{key:"getBookmark",value:function getBookmark(){return new L(this.anchor);}}],[{key:"fromJSON",value:function fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new F(t.resolve(e.pos));}},{key:"valid",value:function valid(t){var e=t.parent;if(e.inlineContent||!function(t){for(var _e4=t.depth;_e4>=0;_e4--){var _s5=t.index(_e4),_r2=t.node(_e4);if(0!=_s5)for(var _t4=_r2.child(_s5-1);;_t4=_t4.lastChild){if(0==_t4.childCount&&!_t4.inlineContent||A(_t4.type))return!0;if(_t4.inlineContent)return!1;}else if(_r2.type.spec.isolating)return!0;}return!0;}(t)||!function(t){for(var _e5=t.depth;_e5>=0;_e5--){var _s6=t.indexAfter(_e5),_r3=t.node(_e5);if(_s6!=_r3.childCount)for(var _t5=_r3.child(_s6);;_t5=_t5.firstChild){if(0==_t5.childCount&&!_t5.inlineContent||A(_t5.type))return!0;if(_t5.inlineContent)return!1;}else if(_r3.type.spec.isolating)return!0;}return!0;}(t))return!1;var s=e.type.spec.allowGapCursor;if(null!=s)return s;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock;}},{key:"findGapCursorFrom",value:function findGapCursorFrom(t,e){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;t:for(;;){if(!s&&F.valid(t))return t;var _r4=t.pos,_n2=null;for(var _s7=t.depth;;_s7--){var _i2=t.node(_s7);if(e>0?t.indexAfter(_s7)<_i2.childCount:t.index(_s7)>0){_n2=_i2.child(e>0?t.indexAfter(_s7):t.index(_s7)-1);break;}if(0==_s7)return null;_r4+=e;var _o=t.doc.resolve(_r4);if(F.valid(_o))return _o;}for(;;){var _o2=e>0?_n2.firstChild:_n2.lastChild;if(!_o2){if(_n2.isAtom&&!_n2.isText&&!i.isSelectable(_n2)){t=t.doc.resolve(_r4+_n2.nodeSize*e),s=!1;continue t;}break;}_n2=_o2,_r4+=e;var _l2=t.doc.resolve(_r4);if(F.valid(_l2))return _l2;}return null;}}}]);}(s);F.prototype.visible=!1,F.findFrom=F.findGapCursorFrom,s.jsonID("gapcursor",F);L=/*#__PURE__*/function(){function L(t){_classCallCheck(this,L);this.pos=t;}return _createClass(L,[{key:"map",value:function map(t){return new L(t.map(this.pos));}},{key:"resolve",value:function resolve(t){var e=t.resolve(this.pos);return F.valid(e)?new F(e):s.near(e);}}]);}();D=h({ArrowLeft:E("horiz",-1),ArrowRight:E("horiz",1),ArrowUp:E("vert",-1),ArrowDown:E("vert",1)});N=new l("nileMentionSuggest"),R=new l("nileSlashSuggest"),B=new l("nileEmojiSuggest");}};});
|
|
2
2
|
//# sourceMappingURL=create-state.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t,e,S as s,T as r,c as i,F as n,d as o,P as l,E as u}from"../../index-6f3fa4ab.esm.js";import{h as a}from"./commands.esm.js";import{b as m}from"../../index-7b1c9857.esm.js";import{D as h,a as f}from"../../index-ba47645d.esm.js";import{b as p}from"./keymap.esm.js";import{b as c}from"./inputrules.esm.js";import{p as g}from"./plugins/placeholder.esm.js";import{l as d}from"./plugins/link.esm.js";import{s as w}from"./plugins/single-line.esm.js";import{t as j}from"./plugins/tables.esm.js";import{i as v}from"./plugins/image.esm.js";import{s as x}from"./plugins/suggestions.esm.js";import{f as b}from"./plugins/find-replace.esm.js";import{m as k}from"./plugins/max-length.esm.js";import{c as S}from"./plugins/code-highlight.esm.js";import{e as y}from"./plugins/embeds.esm.js";import{a as O}from"./plugins/paste.esm.js";import{f as T}from"./plugins/format-painter.esm.js";import{d as z}from"./schema.esm.js";import"../../index-920675c4.esm.js";import"../../index-1faa963c.esm.js";import"./markdown-parse.esm.js";import"./serializer.esm.js";import"./sanitize.esm.js";import"../../xml-
|
|
1
|
+
import{b as t,e,S as s,T as r,c as i,F as n,d as o,P as l,E as u}from"../../index-6f3fa4ab.esm.js";import{h as a}from"./commands.esm.js";import{b as m}from"../../index-7b1c9857.esm.js";import{D as h,a as f}from"../../index-ba47645d.esm.js";import{b as p}from"./keymap.esm.js";import{b as c}from"./inputrules.esm.js";import{p as g}from"./plugins/placeholder.esm.js";import{l as d}from"./plugins/link.esm.js";import{s as w}from"./plugins/single-line.esm.js";import{t as j}from"./plugins/tables.esm.js";import{i as v}from"./plugins/image.esm.js";import{s as x}from"./plugins/suggestions.esm.js";import{f as b}from"./plugins/find-replace.esm.js";import{m as k}from"./plugins/max-length.esm.js";import{c as S}from"./plugins/code-highlight.esm.js";import{e as y}from"./plugins/embeds.esm.js";import{a as O}from"./plugins/paste.esm.js";import{f as T}from"./plugins/format-painter.esm.js";import{d as z}from"./schema.esm.js";import"../../index-920675c4.esm.js";import"../../index-1faa963c.esm.js";import"./markdown-parse.esm.js";import"./serializer.esm.js";import"./sanitize.esm.js";import"../../xml-9bf771b3.esm.js";class C{constructor(t,e){var s;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=null!==(s=e.width)&&void 0!==s?s:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let s=t=>{this[e](t)};return t.dom.addEventListener(e,s),{name:e,handler:s}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){if(null!=this.cursorPos&&e.doc!=t.state.doc)if(this.lastDragEvent){let t=this.computeTarget(this.lastDragEvent);t==this.cursorPos?this.updateOverlay():this.setCursor(t)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),s=!e.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),n=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(s){let s=e.nodeBefore,r=e.nodeAfter;if(s||r){let e=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(e){let i=e.getBoundingClientRect(),n=s?i.bottom:i.top;s&&r&&(n=(n+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let l=this.width/2*o;t={left:i.left,right:i.right,top:n-l,bottom:n+l}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos),s=this.width/2*n;t={left:e.left-s,right:e.left+s,top:e.top,bottom:e.bottom}}let l,u,a=this.editorView.dom.offsetParent;if(this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",s),this.element.classList.toggle("prosemirror-dropcursor-inline",!s),!a||a==document.body&&"static"==getComputedStyle(a).position)l=-pageXOffset,u=-pageYOffset;else{let t=a.getBoundingClientRect(),e=t.width/a.offsetWidth,s=t.height/a.offsetHeight;l=t.left-a.scrollLeft*e,u=t.top-a.scrollTop*s}this.element.style.left=(t.left-l)/n+"px",this.element.style.top=(t.top-u)/o+"px",this.element.style.width=(t.right-t.left)/n+"px",this.element.style.height=(t.bottom-t.top)/o+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}computeTarget(t){let s=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=s&&s.inside>=0&&this.editorView.state.doc.nodeAt(s.inside),i=r&&r.type.spec.disableDropCursor,n="function"==typeof i?i(this.editorView,s,t):i;if(!s||n)return null;let o=s.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=e(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=t&&(o=t)}return o}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let e=this.computeTarget(t);null!=e&&(this.setCursor(e),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class F extends s{constructor(t){super(t,t)}map(t,e){let r=t.resolve(e.map(this.head));return F.valid(r)?new F(r):s.near(r)}content(){return o.empty}eq(t){return t instanceof F&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new F(t.resolve(e.pos))}getBookmark(){return new L(this.anchor)}static valid(t){let e=t.parent;if(e.inlineContent||!function(t){for(let e=t.depth;e>=0;e--){let s=t.index(e),r=t.node(e);if(0!=s)for(let t=r.child(s-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||A(t.type))return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let s=t.indexAfter(e),r=t.node(e);if(s!=r.childCount)for(let t=r.child(s);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||A(t.type))return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;let s=e.type.spec.allowGapCursor;if(null!=s)return s;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,s=!1){t:for(;;){if(!s&&F.valid(t))return t;let r=t.pos,n=null;for(let s=t.depth;;s--){let i=t.node(s);if(e>0?t.indexAfter(s)<i.childCount:t.index(s)>0){n=i.child(e>0?t.indexAfter(s):t.index(s)-1);break}if(0==s)return null;r+=e;let o=t.doc.resolve(r);if(F.valid(o))return o}for(;;){let o=e>0?n.firstChild:n.lastChild;if(!o){if(n.isAtom&&!n.isText&&!i.isSelectable(n)){t=t.doc.resolve(r+n.nodeSize*e),s=!1;continue t}break}n=o,r+=e;let l=t.doc.resolve(r);if(F.valid(l))return l}return null}}}F.prototype.visible=!1,F.findFrom=F.findGapCursorFrom,s.jsonID("gapcursor",F);class L{constructor(t){this.pos=t}map(t){return new L(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return F.valid(e)?new F(e):s.near(e)}}function A(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const D=m({ArrowLeft:E("horiz",-1),ArrowRight:E("horiz",1),ArrowUp:E("vert",-1),ArrowDown:E("vert",1)});function E(t,e){const s="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,i,n){let o=t.selection,l=e>0?o.$to:o.$from,u=o.empty;if(o instanceof r){if(!n.endOfTextblock(s)||0==l.depth)return!1;u=!1,l=t.doc.resolve(e>0?l.after():l.before())}let a=F.findGapCursorFrom(l,e,u);return!!a&&(i&&i(t.tr.setSelection(new F(a))),!0)}}function M(t,e,s){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!F.valid(r))return!1;let n=t.posAtCoords({left:s.clientX,top:s.clientY});return!(n&&n.inside>-1&&i.isSelectable(t.state.doc.nodeAt(n.inside)))&&(t.dispatch(t.state.tr.setSelection(new F(r))),!0)}function P(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof F))return!1;let{$from:s}=t.state.selection,i=s.parent.contentMatchAt(s.index()).findWrapping(t.state.schema.nodes.text);if(!i)return!1;let l=n.empty;for(let t=i.length-1;t>=0;t--)l=n.from(i[t].createAndFill(null,l));let u=t.state.tr.replace(s.pos,s.pos,new o(l,0,0));return u.setSelection(r.near(u.doc.resolve(s.pos+1))),t.dispatch(u),!1}function J(t){if(!(t.selection instanceof F))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",h.create(t.doc,[f.widget(t.selection.head,e,{key:"gapcursor"})])}const N=new l("nileMentionSuggest"),R=new l("nileSlashSuggest"),B=new l("nileEmojiSuggest");function G(e={}){const s=e.schema??z,r=[];return e.mentions&&r.push(x(N,e.mentions)),e.slashCommands&&r.push(x(R,{...e.slashCommands,getTriggers:()=>["/"],startOfLine:!0})),e.emoji&&r.push(x(B,{...e.emoji,getTriggers:()=>[":"],minQueryLength:2})),r.push(c(s,{textTransform:e.textTransform}),...p(s,{onLinkShortcut:e.onLinkShortcut,onFindShortcut:e.onFindShortcut,onShortcutHelp:e.onShortcutHelp}),a(),function(e={}){return new t({view:t=>new C(t,e)})}(),new t({props:{decorations:J,createSelectionBetween:(t,e,s)=>e.pos==s.pos&&F.valid(s)?new F(s):null,handleClick:M,handleKeyDown:D,handleDOMEvents:{beforeinput:P}}}),g(e.getPlaceholder??(()=>"")),d({onOpenLink:e.onOpenLink}),...j(),v({onImageFiles:e.onImageFiles}),b(),S(),y(),T(),O(s,{getForcePlainText:e.getForcePlainText,getMarkdownPaste:e.getMarkdownPaste,getSanitize:e.getSanitize})),e.getMaxLength&&r.push(k(e.getMaxLength)),e.singleLine&&r.push(w()),e.plugins&&r.push(...e.plugins),u.create({schema:s,doc:e.doc,plugins:r})}export{G as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./schema.cjs.js","./sanitize.cjs.js","./serializer.cjs.js","./commands.cjs.js","./markdown.cjs.js","./markdown-parse.cjs.js","./office-paste.cjs.js","./export.cjs.js","./plugins/image-view.cjs.js","./plugins/embed-view.cjs.js","./plugins/style-block-view.cjs.js","./plugins/math-view.cjs.js","./selection-state.cjs.js","./create-state.cjs.js","./plugins/max-length.cjs.js","./plugins/task-list.cjs.js","./plugins/code-highlight.cjs.js","./plugins/embeds.cjs.js","./plugins/find-replace.cjs.js","./plugins/placeholder.cjs.js","./plugins/format-painter.cjs.js","./plugins/link.cjs.js","./plugins/single-line.cjs.js","./plugins/tables.cjs.js","./plugins/image.cjs.js","./plugins/paste.cjs.js","../../index-89c520e9.cjs.js","../../index-c3210a9c.cjs.js","../../index-3ca67627.cjs.js","../../index-178e1e57.cjs.js","./keymap.cjs.js","../../index-403841c7.cjs.js","./inputrules.cjs.js","./plugins/suggestions.cjs.js","../../xml-
|
|
1
|
+
System.register(["./schema.cjs.js","./sanitize.cjs.js","./serializer.cjs.js","./commands.cjs.js","./markdown.cjs.js","./markdown-parse.cjs.js","./office-paste.cjs.js","./export.cjs.js","./plugins/image-view.cjs.js","./plugins/embed-view.cjs.js","./plugins/style-block-view.cjs.js","./plugins/math-view.cjs.js","./selection-state.cjs.js","./create-state.cjs.js","./plugins/max-length.cjs.js","./plugins/task-list.cjs.js","./plugins/code-highlight.cjs.js","./plugins/embeds.cjs.js","./plugins/find-replace.cjs.js","./plugins/placeholder.cjs.js","./plugins/format-painter.cjs.js","./plugins/link.cjs.js","./plugins/single-line.cjs.js","./plugins/tables.cjs.js","./plugins/image.cjs.js","./plugins/paste.cjs.js","../../index-89c520e9.cjs.js","../../index-c3210a9c.cjs.js","../../index-3ca67627.cjs.js","../../index-178e1e57.cjs.js","./keymap.cjs.js","../../index-403841c7.cjs.js","./inputrules.cjs.js","./plugins/suggestions.cjs.js","../../xml-09119317.cjs.js"],function(_export,_context){"use strict";return{setters:[function(_schemaCjsJs){},function(_sanitizeCjsJs){},function(_serializerCjsJs){},function(_commandsCjsJs){},function(_markdownCjsJs){},function(_markdownParseCjsJs){},function(_officePasteCjsJs){},function(_exportCjsJs){},function(_pluginsImageViewCjsJs){},function(_pluginsEmbedViewCjsJs){},function(_pluginsStyleBlockViewCjsJs){},function(_pluginsMathViewCjsJs){},function(_selectionStateCjsJs){},function(_createStateCjsJs){},function(_pluginsMaxLengthCjsJs){},function(_pluginsTaskListCjsJs){},function(_pluginsCodeHighlightCjsJs){},function(_pluginsEmbedsCjsJs){},function(_pluginsFindReplaceCjsJs){},function(_pluginsPlaceholderCjsJs){},function(_pluginsFormatPainterCjsJs){},function(_pluginsLinkCjsJs){},function(_pluginsSingleLineCjsJs){},function(_pluginsTablesCjsJs){},function(_pluginsImageCjsJs){},function(_pluginsPasteCjsJs){},function(_index00bCjsJs){},function(_index001CjsJs){},function(_index00aCjsJs){},function(_index008CjsJs){},function(_keymapCjsJs){},function(_index00dCjsJs){},function(_inputrulesCjsJs){},function(_pluginsSuggestionsCjsJs){},function(_xml00cCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./schema.esm.js";import"./sanitize.esm.js";import"./serializer.esm.js";import"./commands.esm.js";import"./markdown.esm.js";import"./markdown-parse.esm.js";import"./office-paste.esm.js";import"./export.esm.js";import"./plugins/image-view.esm.js";import"./plugins/embed-view.esm.js";import"./plugins/style-block-view.esm.js";import"./plugins/math-view.esm.js";import"./selection-state.esm.js";import"./create-state.esm.js";import"./plugins/max-length.esm.js";import"./plugins/task-list.esm.js";import"./plugins/code-highlight.esm.js";import"./plugins/embeds.esm.js";import"./plugins/find-replace.esm.js";import"./plugins/placeholder.esm.js";import"./plugins/format-painter.esm.js";import"./plugins/link.esm.js";import"./plugins/single-line.esm.js";import"./plugins/tables.esm.js";import"./plugins/image.esm.js";import"./plugins/paste.esm.js";import"../../index-6f3fa4ab.esm.js";import"../../index-7b1c9857.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";import"./keymap.esm.js";import"../../index-1faa963c.esm.js";import"./inputrules.esm.js";import"./plugins/suggestions.esm.js";import"../../xml-
|
|
1
|
+
import"./schema.esm.js";import"./sanitize.esm.js";import"./serializer.esm.js";import"./commands.esm.js";import"./markdown.esm.js";import"./markdown-parse.esm.js";import"./office-paste.esm.js";import"./export.esm.js";import"./plugins/image-view.esm.js";import"./plugins/embed-view.esm.js";import"./plugins/style-block-view.esm.js";import"./plugins/math-view.esm.js";import"./selection-state.esm.js";import"./create-state.esm.js";import"./plugins/max-length.esm.js";import"./plugins/task-list.esm.js";import"./plugins/code-highlight.esm.js";import"./plugins/embeds.esm.js";import"./plugins/find-replace.esm.js";import"./plugins/placeholder.esm.js";import"./plugins/format-painter.esm.js";import"./plugins/link.esm.js";import"./plugins/single-line.esm.js";import"./plugins/tables.esm.js";import"./plugins/image.esm.js";import"./plugins/paste.esm.js";import"../../index-6f3fa4ab.esm.js";import"../../index-7b1c9857.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";import"./keymap.esm.js";import"../../index-1faa963c.esm.js";import"./inputrules.esm.js";import"./plugins/suggestions.esm.js";import"../../xml-9bf771b3.esm.js";
|