@aquera/nile-elements 1.9.10 → 2.0.0
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 +7 -0
- package/demo/nxtgen-dark.css +2265 -0
- package/dist/{index-6832c52b.cjs.js → index-3ca67627.cjs.js} +2 -2
- package/dist/{index-6832c52b.cjs.js.map → index-3ca67627.cjs.js.map} +1 -1
- package/dist/{index-f956f56d.cjs.js → index-403841c7.cjs.js} +2 -2
- package/dist/{index-f956f56d.cjs.js.map → index-403841c7.cjs.js.map} +1 -1
- package/dist/{index-a487d8b4.esm.js → index-802939a8.esm.js} +1 -1
- package/dist/{index-50880eb7.cjs.js → index-c3210a9c.cjs.js} +2 -2
- package/dist/{index-50880eb7.cjs.js.map → index-c3210a9c.cjs.js.map} +1 -1
- package/dist/index-ccff99d6.esm.js +1 -0
- package/dist/{index-747d1880.cjs.js → index-d37d33cb.cjs.js} +2 -2
- package/dist/index-d37d33cb.cjs.js.map +1 -0
- package/dist/index-e43755f5.cjs.js +2 -0
- package/dist/index-e43755f5.cjs.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +418 -352
- package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
- package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
- package/dist/nile-calendar/nile-calendar.css.esm.js +1 -1
- package/dist/nile-calendar/nile-calendar.esm.js +10 -10
- package/dist/nile-carousel/nile-carousel.cjs.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js.map +1 -1
- package/dist/nile-carousel/nile-carousel.esm.js +2 -0
- package/dist/nile-code-editor/extensionSetup.cjs.js +7 -7
- package/dist/nile-code-editor/extensionSetup.cjs.js.map +1 -1
- package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
- package/dist/nile-code-editor/index.cjs.js +1 -1
- package/dist/nile-code-editor/index.esm.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
- package/dist/nile-code-editor/nile-code-editor.css.esm.js +2 -2
- package/dist/nile-code-editor/nile-code-editor.esm.js +3 -3
- package/dist/nile-code-editor/theme.cjs.js +1 -1
- package/dist/nile-code-editor/theme.cjs.js.map +1 -1
- package/dist/nile-code-editor/theme.esm.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.cjs.js.map +1 -1
- package/dist/nile-color-picker/nile-color-picker.css.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-context-menu/index.cjs.js +1 -1
- package/dist/nile-context-menu/nile-context-menu.cjs.js +1 -1
- package/dist/nile-context-submenu/index.cjs.js +1 -1
- package/dist/nile-context-submenu/nile-context-submenu.cjs.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-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.css.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.css.esm.js +56 -1
- package/dist/nile-drawer/nile-drawer.esm.js +7 -7
- package/dist/nile-error-message/nile-error-message.css.cjs.js +1 -1
- package/dist/nile-error-message/nile-error-message.css.cjs.js.map +1 -1
- package/dist/nile-error-message/nile-error-message.css.esm.js +4 -3
- package/dist/nile-error-notification/nile-error-notification.css.cjs.js +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.cjs.js.map +1 -1
- package/dist/nile-error-notification/nile-error-notification.css.esm.js +1 -1
- package/dist/nile-floating-panel/index.cjs.js +1 -1
- package/dist/nile-floating-panel/nile-floating-panel.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js +1 -1
- package/dist/nile-hero/nile-hero.css.cjs.js.map +1 -1
- package/dist/nile-hero/nile-hero.css.esm.js +1 -0
- package/dist/nile-lite-tooltip/index.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-lite-tooltip/nile-lite-tooltip.css.esm.js +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js +1 -1
- package/dist/nile-popup/nile-popup.css.cjs.js.map +1 -1
- package/dist/nile-popup/nile-popup.css.esm.js +5 -4
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.cjs.js.map +1 -1
- package/dist/nile-tooltip/nile-tooltip.css.esm.js +7 -1
- package/dist/nile-wysiwyg-editor/engine/commands.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/create-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/inputrules.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/keymap.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/code-highlight.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embed-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/embeds.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/find-replace.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/format-painter.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image-view.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/image.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/link.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/max-length.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.cjs.js.map +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/paste.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/placeholder.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/single-line.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/suggestions.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/plugins/tables.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/sanitize.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/schema.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/selection-state.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/engine/serializer.esm.js +1 -1
- package/dist/nile-wysiwyg-editor/index.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
- package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js +1 -1
- package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.js +4 -4
- package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
- package/dist/src/nile-carousel/nile-carousel.js +2 -0
- package/dist/src/nile-carousel/nile-carousel.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.css.js +2 -2
- package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
- package/dist/src/nile-code-editor/nile-code-editor.js +4 -3
- package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
- package/dist/src/nile-code-editor/theme.d.ts +118 -2
- package/dist/src/nile-code-editor/theme.js +169 -19
- package/dist/src/nile-code-editor/theme.js.map +1 -1
- package/dist/src/nile-color-picker/nile-color-picker.css.js +12 -12
- package/dist/src/nile-color-picker/nile-color-picker.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.css.js +56 -1
- package/dist/src/nile-drawer/nile-drawer.css.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.d.ts +4 -0
- package/dist/src/nile-drawer/nile-drawer.js +84 -39
- package/dist/src/nile-drawer/nile-drawer.js.map +1 -1
- package/dist/src/nile-drawer/nile-drawer.test.js +71 -0
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.css.js +2 -1
- package/dist/src/nile-error-message/nile-error-message.css.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.css.js.map +1 -1
- package/dist/src/nile-hero/nile-hero.css.js +1 -0
- package/dist/src/nile-hero/nile-hero.css.js.map +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js +1 -1
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.css.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.css.js +3 -2
- package/dist/src/nile-popup/nile-popup.css.js.map +1 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js +7 -1
- package/dist/src/nile-tooltip/nile-tooltip.css.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-calendar/nile-calendar.css.ts +1 -1
- package/src/nile-calendar/nile-calendar.ts +4 -4
- package/src/nile-carousel/nile-carousel.ts +2 -0
- package/src/nile-code-editor/nile-code-editor.css.ts +2 -2
- package/src/nile-code-editor/nile-code-editor.ts +3 -3
- package/src/nile-code-editor/theme.ts +172 -19
- package/src/nile-color-picker/nile-color-picker.css.ts +12 -12
- package/src/nile-drawer/nile-drawer.css.ts +56 -1
- package/src/nile-drawer/nile-drawer.test.ts +73 -0
- package/src/nile-drawer/nile-drawer.ts +59 -12
- package/src/nile-error-message/nile-error-message.css.ts +2 -1
- package/src/nile-error-notification/nile-error-notification.css.ts +1 -1
- package/src/nile-hero/nile-hero.css.ts +1 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.css.ts +1 -1
- package/src/nile-popup/nile-popup.css.ts +3 -2
- package/src/nile-tooltip/nile-tooltip.css.ts +7 -1
- package/vscode-html-custom-data.json +11 -1
- package/dist/index-747d1880.cjs.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./image-view.cjs.js","./embeds.cjs.js","../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,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 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 _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);}return{setters:[function(_imageViewCjsJs){t=_imageViewCjsJs.a;i=_imageViewCjsJs.i;},function(_embedsCjsJs){s=_embedsCjsJs.E;e=_embedsCjsJs.a;},function(
|
|
1
|
+
System.register(["./image-view.cjs.js","./embeds.cjs.js","../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,i,s,e,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 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 _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);}return{setters:[function(_imageViewCjsJs){t=_imageViewCjsJs.a;i=_imageViewCjsJs.i;},function(_embedsCjsJs){s=_embedsCjsJs.E;e=_embedsCjsJs.a;},function(_index00bCjsJs){}],execute:function execute(){_export("E",r=/*#__PURE__*/function(){function r(i,_r,a){_classCallCheck(this,r);this.node=i,this.dom=document.createElement("div"),this.dom.className="nile-wysiwyg__embed",this.iframe=document.createElement("iframe"),this.iframe.setAttribute("frameborder","0"),this.iframe.setAttribute("allowfullscreen","true"),this.iframe.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"),this.iframe.setAttribute("sandbox",s),this.iframe.setAttribute("referrerpolicy",e),this.dom.appendChild(this.iframe),this.applyAttrs(i),t(this.dom,this.dom,function(t){var i=a();if(void 0===i||!_r.editable)return;var s=_r.state.doc.nodeAt(i);s&&_r.dispatch(_r.state.tr.setNodeMarkup(i,void 0,_objectSpread(_objectSpread({},s.attrs),{},{width:t})));},160);}return _createClass(r,[{key:"applyAttrs",value:function applyAttrs(t){var _t$attrs=t.attrs,i=_t$attrs.src,s=_t$attrs.provider,e=_t$attrs.title,_r2=_t$attrs.width,a=_t$attrs.align;this.iframe.getAttribute("src")!==i&&this.iframe.setAttribute("src",i),this.dom.setAttribute("data-embed-provider",s!==null&&s!==void 0?s:"generic"),e?this.iframe.title=e:this.iframe.removeAttribute("title"),_r2?(this.dom.setAttribute("data-width",String(_r2)),this.dom.style.width="".concat(_r2,"px")):(this.dom.removeAttribute("data-width"),this.dom.style.width=""),a?this.dom.setAttribute("data-align",a):this.dom.removeAttribute("data-align"),this.dom.style.marginLeft="center"===a||"right"===a?"auto":"",this.dom.style.marginRight="center"===a?"auto":"";}},{key:"update",value:function update(t){return t.type===this.node.type&&(this.node=t,this.applyAttrs(t),!0);}},{key:"stopEvent",value:function stopEvent(t){return i(t);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}}]);}());}};});
|
|
2
2
|
//# sourceMappingURL=embed-view.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var e,o,t;function r(e){var o;try{o=new URL(e.trim());}catch(_unused){return null;}if("https:"!==o.protocol)return null;var t=o.hostname.replace(/^www\./,"");if("youtube.com"===t||"youtube-nocookie.com"===t||"youtu.be"===t){var _o$searchParams$get;var _e="";if("youtu.be"===t)_e=o.pathname.slice(1).split("/")[0];else if("/watch"===o.pathname)_e=(_o$searchParams$get=o.searchParams.get("v"))!==null&&_o$searchParams$get!==void 0?_o$searchParams$get:"";else{var _t=/^\/(embed|shorts)\/([\w-]+)/.exec(o.pathname);_t&&(_e=_t[2]);}if(/^[\w-]{6,20}$/.test(_e))return{src:"https://www.youtube-nocookie.com/embed/".concat(_e),provider:"youtube"};}else if("vimeo.com"===t||"player.vimeo.com"===t){var _e2=/\/(?:video\/)?(\d{6,12})(?:$|[/?])/.exec(o.pathname);if(_e2)return{src:"https://player.vimeo.com/video/".concat(_e2[1]),provider:"vimeo"};}else if("loom.com"===t){var _e3=/^\/(share|embed)\/([0-9a-f]{16,40})/.exec(o.pathname);if(_e3)return{src:"https://www.loom.com/embed/".concat(_e3[2]),provider:"loom"};}return{src:o.href,provider:"generic"};}function s(e){try{return"https:"===new URL(e.trim()).protocol;}catch(_unused2){return!1;}}function n(){return new e({props:{handlePaste:function handlePaste(e,o){var _o$clipboardData;var t=e.state;if(!t.selection.empty)return!1;var s=(_o$clipboardData=o.clipboardData)===null||_o$clipboardData===void 0||(_o$clipboardData=_o$clipboardData.getData("text/plain"))===null||_o$clipboardData===void 0?void 0:_o$clipboardData.trim();if(!s||/\s/.test(s))return!1;var n=r(s);if(!n)return!1;var i=t.schema.nodes.embed.create({src:n.src,provider:n.provider});return e.dispatch(t.tr.replaceSelectionWith(i).scrollIntoView()),!0;}}});}_export({e:n,i:s,t:r});return{setters:[function(
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var e,o,t;function r(e){var o;try{o=new URL(e.trim());}catch(_unused){return null;}if("https:"!==o.protocol)return null;var t=o.hostname.replace(/^www\./,"");if("youtube.com"===t||"youtube-nocookie.com"===t||"youtu.be"===t){var _o$searchParams$get;var _e="";if("youtu.be"===t)_e=o.pathname.slice(1).split("/")[0];else if("/watch"===o.pathname)_e=(_o$searchParams$get=o.searchParams.get("v"))!==null&&_o$searchParams$get!==void 0?_o$searchParams$get:"";else{var _t=/^\/(embed|shorts)\/([\w-]+)/.exec(o.pathname);_t&&(_e=_t[2]);}if(/^[\w-]{6,20}$/.test(_e))return{src:"https://www.youtube-nocookie.com/embed/".concat(_e),provider:"youtube"};}else if("vimeo.com"===t||"player.vimeo.com"===t){var _e2=/\/(?:video\/)?(\d{6,12})(?:$|[/?])/.exec(o.pathname);if(_e2)return{src:"https://player.vimeo.com/video/".concat(_e2[1]),provider:"vimeo"};}else if("loom.com"===t){var _e3=/^\/(share|embed)\/([0-9a-f]{16,40})/.exec(o.pathname);if(_e3)return{src:"https://www.loom.com/embed/".concat(_e3[2]),provider:"loom"};}return{src:o.href,provider:"generic"};}function s(e){try{return"https:"===new URL(e.trim()).protocol;}catch(_unused2){return!1;}}function n(){return new e({props:{handlePaste:function handlePaste(e,o){var _o$clipboardData;var t=e.state;if(!t.selection.empty)return!1;var s=(_o$clipboardData=o.clipboardData)===null||_o$clipboardData===void 0||(_o$clipboardData=_o$clipboardData.getData("text/plain"))===null||_o$clipboardData===void 0?void 0:_o$clipboardData.trim();if(!s||/\s/.test(s))return!1;var n=r(s);if(!n)return!1;var i=t.schema.nodes.embed.create({src:n.src,provider:n.provider});return e.dispatch(t.tr.replaceSelectionWith(i).scrollIntoView()),!0;}}});}_export({e:n,i:s,t:r});return{setters:[function(_index00bCjsJs){e=_index00bCjsJs.b;}],execute:function execute(){_export("E",o="allow-scripts allow-same-origin allow-presentation allow-popups"),_export("a",t="strict-origin-when-cross-origin");}};});
|
|
2
2
|
//# sourceMappingURL=embeds.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-3ca67627.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(_index00bCjsJs){n=_index00bCjsJs.P;e=_index00bCjsJs.b;},function(_index00aCjsJs){t=_index00aCjsJs.D;r=_index00aCjsJs.a;}],execute:function execute(){s=new n("nileFindReplace"),c={query:"",caseSensitive:!1,matches:[],activeIndex:0};}};});
|
|
2
2
|
//# sourceMappingURL=find-replace.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var n,t,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 s(){return new t({key:r,state:{init:function init(){return{marks:null};},apply:function apply(n,t){var s=n.getMeta(r);return"arm"===(s===null||s===void 0?void 0:s.type)?{marks:s.marks}:"disarm"===(s===null||s===void 0?void 0:s.type)?{marks:null}:t;}},props:{attributes:function attributes(n){var _r$getState;return(_r$getState=r.getState(n))!==null&&_r$getState!==void 0&&_r$getState.marks?{"class":"nile-wysiwyg--painting"}:{};}}});}function a(n){var _r$getState2;return!!((_r$getState2=r.getState(n))!==null&&_r$getState2!==void 0&&_r$getState2.marks);}function e(n){var t=function(n,_n$storedMarks,_t$marksAcross){var _n$selection=n.selection,t=_n$selection.$from,r=_n$selection.empty;return r?(_n$storedMarks=n.storedMarks)!==null&&_n$storedMarks!==void 0?_n$storedMarks:t.marks():(_t$marksAcross=t.marksAcross(n.selection.$to))!==null&&_t$marksAcross!==void 0?_t$marksAcross:t.marks();}(n);return n.tr.setMeta(r,{type:"arm",marks:t});}function o(n){return n.tr.setMeta(r,{type:"disarm"});}function i(n){var t=r.getState(n);if(!(t!==null&&t!==void 0&&t.marks))return null;var _n$selection2=n.selection,s=_n$selection2.from,a=_n$selection2.to,e=_n$selection2.empty;if(e)return null;var o=n.tr;o.removeMark(s,a,null);var _iterator=_createForOfIteratorHelper(t.marks),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _n=_step.value;o.addMark(s,a,_n);}}catch(err){_iterator.e(err);}finally{_iterator.f();}return o.setMeta(r,{type:"disarm"}),o;}_export({a:i,b:e,d:o,f:s,i:a});return{setters:[function(
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var n,t,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 s(){return new t({key:r,state:{init:function init(){return{marks:null};},apply:function apply(n,t){var s=n.getMeta(r);return"arm"===(s===null||s===void 0?void 0:s.type)?{marks:s.marks}:"disarm"===(s===null||s===void 0?void 0:s.type)?{marks:null}:t;}},props:{attributes:function attributes(n){var _r$getState;return(_r$getState=r.getState(n))!==null&&_r$getState!==void 0&&_r$getState.marks?{"class":"nile-wysiwyg--painting"}:{};}}});}function a(n){var _r$getState2;return!!((_r$getState2=r.getState(n))!==null&&_r$getState2!==void 0&&_r$getState2.marks);}function e(n){var t=function(n,_n$storedMarks,_t$marksAcross){var _n$selection=n.selection,t=_n$selection.$from,r=_n$selection.empty;return r?(_n$storedMarks=n.storedMarks)!==null&&_n$storedMarks!==void 0?_n$storedMarks:t.marks():(_t$marksAcross=t.marksAcross(n.selection.$to))!==null&&_t$marksAcross!==void 0?_t$marksAcross:t.marks();}(n);return n.tr.setMeta(r,{type:"arm",marks:t});}function o(n){return n.tr.setMeta(r,{type:"disarm"});}function i(n){var t=r.getState(n);if(!(t!==null&&t!==void 0&&t.marks))return null;var _n$selection2=n.selection,s=_n$selection2.from,a=_n$selection2.to,e=_n$selection2.empty;if(e)return null;var o=n.tr;o.removeMark(s,a,null);var _iterator=_createForOfIteratorHelper(t.marks),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _n=_step.value;o.addMark(s,a,_n);}}catch(err){_iterator.e(err);}finally{_iterator.f();}return o.setMeta(r,{type:"disarm"}),o;}_export({a:i,b:e,d:o,f:s,i:a});return{setters:[function(_index00bCjsJs){n=_index00bCjsJs.P;t=_index00bCjsJs.b;}],execute:function execute(){r=new n("nileFormatPainter");}};});
|
|
2
2
|
//# sourceMappingURL=format-painter.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as n,b as t}from"../../../index-6f3fa4ab.esm.js";const r=new n("nileFormatPainter");function s(){return new t({key:r,state:{init:()=>({marks:null}),apply(n,t){const s=n.getMeta(r);return"arm"===s?.type?{marks:s.marks}:"disarm"===s?.type?{marks:null}:t}},props:{attributes:n=>r.getState(n)?.marks?{class:"nile-wysiwyg--painting"}:{}}})}function
|
|
1
|
+
import{P as n,b as t}from"../../../index-6f3fa4ab.esm.js";const r=new n("nileFormatPainter");function s(){return new t({key:r,state:{init:()=>({marks:null}),apply(n,t){const s=n.getMeta(r);return"arm"===s?.type?{marks:s.marks}:"disarm"===s?.type?{marks:null}:t}},props:{attributes:n=>r.getState(n)?.marks?{class:"nile-wysiwyg--painting"}:{}}})}function e(n){return!!r.getState(n)?.marks}function a(n){const t=function(n){const{$from:t,empty:r}=n.selection;return r?n.storedMarks??t.marks():t.marksAcross(n.selection.$to)??t.marks()}(n);return n.tr.setMeta(r,{type:"arm",marks:t})}function o(n){return n.tr.setMeta(r,{type:"disarm"})}function i(n){const t=r.getState(n);if(!t?.marks)return null;const{from:s,to:e,empty:a}=n.selection;if(a)return null;const o=n.tr;o.removeMark(s,e,null);for(const n of t.marks)o.addMark(s,e,n);return o.setMeta(r,{type:"disarm"}),o}export{i as a,a as b,o as d,s as f,e as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var i,e,n;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 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 _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 t(i,t,s){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:40;var _loop=function _loop(){var n=_arr[_i];var h=document.createElement("span");h.className="nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--".concat(n),h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",function(h){var _i$closest$getBoundin,_i$closest;h.preventDefault(),h.stopPropagation();var o=h.clientX,r=t.getBoundingClientRect().width,
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var i,e,n;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 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 _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 t(i,t,s){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:40;var _loop=function _loop(){var n=_arr[_i];var h=document.createElement("span");h.className="nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--".concat(n),h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",function(h){var _i$closest$getBoundin,_i$closest;h.preventDefault(),h.stopPropagation();var o=h.clientX,r=t.getBoundingClientRect().width,w=n.includes("w")?-1:1,a=(_i$closest$getBoundin=(_i$closest=i.closest(".ProseMirror"))===null||_i$closest===void 0?void 0:_i$closest.getBoundingClientRect().width)!==null&&_i$closest$getBoundin!==void 0?_i$closest$getBoundin:2e3;var l=r;var c=function c(i){l=Math.max(e,Math.min(a,r+w*(i.clientX-o))),t.style.width="".concat(Math.round(l),"px");},_d=function d(){window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",_d),i.classList.remove("nile-wysiwyg__resizing"),s(Math.round(l));};i.classList.add("nile-wysiwyg__resizing"),window.addEventListener("mousemove",c),window.addEventListener("mouseup",_d);}),i.appendChild(h);};for(var _i=0,_arr=["nw","ne","sw","se"];_i<_arr.length;_i++){_loop();}}function s(i){return i.target instanceof HTMLElement&&!!i.target.dataset.resizeHandle;}_export({a:t,i:s});return{setters:[function(_index00bCjsJs){i=_index00bCjsJs.c;}],execute:function execute(){_export("I",e=/*#__PURE__*/function(){function e(i,s,_e){_classCallCheck(this,e);this.node=i,this.dom=document.createElement("span"),this.dom.className="nile-wysiwyg__image-resizer",this.img=document.createElement("img"),this.applyAttrs(i),this.dom.appendChild(this.img),t(this.dom,this.img,function(i){var t=_e();if(void 0===t||!s.editable)return;var n=s.state.doc.nodeAt(t);n&&s.dispatch(s.state.tr.setNodeMarkup(t,void 0,_objectSpread(_objectSpread({},n.attrs),{},{width:i})));});}return _createClass(e,[{key:"applyAttrs",value:function applyAttrs(i){var _i$attrs=i.attrs,t=_i$attrs.src,s=_i$attrs.alt,_e2=_i$attrs.title,n=_i$attrs.width;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),_e2?this.img.title=_e2:this.img.removeAttribute("title"),this.img.style.width=n?"".concat(n,"px"):"";}},{key:"update",value:function update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0);}},{key:"selectNode",value:function selectNode(){this.dom.classList.add("nile-wysiwyg__image-resizer--selected");}},{key:"deselectNode",value:function deselectNode(){this.dom.classList.remove("nile-wysiwyg__image-resizer--selected");}},{key:"stopEvent",value:function stopEvent(i){return s(i);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}}]);}());_export("F",n=/*#__PURE__*/function(){function n(s,e,_n){_classCallCheck(this,n);this.node=s,this.dom=document.createElement("figure"),this.dom.className="nile-wysiwyg__figure",this.wrapper=document.createElement("span"),this.wrapper.className="nile-wysiwyg__image-resizer",this.wrapper.contentEditable="false",this.img=document.createElement("img"),this.wrapper.appendChild(this.img),this.contentDOM=document.createElement("figcaption"),this.contentDOM.className="nile-wysiwyg__figcaption",this.dom.append(this.wrapper,this.contentDOM),this.applyAttrs(s),this.img.addEventListener("mousedown",function(t){t.preventDefault();var s=_n();void 0!==s&&(e.dispatch(e.state.tr.setSelection(i.create(e.state.doc,s))),e.focus());}),t(this.wrapper,this.img,function(i){var t=_n();if(void 0===t||!e.editable)return;var s=e.state.doc.nodeAt(t);s&&e.dispatch(e.state.tr.setNodeMarkup(t,void 0,_objectSpread(_objectSpread({},s.attrs),{},{width:i})));});}return _createClass(n,[{key:"applyAttrs",value:function applyAttrs(i){var _i$attrs2=i.attrs,t=_i$attrs2.src,s=_i$attrs2.alt,e=_i$attrs2.title,_n2=_i$attrs2.width,h=_i$attrs2.align;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.dom.style.width=_n2?"".concat(_n2,"px"):"",h?this.dom.setAttribute("data-align",h):this.dom.removeAttribute("data-align"),this.dom.classList.toggle("nile-wysiwyg__figure--empty-caption",0===i.content.size);}},{key:"update",value:function update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0);}},{key:"selectNode",value:function selectNode(){this.dom.classList.add("nile-wysiwyg__figure--selected"),this.wrapper.classList.add("nile-wysiwyg__image-resizer--selected");}},{key:"deselectNode",value:function deselectNode(){this.dom.classList.remove("nile-wysiwyg__figure--selected"),this.wrapper.classList.remove("nile-wysiwyg__image-resizer--selected");}},{key:"stopEvent",value:function stopEvent(i){return s(i);}},{key:"ignoreMutation",value:function ignoreMutation(i){return!this.contentDOM.contains(i.target);}}]);}());}};});
|
|
2
2
|
//# sourceMappingURL=image-view.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as i}from"../../../index-6f3fa4ab.esm.js";function t(i,t,s,e=40){for(const n of["nw","ne","sw","se"]){const h=document.createElement("span");h.className=`nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--${n}`,h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",(h=>{h.preventDefault(),h.stopPropagation();const o=h.clientX,r=t.getBoundingClientRect().width,
|
|
1
|
+
import{c as i}from"../../../index-6f3fa4ab.esm.js";function t(i,t,s,e=40){for(const n of["nw","ne","sw","se"]){const h=document.createElement("span");h.className=`nile-wysiwyg__resize-handle nile-wysiwyg__resize-handle--${n}`,h.dataset.resizeHandle=n,h.contentEditable="false",h.addEventListener("mousedown",(h=>{h.preventDefault(),h.stopPropagation();const o=h.clientX,r=t.getBoundingClientRect().width,w=n.includes("w")?-1:1,a=i.closest(".ProseMirror")?.getBoundingClientRect().width??2e3;let l=r;const c=i=>{l=Math.max(e,Math.min(a,r+w*(i.clientX-o))),t.style.width=`${Math.round(l)}px`},d=()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",d),i.classList.remove("nile-wysiwyg__resizing"),s(Math.round(l))};i.classList.add("nile-wysiwyg__resizing"),window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)})),i.appendChild(h)}}function s(i){return i.target instanceof HTMLElement&&!!i.target.dataset.resizeHandle}class e{constructor(i,s,e){this.node=i,this.dom=document.createElement("span"),this.dom.className="nile-wysiwyg__image-resizer",this.img=document.createElement("img"),this.applyAttrs(i),this.dom.appendChild(this.img),t(this.dom,this.img,(i=>{const t=e();if(void 0===t||!s.editable)return;const n=s.state.doc.nodeAt(t);n&&s.dispatch(s.state.tr.setNodeMarkup(t,void 0,{...n.attrs,width:i}))}))}applyAttrs(i){const{src:t,alt:s,title:e,width:n}=i.attrs;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.img.style.width=n?`${n}px`:""}update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0)}selectNode(){this.dom.classList.add("nile-wysiwyg__image-resizer--selected")}deselectNode(){this.dom.classList.remove("nile-wysiwyg__image-resizer--selected")}stopEvent(i){return s(i)}ignoreMutation(){return!0}}class n{constructor(s,e,n){this.node=s,this.dom=document.createElement("figure"),this.dom.className="nile-wysiwyg__figure",this.wrapper=document.createElement("span"),this.wrapper.className="nile-wysiwyg__image-resizer",this.wrapper.contentEditable="false",this.img=document.createElement("img"),this.wrapper.appendChild(this.img),this.contentDOM=document.createElement("figcaption"),this.contentDOM.className="nile-wysiwyg__figcaption",this.dom.append(this.wrapper,this.contentDOM),this.applyAttrs(s),this.img.addEventListener("mousedown",(t=>{t.preventDefault();const s=n();void 0!==s&&(e.dispatch(e.state.tr.setSelection(i.create(e.state.doc,s))),e.focus())})),t(this.wrapper,this.img,(i=>{const t=n();if(void 0===t||!e.editable)return;const s=e.state.doc.nodeAt(t);s&&e.dispatch(e.state.tr.setNodeMarkup(t,void 0,{...s.attrs,width:i}))}))}applyAttrs(i){const{src:t,alt:s,title:e,width:n,align:h}=i.attrs;this.img.src=t,s?this.img.alt=s:this.img.removeAttribute("alt"),e?this.img.title=e:this.img.removeAttribute("title"),this.dom.style.width=n?`${n}px`:"",h?this.dom.setAttribute("data-align",h):this.dom.removeAttribute("data-align"),this.dom.classList.toggle("nile-wysiwyg__figure--empty-caption",0===i.content.size)}update(i){return i.type===this.node.type&&(this.node=i,this.applyAttrs(i),!0)}selectNode(){this.dom.classList.add("nile-wysiwyg__figure--selected"),this.wrapper.classList.add("nile-wysiwyg__image-resizer--selected")}deselectNode(){this.dom.classList.remove("nile-wysiwyg__figure--selected"),this.wrapper.classList.remove("nile-wysiwyg__image-resizer--selected")}stopEvent(i){return s(i)}ignoreMutation(i){return!this.contentDOM.contains(i.target)}}export{n as F,e as I,t as a,s as i};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-3ca67627.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(_index00bCjsJs){n=_index00bCjsJs.P;o=_index00bCjsJs.b;},function(_index00aCjsJs){t=_index00aCjsJs.D;e=_index00aCjsJs.a;}],execute:function execute(){_export("a",a=new n("nileImageUpload"));}};});
|
|
2
2
|
//# sourceMappingURL=image.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,t,e;function n(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new r({props:{handleClick:function handleClick(r,e,s){var _s$target,_s$target$closest;if(!s.metaKey&&!s.ctrlKey)return!1;var o=(_s$target=s.target)===null||_s$target===void 0||(_s$target$closest=_s$target.closest)===null||_s$target$closest===void 0?void 0:_s$target$closest.call(_s$target,"a[href]");if(!o)return!1;var i=o.getAttribute("href");return!!t(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0);},handlePaste:function handlePaste(r,n){var _n$clipboardData;var s=r.state,_s$selection=s.selection,o=_s$selection.empty,i=_s$selection.from,
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,t,e;function n(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new r({props:{handleClick:function handleClick(r,e,s){var _s$target,_s$target$closest;if(!s.metaKey&&!s.ctrlKey)return!1;var o=(_s$target=s.target)===null||_s$target===void 0||(_s$target$closest=_s$target.closest)===null||_s$target$closest===void 0?void 0:_s$target$closest.call(_s$target,"a[href]");if(!o)return!1;var i=o.getAttribute("href");return!!t(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0);},handlePaste:function handlePaste(r,n){var _n$clipboardData;var s=r.state,_s$selection=s.selection,o=_s$selection.empty,i=_s$selection.from,f=_s$selection.to;if(o)return!1;var a=(_n$clipboardData=n.clipboardData)===null||_n$clipboardData===void 0||(_n$clipboardData=_n$clipboardData.getData("text/plain"))===null||_n$clipboardData===void 0?void 0:_n$clipboardData.trim();if(!a||!e.test(a)||!t(a))return!1;var c=s.schema.marks.link.create({href:a});return r.dispatch(s.tr.addMark(i,f,c)),!0;}}});}_export("l",n);return{setters:[function(_index00bCjsJs){r=_index00bCjsJs.b;},function(_sanitizeCjsJs){t=_sanitizeCjsJs.i;},function(_embedsCjsJs){}],execute:function execute(){e=/^https?:\/\/\S+$/i;}};});
|
|
2
2
|
//# sourceMappingURL=link.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"../../../index-6f3fa4ab.esm.js";import{i as r}from"../sanitize.esm.js";import"./embeds.esm.js";const t=/^https?:\/\/\S+$/i;function n(n={}){return new e({props:{handleClick(e,t,s){if(!s.metaKey&&!s.ctrlKey)return!1;const o=s.target?.closest?.("a[href]");if(!o)return!1;const i=o.getAttribute("href");return!!r(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0)},handlePaste(e,n){const{state:s}=e,{empty:o,from:i,to:
|
|
1
|
+
import{b as e}from"../../../index-6f3fa4ab.esm.js";import{i as r}from"../sanitize.esm.js";import"./embeds.esm.js";const t=/^https?:\/\/\S+$/i;function n(n={}){return new e({props:{handleClick(e,t,s){if(!s.metaKey&&!s.ctrlKey)return!1;const o=s.target?.closest?.("a[href]");if(!o)return!1;const i=o.getAttribute("href");return!!r(i)&&(n.onOpenLink?n.onOpenLink(i):window.open(i,"_blank","noopener,noreferrer"),!0)},handlePaste(e,n){const{state:s}=e,{empty:o,from:i,to:f}=s.selection;if(o)return!1;const a=n.clipboardData?.getData("text/plain")?.trim();if(!a||!t.test(a)||!r(a))return!1;const m=s.schema.marks.link.create({href:a});return e.dispatch(s.tr.addMark(i,f,m)),!0}}})}export{n as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n;function s(r){return n(r).replace(/\n/g,"").length;}function t(n){return new r({filterTransaction:function filterTransaction(r,t){if(!r.docChanged)return!0;var i=n();if(!i||i<=0)return!0;var e=s(r.doc);return e<=i||e<s(t.doc);}});}_export("m",t);return{setters:[function(
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n;function s(r){return n(r).replace(/\n/g,"").length;}function t(n){return new r({filterTransaction:function filterTransaction(r,t){if(!r.docChanged)return!0;var i=n();if(!i||i<=0)return!0;var e=s(r.doc);return e<=i||e<s(t.doc);}});}_export("m",t);return{setters:[function(_index00bCjsJs){r=_index00bCjsJs.b;},function(_serializerCjsJs){n=_serializerCjsJs.d;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=max-length.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../markdown-parse.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n,t,s,e,
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../markdown-parse.cjs.js","../serializer.cjs.js","../sanitize.cjs.js","./embeds.cjs.js"],function(_export,_context){"use strict";var r,n,t,s,e,i;function a(r,s){var e=s.split(/\r\n?|\n/).map(function(n){return r.nodes.paragraph.create(null,n?r.text(n):null);});return new n(t.from(e),1,1);}function o(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new r({props:{handlePaste:function handlePaste(r,a){var _t$getForcePlainText,_a$clipboardData$getD,_a$clipboardData,_a$clipboardData$getD2,_a$clipboardData2,_t$getSanitize,_t$getSanitize2;if((_t$getForcePlainText=t.getForcePlainText)!==null&&_t$getForcePlainText!==void 0&&_t$getForcePlainText.call(t))return!1;if(t.getMarkdownPaste&&!t.getMarkdownPaste())return!1;var o=(_a$clipboardData$getD=(_a$clipboardData=a.clipboardData)===null||_a$clipboardData===void 0?void 0:_a$clipboardData.getData("text/html"))!==null&&_a$clipboardData$getD!==void 0?_a$clipboardData$getD:"",u=(_a$clipboardData$getD2=(_a$clipboardData2=a.clipboardData)===null||_a$clipboardData2===void 0?void 0:_a$clipboardData2.getData("text/plain"))!==null&&_a$clipboardData$getD2!==void 0?_a$clipboardData$getD2:"";if(o.trim()||!u.trim())return!1;if(r.state.selection.$from.parent.type.spec.code)return!1;if(!s(u))return!1;var m=i(n,e(u),(_t$getSanitize=(_t$getSanitize2=t.getSanitize)===null||_t$getSanitize2===void 0?void 0:_t$getSanitize2.call(t))!==null&&_t$getSanitize!==void 0?_t$getSanitize:!0);return r.dispatch(r.state.tr.replaceSelection(m).scrollIntoView()),!0;},transformPasted:function transformPasted(r){var _t$getForcePlainText2;return(_t$getForcePlainText2=t.getForcePlainText)!==null&&_t$getForcePlainText2!==void 0&&_t$getForcePlainText2.call(t)?function(r,n){return a(r,n.content.textBetween(0,n.content.size,"\n","\n"));}(n,r):r;}}});}_export({a:o,p:a});return{setters:[function(_index00bCjsJs){r=_index00bCjsJs.b;n=_index00bCjsJs.d;t=_index00bCjsJs.F;},function(_markdownParseCjsJs){s=_markdownParseCjsJs.l;e=_markdownParseCjsJs.m;},function(_serializerCjsJs){i=_serializerCjsJs.h;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=paste.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paste.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/paste.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { Slice, Fragment, Node as PMNode, Schema } from 'prosemirror-model';\nimport { markdownToHtml, looksLikeMarkdown } from '../markdown-parse';\nimport { htmlToSlice } from '../serializer';\n\n/**\n * Builds a slice of plain paragraphs from text, splitting on newlines. Open\n * depth 1 on both ends lets the first/last block merge into the surrounding\n * paragraph, matching how a normal plain-text paste behaves.\n */\nexport function plainTextSlice(schema: Schema, text: string): Slice {\n const blocks = text.split(/\\r\\n?|\\n/);\n const nodes: PMNode[] = blocks.map(line =>\n schema.nodes.paragraph.create(null, line ? schema.text(line) : null)\n );\n return new Slice(Fragment.from(nodes), 1, 1);\n}\n\n/** Reduces a pasted slice to unstyled text, preserving block breaks. */\nexport function stripSliceFormatting(schema: Schema, slice: Slice): Slice {\n const text = slice.content.textBetween(0, slice.content.size, '\\n', '\\n');\n return plainTextSlice(schema, text);\n}\n\nexport interface PasteOptions {\n /**\n * Read live: when it returns true, every paste drops formatting (the\n * persistent \"paste as plain text\" toggle). The Ctrl+Shift+V shortcut is a\n * separate one-shot handled in the keymap.\n */\n getForcePlainText?: () => boolean;\n /**\n * Read live: when false, plain-text pastes are never parsed as Markdown.\n * Defaults to on.\n */\n getMarkdownPaste?: () => boolean;\n /** Read live: whether pasted HTML is sanitized. Defaults to on. */\n getSanitize?: () => boolean;\n}\n\n/**\n * Paste behavior: plain-text pastes that look like Markdown are parsed into\n * rich content (headings, lists, code fences, tables, inline marks), and all\n * pastes drop formatting while the host's plain-text toggle is on.\n */\nexport function pastePlugin(schema: Schema, options: PasteOptions = {}): Plugin {\n return new Plugin({\n props: {\n handlePaste(view, event) {\n if (options.getForcePlainText?.()) return false;\n if (options.getMarkdownPaste && !options.getMarkdownPaste()) return false;\n // Only plain-text pastes qualify: an HTML flavor means the source\n // was already rich, and code blocks take text verbatim.\n const html = event.clipboardData?.getData('text/html') ?? '';\n const text = event.clipboardData?.getData('text/plain') ?? '';\n if (html.trim() || !text.trim()) return false;\n if (view.state.selection.$from.parent.type.spec.code) return false;\n if (!looksLikeMarkdown(text)) return false;\n const slice = htmlToSlice(\n schema,\n markdownToHtml(text),\n options.getSanitize?.() ?? true\n );\n view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView());\n return true;\n },\n transformPasted(slice) {\n return options.getForcePlainText?.()\n ? stripSliceFormatting(schema, slice)\n : slice;\n },\n },\n });\n}\n"],"names":["plainTextSlice","schema","text","nodes","split","map","line","paragraph","create","Slice","Fragment","from","pastePlugin","options","arguments","length","undefined","Plugin","props","handlePaste","view","event","_t$getForcePlainText","
|
|
1
|
+
{"version":3,"file":"paste.cjs.js","sources":["../../../../../src/nile-wysiwyg-editor/engine/plugins/paste.ts"],"sourcesContent":["import { Plugin } from 'prosemirror-state';\nimport { Slice, Fragment, Node as PMNode, Schema } from 'prosemirror-model';\nimport { markdownToHtml, looksLikeMarkdown } from '../markdown-parse';\nimport { htmlToSlice } from '../serializer';\n\n/**\n * Builds a slice of plain paragraphs from text, splitting on newlines. Open\n * depth 1 on both ends lets the first/last block merge into the surrounding\n * paragraph, matching how a normal plain-text paste behaves.\n */\nexport function plainTextSlice(schema: Schema, text: string): Slice {\n const blocks = text.split(/\\r\\n?|\\n/);\n const nodes: PMNode[] = blocks.map(line =>\n schema.nodes.paragraph.create(null, line ? schema.text(line) : null)\n );\n return new Slice(Fragment.from(nodes), 1, 1);\n}\n\n/** Reduces a pasted slice to unstyled text, preserving block breaks. */\nexport function stripSliceFormatting(schema: Schema, slice: Slice): Slice {\n const text = slice.content.textBetween(0, slice.content.size, '\\n', '\\n');\n return plainTextSlice(schema, text);\n}\n\nexport interface PasteOptions {\n /**\n * Read live: when it returns true, every paste drops formatting (the\n * persistent \"paste as plain text\" toggle). The Ctrl+Shift+V shortcut is a\n * separate one-shot handled in the keymap.\n */\n getForcePlainText?: () => boolean;\n /**\n * Read live: when false, plain-text pastes are never parsed as Markdown.\n * Defaults to on.\n */\n getMarkdownPaste?: () => boolean;\n /** Read live: whether pasted HTML is sanitized. Defaults to on. */\n getSanitize?: () => boolean;\n}\n\n/**\n * Paste behavior: plain-text pastes that look like Markdown are parsed into\n * rich content (headings, lists, code fences, tables, inline marks), and all\n * pastes drop formatting while the host's plain-text toggle is on.\n */\nexport function pastePlugin(schema: Schema, options: PasteOptions = {}): Plugin {\n return new Plugin({\n props: {\n handlePaste(view, event) {\n if (options.getForcePlainText?.()) return false;\n if (options.getMarkdownPaste && !options.getMarkdownPaste()) return false;\n // Only plain-text pastes qualify: an HTML flavor means the source\n // was already rich, and code blocks take text verbatim.\n const html = event.clipboardData?.getData('text/html') ?? '';\n const text = event.clipboardData?.getData('text/plain') ?? '';\n if (html.trim() || !text.trim()) return false;\n if (view.state.selection.$from.parent.type.spec.code) return false;\n if (!looksLikeMarkdown(text)) return false;\n const slice = htmlToSlice(\n schema,\n markdownToHtml(text),\n options.getSanitize?.() ?? true\n );\n view.dispatch(view.state.tr.replaceSelection(slice).scrollIntoView());\n return true;\n },\n transformPasted(slice) {\n return options.getForcePlainText?.()\n ? stripSliceFormatting(schema, slice)\n : slice;\n },\n },\n });\n}\n"],"names":["plainTextSlice","schema","text","nodes","split","map","line","paragraph","create","Slice","Fragment","from","pastePlugin","options","arguments","length","undefined","Plugin","props","handlePaste","view","event","_t$getForcePlainText","_a$clipboardData$getD","_a$clipboardData","_a$clipboardData$getD2","_a$clipboardData2","_t$getSanitize","_t$getSanitize2","getForcePlainText","getMarkdownPaste","html","clipboardData","getData","trim","state","selection","$from","parent","type","spec","code","looksLikeMarkdown","slice","htmlToSlice","markdownToHtml","getSanitize","dispatch","tr","replaceSelection","scrollIntoView","transformPasted","content","textBetween","size","stripSliceFormatting"],"mappings":"oMAUgB,QAAAA,CAAAA,CAAAA,CAAeC,CAAgBC,CAAAA,CAAAA,CAAAA,CAC7C,GACMC,CAAAA,CADSD,CAAAA,CAAAA,CAAKE,KAAM,CAAA,UAAA,CAAA,CACKC,GAAIC,CAAAA,SAAAA,CAAAA,QACjCL,CAAAA,CAAOE,CAAAA,KAAAA,CAAMI,UAAUC,MAAO,CAAA,IAAA,CAAMF,CAAOL,CAAAA,CAAAA,CAAOC,KAAKI,CAAQ,CAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAEjE,MAAO,IAAIG,CAAAA,EAAMC,CAASC,CAAAA,IAAAA,CAAKR,CAAQ,CAAA,CAAA,CAAA,CAAG,CAC5C,CAAA,UA6BgBS,CAAAA,CAAAA,CAAYX,EAC1B,IAD0CY,CAAAA,CAAwB,CAAAC,SAAA,CAAAC,MAAA,IAAAD,SAAA,MAAAE,SAAA,CAAAF,SAAA,IAAA,EAClE,CAAA,MAAO,IAAIG,CAAAA,CAAO,CAAA,CAChBC,KAAO,CAAA,CACLC,WAAAA,SAAA,CAAAA,WAAAA,CAAYC,CAAAA,CAAMC,CAChB,CAAA,KAAAC,oBAAA,CAAAC,qBAAA,CAAAC,gBAAA,CAAAC,sBAAA,CAAAC,iBAAA,CAAAC,cAAA,CAAAC,eAAA,CAAA,IAAAN,oBAAA,CAAIT,CAAQgB,CAAAA,iBAAAA,UAAAA,oBAAAA,WAARhB,oBAAAA,CAAAA,IAAAA,CAAAA,CAAQgB,CAAAA,CAAuB,MAAO,CAAA,CAAA,CAC1C,GAAIhB,CAAQiB,CAAAA,gBAAAA,EAAAA,CAAqBjB,CAAQiB,CAAAA,gBAAAA,CAAAA,CAAAA,CAAoB,OAAO,CAGpE,CAAA,GAAMC,CAAAA,CAAOV,EAAAA,qBAAAA,EAAAA,gBAAAA,CAAAA,CAAAA,CAAMW,wDAANX,gBAAAA,CAAqBY,OAAQ,CAAA,WAAA,CAAA,UAAAV,qBAAA,UAAAA,qBAAA,CAAgB,EACpDrB,CAAAA,CAAAA,EAAAA,sBAAAA,EAAAA,iBAAAA,CAAOmB,CAAMW,CAAAA,aAAAA,UAAAA,iBAAAA,iBAANX,iBAAAA,CAAqBY,OAAQ,CAAA,YAAA,CAAA,UAAAR,sBAAA,UAAAA,sBAAA,CAAiB,GAC3D,GAAIM,CAAAA,CAAKG,IAAWhC,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,CAAKgC,OAAQ,MAAO,CAAA,CAAA,CACxC,GAAId,CAAAA,CAAKe,MAAMC,SAAUC,CAAAA,KAAAA,CAAMC,MAAOC,CAAAA,IAAAA,CAAKC,IAAKC,CAAAA,IAAAA,CAAM,MAAO,CAAA,CAAA,CAC7D,IAAKC,CAAkBxC,CAAAA,CAAAA,CAAAA,CAAO,MAAO,CAAA,CAAA,CACrC,GAAMyC,CAAAA,CAAQC,CAAAA,CAAAA,CACZ3C,CACA4C,CAAAA,CAAAA,CAAe3C,oCACfW,CAAQiC,CAAAA,WAAAA,UAAAA,eAAAA,iBAARjC,eAAAA,CAAAA,IAAAA,CAAAA,CAAQiC,CAAAA,UAAAA,cAAAA,UAAAA,cAAAA,CAAAA,CAAmB,CAG7B,CAAA,CAAA,MADA1B,CAAAA,CAAK2B,CAAAA,QAAAA,CAAS3B,CAAKe,CAAAA,KAAAA,CAAMa,GAAGC,gBAAiBN,CAAAA,CAAAA,CAAAA,CAAOO,cAC7C,CAAA,CAAA,CAAA,CAAA,CAAA,CACR,GACDC,eAAgBR,CAAAA,QAAhBQ,CAAAA,eAAgBR,CAAAA,CAAAA,MAAAA,qBAAAA,OACP9B,CAAAA,qBAAAA,CAAAA,CAAQgB,CAAAA,iBAAAA,UAAAA,qBAAAA,WAARhB,qBAAAA,CAAAA,IAAAA,CAAAA,CAAQgB,CAAAA,CAhDP,SAAqB5B,CAAgB0C,CAAAA,CAAAA,CAAAA,CAEnD,MAAO3C,CAAAA,CAAAA,CAAeC,EADT0C,CAAMS,CAAAA,OAAAA,CAAQC,WAAY,CAAA,CAAA,CAAGV,EAAMS,OAAQE,CAAAA,IAAAA,CAAM,IAAM,CAAA,IAAA,CAAA,CAEtE,EA8CYC,CAAqBtD,CAAAA,CAAQ0C,CAC7BA,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,CAIZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,d as n,F as t}from"../../../index-6f3fa4ab.esm.js";import{l as e,m as s}from"../markdown-parse.esm.js";import{h as
|
|
1
|
+
import{b as r,d as n,F as t}from"../../../index-6f3fa4ab.esm.js";import{l as e,m as s}from"../markdown-parse.esm.js";import{h as i}from"../serializer.esm.js";import"../sanitize.esm.js";import"./embeds.esm.js";function a(r,e){const s=e.split(/\r\n?|\n/).map((n=>r.nodes.paragraph.create(null,n?r.text(n):null)));return new n(t.from(s),1,1)}function m(n,t={}){return new r({props:{handlePaste(r,a){if(t.getForcePlainText?.())return!1;if(t.getMarkdownPaste&&!t.getMarkdownPaste())return!1;const m=a.clipboardData?.getData("text/html")??"",o=a.clipboardData?.getData("text/plain")??"";if(m.trim()||!o.trim())return!1;if(r.state.selection.$from.parent.type.spec.code)return!1;if(!e(o))return!1;const u=i(n,s(o),t.getSanitize?.()??!0);return r.dispatch(r.state.tr.replaceSelection(u).scrollIntoView()),!0},transformPasted:r=>t.getForcePlainText?.()?function(r,n){return a(r,n.content.textBetween(0,n.content.size,"\n","\n"))}(n,r):r}})}export{m as a,a as p};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-3ca67627.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(_index00bCjsJs){s=_index00bCjsJs.b;},function(_index00aCjsJs){r=_index00aCjsJs.a;e=_index00aCjsJs.D;},function(_serializerCjsJs){i=_serializerCjsJs.i;},function(_sanitizeCjsJs){},function(_embedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=placeholder.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var n,r,t;function s(n){if(n.childCount<=1)return n;var r=n.type.schema,t=[];return n.descendants(function(n){return!n.isInline||(n.type===r.nodes.hard_break||t.push(n),!1);}),r.nodes.doc.create(null,r.nodes.paragraph.create(null,t));}function e(){return new n({filterTransaction:function filterTransaction(n){return!n.docChanged||n.doc.childCount<=1;},props:{handleKeyDown:function handleKeyDown(n,r){return"Enter"===r.key;},transformPasted:function transformPasted(n){var s=[];return n.content.descendants(function(n){return!n.isInline||(s.push(n),!1);}),new r(t.from(s),0,0);}}});}_export({f:s,s:e});return{setters:[function(
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var n,r,t;function s(n){if(n.childCount<=1)return n;var r=n.type.schema,t=[];return n.descendants(function(n){return!n.isInline||(n.type===r.nodes.hard_break||t.push(n),!1);}),r.nodes.doc.create(null,r.nodes.paragraph.create(null,t));}function e(){return new n({filterTransaction:function filterTransaction(n){return!n.docChanged||n.doc.childCount<=1;},props:{handleKeyDown:function handleKeyDown(n,r){return"Enter"===r.key;},transformPasted:function transformPasted(n){var s=[];return n.content.descendants(function(n){return!n.isInline||(s.push(n),!1);}),new r(t.from(s),0,0);}}});}_export({f:s,s:e});return{setters:[function(_index00bCjsJs){n=_index00bCjsJs.b;r=_index00bCjsJs.d;t=_index00bCjsJs.F;}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=single-line.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../../index-89c520e9.cjs.js","../../../index-
|
|
1
|
+
System.register(["../../../index-89c520e9.cjs.js","../../../index-3ca67627.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(_index00bCjsJs){n=_index00bCjsJs.b;},function(_index00aCjsJs){t=_index00aCjsJs.D;o=_index00aCjsJs.a;}],execute:function execute(){r={active:!1,trigger:"",query:"",from:0,to:0};}};});
|
|
2
2
|
//# sourceMappingURL=suggestions.cjs.js.map
|
|
@@ -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-c3210a9c.cjs.js","../../../index-89c520e9.cjs.js","../../../index-3ca67627.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(_index00bCjsJs){},function(_index00aCjsJs){},function(_index008CjsJs){}],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,2 +1,2 @@
|
|
|
1
|
-
System.register(["./plugins/embeds.cjs.js","../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,e,a,i,n,r,o,s,l,d,f;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 c(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var a=t.trim();if(""===a)return!1;if(/^(#|\/|\.\/|\.\.\/)/.test(a))return!0;var i=/^([a-z][a-z0-9+.-]*):/i.exec(a);if(!i)return!0;var n="".concat(i[1].toLowerCase(),":");return!!d.includes(n)||!(!e||"data:"!==n)&&/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(a);}function g(t,e){var a=f[e];return t.split(";").map(function(t){return t.trim();}).filter(function(t){var e=t.slice(0,t.indexOf(":")).trim().toLowerCase();return!!(l.has(e)||a&&a.has(e))&&!/url\s*\(|expression\s*\(/i.test(t);}).join("; ");}function p(t){var e=t.tagName.toLowerCase(),a=r[e];for(var _i=0,_Array$from=Array.from(t.attributes);_i<_Array$from.length;_i++){var _i2=_Array$from[_i];var _n=_i2.name.toLowerCase();if((o.has(_n)||void 0!==a&&a.has(_n))&&!_n.startsWith("on")){if("style"===_n){var _a=g(_i2.value,e);_a?t.setAttribute("style",_a):t.removeAttribute("style");}else if("class"===_n){var _e=_i2.value.split(/\s+/).filter(function(t){return t&&!s.test(t);}).join(" ");_e?t.setAttribute("class",_e):t.removeAttribute("class");}else"id"===_n?s.test(_i2.value)&&t.removeAttribute("id"):"href"===_n||"src"===_n?c(_i2.value,"img"===e)||t.removeAttribute(_i2.name):"target"===_n&&("_blank"===_i2.value?t.setAttribute("rel","noopener noreferrer"):t.removeAttribute("target"));}else t.removeAttribute(_i2.name);}}function m(r){for(var _i3=0,_Array$from2=Array.from(r.children);_i3<_Array$from2.length;_i3++){var _o=_Array$from2[_i3];var _r=_o.tagName.toLowerCase();if(i.has(_r))_o.remove();else{if("iframe"===_r){var _o$getAttribute;if(!t((_o$getAttribute=_o.getAttribute("src"))!==null&&_o$getAttribute!==void 0?_o$getAttribute:"")){_o.remove();continue;}_o.setAttribute("sandbox",e),_o.setAttribute("referrerpolicy",a);}if("style"!==_r)n.has(_r)?(p(_o),m(_o)):(m(_o),_o.replaceWith.apply(_o,_toConsumableArray(Array.from(_o.childNodes))));else{var _o$textContent;_o.textContent=((_o$textContent=_o.textContent)!==null&&_o$textContent!==void 0?_o$textContent:"").replace(/<\/style/gi,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/@import[^;]*;?/gi,"").replace(/expression\s*\(/gi,"blocked(").replace(/(behavior|-moz-binding)(\s*):/gi,"blocked-prop$2:").replace(/url\(\s*(['"]?)([^)]*?)\1\s*\)/gi,function(t,e,a){var i=String(a).trim();return /^#/.test(i)||/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(i)?t:"url(#)";}).trim();for(var _i4=0,_Array$from3=Array.from(_o.attributes);_i4<_Array$from3.length;_i4++){var _t=_Array$from3[_i4];_o.removeAttribute(_t.name);}}}}}function w(t){var e=new DOMParser().parseFromString("<body>".concat(t,"</body>"),"text/html");return m(e.body),e.body.innerHTML;}_export({i:c,s:w});return{setters:[function(_pluginsEmbedsCjsJs){t=_pluginsEmbedsCjsJs.i;e=_pluginsEmbedsCjsJs.E;a=_pluginsEmbedsCjsJs.a;},function(
|
|
1
|
+
System.register(["./plugins/embeds.cjs.js","../../index-89c520e9.cjs.js"],function(_export,_context){"use strict";var t,e,a,i,n,r,o,s,l,d,f;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 c(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var a=t.trim();if(""===a)return!1;if(/^(#|\/|\.\/|\.\.\/)/.test(a))return!0;var i=/^([a-z][a-z0-9+.-]*):/i.exec(a);if(!i)return!0;var n="".concat(i[1].toLowerCase(),":");return!!d.includes(n)||!(!e||"data:"!==n)&&/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(a);}function g(t,e){var a=f[e];return t.split(";").map(function(t){return t.trim();}).filter(function(t){var e=t.slice(0,t.indexOf(":")).trim().toLowerCase();return!!(l.has(e)||a&&a.has(e))&&!/url\s*\(|expression\s*\(/i.test(t);}).join("; ");}function p(t){var e=t.tagName.toLowerCase(),a=r[e];for(var _i=0,_Array$from=Array.from(t.attributes);_i<_Array$from.length;_i++){var _i2=_Array$from[_i];var _n=_i2.name.toLowerCase();if((o.has(_n)||void 0!==a&&a.has(_n))&&!_n.startsWith("on")){if("style"===_n){var _a=g(_i2.value,e);_a?t.setAttribute("style",_a):t.removeAttribute("style");}else if("class"===_n){var _e=_i2.value.split(/\s+/).filter(function(t){return t&&!s.test(t);}).join(" ");_e?t.setAttribute("class",_e):t.removeAttribute("class");}else"id"===_n?s.test(_i2.value)&&t.removeAttribute("id"):"href"===_n||"src"===_n?c(_i2.value,"img"===e)||t.removeAttribute(_i2.name):"target"===_n&&("_blank"===_i2.value?t.setAttribute("rel","noopener noreferrer"):t.removeAttribute("target"));}else t.removeAttribute(_i2.name);}}function m(r){for(var _i3=0,_Array$from2=Array.from(r.children);_i3<_Array$from2.length;_i3++){var _o=_Array$from2[_i3];var _r=_o.tagName.toLowerCase();if(i.has(_r))_o.remove();else{if("iframe"===_r){var _o$getAttribute;if(!t((_o$getAttribute=_o.getAttribute("src"))!==null&&_o$getAttribute!==void 0?_o$getAttribute:"")){_o.remove();continue;}_o.setAttribute("sandbox",e),_o.setAttribute("referrerpolicy",a);}if("style"!==_r)n.has(_r)?(p(_o),m(_o)):(m(_o),_o.replaceWith.apply(_o,_toConsumableArray(Array.from(_o.childNodes))));else{var _o$textContent;_o.textContent=((_o$textContent=_o.textContent)!==null&&_o$textContent!==void 0?_o$textContent:"").replace(/<\/style/gi,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/@import[^;]*;?/gi,"").replace(/expression\s*\(/gi,"blocked(").replace(/(behavior|-moz-binding)(\s*):/gi,"blocked-prop$2:").replace(/url\(\s*(['"]?)([^)]*?)\1\s*\)/gi,function(t,e,a){var i=String(a).trim();return /^#/.test(i)||/^data:image\/(png|gif|jpe?g|webp|avif|bmp);/i.test(i)?t:"url(#)";}).trim();for(var _i4=0,_Array$from3=Array.from(_o.attributes);_i4<_Array$from3.length;_i4++){var _t=_Array$from3[_i4];_o.removeAttribute(_t.name);}}}}}function w(t){var e=new DOMParser().parseFromString("<body>".concat(t,"</body>"),"text/html");return m(e.body),e.body.innerHTML;}_export({i:c,s:w});return{setters:[function(_pluginsEmbedsCjsJs){t=_pluginsEmbedsCjsJs.i;e=_pluginsEmbedsCjsJs.E;a=_pluginsEmbedsCjsJs.a;},function(_index00bCjsJs){}],execute:function execute(){i=new Set(["script","frame","frameset","object","embed","applet","form","input","textarea","select","button","meta","link","base","title","noscript","template","svg","math","canvas","audio","video","dialog","slot"]),n=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","ul","ol","li","br","hr","a","b","strong","i","em","u","s","strike","del","span","code","sub","sup","div","font","pre","figure","figcaption","img","iframe","table","thead","tbody","tfoot","tr","td","th","colgroup","col"]),r={a:new Set(["href","title","target","rel","id","name","data-bookmark"]),table:new Set(["role","data-layout"]),ol:new Set(["start","type","data-list-style"]),ul:new Set(["data-task-list"]),figure:new Set(["data-align"]),li:new Set(["data-task-item","data-checked"]),span:new Set(["data-mention-trigger","data-mention-key","data-mention-label","data-merge-field","data-merge-label","data-math","data-math-display"]),pre:new Set(["data-language"]),img:new Set(["src","alt","title","width","height"]),td:new Set(["colspan","rowspan","data-colwidth"]),th:new Set(["colspan","rowspan","data-colwidth"]),col:new Set(["span","width"]),div:new Set(["data-embed-provider","data-width","data-align"]),iframe:new Set(["src","title","frameborder","allowfullscreen","allow","sandbox","referrerpolicy"])},o=new Set(["style","align","class","id"]),s=/^(?:nile-wysiwyg|ProseMirror)/;l=new Set(["color","background-color","font-family","font-size","font-style","font-weight","text-align","text-decoration","text-decoration-line","vertical-align","margin-left","margin-inline-start","list-style-type","line-height"]),d=["http:","https:","mailto:","tel:","ftp:"];f={img:new Set(["width","height"]),figure:new Set(["width","margin-right"]),div:new Set(["width","max-width"])};}};});
|
|
2
2
|
//# sourceMappingURL=sanitize.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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});}());}};});
|
|
1
|
+
System.register(["../../index-89c520e9.cjs.js","../../index-c3210a9c.cjs.js","./plugins/embeds.cjs.js","../../index-3ca67627.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(_index00bCjsJs){t=_index00bCjsJs.R;e=_index00bCjsJs.d;l=_index00bCjsJs.F;r=_index00bCjsJs.h;n=_index00bCjsJs.l;a=_index00bCjsJs.g;i=_index00bCjsJs.f;s=_index00bCjsJs.i;o=_index00bCjsJs.S;u=_index00bCjsJs.O;c=_index00bCjsJs.j;},function(_index001CjsJs){g=_index001CjsJs.a;},function(_pluginsEmbedsCjsJs){d=_pluginsEmbedsCjsJs.E;f=_pluginsEmbedsCjsJs.a;},function(_index00aCjsJs){},function(_index008CjsJs){}],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,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-c3210a9c.cjs.js","../../index-3ca67627.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(_index00bCjsJs){},function(_schemaCjsJs){},function(_index001CjsJs){},function(_index00aCjsJs){},function(_index008CjsJs){},function(_pluginsEmbedsCjsJs){}],execute:function execute(){}};});
|
|
2
2
|
//# sourceMappingURL=selection-state.cjs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["../../index-89c520e9.cjs.js","./sanitize.cjs.js","./plugins/embeds.cjs.js"],function(_export,_context){"use strict";var n,t,r,e,s,
|
|
1
|
+
System.register(["../../index-89c520e9.cjs.js","./sanitize.cjs.js","./plugins/embeds.cjs.js"],function(_export,_context){"use strict";var n,t,r,e,s,o;function a(n){var r=s.get(n);return r||(r=t.fromSchema(n),s.set(n,r)),r;}function c(n,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=r?e(t):t,o=new DOMParser().parseFromString("<body>".concat(s,"</body>"),"text/html");return a(n).parse(o.body);}function u(n,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=r?e(t):t,o=new DOMParser().parseFromString("<body>".concat(s,"</body>"),"text/html");return a(n).parseSlice(o.body,{preserveWhitespace:!0});}function i(n){var t=n.type.schema,e=document.createElement("div");return e.appendChild(function(n){var t=o.get(n);return t||(t=r.fromSchema(n),o.set(n,t)),t;}(t).serializeFragment(n.content)),e.innerHTML;}function f(n){return n.textBetween(0,n.content.size,"\n"," ");}function p(n){return n.toJSON();}function d(t,r){return n.fromJSON(t,r);}function m(n){var t=f(n);return{words:t.trim()?t.trim().split(/\s+/).length:0,characters:t.replace(/\n/g,"").length};}function b(n){if(n.childCount>1)return!1;var t=n.firstChild;return!t||"paragraph"===t.type.name&&0===t.content.size;}_export({a:i,b:c,c:m,d:f,e:p,h:u,i:b,j:d});return{setters:[function(_index00bCjsJs){n=_index00bCjsJs.N;t=_index00bCjsJs.D;r=_index00bCjsJs.a;},function(_sanitizeCjsJs){e=_sanitizeCjsJs.s;},function(_pluginsEmbedsCjsJs){}],execute:function execute(){s=new WeakMap(),o=new WeakMap();}};});
|
|
2
2
|
//# sourceMappingURL=serializer.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as n,D as t,a as e}from"../../index-6f3fa4ab.esm.js";import{s as r}from"./sanitize.esm.js";import"./plugins/embeds.esm.js";const s=new WeakMap,
|
|
1
|
+
import{N as n,D as t,a as e}from"../../index-6f3fa4ab.esm.js";import{s as r}from"./sanitize.esm.js";import"./plugins/embeds.esm.js";const s=new WeakMap,o=new WeakMap;function a(n){let e=s.get(n);return e||(e=t.fromSchema(n),s.set(n,e)),e}function u(n,t,e=!0){const s=e?r(t):t,o=(new DOMParser).parseFromString(`<body>${s}</body>`,"text/html");return a(n).parse(o.body)}function c(n,t,e=!0){const s=e?r(t):t,o=(new DOMParser).parseFromString(`<body>${s}</body>`,"text/html");return a(n).parseSlice(o.body,{preserveWhitespace:!0})}function i(n){const t=n.type.schema,r=document.createElement("div");return r.appendChild(function(n){let t=o.get(n);return t||(t=e.fromSchema(n),o.set(n,t)),t}(t).serializeFragment(n.content)),r.innerHTML}function f(n){return n.textBetween(0,n.content.size,"\n"," ")}function m(n){return n.toJSON()}function p(t,e){return n.fromJSON(t,e)}function d(n){const t=f(n);return{words:t.trim()?t.trim().split(/\s+/).length:0,characters:t.replace(/\n/g,"").length}}function b(n){if(n.childCount>1)return!1;const t=n.firstChild;return!t||"paragraph"===t.type.name&&0===t.content.size}export{i as a,u as b,d as c,f as d,m as e,c as h,b as i,p as j};
|