Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quill-html-edit-button

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quill-html-edit-button - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

2

dist/demo.min.js

@@ -1,2 +0,2 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Quill"));else if("function"==typeof define&&define.amd)define(["Quill"],e);else{var n="object"==typeof exports?e(require("Quill")):e(t.Quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlEditButton=void 0,n(2);var a=l(n(0));function u(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}var c=!1,f={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return c?console.log.bind(console,this.prefixString()):function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}}},p=function(){function t(t,e){var n=e||{};c=!(!n||!n.debug),f.log("logging enabled");var r=t.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();var o=r.container,l=u("span");s(l,"class","ql-formats");var p=u("button");p.innerHTML=n.buttonHTML||"&lt;&gt;",p.title=n.buttonTitle||"Show HTML source",p.onclick=function(e){e.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=u("div"),o=u("div"),l=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',c=e.cancelText||"Cancel",p=e.okText||"Ok",d=!1!==e.closeOnClickOverlay;s(o,"class","ql-html-overlayContainer"),s(r,"class","ql-html-popupContainer");var h=u("span");s(h,"class","ql-html-popupTitle"),h.innerText=l;var b=u("div");b.appendChild(h),s(b,"class","ql-html-textContainer");var v=u("pre");s(v,"data-language","xml"),v.innerText=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i=null,l="",a=0;a<=t.length;a++){r=o,o=t.substr(a,1),i=t.substr(a+1,1);var u="<br>"===t.substr(a,4),s="<"===o&&"/"!==i&&!u,c="<"===o&&"/"===i&&!u,p=">"===r&&"<"!==o&&n>0,d=!u&&!s&&!c&&p&&""===t.substr(a,t.substr(a).indexOf("<")).trim();u&&(l+="\n",n--,a+=4),s?(l+="\n"+e.repeat(n),n++):c?(--n<0&&(n=0),l+="\n"+e.repeat(n)):(" "===o&&" "===i||"\n"===o&&""===t.substr(a,t.substr(a).indexOf("<")).trim())&&(o=""),p&&!d&&(l+="\n"+e.repeat(n)),l+=o}return f.log("formatHTML",{before:t,after:l}),l}(n);var m=u("div");s(m,"class","ql-html-textArea");var y=u("button");y.innerHTML=c,s(y,"class","ql-html-buttonCancel");var g=u("button");g.innerHTML=p,s(g,"class","ql-html-buttonOk");var x=u("div");s(x,"class","ql-html-buttonGroup");var w=document.querySelector(e.prependSelector);x.appendChild(y),x.appendChild(g),m.appendChild(v),b.appendChild(m),b.appendChild(x),r.appendChild(b),o.appendChild(r),w?w.prepend(o):document.body.appendChild(o);var C=e&&e.editorModules,O=C&&Object.keys(C).length?C:{},j=new a.default(m,{modules:i({syntax:e.syntax},O)});y.onclick=function(){w?w.removeChild(o):document.body.removeChild(o)},d&&(o.onclick=y.onclick);r.onclick=function(t){t.preventDefault(),t.stopPropagation()},g.onclick=function(){var e=j.container.querySelector(".ql-editor").innerText.replace(/\s+/g," ").replace(/(<[^\/<>]+>)\s+/g,"$1").replace(/<\/(p|ol|ul)>\s/g,"</$1>").replace(/\s<(p|ol|ul)>/g,"<$1>").replace(/<\/li>\s<li>/g,"</li><li>").replace(/\s<\//g,"</").replace(/(<[^\/<>]+>)\s(<[^\/<>]+>)/g,"$1$2").trim();t.container.querySelector(".ql-editor").innerHTML=e,w?w.removeChild(o):document.body.removeChild(o)}}(t,n)},l.appendChild(p),o.appendChild(l)}return t.prototype.registerDivModule=function(){var t=a.default.import("blots/block"),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t);e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),a.default.register(e)},t}();e.htmlEditButton=p,window.htmlEditButton=p,e.default=p},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n background: #fff;\n position: absolute;\n left: 15px;\n width: calc(100% - 30px);\n height: calc(100% - 116px);\n}\n\n.ql-html-textArea .ql-syntax {\n word-break: break-all;\n white-space: pre-wrap;\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n font-style: italic;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(l=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var l=t[o];"number"==typeof l[0]&&r[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(t,e,n){var r,o,i={},l=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](r.parts[l]);for(;l<r.parts.length;l++)o.parts.push(y(r.parts[l],e))}else{var a=[];for(l=0;l<r.parts.length;l++)a.push(y(r.parts[l],e));i[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],l=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[l]?r[l].parts.push(a):n.push(r[l]={id:l,parts:[a]})}return n}function h(t,e){var n=a(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=u||(u=v(e)),r=w.bind(null,n,l,!1),o=w.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=O.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var l=n[o];(a=i[l.id]).refs--,r.push(a)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete i[a.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function O(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var l=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(0)),i=n(1);o.default.register("modules/htmlEditButton",i.htmlEditButton);console.log("Demo loaded...");new o.default("#editor",{theme:"snow",modules:{toolbar:{container:[[{header:[1,2,3,!1]}],["bold","italic"],["clean"],["image"],[{list:"ordered"},{list:"bullet"}]]},htmlEditButton:{debug:!0,syntax:!0}}})}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("quill"));else if("function"==typeof define&&define.amd)define(["quill"],e);else{var n="object"==typeof exports?e(require("quill")):e(t.quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=7)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlEditButton=void 0,n(2);var a=l(n(0));function u(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}var c=!1,f={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return c?console.log.bind(console,this.prefixString()):function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}}},p=function(){function t(t,e){var n=e||{};c=!(!n||!n.debug),f.log("logging enabled");var r=t.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();var o=r.container,l=u("span");s(l,"class","ql-formats");var p=u("button");p.innerHTML=n.buttonHTML||"&lt;&gt;",p.title=n.buttonTitle||"Show HTML source",p.onclick=function(e){e.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=u("div"),o=u("div"),l=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',c=e.cancelText||"Cancel",p=e.okText||"Ok",d=!1!==e.closeOnClickOverlay;s(o,"class","ql-html-overlayContainer"),s(r,"class","ql-html-popupContainer");var h=u("span");s(h,"class","ql-html-popupTitle"),h.innerText=l;var b=u("div");b.appendChild(h),s(b,"class","ql-html-textContainer");var v=u("pre");s(v,"data-language","xml"),v.innerText=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i=null,l="",a=0;a<=t.length;a++){r=o,o=t.substr(a,1),i=t.substr(a+1,1);var u="<br>"===t.substr(a,4),s="<"===o&&"/"!==i&&!u,c="<"===o&&"/"===i&&!u,p=">"===r&&"<"!==o&&n>0,d=!u&&!s&&!c&&p&&""===t.substr(a,t.substr(a).indexOf("<")).trim();u&&(l+="\n",n--,a+=4),s?(l+="\n"+e.repeat(n),n++):c?(--n<0&&(n=0),l+="\n"+e.repeat(n)):(" "===o&&" "===i||"\n"===o&&""===t.substr(a,t.substr(a).indexOf("<")).trim())&&(o=""),p&&!d&&(l+="\n"+e.repeat(n)),l+=o}return f.log("formatHTML",{before:t,after:l}),l}(n);var m=u("div");s(m,"class","ql-html-textArea");var y=u("button");y.innerHTML=c,s(y,"class","ql-html-buttonCancel");var g=u("button");g.innerHTML=p,s(g,"class","ql-html-buttonOk");var x=u("div");s(x,"class","ql-html-buttonGroup");var w=document.querySelector(e.prependSelector);x.appendChild(y),x.appendChild(g),m.appendChild(v),b.appendChild(m),b.appendChild(x),r.appendChild(b),o.appendChild(r),w?w.prepend(o):document.body.appendChild(o);var C=e&&e.editorModules,O=C&&Object.keys(C).length?C:{},q=new a.default(m,{modules:i({syntax:e.syntax},O)});y.onclick=function(){w?w.removeChild(o):document.body.removeChild(o)},d&&(o.onclick=y.onclick);r.onclick=function(t){t.preventDefault(),t.stopPropagation()},g.onclick=function(){var e=q.container.querySelector(".ql-editor").innerText.replace(/\s+/g," ").replace(/(<[^\/<>]+>)\s+/g,"$1").replace(/<\/(p|ol|ul)>\s/g,"</$1>").replace(/\s<(p|ol|ul)>/g,"<$1>").replace(/<\/li>\s<li>/g,"</li><li>").replace(/\s<\//g,"</").replace(/(<[^\/<>]+>)\s(<[^\/<>]+>)/g,"$1$2").trim();t.container.querySelector(".ql-editor").innerHTML=e,w?w.removeChild(o):document.body.removeChild(o)}}(t,n)},l.appendChild(p),o.appendChild(l)}return t.prototype.registerDivModule=function(){var t=a.default.import("blots/block"),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t);e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),a.default.register(e)},t}();e.htmlEditButton=p,window.htmlEditButton=p,e.default=p},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n background: #fff;\n position: absolute;\n left: 15px;\n width: calc(100% - 30px);\n height: calc(100% - 116px);\n}\n\n.ql-html-textArea .ql-syntax {\n word-break: break-all;\n white-space: pre-wrap;\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n font-style: italic;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(l=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var l=t[o];"number"==typeof l[0]&&r[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(t,e,n){var r,o,i={},l=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](r.parts[l]);for(;l<r.parts.length;l++)o.parts.push(y(r.parts[l],e))}else{var a=[];for(l=0;l<r.parts.length;l++)a.push(y(r.parts[l],e));i[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],l=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[l]?r[l].parts.push(a):n.push(r[l]={id:l,parts:[a]})}return n}function h(t,e){var n=a(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=u||(u=v(e)),r=w.bind(null,n,l,!1),o=w.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=O.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var l=n[o];(a=i[l.id]).refs--,r.push(a)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete i[a.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function O(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var l=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(n(0)),i=n(1);o.default.register("modules/htmlEditButton",i.htmlEditButton);console.log("Demo loaded...");new o.default("#editor",{theme:"snow",modules:{toolbar:{container:[[{header:[1,2,3,!1]}],["bold","italic"],["clean"],["image"],[{list:"ordered"},{list:"bullet"}]]},htmlEditButton:{debug:!0,syntax:!0}}})}])}));
//# sourceMappingURL=demo.min.js.map

