/** * Skipped minification because the original files appears to be already minified. * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.List=t():e.List=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=0)}([function(e,t,n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n ',default:!1},{name:"ordered",title:this.api.i18n.t("Ordered"),icon:'',default:!0},{name:"removeTab",title:this.api.i18n.t("Remove Tab"),icon:'',default:!1},{name:"addTab",title:this.api.i18n.t("Add Tab"),icon:'',default:!1}],this._data={style:this.settings.find((function(e){return!0===e.default})).name,items:[]},this.data=n,this.selectedItem=null}return a(e,null,[{key:"enableLineBreaks",get:function(){return!0}},{key:"toolbox",get:function(){return{icon:' ',title:"List"}}}]),a(e,[{key:"render",value:function(){var e=this,t="ordered"===this._data.style?this.CSS.wrapperOrdered:this.CSS.wrapperUnordered;return this._elements.wrapper=this._make("ul",[this.CSS.baseBlock,this.CSS.wrapper,t],{contentEditable:!0}),this._data.items.length?this._elements.wrapper=this.createAllElm(this._data.items):this._elements.wrapper.appendChild(this._make("li",this.CSS.item,{tabIndex:"0"})),this._elements.wrapper.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:e.getOutofList(t);break;case 8:e.backspace(t);break;case 9:t.shiftKey?"UL"===e.currentItem.parentNode.parentNode.tagName&&e.removeTab(t):e.addTab(t)}}),!1),this._elements.wrapper.addEventListener("click",(function(t){e.selectedItem=window.getSelection().anchorNode,e.selectedItem="LI"===e.selectedItem.parentElement.nodeName?e.selectedItem.parentElement:e.selectedItem.parentElement.parentElement})),this._elements.wrapper}},{key:"save",value:function(){return this.data}},{key:"renderSettings",value:function(){var e=this,t=this._make("div",[this.CSS.settingsWrapper],{});return this.settings.forEach((function(n){var r=e._make("div",e.CSS.settingsButton,{innerHTML:n.icon});r.addEventListener("click",(function(){e.toggleTune(n.name);var t=r.parentNode.querySelectorAll("."+e.CSS.settingsButton);Array.from(t).forEach((function(t){return t.classList.remove(e.CSS.settingsButtonActive)})),c.includes(n.name)&&r.classList.toggle(e.CSS.settingsButtonActive)})),e.api.tooltip.onHover(r,n.title,{placement:"top",hidingDelay:500}),e._data.style===n.name&&r.classList.add(e.CSS.settingsButtonActive),e.setEndOfContentEditable(e.selectedItem),t.appendChild(r)})),t}},{key:"onPaste",value:function(e){var t=e.detail.data;this.data=this.pasteHandler(t)}},{key:"toggleTune",value:function(e){if(c.includes(e)){this._elements.wrapper.classList.toggle(this.CSS.wrapperOrdered,"ordered"===e),this._elements.wrapper.classList.toggle(this.CSS.wrapperUnordered,"unordered"===e);for(var t=this._elements.wrapper.querySelectorAll("ul"),n=0;n1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement(e);Array.isArray(n)?(t=i.classList).add.apply(t,o(n)):n&&i.classList.add(n);for(var a in r)i[a]=r[a];return i}},{key:"createAllElm",value:function(e){var t=this,n="ordered"===this._data.style?this.CSS.wrapperOrdered:this.CSS.wrapperUnordered,i=this._make("ul",[this.CSS.baseBlock,this.CSS.wrapper,n],{contentEditable:!0});return e.forEach((function(e){"object"==r(e)?i.appendChild(t.createAllElm(e)):i.appendChild(t._make("li",t.CSS.item,{innerHTML:e,tabIndex:"0"}))})),i}},{key:"getOutofList",value:function(e){var t=this._elements.wrapper.querySelectorAll("."+this.CSS.item);if(!(t.length<2)){var n=t[t.length-1],r=this.currentItem;r!==n||n.textContent.trim().length||(r.parentElement.removeChild(r),this.api.blocks.insert(void 0,void 0,void 0,void 0,!0),e.preventDefault(),e.stopPropagation())}}},{key:"backspace",value:function(e){var t=this._elements.wrapper.querySelectorAll("."+this.CSS.item),n=t[0];n&&t.length<2&&!n.innerHTML.replace("
"," ").trim()&&e.preventDefault()}},{key:"addTab",value:function(e){var t=this.unorderedList,n=this.currentItem;if(this.currentItem!=n.parentNode.childNodes[0]){if(this.currentItem.nextSibling||"UL"===this.currentItem.previousSibling.tagName)if(this.currentItem.nextSibling||"UL"!=this.currentItem.previousSibling.tagName)if(null!=this.currentItem.nextSibling&&"LI"===this.currentItem.nextSibling.tagName&&"UL"!==this.currentItem.previousSibling.tagName)this.currentItem.parentNode.insertBefore(t,this.currentItem.nextSibling),t.appendChild(this.currentItem);else if(null!=this.currentItem.nextSibling&&"UL"===this.currentItem.nextSibling.tagName&&"UL"===this.currentItem.previousSibling.tagName){for(var r=[n].concat(o(this.currentItem.nextSibling.childNodes)),i=0;i=i})),s=null,l=0;l"," ").trim();"UL"==t[r].tagName?n.push(e(t[r].childNodes)):i&&n.push(t[r].innerHTML)}return n}(e),this._data}},{key:"currentItem",get:function(){var e=window.getSelection().anchorNode;return e.nodeType!==Node.ELEMENT_NODE&&(e=e.parentNode),e.closest(".".concat(this.CSS.item))}},{key:"unorderedList",get:function(){var e="ordered"===this._data.style?this.CSS.wrapperOrdered:this.CSS.wrapperUnordered;return this._make("ul",[this.CSS.baseBlock,this.CSS.wrapper,e],{contentEditable:!0})}}],[{key:"conversionConfig",get:function(){return{export:function(e){return e.items.join(". ")},import:function(e){return{items:[e],style:"unordered"}}}}},{key:"sanitize",get:function(){return{style:{},items:{br:!0}}}},{key:"pasteConfig",get:function(){return{tags:["OL","UL","LI"]}}}]),e}();e.exports=d},function(e,t,n){var r=n(2),i=n(3);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={insert:"head",singleton:!1};r(i,a);e.exports=i.locals||{}},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function s(e){for(var t=-1,n=0;n