quill
Version:
Your powerful, rich text editor
221 lines (192 loc) • 507 kB
JavaScript
/*!
* Quill Editor v2.0.0-dev.3
* https://quilljs.com/
* Copyright (c) 2014, Jason Chen
* Copyright (c) 2013, salesforce.com
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["Quill"] = factory();
else
root["Quill"] = factory();
})(window, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 2);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./blots/block.js":
/*!************************!*\
!*** ./blots/block.js ***!
\************************/
/*! exports provided: blockDelta, bubbleFormats, BlockEmbed, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blockDelta\", function() { return blockDelta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bubbleFormats\", function() { return bubbleFormats; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BlockEmbed\", function() { return BlockEmbed; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Block; });\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _inline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./inline */ \"./blots/inline.js\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\n\n\n\n\nconst NEWLINE_LENGTH = 1;\n\nclass Block extends parchment__WEBPACK_IMPORTED_MODULE_2__[\"BlockBlot\"] {\n constructor(scroll, domNode) {\n super(scroll, domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = blockDelta(this);\n }\n\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n\n if (this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_2__[\"Scope\"].BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) {\n super.insertAt(index, value, def);\n this.cache = {};\n return;\n }\n\n if (value.length === 0) return;\n const lines = value.split('\\n');\n const text = lines.shift();\n\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n\n this.cache = {};\n }\n\n let block = this;\n lines.reduce((lineIndex, line) => {\n block = block.split(lineIndex, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n const {\n head\n } = this.children;\n super.insertBefore(blot, ref);\n\n if (head instanceof _break__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n head.remove();\n }\n\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n const clone = this.clone();\n\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n }\n\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n\n const next = super.split(index, force);\n this.cache = {};\n return next;\n }\n\n}\n\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = _break__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\nBlock.allowedChildren = [_break__WEBPACK_IMPORTED_MODULE_3__[\"default\"], _inline__WEBPACK_IMPORTED_MODULE_4__[\"default\"], parchment__WEBPACK_IMPORTED_MODULE_2__[\"EmbedBlot\"], _text__WEBPACK_IMPORTED_MODULE_5__[\"default\"]];\n\nclass BlockEmbed extends parchment__WEBPACK_IMPORTED_MODULE_2__[\"EmbedBlot\"] {\n attach() {\n super.attach();\n this.attributes = new parchment__WEBPACK_IMPORTED_MODULE_2__[\"AttributorStore\"](this.domNode);\n }\n\n delta() {\n return new quill_delta__WEBPACK_IMPORTED_MODULE_1___default.a().insert(this.value(), extend__WEBPACK_IMPORTED_MODULE_0___default()(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n const attribute = this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_2__[\"Scope\"].BLOCK_ATTRIBUTE);\n\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n const block = this.scroll.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n\n}\n\nBlockEmbed.scope = parchment__WEBPACK_IMPORTED_MODULE_2__[\"Scope\"].BLOCK_BLOT; // It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\nfunction blockDelta(blot, filter = true) {\n return blot.descendants(parchment__WEBPACK_IMPORTED_MODULE_2__[\"LeafBlot\"]).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n }\n\n return delta.insert(leaf.value(), bubbleFormats(leaf, {}, filter));\n }, new quill_delta__WEBPACK_IMPORTED_MODULE_1___default.a()).insert('\\n', bubbleFormats(blot));\n}\n\nfunction bubbleFormats(blot, formats = {}, filter = true) {\n if (blot == null) return formats;\n\n if (typeof blot.formats === 'function') {\n formats = extend__WEBPACK_IMPORTED_MODULE_0___default()(formats, blot.formats());\n\n if (filter) {\n // exclude syntax highlighting from deltas and getFormat()\n delete formats['code-token'];\n }\n }\n\n if (blot.parent == null || blot.parent.statics.blotName === 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n\n return bubbleFormats(blot.parent, formats, filter);\n}\n\n\n\n//# sourceURL=webpack://Quill/./blots/block.js?");
/***/ }),
/***/ "./blots/break.js":
/*!************************!*\
!*** ./blots/break.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n\n\nclass Break extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static value() {\n return undefined;\n }\n\n optimize() {\n if (this.prev || this.next) {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n\n}\n\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n/* harmony default export */ __webpack_exports__[\"default\"] = (Break);\n\n//# sourceURL=webpack://Quill/./blots/break.js?");
/***/ }),
/***/ "./blots/container.js":
/*!****************************!*\
!*** ./blots/container.js ***!
\****************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n\n\nclass Container extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"ContainerBlot\"] {}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Container);\n\n//# sourceURL=webpack://Quill/./blots/container.js?");
/***/ }),
/***/ "./blots/cursor.js":
/*!*************************!*\
!*** ./blots/cursor.js ***!
\*************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\n\nclass Cursor extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n static value() {\n return undefined;\n }\n\n constructor(scroll, domNode, selection) {\n super(scroll, domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this.savedLength = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this.savedLength !== 0) {\n super.format(name, value);\n return;\n }\n\n let target = this;\n let index = 0;\n\n while (target != null && target.statics.scope !== parchment__WEBPACK_IMPORTED_MODULE_0__[\"Scope\"].BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n\n if (target != null) {\n this.savedLength = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this.savedLength = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this.savedLength;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return null;\n const range = this.selection.getNativeRange(); // Link format will insert text outside of anchor tag\n\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n\n const prevTextBlot = this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? this.prev : null;\n const prevTextLength = prevTextBlot ? prevTextBlot.length() : 0;\n const nextTextBlot = this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"] ? this.next : null;\n const nextText = nextTextBlot ? nextTextBlot.text : '';\n const {\n textNode\n } = this; // take text from inside this blot and reset it\n\n const newText = textNode.data.split(Cursor.CONTENTS).join('');\n textNode.data = Cursor.CONTENTS; // proactively merge TextBlots around cursor so that optimization\n // doesn't lose the cursor. the reason we are here in cursor.restore\n // could be that the user clicked in prevTextBlot or nextTextBlot, or\n // the user typed something.\n\n let mergedTextBlot;\n\n if (prevTextBlot) {\n mergedTextBlot = prevTextBlot;\n\n if (newText || nextTextBlot) {\n prevTextBlot.insertAt(prevTextBlot.length(), newText + nextText);\n\n if (nextTextBlot) {\n nextTextBlot.remove();\n }\n }\n } else if (nextTextBlot) {\n mergedTextBlot = nextTextBlot;\n nextTextBlot.insertAt(0, newText);\n } else {\n const newTextNode = document.createTextNode(newText);\n mergedTextBlot = this.scroll.create(newTextNode);\n this.parent.insertBefore(mergedTextBlot, this);\n }\n\n this.remove();\n\n if (range) {\n // calculate selection to restore\n const remapOffset = (node, offset) => {\n if (prevTextBlot && node === prevTextBlot.domNode) {\n return offset;\n }\n\n if (node === textNode) {\n return prevTextLength + offset - 1;\n }\n\n if (nextTextBlot && node === nextTextBlot.domNode) {\n return prevTextLength + newText.length + offset;\n }\n\n return null;\n };\n\n const start = remapOffset(range.start.node, range.start.offset);\n const end = remapOffset(range.end.node, range.end.offset);\n\n if (start !== null && end !== null) {\n return {\n startNode: mergedTextBlot.domNode,\n startOffset: start,\n endNode: mergedTextBlot.domNode,\n endOffset: end\n };\n }\n }\n\n return null;\n }\n\n update(mutations, context) {\n if (mutations.some(mutation => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n const range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n\n}\n\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Cursor);\n\n//# sourceURL=webpack://Quill/./blots/cursor.js?");
/***/ }),
/***/ "./blots/embed.js":
/*!************************!*\
!*** ./blots/embed.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\nconst GUARD_TEXT = '\\uFEFF';\n\nclass Embed extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"] {\n constructor(scroll, node) {\n super(scroll, node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n Array.from(this.domNode.childNodes).forEach(childNode => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range;\n let textNode;\n const text = node.data.split(GUARD_TEXT).join('');\n\n if (node === this.leftGuard) {\n if (this.prev instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n const prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(this.scroll.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach(mutation => {\n if (mutation.type === 'characterData' && (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n const range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Embed);\n\n//# sourceURL=webpack://Quill/./blots/embed.js?");
/***/ }),
/***/ "./blots/inline.js":
/*!*************************!*\
!*** ./blots/inline.js ***!
\*************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _text__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./text */ \"./blots/text.js\");\n\n\n\n\nclass Inline extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"InlineBlot\"] {\n static compare(self, other) {\n const selfIndex = Inline.order.indexOf(self);\n const otherIndex = Inline.order.indexOf(other);\n\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n }\n\n if (self === other) {\n return 0;\n }\n\n if (self < other) {\n return -1;\n }\n\n return 1;\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && this.scroll.query(name, parchment__WEBPACK_IMPORTED_MODULE_0__[\"Scope\"].BLOT)) {\n const blot = this.isolate(index, length);\n\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n const parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n\n}\n\nInline.allowedChildren = [Inline, _break__WEBPACK_IMPORTED_MODULE_1__[\"default\"], parchment__WEBPACK_IMPORTED_MODULE_0__[\"EmbedBlot\"], _text__WEBPACK_IMPORTED_MODULE_2__[\"default\"]]; // Lower index means deeper in the DOM tree, since not found (-1) is for embeds\n\nInline.order = ['cursor', 'inline', // Must be lower\n'link', // Chrome wants <a> to be lower\n'underline', 'strike', 'italic', 'bold', 'script', 'code' // Must be higher\n];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Inline);\n\n//# sourceURL=webpack://Quill/./blots/inline.js?");
/***/ }),
/***/ "./blots/scroll.js":
/*!*************************!*\
!*** ./blots/scroll.js ***!
\*************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _core_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/emitter */ \"./core/emitter.js\");\n/* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./block */ \"./blots/block.js\");\n/* harmony import */ var _break__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./break */ \"./blots/break.js\");\n/* harmony import */ var _container__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./container */ \"./blots/container.js\");\n\n\n\n\n\n\nfunction isLine(blot) {\n return blot instanceof _block__WEBPACK_IMPORTED_MODULE_2__[\"default\"] || blot instanceof _block__WEBPACK_IMPORTED_MODULE_2__[\"BlockEmbed\"];\n}\n\nclass Scroll extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"ScrollBlot\"] {\n constructor(registry, domNode, {\n emitter\n }) {\n super(registry, domNode);\n this.emitter = emitter;\n this.batch = false;\n this.optimize();\n this.enable();\n this.domNode.addEventListener('dragstart', e => this.handleDragStart(e));\n }\n\n batchStart() {\n if (!Array.isArray(this.batch)) {\n this.batch = [];\n }\n }\n\n batchEnd() {\n const mutations = this.batch;\n this.batch = false;\n this.update(mutations);\n }\n\n emitMount(blot) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_BLOT_MOUNT, blot);\n }\n\n emitUnmount(blot) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_BLOT_UNMOUNT, blot);\n }\n\n deleteAt(index, length) {\n const [first, offset] = this.line(index);\n const [last] = this.line(index + length);\n super.deleteAt(index, length);\n\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block__WEBPACK_IMPORTED_MODULE_2__[\"BlockEmbed\"] || last instanceof _block__WEBPACK_IMPORTED_MODULE_2__[\"BlockEmbed\"]) {\n this.optimize();\n return;\n }\n\n const ref = last.children.head instanceof _break__WEBPACK_IMPORTED_MODULE_3__[\"default\"] ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n handleDragStart(event) {\n event.preventDefault();\n }\n\n insertAt(index, value, def) {\n if (index >= this.length()) {\n if (def == null || this.scroll.query(value, parchment__WEBPACK_IMPORTED_MODULE_0__[\"Scope\"].BLOCK) == null) {\n const blot = this.scroll.create(this.statics.defaultChild.blotName);\n this.appendChild(blot);\n\n if (def == null && value.endsWith('\\n')) {\n blot.insertAt(0, value.slice(0, -1), def);\n } else {\n blot.insertAt(0, value, def);\n }\n } else {\n const embed = this.scroll.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === parchment__WEBPACK_IMPORTED_MODULE_0__[\"Scope\"].INLINE_BLOT) {\n const wrapper = this.scroll.create(this.statics.defaultChild.blotName);\n wrapper.appendChild(blot);\n super.insertBefore(wrapper, ref);\n } else {\n super.insertBefore(blot, ref);\n }\n }\n\n isEnabled() {\n return this.domNode.getAttribute('contenteditable') === 'true';\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n const getLines = (blot, blotIndex, blotLength) => {\n let lines = [];\n let lengthLeft = blotLength;\n blot.children.forEachAt(blotIndex, blotLength, (child, childIndex, childLength) => {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof parchment__WEBPACK_IMPORTED_MODULE_0__[\"ContainerBlot\"]) {\n lines = lines.concat(getLines(child, childIndex, lengthLeft));\n }\n\n lengthLeft -= childLength;\n });\n return lines;\n };\n\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch) return;\n super.optimize(mutations, context);\n\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n remove() {// Never remove self\n }\n\n update(mutations) {\n if (this.batch) {\n if (Array.isArray(mutations)) {\n this.batch = this.batch.concat(mutations);\n }\n\n return;\n }\n\n let source = _core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sources.USER;\n\n if (typeof mutations === 'string') {\n source = mutations;\n }\n\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n\n super.update(mutations.concat([])); // pass copy\n\n if (mutations.length > 0) {\n this.emitter.emit(_core_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"].events.SCROLL_UPDATE, source, mutations);\n }\n }\n\n}\n\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = _block__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nScroll.allowedChildren = [_block__WEBPACK_IMPORTED_MODULE_2__[\"default\"], _block__WEBPACK_IMPORTED_MODULE_2__[\"BlockEmbed\"], _container__WEBPACK_IMPORTED_MODULE_4__[\"default\"]];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scroll);\n\n//# sourceURL=webpack://Quill/./blots/scroll.js?");
/***/ }),
/***/ "./blots/text.js":
/*!***********************!*\
!*** ./blots/text.js ***!
\***********************/
/*! exports provided: default, escapeText */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Text; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"escapeText\", function() { return escapeText; });\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n\n\nclass Text extends parchment__WEBPACK_IMPORTED_MODULE_0__[\"TextBlot\"] {}\n\nfunction escapeText(text) {\n return text.replace(/[&<>\"']/g, s => {\n // https://lodash.com/docs#escape\n const entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n return entityMap[s];\n });\n}\n\n\n\n//# sourceURL=webpack://Quill/./blots/text.js?");
/***/ }),
/***/ "./core.js":
/*!*****************!*\
!*** ./core.js ***!
\*****************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core_quill__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/quill */ \"./core/quill.js\");\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_container__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./blots/container */ \"./blots/container.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_embed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./blots/embed */ \"./blots/embed.js\");\n/* harmony import */ var _blots_inline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blots/inline */ \"./blots/inline.js\");\n/* harmony import */ var _blots_scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./blots/scroll */ \"./blots/scroll.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./blots/text */ \"./blots/text.js\");\n/* harmony import */ var _modules_clipboard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./modules/clipboard */ \"./modules/clipboard.js\");\n/* harmony import */ var _modules_history__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./modules/history */ \"./modules/history.js\");\n/* harmony import */ var _modules_keyboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./modules/keyboard */ \"./modules/keyboard.js\");\n/* harmony import */ var _modules_uploader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./modules/uploader */ \"./modules/uploader.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n_core_quill__WEBPACK_IMPORTED_MODULE_0__[\"default\"].register({\n 'blots/block': _blots_block__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n 'blots/block/embed': _blots_block__WEBPACK_IMPORTED_MODULE_1__[\"BlockEmbed\"],\n 'blots/break': _blots_break__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'blots/container': _blots_container__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'blots/cursor': _blots_cursor__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'blots/embed': _blots_embed__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'blots/inline': _blots_inline__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n 'blots/scroll': _blots_scroll__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n 'blots/text': _blots_text__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'modules/clipboard': _modules_clipboard__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n 'modules/history': _modules_history__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n 'modules/keyboard': _modules_keyboard__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n 'modules/uploader': _modules_uploader__WEBPACK_IMPORTED_MODULE_12__[\"default\"]\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core_quill__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack://Quill/./core.js?");
/***/ }),
/***/ "./core/editor.js":
/*!************************!*\
!*** ./core/editor.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var clone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clone */ \"./node_modules/clone/clone.js\");\n/* harmony import */ var clone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clone__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var deep_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deep-equal */ \"./node_modules/deep-equal/index.js\");\n/* harmony import */ var deep_equal__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deep_equal__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! extend */ \"./node_modules/extend/index.js\");\n/* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(extend__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! quill-delta */ \"./node_modules/quill-delta/dist/Delta.js\");\n/* harmony import */ var quill_delta__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(quill_delta__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var parchment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! parchment */ \"./node_modules/parchment/src/parchment.ts\");\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./selection */ \"./core/selection.js\");\n/* harmony import */ var _blots_cursor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../blots/cursor */ \"./blots/cursor.js\");\n/* harmony import */ var _blots_block__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../blots/block */ \"./blots/block.js\");\n/* harmony import */ var _blots_break__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../blots/break */ \"./blots/break.js\");\n/* harmony import */ var _blots_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../blots/text */ \"./blots/text.js\");\n\n\n\n\n\n\n\n\n\n\nconst ASCII = /^[ -~]*$/;\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n const normalizedDelta = normalizeDelta(delta);\n normalizedDelta.reduce((index, op) => {\n const length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n\n if ((index >= scrollLength || this.scroll.descendant(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"BlockEmbed\"], index)[0]) && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n\n this.scroll.insertAt(index, text);\n const [line, offset] = this.scroll.line(index);\n let formats = extend__WEBPACK_IMPORTED_MODULE_2___default()({}, Object(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"bubbleFormats\"])(line));\n\n if (line instanceof _blots_block__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) {\n const [leaf] = line.descendant(parchment__WEBPACK_IMPORTED_MODULE_4__[\"LeafBlot\"], offset);\n formats = extend__WEBPACK_IMPORTED_MODULE_2___default()(formats, Object(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"bubbleFormats\"])(leaf));\n }\n\n attributes = quill_delta__WEBPACK_IMPORTED_MODULE_3__[\"AttributeMap\"].diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n const key = Object.keys(op.insert)[0]; // There should only be one key\n\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n\n scrollLength += length;\n }\n\n Object.keys(attributes).forEach(name => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n normalizedDelta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n this.scroll.optimize();\n return this.update(normalizedDelta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach(format => {\n this.scroll.lines(index, Math.max(length, 1)).forEach(line => {\n line.format(format, formats[format]);\n });\n });\n this.scroll.optimize();\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).retain(length, clone__WEBPACK_IMPORTED_MODULE_0___default()(formats));\n return this.update(delta);\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).retain(length, clone__WEBPACK_IMPORTED_MODULE_0___default()(formats));\n return this.update(delta);\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a());\n }\n\n getFormat(index, length = 0) {\n let lines = [];\n let leaves = [];\n\n if (length === 0) {\n this.scroll.path(index).forEach(path => {\n const [blot] = path;\n\n if (blot instanceof _blots_block__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) {\n lines.push(blot);\n } else if (blot instanceof parchment__WEBPACK_IMPORTED_MODULE_4__[\"LeafBlot\"]) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(parchment__WEBPACK_IMPORTED_MODULE_4__[\"LeafBlot\"], index, length);\n }\n\n const formatsArr = [lines, leaves].map(blots => {\n if (blots.length === 0) return {};\n let formats = Object(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"bubbleFormats\"])(blots.shift());\n\n while (Object.keys(formats).length > 0) {\n const blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(Object(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"bubbleFormats\"])(blot), formats);\n }\n\n return formats;\n });\n return extend__WEBPACK_IMPORTED_MODULE_2___default.a.apply(extend__WEBPACK_IMPORTED_MODULE_2___default.a, formatsArr);\n }\n\n getHTML(index, length) {\n const [line, lineOffset] = this.scroll.line(index);\n\n if (line.length() >= lineOffset + length) {\n return convertHTML(line, lineOffset, length, true);\n }\n\n return convertHTML(this.scroll, index, length, true);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(op => typeof op.insert === 'string').map(op => op.insert).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).insert({\n [embed]: value\n }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(format => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).insert(text, clone__WEBPACK_IMPORTED_MODULE_0___default()(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length === 0) return true;\n if (this.scroll.children.length > 1) return false;\n const block = this.scroll.children.head;\n if (block.statics.blotName !== _blots_block__WEBPACK_IMPORTED_MODULE_7__[\"default\"].blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _blots_break__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\n }\n\n removeFormat(index, length) {\n const text = this.getText(index, length);\n const [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0;\n let suffix = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a();\n\n if (line != null) {\n suffixLength = line.length() - offset;\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n\n const contents = this.getContents(index, length + suffixLength);\n const diff = contents.diff(new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().insert(text).concat(suffix));\n const delta = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], selectionInfo = undefined) {\n const oldDelta = this.delta;\n\n if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && this.scroll.find(mutations[0].target)) {\n // Optimization for character changes\n const textBlot = this.scroll.find(mutations[0].target);\n const formats = Object(_blots_block__WEBPACK_IMPORTED_MODULE_7__[\"bubbleFormats\"])(textBlot);\n const index = textBlot.offset(this.scroll);\n const oldValue = mutations[0].oldValue.replace(_blots_cursor__WEBPACK_IMPORTED_MODULE_6__[\"default\"].CONTENTS, '');\n const oldText = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().insert(oldValue);\n const newText = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().insert(textBlot.value());\n const relativeSelectionInfo = selectionInfo && {\n oldRange: shiftRange(selectionInfo.oldRange, -index),\n newRange: shiftRange(selectionInfo.newRange, -index)\n };\n const diffDelta = new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a().retain(index).concat(oldText.diff(newText, relativeSelectionInfo));\n change = diffDelta.reduce((delta, op) => {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n }\n\n return delta.push(op);\n }, new quill_delta__WEBPACK_IMPORTED_MODULE_3___default.a());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n\n if (!change || !deep_equal__WEBPACK_IMPORTED_MODULE_1___default()(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, selectionInfo);\n }\n }\n\n return change;\n }\n\n}\n\nfunction convertListHTML(items, lastIndent, types) {\n if (items.length === 0) {\n const [endTag] = getListType(types.pop());\n\n if (lastIndent <= 0) {\n return \"</li></\".concat(endTag, \">\");\n }\n\n return \"</li></\".concat(endTag, \">\").concat(convertListHTML([], lastIndent - 1, types));\n }\n\n const [{\n child,\n offset,\n length,\n indent,\n type\n }, ...rest] = items;\n const [tag, attribute] = getListType(type);\n\n if (indent > lastIndent) {\n types.push(type);\n\n if (indent === lastIndent + 1) {\n return \"<\".concat(tag, \"><li\").concat(attribute, \">\").concat(convertHTML(child, offset, length)).concat(convertListHTML(rest, indent, types));\n }\n\n return \"<\".concat(tag, \"><li>\").concat(convertListHTML(items, lastIndent + 1, types));\n }\n\n const previousType = types[types.length - 1];\n\n if (indent === lastIndent && type === previousType) {\n return \"</li><li\".concat(attribute, \">\").concat(convertHTML(child, offset, length)).concat(convertListHTML(rest, indent, types));\n }\n\n const [endTag] = getListType(types.pop());\n return \"</li></\".concat(endTag, \">\").concat(convertListHTML(items, lastIndent - 1, types));\n}\n\nfunction convertHTML(blot, index, length, isRoot = false) {\n if (typeof blot.html === 'function') {\n return blot.html(index, length);\n }\n\n if (blot instanceof _blots_text__WEBPACK_IMPORTED_MODULE_9__[\"default\"]) {\n return Object(_blots_text__WEBPACK_IMPORTED_MODULE_9__[\"escapeText\"])(blot.value().slice(index, index + length));\n }\n\n if (blot.children) {\n // TODO fix API\n if (blot.statics.blotName === 'list-container') {\n const items = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n const formats = child.formats();\n items.push({\n child,\n offset,\n length: childLength,\n indent: formats.indent || 0,\n type: formats.list\n });\n });\n return convertListHTML(items, -1, []);\n }\n\n const parts = [];\n blot.children.forEachAt(index, length, (child, offset, childLength) => {\n parts.push(convertHTML(child, offset, childLength));\n });\n\n if (isRoot || blot.statics.blotName === 'list') {\n return parts.join('');\n }\n\n const {\n outerHTML,\n innerHTML\n } = blot.domNode;\n const [start, end] = outerHTML.split(\">\".concat(innerHTML, \"<\")); // TODO cleanup\n\n if (start === '<table') {\n return \"<table style=\\\"border: 1px solid #000;\\\">\".concat(parts.join(''), \"<\").concat(end);\n }\n\n return \"\".concat(start, \">\").concat(parts.join(''), \"<\").concat(end);\n }\n\n return blot.domNode.outerHTML;\n}\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce((merged, name) => {\n if (formats[name] == null) return merged;\n\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n\n return merged;\n }, {});\n}\n\nfunction getListType(type) {\n const tag = type === 'ordered' ? 'ol' : 'ul';\n\n switch (type) {\n case 'checked':\n return [tag, ' data-list=\"checked\"'];\n\n case 'unchecked':\n return