@aquera/nile-elements 1.9.9 → 1.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/README.md +7 -0
  2. package/dist/{index-d7e6f1c6.cjs.js → index-50880eb7.cjs.js} +2 -2
  3. package/dist/{index-d7e6f1c6.cjs.js.map → index-50880eb7.cjs.js.map} +1 -1
  4. package/dist/index-6832c52b.cjs.js +2 -0
  5. package/dist/index-6832c52b.cjs.js.map +1 -0
  6. package/dist/{index-289706c7.esm.js → index-7b1c9857.esm.js} +1 -1
  7. package/dist/index-802939a8.esm.js +1 -0
  8. package/dist/index-ba47645d.esm.js +1 -0
  9. package/dist/index-d37d33cb.cjs.js +2 -0
  10. package/dist/index-d37d33cb.cjs.js.map +1 -0
  11. package/dist/index.cjs.js +1 -1
  12. package/dist/index.esm.js +1 -1
  13. package/dist/index.js +74 -10
  14. package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
  15. package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
  16. package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
  17. package/dist/nile-combobox/index.cjs.js +1 -1
  18. package/dist/nile-combobox/index.esm.js +1 -1
  19. package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
  20. package/dist/nile-combobox/nile-combobox.esm.js +1 -1
  21. package/dist/nile-detail/index.cjs.js +1 -1
  22. package/dist/nile-detail/index.esm.js +1 -1
  23. package/dist/nile-detail/nile-detail.cjs.js +1 -1
  24. package/dist/nile-detail/nile-detail.esm.js +1 -1
  25. package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
  26. package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
  27. package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
  28. package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
  29. package/dist/nile-drawer/nile-drawer.css.esm.js +54 -0
  30. package/dist/nile-drawer/nile-drawer.esm.js +6 -6
  31. package/dist/nile-nav-tab/nile-nav-tab.cjs.js +1 -1
  32. package/dist/nile-nav-tab/nile-nav-tab.cjs.js.map +1 -1
  33. package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js +1 -1
  34. package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js.map +1 -1
  35. package/dist/nile-nav-tab/nile-nav-tab.css.esm.js +11 -0
  36. package/dist/nile-nav-tab/nile-nav-tab.esm.js +1 -1
  37. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js +1 -1
  38. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js.map +1 -1
  39. package/dist/nile-nav-tab-group/nile-nav-tab-group.css.esm.js +1 -2
  40. package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
  41. package/dist/nile-wysiwyg-editor/engine/commands.esm.js +1 -1
  42. package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
  43. package/dist/nile-wysiwyg-editor/engine/create-state.esm.js +1 -1
  44. package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
  45. package/dist/nile-wysiwyg-editor/engine/index.esm.js +1 -1
  46. package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
  47. package/dist/nile-wysiwyg-editor/engine/keymap.esm.js +1 -1
  48. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
  49. package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.esm.js +1 -1
  50. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
  51. package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
  52. package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
  53. package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
  54. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
  55. package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
  56. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
  57. package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
  58. package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
  59. package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
  60. package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
  61. package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
  62. package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
  63. package/dist/nile-wysiwyg-editor/engine/selection-state.esm.js +1 -1
  64. package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
  65. package/dist/nile-wysiwyg-editor/index.esm.js +1 -1
  66. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  67. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
  68. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  69. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +1 -1
  70. package/dist/src/nile-checkbox/nile-checkbox.js +1 -0
  71. package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
  72. package/dist/src/nile-drawer/nile-drawer.css.js +54 -0
  73. package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
  74. package/dist/src/nile-drawer/nile-drawer.d.ts +4 -0
  75. package/dist/src/nile-drawer/nile-drawer.js +83 -38
  76. package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
  77. package/dist/src/nile-drawer/nile-drawer.test.js +71 -0
  78. package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
  79. package/dist/src/nile-nav-tab/nile-nav-tab.css.js +11 -0
  80. package/dist/src/nile-nav-tab/nile-nav-tab.css.js.map +1 -1
  81. package/dist/src/nile-nav-tab/nile-nav-tab.d.ts +2 -0
  82. package/dist/src/nile-nav-tab/nile-nav-tab.js +13 -0
  83. package/dist/src/nile-nav-tab/nile-nav-tab.js.map +1 -1
  84. package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js +1 -2
  85. package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js.map +1 -1
  86. package/dist/src/version.js +1 -1
  87. package/dist/src/version.js.map +1 -1
  88. package/dist/tsconfig.tsbuildinfo +1 -1
  89. package/package.json +1 -1
  90. package/src/nile-checkbox/nile-checkbox.ts +1 -0
  91. package/src/nile-drawer/nile-drawer.css.ts +54 -0
  92. package/src/nile-drawer/nile-drawer.test.ts +73 -0
  93. package/src/nile-drawer/nile-drawer.ts +58 -11
  94. package/src/nile-nav-tab/nile-nav-tab.css.ts +11 -0
  95. package/src/nile-nav-tab/nile-nav-tab.ts +17 -0
  96. package/src/nile-nav-tab-group/nile-nav-tab-group.css.ts +1 -2
  97. package/vscode-html-custom-data.json +11 -1
  98. package/dist/index-353172ed.esm.js +0 -1
  99. package/dist/index-b387a9f4.cjs.js +0 -2
  100. package/dist/index-b387a9f4.cjs.js.map +0 -1
  101. package/dist/index-cc1385e0.cjs.js +0 -2
  102. package/dist/index-cc1385e0.cjs.js.map +0 -1
  103. package/dist/index-dedc38a6.esm.js +0 -1