@@ -1,2 +0,2 @@

!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("Quill"));else if("function"==typeof define&&define.amd)define(["Quill"],e);else{var n="object"==typeof exports?e(require("Quill")):e(t.Quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlEditButton=void 0,n(2);var a=l(n(0));function u(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}var c=!1,f={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return c?console.log.bind(console,this.prefixString()):function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}}},p=function(){function t(t,e){var n=e||{};c=!(!n||!n.debug),f.log("logging enabled");var r=t.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();var o=r.container,l=u("span");s(l,"class","ql-formats");var p=u("button");p.innerHTML=n.buttonHTML||"&lt;&gt;",p.title=n.buttonTitle||"Show HTML source",p.onclick=function(e){e.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=u("div"),o=u("div"),l=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',c=e.cancelText||"Cancel",p=e.okText||"Ok",d=!1!==e.closeOnClickOverlay;s(o,"class","ql-html-overlayContainer"),s(r,"class","ql-html-popupContainer");var h=u("span");s(h,"class","ql-html-popupTitle"),h.innerText=l;var b=u("div");b.appendChild(h),s(b,"class","ql-html-textContainer");var v=u("pre");s(v,"data-language","xml"),v.innerText=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i=null,l="",a=0;a<=t.length;a++){r=o,o=t.substr(a,1),i=t.substr(a+1,1);var u="<br>"===t.substr(a,4),s="<"===o&&"/"!==i&&!u,c="<"===o&&"/"===i&&!u,p=">"===r&&"<"!==o&&n>0,d=!u&&!s&&!c&&p&&""===t.substr(a,t.substr(a).indexOf("<")).trim();u&&(l+="\n",n--,a+=4),s?(l+="\n"+e.repeat(n),n++):c?(--n<0&&(n=0),l+="\n"+e.repeat(n)):(" "===o&&" "===i||"\n"===o&&""===t.substr(a,t.substr(a).indexOf("<")).trim())&&(o=""),p&&!d&&(l+="\n"+e.repeat(n)),l+=o}return f.log("formatHTML",{before:t,after:l}),l}(n);var m=u("div");s(m,"class","ql-html-textArea");var y=u("button");y.innerHTML=c,s(y,"class","ql-html-buttonCancel");var g=u("button");g.innerHTML=p,s(g,"class","ql-html-buttonOk");var x=u("div");s(x,"class","ql-html-buttonGroup");var w=document.querySelector(e.prependSelector);x.appendChild(y),x.appendChild(g),m.appendChild(v),b.appendChild(m),b.appendChild(x),r.appendChild(b),o.appendChild(r),w?w.prepend(o):document.body.appendChild(o);var C=e&&e.editorModules,O=C&&Object.keys(C).length?C:{},j=new a.default(m,{modules:i({syntax:e.syntax},O)});y.onclick=function(){w?w.removeChild(o):document.body.removeChild(o)},d&&(o.onclick=y.onclick);r.onclick=function(t){t.preventDefault(),t.stopPropagation()},g.onclick=function(){var e=j.container.querySelector(".ql-editor").innerText.replace(/\s+/g," ").replace(/(<[^\/<>]+>)\s+/g,"$1").replace(/<\/(p|ol|ul)>\s/g,"</$1>").replace(/\s<(p|ol|ul)>/g,"<$1>").replace(/<\/li>\s<li>/g,"</li><li>").replace(/\s<\//g,"</").replace(/(<[^\/<>]+>)\s(<[^\/<>]+>)/g,"$1$2").trim();t.container.querySelector(".ql-editor").innerHTML=e,w?w.removeChild(o):document.body.removeChild(o)}}(t,n)},l.appendChild(p),o.appendChild(l)}return t.prototype.registerDivModule=function(){var t=a.default.import("blots/block"),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t);e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),a.default.register(e)},t}();e.htmlEditButton=p,window.htmlEditButton=p,e.default=p},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n background: #fff;\n position: absolute;\n left: 15px;\n width: calc(100% - 30px);\n height: calc(100% - 116px);\n}\n\n.ql-html-textArea .ql-syntax {\n word-break: break-all;\n white-space: pre-wrap;\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n font-style: italic;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(l=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var l=t[o];"number"==typeof l[0]&&r[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(t,e,n){var r,o,i={},l=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](r.parts[l]);for(;l<r.parts.length;l++)o.parts.push(y(r.parts[l],e))}else{var a=[];for(l=0;l<r.parts.length;l++)a.push(y(r.parts[l],e));i[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],l=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[l]?r[l].parts.push(a):n.push(r[l]={id:l,parts:[a]})}return n}function h(t,e){var n=a(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=u||(u=v(e)),r=w.bind(null,n,l,!1),o=w.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=O.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var l=n[o];(a=i[l.id]).refs--,r.push(a)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete i[a.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function O(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var l=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}}])}));
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("quill"));else if("function"==typeof define&&define.amd)define(["quill"],e);else{var n="object"==typeof exports?e(require("quill")):e(t.quill);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.htmlEditButton=void 0,n(2);var a=l(n(0));function u(t){return document.createElement(t)}function s(t,e,n){return t.setAttribute(e,n)}var c=!1,f={prefixString:function(){return"</> quill-html-edit-button: "},get log(){return c?console.log.bind(console,this.prefixString()):function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}}},p=function(){function t(t,e){var n=e||{};c=!(!n||!n.debug),f.log("logging enabled");var r=t.getModule("toolbar");if(!r)throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');this.registerDivModule();var o=r.container,l=u("span");s(l,"class","ql-formats");var p=u("button");p.innerHTML=n.buttonHTML||"&lt;&gt;",p.title=n.buttonTitle||"Show HTML source",p.onclick=function(e){e.preventDefault(),function(t,e){var n=t.container.querySelector(".ql-editor").innerHTML,r=u("div"),o=u("div"),l=e.msg||'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced',c=e.cancelText||"Cancel",p=e.okText||"Ok",d=!1!==e.closeOnClickOverlay;s(o,"class","ql-html-overlayContainer"),s(r,"class","ql-html-popupContainer");var h=u("span");s(h,"class","ql-html-popupTitle"),h.innerText=l;var b=u("div");b.appendChild(h),s(b,"class","ql-html-textContainer");var v=u("pre");s(v,"data-language","xml"),v.innerText=function(t){for(var e=" ".repeat(2),n=0,r=null,o=null,i=null,l="",a=0;a<=t.length;a++){r=o,o=t.substr(a,1),i=t.substr(a+1,1);var u="<br>"===t.substr(a,4),s="<"===o&&"/"!==i&&!u,c="<"===o&&"/"===i&&!u,p=">"===r&&"<"!==o&&n>0,d=!u&&!s&&!c&&p&&""===t.substr(a,t.substr(a).indexOf("<")).trim();u&&(l+="\n",n--,a+=4),s?(l+="\n"+e.repeat(n),n++):c?(--n<0&&(n=0),l+="\n"+e.repeat(n)):(" "===o&&" "===i||"\n"===o&&""===t.substr(a,t.substr(a).indexOf("<")).trim())&&(o=""),p&&!d&&(l+="\n"+e.repeat(n)),l+=o}return f.log("formatHTML",{before:t,after:l}),l}(n);var m=u("div");s(m,"class","ql-html-textArea");var y=u("button");y.innerHTML=c,s(y,"class","ql-html-buttonCancel");var g=u("button");g.innerHTML=p,s(g,"class","ql-html-buttonOk");var x=u("div");s(x,"class","ql-html-buttonGroup");var w=document.querySelector(e.prependSelector);x.appendChild(y),x.appendChild(g),m.appendChild(v),b.appendChild(m),b.appendChild(x),r.appendChild(b),o.appendChild(r),w?w.prepend(o):document.body.appendChild(o);var C=e&&e.editorModules,q=C&&Object.keys(C).length?C:{},O=new a.default(m,{modules:i({syntax:e.syntax},q)});y.onclick=function(){w?w.removeChild(o):document.body.removeChild(o)},d&&(o.onclick=y.onclick);r.onclick=function(t){t.preventDefault(),t.stopPropagation()},g.onclick=function(){var e=O.container.querySelector(".ql-editor").innerText.replace(/\s+/g," ").replace(/(<[^\/<>]+>)\s+/g,"$1").replace(/<\/(p|ol|ul)>\s/g,"</$1>").replace(/\s<(p|ol|ul)>/g,"<$1>").replace(/<\/li>\s<li>/g,"</li><li>").replace(/\s<\//g,"</").replace(/(<[^\/<>]+>)\s(<[^\/<>]+>)/g,"$1$2").trim();t.container.querySelector(".ql-editor").innerHTML=e,w?w.removeChild(o):document.body.removeChild(o)}}(t,n)},l.appendChild(p),o.appendChild(l)}return t.prototype.registerDivModule=function(){var t=a.default.import("blots/block"),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(t);e.tagName="div",e.blotName="div",e.allowedChildren=t.allowedChildren,e.allowedChildren.push(t),a.default.register(e)},t}();e.htmlEditButton=p,window.htmlEditButton=p,e.default=p},function(t,e,n){var r=n(3);"string"==typeof r&&(r=[[t.i,r,""]]);var o={hmr:!0,transform:void 0};n(5)(r,o);r.locals&&(t.exports=r.locals)},function(t,e,n){(t.exports=n(4)(!1)).push([t.i,".ql-html-overlayContainer {\n background: #0000007d;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 9999;\n}\n\n.ql-html-popupContainer {\n background: #ddd;\n position: absolute;\n top: 5%;\n left: 5%;\n right: 5%;\n bottom: 5%;\n border-radius: 10px;\n}\n\n.ql-html-textContainer {\n position: relative;\n height: calc(100% - 40px);\n padding: 20px;\n}\n\n.ql-html-textArea {\n background: #fff;\n position: absolute;\n left: 15px;\n width: calc(100% - 30px);\n height: calc(100% - 116px);\n}\n\n.ql-html-textArea .ql-syntax {\n word-break: break-all;\n white-space: pre-wrap;\n}\n\n.ql-html-buttonCancel {\n margin-right: 20px;\n}\n\n.ql-html-popupTitle {\n margin: 0;\n display: block;\n font-style: italic;\n}\n\n.ql-html-buttonGroup {\n position: absolute;\n bottom: 20px;\n transform: scale(1.5);\n left: calc(50% - 60px);\n}\n",""])},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",r=t[3];if(!r)return n;if(e&&"function"==typeof btoa){var o=(l=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),i=r.sources.map((function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"}));return[n].concat(i).concat([o]).join("\n")}var l;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},o=0;o<this.length;o++){var i=this[o][0];"number"==typeof i&&(r[i]=!0)}for(o=0;o<t.length;o++){var l=t[o];"number"==typeof l[0]&&r[l[0]]||(n&&!l[2]?l[2]=n:n&&(l[2]="("+l[2]+") and ("+n+")"),e.push(l))}},e}},function(t,e,n){var r,o,i={},l=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),a=function(t){var e={};return function(n){if(void 0===e[n]){var r=t.call(this,n);if(r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(t){r=null}e[n]=r}return e[n]}}((function(t){return document.querySelector(t)})),u=null,s=0,c=[],f=n(6);function p(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=i[r.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](r.parts[l]);for(;l<r.parts.length;l++)o.parts.push(y(r.parts[l],e))}else{var a=[];for(l=0;l<r.parts.length;l++)a.push(y(r.parts[l],e));i[r.id]={id:r.id,refs:1,parts:a}}}}function d(t,e){for(var n=[],r={},o=0;o<t.length;o++){var i=t[o],l=e.base?i[0]+e.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};r[l]?r[l].parts.push(a):n.push(r[l]={id:l,parts:[a]})}return n}function h(t,e){var n=a(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=c[c.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),c.push(e);else if("bottom"===t.insertAt)n.appendChild(e);else{if("object"!=typeof t.insertAt||!t.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=a(t.insertInto+" "+t.insertAt.before);n.insertBefore(e,o)}}function b(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=c.indexOf(t);e>=0&&c.splice(e,1)}function v(t){var e=document.createElement("style");return t.attrs.type="text/css",m(e,t.attrs),h(t,e),e}function m(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,r,o,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var l=s++;n=u||(u=v(e)),r=w.bind(null,n,l,!1),o=w.bind(null,n,l,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",m(e,t.attrs),h(t,e),e}(e),r=q.bind(null,n,e),o=function(){b(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(e),r=C.bind(null,n),o=function(){b(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else o()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=l()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return p(n,e),function(t){for(var r=[],o=0;o<n.length;o++){var l=n[o];(a=i[l.id]).refs--,r.push(a)}t&&p(d(t,e),e);for(o=0;o<r.length;o++){var a;if(0===(a=r[o]).refs){for(var u=0;u<a.parts.length;u++)a.parts[u]();delete i[a.id]}}}};var g,x=(g=[],function(t,e){return g[t]=e,g.filter(Boolean).join("\n")});function w(t,e,n,r){var o=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=x(e,o);else{var i=document.createTextNode(o),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(i,l[e]):t.appendChild(i)}}function C(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function q(t,e,n){var r=n.css,o=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||i)&&(r=f(r)),o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var l=new Blob([r],{type:"text/css"}),a=t.href;t.href=URL.createObjectURL(l),a&&URL.revokeObjectURL(a)}},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,r=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var o,i=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(i)?t:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")}))}}])}));
//# sourceMappingURL=quill.htmlEditButton.min.js.map
{
"name": "quill-html-edit-button",
"description": "A Quill rich text editor Module which adds an html edit button to the quill editor",
"version": "2.0.9",
"version": "2.1.0",
"main": "dist/quill.htmlEditButton.min.js",

@@ -6,0 +6,0 @@ "repository": "https://github.com/benwinding/quill-html-edit-button",

@@ -22,3 +22,3 @@ const path = require("path");

externals: {
quill: "Quill",
quill: "quill",
},

@@ -25,0 +25,0 @@ devtool: isProd ? "source-map" : "inline-source-map",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc