@aquera/nile-elements 1.9.9 → 1.9.10
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 +4 -0
- package/dist/{index-d7e6f1c6.cjs.js → index-50880eb7.cjs.js} +2 -2
- package/dist/{index-d7e6f1c6.cjs.js.map → index-50880eb7.cjs.js.map} +1 -1
- package/dist/index-6832c52b.cjs.js +2 -0
- package/dist/index-6832c52b.cjs.js.map +1 -0
- package/dist/index-747d1880.cjs.js +2 -0
- package/dist/index-747d1880.cjs.js.map +1 -0
- package/dist/{index-289706c7.esm.js → index-7b1c9857.esm.js} +1 -1
- package/dist/index-a487d8b4.esm.js +1 -0
- package/dist/index-ba47645d.esm.js +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +17 -7
- package/dist/nile-checkbox/nile-checkbox.cjs.js +1 -1
- package/dist/nile-checkbox/nile-checkbox.cjs.js.map +1 -1
- package/dist/nile-checkbox/nile-checkbox.esm.js +1 -1
- package/dist/nile-combobox/index.cjs.js +1 -1
- package/dist/nile-combobox/index.esm.js +1 -1
- package/dist/nile-combobox/nile-combobox.cjs.js +1 -1
- package/dist/nile-combobox/nile-combobox.esm.js +1 -1
- package/dist/nile-detail/index.cjs.js +1 -1
- package/dist/nile-detail/index.esm.js +1 -1
- package/dist/nile-detail/nile-detail.cjs.js +1 -1
- package/dist/nile-detail/nile-detail.esm.js +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.cjs.js +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.cjs.js.map +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.css.cjs.js.map +1 -1
- package/dist/nile-nav-tab/nile-nav-tab.css.esm.js +11 -0
- package/dist/nile-nav-tab/nile-nav-tab.esm.js +1 -1
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js +1 -1
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.cjs.js.map +1 -1
- package/dist/nile-nav-tab-group/nile-nav-tab-group.css.esm.js +1 -2
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +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/keymap.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.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.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.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/src/nile-checkbox/nile-checkbox.js +1 -0
- package/dist/src/nile-checkbox/nile-checkbox.js.map +1 -1
- package/dist/src/nile-nav-tab/nile-nav-tab.css.js +11 -0
- package/dist/src/nile-nav-tab/nile-nav-tab.css.js.map +1 -1
- package/dist/src/nile-nav-tab/nile-nav-tab.d.ts +2 -0
- package/dist/src/nile-nav-tab/nile-nav-tab.js +13 -0
- package/dist/src/nile-nav-tab/nile-nav-tab.js.map +1 -1
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js +1 -2
- package/dist/src/nile-nav-tab-group/nile-nav-tab-group.css.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-checkbox/nile-checkbox.ts +1 -0
- package/src/nile-nav-tab/nile-nav-tab.css.ts +11 -0
- package/src/nile-nav-tab/nile-nav-tab.ts +17 -0
- package/src/nile-nav-tab-group/nile-nav-tab-group.css.ts +1 -2
- package/dist/index-353172ed.esm.js +0 -1
- package/dist/index-b387a9f4.cjs.js +0 -2
- package/dist/index-b387a9f4.cjs.js.map +0 -1
- package/dist/index-cc1385e0.cjs.js +0 -2
- package/dist/index-cc1385e0.cjs.js.map +0 -1
- package/dist/index-dedc38a6.esm.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-6832c52b.cjs.js"],function(_export,_context){"use strict";var n,e,t,r,s,c;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 _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 _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 _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n2){function n(){return _n2.apply(this,arguments);}n.toString=function(){return _n2.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}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 _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 _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 i(n,e,t){if(!e)return[];var r=[],s=t?e:e.toLowerCase();return n.descendants(function(n,e){if(!n.isTextblock)return!0;var c=n.textBetween(0,n.content.size,"\0","\0"),i=t?c:c.toLowerCase();var a=0;for(;-1!==(a=i.indexOf(s,a));)r.push({from:e+1+a,to:e+1+a+s.length}),a+=s.length;return!1;}),r;}function a(){return new e({key:s,state:{init:function init(){return c;},apply:function apply(n,e){var t=n.getMeta(s);if(t)return function(n,e,t){switch(e.type){case"search":{var _e$caseSensitive;var _r=(_e$caseSensitive=e.caseSensitive)!==null&&_e$caseSensitive!==void 0?_e$caseSensitive:n.caseSensitive;return{query:e.query,caseSensitive:_r,matches:i(t,e.query,_r),activeIndex:0};}case"next":return n.matches.length?_objectSpread(_objectSpread({},n),{},{activeIndex:(n.activeIndex+1)%n.matches.length}):n;case"prev":return n.matches.length?_objectSpread(_objectSpread({},n),{},{activeIndex:(n.activeIndex-1+n.matches.length)%n.matches.length}):n;default:return c;}}(e,t,n.doc);if(n.docChanged&&e.query){var _t=i(n.doc,e.query,e.caseSensitive);return _objectSpread(_objectSpread({},e),{},{matches:_t,activeIndex:Math.min(e.activeIndex,Math.max(0,_t.length-1))});}return e;}},props:{decorations:function decorations(n){var e=s.getState(n);return e&&e.matches.length?t.create(n.doc,e.matches.map(function(n,t){return r.inline(n.from,n.to,{"class":t===e.activeIndex?"nile-wysiwyg__find-match nile-wysiwyg__find-active":"nile-wysiwyg__find-match"});})):null;}}});}function u(n){var _s$getState;return(_s$getState=s.getState(n))!==null&&_s$getState!==void 0?_s$getState:c;}function o(n,e,t){return n.tr.setMeta(s,{type:"search",query:e,caseSensitive:t});}function f(n,e){return n.tr.setMeta(s,{type:e});}function l(n){return n.tr.setMeta(s,{type:"clear"});}function y(n,e){var t=u(n),r=t.matches[t.activeIndex];return r?n.tr.insertText(e,r.from,r.to):null;}function d(n,e){var t=u(n);if(!t.matches.length)return null;var r=n.tr;var _iterator=_createForOfIteratorHelper(_toConsumableArray(t.matches).reverse()),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _n=_step.value;r.insertText(e,_n.from,_n.to);}}catch(err){_iterator.e(err);}finally{_iterator.f();}return r;}_export({a:f,b:d,c:l,f:a,g:u,r:y,s:o});return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.P;e=_index00aCjsJs.b;},function(_index009CjsJs){t=_index009CjsJs.D;r=_index009CjsJs.a;}],execute:function execute(){s=new n("nileFindReplace"),c={query:"",caseSensitive:!1,matches:[],activeIndex:0};}};});
|
|
2
2
|
//# sourceMappingURL=find-replace.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,b as n}from"../../../index-6f3fa4ab.esm.js";import{D as t,a as r}from"../../../index-
|
|
1
|
+
import{P as e,b as n}from"../../../index-6f3fa4ab.esm.js";import{D as t,a as r}from"../../../index-ba47645d.esm.js";const s=new e("nileFindReplace"),c={query:"",caseSensitive:!1,matches:[],activeIndex:0};function i(e,n,t){if(!n)return[];const r=[],s=t?n:n.toLowerCase();return e.descendants(((e,n)=>{if(!e.isTextblock)return!0;const c=e.textBetween(0,e.content.size,"\0","\0"),i=t?c:c.toLowerCase();let a=0;for(;-1!==(a=i.indexOf(s,a));)r.push({from:n+1+a,to:n+1+a+s.length}),a+=s.length;return!1})),r}function a(){return new n({key:s,state:{init:()=>c,apply(e,n){const t=e.getMeta(s);if(t)return function(e,n,t){switch(n.type){case"search":{const r=n.caseSensitive??e.caseSensitive;return{query:n.query,caseSensitive:r,matches:i(t,n.query,r),activeIndex:0}}case"next":return e.matches.length?{...e,activeIndex:(e.activeIndex+1)%e.matches.length}:e;case"prev":return e.matches.length?{...e,activeIndex:(e.activeIndex-1+e.matches.length)%e.matches.length}:e;default:return c}}(n,t,e.doc);if(e.docChanged&&n.query){const t=i(e.doc,n.query,n.caseSensitive);return{...n,matches:t,activeIndex:Math.min(n.activeIndex,Math.max(0,t.length-1))}}return n}},props:{decorations(e){const n=s.getState(e);return n&&n.matches.length?t.create(e.doc,n.matches.map(((e,t)=>r.inline(e.from,e.to,{class:t===n.activeIndex?"nile-wysiwyg__find-match nile-wysiwyg__find-active":"nile-wysiwyg__find-match"})))):null}}})}function u(e){return s.getState(e)??c}function o(e,n,t){return e.tr.setMeta(s,{type:"search",query:n,caseSensitive:t})}function f(e,n){return e.tr.setMeta(s,{type:n})}function l(e){return e.tr.setMeta(s,{type:"clear"})}function y(e,n){const t=u(e),r=t.matches[t.activeIndex];return r?e.tr.insertText(n,r.from,r.to):null}function d(e,n){const t=u(e);if(!t.matches.length)return null;const r=e.tr;for(const e of[...t.matches].reverse())r.insertText(n,e.from,e.to);return r}export{f as a,d as b,l as c,a as f,u as g,y as r,o as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-6832c52b.cjs.js"],function(_export,_context){"use strict";var n,o,t,e,a;function r(n){return n?Array.from(n.files).filter(function(n){return n.type.startsWith("image/");}):[];}function i(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new o({key:a,state:{init:function init(){return t.empty;},apply:function apply(n,o){var t=o.map(n.mapping,n.doc);var r=n.getMeta(a);if(r!==null&&r!==void 0&&r.add){var _o=document.createElement("span");_o.className="nile-wysiwyg__upload-placeholder",_o.textContent="Uploading image…",t=t.add(n.doc,[e.widget(r.add.pos,_o,{id:r.add.id})]);}return r!==null&&r!==void 0&&r.remove&&(t=t.remove(t.find(void 0,void 0,function(n){return n.id===r.remove.id;}))),t;}},props:{decorations:function decorations(n){return a.getState(n);},handlePaste:function handlePaste(o,t){var e=r(t.clipboardData);return!(0===e.length||!n.onImageFiles)&&(n.onImageFiles(e,null),!0);},handleDrop:function handleDrop(o,t){var e=r(t.dataTransfer);if(0===e.length||!n.onImageFiles)return!1;var a=o.posAtCoords({left:t.clientX,top:t.clientY});return n.onImageFiles(e,a?a.pos:null),!0;}}});}function s(n,o){var t=a.getState(n),e=t===null||t===void 0?void 0:t.find(void 0,void 0,function(n){return n.id===o;});return e&&e.length?e[0].from:null;}_export({f:s,i:i});return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.P;o=_index00aCjsJs.b;},function(_index009CjsJs){t=_index009CjsJs.D;e=_index009CjsJs.a;}],execute:function execute(){_export("a",a=new n("nileImageUpload"));}};});
|
|
2
2
|
//# sourceMappingURL=image.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as n,b as e}from"../../../index-6f3fa4ab.esm.js";import{D as o,a as t}from"../../../index-
|
|
1
|
+
import{P as n,b as e}from"../../../index-6f3fa4ab.esm.js";import{D as o,a as t}from"../../../index-ba47645d.esm.js";const a=new n("nileImageUpload");function r(n){return n?Array.from(n.files).filter((n=>n.type.startsWith("image/"))):[]}function i(n={}){return new e({key:a,state:{init:()=>o.empty,apply(n,e){let o=e.map(n.mapping,n.doc);const r=n.getMeta(a);if(r?.add){const e=document.createElement("span");e.className="nile-wysiwyg__upload-placeholder",e.textContent="Uploading image…",o=o.add(n.doc,[t.widget(r.add.pos,e,{id:r.add.id})])}return r?.remove&&(o=o.remove(o.find(void 0,void 0,(n=>n.id===r.remove.id)))),o}},props:{decorations:n=>a.getState(n),handlePaste(e,o){const t=r(o.clipboardData);return!(0===t.length||!n.onImageFiles)&&(n.onImageFiles(t,null),!0)},handleDrop(e,o){const t=r(o.dataTransfer);if(0===t.length||!n.onImageFiles)return!1;const a=e.posAtCoords({left:o.clientX,top:o.clientY});return n.onImageFiles(t,a?a.pos:null),!0}}})}function s(n,e){const o=a.getState(n),t=o?.find(void 0,void 0,(n=>n.id===e));return t&&t.length?t[0].from:null}export{a,s as f,i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-6832c52b.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var s,r,e,i;function o(o){return new s({props:{decorations:function decorations(s){var t=o();if(!t||!i(s.doc))return null;var a=r.node(0,s.doc.firstChild.nodeSize,{"class":"nile-wysiwyg__empty","data-placeholder":t});return e.create(s.doc,[a]);}}});}_export("p",o);return{setters:[function(_index00aCjsJs){s=_index00aCjsJs.b;},function(_index009CjsJs){r=_index009CjsJs.a;e=_index009CjsJs.D;},function(_serializerCjsJs){i=_serializerCjsJs.i;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=placeholder.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as s}from"../../../index-6f3fa4ab.esm.js";import{a as e,D as r}from"../../../index-
|
|
1
|
+
import{b as s}from"../../../index-6f3fa4ab.esm.js";import{a as e,D as r}from"../../../index-ba47645d.esm.js";import{i}from"../serializer.esm.js";import"../sanitize.esm.js";import"./embeds.esm.js";function o(o){return new s({props:{decorations(s){const t=o();if(!t||!i(s.doc))return null;const m=e.node(0,s.doc.firstChild.nodeSize,{class:"nile-wysiwyg__empty","data-placeholder":t});return r.create(s.doc,[m])}}})}export{o as p};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-6832c52b.cjs.js"],function(_export,_context){"use strict";var n,t,o,r;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,F=function F(){};return{s:F,n:function(_n2){function n(){return _n2.apply(this,arguments);}n.toString=function(){return _n2.toString();};return n;}(function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]};}),e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}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 e(e,s){return new n({key:e,state:{init:function init(){return r;},apply:function apply(n,t,o,e){var i=function(n,t){var _n$selection=n.selection,o=_n$selection.$from,e=_n$selection.empty;if(!e||!o.parent.isTextblock||o.parent.type.spec.code)return r;var s=o.parent.textBetween(0,o.parentOffset,"\0","\0"),i=_toConsumableArray(t.getTriggers()).sort(function(n,t){return t.length-n.length;});var _iterator=_createForOfIteratorHelper(i),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _t$minQueryLength;var _n=_step.value;if(!_n)continue;var _r=s.lastIndexOf(_n);if(-1===_r)continue;if(t.startOfLine&&0!==_r)continue;var _e=s[_r-1];if(void 0!==_e&&!/\s/.test(_e))continue;var _i=s.slice(_r+_n.length);if(!(_i.length>50||/\s/.test(_i)||_i.length<((_t$minQueryLength=t.minQueryLength)!==null&&_t$minQueryLength!==void 0?_t$minQueryLength:0)))return{active:!0,trigger:_n,query:_i,from:o.start()+_r,to:o.pos};}}catch(err){_iterator.e(err);}finally{_iterator.f();}return r;}(e,s);return i.active===t.active&&i.query===t.query&&i.trigger===t.trigger&&i.from===t.from||s.onChange(i),i;}},props:{decorations:function decorations(n){var r=e.getState(n);return r.active?t.create(n.doc,[o.inline(r.from,r.to,{"class":"nile-wysiwyg__suggestion"})]):null;},handleKeyDown:function handleKeyDown(n,t){var o=e.getState(n.state);return!(!o.active||!s.onKeyDown)&&s.onKeyDown(t,o);}}});}_export("s",e);return{setters:[function(_index00aCjsJs){n=_index00aCjsJs.b;},function(_index009CjsJs){t=_index009CjsJs.D;o=_index009CjsJs.a;}],execute:function execute(){r={active:!1,trigger:"",query:"",from:0,to:0};}};});
|
|
2
2
|
//# sourceMappingURL=suggestions.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"../../../index-6f3fa4ab.esm.js";import{D as t,a as o}from"../../../index-
|
|
1
|
+
import{b as n}from"../../../index-6f3fa4ab.esm.js";import{D as t,a as o}from"../../../index-ba47645d.esm.js";const e={active:!1,trigger:"",query:"",from:0,to:0};function r(r,s){return new n({key:r,state:{init:()=>e,apply(n,t,o,r){const i=function(n,t){const{$from:o,empty:r}=n.selection;if(!r||!o.parent.isTextblock||o.parent.type.spec.code)return e;const s=o.parent.textBetween(0,o.parentOffset,"\0","\0"),i=[...t.getTriggers()].sort(((n,t)=>t.length-n.length));for(const n of i){if(!n)continue;const e=s.lastIndexOf(n);if(-1===e)continue;if(t.startOfLine&&0!==e)continue;const r=s[e-1];if(void 0!==r&&!/\s/.test(r))continue;const i=s.slice(e+n.length);if(!(i.length>50||/\s/.test(i)||i.length<(t.minQueryLength??0)))return{active:!0,trigger:n,query:i,from:o.start()+e,to:o.pos}}return e}(r,s);return i.active===t.active&&i.query===t.query&&i.trigger===t.trigger&&i.from===t.from||s.onChange(i),i}},props:{decorations(n){const e=r.getState(n);return e.active?t.create(n.doc,[o.inline(e.from,e.to,{class:"nile-wysiwyg__suggestion"})]):null},handleKeyDown(n,t){const o=r.getState(n.state);return!(!o.active||!s.onKeyDown)&&s.onKeyDown(t,o)}}})}export{r as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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);}System.register(["../../../index-
|
|
1
|
+
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);}System.register(["../../../index-50880eb7.cjs.js","../../../index-89c520e9.cjs.js","../../../index-6832c52b.cjs.js","../../../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var s,t,e,i;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 _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 _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););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 r(){return[s({View:i}),t({allowTableNodeSelection:!0})];}_export("t",r);return{setters:[function(_index001CjsJs){s=_index001CjsJs.c;t=_index001CjsJs.t;e=_index001CjsJs.T;},function(_index00aCjsJs){},function(_index009CjsJs){},function(_index007CjsJs){}],execute:function execute(){i=/*#__PURE__*/function(_e){function i(s,t){var _this;_classCallCheck(this,i);_this=_callSuper(this,i,[s,t]),_this.applyHtmlAttrs(s);return _this;}_inherits(i,_e);return _createClass(i,[{key:"applyHtmlAttrs",value:function applyHtmlAttrs(s){var t=s.attrs.htmlClass,e=s.attrs.htmlId;this.table.className=t!==null&&t!==void 0?t:"",e?this.table.id=e:this.table.removeAttribute("id");}},{key:"update",value:function update(s){var t=_superPropGet(i,"update",this,3)([s]);return t&&this.applyHtmlAttrs(s),t;}}]);}(e);}};});
|
|
2
2
|
//# sourceMappingURL=tables.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,t,T as e}from"../../../index-
|
|
1
|
+
import{c as s,t,T as e}from"../../../index-7b1c9857.esm.js";import"../../../index-6f3fa4ab.esm.js";import"../../../index-ba47645d.esm.js";import"../../../index-920675c4.esm.js";class i extends e{constructor(s,t){super(s,t),this.applyHtmlAttrs(s)}applyHtmlAttrs(s){const t=s.attrs.htmlClass,e=s.attrs.htmlId;this.table.className=t??"",e?this.table.id=e:this.table.removeAttribute("id")}update(s){const t=super.update(s);return t&&this.applyHtmlAttrs(s),t}}function r(){return[s({View:i}),t({allowTableNodeSelection:!0})]}export{r as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../index-89c520e9.cjs.js","../../index-d7e6f1c6.cjs.js","./plugins/embeds.cjs.js","../../index-cc1385e0.cjs.js","../../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var t,e,l,r,n,a,i,s,o,u,c,g,d,f,_R$attrs,p,m,b,y,h,M,A,x,F,q,E,B,G,P,R,W,J,K,L,Q,T,U,V,X;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}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 _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure 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 _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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithHoles(r){if(Array.isArray(r))return r;}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 _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 O(t,e){var l={};for(var _e in t)l[_e]=t[_e];for(var _t in e)l[_t]=e[_t];return l;}function D(n){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return function(o,u){var _o$selection=o.selection,c=_o$selection.$from,g=_o$selection.$to,d=c.blockRange(g);if(!d)return!1;var f=u?o.tr:null;return!!function(n,a,o){var u=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var c=!1,g=a,d=a.$from.doc;if(a.depth>=2&&a.$from.node(a.depth-1).type.compatibleContent(o)&&0==a.startIndex){if(0==a.$from.index(a.depth-1))return!1;var _t2=d.resolve(a.start-2);g=new r(_t2,_t2,a.depth),a.endIndex<a.parent.childCount&&(a=new r(a.$from,d.resolve(a.$to.end(a.depth)),a.depth)),c=!0;}var f=i(g,o,u,a);if(!f)return!1;n&&function(r,n,a,i,o){var u=l.empty;for(var _t3=a.length-1;_t3>=0;_t3--)u=l.from(a[_t3].type.create(a[_t3].attrs,u));r.step(new t(n.start-(i?2:0),n.end,n.start,n.end,new e(u,0,0),a.length,!0));var c=0;for(var _t4=0;_t4<a.length;_t4++)a[_t4].type==o&&(c=_t4+1);var g=a.length-c,d=n.start+a.length-(i?2:0),f=n.parent;for(var _t5=n.startIndex,_e2=n.endIndex,_l=!0;_t5<_e2;_t5++,_l=!1)!_l&&s(r.doc,d,g)&&(r.split(d,g),d+=2*g),d+=f.child(_t5).nodeSize;}(n,a,f,c,o);return!0;}(f,d,n,a)&&(u&&u(f.scrollIntoView()),!0);};}function k(t,r){return function(n,a){var _n$selection=n.selection,i=_n$selection.$from,u=_n$selection.$to,c=_n$selection.node;if(c&&c.isBlock||i.depth<2||!i.sameParent(u))return!1;var g=i.node(-1);if(g.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(a){var _r=l.empty,_s=i.index(-1)?1:i.index(-2)?2:3;for(var _t6=i.depth-_s;_t6>=i.depth-3;_t6--)_r=l.from(i.node(_t6).copy(_r));var _u=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;_r=_r.append(l.from(t.createAndFill()));var _c=i.before(i.depth-(_s-1)),_g=n.tr.replace(_c,i.after(-_u),new e(_r,4-_s,0)),_d=-1;_g.doc.nodesBetween(_c,_g.doc.content.size,function(t,e){if(_d>-1)return!1;t.isTextblock&&0==t.content.size&&(_d=e+1);}),_d>-1&&_g.setSelection(o.near(_g.doc.resolve(_d))),a(_g.scrollIntoView());}return!0;}var d=u.pos==i.end()?g.contentMatchAt(0).defaultType:null,f=n.tr["delete"](i.pos,u.pos),p=d?[r?{type:t,attrs:r}:null,{type:d}]:void 0;return!!s(f.doc,i.pos,2,p)&&(a&&a(f.split(i.pos,2,p).scrollIntoView()),!0);};}function w(i){return function(s,o){var _s$selection=s.selection,u=_s$selection.$from,c=_s$selection.$to,g=u.blockRange(c,function(t){return t.childCount>0&&t.firstChild.type==i;});return!!g&&(!o||(u.node(g.depth-1).type==i?function(i,s,o,u){var c=i.tr,g=u.end,d=u.$to.end(u.depth);g<d&&(c.step(new t(g-1,d,g,d,new e(l.from(o.create(null,u.parent.copy())),1,0),1,!0)),u=new r(c.doc.resolve(u.$from.pos),c.doc.resolve(d),u.depth));var f=n(u);if(null==f)return!1;c.lift(u,f);var p=c.doc.resolve(c.mapping.map(g,-1)-1);a(c.doc,p.pos)&&p.nodeBefore.type==p.nodeAfter.type&&c.join(p.pos);return s(c.scrollIntoView()),!0;}(s,o,i,g):function(r,n,a){var i=r.tr,s=a.parent;for(var _t7=a.end,_e3=a.endIndex-1,_l2=a.startIndex;_e3>_l2;_e3--)_t7-=s.child(_e3).nodeSize,i["delete"](_t7-1,_t7+1);var o=i.doc.resolve(a.start),u=o.nodeAfter;if(i.mapping.map(a.end)!=a.start+o.nodeAfter.nodeSize)return!1;var c=0==a.startIndex,g=a.endIndex==s.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(c?0:1),f+1,u.content.append(g?l.empty:l.from(s))))return!1;var p=o.pos,m=p+u.nodeSize;return i.step(new t(p-(c?1:0),m+(g?1:0),p+1,m-1,new e((c?l.empty:l.from(s.copy(l.empty))).append(g?l.empty:l.from(s.copy(l.empty))),c?0:1,g?0:1),c?0:1)),n(i.scrollIntoView()),!0;}(s,o,g)));};}function _(r){return function(n,a){var _n$selection2=n.selection,i=_n$selection2.$from,s=_n$selection2.$to,o=i.blockRange(s,function(t){return t.childCount>0&&t.firstChild.type==r;});if(!o)return!1;var u=o.startIndex;if(0==u)return!1;var c=o.parent,g=c.child(u-1);if(g.type!=r)return!1;if(a){var _i=g.lastChild&&g.lastChild.type==c.type,_s2=l.from(_i?r.create():null),_u2=new e(l.from(r.create(null,l.from(c.type.create(null,_s2)))),_i?3:1,0),_d2=o.start,_f=o.end;a(n.tr.step(new t(_d2-(_i?3:1),_f,_d2,_f,_u2,1,!0)).scrollIntoView());}return!0;};}function $(t){var e=t.style.textAlign||t.getAttribute("align")||"";return A.includes(e)?e:null;}function v(t){var e=t.style.marginInlineStart||t.style.marginLeft||"",l=parseFloat(e);return!Number.isFinite(l)||l<=0?0:Math.min(8,Math.round(l/40));}function j(t){var e=t.style.lineHeight.trim();if(!e||"normal"===e)return null;var l=parseFloat(e);return!Number.isFinite(l)||l<=0?null:e.endsWith("%")?String(l/100):e;}function N(t){var _t$align;var e=[],l=function(t){return t?"text-align: ".concat(t):null;}((_t$align=t.align)!==null&&_t$align!==void 0?_t$align:null);return l&&e.push(l),t.indent&&e.push("margin-inline-start: ".concat(40*t.indent,"px")),t.lineHeight&&e.push("line-height: ".concat(t.lineHeight)),e.length?e.join("; "):null;}function I(t){if(!t)return null;var e=t.split(/\s+/).filter(function(t){return t&&!F.test(t);});return e.length?e.join(" "):null;}function z(t){return t&&!F.test(t)?t:null;}function C(t){return{htmlClass:I(t.getAttribute("class")),htmlId:z(t.getAttribute("id"))};}function S(t){if(!("tag"in t)||"style"in t)return t;var e=t.getAttrs;return _objectSpread(_objectSpread({},t),{},{getAttrs:function getAttrs(t){var l=e?e(t):null;return!1!==l&&_objectSpread(_objectSpread({},l!==null&&l!==void 0?l:{}),C(t));}});}function H(t){var _t$attrs,_t$parseDOM;return _objectSpread(_objectSpread({},t),{},{attrs:_objectSpread(_objectSpread({},(_t$attrs=t.attrs)!==null&&_t$attrs!==void 0?_t$attrs:{}),q),parseDOM:(_t$parseDOM=t.parseDOM)===null||_t$parseDOM===void 0?void 0:_t$parseDOM.map(S),toDOM:(e=t.toDOM,e?function(t){for(var _len=arguments.length,l=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){l[_key-1]=arguments[_key];}var r=e.apply(void 0,[t].concat(l)),n=t.attrs.htmlClass,a=t.attrs.htmlId;if(!Array.isArray(r)||!n&&!a)return r;var _r2=_toArray(r),i=_r2[0],s=_r2.slice(1);var o={},u=s;return s.length&&s[0]&&"object"==_typeof(s[0])&&!Array.isArray(s[0])&&(o=_objectSpread({},s[0]),u=s.slice(1)),n&&(o["class"]=o["class"]?"".concat(o["class"]," ").concat(n):n),a&&(o.id=a),[i,o].concat(_toConsumableArray(u));}:e)});var e;}_export({a:_,l:w,s:k,w:D});return{setters:[function(_index00aCjsJs){t=_index00aCjsJs.R;e=_index00aCjsJs.d;l=_index00aCjsJs.F;r=_index00aCjsJs.h;n=_index00aCjsJs.l;a=_index00aCjsJs.g;i=_index00aCjsJs.f;s=_index00aCjsJs.i;o=_index00aCjsJs.S;u=_index00aCjsJs.O;c=_index00aCjsJs.j;},function(_index001CjsJs){g=_index001CjsJs.a;},function(_pluginsEmbedsCjsJs){d=_pluginsEmbedsCjsJs.E;f=_pluginsEmbedsCjsJs.a;},function(_index009CjsJs){},function(_index007CjsJs){}],execute:function execute(){p=["ol",0],m=["ul",0],b=["li",0],y={attrs:{order:{"default":1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1};}}],toDOM:function toDOM(t){return 1==t.attrs.order?p:["ol",{start:t.attrs.order},0];}},h={parseDOM:[{tag:"ul"}],toDOM:function toDOM(){return m;}},M={parseDOM:[{tag:"li"}],toDOM:function toDOM(){return b;},defining:!0};A=["left","center","right","justify"];_export("b",x=8);F=/^(?:nile-wysiwyg|ProseMirror)/;q={htmlClass:{"default":null},htmlId:{"default":null}};E=["paragraph","heading","blockquote","code_block","bullet_list","ordered_list","list_item","table","table_row","table_cell","table_header"],B=["link","bold","italic","underline","strike","code","subscript","superscript"],G={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[{tag:"p",getAttrs:function getAttrs(t){return{align:$(t),indent:v(t),lineHeight:j(t)};}}],toDOM:function toDOM(t){var e=N(t.attrs);return e?["p",{style:e},0]:["p",0];}},heading:{content:"inline*",group:"block",defining:!0,attrs:{level:{"default":1},align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[1,2,3,4,5,6].map(function(t){return{tag:"h".concat(t),getAttrs:function getAttrs(e){return{level:t,align:$(e),indent:v(e),lineHeight:j(e)};}};}),toDOM:function toDOM(t){var e=N(t.attrs);return e?["h".concat(t.attrs.level),{style:e},0]:["h".concat(t.attrs.level),0];}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function toDOM(){return["blockquote",0];}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function toDOM(){return["hr"];}},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function toDOM(){return["br"];}},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,attrs:{language:{"default":null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function getAttrs(t){return{language:t.getAttribute("data-language")};}}],toDOM:function toDOM(t){var e={"class":"nile-wysiwyg__code-block"};return t.attrs.language&&(e["data-language"]=t.attrs.language),["pre",e,["code",0]];}},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null}},parseDOM:[{tag:"img[src]",getAttrs:function getAttrs(t){var _t$getAttribute;var e=parseFloat(t.style.width),l=parseFloat((_t$getAttribute=t.getAttribute("width"))!==null&&_t$getAttribute!==void 0?_t$getAttribute:""),r=Number.isFinite(e)?Math.round(e):Number.isFinite(l)?Math.round(l):null;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:r&&r>0?r:null};}}],toDOM:function toDOM(t){var _t$attrs2=t.attrs,e=_t$attrs2.src,l=_t$attrs2.alt,r=_t$attrs2.title,n=_t$attrs2.width,a={src:e};return l&&(a.alt=l),r&&(a.title=r),n&&(a.style="width: ".concat(n,"px")),["img",a];}},figure:{group:"block",content:"inline*",defining:!0,isolating:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"figure",contentElement:"figcaption",getAttrs:function getAttrs(t){var e=t.querySelector("img[src]");if(!e)return!1;var l=parseFloat(e.style.width||t.style.width),r=t.getAttribute("data-align");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:Number.isFinite(l)&&l>0?Math.round(l):null,align:"left"===r||"center"===r||"right"===r?r:null};}}],toDOM:function toDOM(t){var _t$attrs3=t.attrs,e=_t$attrs3.src,l=_t$attrs3.alt,r=_t$attrs3.title,n=_t$attrs3.width,a=_t$attrs3.align,i={"class":"nile-wysiwyg__figure"};a&&(i["data-align"]=a);var s=[];n&&s.push("width: ".concat(n,"px")),"center"===a?s.push("margin-left: auto; margin-right: auto"):"right"===a&&s.push("margin-left: auto; margin-right: 0"),s.length&&(i.style=s.join("; "));var o={src:e,style:"width: 100%"};return l&&(o.alt=l),r&&(o.title=r),["figure",i,["img",o],["figcaption",{"class":"nile-wysiwyg__figcaption"},0]];}},task_list:{content:"task_item+",group:"block",parseDOM:[{tag:"ul[data-task-list]",priority:51}],toDOM:function toDOM(){return["ul",{"data-task-list":"true","class":"nile-wysiwyg__task-list"},0];}},task_item:{content:"paragraph block*",defining:!0,attrs:{checked:{"default":!1}},parseDOM:[{tag:"li[data-task-item]",priority:51,getAttrs:function getAttrs(t){return{checked:"true"===t.getAttribute("data-checked")};}}],toDOM:function toDOM(t){return["li",{"data-task-item":"true","data-checked":String(t.attrs.checked),"class":"nile-wysiwyg__task-item"},0];}},embed:{group:"block",atom:!0,selectable:!0,draggable:!0,attrs:{src:{},provider:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"div[data-embed-provider]",getAttrs:function getAttrs(t){var _t$getAttribute2,_exec;var e=t.querySelector("iframe[src]");if(!e)return!1;var l=(_t$getAttribute2=t.getAttribute("data-width"))!==null&&_t$getAttribute2!==void 0?_t$getAttribute2:(_exec=/^(\d+)px$/.exec(t.style.width))===null||_exec===void 0?void 0:_exec[1],r=l?parseInt(l,10):NaN,n=t.getAttribute("data-align");return{src:e.getAttribute("src"),provider:t.getAttribute("data-embed-provider"),title:e.getAttribute("title"),width:Number.isFinite(r)&&r>0?r:null,align:"left"===n||"center"===n||"right"===n?n:null};}},{tag:"iframe[src]",getAttrs:function getAttrs(t){var _t$getAttribute3;var e=parseInt((_t$getAttribute3=t.getAttribute("width"))!==null&&_t$getAttribute3!==void 0?_t$getAttribute3:"",10);return{src:t.getAttribute("src"),title:t.getAttribute("title"),width:Number.isFinite(e)&&e>0?e:null};}}],toDOM:function toDOM(t){var _t$attrs4=t.attrs,e=_t$attrs4.src,l=_t$attrs4.provider,r=_t$attrs4.title,n=_t$attrs4.width,a=_t$attrs4.align,i={src:e,frameborder:"0",allowfullscreen:"true",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",sandbox:d,referrerpolicy:f};r&&(i.title=r);var s={"class":"nile-wysiwyg__embed","data-embed-provider":l!==null&&l!==void 0?l:"generic"},o=[];return n&&(s["data-width"]=String(n),o.push("width: ".concat(n,"px"),"max-width: 100%")),a&&(s["data-align"]=a,"center"===a?o.push("margin-left: auto","margin-right: auto"):"right"===a&&o.push("margin-left: auto","margin-right: 0")),o.length&&(s.style=o.join("; ")),["div",s,["iframe",i]];}},styleBlock:{group:"block",atom:!0,selectable:!0,attrs:{css:{"default":""}},parseDOM:[{tag:"style",getAttrs:function getAttrs(t){var _t$textContent;return{css:(_t$textContent=t.textContent)!==null&&_t$textContent!==void 0?_t$textContent:""};}}],toDOM:function toDOM(t){return["style",t.attrs.css];}},bookmark:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{}},parseDOM:[{tag:"a[data-bookmark]",priority:60,getAttrs:function getAttrs(t){var e=t.getAttribute("id")||t.getAttribute("name");return!!e&&{id:e};}},{tag:"a[id]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("id")};}},{tag:"a[name]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("name")};}}],toDOM:function toDOM(t){return["a",{id:t.attrs.id,"data-bookmark":"true"}];}},mention:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{trigger:{"default":"@"},key:{},label:{}},parseDOM:[{tag:"span[data-mention-key]",getAttrs:function getAttrs(t){var _t$textContent2;return{trigger:t.getAttribute("data-mention-trigger")||"@",key:t.getAttribute("data-mention-key"),label:t.getAttribute("data-mention-label")||((_t$textContent2=t.textContent)===null||_t$textContent2===void 0?void 0:_t$textContent2.slice(1))||""};}}],toDOM:function toDOM(t){var _t$attrs5=t.attrs,e=_t$attrs5.trigger,l=_t$attrs5.key,r=_t$attrs5.label;return["span",{"class":"nile-wysiwyg__mention","data-mention-trigger":e,"data-mention-key":l,"data-mention-label":r},"".concat(e).concat(r)];}},merge_field:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{},label:{"default":null}},parseDOM:[{tag:"span[data-merge-field]",getAttrs:function getAttrs(t){var e=t.getAttribute("data-merge-field");return!!e&&{id:e,label:t.getAttribute("data-merge-label")||t.textContent||null};}}],toDOM:function toDOM(t){var _t$attrs6=t.attrs,e=_t$attrs6.id,l=_t$attrs6.label;return["span",{"class":"nile-wysiwyg__merge-field","data-merge-field":e,"data-merge-label":l!==null&&l!==void 0?l:""},l||"{{".concat(e,"}}")];}},math:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{latex:{},display:{"default":"inline"}},parseDOM:[{tag:"span[data-math]",getAttrs:function getAttrs(t){return{latex:t.getAttribute("data-math")||t.textContent||"",display:"block"===t.getAttribute("data-math-display")?"block":"inline"};}}],toDOM:function toDOM(t){var _t$attrs7=t.attrs,e=_t$attrs7.latex,l=_t$attrs7.display;return["span",{"class":"nile-wysiwyg__math","data-math":e,"data-math-display":l},e];}}},P=g({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{"default":null,getFromDOM:function getFromDOM(t){return t.style.backgroundColor||null;},setDOMAttr:function setDOMAttr(t,e){t&&(e.style="".concat(e.style||"","background-color: ").concat(t,";"));}}}}),R=P.table,W=_objectSpread(_objectSpread({},R),{},{attrs:_objectSpread(_objectSpread({},(_R$attrs=R.attrs)!==null&&_R$attrs!==void 0?_R$attrs:{}),{},{layout:{"default":!1}}),parseDOM:[{tag:"table",getAttrs:function getAttrs(t){return{layout:"presentation"===t.getAttribute("role")||t.hasAttribute("data-layout")};}}],toDOM:function toDOM(t){return t.attrs.layout?["table",{role:"presentation","data-layout":"true"},["tbody",0]]:["table",["tbody",0]];}}),J={link:{attrs:{href:{},title:{"default":null},target:{"default":null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title"),target:t.getAttribute("target")};}}],toDOM:function toDOM(t){var _t$attrs8=t.attrs,e=_t$attrs8.href,l=_t$attrs8.title,r=_t$attrs8.target,n={href:e};return l&&(n.title=l),r&&(n.target=r,"_blank"===r&&(n.rel="noopener noreferrer")),["a",n,0];}},bold:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function getAttrs(t){return"normal"!==t.style.fontWeight&&null;}},{style:"font-weight",getAttrs:function getAttrs(t){return /^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null;}}],toDOM:function toDOM(){return["strong",0];}},italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:function toDOM(){return["em",0];}},underline:{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}}],toDOM:function toDOM(){return["u",0];}},strike:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}}],toDOM:function toDOM(){return["s",0];}},subscript:{excludes:"subscript superscript",parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:function toDOM(){return["sub",0];}},superscript:{excludes:"subscript superscript",parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:function toDOM(){return["sup",0];}},code:{parseDOM:[{tag:"code"}],toDOM:function toDOM(){return["code",{"class":"nile-wysiwyg__inline-code"},0];}},html_span:{attrs:{htmlClass:{"default":null},htmlId:{"default":null}},parseDOM:[{tag:"span",priority:5,getAttrs:function getAttrs(t){var e=I(t.getAttribute("class")),l=z(t.getAttribute("id"));return!(!e&&!l)&&{htmlClass:e,htmlId:l};}}],toDOM:function toDOM(t){var e={};return t.attrs.htmlClass&&(e["class"]=t.attrs.htmlClass),t.attrs.htmlId&&(e.id=t.attrs.htmlId),["span",e,0];}},text_color:{attrs:{color:{}},parseDOM:[{style:"color",getAttrs:function getAttrs(t){return!!t&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"color: ".concat(t.attrs.color)},0];}},bg_color:{attrs:{color:{}},parseDOM:[{style:"background-color",getAttrs:function getAttrs(t){return!(!t||"transparent"===t)&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"background-color: ".concat(t.attrs.color)},0];}},font_family:{attrs:{family:{}},parseDOM:[{style:"font-family",getAttrs:function getAttrs(t){return!!t&&{family:t};}}],toDOM:function toDOM(t){return["span",{style:"font-family: ".concat(t.attrs.family)},0];}},font_size:{attrs:{size:{}},parseDOM:[{style:"font-size",getAttrs:function getAttrs(t){return!!t&&{size:t};}}],toDOM:function toDOM(t){return["span",{style:"font-size: ".concat(t.attrs.size)},0];}}},K=["disc","circle","square"],L={1:"decimal",a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"},Q=Object.fromEntries(Object.entries(L).map(function(_ref){var _ref2=_slicedToArray(_ref,2),t=_ref2[0],e=_ref2[1];return[e,t];})),_export("M",T="multilevel"),U={content:"list_item+",group:"block",attrs:{style:{"default":null}},parseDOM:[{tag:"ul",getAttrs:function getAttrs(t){var e=t.style.listStyleType;return{style:K.includes(e)?e:null};}}],toDOM:function toDOM(t){return t.attrs.style?["ul",{style:"list-style-type: ".concat(t.attrs.style)},0]:["ul",0];}},V={content:"list_item+",group:"block",attrs:{order:{"default":1},style:{"default":null}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){var _t$getAttribute4,_L$e;var e=(_t$getAttribute4=t.getAttribute("type"))!==null&&_t$getAttribute4!==void 0?_t$getAttribute4:"",l=t.style.listStyleType,r=t.getAttribute("data-list-style")===T?T:(_L$e=L[e])!==null&&_L$e!==void 0?_L$e:Object.values(L).includes(l)?l:null,n=Number(t.getAttribute("start"));return{order:Number.isFinite(n)&&n>0?n:1,style:r};}}],toDOM:function toDOM(t){var e={};return 1!==t.attrs.order&&(e.start=String(t.attrs.order)),t.attrs.style===T?e["data-list-style"]=T:t.attrs.style&&Q[t.attrs.style]&&(e.type=Q[t.attrs.style]),["ol",e,0];}};_export("d",X=function(){var t=function(t,e,l){return t.append({ordered_list:O(y,{content:"list_item+",group:l}),bullet_list:O(h,{content:"list_item+",group:l}),list_item:O(M,{content:e})});}(u.from(G),"paragraph block*","block").update("bullet_list",U).update("ordered_list",V).append(P).update("table",W);for(var _i2=0,_E=E;_i2<_E.length;_i2++){var _e4=_E[_i2];var _l3=t.get(_e4);_l3&&(t=t.update(_e4,H(_l3)));}var e=u.from(J);for(var _i3=0,_B=B;_i3<_B.length;_i3++){var _t8=_B[_i3];var _l4=e.get(_t8);_l4&&(e=e.update(_t8,H(_l4)));}return new c({nodes:t,marks:e});}());}};});
|
|
1
|
+
System.register(["../../index-89c520e9.cjs.js","../../index-50880eb7.cjs.js","./plugins/embeds.cjs.js","../../index-6832c52b.cjs.js","../../index-178e1e57.cjs.js"],function(_export,_context){"use strict";var t,e,l,r,n,a,i,s,o,u,c,g,d,f,_R$attrs,p,m,b,y,h,M,A,x,F,q,E,B,G,P,R,W,J,K,L,Q,T,U,V,X;function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}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 _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}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 _toArray(r){return _arrayWithHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure 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 _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 _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithHoles(r){if(Array.isArray(r))return r;}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 _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 O(t,e){var l={};for(var _e in t)l[_e]=t[_e];for(var _t in e)l[_t]=e[_t];return l;}function D(n){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return function(o,u){var _o$selection=o.selection,c=_o$selection.$from,g=_o$selection.$to,d=c.blockRange(g);if(!d)return!1;var f=u?o.tr:null;return!!function(n,a,o){var u=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var c=!1,g=a,d=a.$from.doc;if(a.depth>=2&&a.$from.node(a.depth-1).type.compatibleContent(o)&&0==a.startIndex){if(0==a.$from.index(a.depth-1))return!1;var _t2=d.resolve(a.start-2);g=new r(_t2,_t2,a.depth),a.endIndex<a.parent.childCount&&(a=new r(a.$from,d.resolve(a.$to.end(a.depth)),a.depth)),c=!0;}var f=i(g,o,u,a);if(!f)return!1;n&&function(r,n,a,i,o){var u=l.empty;for(var _t3=a.length-1;_t3>=0;_t3--)u=l.from(a[_t3].type.create(a[_t3].attrs,u));r.step(new t(n.start-(i?2:0),n.end,n.start,n.end,new e(u,0,0),a.length,!0));var c=0;for(var _t4=0;_t4<a.length;_t4++)a[_t4].type==o&&(c=_t4+1);var g=a.length-c,d=n.start+a.length-(i?2:0),f=n.parent;for(var _t5=n.startIndex,_e2=n.endIndex,_l=!0;_t5<_e2;_t5++,_l=!1)!_l&&s(r.doc,d,g)&&(r.split(d,g),d+=2*g),d+=f.child(_t5).nodeSize;}(n,a,f,c,o);return!0;}(f,d,n,a)&&(u&&u(f.scrollIntoView()),!0);};}function k(t,r){return function(n,a){var _n$selection=n.selection,i=_n$selection.$from,u=_n$selection.$to,c=_n$selection.node;if(c&&c.isBlock||i.depth<2||!i.sameParent(u))return!1;var g=i.node(-1);if(g.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(a){var _r=l.empty,_s=i.index(-1)?1:i.index(-2)?2:3;for(var _t6=i.depth-_s;_t6>=i.depth-3;_t6--)_r=l.from(i.node(_t6).copy(_r));var _u=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;_r=_r.append(l.from(t.createAndFill()));var _c=i.before(i.depth-(_s-1)),_g=n.tr.replace(_c,i.after(-_u),new e(_r,4-_s,0)),_d=-1;_g.doc.nodesBetween(_c,_g.doc.content.size,function(t,e){if(_d>-1)return!1;t.isTextblock&&0==t.content.size&&(_d=e+1);}),_d>-1&&_g.setSelection(o.near(_g.doc.resolve(_d))),a(_g.scrollIntoView());}return!0;}var d=u.pos==i.end()?g.contentMatchAt(0).defaultType:null,f=n.tr["delete"](i.pos,u.pos),p=d?[r?{type:t,attrs:r}:null,{type:d}]:void 0;return!!s(f.doc,i.pos,2,p)&&(a&&a(f.split(i.pos,2,p).scrollIntoView()),!0);};}function w(i){return function(s,o){var _s$selection=s.selection,u=_s$selection.$from,c=_s$selection.$to,g=u.blockRange(c,function(t){return t.childCount>0&&t.firstChild.type==i;});return!!g&&(!o||(u.node(g.depth-1).type==i?function(i,s,o,u){var c=i.tr,g=u.end,d=u.$to.end(u.depth);g<d&&(c.step(new t(g-1,d,g,d,new e(l.from(o.create(null,u.parent.copy())),1,0),1,!0)),u=new r(c.doc.resolve(u.$from.pos),c.doc.resolve(d),u.depth));var f=n(u);if(null==f)return!1;c.lift(u,f);var p=c.doc.resolve(c.mapping.map(g,-1)-1);a(c.doc,p.pos)&&p.nodeBefore.type==p.nodeAfter.type&&c.join(p.pos);return s(c.scrollIntoView()),!0;}(s,o,i,g):function(r,n,a){var i=r.tr,s=a.parent;for(var _t7=a.end,_e3=a.endIndex-1,_l2=a.startIndex;_e3>_l2;_e3--)_t7-=s.child(_e3).nodeSize,i["delete"](_t7-1,_t7+1);var o=i.doc.resolve(a.start),u=o.nodeAfter;if(i.mapping.map(a.end)!=a.start+o.nodeAfter.nodeSize)return!1;var c=0==a.startIndex,g=a.endIndex==s.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(c?0:1),f+1,u.content.append(g?l.empty:l.from(s))))return!1;var p=o.pos,m=p+u.nodeSize;return i.step(new t(p-(c?1:0),m+(g?1:0),p+1,m-1,new e((c?l.empty:l.from(s.copy(l.empty))).append(g?l.empty:l.from(s.copy(l.empty))),c?0:1,g?0:1),c?0:1)),n(i.scrollIntoView()),!0;}(s,o,g)));};}function _(r){return function(n,a){var _n$selection2=n.selection,i=_n$selection2.$from,s=_n$selection2.$to,o=i.blockRange(s,function(t){return t.childCount>0&&t.firstChild.type==r;});if(!o)return!1;var u=o.startIndex;if(0==u)return!1;var c=o.parent,g=c.child(u-1);if(g.type!=r)return!1;if(a){var _i=g.lastChild&&g.lastChild.type==c.type,_s2=l.from(_i?r.create():null),_u2=new e(l.from(r.create(null,l.from(c.type.create(null,_s2)))),_i?3:1,0),_d2=o.start,_f=o.end;a(n.tr.step(new t(_d2-(_i?3:1),_f,_d2,_f,_u2,1,!0)).scrollIntoView());}return!0;};}function $(t){var e=t.style.textAlign||t.getAttribute("align")||"";return A.includes(e)?e:null;}function v(t){var e=t.style.marginInlineStart||t.style.marginLeft||"",l=parseFloat(e);return!Number.isFinite(l)||l<=0?0:Math.min(8,Math.round(l/40));}function j(t){var e=t.style.lineHeight.trim();if(!e||"normal"===e)return null;var l=parseFloat(e);return!Number.isFinite(l)||l<=0?null:e.endsWith("%")?String(l/100):e;}function N(t){var _t$align;var e=[],l=function(t){return t?"text-align: ".concat(t):null;}((_t$align=t.align)!==null&&_t$align!==void 0?_t$align:null);return l&&e.push(l),t.indent&&e.push("margin-inline-start: ".concat(40*t.indent,"px")),t.lineHeight&&e.push("line-height: ".concat(t.lineHeight)),e.length?e.join("; "):null;}function I(t){if(!t)return null;var e=t.split(/\s+/).filter(function(t){return t&&!F.test(t);});return e.length?e.join(" "):null;}function z(t){return t&&!F.test(t)?t:null;}function C(t){return{htmlClass:I(t.getAttribute("class")),htmlId:z(t.getAttribute("id"))};}function S(t){if(!("tag"in t)||"style"in t)return t;var e=t.getAttrs;return _objectSpread(_objectSpread({},t),{},{getAttrs:function getAttrs(t){var l=e?e(t):null;return!1!==l&&_objectSpread(_objectSpread({},l!==null&&l!==void 0?l:{}),C(t));}});}function H(t){var _t$attrs,_t$parseDOM;return _objectSpread(_objectSpread({},t),{},{attrs:_objectSpread(_objectSpread({},(_t$attrs=t.attrs)!==null&&_t$attrs!==void 0?_t$attrs:{}),q),parseDOM:(_t$parseDOM=t.parseDOM)===null||_t$parseDOM===void 0?void 0:_t$parseDOM.map(S),toDOM:(e=t.toDOM,e?function(t){for(var _len=arguments.length,l=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){l[_key-1]=arguments[_key];}var r=e.apply(void 0,[t].concat(l)),n=t.attrs.htmlClass,a=t.attrs.htmlId;if(!Array.isArray(r)||!n&&!a)return r;var _r2=_toArray(r),i=_r2[0],s=_r2.slice(1);var o={},u=s;return s.length&&s[0]&&"object"==_typeof(s[0])&&!Array.isArray(s[0])&&(o=_objectSpread({},s[0]),u=s.slice(1)),n&&(o["class"]=o["class"]?"".concat(o["class"]," ").concat(n):n),a&&(o.id=a),[i,o].concat(_toConsumableArray(u));}:e)});var e;}_export({a:_,l:w,s:k,w:D});return{setters:[function(_index00aCjsJs){t=_index00aCjsJs.R;e=_index00aCjsJs.d;l=_index00aCjsJs.F;r=_index00aCjsJs.h;n=_index00aCjsJs.l;a=_index00aCjsJs.g;i=_index00aCjsJs.f;s=_index00aCjsJs.i;o=_index00aCjsJs.S;u=_index00aCjsJs.O;c=_index00aCjsJs.j;},function(_index001CjsJs){g=_index001CjsJs.a;},function(_pluginsEmbedsCjsJs){d=_pluginsEmbedsCjsJs.E;f=_pluginsEmbedsCjsJs.a;},function(_index009CjsJs){},function(_index007CjsJs){}],execute:function execute(){p=["ol",0],m=["ul",0],b=["li",0],y={attrs:{order:{"default":1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1};}}],toDOM:function toDOM(t){return 1==t.attrs.order?p:["ol",{start:t.attrs.order},0];}},h={parseDOM:[{tag:"ul"}],toDOM:function toDOM(){return m;}},M={parseDOM:[{tag:"li"}],toDOM:function toDOM(){return b;},defining:!0};A=["left","center","right","justify"];_export("b",x=8);F=/^(?:nile-wysiwyg|ProseMirror)/;q={htmlClass:{"default":null},htmlId:{"default":null}};E=["paragraph","heading","blockquote","code_block","bullet_list","ordered_list","list_item","table","table_row","table_cell","table_header"],B=["link","bold","italic","underline","strike","code","subscript","superscript"],G={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[{tag:"p",getAttrs:function getAttrs(t){return{align:$(t),indent:v(t),lineHeight:j(t)};}}],toDOM:function toDOM(t){var e=N(t.attrs);return e?["p",{style:e},0]:["p",0];}},heading:{content:"inline*",group:"block",defining:!0,attrs:{level:{"default":1},align:{"default":null},indent:{"default":0},lineHeight:{"default":null}},parseDOM:[1,2,3,4,5,6].map(function(t){return{tag:"h".concat(t),getAttrs:function getAttrs(e){return{level:t,align:$(e),indent:v(e),lineHeight:j(e)};}};}),toDOM:function toDOM(t){var e=N(t.attrs);return e?["h".concat(t.attrs.level),{style:e},0]:["h".concat(t.attrs.level),0];}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function toDOM(){return["blockquote",0];}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function toDOM(){return["hr"];}},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function toDOM(){return["br"];}},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,attrs:{language:{"default":null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function getAttrs(t){return{language:t.getAttribute("data-language")};}}],toDOM:function toDOM(t){var e={"class":"nile-wysiwyg__code-block"};return t.attrs.language&&(e["data-language"]=t.attrs.language),["pre",e,["code",0]];}},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null}},parseDOM:[{tag:"img[src]",getAttrs:function getAttrs(t){var _t$getAttribute;var e=parseFloat(t.style.width),l=parseFloat((_t$getAttribute=t.getAttribute("width"))!==null&&_t$getAttribute!==void 0?_t$getAttribute:""),r=Number.isFinite(e)?Math.round(e):Number.isFinite(l)?Math.round(l):null;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:r&&r>0?r:null};}}],toDOM:function toDOM(t){var _t$attrs2=t.attrs,e=_t$attrs2.src,l=_t$attrs2.alt,r=_t$attrs2.title,n=_t$attrs2.width,a={src:e};return l&&(a.alt=l),r&&(a.title=r),n&&(a.style="width: ".concat(n,"px")),["img",a];}},figure:{group:"block",content:"inline*",defining:!0,isolating:!0,attrs:{src:{},alt:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"figure",contentElement:"figcaption",getAttrs:function getAttrs(t){var e=t.querySelector("img[src]");if(!e)return!1;var l=parseFloat(e.style.width||t.style.width),r=t.getAttribute("data-align");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:Number.isFinite(l)&&l>0?Math.round(l):null,align:"left"===r||"center"===r||"right"===r?r:null};}}],toDOM:function toDOM(t){var _t$attrs3=t.attrs,e=_t$attrs3.src,l=_t$attrs3.alt,r=_t$attrs3.title,n=_t$attrs3.width,a=_t$attrs3.align,i={"class":"nile-wysiwyg__figure"};a&&(i["data-align"]=a);var s=[];n&&s.push("width: ".concat(n,"px")),"center"===a?s.push("margin-left: auto; margin-right: auto"):"right"===a&&s.push("margin-left: auto; margin-right: 0"),s.length&&(i.style=s.join("; "));var o={src:e,style:"width: 100%"};return l&&(o.alt=l),r&&(o.title=r),["figure",i,["img",o],["figcaption",{"class":"nile-wysiwyg__figcaption"},0]];}},task_list:{content:"task_item+",group:"block",parseDOM:[{tag:"ul[data-task-list]",priority:51}],toDOM:function toDOM(){return["ul",{"data-task-list":"true","class":"nile-wysiwyg__task-list"},0];}},task_item:{content:"paragraph block*",defining:!0,attrs:{checked:{"default":!1}},parseDOM:[{tag:"li[data-task-item]",priority:51,getAttrs:function getAttrs(t){return{checked:"true"===t.getAttribute("data-checked")};}}],toDOM:function toDOM(t){return["li",{"data-task-item":"true","data-checked":String(t.attrs.checked),"class":"nile-wysiwyg__task-item"},0];}},embed:{group:"block",atom:!0,selectable:!0,draggable:!0,attrs:{src:{},provider:{"default":null},title:{"default":null},width:{"default":null},align:{"default":null}},parseDOM:[{tag:"div[data-embed-provider]",getAttrs:function getAttrs(t){var _t$getAttribute2,_exec;var e=t.querySelector("iframe[src]");if(!e)return!1;var l=(_t$getAttribute2=t.getAttribute("data-width"))!==null&&_t$getAttribute2!==void 0?_t$getAttribute2:(_exec=/^(\d+)px$/.exec(t.style.width))===null||_exec===void 0?void 0:_exec[1],r=l?parseInt(l,10):NaN,n=t.getAttribute("data-align");return{src:e.getAttribute("src"),provider:t.getAttribute("data-embed-provider"),title:e.getAttribute("title"),width:Number.isFinite(r)&&r>0?r:null,align:"left"===n||"center"===n||"right"===n?n:null};}},{tag:"iframe[src]",getAttrs:function getAttrs(t){var _t$getAttribute3;var e=parseInt((_t$getAttribute3=t.getAttribute("width"))!==null&&_t$getAttribute3!==void 0?_t$getAttribute3:"",10);return{src:t.getAttribute("src"),title:t.getAttribute("title"),width:Number.isFinite(e)&&e>0?e:null};}}],toDOM:function toDOM(t){var _t$attrs4=t.attrs,e=_t$attrs4.src,l=_t$attrs4.provider,r=_t$attrs4.title,n=_t$attrs4.width,a=_t$attrs4.align,i={src:e,frameborder:"0",allowfullscreen:"true",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",sandbox:d,referrerpolicy:f};r&&(i.title=r);var s={"class":"nile-wysiwyg__embed","data-embed-provider":l!==null&&l!==void 0?l:"generic"},o=[];return n&&(s["data-width"]=String(n),o.push("width: ".concat(n,"px"),"max-width: 100%")),a&&(s["data-align"]=a,"center"===a?o.push("margin-left: auto","margin-right: auto"):"right"===a&&o.push("margin-left: auto","margin-right: 0")),o.length&&(s.style=o.join("; ")),["div",s,["iframe",i]];}},styleBlock:{group:"block",atom:!0,selectable:!0,attrs:{css:{"default":""}},parseDOM:[{tag:"style",getAttrs:function getAttrs(t){var _t$textContent;return{css:(_t$textContent=t.textContent)!==null&&_t$textContent!==void 0?_t$textContent:""};}}],toDOM:function toDOM(t){return["style",t.attrs.css];}},bookmark:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{}},parseDOM:[{tag:"a[data-bookmark]",priority:60,getAttrs:function getAttrs(t){var e=t.getAttribute("id")||t.getAttribute("name");return!!e&&{id:e};}},{tag:"a[id]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("id")};}},{tag:"a[name]",getAttrs:function getAttrs(t){return!t.hasAttribute("href")&&{id:t.getAttribute("name")};}}],toDOM:function toDOM(t){return["a",{id:t.attrs.id,"data-bookmark":"true"}];}},mention:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{trigger:{"default":"@"},key:{},label:{}},parseDOM:[{tag:"span[data-mention-key]",getAttrs:function getAttrs(t){var _t$textContent2;return{trigger:t.getAttribute("data-mention-trigger")||"@",key:t.getAttribute("data-mention-key"),label:t.getAttribute("data-mention-label")||((_t$textContent2=t.textContent)===null||_t$textContent2===void 0?void 0:_t$textContent2.slice(1))||""};}}],toDOM:function toDOM(t){var _t$attrs5=t.attrs,e=_t$attrs5.trigger,l=_t$attrs5.key,r=_t$attrs5.label;return["span",{"class":"nile-wysiwyg__mention","data-mention-trigger":e,"data-mention-key":l,"data-mention-label":r},"".concat(e).concat(r)];}},merge_field:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{},label:{"default":null}},parseDOM:[{tag:"span[data-merge-field]",getAttrs:function getAttrs(t){var e=t.getAttribute("data-merge-field");return!!e&&{id:e,label:t.getAttribute("data-merge-label")||t.textContent||null};}}],toDOM:function toDOM(t){var _t$attrs6=t.attrs,e=_t$attrs6.id,l=_t$attrs6.label;return["span",{"class":"nile-wysiwyg__merge-field","data-merge-field":e,"data-merge-label":l!==null&&l!==void 0?l:""},l||"{{".concat(e,"}}")];}},math:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{latex:{},display:{"default":"inline"}},parseDOM:[{tag:"span[data-math]",getAttrs:function getAttrs(t){return{latex:t.getAttribute("data-math")||t.textContent||"",display:"block"===t.getAttribute("data-math-display")?"block":"inline"};}}],toDOM:function toDOM(t){var _t$attrs7=t.attrs,e=_t$attrs7.latex,l=_t$attrs7.display;return["span",{"class":"nile-wysiwyg__math","data-math":e,"data-math-display":l},e];}}},P=g({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{"default":null,getFromDOM:function getFromDOM(t){return t.style.backgroundColor||null;},setDOMAttr:function setDOMAttr(t,e){t&&(e.style="".concat(e.style||"","background-color: ").concat(t,";"));}}}}),R=P.table,W=_objectSpread(_objectSpread({},R),{},{attrs:_objectSpread(_objectSpread({},(_R$attrs=R.attrs)!==null&&_R$attrs!==void 0?_R$attrs:{}),{},{layout:{"default":!1}}),parseDOM:[{tag:"table",getAttrs:function getAttrs(t){return{layout:"presentation"===t.getAttribute("role")||t.hasAttribute("data-layout")};}}],toDOM:function toDOM(t){return t.attrs.layout?["table",{role:"presentation","data-layout":"true"},["tbody",0]]:["table",["tbody",0]];}}),J={link:{attrs:{href:{},title:{"default":null},target:{"default":null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function getAttrs(t){return{href:t.getAttribute("href"),title:t.getAttribute("title"),target:t.getAttribute("target")};}}],toDOM:function toDOM(t){var _t$attrs8=t.attrs,e=_t$attrs8.href,l=_t$attrs8.title,r=_t$attrs8.target,n={href:e};return l&&(n.title=l),r&&(n.target=r,"_blank"===r&&(n.rel="noopener noreferrer")),["a",n,0];}},bold:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function getAttrs(t){return"normal"!==t.style.fontWeight&&null;}},{style:"font-weight",getAttrs:function getAttrs(t){return /^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null;}}],toDOM:function toDOM(){return["strong",0];}},italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:function toDOM(){return["em",0];}},underline:{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("underline")&&null;}}],toDOM:function toDOM(){return["u",0];}},strike:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}},{style:"text-decoration-line",getAttrs:function getAttrs(t){return t.includes("line-through")&&null;}}],toDOM:function toDOM(){return["s",0];}},subscript:{excludes:"subscript superscript",parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:function toDOM(){return["sub",0];}},superscript:{excludes:"subscript superscript",parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:function toDOM(){return["sup",0];}},code:{parseDOM:[{tag:"code"}],toDOM:function toDOM(){return["code",{"class":"nile-wysiwyg__inline-code"},0];}},html_span:{attrs:{htmlClass:{"default":null},htmlId:{"default":null}},parseDOM:[{tag:"span",priority:5,getAttrs:function getAttrs(t){var e=I(t.getAttribute("class")),l=z(t.getAttribute("id"));return!(!e&&!l)&&{htmlClass:e,htmlId:l};}}],toDOM:function toDOM(t){var e={};return t.attrs.htmlClass&&(e["class"]=t.attrs.htmlClass),t.attrs.htmlId&&(e.id=t.attrs.htmlId),["span",e,0];}},text_color:{attrs:{color:{}},parseDOM:[{style:"color",getAttrs:function getAttrs(t){return!!t&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"color: ".concat(t.attrs.color)},0];}},bg_color:{attrs:{color:{}},parseDOM:[{style:"background-color",getAttrs:function getAttrs(t){return!(!t||"transparent"===t)&&{color:t};}}],toDOM:function toDOM(t){return["span",{style:"background-color: ".concat(t.attrs.color)},0];}},font_family:{attrs:{family:{}},parseDOM:[{style:"font-family",getAttrs:function getAttrs(t){return!!t&&{family:t};}}],toDOM:function toDOM(t){return["span",{style:"font-family: ".concat(t.attrs.family)},0];}},font_size:{attrs:{size:{}},parseDOM:[{style:"font-size",getAttrs:function getAttrs(t){return!!t&&{size:t};}}],toDOM:function toDOM(t){return["span",{style:"font-size: ".concat(t.attrs.size)},0];}}},K=["disc","circle","square"],L={1:"decimal",a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"},Q=Object.fromEntries(Object.entries(L).map(function(_ref){var _ref2=_slicedToArray(_ref,2),t=_ref2[0],e=_ref2[1];return[e,t];})),_export("M",T="multilevel"),U={content:"list_item+",group:"block",attrs:{style:{"default":null}},parseDOM:[{tag:"ul",getAttrs:function getAttrs(t){var e=t.style.listStyleType;return{style:K.includes(e)?e:null};}}],toDOM:function toDOM(t){return t.attrs.style?["ul",{style:"list-style-type: ".concat(t.attrs.style)},0]:["ul",0];}},V={content:"list_item+",group:"block",attrs:{order:{"default":1},style:{"default":null}},parseDOM:[{tag:"ol",getAttrs:function getAttrs(t){var _t$getAttribute4,_L$e;var e=(_t$getAttribute4=t.getAttribute("type"))!==null&&_t$getAttribute4!==void 0?_t$getAttribute4:"",l=t.style.listStyleType,r=t.getAttribute("data-list-style")===T?T:(_L$e=L[e])!==null&&_L$e!==void 0?_L$e:Object.values(L).includes(l)?l:null,n=Number(t.getAttribute("start"));return{order:Number.isFinite(n)&&n>0?n:1,style:r};}}],toDOM:function toDOM(t){var e={};return 1!==t.attrs.order&&(e.start=String(t.attrs.order)),t.attrs.style===T?e["data-list-style"]=T:t.attrs.style&&Q[t.attrs.style]&&(e.type=Q[t.attrs.style]),["ol",e,0];}};_export("d",X=function(){var t=function(t,e,l){return t.append({ordered_list:O(y,{content:"list_item+",group:l}),bullet_list:O(h,{content:"list_item+",group:l}),list_item:O(M,{content:e})});}(u.from(G),"paragraph block*","block").update("bullet_list",U).update("ordered_list",V).append(P).update("table",W);for(var _i2=0,_E=E;_i2<_E.length;_i2++){var _e4=_E[_i2];var _l3=t.get(_e4);_l3&&(t=t.update(_e4,H(_l3)));}var e=u.from(J);for(var _i3=0,_B=B;_i3<_B.length;_i3++){var _t8=_B[_i3];var _l4=e.get(_t8);_l4&&(e=e.update(_t8,H(_l4)));}return new c({nodes:t,marks:e});}());}};});
|
|
2
2
|
//# sourceMappingURL=schema.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as t,d as e,F as l,h as r,l as n,g as a,f as i,i as s,S as o,O as u,j as c}from"../../index-6f3fa4ab.esm.js";import{a as g}from"../../index-289706c7.esm.js";import{E as d,a as f}from"./plugins/embeds.esm.js";import"../../index-353172ed.esm.js";import"../../index-920675c4.esm.js";const p=["ol",0],m=["ul",0],b=["li",0],y={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?p:["ol",{start:t.attrs.order},0]},h={parseDOM:[{tag:"ul"}],toDOM:()=>m},M={parseDOM:[{tag:"li"}],toDOM:()=>b,defining:!0};function O(t,e){let l={};for(let e in t)l[e]=t[e];for(let t in e)l[t]=e[t];return l}function D(n,a=null){return function(o,u){let{$from:c,$to:g}=o.selection,d=c.blockRange(g);if(!d)return!1;let f=u?o.tr:null;return!!function(n,a,o,u=null){let c=!1,g=a,d=a.$from.doc;if(a.depth>=2&&a.$from.node(a.depth-1).type.compatibleContent(o)&&0==a.startIndex){if(0==a.$from.index(a.depth-1))return!1;let t=d.resolve(a.start-2);g=new r(t,t,a.depth),a.endIndex<a.parent.childCount&&(a=new r(a.$from,d.resolve(a.$to.end(a.depth)),a.depth)),c=!0}let f=i(g,o,u,a);if(!f)return!1;n&&function(r,n,a,i,o){let u=l.empty;for(let t=a.length-1;t>=0;t--)u=l.from(a[t].type.create(a[t].attrs,u));r.step(new t(n.start-(i?2:0),n.end,n.start,n.end,new e(u,0,0),a.length,!0));let c=0;for(let t=0;t<a.length;t++)a[t].type==o&&(c=t+1);let g=a.length-c,d=n.start+a.length-(i?2:0),f=n.parent;for(let t=n.startIndex,e=n.endIndex,l=!0;t<e;t++,l=!1)!l&&s(r.doc,d,g)&&(r.split(d,g),d+=2*g),d+=f.child(t).nodeSize}(n,a,f,c,o);return!0}(f,d,n,a)&&(u&&u(f.scrollIntoView()),!0)}}function k(t,r){return function(n,a){let{$from:i,$to:u,node:c}=n.selection;if(c&&c.isBlock||i.depth<2||!i.sameParent(u))return!1;let g=i.node(-1);if(g.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(a){let r=l.empty,s=i.index(-1)?1:i.index(-2)?2:3;for(let t=i.depth-s;t>=i.depth-3;t--)r=l.from(i.node(t).copy(r));let u=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;r=r.append(l.from(t.createAndFill()));let c=i.before(i.depth-(s-1)),g=n.tr.replace(c,i.after(-u),new e(r,4-s,0)),d=-1;g.doc.nodesBetween(c,g.doc.content.size,((t,e)=>{if(d>-1)return!1;t.isTextblock&&0==t.content.size&&(d=e+1)})),d>-1&&g.setSelection(o.near(g.doc.resolve(d))),a(g.scrollIntoView())}return!0}let d=u.pos==i.end()?g.contentMatchAt(0).defaultType:null,f=n.tr.delete(i.pos,u.pos),p=d?[r?{type:t,attrs:r}:null,{type:d}]:void 0;return!!s(f.doc,i.pos,2,p)&&(a&&a(f.split(i.pos,2,p).scrollIntoView()),!0)}}function w(i){return function(s,o){let{$from:u,$to:c}=s.selection,g=u.blockRange(c,(t=>t.childCount>0&&t.firstChild.type==i));return!!g&&(!o||(u.node(g.depth-1).type==i?function(i,s,o,u){let c=i.tr,g=u.end,d=u.$to.end(u.depth);g<d&&(c.step(new t(g-1,d,g,d,new e(l.from(o.create(null,u.parent.copy())),1,0),1,!0)),u=new r(c.doc.resolve(u.$from.pos),c.doc.resolve(d),u.depth));const f=n(u);if(null==f)return!1;c.lift(u,f);let p=c.doc.resolve(c.mapping.map(g,-1)-1);a(c.doc,p.pos)&&p.nodeBefore.type==p.nodeAfter.type&&c.join(p.pos);return s(c.scrollIntoView()),!0}(s,o,i,g):function(r,n,a){let i=r.tr,s=a.parent;for(let t=a.end,e=a.endIndex-1,l=a.startIndex;e>l;e--)t-=s.child(e).nodeSize,i.delete(t-1,t+1);let o=i.doc.resolve(a.start),u=o.nodeAfter;if(i.mapping.map(a.end)!=a.start+o.nodeAfter.nodeSize)return!1;let c=0==a.startIndex,g=a.endIndex==s.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(c?0:1),f+1,u.content.append(g?l.empty:l.from(s))))return!1;let p=o.pos,m=p+u.nodeSize;return i.step(new t(p-(c?1:0),m+(g?1:0),p+1,m-1,new e((c?l.empty:l.from(s.copy(l.empty))).append(g?l.empty:l.from(s.copy(l.empty))),c?0:1,g?0:1),c?0:1)),n(i.scrollIntoView()),!0}(s,o,g)))}}function _(r){return function(n,a){let{$from:i,$to:s}=n.selection,o=i.blockRange(s,(t=>t.childCount>0&&t.firstChild.type==r));if(!o)return!1;let u=o.startIndex;if(0==u)return!1;let c=o.parent,g=c.child(u-1);if(g.type!=r)return!1;if(a){let i=g.lastChild&&g.lastChild.type==c.type,s=l.from(i?r.create():null),u=new e(l.from(r.create(null,l.from(c.type.create(null,s)))),i?3:1,0),d=o.start,f=o.end;a(n.tr.step(new t(d-(i?3:1),f,d,f,u,1,!0)).scrollIntoView())}return!0}}const A=["left","center","right","justify"];function $(t){const e=t.style.textAlign||t.getAttribute("align")||"";return A.includes(e)?e:null}const x=8;function v(t){const e=t.style.marginInlineStart||t.style.marginLeft||"",l=parseFloat(e);return!Number.isFinite(l)||l<=0?0:Math.min(8,Math.round(l/40))}function j(t){const e=t.style.lineHeight.trim();if(!e||"normal"===e)return null;const l=parseFloat(e);return!Number.isFinite(l)||l<=0?null:e.endsWith("%")?String(l/100):e}function N(t){const e=[],l=function(t){return t?`text-align: ${t}`:null}(t.align??null);return l&&e.push(l),t.indent&&e.push(`margin-inline-start: ${40*t.indent}px`),t.lineHeight&&e.push(`line-height: ${t.lineHeight}`),e.length?e.join("; "):null}const F=/^(?:nile-wysiwyg|ProseMirror)/;function I(t){if(!t)return null;const e=t.split(/\s+/).filter((t=>t&&!F.test(t)));return e.length?e.join(" "):null}function z(t){return t&&!F.test(t)?t:null}const q={htmlClass:{default:null},htmlId:{default:null}};function C(t){return{htmlClass:I(t.getAttribute("class")),htmlId:z(t.getAttribute("id"))}}function S(t){if(!("tag"in t)||"style"in t)return t;const e=t.getAttrs;return{...t,getAttrs(t){const l=e?e(t):null;return!1!==l&&{...l??{},...C(t)}}}}function H(t){return{...t,attrs:{...t.attrs??{},...q},parseDOM:t.parseDOM?.map(S),toDOM:(e=t.toDOM,e?(t,...l)=>{const r=e(t,...l),n=t.attrs.htmlClass,a=t.attrs.htmlId;if(!Array.isArray(r)||!n&&!a)return r;const[i,...s]=r;let o={},u=s;return s.length&&s[0]&&"object"==typeof s[0]&&!Array.isArray(s[0])&&(o={...s[0]},u=s.slice(1)),n&&(o.class=o.class?`${o.class} ${n}`:n),a&&(o.id=a),[i,o,...u]}:e)};var e}const E=["paragraph","heading","blockquote","code_block","bullet_list","ordered_list","list_item","table","table_row","table_cell","table_header"],B=["link","bold","italic","underline","strike","code","subscript","superscript"],G={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:null},indent:{default:0},lineHeight:{default:null}},parseDOM:[{tag:"p",getAttrs:t=>({align:$(t),indent:v(t),lineHeight:j(t)})}],toDOM(t){const e=N(t.attrs);return e?["p",{style:e},0]:["p",0]}},heading:{content:"inline*",group:"block",defining:!0,attrs:{level:{default:1},align:{default:null},indent:{default:0},lineHeight:{default:null}},parseDOM:[1,2,3,4,5,6].map((t=>({tag:`h${t}`,getAttrs:e=>({level:t,align:$(e),indent:v(e),lineHeight:j(e)})}))),toDOM(t){const e=N(t.attrs);return e?[`h${t.attrs.level}`,{style:e},0]:[`h${t.attrs.level}`,0]}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,attrs:{language:{default:null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({language:t.getAttribute("data-language")})}],toDOM(t){const e={class:"nile-wysiwyg__code-block"};return t.attrs.language&&(e["data-language"]=t.attrs.language),["pre",e,["code",0]]}},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:t=>{const e=parseFloat(t.style.width),l=parseFloat(t.getAttribute("width")??""),r=Number.isFinite(e)?Math.round(e):Number.isFinite(l)?Math.round(l):null;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:r&&r>0?r:null}}}],toDOM(t){const{src:e,alt:l,title:r,width:n}=t.attrs,a={src:e};return l&&(a.alt=l),r&&(a.title=r),n&&(a.style=`width: ${n}px`),["img",a]}},figure:{group:"block",content:"inline*",defining:!0,isolating:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null},align:{default:null}},parseDOM:[{tag:"figure",contentElement:"figcaption",getAttrs:t=>{const e=t.querySelector("img[src]");if(!e)return!1;const l=parseFloat(e.style.width||t.style.width),r=t.getAttribute("data-align");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:Number.isFinite(l)&&l>0?Math.round(l):null,align:"left"===r||"center"===r||"right"===r?r:null}}}],toDOM(t){const{src:e,alt:l,title:r,width:n,align:a}=t.attrs,i={class:"nile-wysiwyg__figure"};a&&(i["data-align"]=a);const s=[];n&&s.push(`width: ${n}px`),"center"===a?s.push("margin-left: auto; margin-right: auto"):"right"===a&&s.push("margin-left: auto; margin-right: 0"),s.length&&(i.style=s.join("; "));const o={src:e,style:"width: 100%"};return l&&(o.alt=l),r&&(o.title=r),["figure",i,["img",o],["figcaption",{class:"nile-wysiwyg__figcaption"},0]]}},task_list:{content:"task_item+",group:"block",parseDOM:[{tag:"ul[data-task-list]",priority:51}],toDOM:()=>["ul",{"data-task-list":"true",class:"nile-wysiwyg__task-list"},0]},task_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:!1}},parseDOM:[{tag:"li[data-task-item]",priority:51,getAttrs:t=>({checked:"true"===t.getAttribute("data-checked")})}],toDOM:t=>["li",{"data-task-item":"true","data-checked":String(t.attrs.checked),class:"nile-wysiwyg__task-item"},0]},embed:{group:"block",atom:!0,selectable:!0,draggable:!0,attrs:{src:{},provider:{default:null},title:{default:null},width:{default:null},align:{default:null}},parseDOM:[{tag:"div[data-embed-provider]",getAttrs:t=>{const e=t.querySelector("iframe[src]");if(!e)return!1;const l=t.getAttribute("data-width")??/^(\d+)px$/.exec(t.style.width)?.[1],r=l?parseInt(l,10):NaN,n=t.getAttribute("data-align");return{src:e.getAttribute("src"),provider:t.getAttribute("data-embed-provider"),title:e.getAttribute("title"),width:Number.isFinite(r)&&r>0?r:null,align:"left"===n||"center"===n||"right"===n?n:null}}},{tag:"iframe[src]",getAttrs:t=>{const e=parseInt(t.getAttribute("width")??"",10);return{src:t.getAttribute("src"),title:t.getAttribute("title"),width:Number.isFinite(e)&&e>0?e:null}}}],toDOM(t){const{src:e,provider:l,title:r,width:n,align:a}=t.attrs,i={src:e,frameborder:"0",allowfullscreen:"true",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",sandbox:d,referrerpolicy:f};r&&(i.title=r);const s={class:"nile-wysiwyg__embed","data-embed-provider":l??"generic"},o=[];return n&&(s["data-width"]=String(n),o.push(`width: ${n}px`,"max-width: 100%")),a&&(s["data-align"]=a,"center"===a?o.push("margin-left: auto","margin-right: auto"):"right"===a&&o.push("margin-left: auto","margin-right: 0")),o.length&&(s.style=o.join("; ")),["div",s,["iframe",i]]}},styleBlock:{group:"block",atom:!0,selectable:!0,attrs:{css:{default:""}},parseDOM:[{tag:"style",getAttrs:t=>({css:t.textContent??""})}],toDOM:t=>["style",t.attrs.css]},bookmark:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{}},parseDOM:[{tag:"a[data-bookmark]",priority:60,getAttrs:t=>{const e=t.getAttribute("id")||t.getAttribute("name");return!!e&&{id:e}}},{tag:"a[id]",getAttrs:t=>!t.hasAttribute("href")&&{id:t.getAttribute("id")}},{tag:"a[name]",getAttrs:t=>!t.hasAttribute("href")&&{id:t.getAttribute("name")}}],toDOM:t=>["a",{id:t.attrs.id,"data-bookmark":"true"}]},mention:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{trigger:{default:"@"},key:{},label:{}},parseDOM:[{tag:"span[data-mention-key]",getAttrs:t=>({trigger:t.getAttribute("data-mention-trigger")||"@",key:t.getAttribute("data-mention-key"),label:t.getAttribute("data-mention-label")||t.textContent?.slice(1)||""})}],toDOM(t){const{trigger:e,key:l,label:r}=t.attrs;return["span",{class:"nile-wysiwyg__mention","data-mention-trigger":e,"data-mention-key":l,"data-mention-label":r},`${e}${r}`]}},merge_field:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{},label:{default:null}},parseDOM:[{tag:"span[data-merge-field]",getAttrs:t=>{const e=t.getAttribute("data-merge-field");return!!e&&{id:e,label:t.getAttribute("data-merge-label")||t.textContent||null}}}],toDOM(t){const{id:e,label:l}=t.attrs;return["span",{class:"nile-wysiwyg__merge-field","data-merge-field":e,"data-merge-label":l??""},l||`{{${e}}}`]}},math:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{latex:{},display:{default:"inline"}},parseDOM:[{tag:"span[data-math]",getAttrs:t=>({latex:t.getAttribute("data-math")||t.textContent||"",display:"block"===t.getAttribute("data-math-display")?"block":"inline"})}],toDOM(t){const{latex:e,display:l}=t.attrs;return["span",{class:"nile-wysiwyg__math","data-math":e,"data-math-display":l},e]}}},P=g({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:t=>t.style.backgroundColor||null,setDOMAttr(t,e){t&&(e.style=`${e.style||""}background-color: ${t};`)}}}}),R=P.table,W={...R,attrs:{...R.attrs??{},layout:{default:!1}},parseDOM:[{tag:"table",getAttrs:t=>({layout:"presentation"===t.getAttribute("role")||t.hasAttribute("data-layout")})}],toDOM:t=>t.attrs.layout?["table",{role:"presentation","data-layout":"true"},["tbody",0]]:["table",["tbody",0]]},J={link:{attrs:{href:{},title:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:t=>({href:t.getAttribute("href"),title:t.getAttribute("title"),target:t.getAttribute("target")})}],toDOM(t){const{href:e,title:l,target:r}=t.attrs,n={href:e};return l&&(n.title=l),r&&(n.target=r,"_blank"===r&&(n.rel="noopener noreferrer")),["a",n,0]}},bold:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]},italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},underline:{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>t.includes("underline")&&null},{style:"text-decoration-line",getAttrs:t=>t.includes("underline")&&null}],toDOM:()=>["u",0]},strike:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>t.includes("line-through")&&null},{style:"text-decoration-line",getAttrs:t=>t.includes("line-through")&&null}],toDOM:()=>["s",0]},subscript:{excludes:"subscript superscript",parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:()=>["sub",0]},superscript:{excludes:"subscript superscript",parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:()=>["sup",0]},code:{parseDOM:[{tag:"code"}],toDOM:()=>["code",{class:"nile-wysiwyg__inline-code"},0]},html_span:{attrs:{htmlClass:{default:null},htmlId:{default:null}},parseDOM:[{tag:"span",priority:5,getAttrs:t=>{const e=I(t.getAttribute("class")),l=z(t.getAttribute("id"));return!(!e&&!l)&&{htmlClass:e,htmlId:l}}}],toDOM(t){const e={};return t.attrs.htmlClass&&(e.class=t.attrs.htmlClass),t.attrs.htmlId&&(e.id=t.attrs.htmlId),["span",e,0]}},text_color:{attrs:{color:{}},parseDOM:[{style:"color",getAttrs:t=>!!t&&{color:t}}],toDOM:t=>["span",{style:`color: ${t.attrs.color}`},0]},bg_color:{attrs:{color:{}},parseDOM:[{style:"background-color",getAttrs:t=>!(!t||"transparent"===t)&&{color:t}}],toDOM:t=>["span",{style:`background-color: ${t.attrs.color}`},0]},font_family:{attrs:{family:{}},parseDOM:[{style:"font-family",getAttrs:t=>!!t&&{family:t}}],toDOM:t=>["span",{style:`font-family: ${t.attrs.family}`},0]},font_size:{attrs:{size:{}},parseDOM:[{style:"font-size",getAttrs:t=>!!t&&{size:t}}],toDOM:t=>["span",{style:`font-size: ${t.attrs.size}`},0]}},K=["disc","circle","square"],L={1:"decimal",a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"},Q=Object.fromEntries(Object.entries(L).map((([t,e])=>[e,t]))),T="multilevel",U={content:"list_item+",group:"block",attrs:{style:{default:null}},parseDOM:[{tag:"ul",getAttrs:t=>{const e=t.style.listStyleType;return{style:K.includes(e)?e:null}}}],toDOM:t=>t.attrs.style?["ul",{style:`list-style-type: ${t.attrs.style}`},0]:["ul",0]},V={content:"list_item+",group:"block",attrs:{order:{default:1},style:{default:null}},parseDOM:[{tag:"ol",getAttrs:t=>{const e=t.getAttribute("type")??"",l=t.style.listStyleType,r=t.getAttribute("data-list-style")===T?T:L[e]??(Object.values(L).includes(l)?l:null),n=Number(t.getAttribute("start"));return{order:Number.isFinite(n)&&n>0?n:1,style:r}}}],toDOM(t){const e={};return 1!==t.attrs.order&&(e.start=String(t.attrs.order)),t.attrs.style===T?e["data-list-style"]=T:t.attrs.style&&Q[t.attrs.style]&&(e.type=Q[t.attrs.style]),["ol",e,0]}};const X=function(){let t=function(t,e,l){return t.append({ordered_list:O(y,{content:"list_item+",group:l}),bullet_list:O(h,{content:"list_item+",group:l}),list_item:O(M,{content:e})})}(u.from(G),"paragraph block*","block").update("bullet_list",U).update("ordered_list",V).append(P).update("table",W);for(const e of E){const l=t.get(e);l&&(t=t.update(e,H(l)))}let e=u.from(J);for(const t of B){const l=e.get(t);l&&(e=e.update(t,H(l)))}return new c({nodes:t,marks:e})}();export{T as M,_ as a,x as b,X as d,w as l,k as s,D as w};
|
|
1
|
+
import{R as t,d as e,F as l,h as r,l as n,g as a,f as i,i as s,S as o,O as u,j as c}from"../../index-6f3fa4ab.esm.js";import{a as g}from"../../index-7b1c9857.esm.js";import{E as d,a as f}from"./plugins/embeds.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";const p=["ol",0],m=["ul",0],b=["li",0],y={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1})}],toDOM:t=>1==t.attrs.order?p:["ol",{start:t.attrs.order},0]},h={parseDOM:[{tag:"ul"}],toDOM:()=>m},M={parseDOM:[{tag:"li"}],toDOM:()=>b,defining:!0};function O(t,e){let l={};for(let e in t)l[e]=t[e];for(let t in e)l[t]=e[t];return l}function D(n,a=null){return function(o,u){let{$from:c,$to:g}=o.selection,d=c.blockRange(g);if(!d)return!1;let f=u?o.tr:null;return!!function(n,a,o,u=null){let c=!1,g=a,d=a.$from.doc;if(a.depth>=2&&a.$from.node(a.depth-1).type.compatibleContent(o)&&0==a.startIndex){if(0==a.$from.index(a.depth-1))return!1;let t=d.resolve(a.start-2);g=new r(t,t,a.depth),a.endIndex<a.parent.childCount&&(a=new r(a.$from,d.resolve(a.$to.end(a.depth)),a.depth)),c=!0}let f=i(g,o,u,a);if(!f)return!1;n&&function(r,n,a,i,o){let u=l.empty;for(let t=a.length-1;t>=0;t--)u=l.from(a[t].type.create(a[t].attrs,u));r.step(new t(n.start-(i?2:0),n.end,n.start,n.end,new e(u,0,0),a.length,!0));let c=0;for(let t=0;t<a.length;t++)a[t].type==o&&(c=t+1);let g=a.length-c,d=n.start+a.length-(i?2:0),f=n.parent;for(let t=n.startIndex,e=n.endIndex,l=!0;t<e;t++,l=!1)!l&&s(r.doc,d,g)&&(r.split(d,g),d+=2*g),d+=f.child(t).nodeSize}(n,a,f,c,o);return!0}(f,d,n,a)&&(u&&u(f.scrollIntoView()),!0)}}function k(t,r){return function(n,a){let{$from:i,$to:u,node:c}=n.selection;if(c&&c.isBlock||i.depth<2||!i.sameParent(u))return!1;let g=i.node(-1);if(g.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(a){let r=l.empty,s=i.index(-1)?1:i.index(-2)?2:3;for(let t=i.depth-s;t>=i.depth-3;t--)r=l.from(i.node(t).copy(r));let u=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;r=r.append(l.from(t.createAndFill()));let c=i.before(i.depth-(s-1)),g=n.tr.replace(c,i.after(-u),new e(r,4-s,0)),d=-1;g.doc.nodesBetween(c,g.doc.content.size,((t,e)=>{if(d>-1)return!1;t.isTextblock&&0==t.content.size&&(d=e+1)})),d>-1&&g.setSelection(o.near(g.doc.resolve(d))),a(g.scrollIntoView())}return!0}let d=u.pos==i.end()?g.contentMatchAt(0).defaultType:null,f=n.tr.delete(i.pos,u.pos),p=d?[r?{type:t,attrs:r}:null,{type:d}]:void 0;return!!s(f.doc,i.pos,2,p)&&(a&&a(f.split(i.pos,2,p).scrollIntoView()),!0)}}function w(i){return function(s,o){let{$from:u,$to:c}=s.selection,g=u.blockRange(c,(t=>t.childCount>0&&t.firstChild.type==i));return!!g&&(!o||(u.node(g.depth-1).type==i?function(i,s,o,u){let c=i.tr,g=u.end,d=u.$to.end(u.depth);g<d&&(c.step(new t(g-1,d,g,d,new e(l.from(o.create(null,u.parent.copy())),1,0),1,!0)),u=new r(c.doc.resolve(u.$from.pos),c.doc.resolve(d),u.depth));const f=n(u);if(null==f)return!1;c.lift(u,f);let p=c.doc.resolve(c.mapping.map(g,-1)-1);a(c.doc,p.pos)&&p.nodeBefore.type==p.nodeAfter.type&&c.join(p.pos);return s(c.scrollIntoView()),!0}(s,o,i,g):function(r,n,a){let i=r.tr,s=a.parent;for(let t=a.end,e=a.endIndex-1,l=a.startIndex;e>l;e--)t-=s.child(e).nodeSize,i.delete(t-1,t+1);let o=i.doc.resolve(a.start),u=o.nodeAfter;if(i.mapping.map(a.end)!=a.start+o.nodeAfter.nodeSize)return!1;let c=0==a.startIndex,g=a.endIndex==s.childCount,d=o.node(-1),f=o.index(-1);if(!d.canReplace(f+(c?0:1),f+1,u.content.append(g?l.empty:l.from(s))))return!1;let p=o.pos,m=p+u.nodeSize;return i.step(new t(p-(c?1:0),m+(g?1:0),p+1,m-1,new e((c?l.empty:l.from(s.copy(l.empty))).append(g?l.empty:l.from(s.copy(l.empty))),c?0:1,g?0:1),c?0:1)),n(i.scrollIntoView()),!0}(s,o,g)))}}function _(r){return function(n,a){let{$from:i,$to:s}=n.selection,o=i.blockRange(s,(t=>t.childCount>0&&t.firstChild.type==r));if(!o)return!1;let u=o.startIndex;if(0==u)return!1;let c=o.parent,g=c.child(u-1);if(g.type!=r)return!1;if(a){let i=g.lastChild&&g.lastChild.type==c.type,s=l.from(i?r.create():null),u=new e(l.from(r.create(null,l.from(c.type.create(null,s)))),i?3:1,0),d=o.start,f=o.end;a(n.tr.step(new t(d-(i?3:1),f,d,f,u,1,!0)).scrollIntoView())}return!0}}const A=["left","center","right","justify"];function $(t){const e=t.style.textAlign||t.getAttribute("align")||"";return A.includes(e)?e:null}const x=8;function v(t){const e=t.style.marginInlineStart||t.style.marginLeft||"",l=parseFloat(e);return!Number.isFinite(l)||l<=0?0:Math.min(8,Math.round(l/40))}function j(t){const e=t.style.lineHeight.trim();if(!e||"normal"===e)return null;const l=parseFloat(e);return!Number.isFinite(l)||l<=0?null:e.endsWith("%")?String(l/100):e}function N(t){const e=[],l=function(t){return t?`text-align: ${t}`:null}(t.align??null);return l&&e.push(l),t.indent&&e.push(`margin-inline-start: ${40*t.indent}px`),t.lineHeight&&e.push(`line-height: ${t.lineHeight}`),e.length?e.join("; "):null}const F=/^(?:nile-wysiwyg|ProseMirror)/;function I(t){if(!t)return null;const e=t.split(/\s+/).filter((t=>t&&!F.test(t)));return e.length?e.join(" "):null}function z(t){return t&&!F.test(t)?t:null}const q={htmlClass:{default:null},htmlId:{default:null}};function C(t){return{htmlClass:I(t.getAttribute("class")),htmlId:z(t.getAttribute("id"))}}function S(t){if(!("tag"in t)||"style"in t)return t;const e=t.getAttrs;return{...t,getAttrs(t){const l=e?e(t):null;return!1!==l&&{...l??{},...C(t)}}}}function H(t){return{...t,attrs:{...t.attrs??{},...q},parseDOM:t.parseDOM?.map(S),toDOM:(e=t.toDOM,e?(t,...l)=>{const r=e(t,...l),n=t.attrs.htmlClass,a=t.attrs.htmlId;if(!Array.isArray(r)||!n&&!a)return r;const[i,...s]=r;let o={},u=s;return s.length&&s[0]&&"object"==typeof s[0]&&!Array.isArray(s[0])&&(o={...s[0]},u=s.slice(1)),n&&(o.class=o.class?`${o.class} ${n}`:n),a&&(o.id=a),[i,o,...u]}:e)};var e}const E=["paragraph","heading","blockquote","code_block","bullet_list","ordered_list","list_item","table","table_row","table_cell","table_header"],B=["link","bold","italic","underline","strike","code","subscript","superscript"],G={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:null},indent:{default:0},lineHeight:{default:null}},parseDOM:[{tag:"p",getAttrs:t=>({align:$(t),indent:v(t),lineHeight:j(t)})}],toDOM(t){const e=N(t.attrs);return e?["p",{style:e},0]:["p",0]}},heading:{content:"inline*",group:"block",defining:!0,attrs:{level:{default:1},align:{default:null},indent:{default:0},lineHeight:{default:null}},parseDOM:[1,2,3,4,5,6].map((t=>({tag:`h${t}`,getAttrs:e=>({level:t,align:$(e),indent:v(e),lineHeight:j(e)})}))),toDOM(t){const e=N(t.attrs);return e?[`h${t.attrs.level}`,{style:e},0]:[`h${t.attrs.level}`,0]}},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},text:{group:"inline"},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},code_block:{content:"text*",group:"block",marks:"",code:!0,defining:!0,attrs:{language:{default:null}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({language:t.getAttribute("data-language")})}],toDOM(t){const e={class:"nile-wysiwyg__code-block"};return t.attrs.language&&(e["data-language"]=t.attrs.language),["pre",e,["code",0]]}},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:t=>{const e=parseFloat(t.style.width),l=parseFloat(t.getAttribute("width")??""),r=Number.isFinite(e)?Math.round(e):Number.isFinite(l)?Math.round(l):null;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title"),width:r&&r>0?r:null}}}],toDOM(t){const{src:e,alt:l,title:r,width:n}=t.attrs,a={src:e};return l&&(a.alt=l),r&&(a.title=r),n&&(a.style=`width: ${n}px`),["img",a]}},figure:{group:"block",content:"inline*",defining:!0,isolating:!0,attrs:{src:{},alt:{default:null},title:{default:null},width:{default:null},align:{default:null}},parseDOM:[{tag:"figure",contentElement:"figcaption",getAttrs:t=>{const e=t.querySelector("img[src]");if(!e)return!1;const l=parseFloat(e.style.width||t.style.width),r=t.getAttribute("data-align");return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:Number.isFinite(l)&&l>0?Math.round(l):null,align:"left"===r||"center"===r||"right"===r?r:null}}}],toDOM(t){const{src:e,alt:l,title:r,width:n,align:a}=t.attrs,i={class:"nile-wysiwyg__figure"};a&&(i["data-align"]=a);const s=[];n&&s.push(`width: ${n}px`),"center"===a?s.push("margin-left: auto; margin-right: auto"):"right"===a&&s.push("margin-left: auto; margin-right: 0"),s.length&&(i.style=s.join("; "));const o={src:e,style:"width: 100%"};return l&&(o.alt=l),r&&(o.title=r),["figure",i,["img",o],["figcaption",{class:"nile-wysiwyg__figcaption"},0]]}},task_list:{content:"task_item+",group:"block",parseDOM:[{tag:"ul[data-task-list]",priority:51}],toDOM:()=>["ul",{"data-task-list":"true",class:"nile-wysiwyg__task-list"},0]},task_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:!1}},parseDOM:[{tag:"li[data-task-item]",priority:51,getAttrs:t=>({checked:"true"===t.getAttribute("data-checked")})}],toDOM:t=>["li",{"data-task-item":"true","data-checked":String(t.attrs.checked),class:"nile-wysiwyg__task-item"},0]},embed:{group:"block",atom:!0,selectable:!0,draggable:!0,attrs:{src:{},provider:{default:null},title:{default:null},width:{default:null},align:{default:null}},parseDOM:[{tag:"div[data-embed-provider]",getAttrs:t=>{const e=t.querySelector("iframe[src]");if(!e)return!1;const l=t.getAttribute("data-width")??/^(\d+)px$/.exec(t.style.width)?.[1],r=l?parseInt(l,10):NaN,n=t.getAttribute("data-align");return{src:e.getAttribute("src"),provider:t.getAttribute("data-embed-provider"),title:e.getAttribute("title"),width:Number.isFinite(r)&&r>0?r:null,align:"left"===n||"center"===n||"right"===n?n:null}}},{tag:"iframe[src]",getAttrs:t=>{const e=parseInt(t.getAttribute("width")??"",10);return{src:t.getAttribute("src"),title:t.getAttribute("title"),width:Number.isFinite(e)&&e>0?e:null}}}],toDOM(t){const{src:e,provider:l,title:r,width:n,align:a}=t.attrs,i={src:e,frameborder:"0",allowfullscreen:"true",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",sandbox:d,referrerpolicy:f};r&&(i.title=r);const s={class:"nile-wysiwyg__embed","data-embed-provider":l??"generic"},o=[];return n&&(s["data-width"]=String(n),o.push(`width: ${n}px`,"max-width: 100%")),a&&(s["data-align"]=a,"center"===a?o.push("margin-left: auto","margin-right: auto"):"right"===a&&o.push("margin-left: auto","margin-right: 0")),o.length&&(s.style=o.join("; ")),["div",s,["iframe",i]]}},styleBlock:{group:"block",atom:!0,selectable:!0,attrs:{css:{default:""}},parseDOM:[{tag:"style",getAttrs:t=>({css:t.textContent??""})}],toDOM:t=>["style",t.attrs.css]},bookmark:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{}},parseDOM:[{tag:"a[data-bookmark]",priority:60,getAttrs:t=>{const e=t.getAttribute("id")||t.getAttribute("name");return!!e&&{id:e}}},{tag:"a[id]",getAttrs:t=>!t.hasAttribute("href")&&{id:t.getAttribute("id")}},{tag:"a[name]",getAttrs:t=>!t.hasAttribute("href")&&{id:t.getAttribute("name")}}],toDOM:t=>["a",{id:t.attrs.id,"data-bookmark":"true"}]},mention:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{trigger:{default:"@"},key:{},label:{}},parseDOM:[{tag:"span[data-mention-key]",getAttrs:t=>({trigger:t.getAttribute("data-mention-trigger")||"@",key:t.getAttribute("data-mention-key"),label:t.getAttribute("data-mention-label")||t.textContent?.slice(1)||""})}],toDOM(t){const{trigger:e,key:l,label:r}=t.attrs;return["span",{class:"nile-wysiwyg__mention","data-mention-trigger":e,"data-mention-key":l,"data-mention-label":r},`${e}${r}`]}},merge_field:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{id:{},label:{default:null}},parseDOM:[{tag:"span[data-merge-field]",getAttrs:t=>{const e=t.getAttribute("data-merge-field");return!!e&&{id:e,label:t.getAttribute("data-merge-label")||t.textContent||null}}}],toDOM(t){const{id:e,label:l}=t.attrs;return["span",{class:"nile-wysiwyg__merge-field","data-merge-field":e,"data-merge-label":l??""},l||`{{${e}}}`]}},math:{inline:!0,group:"inline",atom:!0,selectable:!0,attrs:{latex:{},display:{default:"inline"}},parseDOM:[{tag:"span[data-math]",getAttrs:t=>({latex:t.getAttribute("data-math")||t.textContent||"",display:"block"===t.getAttribute("data-math-display")?"block":"inline"})}],toDOM(t){const{latex:e,display:l}=t.attrs;return["span",{class:"nile-wysiwyg__math","data-math":e,"data-math-display":l},e]}}},P=g({tableGroup:"block",cellContent:"block+",cellAttributes:{background:{default:null,getFromDOM:t=>t.style.backgroundColor||null,setDOMAttr(t,e){t&&(e.style=`${e.style||""}background-color: ${t};`)}}}}),R=P.table,W={...R,attrs:{...R.attrs??{},layout:{default:!1}},parseDOM:[{tag:"table",getAttrs:t=>({layout:"presentation"===t.getAttribute("role")||t.hasAttribute("data-layout")})}],toDOM:t=>t.attrs.layout?["table",{role:"presentation","data-layout":"true"},["tbody",0]]:["table",["tbody",0]]},J={link:{attrs:{href:{},title:{default:null},target:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:t=>({href:t.getAttribute("href"),title:t.getAttribute("title"),target:t.getAttribute("target")})}],toDOM(t){const{href:e,title:l,target:r}=t.attrs,n={href:e};return l&&(n.title=l),r&&(n.target=r,"_blank"===r&&(n.rel="noopener noreferrer")),["a",n,0]}},bold:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],toDOM:()=>["strong",0]},italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},underline:{parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:t=>t.includes("underline")&&null},{style:"text-decoration-line",getAttrs:t=>t.includes("underline")&&null}],toDOM:()=>["u",0]},strike:{parseDOM:[{tag:"s"},{tag:"strike"},{tag:"del"},{style:"text-decoration",getAttrs:t=>t.includes("line-through")&&null},{style:"text-decoration-line",getAttrs:t=>t.includes("line-through")&&null}],toDOM:()=>["s",0]},subscript:{excludes:"subscript superscript",parseDOM:[{tag:"sub"},{style:"vertical-align=sub"}],toDOM:()=>["sub",0]},superscript:{excludes:"subscript superscript",parseDOM:[{tag:"sup"},{style:"vertical-align=super"}],toDOM:()=>["sup",0]},code:{parseDOM:[{tag:"code"}],toDOM:()=>["code",{class:"nile-wysiwyg__inline-code"},0]},html_span:{attrs:{htmlClass:{default:null},htmlId:{default:null}},parseDOM:[{tag:"span",priority:5,getAttrs:t=>{const e=I(t.getAttribute("class")),l=z(t.getAttribute("id"));return!(!e&&!l)&&{htmlClass:e,htmlId:l}}}],toDOM(t){const e={};return t.attrs.htmlClass&&(e.class=t.attrs.htmlClass),t.attrs.htmlId&&(e.id=t.attrs.htmlId),["span",e,0]}},text_color:{attrs:{color:{}},parseDOM:[{style:"color",getAttrs:t=>!!t&&{color:t}}],toDOM:t=>["span",{style:`color: ${t.attrs.color}`},0]},bg_color:{attrs:{color:{}},parseDOM:[{style:"background-color",getAttrs:t=>!(!t||"transparent"===t)&&{color:t}}],toDOM:t=>["span",{style:`background-color: ${t.attrs.color}`},0]},font_family:{attrs:{family:{}},parseDOM:[{style:"font-family",getAttrs:t=>!!t&&{family:t}}],toDOM:t=>["span",{style:`font-family: ${t.attrs.family}`},0]},font_size:{attrs:{size:{}},parseDOM:[{style:"font-size",getAttrs:t=>!!t&&{size:t}}],toDOM:t=>["span",{style:`font-size: ${t.attrs.size}`},0]}},K=["disc","circle","square"],L={1:"decimal",a:"lower-alpha",A:"upper-alpha",i:"lower-roman",I:"upper-roman"},Q=Object.fromEntries(Object.entries(L).map((([t,e])=>[e,t]))),T="multilevel",U={content:"list_item+",group:"block",attrs:{style:{default:null}},parseDOM:[{tag:"ul",getAttrs:t=>{const e=t.style.listStyleType;return{style:K.includes(e)?e:null}}}],toDOM:t=>t.attrs.style?["ul",{style:`list-style-type: ${t.attrs.style}`},0]:["ul",0]},V={content:"list_item+",group:"block",attrs:{order:{default:1},style:{default:null}},parseDOM:[{tag:"ol",getAttrs:t=>{const e=t.getAttribute("type")??"",l=t.style.listStyleType,r=t.getAttribute("data-list-style")===T?T:L[e]??(Object.values(L).includes(l)?l:null),n=Number(t.getAttribute("start"));return{order:Number.isFinite(n)&&n>0?n:1,style:r}}}],toDOM(t){const e={};return 1!==t.attrs.order&&(e.start=String(t.attrs.order)),t.attrs.style===T?e["data-list-style"]=T:t.attrs.style&&Q[t.attrs.style]&&(e.type=Q[t.attrs.style]),["ol",e,0]}};const X=function(){let t=function(t,e,l){return t.append({ordered_list:O(y,{content:"list_item+",group:l}),bullet_list:O(h,{content:"list_item+",group:l}),list_item:O(M,{content:e})})}(u.from(G),"paragraph block*","block").update("bullet_list",U).update("ordered_list",V).append(P).update("table",W);for(const e of E){const l=t.get(e);l&&(t=t.update(e,H(l)))}let e=u.from(J);for(const t of B){const l=e.get(t);l&&(e=e.update(t,H(l)))}return new c({nodes:t,marks:e})}();export{T as M,_ as a,x as b,X as d,w as l,k as s,D as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./commands.cjs.js","../../index-89c520e9.cjs.js","./schema.cjs.js","../../index-
|
|
1
|
+
System.register(["./commands.cjs.js","../../index-89c520e9.cjs.js","./schema.cjs.js","../../index-50880eb7.cjs.js","../../index-6832c52b.cjs.js","../../index-178e1e57.cjs.js","./plugins/embeds.cjs.js"],function(_export,_context){"use strict";var l,n,e,t,i;function o(l,n){var _l$selection=l.selection,e=_l$selection.from,t=_l$selection.$from,i=_l$selection.to,o=_l$selection.empty;return o?!!n.isInSet(l.storedMarks||t.marks()):l.doc.rangeHasMark(e,i,n);}function s(l,n,e){var _l$selection2=l.selection,t=_l$selection2.$from,i=_l$selection2.from,o=_l$selection2.to,s=_l$selection2.empty;if(s){var _i$attrs$e;var _i=n.isInSet(l.storedMarks||t.marks());return _i?(_i$attrs$e=_i.attrs[e])!==null&&_i$attrs$e!==void 0?_i$attrs$e:null:null;}var u=null;return l.doc.nodesBetween(i,o,function(l){var _t$attrs$e;if(null!==u||!l.isText)return null===u;var t=n.isInSet(l.marks);return t&&(u=(_t$attrs$e=t.attrs[e])!==null&&_t$attrs$e!==void 0?_t$attrs$e:null),null===u;}),u;}function u(u){var _f$attrs$align,_f$attrs$lineHeight,_f$attrs$indent,_A$isFigure,_A$node$attrs$align,_C$node$attrs$align,_f$attrs$language;var c=u.schema,_u$selection=u.selection,r=_u$selection.$from,a=_u$selection.from,m=_u$selection.to,d=_u$selection.empty;var f=r.parent;if(!f.isTextblock){var _l=null;u.doc.nodesBetween(a,m,function(n){return!_l&&n.isTextblock&&(_l=n),!_l;}),_l&&(f=_l);}var g=f.type.name,p="heading"===g?f.attrs.level:null,j=f.type.spec.attrs&&"align"in f.type.spec.attrs?(_f$attrs$align=f.attrs.align)!==null&&_f$attrs$align!==void 0?_f$attrs$align:null:null;var b=!1,k=!1,y=!1,h=!1,x=!1,L=!1,S=null,B=null;for(var _l2=r.depth;_l2>0;_l2-=1){var _n$attrs$style,_n$attrs$style2,_n$attrs$order;var _n=r.node(_l2);_n.type===c.nodes.bullet_list?(b=!0,null===S&&(S=(_n$attrs$style=_n.attrs.style)!==null&&_n$attrs$style!==void 0?_n$attrs$style:null)):_n.type===c.nodes.ordered_list?(k=!0,null===S&&(S=(_n$attrs$style2=_n.attrs.style)!==null&&_n$attrs$style2!==void 0?_n$attrs$style2:null),null===B&&(B=(_n$attrs$order=_n.attrs.order)!==null&&_n$attrs$order!==void 0?_n$attrs$order:1)):_n.type===c.nodes.task_list?y=!0:_n.type===c.nodes.blockquote?h=!0:_n.type===c.nodes.table&&(x=!0,L=!!_n.attrs.layout);}var A=l(u),C=n(u),H=o(u,c.marks.link);var T=null;if(H&&(T=s(u,c.marks.link,"href"),null===T&&d)){var _l3=e(r,c.marks.link);if(_l3){var _n2=c.marks.link.isInSet(u.doc.resolve(_l3.from+1).marks());T=_n2?_n2.attrs.href:null;}}return{bold:o(u,c.marks.bold),italic:o(u,c.marks.italic),underline:o(u,c.marks.underline),strike:o(u,c.marks.strike),subscript:o(u,c.marks.subscript),superscript:o(u,c.marks.superscript),code:o(u,c.marks.code),blockType:g,headingLevel:p,align:j,lineHeight:f.type.spec.attrs&&"lineHeight"in f.type.spec.attrs?(_f$attrs$lineHeight=f.attrs.lineHeight)!==null&&_f$attrs$lineHeight!==void 0?_f$attrs$lineHeight:null:null,inBulletList:b,inOrderedList:k,inTaskList:y,inBlockquote:h,inTable:x,tableLayout:L,blockIndent:f.type.spec.attrs&&"indent"in f.type.spec.attrs?(_f$attrs$indent=f.attrs.indent)!==null&&_f$attrs$indent!==void 0?_f$attrs$indent:0:0,listStyle:S,listStart:B,imageSelected:null!==A,imageIsFigure:(_A$isFigure=A===null||A===void 0?void 0:A.isFigure)!==null&&_A$isFigure!==void 0?_A$isFigure:!1,imageAlign:A!==null&&A!==void 0&&A.isFigure?(_A$node$attrs$align=A.node.attrs.align)!==null&&_A$node$attrs$align!==void 0?_A$node$attrs$align:null:null,embedSelected:null!==C,embedAlign:(_C$node$attrs$align=C===null||C===void 0?void 0:C.node.attrs.align)!==null&&_C$node$attrs$align!==void 0?_C$node$attrs$align:null,inCodeBlock:"code_block"===g,codeBlockLanguage:"code_block"===g?(_f$attrs$language=f.attrs.language)!==null&&_f$attrs$language!==void 0?_f$attrs$language:null:null,canUndo:t(u),canRedo:i(u),linkActive:H,linkHref:T,textColor:s(u,c.marks.text_color,"color"),bgColor:s(u,c.marks.bg_color,"color"),fontFamily:s(u,c.marks.font_family,"family"),fontSize:s(u,c.marks.font_size,"size"),selectionEmpty:d};}_export("c",u);return{setters:[function(_commandsCjsJs){l=_commandsCjsJs.s;n=_commandsCjsJs.a;e=_commandsCjsJs.g;t=_commandsCjsJs.u;i=_commandsCjsJs.r;},function(_index00aCjsJs){},function(_schemaCjsJs){},function(_index001CjsJs){},function(_index009CjsJs){},function(_index007CjsJs){},function(_pluginsEmbedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=selection-state.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as l,a as n,g as e,u as t,r as i}from"./commands.esm.js";import"../../index-6f3fa4ab.esm.js";import"./schema.esm.js";import"../../index-
|
|
1
|
+
import{s as l,a as n,g as e,u as t,r as i}from"./commands.esm.js";import"../../index-6f3fa4ab.esm.js";import"./schema.esm.js";import"../../index-7b1c9857.esm.js";import"../../index-ba47645d.esm.js";import"../../index-920675c4.esm.js";import"./plugins/embeds.esm.js";function o(l,n){const{from:e,$from:t,to:i,empty:o}=l.selection;return o?!!n.isInSet(l.storedMarks||t.marks()):l.doc.rangeHasMark(e,i,n)}function s(l,n,e){const{$from:t,from:i,to:o,empty:s}=l.selection;if(s){const i=n.isInSet(l.storedMarks||t.marks());return i?i.attrs[e]??null:null}let u=null;return l.doc.nodesBetween(i,o,(l=>{if(null!==u||!l.isText)return null===u;const t=n.isInSet(l.marks);return t&&(u=t.attrs[e]??null),null===u})),u}function u(u){const{schema:r}=u,{$from:c,from:m,to:a,empty:d}=u.selection;let f=c.parent;if(!f.isTextblock){let l=null;u.doc.nodesBetween(m,a,(n=>(!l&&n.isTextblock&&(l=n),!l))),l&&(f=l)}const g=f.type.name,p="heading"===g?f.attrs.level:null,b=f.type.spec.attrs&&"align"in f.type.spec.attrs?f.attrs.align??null:null;let k=!1,y=!1,h=!1,j=!1,x=!1,L=!1,S=null,B=null;for(let l=c.depth;l>0;l-=1){const n=c.node(l);n.type===r.nodes.bullet_list?(k=!0,null===S&&(S=n.attrs.style??null)):n.type===r.nodes.ordered_list?(y=!0,null===S&&(S=n.attrs.style??null),null===B&&(B=n.attrs.order??1)):n.type===r.nodes.task_list?h=!0:n.type===r.nodes.blockquote?j=!0:n.type===r.nodes.table&&(x=!0,L=!!n.attrs.layout)}const A=l(u),C=n(u),H=o(u,r.marks.link);let T=null;if(H&&(T=s(u,r.marks.link,"href"),null===T&&d)){const l=e(c,r.marks.link);if(l){const n=r.marks.link.isInSet(u.doc.resolve(l.from+1).marks());T=n?n.attrs.href:null}}return{bold:o(u,r.marks.bold),italic:o(u,r.marks.italic),underline:o(u,r.marks.underline),strike:o(u,r.marks.strike),subscript:o(u,r.marks.subscript),superscript:o(u,r.marks.superscript),code:o(u,r.marks.code),blockType:g,headingLevel:p,align:b,lineHeight:f.type.spec.attrs&&"lineHeight"in f.type.spec.attrs?f.attrs.lineHeight??null:null,inBulletList:k,inOrderedList:y,inTaskList:h,inBlockquote:j,inTable:x,tableLayout:L,blockIndent:f.type.spec.attrs&&"indent"in f.type.spec.attrs?f.attrs.indent??0:0,listStyle:S,listStart:B,imageSelected:null!==A,imageIsFigure:A?.isFigure??!1,imageAlign:A?.isFigure?A.node.attrs.align??null:null,embedSelected:null!==C,embedAlign:C?.node.attrs.align??null,inCodeBlock:"code_block"===g,codeBlockLanguage:"code_block"===g?f.attrs.language??null:null,canUndo:t(u),canRedo:i(u),linkActive:H,linkHref:T,textColor:s(u,r.marks.text_color,"color"),bgColor:s(u,r.marks.bg_color,"color"),fontFamily:s(u,r.marks.font_family,"family"),fontSize:s(u,r.marks.font_size,"size"),selectionEmpty:d}}export{u as c};
|