@@ -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-289706c7.esm.js";import{D as h,a as f}from"../../index-353172ed.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-25c4108a.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
+ 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-25c4108a.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-d7e6f1c6.cjs.js","../../index-cc1385e0.cjs.js","../../index-178e1e57.cjs.js","./keymap.cjs.js","../../index-f956f56d.cjs.js","./inputrules.cjs.js","./plugins/suggestions.cjs.js","../../xml-90fd974e.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(_index00aCjsJs){},function(_index001CjsJs){},function(_index009CjsJs){},function(_index007CjsJs){},function(_keymapCjsJs){},function(_index00cCjsJs){},function(_inputrulesCjsJs){},function(_pluginsSuggestionsCjsJs){},function(_xml00bCjsJs){}],execute:function execute(){}};});
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-50880eb7.cjs.js","../../index-6832c52b.cjs.js","../../index-178e1e57.cjs.js","./keymap.cjs.js","../../index-f956f56d.cjs.js","./inputrules.cjs.js","./plugins/suggestions.cjs.js","../../xml-90fd974e.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(_index00aCjsJs){},function(_index001CjsJs){},function(_index009CjsJs){},function(_index007CjsJs){},function(_keymapCjsJs){},function(_index00cCjsJs){},function(_inputrulesCjsJs){},function(_pluginsSuggestionsCjsJs){},function(_xml00bCjsJs){}],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-289706c7.esm.js";import"../../index-353172ed.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-25c4108a.esm.js";
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-25c4108a.esm.js";
@@ -1,2 +1,2 @@
1
- System.register(["../../index-d7e6f1c6.cjs.js","./commands.cjs.js","../../index-f956f56d.cjs.js","./schema.cjs.js","./plugins/paste.cjs.js","../../index-89c520e9.cjs.js","../../index-cc1385e0.cjs.js","../../index-178e1e57.cjs.js","./plugins/embeds.cjs.js","./markdown-parse.cjs.js","./serializer.cjs.js","./sanitize.cjs.js"],function(_export,_context){"use strict";var s,i,t,o,r,e,a,n,c,p,j,d,m;function f(f){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var u={};u["Mod-z"]=o,u["Shift-Mod-z"]=r,m||(u["Mod-y"]=r),u.Backspace=n,u["Mod-b"]=function(s,t,o){return i(s,"bold")(s,t,o);},u["Mod-i"]=function(s,t,o){return i(s,"italic")(s,t,o);},u["Mod-u"]=function(s,t,o){return i(s,"underline")(s,t,o);},u["Shift-Mod-x"]=function(s,t,o){return i(s,"strike")(s,t,o);},u["Mod-,"]=function(s,t,o){return i(s,"subscript")(s,t,o);},u["Mod-."]=function(s,t,o){return i(s,"superscript")(s,t,o);},u["Shift-Mod-v"]=function(s,i,t){var _navigator$clipboard;return!(!t||"undefined"==typeof navigator||!((_navigator$clipboard=navigator.clipboard)!==null&&_navigator$clipboard!==void 0&&_navigator$clipboard.readText))&&(navigator.clipboard.readText().then(function(s){if(!s||!t)return;var i=d(t.state.schema,s);t.dispatch(t.state.tr.replaceSelection(i).scrollIntoView());})["catch"](function(){}),!0);},u["Shift-Ctrl-0"]=function(s,t,o){return i(s,"paragraph")(s,t,o);};var _loop=function _loop(_s){u["Shift-Ctrl-".concat(_s)]=function(t,o,r){return i(t,"heading",{level:_s})(t,o,r);};};for(var _s=1;_s<=6;_s+=1){_loop(_s);}u["Shift-Mod-7"]=function(s,t,o){return i(s,"orderedList")(s,t,o);},u["Shift-Mod-8"]=function(s,t,o){return i(s,"bulletList")(s,t,o);},u["Shift-Mod-9"]=function(s,t,o){return i(s,"blockquote")(s,t,o);},u["Mod-Alt-c"]=function(s,t,o){return i(s,"codeBlock")(s,t,o);},u["Mod-]"]=function(s,t,o){return i(s,"indent")(s,t,o);},u["Mod-["]=function(s,t,o){return i(s,"outdent")(s,t,o);},u.Enter=t(c(f.nodes.task_item,{checked:!1}),c(f.nodes.list_item)),u.Tab=t(p(f.nodes.task_item),p(f.nodes.list_item)),u["Shift-Tab"]=t(j(f.nodes.task_item),j(f.nodes.list_item));var g=t(e,function(s,i){return i&&i(s.tr.replaceSelectionWith(f.nodes.hard_break.create()).scrollIntoView()),!0;});if(u["Shift-Enter"]=g,u["Mod-Enter"]=g,l.onLinkShortcut){var _s2=l.onLinkShortcut;u["Mod-k"]=function(){return _s2(),!0;};}if(l.onFindShortcut){var _s3=l.onFindShortcut;u["Mod-f"]=function(){return _s3(),!0;};}if(l.onShortcutHelp){var _s4=l.onShortcutHelp;u["Mod-/"]=function(){return _s4(),!0;};}return[s(u),s(a)];}_export("b",f);return{setters:[function(_index001CjsJs){s=_index001CjsJs.k;},function(_commandsCjsJs){i=_commandsCjsJs.b;t=_commandsCjsJs.c;o=_commandsCjsJs.u;r=_commandsCjsJs.r;e=_commandsCjsJs.e;a=_commandsCjsJs.d;},function(_index00cCjsJs){n=_index00cCjsJs.u;},function(_schemaCjsJs){c=_schemaCjsJs.s;p=_schemaCjsJs.a;j=_schemaCjsJs.l;},function(_pluginsPasteCjsJs){d=_pluginsPasteCjsJs.p;},function(_index00aCjsJs){},function(_index009CjsJs){},function(_index007CjsJs){},function(_pluginsEmbedsCjsJs){},function(_markdownParseCjsJs){},function(_serializerCjsJs){},function(_sanitizeCjsJs){}],execute:function execute(){m="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);}};});
1
+ System.register(["../../index-50880eb7.cjs.js","./commands.cjs.js","../../index-f956f56d.cjs.js","./schema.cjs.js","./plugins/paste.cjs.js","../../index-89c520e9.cjs.js","../../index-6832c52b.cjs.js","../../index-178e1e57.cjs.js","./plugins/embeds.cjs.js","./markdown-parse.cjs.js","./serializer.cjs.js","./sanitize.cjs.js"],function(_export,_context){"use strict";var s,i,t,o,r,e,a,n,c,p,j,d,m;function f(f){var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var u={};u["Mod-z"]=o,u["Shift-Mod-z"]=r,m||(u["Mod-y"]=r),u.Backspace=n,u["Mod-b"]=function(s,t,o){return i(s,"bold")(s,t,o);},u["Mod-i"]=function(s,t,o){return i(s,"italic")(s,t,o);},u["Mod-u"]=function(s,t,o){return i(s,"underline")(s,t,o);},u["Shift-Mod-x"]=function(s,t,o){return i(s,"strike")(s,t,o);},u["Mod-,"]=function(s,t,o){return i(s,"subscript")(s,t,o);},u["Mod-."]=function(s,t,o){return i(s,"superscript")(s,t,o);},u["Shift-Mod-v"]=function(s,i,t){var _navigator$clipboard;return!(!t||"undefined"==typeof navigator||!((_navigator$clipboard=navigator.clipboard)!==null&&_navigator$clipboard!==void 0&&_navigator$clipboard.readText))&&(navigator.clipboard.readText().then(function(s){if(!s||!t)return;var i=d(t.state.schema,s);t.dispatch(t.state.tr.replaceSelection(i).scrollIntoView());})["catch"](function(){}),!0);},u["Shift-Ctrl-0"]=function(s,t,o){return i(s,"paragraph")(s,t,o);};var _loop=function _loop(_s){u["Shift-Ctrl-".concat(_s)]=function(t,o,r){return i(t,"heading",{level:_s})(t,o,r);};};for(var _s=1;_s<=6;_s+=1){_loop(_s);}u["Shift-Mod-7"]=function(s,t,o){return i(s,"orderedList")(s,t,o);},u["Shift-Mod-8"]=function(s,t,o){return i(s,"bulletList")(s,t,o);},u["Shift-Mod-9"]=function(s,t,o){return i(s,"blockquote")(s,t,o);},u["Mod-Alt-c"]=function(s,t,o){return i(s,"codeBlock")(s,t,o);},u["Mod-]"]=function(s,t,o){return i(s,"indent")(s,t,o);},u["Mod-["]=function(s,t,o){return i(s,"outdent")(s,t,o);},u.Enter=t(c(f.nodes.task_item,{checked:!1}),c(f.nodes.list_item)),u.Tab=t(p(f.nodes.task_item),p(f.nodes.list_item)),u["Shift-Tab"]=t(j(f.nodes.task_item),j(f.nodes.list_item));var g=t(e,function(s,i){return i&&i(s.tr.replaceSelectionWith(f.nodes.hard_break.create()).scrollIntoView()),!0;});if(u["Shift-Enter"]=g,u["Mod-Enter"]=g,l.onLinkShortcut){var _s2=l.onLinkShortcut;u["Mod-k"]=function(){return _s2(),!0;};}if(l.onFindShortcut){var _s3=l.onFindShortcut;u["Mod-f"]=function(){return _s3(),!0;};}if(l.onShortcutHelp){var _s4=l.onShortcutHelp;u["Mod-/"]=function(){return _s4(),!0;};}return[s(u),s(a)];}_export("b",f);return{setters:[function(_index001CjsJs){s=_index001CjsJs.k;},function(_commandsCjsJs){i=_commandsCjsJs.b;t=_commandsCjsJs.c;o=_commandsCjsJs.u;r=_commandsCjsJs.r;e=_commandsCjsJs.e;a=_commandsCjsJs.d;},function(_index00cCjsJs){n=_index00cCjsJs.u;},function(_schemaCjsJs){c=_schemaCjsJs.s;p=_schemaCjsJs.a;j=_schemaCjsJs.l;},function(_pluginsPasteCjsJs){d=_pluginsPasteCjsJs.p;},function(_index00aCjsJs){},function(_index009CjsJs){},function(_index007CjsJs){},function(_pluginsEmbedsCjsJs){},function(_markdownParseCjsJs){},function(_serializerCjsJs){},function(_sanitizeCjsJs){}],execute:function execute(){m="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);}};});
2
2
  //# sourceMappingURL=keymap.cjs.js.map
@@ -1 +1 @@
1
- import{k as s}from"../../index-289706c7.esm.js";import{b as e,c as i,u as t,r as o,e as r,d as a}from"./commands.esm.js";import{u as n}from"../../index-1faa963c.esm.js";import{s as m,a as p,l as d}from"./schema.esm.js";import{p as c}from"./plugins/paste.esm.js";import"../../index-6f3fa4ab.esm.js";import"../../index-353172ed.esm.js";import"../../index-920675c4.esm.js";import"./plugins/embeds.esm.js";import"./markdown-parse.esm.js";import"./serializer.esm.js";import"./sanitize.esm.js";const f="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function l(l,u={}){const j={};j["Mod-z"]=t,j["Shift-Mod-z"]=o,f||(j["Mod-y"]=o),j.Backspace=n,j["Mod-b"]=(s,i,t)=>e(s,"bold")(s,i,t),j["Mod-i"]=(s,i,t)=>e(s,"italic")(s,i,t),j["Mod-u"]=(s,i,t)=>e(s,"underline")(s,i,t),j["Shift-Mod-x"]=(s,i,t)=>e(s,"strike")(s,i,t),j["Mod-,"]=(s,i,t)=>e(s,"subscript")(s,i,t),j["Mod-."]=(s,i,t)=>e(s,"superscript")(s,i,t),j["Shift-Mod-v"]=(s,e,i)=>!(!i||"undefined"==typeof navigator||!navigator.clipboard?.readText)&&(navigator.clipboard.readText().then((s=>{if(!s||!i)return;const e=c(i.state.schema,s);i.dispatch(i.state.tr.replaceSelection(e).scrollIntoView())})).catch((()=>{})),!0),j["Shift-Ctrl-0"]=(s,i,t)=>e(s,"paragraph")(s,i,t);for(let s=1;s<=6;s+=1)j[`Shift-Ctrl-${s}`]=(i,t,o)=>e(i,"heading",{level:s})(i,t,o);j["Shift-Mod-7"]=(s,i,t)=>e(s,"orderedList")(s,i,t),j["Shift-Mod-8"]=(s,i,t)=>e(s,"bulletList")(s,i,t),j["Shift-Mod-9"]=(s,i,t)=>e(s,"blockquote")(s,i,t),j["Mod-Alt-c"]=(s,i,t)=>e(s,"codeBlock")(s,i,t),j["Mod-]"]=(s,i,t)=>e(s,"indent")(s,i,t),j["Mod-["]=(s,i,t)=>e(s,"outdent")(s,i,t),j.Enter=i(m(l.nodes.task_item,{checked:!1}),m(l.nodes.list_item)),j.Tab=i(p(l.nodes.task_item),p(l.nodes.list_item)),j["Shift-Tab"]=i(d(l.nodes.task_item),d(l.nodes.list_item));const g=i(r,((s,e)=>(e&&e(s.tr.replaceSelectionWith(l.nodes.hard_break.create()).scrollIntoView()),!0)));if(j["Shift-Enter"]=g,j["Mod-Enter"]=g,u.onLinkShortcut){const s=u.onLinkShortcut;j["Mod-k"]=()=>(s(),!0)}if(u.onFindShortcut){const s=u.onFindShortcut;j["Mod-f"]=()=>(s(),!0)}if(u.onShortcutHelp){const s=u.onShortcutHelp;j["Mod-/"]=()=>(s(),!0)}return[s(j),s(a)]}export{l as b};
1
+ import{k as s}from"../../index-7b1c9857.esm.js";import{b as e,c as i,u as t,r as o,e as r,d as a}from"./commands.esm.js";import{u as n}from"../../index-1faa963c.esm.js";import{s as m,a as p,l as d}from"./schema.esm.js";import{p as c}from"./plugins/paste.esm.js";import"../../index-6f3fa4ab.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";import"./plugins/embeds.esm.js";import"./markdown-parse.esm.js";import"./serializer.esm.js";import"./sanitize.esm.js";const f="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function l(l,u={}){const j={};j["Mod-z"]=t,j["Shift-Mod-z"]=o,f||(j["Mod-y"]=o),j.Backspace=n,j["Mod-b"]=(s,i,t)=>e(s,"bold")(s,i,t),j["Mod-i"]=(s,i,t)=>e(s,"italic")(s,i,t),j["Mod-u"]=(s,i,t)=>e(s,"underline")(s,i,t),j["Shift-Mod-x"]=(s,i,t)=>e(s,"strike")(s,i,t),j["Mod-,"]=(s,i,t)=>e(s,"subscript")(s,i,t),j["Mod-."]=(s,i,t)=>e(s,"superscript")(s,i,t),j["Shift-Mod-v"]=(s,e,i)=>!(!i||"undefined"==typeof navigator||!navigator.clipboard?.readText)&&(navigator.clipboard.readText().then((s=>{if(!s||!i)return;const e=c(i.state.schema,s);i.dispatch(i.state.tr.replaceSelection(e).scrollIntoView())})).catch((()=>{})),!0),j["Shift-Ctrl-0"]=(s,i,t)=>e(s,"paragraph")(s,i,t);for(let s=1;s<=6;s+=1)j[`Shift-Ctrl-${s}`]=(i,t,o)=>e(i,"heading",{level:s})(i,t,o);j["Shift-Mod-7"]=(s,i,t)=>e(s,"orderedList")(s,i,t),j["Shift-Mod-8"]=(s,i,t)=>e(s,"bulletList")(s,i,t),j["Shift-Mod-9"]=(s,i,t)=>e(s,"blockquote")(s,i,t),j["Mod-Alt-c"]=(s,i,t)=>e(s,"codeBlock")(s,i,t),j["Mod-]"]=(s,i,t)=>e(s,"indent")(s,i,t),j["Mod-["]=(s,i,t)=>e(s,"outdent")(s,i,t),j.Enter=i(m(l.nodes.task_item,{checked:!1}),m(l.nodes.list_item)),j.Tab=i(p(l.nodes.task_item),p(l.nodes.list_item)),j["Shift-Tab"]=i(d(l.nodes.task_item),d(l.nodes.list_item));const g=i(r,((s,e)=>(e&&e(s.tr.replaceSelectionWith(l.nodes.hard_break.create()).scrollIntoView()),!0)));if(j["Shift-Enter"]=g,j["Mod-Enter"]=g,u.onLinkShortcut){const s=u.onLinkShortcut;j["Mod-k"]=()=>(s(),!0)}if(u.onFindShortcut){const s=u.onFindShortcut;j["Mod-f"]=()=>(s(),!0)}if(u.onShortcutHelp){const s=u.onShortcutHelp;j["Mod-/"]=()=>(s(),!0)}return[s(j),s(a)]}export{l as b};