From dbb4cd6f8f8e333f90a0de2e491af81bb8db2bb6 Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Mon, 11 Jun 2018 15:29:15 +0300 Subject: [PATCH] TypeScript support, Webpack 4, Inline Toolbar beginning (#257) * Create UI * Support TypeScript Modules * remove tmp files * migrate to 2-spaced tabs * Add TS Linter --- .editorconfig | 9 + .eslintrc | 4 +- build/codex-editor.js | 8580 ++++++++--------- build/codex-editor.js.map | 2 +- package-lock.json | 6291 +++++++----- package.json | 43 +- src/codex.js | 392 +- src/components/__module.js | 50 - src/components/__module.ts | 48 + src/components/block.js | 396 +- src/components/dom.js | 468 +- src/components/modules/blockManager.js | 991 +- src/components/modules/caret.js | 454 +- src/components/modules/events.js | 78 +- src/components/modules/keyboard.js | 270 +- src/components/modules/listeners.js | 299 +- src/components/modules/renderer.js | 128 +- src/components/modules/sanitizer.js | 173 +- src/components/modules/saver.js | 110 +- .../modules/toolbar-blockSettings.js | 207 +- src/components/modules/toolbar-inline.ts | 68 + src/components/modules/toolbar-toolbox.js | 332 +- src/components/modules/toolbar.js | 366 +- src/components/modules/tools.js | 320 +- src/components/modules/ui.js | 500 +- src/components/polyfills.js | 24 +- src/components/selection.js | 94 +- src/components/utils.js | 336 +- src/styles/inline-toolbar.css | 8 + src/styles/main.css | 1 + src/styles/toolbox.css | 1 + src/styles/variables.css | 19 + tsconfig.json | 6 + tslint.json | 6 + webpack.config.js | 273 +- 35 files changed, 11017 insertions(+), 10330 deletions(-) create mode 100644 .editorconfig delete mode 100644 src/components/__module.js create mode 100644 src/components/__module.ts create mode 100644 src/components/modules/toolbar-inline.ts create mode 100644 src/styles/inline-toolbar.css create mode 100644 tsconfig.json create mode 100644 tslint.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..0915b639 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = false + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index badf3fb8..1afad491 100644 --- a/.eslintrc +++ b/.eslintrc @@ -42,7 +42,7 @@ "no-nested-ternary": 1, "no-trailing-spaces": 2, "no-mixed-spaces-and-tabs": 2, - "padded-blocks": [2, "always"], + "padded-blocks": [2, "never"], "space-before-blocks": 1, "space-before-function-paren": [1, { "anonymous": "always", @@ -53,7 +53,7 @@ "markers": ["=", "!"] }], "semi": [2, "always"], - "indent": [2, 4, { + "indent": [2, 2, { "SwitchCase": 1 }], "camelcase": [2, { diff --git a/build/codex-editor.js b/build/codex-editor.js index dd72ae63..aa1679da 100644 --- a/build/codex-editor.js +++ b/build/codex-editor.js @@ -37,14 +37,34 @@ var CodexEditor = /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); +/******/ 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 ? @@ -60,3587 +80,105 @@ var CodexEditor = /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ +/******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 3); +/******/ return __webpack_require__(__webpack_require__.s = "./src/codex.js"); /******/ }) /************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * @abstract - * @class Module - * @classdesc All modules inherits from this class. - * - * @typedef {Module} Module - * @property {Object} config - Editor user settings - * @property {Object} Editor - List of Editor modules - */ -var Module = function () { - - /** - * @constructor - * - * @param {EditorConfig} config - */ - function Module() { - var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, - config = _ref.config; - - _classCallCheck(this, Module); - - if (new.target === Module) { - - throw new TypeError('Constructors for abstract class Module are not allowed.'); - } - - /** - * @type {EditorConfig} - */ - this.config = config; - - /** - * @type {EditorComponents} - */ - this.Editor = null; - } - - /** - * Editor modules setter - * - * @param Editor - * @param Editor.modules {@link CodexEditor#moduleInstances} - * @param Editor.config {@link CodexEditor#configuration} - */ - - - _createClass(Module, [{ - key: 'state', - set: function set(Editor) { - - this.Editor = Editor; - } - }]); - - return Module; -}(); - -Module.displayName = 'Module'; -exports.default = Module; -module.exports = exports['default']; - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Codex Editor Util - */ -var Util = function () { - function Util() { - _classCallCheck(this, Util); - } - - _createClass(Util, null, [{ - key: 'log', - - - /** - * Custom logger - * - * @param {string} msg - message - * @param {string} type - logging type 'log'|'warn'|'error'|'info' - * @param {*} args - argument to log with a message - */ - value: function log(msg, type, args) { - - type = type || 'log'; - - if (!args) { - - args = msg || 'undefined'; - msg = '[codex-editor]: %o'; - } else { - - msg = '[codex-editor]: ' + msg; - } - - try { - - if ('console' in window && window.console[type]) { - - if (args) window.console[type](msg, args);else window.console[type](msg); - } - } catch (e) { - // do nothing - } - } - - /** - * Returns basic keycodes as constants - * @return {{}} - */ - - }, { - key: 'sequence', - - - /** - * @typedef {Object} ChainData - * @property {Object} data - data that will be passed to the success or fallback - * @property {Function} function - function's that must be called asynchronically - */ - - /** - * Fires a promise sequence asyncronically - * - * @param {Object[]} chains - list or ChainData's - * @param {Function} success - success callback - * @param {Function} fallback - callback that fires in case of errors - * - * @return {Promise} - */ - value: function sequence(chains) { - var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; - var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; - - - return new Promise(function (resolve) { - - /** - * pluck each element from queue - * First, send resolved Promise as previous value - * Each plugins "prepare" method returns a Promise, that's why - * reduce current element will not be able to continue while can't get - * a resolved Promise - */ - chains.reduce(function (previousValue, currentValue, iteration) { - - return previousValue.then(function () { - return waitNextBlock(currentValue, success, fallback); - }).then(function () { - - // finished - if (iteration === chains.length - 1) { - - resolve(); - } - }); - }, Promise.resolve()); - }); - - /** - * Decorator - * - * @param {ChainData} chainData - * - * @param {Function} successCallback - * @param {Function} fallbackCallback - * - * @return {Promise} - */ - function waitNextBlock(chainData, successCallback, fallbackCallback) { - - return new Promise(function (resolve) { - - chainData.function().then(function () { - - successCallback(chainData.data || {}); - }).then(resolve).catch(function () { - - fallbackCallback(chainData.data || {}); - - // anyway, go ahead even it falls - resolve(); - }); - }); - } - } - - /** - * Make array from array-like collection - * - * @param {*} collection - * - * @return {Array} - */ - - }, { - key: 'array', - value: function array(collection) { - - return Array.prototype.slice.call(collection); - } - - /** - * Checks if object is empty - * - * @param {Object} object - * @return {boolean} - */ - - }, { - key: 'isEmpty', - value: function isEmpty(object) { - - return Object.keys(object).length === 0 && object.constructor === Object; - } - - /** - * Check if passed object is a Promise - * @param {*} object - object to check - * @return {Boolean} - */ - - }, { - key: 'isPromise', - value: function isPromise(object) { - - return Promise.resolve(object) === object; - } - - /** - * Check if passed element is contenteditable - * @param element - * @return {boolean} - */ - - }, { - key: 'isContentEditable', - value: function isContentEditable(element) { - - return element.contentEditable === 'true'; - } - - /** - * Delays method execution - * - * @param method - * @param timeout - */ - - }, { - key: 'delay', - value: function delay(method, timeout) { - - return function () { - - var context = this, - args = arguments; - - window.setTimeout(function () { - return method.apply(context, args); - }, timeout); - }; - } - }, { - key: 'keyCodes', - get: function get() { - - return { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - SHIFT: 16, - CTRL: 17, - ALT: 18, - ESC: 27, - SPACE: 32, - LEFT: 37, - UP: 38, - DOWN: 40, - RIGHT: 39, - DELETE: 46, - META: 91 - }; - } - }]); - - return Util; -}(); - -Util.displayName = 'Util'; -exports.default = Util; -; -module.exports = exports['default']; - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * DOM manipulations helper - */ -var Dom = function () { - function Dom() { - _classCallCheck(this, Dom); - } - - _createClass(Dom, null, [{ - key: 'isSingleTag', - - - /** - * Check if passed tag has no closed tag - * @param {Element} tag - * @return {Boolean} - */ - value: function isSingleTag(tag) { - - return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); - } - }, { - key: 'make', - - - /** - * Helper for making Elements with classname and attributes - * - * @param {string} tagName - new Element tag name - * @param {array|string} classNames - list or name of CSS classname(s) - * @param {Object} attributes - any attributes - * @return {Element} - */ - value: function make(tagName) { - var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - - - var el = document.createElement(tagName); - - if (Array.isArray(classNames)) { - var _el$classList; - - (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classNames)); - } else if (classNames) { - - el.classList.add(classNames); - } - - for (var attrName in attributes) { - - el[attrName] = attributes[attrName]; - } - - return el; - } - - /** - * Creates Text Node with the passed content - * @param {String} content - text content - * @return {Text} - */ - - }, { - key: 'text', - value: function text(content) { - - return document.createTextNode(content); - } - - /** - * Append one or several elements to the parent - * - * @param {Element} parent - where to append - * @param {Element|Element[]} - element ore elements list - */ - - }, { - key: 'append', - value: function append(parent, elements) { - - if (Array.isArray(elements)) { - - elements.forEach(function (el) { - return parent.appendChild(el); - }); - } else { - - parent.appendChild(elements); - } - } - - /** - * Selector Decorator - * - * Returns first match - * - * @param {Element} el - element we searching inside. Default - DOM Document - * @param {String} selector - searching string - * - * @returns {Element} - */ - - }, { - key: 'find', - value: function find() { - var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; - var selector = arguments[1]; - - - return el.querySelector(selector); - } - - /** - * Selector Decorator. - * - * Returns all matches - * - * @param {Element} el - element we searching inside. Default - DOM Document - * @param {String} selector - searching string - * @returns {NodeList} - */ - - }, { - key: 'findAll', - value: function findAll() { - var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; - var selector = arguments[1]; - - - return el.querySelectorAll(selector); - } - - /** - * Search for deepest node which is Leaf. - * Leaf is the vertex that doesn't have any child nodes - * - * @description Method recursively goes throw the all Node until it finds the Leaf - * - * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} - * @param {Boolean} atLast - find last text node - * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it - */ - - }, { - key: 'getDeepestNode', - value: function getDeepestNode(node) { - var atLast = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - - - /** - * Current function have two directions: - * - starts from first child and every time gets first or nextSibling in special cases - * - starts from last child and gets last or previousSibling - * @type {string} - */ - var child = atLast ? 'lastChild' : 'firstChild', - sibling = atLast ? 'previousSibling' : 'nextSibling'; - - if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { - - var nodeChild = node[child]; - - /** - * special case when child is single tag that can't contain any content - */ - if (Dom.isSingleTag(nodeChild)) { - - /** - * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest - * from sibling - * - * 2) If single tag's next sibling is null, then go back to parent and check his sibling - * In case of Node Element continue searching - * - * 3) If none of conditions above happened return parent Node Element - */ - if (nodeChild[sibling]) { - - nodeChild = nodeChild[sibling]; - } else if (nodeChild.parentNode[sibling]) { - - nodeChild = nodeChild.parentNode[sibling]; - } else { - - return nodeChild.parentNode; - } - } - - return this.getDeepestNode(nodeChild, atLast); - } - - return node; - } - - /** - * Check if object is DOM node - * - * @param {Object} node - * @returns {boolean} - */ - - }, { - key: 'isElement', - value: function isElement(node) { - - return node && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; - } - - /** - * Checks target if it is native input - * @param {Element|String} target - HTML element or string - * @return {Boolean} - */ - - }, { - key: 'isNativeInput', - value: function isNativeInput(target) { - - var nativeInputs = ['INPUT', 'TEXTAREA']; - - return target ? nativeInputs.includes(target.tagName) : false; - } - - /** - * Checks node if it is empty - * - * @description Method checks simple Node without any childs for emptiness - * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method - * - * @param {Node} node - * @return {Boolean} true if it is empty - */ - - }, { - key: 'isNodeEmpty', - value: function isNodeEmpty(node) { - - var nodeText = void 0; - - if (this.isElement(node) && this.isNativeInput(node)) { - - nodeText = node.value; - } else { - - nodeText = node.textContent.replace('\u200B', ''); - } - - return nodeText.trim().length === 0; - } - - /** - * checks node if it is doesn't have any child nodes - * @param {Node} node - * @return {boolean} - */ - - }, { - key: 'isLeaf', - value: function isLeaf(node) { - - if (!node) { - - return false; - } - - return node.childNodes.length === 0; - } - - /** - * breadth-first search (BFS) - * {@link https://en.wikipedia.org/wiki/Breadth-first_search} - * - * @description Pushes to stack all DOM leafs and checks for emptiness - * - * @param {Node} node - * @return {boolean} - */ - - }, { - key: 'isEmpty', - value: function isEmpty(node) { - var _this = this; - - var treeWalker = [], - leafs = []; - - if (!node) { - - return true; - } - - if (!node.childNodes.length) { - - return this.isNodeEmpty(node); - } - - treeWalker.push(node.firstChild); - - while (treeWalker.length > 0) { - - node = treeWalker.shift(); - - if (!node) continue; - - if (this.isLeaf(node)) { - - leafs.push(node); - } else { - - treeWalker.push(node.firstChild); - } - - while (node && node.nextSibling) { - - node = node.nextSibling; - - if (!node) continue; - - treeWalker.push(node); - } - - /** - * If one of childs is not empty, checked Node is not empty too - */ - if (node && !this.isNodeEmpty(node)) { - - return false; - } - } - - return leafs.every(function (leaf) { - return _this.isNodeEmpty(leaf); - }); - } - }]); - - return Dom; -}(); - -Dom.displayName = 'Dom'; -exports.default = Dom; -; -module.exports = exports['default']; - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(_) {/** - * Codex Editor - * - * Short Description (눈_눈;) - * @version 2.0.0 - * - * How to start? - * Example: - * new CodexEditor({ - * holderId : 'codex-editor', - * initialBlock : 'text', - * placeholder : 'Write your story....', - * tools: { - * quote: Quote, - * anotherTool : AnotherTool - * }, - * toolsConfig: { - * quote: { - * iconClassname : 'quote-icon', - * displayInToolbox : true, - * enableLineBreaks : true - * }, - * anotherTool: { - * iconClassname : 'tool-icon' - * } - * } - * }); - * - * - tools is an object: { - * pluginName: PluginClass, - * ..... - * } - * - toolsConfig is an additional configuration that uses Codex Editor API - * iconClassname - CSS classname of toolbox icon - * displayInToolbox - if you want to see your Tool in toolbox hided in "plus" button, than set "True". By default : "False" - * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property "True", enter will break the lines in current block - * - * @author CodeX-Team - * - */ - -/** - * @typedef {CodexEditor} CodexEditor - editor class - */ - -/** - * @typedef {Object} EditorConfig - * @property {String} holderId - Element to append Editor - * @property {Array} data - Blocks list in JSON-format - * @property {Object} tools - Map for used Tools in format { name : Class, ... } - * @property {String} initialBlock - This Tool will be added by default - * @property {String} placeholder - First Block placeholder - * @property {Object} sanitizer - @todo fill desc - * @property {Boolean} hideToolbar - @todo fill desc - * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig} - */ - -/** - * Dynamically imported utils - * - * @typedef {Dom} $ - {@link components/dom.js} - * @typedef {Util} _ - {@link components/utils.js} - */ - - - -/** - * Apply polyfills - */ - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -__webpack_require__(4); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Require Editor modules places in components/modules dir - */ -// eslint-disable-next-line -var modules = ["blockManager.js","caret.js","events.js","keyboard.js","listeners.js","renderer.js","sanitizer.js","saver.js","toolbar-blockSettings.js","toolbar-toolbox.js","toolbar.js","tools.js","ui.js"].map(function (module) { - return __webpack_require__(5)("./" + module); -}); - -/** - * @class - * - * @classdesc CodeX Editor base class - * - * @property this.config - all settings - * @property this.moduleInstances - constructed editor components - * - * @type {CodexEditor} - */ -module.exports = function () { - _createClass(CodexEditor, null, [{ - key: 'version', - - - /** Editor version */ - get: function get() { - - return "2.0.0"; - } - - /** - * @param {EditorConfig} config - user configuration - * - */ - - }]); - - function CodexEditor(config) { - var _this = this; - - _classCallCheck(this, CodexEditor); - - /** - * Configuration object - * @type {EditorConfig} - */ - this.config = {}; - - /** - * @typedef {Object} EditorComponents - * @property {BlockManager} BlockManager - * @property {Tools} Tools - * @property {Events} Events - * @property {UI} UI - * @property {Toolbar} Toolbar - * @property {Toolbox} Toolbox - * @property {BlockSettings} BlockSettings - * @property {Renderer} Renderer - */ - this.moduleInstances = {}; - - Promise.resolve().then(function () { - - _this.configuration = config; - }).then(function () { - return _this.init(); - }).then(function () { - return _this.start(); - }).then(function () { - - console.log('CodeX Editor is ready!'); - }).catch(function (error) { - - console.log('CodeX Editor does not ready because of %o', error); - }); - } - - /** - * Setting for configuration - * @param {EditorConfig} config - */ - - - _createClass(CodexEditor, [{ - key: 'init', - - - /** - * Initializes modules: - * - make and save instances - * - configure - */ - value: function init() { - - /** - * Make modules instances and save it to the @property this.moduleInstances - */ - this.constructModules(); - - /** - * Modules configuration - */ - this.configureModules(); - } - - /** - * Make modules instances and save it to the @property this.moduleInstances - */ - - }, { - key: 'constructModules', - value: function constructModules() { - var _this2 = this; - - modules.forEach(function (Module) { - - try { - - /** - * We use class name provided by displayName property - * - * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' - * To prevent this, we use 'babel-plugin-class-display-name' plugin - * @see https://www.npmjs.com/package/babel-plugin-class-display-name - */ - _this2.moduleInstances[Module.displayName] = new Module({ - config: _this2.configuration - }); - } catch (e) { - - console.log('Module %o skipped because %o', Module, e); - } - }); - } - - /** - * Modules instances configuration: - * - pass other modules to the 'state' property - * - ... - */ - - }, { - key: 'configureModules', - value: function configureModules() { - - for (var name in this.moduleInstances) { - - /** - * Module does not need self-instance - */ - this.moduleInstances[name].state = this.getModulesDiff(name); - } - } - - /** - * Return modules without passed name - */ - - }, { - key: 'getModulesDiff', - value: function getModulesDiff(name) { - - var diff = {}; - - for (var moduleName in this.moduleInstances) { - - /** - * Skip module with passed name - */ - if (moduleName === name) { - - continue; - } - diff[moduleName] = this.moduleInstances[moduleName]; - } - - return diff; - } - - /** - * Start Editor! - * - * Get list of modules that needs to be prepared and return a sequence (Promise) - * @return {Promise} - */ - - }, { - key: 'start', - value: function start() { - var _this3 = this; - - var prepareDecorator = function prepareDecorator(module) { - return module.prepare(); - }; - - return Promise.resolve().then(prepareDecorator(this.moduleInstances.Tools)).then(prepareDecorator(this.moduleInstances.UI)).then(prepareDecorator(this.moduleInstances.BlockManager)).then(function () { - - return _this3.moduleInstances.Renderer.render(_this3.config.data.items); - }); - } - }, { - key: 'configuration', - set: function set(config) { - - /** - * Initlai block type - * Uses in case when there is no items passed - * @type {{type: (*), data: {text: null}}} - */ - var initialBlock = { - type: config.initialBlock, - data: {} - }; - - this.config.holderId = config.holderId; - this.config.placeholder = config.placeholder || 'write your story...'; - this.config.sanitizer = config.sanitizer || { - p: true, - b: true, - a: true - }; - - this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; - this.config.tools = config.tools || {}; - this.config.toolsConfig = config.toolsConfig || {}; - this.config.data = config.data || {}; - - /** - * Initialize items to pass data to the Renderer - */ - if (_.isEmpty(this.config.data)) { - - this.config.data = {}; - this.config.data.items = [initialBlock]; - } else { - - if (!this.config.data.items || this.config.data.items.length === 0) { - - this.config.data.items = [initialBlock]; - } - } - - /** - * If initial Block's Tool was not passed, use the first Tool in config.tools - */ - if (!config.initialBlock) { - - for (this.config.initialBlock in this.config.tools) { - break; - } - } else { - - this.config.initialBlock = config.initialBlock; - } - } - - /** - * Returns private property - * @returns {EditorConfig} - */ - , - get: function get() { - - return this.config; - } - }]); - - return CodexEditor; -}(); - -// module.exports = (function (editor) { -// -// 'use strict'; -// -// editor.version = VERSION; -// editor.scriptPrefix = 'cdx-script-'; -// -// var init = function () { -// -// editor.core = require('./modules/core'); -// editor.tools = require('./modules/tools'); -// editor.ui = require('./modules/ui'); -// editor.transport = require('./modules/transport'); -// editor.renderer = require('./modules/renderer'); -// editor.saver = require('./modules/saver'); -// editor.content = require('./modules/content'); -// editor.toolbar = require('./modules/toolbar/toolbar'); -// editor.callback = require('./modules/callbacks'); -// editor.draw = require('./modules/draw'); -// editor.caret = require('./modules/caret'); -// editor.notifications = require('./modules/notifications'); -// editor.parser = require('./modules/parser'); -// editor.sanitizer = require('./modules/sanitizer'); -// editor.listeners = require('./modules/listeners'); -// editor.destroyer = require('./modules/destroyer'); -// editor.paste = require('./modules/paste'); -// -// }; -// -// /** -// * @public -// * holds initial settings -// */ -// editor.settings = { -// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], -// holderId : 'codex-editor', -// -// // Type of block showing on empty editor -// initialBlockPlugin: 'text' -// }; -// -// /** -// * public -// * -// * Static nodes -// */ -// editor.nodes = { -// holder : null, -// wrapper : null, -// toolbar : null, -// inlineToolbar : { -// wrapper : null, -// buttons : null, -// actions : null -// }, -// toolbox : null, -// notifications : null, -// plusButton : null, -// showSettingsButton: null, -// showTrashButton : null, -// blockSettings : null, -// pluginSettings : null, -// defaultSettings : null, -// toolbarButtons : {}, // { type : DomEl, ... } -// redactor : null -// }; -// -// /** -// * @public -// * -// * Output state -// */ -// editor.state = { -// jsonOutput : [], -// blocks : [], -// inputs : [] -// }; -// -// /** -// * @public -// * Editor plugins -// */ -// editor.tools = {}; -// -// editor.start = function (userSettings) { -// -// init(); -// -// editor.core.prepare(userSettings) -// -// // If all ok, make UI, bind events and parse initial-content -// .then(editor.ui.prepare) -// .then(editor.tools.prepare) -// .then(editor.sanitizer.prepare) -// .then(editor.paste.prepare) -// .then(editor.transport.prepare) -// .then(editor.renderer.makeBlocksFromData) -// .then(editor.ui.saveInputs) -// .catch(function (error) { -// -// editor.core.log('Initialization failed with error: %o', 'warn', error); -// -// }); -// -// }; -// -// return editor; -// -// })({}); -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) - -/***/ }), -/* 4 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/** - * Element.closest() - * - * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest - */ -if (!Element.prototype.matches) Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - -if (!Element.prototype.closest) Element.prototype.closest = function (s) { - - var el = this; - - if (!document.documentElement.contains(el)) return null; - do { - - if (el.matches(s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null); - return null; +/******/ ({ + +/***/ "./node_modules/css-loader/lib/css-base.js": +/*!*************************************************!*\ + !*** ./node_modules/css-loader/lib/css-base.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; }; -/***/ }), -/* 5 */ -/***/ (function(module, exports, __webpack_require__) { +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} -var map = { - "./blockManager.js": 6, - "./caret.js": 8, - "./events.js": 10, - "./keyboard.js": 11, - "./listeners.js": 12, - "./renderer.js": 13, - "./sanitizer.js": 14, - "./saver.js": 16, - "./toolbar-blockSettings.js": 17, - "./toolbar-toolbox.js": 18, - "./toolbar.js": 19, - "./tools.js": 20, - "./ui.js": 21 -}; -function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); -}; -function webpackContextResolve(req) { - var id = map[req]; - if(!(id + 1)) // check for number or string - throw new Error("Cannot find module '" + req + "'."); - return id; -}; -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 5; /***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module, $, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _block = __webpack_require__(7); - -var _block2 = _interopRequireDefault(_block); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * @class BlockManager - * @classdesc Manage editor`s blocks storage and appearance - * - * @module BlockManager - * - * @version 2.0.0 - */ - -/** - * @typedef {BlockManager} BlockManager - * @property {Number} currentBlockIndex - Index of current working block - * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks} - */ -var BlockManager = function (_Module) { - _inherits(BlockManager, _Module); - - /** - * @constructor - * @param {EditorConfig} config - */ - function BlockManager(_ref) { - var config = _ref.config; - - _classCallCheck(this, BlockManager); - - /** - * Proxy for Blocks instance {@link Blocks} - * - * @type {Proxy} - * @private - */ - var _this = _possibleConstructorReturn(this, (BlockManager.__proto__ || Object.getPrototypeOf(BlockManager)).call(this, { config: config })); - - _this._blocks = null; - - /** - * Index of current working block - * - * @type {number} - * @private - */ - _this.currentBlockIndex = -1; - - return _this; - } - - /** - * Should be called after Editor.UI preparation - * Define this._blocks property - * - * @returns {Promise} - */ - - - _createClass(BlockManager, [{ - key: 'prepare', - value: function prepare() { - var _this2 = this; - - return new Promise(function (resolve) { - - var blocks = new Blocks(_this2.Editor.UI.nodes.redactor); - - /** - * We need to use Proxy to overload set/get [] operator. - * So we can use array-like syntax to access blocks - * - * @example - * this._blocks[0] = new Block(...); - * - * block = this._blocks[0]; - * - * @todo proxy the enumerate method - * - * @type {Proxy} - * @private - */ - _this2._blocks = new Proxy(blocks, { - set: Blocks.set, - get: Blocks.get - }); - - resolve(); - }); - } - - /** - * Creates Block instance by tool name - * - * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} - * @param {Object} data - constructor params - * - * @return {Block} - */ - - }, { - key: 'composeBlock', - value: function composeBlock(toolName, data) { - - var toolInstance = this.Editor.Tools.construct(toolName, data), - block = new _block2.default(toolName, toolInstance); - - this.bindEvents(block); - - /** - * Apply callback before inserting html - */ - block.call('appendCallback', {}); - - return block; - } - - /** - * Bind Events - * @param {Object} block - */ - - }, { - key: 'bindEvents', - value: function bindEvents(block) { - var _this3 = this; - - this.Editor.Listeners.on(block.pluginsContent, 'keydown', function (event) { - return _this3.Editor.Keyboard.blockKeydownsListener(event); - }); - } - - /** - * Set's caret to the next Block - * Before moving caret, we should check if caret position is at the end of Plugins node - * Using {@link Dom#getDeepestNode} to get a last node and match with current selection - */ - - }, { - key: 'navigateNext', - value: function navigateNext() { - - var caretAtEnd = this.Editor.Caret.isAtEnd; - - if (!caretAtEnd) { - - return; - } - - var nextBlock = this.nextBlock; - - if (!nextBlock) { - - return; - } - - this.Editor.Caret.setToBlock(nextBlock); - } - - /** - * Set's caret to the previous Block - * Before moving caret, we should check if caret position is start of the Plugins node - * Using {@link Dom#getDeepestNode} to get a last node and match with current selection - */ - - }, { - key: 'navigatePrevious', - value: function navigatePrevious() { - - var caretAtStart = this.Editor.Caret.isAtStart; - - if (!caretAtStart) { - - return; - } - - var previousBlock = this.previousBlock; - - if (!previousBlock) { - - return; - } - - this.Editor.Caret.setToBlock(previousBlock, 0, true); - } - - /** - * Insert new block into _blocks - * - * @param {String} toolName — plugin name - * @param {Object} data — plugin data - */ - - }, { - key: 'insert', - value: function insert(toolName) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - - var block = this.composeBlock(toolName, data); - - this._blocks[++this.currentBlockIndex] = block; - this.Editor.Caret.setToBlock(block); - } - - /** - * Merge two blocks - * @param {Block} targetBlock - previous block will be append to this block - * @param {Block} blockToMerge - block that will be merged with target block - * - * @return {Promise} - the sequence that can be continued - */ - - }, { - key: 'mergeBlocks', - value: function mergeBlocks(targetBlock, blockToMerge) { - var _this4 = this; - - var blockToMergeIndex = this._blocks.indexOf(blockToMerge); - - return Promise.resolve().then(function () { - - if (blockToMerge.isEmpty) { - - return; - } - - return blockToMerge.data.then(function (blockToMergeInfo) { - - targetBlock.mergeWith(blockToMergeInfo.data); - }); - }).then(function () { - - _this4.removeBlock(blockToMergeIndex); - _this4.currentBlockIndex = _this4._blocks.indexOf(targetBlock); - }); - } - - /** - * Remove block with passed index or remove last - * @param {Number|null} index - */ - - }, { - key: 'removeBlock', - value: function removeBlock(index) { - - this._blocks.remove(index); - } - /** - * Split current Block - * 1. Extract content from Caret position to the Block`s end - * 2. Insert a new Block below current one with extracted content - */ - - }, { - key: 'split', - value: function split() { - - var extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), - wrapper = $.make('div'); - - wrapper.append(extractedFragment); - - /** - * @todo make object in accordance with Tool - */ - var data = { - text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML - }; - - this.insert(this.config.initialBlock, data); - } - - /** - * Replace current working block - * - * @param {String} toolName — plugin name - * @param {Object} data — plugin data - */ - - }, { - key: 'replace', - value: function replace(toolName) { - var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - - var block = this.composeBlock(toolName, data); - - this._blocks.insert(this.currentBlockIndex, block, true); - } - - /** - * returns last Block - * @return {Block} - */ - - }, { - key: 'getBlockByIndex', - - - /** - * Returns Block by passed index - * @param {Number} index - * @return {Block} - */ - value: function getBlockByIndex(index) { - - return this._blocks[index]; - } - - /** - * Get Block instance by html element - * @param {HTMLElement} element - * @returns {Block} - */ - - }, { - key: 'getBlock', - value: function getBlock(element) { - - var nodes = this._blocks.nodes, - firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper), - index = nodes.indexOf(firstLevelBlock); - - if (index >= 0) { - - return this._blocks[index]; - } - } - - /** - * Get current Block instance - * - * @return {Block} - */ - - }, { - key: 'setCurrentBlockByChildNode', - - - /** - * 1) Find first-level Block from passed child Node - * 2) Mark it as current - * - * @param {Element|Text} childNode - look ahead from this node. - * @throws Error - when passed Node is not included at the Block - */ - value: function setCurrentBlockByChildNode(childNode) { - - /** - * If node is Text TextNode - */ - if (!$.isElement(childNode)) { - - childNode = childNode.parentNode; - } - - var parentFirstLevelBlock = childNode.closest('.' + _block2.default.CSS.wrapper); - - if (parentFirstLevelBlock) { - - this.currentNode = parentFirstLevelBlock; - } else { - - throw new Error('Can not find a Block from this child Node'); - } - } - }, { - key: 'lastBlock', - get: function get() { - - return this._blocks[this._blocks.length - 1]; - } - }, { - key: 'currentBlock', - get: function get() { - - return this._blocks[this.currentBlockIndex]; - } - - /** - * Returns next Block instance - * @return {Block|null} - */ - - }, { - key: 'nextBlock', - get: function get() { - - var isLastBlock = this.currentBlockIndex === this._blocks.length - 1; - - if (isLastBlock) { - - return null; - } - - return this._blocks[this.currentBlockIndex + 1]; - } - - /** - * Returns previous Block instance - * @return {Block|null} - */ - - }, { - key: 'previousBlock', - get: function get() { - - var isFirstBlock = this.currentBlockIndex === 0; - - if (isFirstBlock) { - - return null; - } - - return this._blocks[this.currentBlockIndex - 1]; - } - - /** - * Get working html element - * - * @return {HTMLElement} - */ - - }, { - key: 'currentNode', - get: function get() { - - return this._blocks.nodes[this.currentBlockIndex]; - } - - /** - * Set currentBlockIndex to passed block - * @param {HTMLElement} element - */ - , - set: function set(element) { - - var nodes = this._blocks.nodes, - firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper); - - /** - * Update current Block's index - * @type {number} - */ - this.currentBlockIndex = nodes.indexOf(firstLevelBlock); - - /** - * Remove previous selected Block's state - */ - this._blocks.array.forEach(function (block) { - return block.selected = false; - }); - - /** - * Mark current Block as selected - * @type {boolean} - */ - this.currentBlock.selected = true; - } - - /** - * Get array of Block instances - * - * @returns {Block[]} {@link Blocks#array} - */ - - }, { - key: 'blocks', - get: function get() { - - return this._blocks.array; - } - }]); - - return BlockManager; -}(Module); - -/** - * @class Blocks - * @classdesc Class to work with Block instances array - * - * @private - * - * @property {HTMLElement} workingArea — editor`s working node - * - */ - - -BlockManager.displayName = 'BlockManager'; -exports.default = BlockManager; - -var Blocks = function () { - - /** - * @constructor - * - * @param {HTMLElement} workingArea — editor`s working node - */ - function Blocks(workingArea) { - _classCallCheck(this, Blocks); - - this.blocks = []; - this.workingArea = workingArea; - } - - /** - * Push back new Block - * - * @param {Block} block - */ - - - _createClass(Blocks, [{ - key: 'push', - value: function push(block) { - - this.blocks.push(block); - this.workingArea.appendChild(block.html); - } - - /** - * Insert new Block at passed index - * - * @param {Number} index — index to insert Block - * @param {Block} block — Block to insert - * @param {Boolean} replace — it true, replace block on given index - */ - - }, { - key: 'insert', - value: function insert(index, block) { - var replace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - - if (!this.length) { - - this.push(block); - return; - } - - if (index > this.length) { - - index = this.length; - } - - if (replace) { - - this.blocks[index].html.remove(); - } - - var deleteCount = replace ? 1 : 0; - - this.blocks.splice(index, deleteCount, block); - - if (index > 0) { - - var previousBlock = this.blocks[index - 1]; - - previousBlock.html.insertAdjacentElement('afterend', block.html); - } else { - - var nextBlock = this.blocks[index + 1]; - - if (nextBlock) { - - nextBlock.html.insertAdjacentElement('beforebegin', block.html); - } else { - - this.workingArea.appendChild(block.html); - } - } - } - - /** - * Remove block - * @param {Number|null} index - */ - - }, { - key: 'remove', - value: function remove(index) { - - if (!index) { - - index = this.length - 1; - } - - this.blocks[index].html.remove(); - this.blocks.splice(index, 1); - } - - /** - * Insert Block after passed target - * - * @todo decide if this method is necessary - * - * @param {Block} targetBlock — target after wich Block should be inserted - * @param {Block} newBlock — Block to insert - */ - - }, { - key: 'insertAfter', - value: function insertAfter(targetBlock, newBlock) { - - var index = this.blocks.indexOf(targetBlock); - - this.insert(index + 1, newBlock); - } - - /** - * Get Block by index - * - * @param {Number} index — Block index - * @returns {Block} - */ - - }, { - key: 'get', - value: function get(index) { - - return this.blocks[index]; - } - - /** - * Return index of passed Block - * - * @param {Block} block - * @returns {Number} - */ - - }, { - key: 'indexOf', - value: function indexOf(block) { - - return this.blocks.indexOf(block); - } - - /** - * Get length of Block instances array - * - * @returns {Number} - */ - - }, { - key: 'length', - get: function get() { - - return this.blocks.length; - } - - /** - * Get Block instances array - * - * @returns {Block[]} - */ - - }, { - key: 'array', - get: function get() { - - return this.blocks; - } - - /** - * Get blocks html elements array - * - * @returns {HTMLElement[]} - */ - - }, { - key: 'nodes', - get: function get() { - - return _.array(this.workingArea.children); - } - - /** - * Proxy trap to implement array-like setter - * - * @example - * blocks[0] = new Block(...) - * - * @param {Blocks} instance — Blocks instance - * @param {Number|String} index — block index - * @param {Block} block — Block to set - * @returns {Boolean} - */ - - }], [{ - key: 'set', - value: function set(instance, index, block) { - - if (isNaN(Number(index))) { - - return false; - } - - instance.insert(index, block); - - return true; - } - - /** - * Proxy trap to implement array-like getter - * - * @param {Blocks} instance — Blocks instance - * @param {Number|String} index — Block index - * @returns {Block|*} - */ - - }, { - key: 'get', - value: function get(instance, index) { - - if (isNaN(Number(index))) { - - return instance[index]; - } - - return instance.get(index); - } - }]); - - return Blocks; -}(); - -Blocks.displayName = 'Blocks'; -module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2), __webpack_require__(1))) - -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function($, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * - * @class Block - * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool - * - * @property {Tool} tool — current block tool (Paragraph, for example) - * @property {Object} CSS — block`s css classes - * - */ - -/** - * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance - * - * @property tool - Tool instance - * @property html - Returns HTML content of plugin - * @property wrapper - Div element that wraps block content with Tool's content. Has `ce-block` CSS class - * @property contentNode - Div element that wraps Tool's content. Has `ce-block__content` CSS class - * @property pluginsContent - HTML content that returns by Tool's render function - */ -var Block = function () { - - /** - * @constructor - * @param {String} toolName - Tool name that passed on initialization - * @param {Object} toolInstance — passed Tool`s instance that rendered the Block - */ - function Block(toolName, toolInstance) { - _classCallCheck(this, Block); - - this.name = toolName; - this.tool = toolInstance; - this._html = this.compose(); - } - - /** - * CSS classes for the Block - * @return {{wrapper: string, content: string}} - */ - - - _createClass(Block, [{ - key: 'compose', - - - /** - * Make default Block wrappers and put Tool`s content there - * @returns {HTMLDivElement} - */ - value: function compose() { - - this.wrapper = $.make('div', Block.CSS.wrapper); - this.contentNode = $.make('div', Block.CSS.content); - this.pluginsContent = this.tool.render(); - - this.contentNode.appendChild(this.pluginsContent); - this.wrapper.appendChild(this.contentNode); - - return this.wrapper; - } - - /** - * Calls Tool's method - * - * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function - * - * @param {String} methodName - * @param {Object} params - */ - - }, { - key: 'call', - value: function call(methodName, params) { - - /** - * call Tool's method with the instance context - */ - if (this.tool[methodName] && this.tool[methodName] instanceof Function) { - - this.tool[methodName].call(this.tool, params); - } - } - - /** - * Get Block`s HTML - * @returns {HTMLElement} - */ - - }, { - key: 'mergeWith', - - - /** - * Call plugins merge method - * @param {Object} data - */ - value: function mergeWith(data) { - var _this = this; - - return Promise.resolve().then(function () { - - _this.tool.merge(data); - }); - } - /** - * Extracts data from Block - * Groups Tool's save processing time - * @return {Object} - */ - - }, { - key: 'save', - value: function save() { - var _this2 = this; - - var extractedBlock = this.tool.save(this.pluginsContent); - - /** Measuring execution time*/ - var measuringStart = window.performance.now(), - measuringEnd = void 0; - - return Promise.resolve(extractedBlock).then(function (finishedExtraction) { - - /** measure promise execution */ - measuringEnd = window.performance.now(); - - return { - tool: _this2.name, - data: finishedExtraction, - time: measuringEnd - measuringStart - }; - }).catch(function (error) { - - _.log('Saving proccess for ' + this.tool.name + ' tool failed due to the ' + error, 'log', 'red'); - }); - } - - /** - * Uses Tool's validation method to check the correctness of output data - * Tool's validation method is optional - * - * @description Method also can return data if it passed the validation - * - * @param {Object} data - * @returns {Boolean|Object} valid - */ - - }, { - key: 'validateData', - value: function validateData(data) { - - var isValid = true; - - if (this.tool.validate instanceof Function) { - - isValid = this.tool.validate(data); - } - - if (!isValid) { - - return false; - } - - return data; - } - - /** - * Check block for emptiness - * @return {Boolean} - */ - - }, { - key: 'html', - get: function get() { - - return this._html; - } - - /** - * Get Block's JSON data - * @return {Object} - */ - - }, { - key: 'data', - get: function get() { - - return this.save(); - } - - /** - * is block mergeable - * We plugin have merge function then we call it mergable - * @return {boolean} - */ - - }, { - key: 'mergeable', - get: function get() { - - return typeof this.tool.merge === 'function'; - } - }, { - key: 'isEmpty', - get: function get() { - - /** - * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool - * That Tools are not empty - */ - if (this.tool.contentless) { - - return false; - } - - var emptyText = $.isEmpty(this.pluginsContent), - emptyMedia = !this.hasMedia; - - return emptyText && emptyMedia; - } - - /** - * Check if block has a media content such as images, iframes and other - * @return {Boolean} - */ - - }, { - key: 'hasMedia', - get: function get() { - - /** - * This tags represents media-content - * @type {string[]} - */ - var mediaTags = ['img', 'iframe', 'video', 'audio', 'source', 'input', 'textarea', 'twitterwidget']; - - return !!this._html.querySelector(mediaTags.join(',')); - } - - /** - * Set selected state - * @param {Boolean} state - 'true' to select, 'false' to remove selection - */ - - }, { - key: 'selected', - set: function set(state) { - - /** - * We don't need to mark Block as Selected when it is not empty - */ - if (state === true && !this.isEmpty) { - - this._html.classList.add(Block.CSS.selected); - } else { - - this._html.classList.remove(Block.CSS.selected); - } - } - }], [{ - key: 'CSS', - get: function get() { - - return { - wrapper: 'ce-block', - content: 'ce-block__content', - selected: 'ce-block--selected' - }; - } - }]); - - return Block; -}(); - -Block.displayName = 'Block'; -exports.default = Block; -module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(1))) - -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module, $, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -var _Selection = __webpack_require__(9); - -var _Selection2 = _interopRequireDefault(_Selection); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** - * @class Caret - * @classdesc Contains methods for working Caret - * - * Uses Range methods to manipulate with caret - * - * @module Caret - * - * @version 2.0.0 - */ - -/** - * @typedef {Caret} Caret - */ - - -var Caret = function (_Module) { - _inherits(Caret, _Module); - - /** - * @constructor - */ - function Caret(_ref) { - var config = _ref.config; - - _classCallCheck(this, Caret); - - return _possibleConstructorReturn(this, (Caret.__proto__ || Object.getPrototypeOf(Caret)).call(this, { config: config })); - } - - /** - * Method gets Block instance and puts caret to the text node with offset - * There two ways that method applies caret position: - * - first found text node: sets at the beginning, but you can pass an offset - * - last found text node: sets at the end of the node. Also, you can customize the behaviour - * - * @param {Block} block - Block class - * @param {Number} offset - caret offset regarding to the text node - * @param {Boolean} atEnd - put caret at the end of the text node or not - */ - - - _createClass(Caret, [{ - key: 'setToBlock', - value: function setToBlock(block) { - var _this2 = this; - - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - var atEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - - - var element = block.pluginsContent; - - /** If Element is INPUT */ - if ($.isNativeInput(element)) { - - element.focus(); - return; - } - - var nodeToSet = $.getDeepestNode(element, atEnd); - - if (atEnd || offset > nodeToSet.length) { - - offset = nodeToSet.length; - } - - /** if found deepest node is native input */ - if ($.isNativeInput(nodeToSet)) { - - nodeToSet.focus(); - return; - } - - /** - * @todo try to fix via Promises or use querySelectorAll to not to use timeout - */ - _.delay(function () { - - _this2.set(nodeToSet, offset); - }, 20)(); - - this.Editor.BlockManager.currentNode = block.wrapper; - } - - /** - * Creates Document Range and sets caret to the element with offset - * @param {Element} element - target node. - * @param {Number} offset - offset - */ - - }, { - key: 'set', - value: function set(element) { - var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - - var range = document.createRange(), - selection = _Selection2.default.get(); - - range.setStart(element, offset); - range.setEnd(element, offset); - - selection.removeAllRanges(); - selection.addRange(range); - } - }, { - key: 'setToTheLastBlock', - - - /** - * Set Caret to the last Block - * If last block is not empty, append another empty block - */ - value: function setToTheLastBlock() { - - var lastBlock = this.Editor.BlockManager.lastBlock; - - if (!lastBlock) return; - - /** - * If last block is empty and it is an initialBlock, set to that. - * Otherwise, append new empty block and set to that - */ - if (lastBlock.isEmpty) { - - this.setToBlock(lastBlock); - } else { - - this.Editor.BlockManager.insert(this.config.initialBlock); - } - } - - /** - * Extract content fragment of current Block from Caret position to the end of the Block - */ - - }, { - key: 'extractFragmentFromCaretPosition', - value: function extractFragmentFromCaretPosition() { - - var selection = _Selection2.default.get(); - - if (selection.rangeCount) { - - var selectRange = selection.getRangeAt(0), - blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; - - selectRange.deleteContents(); - - if (blockElem) { - - var range = selectRange.cloneRange(true); - - range.selectNodeContents(blockElem); - range.setStart(selectRange.endContainer, selectRange.endOffset); - return range.extractContents(); - } - } - } - - /** - * Get all first-level (first child of [contenteditabel]) siblings from passed node - * Then you can check it for emptiness - * - * @example - *
- *

| - *

| left first-level siblings - *

| - *
adaddad
<-- passed node for example - *

| - *

| right first-level siblings - *

| - *
- * - * @return {Element[]} - */ - - }, { - key: 'getHigherLevelSiblings', - value: function getHigherLevelSiblings(from, direction) { - - var current = from, - siblings = []; - - /** - * Find passed node's firs-level parent (in example - blockquote) - */ - while (current.parentNode && current.parentNode.contentEditable !== 'true') { - - current = current.parentNode; - } - - var sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; - - /** - * Find all left/right siblings - */ - while (current[sibling]) { - - current = current[sibling]; - siblings.push(current); - } - - return siblings; - } - - /** - * Get's deepest first node and checks if offset is zero - * @return {boolean} - */ - - }, { - key: 'isAtStart', - get: function get() { - - /** - * Don't handle ranges - */ - if (!_Selection2.default.isCollapsed) { - - return false; - } - - var selection = _Selection2.default.get(), - anchorNode = selection.anchorNode, - firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); - - /** - * Workaround case when caret in the text like " |Hello!" - * selection.anchorOffset is 1, but real caret visible position is 0 - * @type {number} - */ - var firstLetterPosition = anchorNode.textContent.search(/\S/); - - if (firstLetterPosition === -1) { - // empty text - - firstLetterPosition = 0; - } - - /** - * In case of - *
- *

<-- first (and deepest) node is - * |adaddad <-- anchor node - *
- */ - if ($.isEmpty(firstNode)) { - - var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), - nothingAtLeft = leftSiblings.every(function (node) { - return $.isEmpty(node); - }); - - if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { - - return true; - } - } - - return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition; - } - - /** - * Get's deepest last node and checks if offset is last node text length - * @return {boolean} - */ - - }, { - key: 'isAtEnd', - get: function get() { - - /** - * Don't handle ranges - */ - if (!_Selection2.default.isCollapsed) { - - return false; - } - - var selection = _Selection2.default.get(), - anchorNode = selection.anchorNode, - lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); - - /** - * In case of - *
- * adaddad| <-- anchor node - *

<-- first (and deepest) node is - *
- */ - if ($.isEmpty(lastNode)) { - - var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), - nothingAtRight = leftSiblings.every(function (node) { - return $.isEmpty(node); - }); - - if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { - - return true; - } - } - - return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length; - } - }]); - - return Caret; -}(Module); - -Caret.displayName = 'Caret'; -exports.default = Caret; -module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2), __webpack_require__(1))) - -/***/ }), -/* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -/** - * Working with selection - */ -var Selection = function () { - - /** - * @constructor - */ - function Selection() { - _classCallCheck(this, Selection); - - this.instance = null; - this.selection = null; - } - - /** - * Returns window Selection - * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} - * @return {Selection} - */ - - - _createClass(Selection, null, [{ - key: "get", - value: function get() { - - return window.getSelection(); - } - - /** - * Returns selected anchor - * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} - * @return {Node|null} - */ - - }, { - key: "getAnchorNode", - value: function getAnchorNode() { - - var selection = window.getSelection(); - - return selection ? selection.anchorNode : null; - } - - /** - * Returns selection offset according to the anchor node - * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} - * @return {Number|null} - */ - - }, { - key: "getAnchorOffset", - value: function getAnchorOffset() { - - var selection = window.getSelection(); - - return selection ? selection.anchorOffset : null; - } - - /** - * Is current selection range collapsed - * @return {boolean|null} - */ - - }, { - key: "isCollapsed", - get: function get() { - - var selection = window.getSelection(); - - return selection ? selection.isCollapsed : null; - } - }]); - - return Selection; -}(); - -Selection.displayName = "Selection"; -exports.default = Selection; -module.exports = exports["default"]; - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * @module eventDispatcher - * - * Has two important methods: - * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one - * - {Function} emit - fires all subscribers with data - * - * @version 1.0.0 - * - * @typedef {Events} Events - * @property {Object} subscribers - all subscribers grouped by event name - */ -var Events = function (_Module) { - _inherits(Events, _Module); - - /** - * @constructor - */ - function Events(_ref) { - var config = _ref.config; - - _classCallCheck(this, Events); - - var _this = _possibleConstructorReturn(this, (Events.__proto__ || Object.getPrototypeOf(Events)).call(this, { config: config })); - - _this.subscribers = {}; - - return _this; - } - - /** - * @param {String} eventName - event name - * @param {Function} callback - subscriber - */ - - - _createClass(Events, [{ - key: "on", - value: function on(eventName, callback) { - - if (!(eventName in this.subscribers)) { - - this.subscribers[eventName] = []; - } - - // group by events - this.subscribers[eventName].push(callback); - } - - /** - * @param {String} eventName - event name - * @param {Object} data - subscribers get this data when they were fired - */ - - }, { - key: "emit", - value: function emit(eventName, data) { - - this.subscribers[eventName].reduce(function (previousData, currentHandler) { - - var newData = currentHandler(previousData); - - return newData ? newData : previousData; - }, data); - } - - /** - * Destroyer - * clears subsribers list - */ - - }, { - key: "destroy", - value: function destroy() { - - this.subscribers = null; - } - }]); - - return Events; -}(Module); - -Events.displayName = "Events"; -exports.default = Events; -module.exports = exports["default"]; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * @class Keyboard - * @classdesc Сlass to handle the keydowns - * - * @author CodeX Team (team@ifmo.su) - * @copyright CodeX Team 2017 - * @license The MIT License (MIT) - * @version 1.0.0 - */ - -/** - * @typedef {Keyboard} Keyboard - */ -var Keyboard = function (_Module) { - _inherits(Keyboard, _Module); - - /** - * @constructor - */ - function Keyboard(_ref) { - var config = _ref.config; - - _classCallCheck(this, Keyboard); - - return _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, { config: config })); - } - - /** - * Handler on Block for keyboard keys at keydown event - * - * @param {KeyboardEvent} event - */ - - - _createClass(Keyboard, [{ - key: 'blockKeydownsListener', - value: function blockKeydownsListener(event) { - - switch (event.keyCode) { - - case _.keyCodes.BACKSPACE: - - _.log('Backspace key pressed'); - this.backspacePressed(event); - break; - - case _.keyCodes.ENTER: - - _.log('Enter key pressed'); - this.enterPressed(event); - break; - - case _.keyCodes.DOWN: - case _.keyCodes.RIGHT: - - _.log('Right/Down key pressed'); - this.arrowRightAndDownPressed(); - break; - - case _.keyCodes.UP: - case _.keyCodes.LEFT: - - _.log('Left/Up key pressed'); - this.arrowLeftAndUpPressed(); - break; - - default: - - break; - - } - } - - /** - * Handle pressing enter key - * - * @param {KeyboardEvent} event - */ - - }, { - key: 'enterPressed', - value: function enterPressed(event) { - - var currentBlock = this.Editor.BlockManager.currentBlock, - toolsConfig = this.config.toolsConfig[currentBlock.name]; - - /** - * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. - * Uses for Tools like where line breaks should be handled by default behaviour. - */ - if (toolsConfig && toolsConfig.enableLineBreaks) { - - return; - } - - /** - * Allow to create linebreaks by Shift+Enter - */ - if (event.shiftKey) { - - return; - } - - /** - * Split the Current Block into two blocks - */ - this.Editor.BlockManager.split(); - event.preventDefault(); - } - - /** - * Handle backspace keypress on block - * @param {KeyboardEvent} event - keydown - */ - - }, { - key: 'backspacePressed', - value: function backspacePressed(event) { - var _this2 = this; - - var BM = this.Editor.BlockManager; - - var isFirstBlock = BM.currentBlockIndex === 0, - canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; - - if (!canMergeBlocks) { - - return; - } - - // preventing browser default behaviour - event.preventDefault(); - - var targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), - blockToMerge = BM.currentBlock; - - /** - * Blocks that can be merged: - * 1) with the same Name - * 2) Tool has 'merge' method - * - * other case will handle as usual ARROW LEFT behaviour - */ - if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { - - BM.navigatePrevious(); - } - - var setCaretToTheEnd = !targetBlock.isEmpty ? true : false; - - BM.mergeBlocks(targetBlock, blockToMerge).then(function () { - - window.setTimeout(function () { - - // set caret to the block without offset at the end - _this2.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd); - _this2.Editor.Toolbar.close(); - }, 10); - }); - } - - /** - * Handle right and down keyboard keys - */ - - }, { - key: 'arrowRightAndDownPressed', - value: function arrowRightAndDownPressed() { - - this.Editor.BlockManager.navigateNext(); - } - - /** - * Handle left and up keyboard keys - */ - - }, { - key: 'arrowLeftAndUpPressed', - value: function arrowLeftAndUpPressed() { - - this.Editor.BlockManager.navigatePrevious(); - } - }]); - - return Keyboard; -}(Module); - -Keyboard.displayName = 'Keyboard'; -exports.default = Keyboard; -module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) - -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * Codex Editor Listeners module - * - * @module Listeners - * - * Module-decorator for event listeners assignment - * - * @author Codex Team - * @version 2.0.0 - */ - -/** - * @typedef {Listeners} Listeners - * @property {Array} allListeners - */ - -var Listeners = function (_Module) { - _inherits(Listeners, _Module); - - /** - * @constructor - * @param {EditorConfig} config - */ - function Listeners(_ref) { - var config = _ref.config; - - _classCallCheck(this, Listeners); - - var _this = _possibleConstructorReturn(this, (Listeners.__proto__ || Object.getPrototypeOf(Listeners)).call(this, { config: config })); - - _this.allListeners = []; - - return _this; - } - - /** - * Assigns event listener on element - * - * @param {Element} element - DOM element that needs to be listened - * @param {String} eventType - event type - * @param {Function} handler - method that will be fired on event - * @param {Boolean} useCapture - use event bubbling - */ - - - _createClass(Listeners, [{ - key: "on", - value: function on(element, eventType, handler) { - var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - - var assignedEventData = { - element: element, - eventType: eventType, - handler: handler, - useCapture: useCapture - }; - - var alreadyExist = this.findOne(element, eventType, handler); - - if (alreadyExist) return; - - this.allListeners.push(assignedEventData); - element.addEventListener(eventType, handler, useCapture); - } - - /** - * Removes event listener from element - * - * @param {Element} element - DOM element that we removing listener - * @param {String} eventType - event type - * @param {Function} handler - remove handler, if element listens several handlers on the same event type - * @param {Boolean} useCapture - use event bubbling - */ - - }, { - key: "off", - value: function off(element, eventType, handler) { - var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; - - - var existingListeners = this.findAll(element, eventType, handler); - - for (var i = 0; i < existingListeners.length; i++) { - - var index = this.allListeners.indexOf(existingListeners[i]); - - if (index > 0) { - - this.allListeners.splice(index, 1); - } - } - - element.removeEventListener(eventType, handler, useCapture); - } - - /** - * Search method: looks for listener by passed element - * @param {Element} element - searching element - * @returns {Array} listeners that found on element - */ - - }, { - key: "findByElement", - value: function findByElement(element) { - - var listenersOnElement = []; - - for (var i = 0; i < this.allListeners.length; i++) { - - var listener = this.allListeners[i]; - - if (listener.element === element) { - - listenersOnElement.push(listener); - } - } - - return listenersOnElement; - } - - /** - * Search method: looks for listener by passed event type - * @param {String} eventType - * @return {Array} listeners that found on element - */ - - }, { - key: "findByType", - value: function findByType(eventType) { - - var listenersWithType = []; - - for (var i = 0; i < this.allListeners.length; i++) { - - var listener = this.allListeners[i]; - - if (listener.type === eventType) { - - listenersWithType.push(listener); - } - } - - return listenersWithType; - } - - /** - * Search method: looks for listener by passed handler - * @param {Function} handler - * @return {Array} listeners that found on element - */ - - }, { - key: "findByHandler", - value: function findByHandler(handler) { - - var listenersWithHandler = []; - - for (var i = 0; i < this.allListeners.length; i++) { - - var listener = this.allListeners[i]; - - if (listener.handler === handler) { - - listenersWithHandler.push(listener); - } - } - - return listenersWithHandler; - } - - /** - * @param {Element} element - * @param {String} eventType - * @param {Function} handler - * @return {Element|null} - */ - - }, { - key: "findOne", - value: function findOne(element, eventType, handler) { - - var foundListeners = this.findAll(element, eventType, handler); - - return foundListeners.length > 0 ? foundListeners[0] : null; - } - - /** - * @param {Element} element - * @param {String} eventType - * @param {Function} handler - * @return {Array} - */ - - }, { - key: "findAll", - value: function findAll(element, eventType, handler) { - - var foundAllListeners = void 0, - foundByElements = [], - foundByEventType = [], - foundByHandler = []; - - if (element) foundByElements = this.findByElement(element); - - if (eventType) foundByEventType = this.findByType(eventType); - - if (handler) foundByHandler = this.findByHandler(handler); - - foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler); - - return foundAllListeners; - } - - /** - * Removes all listeners - */ - - }, { - key: "removeAll", - value: function removeAll() { - - this.allListeners.map(function (current) { - - current.element.removeEventListener(current.eventType, current.handler); - }); - - this.allListeners = []; - } - }]); - - return Listeners; -}(Module); - -Listeners.displayName = "Listeners"; -exports.default = Listeners; -module.exports = exports["default"]; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) - -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * Codex Editor Renderer Module - * - * @module Renderer - * @author CodeX Team - * - * @version 2.0.0 - */ -var Renderer = function (_Module) { - _inherits(Renderer, _Module); - - /** - * @constructor - * @param {EditorConfig} config - */ - function Renderer(_ref) { - var config = _ref.config; - - _classCallCheck(this, Renderer); - - return _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).call(this, { config: config })); - } - - /** - * @typedef {Object} RendererItems - * @property {String} type - tool name - * @property {Object} data - tool data - */ - - /** - * @example - * - * items: [ - * { - * type : 'paragraph', - * data : { - * text : 'Hello from Codex!' - * } - * }, - * { - * type : 'paragraph', - * data : { - * text : 'Leave feedback if you like it!' - * } - * }, - * ] - * - */ - - /** - * Make plugin blocks from array of plugin`s data - * @param {RendererItems[]} items - */ - - - _createClass(Renderer, [{ - key: "render", - value: function render(items) { - var _this2 = this; - - var chainData = []; - - var _loop = function _loop(i) { - - chainData.push({ - function: function _function() { - return _this2.insertBlock(items[i]); - } - }); - }; - - for (var i = 0; i < items.length; i++) { - _loop(i); - } - - return _.sequence(chainData); - } - - /** - * Get plugin instance - * Add plugin instance to BlockManager - * Insert block to working zone - * - * @param {Object} item - * @returns {Promise.} - * @private - */ - - }, { - key: "insertBlock", - value: function insertBlock(item) { - - var tool = item.type, - data = item.data; - - this.Editor.BlockManager.insert(tool, data); - - return Promise.resolve(); - } - }]); - - return Renderer; -}(Module); - -Renderer.displayName = "Renderer"; -exports.default = Renderer; -module.exports = exports["default"]; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) - -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(Module, _) { - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -/** - * CodeX Sanitizer - * - * @module Sanitizer - * Clears HTML from taint tags - * - * @version 2.0.0 - * - * @example - * Module can be used within two ways: - * 1) When you have an instance - * - this.Editor.Sanitizer.clean(yourTaintString); - * 2) As static method - * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration); - * - * {@link SanitizerConfig} - */ - -/** - * @typedef {Object} SanitizerConfig - * @property {Object} tags - define tags restrictions - * - * @example - * - * tags : { - * p: true, - * a: { - * href: true, - * rel: "nofollow", - * target: "_blank" - * } - * } - */ -var Sanitizer = function (_Module) { - _inherits(Sanitizer, _Module); - - /** - * Initializes Sanitizer module - * Sets default configuration if custom not exists - * - * @property {SanitizerConfig} this.defaultConfig - * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library - * - * @param {SanitizerConfig} config - */ - function Sanitizer(_ref) { - var config = _ref.config; - - _classCallCheck(this, Sanitizer); - - // default config - var _this = _possibleConstructorReturn(this, (Sanitizer.__proto__ || Object.getPrototypeOf(Sanitizer)).call(this, { config: config })); - - _this.defaultConfig = null; - _this._sanitizerInstance = null; - - /** Custom configuration */ - _this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; - - /** HTML Janitor library */ - _this.sanitizerInstance = __webpack_require__(15); - - return _this; - } - - /** - * If developer uses editor's API, then he can customize sanitize restrictions. - * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere - * At least, if there is no config overrides, that API uses Default configuration - * - * @uses https://www.npmjs.com/package/html-janitor - * - * @param {HTMLJanitor} library - sanitizer extension - */ - - - _createClass(Sanitizer, [{ - key: 'clean', - - - /** - * Cleans string from unwanted tags - * @param {String} taintString - HTML string - * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty - * @return {String} clean HTML - */ - value: function clean(taintString) { - var customConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - - if (_.isEmpty(customConfig)) { - - return this._sanitizerInstance.clean(taintString); - } else { - - return Sanitizer.clean(taintString, customConfig); - } - } - - /** - * Cleans string from unwanted tags - * @static - * - * Method allows to use default config - * - * @param {String} taintString - taint string - * @param {SanitizerConfig} customConfig - allowed tags - * - * @return {String} clean HTML - */ - - }, { - key: 'sanitizerInstance', - set: function set(library) { - - this._sanitizerInstance = new library(this.defaultConfig); - } - - /** - * Sets sanitizer configuration. Uses default config if user didn't pass the restriction - * @param {SanitizerConfig} config - */ - - }, { - key: 'sanitizerConfig', - set: function set(config) { - - if (_.isEmpty(config)) { - - this.defaultConfig = { - tags: { - p: {}, - a: { - href: true, - target: '_blank', - rel: 'nofollow' - } - } - }; - } else { - - this.defaultConfig = config; - } - } - }], [{ - key: 'clean', - value: function clean(taintString, customConfig) { - - var newInstance = Sanitizer(customConfig); - - return newInstance.clean(taintString); - } - }]); - - return Sanitizer; -}(Module); - -Sanitizer.displayName = 'Sanitizer'; -exports.default = Sanitizer; -module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) - -/***/ }), -/* 15 */ +/***/ "./node_modules/html-janitor/src/html-janitor.js": +/*!*******************************************************!*\ + !*** ./node_modules/html-janitor/src/html-janitor.js ***! + \*******************************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { @@ -3650,11 +188,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (roo (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else if (typeof exports === 'object') { - module.exports = factory(); - } else { - root.HTMLJanitor = factory(); - } + } else {} }(this, function () { /** @@ -3835,14 +369,3200 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (roo /***/ }), -/* 16 */ + +/***/ "./src/codex.js": +/*!**********************!*\ + !*** ./src/codex.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(_) {/** + * Codex Editor + * + * Short Description (눈_눈;) + * @version 2.0.0 + * + * How to start? + * Example: + * new CodexEditor({ + * holderId : 'codex-editor', + * initialBlock : 'text', + * placeholder : 'Write your story....', + * tools: { + * quote: Quote, + * anotherTool : AnotherTool + * }, + * toolsConfig: { + * quote: { + * iconClassname : 'quote-icon', + * displayInToolbox : true, + * enableLineBreaks : true + * }, + * anotherTool: { + * iconClassname : 'tool-icon' + * } + * } + * }); + * + * - tools is an object: { + * pluginName: PluginClass, + * ..... + * } + * - toolsConfig is an additional configuration that uses Codex Editor API + * iconClassname - CSS classname of toolbox icon + * displayInToolbox - if you want to see your Tool in toolbox hided in "plus" button, than set "True". By default : "False" + * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property "True", enter will break the lines in current block + * + * @author CodeX-Team + * + */ + +/** + * @typedef {CodexEditor} CodexEditor - editor class + */ + +/** + * @typedef {Object} EditorConfig + * @property {String} holderId - Element to append Editor + * @property {Array} data - Blocks list in JSON-format + * @property {Object} tools - Map for used Tools in format { name : Class, ... } + * @property {String} initialBlock - This Tool will be added by default + * @property {String} placeholder - First Block placeholder + * @property {Object} sanitizer - @todo fill desc + * @property {Boolean} hideToolbar - @todo fill desc + * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig} + */ + +/** + * Dynamically imported utils + * + * @typedef {Dom} $ - {@link components/dom.js} + * @typedef {Util} _ - {@link components/utils.js} + */ + + + +/** + * Apply polyfills + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(/*! components/polyfills */ "./src/components/polyfills.js"); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Require Editor modules places in components/modules dir + */ +// eslint-disable-next-line +var modules = ["blockManager.js","caret.js","events.js","keyboard.js","listeners.js","renderer.js","sanitizer.js","saver.js","toolbar-blockSettings.js","toolbar-inline.ts","toolbar-toolbox.js","toolbar.js","tools.js","ui.js"].map(function (module) { + return __webpack_require__("./src/components/modules sync [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$")("./" + module); +}); + +/** + * @class + * + * @classdesc CodeX Editor base class + * + * @property this.config - all settings + * @property this.moduleInstances - constructed editor components + * + * @type {CodexEditor} + */ + +var CodexEditor = function () { + _createClass(CodexEditor, null, [{ + key: 'version', + + /** Editor version */ + get: function get() { + return "2.0.0"; + } + + /** + * @param {EditorConfig} config - user configuration + * + */ + + }]); + + function CodexEditor(config) { + var _this = this; + + _classCallCheck(this, CodexEditor); + + /** + * Configuration object + * @type {EditorConfig} + */ + this.config = {}; + + /** + * @typedef {Object} EditorComponents + * @property {BlockManager} BlockManager + * @property {Tools} Tools + * @property {Events} Events + * @property {UI} UI + * @property {Toolbar} Toolbar + * @property {Toolbox} Toolbox + * @property {BlockSettings} BlockSettings + * @property {Renderer} Renderer + * @property {InlineToolbar} InlineToolbar + */ + this.moduleInstances = {}; + + Promise.resolve().then(function () { + _this.configuration = config; + }).then(function () { + return _this.init(); + }).then(function () { + return _this.start(); + }).then(function () { + console.log('CodeX Editor is ready!'); + }).catch(function (error) { + console.log('CodeX Editor does not ready because of %o', error); + }); + } + + /** + * Setting for configuration + * @param {EditorConfig} config + */ + + + _createClass(CodexEditor, [{ + key: 'init', + + + /** + * Initializes modules: + * - make and save instances + * - configure + */ + value: function init() { + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + this.constructModules(); + + /** + * Modules configuration + */ + this.configureModules(); + } + + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + + }, { + key: 'constructModules', + value: function constructModules() { + var _this2 = this; + + modules.forEach(function (Module) { + try { + /** + * We use class name provided by displayName property + * + * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' + * To prevent this, we use 'babel-plugin-class-display-name' plugin + * @see https://www.npmjs.com/package/babel-plugin-class-display-name + */ + _this2.moduleInstances[Module.displayName] = new Module({ + config: _this2.configuration + }); + } catch (e) { + console.log('Module %o skipped because %o', Module, e); + } + }); + } + + /** + * Modules instances configuration: + * - pass other modules to the 'state' property + * - ... + */ + + }, { + key: 'configureModules', + value: function configureModules() { + for (var name in this.moduleInstances) { + /** + * Module does not need self-instance + */ + this.moduleInstances[name].state = this.getModulesDiff(name); + } + } + + /** + * Return modules without passed name + */ + + }, { + key: 'getModulesDiff', + value: function getModulesDiff(name) { + var diff = {}; + + for (var moduleName in this.moduleInstances) { + /** + * Skip module with passed name + */ + if (moduleName === name) { + continue; + } + diff[moduleName] = this.moduleInstances[moduleName]; + } + + return diff; + } + + /** + * Start Editor! + * + * Get list of modules that needs to be prepared and return a sequence (Promise) + * @return {Promise} + */ + + }, { + key: 'start', + value: function start() { + var _this3 = this; + + var prepareDecorator = function prepareDecorator(module) { + return module.prepare(); + }; + + return Promise.resolve().then(prepareDecorator(this.moduleInstances.Tools)).then(prepareDecorator(this.moduleInstances.UI)).then(prepareDecorator(this.moduleInstances.BlockManager)).then(function () { + return _this3.moduleInstances.Renderer.render(_this3.config.data.items); + }); + } + }, { + key: 'configuration', + set: function set(config) { + /** + * Initlai block type + * Uses in case when there is no items passed + * @type {{type: (*), data: {text: null}}} + */ + var initialBlock = { + type: config.initialBlock, + data: {} + }; + + this.config.holderId = config.holderId; + this.config.placeholder = config.placeholder || 'write your story...'; + this.config.sanitizer = config.sanitizer || { + p: true, + b: true, + a: true + }; + + this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; + this.config.tools = config.tools || {}; + this.config.toolsConfig = config.toolsConfig || {}; + this.config.data = config.data || {}; + + /** + * Initialize items to pass data to the Renderer + */ + if (_.isEmpty(this.config.data)) { + this.config.data = {}; + this.config.data.items = [initialBlock]; + } else { + if (!this.config.data.items || this.config.data.items.length === 0) { + this.config.data.items = [initialBlock]; + } + } + + /** + * If initial Block's Tool was not passed, use the first Tool in config.tools + */ + if (!config.initialBlock) { + for (this.config.initialBlock in this.config.tools) { + break; + } + } else { + this.config.initialBlock = config.initialBlock; + } + } + + /** + * Returns private property + * @returns {EditorConfig} + */ + , + get: function get() { + return this.config; + } + }]); + + return CodexEditor; +}(); + +CodexEditor.displayName = 'CodexEditor'; +exports.default = CodexEditor; +; + +// module.exports = (function (editor) { +// +// 'use strict'; +// +// editor.version = VERSION; +// editor.scriptPrefix = 'cdx-script-'; +// +// var init = function () { +// +// editor.core = require('./modules/core'); +// editor.tools = require('./modules/tools'); +// editor.ui = require('./modules/ui'); +// editor.transport = require('./modules/transport'); +// editor.renderer = require('./modules/renderer'); +// editor.saver = require('./modules/saver'); +// editor.content = require('./modules/content'); +// editor.toolbar = require('./modules/toolbar/toolbar'); +// editor.callback = require('./modules/callbacks'); +// editor.draw = require('./modules/draw'); +// editor.caret = require('./modules/caret'); +// editor.notifications = require('./modules/notifications'); +// editor.parser = require('./modules/parser'); +// editor.sanitizer = require('./modules/sanitizer'); +// editor.listeners = require('./modules/listeners'); +// editor.destroyer = require('./modules/destroyer'); +// editor.paste = require('./modules/paste'); +// +// }; +// +// /** +// * @public +// * holds initial settings +// */ +// editor.settings = { +// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], +// holderId : 'codex-editor', +// +// // Type of block showing on empty editor +// initialBlockPlugin: 'text' +// }; +// +// /** +// * public +// * +// * Static nodes +// */ +// editor.nodes = { +// holder : null, +// wrapper : null, +// toolbar : null, +// inlineToolbar : { +// wrapper : null, +// buttons : null, +// actions : null +// }, +// toolbox : null, +// notifications : null, +// plusButton : null, +// showSettingsButton: null, +// showTrashButton : null, +// blockSettings : null, +// pluginSettings : null, +// defaultSettings : null, +// toolbarButtons : {}, // { type : DomEl, ... } +// redactor : null +// }; +// +// /** +// * @public +// * +// * Output state +// */ +// editor.state = { +// jsonOutput : [], +// blocks : [], +// inputs : [] +// }; +// +// /** +// * @public +// * Editor plugins +// */ +// editor.tools = {}; +// +// editor.start = function (userSettings) { +// +// init(); +// +// editor.core.prepare(userSettings) +// +// // If all ok, make UI, bind events and parse initial-content +// .then(editor.ui.prepare) +// .then(editor.tools.prepare) +// .then(editor.sanitizer.prepare) +// .then(editor.paste.prepare) +// .then(editor.transport.prepare) +// .then(editor.renderer.makeBlocksFromData) +// .then(editor.ui.saveInputs) +// .catch(function (error) { +// +// editor.core.log('Initialization failed with error: %o', 'warn', error); +// +// }); +// +// }; +// +// return editor; +// +// })({}); + +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/Selection.js": +/*!*************************************!*\ + !*** ./src/components/Selection.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Working with selection + */ +var Selection = function () { + /** + * @constructor + */ + function Selection() { + _classCallCheck(this, Selection); + + this.instance = null; + this.selection = null; + } + + /** + * Returns window Selection + * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} + * @return {Selection} + */ + + + _createClass(Selection, null, [{ + key: "get", + value: function get() { + return window.getSelection(); + } + + /** + * Returns selected anchor + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} + * @return {Node|null} + */ + + }, { + key: "getAnchorNode", + value: function getAnchorNode() { + var selection = window.getSelection(); + + return selection ? selection.anchorNode : null; + } + + /** + * Returns selection offset according to the anchor node + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} + * @return {Number|null} + */ + + }, { + key: "getAnchorOffset", + value: function getAnchorOffset() { + var selection = window.getSelection(); + + return selection ? selection.anchorOffset : null; + } + + /** + * Is current selection range collapsed + * @return {boolean|null} + */ + + }, { + key: "isCollapsed", + get: function get() { + var selection = window.getSelection(); + + return selection ? selection.isCollapsed : null; + } + }]); + + return Selection; +}(); + +Selection.displayName = "Selection"; +exports.default = Selection; +module.exports = exports["default"]; + +/***/ }), + +/***/ "./src/components/__module.ts": +/*!************************************!*\ + !*** ./src/components/__module.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @abstract + * @class Module + * @classdesc All modules inherits from this class. + * + * @typedef {Module} Module + * @property {Object} config - Editor user settings + * @property {Object} Editor - List of Editor modules + */ +var Module = function () { + /** + * @constructor + * + * @param {EditorConfig} config + */ + function Module(_ref) { + var config = _ref.config; + + _classCallCheck(this, Module); + + /** + * Editor modules list + * @type {EditorComponents} + */ + this.Editor = null; + /** + * Editor configuration object + * @type {EditorConfig} + */ + this.config = {}; + if (new.target === Module) { + throw new TypeError('Constructors for abstract class Module are not allowed.'); + } + this.config = config; + } + /** + * Editor modules setter + * + * @param Editor + * @param Editor.modules {@link CodexEditor#moduleInstances} + * @param Editor.config {@link CodexEditor#configuration} + */ + + + _createClass(Module, [{ + key: 'state', + set: function set(Editor) { + this.Editor = Editor; + } + }]); + + return Module; +}(); + +Module.displayName = 'Module'; +exports.default = Module; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/components/block.js": +/*!*********************************!*\ + !*** ./src/components/block.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * + * @class Block + * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool + * + * @property {Tool} tool — current block tool (Paragraph, for example) + * @property {Object} CSS — block`s css classes + * + */ + +/** + * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance + * + * @property tool - Tool instance + * @property html - Returns HTML content of plugin + * @property wrapper - Div element that wraps block content with Tool's content. Has `ce-block` CSS class + * @property contentNode - Div element that wraps Tool's content. Has `ce-block__content` CSS class + * @property pluginsContent - HTML content that returns by Tool's render function + */ +var Block = function () { + /** + * @constructor + * @param {String} toolName - Tool name that passed on initialization + * @param {Object} toolInstance — passed Tool`s instance that rendered the Block + */ + function Block(toolName, toolInstance) { + _classCallCheck(this, Block); + + this.name = toolName; + this.tool = toolInstance; + this._html = this.compose(); + } + + /** + * CSS classes for the Block + * @return {{wrapper: string, content: string}} + */ + + + _createClass(Block, [{ + key: 'compose', + + + /** + * Make default Block wrappers and put Tool`s content there + * @returns {HTMLDivElement} + */ + value: function compose() { + this.wrapper = $.make('div', Block.CSS.wrapper); + this.contentNode = $.make('div', Block.CSS.content); + this.pluginsContent = this.tool.render(); + + this.contentNode.appendChild(this.pluginsContent); + this.wrapper.appendChild(this.contentNode); + + return this.wrapper; + } + + /** + * Calls Tool's method + * + * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function + * + * @param {String} methodName + * @param {Object} params + */ + + }, { + key: 'call', + value: function call(methodName, params) { + /** + * call Tool's method with the instance context + */ + if (this.tool[methodName] && this.tool[methodName] instanceof Function) { + this.tool[methodName].call(this.tool, params); + } + } + + /** + * Get Block`s HTML + * @returns {HTMLElement} + */ + + }, { + key: 'mergeWith', + + + /** + * Call plugins merge method + * @param {Object} data + */ + value: function mergeWith(data) { + var _this = this; + + return Promise.resolve().then(function () { + _this.tool.merge(data); + }); + } + /** + * Extracts data from Block + * Groups Tool's save processing time + * @return {Object} + */ + + }, { + key: 'save', + value: function save() { + var _this2 = this; + + var extractedBlock = this.tool.save(this.pluginsContent); + + /** Measuring execution time*/ + var measuringStart = window.performance.now(), + measuringEnd = void 0; + + return Promise.resolve(extractedBlock).then(function (finishedExtraction) { + /** measure promise execution */ + measuringEnd = window.performance.now(); + + return { + tool: _this2.name, + data: finishedExtraction, + time: measuringEnd - measuringStart + }; + }).catch(function (error) { + _.log('Saving proccess for ' + this.tool.name + ' tool failed due to the ' + error, 'log', 'red'); + }); + } + + /** + * Uses Tool's validation method to check the correctness of output data + * Tool's validation method is optional + * + * @description Method also can return data if it passed the validation + * + * @param {Object} data + * @returns {Boolean|Object} valid + */ + + }, { + key: 'validateData', + value: function validateData(data) { + var isValid = true; + + if (this.tool.validate instanceof Function) { + isValid = this.tool.validate(data); + } + + if (!isValid) { + return false; + } + + return data; + } + + /** + * Check block for emptiness + * @return {Boolean} + */ + + }, { + key: 'html', + get: function get() { + return this._html; + } + + /** + * Get Block's JSON data + * @return {Object} + */ + + }, { + key: 'data', + get: function get() { + return this.save(); + } + + /** + * is block mergeable + * We plugin have merge function then we call it mergable + * @return {boolean} + */ + + }, { + key: 'mergeable', + get: function get() { + return typeof this.tool.merge === 'function'; + } + }, { + key: 'isEmpty', + get: function get() { + /** + * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool + * That Tools are not empty + */ + if (this.tool.contentless) { + return false; + } + + var emptyText = $.isEmpty(this.pluginsContent), + emptyMedia = !this.hasMedia; + + return emptyText && emptyMedia; + } + + /** + * Check if block has a media content such as images, iframes and other + * @return {Boolean} + */ + + }, { + key: 'hasMedia', + get: function get() { + /** + * This tags represents media-content + * @type {string[]} + */ + var mediaTags = ['img', 'iframe', 'video', 'audio', 'source', 'input', 'textarea', 'twitterwidget']; + + return !!this._html.querySelector(mediaTags.join(',')); + } + + /** + * Set selected state + * @param {Boolean} state - 'true' to select, 'false' to remove selection + */ + + }, { + key: 'selected', + set: function set(state) { + /** + * We don't need to mark Block as Selected when it is not empty + */ + if (state === true && !this.isEmpty) { + this._html.classList.add(Block.CSS.selected); + } else { + this._html.classList.remove(Block.CSS.selected); + } + } + }], [{ + key: 'CSS', + get: function get() { + return { + wrapper: 'ce-block', + content: 'ce-block__content', + selected: 'ce-block--selected' + }; + } + }]); + + return Block; +}(); + +Block.displayName = 'Block'; +exports.default = Block; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/dom.js": +/*!*******************************!*\ + !*** ./src/components/dom.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * DOM manipulations helper + */ +var Dom = function () { + function Dom() { + _classCallCheck(this, Dom); + } + + _createClass(Dom, null, [{ + key: 'isSingleTag', + + /** + * Check if passed tag has no closed tag + * @param {Element} tag + * @return {Boolean} + */ + value: function isSingleTag(tag) { + return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); + } + }, { + key: 'make', + + + /** + * Helper for making Elements with classname and attributes + * + * @param {string} tagName - new Element tag name + * @param {array|string} classNames - list or name of CSS classname(s) + * @param {Object} attributes - any attributes + * @return {Element} + */ + value: function make(tagName) { + var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var el = document.createElement(tagName); + + if (Array.isArray(classNames)) { + var _el$classList; + + (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classNames)); + } else if (classNames) { + el.classList.add(classNames); + } + + for (var attrName in attributes) { + el[attrName] = attributes[attrName]; + } + + return el; + } + + /** + * Creates Text Node with the passed content + * @param {String} content - text content + * @return {Text} + */ + + }, { + key: 'text', + value: function text(content) { + return document.createTextNode(content); + } + + /** + * Append one or several elements to the parent + * + * @param {Element} parent - where to append + * @param {Element|Element[]} - element ore elements list + */ + + }, { + key: 'append', + value: function append(parent, elements) { + if (Array.isArray(elements)) { + elements.forEach(function (el) { + return parent.appendChild(el); + }); + } else { + parent.appendChild(elements); + } + } + + /** + * Selector Decorator + * + * Returns first match + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * + * @returns {Element} + */ + + }, { + key: 'find', + value: function find() { + var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + var selector = arguments[1]; + + return el.querySelector(selector); + } + + /** + * Selector Decorator. + * + * Returns all matches + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * @returns {NodeList} + */ + + }, { + key: 'findAll', + value: function findAll() { + var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + var selector = arguments[1]; + + return el.querySelectorAll(selector); + } + + /** + * Search for deepest node which is Leaf. + * Leaf is the vertex that doesn't have any child nodes + * + * @description Method recursively goes throw the all Node until it finds the Leaf + * + * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} + * @param {Boolean} atLast - find last text node + * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it + */ + + }, { + key: 'getDeepestNode', + value: function getDeepestNode(node) { + var atLast = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + /** + * Current function have two directions: + * - starts from first child and every time gets first or nextSibling in special cases + * - starts from last child and gets last or previousSibling + * @type {string} + */ + var child = atLast ? 'lastChild' : 'firstChild', + sibling = atLast ? 'previousSibling' : 'nextSibling'; + + if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { + var nodeChild = node[child]; + + /** + * special case when child is single tag that can't contain any content + */ + if (Dom.isSingleTag(nodeChild)) { + /** + * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest + * from sibling + * + * 2) If single tag's next sibling is null, then go back to parent and check his sibling + * In case of Node Element continue searching + * + * 3) If none of conditions above happened return parent Node Element + */ + if (nodeChild[sibling]) { + nodeChild = nodeChild[sibling]; + } else if (nodeChild.parentNode[sibling]) { + nodeChild = nodeChild.parentNode[sibling]; + } else { + return nodeChild.parentNode; + } + } + + return this.getDeepestNode(nodeChild, atLast); + } + + return node; + } + + /** + * Check if object is DOM node + * + * @param {Object} node + * @returns {boolean} + */ + + }, { + key: 'isElement', + value: function isElement(node) { + return node && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; + } + + /** + * Checks target if it is native input + * @param {Element|String} target - HTML element or string + * @return {Boolean} + */ + + }, { + key: 'isNativeInput', + value: function isNativeInput(target) { + var nativeInputs = ['INPUT', 'TEXTAREA']; + + return target ? nativeInputs.includes(target.tagName) : false; + } + + /** + * Checks node if it is empty + * + * @description Method checks simple Node without any childs for emptiness + * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method + * + * @param {Node} node + * @return {Boolean} true if it is empty + */ + + }, { + key: 'isNodeEmpty', + value: function isNodeEmpty(node) { + var nodeText = void 0; + + if (this.isElement(node) && this.isNativeInput(node)) { + nodeText = node.value; + } else { + nodeText = node.textContent.replace('\u200B', ''); + } + + return nodeText.trim().length === 0; + } + + /** + * checks node if it is doesn't have any child nodes + * @param {Node} node + * @return {boolean} + */ + + }, { + key: 'isLeaf', + value: function isLeaf(node) { + if (!node) { + return false; + } + + return node.childNodes.length === 0; + } + + /** + * breadth-first search (BFS) + * {@link https://en.wikipedia.org/wiki/Breadth-first_search} + * + * @description Pushes to stack all DOM leafs and checks for emptiness + * + * @param {Node} node + * @return {boolean} + */ + + }, { + key: 'isEmpty', + value: function isEmpty(node) { + var _this = this; + + var treeWalker = [], + leafs = []; + + if (!node) { + return true; + } + + if (!node.childNodes.length) { + return this.isNodeEmpty(node); + } + + treeWalker.push(node.firstChild); + + while (treeWalker.length > 0) { + node = treeWalker.shift(); + + if (!node) continue; + + if (this.isLeaf(node)) { + leafs.push(node); + } else { + treeWalker.push(node.firstChild); + } + + while (node && node.nextSibling) { + node = node.nextSibling; + + if (!node) continue; + + treeWalker.push(node); + } + + /** + * If one of childs is not empty, checked Node is not empty too + */ + if (node && !this.isNodeEmpty(node)) { + return false; + } + } + + return leafs.every(function (leaf) { + return _this.isNodeEmpty(leaf); + }); + } + }]); + + return Dom; +}(); + +Dom.displayName = 'Dom'; +exports.default = Dom; +; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/components/modules sync [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$": +/*!***********************************************************************************************************************************************************************************************************************************************!*\ + !*** ./src/components/modules sync nonrecursive [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$ ***! + \***********************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var map = { + "./blockManager.js": "./src/components/modules/blockManager.js", + "./caret.js": "./src/components/modules/caret.js", + "./events.js": "./src/components/modules/events.js", + "./keyboard.js": "./src/components/modules/keyboard.js", + "./listeners.js": "./src/components/modules/listeners.js", + "./renderer.js": "./src/components/modules/renderer.js", + "./sanitizer.js": "./src/components/modules/sanitizer.js", + "./saver.js": "./src/components/modules/saver.js", + "./toolbar-blockSettings.js": "./src/components/modules/toolbar-blockSettings.js", + "./toolbar-inline.ts": "./src/components/modules/toolbar-inline.ts", + "./toolbar-toolbox.js": "./src/components/modules/toolbar-toolbox.js", + "./toolbar.js": "./src/components/modules/toolbar.js", + "./tools.js": "./src/components/modules/tools.js", + "./ui.js": "./src/components/modules/ui.js" +}; + + +function webpackContext(req) { + var id = webpackContextResolve(req); + return __webpack_require__(id); +} +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) { // check for number or string + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return id; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = "./src/components/modules sync [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$"; + +/***/ }), + +/***/ "./src/components/modules/blockManager.js": +/*!************************************************!*\ + !*** ./src/components/modules/blockManager.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _block = __webpack_require__(/*! ../block */ "./src/components/block.js"); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @class BlockManager + * @classdesc Manage editor`s blocks storage and appearance + * + * @module BlockManager + * + * @version 2.0.0 + */ + +/** + * @typedef {BlockManager} BlockManager + * @property {Number} currentBlockIndex - Index of current working block + * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks} + */ +var BlockManager = function (_Module) { + _inherits(BlockManager, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function BlockManager(_ref) { + var config = _ref.config; + + _classCallCheck(this, BlockManager); + + /** + * Proxy for Blocks instance {@link Blocks} + * + * @type {Proxy} + * @private + */ + var _this = _possibleConstructorReturn(this, (BlockManager.__proto__ || Object.getPrototypeOf(BlockManager)).call(this, { config: config })); + + _this._blocks = null; + + /** + * Index of current working block + * + * @type {number} + * @private + */ + _this.currentBlockIndex = -1; + return _this; + } + + /** + * Should be called after Editor.UI preparation + * Define this._blocks property + * + * @returns {Promise} + */ + + + _createClass(BlockManager, [{ + key: 'prepare', + value: function prepare() { + var _this2 = this; + + return new Promise(function (resolve) { + var blocks = new Blocks(_this2.Editor.UI.nodes.redactor); + + /** + * We need to use Proxy to overload set/get [] operator. + * So we can use array-like syntax to access blocks + * + * @example + * this._blocks[0] = new Block(...); + * + * block = this._blocks[0]; + * + * @todo proxy the enumerate method + * + * @type {Proxy} + * @private + */ + _this2._blocks = new Proxy(blocks, { + set: Blocks.set, + get: Blocks.get + }); + + resolve(); + }); + } + + /** + * Creates Block instance by tool name + * + * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} + * @param {Object} data - constructor params + * + * @return {Block} + */ + + }, { + key: 'composeBlock', + value: function composeBlock(toolName, data) { + var toolInstance = this.Editor.Tools.construct(toolName, data), + block = new _block2.default(toolName, toolInstance); + + this.bindEvents(block); + + /** + * Apply callback before inserting html + */ + block.call('appendCallback', {}); + + return block; + } + + /** + * Bind Events + * @param {Object} block + */ + + }, { + key: 'bindEvents', + value: function bindEvents(block) { + var _this3 = this; + + this.Editor.Listeners.on(block.pluginsContent, 'keydown', function (event) { + return _this3.Editor.Keyboard.blockKeydownsListener(event); + }); + this.Editor.Listeners.on(block.pluginsContent, 'mouseup', function (event) { + _this3.Editor.InlineToolbar.move(event); + }); + } + + /** + * Set's caret to the next Block + * Before moving caret, we should check if caret position is at the end of Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + */ + + }, { + key: 'navigateNext', + value: function navigateNext() { + var caretAtEnd = this.Editor.Caret.isAtEnd; + + if (!caretAtEnd) { + return; + } + + var nextBlock = this.nextBlock; + + if (!nextBlock) { + return; + } + + this.Editor.Caret.setToBlock(nextBlock); + } + + /** + * Set's caret to the previous Block + * Before moving caret, we should check if caret position is start of the Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + */ + + }, { + key: 'navigatePrevious', + value: function navigatePrevious() { + var caretAtStart = this.Editor.Caret.isAtStart; + + if (!caretAtStart) { + return; + } + + var previousBlock = this.previousBlock; + + if (!previousBlock) { + return; + } + + this.Editor.Caret.setToBlock(previousBlock, 0, true); + } + + /** + * Insert new block into _blocks + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + + }, { + key: 'insert', + value: function insert(toolName) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var block = this.composeBlock(toolName, data); + + this._blocks[++this.currentBlockIndex] = block; + this.Editor.Caret.setToBlock(block); + } + + /** + * Merge two blocks + * @param {Block} targetBlock - previous block will be append to this block + * @param {Block} blockToMerge - block that will be merged with target block + * + * @return {Promise} - the sequence that can be continued + */ + + }, { + key: 'mergeBlocks', + value: function mergeBlocks(targetBlock, blockToMerge) { + var _this4 = this; + + var blockToMergeIndex = this._blocks.indexOf(blockToMerge); + + return Promise.resolve().then(function () { + if (blockToMerge.isEmpty) { + return; + } + + return blockToMerge.data.then(function (blockToMergeInfo) { + targetBlock.mergeWith(blockToMergeInfo.data); + }); + }).then(function () { + _this4.removeBlock(blockToMergeIndex); + _this4.currentBlockIndex = _this4._blocks.indexOf(targetBlock); + }); + } + + /** + * Remove block with passed index or remove last + * @param {Number|null} index + */ + + }, { + key: 'removeBlock', + value: function removeBlock(index) { + this._blocks.remove(index); + } + /** + * Split current Block + * 1. Extract content from Caret position to the Block`s end + * 2. Insert a new Block below current one with extracted content + */ + + }, { + key: 'split', + value: function split() { + var extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), + wrapper = $.make('div'); + + wrapper.append(extractedFragment); + + /** + * @todo make object in accordance with Tool + */ + var data = { + text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML + }; + + this.insert(this.config.initialBlock, data); + } + + /** + * Replace current working block + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + + }, { + key: 'replace', + value: function replace(toolName) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var block = this.composeBlock(toolName, data); + + this._blocks.insert(this.currentBlockIndex, block, true); + } + + /** + * returns last Block + * @return {Block} + */ + + }, { + key: 'getBlockByIndex', + + + /** + * Returns Block by passed index + * @param {Number} index + * @return {Block} + */ + value: function getBlockByIndex(index) { + return this._blocks[index]; + } + + /** + * Get Block instance by html element + * @param {HTMLElement} element + * @returns {Block} + */ + + }, { + key: 'getBlock', + value: function getBlock(element) { + var nodes = this._blocks.nodes, + firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper), + index = nodes.indexOf(firstLevelBlock); + + if (index >= 0) { + return this._blocks[index]; + } + } + + /** + * Get current Block instance + * + * @return {Block} + */ + + }, { + key: 'setCurrentBlockByChildNode', + + + /** + * 1) Find first-level Block from passed child Node + * 2) Mark it as current + * + * @param {Element|Text} childNode - look ahead from this node. + * @throws Error - when passed Node is not included at the Block + */ + value: function setCurrentBlockByChildNode(childNode) { + /** + * If node is Text TextNode + */ + if (!$.isElement(childNode)) { + childNode = childNode.parentNode; + } + + var parentFirstLevelBlock = childNode.closest('.' + _block2.default.CSS.wrapper); + + if (parentFirstLevelBlock) { + this.currentNode = parentFirstLevelBlock; + } else { + throw new Error('Can not find a Block from this child Node'); + } + } + }, { + key: 'lastBlock', + get: function get() { + return this._blocks[this._blocks.length - 1]; + } + }, { + key: 'currentBlock', + get: function get() { + return this._blocks[this.currentBlockIndex]; + } + + /** + * Returns next Block instance + * @return {Block|null} + */ + + }, { + key: 'nextBlock', + get: function get() { + var isLastBlock = this.currentBlockIndex === this._blocks.length - 1; + + if (isLastBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex + 1]; + } + + /** + * Returns previous Block instance + * @return {Block|null} + */ + + }, { + key: 'previousBlock', + get: function get() { + var isFirstBlock = this.currentBlockIndex === 0; + + if (isFirstBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex - 1]; + } + + /** + * Get working html element + * + * @return {HTMLElement} + */ + + }, { + key: 'currentNode', + get: function get() { + return this._blocks.nodes[this.currentBlockIndex]; + } + + /** + * Set currentBlockIndex to passed block + * @param {HTMLElement} element + */ + , + set: function set(element) { + var nodes = this._blocks.nodes, + firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper); + + /** + * Update current Block's index + * @type {number} + */ + this.currentBlockIndex = nodes.indexOf(firstLevelBlock); + + /** + * Remove previous selected Block's state + */ + this._blocks.array.forEach(function (block) { + return block.selected = false; + }); + + /** + * Mark current Block as selected + * @type {boolean} + */ + this.currentBlock.selected = true; + } + + /** + * Get array of Block instances + * + * @returns {Block[]} {@link Blocks#array} + */ + + }, { + key: 'blocks', + get: function get() { + return this._blocks.array; + } + }]); + + return BlockManager; +}(Module); + +BlockManager.displayName = 'BlockManager'; +exports.default = BlockManager; +; + +/** + * @class Blocks + * @classdesc Class to work with Block instances array + * + * @private + * + * @property {HTMLElement} workingArea — editor`s working node + * + */ + +var Blocks = function () { + /** + * @constructor + * + * @param {HTMLElement} workingArea — editor`s working node + */ + function Blocks(workingArea) { + _classCallCheck(this, Blocks); + + this.blocks = []; + this.workingArea = workingArea; + } + + /** + * Push back new Block + * + * @param {Block} block + */ + + + _createClass(Blocks, [{ + key: 'push', + value: function push(block) { + this.blocks.push(block); + this.workingArea.appendChild(block.html); + } + + /** + * Insert new Block at passed index + * + * @param {Number} index — index to insert Block + * @param {Block} block — Block to insert + * @param {Boolean} replace — it true, replace block on given index + */ + + }, { + key: 'insert', + value: function insert(index, block) { + var replace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (!this.length) { + this.push(block); + return; + } + + if (index > this.length) { + index = this.length; + } + + if (replace) { + this.blocks[index].html.remove(); + } + + var deleteCount = replace ? 1 : 0; + + this.blocks.splice(index, deleteCount, block); + + if (index > 0) { + var previousBlock = this.blocks[index - 1]; + + previousBlock.html.insertAdjacentElement('afterend', block.html); + } else { + var nextBlock = this.blocks[index + 1]; + + if (nextBlock) { + nextBlock.html.insertAdjacentElement('beforebegin', block.html); + } else { + this.workingArea.appendChild(block.html); + } + } + } + + /** + * Remove block + * @param {Number|null} index + */ + + }, { + key: 'remove', + value: function remove(index) { + if (!index) { + index = this.length - 1; + } + + this.blocks[index].html.remove(); + this.blocks.splice(index, 1); + } + + /** + * Insert Block after passed target + * + * @todo decide if this method is necessary + * + * @param {Block} targetBlock — target after wich Block should be inserted + * @param {Block} newBlock — Block to insert + */ + + }, { + key: 'insertAfter', + value: function insertAfter(targetBlock, newBlock) { + var index = this.blocks.indexOf(targetBlock); + + this.insert(index + 1, newBlock); + } + + /** + * Get Block by index + * + * @param {Number} index — Block index + * @returns {Block} + */ + + }, { + key: 'get', + value: function get(index) { + return this.blocks[index]; + } + + /** + * Return index of passed Block + * + * @param {Block} block + * @returns {Number} + */ + + }, { + key: 'indexOf', + value: function indexOf(block) { + return this.blocks.indexOf(block); + } + + /** + * Get length of Block instances array + * + * @returns {Number} + */ + + }, { + key: 'length', + get: function get() { + return this.blocks.length; + } + + /** + * Get Block instances array + * + * @returns {Block[]} + */ + + }, { + key: 'array', + get: function get() { + return this.blocks; + } + + /** + * Get blocks html elements array + * + * @returns {HTMLElement[]} + */ + + }, { + key: 'nodes', + get: function get() { + return _.array(this.workingArea.children); + } + + /** + * Proxy trap to implement array-like setter + * + * @example + * blocks[0] = new Block(...) + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — block index + * @param {Block} block — Block to set + * @returns {Boolean} + */ + + }], [{ + key: 'set', + value: function set(instance, index, block) { + if (isNaN(Number(index))) { + return false; + } + + instance.insert(index, block); + + return true; + } + + /** + * Proxy trap to implement array-like getter + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — Block index + * @returns {Block|*} + */ + + }, { + key: 'get', + value: function get(instance, index) { + if (isNaN(Number(index))) { + return instance[index]; + } + + return instance.get(index); + } + }]); + + return Blocks; +}(); + +Blocks.displayName = 'Blocks'; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/caret.js": +/*!*****************************************!*\ + !*** ./src/components/modules/caret.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _Selection = __webpack_require__(/*! ../Selection */ "./src/components/Selection.js"); + +var _Selection2 = _interopRequireDefault(_Selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @class Caret + * @classdesc Contains methods for working Caret + * + * Uses Range methods to manipulate with caret + * + * @module Caret + * + * @version 2.0.0 + */ + +/** + * @typedef {Caret} Caret + */ + + +var Caret = function (_Module) { + _inherits(Caret, _Module); + + /** + * @constructor + */ + function Caret(_ref) { + var config = _ref.config; + + _classCallCheck(this, Caret); + + return _possibleConstructorReturn(this, (Caret.__proto__ || Object.getPrototypeOf(Caret)).call(this, { config: config })); + } + + /** + * Method gets Block instance and puts caret to the text node with offset + * There two ways that method applies caret position: + * - first found text node: sets at the beginning, but you can pass an offset + * - last found text node: sets at the end of the node. Also, you can customize the behaviour + * + * @param {Block} block - Block class + * @param {Number} offset - caret offset regarding to the text node + * @param {Boolean} atEnd - put caret at the end of the text node or not + */ + + + _createClass(Caret, [{ + key: 'setToBlock', + value: function setToBlock(block) { + var _this2 = this; + + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var atEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var element = block.pluginsContent; + + /** If Element is INPUT */ + if ($.isNativeInput(element)) { + element.focus(); + return; + } + + var nodeToSet = $.getDeepestNode(element, atEnd); + + if (atEnd || offset > nodeToSet.length) { + offset = nodeToSet.length; + } + + /** if found deepest node is native input */ + if ($.isNativeInput(nodeToSet)) { + nodeToSet.focus(); + return; + } + + /** + * @todo try to fix via Promises or use querySelectorAll to not to use timeout + */ + _.delay(function () { + _this2.set(nodeToSet, offset); + }, 20)(); + + this.Editor.BlockManager.currentNode = block.wrapper; + } + + /** + * Creates Document Range and sets caret to the element with offset + * @param {Element} element - target node. + * @param {Number} offset - offset + */ + + }, { + key: 'set', + value: function set(element) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var range = document.createRange(), + selection = _Selection2.default.get(); + + range.setStart(element, offset); + range.setEnd(element, offset); + + selection.removeAllRanges(); + selection.addRange(range); + } + }, { + key: 'setToTheLastBlock', + + + /** + * Set Caret to the last Block + * If last block is not empty, append another empty block + */ + value: function setToTheLastBlock() { + var lastBlock = this.Editor.BlockManager.lastBlock; + + if (!lastBlock) return; + + /** + * If last block is empty and it is an initialBlock, set to that. + * Otherwise, append new empty block and set to that + */ + if (lastBlock.isEmpty) { + this.setToBlock(lastBlock); + } else { + this.Editor.BlockManager.insert(this.config.initialBlock); + } + } + + /** + * Extract content fragment of current Block from Caret position to the end of the Block + */ + + }, { + key: 'extractFragmentFromCaretPosition', + value: function extractFragmentFromCaretPosition() { + var selection = _Selection2.default.get(); + + if (selection.rangeCount) { + var selectRange = selection.getRangeAt(0), + blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; + + selectRange.deleteContents(); + + if (blockElem) { + var range = selectRange.cloneRange(true); + + range.selectNodeContents(blockElem); + range.setStart(selectRange.endContainer, selectRange.endOffset); + return range.extractContents(); + } + } + } + + /** + * Get all first-level (first child of [contenteditabel]) siblings from passed node + * Then you can check it for emptiness + * + * @example + *
+ *

| + *

| left first-level siblings + *

| + *
adaddad
<-- passed node for example + *

| + *

| right first-level siblings + *

| + *
+ * + * @return {Element[]} + */ + + }, { + key: 'getHigherLevelSiblings', + value: function getHigherLevelSiblings(from, direction) { + var current = from, + siblings = []; + + /** + * Find passed node's firs-level parent (in example - blockquote) + */ + while (current.parentNode && current.parentNode.contentEditable !== 'true') { + current = current.parentNode; + } + + var sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; + + /** + * Find all left/right siblings + */ + while (current[sibling]) { + current = current[sibling]; + siblings.push(current); + } + + return siblings; + } + + /** + * Get's deepest first node and checks if offset is zero + * @return {boolean} + */ + + }, { + key: 'isAtStart', + get: function get() { + /** + * Don't handle ranges + */ + if (!_Selection2.default.isCollapsed) { + return false; + } + + var selection = _Selection2.default.get(), + anchorNode = selection.anchorNode, + firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); + + /** + * Workaround case when caret in the text like " |Hello!" + * selection.anchorOffset is 1, but real caret visible position is 0 + * @type {number} + */ + var firstLetterPosition = anchorNode.textContent.search(/\S/); + + if (firstLetterPosition === -1) { + // empty text + firstLetterPosition = 0; + } + + /** + * In case of + *
+ *

<-- first (and deepest) node is + * |adaddad <-- anchor node + *
+ */ + if ($.isEmpty(firstNode)) { + var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), + nothingAtLeft = leftSiblings.every(function (node) { + return $.isEmpty(node); + }); + + if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { + return true; + } + } + + return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition; + } + + /** + * Get's deepest last node and checks if offset is last node text length + * @return {boolean} + */ + + }, { + key: 'isAtEnd', + get: function get() { + /** + * Don't handle ranges + */ + if (!_Selection2.default.isCollapsed) { + return false; + } + + var selection = _Selection2.default.get(), + anchorNode = selection.anchorNode, + lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); + + /** + * In case of + *
+ * adaddad| <-- anchor node + *

<-- first (and deepest) node is + *
+ */ + if ($.isEmpty(lastNode)) { + var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), + nothingAtRight = leftSiblings.every(function (node) { + return $.isEmpty(node); + }); + + if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { + return true; + } + } + + return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length; + } + }]); + + return Caret; +}(Module); + +Caret.displayName = 'Caret'; +exports.default = Caret; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/events.js": +/*!******************************************!*\ + !*** ./src/components/modules/events.js ***! + \******************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Module) { Object.defineProperty(exports, "__esModule", { - value: true + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @module eventDispatcher + * + * Has two important methods: + * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one + * - {Function} emit - fires all subscribers with data + * + * @version 1.0.0 + * + * @typedef {Events} Events + * @property {Object} subscribers - all subscribers grouped by event name + */ +var Events = function (_Module) { + _inherits(Events, _Module); + + /** + * @constructor + */ + function Events(_ref) { + var config = _ref.config; + + _classCallCheck(this, Events); + + var _this = _possibleConstructorReturn(this, (Events.__proto__ || Object.getPrototypeOf(Events)).call(this, { config: config })); + + _this.subscribers = {}; + return _this; + } + + /** + * @param {String} eventName - event name + * @param {Function} callback - subscriber + */ + + + _createClass(Events, [{ + key: "on", + value: function on(eventName, callback) { + if (!(eventName in this.subscribers)) { + this.subscribers[eventName] = []; + } + + // group by events + this.subscribers[eventName].push(callback); + } + + /** + * @param {String} eventName - event name + * @param {Object} data - subscribers get this data when they were fired + */ + + }, { + key: "emit", + value: function emit(eventName, data) { + this.subscribers[eventName].reduce(function (previousData, currentHandler) { + var newData = currentHandler(previousData); + + return newData ? newData : previousData; + }, data); + } + + /** + * Destroyer + * clears subsribers list + */ + + }, { + key: "destroy", + value: function destroy() { + this.subscribers = null; + } + }]); + + return Events; +}(Module); + +Events.displayName = "Events"; +exports.default = Events; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/keyboard.js": +/*!********************************************!*\ + !*** ./src/components/modules/keyboard.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class Keyboard + * @classdesc Сlass to handle the keydowns + * + * @author CodeX Team (team@ifmo.su) + * @copyright CodeX Team 2017 + * @license The MIT License (MIT) + * @version 1.0.0 + */ + +/** + * @typedef {Keyboard} Keyboard + */ +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + /** + * @constructor + */ + function Keyboard(_ref) { + var config = _ref.config; + + _classCallCheck(this, Keyboard); + + return _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, { config: config })); + } + + /** + * Handler on Block for keyboard keys at keydown event + * + * @param {KeyboardEvent} event + */ + + + _createClass(Keyboard, [{ + key: 'blockKeydownsListener', + value: function blockKeydownsListener(event) { + switch (event.keyCode) { + case _.keyCodes.BACKSPACE: + + _.log('Backspace key pressed'); + this.backspacePressed(event); + break; + + case _.keyCodes.ENTER: + + _.log('Enter key pressed'); + this.enterPressed(event); + break; + + case _.keyCodes.DOWN: + case _.keyCodes.RIGHT: + + _.log('Right/Down key pressed'); + this.arrowRightAndDownPressed(); + break; + + case _.keyCodes.UP: + case _.keyCodes.LEFT: + + _.log('Left/Up key pressed'); + this.arrowLeftAndUpPressed(); + break; + + default: + + break; + } + } + + /** + * Handle pressing enter key + * + * @param {KeyboardEvent} event + */ + + }, { + key: 'enterPressed', + value: function enterPressed(event) { + var currentBlock = this.Editor.BlockManager.currentBlock, + toolsConfig = this.config.toolsConfig[currentBlock.name]; + + /** + * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. + * Uses for Tools like where line breaks should be handled by default behaviour. + */ + if (toolsConfig && toolsConfig.enableLineBreaks) { + return; + } + + /** + * Allow to create linebreaks by Shift+Enter + */ + if (event.shiftKey) { + return; + } + + /** + * Split the Current Block into two blocks + */ + this.Editor.BlockManager.split(); + event.preventDefault(); + } + + /** + * Handle backspace keypress on block + * @param {KeyboardEvent} event - keydown + */ + + }, { + key: 'backspacePressed', + value: function backspacePressed(event) { + var _this2 = this; + + var BM = this.Editor.BlockManager; + + var isFirstBlock = BM.currentBlockIndex === 0, + canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; + + if (!canMergeBlocks) { + return; + } + + // preventing browser default behaviour + event.preventDefault(); + + var targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), + blockToMerge = BM.currentBlock; + + /** + * Blocks that can be merged: + * 1) with the same Name + * 2) Tool has 'merge' method + * + * other case will handle as usual ARROW LEFT behaviour + */ + if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { + BM.navigatePrevious(); + } + + var setCaretToTheEnd = !targetBlock.isEmpty ? true : false; + + BM.mergeBlocks(targetBlock, blockToMerge).then(function () { + window.setTimeout(function () { + // set caret to the block without offset at the end + _this2.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd); + _this2.Editor.Toolbar.close(); + }, 10); + }); + } + + /** + * Handle right and down keyboard keys + */ + + }, { + key: 'arrowRightAndDownPressed', + value: function arrowRightAndDownPressed() { + this.Editor.BlockManager.navigateNext(); + } + + /** + * Handle left and up keyboard keys + */ + + }, { + key: 'arrowLeftAndUpPressed', + value: function arrowLeftAndUpPressed() { + this.Editor.BlockManager.navigatePrevious(); + } + }]); + + return Keyboard; +}(Module); + +Keyboard.displayName = 'Keyboard'; +exports.default = Keyboard; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/listeners.js": +/*!*********************************************!*\ + !*** ./src/components/modules/listeners.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Codex Editor Listeners module + * + * @module Listeners + * + * Module-decorator for event listeners assignment + * + * @author Codex Team + * @version 2.0.0 + */ + +/** + * @typedef {Listeners} Listeners + * @property {Array} allListeners + */ + +var Listeners = function (_Module) { + _inherits(Listeners, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function Listeners(_ref) { + var config = _ref.config; + + _classCallCheck(this, Listeners); + + var _this = _possibleConstructorReturn(this, (Listeners.__proto__ || Object.getPrototypeOf(Listeners)).call(this, { config: config })); + + _this.allListeners = []; + return _this; + } + + /** + * Assigns event listener on element + * + * @param {Element} element - DOM element that needs to be listened + * @param {String} eventType - event type + * @param {Function} handler - method that will be fired on event + * @param {Boolean} useCapture - use event bubbling + */ + + + _createClass(Listeners, [{ + key: "on", + value: function on(element, eventType, handler) { + var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + var assignedEventData = { + element: element, + eventType: eventType, + handler: handler, + useCapture: useCapture + }; + + var alreadyExist = this.findOne(element, eventType, handler); + + if (alreadyExist) return; + + this.allListeners.push(assignedEventData); + element.addEventListener(eventType, handler, useCapture); + } + + /** + * Removes event listener from element + * + * @param {Element} element - DOM element that we removing listener + * @param {String} eventType - event type + * @param {Function} handler - remove handler, if element listens several handlers on the same event type + * @param {Boolean} useCapture - use event bubbling + */ + + }, { + key: "off", + value: function off(element, eventType, handler) { + var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + var existingListeners = this.findAll(element, eventType, handler); + + for (var i = 0; i < existingListeners.length; i++) { + var index = this.allListeners.indexOf(existingListeners[i]); + + if (index > 0) { + this.allListeners.splice(index, 1); + } + } + + element.removeEventListener(eventType, handler, useCapture); + } + + /** + * Search method: looks for listener by passed element + * @param {Element} element - searching element + * @returns {Array} listeners that found on element + */ + + }, { + key: "findByElement", + value: function findByElement(element) { + var listenersOnElement = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.element === element) { + listenersOnElement.push(listener); + } + } + + return listenersOnElement; + } + + /** + * Search method: looks for listener by passed event type + * @param {String} eventType + * @return {Array} listeners that found on element + */ + + }, { + key: "findByType", + value: function findByType(eventType) { + var listenersWithType = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.type === eventType) { + listenersWithType.push(listener); + } + } + + return listenersWithType; + } + + /** + * Search method: looks for listener by passed handler + * @param {Function} handler + * @return {Array} listeners that found on element + */ + + }, { + key: "findByHandler", + value: function findByHandler(handler) { + var listenersWithHandler = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.handler === handler) { + listenersWithHandler.push(listener); + } + } + + return listenersWithHandler; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Element|null} + */ + + }, { + key: "findOne", + value: function findOne(element, eventType, handler) { + var foundListeners = this.findAll(element, eventType, handler); + + return foundListeners.length > 0 ? foundListeners[0] : null; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Array} + */ + + }, { + key: "findAll", + value: function findAll(element, eventType, handler) { + var foundAllListeners = void 0, + foundByElements = [], + foundByEventType = [], + foundByHandler = []; + + if (element) foundByElements = this.findByElement(element); + + if (eventType) foundByEventType = this.findByType(eventType); + + if (handler) foundByHandler = this.findByHandler(handler); + + foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler); + + return foundAllListeners; + } + + /** + * Removes all listeners + */ + + }, { + key: "removeAll", + value: function removeAll() { + this.allListeners.map(function (current) { + current.element.removeEventListener(current.eventType, current.handler); + }); + + this.allListeners = []; + } + }]); + + return Listeners; +}(Module); + +Listeners.displayName = "Listeners"; +exports.default = Listeners; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/renderer.js": +/*!********************************************!*\ + !*** ./src/components/modules/renderer.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Codex Editor Renderer Module + * + * @module Renderer + * @author CodeX Team + * + * @version 2.0.0 + */ +var Renderer = function (_Module) { + _inherits(Renderer, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function Renderer(_ref) { + var config = _ref.config; + + _classCallCheck(this, Renderer); + + return _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).call(this, { config: config })); + } + + /** + * @typedef {Object} RendererItems + * @property {String} type - tool name + * @property {Object} data - tool data + */ + + /** + * @example + * + * items: [ + * { + * type : 'paragraph', + * data : { + * text : 'Hello from Codex!' + * } + * }, + * { + * type : 'paragraph', + * data : { + * text : 'Leave feedback if you like it!' + * } + * }, + * ] + * + */ + + /** + * Make plugin blocks from array of plugin`s data + * @param {RendererItems[]} items + */ + + + _createClass(Renderer, [{ + key: "render", + value: function render(items) { + var _this2 = this; + + var chainData = []; + + var _loop = function _loop(i) { + chainData.push({ + function: function _function() { + return _this2.insertBlock(items[i]); + } + }); + }; + + for (var i = 0; i < items.length; i++) { + _loop(i); + } + + return _.sequence(chainData); + } + + /** + * Get plugin instance + * Add plugin instance to BlockManager + * Insert block to working zone + * + * @param {Object} item + * @returns {Promise.} + * @private + */ + + }, { + key: "insertBlock", + value: function insertBlock(item) { + var tool = item.type, + data = item.data; + + this.Editor.BlockManager.insert(tool, data); + + return Promise.resolve(); + } + }]); + + return Renderer; +}(Module); + +Renderer.displayName = "Renderer"; +exports.default = Renderer; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/sanitizer.js": +/*!*********************************************!*\ + !*** ./src/components/modules/sanitizer.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * CodeX Sanitizer + * + * @module Sanitizer + * Clears HTML from taint tags + * + * @version 2.0.0 + * + * @example + * Module can be used within two ways: + * 1) When you have an instance + * - this.Editor.Sanitizer.clean(yourTaintString); + * 2) As static method + * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration); + * + * {@link SanitizerConfig} + */ + +/** + * @typedef {Object} SanitizerConfig + * @property {Object} tags - define tags restrictions + * + * @example + * + * tags : { + * p: true, + * a: { + * href: true, + * rel: "nofollow", + * target: "_blank" + * } + * } + */ +var Sanitizer = function (_Module) { + _inherits(Sanitizer, _Module); + + /** + * Initializes Sanitizer module + * Sets default configuration if custom not exists + * + * @property {SanitizerConfig} this.defaultConfig + * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library + * + * @param {SanitizerConfig} config + */ + function Sanitizer(_ref) { + var config = _ref.config; + + _classCallCheck(this, Sanitizer); + + // default config + var _this = _possibleConstructorReturn(this, (Sanitizer.__proto__ || Object.getPrototypeOf(Sanitizer)).call(this, { config: config })); + + _this.defaultConfig = null; + _this._sanitizerInstance = null; + + /** Custom configuration */ + _this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; + + /** HTML Janitor library */ + _this.sanitizerInstance = __webpack_require__(/*! html-janitor */ "./node_modules/html-janitor/src/html-janitor.js"); + return _this; + } + + /** + * If developer uses editor's API, then he can customize sanitize restrictions. + * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere + * At least, if there is no config overrides, that API uses Default configuration + * + * @uses https://www.npmjs.com/package/html-janitor + * + * @param {HTMLJanitor} library - sanitizer extension + */ + + + _createClass(Sanitizer, [{ + key: 'clean', + + + /** + * Cleans string from unwanted tags + * @param {String} taintString - HTML string + * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty + * @return {String} clean HTML + */ + value: function clean(taintString) { + var customConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (_.isEmpty(customConfig)) { + return this._sanitizerInstance.clean(taintString); + } else { + return Sanitizer.clean(taintString, customConfig); + } + } + + /** + * Cleans string from unwanted tags + * @static + * + * Method allows to use default config + * + * @param {String} taintString - taint string + * @param {SanitizerConfig} customConfig - allowed tags + * + * @return {String} clean HTML + */ + + }, { + key: 'sanitizerInstance', + set: function set(library) { + this._sanitizerInstance = new library(this.defaultConfig); + } + + /** + * Sets sanitizer configuration. Uses default config if user didn't pass the restriction + * @param {SanitizerConfig} config + */ + + }, { + key: 'sanitizerConfig', + set: function set(config) { + if (_.isEmpty(config)) { + this.defaultConfig = { + tags: { + p: {}, + a: { + href: true, + target: '_blank', + rel: 'nofollow' + } + } + }; + } else { + this.defaultConfig = config; + } + } + }], [{ + key: 'clean', + value: function clean(taintString, customConfig) { + var newInstance = Sanitizer(customConfig); + + return newInstance.clean(taintString); + } + }]); + + return Sanitizer; +}(Module); + +Sanitizer.displayName = 'Sanitizer'; +exports.default = Sanitizer; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/saver.js": +/*!*****************************************!*\ + !*** ./src/components/modules/saver.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -3877,87 +3597,82 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" */ var Saver = function (_Module) { - _inherits(Saver, _Module); + _inherits(Saver, _Module); - /** - * @constructor - * @param config - */ - function Saver(_ref) { - var config = _ref.config; + /** + * @constructor + * @param config + */ + function Saver(_ref) { + var config = _ref.config; - _classCallCheck(this, Saver); + _classCallCheck(this, Saver); - var _this = _possibleConstructorReturn(this, (Saver.__proto__ || Object.getPrototypeOf(Saver)).call(this, { config: config })); + var _this = _possibleConstructorReturn(this, (Saver.__proto__ || Object.getPrototypeOf(Saver)).call(this, { config: config })); - _this.output = null; - _this.blocksData = []; + _this.output = null; + _this.blocksData = []; + return _this; + } - return _this; + /** + * Composes new chain of Promises to fire them alternatelly + * @return {SavedData} + */ + + + _createClass(Saver, [{ + key: 'save', + value: function save() { + var _this2 = this; + + var blocks = this.Editor.BlockManager.blocks, + chainData = []; + + blocks.forEach(function (block) { + chainData.push(block.data); + }); + + return Promise.all(chainData).then(function (allExtractedData) { + return _this2.makeOutput(allExtractedData); + }).then(function (outputData) { + return outputData; + }); } /** - * Composes new chain of Promises to fire them alternatelly + * Creates output object with saved data, time and version of editor + * @param {Object} allExtractedData * @return {SavedData} */ + }, { + key: 'makeOutput', + value: function makeOutput(allExtractedData) { + var items = [], + totalTime = 0; - _createClass(Saver, [{ - key: 'save', - value: function save() { - var _this2 = this; + console.groupCollapsed('[CodexEditor saving]:'); - var blocks = this.Editor.BlockManager.blocks, - chainData = []; + allExtractedData.forEach(function (extraction) { + /** Group process info */ + console.log('\xAB' + extraction.tool + '\xBB saving info', extraction); + totalTime += extraction.time; + items.push(extraction.data); + }); - blocks.forEach(function (block) { + console.log('Total', totalTime); + console.groupEnd(); - chainData.push(block.data); - }); + return { + time: +new Date(), + items: items, + version: "2.0.0" + }; + } + }]); - return Promise.all(chainData).then(function (allExtractedData) { - return _this2.makeOutput(allExtractedData); - }).then(function (outputData) { - - return outputData; - }); - } - - /** - * Creates output object with saved data, time and version of editor - * @param {Object} allExtractedData - * @return {SavedData} - */ - - }, { - key: 'makeOutput', - value: function makeOutput(allExtractedData) { - - var items = [], - totalTime = 0; - - console.groupCollapsed('[CodexEditor saving]:'); - - allExtractedData.forEach(function (extraction, index) { - - /** Group process info */ - console.log('\xAB' + extraction.tool + '\xBB saving info', extraction); - totalTime += extraction.time; - items.push(extraction.data); - }); - - console.log('Total', totalTime); - console.groupEnd(); - - return { - time: +new Date(), - items: items, - version: "2.0.0" - }; - } - }]); - - return Saver; + return Saver; }(Module); // module.exports = (function (saver) { @@ -4123,17 +3838,22 @@ var Saver = function (_Module) { Saver.displayName = 'Saver'; exports.default = Saver; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) /***/ }), -/* 17 */ + +/***/ "./src/components/modules/toolbar-blockSettings.js": +/*!*********************************************************!*\ + !*** ./src/components/modules/toolbar-blockSettings.js ***! + \*********************************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Module, $) { Object.defineProperty(exports, "__esModule", { - value: true + value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -4156,174 +3876,251 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * |________________________| */ var BlockSettings = function (_Module) { - _inherits(BlockSettings, _Module); + _inherits(BlockSettings, _Module); - function BlockSettings(_ref) { - var config = _ref.config; + function BlockSettings(_ref) { + var config = _ref.config; - _classCallCheck(this, BlockSettings); + _classCallCheck(this, BlockSettings); - var _this = _possibleConstructorReturn(this, (BlockSettings.__proto__ || Object.getPrototypeOf(BlockSettings)).call(this, { config: config })); + var _this = _possibleConstructorReturn(this, (BlockSettings.__proto__ || Object.getPrototypeOf(BlockSettings)).call(this, { config: config })); - _this.nodes = { - wrapper: null, - toolSettings: null, - defaultSettings: null, - buttonRemove: null - }; + _this.nodes = { + wrapper: null, + toolSettings: null, + defaultSettings: null, + buttonRemove: null + }; + return _this; + } - return _this; + /** + * Block Settings CSS + * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + */ + + + _createClass(BlockSettings, [{ + key: 'make', + + + /** + * Panel with block settings with 2 sections: + * - Tool's Settings + * - Default Settings [Move, Remove, etc] + * + * @return {Element} + */ + value: function make() { + this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); + + this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); + this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); + + $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); + + /** + * Add default settings that presents for all Blocks + */ + this.addDefaultSettings(); } /** - * Block Settings CSS - * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + * Add Tool's settings */ + }, { + key: 'addToolSettings', + value: function addToolSettings() { + console.log('Block Settings: add settings for ', this.Editor.BlockManager.currentBlock); + } - _createClass(BlockSettings, [{ - key: 'make', + /** + * Add default settings + */ + + }, { + key: 'addDefaultSettings', + value: function addDefaultSettings() { + var _this2 = this; + + /** + * Remove Block Button + * -------------------------------------------- + */ + this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, { + textContent: 'Remove Block' + }); + + $.append(this.nodes.defaultSettings, this.nodes.buttonRemove); + + this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', function (event) { + return _this2.removeBlockButtonClicked(event); + }); + } + + /** + * Clicks on the Remove Block Button + */ + + }, { + key: 'removeBlockButtonClicked', + value: function removeBlockButtonClicked() { + console.log('❇️ Remove Block Button clicked'); + } + + /** + * Is Block Settings opened or not + * @returns {boolean} + */ + + }, { + key: 'open', - /** - * Panel with block settings with 2 sections: - * - Tool's Settings - * - Default Settings [Move, Remove, etc] - * - * @return {Element} - */ - value: function make() { + /** + * Open Block Settings pane + */ + value: function open() { + this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); - this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); + /** + * Fill Tool's settings + */ + this.addToolSettings(); + } - this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); - this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); + /** + * Close Block Settings pane + */ - $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); + }, { + key: 'close', + value: function close() { + this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); + } + }, { + key: 'opened', + get: function get() { + return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); + } + }], [{ + key: 'CSS', + get: function get() { + return { + // Settings Panel + wrapper: 'ce-settings', + wrapperOpened: 'ce-settings--opened', + toolSettings: 'ce-settings__plugin-zone', + defaultSettings: 'ce-settings__default-zone', - /** - * Add default settings that presents for all Blocks - */ - this.addDefaultSettings(); - } + button: 'ce-settings__button' + }; + } + }]); - /** - * Add Tool's settings - */ - - }, { - key: 'addToolSettings', - value: function addToolSettings() { - - console.log('Block Settings: add settings for ', this.Editor.BlockManager.currentBlock); - } - - /** - * Add default settings - */ - - }, { - key: 'addDefaultSettings', - value: function addDefaultSettings() { - var _this2 = this; - - /** - * Remove Block Button - * -------------------------------------------- - */ - this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, { - textContent: 'Remove Block' - }); - - $.append(this.nodes.defaultSettings, this.nodes.buttonRemove); - - this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', function (event) { - return _this2.removeBlockButtonClicked(event); - }); - } - - /** - * Clicks on the Remove Block Button - */ - - }, { - key: 'removeBlockButtonClicked', - value: function removeBlockButtonClicked() { - - console.log('❇️ Remove Block Button clicked'); - } - - /** - * Is Block Settings opened or not - * @returns {boolean} - */ - - }, { - key: 'open', - - - /** - * Open Block Settings pane - */ - value: function open() { - - this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); - - /** - * Fill Tool's settings - */ - this.addToolSettings(); - } - - /** - * Close Block Settings pane - */ - - }, { - key: 'close', - value: function close() { - - this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); - } - }, { - key: 'opened', - get: function get() { - - return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); - } - }], [{ - key: 'CSS', - get: function get() { - - return { - // Settings Panel - wrapper: 'ce-settings', - wrapperOpened: 'ce-settings--opened', - toolSettings: 'ce-settings__plugin-zone', - defaultSettings: 'ce-settings__default-zone', - - button: 'ce-settings__button' - }; - } - }]); - - return BlockSettings; + return BlockSettings; }(Module); BlockSettings.displayName = 'BlockSettings'; exports.default = BlockSettings; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) /***/ }), -/* 18 */ + +/***/ "./src/components/modules/toolbar-inline.ts": +/*!**************************************************!*\ + !*** ./src/components/modules/toolbar-inline.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InlineToolbar = function (_Module) { + _inherits(InlineToolbar, _Module); + + /** + * @constructor + */ + function InlineToolbar(_ref) { + var config = _ref.config; + + _classCallCheck(this, InlineToolbar); + + /** + * Inline Toolbar elements + */ + var _this = _possibleConstructorReturn(this, (InlineToolbar.__proto__ || Object.getPrototypeOf(InlineToolbar)).call(this, { config: config })); + + _this.nodes = { + wrapper: null + }; + /** + * CSS styles + */ + _this.CSS = { + inlineToolbar: 'ce-inline-toolbar' + }; + return _this; + } + /** + * Making DOM + */ + + + _createClass(InlineToolbar, [{ + key: 'make', + value: function make() { + this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar); + /** + * Append Inline Toolbar to the Editor + */ + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + } + }, { + key: 'move', + value: function move() { + // moving + } + }]); + + return InlineToolbar; +}(Module); + +InlineToolbar.displayName = 'InlineToolbar'; +exports.default = InlineToolbar; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar-toolbox.js": +/*!***************************************************!*\ + !*** ./src/components/modules/toolbar-toolbox.js ***! + \***************************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Module, $, _) { Object.defineProperty(exports, "__esModule", { - value: true + value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -4345,243 +4142,232 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * */ var Toolbox = function (_Module) { - _inherits(Toolbox, _Module); + _inherits(Toolbox, _Module); + + /** + * @constructor + */ + function Toolbox(_ref) { + var config = _ref.config; + + _classCallCheck(this, Toolbox); + + var _this = _possibleConstructorReturn(this, (Toolbox.__proto__ || Object.getPrototypeOf(Toolbox)).call(this, { config: config })); + + _this.nodes = { + toolbox: null, + buttons: [] + }; /** - * @constructor + * Opening state + * @type {boolean} */ - function Toolbox(_ref) { - var config = _ref.config; + _this.opened = false; + return _this; + } - _classCallCheck(this, Toolbox); + /** + * CSS styles + * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + */ - var _this = _possibleConstructorReturn(this, (Toolbox.__proto__ || Object.getPrototypeOf(Toolbox)).call(this, { config: config })); - _this.nodes = { - toolbox: null, - buttons: [] - }; + _createClass(Toolbox, [{ + key: 'make', - /** - * Opening state - * @type {boolean} - */ - _this.opened = false; - return _this; + /** + * Makes the Toolbox + */ + value: function make() { + this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); + $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); + + this.addTools(); } /** - * CSS styles - * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + * Iterates available tools and appends them to the Toolbox */ + }, { + key: 'addTools', + value: function addTools() { + var tools = this.Editor.Tools.toolsAvailable; - _createClass(Toolbox, [{ - key: 'make', + for (var toolName in tools) { + this.addTool(toolName, tools[toolName]); + } + } + /** + * Append Tool to the Toolbox + * + * @param {string} toolName - tool name + * @param {Tool} tool - tool class + */ - /** - * Makes the Toolbox - */ - value: function make() { + }, { + key: 'addTool', + value: function addTool(toolName, tool) { + var _this2 = this; - this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); - $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); + if (tool.displayInToolbox && !tool.iconClassName) { + _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); + return; + } - this.addTools(); - } + /** + * @todo Add checkup for the render method + */ + // if (typeof tool.render !== 'function') { + // + // _.log('render method missed. Tool %o skipped', 'warn', tool); + // return; + // + // } - /** - * Iterates available tools and appends them to the Toolbox - */ + /** + * Skip tools that pass 'displayInToolbox=false' + */ + if (!tool.displayInToolbox) { + return; + } - }, { - key: 'addTools', - value: function addTools() { + var button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], { + title: toolName + }); - var tools = this.Editor.Tools.toolsAvailable; + /** + * Save tool's name in the button data-name + */ + button.dataset.name = toolName; - for (var toolName in tools) { + $.append(this.nodes.toolbox, button); - this.addTool(toolName, tools[toolName]); - } - } + this.nodes.toolbox.appendChild(button); + this.nodes.buttons.push(button); - /** - * Append Tool to the Toolbox - * - * @param {string} toolName - tool name - * @param {Tool} tool - tool class - */ + /** + * @todo add event with module Listeners + */ + // this.Editor.Listeners.add(); + button.addEventListener('click', function (event) { + _this2.buttonClicked(event); + }, false); + } - }, { - key: 'addTool', - value: function addTool(toolName, tool) { - var _this2 = this; + /** + * Toolbox button click listener + * 1) if block is empty -> replace + * 2) if block is not empty -> add new block below + * + * @param {MouseEvent} event + */ - if (tool.displayInToolbox && !tool.iconClassName) { + }, { + key: 'buttonClicked', + value: function buttonClicked(event) { + var toolButton = event.target, + toolName = toolButton.dataset.name, + tool = this.Editor.Tools.toolClasses[toolName]; - _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); - return; - } + /** + * @type {Block} + */ + var currentBlock = this.Editor.BlockManager.currentBlock; - /** - * @todo Add checkup for the render method - */ - // if (typeof tool.render !== 'function') { - // - // _.log('render method missed. Tool %o skipped', 'warn', tool); - // return; - // - // } + /** + * We do replace if: + * - block is empty + * - block is not irreplaceable + * @type {Array} + */ + if (!tool.irreplaceable && currentBlock.isEmpty) { + this.Editor.BlockManager.replace(toolName); + } else { + this.Editor.BlockManager.insert(toolName); + } - /** - * Skip tools that pass 'displayInToolbox=false' - */ - if (!tool.displayInToolbox) { + /** + * @todo set caret to the new block + */ - return; - } + // window.setTimeout(function () { - var button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], { - title: toolName - }); + /** Set caret to current block */ + // editor.caret.setToBlock(currentInputIndex); - /** - * Save tool's name in the button data-name - */ - button.dataset.name = toolName; + // }, 10); - $.append(this.nodes.toolbox, button); + /** + * Move toolbar when node is changed + */ + this.Editor.Toolbar.move(); + } - this.nodes.toolbox.appendChild(button); - this.nodes.buttons.push(button); + /** + * Open Toolbox with Tools + */ - /** - * @todo add event with module Listeners - */ - // this.Editor.Listeners.add(); - button.addEventListener('click', function (event) { + }, { + key: 'open', + value: function open() { + this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); + this.opened = true; + } - _this2.buttonClicked(event); - }, false); - } + /** + * Close Toolbox + */ - /** - * Toolbox button click listener - * 1) if block is empty -> replace - * 2) if block is not empty -> add new block below - * - * @param {MouseEvent} event - */ + }, { + key: 'close', + value: function close() { + this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); + this.opened = false; + } - }, { - key: 'buttonClicked', - value: function buttonClicked(event) { + /** + * Close Toolbox + */ - var toolButton = event.target, - toolName = toolButton.dataset.name, - tool = this.Editor.Tools.toolClasses[toolName]; + }, { + key: 'toggle', + value: function toggle() { + if (!this.opened) { + this.open(); + } else { + this.close(); + } + } + }], [{ + key: 'CSS', + get: function get() { + return { + toolbox: 'ce-toolbox', + toolboxButton: 'ce-toolbox__button', + toolboxOpened: 'ce-toolbox--opened' + }; + } + }]); - /** - * @type {Block} - */ - var currentBlock = this.Editor.BlockManager.currentBlock; - - /** - * We do replace if: - * - block is empty - * - block is not irreplaceable - * @type {Array} - */ - if (!tool.irreplaceable && currentBlock.isEmpty) { - - this.Editor.BlockManager.replace(toolName); - } else { - - this.Editor.BlockManager.insert(toolName); - } - - /** - * @todo set caret to the new block - */ - - // window.setTimeout(function () { - - /** Set caret to current block */ - // editor.caret.setToBlock(currentInputIndex); - - // }, 10); - - /** - * Move toolbar when node is changed - */ - this.Editor.Toolbar.move(); - } - - /** - * Open Toolbox with Tools - */ - - }, { - key: 'open', - value: function open() { - - this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); - this.opened = true; - } - - /** - * Close Toolbox - */ - - }, { - key: 'close', - value: function close() { - - this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); - this.opened = false; - } - - /** - * Close Toolbox - */ - - }, { - key: 'toggle', - value: function toggle() { - - if (!this.opened) { - - this.open(); - } else { - - this.close(); - } - } - }], [{ - key: 'CSS', - get: function get() { - - return { - toolbox: 'ce-toolbox', - toolboxButton: 'ce-toolbox__button', - toolboxOpened: 'ce-toolbox--opened' - }; - } - }]); - - return Toolbox; + return Toolbox; }(Module); Toolbox.displayName = 'Toolbox'; exports.default = Toolbox; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2), __webpack_require__(1))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) /***/ }), -/* 19 */ + +/***/ "./src/components/modules/toolbar.js": +/*!*******************************************!*\ + !*** ./src/components/modules/toolbar.js ***! + \*******************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -4675,7 +4461,6 @@ var Toolbar = function (_Module) { blockActionsButtons: null, settingsToggler: null }; - return _this; } @@ -4702,7 +4487,6 @@ var Toolbar = function (_Module) { * Make Content Zone and Actions Zone */ ['content', 'actions'].forEach(function (el) { - _this2.nodes[el] = $.make('div', Toolbar.CSS[el]); $.append(_this2.nodes.wrapper, _this2.nodes[el]); }); @@ -4759,7 +4543,6 @@ var Toolbar = function (_Module) { }, { key: 'move', value: function move() { - /** Close Toolbox when we move toolbar */ this.Editor.Toolbox.close(); @@ -4769,7 +4552,6 @@ var Toolbar = function (_Module) { * If no one Block selected as a Current */ if (!currentNode) { - return; } @@ -4795,7 +4577,6 @@ var Toolbar = function (_Module) { }, { key: 'open', value: function open() { - this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened); } @@ -4806,7 +4587,6 @@ var Toolbar = function (_Module) { }, { key: 'close', value: function close() { - this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened); } @@ -4824,7 +4604,6 @@ var Toolbar = function (_Module) { * @param {MouseEvent} event */ value: function plusButtonClicked() { - this.Editor.Toolbox.toggle(); } @@ -4842,7 +4621,6 @@ var Toolbar = function (_Module) { * Settings toggler */ this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', function (event) { - _this3.settingsTogglerClicked(event); }); } @@ -4854,12 +4632,9 @@ var Toolbar = function (_Module) { }, { key: 'settingsTogglerClicked', value: function settingsTogglerClicked() { - if (this.Editor.BlockSettings.opened) { - this.Editor.BlockSettings.close(); } else { - this.Editor.BlockSettings.open(); } } @@ -4880,7 +4655,6 @@ var Toolbar = function (_Module) { }], [{ key: 'CSS', get: function get() { - return { toolbar: 'ce-toolbar', content: 'ce-toolbar__content', @@ -4905,17 +4679,22 @@ var Toolbar = function (_Module) { Toolbar.displayName = 'Toolbar'; exports.default = Toolbar; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) /***/ }), -/* 20 */ + +/***/ "./src/components/modules/tools.js": +/*!*****************************************!*\ + !*** ./src/components/modules/tools.js ***! + \*****************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(Module, _) { Object.defineProperty(exports, "__esModule", { - value: true + value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -4969,245 +4748,231 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" * @property {EditorConfig} config - Editor config */ var Tools = function (_Module) { - _inherits(Tools, _Module); + _inherits(Tools, _Module); - _createClass(Tools, [{ - key: 'available', + _createClass(Tools, [{ + key: 'available', - - /** - * Returns available Tools - * @return {Tool[]} - */ - get: function get() { - - return this.toolsAvailable; - } - - /** - * Returns unavailable Tools - * @return {Tool[]} - */ - - }, { - key: 'unavailable', - get: function get() { - - return this.toolsUnavailable; - } - - /** - * Static getter for default Tool config fields - * - * @usage Tools.defaultConfig.displayInToolbox - * @return {ToolConfig} - */ - - }], [{ - key: 'defaultConfig', - get: function get() { - - return { - iconClassName: '', - displayInToolbox: false, - enableLineBreaks: false, - irreplaceable: false - }; - } - - /** - * @constructor - * - * @param {EditorConfig} config - */ - - }]); - - function Tools(_ref) { - var config = _ref.config; - - _classCallCheck(this, Tools); - - /** - * Map {name: Class, ...} where: - * name — block type name in JSON. Got from EditorConfig.tools keys - * @type {Object} - */ - var _this = _possibleConstructorReturn(this, (Tools.__proto__ || Object.getPrototypeOf(Tools)).call(this, { config: config })); - - _this.toolClasses = {}; - - /** - * Available tools list - * {name: Class, ...} - * @type {Object} - */ - _this.toolsAvailable = {}; - - /** - * Tools that rejected a prepare method - * {name: Class, ... } - * @type {Object} - */ - _this.toolsUnavailable = {}; - - return _this; + /** + * Returns available Tools + * @return {Tool[]} + */ + get: function get() { + return this.toolsAvailable; } /** - * Creates instances via passed or default configuration - * @return {Promise} + * Returns unavailable Tools + * @return {Tool[]} */ + }, { + key: 'unavailable', + get: function get() { + return this.toolsUnavailable; + } - _createClass(Tools, [{ - key: 'prepare', - value: function prepare() { - var _this2 = this; + /** + * Static getter for default Tool config fields + * + * @usage Tools.defaultConfig.displayInToolbox + * @return {ToolConfig} + */ - if (!this.config.hasOwnProperty('tools')) { + }], [{ + key: 'defaultConfig', + get: function get() { + return { + iconClassName: '', + displayInToolbox: false, + enableLineBreaks: false, + irreplaceable: false + }; + } - return Promise.reject("Can't start without tools"); + /** + * @constructor + * + * @param {EditorConfig} config + */ + + }]); + + function Tools(_ref) { + var config = _ref.config; + + _classCallCheck(this, Tools); + + /** + * Map {name: Class, ...} where: + * name — block type name in JSON. Got from EditorConfig.tools keys + * @type {Object} + */ + var _this = _possibleConstructorReturn(this, (Tools.__proto__ || Object.getPrototypeOf(Tools)).call(this, { config: config })); + + _this.toolClasses = {}; + + /** + * Available tools list + * {name: Class, ...} + * @type {Object} + */ + _this.toolsAvailable = {}; + + /** + * Tools that rejected a prepare method + * {name: Class, ... } + * @type {Object} + */ + _this.toolsUnavailable = {}; + return _this; + } + + /** + * Creates instances via passed or default configuration + * @return {Promise} + */ + + + _createClass(Tools, [{ + key: 'prepare', + value: function prepare() { + var _this2 = this; + + if (!this.config.hasOwnProperty('tools')) { + return Promise.reject("Can't start without tools"); + } + + for (var toolName in this.config.tools) { + this.toolClasses[toolName] = this.config.tools[toolName]; + } + + /** + * getting classes that has prepare method + */ + var sequenceData = this.getListOfPrepareFunctions(); + + /** + * if sequence data contains nothing then resolve current chain and run other module prepare + */ + if (sequenceData.length === 0) { + return Promise.resolve(); + } + + /** + * to see how it works {@link Util#sequence} + */ + return _.sequence(sequenceData, function (data) { + _this2.success(data); + }, function (data) { + _this2.fallback(data); + }); + } + + /** + * Binds prepare function of plugins with user or default config + * @return {Array} list of functions that needs to be fired sequentially + */ + + }, { + key: 'getListOfPrepareFunctions', + value: function getListOfPrepareFunctions() { + var toolPreparationList = []; + + for (var toolName in this.toolClasses) { + var toolClass = this.toolClasses[toolName]; + + if (typeof toolClass.prepare === 'function') { + toolPreparationList.push({ + function: toolClass.prepare, + data: { + toolName: toolName } - - for (var toolName in this.config.tools) { - - this.toolClasses[toolName] = this.config.tools[toolName]; - } - - /** - * getting classes that has prepare method - */ - var sequenceData = this.getListOfPrepareFunctions(); - - /** - * if sequence data contains nothing then resolve current chain and run other module prepare - */ - if (sequenceData.length === 0) { - - return Promise.resolve(); - } - - /** - * to see how it works {@link Util#sequence} - */ - return _.sequence(sequenceData, function (data) { - - _this2.success(data); - }, function (data) { - - _this2.fallback(data); - }); + }); + } else { + /** + * If Tool hasn't a prepare method, mark it as available + */ + this.toolsAvailable[toolName] = toolClass; } + } - /** - * Binds prepare function of plugins with user or default config - * @return {Array} list of functions that needs to be fired sequentially - */ + return toolPreparationList; + } - }, { - key: 'getListOfPrepareFunctions', - value: function getListOfPrepareFunctions() { + /** + * @param {ChainData.data} data - append tool to available list + */ - var toolPreparationList = []; + }, { + key: 'success', + value: function success(data) { + this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; + } - for (var toolName in this.toolClasses) { + /** + * @param {ChainData.data} data - append tool to unavailable list + */ - var toolClass = this.toolClasses[toolName]; + }, { + key: 'fallback', + value: function fallback(data) { + this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; + } - if (typeof toolClass.prepare === 'function') { + /** + * Return tool`a instance + * + * @param {String} tool — tool name + * @param {Object} data — initial data + * + * @todo throw exceptions if tool doesnt exist + * + */ - toolPreparationList.push({ - function: toolClass.prepare, - data: { - toolName: toolName - } - }); - } else { + }, { + key: 'construct', + value: function construct(tool, data) { + var plugin = this.toolClasses[tool], + config = this.config.toolsConfig[tool]; - /** - * If Tool hasn't a prepare method, mark it as available - */ - this.toolsAvailable[toolName] = toolClass; - } - } + if (!config) { + config = this.defaultConfig; + } - return toolPreparationList; - } + var instance = new plugin(data, config); - /** - * @param {ChainData.data} data - append tool to available list - */ + return instance; + } - }, { - key: 'success', - value: function success(data) { + /** + * Check if passed Tool is an instance of Initial Block Tool + * @param {Tool} tool - Tool to check + * @return {Boolean} + */ - this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; - } + }, { + key: 'isInitial', + value: function isInitial(tool) { + return tool instanceof this.available[this.config.initialBlock]; + } + }]); - /** - * @param {ChainData.data} data - append tool to unavailable list - */ - - }, { - key: 'fallback', - value: function fallback(data) { - - this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; - } - - /** - * Return tool`a instance - * - * @param {String} tool — tool name - * @param {Object} data — initial data - * - * @todo throw exceptions if tool doesnt exist - * - */ - - }, { - key: 'construct', - value: function construct(tool, data) { - - var plugin = this.toolClasses[tool], - config = this.config.toolsConfig[tool]; - - if (!config) { - - config = this.defaultConfig; - } - - var instance = new plugin(data, config); - - return instance; - } - - /** - * Check if passed Tool is an instance of Initial Block Tool - * @param {Tool} tool - Tool to check - * @return {Boolean} - */ - - }, { - key: 'isInitial', - value: function isInitial(tool) { - - return tool instanceof this.available[this.config.initialBlock]; - } - }]); - - return Tools; + return Tools; }(Module); Tools.displayName = 'Tools'; exports.default = Tools; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(1))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) /***/ }), -/* 21 */ + +/***/ "./src/components/modules/ui.js": +/*!**************************************!*\ + !*** ./src/components/modules/ui.js ***! + \**************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -5233,28 +4998,28 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function" // let className = { /** - * @const {string} BLOCK_CLASSNAME - redactor blocks name - */ + * @const {string} BLOCK_CLASSNAME - redactor blocks name + */ // BLOCK_CLASSNAME : 'ce-block', /** - * @const {String} wrapper for plugins content - */ + * @const {String} wrapper for plugins content + */ // BLOCK_CONTENT : 'ce-block__content', /** - * @const {String} BLOCK_STRETCHED - makes block stretched - */ + * @const {String} BLOCK_STRETCHED - makes block stretched + */ // BLOCK_STRETCHED : 'ce-block--stretched', /** - * @const {String} BLOCK_HIGHLIGHTED - adds background - */ + * @const {String} BLOCK_HIGHLIGHTED - adds background + */ // BLOCK_HIGHLIGHTED : 'ce-block--focused', /** - * @const {String} - for all default settings - */ + * @const {String} - for all default settings + */ // SETTINGS_ITEM : 'ce-settings__item' // }; @@ -5298,7 +5063,6 @@ var UI = function (_Module) { wrapper: null, redactor: null }; - return _this; } @@ -5312,8 +5076,6 @@ var UI = function (_Module) { value: function prepare() { var _this2 = this; - // this.Editor.Toolbar.make(); - return this.make() /** * Make toolbar @@ -5321,6 +5083,12 @@ var UI = function (_Module) { .then(function () { return _this2.Editor.Toolbar.make(); }) + /** + * Make the Inline toolbar + */ + .then(function () { + return _this2.Editor.InlineToolbar.make(); + }) /** * Load and append CSS */ @@ -5347,7 +5115,6 @@ var UI = function (_Module) { // .then(bindEvents_) .catch(function (e) { - console.error(e); // editor.core.log("Can't draw editor interface"); @@ -5355,23 +5122,22 @@ var UI = function (_Module) { } /** - * CodeX Editor UI CSS class names - * @return {{editorWrapper: string, editorZone: string, block: string}} - */ + * CodeX Editor UI CSS class names + * @return {{editorWrapper: string, editorZone: string, block: string}} + */ }, { key: 'make', /** - * Makes CodeX Editor interface - * @return {Promise} - */ + * Makes CodeX Editor interface + * @return {Promise} + */ value: function make() { var _this3 = this; return new Promise(function (resolve, reject) { - /** * Element where we need to append CodeX Editor * @type {Element} @@ -5379,7 +5145,6 @@ var UI = function (_Module) { _this3.nodes.holder = document.getElementById(_this3.config.holderId); if (!_this3.nodes.holder) { - reject(Error("Holder wasn't found by ID: #" + _this3.config.holderId)); return; } @@ -5404,11 +5169,10 @@ var UI = function (_Module) { }, { key: 'loadStyles', value: function loadStyles() { - /** * Load CSS */ - var styles = __webpack_require__(22); + var styles = __webpack_require__(/*! ../../styles/main.css */ "./src/styles/main.css"); /** * Make tag @@ -5468,17 +5232,14 @@ var UI = function (_Module) { }, { key: 'redactorClicked', value: function redactorClicked(event) { - var clickedNode = event.target; /** * Select clicked Block as Current */ try { - this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode); } catch (e) { - /** * If clicked outside first-level Blocks, set Caret to the last empty Block */ @@ -5499,8 +5260,8 @@ var UI = function (_Module) { // } /** - * - /** Update current input index in memory when caret focused into existed input */ + * + /** Update current input index in memory when caret focused into existed input */ // if (event.target.contentEditable == 'true') { // // editor.caret.saveCurrentInputIndex(); @@ -5585,14 +5346,12 @@ var UI = function (_Module) { isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty; if (isInitialBlock && isEmptyBlock) { - this.Editor.Toolbar.plusButton.show(); } } }, { key: 'CSS', get: function get() { - return { editorWrapper: 'codex-editor', editorZone: 'codex-editor__redactor' @@ -5822,104 +5581,287 @@ var UI = function (_Module) { UI.displayName = 'UI'; exports.default = UI; module.exports = exports['default']; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0), __webpack_require__(2))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) /***/ }), -/* 22 */ + +/***/ "./src/components/polyfills.js": +/*!*************************************!*\ + !*** ./src/components/polyfills.js ***! + \*************************************/ +/*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -exports = module.exports = __webpack_require__(23)(undefined); +"use strict"; + + +/** + * Element.closest() + * + * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest + */ +if (!Element.prototype.matches) Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + +if (!Element.prototype.closest) Element.prototype.closest = function (s) { + var el = this; + + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null); + return null; +}; + +/***/ }), + +/***/ "./src/components/utils.js": +/*!*********************************!*\ + !*** ./src/components/utils.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Codex Editor Util + */ +var Util = function () { + function Util() { + _classCallCheck(this, Util); + } + + _createClass(Util, null, [{ + key: 'log', + + /** + * Custom logger + * + * @param {string} msg - message + * @param {string} type - logging type 'log'|'warn'|'error'|'info' + * @param {*} args - argument to log with a message + */ + value: function log(msg, type, args) { + type = type || 'log'; + + if (!args) { + args = msg || 'undefined'; + msg = '[codex-editor]: %o'; + } else { + msg = '[codex-editor]: ' + msg; + } + + try { + if ('console' in window && window.console[type]) { + if (args) window.console[type](msg, args);else window.console[type](msg); + } + } catch (e) { + // do nothing + } + } + + /** + * Returns basic keycodes as constants + * @return {{}} + */ + + }, { + key: 'sequence', + + + /** + * @typedef {Object} ChainData + * @property {Object} data - data that will be passed to the success or fallback + * @property {Function} function - function's that must be called asynchronically + */ + + /** + * Fires a promise sequence asyncronically + * + * @param {Object[]} chains - list or ChainData's + * @param {Function} success - success callback + * @param {Function} fallback - callback that fires in case of errors + * + * @return {Promise} + */ + value: function sequence(chains) { + var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; + + return new Promise(function (resolve) { + /** + * pluck each element from queue + * First, send resolved Promise as previous value + * Each plugins "prepare" method returns a Promise, that's why + * reduce current element will not be able to continue while can't get + * a resolved Promise + */ + chains.reduce(function (previousValue, currentValue, iteration) { + return previousValue.then(function () { + return waitNextBlock(currentValue, success, fallback); + }).then(function () { + // finished + if (iteration === chains.length - 1) { + resolve(); + } + }); + }, Promise.resolve()); + }); + + /** + * Decorator + * + * @param {ChainData} chainData + * + * @param {Function} successCallback + * @param {Function} fallbackCallback + * + * @return {Promise} + */ + function waitNextBlock(chainData, successCallback, fallbackCallback) { + return new Promise(function (resolve) { + chainData.function().then(function () { + successCallback(chainData.data || {}); + }).then(resolve).catch(function () { + fallbackCallback(chainData.data || {}); + + // anyway, go ahead even it falls + resolve(); + }); + }); + } + } + + /** + * Make array from array-like collection + * + * @param {*} collection + * + * @return {Array} + */ + + }, { + key: 'array', + value: function array(collection) { + return Array.prototype.slice.call(collection); + } + + /** + * Checks if object is empty + * + * @param {Object} object + * @return {boolean} + */ + + }, { + key: 'isEmpty', + value: function isEmpty(object) { + return Object.keys(object).length === 0 && object.constructor === Object; + } + + /** + * Check if passed object is a Promise + * @param {*} object - object to check + * @return {Boolean} + */ + + }, { + key: 'isPromise', + value: function isPromise(object) { + return Promise.resolve(object) === object; + } + + /** + * Check if passed element is contenteditable + * @param element + * @return {boolean} + */ + + }, { + key: 'isContentEditable', + value: function isContentEditable(element) { + return element.contentEditable === 'true'; + } + + /** + * Delays method execution + * + * @param method + * @param timeout + */ + + }, { + key: 'delay', + value: function delay(method, timeout) { + return function () { + var context = this, + args = arguments; + + window.setTimeout(function () { + return method.apply(context, args); + }, timeout); + }; + } + }, { + key: 'keyCodes', + get: function get() { + return { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + DOWN: 40, + RIGHT: 39, + DELETE: 46, + META: 91 + }; + } + }]); + + return Util; +}(); + +Util.displayName = 'Util'; +exports.default = Util; +; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/styles/main.css": +/*!*****************************!*\ + !*** ./src/styles/main.css ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); // imports // module -exports.push([module.i, ":root {\n\n /**\n * Toolbar buttons\n */\n\n /**\n * All gray texts: placeholders, settings\n */\n\n /**\n * Block content width\n */\n\n /**\n * Toolbar Plus Button and Toolbox buttons height and width\n */\n\n}\n/**\n* Editor wrapper\n*/\n.codex-editor {\n position: relative;\n border: 1px solid #ccc;\n padding: 2px;\n box-sizing: border-box;\n}\n.codex-editor .hide {\n display: none;\n }\n.codex-editor__redactor {\n padding-bottom: 300px;\n }\n.ce-toolbar {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n /*opacity: 0;*/\n /*visibility: hidden;*/\n transition: opacity 100ms ease;\n will-change: opacity, transform;\n display: none;\n}\n.ce-toolbar--opened {\n display: block;\n /*opacity: 1;*/\n /*visibility: visible;*/\n }\n.ce-toolbar__content {\n max-width: 650px;\n margin: 0 auto;\n position: relative;\n }\n.ce-toolbar__plus {\n position: absolute;\n left: calc(-34px - 10px);\n display: inline-block;\n background-color: #eff2f5;\n width: 34px;\n height: 34px;\n line-height: 34px;\n text-align: center;\n border-radius: 50%\n }\n.ce-toolbar__plus::after {\n content: '+';\n font-size: 26px;\n display: block;\n margin-top: -2px;\n margin-right: -2px;\n\n}\n.ce-toolbar__plus--hidden {\n display: none;\n\n}\n/**\n * Block actions Zone\n * -------------------------\n */\n.ce-toolbar__actions {\n position: absolute;\n right: 0;\n top: 0;\n border: 1px dotted #ccc;\n padding: 2px;\n }\n.ce-toolbar__actions-buttons {\n border: 1px dotted #ccc;\n padding: 2px;\n text-align: right;\n margin-bottom: 2px;\n }\n.ce-toolbar__settings-btn {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 1px dotted #ccc\n }\n.ce-toolbar__settings-btn::before {\n content: 'STN';\n font-size: 10px;\n opacity: .4;\n\n}\n.ce-toolbox {\n visibility: hidden;\n transition: opacity 100ms ease;\n will-change: opacity;\n}\n.ce-toolbox--opened {\n opacity: 1;\n visibility: visible;\n }\n.ce-toolbox__button {\n display: inline-block;\n list-style: none;\n margin: 0;\n background: #eff2f5;\n width: 34px;\n height: 34px;\n border-radius: 30px;\n overflow: hidden;\n text-align: center;\n line-height: 34px\n }\n.ce-toolbox__button::before {\n content: attr(title);\n font-size: 22px;\n font-weight: 500;\n letter-spacing: 1em;\n -webkit-font-feature-settings: \"smcp\", \"c2sc\";\n font-feature-settings: \"smcp\", \"c2sc\";\n font-variant-caps: all-small-caps;\n padding-left: 11.5px;\n margin-top: -1px;\n display: inline-block;\n\n}\n.ce-settings {\n border: 1px dotted #ccc;\n padding: 2px;\n display: none;\n}\n.ce-settings--opened {\n display: block;\n }\n.ce-settings__plugin-zone {\n border: 1px dotted #ccc;\n padding: 2px;\n margin-bottom: 2px\n }\n.ce-settings__plugin-zone::before {\n content: 'PLUGIN SETTINGS';\n opacity: .4;\n font-size: 12px;\n\n}\n.ce-settings__default-zone {\n border: 1px dotted #ccc;\n padding: 2px\n }\n.ce-settings__default-zone::before {\n content: 'DEFAULT SETTINGS';\n opacity: .4;\n font-size: 12px;\n\n}\n.ce-settings__button {\n padding: 10px 15px;\n color: #707684\n }\n.ce-settings__button:hover {\n background: #eff2f5;\n\n}\n.ce-block {\n border: 1px dotted #ccc;\n margin: 2px 0\n}\n.ce-block:first-of-type {\n margin-top: 0;\n\n}\n.ce-block--selected {\n background-color: #eff2f5;\n\n}\n.ce-block__content {\n max-width: 650px;\n margin: 0 auto;\n\n}\n", ""]); +exports.push([module.i, ":root {\n\n /**\n * Toolbar buttons\n */\n --bg-light: #eff2f5;\n\n /**\n * All gray texts: placeholders, settings\n */\n --grayText: #707684;\n\n /**\n * Block content width\n */\n --content-width: 650px;\n\n /**\n * Toolbar Plus Button and Toolbox buttons height and width\n */\n --toolbar-buttons-size: 34px\n\n}\n/**\n* Editor wrapper\n*/\n.codex-editor {\n position: relative;\n border: 1px solid #ccc;\n padding: 2px;\n box-sizing: border-box;\n}\n.codex-editor .hide {\n display: none;\n }\n.codex-editor__redactor {\n padding-bottom: 300px;\n }\n.ce-toolbar {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n /*opacity: 0;*/\n /*visibility: hidden;*/\n transition: opacity 100ms ease;\n will-change: opacity, transform;\n display: none;\n}\n.ce-toolbar--opened {\n display: block;\n /*opacity: 1;*/\n /*visibility: visible;*/\n }\n.ce-toolbar__content {\n max-width: 650px;\n max-width: var(--content-width);\n margin: 0 auto;\n position: relative;\n }\n.ce-toolbar__plus {\n position: absolute;\n left: calc(-var(--toolbar-buttons-size) - 10px);\n left: calc(-var(--toolbar-buttons-size) - 10px);\n display: inline-block;\n background-color: #eff2f5;\n background-color: var(--bg-light);\n width: 34px;\n width: var(--toolbar-buttons-size);\n height: 34px;\n height: var(--toolbar-buttons-size);\n line-height: 34px;\n text-align: center;\n border-radius: 50%\n }\n.ce-toolbar__plus::after {\n content: '+';\n font-size: 26px;\n display: block;\n margin-top: -2px;\n margin-right: -2px;\n }\n.ce-toolbar__plus--hidden {\n display: none;\n }\n/**\n * Block actions Zone\n * -------------------------\n */\n.ce-toolbar__actions {\n position: absolute;\n right: 0;\n top: 0;\n border: 1px dotted #ccc;\n padding: 2px;\n }\n.ce-toolbar__actions-buttons {\n border: 1px dotted #ccc;\n padding: 2px;\n text-align: right;\n margin-bottom: 2px;\n }\n.ce-toolbar__settings-btn {\n display: inline-block;\n width: 24px;\n height: 24px;\n border: 1px dotted #ccc\n }\n.ce-toolbar__settings-btn::before {\n content: 'STN';\n font-size: 10px;\n opacity: .4;\n }\n.ce-toolbox {\n position: absolute;\n visibility: hidden;\n transition: opacity 100ms ease;\n will-change: opacity;\n}\n.ce-toolbox--opened {\n opacity: 1;\n visibility: visible;\n }\n.ce-toolbox__button {\n display: inline-block;\n list-style: none;\n margin: 0;\n background: #eff2f5;\n background: var(--bg-light);\n width: 34px;\n width: var(--toolbar-buttons-size);\n height: 34px;\n height: var(--toolbar-buttons-size);\n border-radius: 30px;\n overflow: hidden;\n text-align: center;\n line-height: 34px;\n line-height: var(--toolbar-buttons-size)\n }\n.ce-toolbox__button::before {\n content: attr(title);\n font-size: 22px;\n font-weight: 500;\n letter-spacing: 1em;\n -webkit-font-feature-settings: \"smcp\", \"c2sc\";\n font-feature-settings: \"smcp\", \"c2sc\";\n font-variant-caps: all-small-caps;\n padding-left: 11.5px;\n margin-top: -1px;\n display: inline-block;\n }\n.ce-inline-toolbar {\n position: absolute;\n z-index: 2;\n background: #FFFFFF;\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\n border-radius: 4px;\n position: relative;\n}\n.ce-inline-toolbar::before {\n content: '';\n width: 15px;\n height: 15px;\n position: absolute;\n top: -7px;\n left: 50%;\n margin-left: -7px;\n transform: rotate(-45deg);\n background: #fff;\n }\n.ce-inline-toolbar {\n\n width: 100px;\n height: 40px;\n}\n.ce-settings {\n border: 1px dotted #ccc;\n padding: 2px;\n display: none;\n}\n.ce-settings--opened {\n display: block;\n }\n.ce-settings__plugin-zone {\n border: 1px dotted #ccc;\n padding: 2px;\n margin-bottom: 2px\n }\n.ce-settings__plugin-zone::before {\n content: 'PLUGIN SETTINGS';\n opacity: .4;\n font-size: 12px;\n }\n.ce-settings__default-zone {\n border: 1px dotted #ccc;\n padding: 2px\n }\n.ce-settings__default-zone::before {\n content: 'DEFAULT SETTINGS';\n opacity: .4;\n font-size: 12px;\n }\n.ce-settings__button {\n padding: 10px 15px;\n color: #707684;\n color: var(--grayText)\n }\n.ce-settings__button:hover {\n background: #eff2f5;\n background: var(--bg-light);\n }\n.ce-block {\n border: 1px dotted #ccc;\n margin: 2px 0\n}\n.ce-block:first-of-type {\n margin-top: 0;\n }\n.ce-block--selected {\n background-color: #eff2f5;\n background-color: var(--bg-light);\n }\n.ce-block__content {\n max-width: 650px;\n max-width: var(--content-width);\n margin: 0 auto;\n }\n", ""]); // exports -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -/* - MIT License http://www.opensource.org/licenses/mit-license.php - Author Tobias Koppers @sokra -*/ -// css base code, injected by the css-loader -module.exports = function(useSourceMap) { - var list = []; - - // return the list of modules as css string - list.toString = function toString() { - return this.map(function (item) { - var content = cssWithMappingToString(item, useSourceMap); - if(item[2]) { - return "@media " + item[2] + "{" + content + "}"; - } else { - return content; - } - }).join(""); - }; - - // import a list of modules into the list - list.i = function(modules, mediaQuery) { - if(typeof modules === "string") - modules = [[null, modules, ""]]; - var alreadyImportedModules = {}; - for(var i = 0; i < this.length; i++) { - var id = this[i][0]; - if(typeof id === "number") - alreadyImportedModules[id] = true; - } - for(i = 0; i < modules.length; i++) { - var item = modules[i]; - // skip already imported module - // this implementation is not 100% perfect for weird media query combinations - // when a module is imported multiple times with different media queries. - // I hope this will never occur (Hey this way we have smaller bundles) - if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { - if(mediaQuery && !item[2]) { - item[2] = mediaQuery; - } else if(mediaQuery) { - item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; - } - list.push(item); - } - } - }; - return list; -}; - -function cssWithMappingToString(item, useSourceMap) { - var content = item[1] || ''; - var cssMapping = item[3]; - if (!cssMapping) { - return content; - } - - if (useSourceMap && typeof btoa === 'function') { - var sourceMapping = toComment(cssMapping); - var sourceURLs = cssMapping.sources.map(function (source) { - return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' - }); - - return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); - } - - return [content].join('\n'); -} - -// Adapted from convert-source-map (MIT) -function toComment(sourceMap) { - // eslint-disable-next-line no-undef - var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); - var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; - - return '/*# ' + data + ' */'; -} - - /***/ }) -/******/ ]); + +/******/ }); //# sourceMappingURL=codex-editor.js.map \ No newline at end of file diff --git a/build/codex-editor.js.map b/build/codex-editor.js.map index 66253bfc..614e9f27 100644 --- a/build/codex-editor.js.map +++ b/build/codex-editor.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap eb08a6ca55871472e45f","webpack:///./src/components/__module.js","webpack:///./src/components/utils.js","webpack:///./src/components/dom.js","webpack:///./src/codex.js","webpack:///./src/components/polyfills.js","webpack:///./src/components/modules nonrecursive [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$","webpack:///./src/components/modules/blockManager.js","webpack:///./src/components/block.js","webpack:///./src/components/modules/caret.js","webpack:///./src/components/Selection.js","webpack:///./src/components/modules/events.js","webpack:///./src/components/modules/keyboard.js","webpack:///./src/components/modules/listeners.js","webpack:///./src/components/modules/renderer.js","webpack:///./src/components/modules/sanitizer.js","webpack:///./node_modules/html-janitor/src/html-janitor.js","webpack:///./src/components/modules/saver.js","webpack:///./src/components/modules/toolbar-blockSettings.js","webpack:///./src/components/modules/toolbar-toolbox.js","webpack:///./src/components/modules/toolbar.js","webpack:///./src/components/modules/tools.js","webpack:///./src/components/modules/ui.js","webpack:///./src/styles/main.css","webpack:///./node_modules/css-loader/lib/css-base.js"],"names":["Module","config","new","target","TypeError","Editor","Util","msg","type","args","window","console","e","chains","success","fallback","Promise","resolve","reduce","previousValue","currentValue","iteration","then","waitNextBlock","length","chainData","successCallback","fallbackCallback","function","data","catch","collection","Array","prototype","slice","call","object","Object","keys","constructor","element","contentEditable","method","timeout","context","arguments","setTimeout","apply","BACKSPACE","TAB","ENTER","SHIFT","CTRL","ALT","ESC","SPACE","LEFT","UP","DOWN","RIGHT","DELETE","META","Dom","tag","tagName","includes","classNames","attributes","el","document","createElement","isArray","classList","add","attrName","content","createTextNode","parent","elements","forEach","appendChild","selector","querySelector","querySelectorAll","node","atLast","child","sibling","nodeType","Node","ELEMENT_NODE","nodeChild","isSingleTag","parentNode","getDeepestNode","nativeInputs","nodeText","isElement","isNativeInput","value","textContent","replace","trim","childNodes","treeWalker","leafs","isNodeEmpty","push","firstChild","shift","isLeaf","nextSibling","every","leaf","modules","editorModules","map","module","exports","moduleInstances","configuration","init","start","log","error","constructModules","configureModules","displayName","name","state","getModulesDiff","diff","moduleName","prepareDecorator","prepare","Tools","UI","BlockManager","Renderer","render","items","initialBlock","holderId","placeholder","sanitizer","p","b","a","hideToolbar","tools","toolsConfig","_","isEmpty","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","documentElement","contains","parentElement","_blocks","currentBlockIndex","blocks","Blocks","nodes","redactor","Proxy","set","get","toolName","toolInstance","construct","block","bindEvents","Listeners","on","pluginsContent","event","Keyboard","blockKeydownsListener","caretAtEnd","Caret","isAtEnd","nextBlock","setToBlock","caretAtStart","isAtStart","previousBlock","composeBlock","targetBlock","blockToMerge","blockToMergeIndex","indexOf","blockToMergeInfo","mergeWith","removeBlock","index","remove","extractedFragment","extractFragmentFromCaretPosition","wrapper","$","make","append","text","innerHTML","insert","firstLevelBlock","CSS","childNode","parentFirstLevelBlock","currentNode","Error","isLastBlock","isFirstBlock","array","selected","currentBlock","workingArea","html","deleteCount","splice","insertAdjacentElement","newBlock","children","instance","isNaN","Number","Block","tool","_html","compose","contentNode","methodName","params","Function","merge","extractedBlock","save","measuringStart","performance","now","measuringEnd","finishedExtraction","time","isValid","validate","contentless","emptyText","emptyMedia","hasMedia","mediaTags","join","offset","atEnd","focus","nodeToSet","delay","range","createRange","selection","setStart","setEnd","removeAllRanges","addRange","lastBlock","rangeCount","selectRange","getRangeAt","blockElem","deleteContents","cloneRange","selectNodeContents","endContainer","endOffset","extractContents","from","direction","current","siblings","isCollapsed","anchorNode","firstNode","firstLetterPosition","search","leftSiblings","getHigherLevelSiblings","nothingAtLeft","anchorOffset","lastNode","nothingAtRight","Selection","getSelection","Events","subscribers","eventName","callback","previousData","currentHandler","newData","keyCode","keyCodes","backspacePressed","enterPressed","arrowRightAndDownPressed","arrowLeftAndUpPressed","enableLineBreaks","shiftKey","split","preventDefault","BM","canMergeBlocks","getBlockByIndex","mergeable","navigatePrevious","setCaretToTheEnd","mergeBlocks","Toolbar","close","navigateNext","allListeners","eventType","handler","useCapture","assignedEventData","alreadyExist","findOne","addEventListener","existingListeners","findAll","i","removeEventListener","listenersOnElement","listener","listenersWithType","listenersWithHandler","foundListeners","foundAllListeners","foundByElements","foundByEventType","foundByHandler","findByElement","findByType","findByHandler","concat","insertBlock","sequence","item","Sanitizer","defaultConfig","_sanitizerInstance","sanitizerConfig","settings","sanitizerInstance","require","taintString","customConfig","clean","library","tags","href","rel","newInstance","Saver","output","blocksData","all","allExtractedData","makeOutput","outputData","totalTime","groupCollapsed","extraction","groupEnd","Date","version","VERSION","BlockSettings","toolSettings","defaultSettings","buttonRemove","addDefaultSettings","button","removeBlockButtonClicked","wrapperOpened","addToolSettings","Toolbox","toolbox","buttons","opened","addTools","toolsAvailable","addTool","displayInToolbox","iconClassName","toolboxButton","title","dataset","buttonClicked","toolButton","toolClasses","irreplaceable","move","toolboxOpened","open","actions","plusButton","blockActionsButtons","settingsToggler","toolbar","plusButtonClicked","defaultToolbarHeight","defaultOffset","newYCoordinate","offsetTop","style","transform","Math","floor","toolbarOpened","toggle","settingsTogglerClicked","hide","plusButtonHidden","show","toolsUnavailable","hasOwnProperty","reject","sequenceData","getListOfPrepareFunctions","toolPreparationList","toolClass","plugin","available","holder","loadStyles","getElementById","editorWrapper","editorZone","styles","toString","head","redactorClicked","clickedNode","setCurrentBlockByChildNode","setToTheLastBlock","isInitialBlock","isInitial","isEmptyBlock"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;AC7DA;;;;;;;;;IASqBA,M;;AAEjB;;;;;AAKA,oBAA6B;AAAA,mFAAJ,EAAI;AAAA,QAAfC,MAAe,QAAfA,MAAe;;AAAA;;AAEzB,QAAIC,IAAIC,MAAJ,KAAeH,MAAnB,EAA2B;;AAEvB,YAAM,IAAII,SAAJ,CAAc,yDAAd,CAAN;AAEH;;AAED;;;AAGA,SAAKH,MAAL,GAAcA,MAAd;;AAEA;;;AAGA,SAAKI,MAAL,GAAc,IAAd;AAEH;;AAED;;;;;;;;;;;sBAOUA,M,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,U;;;;;;;;;;ACvbA;;;;;AAKA,IAAI,CAACwJ,QAAQxH,SAAR,CAAkByH,OAAvB,EACID,QAAQxH,SAAR,CAAkByH,OAAlB,GAA4BD,QAAQxH,SAAR,CAAkB0H,iBAAlB,IACxBF,QAAQxH,SAAR,CAAkB2H,qBADtB;;AAGJ,IAAI,CAACH,QAAQxH,SAAR,CAAkB4H,OAAvB,EACIJ,QAAQxH,SAAR,CAAkB4H,OAAlB,GAA4B,UAAUC,CAAV,EAAa;;AAErC,QAAI1F,KAAK,IAAT;;AAEA,QAAI,CAACC,SAAS0F,eAAT,CAAyBC,QAAzB,CAAkC5F,EAAlC,CAAL,EAA4C,OAAO,IAAP;AAC5C,OAAG;;AAEC,YAAIA,GAAGsF,OAAH,CAAWI,CAAX,CAAJ,EAAmB,OAAO1F,EAAP;AACnBA,aAAKA,GAAG6F,aAAH,IAAoB7F,GAAGyB,UAA5B;AAEH,KALD,QAKSzB,OAAO,IALhB;AAMA,WAAO,IAAP;AAEH,CAbD,C;;;;;;ACVJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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jB,CAAyB,UAACuS,UAAD,EAAahL,KAAb,EAAuB;;AAE5C;AACA3L,wBAAQgH,GAAR,UAAgB2P,WAAW/I,IAA3B,uBAAgD+I,UAAhD;AACAF,6BAAaE,WAAWhI,IAAxB;AACA1G,sBAAMjC,IAAN,CAAW2Q,WAAWzV,IAAtB;AAEH,aAPD;;AASAlB,oBAAQgH,GAAR,CAAY,OAAZ,EAAqByP,SAArB;AACAzW,oBAAQ4W,QAAR;;AAEA,mBAAO;AACHjI,sBAAU,CAAC,IAAIkI,IAAJ,EADR;AAEH5O,uBAAUA,KAFP;AAGH6O,yBAAU,OAAAC;AAHP,aAAP;AAMH;;;;EAtE8B1X,M;;AA0EnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;kBAvOqB6W,K;;;;;;;;;;;;;;;;;;;;;;;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b,MAAL,CAAYoI,YAAZ,CAAyBkF,YAAzB,CAAsCY,IAAlE,CAArB;AAAA,UACI2N,eAAe,KAAK7b,MAAL,CAAYoI,YAAZ,CAAyBkF,YAAzB,CAAsCnE,OADzD;;AAGA,UAAIwS,kBAAkBE,YAAtB,EAAoC;;AAEhC,aAAK7b,MAAL,CAAY0T,OAAZ,CAAoByF,UAApB,CAA+BkB,IAA/B;AAEH;AAEJ;;;wBAxOS;;AAEN,aAAO;AACHa,uBAAgB,cADb;AAEHC,oBAAgB;AAFb,OAAP;AAKH;;;;EAzE2Bxb,M;;AA8ShC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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8B,8BAA8B,uBAAuB,sCAAsC,kCAAkC,kBAAkB,sBAAsB,KAAK,wBAAwB,yBAAyB,yBAAyB,8BAA8B,0BAA0B,KAAK,aAAa,4BAA4B,oBAAoB,2BAA2B,oBAAoB,KAAK,uBAAuB,gCAAgC,KAAK,sBAAsB,uBAAuB,qBAAqB,KAAK;;AAE1rH;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,IAAI;AACJ;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;;AAElE;AACA","file":"codex-editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap eb08a6ca55871472e45f","/**\n * @abstract\n * @class Module\n * @classdesc All modules inherits from this class.\n *\n * @typedef {Module} Module\n * @property {Object} config - Editor user settings\n * @property {Object} Editor - List of Editor modules\n */\nexport default class Module {\n\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({ config } = {}) {\n\n if (new.target === Module) {\n\n throw new TypeError('Constructors for abstract class Module are not allowed.');\n\n }\n\n /**\n * @type {EditorConfig}\n */\n this.config = config;\n\n /**\n * @type {EditorComponents}\n */\n this.Editor = null;\n\n }\n\n /**\n * Editor modules setter\n *\n * @param Editor\n * @param Editor.modules {@link CodexEditor#moduleInstances}\n * @param Editor.config {@link CodexEditor#configuration}\n */\n set state(Editor) {\n\n this.Editor = Editor;\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/__module.js","/**\n * Codex Editor Util\n */\nexport default class Util {\n\n /**\n * Custom logger\n *\n * @param {string} msg - message\n * @param {string} type - logging type 'log'|'warn'|'error'|'info'\n * @param {*} args - argument to log with a message\n */\n static log(msg, type, args) {\n\n type = type || 'log';\n\n if (!args) {\n\n args = msg || 'undefined';\n msg = '[codex-editor]: %o';\n\n } else {\n\n msg = '[codex-editor]: ' + msg;\n\n }\n\n try{\n\n if ( 'console' in window && window.console[ type ] ) {\n\n if ( args ) window.console[ type ]( msg, args );\n else window.console[ type ]( msg );\n\n }\n\n } catch(e) {\n // do nothing\n }\n\n }\n\n /**\n * Returns basic keycodes as constants\n * @return {{}}\n */\n static get keyCodes() {\n\n return {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n SHIFT: 16,\n CTRL: 17,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n LEFT: 37,\n UP: 38,\n DOWN: 40,\n RIGHT: 39,\n DELETE: 46,\n META: 91\n };\n\n }\n\n /**\n * @typedef {Object} ChainData\n * @property {Object} data - data that will be passed to the success or fallback\n * @property {Function} function - function's that must be called asynchronically\n */\n\n /**\n * Fires a promise sequence asyncronically\n *\n * @param {Object[]} chains - list or ChainData's\n * @param {Function} success - success callback\n * @param {Function} fallback - callback that fires in case of errors\n *\n * @return {Promise}\n */\n static sequence(chains, success = () => {}, fallback = () => {}) {\n\n return new Promise(function (resolve) {\n\n /**\n * pluck each element from queue\n * First, send resolved Promise as previous value\n * Each plugins \"prepare\" method returns a Promise, that's why\n * reduce current element will not be able to continue while can't get\n * a resolved Promise\n */\n chains.reduce(function (previousValue, currentValue, iteration) {\n\n return previousValue\n .then(() => waitNextBlock(currentValue, success, fallback))\n .then(() => {\n\n // finished\n if (iteration === chains.length - 1) {\n\n resolve();\n\n }\n\n });\n\n }, Promise.resolve());\n\n });\n\n /**\n * Decorator\n *\n * @param {ChainData} chainData\n *\n * @param {Function} successCallback\n * @param {Function} fallbackCallback\n *\n * @return {Promise}\n */\n function waitNextBlock(chainData, successCallback, fallbackCallback) {\n\n return new Promise(function (resolve) {\n\n chainData.function()\n .then(() => {\n\n successCallback(chainData.data || {});\n\n })\n .then(resolve)\n .catch(function () {\n\n fallbackCallback(chainData.data || {});\n\n // anyway, go ahead even it falls\n resolve();\n\n });\n\n });\n\n }\n\n }\n\n /**\n * Make array from array-like collection\n *\n * @param {*} collection\n *\n * @return {Array}\n */\n static array(collection) {\n\n return Array.prototype.slice.call(collection);\n\n }\n\n /**\n * Checks if object is empty\n *\n * @param {Object} object\n * @return {boolean}\n */\n static isEmpty(object) {\n\n return Object.keys(object).length === 0 && object.constructor === Object;\n\n }\n\n /**\n * Check if passed object is a Promise\n * @param {*} object - object to check\n * @return {Boolean}\n */\n static isPromise(object) {\n\n return Promise.resolve(object) === object;\n\n }\n\n /**\n * Check if passed element is contenteditable\n * @param element\n * @return {boolean}\n */\n static isContentEditable(element) {\n\n return element.contentEditable === 'true';\n\n }\n\n /**\n * Delays method execution\n *\n * @param method\n * @param timeout\n */\n static delay(method, timeout) {\n\n return function () {\n\n let context = this,\n args = arguments;\n\n window.setTimeout(() => method.apply(context, args), timeout);\n\n };\n\n }\n\n};\n\n\n// WEBPACK FOOTER //\n// ./src/components/utils.js","/**\n * DOM manipulations helper\n */\nexport default class Dom {\n\n /**\n * Check if passed tag has no closed tag\n * @param {Element} tag\n * @return {Boolean}\n */\n static isSingleTag(tag) {\n\n return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName);\n\n };\n\n\n /**\n * Helper for making Elements with classname and attributes\n *\n * @param {string} tagName - new Element tag name\n * @param {array|string} classNames - list or name of CSS classname(s)\n * @param {Object} attributes - any attributes\n * @return {Element}\n */\n static make(tagName, classNames = null, attributes = {}) {\n\n let el = document.createElement(tagName);\n\n if ( Array.isArray(classNames) ) {\n\n el.classList.add(...classNames);\n\n } else if( classNames ) {\n\n el.classList.add(classNames);\n\n }\n\n for (let attrName in attributes) {\n\n el[attrName] = attributes[attrName];\n\n }\n\n return el;\n\n }\n\n /**\n * Creates Text Node with the passed content\n * @param {String} content - text content\n * @return {Text}\n */\n static text(content) {\n\n return document.createTextNode(content);\n\n }\n\n /**\n * Append one or several elements to the parent\n *\n * @param {Element} parent - where to append\n * @param {Element|Element[]} - element ore elements list\n */\n static append(parent, elements) {\n\n if ( Array.isArray(elements) ) {\n\n elements.forEach( el => parent.appendChild(el) );\n\n } else {\n\n parent.appendChild(elements);\n\n }\n\n }\n\n /**\n * Selector Decorator\n *\n * Returns first match\n *\n * @param {Element} el - element we searching inside. Default - DOM Document\n * @param {String} selector - searching string\n *\n * @returns {Element}\n */\n static find(el = document, selector) {\n\n return el.querySelector(selector);\n\n }\n\n /**\n * Selector Decorator.\n *\n * Returns all matches\n *\n * @param {Element} el - element we searching inside. Default - DOM Document\n * @param {String} selector - searching string\n * @returns {NodeList}\n */\n static findAll(el = document, selector) {\n\n return el.querySelectorAll(selector);\n\n }\n\n /**\n * Search for deepest node which is Leaf.\n * Leaf is the vertex that doesn't have any child nodes\n *\n * @description Method recursively goes throw the all Node until it finds the Leaf\n *\n * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search}\n * @param {Boolean} atLast - find last text node\n * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it\n */\n static getDeepestNode(node, atLast = false) {\n\n /**\n * Current function have two directions:\n * - starts from first child and every time gets first or nextSibling in special cases\n * - starts from last child and gets last or previousSibling\n * @type {string}\n */\n let child = atLast ? 'lastChild' : 'firstChild',\n sibling = atLast ? 'previousSibling' : 'nextSibling';\n\n if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) {\n\n let nodeChild = node[child];\n\n /**\n * special case when child is single tag that can't contain any content\n */\n if (Dom.isSingleTag(nodeChild)) {\n\n /**\n * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest\n * from sibling\n *\n * 2) If single tag's next sibling is null, then go back to parent and check his sibling\n * In case of Node Element continue searching\n *\n * 3) If none of conditions above happened return parent Node Element\n */\n if (nodeChild[sibling]) {\n\n nodeChild = nodeChild[sibling];\n\n } else if (nodeChild.parentNode[sibling]) {\n\n nodeChild = nodeChild.parentNode[sibling];\n\n } else {\n\n return nodeChild.parentNode;\n\n }\n\n }\n\n return this.getDeepestNode(nodeChild, atLast);\n\n }\n\n return node;\n\n }\n\n /**\n * Check if object is DOM node\n *\n * @param {Object} node\n * @returns {boolean}\n */\n static isElement(node) {\n\n return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE;\n\n }\n\n /**\n * Checks target if it is native input\n * @param {Element|String} target - HTML element or string\n * @return {Boolean}\n */\n static isNativeInput(target) {\n\n let nativeInputs = [\n 'INPUT',\n 'TEXTAREA'\n ];\n\n return target ? nativeInputs.includes(target.tagName) : false;\n\n }\n\n /**\n * Checks node if it is empty\n *\n * @description Method checks simple Node without any childs for emptiness\n * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method\n *\n * @param {Node} node\n * @return {Boolean} true if it is empty\n */\n static isNodeEmpty(node) {\n\n let nodeText;\n\n if ( this.isElement(node) && this.isNativeInput(node) ) {\n\n nodeText = node.value;\n\n } else {\n\n nodeText = node.textContent.replace('\\u200B', '');\n\n }\n\n return nodeText.trim().length === 0;\n\n }\n\n /**\n * checks node if it is doesn't have any child nodes\n * @param {Node} node\n * @return {boolean}\n */\n static isLeaf(node) {\n\n if (!node) {\n\n return false;\n\n }\n\n return node.childNodes.length === 0;\n\n }\n\n /**\n * breadth-first search (BFS)\n * {@link https://en.wikipedia.org/wiki/Breadth-first_search}\n *\n * @description Pushes to stack all DOM leafs and checks for emptiness\n *\n * @param {Node} node\n * @return {boolean}\n */\n static isEmpty(node) {\n\n let treeWalker = [],\n leafs = [];\n\n if (!node) {\n\n return true;\n\n }\n\n if (!node.childNodes.length) {\n\n return this.isNodeEmpty(node);\n\n }\n\n treeWalker.push(node.firstChild);\n\n while ( treeWalker.length > 0 ) {\n\n node = treeWalker.shift();\n\n if (!node) continue;\n\n if ( this.isLeaf(node) ) {\n\n leafs.push(node);\n\n } else {\n\n treeWalker.push(node.firstChild);\n\n }\n\n while ( node && node.nextSibling ) {\n\n node = node.nextSibling;\n\n if (!node) continue;\n\n treeWalker.push(node);\n\n }\n\n /**\n * If one of childs is not empty, checked Node is not empty too\n */\n if (node && !this.isNodeEmpty(node)) {\n\n return false;\n\n }\n\n }\n\n return leafs.every( leaf => this.isNodeEmpty(leaf) );\n\n }\n\n};\n\n\n// WEBPACK FOOTER //\n// ./src/components/dom.js","/**\n * Codex Editor\n *\n * Short Description (눈_눈;)\n * @version 2.0.0\n *\n * How to start?\n * Example:\n * new CodexEditor({\n * holderId : 'codex-editor',\n * initialBlock : 'text',\n * placeholder : 'Write your story....',\n * tools: {\n * quote: Quote,\n * anotherTool : AnotherTool\n * },\n * toolsConfig: {\n * quote: {\n * iconClassname : 'quote-icon',\n * displayInToolbox : true,\n * enableLineBreaks : true\n * },\n * anotherTool: {\n * iconClassname : 'tool-icon'\n * }\n * }\n * });\n *\n * - tools is an object: {\n * pluginName: PluginClass,\n * .....\n * }\n * - toolsConfig is an additional configuration that uses Codex Editor API\n * iconClassname - CSS classname of toolbox icon\n * displayInToolbox - if you want to see your Tool in toolbox hided in \"plus\" button, than set \"True\". By default : \"False\"\n * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property \"True\", enter will break the lines in current block\n *\n * @author CodeX-Team \n *\n */\n\n/**\n * @typedef {CodexEditor} CodexEditor - editor class\n */\n\n/**\n * @typedef {Object} EditorConfig\n * @property {String} holderId - Element to append Editor\n * @property {Array} data - Blocks list in JSON-format\n * @property {Object} tools - Map for used Tools in format { name : Class, ... }\n * @property {String} initialBlock - This Tool will be added by default\n * @property {String} placeholder - First Block placeholder\n * @property {Object} sanitizer - @todo fill desc\n * @property {Boolean} hideToolbar - @todo fill desc\n * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig}\n */\n\n/**\n * Dynamically imported utils\n *\n * @typedef {Dom} $ - {@link components/dom.js}\n * @typedef {Util} _ - {@link components/utils.js}\n */\n\n'use strict';\n\n/**\n * Apply polyfills\n */\nimport 'components/polyfills';\n\n/**\n * Require Editor modules places in components/modules dir\n */\n// eslint-disable-next-line\nlet modules = editorModules.map( module => require('./components/modules/' + module ));\n\n/**\n * @class\n *\n * @classdesc CodeX Editor base class\n *\n * @property this.config - all settings\n * @property this.moduleInstances - constructed editor components\n *\n * @type {CodexEditor}\n */\nmodule.exports = class CodexEditor {\n\n /** Editor version */\n static get version() {\n\n return VERSION;\n\n }\n\n /**\n * @param {EditorConfig} config - user configuration\n *\n */\n constructor(config) {\n\n /**\n * Configuration object\n * @type {EditorConfig}\n */\n this.config = {};\n\n /**\n * @typedef {Object} EditorComponents\n * @property {BlockManager} BlockManager\n * @property {Tools} Tools\n * @property {Events} Events\n * @property {UI} UI\n * @property {Toolbar} Toolbar\n * @property {Toolbox} Toolbox\n * @property {BlockSettings} BlockSettings\n * @property {Renderer} Renderer\n */\n this.moduleInstances = {};\n\n Promise.resolve()\n .then(() => {\n\n this.configuration = config;\n\n })\n .then(() => this.init())\n .then(() => this.start())\n .then(() => {\n\n console.log('CodeX Editor is ready!');\n\n })\n .catch(error => {\n\n console.log('CodeX Editor does not ready because of %o', error);\n\n });\n\n }\n\n /**\n * Setting for configuration\n * @param {EditorConfig} config\n */\n set configuration(config) {\n\n /**\n * Initlai block type\n * Uses in case when there is no items passed\n * @type {{type: (*), data: {text: null}}}\n */\n let initialBlock = {\n type : config.initialBlock,\n data : {}\n };\n\n this.config.holderId = config.holderId;\n this.config.placeholder = config.placeholder || 'write your story...';\n this.config.sanitizer = config.sanitizer || {\n p: true,\n b: true,\n a: true\n };\n\n this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false;\n this.config.tools = config.tools || {};\n this.config.toolsConfig = config.toolsConfig || {};\n this.config.data = config.data || {};\n\n /**\n * Initialize items to pass data to the Renderer\n */\n if (_.isEmpty(this.config.data)) {\n\n this.config.data = {};\n this.config.data.items = [ initialBlock ];\n\n } else {\n\n if (!this.config.data.items || this.config.data.items.length === 0) {\n\n this.config.data.items = [ initialBlock ];\n\n }\n\n }\n\n /**\n * If initial Block's Tool was not passed, use the first Tool in config.tools\n */\n if (!config.initialBlock) {\n\n for (this.config.initialBlock in this.config.tools) break;\n\n } else {\n\n this.config.initialBlock = config.initialBlock;\n\n }\n\n }\n\n /**\n * Returns private property\n * @returns {EditorConfig}\n */\n get configuration() {\n\n return this.config;\n\n }\n\n /**\n * Initializes modules:\n * - make and save instances\n * - configure\n */\n init() {\n\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n this.constructModules();\n\n /**\n * Modules configuration\n */\n this.configureModules();\n\n }\n\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n constructModules() {\n\n modules.forEach( Module => {\n\n try {\n\n /**\n * We use class name provided by displayName property\n *\n * On build, Babel will transform all Classes to the Functions so, name will always be 'Function'\n * To prevent this, we use 'babel-plugin-class-display-name' plugin\n * @see https://www.npmjs.com/package/babel-plugin-class-display-name\n */\n this.moduleInstances[Module.displayName] = new Module({\n config : this.configuration\n });\n\n } catch ( e ) {\n\n console.log('Module %o skipped because %o', Module, e);\n\n }\n\n });\n\n }\n\n /**\n * Modules instances configuration:\n * - pass other modules to the 'state' property\n * - ...\n */\n configureModules() {\n\n for(let name in this.moduleInstances) {\n\n /**\n * Module does not need self-instance\n */\n this.moduleInstances[name].state = this.getModulesDiff( name );\n\n }\n\n }\n\n /**\n * Return modules without passed name\n */\n getModulesDiff( name ) {\n\n let diff = {};\n\n for(let moduleName in this.moduleInstances) {\n\n /**\n * Skip module with passed name\n */\n if (moduleName === name) {\n\n continue;\n\n }\n diff[moduleName] = this.moduleInstances[moduleName];\n\n }\n\n return diff;\n\n }\n\n /**\n * Start Editor!\n *\n * Get list of modules that needs to be prepared and return a sequence (Promise)\n * @return {Promise}\n */\n start() {\n\n let prepareDecorator = module => module.prepare();\n\n return Promise.resolve()\n .then(prepareDecorator(this.moduleInstances.Tools))\n .then(prepareDecorator(this.moduleInstances.UI))\n .then(prepareDecorator(this.moduleInstances.BlockManager))\n .then(() => {\n\n return this.moduleInstances.Renderer.render(this.config.data.items);\n\n\n });\n\n }\n\n};\n\n// module.exports = (function (editor) {\n//\n// 'use strict';\n//\n// editor.version = VERSION;\n// editor.scriptPrefix = 'cdx-script-';\n//\n// var init = function () {\n//\n// editor.core = require('./modules/core');\n// editor.tools = require('./modules/tools');\n// editor.ui = require('./modules/ui');\n// editor.transport = require('./modules/transport');\n// editor.renderer = require('./modules/renderer');\n// editor.saver = require('./modules/saver');\n// editor.content = require('./modules/content');\n// editor.toolbar = require('./modules/toolbar/toolbar');\n// editor.callback = require('./modules/callbacks');\n// editor.draw = require('./modules/draw');\n// editor.caret = require('./modules/caret');\n// editor.notifications = require('./modules/notifications');\n// editor.parser = require('./modules/parser');\n// editor.sanitizer = require('./modules/sanitizer');\n// editor.listeners = require('./modules/listeners');\n// editor.destroyer = require('./modules/destroyer');\n// editor.paste = require('./modules/paste');\n//\n// };\n//\n// /**\n// * @public\n// * holds initial settings\n// */\n// editor.settings = {\n// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],\n// holderId : 'codex-editor',\n//\n// // Type of block showing on empty editor\n// initialBlockPlugin: 'text'\n// };\n//\n// /**\n// * public\n// *\n// * Static nodes\n// */\n// editor.nodes = {\n// holder : null,\n// wrapper : null,\n// toolbar : null,\n// inlineToolbar : {\n// wrapper : null,\n// buttons : null,\n// actions : null\n// },\n// toolbox : null,\n// notifications : null,\n// plusButton : null,\n// showSettingsButton: null,\n// showTrashButton : null,\n// blockSettings : null,\n// pluginSettings : null,\n// defaultSettings : null,\n// toolbarButtons : {}, // { type : DomEl, ... }\n// redactor : null\n// };\n//\n// /**\n// * @public\n// *\n// * Output state\n// */\n// editor.state = {\n// jsonOutput : [],\n// blocks : [],\n// inputs : []\n// };\n//\n// /**\n// * @public\n// * Editor plugins\n// */\n// editor.tools = {};\n//\n// editor.start = function (userSettings) {\n//\n// init();\n//\n// editor.core.prepare(userSettings)\n//\n// // If all ok, make UI, bind events and parse initial-content\n// .then(editor.ui.prepare)\n// .then(editor.tools.prepare)\n// .then(editor.sanitizer.prepare)\n// .then(editor.paste.prepare)\n// .then(editor.transport.prepare)\n// .then(editor.renderer.makeBlocksFromData)\n// .then(editor.ui.saveInputs)\n// .catch(function (error) {\n//\n// editor.core.log('Initialization failed with error: %o', 'warn', error);\n//\n// });\n//\n// };\n//\n// return editor;\n//\n// })({});\n\n\n\n// WEBPACK FOOTER //\n// ./src/codex.js","/**\n * Element.closest()\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n */\nif (!Element.prototype.matches)\n Element.prototype.matches = Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n\n var el = this;\n\n if (!document.documentElement.contains(el)) return null;\n do {\n\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n\n } while (el !== null);\n return null;\n\n };\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/polyfills.js","var map = {\n\t\"./blockManager.js\": 6,\n\t\"./caret.js\": 8,\n\t\"./events.js\": 10,\n\t\"./keyboard.js\": 11,\n\t\"./listeners.js\": 12,\n\t\"./renderer.js\": 13,\n\t\"./sanitizer.js\": 14,\n\t\"./saver.js\": 16,\n\t\"./toolbar-blockSettings.js\": 17,\n\t\"./toolbar-toolbox.js\": 18,\n\t\"./toolbar.js\": 19,\n\t\"./tools.js\": 20,\n\t\"./ui.js\": 21\n};\nfunction webpackContext(req) {\n\treturn __webpack_require__(webpackContextResolve(req));\n};\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) // check for number or string\n\t\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n\treturn id;\n};\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 5;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/components/modules nonrecursive [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$\n// module id = 5\n// module chunks = 0","/**\n * @class BlockManager\n * @classdesc Manage editor`s blocks storage and appearance\n *\n * @module BlockManager\n *\n * @version 2.0.0\n */\n\nimport Block from '../block';\n\n/**\n * @typedef {BlockManager} BlockManager\n * @property {Number} currentBlockIndex - Index of current working block\n * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks}\n */\nexport default class BlockManager extends Module {\n\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n\n super({config});\n\n /**\n * Proxy for Blocks instance {@link Blocks}\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = null;\n\n /**\n * Index of current working block\n *\n * @type {number}\n * @private\n */\n this.currentBlockIndex = -1;\n\n }\n\n /**\n * Should be called after Editor.UI preparation\n * Define this._blocks property\n *\n * @returns {Promise}\n */\n prepare() {\n\n return new Promise(resolve => {\n\n let blocks = new Blocks(this.Editor.UI.nodes.redactor);\n\n /**\n * We need to use Proxy to overload set/get [] operator.\n * So we can use array-like syntax to access blocks\n *\n * @example\n * this._blocks[0] = new Block(...);\n *\n * block = this._blocks[0];\n *\n * @todo proxy the enumerate method\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = new Proxy(blocks, {\n set: Blocks.set,\n get: Blocks.get\n });\n\n resolve();\n\n });\n\n }\n\n /**\n * Creates Block instance by tool name\n *\n * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools}\n * @param {Object} data - constructor params\n *\n * @return {Block}\n */\n composeBlock(toolName, data) {\n\n let toolInstance = this.Editor.Tools.construct(toolName, data),\n block = new Block(toolName, toolInstance);\n\n this.bindEvents(block);\n\n /**\n * Apply callback before inserting html\n */\n block.call('appendCallback', {});\n\n return block;\n\n }\n\n /**\n * Bind Events\n * @param {Object} block\n */\n bindEvents(block) {\n\n this.Editor.Listeners.on(block.pluginsContent, 'keydown', (event) => this.Editor.Keyboard.blockKeydownsListener(event));\n\n }\n\n /**\n * Set's caret to the next Block\n * Before moving caret, we should check if caret position is at the end of Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n */\n navigateNext() {\n\n let caretAtEnd = this.Editor.Caret.isAtEnd;\n\n if (!caretAtEnd) {\n\n return;\n\n }\n\n let nextBlock = this.nextBlock;\n\n if (!nextBlock) {\n\n return;\n\n }\n\n this.Editor.Caret.setToBlock( nextBlock );\n\n\n }\n\n /**\n * Set's caret to the previous Block\n * Before moving caret, we should check if caret position is start of the Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n */\n navigatePrevious() {\n\n let caretAtStart = this.Editor.Caret.isAtStart;\n\n if (!caretAtStart) {\n\n return;\n\n }\n\n let previousBlock = this.previousBlock;\n\n if (!previousBlock) {\n\n return;\n\n }\n\n this.Editor.Caret.setToBlock( previousBlock, 0, true );\n\n }\n\n /**\n * Insert new block into _blocks\n *\n * @param {String} toolName — plugin name\n * @param {Object} data — plugin data\n */\n insert(toolName, data = {}) {\n\n let block = this.composeBlock(toolName, data);\n\n this._blocks[++this.currentBlockIndex] = block;\n this.Editor.Caret.setToBlock(block);\n\n }\n\n /**\n * Merge two blocks\n * @param {Block} targetBlock - previous block will be append to this block\n * @param {Block} blockToMerge - block that will be merged with target block\n *\n * @return {Promise} - the sequence that can be continued\n */\n mergeBlocks(targetBlock, blockToMerge) {\n\n let blockToMergeIndex = this._blocks.indexOf(blockToMerge);\n\n return Promise.resolve()\n .then( () => {\n\n if (blockToMerge.isEmpty) {\n\n return;\n\n }\n\n return blockToMerge.data\n .then((blockToMergeInfo) => {\n\n targetBlock.mergeWith(blockToMergeInfo.data);\n\n });\n\n })\n .then( () => {\n\n this.removeBlock(blockToMergeIndex);\n this.currentBlockIndex = this._blocks.indexOf(targetBlock);\n\n });\n\n\n }\n\n /**\n * Remove block with passed index or remove last\n * @param {Number|null} index\n */\n removeBlock(index) {\n\n this._blocks.remove(index);\n\n }\n /**\n * Split current Block\n * 1. Extract content from Caret position to the Block`s end\n * 2. Insert a new Block below current one with extracted content\n */\n split() {\n\n let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(),\n wrapper = $.make('div');\n\n wrapper.append(extractedFragment);\n\n /**\n * @todo make object in accordance with Tool\n */\n let data = {\n text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML,\n };\n\n this.insert(this.config.initialBlock, data);\n\n }\n\n /**\n * Replace current working block\n *\n * @param {String} toolName — plugin name\n * @param {Object} data — plugin data\n */\n replace(toolName, data = {}) {\n\n let block = this.composeBlock(toolName, data);\n\n this._blocks.insert(this.currentBlockIndex, block, true);\n\n }\n\n /**\n * returns last Block\n * @return {Block}\n */\n get lastBlock() {\n\n return this._blocks[this._blocks.length - 1];\n\n }\n\n /**\n * Returns Block by passed index\n * @param {Number} index\n * @return {Block}\n */\n getBlockByIndex(index) {\n\n return this._blocks[index];\n\n }\n\n /**\n * Get Block instance by html element\n * @param {HTMLElement} element\n * @returns {Block}\n */\n getBlock(element) {\n\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`),\n index = nodes.indexOf(firstLevelBlock);\n\n if (index >= 0) {\n\n return this._blocks[index];\n\n }\n\n }\n\n /**\n * Get current Block instance\n *\n * @return {Block}\n */\n get currentBlock() {\n\n return this._blocks[this.currentBlockIndex];\n\n }\n\n /**\n * Returns next Block instance\n * @return {Block|null}\n */\n get nextBlock() {\n\n let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1);\n\n if (isLastBlock) {\n\n return null;\n\n }\n\n return this._blocks[this.currentBlockIndex + 1];\n\n }\n\n /**\n * Returns previous Block instance\n * @return {Block|null}\n */\n get previousBlock() {\n\n let isFirstBlock = this.currentBlockIndex === 0;\n\n if (isFirstBlock) {\n\n return null;\n\n }\n\n return this._blocks[this.currentBlockIndex - 1];\n\n }\n\n /**\n * Get working html element\n *\n * @return {HTMLElement}\n */\n get currentNode() {\n\n return this._blocks.nodes[this.currentBlockIndex];\n\n }\n\n /**\n * Set currentBlockIndex to passed block\n * @param {HTMLElement} element\n */\n set currentNode(element) {\n\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`);\n\n /**\n * Update current Block's index\n * @type {number}\n */\n this.currentBlockIndex = nodes.indexOf(firstLevelBlock);\n\n /**\n * Remove previous selected Block's state\n */\n this._blocks.array.forEach( block => block.selected = false);\n\n /**\n * Mark current Block as selected\n * @type {boolean}\n */\n this.currentBlock.selected = true;\n\n }\n\n /**\n * Get array of Block instances\n *\n * @returns {Block[]} {@link Blocks#array}\n */\n get blocks() {\n\n return this._blocks.array;\n\n }\n\n /**\n * 1) Find first-level Block from passed child Node\n * 2) Mark it as current\n *\n * @param {Element|Text} childNode - look ahead from this node.\n * @throws Error - when passed Node is not included at the Block\n */\n setCurrentBlockByChildNode(childNode) {\n\n /**\n * If node is Text TextNode\n */\n if (!$.isElement(childNode)) {\n\n childNode = childNode.parentNode;\n\n }\n\n let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`);\n\n if (parentFirstLevelBlock) {\n\n this.currentNode = parentFirstLevelBlock;\n\n } else {\n\n throw new Error('Can not find a Block from this child Node');\n\n }\n\n }\n\n}\n\n/**\n * @class Blocks\n * @classdesc Class to work with Block instances array\n *\n * @private\n *\n * @property {HTMLElement} workingArea — editor`s working node\n *\n */\nclass Blocks {\n\n /**\n * @constructor\n *\n * @param {HTMLElement} workingArea — editor`s working node\n */\n constructor(workingArea) {\n\n this.blocks = [];\n this.workingArea = workingArea;\n\n }\n\n /**\n * Push back new Block\n *\n * @param {Block} block\n */\n push(block) {\n\n this.blocks.push(block);\n this.workingArea.appendChild(block.html);\n\n }\n\n /**\n * Insert new Block at passed index\n *\n * @param {Number} index — index to insert Block\n * @param {Block} block — Block to insert\n * @param {Boolean} replace — it true, replace block on given index\n */\n insert(index, block, replace = false) {\n\n if (!this.length) {\n\n this.push(block);\n return;\n\n }\n\n if (index > this.length) {\n\n index = this.length;\n\n }\n\n if (replace) {\n\n this.blocks[index].html.remove();\n\n }\n\n let deleteCount = replace ? 1 : 0;\n\n this.blocks.splice(index, deleteCount, block);\n\n if (index > 0) {\n\n let previousBlock = this.blocks[index - 1];\n\n previousBlock.html.insertAdjacentElement('afterend', block.html);\n\n } else {\n\n let nextBlock = this.blocks[index + 1];\n\n if (nextBlock) {\n\n nextBlock.html.insertAdjacentElement('beforebegin', block.html);\n\n } else {\n\n this.workingArea.appendChild(block.html);\n\n }\n\n }\n\n }\n\n /**\n * Remove block\n * @param {Number|null} index\n */\n remove(index) {\n\n if (!index) {\n\n index = this.length - 1;\n\n }\n\n this.blocks[index].html.remove();\n this.blocks.splice(index, 1);\n\n }\n\n /**\n * Insert Block after passed target\n *\n * @todo decide if this method is necessary\n *\n * @param {Block} targetBlock — target after wich Block should be inserted\n * @param {Block} newBlock — Block to insert\n */\n insertAfter(targetBlock, newBlock) {\n\n let index = this.blocks.indexOf(targetBlock);\n\n this.insert(index + 1, newBlock);\n\n }\n\n /**\n * Get Block by index\n *\n * @param {Number} index — Block index\n * @returns {Block}\n */\n get(index) {\n\n return this.blocks[index];\n\n }\n\n /**\n * Return index of passed Block\n *\n * @param {Block} block\n * @returns {Number}\n */\n indexOf(block) {\n\n return this.blocks.indexOf(block);\n\n }\n\n /**\n * Get length of Block instances array\n *\n * @returns {Number}\n */\n get length() {\n\n return this.blocks.length;\n\n }\n\n /**\n * Get Block instances array\n *\n * @returns {Block[]}\n */\n get array() {\n\n return this.blocks;\n\n }\n\n /**\n * Get blocks html elements array\n *\n * @returns {HTMLElement[]}\n */\n get nodes() {\n\n return _.array(this.workingArea.children);\n\n }\n\n /**\n * Proxy trap to implement array-like setter\n *\n * @example\n * blocks[0] = new Block(...)\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — block index\n * @param {Block} block — Block to set\n * @returns {Boolean}\n */\n static set(instance, index, block) {\n\n if (isNaN(Number(index))) {\n\n return false;\n\n }\n\n instance.insert(index, block);\n\n return true;\n\n }\n\n /**\n * Proxy trap to implement array-like getter\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — Block index\n * @returns {Block|*}\n */\n static get(instance, index) {\n\n if (isNaN(Number(index))) {\n\n return instance[index];\n\n }\n\n return instance.get(index);\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/blockManager.js","/**\n *\n * @class Block\n * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool\n *\n * @property {Tool} tool — current block tool (Paragraph, for example)\n * @property {Object} CSS — block`s css classes\n *\n */\n\n/**\n * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance\n *\n * @property tool - Tool instance\n * @property html - Returns HTML content of plugin\n * @property wrapper - Div element that wraps block content with Tool's content. Has `ce-block` CSS class\n * @property contentNode - Div element that wraps Tool's content. Has `ce-block__content` CSS class\n * @property pluginsContent - HTML content that returns by Tool's render function\n */\nexport default class Block {\n\n /**\n * @constructor\n * @param {String} toolName - Tool name that passed on initialization\n * @param {Object} toolInstance — passed Tool`s instance that rendered the Block\n */\n constructor(toolName, toolInstance) {\n\n this.name = toolName;\n this.tool = toolInstance;\n this._html = this.compose();\n\n }\n\n /**\n * CSS classes for the Block\n * @return {{wrapper: string, content: string}}\n */\n static get CSS() {\n\n return {\n wrapper: 'ce-block',\n content: 'ce-block__content',\n selected: 'ce-block--selected'\n };\n\n }\n\n /**\n * Make default Block wrappers and put Tool`s content there\n * @returns {HTMLDivElement}\n */\n compose() {\n\n this.wrapper = $.make('div', Block.CSS.wrapper);\n this.contentNode = $.make('div', Block.CSS.content);\n this.pluginsContent = this.tool.render();\n\n this.contentNode.appendChild(this.pluginsContent);\n this.wrapper.appendChild(this.contentNode);\n\n return this.wrapper;\n\n }\n\n /**\n * Calls Tool's method\n *\n * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function\n *\n * @param {String} methodName\n * @param {Object} params\n */\n call(methodName, params) {\n\n /**\n * call Tool's method with the instance context\n */\n if (this.tool[methodName] && this.tool[methodName] instanceof Function) {\n\n this.tool[methodName].call(this.tool, params);\n\n }\n\n }\n\n /**\n * Get Block`s HTML\n * @returns {HTMLElement}\n */\n get html() {\n\n return this._html;\n\n }\n\n /**\n * Get Block's JSON data\n * @return {Object}\n */\n get data() {\n\n return this.save();\n\n }\n\n /**\n * is block mergeable\n * We plugin have merge function then we call it mergable\n * @return {boolean}\n */\n get mergeable() {\n\n return typeof this.tool.merge === 'function';\n\n }\n\n /**\n * Call plugins merge method\n * @param {Object} data\n */\n mergeWith(data) {\n\n return Promise.resolve()\n .then(() => {\n\n this.tool.merge(data);\n\n });\n\n }\n /**\n * Extracts data from Block\n * Groups Tool's save processing time\n * @return {Object}\n */\n save() {\n\n let extractedBlock = this.tool.save(this.pluginsContent);\n\n /** Measuring execution time*/\n let measuringStart = window.performance.now(),\n measuringEnd;\n\n return Promise.resolve(extractedBlock)\n .then((finishedExtraction) => {\n\n /** measure promise execution */\n measuringEnd = window.performance.now();\n\n return {\n tool: this.name,\n data: finishedExtraction,\n time : measuringEnd - measuringStart\n };\n\n })\n .catch(function (error) {\n\n _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red');\n\n });\n\n }\n\n /**\n * Uses Tool's validation method to check the correctness of output data\n * Tool's validation method is optional\n *\n * @description Method also can return data if it passed the validation\n *\n * @param {Object} data\n * @returns {Boolean|Object} valid\n */\n validateData(data) {\n\n let isValid = true;\n\n if (this.tool.validate instanceof Function) {\n\n isValid = this.tool.validate(data);\n\n }\n\n if (!isValid) {\n\n return false;\n\n }\n\n return data;\n\n }\n\n /**\n * Check block for emptiness\n * @return {Boolean}\n */\n get isEmpty() {\n\n /**\n * Allow Tool to represent decorative contentless blocks: for example \"* * *\"-tool\n * That Tools are not empty\n */\n if (this.tool.contentless) {\n\n return false;\n\n }\n\n let emptyText = $.isEmpty(this.pluginsContent),\n emptyMedia = !this.hasMedia;\n\n return emptyText && emptyMedia;\n\n }\n\n /**\n * Check if block has a media content such as images, iframes and other\n * @return {Boolean}\n */\n get hasMedia() {\n\n /**\n * This tags represents media-content\n * @type {string[]}\n */\n const mediaTags = [\n 'img',\n 'iframe',\n 'video',\n 'audio',\n 'source',\n 'input',\n 'textarea',\n 'twitterwidget'\n ];\n\n return !!this._html.querySelector(mediaTags.join(','));\n\n }\n\n /**\n * Set selected state\n * @param {Boolean} state - 'true' to select, 'false' to remove selection\n */\n set selected(state) {\n\n /**\n * We don't need to mark Block as Selected when it is not empty\n */\n if (state === true && !this.isEmpty) {\n\n this._html.classList.add(Block.CSS.selected);\n\n } else {\n\n this._html.classList.remove(Block.CSS.selected);\n\n }\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/block.js","/**\n * @class Caret\n * @classdesc Contains methods for working Caret\n *\n * Uses Range methods to manipulate with caret\n *\n * @module Caret\n *\n * @version 2.0.0\n */\n\n/**\n * @typedef {Caret} Caret\n */\nimport Selection from '../Selection';\n\nexport default class Caret extends Module {\n\n /**\n * @constructor\n */\n constructor({config}) {\n\n super({config});\n\n }\n\n /**\n * Method gets Block instance and puts caret to the text node with offset\n * There two ways that method applies caret position:\n * - first found text node: sets at the beginning, but you can pass an offset\n * - last found text node: sets at the end of the node. Also, you can customize the behaviour\n *\n * @param {Block} block - Block class\n * @param {Number} offset - caret offset regarding to the text node\n * @param {Boolean} atEnd - put caret at the end of the text node or not\n */\n setToBlock(block, offset = 0, atEnd = false) {\n\n let element = block.pluginsContent;\n\n /** If Element is INPUT */\n if ($.isNativeInput(element)) {\n\n element.focus();\n return;\n\n }\n\n let nodeToSet = $.getDeepestNode(element, atEnd);\n\n if (atEnd || offset > nodeToSet.length) {\n\n offset = nodeToSet.length;\n\n }\n\n /** if found deepest node is native input */\n if ($.isNativeInput(nodeToSet)) {\n\n nodeToSet.focus();\n return;\n\n }\n\n /**\n * @todo try to fix via Promises or use querySelectorAll to not to use timeout\n */\n _.delay( () => {\n\n this.set(nodeToSet, offset);\n\n }, 20)();\n\n this.Editor.BlockManager.currentNode = block.wrapper;\n\n }\n\n /**\n * Creates Document Range and sets caret to the element with offset\n * @param {Element} element - target node.\n * @param {Number} offset - offset\n */\n set( element, offset = 0) {\n\n let range = document.createRange(),\n selection = Selection.get();\n\n range.setStart(element, offset);\n range.setEnd(element, offset);\n\n selection.removeAllRanges();\n selection.addRange(range);\n\n };\n\n /**\n * Set Caret to the last Block\n * If last block is not empty, append another empty block\n */\n setToTheLastBlock() {\n\n let lastBlock = this.Editor.BlockManager.lastBlock;\n\n if (!lastBlock) return;\n\n /**\n * If last block is empty and it is an initialBlock, set to that.\n * Otherwise, append new empty block and set to that\n */\n if (lastBlock.isEmpty) {\n\n this.setToBlock(lastBlock);\n\n } else {\n\n this.Editor.BlockManager.insert(this.config.initialBlock);\n\n }\n\n }\n\n /**\n * Extract content fragment of current Block from Caret position to the end of the Block\n */\n extractFragmentFromCaretPosition() {\n\n let selection = Selection.get();\n\n if (selection.rangeCount) {\n\n let selectRange = selection.getRangeAt(0),\n blockElem = this.Editor.BlockManager.currentBlock.pluginsContent;\n\n selectRange.deleteContents();\n\n if (blockElem) {\n\n let range = selectRange.cloneRange(true);\n\n range.selectNodeContents(blockElem);\n range.setStart(selectRange.endContainer, selectRange.endOffset);\n return range.extractContents();\n\n }\n\n }\n\n }\n\n /**\n * Get all first-level (first child of [contenteditabel]) siblings from passed node\n * Then you can check it for emptiness\n *\n * @example\n * \n *\n * @return {Element[]}\n */\n getHigherLevelSiblings(from, direction ) {\n\n let current = from,\n siblings = [];\n\n /**\n * Find passed node's firs-level parent (in example - blockquote)\n */\n while (current.parentNode && current.parentNode.contentEditable !== 'true') {\n\n current = current.parentNode;\n\n }\n\n let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling';\n\n /**\n * Find all left/right siblings\n */\n while (current[sibling]) {\n\n current = current[sibling];\n siblings.push(current);\n\n }\n\n return siblings;\n\n }\n\n /**\n * Get's deepest first node and checks if offset is zero\n * @return {boolean}\n */\n get isAtStart() {\n\n /**\n * Don't handle ranges\n */\n if (!Selection.isCollapsed) {\n\n return false;\n\n }\n\n let selection = Selection.get(),\n anchorNode = selection.anchorNode,\n firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent);\n\n /**\n * Workaround case when caret in the text like \" |Hello!\"\n * selection.anchorOffset is 1, but real caret visible position is 0\n * @type {number}\n */\n let firstLetterPosition = anchorNode.textContent.search(/\\S/);\n\n if (firstLetterPosition === -1) { // empty text\n\n firstLetterPosition = 0;\n\n }\n\n /**\n * In case of\n *
\n *

<-- first (and deepest) node is \n * |adaddad <-- anchor node\n *
\n */\n if ($.isEmpty(firstNode)) {\n\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'),\n nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) );\n\n\n\n if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) {\n\n return true;\n\n }\n\n }\n\n return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition;\n\n }\n\n /**\n * Get's deepest last node and checks if offset is last node text length\n * @return {boolean}\n */\n get isAtEnd() {\n\n /**\n * Don't handle ranges\n */\n if (!Selection.isCollapsed) {\n\n return false;\n\n }\n\n let selection = Selection.get(),\n anchorNode = selection.anchorNode,\n lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true);\n\n /**\n * In case of\n *
\n * adaddad| <-- anchor node\n *

<-- first (and deepest) node is \n *
\n */\n if ($.isEmpty(lastNode)) {\n\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'),\n nothingAtRight = leftSiblings.every( node => $.isEmpty(node) );\n\n if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) {\n\n return true;\n\n }\n\n }\n\n return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length;\n\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/caret.js","/**\n * Working with selection\n */\nexport default class Selection {\n\n /**\n * @constructor\n */\n constructor() {\n\n this.instance = null;\n this.selection = null;\n\n }\n\n /**\n * Returns window Selection\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection}\n * @return {Selection}\n */\n static get() {\n\n return window.getSelection();\n\n }\n\n /**\n * Returns selected anchor\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode}\n * @return {Node|null}\n */\n static getAnchorNode() {\n\n let selection = window.getSelection();\n\n return selection ? selection.anchorNode : null;\n\n }\n\n /**\n * Returns selection offset according to the anchor node\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset}\n * @return {Number|null}\n */\n static getAnchorOffset() {\n\n let selection = window.getSelection();\n\n return selection ? selection.anchorOffset : null;\n\n }\n\n /**\n * Is current selection range collapsed\n * @return {boolean|null}\n */\n static get isCollapsed() {\n\n let selection = window.getSelection();\n\n return selection ? selection.isCollapsed : null;\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/Selection.js","/**\n * @module eventDispatcher\n *\n * Has two important methods:\n * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one\n * - {Function} emit - fires all subscribers with data\n *\n * @version 1.0.0\n *\n * @typedef {Events} Events\n * @property {Object} subscribers - all subscribers grouped by event name\n */\nexport default class Events extends Module {\n\n /**\n * @constructor\n */\n constructor({config}) {\n\n super({config});\n this.subscribers = {};\n\n }\n\n /**\n * @param {String} eventName - event name\n * @param {Function} callback - subscriber\n */\n on(eventName, callback) {\n\n if (!(eventName in this.subscribers)) {\n\n this.subscribers[eventName] = [];\n\n }\n\n // group by events\n this.subscribers[eventName].push(callback);\n\n }\n\n /**\n * @param {String} eventName - event name\n * @param {Object} data - subscribers get this data when they were fired\n */\n emit(eventName, data) {\n\n this.subscribers[eventName].reduce(function (previousData, currentHandler) {\n\n let newData = currentHandler(previousData);\n\n return newData ? newData : previousData;\n\n }, data);\n\n }\n\n /**\n * Destroyer\n * clears subsribers list\n */\n destroy() {\n\n this.subscribers = null;\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/events.js","/**\n * @class Keyboard\n * @classdesc Сlass to handle the keydowns\n *\n * @author CodeX Team (team@ifmo.su)\n * @copyright CodeX Team 2017\n * @license The MIT License (MIT)\n * @version 1.0.0\n */\n\n/**\n * @typedef {Keyboard} Keyboard\n */\nexport default class Keyboard extends Module {\n\n /**\n * @constructor\n */\n constructor({config}) {\n\n super({config});\n\n }\n\n /**\n * Handler on Block for keyboard keys at keydown event\n *\n * @param {KeyboardEvent} event\n */\n blockKeydownsListener(event) {\n\n switch(event.keyCode) {\n\n case _.keyCodes.BACKSPACE:\n\n _.log('Backspace key pressed');\n this.backspacePressed(event);\n break;\n\n case _.keyCodes.ENTER:\n\n _.log('Enter key pressed');\n this.enterPressed(event);\n break;\n\n case _.keyCodes.DOWN:\n case _.keyCodes.RIGHT:\n\n _.log('Right/Down key pressed');\n this.arrowRightAndDownPressed();\n break;\n\n case _.keyCodes.UP:\n case _.keyCodes.LEFT:\n\n _.log('Left/Up key pressed');\n this.arrowLeftAndUpPressed();\n break;\n\n default:\n\n break;\n\n }\n\n }\n\n /**\n * Handle pressing enter key\n *\n * @param {KeyboardEvent} event\n */\n enterPressed(event) {\n\n let currentBlock = this.Editor.BlockManager.currentBlock,\n toolsConfig = this.config.toolsConfig[currentBlock.name];\n\n /**\n * Don't handle Enter keydowns when Tool sets enableLineBreaks to true.\n * Uses for Tools like where line breaks should be handled by default behaviour.\n */\n if (toolsConfig && toolsConfig.enableLineBreaks) {\n\n return;\n\n }\n\n /**\n * Allow to create linebreaks by Shift+Enter\n */\n if (event.shiftKey) {\n\n return;\n\n }\n\n\n /**\n * Split the Current Block into two blocks\n */\n this.Editor.BlockManager.split();\n event.preventDefault();\n\n }\n\n /**\n * Handle backspace keypress on block\n * @param {KeyboardEvent} event - keydown\n */\n backspacePressed(event) {\n\n const BM = this.Editor.BlockManager;\n\n let isFirstBlock = BM.currentBlockIndex === 0,\n canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock;\n\n if (!canMergeBlocks) {\n\n return;\n\n }\n\n // preventing browser default behaviour\n event.preventDefault();\n\n let targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1),\n blockToMerge = BM.currentBlock;\n\n /**\n * Blocks that can be merged:\n * 1) with the same Name\n * 2) Tool has 'merge' method\n *\n * other case will handle as usual ARROW LEFT behaviour\n */\n if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) {\n\n BM.navigatePrevious();\n\n }\n\n let setCaretToTheEnd = !targetBlock.isEmpty ? true : false;\n\n BM.mergeBlocks(targetBlock, blockToMerge)\n .then( () => {\n\n window.setTimeout( () => {\n\n // set caret to the block without offset at the end\n this.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd);\n this.Editor.Toolbar.close();\n\n }, 10);\n\n });\n\n }\n\n /**\n * Handle right and down keyboard keys\n */\n arrowRightAndDownPressed() {\n\n this.Editor.BlockManager.navigateNext();\n\n }\n\n /**\n * Handle left and up keyboard keys\n */\n arrowLeftAndUpPressed() {\n\n this.Editor.BlockManager.navigatePrevious();\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/keyboard.js","/**\n * Codex Editor Listeners module\n *\n * @module Listeners\n *\n * Module-decorator for event listeners assignment\n *\n * @author Codex Team\n * @version 2.0.0\n */\n\n/**\n * @typedef {Listeners} Listeners\n * @property {Array} allListeners\n */\n\nexport default class Listeners extends Module {\n\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n\n super({config});\n this.allListeners = [];\n\n }\n\n /**\n * Assigns event listener on element\n *\n * @param {Element} element - DOM element that needs to be listened\n * @param {String} eventType - event type\n * @param {Function} handler - method that will be fired on event\n * @param {Boolean} useCapture - use event bubbling\n */\n on(element, eventType, handler, useCapture = false) {\n\n let assignedEventData = {\n element,\n eventType,\n handler,\n useCapture\n };\n\n let alreadyExist = this.findOne(element, eventType, handler);\n\n if (alreadyExist) return;\n\n this.allListeners.push(assignedEventData);\n element.addEventListener(eventType, handler, useCapture);\n\n }\n\n /**\n * Removes event listener from element\n *\n * @param {Element} element - DOM element that we removing listener\n * @param {String} eventType - event type\n * @param {Function} handler - remove handler, if element listens several handlers on the same event type\n * @param {Boolean} useCapture - use event bubbling\n */\n off(element, eventType, handler, useCapture = false) {\n\n let existingListeners = this.findAll(element, eventType, handler);\n\n for (let i = 0; i < existingListeners.length; i++) {\n\n let index = this.allListeners.indexOf(existingListeners[i]);\n\n if (index > 0) {\n\n this.allListeners.splice(index, 1);\n\n }\n\n }\n\n element.removeEventListener(eventType, handler, useCapture);\n\n\n }\n\n /**\n * Search method: looks for listener by passed element\n * @param {Element} element - searching element\n * @returns {Array} listeners that found on element\n */\n findByElement(element) {\n\n let listenersOnElement = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n\n let listener = this.allListeners[i];\n\n if (listener.element === element) {\n\n listenersOnElement.push(listener);\n\n }\n\n }\n\n return listenersOnElement;\n\n }\n\n /**\n * Search method: looks for listener by passed event type\n * @param {String} eventType\n * @return {Array} listeners that found on element\n */\n findByType(eventType) {\n\n let listenersWithType = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n\n let listener = this.allListeners[i];\n\n if (listener.type === eventType) {\n\n listenersWithType.push(listener);\n\n }\n\n }\n\n return listenersWithType;\n\n }\n\n /**\n * Search method: looks for listener by passed handler\n * @param {Function} handler\n * @return {Array} listeners that found on element\n */\n findByHandler(handler) {\n\n let listenersWithHandler = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n\n let listener = this.allListeners[i];\n\n if (listener.handler === handler) {\n\n listenersWithHandler.push(listener);\n\n }\n\n }\n\n return listenersWithHandler;\n\n }\n\n /**\n * @param {Element} element\n * @param {String} eventType\n * @param {Function} handler\n * @return {Element|null}\n */\n findOne(element, eventType, handler) {\n\n let foundListeners = this.findAll(element, eventType, handler);\n\n return foundListeners.length > 0 ? foundListeners[0] : null;\n\n }\n\n /**\n * @param {Element} element\n * @param {String} eventType\n * @param {Function} handler\n * @return {Array}\n */\n findAll(element, eventType, handler) {\n\n let foundAllListeners,\n foundByElements = [],\n foundByEventType = [],\n foundByHandler = [];\n\n if (element)\n foundByElements = this.findByElement(element);\n\n if (eventType)\n foundByEventType = this.findByType(eventType);\n\n if (handler)\n foundByHandler = this.findByHandler(handler);\n\n foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler);\n\n return foundAllListeners;\n\n }\n\n /**\n * Removes all listeners\n */\n removeAll() {\n\n this.allListeners.map( (current) => {\n\n current.element.removeEventListener(current.eventType, current.handler);\n\n });\n\n this.allListeners = [];\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/listeners.js","/**\n * Codex Editor Renderer Module\n *\n * @module Renderer\n * @author CodeX Team\n *\n * @version 2.0.0\n */\nexport default class Renderer extends Module {\n\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n\n super({config});\n\n }\n\n /**\n * @typedef {Object} RendererItems\n * @property {String} type - tool name\n * @property {Object} data - tool data\n */\n\n /**\n * @example\n *\n * items: [\n * {\n * type : 'paragraph',\n * data : {\n * text : 'Hello from Codex!'\n * }\n * },\n * {\n * type : 'paragraph',\n * data : {\n * text : 'Leave feedback if you like it!'\n * }\n * },\n * ]\n *\n */\n\n /**\n * Make plugin blocks from array of plugin`s data\n * @param {RendererItems[]} items\n */\n render(items) {\n\n let chainData = [];\n\n for (let i = 0; i < items.length; i++) {\n\n chainData.push({\n function: () => this.insertBlock(items[i])\n });\n\n }\n\n return _.sequence(chainData);\n\n }\n\n /**\n * Get plugin instance\n * Add plugin instance to BlockManager\n * Insert block to working zone\n *\n * @param {Object} item\n * @returns {Promise.}\n * @private\n */\n insertBlock(item) {\n\n let tool = item.type,\n data = item.data;\n\n this.Editor.BlockManager.insert(tool, data);\n\n return Promise.resolve();\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/renderer.js","/**\n * CodeX Sanitizer\n *\n * @module Sanitizer\n * Clears HTML from taint tags\n *\n * @version 2.0.0\n *\n * @example\n * Module can be used within two ways:\n * 1) When you have an instance\n * - this.Editor.Sanitizer.clean(yourTaintString);\n * 2) As static method\n * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration);\n *\n * {@link SanitizerConfig}\n */\n\n\n/**\n * @typedef {Object} SanitizerConfig\n * @property {Object} tags - define tags restrictions\n *\n * @example\n *\n * tags : {\n * p: true,\n * a: {\n * href: true,\n * rel: \"nofollow\",\n * target: \"_blank\"\n * }\n * }\n */\nexport default class Sanitizer extends Module {\n\n /**\n * Initializes Sanitizer module\n * Sets default configuration if custom not exists\n *\n * @property {SanitizerConfig} this.defaultConfig\n * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library\n *\n * @param {SanitizerConfig} config\n */\n constructor({config}) {\n\n super({config});\n\n // default config\n this.defaultConfig = null;\n this._sanitizerInstance = null;\n\n /** Custom configuration */\n this.sanitizerConfig = config.settings ? config.settings.sanitizer : {};\n\n /** HTML Janitor library */\n this.sanitizerInstance = require('html-janitor');\n\n }\n\n /**\n * If developer uses editor's API, then he can customize sanitize restrictions.\n * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere\n * At least, if there is no config overrides, that API uses Default configuration\n *\n * @uses https://www.npmjs.com/package/html-janitor\n *\n * @param {HTMLJanitor} library - sanitizer extension\n */\n set sanitizerInstance(library) {\n\n this._sanitizerInstance = new library(this.defaultConfig);\n\n }\n\n /**\n * Sets sanitizer configuration. Uses default config if user didn't pass the restriction\n * @param {SanitizerConfig} config\n */\n set sanitizerConfig(config) {\n\n if (_.isEmpty(config)) {\n\n this.defaultConfig = {\n tags: {\n p: {},\n a: {\n href: true,\n target: '_blank',\n rel: 'nofollow'\n }\n }\n };\n\n } else {\n\n this.defaultConfig = config;\n\n }\n\n }\n\n /**\n * Cleans string from unwanted tags\n * @param {String} taintString - HTML string\n * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty\n * @return {String} clean HTML\n */\n clean(taintString, customConfig = {}) {\n\n if (_.isEmpty(customConfig)) {\n\n return this._sanitizerInstance.clean(taintString);\n\n } else {\n\n return Sanitizer.clean(taintString, customConfig);\n\n }\n\n\n }\n\n /**\n * Cleans string from unwanted tags\n * @static\n *\n * Method allows to use default config\n *\n * @param {String} taintString - taint string\n * @param {SanitizerConfig} customConfig - allowed tags\n *\n * @return {String} clean HTML\n */\n static clean(taintString, customConfig) {\n\n let newInstance = Sanitizer(customConfig);\n\n return newInstance.clean(taintString);\n\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/sanitizer.js","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('html-janitor', factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.HTMLJanitor = factory();\n }\n}(this, function () {\n\n /**\n * @param {Object} config.tags Dictionary of allowed tags.\n * @param {boolean} config.keepNestedBlockElements Default false.\n */\n function HTMLJanitor(config) {\n\n var tagDefinitions = config['tags'];\n var tags = Object.keys(tagDefinitions);\n\n var validConfigValues = tags\n .map(function(k) { return typeof tagDefinitions[k]; })\n .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; });\n\n if(!validConfigValues) {\n throw new Error(\"The configuration was invalid\");\n }\n\n this.config = config;\n }\n\n // TODO: not exhaustive?\n var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE'];\n function isBlockElement(node) {\n return blockElementNames.indexOf(node.nodeName) !== -1;\n }\n\n var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE'];\n function isInlineElement(node) {\n return inlineElementNames.indexOf(node.nodeName) !== -1;\n }\n\n HTMLJanitor.prototype.clean = function (html) {\n var sandbox = document.createElement('div');\n sandbox.innerHTML = html;\n\n this._sanitize(sandbox);\n\n return sandbox.innerHTML;\n };\n\n HTMLJanitor.prototype._sanitize = function (parentNode) {\n var treeWalker = createTreeWalker(parentNode);\n var node = treeWalker.firstChild();\n if (!node) { return; }\n\n do {\n // Ignore nodes that have already been sanitized\n if (node._sanitized) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n // If this text node is just whitespace and the previous or next element\n // sibling is a block element, remove it\n // N.B.: This heuristic could change. Very specific to a bug with\n // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output\n // FIXME: make this an option?\n if (node.data.trim() === ''\n && ((node.previousElementSibling && isBlockElement(node.previousElementSibling))\n || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n } else {\n continue;\n }\n }\n\n // Remove all comments\n if (node.nodeType === Node.COMMENT_NODE) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n }\n\n var isInline = isInlineElement(node);\n var containsBlockElement;\n if (isInline) {\n containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement);\n }\n\n // Block elements should not be nested (e.g.
  • ...); if\n // they are, we want to unwrap the inner block element.\n var isNotTopContainer = !! parentNode.parentNode;\n var isNestedBlockElement =\n isBlockElement(parentNode) &&\n isBlockElement(node) &&\n isNotTopContainer;\n\n var nodeName = node.nodeName.toLowerCase();\n\n var allowedAttrs = getAllowedAttrs(this.config, nodeName, node);\n\n var isInvalid = isInline && containsBlockElement;\n\n // Drop tag entirely according to the whitelist *and* if the markup\n // is invalid.\n if (isInvalid || shouldRejectNode(node, allowedAttrs)\n || (!this.config.keepNestedBlockElements && isNestedBlockElement)) {\n // Do not keep the inner text of SCRIPT/STYLE elements.\n if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) {\n while (node.childNodes.length > 0) {\n parentNode.insertBefore(node.childNodes[0], node);\n }\n }\n parentNode.removeChild(node);\n\n this._sanitize(parentNode);\n break;\n }\n\n // Sanitize attributes\n for (var a = 0; a < node.attributes.length; a += 1) {\n var attr = node.attributes[a];\n\n if (shouldRejectAttr(attr, allowedAttrs, node)) {\n node.removeAttribute(attr.name);\n // Shift the array to continue looping.\n a = a - 1;\n }\n }\n\n // Sanitize children\n this._sanitize(node);\n\n // Mark node as sanitized so it's ignored in future runs\n node._sanitized = true;\n } while ((node = treeWalker.nextSibling()));\n };\n\n function createTreeWalker(node) {\n return document.createTreeWalker(node,\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n null, false);\n }\n\n function getAllowedAttrs(config, nodeName, node){\n if (typeof config.tags[nodeName] === 'function') {\n return config.tags[nodeName](node);\n } else {\n return config.tags[nodeName];\n }\n }\n\n function shouldRejectNode(node, allowedAttrs){\n if (typeof allowedAttrs === 'undefined') {\n return true;\n } else if (typeof allowedAttrs === 'boolean') {\n return !allowedAttrs;\n }\n\n return false;\n }\n\n function shouldRejectAttr(attr, allowedAttrs, node){\n var attrName = attr.name.toLowerCase();\n\n if (allowedAttrs === true){\n return false;\n } else if (typeof allowedAttrs[attrName] === 'function'){\n return !allowedAttrs[attrName](attr.value, node);\n } else if (typeof allowedAttrs[attrName] === 'undefined'){\n return true;\n } else if (allowedAttrs[attrName] === false) {\n return true;\n } else if (typeof allowedAttrs[attrName] === 'string') {\n return (allowedAttrs[attrName] !== attr.value);\n }\n\n return false;\n }\n\n return HTMLJanitor;\n\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/html-janitor/src/html-janitor.js\n// module id = 15\n// module chunks = 0","/**\n * Codex Editor Saver\n *\n * @module Saver\n * @author Codex Team\n * @version 2.0.0\n */\n\n/**\n * @typedef {Object} SavedData\n * @property {Date} time - saving proccess time\n * @property {Object} items - extracted data\n * @property {String} version - CodexEditor version\n */\n\n/**\n * @classdesc This method reduces all Blocks asyncronically and calls Block's save method to extract data\n *\n * @typedef {Saver} Saver\n * @property {Element} html - Editor HTML content\n * @property {String} json - Editor JSON output\n */\n\nexport default class Saver extends Module {\n\n /**\n * @constructor\n * @param config\n */\n constructor({config}) {\n\n super({config});\n\n this.output = null;\n this.blocksData = [];\n\n }\n\n /**\n * Composes new chain of Promises to fire them alternatelly\n * @return {SavedData}\n */\n save() {\n\n let blocks = this.Editor.BlockManager.blocks,\n chainData = [];\n\n blocks.forEach((block) => {\n\n chainData.push(block.data);\n\n });\n\n return Promise.all(chainData)\n .then((allExtractedData) => this.makeOutput(allExtractedData))\n .then((outputData) => {\n\n return outputData;\n\n });\n\n }\n\n /**\n * Creates output object with saved data, time and version of editor\n * @param {Object} allExtractedData\n * @return {SavedData}\n */\n makeOutput(allExtractedData) {\n\n let items = [],\n totalTime = 0;\n\n console.groupCollapsed('[CodexEditor saving]:');\n\n allExtractedData.forEach((extraction, index) => {\n\n /** Group process info */\n console.log(`«${extraction.tool}» saving info`, extraction);\n totalTime += extraction.time;\n items.push(extraction.data);\n\n });\n\n console.log('Total', totalTime);\n console.groupEnd();\n\n return {\n time : +new Date(),\n items : items,\n version : VERSION,\n };\n\n }\n\n}\n\n// module.exports = (function (saver) {\n//\n// let editor = codex.editor;\n//\n// /**\n// * @public\n// * Save blocks\n// */\n// saver.save = function () {\n//\n// /** Save html content of redactor to memory */\n// editor.state.html = editor.nodes.redactor.innerHTML;\n//\n// /** Clean jsonOutput state */\n// editor.state.jsonOutput = [];\n//\n// return saveBlocks(editor.nodes.redactor.childNodes);\n//\n// };\n//\n// /**\n// * @private\n// * Save each block data\n// *\n// * @param blocks\n// * @returns {Promise.}\n// */\n// let saveBlocks = function (blocks) {\n//\n// let data = [];\n//\n// for(let index = 0; index < blocks.length; index++) {\n//\n// data.push(getBlockData(blocks[index]));\n//\n// }\n//\n// return Promise.all(data)\n// .then(makeOutput)\n// .catch(editor.core.log);\n//\n// };\n//\n// /** Save and validate block data */\n// let getBlockData = function (block) {\n//\n// return saveBlockData(block)\n// .then(validateBlockData)\n// .catch(editor.core.log);\n//\n// };\n//\n// /**\n// * @private\n// * Call block`s plugin save method and return saved data\n// *\n// * @param block\n// * @returns {Object}\n// */\n// let saveBlockData = function (block) {\n//\n// let pluginName = block.dataset.tool;\n//\n// /** Check for plugin existence */\n// if (!editor.tools[pluginName]) {\n//\n// editor.core.log(`Plugin «${pluginName}» not found`, 'error');\n// return {data: null, pluginName: null};\n//\n// }\n//\n// /** Check for plugin having save method */\n// if (typeof editor.tools[pluginName].save !== 'function') {\n//\n// editor.core.log(`Plugin «${pluginName}» must have save method`, 'error');\n// return {data: null, pluginName: null};\n//\n// }\n//\n// /** Result saver */\n// let blockContent = block.childNodes[0],\n// pluginsContent = blockContent.childNodes[0],\n// position = pluginsContent.dataset.inputPosition;\n//\n// /** If plugin wasn't available then return data from cache */\n// if ( editor.tools[pluginName].available === false ) {\n//\n// return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName});\n//\n// }\n//\n// return Promise.resolve(pluginsContent)\n// .then(editor.tools[pluginName].save)\n// .then(data => Object({data, pluginName}));\n//\n// };\n//\n// /**\n// * Call plugin`s validate method. Return false if validation failed\n// *\n// * @param data\n// * @param pluginName\n// * @returns {Object|Boolean}\n// */\n// let validateBlockData = function ({data, pluginName}) {\n//\n// if (!data || !pluginName) {\n//\n// return false;\n//\n// }\n//\n// if (editor.tools[pluginName].validate) {\n//\n// let result = editor.tools[pluginName].validate(data);\n//\n// /**\n// * Do not allow invalid data\n// */\n// if (!result) {\n//\n// return false;\n//\n// }\n//\n// }\n//\n// return {data, pluginName};\n//\n//\n// };\n//\n// /**\n// * Compile article output\n// *\n// * @param savedData\n// * @returns {{time: number, version, items: (*|Array)}}\n// */\n// let makeOutput = function (savedData) {\n//\n// savedData = savedData.filter(blockData => blockData);\n//\n// let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data}));\n//\n// editor.state.jsonOutput = items;\n//\n// return {\n// id: editor.state.blocks.id || null,\n// time: +new Date(),\n// version: editor.version,\n// items\n// };\n//\n// };\n//\n// return saver;\n//\n// })({});\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/saver.js","/**\n * Block Settings\n *\n * ____ Settings Panel ____\n * | ...................... |\n * | . Tool Settings . |\n * | ...................... |\n * | . Default Settings . |\n * | ...................... |\n * |________________________|\n */\nexport default class BlockSettings extends Module {\n\n constructor({config}) {\n\n super({config});\n\n this.nodes = {\n wrapper: null,\n toolSettings: null,\n defaultSettings: null,\n buttonRemove: null\n };\n\n }\n\n /**\n * Block Settings CSS\n * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}}\n */\n static get CSS() {\n\n return {\n // Settings Panel\n wrapper: 'ce-settings',\n wrapperOpened: 'ce-settings--opened',\n toolSettings: 'ce-settings__plugin-zone',\n defaultSettings: 'ce-settings__default-zone',\n\n button: 'ce-settings__button'\n };\n\n }\n\n /**\n * Panel with block settings with 2 sections:\n * - Tool's Settings\n * - Default Settings [Move, Remove, etc]\n *\n * @return {Element}\n */\n make() {\n\n this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper);\n\n this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings);\n this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings);\n\n $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]);\n\n /**\n * Add default settings that presents for all Blocks\n */\n this.addDefaultSettings();\n\n }\n\n /**\n * Add Tool's settings\n */\n addToolSettings() {\n\n console.log('Block Settings: add settings for ',\n this.Editor.BlockManager.currentBlock\n );\n\n\n }\n\n /**\n * Add default settings\n */\n addDefaultSettings() {\n\n /**\n * Remove Block Button\n * --------------------------------------------\n */\n this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, {\n textContent: 'Remove Block'\n });\n\n $.append(this.nodes.defaultSettings, this.nodes.buttonRemove);\n\n this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', (event) => this.removeBlockButtonClicked(event));\n\n }\n\n /**\n * Clicks on the Remove Block Button\n */\n removeBlockButtonClicked() {\n\n console.log('❇️ Remove Block Button clicked');\n\n }\n\n /**\n * Is Block Settings opened or not\n * @returns {boolean}\n */\n get opened() {\n\n return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened);\n\n }\n\n /**\n * Open Block Settings pane\n */\n open() {\n\n this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened);\n\n /**\n * Fill Tool's settings\n */\n this.addToolSettings();\n\n }\n\n /**\n * Close Block Settings pane\n */\n close() {\n\n this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened);\n\n }\n\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/toolbar-blockSettings.js","/**\n * @class Toolbox\n * @classdesc Holder for Tools\n *\n * @typedef {Toolbox} Toolbox\n * @property {Boolean} opened - opening state\n * @property {Object} nodes - Toolbox nodes\n * @property {Object} CSS - CSS class names\n *\n */\nexport default class Toolbox extends Module {\n\n /**\n * @constructor\n */\n constructor({config}) {\n\n super({config});\n\n this.nodes = {\n toolbox: null,\n buttons: []\n };\n\n /**\n * Opening state\n * @type {boolean}\n */\n this.opened = false;\n\n }\n\n /**\n * CSS styles\n * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}}\n */\n static get CSS() {\n\n return {\n toolbox: 'ce-toolbox',\n toolboxButton: 'ce-toolbox__button',\n toolboxOpened: 'ce-toolbox--opened',\n };\n\n }\n\n /**\n * Makes the Toolbox\n */\n make() {\n\n this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox);\n $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox);\n\n this.addTools();\n\n }\n\n /**\n * Iterates available tools and appends them to the Toolbox\n */\n addTools() {\n\n let tools = this.Editor.Tools.toolsAvailable;\n\n for (let toolName in tools) {\n\n this.addTool(toolName, tools[toolName]);\n\n }\n\n }\n\n /**\n * Append Tool to the Toolbox\n *\n * @param {string} toolName - tool name\n * @param {Tool} tool - tool class\n */\n addTool(toolName, tool) {\n\n if (tool.displayInToolbox && !tool.iconClassName) {\n\n _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName);\n return;\n\n }\n\n /**\n * @todo Add checkup for the render method\n */\n // if (typeof tool.render !== 'function') {\n //\n // _.log('render method missed. Tool %o skipped', 'warn', tool);\n // return;\n //\n // }\n\n /**\n * Skip tools that pass 'displayInToolbox=false'\n */\n if (!tool.displayInToolbox) {\n\n return;\n\n }\n\n let button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], {\n title: toolName\n });\n\n /**\n * Save tool's name in the button data-name\n */\n button.dataset.name = toolName;\n\n $.append(this.nodes.toolbox, button);\n\n this.nodes.toolbox.appendChild(button);\n this.nodes.buttons.push(button);\n\n /**\n * @todo add event with module Listeners\n */\n // this.Editor.Listeners.add();\n button.addEventListener('click', event => {\n\n this.buttonClicked(event);\n\n }, false);\n\n }\n\n /**\n * Toolbox button click listener\n * 1) if block is empty -> replace\n * 2) if block is not empty -> add new block below\n *\n * @param {MouseEvent} event\n */\n buttonClicked(event) {\n\n let toolButton = event.target,\n toolName = toolButton.dataset.name,\n tool = this.Editor.Tools.toolClasses[toolName];\n\n /**\n * @type {Block}\n */\n let currentBlock = this.Editor.BlockManager.currentBlock;\n\n /**\n * We do replace if:\n * - block is empty\n * - block is not irreplaceable\n * @type {Array}\n */\n if (!tool.irreplaceable && currentBlock.isEmpty) {\n\n this.Editor.BlockManager.replace(toolName);\n\n } else {\n\n this.Editor.BlockManager.insert(toolName);\n\n }\n\n /**\n * @todo set caret to the new block\n */\n\n // window.setTimeout(function () {\n\n /** Set caret to current block */\n // editor.caret.setToBlock(currentInputIndex);\n\n // }, 10);\n\n /**\n * Move toolbar when node is changed\n */\n this.Editor.Toolbar.move();\n\n }\n\n /**\n * Open Toolbox with Tools\n */\n open() {\n\n this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened);\n this.opened = true;\n\n }\n\n /**\n * Close Toolbox\n */\n close() {\n\n this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened);\n this.opened = false;\n\n }\n\n /**\n * Close Toolbox\n */\n toggle() {\n\n if (!this.opened) {\n\n this.open();\n\n } else {\n\n this.close();\n\n }\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/toolbar-toolbox.js","/**\n *\n * «Toolbar» is the node that moves up/down over current block\n *\n * ______________________________________ Toolbar ____________________________________________\n * | |\n * | ..................... Content .................... ......... Block Actions .......... |\n * | . . . . |\n * | . . . [Open Settings] [Remove Block] . |\n * | . [Plus Button] [Toolbox: {Tool1}, {Tool2}] . . . |\n * | . . . [Settings Panel] . |\n * | .................................................. .................................. |\n * | |\n * |___________________________________________________________________________________________|\n *\n *\n * Toolbox — its an Element contains tools buttons. Can be shown by Plus Button.\n *\n * _______________ Toolbox _______________\n * | |\n * | [Header] [Image] [List] [Quote] ... |\n * |_______________________________________|\n *\n *\n * Settings Panel — is an Element with block settings:\n *\n * ____ Settings Panel ____\n * | ...................... |\n * | . Tool Settings . |\n * | ...................... |\n * | . Default Settings . |\n * | ...................... |\n * |________________________|\n *\n *\n * @class\n * @classdesc Toolbar module\n *\n * @typedef {Toolbar} Toolbar\n * @property {Object} nodes\n * @property {Element} nodes.wrapper - Toolbar main element\n * @property {Element} nodes.content - Zone with Plus button and toolbox.\n * @property {Element} nodes.actions - Zone with Block Settings and Remove Button\n * @property {Element} nodes.blockActionsButtons - Zone with Block Buttons: [Settings]\n * @property {Element} nodes.plusButton - Button that opens or closes Toolbox\n * @property {Element} nodes.toolbox - Container for tools\n * @property {Element} nodes.settingsToggler - open/close Settings Panel button\n * @property {Element} nodes.settings - Settings Panel\n * @property {Element} nodes.pluginSettings - Plugin Settings section of Settings Panel\n * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel\n */\nexport default class Toolbar extends Module {\n\n /**\n * @constructor\n */\n constructor({config}) {\n\n super({config});\n\n this.nodes = {\n wrapper : null,\n content : null,\n actions : null,\n\n // Content Zone\n plusButton : null,\n\n // Actions Zone\n blockActionsButtons: null,\n settingsToggler : null,\n };\n\n }\n\n /**\n * CSS styles\n * @return {Object}\n * @constructor\n */\n static get CSS() {\n\n return {\n toolbar: 'ce-toolbar',\n content: 'ce-toolbar__content',\n actions: 'ce-toolbar__actions',\n\n toolbarOpened: 'ce-toolbar--opened',\n\n // Content Zone\n plusButton: 'ce-toolbar__plus',\n plusButtonHidden: 'ce-toolbar__plus--hidden',\n\n // Actions Zone\n blockActionsButtons: 'ce-toolbar__actions-buttons',\n settingsToggler: 'ce-toolbar__settings-btn',\n };\n\n }\n\n /**\n * Makes toolbar\n */\n make() {\n\n this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar);\n\n /**\n * Make Content Zone and Actions Zone\n */\n ['content', 'actions'].forEach( el => {\n\n this.nodes[el] = $.make('div', Toolbar.CSS[el]);\n $.append(this.nodes.wrapper, this.nodes[el]);\n\n });\n\n\n /**\n * Fill Content Zone:\n * - Plus Button\n * - Toolbox\n */\n this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton);\n $.append(this.nodes.content, this.nodes.plusButton);\n this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false);\n\n\n /**\n * Make a Toolbox\n */\n this.Editor.Toolbox.make();\n\n /**\n * Fill Actions Zone:\n * - Settings Toggler\n * - Remove Block Button\n * - Settings Panel\n */\n this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons);\n this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler);\n\n $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler);\n $.append(this.nodes.actions, this.nodes.blockActionsButtons);\n\n /**\n * Make and append Settings Panel\n */\n this.Editor.BlockSettings.make();\n $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper);\n\n /**\n * Append toolbar to the Editor\n */\n $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\n\n /**\n * Bind events on the Toolbar elements\n */\n this.bindEvents();\n\n }\n\n /**\n * Move Toolbar to the Current Block\n */\n move() {\n\n /** Close Toolbox when we move toolbar */\n this.Editor.Toolbox.close();\n\n let currentNode = this.Editor.BlockManager.currentNode;\n\n /**\n * If no one Block selected as a Current\n */\n if (!currentNode) {\n\n return;\n\n }\n\n /**\n * @todo Compute dynamically on prepare\n * @type {number}\n */\n const defaultToolbarHeight = 49;\n const defaultOffset = 34;\n\n var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset;\n\n this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`;\n\n /** Close trash actions */\n // editor.toolbar.settings.hideRemoveActions();\n\n }\n\n /**\n * Open Toolbar with Plus Button\n */\n open() {\n\n this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened);\n\n }\n\n /**\n * Close the Toolbar\n */\n close() {\n\n this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened);\n\n }\n\n /**\n * Plus Button public methods\n * @return {{hide: function(): void, show: function(): void}}\n */\n get plusButton() {\n\n return {\n hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden),\n show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden)\n };\n\n }\n\n /**\n * Handler for Plus Button\n * @param {MouseEvent} event\n */\n plusButtonClicked() {\n\n this.Editor.Toolbox.toggle();\n\n }\n\n /**\n * Bind events on the Toolbar Elements:\n * - Block Settings\n */\n bindEvents() {\n\n /**\n * Settings toggler\n */\n this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => {\n\n this.settingsTogglerClicked(event);\n\n });\n\n }\n\n /**\n * Clicks on the Block Settings toggler\n */\n settingsTogglerClicked() {\n\n if (this.Editor.BlockSettings.opened) {\n\n this.Editor.BlockSettings.close();\n\n } else {\n\n this.Editor.BlockSettings.open();\n\n }\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/toolbar.js","/**\n * @module Codex Editor Tools Submodule\n *\n * Creates Instances from Plugins and binds external config to the instances\n */\n\n/**\n * Each Tool must contain the following important objects:\n *\n * @typedef {Object} ToolConfig {@link docs/tools.md}\n * @property {String} iconClassname - this a icon in toolbar\n * @property {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE\n * @property {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE\n * @property render @todo add description\n * @property save @todo add description\n * @property settings @todo add description\n * @property validate - method that validates output data before saving\n */\n\n/**\n * @typedef {Function} Tool {@link docs/tools.md}\n * @property {Boolean} displayInToolbox - By default, tools won't be added in the Toolbox. Pass true to add.\n * @property {String} iconClassName - CSS class name for the Toolbox button\n * @property {Boolean} irreplaceable - Toolbox behaviour: replace or add new block below\n * @property render\n * @property save\n * @property settings\n * @property validate\n *\n * @todo update according to current API\n * @todo describe Tool in the {@link docs/tools.md}\n */\n\n/**\n * Class properties:\n *\n * @typedef {Tools} Tools\n * @property {Tools[]} toolsAvailable - available Tools\n * @property {Tools[]} toolsUnavailable - unavailable Tools\n * @property {Object} toolsClasses - all classes\n * @property {EditorConfig} config - Editor config\n */\nexport default class Tools extends Module {\n\n /**\n * Returns available Tools\n * @return {Tool[]}\n */\n get available() {\n\n return this.toolsAvailable;\n\n }\n\n /**\n * Returns unavailable Tools\n * @return {Tool[]}\n */\n get unavailable() {\n\n return this.toolsUnavailable;\n\n }\n\n /**\n * Static getter for default Tool config fields\n *\n * @usage Tools.defaultConfig.displayInToolbox\n * @return {ToolConfig}\n */\n static get defaultConfig() {\n\n return {\n iconClassName : '',\n displayInToolbox : false,\n enableLineBreaks : false,\n irreplaceable : false\n };\n\n }\n\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({config}) {\n\n super({config});\n\n /**\n * Map {name: Class, ...} where:\n * name — block type name in JSON. Got from EditorConfig.tools keys\n * @type {Object}\n */\n this.toolClasses = {};\n\n /**\n * Available tools list\n * {name: Class, ...}\n * @type {Object}\n */\n this.toolsAvailable = {};\n\n /**\n * Tools that rejected a prepare method\n * {name: Class, ... }\n * @type {Object}\n */\n this.toolsUnavailable = {};\n\n }\n\n /**\n * Creates instances via passed or default configuration\n * @return {Promise}\n */\n prepare() {\n\n if (!this.config.hasOwnProperty('tools')) {\n\n return Promise.reject(\"Can't start without tools\");\n\n }\n\n for(let toolName in this.config.tools) {\n\n this.toolClasses[toolName] = this.config.tools[toolName];\n\n }\n\n /**\n * getting classes that has prepare method\n */\n let sequenceData = this.getListOfPrepareFunctions();\n\n /**\n * if sequence data contains nothing then resolve current chain and run other module prepare\n */\n if (sequenceData.length === 0) {\n\n return Promise.resolve();\n\n }\n\n /**\n * to see how it works {@link Util#sequence}\n */\n return _.sequence(sequenceData, (data) => {\n\n this.success(data);\n\n }, (data) => {\n\n this.fallback(data);\n\n });\n\n }\n\n /**\n * Binds prepare function of plugins with user or default config\n * @return {Array} list of functions that needs to be fired sequentially\n */\n getListOfPrepareFunctions() {\n\n let toolPreparationList = [];\n\n for(let toolName in this.toolClasses) {\n\n let toolClass = this.toolClasses[toolName];\n\n if (typeof toolClass.prepare === 'function') {\n\n toolPreparationList.push({\n function : toolClass.prepare,\n data : {\n toolName\n }\n });\n\n } else {\n\n /**\n * If Tool hasn't a prepare method, mark it as available\n */\n this.toolsAvailable[toolName] = toolClass;\n\n }\n\n }\n\n return toolPreparationList;\n\n }\n\n /**\n * @param {ChainData.data} data - append tool to available list\n */\n success(data) {\n\n this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName];\n\n }\n\n /**\n * @param {ChainData.data} data - append tool to unavailable list\n */\n fallback(data) {\n\n this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName];\n\n }\n\n /**\n * Return tool`a instance\n *\n * @param {String} tool — tool name\n * @param {Object} data — initial data\n *\n * @todo throw exceptions if tool doesnt exist\n *\n */\n construct(tool, data) {\n\n let plugin = this.toolClasses[tool],\n config = this.config.toolsConfig[tool];\n\n if (!config) {\n\n config = this.defaultConfig;\n\n }\n\n let instance = new plugin(data, config);\n\n return instance;\n\n }\n\n /**\n * Check if passed Tool is an instance of Initial Block Tool\n * @param {Tool} tool - Tool to check\n * @return {Boolean}\n */\n isInitial(tool) {\n\n return tool instanceof this.available[this.config.initialBlock];\n\n }\n\n}\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/tools.js","/**\n * Module UI\n *\n * @type {UI}\n */\n// let className = {\n\n/**\n * @const {string} BLOCK_CLASSNAME - redactor blocks name\n */\n// BLOCK_CLASSNAME : 'ce-block',\n\n/**\n * @const {String} wrapper for plugins content\n */\n// BLOCK_CONTENT : 'ce-block__content',\n\n/**\n * @const {String} BLOCK_STRETCHED - makes block stretched\n */\n// BLOCK_STRETCHED : 'ce-block--stretched',\n\n/**\n * @const {String} BLOCK_HIGHLIGHTED - adds background\n */\n// BLOCK_HIGHLIGHTED : 'ce-block--focused',\n\n/**\n * @const {String} - for all default settings\n */\n// SETTINGS_ITEM : 'ce-settings__item'\n// };\n\n// import Block from '../block';\n\n/**\n * @class\n *\n * @classdesc Makes CodeX Editor UI:\n * \n * \n * \n * \n * \n *\n * @typedef {UI} UI\n * @property {EditorConfig} config - editor configuration {@link CodexEditor#configuration}\n * @property {Object} Editor - available editor modules {@link CodexEditor#moduleInstances}\n * @property {Object} nodes -\n * @property {Element} nodes.holder - element where we need to append redactor\n * @property {Element} nodes.wrapper - \n * @property {Element} nodes.redactor - \n */\nexport default class UI extends Module {\n\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({config}) {\n\n super({config});\n\n this.nodes = {\n holder: null,\n wrapper: null,\n redactor: null\n };\n\n }\n\n /**\n * Making main interface\n */\n prepare() {\n\n // this.Editor.Toolbar.make();\n\n return this.make()\n /**\n * Make toolbar\n */\n .then(() => this.Editor.Toolbar.make())\n /**\n * Load and append CSS\n */\n .then(() => this.loadStyles())\n /**\n * Bind events for the UI elements\n */\n .then(() => this.bindEvents())\n\n /** Make container for inline toolbar */\n // .then(makeInlineToolbar_)\n\n /** Add inline toolbar tools */\n // .then(addInlineToolbarTools_)\n\n /** Draw wrapper for notifications */\n // .then(makeNotificationHolder_)\n\n /** Add eventlisteners to redactor elements */\n // .then(bindEvents_)\n\n .catch(e => {\n\n console.error(e);\n\n // editor.core.log(\"Can't draw editor interface\");\n\n });\n\n }\n\n /**\n * CodeX Editor UI CSS class names\n * @return {{editorWrapper: string, editorZone: string, block: string}}\n */\n get CSS() {\n\n return {\n editorWrapper : 'codex-editor',\n editorZone : 'codex-editor__redactor',\n };\n\n }\n\n /**\n * Makes CodeX Editor interface\n * @return {Promise}\n */\n make() {\n\n return new Promise( (resolve, reject) => {\n\n /**\n * Element where we need to append CodeX Editor\n * @type {Element}\n */\n this.nodes.holder = document.getElementById(this.config.holderId);\n\n if (!this.nodes.holder) {\n\n reject(Error(\"Holder wasn't found by ID: #\" + this.config.holderId));\n return;\n\n }\n\n /**\n * Create and save main UI elements\n */\n this.nodes.wrapper = $.make('div', this.CSS.editorWrapper);\n this.nodes.redactor = $.make('div', this.CSS.editorZone);\n\n this.nodes.wrapper.appendChild(this.nodes.redactor);\n this.nodes.holder.appendChild(this.nodes.wrapper);\n\n resolve();\n\n });\n\n }\n\n /**\n * Appends CSS\n */\n loadStyles() {\n\n /**\n * Load CSS\n */\n let styles = require('../../styles/main.css');\n\n /**\n * Make tag\n */\n let tag = $.make('style', null, {\n textContent: styles.toString()\n });\n\n /**\n * Append styles\n */\n $.append(document.head, tag);\n\n }\n\n /**\n * Bind events on the CodeX Editor interface\n */\n bindEvents() {\n\n /**\n * @todo bind events with the Listeners module\n */\n this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false );\n\n }\n\n /**\n * All clicks on the redactor zone\n *\n * @param {MouseEvent} event\n *\n * @description\n * 1. Save clicked Block as a current {@link BlockManager#currentNode}\n * it uses for the following:\n * - add CSS modifier for the selected Block\n * - on Enter press, we make a new Block under that\n *\n * 2. Move and show the Toolbar\n *\n * 3. Set a Caret\n *\n * 4. By clicks on the Editor's bottom zone:\n * - if last Block is empty, set a Caret to this\n * - otherwise, add a new empty Block and set a Caret to that\n *\n * 5. Hide the Inline Toolbar\n *\n * @see selectClickedBlock\n *\n */\n redactorClicked(event) {\n\n let clickedNode = event.target;\n\n /**\n * Select clicked Block as Current\n */\n try {\n\n this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode);\n\n } catch (e) {\n\n /**\n * If clicked outside first-level Blocks, set Caret to the last empty Block\n */\n this.Editor.Caret.setToTheLastBlock();\n\n }\n\n\n /**\n * @todo hide the Inline Toolbar\n */\n // var selectedText = editor.toolbar.inline.getSelectionText(),\n // firstLevelBlock;\n\n /** If selection range took off, then we hide inline toolbar */\n // if (selectedText.length === 0) {\n\n // editor.toolbar.inline.close();\n\n // }\n\n /**\n *\n\n /** Update current input index in memory when caret focused into existed input */\n // if (event.target.contentEditable == 'true') {\n //\n // editor.caret.saveCurrentInputIndex();\n //\n // }\n\n // if (editor.content.currentNode === null) {\n //\n // /**\n // * If inputs in redactor does not exits, then we put input index 0 not -1\n // */\n // var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0;\n //\n // /** If we have any inputs */\n // if (editor.state.inputs.length) {\n //\n // /** getting firstlevel parent of input */\n // firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]);\n //\n // }\n //\n // /** If input is empty, then we set caret to the last input */\n // if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) {\n //\n // editor.caret.setToBlock(indexOfLastInput);\n //\n // } else {\n //\n // /** Create new input when caret clicked in redactors area */\n // var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n //\n // editor.content.insertBlock({\n // type : NEW_BLOCK_TYPE,\n // block : editor.tools[NEW_BLOCK_TYPE].render()\n // });\n //\n // /** If there is no inputs except inserted */\n // if (editor.state.inputs.length === 1) {\n //\n // editor.caret.setToBlock(indexOfLastInput);\n //\n // } else {\n //\n // /** Set caret to this appended input */\n // editor.caret.setToNextBlock(indexOfLastInput);\n //\n // }\n //\n // }\n //\n // } else {\n //\n // /** Close all panels */\n // editor.toolbar.settings.close();\n // editor.toolbar.toolbox.close();\n //\n // }\n //\n /**\n * Move toolbar and open\n */\n this.Editor.Toolbar.move();\n this.Editor.Toolbar.open();\n //\n // var inputIsEmpty = !editor.content.currentNode.textContent.trim(),\n // currentNodeType = editor.content.currentNode.dataset.tool,\n // isInitialType = currentNodeType == editor.settings.initialBlockPlugin;\n //\n //\n\n /**\n * Hide the Plus Button\n * */\n this.Editor.Toolbar.plusButton.hide();\n\n /**\n * Show the Plus Button if:\n * - Block is an initial-block (Text)\n * - Block is empty\n */\n let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool),\n isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty;\n\n if (isInitialBlock && isEmptyBlock) {\n\n this.Editor.Toolbar.plusButton.show();\n\n }\n\n }\n\n}\n\n// /**\n// * Codex Editor UI module\n// *\n// * @author Codex Team\n// * @version 1.2.0\n// */\n//\n// module.exports = (function (ui) {\n//\n// let editor = codex.editor;\n//\n// /**\n// * Basic editor classnames\n// */\n// ui.prepare = function () {\n//\n\n//\n// };\n//\n// /** Draw notifications holder */\n// var makeNotificationHolder_ = function () {\n//\n// /** Append block with notifications to the document */\n// editor.nodes.notifications = editor.notifications.createHolder();\n//\n// };\n//\n//\n// var addInlineToolbarTools_ = function () {\n//\n// var tools = {\n//\n// bold: {\n// icon : 'ce-icon-bold',\n// command : 'bold'\n// },\n//\n// italic: {\n// icon : 'ce-icon-italic',\n// command : 'italic'\n// },\n//\n// link: {\n// icon : 'ce-icon-link',\n// command : 'createLink'\n// }\n// };\n//\n// var toolButton,\n// tool;\n//\n// for(var name in tools) {\n//\n// tool = tools[name];\n//\n// toolButton = editor.draw.toolbarButtonInline(name, tool.icon);\n//\n// editor.nodes.inlineToolbar.buttons.appendChild(toolButton);\n// /**\n// * Add callbacks to this buttons\n// */\n// editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command);\n//\n// }\n//\n// };\n//\n// /**\n// * @private\n// * Bind editor UI events\n// */\n// var bindEvents_ = function () {\n//\n// editor.core.log('ui.bindEvents fired', 'info');\n//\n// // window.addEventListener('error', function (errorMsg, url, lineNumber) {\n// // editor.notifications.errorThrown(errorMsg, event);\n// // }, false );\n//\n// /** All keydowns on Document */\n// editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false);\n//\n// /** All keydowns on Redactor zone */\n// editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false);\n//\n// /** All keydowns on Document */\n// editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false );\n//\n// /**\n// * Mouse click to radactor\n// */\n// editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false );\n//\n// /**\n// * Clicks to the Plus button\n// */\n// editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false);\n//\n// /**\n// * Clicks to SETTINGS button in toolbar\n// */\n// editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false );\n//\n// /** Bind click listeners on toolbar buttons */\n// for (var button in editor.nodes.toolbarButtons) {\n//\n// editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false);\n//\n// }\n//\n// };\n//\n// ui.addBlockHandlers = function (block) {\n//\n// if (!block) return;\n//\n// /**\n// * Block keydowns\n// */\n// editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false);\n//\n// /**\n// * Pasting content from another source\n// * We have two type of sanitization\n// * First - uses deep-first search algorithm to get sub nodes,\n// * sanitizes whole Block_content and replaces cleared nodes\n// * This method is deprecated\n// * Method is used in editor.callback.blockPaste(event)\n// *\n// * Secont - uses Mutation observer.\n// * Observer \"observe\" DOM changes and send changings to callback.\n// * Callback gets changed node, not whole Block_content.\n// * Inserted or changed node, which we've gotten have been cleared and replaced with diry node\n// *\n// * Method is used in editor.callback.blockPasteViaSanitize(event)\n// *\n// * @uses html-janitor\n// * @example editor.callback.blockPasteViaSanitize(event), the second method.\n// *\n// */\n// editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false);\n//\n// /**\n// * Show inline toolbar for selected text\n// */\n// editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false);\n// editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false);\n//\n// };\n//\n// /** getting all contenteditable elements */\n// ui.saveInputs = function () {\n//\n// var redactor = editor.nodes.redactor;\n//\n// editor.state.inputs = [];\n//\n// /** Save all inputs in global variable state */\n// var inputs = redactor.querySelectorAll('[contenteditable], input, textarea');\n//\n// Array.prototype.map.call(inputs, function (current) {\n//\n// if (!current.type || current.type == 'text' || current.type == 'textarea') {\n//\n// editor.state.inputs.push(current);\n//\n// }\n//\n// });\n//\n// };\n//\n// /**\n// * Adds first initial block on empty redactor\n// */\n// ui.addInitialBlock = function () {\n//\n// var initialBlockType = editor.settings.initialBlockPlugin,\n// initialBlock;\n//\n// if ( !editor.tools[initialBlockType] ) {\n//\n// editor.core.log('Plugin %o was not implemented and can\\'t be used as initial block', 'warn', initialBlockType);\n// return;\n//\n// }\n//\n// initialBlock = editor.tools[initialBlockType].render();\n//\n// initialBlock.setAttribute('data-placeholder', editor.settings.placeholder);\n//\n// editor.content.insertBlock({\n// type : initialBlockType,\n// block : initialBlock\n// });\n//\n// editor.content.workingNodeChanged(initialBlock);\n//\n// };\n//\n// ui.setInlineToolbarButtonBehaviour = function (button, type) {\n//\n// editor.listeners.add(button, 'mousedown', function (event) {\n//\n// editor.toolbar.inline.toolClicked(event, type);\n//\n// }, false);\n//\n// };\n//\n// return ui;\n//\n// })({});\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/modules/ui.js","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(undefined);\n// imports\n\n\n// module\nexports.push([module.id, \":root {\\n\\n /**\\n * Toolbar buttons\\n */\\n\\n /**\\n * All gray texts: placeholders, settings\\n */\\n\\n /**\\n * Block content width\\n */\\n\\n /**\\n * Toolbar Plus Button and Toolbox buttons height and width\\n */\\n\\n}\\n/**\\n* Editor wrapper\\n*/\\n.codex-editor {\\n position: relative;\\n border: 1px solid #ccc;\\n padding: 2px;\\n box-sizing: border-box;\\n}\\n.codex-editor .hide {\\n display: none;\\n }\\n.codex-editor__redactor {\\n padding-bottom: 300px;\\n }\\n.ce-toolbar {\\n position: absolute;\\n left: 0;\\n right: 0;\\n top: 0;\\n /*opacity: 0;*/\\n /*visibility: hidden;*/\\n transition: opacity 100ms ease;\\n will-change: opacity, transform;\\n display: none;\\n}\\n.ce-toolbar--opened {\\n display: block;\\n /*opacity: 1;*/\\n /*visibility: visible;*/\\n }\\n.ce-toolbar__content {\\n max-width: 650px;\\n margin: 0 auto;\\n position: relative;\\n }\\n.ce-toolbar__plus {\\n position: absolute;\\n left: calc(-34px - 10px);\\n display: inline-block;\\n background-color: #eff2f5;\\n width: 34px;\\n height: 34px;\\n line-height: 34px;\\n text-align: center;\\n border-radius: 50%\\n }\\n.ce-toolbar__plus::after {\\n content: '+';\\n font-size: 26px;\\n display: block;\\n margin-top: -2px;\\n margin-right: -2px;\\n\\n}\\n.ce-toolbar__plus--hidden {\\n display: none;\\n\\n}\\n/**\\n * Block actions Zone\\n * -------------------------\\n */\\n.ce-toolbar__actions {\\n position: absolute;\\n right: 0;\\n top: 0;\\n border: 1px dotted #ccc;\\n padding: 2px;\\n }\\n.ce-toolbar__actions-buttons {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n text-align: right;\\n margin-bottom: 2px;\\n }\\n.ce-toolbar__settings-btn {\\n display: inline-block;\\n width: 24px;\\n height: 24px;\\n border: 1px dotted #ccc\\n }\\n.ce-toolbar__settings-btn::before {\\n content: 'STN';\\n font-size: 10px;\\n opacity: .4;\\n\\n}\\n.ce-toolbox {\\n visibility: hidden;\\n transition: opacity 100ms ease;\\n will-change: opacity;\\n}\\n.ce-toolbox--opened {\\n opacity: 1;\\n visibility: visible;\\n }\\n.ce-toolbox__button {\\n display: inline-block;\\n list-style: none;\\n margin: 0;\\n background: #eff2f5;\\n width: 34px;\\n height: 34px;\\n border-radius: 30px;\\n overflow: hidden;\\n text-align: center;\\n line-height: 34px\\n }\\n.ce-toolbox__button::before {\\n content: attr(title);\\n font-size: 22px;\\n font-weight: 500;\\n letter-spacing: 1em;\\n -webkit-font-feature-settings: \\\"smcp\\\", \\\"c2sc\\\";\\n font-feature-settings: \\\"smcp\\\", \\\"c2sc\\\";\\n font-variant-caps: all-small-caps;\\n padding-left: 11.5px;\\n margin-top: -1px;\\n display: inline-block;\\n\\n}\\n.ce-settings {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n display: none;\\n}\\n.ce-settings--opened {\\n display: block;\\n }\\n.ce-settings__plugin-zone {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n margin-bottom: 2px\\n }\\n.ce-settings__plugin-zone::before {\\n content: 'PLUGIN SETTINGS';\\n opacity: .4;\\n font-size: 12px;\\n\\n}\\n.ce-settings__default-zone {\\n border: 1px dotted #ccc;\\n padding: 2px\\n }\\n.ce-settings__default-zone::before {\\n content: 'DEFAULT SETTINGS';\\n opacity: .4;\\n font-size: 12px;\\n\\n}\\n.ce-settings__button {\\n padding: 10px 15px;\\n color: #707684\\n }\\n.ce-settings__button:hover {\\n background: #eff2f5;\\n\\n}\\n.ce-block {\\n border: 1px dotted #ccc;\\n margin: 2px 0\\n}\\n.ce-block:first-of-type {\\n margin-top: 0;\\n\\n}\\n.ce-block--selected {\\n background-color: #eff2f5;\\n\\n}\\n.ce-block__content {\\n max-width: 650px;\\n margin: 0 auto;\\n\\n}\\n\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/styles/main.css\n// module id = 22\n// module chunks = 0","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader/lib/css-base.js\n// module id = 23\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://CodexEditor/webpack/bootstrap","webpack://CodexEditor/./node_modules/css-loader/lib/css-base.js","webpack://CodexEditor/./node_modules/html-janitor/src/html-janitor.js","webpack://CodexEditor/./src/codex.js","webpack://CodexEditor/./src/components/Selection.js","webpack://CodexEditor/./src/components/__module.ts","webpack://CodexEditor/./src/components/block.js","webpack://CodexEditor/./src/components/dom.js","webpack://CodexEditor/./src/components/modules sync nonrecursive [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$","webpack://CodexEditor/./src/components/modules/blockManager.js","webpack://CodexEditor/./src/components/modules/caret.js","webpack://CodexEditor/./src/components/modules/events.js","webpack://CodexEditor/./src/components/modules/keyboard.js","webpack://CodexEditor/./src/components/modules/listeners.js","webpack://CodexEditor/./src/components/modules/renderer.js","webpack://CodexEditor/./src/components/modules/sanitizer.js","webpack://CodexEditor/./src/components/modules/saver.js","webpack://CodexEditor/./src/components/modules/toolbar-blockSettings.js","webpack://CodexEditor/./src/components/modules/toolbar-inline.ts","webpack://CodexEditor/./src/components/modules/toolbar-toolbox.js","webpack://CodexEditor/./src/components/modules/toolbar.js","webpack://CodexEditor/./src/components/modules/tools.js","webpack://CodexEditor/./src/components/modules/ui.js","webpack://CodexEditor/./src/components/polyfills.js","webpack://CodexEditor/./src/components/utils.js","webpack://CodexEditor/./src/styles/main.css"],"names":["modules","editorModules","map","module","CodexEditor","config","moduleInstances","Promise","resolve","then","configuration","init","start","console","log","catch","error","constructModules","configureModules","forEach","Module","displayName","e","name","state","getModulesDiff","diff","moduleName","prepareDecorator","prepare","Tools","UI","BlockManager","Renderer","render","data","items","initialBlock","type","holderId","placeholder","sanitizer","p","b","a","hideToolbar","tools","toolsConfig","_","isEmpty","length","Selection","instance","selection","window","getSelection","anchorNode","anchorOffset","isCollapsed","Editor","new","target","TypeError","Block","toolName","toolInstance","tool","_html","compose","wrapper","$","make","CSS","contentNode","content","pluginsContent","appendChild","methodName","params","Function","call","merge","extractedBlock","save","measuringStart","performance","now","measuringEnd","finishedExtraction","time","isValid","validate","contentless","emptyText","emptyMedia","hasMedia","mediaTags","querySelector","join","classList","add","selected","remove","Dom","tag","tagName","includes","classNames","attributes","el","document","createElement","Array","isArray","attrName","createTextNode","parent","elements","selector","querySelectorAll","node","atLast","child","sibling","nodeType","Node","ELEMENT_NODE","nodeChild","isSingleTag","parentNode","getDeepestNode","nativeInputs","nodeText","isElement","isNativeInput","value","textContent","replace","trim","childNodes","treeWalker","leafs","isNodeEmpty","push","firstChild","shift","isLeaf","nextSibling","every","leaf","_blocks","currentBlockIndex","blocks","Blocks","nodes","redactor","Proxy","set","get","construct","block","bindEvents","Listeners","on","event","Keyboard","blockKeydownsListener","InlineToolbar","move","caretAtEnd","Caret","isAtEnd","nextBlock","setToBlock","caretAtStart","isAtStart","previousBlock","composeBlock","targetBlock","blockToMerge","blockToMergeIndex","indexOf","blockToMergeInfo","mergeWith","removeBlock","index","extractedFragment","extractFragmentFromCaretPosition","append","text","innerHTML","insert","element","firstLevelBlock","closest","childNode","parentFirstLevelBlock","currentNode","Error","isLastBlock","isFirstBlock","array","currentBlock","workingArea","html","deleteCount","splice","insertAdjacentElement","newBlock","children","isNaN","Number","offset","atEnd","focus","nodeToSet","delay","range","createRange","setStart","setEnd","removeAllRanges","addRange","lastBlock","rangeCount","selectRange","getRangeAt","blockElem","deleteContents","cloneRange","selectNodeContents","endContainer","endOffset","extractContents","from","direction","current","siblings","contentEditable","firstNode","firstLetterPosition","search","leftSiblings","getHigherLevelSiblings","nothingAtLeft","lastNode","nothingAtRight","Events","subscribers","eventName","callback","reduce","previousData","currentHandler","newData","keyCode","keyCodes","BACKSPACE","backspacePressed","ENTER","enterPressed","DOWN","RIGHT","arrowRightAndDownPressed","UP","LEFT","arrowLeftAndUpPressed","enableLineBreaks","shiftKey","split","preventDefault","BM","canMergeBlocks","getBlockByIndex","mergeable","navigatePrevious","setCaretToTheEnd","mergeBlocks","setTimeout","Toolbar","close","navigateNext","allListeners","eventType","handler","useCapture","assignedEventData","alreadyExist","findOne","addEventListener","existingListeners","findAll","i","removeEventListener","listenersOnElement","listener","listenersWithType","listenersWithHandler","foundListeners","foundAllListeners","foundByElements","foundByEventType","foundByHandler","findByElement","findByType","findByHandler","concat","chainData","function","insertBlock","sequence","item","Sanitizer","defaultConfig","_sanitizerInstance","sanitizerConfig","settings","sanitizerInstance","require","taintString","customConfig","clean","library","tags","href","rel","newInstance","Saver","output","blocksData","all","allExtractedData","makeOutput","outputData","totalTime","groupCollapsed","extraction","groupEnd","Date","version","VERSION","BlockSettings","toolSettings","defaultSettings","buttonRemove","addDefaultSettings","button","removeBlockButtonClicked","wrapperOpened","addToolSettings","contains","inlineToolbar","Toolbox","toolbox","buttons","opened","addTools","toolsAvailable","addTool","displayInToolbox","iconClassName","toolboxButton","title","dataset","buttonClicked","toolButton","toolClasses","irreplaceable","toolboxOpened","open","actions","plusButton","blockActionsButtons","settingsToggler","toolbar","plusButtonClicked","defaultToolbarHeight","defaultOffset","newYCoordinate","offsetTop","style","transform","Math","floor","toolbarOpened","toggle","settingsTogglerClicked","hide","plusButtonHidden","show","toolsUnavailable","hasOwnProperty","reject","sequenceData","getListOfPrepareFunctions","success","fallback","toolPreparationList","toolClass","plugin","available","holder","loadStyles","getElementById","editorWrapper","editorZone","styles","toString","head","redactorClicked","clickedNode","setCurrentBlockByChildNode","setToTheLastBlock","isInitialBlock","isInitial","isEmptyBlock","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","documentElement","parentElement","Util","msg","args","chains","previousValue","currentValue","iteration","waitNextBlock","successCallback","fallbackCallback","collection","slice","object","Object","keys","constructor","method","timeout","context","arguments","apply","TAB","SHIFT","CTRL","ALT","ESC","SPACE","DELETE","META"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,IAAI;AACJ;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;;AAElE;AACA;;;;;;;;;;;;AC3EA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA,GAAG,QAIH;AACA,CAAC;;AAED;AACA,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;;AAEA;AACA,wBAAwB,iCAAiC,EAAE;AAC3D,6BAA6B,uEAAuE,EAAE;;AAEtG;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB,4BAA4B;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;;;;;;;;;;;;ACxLD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;;;;AAIA;;;;;;;;;;;;AAYA;;;;;;;AAOA;;AAEA;;;;;;;;;;AAGA;;;;AAEA;;;AAGA;AACA,IAAIA,UAAU,mNAAAC,CAAcC,GAAd,CAAmB;AAAA,SAAU,sPAAQ,GAA0BC,MAAlC,CAAV;AAAA,CAAnB,CAAd;;AAEA;;;;;;;;;;;IAUqBC,W;;;;AACnB;wBACqB;AACnB,aAAO,OAAP;AACD;;AAED;;;;;;;AAIA,uBAAYC,MAAZ,EAAoB;AAAA;;AAAA;;AAClB;;;;AAIA,SAAKA,MAAL,GAAc,EAAd;;AAEA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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;kBAzNqBmT,K;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvBrB;;;;;;;;;;;IAWqBc,a;;;AACnB,+BAAsB;AAAA,QAAThV,MAAS,QAATA,MAAS;;AAAA;;AAAA,8HACd,EAACA,cAAD,EADc;;AAGpB,UAAKqJ,KAAL,GAAa;AACXrF,eAAS,IADE;AAEXiR,oBAAc,IAFH;AAGXC,uBAAiB,IAHN;AAIXC,oBAAc;AAJH,KAAb;AAHoB;AASrB;;AAED;;;;;;;;;;AAgBA;;;;;;;2BAOO;AACL,WAAK9L,KAAL,CAAWrF,OAAX,GAAqBC,EAAEC,IAAF,CAAO,KAAP,EAAc8Q,cAAc7Q,GAAd,CAAkBH,OAAhC,CAArB;;AAEA,WAAKqF,KAAL,CAAW4L,YAAX,GAA0BhR,EAAEC,IAAF,CAAO,KAAP,EAAc8Q,cAAc7Q,GAAd,CAAkB8Q,YAAhC,CAA1B;AACA,WAAK5L,KAAL,CAAW6L,eAAX,GAA6BjR,EAAEC,IAAF,CAAO,KAAP,EAAc8Q,cAAc7Q,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MAAL,CAAY4N,OAAZ,CAAoB4F,UAApB,CAA+BkB,IAA/B;AACD;AACF;;;wBApNS;AACR,aAAO;AACLe,uBAAgB,cADX;AAELC,oBAAgB;AAFX,OAAP;AAID;;;;EAlE6BjY,M;;AAoRhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;kBAzeqBW,E;;;;;;;;;;;;;;;;ACrDrB;;;;;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,2BAA2B,OAAO,6BAA6B,sBAAsB,OAAO,6FAA6F,yBAAyB,eAAe,aAAa,8BAA8B,mBAAmB,KAAK,gCAAgC,gCAAgC,qBAAqB,0BAA0B,2BAA2B,OAAO,6BAA6B,4BAA4B,kBAAkB,mBAAmB,kCAAkC,qCAAqC,uBAAuB,wBAAwB,oBAAoB,OAAO,eAAe,yBAAyB,yBAAyB,qCAAqC,2BAA2B,GAAG,uBAAuB,qBAAqB,8BAA8B,OAAO,uBAAuB,gCAAgC,2BAA2B,oBAAoB,8BAA8B,sCAAsC,sBAAsB,6CAA6C,uBAAuB,8CAA8C,8BAA8B,2BAA2B,6BAA6B,4BAA4B,yDAAyD,+BAA+B,mCAAmC,8BAA8B,+BAA+B,kCAAkC,gEAAgE,gEAAgE,gDAAgD,mCAAmC,+BAA+B,oCAAoC,WAAW,sBAAsB,yBAAyB,iBAAiB,wBAAwB,+FAA+F,uBAAuB,uBAAuB,GAAG,8BAA8B,gBAAgB,gBAAgB,iBAAiB,uBAAuB,cAAc,cAAc,sBAAsB,8BAA8B,qBAAqB,WAAW,sBAAsB,qBAAqB,mBAAmB,GAAG,gBAAgB,4BAA4B,iBAAiB,kBAAkB,GAAG,wBAAwB,qBAAqB,KAAK,6BAA6B,8BAA8B,mBAAmB,6BAA6B,qCAAqC,mCAAmC,oBAAoB,wBAAwB,OAAO,8BAA8B,8BAA8B,uBAAuB,sCAAsC,oCAAoC,oBAAoB,wBAAwB,OAAO,wBAAwB,yBAAyB,qBAAqB,iCAAiC,8BAA8B,4BAA4B,oCAAoC,OAAO,aAAa,4BAA4B,oBAAoB,2BAA2B,oBAAoB,KAAK,uBAAuB,gCAAgC,wCAAwC,KAAK,sBAAsB,uBAAuB,sCAAsC,qBAAqB,KAAK;;AAEt/J","file":"codex-editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/codex.js\");\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('html-janitor', factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.HTMLJanitor = factory();\n }\n}(this, function () {\n\n /**\n * @param {Object} config.tags Dictionary of allowed tags.\n * @param {boolean} config.keepNestedBlockElements Default false.\n */\n function HTMLJanitor(config) {\n\n var tagDefinitions = config['tags'];\n var tags = Object.keys(tagDefinitions);\n\n var validConfigValues = tags\n .map(function(k) { return typeof tagDefinitions[k]; })\n .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; });\n\n if(!validConfigValues) {\n throw new Error(\"The configuration was invalid\");\n }\n\n this.config = config;\n }\n\n // TODO: not exhaustive?\n var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE'];\n function isBlockElement(node) {\n return blockElementNames.indexOf(node.nodeName) !== -1;\n }\n\n var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE'];\n function isInlineElement(node) {\n return inlineElementNames.indexOf(node.nodeName) !== -1;\n }\n\n HTMLJanitor.prototype.clean = function (html) {\n var sandbox = document.createElement('div');\n sandbox.innerHTML = html;\n\n this._sanitize(sandbox);\n\n return sandbox.innerHTML;\n };\n\n HTMLJanitor.prototype._sanitize = function (parentNode) {\n var treeWalker = createTreeWalker(parentNode);\n var node = treeWalker.firstChild();\n if (!node) { return; }\n\n do {\n // Ignore nodes that have already been sanitized\n if (node._sanitized) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n // If this text node is just whitespace and the previous or next element\n // sibling is a block element, remove it\n // N.B.: This heuristic could change. Very specific to a bug with\n // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output\n // FIXME: make this an option?\n if (node.data.trim() === ''\n && ((node.previousElementSibling && isBlockElement(node.previousElementSibling))\n || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n } else {\n continue;\n }\n }\n\n // Remove all comments\n if (node.nodeType === Node.COMMENT_NODE) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n }\n\n var isInline = isInlineElement(node);\n var containsBlockElement;\n if (isInline) {\n containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement);\n }\n\n // Block elements should not be nested (e.g.

  • ...); if\n // they are, we want to unwrap the inner block element.\n var isNotTopContainer = !! parentNode.parentNode;\n var isNestedBlockElement =\n isBlockElement(parentNode) &&\n isBlockElement(node) &&\n isNotTopContainer;\n\n var nodeName = node.nodeName.toLowerCase();\n\n var allowedAttrs = getAllowedAttrs(this.config, nodeName, node);\n\n var isInvalid = isInline && containsBlockElement;\n\n // Drop tag entirely according to the whitelist *and* if the markup\n // is invalid.\n if (isInvalid || shouldRejectNode(node, allowedAttrs)\n || (!this.config.keepNestedBlockElements && isNestedBlockElement)) {\n // Do not keep the inner text of SCRIPT/STYLE elements.\n if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) {\n while (node.childNodes.length > 0) {\n parentNode.insertBefore(node.childNodes[0], node);\n }\n }\n parentNode.removeChild(node);\n\n this._sanitize(parentNode);\n break;\n }\n\n // Sanitize attributes\n for (var a = 0; a < node.attributes.length; a += 1) {\n var attr = node.attributes[a];\n\n if (shouldRejectAttr(attr, allowedAttrs, node)) {\n node.removeAttribute(attr.name);\n // Shift the array to continue looping.\n a = a - 1;\n }\n }\n\n // Sanitize children\n this._sanitize(node);\n\n // Mark node as sanitized so it's ignored in future runs\n node._sanitized = true;\n } while ((node = treeWalker.nextSibling()));\n };\n\n function createTreeWalker(node) {\n return document.createTreeWalker(node,\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n null, false);\n }\n\n function getAllowedAttrs(config, nodeName, node){\n if (typeof config.tags[nodeName] === 'function') {\n return config.tags[nodeName](node);\n } else {\n return config.tags[nodeName];\n }\n }\n\n function shouldRejectNode(node, allowedAttrs){\n if (typeof allowedAttrs === 'undefined') {\n return true;\n } else if (typeof allowedAttrs === 'boolean') {\n return !allowedAttrs;\n }\n\n return false;\n }\n\n function shouldRejectAttr(attr, allowedAttrs, node){\n var attrName = attr.name.toLowerCase();\n\n if (allowedAttrs === true){\n return false;\n } else if (typeof allowedAttrs[attrName] === 'function'){\n return !allowedAttrs[attrName](attr.value, node);\n } else if (typeof allowedAttrs[attrName] === 'undefined'){\n return true;\n } else if (allowedAttrs[attrName] === false) {\n return true;\n } else if (typeof allowedAttrs[attrName] === 'string') {\n return (allowedAttrs[attrName] !== attr.value);\n }\n\n return false;\n }\n\n return HTMLJanitor;\n\n}));\n","/**\n * Codex Editor\n *\n * Short Description (눈_눈;)\n * @version 2.0.0\n *\n * How to start?\n * Example:\n * new CodexEditor({\n * holderId : 'codex-editor',\n * initialBlock : 'text',\n * placeholder : 'Write your story....',\n * tools: {\n * quote: Quote,\n * anotherTool : AnotherTool\n * },\n * toolsConfig: {\n * quote: {\n * iconClassname : 'quote-icon',\n * displayInToolbox : true,\n * enableLineBreaks : true\n * },\n * anotherTool: {\n * iconClassname : 'tool-icon'\n * }\n * }\n * });\n *\n * - tools is an object: {\n * pluginName: PluginClass,\n * .....\n * }\n * - toolsConfig is an additional configuration that uses Codex Editor API\n * iconClassname - CSS classname of toolbox icon\n * displayInToolbox - if you want to see your Tool in toolbox hided in \"plus\" button, than set \"True\". By default : \"False\"\n * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property \"True\", enter will break the lines in current block\n *\n * @author CodeX-Team \n *\n */\n\n/**\n * @typedef {CodexEditor} CodexEditor - editor class\n */\n\n/**\n * @typedef {Object} EditorConfig\n * @property {String} holderId - Element to append Editor\n * @property {Array} data - Blocks list in JSON-format\n * @property {Object} tools - Map for used Tools in format { name : Class, ... }\n * @property {String} initialBlock - This Tool will be added by default\n * @property {String} placeholder - First Block placeholder\n * @property {Object} sanitizer - @todo fill desc\n * @property {Boolean} hideToolbar - @todo fill desc\n * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig}\n */\n\n/**\n * Dynamically imported utils\n *\n * @typedef {Dom} $ - {@link components/dom.js}\n * @typedef {Util} _ - {@link components/utils.js}\n */\n\n'use strict';\n\n/**\n * Apply polyfills\n */\nimport 'components/polyfills';\n\n/**\n * Require Editor modules places in components/modules dir\n */\n// eslint-disable-next-line\nlet modules = editorModules.map( module => require('./components/modules/' + module ));\n\n/**\n * @class\n *\n * @classdesc CodeX Editor base class\n *\n * @property this.config - all settings\n * @property this.moduleInstances - constructed editor components\n *\n * @type {CodexEditor}\n */\nexport default class CodexEditor {\n /** Editor version */\n static get version() {\n return VERSION;\n }\n\n /**\n * @param {EditorConfig} config - user configuration\n *\n */\n constructor(config) {\n /**\n * Configuration object\n * @type {EditorConfig}\n */\n this.config = {};\n\n /**\n * @typedef {Object} EditorComponents\n * @property {BlockManager} BlockManager\n * @property {Tools} Tools\n * @property {Events} Events\n * @property {UI} UI\n * @property {Toolbar} Toolbar\n * @property {Toolbox} Toolbox\n * @property {BlockSettings} BlockSettings\n * @property {Renderer} Renderer\n * @property {InlineToolbar} InlineToolbar\n */\n this.moduleInstances = {};\n\n Promise.resolve()\n .then(() => {\n this.configuration = config;\n })\n .then(() => this.init())\n .then(() => this.start())\n .then(() => {\n console.log('CodeX Editor is ready!');\n })\n .catch(error => {\n console.log('CodeX Editor does not ready because of %o', error);\n });\n }\n\n /**\n * Setting for configuration\n * @param {EditorConfig} config\n */\n set configuration(config) {\n /**\n * Initlai block type\n * Uses in case when there is no items passed\n * @type {{type: (*), data: {text: null}}}\n */\n let initialBlock = {\n type : config.initialBlock,\n data : {}\n };\n\n this.config.holderId = config.holderId;\n this.config.placeholder = config.placeholder || 'write your story...';\n this.config.sanitizer = config.sanitizer || {\n p: true,\n b: true,\n a: true\n };\n\n this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false;\n this.config.tools = config.tools || {};\n this.config.toolsConfig = config.toolsConfig || {};\n this.config.data = config.data || {};\n\n /**\n * Initialize items to pass data to the Renderer\n */\n if (_.isEmpty(this.config.data)) {\n this.config.data = {};\n this.config.data.items = [ initialBlock ];\n } else {\n if (!this.config.data.items || this.config.data.items.length === 0) {\n this.config.data.items = [ initialBlock ];\n }\n }\n\n /**\n * If initial Block's Tool was not passed, use the first Tool in config.tools\n */\n if (!config.initialBlock) {\n for (this.config.initialBlock in this.config.tools) break;\n } else {\n this.config.initialBlock = config.initialBlock;\n }\n }\n\n /**\n * Returns private property\n * @returns {EditorConfig}\n */\n get configuration() {\n return this.config;\n }\n\n /**\n * Initializes modules:\n * - make and save instances\n * - configure\n */\n init() {\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n this.constructModules();\n\n /**\n * Modules configuration\n */\n this.configureModules();\n }\n\n /**\n * Make modules instances and save it to the @property this.moduleInstances\n */\n constructModules() {\n modules.forEach( Module => {\n try {\n /**\n * We use class name provided by displayName property\n *\n * On build, Babel will transform all Classes to the Functions so, name will always be 'Function'\n * To prevent this, we use 'babel-plugin-class-display-name' plugin\n * @see https://www.npmjs.com/package/babel-plugin-class-display-name\n */\n this.moduleInstances[Module.displayName] = new Module({\n config : this.configuration\n });\n } catch ( e ) {\n console.log('Module %o skipped because %o', Module, e);\n }\n });\n }\n\n /**\n * Modules instances configuration:\n * - pass other modules to the 'state' property\n * - ...\n */\n configureModules() {\n for(let name in this.moduleInstances) {\n /**\n * Module does not need self-instance\n */\n this.moduleInstances[name].state = this.getModulesDiff( name );\n }\n }\n\n /**\n * Return modules without passed name\n */\n getModulesDiff( name ) {\n let diff = {};\n\n for(let moduleName in this.moduleInstances) {\n /**\n * Skip module with passed name\n */\n if (moduleName === name) {\n continue;\n }\n diff[moduleName] = this.moduleInstances[moduleName];\n }\n\n return diff;\n }\n\n /**\n * Start Editor!\n *\n * Get list of modules that needs to be prepared and return a sequence (Promise)\n * @return {Promise}\n */\n start() {\n let prepareDecorator = module => module.prepare();\n\n return Promise.resolve()\n .then(prepareDecorator(this.moduleInstances.Tools))\n .then(prepareDecorator(this.moduleInstances.UI))\n .then(prepareDecorator(this.moduleInstances.BlockManager))\n .then(() => {\n return this.moduleInstances.Renderer.render(this.config.data.items);\n });\n }\n};\n\n// module.exports = (function (editor) {\n//\n// 'use strict';\n//\n// editor.version = VERSION;\n// editor.scriptPrefix = 'cdx-script-';\n//\n// var init = function () {\n//\n// editor.core = require('./modules/core');\n// editor.tools = require('./modules/tools');\n// editor.ui = require('./modules/ui');\n// editor.transport = require('./modules/transport');\n// editor.renderer = require('./modules/renderer');\n// editor.saver = require('./modules/saver');\n// editor.content = require('./modules/content');\n// editor.toolbar = require('./modules/toolbar/toolbar');\n// editor.callback = require('./modules/callbacks');\n// editor.draw = require('./modules/draw');\n// editor.caret = require('./modules/caret');\n// editor.notifications = require('./modules/notifications');\n// editor.parser = require('./modules/parser');\n// editor.sanitizer = require('./modules/sanitizer');\n// editor.listeners = require('./modules/listeners');\n// editor.destroyer = require('./modules/destroyer');\n// editor.paste = require('./modules/paste');\n//\n// };\n//\n// /**\n// * @public\n// * holds initial settings\n// */\n// editor.settings = {\n// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],\n// holderId : 'codex-editor',\n//\n// // Type of block showing on empty editor\n// initialBlockPlugin: 'text'\n// };\n//\n// /**\n// * public\n// *\n// * Static nodes\n// */\n// editor.nodes = {\n// holder : null,\n// wrapper : null,\n// toolbar : null,\n// inlineToolbar : {\n// wrapper : null,\n// buttons : null,\n// actions : null\n// },\n// toolbox : null,\n// notifications : null,\n// plusButton : null,\n// showSettingsButton: null,\n// showTrashButton : null,\n// blockSettings : null,\n// pluginSettings : null,\n// defaultSettings : null,\n// toolbarButtons : {}, // { type : DomEl, ... }\n// redactor : null\n// };\n//\n// /**\n// * @public\n// *\n// * Output state\n// */\n// editor.state = {\n// jsonOutput : [],\n// blocks : [],\n// inputs : []\n// };\n//\n// /**\n// * @public\n// * Editor plugins\n// */\n// editor.tools = {};\n//\n// editor.start = function (userSettings) {\n//\n// init();\n//\n// editor.core.prepare(userSettings)\n//\n// // If all ok, make UI, bind events and parse initial-content\n// .then(editor.ui.prepare)\n// .then(editor.tools.prepare)\n// .then(editor.sanitizer.prepare)\n// .then(editor.paste.prepare)\n// .then(editor.transport.prepare)\n// .then(editor.renderer.makeBlocksFromData)\n// .then(editor.ui.saveInputs)\n// .catch(function (error) {\n//\n// editor.core.log('Initialization failed with error: %o', 'warn', error);\n//\n// });\n//\n// };\n//\n// return editor;\n//\n// })({});\n","/**\n * Working with selection\n */\nexport default class Selection {\n /**\n * @constructor\n */\n constructor() {\n this.instance = null;\n this.selection = null;\n }\n\n /**\n * Returns window Selection\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection}\n * @return {Selection}\n */\n static get() {\n return window.getSelection();\n }\n\n /**\n * Returns selected anchor\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode}\n * @return {Node|null}\n */\n static getAnchorNode() {\n let selection = window.getSelection();\n\n return selection ? selection.anchorNode : null;\n }\n\n /**\n * Returns selection offset according to the anchor node\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset}\n * @return {Number|null}\n */\n static getAnchorOffset() {\n let selection = window.getSelection();\n\n return selection ? selection.anchorOffset : null;\n }\n\n /**\n * Is current selection range collapsed\n * @return {boolean|null}\n */\n static get isCollapsed() {\n let selection = window.getSelection();\n\n return selection ? selection.isCollapsed : null;\n }\n}","/**\n * @abstract\n * @class Module\n * @classdesc All modules inherits from this class.\n *\n * @typedef {Module} Module\n * @property {Object} config - Editor user settings\n * @property {Object} Editor - List of Editor modules\n */\nexport default class Module {\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({ config }) {\n /**\n * Editor modules list\n * @type {EditorComponents}\n */\n this.Editor = null;\n /**\n * Editor configuration object\n * @type {EditorConfig}\n */\n this.config = {};\n if (new.target === Module) {\n throw new TypeError('Constructors for abstract class Module are not allowed.');\n }\n this.config = config;\n }\n /**\n * Editor modules setter\n *\n * @param Editor\n * @param Editor.modules {@link CodexEditor#moduleInstances}\n * @param Editor.config {@link CodexEditor#configuration}\n */\n set state(Editor) {\n this.Editor = Editor;\n }\n}\n","/**\n *\n * @class Block\n * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool\n *\n * @property {Tool} tool — current block tool (Paragraph, for example)\n * @property {Object} CSS — block`s css classes\n *\n */\n\n/**\n * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance\n *\n * @property tool - Tool instance\n * @property html - Returns HTML content of plugin\n * @property wrapper - Div element that wraps block content with Tool's content. Has `ce-block` CSS class\n * @property contentNode - Div element that wraps Tool's content. Has `ce-block__content` CSS class\n * @property pluginsContent - HTML content that returns by Tool's render function\n */\nexport default class Block {\n /**\n * @constructor\n * @param {String} toolName - Tool name that passed on initialization\n * @param {Object} toolInstance — passed Tool`s instance that rendered the Block\n */\n constructor(toolName, toolInstance) {\n this.name = toolName;\n this.tool = toolInstance;\n this._html = this.compose();\n }\n\n /**\n * CSS classes for the Block\n * @return {{wrapper: string, content: string}}\n */\n static get CSS() {\n return {\n wrapper: 'ce-block',\n content: 'ce-block__content',\n selected: 'ce-block--selected'\n };\n }\n\n /**\n * Make default Block wrappers and put Tool`s content there\n * @returns {HTMLDivElement}\n */\n compose() {\n this.wrapper = $.make('div', Block.CSS.wrapper);\n this.contentNode = $.make('div', Block.CSS.content);\n this.pluginsContent = this.tool.render();\n\n this.contentNode.appendChild(this.pluginsContent);\n this.wrapper.appendChild(this.contentNode);\n\n return this.wrapper;\n }\n\n /**\n * Calls Tool's method\n *\n * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function\n *\n * @param {String} methodName\n * @param {Object} params\n */\n call(methodName, params) {\n /**\n * call Tool's method with the instance context\n */\n if (this.tool[methodName] && this.tool[methodName] instanceof Function) {\n this.tool[methodName].call(this.tool, params);\n }\n }\n\n /**\n * Get Block`s HTML\n * @returns {HTMLElement}\n */\n get html() {\n return this._html;\n }\n\n /**\n * Get Block's JSON data\n * @return {Object}\n */\n get data() {\n return this.save();\n }\n\n /**\n * is block mergeable\n * We plugin have merge function then we call it mergable\n * @return {boolean}\n */\n get mergeable() {\n return typeof this.tool.merge === 'function';\n }\n\n /**\n * Call plugins merge method\n * @param {Object} data\n */\n mergeWith(data) {\n return Promise.resolve()\n .then(() => {\n this.tool.merge(data);\n });\n }\n /**\n * Extracts data from Block\n * Groups Tool's save processing time\n * @return {Object}\n */\n save() {\n let extractedBlock = this.tool.save(this.pluginsContent);\n\n /** Measuring execution time*/\n let measuringStart = window.performance.now(),\n measuringEnd;\n\n return Promise.resolve(extractedBlock)\n .then((finishedExtraction) => {\n /** measure promise execution */\n measuringEnd = window.performance.now();\n\n return {\n tool: this.name,\n data: finishedExtraction,\n time : measuringEnd - measuringStart\n };\n })\n .catch(function (error) {\n _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red');\n });\n }\n\n /**\n * Uses Tool's validation method to check the correctness of output data\n * Tool's validation method is optional\n *\n * @description Method also can return data if it passed the validation\n *\n * @param {Object} data\n * @returns {Boolean|Object} valid\n */\n validateData(data) {\n let isValid = true;\n\n if (this.tool.validate instanceof Function) {\n isValid = this.tool.validate(data);\n }\n\n if (!isValid) {\n return false;\n }\n\n return data;\n }\n\n /**\n * Check block for emptiness\n * @return {Boolean}\n */\n get isEmpty() {\n /**\n * Allow Tool to represent decorative contentless blocks: for example \"* * *\"-tool\n * That Tools are not empty\n */\n if (this.tool.contentless) {\n return false;\n }\n\n let emptyText = $.isEmpty(this.pluginsContent),\n emptyMedia = !this.hasMedia;\n\n return emptyText && emptyMedia;\n }\n\n /**\n * Check if block has a media content such as images, iframes and other\n * @return {Boolean}\n */\n get hasMedia() {\n /**\n * This tags represents media-content\n * @type {string[]}\n */\n const mediaTags = [\n 'img',\n 'iframe',\n 'video',\n 'audio',\n 'source',\n 'input',\n 'textarea',\n 'twitterwidget'\n ];\n\n return !!this._html.querySelector(mediaTags.join(','));\n }\n\n /**\n * Set selected state\n * @param {Boolean} state - 'true' to select, 'false' to remove selection\n */\n set selected(state) {\n /**\n * We don't need to mark Block as Selected when it is not empty\n */\n if (state === true && !this.isEmpty) {\n this._html.classList.add(Block.CSS.selected);\n } else {\n this._html.classList.remove(Block.CSS.selected);\n }\n }\n}","/**\n * DOM manipulations helper\n */\nexport default class Dom {\n /**\n * Check if passed tag has no closed tag\n * @param {Element} tag\n * @return {Boolean}\n */\n static isSingleTag(tag) {\n return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName);\n };\n\n\n /**\n * Helper for making Elements with classname and attributes\n *\n * @param {string} tagName - new Element tag name\n * @param {array|string} classNames - list or name of CSS classname(s)\n * @param {Object} attributes - any attributes\n * @return {Element}\n */\n static make(tagName, classNames = null, attributes = {}) {\n let el = document.createElement(tagName);\n\n if ( Array.isArray(classNames) ) {\n el.classList.add(...classNames);\n } else if( classNames ) {\n el.classList.add(classNames);\n }\n\n for (let attrName in attributes) {\n el[attrName] = attributes[attrName];\n }\n\n return el;\n }\n\n /**\n * Creates Text Node with the passed content\n * @param {String} content - text content\n * @return {Text}\n */\n static text(content) {\n return document.createTextNode(content);\n }\n\n /**\n * Append one or several elements to the parent\n *\n * @param {Element} parent - where to append\n * @param {Element|Element[]} - element ore elements list\n */\n static append(parent, elements) {\n if ( Array.isArray(elements) ) {\n elements.forEach( el => parent.appendChild(el) );\n } else {\n parent.appendChild(elements);\n }\n }\n\n /**\n * Selector Decorator\n *\n * Returns first match\n *\n * @param {Element} el - element we searching inside. Default - DOM Document\n * @param {String} selector - searching string\n *\n * @returns {Element}\n */\n static find(el = document, selector) {\n return el.querySelector(selector);\n }\n\n /**\n * Selector Decorator.\n *\n * Returns all matches\n *\n * @param {Element} el - element we searching inside. Default - DOM Document\n * @param {String} selector - searching string\n * @returns {NodeList}\n */\n static findAll(el = document, selector) {\n return el.querySelectorAll(selector);\n }\n\n /**\n * Search for deepest node which is Leaf.\n * Leaf is the vertex that doesn't have any child nodes\n *\n * @description Method recursively goes throw the all Node until it finds the Leaf\n *\n * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search}\n * @param {Boolean} atLast - find last text node\n * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it\n */\n static getDeepestNode(node, atLast = false) {\n /**\n * Current function have two directions:\n * - starts from first child and every time gets first or nextSibling in special cases\n * - starts from last child and gets last or previousSibling\n * @type {string}\n */\n let child = atLast ? 'lastChild' : 'firstChild',\n sibling = atLast ? 'previousSibling' : 'nextSibling';\n\n if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) {\n let nodeChild = node[child];\n\n /**\n * special case when child is single tag that can't contain any content\n */\n if (Dom.isSingleTag(nodeChild)) {\n /**\n * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest\n * from sibling\n *\n * 2) If single tag's next sibling is null, then go back to parent and check his sibling\n * In case of Node Element continue searching\n *\n * 3) If none of conditions above happened return parent Node Element\n */\n if (nodeChild[sibling]) {\n nodeChild = nodeChild[sibling];\n } else if (nodeChild.parentNode[sibling]) {\n nodeChild = nodeChild.parentNode[sibling];\n } else {\n return nodeChild.parentNode;\n }\n }\n\n return this.getDeepestNode(nodeChild, atLast);\n }\n\n return node;\n }\n\n /**\n * Check if object is DOM node\n *\n * @param {Object} node\n * @returns {boolean}\n */\n static isElement(node) {\n return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE;\n }\n\n /**\n * Checks target if it is native input\n * @param {Element|String} target - HTML element or string\n * @return {Boolean}\n */\n static isNativeInput(target) {\n let nativeInputs = [\n 'INPUT',\n 'TEXTAREA'\n ];\n\n return target ? nativeInputs.includes(target.tagName) : false;\n }\n\n /**\n * Checks node if it is empty\n *\n * @description Method checks simple Node without any childs for emptiness\n * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method\n *\n * @param {Node} node\n * @return {Boolean} true if it is empty\n */\n static isNodeEmpty(node) {\n let nodeText;\n\n if ( this.isElement(node) && this.isNativeInput(node) ) {\n nodeText = node.value;\n } else {\n nodeText = node.textContent.replace('\\u200B', '');\n }\n\n return nodeText.trim().length === 0;\n }\n\n /**\n * checks node if it is doesn't have any child nodes\n * @param {Node} node\n * @return {boolean}\n */\n static isLeaf(node) {\n if (!node) {\n return false;\n }\n\n return node.childNodes.length === 0;\n }\n\n /**\n * breadth-first search (BFS)\n * {@link https://en.wikipedia.org/wiki/Breadth-first_search}\n *\n * @description Pushes to stack all DOM leafs and checks for emptiness\n *\n * @param {Node} node\n * @return {boolean}\n */\n static isEmpty(node) {\n let treeWalker = [],\n leafs = [];\n\n if (!node) {\n return true;\n }\n\n if (!node.childNodes.length) {\n return this.isNodeEmpty(node);\n }\n\n treeWalker.push(node.firstChild);\n\n while ( treeWalker.length > 0 ) {\n node = treeWalker.shift();\n\n if (!node) continue;\n\n if ( this.isLeaf(node) ) {\n leafs.push(node);\n } else {\n treeWalker.push(node.firstChild);\n }\n\n while ( node && node.nextSibling ) {\n node = node.nextSibling;\n\n if (!node) continue;\n\n treeWalker.push(node);\n }\n\n /**\n * If one of childs is not empty, checked Node is not empty too\n */\n if (node && !this.isNodeEmpty(node)) {\n return false;\n }\n }\n\n return leafs.every( leaf => this.isNodeEmpty(leaf) );\n }\n};","var map = {\n\t\"./blockManager.js\": \"./src/components/modules/blockManager.js\",\n\t\"./caret.js\": \"./src/components/modules/caret.js\",\n\t\"./events.js\": \"./src/components/modules/events.js\",\n\t\"./keyboard.js\": \"./src/components/modules/keyboard.js\",\n\t\"./listeners.js\": \"./src/components/modules/listeners.js\",\n\t\"./renderer.js\": \"./src/components/modules/renderer.js\",\n\t\"./sanitizer.js\": \"./src/components/modules/sanitizer.js\",\n\t\"./saver.js\": \"./src/components/modules/saver.js\",\n\t\"./toolbar-blockSettings.js\": \"./src/components/modules/toolbar-blockSettings.js\",\n\t\"./toolbar-inline.ts\": \"./src/components/modules/toolbar-inline.ts\",\n\t\"./toolbar-toolbox.js\": \"./src/components/modules/toolbar-toolbox.js\",\n\t\"./toolbar.js\": \"./src/components/modules/toolbar.js\",\n\t\"./tools.js\": \"./src/components/modules/tools.js\",\n\t\"./ui.js\": \"./src/components/modules/ui.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./src/components/modules sync [^_](blockManager.js|caret.js|events.js|keyboard.js|listeners.js|renderer.js|sanitizer.js|saver.js|toolbar-blockSettings.js|toolbar-inline.ts|toolbar-toolbox.js|toolbar.js|tools.js|ui.js)$\";","/**\n * @class BlockManager\n * @classdesc Manage editor`s blocks storage and appearance\n *\n * @module BlockManager\n *\n * @version 2.0.0\n */\n\nimport Block from '../block';\n\n/**\n * @typedef {BlockManager} BlockManager\n * @property {Number} currentBlockIndex - Index of current working block\n * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks}\n */\nexport default class BlockManager extends Module {\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n\n /**\n * Proxy for Blocks instance {@link Blocks}\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = null;\n\n /**\n * Index of current working block\n *\n * @type {number}\n * @private\n */\n this.currentBlockIndex = -1;\n }\n\n /**\n * Should be called after Editor.UI preparation\n * Define this._blocks property\n *\n * @returns {Promise}\n */\n prepare() {\n return new Promise(resolve => {\n let blocks = new Blocks(this.Editor.UI.nodes.redactor);\n\n /**\n * We need to use Proxy to overload set/get [] operator.\n * So we can use array-like syntax to access blocks\n *\n * @example\n * this._blocks[0] = new Block(...);\n *\n * block = this._blocks[0];\n *\n * @todo proxy the enumerate method\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = new Proxy(blocks, {\n set: Blocks.set,\n get: Blocks.get\n });\n\n resolve();\n });\n }\n\n /**\n * Creates Block instance by tool name\n *\n * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools}\n * @param {Object} data - constructor params\n *\n * @return {Block}\n */\n composeBlock(toolName, data) {\n let toolInstance = this.Editor.Tools.construct(toolName, data),\n block = new Block(toolName, toolInstance);\n\n this.bindEvents(block);\n\n /**\n * Apply callback before inserting html\n */\n block.call('appendCallback', {});\n\n return block;\n }\n\n /**\n * Bind Events\n * @param {Object} block\n */\n bindEvents(block) {\n this.Editor.Listeners.on(block.pluginsContent, 'keydown', (event) => this.Editor.Keyboard.blockKeydownsListener(event));\n this.Editor.Listeners.on(block.pluginsContent, 'mouseup', (event) => {\n this.Editor.InlineToolbar.move(event);\n });\n }\n\n /**\n * Set's caret to the next Block\n * Before moving caret, we should check if caret position is at the end of Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n */\n navigateNext() {\n let caretAtEnd = this.Editor.Caret.isAtEnd;\n\n if (!caretAtEnd) {\n return;\n }\n\n let nextBlock = this.nextBlock;\n\n if (!nextBlock) {\n return;\n }\n\n this.Editor.Caret.setToBlock( nextBlock );\n }\n\n /**\n * Set's caret to the previous Block\n * Before moving caret, we should check if caret position is start of the Plugins node\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\n */\n navigatePrevious() {\n let caretAtStart = this.Editor.Caret.isAtStart;\n\n if (!caretAtStart) {\n return;\n }\n\n let previousBlock = this.previousBlock;\n\n if (!previousBlock) {\n return;\n }\n\n this.Editor.Caret.setToBlock( previousBlock, 0, true );\n }\n\n /**\n * Insert new block into _blocks\n *\n * @param {String} toolName — plugin name\n * @param {Object} data — plugin data\n */\n insert(toolName, data = {}) {\n let block = this.composeBlock(toolName, data);\n\n this._blocks[++this.currentBlockIndex] = block;\n this.Editor.Caret.setToBlock(block);\n }\n\n /**\n * Merge two blocks\n * @param {Block} targetBlock - previous block will be append to this block\n * @param {Block} blockToMerge - block that will be merged with target block\n *\n * @return {Promise} - the sequence that can be continued\n */\n mergeBlocks(targetBlock, blockToMerge) {\n let blockToMergeIndex = this._blocks.indexOf(blockToMerge);\n\n return Promise.resolve()\n .then( () => {\n if (blockToMerge.isEmpty) {\n return;\n }\n\n return blockToMerge.data\n .then((blockToMergeInfo) => {\n targetBlock.mergeWith(blockToMergeInfo.data);\n });\n })\n .then( () => {\n this.removeBlock(blockToMergeIndex);\n this.currentBlockIndex = this._blocks.indexOf(targetBlock);\n });\n }\n\n /**\n * Remove block with passed index or remove last\n * @param {Number|null} index\n */\n removeBlock(index) {\n this._blocks.remove(index);\n }\n /**\n * Split current Block\n * 1. Extract content from Caret position to the Block`s end\n * 2. Insert a new Block below current one with extracted content\n */\n split() {\n let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(),\n wrapper = $.make('div');\n\n wrapper.append(extractedFragment);\n\n /**\n * @todo make object in accordance with Tool\n */\n let data = {\n text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML,\n };\n\n this.insert(this.config.initialBlock, data);\n }\n\n /**\n * Replace current working block\n *\n * @param {String} toolName — plugin name\n * @param {Object} data — plugin data\n */\n replace(toolName, data = {}) {\n let block = this.composeBlock(toolName, data);\n\n this._blocks.insert(this.currentBlockIndex, block, true);\n }\n\n /**\n * returns last Block\n * @return {Block}\n */\n get lastBlock() {\n return this._blocks[this._blocks.length - 1];\n }\n\n /**\n * Returns Block by passed index\n * @param {Number} index\n * @return {Block}\n */\n getBlockByIndex(index) {\n return this._blocks[index];\n }\n\n /**\n * Get Block instance by html element\n * @param {HTMLElement} element\n * @returns {Block}\n */\n getBlock(element) {\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`),\n index = nodes.indexOf(firstLevelBlock);\n\n if (index >= 0) {\n return this._blocks[index];\n }\n }\n\n /**\n * Get current Block instance\n *\n * @return {Block}\n */\n get currentBlock() {\n return this._blocks[this.currentBlockIndex];\n }\n\n /**\n * Returns next Block instance\n * @return {Block|null}\n */\n get nextBlock() {\n let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1);\n\n if (isLastBlock) {\n return null;\n }\n\n return this._blocks[this.currentBlockIndex + 1];\n }\n\n /**\n * Returns previous Block instance\n * @return {Block|null}\n */\n get previousBlock() {\n let isFirstBlock = this.currentBlockIndex === 0;\n\n if (isFirstBlock) {\n return null;\n }\n\n return this._blocks[this.currentBlockIndex - 1];\n }\n\n /**\n * Get working html element\n *\n * @return {HTMLElement}\n */\n get currentNode() {\n return this._blocks.nodes[this.currentBlockIndex];\n }\n\n /**\n * Set currentBlockIndex to passed block\n * @param {HTMLElement} element\n */\n set currentNode(element) {\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`);\n\n /**\n * Update current Block's index\n * @type {number}\n */\n this.currentBlockIndex = nodes.indexOf(firstLevelBlock);\n\n /**\n * Remove previous selected Block's state\n */\n this._blocks.array.forEach( block => block.selected = false);\n\n /**\n * Mark current Block as selected\n * @type {boolean}\n */\n this.currentBlock.selected = true;\n }\n\n /**\n * Get array of Block instances\n *\n * @returns {Block[]} {@link Blocks#array}\n */\n get blocks() {\n return this._blocks.array;\n }\n\n /**\n * 1) Find first-level Block from passed child Node\n * 2) Mark it as current\n *\n * @param {Element|Text} childNode - look ahead from this node.\n * @throws Error - when passed Node is not included at the Block\n */\n setCurrentBlockByChildNode(childNode) {\n /**\n * If node is Text TextNode\n */\n if (!$.isElement(childNode)) {\n childNode = childNode.parentNode;\n }\n\n let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`);\n\n if (parentFirstLevelBlock) {\n this.currentNode = parentFirstLevelBlock;\n } else {\n throw new Error('Can not find a Block from this child Node');\n }\n }\n};\n\n/**\n * @class Blocks\n * @classdesc Class to work with Block instances array\n *\n * @private\n *\n * @property {HTMLElement} workingArea — editor`s working node\n *\n */\nclass Blocks {\n /**\n * @constructor\n *\n * @param {HTMLElement} workingArea — editor`s working node\n */\n constructor(workingArea) {\n this.blocks = [];\n this.workingArea = workingArea;\n }\n\n /**\n * Push back new Block\n *\n * @param {Block} block\n */\n push(block) {\n this.blocks.push(block);\n this.workingArea.appendChild(block.html);\n }\n\n /**\n * Insert new Block at passed index\n *\n * @param {Number} index — index to insert Block\n * @param {Block} block — Block to insert\n * @param {Boolean} replace — it true, replace block on given index\n */\n insert(index, block, replace = false) {\n if (!this.length) {\n this.push(block);\n return;\n }\n\n if (index > this.length) {\n index = this.length;\n }\n\n if (replace) {\n this.blocks[index].html.remove();\n }\n\n let deleteCount = replace ? 1 : 0;\n\n this.blocks.splice(index, deleteCount, block);\n\n if (index > 0) {\n let previousBlock = this.blocks[index - 1];\n\n previousBlock.html.insertAdjacentElement('afterend', block.html);\n } else {\n let nextBlock = this.blocks[index + 1];\n\n if (nextBlock) {\n nextBlock.html.insertAdjacentElement('beforebegin', block.html);\n } else {\n this.workingArea.appendChild(block.html);\n }\n }\n }\n\n /**\n * Remove block\n * @param {Number|null} index\n */\n remove(index) {\n if (!index) {\n index = this.length - 1;\n }\n\n this.blocks[index].html.remove();\n this.blocks.splice(index, 1);\n }\n\n /**\n * Insert Block after passed target\n *\n * @todo decide if this method is necessary\n *\n * @param {Block} targetBlock — target after wich Block should be inserted\n * @param {Block} newBlock — Block to insert\n */\n insertAfter(targetBlock, newBlock) {\n let index = this.blocks.indexOf(targetBlock);\n\n this.insert(index + 1, newBlock);\n }\n\n /**\n * Get Block by index\n *\n * @param {Number} index — Block index\n * @returns {Block}\n */\n get(index) {\n return this.blocks[index];\n }\n\n /**\n * Return index of passed Block\n *\n * @param {Block} block\n * @returns {Number}\n */\n indexOf(block) {\n return this.blocks.indexOf(block);\n }\n\n /**\n * Get length of Block instances array\n *\n * @returns {Number}\n */\n get length() {\n return this.blocks.length;\n }\n\n /**\n * Get Block instances array\n *\n * @returns {Block[]}\n */\n get array() {\n return this.blocks;\n }\n\n /**\n * Get blocks html elements array\n *\n * @returns {HTMLElement[]}\n */\n get nodes() {\n return _.array(this.workingArea.children);\n }\n\n /**\n * Proxy trap to implement array-like setter\n *\n * @example\n * blocks[0] = new Block(...)\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — block index\n * @param {Block} block — Block to set\n * @returns {Boolean}\n */\n static set(instance, index, block) {\n if (isNaN(Number(index))) {\n return false;\n }\n\n instance.insert(index, block);\n\n return true;\n }\n\n /**\n * Proxy trap to implement array-like getter\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — Block index\n * @returns {Block|*}\n */\n static get(instance, index) {\n if (isNaN(Number(index))) {\n return instance[index];\n }\n\n return instance.get(index);\n }\n}","/**\n * @class Caret\n * @classdesc Contains methods for working Caret\n *\n * Uses Range methods to manipulate with caret\n *\n * @module Caret\n *\n * @version 2.0.0\n */\n\n/**\n * @typedef {Caret} Caret\n */\nimport Selection from '../Selection';\n\nexport default class Caret extends Module {\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n }\n\n /**\n * Method gets Block instance and puts caret to the text node with offset\n * There two ways that method applies caret position:\n * - first found text node: sets at the beginning, but you can pass an offset\n * - last found text node: sets at the end of the node. Also, you can customize the behaviour\n *\n * @param {Block} block - Block class\n * @param {Number} offset - caret offset regarding to the text node\n * @param {Boolean} atEnd - put caret at the end of the text node or not\n */\n setToBlock(block, offset = 0, atEnd = false) {\n let element = block.pluginsContent;\n\n /** If Element is INPUT */\n if ($.isNativeInput(element)) {\n element.focus();\n return;\n }\n\n let nodeToSet = $.getDeepestNode(element, atEnd);\n\n if (atEnd || offset > nodeToSet.length) {\n offset = nodeToSet.length;\n }\n\n /** if found deepest node is native input */\n if ($.isNativeInput(nodeToSet)) {\n nodeToSet.focus();\n return;\n }\n\n /**\n * @todo try to fix via Promises or use querySelectorAll to not to use timeout\n */\n _.delay( () => {\n this.set(nodeToSet, offset);\n }, 20)();\n\n this.Editor.BlockManager.currentNode = block.wrapper;\n }\n\n /**\n * Creates Document Range and sets caret to the element with offset\n * @param {Element} element - target node.\n * @param {Number} offset - offset\n */\n set( element, offset = 0) {\n let range = document.createRange(),\n selection = Selection.get();\n\n range.setStart(element, offset);\n range.setEnd(element, offset);\n\n selection.removeAllRanges();\n selection.addRange(range);\n };\n\n /**\n * Set Caret to the last Block\n * If last block is not empty, append another empty block\n */\n setToTheLastBlock() {\n let lastBlock = this.Editor.BlockManager.lastBlock;\n\n if (!lastBlock) return;\n\n /**\n * If last block is empty and it is an initialBlock, set to that.\n * Otherwise, append new empty block and set to that\n */\n if (lastBlock.isEmpty) {\n this.setToBlock(lastBlock);\n } else {\n this.Editor.BlockManager.insert(this.config.initialBlock);\n }\n }\n\n /**\n * Extract content fragment of current Block from Caret position to the end of the Block\n */\n extractFragmentFromCaretPosition() {\n let selection = Selection.get();\n\n if (selection.rangeCount) {\n let selectRange = selection.getRangeAt(0),\n blockElem = this.Editor.BlockManager.currentBlock.pluginsContent;\n\n selectRange.deleteContents();\n\n if (blockElem) {\n let range = selectRange.cloneRange(true);\n\n range.selectNodeContents(blockElem);\n range.setStart(selectRange.endContainer, selectRange.endOffset);\n return range.extractContents();\n }\n }\n }\n\n /**\n * Get all first-level (first child of [contenteditabel]) siblings from passed node\n * Then you can check it for emptiness\n *\n * @example\n *

    \n *\n * @return {Element[]}\n */\n getHigherLevelSiblings(from, direction ) {\n let current = from,\n siblings = [];\n\n /**\n * Find passed node's firs-level parent (in example - blockquote)\n */\n while (current.parentNode && current.parentNode.contentEditable !== 'true') {\n current = current.parentNode;\n }\n\n let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling';\n\n /**\n * Find all left/right siblings\n */\n while (current[sibling]) {\n current = current[sibling];\n siblings.push(current);\n }\n\n return siblings;\n }\n\n /**\n * Get's deepest first node and checks if offset is zero\n * @return {boolean}\n */\n get isAtStart() {\n /**\n * Don't handle ranges\n */\n if (!Selection.isCollapsed) {\n return false;\n }\n\n let selection = Selection.get(),\n anchorNode = selection.anchorNode,\n firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent);\n\n /**\n * Workaround case when caret in the text like \" |Hello!\"\n * selection.anchorOffset is 1, but real caret visible position is 0\n * @type {number}\n */\n let firstLetterPosition = anchorNode.textContent.search(/\\S/);\n\n if (firstLetterPosition === -1) { // empty text\n firstLetterPosition = 0;\n }\n\n /**\n * In case of\n *
    \n *

    <-- first (and deepest) node is \n * |adaddad <-- anchor node\n *
    \n */\n if ($.isEmpty(firstNode)) {\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'),\n nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) );\n\n\n\n if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) {\n return true;\n }\n }\n\n return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition;\n }\n\n /**\n * Get's deepest last node and checks if offset is last node text length\n * @return {boolean}\n */\n get isAtEnd() {\n /**\n * Don't handle ranges\n */\n if (!Selection.isCollapsed) {\n return false;\n }\n\n let selection = Selection.get(),\n anchorNode = selection.anchorNode,\n lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true);\n\n /**\n * In case of\n *
    \n * adaddad| <-- anchor node\n *

    <-- first (and deepest) node is \n *
    \n */\n if ($.isEmpty(lastNode)) {\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'),\n nothingAtRight = leftSiblings.every( node => $.isEmpty(node) );\n\n if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) {\n return true;\n }\n }\n\n return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length;\n }\n}\n","/**\n * @module eventDispatcher\n *\n * Has two important methods:\n * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one\n * - {Function} emit - fires all subscribers with data\n *\n * @version 1.0.0\n *\n * @typedef {Events} Events\n * @property {Object} subscribers - all subscribers grouped by event name\n */\nexport default class Events extends Module {\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n this.subscribers = {};\n }\n\n /**\n * @param {String} eventName - event name\n * @param {Function} callback - subscriber\n */\n on(eventName, callback) {\n if (!(eventName in this.subscribers)) {\n this.subscribers[eventName] = [];\n }\n\n // group by events\n this.subscribers[eventName].push(callback);\n }\n\n /**\n * @param {String} eventName - event name\n * @param {Object} data - subscribers get this data when they were fired\n */\n emit(eventName, data) {\n this.subscribers[eventName].reduce(function (previousData, currentHandler) {\n let newData = currentHandler(previousData);\n\n return newData ? newData : previousData;\n }, data);\n }\n\n /**\n * Destroyer\n * clears subsribers list\n */\n destroy() {\n this.subscribers = null;\n }\n}","/**\n * @class Keyboard\n * @classdesc Сlass to handle the keydowns\n *\n * @author CodeX Team (team@ifmo.su)\n * @copyright CodeX Team 2017\n * @license The MIT License (MIT)\n * @version 1.0.0\n */\n\n/**\n * @typedef {Keyboard} Keyboard\n */\nexport default class Keyboard extends Module {\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n }\n\n /**\n * Handler on Block for keyboard keys at keydown event\n *\n * @param {KeyboardEvent} event\n */\n blockKeydownsListener(event) {\n switch(event.keyCode) {\n case _.keyCodes.BACKSPACE:\n\n _.log('Backspace key pressed');\n this.backspacePressed(event);\n break;\n\n case _.keyCodes.ENTER:\n\n _.log('Enter key pressed');\n this.enterPressed(event);\n break;\n\n case _.keyCodes.DOWN:\n case _.keyCodes.RIGHT:\n\n _.log('Right/Down key pressed');\n this.arrowRightAndDownPressed();\n break;\n\n case _.keyCodes.UP:\n case _.keyCodes.LEFT:\n\n _.log('Left/Up key pressed');\n this.arrowLeftAndUpPressed();\n break;\n\n default:\n\n break;\n }\n }\n\n /**\n * Handle pressing enter key\n *\n * @param {KeyboardEvent} event\n */\n enterPressed(event) {\n let currentBlock = this.Editor.BlockManager.currentBlock,\n toolsConfig = this.config.toolsConfig[currentBlock.name];\n\n /**\n * Don't handle Enter keydowns when Tool sets enableLineBreaks to true.\n * Uses for Tools like where line breaks should be handled by default behaviour.\n */\n if (toolsConfig && toolsConfig.enableLineBreaks) {\n return;\n }\n\n /**\n * Allow to create linebreaks by Shift+Enter\n */\n if (event.shiftKey) {\n return;\n }\n\n\n /**\n * Split the Current Block into two blocks\n */\n this.Editor.BlockManager.split();\n event.preventDefault();\n }\n\n /**\n * Handle backspace keypress on block\n * @param {KeyboardEvent} event - keydown\n */\n backspacePressed(event) {\n const BM = this.Editor.BlockManager;\n\n let isFirstBlock = BM.currentBlockIndex === 0,\n canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock;\n\n if (!canMergeBlocks) {\n return;\n }\n\n // preventing browser default behaviour\n event.preventDefault();\n\n let targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1),\n blockToMerge = BM.currentBlock;\n\n /**\n * Blocks that can be merged:\n * 1) with the same Name\n * 2) Tool has 'merge' method\n *\n * other case will handle as usual ARROW LEFT behaviour\n */\n if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) {\n BM.navigatePrevious();\n }\n\n let setCaretToTheEnd = !targetBlock.isEmpty ? true : false;\n\n BM.mergeBlocks(targetBlock, blockToMerge)\n .then( () => {\n window.setTimeout( () => {\n // set caret to the block without offset at the end\n this.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd);\n this.Editor.Toolbar.close();\n }, 10);\n });\n }\n\n /**\n * Handle right and down keyboard keys\n */\n arrowRightAndDownPressed() {\n this.Editor.BlockManager.navigateNext();\n }\n\n /**\n * Handle left and up keyboard keys\n */\n arrowLeftAndUpPressed() {\n this.Editor.BlockManager.navigatePrevious();\n }\n}","/**\n * Codex Editor Listeners module\n *\n * @module Listeners\n *\n * Module-decorator for event listeners assignment\n *\n * @author Codex Team\n * @version 2.0.0\n */\n\n/**\n * @typedef {Listeners} Listeners\n * @property {Array} allListeners\n */\n\nexport default class Listeners extends Module {\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n this.allListeners = [];\n }\n\n /**\n * Assigns event listener on element\n *\n * @param {Element} element - DOM element that needs to be listened\n * @param {String} eventType - event type\n * @param {Function} handler - method that will be fired on event\n * @param {Boolean} useCapture - use event bubbling\n */\n on(element, eventType, handler, useCapture = false) {\n let assignedEventData = {\n element,\n eventType,\n handler,\n useCapture\n };\n\n let alreadyExist = this.findOne(element, eventType, handler);\n\n if (alreadyExist) return;\n\n this.allListeners.push(assignedEventData);\n element.addEventListener(eventType, handler, useCapture);\n }\n\n /**\n * Removes event listener from element\n *\n * @param {Element} element - DOM element that we removing listener\n * @param {String} eventType - event type\n * @param {Function} handler - remove handler, if element listens several handlers on the same event type\n * @param {Boolean} useCapture - use event bubbling\n */\n off(element, eventType, handler, useCapture = false) {\n let existingListeners = this.findAll(element, eventType, handler);\n\n for (let i = 0; i < existingListeners.length; i++) {\n let index = this.allListeners.indexOf(existingListeners[i]);\n\n if (index > 0) {\n this.allListeners.splice(index, 1);\n }\n }\n\n element.removeEventListener(eventType, handler, useCapture);\n }\n\n /**\n * Search method: looks for listener by passed element\n * @param {Element} element - searching element\n * @returns {Array} listeners that found on element\n */\n findByElement(element) {\n let listenersOnElement = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n let listener = this.allListeners[i];\n\n if (listener.element === element) {\n listenersOnElement.push(listener);\n }\n }\n\n return listenersOnElement;\n }\n\n /**\n * Search method: looks for listener by passed event type\n * @param {String} eventType\n * @return {Array} listeners that found on element\n */\n findByType(eventType) {\n let listenersWithType = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n let listener = this.allListeners[i];\n\n if (listener.type === eventType) {\n listenersWithType.push(listener);\n }\n }\n\n return listenersWithType;\n }\n\n /**\n * Search method: looks for listener by passed handler\n * @param {Function} handler\n * @return {Array} listeners that found on element\n */\n findByHandler(handler) {\n let listenersWithHandler = [];\n\n for (let i = 0; i < this.allListeners.length; i++) {\n let listener = this.allListeners[i];\n\n if (listener.handler === handler) {\n listenersWithHandler.push(listener);\n }\n }\n\n return listenersWithHandler;\n }\n\n /**\n * @param {Element} element\n * @param {String} eventType\n * @param {Function} handler\n * @return {Element|null}\n */\n findOne(element, eventType, handler) {\n let foundListeners = this.findAll(element, eventType, handler);\n\n return foundListeners.length > 0 ? foundListeners[0] : null;\n }\n\n /**\n * @param {Element} element\n * @param {String} eventType\n * @param {Function} handler\n * @return {Array}\n */\n findAll(element, eventType, handler) {\n let foundAllListeners,\n foundByElements = [],\n foundByEventType = [],\n foundByHandler = [];\n\n if (element)\n foundByElements = this.findByElement(element);\n\n if (eventType)\n foundByEventType = this.findByType(eventType);\n\n if (handler)\n foundByHandler = this.findByHandler(handler);\n\n foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler);\n\n return foundAllListeners;\n }\n\n /**\n * Removes all listeners\n */\n removeAll() {\n this.allListeners.map( (current) => {\n current.element.removeEventListener(current.eventType, current.handler);\n });\n\n this.allListeners = [];\n }\n}","/**\n * Codex Editor Renderer Module\n *\n * @module Renderer\n * @author CodeX Team\n *\n * @version 2.0.0\n */\nexport default class Renderer extends Module {\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n }\n\n /**\n * @typedef {Object} RendererItems\n * @property {String} type - tool name\n * @property {Object} data - tool data\n */\n\n /**\n * @example\n *\n * items: [\n * {\n * type : 'paragraph',\n * data : {\n * text : 'Hello from Codex!'\n * }\n * },\n * {\n * type : 'paragraph',\n * data : {\n * text : 'Leave feedback if you like it!'\n * }\n * },\n * ]\n *\n */\n\n /**\n * Make plugin blocks from array of plugin`s data\n * @param {RendererItems[]} items\n */\n render(items) {\n let chainData = [];\n\n for (let i = 0; i < items.length; i++) {\n chainData.push({\n function: () => this.insertBlock(items[i])\n });\n }\n\n return _.sequence(chainData);\n }\n\n /**\n * Get plugin instance\n * Add plugin instance to BlockManager\n * Insert block to working zone\n *\n * @param {Object} item\n * @returns {Promise.}\n * @private\n */\n insertBlock(item) {\n let tool = item.type,\n data = item.data;\n\n this.Editor.BlockManager.insert(tool, data);\n\n return Promise.resolve();\n }\n}","/**\n * CodeX Sanitizer\n *\n * @module Sanitizer\n * Clears HTML from taint tags\n *\n * @version 2.0.0\n *\n * @example\n * Module can be used within two ways:\n * 1) When you have an instance\n * - this.Editor.Sanitizer.clean(yourTaintString);\n * 2) As static method\n * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration);\n *\n * {@link SanitizerConfig}\n */\n\n\n/**\n * @typedef {Object} SanitizerConfig\n * @property {Object} tags - define tags restrictions\n *\n * @example\n *\n * tags : {\n * p: true,\n * a: {\n * href: true,\n * rel: \"nofollow\",\n * target: \"_blank\"\n * }\n * }\n */\nexport default class Sanitizer extends Module {\n /**\n * Initializes Sanitizer module\n * Sets default configuration if custom not exists\n *\n * @property {SanitizerConfig} this.defaultConfig\n * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library\n *\n * @param {SanitizerConfig} config\n */\n constructor({config}) {\n super({config});\n\n // default config\n this.defaultConfig = null;\n this._sanitizerInstance = null;\n\n /** Custom configuration */\n this.sanitizerConfig = config.settings ? config.settings.sanitizer : {};\n\n /** HTML Janitor library */\n this.sanitizerInstance = require('html-janitor');\n }\n\n /**\n * If developer uses editor's API, then he can customize sanitize restrictions.\n * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere\n * At least, if there is no config overrides, that API uses Default configuration\n *\n * @uses https://www.npmjs.com/package/html-janitor\n *\n * @param {HTMLJanitor} library - sanitizer extension\n */\n set sanitizerInstance(library) {\n this._sanitizerInstance = new library(this.defaultConfig);\n }\n\n /**\n * Sets sanitizer configuration. Uses default config if user didn't pass the restriction\n * @param {SanitizerConfig} config\n */\n set sanitizerConfig(config) {\n if (_.isEmpty(config)) {\n this.defaultConfig = {\n tags: {\n p: {},\n a: {\n href: true,\n target: '_blank',\n rel: 'nofollow'\n }\n }\n };\n } else {\n this.defaultConfig = config;\n }\n }\n\n /**\n * Cleans string from unwanted tags\n * @param {String} taintString - HTML string\n * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty\n * @return {String} clean HTML\n */\n clean(taintString, customConfig = {}) {\n if (_.isEmpty(customConfig)) {\n return this._sanitizerInstance.clean(taintString);\n } else {\n return Sanitizer.clean(taintString, customConfig);\n }\n }\n\n /**\n * Cleans string from unwanted tags\n * @static\n *\n * Method allows to use default config\n *\n * @param {String} taintString - taint string\n * @param {SanitizerConfig} customConfig - allowed tags\n *\n * @return {String} clean HTML\n */\n static clean(taintString, customConfig) {\n let newInstance = Sanitizer(customConfig);\n\n return newInstance.clean(taintString);\n }\n}\n","/**\n * Codex Editor Saver\n *\n * @module Saver\n * @author Codex Team\n * @version 2.0.0\n */\n\n/**\n * @typedef {Object} SavedData\n * @property {Date} time - saving proccess time\n * @property {Object} items - extracted data\n * @property {String} version - CodexEditor version\n */\n\n/**\n * @classdesc This method reduces all Blocks asyncronically and calls Block's save method to extract data\n *\n * @typedef {Saver} Saver\n * @property {Element} html - Editor HTML content\n * @property {String} json - Editor JSON output\n */\n\nexport default class Saver extends Module {\n /**\n * @constructor\n * @param config\n */\n constructor({config}) {\n super({config});\n\n this.output = null;\n this.blocksData = [];\n }\n\n /**\n * Composes new chain of Promises to fire them alternatelly\n * @return {SavedData}\n */\n save() {\n let blocks = this.Editor.BlockManager.blocks,\n chainData = [];\n\n blocks.forEach((block) => {\n chainData.push(block.data);\n });\n\n return Promise.all(chainData)\n .then((allExtractedData) => this.makeOutput(allExtractedData))\n .then((outputData) => {\n return outputData;\n });\n }\n\n /**\n * Creates output object with saved data, time and version of editor\n * @param {Object} allExtractedData\n * @return {SavedData}\n */\n makeOutput(allExtractedData) {\n let items = [],\n totalTime = 0;\n\n console.groupCollapsed('[CodexEditor saving]:');\n\n allExtractedData.forEach((extraction) => {\n /** Group process info */\n console.log(`«${extraction.tool}» saving info`, extraction);\n totalTime += extraction.time;\n items.push(extraction.data);\n });\n\n console.log('Total', totalTime);\n console.groupEnd();\n\n return {\n time : +new Date(),\n items : items,\n version : VERSION,\n };\n }\n}\n\n// module.exports = (function (saver) {\n//\n// let editor = codex.editor;\n//\n// /**\n// * @public\n// * Save blocks\n// */\n// saver.save = function () {\n//\n// /** Save html content of redactor to memory */\n// editor.state.html = editor.nodes.redactor.innerHTML;\n//\n// /** Clean jsonOutput state */\n// editor.state.jsonOutput = [];\n//\n// return saveBlocks(editor.nodes.redactor.childNodes);\n//\n// };\n//\n// /**\n// * @private\n// * Save each block data\n// *\n// * @param blocks\n// * @returns {Promise.}\n// */\n// let saveBlocks = function (blocks) {\n//\n// let data = [];\n//\n// for(let index = 0; index < blocks.length; index++) {\n//\n// data.push(getBlockData(blocks[index]));\n//\n// }\n//\n// return Promise.all(data)\n// .then(makeOutput)\n// .catch(editor.core.log);\n//\n// };\n//\n// /** Save and validate block data */\n// let getBlockData = function (block) {\n//\n// return saveBlockData(block)\n// .then(validateBlockData)\n// .catch(editor.core.log);\n//\n// };\n//\n// /**\n// * @private\n// * Call block`s plugin save method and return saved data\n// *\n// * @param block\n// * @returns {Object}\n// */\n// let saveBlockData = function (block) {\n//\n// let pluginName = block.dataset.tool;\n//\n// /** Check for plugin existence */\n// if (!editor.tools[pluginName]) {\n//\n// editor.core.log(`Plugin «${pluginName}» not found`, 'error');\n// return {data: null, pluginName: null};\n//\n// }\n//\n// /** Check for plugin having save method */\n// if (typeof editor.tools[pluginName].save !== 'function') {\n//\n// editor.core.log(`Plugin «${pluginName}» must have save method`, 'error');\n// return {data: null, pluginName: null};\n//\n// }\n//\n// /** Result saver */\n// let blockContent = block.childNodes[0],\n// pluginsContent = blockContent.childNodes[0],\n// position = pluginsContent.dataset.inputPosition;\n//\n// /** If plugin wasn't available then return data from cache */\n// if ( editor.tools[pluginName].available === false ) {\n//\n// return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName});\n//\n// }\n//\n// return Promise.resolve(pluginsContent)\n// .then(editor.tools[pluginName].save)\n// .then(data => Object({data, pluginName}));\n//\n// };\n//\n// /**\n// * Call plugin`s validate method. Return false if validation failed\n// *\n// * @param data\n// * @param pluginName\n// * @returns {Object|Boolean}\n// */\n// let validateBlockData = function ({data, pluginName}) {\n//\n// if (!data || !pluginName) {\n//\n// return false;\n//\n// }\n//\n// if (editor.tools[pluginName].validate) {\n//\n// let result = editor.tools[pluginName].validate(data);\n//\n// /**\n// * Do not allow invalid data\n// */\n// if (!result) {\n//\n// return false;\n//\n// }\n//\n// }\n//\n// return {data, pluginName};\n//\n//\n// };\n//\n// /**\n// * Compile article output\n// *\n// * @param savedData\n// * @returns {{time: number, version, items: (*|Array)}}\n// */\n// let makeOutput = function (savedData) {\n//\n// savedData = savedData.filter(blockData => blockData);\n//\n// let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data}));\n//\n// editor.state.jsonOutput = items;\n//\n// return {\n// id: editor.state.blocks.id || null,\n// time: +new Date(),\n// version: editor.version,\n// items\n// };\n//\n// };\n//\n// return saver;\n//\n// })({});\n","/**\n * Block Settings\n *\n * ____ Settings Panel ____\n * | ...................... |\n * | . Tool Settings . |\n * | ...................... |\n * | . Default Settings . |\n * | ...................... |\n * |________________________|\n */\nexport default class BlockSettings extends Module {\n constructor({config}) {\n super({config});\n\n this.nodes = {\n wrapper: null,\n toolSettings: null,\n defaultSettings: null,\n buttonRemove: null\n };\n }\n\n /**\n * Block Settings CSS\n * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}}\n */\n static get CSS() {\n return {\n // Settings Panel\n wrapper: 'ce-settings',\n wrapperOpened: 'ce-settings--opened',\n toolSettings: 'ce-settings__plugin-zone',\n defaultSettings: 'ce-settings__default-zone',\n\n button: 'ce-settings__button'\n };\n }\n\n /**\n * Panel with block settings with 2 sections:\n * - Tool's Settings\n * - Default Settings [Move, Remove, etc]\n *\n * @return {Element}\n */\n make() {\n this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper);\n\n this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings);\n this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings);\n\n $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]);\n\n /**\n * Add default settings that presents for all Blocks\n */\n this.addDefaultSettings();\n }\n\n /**\n * Add Tool's settings\n */\n addToolSettings() {\n console.log('Block Settings: add settings for ',\n this.Editor.BlockManager.currentBlock\n );\n }\n\n /**\n * Add default settings\n */\n addDefaultSettings() {\n /**\n * Remove Block Button\n * --------------------------------------------\n */\n this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, {\n textContent: 'Remove Block'\n });\n\n $.append(this.nodes.defaultSettings, this.nodes.buttonRemove);\n\n this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', (event) => this.removeBlockButtonClicked(event));\n }\n\n /**\n * Clicks on the Remove Block Button\n */\n removeBlockButtonClicked() {\n console.log('❇️ Remove Block Button clicked');\n }\n\n /**\n * Is Block Settings opened or not\n * @returns {boolean}\n */\n get opened() {\n return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened);\n }\n\n /**\n * Open Block Settings pane\n */\n open() {\n this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened);\n\n /**\n * Fill Tool's settings\n */\n this.addToolSettings();\n }\n\n /**\n * Close Block Settings pane\n */\n close() {\n this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened);\n }\n}\n","export default class InlineToolbar extends Module {\n /**\n * @constructor\n */\n constructor({ config }) {\n super({ config });\n /**\n * Inline Toolbar elements\n */\n this.nodes = {\n wrapper: null,\n };\n /**\n * CSS styles\n */\n this.CSS = {\n inlineToolbar: 'ce-inline-toolbar',\n };\n }\n /**\n * Making DOM\n */\n make() {\n this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar);\n /**\n * Append Inline Toolbar to the Editor\n */\n $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\n }\n move() {\n // moving\n }\n}\n","/**\n * @class Toolbox\n * @classdesc Holder for Tools\n *\n * @typedef {Toolbox} Toolbox\n * @property {Boolean} opened - opening state\n * @property {Object} nodes - Toolbox nodes\n * @property {Object} CSS - CSS class names\n *\n */\nexport default class Toolbox extends Module {\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n\n this.nodes = {\n toolbox: null,\n buttons: []\n };\n\n /**\n * Opening state\n * @type {boolean}\n */\n this.opened = false;\n }\n\n /**\n * CSS styles\n * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}}\n */\n static get CSS() {\n return {\n toolbox: 'ce-toolbox',\n toolboxButton: 'ce-toolbox__button',\n toolboxOpened: 'ce-toolbox--opened',\n };\n }\n\n /**\n * Makes the Toolbox\n */\n make() {\n this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox);\n $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox);\n\n this.addTools();\n }\n\n /**\n * Iterates available tools and appends them to the Toolbox\n */\n addTools() {\n let tools = this.Editor.Tools.toolsAvailable;\n\n for (let toolName in tools) {\n this.addTool(toolName, tools[toolName]);\n }\n }\n\n /**\n * Append Tool to the Toolbox\n *\n * @param {string} toolName - tool name\n * @param {Tool} tool - tool class\n */\n addTool(toolName, tool) {\n if (tool.displayInToolbox && !tool.iconClassName) {\n _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName);\n return;\n }\n\n /**\n * @todo Add checkup for the render method\n */\n // if (typeof tool.render !== 'function') {\n //\n // _.log('render method missed. Tool %o skipped', 'warn', tool);\n // return;\n //\n // }\n\n /**\n * Skip tools that pass 'displayInToolbox=false'\n */\n if (!tool.displayInToolbox) {\n return;\n }\n\n let button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], {\n title: toolName\n });\n\n /**\n * Save tool's name in the button data-name\n */\n button.dataset.name = toolName;\n\n $.append(this.nodes.toolbox, button);\n\n this.nodes.toolbox.appendChild(button);\n this.nodes.buttons.push(button);\n\n /**\n * @todo add event with module Listeners\n */\n // this.Editor.Listeners.add();\n button.addEventListener('click', event => {\n this.buttonClicked(event);\n }, false);\n }\n\n /**\n * Toolbox button click listener\n * 1) if block is empty -> replace\n * 2) if block is not empty -> add new block below\n *\n * @param {MouseEvent} event\n */\n buttonClicked(event) {\n let toolButton = event.target,\n toolName = toolButton.dataset.name,\n tool = this.Editor.Tools.toolClasses[toolName];\n\n /**\n * @type {Block}\n */\n let currentBlock = this.Editor.BlockManager.currentBlock;\n\n /**\n * We do replace if:\n * - block is empty\n * - block is not irreplaceable\n * @type {Array}\n */\n if (!tool.irreplaceable && currentBlock.isEmpty) {\n this.Editor.BlockManager.replace(toolName);\n } else {\n this.Editor.BlockManager.insert(toolName);\n }\n\n /**\n * @todo set caret to the new block\n */\n\n // window.setTimeout(function () {\n\n /** Set caret to current block */\n // editor.caret.setToBlock(currentInputIndex);\n\n // }, 10);\n\n /**\n * Move toolbar when node is changed\n */\n this.Editor.Toolbar.move();\n }\n\n /**\n * Open Toolbox with Tools\n */\n open() {\n this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened);\n this.opened = true;\n }\n\n /**\n * Close Toolbox\n */\n close() {\n this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened);\n this.opened = false;\n }\n\n /**\n * Close Toolbox\n */\n toggle() {\n if (!this.opened) {\n this.open();\n } else {\n this.close();\n }\n }\n}","/**\n *\n * «Toolbar» is the node that moves up/down over current block\n *\n * ______________________________________ Toolbar ____________________________________________\n * | |\n * | ..................... Content .................... ......... Block Actions .......... |\n * | . . . . |\n * | . . . [Open Settings] [Remove Block] . |\n * | . [Plus Button] [Toolbox: {Tool1}, {Tool2}] . . . |\n * | . . . [Settings Panel] . |\n * | .................................................. .................................. |\n * | |\n * |___________________________________________________________________________________________|\n *\n *\n * Toolbox — its an Element contains tools buttons. Can be shown by Plus Button.\n *\n * _______________ Toolbox _______________\n * | |\n * | [Header] [Image] [List] [Quote] ... |\n * |_______________________________________|\n *\n *\n * Settings Panel — is an Element with block settings:\n *\n * ____ Settings Panel ____\n * | ...................... |\n * | . Tool Settings . |\n * | ...................... |\n * | . Default Settings . |\n * | ...................... |\n * |________________________|\n *\n *\n * @class\n * @classdesc Toolbar module\n *\n * @typedef {Toolbar} Toolbar\n * @property {Object} nodes\n * @property {Element} nodes.wrapper - Toolbar main element\n * @property {Element} nodes.content - Zone with Plus button and toolbox.\n * @property {Element} nodes.actions - Zone with Block Settings and Remove Button\n * @property {Element} nodes.blockActionsButtons - Zone with Block Buttons: [Settings]\n * @property {Element} nodes.plusButton - Button that opens or closes Toolbox\n * @property {Element} nodes.toolbox - Container for tools\n * @property {Element} nodes.settingsToggler - open/close Settings Panel button\n * @property {Element} nodes.settings - Settings Panel\n * @property {Element} nodes.pluginSettings - Plugin Settings section of Settings Panel\n * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel\n */\nexport default class Toolbar extends Module {\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n\n this.nodes = {\n wrapper : null,\n content : null,\n actions : null,\n\n // Content Zone\n plusButton : null,\n\n // Actions Zone\n blockActionsButtons: null,\n settingsToggler : null,\n };\n }\n\n /**\n * CSS styles\n * @return {Object}\n * @constructor\n */\n static get CSS() {\n return {\n toolbar: 'ce-toolbar',\n content: 'ce-toolbar__content',\n actions: 'ce-toolbar__actions',\n\n toolbarOpened: 'ce-toolbar--opened',\n\n // Content Zone\n plusButton: 'ce-toolbar__plus',\n plusButtonHidden: 'ce-toolbar__plus--hidden',\n\n // Actions Zone\n blockActionsButtons: 'ce-toolbar__actions-buttons',\n settingsToggler: 'ce-toolbar__settings-btn',\n };\n }\n\n /**\n * Makes toolbar\n */\n make() {\n this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar);\n\n /**\n * Make Content Zone and Actions Zone\n */\n ['content', 'actions'].forEach( el => {\n this.nodes[el] = $.make('div', Toolbar.CSS[el]);\n $.append(this.nodes.wrapper, this.nodes[el]);\n });\n\n\n /**\n * Fill Content Zone:\n * - Plus Button\n * - Toolbox\n */\n this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton);\n $.append(this.nodes.content, this.nodes.plusButton);\n this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false);\n\n\n /**\n * Make a Toolbox\n */\n this.Editor.Toolbox.make();\n\n /**\n * Fill Actions Zone:\n * - Settings Toggler\n * - Remove Block Button\n * - Settings Panel\n */\n this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons);\n this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler);\n\n $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler);\n $.append(this.nodes.actions, this.nodes.blockActionsButtons);\n\n /**\n * Make and append Settings Panel\n */\n this.Editor.BlockSettings.make();\n $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper);\n\n /**\n * Append toolbar to the Editor\n */\n $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\n\n /**\n * Bind events on the Toolbar elements\n */\n this.bindEvents();\n }\n\n /**\n * Move Toolbar to the Current Block\n */\n move() {\n /** Close Toolbox when we move toolbar */\n this.Editor.Toolbox.close();\n\n let currentNode = this.Editor.BlockManager.currentNode;\n\n /**\n * If no one Block selected as a Current\n */\n if (!currentNode) {\n return;\n }\n\n /**\n * @todo Compute dynamically on prepare\n * @type {number}\n */\n const defaultToolbarHeight = 49;\n const defaultOffset = 34;\n\n var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset;\n\n this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`;\n\n /** Close trash actions */\n // editor.toolbar.settings.hideRemoveActions();\n }\n\n /**\n * Open Toolbar with Plus Button\n */\n open() {\n this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened);\n }\n\n /**\n * Close the Toolbar\n */\n close() {\n this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened);\n }\n\n /**\n * Plus Button public methods\n * @return {{hide: function(): void, show: function(): void}}\n */\n get plusButton() {\n return {\n hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden),\n show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden)\n };\n }\n\n /**\n * Handler for Plus Button\n * @param {MouseEvent} event\n */\n plusButtonClicked() {\n this.Editor.Toolbox.toggle();\n }\n\n /**\n * Bind events on the Toolbar Elements:\n * - Block Settings\n */\n bindEvents() {\n /**\n * Settings toggler\n */\n this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => {\n this.settingsTogglerClicked(event);\n });\n }\n\n /**\n * Clicks on the Block Settings toggler\n */\n settingsTogglerClicked() {\n if (this.Editor.BlockSettings.opened) {\n this.Editor.BlockSettings.close();\n } else {\n this.Editor.BlockSettings.open();\n }\n }\n}","/**\n * @module Codex Editor Tools Submodule\n *\n * Creates Instances from Plugins and binds external config to the instances\n */\n\n/**\n * Each Tool must contain the following important objects:\n *\n * @typedef {Object} ToolConfig {@link docs/tools.md}\n * @property {String} iconClassname - this a icon in toolbar\n * @property {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE\n * @property {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE\n * @property render @todo add description\n * @property save @todo add description\n * @property settings @todo add description\n * @property validate - method that validates output data before saving\n */\n\n/**\n * @typedef {Function} Tool {@link docs/tools.md}\n * @property {Boolean} displayInToolbox - By default, tools won't be added in the Toolbox. Pass true to add.\n * @property {String} iconClassName - CSS class name for the Toolbox button\n * @property {Boolean} irreplaceable - Toolbox behaviour: replace or add new block below\n * @property render\n * @property save\n * @property settings\n * @property validate\n *\n * @todo update according to current API\n * @todo describe Tool in the {@link docs/tools.md}\n */\n\n/**\n * Class properties:\n *\n * @typedef {Tools} Tools\n * @property {Tools[]} toolsAvailable - available Tools\n * @property {Tools[]} toolsUnavailable - unavailable Tools\n * @property {Object} toolsClasses - all classes\n * @property {EditorConfig} config - Editor config\n */\nexport default class Tools extends Module {\n /**\n * Returns available Tools\n * @return {Tool[]}\n */\n get available() {\n return this.toolsAvailable;\n }\n\n /**\n * Returns unavailable Tools\n * @return {Tool[]}\n */\n get unavailable() {\n return this.toolsUnavailable;\n }\n\n /**\n * Static getter for default Tool config fields\n *\n * @usage Tools.defaultConfig.displayInToolbox\n * @return {ToolConfig}\n */\n static get defaultConfig() {\n return {\n iconClassName : '',\n displayInToolbox : false,\n enableLineBreaks : false,\n irreplaceable : false\n };\n }\n\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n\n /**\n * Map {name: Class, ...} where:\n * name — block type name in JSON. Got from EditorConfig.tools keys\n * @type {Object}\n */\n this.toolClasses = {};\n\n /**\n * Available tools list\n * {name: Class, ...}\n * @type {Object}\n */\n this.toolsAvailable = {};\n\n /**\n * Tools that rejected a prepare method\n * {name: Class, ... }\n * @type {Object}\n */\n this.toolsUnavailable = {};\n }\n\n /**\n * Creates instances via passed or default configuration\n * @return {Promise}\n */\n prepare() {\n if (!this.config.hasOwnProperty('tools')) {\n return Promise.reject(\"Can't start without tools\");\n }\n\n for(let toolName in this.config.tools) {\n this.toolClasses[toolName] = this.config.tools[toolName];\n }\n\n /**\n * getting classes that has prepare method\n */\n let sequenceData = this.getListOfPrepareFunctions();\n\n /**\n * if sequence data contains nothing then resolve current chain and run other module prepare\n */\n if (sequenceData.length === 0) {\n return Promise.resolve();\n }\n\n /**\n * to see how it works {@link Util#sequence}\n */\n return _.sequence(sequenceData, (data) => {\n this.success(data);\n }, (data) => {\n this.fallback(data);\n });\n }\n\n /**\n * Binds prepare function of plugins with user or default config\n * @return {Array} list of functions that needs to be fired sequentially\n */\n getListOfPrepareFunctions() {\n let toolPreparationList = [];\n\n for(let toolName in this.toolClasses) {\n let toolClass = this.toolClasses[toolName];\n\n if (typeof toolClass.prepare === 'function') {\n toolPreparationList.push({\n function : toolClass.prepare,\n data : {\n toolName\n }\n });\n } else {\n /**\n * If Tool hasn't a prepare method, mark it as available\n */\n this.toolsAvailable[toolName] = toolClass;\n }\n }\n\n return toolPreparationList;\n }\n\n /**\n * @param {ChainData.data} data - append tool to available list\n */\n success(data) {\n this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName];\n }\n\n /**\n * @param {ChainData.data} data - append tool to unavailable list\n */\n fallback(data) {\n this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName];\n }\n\n /**\n * Return tool`a instance\n *\n * @param {String} tool — tool name\n * @param {Object} data — initial data\n *\n * @todo throw exceptions if tool doesnt exist\n *\n */\n construct(tool, data) {\n let plugin = this.toolClasses[tool],\n config = this.config.toolsConfig[tool];\n\n if (!config) {\n config = this.defaultConfig;\n }\n\n let instance = new plugin(data, config);\n\n return instance;\n }\n\n /**\n * Check if passed Tool is an instance of Initial Block Tool\n * @param {Tool} tool - Tool to check\n * @return {Boolean}\n */\n isInitial(tool) {\n return tool instanceof this.available[this.config.initialBlock];\n }\n}","/**\n * Module UI\n *\n * @type {UI}\n */\n// let className = {\n\n/**\n * @const {string} BLOCK_CLASSNAME - redactor blocks name\n */\n// BLOCK_CLASSNAME : 'ce-block',\n\n/**\n * @const {String} wrapper for plugins content\n */\n// BLOCK_CONTENT : 'ce-block__content',\n\n/**\n * @const {String} BLOCK_STRETCHED - makes block stretched\n */\n// BLOCK_STRETCHED : 'ce-block--stretched',\n\n/**\n * @const {String} BLOCK_HIGHLIGHTED - adds background\n */\n// BLOCK_HIGHLIGHTED : 'ce-block--focused',\n\n/**\n * @const {String} - for all default settings\n */\n// SETTINGS_ITEM : 'ce-settings__item'\n// };\n\n// import Block from '../block';\n\n/**\n * @class\n *\n * @classdesc Makes CodeX Editor UI:\n * \n * \n * \n * \n * \n *\n * @typedef {UI} UI\n * @property {EditorConfig} config - editor configuration {@link CodexEditor#configuration}\n * @property {Object} Editor - available editor modules {@link CodexEditor#moduleInstances}\n * @property {Object} nodes -\n * @property {Element} nodes.holder - element where we need to append redactor\n * @property {Element} nodes.wrapper - \n * @property {Element} nodes.redactor - \n */\nexport default class UI extends Module {\n /**\n * @constructor\n *\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n\n this.nodes = {\n holder: null,\n wrapper: null,\n redactor: null\n };\n }\n\n /**\n * Making main interface\n */\n prepare() {\n return this.make()\n /**\n * Make toolbar\n */\n .then(() => this.Editor.Toolbar.make())\n /**\n * Make the Inline toolbar\n */\n .then(() => this.Editor.InlineToolbar.make())\n /**\n * Load and append CSS\n */\n .then(() => this.loadStyles())\n /**\n * Bind events for the UI elements\n */\n .then(() => this.bindEvents())\n\n /** Make container for inline toolbar */\n // .then(makeInlineToolbar_)\n\n /** Add inline toolbar tools */\n // .then(addInlineToolbarTools_)\n\n /** Draw wrapper for notifications */\n // .then(makeNotificationHolder_)\n\n /** Add eventlisteners to redactor elements */\n // .then(bindEvents_)\n\n .catch(e => {\n console.error(e);\n\n // editor.core.log(\"Can't draw editor interface\");\n });\n }\n\n /**\n * CodeX Editor UI CSS class names\n * @return {{editorWrapper: string, editorZone: string, block: string}}\n */\n get CSS() {\n return {\n editorWrapper : 'codex-editor',\n editorZone : 'codex-editor__redactor',\n };\n }\n\n /**\n * Makes CodeX Editor interface\n * @return {Promise}\n */\n make() {\n return new Promise( (resolve, reject) => {\n /**\n * Element where we need to append CodeX Editor\n * @type {Element}\n */\n this.nodes.holder = document.getElementById(this.config.holderId);\n\n if (!this.nodes.holder) {\n reject(Error(\"Holder wasn't found by ID: #\" + this.config.holderId));\n return;\n }\n\n /**\n * Create and save main UI elements\n */\n this.nodes.wrapper = $.make('div', this.CSS.editorWrapper);\n this.nodes.redactor = $.make('div', this.CSS.editorZone);\n\n this.nodes.wrapper.appendChild(this.nodes.redactor);\n this.nodes.holder.appendChild(this.nodes.wrapper);\n\n resolve();\n });\n }\n\n /**\n * Appends CSS\n */\n loadStyles() {\n /**\n * Load CSS\n */\n let styles = require('../../styles/main.css');\n\n /**\n * Make tag\n */\n let tag = $.make('style', null, {\n textContent: styles.toString()\n });\n\n /**\n * Append styles\n */\n $.append(document.head, tag);\n }\n\n /**\n * Bind events on the CodeX Editor interface\n */\n bindEvents() {\n /**\n * @todo bind events with the Listeners module\n */\n this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false );\n }\n\n /**\n * All clicks on the redactor zone\n *\n * @param {MouseEvent} event\n *\n * @description\n * 1. Save clicked Block as a current {@link BlockManager#currentNode}\n * it uses for the following:\n * - add CSS modifier for the selected Block\n * - on Enter press, we make a new Block under that\n *\n * 2. Move and show the Toolbar\n *\n * 3. Set a Caret\n *\n * 4. By clicks on the Editor's bottom zone:\n * - if last Block is empty, set a Caret to this\n * - otherwise, add a new empty Block and set a Caret to that\n *\n * 5. Hide the Inline Toolbar\n *\n * @see selectClickedBlock\n *\n */\n redactorClicked(event) {\n let clickedNode = event.target;\n\n /**\n * Select clicked Block as Current\n */\n try {\n this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode);\n } catch (e) {\n /**\n * If clicked outside first-level Blocks, set Caret to the last empty Block\n */\n this.Editor.Caret.setToTheLastBlock();\n }\n\n\n /**\n * @todo hide the Inline Toolbar\n */\n // var selectedText = editor.toolbar.inline.getSelectionText(),\n // firstLevelBlock;\n\n /** If selection range took off, then we hide inline toolbar */\n // if (selectedText.length === 0) {\n\n // editor.toolbar.inline.close();\n\n // }\n\n /**\n *\n\n /** Update current input index in memory when caret focused into existed input */\n // if (event.target.contentEditable == 'true') {\n //\n // editor.caret.saveCurrentInputIndex();\n //\n // }\n\n // if (editor.content.currentNode === null) {\n //\n // /**\n // * If inputs in redactor does not exits, then we put input index 0 not -1\n // */\n // var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0;\n //\n // /** If we have any inputs */\n // if (editor.state.inputs.length) {\n //\n // /** getting firstlevel parent of input */\n // firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]);\n //\n // }\n //\n // /** If input is empty, then we set caret to the last input */\n // if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) {\n //\n // editor.caret.setToBlock(indexOfLastInput);\n //\n // } else {\n //\n // /** Create new input when caret clicked in redactors area */\n // var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n //\n // editor.content.insertBlock({\n // type : NEW_BLOCK_TYPE,\n // block : editor.tools[NEW_BLOCK_TYPE].render()\n // });\n //\n // /** If there is no inputs except inserted */\n // if (editor.state.inputs.length === 1) {\n //\n // editor.caret.setToBlock(indexOfLastInput);\n //\n // } else {\n //\n // /** Set caret to this appended input */\n // editor.caret.setToNextBlock(indexOfLastInput);\n //\n // }\n //\n // }\n //\n // } else {\n //\n // /** Close all panels */\n // editor.toolbar.settings.close();\n // editor.toolbar.toolbox.close();\n //\n // }\n //\n /**\n * Move toolbar and open\n */\n this.Editor.Toolbar.move();\n this.Editor.Toolbar.open();\n //\n // var inputIsEmpty = !editor.content.currentNode.textContent.trim(),\n // currentNodeType = editor.content.currentNode.dataset.tool,\n // isInitialType = currentNodeType == editor.settings.initialBlockPlugin;\n //\n //\n\n /**\n * Hide the Plus Button\n * */\n this.Editor.Toolbar.plusButton.hide();\n\n /**\n * Show the Plus Button if:\n * - Block is an initial-block (Text)\n * - Block is empty\n */\n let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool),\n isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty;\n\n if (isInitialBlock && isEmptyBlock) {\n this.Editor.Toolbar.plusButton.show();\n }\n }\n}\n\n// /**\n// * Codex Editor UI module\n// *\n// * @author Codex Team\n// * @version 1.2.0\n// */\n//\n// module.exports = (function (ui) {\n//\n// let editor = codex.editor;\n//\n// /**\n// * Basic editor classnames\n// */\n// ui.prepare = function () {\n//\n\n//\n// };\n//\n// /** Draw notifications holder */\n// var makeNotificationHolder_ = function () {\n//\n// /** Append block with notifications to the document */\n// editor.nodes.notifications = editor.notifications.createHolder();\n//\n// };\n//\n//\n// var addInlineToolbarTools_ = function () {\n//\n// var tools = {\n//\n// bold: {\n// icon : 'ce-icon-bold',\n// command : 'bold'\n// },\n//\n// italic: {\n// icon : 'ce-icon-italic',\n// command : 'italic'\n// },\n//\n// link: {\n// icon : 'ce-icon-link',\n// command : 'createLink'\n// }\n// };\n//\n// var toolButton,\n// tool;\n//\n// for(var name in tools) {\n//\n// tool = tools[name];\n//\n// toolButton = editor.draw.toolbarButtonInline(name, tool.icon);\n//\n// editor.nodes.inlineToolbar.buttons.appendChild(toolButton);\n// /**\n// * Add callbacks to this buttons\n// */\n// editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command);\n//\n// }\n//\n// };\n//\n// /**\n// * @private\n// * Bind editor UI events\n// */\n// var bindEvents_ = function () {\n//\n// editor.core.log('ui.bindEvents fired', 'info');\n//\n// // window.addEventListener('error', function (errorMsg, url, lineNumber) {\n// // editor.notifications.errorThrown(errorMsg, event);\n// // }, false );\n//\n// /** All keydowns on Document */\n// editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false);\n//\n// /** All keydowns on Redactor zone */\n// editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false);\n//\n// /** All keydowns on Document */\n// editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false );\n//\n// /**\n// * Mouse click to radactor\n// */\n// editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false );\n//\n// /**\n// * Clicks to the Plus button\n// */\n// editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false);\n//\n// /**\n// * Clicks to SETTINGS button in toolbar\n// */\n// editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false );\n//\n// /** Bind click listeners on toolbar buttons */\n// for (var button in editor.nodes.toolbarButtons) {\n//\n// editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false);\n//\n// }\n//\n// };\n//\n// ui.addBlockHandlers = function (block) {\n//\n// if (!block) return;\n//\n// /**\n// * Block keydowns\n// */\n// editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false);\n//\n// /**\n// * Pasting content from another source\n// * We have two type of sanitization\n// * First - uses deep-first search algorithm to get sub nodes,\n// * sanitizes whole Block_content and replaces cleared nodes\n// * This method is deprecated\n// * Method is used in editor.callback.blockPaste(event)\n// *\n// * Secont - uses Mutation observer.\n// * Observer \"observe\" DOM changes and send changings to callback.\n// * Callback gets changed node, not whole Block_content.\n// * Inserted or changed node, which we've gotten have been cleared and replaced with diry node\n// *\n// * Method is used in editor.callback.blockPasteViaSanitize(event)\n// *\n// * @uses html-janitor\n// * @example editor.callback.blockPasteViaSanitize(event), the second method.\n// *\n// */\n// editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false);\n//\n// /**\n// * Show inline toolbar for selected text\n// */\n// editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false);\n// editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false);\n//\n// };\n//\n// /** getting all contenteditable elements */\n// ui.saveInputs = function () {\n//\n// var redactor = editor.nodes.redactor;\n//\n// editor.state.inputs = [];\n//\n// /** Save all inputs in global variable state */\n// var inputs = redactor.querySelectorAll('[contenteditable], input, textarea');\n//\n// Array.prototype.map.call(inputs, function (current) {\n//\n// if (!current.type || current.type == 'text' || current.type == 'textarea') {\n//\n// editor.state.inputs.push(current);\n//\n// }\n//\n// });\n//\n// };\n//\n// /**\n// * Adds first initial block on empty redactor\n// */\n// ui.addInitialBlock = function () {\n//\n// var initialBlockType = editor.settings.initialBlockPlugin,\n// initialBlock;\n//\n// if ( !editor.tools[initialBlockType] ) {\n//\n// editor.core.log('Plugin %o was not implemented and can\\'t be used as initial block', 'warn', initialBlockType);\n// return;\n//\n// }\n//\n// initialBlock = editor.tools[initialBlockType].render();\n//\n// initialBlock.setAttribute('data-placeholder', editor.settings.placeholder);\n//\n// editor.content.insertBlock({\n// type : initialBlockType,\n// block : initialBlock\n// });\n//\n// editor.content.workingNodeChanged(initialBlock);\n//\n// };\n//\n// ui.setInlineToolbarButtonBehaviour = function (button, type) {\n//\n// editor.listeners.add(button, 'mousedown', function (event) {\n//\n// editor.toolbar.inline.toolClicked(event, type);\n//\n// }, false);\n//\n// };\n//\n// return ui;\n//\n// })({});\n","/**\n * Element.closest()\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\n */\nif (!Element.prototype.matches)\n Element.prototype.matches = Element.prototype.msMatchesSelector ||\n Element.prototype.webkitMatchesSelector;\n\nif (!Element.prototype.closest)\n Element.prototype.closest = function (s) {\n var el = this;\n\n if (!document.documentElement.contains(el)) return null;\n do {\n if (el.matches(s)) return el;\n el = el.parentElement || el.parentNode;\n } while (el !== null);\n return null;\n };\n","/**\n * Codex Editor Util\n */\nexport default class Util {\n /**\n * Custom logger\n *\n * @param {string} msg - message\n * @param {string} type - logging type 'log'|'warn'|'error'|'info'\n * @param {*} args - argument to log with a message\n */\n static log(msg, type, args) {\n type = type || 'log';\n\n if (!args) {\n args = msg || 'undefined';\n msg = '[codex-editor]: %o';\n } else {\n msg = '[codex-editor]: ' + msg;\n }\n\n try{\n if ( 'console' in window && window.console[ type ] ) {\n if ( args ) window.console[ type ]( msg, args );\n else window.console[ type ]( msg );\n }\n } catch(e) {\n // do nothing\n }\n }\n\n /**\n * Returns basic keycodes as constants\n * @return {{}}\n */\n static get keyCodes() {\n return {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n SHIFT: 16,\n CTRL: 17,\n ALT: 18,\n ESC: 27,\n SPACE: 32,\n LEFT: 37,\n UP: 38,\n DOWN: 40,\n RIGHT: 39,\n DELETE: 46,\n META: 91\n };\n }\n\n /**\n * @typedef {Object} ChainData\n * @property {Object} data - data that will be passed to the success or fallback\n * @property {Function} function - function's that must be called asynchronically\n */\n\n /**\n * Fires a promise sequence asyncronically\n *\n * @param {Object[]} chains - list or ChainData's\n * @param {Function} success - success callback\n * @param {Function} fallback - callback that fires in case of errors\n *\n * @return {Promise}\n */\n static sequence(chains, success = () => {}, fallback = () => {}) {\n return new Promise(function (resolve) {\n /**\n * pluck each element from queue\n * First, send resolved Promise as previous value\n * Each plugins \"prepare\" method returns a Promise, that's why\n * reduce current element will not be able to continue while can't get\n * a resolved Promise\n */\n chains.reduce(function (previousValue, currentValue, iteration) {\n return previousValue\n .then(() => waitNextBlock(currentValue, success, fallback))\n .then(() => {\n // finished\n if (iteration === chains.length - 1) {\n resolve();\n }\n });\n }, Promise.resolve());\n });\n\n /**\n * Decorator\n *\n * @param {ChainData} chainData\n *\n * @param {Function} successCallback\n * @param {Function} fallbackCallback\n *\n * @return {Promise}\n */\n function waitNextBlock(chainData, successCallback, fallbackCallback) {\n return new Promise(function (resolve) {\n chainData.function()\n .then(() => {\n successCallback(chainData.data || {});\n })\n .then(resolve)\n .catch(function () {\n fallbackCallback(chainData.data || {});\n\n // anyway, go ahead even it falls\n resolve();\n });\n });\n }\n }\n\n /**\n * Make array from array-like collection\n *\n * @param {*} collection\n *\n * @return {Array}\n */\n static array(collection) {\n return Array.prototype.slice.call(collection);\n }\n\n /**\n * Checks if object is empty\n *\n * @param {Object} object\n * @return {boolean}\n */\n static isEmpty(object) {\n return Object.keys(object).length === 0 && object.constructor === Object;\n }\n\n /**\n * Check if passed object is a Promise\n * @param {*} object - object to check\n * @return {Boolean}\n */\n static isPromise(object) {\n return Promise.resolve(object) === object;\n }\n\n /**\n * Check if passed element is contenteditable\n * @param element\n * @return {boolean}\n */\n static isContentEditable(element) {\n return element.contentEditable === 'true';\n }\n\n /**\n * Delays method execution\n *\n * @param method\n * @param timeout\n */\n static delay(method, timeout) {\n return function () {\n let context = this,\n args = arguments;\n\n window.setTimeout(() => method.apply(context, args), timeout);\n };\n }\n};","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \":root {\\n\\n /**\\n * Toolbar buttons\\n */\\n --bg-light: #eff2f5;\\n\\n /**\\n * All gray texts: placeholders, settings\\n */\\n --grayText: #707684;\\n\\n /**\\n * Block content width\\n */\\n --content-width: 650px;\\n\\n /**\\n * Toolbar Plus Button and Toolbox buttons height and width\\n */\\n --toolbar-buttons-size: 34px\\n\\n}\\n/**\\n* Editor wrapper\\n*/\\n.codex-editor {\\n position: relative;\\n border: 1px solid #ccc;\\n padding: 2px;\\n box-sizing: border-box;\\n}\\n.codex-editor .hide {\\n display: none;\\n }\\n.codex-editor__redactor {\\n padding-bottom: 300px;\\n }\\n.ce-toolbar {\\n position: absolute;\\n left: 0;\\n right: 0;\\n top: 0;\\n /*opacity: 0;*/\\n /*visibility: hidden;*/\\n transition: opacity 100ms ease;\\n will-change: opacity, transform;\\n display: none;\\n}\\n.ce-toolbar--opened {\\n display: block;\\n /*opacity: 1;*/\\n /*visibility: visible;*/\\n }\\n.ce-toolbar__content {\\n max-width: 650px;\\n max-width: var(--content-width);\\n margin: 0 auto;\\n position: relative;\\n }\\n.ce-toolbar__plus {\\n position: absolute;\\n left: calc(-var(--toolbar-buttons-size) - 10px);\\n left: calc(-var(--toolbar-buttons-size) - 10px);\\n display: inline-block;\\n background-color: #eff2f5;\\n background-color: var(--bg-light);\\n width: 34px;\\n width: var(--toolbar-buttons-size);\\n height: 34px;\\n height: var(--toolbar-buttons-size);\\n line-height: 34px;\\n text-align: center;\\n border-radius: 50%\\n }\\n.ce-toolbar__plus::after {\\n content: '+';\\n font-size: 26px;\\n display: block;\\n margin-top: -2px;\\n margin-right: -2px;\\n }\\n.ce-toolbar__plus--hidden {\\n display: none;\\n }\\n/**\\n * Block actions Zone\\n * -------------------------\\n */\\n.ce-toolbar__actions {\\n position: absolute;\\n right: 0;\\n top: 0;\\n border: 1px dotted #ccc;\\n padding: 2px;\\n }\\n.ce-toolbar__actions-buttons {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n text-align: right;\\n margin-bottom: 2px;\\n }\\n.ce-toolbar__settings-btn {\\n display: inline-block;\\n width: 24px;\\n height: 24px;\\n border: 1px dotted #ccc\\n }\\n.ce-toolbar__settings-btn::before {\\n content: 'STN';\\n font-size: 10px;\\n opacity: .4;\\n }\\n.ce-toolbox {\\n position: absolute;\\n visibility: hidden;\\n transition: opacity 100ms ease;\\n will-change: opacity;\\n}\\n.ce-toolbox--opened {\\n opacity: 1;\\n visibility: visible;\\n }\\n.ce-toolbox__button {\\n display: inline-block;\\n list-style: none;\\n margin: 0;\\n background: #eff2f5;\\n background: var(--bg-light);\\n width: 34px;\\n width: var(--toolbar-buttons-size);\\n height: 34px;\\n height: var(--toolbar-buttons-size);\\n border-radius: 30px;\\n overflow: hidden;\\n text-align: center;\\n line-height: 34px;\\n line-height: var(--toolbar-buttons-size)\\n }\\n.ce-toolbox__button::before {\\n content: attr(title);\\n font-size: 22px;\\n font-weight: 500;\\n letter-spacing: 1em;\\n -webkit-font-feature-settings: \\\"smcp\\\", \\\"c2sc\\\";\\n font-feature-settings: \\\"smcp\\\", \\\"c2sc\\\";\\n font-variant-caps: all-small-caps;\\n padding-left: 11.5px;\\n margin-top: -1px;\\n display: inline-block;\\n }\\n.ce-inline-toolbar {\\n position: absolute;\\n z-index: 2;\\n background: #FFFFFF;\\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\\n border-radius: 4px;\\n position: relative;\\n}\\n.ce-inline-toolbar::before {\\n content: '';\\n width: 15px;\\n height: 15px;\\n position: absolute;\\n top: -7px;\\n left: 50%;\\n margin-left: -7px;\\n transform: rotate(-45deg);\\n background: #fff;\\n }\\n.ce-inline-toolbar {\\n\\n width: 100px;\\n height: 40px;\\n}\\n.ce-settings {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n display: none;\\n}\\n.ce-settings--opened {\\n display: block;\\n }\\n.ce-settings__plugin-zone {\\n border: 1px dotted #ccc;\\n padding: 2px;\\n margin-bottom: 2px\\n }\\n.ce-settings__plugin-zone::before {\\n content: 'PLUGIN SETTINGS';\\n opacity: .4;\\n font-size: 12px;\\n }\\n.ce-settings__default-zone {\\n border: 1px dotted #ccc;\\n padding: 2px\\n }\\n.ce-settings__default-zone::before {\\n content: 'DEFAULT SETTINGS';\\n opacity: .4;\\n font-size: 12px;\\n }\\n.ce-settings__button {\\n padding: 10px 15px;\\n color: #707684;\\n color: var(--grayText)\\n }\\n.ce-settings__button:hover {\\n background: #eff2f5;\\n background: var(--bg-light);\\n }\\n.ce-block {\\n border: 1px dotted #ccc;\\n margin: 2px 0\\n}\\n.ce-block:first-of-type {\\n margin-top: 0;\\n }\\n.ce-block--selected {\\n background-color: #eff2f5;\\n background-color: var(--bg-light);\\n }\\n.ce-block__content {\\n max-width: 650px;\\n max-width: var(--content-width);\\n margin: 0 auto;\\n }\\n\", \"\"]);\n\n// exports\n"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a97f96fa..29fe8fc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,33 +4,204 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@std/esm": { - "version": "0.16.0", - "resolved": "https://registry.npmjs.org/@std/esm/-/esm-0.16.0.tgz", - "integrity": "sha512-JokzOdnTmxUWJ81VWp0OuSR+VZGuvM9lmnefiPoeTwrOH/wworkRvwkXMpSuso0zYQ0LcbGUKLEdkoKwkYyohg==", + "@webassemblyjs/ast": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.12.tgz", + "integrity": "sha512-bmTBEKuuhSU6dC95QIW250xO769cdYGx9rWn3uBLTw2pUpud0Z5kVuMw9m9fqbNzGeuOU2HpyuZa+yUt2CTEDA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "debug": "3.1.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.12.tgz", + "integrity": "sha512-epTvkdwOIPpTE9edHS+V+shetYzpTbd91XOzUli1zAS0+NSgSe6ZsNggIqUNzhma1s4bN2f/m8c6B1NMdCERAg==", "dev": true }, + "@webassemblyjs/helper-api-error": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.12.tgz", + "integrity": "sha512-Goxag86JvLq8ucHLXFNSLYzf9wrR+CJr37DsESTAzSnGoqDTgw5eqiXSQVd/D9Biih7+DIn8UIQCxMs8emRRwg==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.12.tgz", + "integrity": "sha512-tJNUjttL5CxiiS/KLxT4/Zk0Nbl/poFhztFxktb46zoQEUWaGHR9ZJ0SnvE7DbFX5PY5JNJDMZ0Li4lm246fWw==", + "dev": true, + "requires": { + "debug": "3.1.0" + } + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.12.tgz", + "integrity": "sha512-0FrJgiST+MQDMvPigzs+UIk1vslLIqGadkEWdn53Lr0NsUC2JbheG9QaO3Zf6ycK2JwsHiUpGaMFcHYXStTPMA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.5.12" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.12.tgz", + "integrity": "sha512-QBHZ45VPUJ7UyYKvUFoaxrSS9H5hbkC9U7tdWgFHmnTMutkXSEgDg2gZg3I/QTsiKOCIwx4qJUJwPd7J4D5CNQ==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.12.tgz", + "integrity": "sha512-SCXR8hPI4JOG3cdy9HAO8W5/VQ68YXG/Hfs7qDf1cd64zWuMNshyEour5NYnLMVkrrtc0XzfVS/MdeV94woFHA==", + "dev": true, + "requires": { + "debug": "3.1.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.12.tgz", + "integrity": "sha512-0Gz5lQcyvElNVbOTKwjEmIxGwdWf+zpAW/WGzGo95B7IgMEzyyfZU+PrGHDwiSH9c0knol9G7smQnY0ljrSA6g==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.12.tgz", + "integrity": "sha512-ge/CKVKBGpiJhFN9PIOQ7sPtGYJhxm/mW1Y3SpG1L6XBunfRz0YnLjW3TmhcOEFozIVyODPS1HZ9f7VR3GBGow==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.5.12.tgz", + "integrity": "sha512-F+PEv9QBzPi1ThLBouUJbuxhEr+Sy/oua1ftXFKHiaYYS5Z9tKPvK/hgCxlSdq+RY4MSG15jU2JYb/K5pkoybg==", + "dev": true, + "requires": { + "ieee754": "1.1.12" + } + }, + "@webassemblyjs/leb128": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.5.12.tgz", + "integrity": "sha512-cCOx/LVGiWyCwVrVlvGmTdnwHzIP4+zflLjGkZxWpYCpdNax9krVIJh1Pm7O86Ox/c5PrJpbvZU1cZLxndlPEw==", + "dev": true, + "requires": { + "leb": "0.3.0" + } + }, + "@webassemblyjs/utf8": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.5.12.tgz", + "integrity": "sha512-FX8NYQMiTRU0TfK/tJVntsi9IEKsedSsna8qtsndWVE0x3zLndugiApxdNMIOoElBV9o4j0BUqR+iwU58QfPxQ==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.12.tgz", + "integrity": "sha512-r/oZAyC4EZl0ToOYJgvj+b0X6gVEKQMLT34pNNbtvWBehQOnaSXvVUA5FIYlH8ubWjFNAFqYaVGgQTjR1yuJdQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/helper-wasm-section": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "@webassemblyjs/wast-printer": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.12.tgz", + "integrity": "sha512-LTu+cr1YRxGGiVIXWhei/35lXXEwTnQU18x4V/gE+qCSJN21QcVTMjJuasTUh8WtmBZtOlqJbOQIeN7fGnHWhg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.12.tgz", + "integrity": "sha512-LBwG5KPA9u/uigZVyTsDpS3CVxx3AePCnTItVL+OPkRCp5LqmLsOp4a3/c5CQE0Lecm0Ss9hjUTDcbYFZkXlfQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.12.tgz", + "integrity": "sha512-xset3+1AtoFYEfMg30nzCGBnhKmTBzbIKvMyLhqJT06TvYV+kA884AOUpUvhSmP6XPF3G+HVZPm/PbCGxH4/VQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.5.12.tgz", + "integrity": "sha512-QWUtzhvfY7Ue9GlJ3HeOB6w5g9vNYUUnG+Y96TWPkFHJTxZlcvGfNrUoACCw6eDb9gKaHrjt77aPq41a7y8svg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/floating-point-hex-parser": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-code-frame": "1.5.12", + "@webassemblyjs/helper-fsm": "1.5.12", + "long": "3.2.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.5.12.tgz", + "integrity": "sha512-XF9RTeckFgDyl196uRKZWHFFfbkzsMK96QTXp+TC0R9gsV9DMiDGMSIllgy/WdrZ3y3dsQp4fTA5r4GoaOBchA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "long": "3.2.0" + } + }, "acorn": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", - "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", "dev": true }, "acorn-dynamic-import": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", - "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", "dev": true, "requires": { - "acorn": "4.0.13" - }, - "dependencies": { - "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", - "dev": true - } + "acorn": "5.5.3" } }, "acorn-jsx": { @@ -51,34 +222,23 @@ } }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.0.tgz", + "integrity": "sha512-VDUX1oSajablmiyFyED9L1DFndg0P9h7p1F+NO8FkIzei6EPrR6Zu1n18rd5P8PqaSRd/FrWv3G1TVBqpM83gA==", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.0.0", + "fast-deep-equal": "2.0.1", "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "json-schema-traverse": "0.3.1", + "uri-js": "4.2.2" } }, "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", "dev": true }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - } - }, "alphanum-sort": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", @@ -86,9 +246,9 @@ "dev": true }, "ansi-escapes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.0.0.tgz", - "integrity": "sha512-O/klc27mWNUigtv0F8NJWbLF00OcegQalkqKURWdosW08YZKi4m6CnSUSvIZG1otNJbTWhN01Hhz389DW7mvDQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { @@ -110,32 +270,35 @@ "dev": true }, "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "2.3.11", + "micromatch": "3.1.10", "normalize-path": "2.1.1" } }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", @@ -143,6 +306,12 @@ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -159,9 +328,9 @@ "dev": true }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrify": { @@ -171,14 +340,14 @@ "dev": true }, "asn1.js": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", - "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { "bn.js": "4.11.8", "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "minimalistic-assert": "1.0.1" } }, "assert": { @@ -190,13 +359,19 @@ "util": "0.10.3" } }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "4.17.4" + "lodash": "4.17.10" } }, "async-each": { @@ -205,6 +380,12 @@ "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "dev": true }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true + }, "autoprefixer": { "version": "6.7.7", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", @@ -212,11 +393,23 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000784", + "caniuse-db": "1.0.30000846", "normalize-range": "0.1.2", "num2fraction": "1.2.2", "postcss": "5.2.18", "postcss-value-parser": "3.3.0" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "babel-code-frame": { @@ -231,13 +424,13 @@ } }, "babel-core": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", - "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { "babel-code-frame": "6.26.0", - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-helpers": "6.24.1", "babel-messages": "6.23.0", "babel-register": "6.26.0", @@ -249,18 +442,29 @@ "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", - "lodash": "4.17.4", + "lodash": "4.17.10", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-generator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", - "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "6.23.0", @@ -268,11 +472,22 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" } }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, "babel-helper-call-delegate": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", @@ -294,7 +509,18 @@ "babel-helper-function-name": "6.24.1", "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-function-name": { @@ -348,7 +574,20 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-replace-supers": { @@ -376,9 +615,9 @@ } }, "babel-loader": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.2.tgz", - "integrity": "sha512-jRwlFbINAeyDStqK6Dd5YuY0k5YuzQUvlz2ZamuXrXmxav3pNqe9vfJ402+2G+OmlJSXxCOpB6Uz0INM7RQe2A==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", + "integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", "dev": true, "requires": { "find-cache-dir": "1.0.0", @@ -416,6 +655,35 @@ "integrity": "sha1-GY/xK56r0z4BHuE/L5iYmFYItNE=", "dev": true }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, "babel-plugin-transform-es2015-arrow-functions": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", @@ -444,7 +712,7 @@ "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" } }, "babel-plugin-transform-es2015-classes": { @@ -528,15 +796,15 @@ "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-runtime": "6.26.0", "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", - "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "dev": true, "requires": { "babel-plugin-transform-strict-mode": "6.24.1", @@ -650,6 +918,17 @@ "regexpu-core": "2.0.0" } }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", + "babel-plugin-syntax-exponentiation-operator": "6.13.0", + "babel-runtime": "6.26.0" + } + }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", @@ -676,7 +955,7 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "core-js": "2.5.3", + "core-js": "2.5.7", "regenerator-runtime": "0.10.5" }, "dependencies": { @@ -688,13 +967,15 @@ } } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-to-generator": "6.24.1", "babel-plugin-transform-es2015-arrow-functions": "6.22.0", "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", "babel-plugin-transform-es2015-block-scoping": "6.26.0", @@ -706,7 +987,7 @@ "babel-plugin-transform-es2015-function-name": "6.24.1", "babel-plugin-transform-es2015-literals": "6.22.0", "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", "babel-plugin-transform-es2015-modules-umd": "6.24.1", "babel-plugin-transform-es2015-object-super": "6.24.1", @@ -717,7 +998,11 @@ "babel-plugin-transform-es2015-template-literals": "6.22.0", "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" + "babel-plugin-transform-exponentiation-operator": "6.24.1", + "babel-plugin-transform-regenerator": "6.26.0", + "browserslist": "3.2.8", + "invariant": "2.2.4", + "semver": "5.5.0" } }, "babel-register": { @@ -726,11 +1011,11 @@ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "6.26.0", + "babel-core": "6.26.3", "babel-runtime": "6.26.0", - "core-js": "2.5.3", + "core-js": "2.5.7", "home-or-tmp": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "mkdirp": "0.5.1", "source-map-support": "0.4.18" } @@ -741,7 +1026,7 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.3", + "core-js": "2.5.7", "regenerator-runtime": "0.11.1" } }, @@ -755,7 +1040,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.10" } }, "babel-traverse": { @@ -771,8 +1056,19 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "invariant": "2.2.4", + "lodash": "4.17.10" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-types": { @@ -783,7 +1079,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, @@ -799,10 +1095,65 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, "base64-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", "dev": true }, "big.js": { @@ -817,6 +1168,12 @@ "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", "dev": true }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, "bn.js": { "version": "4.11.8", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", @@ -824,9 +1181,9 @@ "dev": true }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", @@ -834,14 +1191,32 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "brorand": { @@ -851,34 +1226,34 @@ "dev": true }, "browserify-aes": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", - "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { "buffer-xor": "1.0.3", "cipher-base": "1.0.4", - "create-hash": "1.1.3", + "create-hash": "1.2.0", "evp_bytestokey": "1.0.3", "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "browserify-cipher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", - "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "1.1.1", - "browserify-des": "1.0.0", + "browserify-aes": "1.2.0", + "browserify-des": "1.0.1", "evp_bytestokey": "1.0.3" } }, "browserify-des": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", - "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz", + "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", "dev": true, "requires": { "cipher-base": "1.0.4", @@ -893,7 +1268,7 @@ "dev": true, "requires": { "bn.js": "4.11.8", - "randombytes": "2.0.5" + "randombytes": "2.0.6" } }, "browserify-sign": { @@ -904,11 +1279,11 @@ "requires": { "bn.js": "4.11.8", "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", "elliptic": "6.4.0", "inherits": "2.0.3", - "parse-asn1": "5.1.0" + "parse-asn1": "5.1.1" } }, "browserify-zlib": { @@ -921,13 +1296,13 @@ } }, "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", "dev": true, "requires": { - "caniuse-db": "1.0.30000784", - "electron-to-chromium": "1.3.30" + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" } }, "buffer": { @@ -936,11 +1311,17 @@ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "1.2.1", - "ieee754": "1.1.8", + "base64-js": "1.3.0", + "ieee754": "1.1.12", "isarray": "1.0.0" } }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "dev": true + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -959,6 +1340,44 @@ "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "chownr": "1.0.1", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "lru-cache": "4.1.3", + "mississippi": "2.0.0", + "mkdirp": "0.5.1", + "move-concurrently": "1.0.1", + "promise-inflight": "1.0.1", + "rimraf": "2.6.2", + "ssri": "5.3.0", + "unique-filename": "1.1.0", + "y18n": "4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -975,9 +1394,9 @@ "dev": true }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, "caniuse-api": { @@ -987,33 +1406,35 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000784", + "caniuse-db": "1.0.30000846", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "caniuse-db": { - "version": "1.0.30000784", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000784.tgz", - "integrity": "sha1-G+lQEtlInHcZB0+BruV9vf/mNhs=", + "version": "1.0.30000846", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000846.tgz", + "integrity": "sha1-2chvkUc4202gmO7e2ZdBPERWG9I=", "dev": true }, "caniuse-lite": { - "version": "1.0.30000784", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000784.tgz", - "integrity": "sha1-EpztdOmhKApEGIC2zSvOMO9Z5sA=", + "version": "1.0.30000846", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000846.tgz", + "integrity": "sha512-qxUOHr5mTaadWH1ap0ueivHd8x42Bnemcn+JutVr7GWmm2bU4zoBhjuv5QdXgALQnnT626lOQros7cCDf8PwCg==", "dev": true }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } - }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", @@ -1034,20 +1455,38 @@ "dev": true }, "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", + "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", "dev": true, "requires": { - "anymatch": "1.3.2", + "anymatch": "2.0.0", "async-each": "1.0.1", - "fsevents": "1.1.3", - "glob-parent": "2.0.0", + "braces": "2.3.2", + "fsevents": "1.2.4", + "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", - "is-glob": "2.0.1", + "is-glob": "4.0.0", + "normalize-path": "2.1.1", "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" + "readdirp": "2.1.0", + "upath": "1.1.0" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", + "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", + "dev": true, + "requires": { + "tslib": "1.9.2" } }, "cipher-base": { @@ -1057,7 +1496,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "circular-json": { @@ -1075,6 +1514,29 @@ "chalk": "1.1.3" } }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -1091,28 +1553,37 @@ "dev": true }, "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" }, "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } } } }, "clone": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.3.tgz", - "integrity": "sha1-KY1+IjFmD0DAA8LtMUDezz9TCF8=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, "co": { @@ -1136,13 +1607,23 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, "color": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz", "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", "dev": true, "requires": { - "clone": "1.0.3", + "clone": "1.0.4", "color-convert": "1.9.1", "color-string": "0.3.0" } @@ -1188,12 +1669,24 @@ "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1201,13 +1694,14 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { + "buffer-from": "1.1.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "typedarray": "0.0.6" } }, @@ -1232,10 +1726,30 @@ "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", "dev": true }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "1.2.0", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "core-js": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.3.tgz", - "integrity": "sha1-isw4NFgk8W2DZbfJtCWRaOjtYD4=", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", "dev": true }, "core-util-is": { @@ -1268,9 +1782,9 @@ } }, "create-ecdh": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", - "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { "bn.js": "4.11.8", @@ -1278,29 +1792,30 @@ } }, "create-hash": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", - "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { "cipher-base": "1.0.4", "inherits": "2.0.3", - "ripemd160": "2.0.1", - "sha.js": "2.4.9" + "md5.js": "1.3.4", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" } }, "create-hmac": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", - "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { "cipher-base": "1.0.4", - "create-hash": "1.1.3", + "create-hash": "1.2.0", "inherits": "2.0.3", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.9" + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "cross-spawn": { @@ -1309,9 +1824,9 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.3", "shebang-command": "1.2.0", - "which": "1.3.0" + "which": "1.3.1" } }, "crypto-browserify": { @@ -1320,17 +1835,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "browserify-cipher": "1.0.0", + "browserify-cipher": "1.0.1", "browserify-sign": "4.0.4", - "create-ecdh": "4.0.0", - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "diffie-hellman": "5.0.2", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", "inherits": "2.0.3", - "pbkdf2": "3.0.14", - "public-encrypt": "4.0.0", - "randombytes": "2.0.5", - "randomfill": "1.0.3" + "pbkdf2": "3.0.16", + "public-encrypt": "4.0.2", + "randombytes": "2.0.6", + "randomfill": "1.0.4" } }, "css-color-function": { @@ -1350,15 +1865,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.1.0.tgz", "integrity": "sha1-tQS9BYabOSWd0MXvw12EMXbczEo=", "dev": true - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } } } }, @@ -1369,9 +1875,9 @@ "dev": true }, "css-loader": { - "version": "0.28.7", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.7.tgz", - "integrity": "sha512-GxMpax8a/VgcfRrVy0gXD6yLd5ePYbXX/5zGgTVYp4wXtJklS8Z2VaUArJgc//f6/Dzil7BaJObdSv8eKKCPgg==", + "version": "0.28.11", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", + "integrity": "sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg==", "dev": true, "requires": { "babel-code-frame": "6.26.0", @@ -1382,7 +1888,7 @@ "lodash.camelcase": "4.3.0", "object-assign": "4.1.1", "postcss": "5.2.18", - "postcss-modules-extract-imports": "1.1.0", + "postcss-modules-extract-imports": "1.2.0", "postcss-modules-local-by-default": "1.2.0", "postcss-modules-scope": "1.1.0", "postcss-modules-values": "1.3.0", @@ -1407,7 +1913,7 @@ "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { - "regenerate": "1.3.3", + "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } @@ -1446,7 +1952,7 @@ "postcss-discard-empty": "2.1.0", "postcss-discard-overridden": "0.1.1", "postcss-discard-unused": "2.2.3", - "postcss-filter-plugins": "2.0.2", + "postcss-filter-plugins": "2.0.3", "postcss-merge-idents": "2.1.7", "postcss-merge-longhand": "2.0.2", "postcss-merge-rules": "2.1.2", @@ -1476,14 +1982,11 @@ "source-map": "0.5.7" } }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "dev": true, - "requires": { - "es5-ext": "0.10.37" - } + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true }, "date-now": { "version": "0.1.4", @@ -1492,9 +1995,9 @@ "dev": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -1506,12 +2009,59 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", @@ -1526,7 +2076,7 @@ "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", @@ -1548,7 +2098,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "minimalistic-assert": "1.0.1" } }, "detect-indent": { @@ -1560,47 +2110,65 @@ "repeating": "2.0.1" } }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "diffie-hellman": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", - "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { "bn.js": "4.11.8", "miller-rabin": "4.0.1", - "randombytes": "2.0.5" + "randombytes": "2.0.6" } }, "doctrine": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", - "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "2.0.2" } }, "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, - "electron-releases": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/electron-releases/-/electron-releases-2.1.0.tgz", - "integrity": "sha512-cyKFD1bTE/UgULXfaueIN1k5EPFzs+FRc/rvCY5tIynefAPqopQEgjr0EzY+U3Dqrk/G4m9tXSPuZ77v6dL/Rw==", - "dev": true - }, - "electron-to-chromium": { - "version": "1.3.30", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.30.tgz", - "integrity": "sha512-zx1Prv7kYLfc4OA60FhxGbSo4qrEjgSzpo1/37i7l9ltXPYOoQBtjQxY9KmsgfHnBxHlBGXwLlsbt/gub1w5lw==", + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", "dev": true, "requires": { - "electron-releases": "2.1.0" + "is-obj": "1.0.1" } }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "stream-shift": "1.0.0" + } + }, + "electron-to-chromium": { + "version": "1.3.48", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz", + "integrity": "sha1-07DYWTgUBE4JLs4hCPw6ya6kuQA=", + "dev": true + }, "elliptic": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", @@ -1612,7 +2180,7 @@ "hash.js": "1.1.3", "hmac-drbg": "1.0.1", "inherits": "2.0.3", - "minimalistic-assert": "1.0.0", + "minimalistic-assert": "1.0.1", "minimalistic-crypto-utils": "1.0.1" } }, @@ -1622,22 +2190,30 @@ "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, "enhanced-resolve": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", - "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", + "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", "dev": true, "requires": { "graceful-fs": "4.1.11", "memory-fs": "0.4.1", - "object-assign": "4.1.1", - "tapable": "0.2.8" + "tapable": "1.0.0" } }, "errno": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.6.tgz", - "integrity": "sha512-IsORQDpaaSwcDP4ZZnHxgE85werpo34VYn1Ud3mq+eUsF593faR8oCZNXrROVkpFu2TsbrNhHin0aUrTsQ9vNw==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "dev": true, "requires": { "prr": "1.0.1" @@ -1660,124 +2236,42 @@ } } }, - "es5-ext": { - "version": "0.10.37", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz", - "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=", - "dev": true, - "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37", - "es6-symbol": "3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37", - "es6-iterator": "2.0.3", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", - "estraverse": "4.2.0" - } - }, "eslint": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.14.0.tgz", - "integrity": "sha512-Ul6CSGRjKscEyg0X/EeNs7o2XdnbTEOD1OM8cTjmx85RPcBJQrEhZLevhuJZNAE/vS2iVl5Uhgiqf3h5uLMCJQ==", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "2.3.0", - "concat-stream": "1.6.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", "cross-spawn": "5.1.0", "debug": "3.1.0", - "doctrine": "2.0.2", + "doctrine": "2.1.0", "eslint-scope": "3.7.1", "eslint-visitor-keys": "1.0.0", - "espree": "3.5.2", - "esquery": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "11.1.0", - "ignore": "3.3.7", + "globals": "11.5.0", + "ignore": "3.3.8", "imurmurhash": "0.1.4", "inquirer": "3.3.0", - "is-resolvable": "1.0.1", - "js-yaml": "3.10.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", @@ -1785,14 +2279,27 @@ "path-is-inside": "1.0.2", "pluralize": "7.0.0", "progress": "2.0.0", + "regexpp": "1.1.0", "require-uncached": "1.0.3", - "semver": "5.4.1", + "semver": "5.5.0", "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", "table": "4.0.2", "text-table": "0.2.0" }, "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", @@ -1800,32 +2307,23 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - } - }, - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" + "supports-color": "5.4.0" } }, "esprima": { @@ -1834,25 +2332,31 @@ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, "globals": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.1.0.tgz", - "integrity": "sha512-uEuWt9mqTlPDwSqi+sHjD4nWU/1N+q0fiWI9T1mZpD2UENqX20CFD5T/ziLZvztPaBKl7ZylUi1q6Qfm7E2CiQ==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", "dev": true }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "js-yaml": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "4.0.0" } }, @@ -1866,26 +2370,26 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "eslint-loader": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-1.9.0.tgz", - "integrity": "sha512-40aN976qSNPyb9ejTqjEthZITpls1SVKtwguahmH1dzGCwQU/vySE+xX33VZmD8csU0ahVNCtFlsPgKqRBiqgg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-2.0.0.tgz", + "integrity": "sha512-VxxGDI4bXzLk0+/jMt/0EkGMRKS9ox6Czx+yapMb9WJmcS/ZHhlhqcVUNgUjFBNp02j/2pZLdGOrG7EXyjoz/g==", "dev": true, "requires": { "loader-fs-cache": "1.0.1", "loader-utils": "1.1.0", "object-assign": "4.1.1", - "object-hash": "1.2.0", + "object-hash": "1.3.0", "rimraf": "2.6.2" } }, @@ -1895,7 +2399,7 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.0", + "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, @@ -1906,12 +2410,12 @@ "dev": true }, "espree": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", - "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.3.0", + "acorn": "5.5.3", "acorn-jsx": "3.0.1" } }, @@ -1922,22 +2426,21 @@ "dev": true }, "esquery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", - "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "4.2.0" } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "4.2.0" } }, "estraverse": { @@ -1952,16 +2455,6 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37" - } - }, "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", @@ -1975,7 +2468,7 @@ "dev": true, "requires": { "md5.js": "1.3.4", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "execa": { @@ -1994,41 +2487,144 @@ } }, "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "fill-range": "2.2.3" + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } } }, "external-editor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz", - "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", "dev": true, "requires": { "chardet": "0.4.2", - "iconv-lite": "0.4.19", + "iconv-lite": "0.4.23", "tmp": "0.0.33" } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "is-extglob": "1.0.0" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } } }, "extract-text-webpack-plugin": { @@ -2037,16 +2633,45 @@ "integrity": "sha512-bt/LZ4m5Rqt/Crl2HiKuAl/oqg0psx1tsTLkvWbJen1CtD+fftkZhMaQ9HOtY2gWsl2Wq+sABmMVi9z3DhKWQQ==", "dev": true, "requires": { - "async": "2.6.0", + "async": "2.6.1", "loader-utils": "1.1.0", "schema-utils": "0.3.0", "webpack-sources": "1.1.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "5.5.2" + } + } } }, "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { @@ -2086,23 +2711,27 @@ "object-assign": "4.1.1" } }, - "filename-regex": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", - "dev": true - }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "find-cache-dir": { @@ -2112,7 +2741,7 @@ "dev": true, "requires": { "commondir": "1.0.1", - "make-dir": "1.1.0", + "make-dir": "1.3.0", "pkg-dir": "2.0.0" } }, @@ -2143,19 +2772,51 @@ "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", "dev": true }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", "dev": true }, - "for-own": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "for-in": "1.0.2" + "map-cache": "0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "iferr": "0.1.5", + "imurmurhash": "0.1.4", + "readable-stream": "2.3.6" } }, "fs.realpath": { @@ -2165,39 +2826,29 @@ "dev": true }, "fsevents": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", - "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { - "nan": "2.8.0", - "node-pre-gyp": "0.6.39" + "nan": "2.10.0", + "node-pre-gyp": "0.10.0" }, "dependencies": { "abbrev": { - "version": "1.1.0", + "version": "1.1.1", "bundled": true, "dev": true, "optional": true }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, "ansi-regex": { "version": "2.1.1", "bundled": true, "dev": true }, "aproba": { - "version": "1.1.1", + "version": "1.2.0", "bundled": true, "dev": true, "optional": true @@ -2209,91 +2860,25 @@ "optional": true, "requires": { "delegates": "1.0.0", - "readable-stream": "2.2.9" + "readable-stream": "2.3.6" } }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, "balanced-match": { - "version": "0.4.2", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "brace-expansion": { - "version": "1.1.7", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "0.4.2", - "concat-map": "0.0.1" - } - }, - "buffer-shims": { "version": "1.0.0", "bundled": true, "dev": true }, - "caseless": { - "version": "0.12.0", + "brace-expansion": { + "version": "1.1.11", "bundled": true, "dev": true, - "optional": true + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } }, - "co": { - "version": "4.6.0", + "chownr": { + "version": "1.0.1", "bundled": true, "dev": true, "optional": true @@ -2303,14 +2888,6 @@ "bundled": true, "dev": true }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, "concat-map": { "version": "0.0.1", "bundled": true, @@ -2324,35 +2901,11 @@ "core-util-is": { "version": "1.0.2", "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, "dev": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } + "optional": true }, "debug": { - "version": "2.6.8", + "version": "2.6.9", "bundled": true, "dev": true, "optional": true, @@ -2361,16 +2914,11 @@ } }, "deep-extend": { - "version": "0.4.2", + "version": "0.5.1", "bundled": true, "dev": true, "optional": true }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "delegates": { "version": "1.0.0", "bundled": true, @@ -2378,74 +2926,25 @@ "optional": true }, "detect-libc": { - "version": "1.0.2", + "version": "1.0.3", "bundled": true, "dev": true, "optional": true }, - "ecc-jsbn": { - "version": "0.1.1", + "fs-minipass": { + "version": "1.2.5", "bundled": true, "dev": true, "optional": true, "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "minipass": "2.2.4" } }, "fs.realpath": { "version": "1.0.0", "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } + "optional": true }, "gauge": { "version": "2.7.4", @@ -2453,7 +2952,7 @@ "dev": true, "optional": true, "requires": { - "aproba": "1.1.1", + "aproba": "1.2.0", "console-control-strings": "1.1.0", "has-unicode": "2.0.1", "object-assign": "4.1.1", @@ -2463,27 +2962,11 @@ "wide-align": "1.1.2" } }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, "glob": { "version": "7.1.2", "bundled": true, "dev": true, + "optional": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -2493,64 +2976,35 @@ "path-is-absolute": "1.0.1" } }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, "has-unicode": { "version": "2.0.1", "bundled": true, "dev": true, "optional": true }, - "hawk": { - "version": "3.1.3", - "bundled": true, - "dev": true, - "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" - } - }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", + "iconv-lite": { + "version": "0.4.21", "bundled": true, "dev": true, "optional": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "3.0.4" } }, "inflight": { "version": "1.0.6", "bundled": true, "dev": true, + "optional": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -2562,7 +3016,7 @@ "dev": true }, "ini": { - "version": "1.3.4", + "version": "1.3.5", "bundled": true, "dev": true, "optional": true @@ -2575,104 +3029,18 @@ "number-is-nan": "1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, "isarray": { "version": "1.0.0", "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, "dev": true, "optional": true }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, "minimatch": { "version": "3.0.4", "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -2680,6 +3048,24 @@ "bundled": true, "dev": true }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, "mkdirp": { "version": "0.5.1", "bundled": true, @@ -2694,23 +3080,33 @@ "dev": true, "optional": true }, - "node-pre-gyp": { - "version": "0.6.39", + "needle": { + "version": "2.2.0", "bundled": true, "dev": true, "optional": true, "requires": { - "detect-libc": "1.0.2", - "hawk": "3.1.3", + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", "mkdirp": "0.5.1", + "needle": "2.2.0", "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.7", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" } }, "nopt": { @@ -2719,12 +3115,28 @@ "dev": true, "optional": true, "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" } }, "npmlog": { - "version": "4.1.0", + "version": "4.1.2", "bundled": true, "dev": true, "optional": true, @@ -2740,12 +3152,6 @@ "bundled": true, "dev": true }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, "object-assign": { "version": "4.1.1", "bundled": true, @@ -2773,7 +3179,7 @@ "optional": true }, "osenv": { - "version": "0.1.4", + "version": "0.1.5", "bundled": true, "dev": true, "optional": true, @@ -2785,39 +3191,23 @@ "path-is-absolute": { "version": "1.0.1", "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, "dev": true, "optional": true }, "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", + "version": "2.0.0", "bundled": true, "dev": true, "optional": true }, "rc": { - "version": "1.2.1", + "version": "1.2.7", "bundled": true, "dev": true, "optional": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", + "deep-extend": "0.5.1", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, @@ -2831,64 +3221,48 @@ } }, "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", + "version": "2.3.6", "bundled": true, "dev": true, "optional": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "rimraf": { - "version": "2.6.1", + "version": "2.6.2", "bundled": true, "dev": true, + "optional": true, "requires": { "glob": "7.1.2" } }, "safe-buffer": { - "version": "5.0.1", + "version": "5.1.1", "bundled": true, "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, "semver": { - "version": "5.3.0", + "version": "5.5.0", "bundled": true, "dev": true, "optional": true @@ -2905,39 +3279,6 @@ "dev": true, "optional": true }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, "string-width": { "version": "1.0.2", "bundled": true, @@ -2949,19 +3290,14 @@ } }, "string_decoder": { - "version": "1.0.1", + "version": "1.1.1", "bundled": true, "dev": true, + "optional": true, "requires": { - "safe-buffer": "5.0.1" + "safe-buffer": "5.1.1" } }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, "strip-ansi": { "version": "3.0.1", "bundled": true, @@ -2977,81 +3313,26 @@ "optional": true }, "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", + "version": "4.4.1", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, "util-deprecate": { "version": "1.0.2", "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, "dev": true, "optional": true }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, "wide-align": { "version": "1.1.2", "bundled": true, @@ -3065,6 +3346,11 @@ "version": "1.0.2", "bundled": true, "dev": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true, + "dev": true } } }, @@ -3092,6 +3378,12 @@ "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -3106,24 +3398,32 @@ "path-is-absolute": "1.0.1" } }, - "glob-base": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } } }, - "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", - "dev": true, - "requires": { - "is-glob": "2.0.1" - } + "global-modules-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.1.0.tgz", + "integrity": "sha512-3DrmGj2TP+96cABk9TfMp6f3knH/Y46dqvWznTU3Tf6/bDGLDAn15tFluQ7BcloykOcdY16U0WGq0BQblYOxJQ==", + "dev": true }, "globals": { "version": "9.18.0", @@ -3200,13 +3500,46 @@ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, - "hash-base": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", - "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "inherits": "2.0.3" + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "hash.js": { @@ -3216,7 +3549,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "minimalistic-assert": "1.0.0" + "minimalistic-assert": "1.0.1" } }, "hmac-drbg": { @@ -3226,7 +3559,7 @@ "dev": true, "requires": { "hash.js": "1.1.3", - "minimalistic-assert": "1.0.0", + "minimalistic-assert": "1.0.1", "minimalistic-crypto-utils": "1.0.1" } }, @@ -3240,12 +3573,6 @@ "os-tmpdir": "1.0.2" } }, - "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", - "dev": true - }, "html-comment-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", @@ -3265,10 +3592,13 @@ "dev": true }, "iconv-lite": { - "version": "0.4.19", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", - "dev": true + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } }, "icss-replace-symbols": { "version": "1.1.0", @@ -3282,44 +3612,44 @@ "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -3329,28 +3659,44 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "ieee754": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", - "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "dev": true }, "ignore": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.7.tgz", - "integrity": "sha512-YGG3ejvBNHRqu0559EOxxNFihD0AjpvHlC/pdGKd3X3ofe+CoJkYazwNJYTNebqpPKN+VVQbh4ZFn1DivMNuHA==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", "dev": true }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -3391,13 +3737,13 @@ "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", - "external-editor": "2.1.0", + "external-editor": "2.2.0", "figures": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "mute-stream": "0.0.7", "run-async": "2.3.0", "rx-lite": "4.0.8", @@ -3414,29 +3760,29 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "strip-ansi": { @@ -3449,12 +3795,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3466,9 +3812,9 @@ "dev": true }, "invariant": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "1.3.1" @@ -3486,6 +3832,26 @@ "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", "dev": true }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "is-arrayish": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.1.tgz", @@ -3507,13 +3873,43 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } } }, "is-directory": { @@ -3522,21 +3918,6 @@ "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, - "is-dotfile": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", - "dev": true - }, - "is-equal-shallow": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", - "dev": true, - "requires": { - "is-primitive": "2.0.0" - } - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -3544,9 +3925,9 @@ "dev": true }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-finite": { @@ -3565,21 +3946,55 @@ "dev": true }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "2.1.1" } }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } } }, "is-path-cwd": { @@ -3589,9 +4004,9 @@ "dev": true }, "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { "is-path-inside": "1.0.1" @@ -3612,17 +4027,14 @@ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, - "is-posix-bracket": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", - "dev": true - }, - "is-primitive": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", - "dev": true + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } }, "is-promise": { "version": "2.1.0", @@ -3631,9 +4043,9 @@ "dev": true }, "is-resolvable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", - "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-stream": { @@ -3651,6 +4063,12 @@ "html-comment-regex": "1.1.1" } }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -3670,18 +4088,15 @@ "dev": true }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "js-base64": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", - "integrity": "sha512-Wehd+7Pf9tFvGb+ydPm9TjYjV8X1YHOVyG8QyELZxEMqOhemVwGRmoG8iQ/soqI3n8v4xn59zaLxiCJiaaRzKA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.5.tgz", + "integrity": "sha512-aUnNwqMOXw3yvErjMPSQu6qIIzUmT1e5KcU1OZxRDU1g/am6mzBvcrmLAYwzmB59BHPrh5/tKaiF4OPhqRWESQ==", "dev": true }, "js-tokens": { @@ -3696,7 +4111,7 @@ "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "2.7.3" } }, @@ -3706,10 +4121,10 @@ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, - "json-loader": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", - "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-schema-traverse": { @@ -3731,18 +4146,9 @@ "dev": true }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", "dev": true }, "lcid": { @@ -3754,6 +4160,12 @@ "invert-kv": "1.0.0" } }, + "leb": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/leb/-/leb-0.3.0.tgz", + "integrity": "sha1-Mr7p+tFoMo1q6oUi2DP0GA7tHaM=", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -3764,26 +4176,6 @@ "type-check": "0.3.2" } }, - "load-json-file": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", - "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", - "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, "loader-fs-cache": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz", @@ -3863,9 +4255,9 @@ } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", "dev": true }, "lodash._reinterpolate": { @@ -3911,10 +4303,10 @@ "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", "dev": true }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", "dev": true }, "loose-envify": { @@ -3927,30 +4319,45 @@ } }, "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { "pseudomap": "1.0.2", "yallist": "2.1.2" } }, - "macaddress": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.8.tgz", - "integrity": "sha1-WQTcU3w57G2+/q6QIycTX6hRHxI=", - "dev": true - }, "make-dir": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", - "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "3.0.0" } }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, "math-expression-evaluator": { "version": "1.2.17", "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", @@ -3965,18 +4372,6 @@ "requires": { "hash-base": "3.0.4", "inherits": "2.0.3" - }, - "dependencies": { - "hash-base": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", - "dev": true, - "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.1" - } - } } }, "mem": { @@ -3985,7 +4380,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "memory-fs": { @@ -3994,29 +4389,29 @@ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "dev": true, "requires": { - "errno": "0.1.6", - "readable-stream": "2.3.3" + "errno": "0.1.7", + "readable-stream": "2.3.6" } }, "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" } }, "miller-rabin": { @@ -4030,15 +4425,15 @@ } }, "mimic-fn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", - "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimalistic-assert": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", - "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, "minimalistic-crypto-utils": { @@ -4053,7 +4448,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -4062,6 +4457,45 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "requires": { + "concat-stream": "1.6.2", + "duplexify": "3.6.0", + "end-of-stream": "1.4.1", + "flush-write-stream": "1.0.3", + "from2": "2.3.0", + "parallel-transform": "1.1.0", + "pump": "2.0.1", + "pumpify": "1.5.1", + "stream-each": "1.2.2", + "through2": "2.0.3" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -4071,6 +4505,20 @@ "minimist": "0.0.8" } }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "copy-concurrently": "1.0.5", + "fs-write-stream-atomic": "1.0.10", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -4084,18 +4532,50 @@ "dev": true }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true, "optional": true }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "neo-async": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", + "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", + "dev": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, "node-libs-browser": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", @@ -4108,7 +4588,7 @@ "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.12.0", - "domain-browser": "1.1.7", + "domain-browser": "1.2.0", "events": "1.1.1", "https-browserify": "1.0.0", "os-browserify": "0.3.0", @@ -4116,27 +4596,23 @@ "process": "0.11.10", "punycode": "1.4.1", "querystring-es3": "0.2.1", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "stream-browserify": "2.0.1", - "stream-http": "2.7.2", - "string_decoder": "1.0.3", - "timers-browserify": "2.0.4", + "stream-http": "2.8.3", + "string_decoder": "1.1.1", + "timers-browserify": "2.0.10", "tty-browserify": "0.0.0", "url": "0.11.0", "util": "0.10.3", "vm-browserify": "0.0.4" - } - }, - "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, - "requires": { - "hosted-git-info": "2.5.0", - "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } } }, "normalize-path": { @@ -4193,20 +4669,59 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, - "object-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.2.0.tgz", - "integrity": "sha512-smRWXzkvxw72VquyZ0wggySl7PFUtoDhvhpdwgESXxUrH7vVhhp9asfup1+rVLrhsl7L45Ee1Q/l5R2Ul4MwUg==", - "dev": true - }, - "object.omit": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "object-hash": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz", + "integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "3.0.1" } }, "once": { @@ -4230,7 +4745,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "optionator": { @@ -4283,10 +4798,13 @@ "dev": true }, "p-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", - "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", - "dev": true + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } }, "p-locate": { "version": "2.0.0", @@ -4294,38 +4812,43 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.1.0" + "p-limit": "1.2.0" } }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "pako": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", "dev": true }, - "parse-asn1": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", - "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", "dev": true, "requires": { - "asn1.js": "4.9.2", - "browserify-aes": "1.1.1", - "create-hash": "1.1.3", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.14" + "cyclist": "0.2.2", + "inherits": "2.0.3", + "readable-stream": "2.3.6" } }, - "parse-glob": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.16" } }, "parse-json": { @@ -4337,6 +4860,12 @@ "error-ex": "1.3.1" } }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", @@ -4353,6 +4882,12 @@ "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -4383,34 +4918,17 @@ "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, - "path-type": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", - "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", - "dev": true, - "requires": { - "pify": "2.3.0" - }, - "dependencies": { - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - } - } - }, "pbkdf2": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", - "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", "dev": true, "requires": { - "create-hash": "1.1.3", - "create-hmac": "1.1.6", - "ripemd160": "2.0.1", - "safe-buffer": "5.1.1", - "sha.js": "2.4.9" + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" } }, "pify": { @@ -4440,56 +4958,56 @@ "integrity": "sha1-LaSh3m7EQjxfw3lOkwuB1EkOxoY=", "dev": true, "requires": { - "browserslist": "2.10.0", - "postcss": "6.0.14", + "browserslist": "2.11.3", + "postcss": "6.0.22", "reduce-css-calc": "1.3.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "browserslist": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.10.0.tgz", - "integrity": "sha512-WyvzSLsuAVPOjbljXnyeWl14Ae+ukAT8MUuagKVzIDvwBxl4UAwD1xqtyQs2eWYPGUKMeC3Ol62goqYuKqTTcw==", + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", "dev": true, "requires": { - "caniuse-lite": "1.0.30000784", - "electron-to-chromium": "1.3.30" + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4499,12 +5017,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4525,44 +5043,44 @@ "dev": true, "requires": { "onecolor": "3.0.5", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4572,12 +5090,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4588,6 +5106,12 @@ "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "postcss": { "version": "5.2.18", "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", @@ -4595,7 +5119,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.0", + "js-base64": "2.4.5", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -4612,57 +5136,51 @@ } }, "postcss-apply": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.8.0.tgz", - "integrity": "sha1-FOVEu7XLbxweBIhXll15rgZrE0M=", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.10.0.tgz", + "integrity": "sha512-h0jVwtwViCo0wu+l3hEa9+RNlFbwpeVBYKRBF1K6Kqwat9egE3dDTZsUrQ9YyNE/AP3WWC5G2/oXQAezWPOJnw==", "dev": true, "requires": { "babel-runtime": "6.26.0", - "balanced-match": "0.4.2", - "postcss": "6.0.14" + "balanced-match": "1.0.0", + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, - "balanced-match": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", - "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", - "dev": true - }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4672,12 +5190,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4688,45 +5206,45 @@ "integrity": "sha1-lNxCLI+QmX8WvTOjZUu77AhJY7Q=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-selector-parser": "2.2.3" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4736,12 +5254,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4764,46 +5282,46 @@ "dev": true, "requires": { "css-color-function": "1.3.3", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-message-helpers": "2.0.0", "postcss-value-parser": "3.3.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4813,12 +5331,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4830,29 +5348,29 @@ "dev": true, "requires": { "color": "2.0.1", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-message-helpers": "2.0.0", "reduce-function-call": "1.0.2" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "color": { @@ -4876,20 +5394,20 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4899,12 +5417,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4916,28 +5434,28 @@ "dev": true, "requires": { "color": "1.0.3", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-message-helpers": "2.0.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "color": { @@ -4961,20 +5479,20 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -4984,12 +5502,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5000,46 +5518,46 @@ "integrity": "sha1-EnA2ZvoxBDDj8wpFTawThjF9WEQ=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-value-parser": "3.3.0", "units-css": "0.4.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5049,12 +5567,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5066,29 +5584,29 @@ "dev": true, "requires": { "color": "1.0.3", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-message-helpers": "2.0.0", "reduce-function-call": "1.0.2" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "color": { @@ -5112,20 +5630,20 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5135,61 +5653,61 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "postcss-color-rebeccapurple": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-3.0.0.tgz", - "integrity": "sha1-7rrwPTY7QwC5Z5K9MIHBntZlE9M=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-3.1.0.tgz", + "integrity": "sha512-212hJUk9uSsbwO5ECqVjmh/iLsmiVL1xy9ce9TVf+X3cK/ZlUIlaMdoxje/YpsL9cmUH3I7io+/G2LyWx5rg1g==", "dev": true, "requires": { - "postcss": "6.0.14", - "postcss-value-parser": "3.3.0" + "postcss": "6.0.22", + "postcss-values-parser": "1.5.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5199,12 +5717,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5215,45 +5733,45 @@ "integrity": "sha1-FFOcinExSUtILg3RzCZf9lFLUmM=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-value-parser": "3.3.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5263,12 +5781,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5279,46 +5797,46 @@ "integrity": "sha1-N9XJNToHoJJwkSqCYGu0Kg1wLAQ=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-value-parser": "3.3.0", "rgb-hex": "2.1.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5328,12 +5846,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5360,17 +5878,17 @@ } }, "postcss-cssnext": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/postcss-cssnext/-/postcss-cssnext-3.0.2.tgz", - "integrity": "sha512-jA6kGdcUMZqLUgw6MdpyNWGFhk0LIITVhC/jTnLRZLoXSTR88qT2cFOn3LbY06udt1PVdTCHDG3plBjxVKf8BQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-cssnext/-/postcss-cssnext-3.1.0.tgz", + "integrity": "sha512-awPDhI4OKetcHCr560iVCoDuP6e/vn0r6EAqdWPpAavJMvkBSZ6kDpSN4b3mB3Ti57hQMunHHM8Wvx9PeuYXtA==", "dev": true, "requires": { - "autoprefixer": "7.2.3", + "autoprefixer": "7.2.6", "caniuse-api": "2.0.0", - "chalk": "2.3.0", + "chalk": "2.4.1", "pixrem": "4.0.1", "pleeease-filters": "4.0.0", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-apply": "0.8.0", "postcss-attribute-case-insensitive": "2.0.0", "postcss-calc": "6.0.1", @@ -5379,13 +5897,13 @@ "postcss-color-hex-alpha": "3.0.0", "postcss-color-hsl": "2.0.0", "postcss-color-hwb": "3.0.0", - "postcss-color-rebeccapurple": "3.0.0", + "postcss-color-rebeccapurple": "3.1.0", "postcss-color-rgb": "2.0.0", "postcss-color-rgba-fallback": "3.0.0", "postcss-custom-media": "6.0.0", - "postcss-custom-properties": "6.2.0", + "postcss-custom-properties": "6.3.1", "postcss-custom-selectors": "4.0.1", - "postcss-font-family-system-ui": "2.1.1", + "postcss-font-family-system-ui": "3.0.0", "postcss-font-variant": "3.0.0", "postcss-image-set-polyfill": "0.3.5", "postcss-initial": "2.0.0", @@ -5399,36 +5917,42 @@ }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "autoprefixer": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.3.tgz", - "integrity": "sha512-dqzVGiz3v934+s3YZA6nk7tAs9xuTz5wMJbX1M+L4cY/MTNkOUqP61c1GWkEVlUL/PEy1pKRSCFuoRZrXYx9qA==", + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.6.tgz", + "integrity": "sha512-Iq8TRIB+/9eQ8rbGhcP7ct5cYb/3qjNYAR2SnzLCEcwF6rvVOax8+9+fccgXk4bEhQGjOZd5TLhsksmAdsbGqQ==", "dev": true, "requires": { - "browserslist": "2.10.0", - "caniuse-lite": "1.0.30000784", + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000846", "normalize-range": "0.1.2", "num2fraction": "1.2.2", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-value-parser": "3.3.0" } }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, "browserslist": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.10.0.tgz", - "integrity": "sha512-WyvzSLsuAVPOjbljXnyeWl14Ae+ukAT8MUuagKVzIDvwBxl4UAwD1xqtyQs2eWYPGUKMeC3Ol62goqYuKqTTcw==", + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", "dev": true, "requires": { - "caniuse-lite": "1.0.30000784", - "electron-to-chromium": "1.3.30" + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" } }, "caniuse-api": { @@ -5437,38 +5961,49 @@ "integrity": "sha1-sd21pZZrFvSNxJmERNS7xsfZ2DQ=", "dev": true, "requires": { - "browserslist": "2.10.0", - "caniuse-lite": "1.0.30000784", + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000846", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" + } + }, + "postcss-apply": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.8.0.tgz", + "integrity": "sha1-FOVEu7XLbxweBIhXll15rgZrE0M=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "balanced-match": "0.4.2", + "postcss": "6.0.22" } }, "postcss-calc": { @@ -5478,15 +6013,51 @@ "dev": true, "requires": { "css-unit-converter": "1.1.1", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-selector-parser": "2.2.3", - "reduce-css-calc": "2.1.3" + "reduce-css-calc": "2.1.4" + } + }, + "postcss-custom-properties": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-6.3.1.tgz", + "integrity": "sha512-zoiwn4sCiUFbr4KcgcNZLFkR6gVQom647L+z1p/KBVHZ1OYwT87apnS42atJtx6XlX2yI7N5fjXbFixShQO2QQ==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "postcss": "6.0.22" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + } + } + }, + "postcss-font-family-system-ui": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-3.0.0.tgz", + "integrity": "sha512-58G/hTxMSSKlIRpcPUjlyo6hV2MEzvcVO2m4L/T7Bb2fJTG4DYYfQjQeRvuimKQh1V1sOzCIz99g+H2aFNtlQw==", + "dev": true, + "requires": { + "postcss": "6.0.22" + } + }, + "postcss-nesting": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-4.2.1.tgz", + "integrity": "sha512-IkyWXICwagCnlaviRexi7qOdwPw3+xVVjgFfGsxmztvRVaNxAlrypOIKqDE5mxY+BVxnId1rnUKBRQoNE2VDaA==", + "dev": true, + "requires": { + "postcss": "6.0.22" } }, "reduce-css-calc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-2.1.3.tgz", - "integrity": "sha1-Y8TGMl/7v06mwj8dTetHw5U/O4E=", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz", + "integrity": "sha512-i/vWQbyd3aJRmip9OVSN9V6nIjLf/gg/ctxb0CpvHWtcRysFl/ngDBQD+rqavxdw/doScA3GMBXhzkHQ4GCzFQ==", "dev": true, "requires": { "css-unit-converter": "1.1.1", @@ -5500,12 +6071,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5516,44 +6087,44 @@ "integrity": "sha1-vlMnhBEOyylQRPtTlaGABushpzc=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5563,61 +6134,61 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "postcss-custom-properties": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-6.2.0.tgz", - "integrity": "sha512-eNR2h9T9ciKMoQEORrPjH33XeN/nuvVuxArOKmHtsFbGbNss631tgTrKou3/pmjAZbA4QQkhLIkPQkIk3WW+8w==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-7.0.0.tgz", + "integrity": "sha512-dl/CNaM6z2RBa0vZZqsV6Hunj4HD6Spu7FcAkiVp5B2tgm6xReKKYzI7x7QNx3wTMBNj5v+ylfVcQGMW4xdkHw==", "dev": true, "requires": { "balanced-match": "1.0.0", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5627,12 +6198,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5643,45 +6214,45 @@ "integrity": "sha1-eBOC+UxS5yfvXKR3bqKt9JphE4I=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-selector-matches": "3.0.1" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5691,12 +6262,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5748,62 +6319,58 @@ } }, "postcss-filter-plugins": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz", - "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz", + "integrity": "sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ==", "dev": true, "requires": { - "postcss": "5.2.18", - "uniqid": "4.1.1" + "postcss": "5.2.18" } }, "postcss-font-family-system-ui": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-2.1.1.tgz", - "integrity": "sha512-AOAn553wVmMDx2nph0axVDXJwhsd9x4MjKHRH9SOXL4YdiqsYFxyTVTWnlka9iNB70Pb3Idxmj79bIXxq38b/w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-3.0.0.tgz", + "integrity": "sha512-58G/hTxMSSKlIRpcPUjlyo6hV2MEzvcVO2m4L/T7Bb2fJTG4DYYfQjQeRvuimKQh1V1sOzCIz99g+H2aFNtlQw==", "dev": true, "requires": { - "@std/esm": "0.16.0", - "lodash": "4.17.4", - "postcss": "6.0.14", - "postcss-value-parser": "3.3.0" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5813,12 +6380,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5829,44 +6396,44 @@ "integrity": "sha1-CMzIj2BQuoLtjvLMdsDGprQfGD4=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5876,12 +6443,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5892,45 +6459,45 @@ "integrity": "sha1-Dxk0E3AM8fgr05Bm7wFtZaShgYE=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-media-query-parser": "0.2.3" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -5940,12 +6507,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5957,44 +6524,44 @@ "dev": true, "requires": { "lodash.template": "4.4.0", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6004,12 +6571,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6047,52 +6614,52 @@ } }, "postcss-loader": { - "version": "2.0.9", - "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-2.0.9.tgz", - "integrity": "sha512-sgoXPtmgVT3aBAhU47Kig8oPF+mbXl8Unjvtz1Qj1q2D2EvSVJW2mKJNzxv5y/LvA9xWwuvdysvhc7Zn80UWWw==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-2.1.5.tgz", + "integrity": "sha512-pV7kB5neJ0/1tZ8L1uGOBNTVBCSCXQoIsZMsrwvO8V2rKGa2tBl/f80GGVxow2jJnRJ2w1ocx693EKhZAb9Isg==", "dev": true, "requires": { "loader-utils": "1.1.0", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-load-config": "1.2.0", - "schema-utils": "0.3.0" + "schema-utils": "0.4.5" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6102,12 +6669,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6118,44 +6685,44 @@ "integrity": "sha1-Z1JWA3pD70C8Twdgv9BtTcadSNI=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6165,12 +6732,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6211,7 +6778,19 @@ "caniuse-api": "1.6.1", "postcss": "5.2.18", "postcss-selector-parser": "2.2.3", - "vendors": "1.0.1" + "vendors": "1.0.2" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "postcss-message-helpers": { @@ -6266,49 +6845,49 @@ } }, "postcss-modules-extract-imports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz", - "integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz", + "integrity": "sha1-ZhQOzs447wa/DT41XWm/WdFB6oU=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6318,12 +6897,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6335,44 +6914,44 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6382,12 +6961,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6399,44 +6978,44 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6446,12 +7025,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6463,44 +7042,44 @@ "dev": true, "requires": { "icss-replace-symbols": "1.1.0", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6510,61 +7089,72 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "postcss-nested": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-2.1.2.tgz", - "integrity": "sha512-CU7KjbFOZSNrbFwrl8+KJHTj29GjCEhL86kCKyvf+k633fc+FQA6IuhGyPze5e+a4O5d2fP7hDlMOlVDXia1Xg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-3.0.0.tgz", + "integrity": "sha512-1xxmLHSfubuUi6xZZ0zLsNoiKfk3BWQj6fkNMaBJC529wKKLcdeCxXt6KJmDLva+trNyQNwEaE/ZWMA7cve1fA==", "dev": true, "requires": { - "postcss": "6.0.14", - "postcss-selector-parser": "2.2.3" + "postcss": "6.0.22", + "postcss-selector-parser": "3.1.1" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" + } + }, + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" } }, "source-map": { @@ -6574,72 +7164,62 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "postcss-nested-ancestors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postcss-nested-ancestors/-/postcss-nested-ancestors-1.0.0.tgz", - "integrity": "sha1-t+Li5K67vBRWqa35KD9spcOmHeM=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-nested-ancestors/-/postcss-nested-ancestors-2.0.0.tgz", + "integrity": "sha512-r8WbA1XLqbDuOGdCWpQ5nXdHvL4eKdnCEcDAnUlIAUHk7ZIQAESqPdxrWGPlq70ZB+FKw4wPbX1850dgFuxUKQ==", "dev": true, "requires": { "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1", - "postcss": "5.2.18", + "postcss": "6.0.22", "postcss-resolve-nested-selector": "0.1.1" - } - }, - "postcss-nesting": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-4.2.1.tgz", - "integrity": "sha512-IkyWXICwagCnlaviRexi7qOdwPw3+xVVjgFfGsxmztvRVaNxAlrypOIKqDE5mxY+BVxnId1rnUKBRQoNE2VDaA==", - "dev": true, - "requires": { - "postcss": "6.0.14" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6649,12 +7229,75 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" + } + } + } + }, + "postcss-nesting": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-6.0.0.tgz", + "integrity": "sha512-Yoglsy6eZbDCbRIXoYSmnIt9ao4xyg07iFwVBd7WyIkDzMSeRxIqUk8xEAdkeJQ7eGfWo6RufrTU7FSUjZ22fg==", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" } } } @@ -6696,45 +7339,45 @@ "integrity": "sha1-kVKgYT00UHIFE+iJKFS65C0O5o4=", "dev": true, "requires": { - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-selector-parser": "2.2.3" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6744,12 +7387,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6760,44 +7403,44 @@ "integrity": "sha1-7vGU6NUkZFylIKlJ6V5RjoEkAss=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6807,12 +7450,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6853,44 +7496,44 @@ "integrity": "sha1-eU22+qVPjbEAhUOSqTr0V2i04ls=", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6900,12 +7543,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6923,44 +7566,44 @@ "dev": true, "requires": { "gonzales-pe": "4.2.3", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -6970,60 +7613,60 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "postcss-scss": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-1.0.2.tgz", - "integrity": "sha1-/0XPM1S4ee6JpOtoaA9GrJuxT5Q=", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-1.0.5.tgz", + "integrity": "sha512-gJB1tKYMkBy0MU+COt6WXA4ZiRctAKoWLa6qD7a6bbEbBMqrpa/BhfQdN80eYMV+JkKddZVEpZlOggnGShpvyg==", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -7033,12 +7676,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7050,13 +7693,13 @@ "dev": true, "requires": { "balanced-match": "0.4.2", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" @@ -7069,31 +7712,31 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -7103,12 +7746,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7120,13 +7763,13 @@ "dev": true, "requires": { "balanced-match": "0.4.2", - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" @@ -7139,31 +7782,31 @@ "dev": true }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -7173,12 +7816,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7201,53 +7844,53 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "object-assign": "4.1.1", - "postcss": "6.0.14", + "postcss": "6.0.22", "postcss-sass": "0.2.0", - "postcss-scss": "1.0.2", + "postcss-scss": "1.0.5", "postcss-value-parser": "3.3.0", "promise-each": "2.2.0", "read-cache": "1.0.0", - "resolve": "1.5.0", + "resolve": "1.7.1", "sugarss": "1.0.1" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -7257,12 +7900,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7296,6 +7939,17 @@ "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", "dev": true }, + "postcss-values-parser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-1.5.0.tgz", + "integrity": "sha512-3M3p+2gMp0AH3da530TlX8kiO1nxdTnc3C6vr8dMxRLIlh8UYkz0/wcwptSXjhtx2Fr0TySI7a+BHDQ8NL7LaQ==", + "dev": true, + "requires": { + "flatten": "1.0.2", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, "postcss-zindex": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", @@ -7319,12 +7973,6 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, - "preserve": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", - "dev": true - }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -7338,9 +7986,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { @@ -7358,6 +8006,12 @@ "any-promise": "0.1.0" } }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", @@ -7371,22 +8025,43 @@ "dev": true }, "public-encrypt": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", - "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", "dev": true, "requires": { "bn.js": "4.11.8", "browserify-rsa": "4.0.1", - "create-hash": "1.1.3", - "parse-asn1": "5.1.0", - "randombytes": "2.0.5" + "create-hash": "1.2.0", + "parse-asn1": "5.1.1", + "randombytes": "2.0.6" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "3.6.0", + "inherits": "2.0.3", + "pump": "2.0.1" } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "q": { @@ -7417,64 +8092,23 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, - "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", - "dev": true, - "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" - }, - "dependencies": { - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.6" - } - } - } - }, "randombytes": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "randomfill": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", - "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "2.0.5", - "safe-buffer": "5.1.1" + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" } }, "read-cache": { @@ -7494,39 +8128,18 @@ } } }, - "read-pkg": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", - "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", - "dev": true, - "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.4.0", - "path-type": "2.0.0" - } - }, - "read-pkg-up": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", - "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", - "dev": true, - "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" - } - }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, @@ -7538,7 +8151,7 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "set-immediate-shim": "1.0.1" } }, @@ -7579,9 +8192,9 @@ } }, "regenerate": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", - "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, "regenerator-runtime": { @@ -7601,22 +8214,29 @@ "private": "0.1.8" } }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" } }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "1.3.3", + "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } @@ -7700,20 +8320,43 @@ } }, "resolve": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", - "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { "path-parse": "1.0.5" } }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -7724,6 +8367,12 @@ "signal-exit": "3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "rgb": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/rgb/-/rgb-0.1.0.tgz", @@ -7736,15 +8385,6 @@ "integrity": "sha1-x3PF/iJoolV42SU5qCp6XOU77aY=", "dev": true }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "requires": { - "align-text": "0.1.4" - } - }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", @@ -7755,12 +8395,12 @@ } }, "ripemd160": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", - "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "2.0.2", + "hash-base": "3.0.4", "inherits": "2.0.3" } }, @@ -7773,6 +8413,15 @@ "is-promise": "2.1.0" } }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "1.2.0" + } + }, "rx-lite": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", @@ -7788,10 +8437,34 @@ "rx-lite": "4.0.8" } }, + "rxjs": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.0.tgz", + "integrity": "sha512-qBzf5uu6eOKiCZuAE0SgZ0/Qp+l54oeVxFfC2t+mJ2SFI6IB8gmMdJHs5DUMu5kqifqcCtsKS2XHjhZu6RKvAw==", + "dev": true, + "requires": { + "tslib": "1.9.2" + } + }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "sax": { @@ -7801,18 +8474,25 @@ "dev": true }, "schema-utils": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", - "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", + "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", "dev": true, "requires": { - "ajv": "5.5.2" + "ajv": "6.5.0", + "ajv-keywords": "3.2.0" } }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", "dev": true }, "set-blocking": { @@ -7827,6 +8507,29 @@ "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -7834,13 +8537,13 @@ "dev": true }, "sha.js": { - "version": "2.4.9", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", - "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { "inherits": "2.0.3", - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "shebang-command": { @@ -7888,6 +8591,122 @@ "is-fullwidth-code-point": "2.0.0" } }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "sort-keys": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", @@ -7909,6 +8728,19 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "2.1.1", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -7918,33 +8750,57 @@ "source-map": "0.5.7" } }, - "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "spdx-license-ids": "1.2.2" + "extend-shallow": "3.0.2" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", - "dev": true - }, - "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", - "dev": true - }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "ssri": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, "stream-browserify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", @@ -7952,22 +8808,38 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.6" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "stream-shift": "1.0.0" } }, "stream-http": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", "dev": true, "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "to-arraybuffer": "1.0.1", "xtend": "4.0.1" } }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -8002,12 +8874,12 @@ } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" } }, "strip-ansi": { @@ -8019,12 +8891,6 @@ "ansi-regex": "2.1.1" } }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", @@ -8043,44 +8909,44 @@ "integrity": "sha512-3qgLZytikQQEVn1/FrhY7B68gPUUGY3R1Q1vTiD5xT+Ti1DP/8iZuwFet9ONs5+bmL8pZoDQ6JrQHVgrNlK6mA==", "dev": true, "requires": { - "postcss": "6.0.14" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.14", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", - "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -8090,12 +8956,12 @@ "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -8129,53 +8995,77 @@ "requires": { "ajv": "5.5.2", "ajv-keywords": "2.1.1", - "chalk": "2.3.0", - "lodash": "4.17.4", + "chalk": "2.4.1", + "lodash": "4.17.10", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.4.0" } }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, "tapable": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", - "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==", "dev": true }, "text-table": { @@ -8190,10 +9080,20 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, "timers-browserify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", "dev": true, "requires": { "setimmediate": "1.0.5" @@ -8220,12 +9120,189 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "ts-loader": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-4.4.1.tgz", + "integrity": "sha512-PvL6jgVEt4RurczrTOR8uI6uRmKRfRXiv3CyMRX8+MSQLlbedfbXtbJIdkhdpbqrsumb+Lc3qrxfmXHCmODyAg==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "enhanced-resolve": "4.0.0", + "loader-utils": "1.1.0", + "micromatch": "3.1.10", + "semver": "5.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "tslib": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", + "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==", + "dev": true + }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.13.0", + "diff": "3.5.0", + "glob": "7.1.2", + "js-yaml": "3.7.0", + "minimatch": "3.0.4", + "resolve": "1.7.1", + "semver": "5.5.0", + "tslib": "1.9.2", + "tsutils": "2.27.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "tslint-loader": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/tslint-loader/-/tslint-loader-3.6.0.tgz", + "integrity": "sha512-Me9Qf/87BOfCY8uJJw+J7VMF4U8WiMXKLhKKKugMydF0xMhMOt9wo2mjYTNhwbF9H7SHh8PAIwRG8roisTNekQ==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "mkdirp": "0.5.1", + "object-assign": "4.1.1", + "rimraf": "2.6.2", + "semver": "5.5.0" + } + }, + "tsutils": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz", + "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", + "dev": true, + "requires": { + "tslib": "1.9.2" + } + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -8247,47 +9324,87 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "typescript": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz", + "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==", + "dev": true + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", "dev": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "commander": "2.13.0", + "source-map": "0.6.1" }, "dependencies": { - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", - "window-size": "0.1.0" - } + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, "uglifyjs-webpack-plugin": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", - "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz", + "integrity": "sha512-hIQJ1yxAPhEA2yW/i7Fr+SXZVMp+VEI3d42RTHBgQd2yhp/1UdBcR3QEWPV5ahBxlqQDMEMTuTEvDHSFINfwSw==", "dev": true, "requires": { - "source-map": "0.5.7", - "uglify-js": "2.8.29", - "webpack-sources": "1.1.0" + "cacache": "10.0.4", + "find-cache-dir": "1.0.0", + "schema-utils": "0.4.5", + "serialize-javascript": "1.5.0", + "source-map": "0.6.1", + "uglify-es": "3.3.9", + "webpack-sources": "1.1.0", + "worker-farm": "1.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } } }, "uniq": { @@ -8296,21 +9413,30 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, - "uniqid": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", - "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", - "dev": true, - "requires": { - "macaddress": "0.2.8" - } - }, "uniqs": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", "dev": true }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "dev": true, + "requires": { + "unique-slug": "2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "dev": true, + "requires": { + "imurmurhash": "0.1.4" + } + }, "units-css": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/units-css/-/units-css-0.4.0.tgz", @@ -8321,6 +9447,67 @@ "viewport-dimensions": "0.2.0" } }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "2.1.1" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -8339,6 +9526,15 @@ } } }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, "util": { "version": "0.10.3", "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", @@ -8362,20 +9558,16 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, - "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", - "dev": true, - "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" - } + "v8-compile-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.0.tgz", + "integrity": "sha512-qNdTUMaCjPs4eEnM3W9H94R3sU70YCuT+/ST7nUf+id1bVOrdjrpUaeZLqPBPRph3hsgn4a4BvwpxhHZx+oSDg==", + "dev": true }, "vendors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.1.tgz", - "integrity": "sha1-N61zyO5Bf7PVgOeFMSMH0nSEfyI=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", + "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==", "dev": true }, "viewport-dimensions": { @@ -8394,59 +9586,175 @@ } }, "watchpack": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", - "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", "dev": true, "requires": { - "async": "2.6.0", - "chokidar": "1.7.0", - "graceful-fs": "4.1.11" + "chokidar": "2.0.3", + "graceful-fs": "4.1.11", + "neo-async": "2.5.1" } }, "webpack": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.10.0.tgz", - "integrity": "sha512-fxxKXoicjdXNUMY7LIdY89tkJJJ0m1Oo8PQutZ5rLgWbV5QVKI15Cn7+/IHnRTd3vfKfiwBx6SBqlorAuNA8LA==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.12.0.tgz", + "integrity": "sha512-EJj2FfhgtjrTbJbJaNulcVpDxi9vsQVvTahHN7xJvIv6W+k4r/E6Hxy4eyOrj+IAFWqYgaUtnpxmSGYP8MSZJw==", "dev": true, "requires": { - "acorn": "5.3.0", - "acorn-dynamic-import": "2.0.2", - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "async": "2.6.0", - "enhanced-resolve": "3.4.1", - "escope": "3.6.0", - "interpret": "1.1.0", - "json-loader": "0.5.7", - "json5": "0.5.1", + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/wasm-edit": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "acorn": "5.6.2", + "acorn-dynamic-import": "3.0.0", + "ajv": "6.5.0", + "ajv-keywords": "3.2.0", + "chrome-trace-event": "1.0.0", + "enhanced-resolve": "4.0.0", + "eslint-scope": "3.7.1", + "json-parse-better-errors": "1.0.2", "loader-runner": "2.3.0", "loader-utils": "1.1.0", "memory-fs": "0.4.1", + "micromatch": "3.1.10", "mkdirp": "0.5.1", + "neo-async": "2.5.1", "node-libs-browser": "2.1.0", - "source-map": "0.5.7", - "supports-color": "4.5.0", - "tapable": "0.2.8", - "uglifyjs-webpack-plugin": "0.4.6", - "watchpack": "1.4.0", - "webpack-sources": "1.1.0", - "yargs": "8.0.2" + "schema-utils": "0.4.5", + "tapable": "1.0.0", + "uglifyjs-webpack-plugin": "1.2.5", + "watchpack": "1.6.0", + "webpack-sources": "1.1.0" }, "dependencies": { - "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "acorn": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", + "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", + "dev": true + } + } + }, + "webpack-cli": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.0.3.tgz", + "integrity": "sha512-65a3T3SDIozJjRU4UJMdK+LXJt73gNs2qpdjsOeq6jIrfBvAKApy59Glof1qDG3wYEo38HRxb+KrwsrsAtsaiA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "cross-spawn": "6.0.5", + "enhanced-resolve": "4.0.0", + "global-modules-path": "2.1.0", + "import-local": "1.0.0", + "inquirer": "6.0.0", + "interpret": "1.1.0", + "loader-utils": "1.1.0", + "supports-color": "5.4.0", + "v8-compile-cache": "2.0.0", + "yargs": "11.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "has-flag": "2.0.0" + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "chardet": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", + "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "external-editor": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", + "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", + "dev": true, + "requires": { + "chardet": "0.5.0", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inquirer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", + "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "3.0.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rxjs": "6.2.0", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" } } } @@ -8476,9 +9784,9 @@ "dev": true }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "2.0.0" @@ -8490,18 +9798,21 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true - }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "worker-farm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", + "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "dev": true, + "requires": { + "errno": "0.1.7" + } + }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", @@ -8556,9 +9867,9 @@ "dev": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { @@ -8568,82 +9879,40 @@ "dev": true }, "yargs": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", - "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { - "camelcase": "4.1.0", - "cliui": "3.2.0", + "cliui": "4.1.0", "decamelize": "1.2.0", + "find-up": "2.1.0", "get-caller-file": "1.0.2", "os-locale": "2.1.0", - "read-pkg-up": "2.0.0", "require-directory": "2.1.1", "require-main-filename": "1.0.1", "set-blocking": "2.0.0", "string-width": "2.1.1", "which-module": "2.0.0", "y18n": "3.2.1", - "yargs-parser": "7.0.0" + "yargs-parser": "9.0.2" }, "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", "dev": true - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "dev": true, - "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" - } - } - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } } } }, "yargs-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", - "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { "camelcase": "4.1.0" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - } } } } diff --git a/package.json b/package.json index 87ea4b73..f8e4d1cc 100644 --- a/package.json +++ b/package.json @@ -4,40 +4,51 @@ "description": "Codex Editor. Native JS, based on API and Open Source", "main": "index.js", "scripts": { - "build": "webpack --progress --display-error-details --display-entrypoints" + "build": "rimraf dist && npm run build:dev", + "build:dev": "webpack --mode development --progress --display-error-details --display-entrypoints" }, "author": "Codex Team", "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/codex-team/codex.editor.git" + }, "devDependencies": { - "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-class-display-name": "^2.1.0", "babel-polyfill": "^6.26.0", - "babel-preset-es2015": "^6.24.1", + "babel-preset-env": "^1.7.0", "babel-runtime": "^6.26.0", - "css-loader": "^0.28.7", - "eslint": "^4.13.1", - "eslint-loader": "^1.9.0", + "css-loader": "^0.28.11", + "eslint": "^4.19.1", + "eslint-loader": "^2.0.0", "extract-text-webpack-plugin": "^3.0.2", "html-janitor": "^2.0.2", "path": "^0.12.7", - "postcss-apply": "^0.8.0", + "postcss-apply": "^0.10.0", "postcss-color-function": "^4.0.1", "postcss-color-hex-alpha": "^3.0.0", - "postcss-cssnext": "^3.0.2", + "postcss-cssnext": "^3.1.0", "postcss-custom-media": "^6.0.0", - "postcss-custom-properties": "^6.2.0", + "postcss-custom-properties": "^7.0.0", "postcss-custom-selectors": "^4.0.1", - "postcss-font-family-system-ui": "^2.1.1", + "postcss-font-family-system-ui": "^3.0.0", "postcss-font-variant": "^3.0.0", - "postcss-loader": "^2.0.9", + "postcss-loader": "^2.1.5", "postcss-media-minmax": "^3.0.0", - "postcss-nested": "^2.1.2", - "postcss-nested-ancestors": "^1.0.0", - "postcss-nesting": "^4.2.1", + "postcss-nested": "^3.0.0", + "postcss-nested-ancestors": "^2.0.0", + "postcss-nesting": "^6.0.0", "postcss-smart-import": "^0.7.6", - "webpack": "^3.10.0" + "rimraf": "^2.6.2", + "ts-loader": "^4.4.1", + "tslint": "^5.10.0", + "tslint-loader": "^3.6.0", + "typescript": "^2.9.1", + "webpack": "^4.12.0", + "webpack-cli": "^3.0.3" }, "dependencies": {} } diff --git a/src/codex.js b/src/codex.js index a5c5f180..c1080226 100644 --- a/src/codex.js +++ b/src/codex.js @@ -85,248 +85,198 @@ let modules = editorModules.map( module => require('./components/modules/' + mod * * @type {CodexEditor} */ -module.exports = class CodexEditor { +export default class CodexEditor { + /** Editor version */ + static get version() { + return VERSION; + } - /** Editor version */ - static get version() { + /** + * @param {EditorConfig} config - user configuration + * + */ + constructor(config) { + /** + * Configuration object + * @type {EditorConfig} + */ + this.config = {}; - return VERSION; + /** + * @typedef {Object} EditorComponents + * @property {BlockManager} BlockManager + * @property {Tools} Tools + * @property {Events} Events + * @property {UI} UI + * @property {Toolbar} Toolbar + * @property {Toolbox} Toolbox + * @property {BlockSettings} BlockSettings + * @property {Renderer} Renderer + * @property {InlineToolbar} InlineToolbar + */ + this.moduleInstances = {}; + Promise.resolve() + .then(() => { + this.configuration = config; + }) + .then(() => this.init()) + .then(() => this.start()) + .then(() => { + console.log('CodeX Editor is ready!'); + }) + .catch(error => { + console.log('CodeX Editor does not ready because of %o', error); + }); + } + + /** + * Setting for configuration + * @param {EditorConfig} config + */ + set configuration(config) { + /** + * Initlai block type + * Uses in case when there is no items passed + * @type {{type: (*), data: {text: null}}} + */ + let initialBlock = { + type : config.initialBlock, + data : {} + }; + + this.config.holderId = config.holderId; + this.config.placeholder = config.placeholder || 'write your story...'; + this.config.sanitizer = config.sanitizer || { + p: true, + b: true, + a: true + }; + + this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; + this.config.tools = config.tools || {}; + this.config.toolsConfig = config.toolsConfig || {}; + this.config.data = config.data || {}; + + /** + * Initialize items to pass data to the Renderer + */ + if (_.isEmpty(this.config.data)) { + this.config.data = {}; + this.config.data.items = [ initialBlock ]; + } else { + if (!this.config.data.items || this.config.data.items.length === 0) { + this.config.data.items = [ initialBlock ]; + } } /** - * @param {EditorConfig} config - user configuration - * + * If initial Block's Tool was not passed, use the first Tool in config.tools */ - constructor(config) { - - /** - * Configuration object - * @type {EditorConfig} - */ - this.config = {}; - - /** - * @typedef {Object} EditorComponents - * @property {BlockManager} BlockManager - * @property {Tools} Tools - * @property {Events} Events - * @property {UI} UI - * @property {Toolbar} Toolbar - * @property {Toolbox} Toolbox - * @property {BlockSettings} BlockSettings - * @property {Renderer} Renderer - */ - this.moduleInstances = {}; - - Promise.resolve() - .then(() => { - - this.configuration = config; - - }) - .then(() => this.init()) - .then(() => this.start()) - .then(() => { - - console.log('CodeX Editor is ready!'); - - }) - .catch(error => { - - console.log('CodeX Editor does not ready because of %o', error); - - }); - + if (!config.initialBlock) { + for (this.config.initialBlock in this.config.tools) break; + } else { + this.config.initialBlock = config.initialBlock; } + } - /** - * Setting for configuration - * @param {EditorConfig} config - */ - set configuration(config) { - - /** - * Initlai block type - * Uses in case when there is no items passed - * @type {{type: (*), data: {text: null}}} - */ - let initialBlock = { - type : config.initialBlock, - data : {} - }; - - this.config.holderId = config.holderId; - this.config.placeholder = config.placeholder || 'write your story...'; - this.config.sanitizer = config.sanitizer || { - p: true, - b: true, - a: true - }; - - this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; - this.config.tools = config.tools || {}; - this.config.toolsConfig = config.toolsConfig || {}; - this.config.data = config.data || {}; - - /** - * Initialize items to pass data to the Renderer - */ - if (_.isEmpty(this.config.data)) { - - this.config.data = {}; - this.config.data.items = [ initialBlock ]; - - } else { - - if (!this.config.data.items || this.config.data.items.length === 0) { - - this.config.data.items = [ initialBlock ]; - - } - - } - - /** - * If initial Block's Tool was not passed, use the first Tool in config.tools - */ - if (!config.initialBlock) { - - for (this.config.initialBlock in this.config.tools) break; - - } else { - - this.config.initialBlock = config.initialBlock; - - } - - } - - /** - * Returns private property - * @returns {EditorConfig} - */ - get configuration() { - - return this.config; - - } - - /** - * Initializes modules: - * - make and save instances - * - configure - */ - init() { - - /** - * Make modules instances and save it to the @property this.moduleInstances - */ - this.constructModules(); - - /** - * Modules configuration - */ - this.configureModules(); - - } + /** + * Returns private property + * @returns {EditorConfig} + */ + get configuration() { + return this.config; + } + /** + * Initializes modules: + * - make and save instances + * - configure + */ + init() { /** * Make modules instances and save it to the @property this.moduleInstances */ - constructModules() { + this.constructModules(); - modules.forEach( Module => { - - try { - - /** - * We use class name provided by displayName property - * - * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' - * To prevent this, we use 'babel-plugin-class-display-name' plugin - * @see https://www.npmjs.com/package/babel-plugin-class-display-name - */ - this.moduleInstances[Module.displayName] = new Module({ - config : this.configuration - }); - - } catch ( e ) { - - console.log('Module %o skipped because %o', Module, e); - - } + /** + * Modules configuration + */ + this.configureModules(); + } + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + constructModules() { + modules.forEach( Module => { + try { + /** + * We use class name provided by displayName property + * + * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' + * To prevent this, we use 'babel-plugin-class-display-name' plugin + * @see https://www.npmjs.com/package/babel-plugin-class-display-name + */ + this.moduleInstances[Module.displayName] = new Module({ + config : this.configuration }); + } catch ( e ) { + console.log('Module %o skipped because %o', Module, e); + } + }); + } + /** + * Modules instances configuration: + * - pass other modules to the 'state' property + * - ... + */ + configureModules() { + for(let name in this.moduleInstances) { + /** + * Module does not need self-instance + */ + this.moduleInstances[name].state = this.getModulesDiff( name ); + } + } + + /** + * Return modules without passed name + */ + getModulesDiff( name ) { + let diff = {}; + + for(let moduleName in this.moduleInstances) { + /** + * Skip module with passed name + */ + if (moduleName === name) { + continue; + } + diff[moduleName] = this.moduleInstances[moduleName]; } - /** - * Modules instances configuration: - * - pass other modules to the 'state' property - * - ... - */ - configureModules() { + return diff; + } - for(let name in this.moduleInstances) { - - /** - * Module does not need self-instance - */ - this.moduleInstances[name].state = this.getModulesDiff( name ); - - } - - } - - /** - * Return modules without passed name - */ - getModulesDiff( name ) { - - let diff = {}; - - for(let moduleName in this.moduleInstances) { - - /** - * Skip module with passed name - */ - if (moduleName === name) { - - continue; - - } - diff[moduleName] = this.moduleInstances[moduleName]; - - } - - return diff; - - } - - /** - * Start Editor! - * - * Get list of modules that needs to be prepared and return a sequence (Promise) - * @return {Promise} - */ - start() { - - let prepareDecorator = module => module.prepare(); - - return Promise.resolve() - .then(prepareDecorator(this.moduleInstances.Tools)) - .then(prepareDecorator(this.moduleInstances.UI)) - .then(prepareDecorator(this.moduleInstances.BlockManager)) - .then(() => { - - return this.moduleInstances.Renderer.render(this.config.data.items); - - - }); - - } + /** + * Start Editor! + * + * Get list of modules that needs to be prepared and return a sequence (Promise) + * @return {Promise} + */ + start() { + let prepareDecorator = module => module.prepare(); + return Promise.resolve() + .then(prepareDecorator(this.moduleInstances.Tools)) + .then(prepareDecorator(this.moduleInstances.UI)) + .then(prepareDecorator(this.moduleInstances.BlockManager)) + .then(() => { + return this.moduleInstances.Renderer.render(this.config.data.items); + }); + } }; // module.exports = (function (editor) { diff --git a/src/components/__module.js b/src/components/__module.js deleted file mode 100644 index d51c419f..00000000 --- a/src/components/__module.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @abstract - * @class Module - * @classdesc All modules inherits from this class. - * - * @typedef {Module} Module - * @property {Object} config - Editor user settings - * @property {Object} Editor - List of Editor modules - */ -export default class Module { - - /** - * @constructor - * - * @param {EditorConfig} config - */ - constructor({ config } = {}) { - - if (new.target === Module) { - - throw new TypeError('Constructors for abstract class Module are not allowed.'); - - } - - /** - * @type {EditorConfig} - */ - this.config = config; - - /** - * @type {EditorComponents} - */ - this.Editor = null; - - } - - /** - * Editor modules setter - * - * @param Editor - * @param Editor.modules {@link CodexEditor#moduleInstances} - * @param Editor.config {@link CodexEditor#configuration} - */ - set state(Editor) { - - this.Editor = Editor; - - } - -} \ No newline at end of file diff --git a/src/components/__module.ts b/src/components/__module.ts new file mode 100644 index 00000000..2817bdb4 --- /dev/null +++ b/src/components/__module.ts @@ -0,0 +1,48 @@ +/** + * @abstract + * @class Module + * @classdesc All modules inherits from this class. + * + * @typedef {Module} Module + * @property {Object} config - Editor user settings + * @property {Object} Editor - List of Editor modules + */ +export default class Module { + + /** + * Editor modules list + * @type {EditorComponents} + */ + private Editor: any = null; + + /** + * Editor configuration object + * @type {EditorConfig} + */ + private config: any = {}; + + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor({config}) { + + if (new.target === Module) { + throw new TypeError('Constructors for abstract class Module are not allowed.'); + } + + this.config = config; + } + + /** + * Editor modules setter + * + * @param Editor + * @param Editor.modules {@link CodexEditor#moduleInstances} + * @param Editor.config {@link CodexEditor#configuration} + */ + set state(Editor) { + this.Editor = Editor; + } +} diff --git a/src/components/block.js b/src/components/block.js index 37f27e73..24dd3c04 100644 --- a/src/components/block.js +++ b/src/components/block.js @@ -18,247 +18,201 @@ * @property pluginsContent - HTML content that returns by Tool's render function */ export default class Block { + /** + * @constructor + * @param {String} toolName - Tool name that passed on initialization + * @param {Object} toolInstance — passed Tool`s instance that rendered the Block + */ + constructor(toolName, toolInstance) { + this.name = toolName; + this.tool = toolInstance; + this._html = this.compose(); + } + /** + * CSS classes for the Block + * @return {{wrapper: string, content: string}} + */ + static get CSS() { + return { + wrapper: 'ce-block', + content: 'ce-block__content', + selected: 'ce-block--selected' + }; + } + + /** + * Make default Block wrappers and put Tool`s content there + * @returns {HTMLDivElement} + */ + compose() { + this.wrapper = $.make('div', Block.CSS.wrapper); + this.contentNode = $.make('div', Block.CSS.content); + this.pluginsContent = this.tool.render(); + + this.contentNode.appendChild(this.pluginsContent); + this.wrapper.appendChild(this.contentNode); + + return this.wrapper; + } + + /** + * Calls Tool's method + * + * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function + * + * @param {String} methodName + * @param {Object} params + */ + call(methodName, params) { /** - * @constructor - * @param {String} toolName - Tool name that passed on initialization - * @param {Object} toolInstance — passed Tool`s instance that rendered the Block + * call Tool's method with the instance context */ - constructor(toolName, toolInstance) { - - this.name = toolName; - this.tool = toolInstance; - this._html = this.compose(); - + if (this.tool[methodName] && this.tool[methodName] instanceof Function) { + this.tool[methodName].call(this.tool, params); } + } - /** - * CSS classes for the Block - * @return {{wrapper: string, content: string}} - */ - static get CSS() { + /** + * Get Block`s HTML + * @returns {HTMLElement} + */ + get html() { + return this._html; + } + + /** + * Get Block's JSON data + * @return {Object} + */ + get data() { + return this.save(); + } + + /** + * is block mergeable + * We plugin have merge function then we call it mergable + * @return {boolean} + */ + get mergeable() { + return typeof this.tool.merge === 'function'; + } + + /** + * Call plugins merge method + * @param {Object} data + */ + mergeWith(data) { + return Promise.resolve() + .then(() => { + this.tool.merge(data); + }); + } + /** + * Extracts data from Block + * Groups Tool's save processing time + * @return {Object} + */ + save() { + let extractedBlock = this.tool.save(this.pluginsContent); + + /** Measuring execution time*/ + let measuringStart = window.performance.now(), + measuringEnd; + + return Promise.resolve(extractedBlock) + .then((finishedExtraction) => { + /** measure promise execution */ + measuringEnd = window.performance.now(); return { - wrapper: 'ce-block', - content: 'ce-block__content', - selected: 'ce-block--selected' + tool: this.name, + data: finishedExtraction, + time : measuringEnd - measuringStart }; + }) + .catch(function (error) { + _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red'); + }); + } + /** + * Uses Tool's validation method to check the correctness of output data + * Tool's validation method is optional + * + * @description Method also can return data if it passed the validation + * + * @param {Object} data + * @returns {Boolean|Object} valid + */ + validateData(data) { + let isValid = true; + + if (this.tool.validate instanceof Function) { + isValid = this.tool.validate(data); } + if (!isValid) { + return false; + } + + return data; + } + + /** + * Check block for emptiness + * @return {Boolean} + */ + get isEmpty() { /** - * Make default Block wrappers and put Tool`s content there - * @returns {HTMLDivElement} + * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool + * That Tools are not empty */ - compose() { - - this.wrapper = $.make('div', Block.CSS.wrapper); - this.contentNode = $.make('div', Block.CSS.content); - this.pluginsContent = this.tool.render(); - - this.contentNode.appendChild(this.pluginsContent); - this.wrapper.appendChild(this.contentNode); - - return this.wrapper; - + if (this.tool.contentless) { + return false; } + let emptyText = $.isEmpty(this.pluginsContent), + emptyMedia = !this.hasMedia; + + return emptyText && emptyMedia; + } + + /** + * Check if block has a media content such as images, iframes and other + * @return {Boolean} + */ + get hasMedia() { /** - * Calls Tool's method - * - * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function - * - * @param {String} methodName - * @param {Object} params + * This tags represents media-content + * @type {string[]} */ - call(methodName, params) { + const mediaTags = [ + 'img', + 'iframe', + 'video', + 'audio', + 'source', + 'input', + 'textarea', + 'twitterwidget' + ]; - /** - * call Tool's method with the instance context - */ - if (this.tool[methodName] && this.tool[methodName] instanceof Function) { - - this.tool[methodName].call(this.tool, params); - - } - - } + return !!this._html.querySelector(mediaTags.join(',')); + } + /** + * Set selected state + * @param {Boolean} state - 'true' to select, 'false' to remove selection + */ + set selected(state) { /** - * Get Block`s HTML - * @returns {HTMLElement} + * We don't need to mark Block as Selected when it is not empty */ - get html() { - - return this._html; - + if (state === true && !this.isEmpty) { + this._html.classList.add(Block.CSS.selected); + } else { + this._html.classList.remove(Block.CSS.selected); } - - /** - * Get Block's JSON data - * @return {Object} - */ - get data() { - - return this.save(); - - } - - /** - * is block mergeable - * We plugin have merge function then we call it mergable - * @return {boolean} - */ - get mergeable() { - - return typeof this.tool.merge === 'function'; - - } - - /** - * Call plugins merge method - * @param {Object} data - */ - mergeWith(data) { - - return Promise.resolve() - .then(() => { - - this.tool.merge(data); - - }); - - } - /** - * Extracts data from Block - * Groups Tool's save processing time - * @return {Object} - */ - save() { - - let extractedBlock = this.tool.save(this.pluginsContent); - - /** Measuring execution time*/ - let measuringStart = window.performance.now(), - measuringEnd; - - return Promise.resolve(extractedBlock) - .then((finishedExtraction) => { - - /** measure promise execution */ - measuringEnd = window.performance.now(); - - return { - tool: this.name, - data: finishedExtraction, - time : measuringEnd - measuringStart - }; - - }) - .catch(function (error) { - - _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red'); - - }); - - } - - /** - * Uses Tool's validation method to check the correctness of output data - * Tool's validation method is optional - * - * @description Method also can return data if it passed the validation - * - * @param {Object} data - * @returns {Boolean|Object} valid - */ - validateData(data) { - - let isValid = true; - - if (this.tool.validate instanceof Function) { - - isValid = this.tool.validate(data); - - } - - if (!isValid) { - - return false; - - } - - return data; - - } - - /** - * Check block for emptiness - * @return {Boolean} - */ - get isEmpty() { - - /** - * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool - * That Tools are not empty - */ - if (this.tool.contentless) { - - return false; - - } - - let emptyText = $.isEmpty(this.pluginsContent), - emptyMedia = !this.hasMedia; - - return emptyText && emptyMedia; - - } - - /** - * Check if block has a media content such as images, iframes and other - * @return {Boolean} - */ - get hasMedia() { - - /** - * This tags represents media-content - * @type {string[]} - */ - const mediaTags = [ - 'img', - 'iframe', - 'video', - 'audio', - 'source', - 'input', - 'textarea', - 'twitterwidget' - ]; - - return !!this._html.querySelector(mediaTags.join(',')); - - } - - /** - * Set selected state - * @param {Boolean} state - 'true' to select, 'false' to remove selection - */ - set selected(state) { - - /** - * We don't need to mark Block as Selected when it is not empty - */ - if (state === true && !this.isEmpty) { - - this._html.classList.add(Block.CSS.selected); - - } else { - - this._html.classList.remove(Block.CSS.selected); - - } - - } - + } } \ No newline at end of file diff --git a/src/components/dom.js b/src/components/dom.js index 53de18c7..c623e6f2 100644 --- a/src/components/dom.js +++ b/src/components/dom.js @@ -2,315 +2,249 @@ * DOM manipulations helper */ export default class Dom { - - /** - * Check if passed tag has no closed tag - * @param {Element} tag - * @return {Boolean} - */ - static isSingleTag(tag) { - - return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); - - }; + /** + * Check if passed tag has no closed tag + * @param {Element} tag + * @return {Boolean} + */ + static isSingleTag(tag) { + return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); + }; - /** - * Helper for making Elements with classname and attributes - * - * @param {string} tagName - new Element tag name - * @param {array|string} classNames - list or name of CSS classname(s) - * @param {Object} attributes - any attributes - * @return {Element} - */ - static make(tagName, classNames = null, attributes = {}) { - - let el = document.createElement(tagName); - - if ( Array.isArray(classNames) ) { - - el.classList.add(...classNames); - - } else if( classNames ) { - - el.classList.add(classNames); - - } - - for (let attrName in attributes) { - - el[attrName] = attributes[attrName]; - - } - - return el; + /** + * Helper for making Elements with classname and attributes + * + * @param {string} tagName - new Element tag name + * @param {array|string} classNames - list or name of CSS classname(s) + * @param {Object} attributes - any attributes + * @return {Element} + */ + static make(tagName, classNames = null, attributes = {}) { + let el = document.createElement(tagName); + if ( Array.isArray(classNames) ) { + el.classList.add(...classNames); + } else if( classNames ) { + el.classList.add(classNames); } - /** - * Creates Text Node with the passed content - * @param {String} content - text content - * @return {Text} - */ - static text(content) { - - return document.createTextNode(content); - + for (let attrName in attributes) { + el[attrName] = attributes[attrName]; } - /** - * Append one or several elements to the parent - * - * @param {Element} parent - where to append - * @param {Element|Element[]} - element ore elements list - */ - static append(parent, elements) { + return el; + } - if ( Array.isArray(elements) ) { - - elements.forEach( el => parent.appendChild(el) ); - - } else { - - parent.appendChild(elements); - - } + /** + * Creates Text Node with the passed content + * @param {String} content - text content + * @return {Text} + */ + static text(content) { + return document.createTextNode(content); + } + /** + * Append one or several elements to the parent + * + * @param {Element} parent - where to append + * @param {Element|Element[]} - element ore elements list + */ + static append(parent, elements) { + if ( Array.isArray(elements) ) { + elements.forEach( el => parent.appendChild(el) ); + } else { + parent.appendChild(elements); } + } + /** + * Selector Decorator + * + * Returns first match + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * + * @returns {Element} + */ + static find(el = document, selector) { + return el.querySelector(selector); + } + + /** + * Selector Decorator. + * + * Returns all matches + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * @returns {NodeList} + */ + static findAll(el = document, selector) { + return el.querySelectorAll(selector); + } + + /** + * Search for deepest node which is Leaf. + * Leaf is the vertex that doesn't have any child nodes + * + * @description Method recursively goes throw the all Node until it finds the Leaf + * + * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} + * @param {Boolean} atLast - find last text node + * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it + */ + static getDeepestNode(node, atLast = false) { /** - * Selector Decorator - * - * Returns first match - * - * @param {Element} el - element we searching inside. Default - DOM Document - * @param {String} selector - searching string - * - * @returns {Element} + * Current function have two directions: + * - starts from first child and every time gets first or nextSibling in special cases + * - starts from last child and gets last or previousSibling + * @type {string} */ - static find(el = document, selector) { + let child = atLast ? 'lastChild' : 'firstChild', + sibling = atLast ? 'previousSibling' : 'nextSibling'; - return el.querySelector(selector); - - } - - /** - * Selector Decorator. - * - * Returns all matches - * - * @param {Element} el - element we searching inside. Default - DOM Document - * @param {String} selector - searching string - * @returns {NodeList} - */ - static findAll(el = document, selector) { - - return el.querySelectorAll(selector); - - } - - /** - * Search for deepest node which is Leaf. - * Leaf is the vertex that doesn't have any child nodes - * - * @description Method recursively goes throw the all Node until it finds the Leaf - * - * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} - * @param {Boolean} atLast - find last text node - * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it - */ - static getDeepestNode(node, atLast = false) { + if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { + let nodeChild = node[child]; + /** + * special case when child is single tag that can't contain any content + */ + if (Dom.isSingleTag(nodeChild)) { /** - * Current function have two directions: - * - starts from first child and every time gets first or nextSibling in special cases - * - starts from last child and gets last or previousSibling - * @type {string} + * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest + * from sibling + * + * 2) If single tag's next sibling is null, then go back to parent and check his sibling + * In case of Node Element continue searching + * + * 3) If none of conditions above happened return parent Node Element */ - let child = atLast ? 'lastChild' : 'firstChild', - sibling = atLast ? 'previousSibling' : 'nextSibling'; - - if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { - - let nodeChild = node[child]; - - /** - * special case when child is single tag that can't contain any content - */ - if (Dom.isSingleTag(nodeChild)) { - - /** - * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest - * from sibling - * - * 2) If single tag's next sibling is null, then go back to parent and check his sibling - * In case of Node Element continue searching - * - * 3) If none of conditions above happened return parent Node Element - */ - if (nodeChild[sibling]) { - - nodeChild = nodeChild[sibling]; - - } else if (nodeChild.parentNode[sibling]) { - - nodeChild = nodeChild.parentNode[sibling]; - - } else { - - return nodeChild.parentNode; - - } - - } - - return this.getDeepestNode(nodeChild, atLast); - - } - - return node; - - } - - /** - * Check if object is DOM node - * - * @param {Object} node - * @returns {boolean} - */ - static isElement(node) { - - return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; - - } - - /** - * Checks target if it is native input - * @param {Element|String} target - HTML element or string - * @return {Boolean} - */ - static isNativeInput(target) { - - let nativeInputs = [ - 'INPUT', - 'TEXTAREA' - ]; - - return target ? nativeInputs.includes(target.tagName) : false; - - } - - /** - * Checks node if it is empty - * - * @description Method checks simple Node without any childs for emptiness - * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method - * - * @param {Node} node - * @return {Boolean} true if it is empty - */ - static isNodeEmpty(node) { - - let nodeText; - - if ( this.isElement(node) && this.isNativeInput(node) ) { - - nodeText = node.value; - + if (nodeChild[sibling]) { + nodeChild = nodeChild[sibling]; + } else if (nodeChild.parentNode[sibling]) { + nodeChild = nodeChild.parentNode[sibling]; } else { - - nodeText = node.textContent.replace('\u200B', ''); - + return nodeChild.parentNode; } + } - return nodeText.trim().length === 0; - + return this.getDeepestNode(nodeChild, atLast); } - /** - * checks node if it is doesn't have any child nodes - * @param {Node} node - * @return {boolean} - */ - static isLeaf(node) { + return node; + } - if (!node) { + /** + * Check if object is DOM node + * + * @param {Object} node + * @returns {boolean} + */ + static isElement(node) { + return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; + } - return false; + /** + * Checks target if it is native input + * @param {Element|String} target - HTML element or string + * @return {Boolean} + */ + static isNativeInput(target) { + let nativeInputs = [ + 'INPUT', + 'TEXTAREA' + ]; - } + return target ? nativeInputs.includes(target.tagName) : false; + } - return node.childNodes.length === 0; + /** + * Checks node if it is empty + * + * @description Method checks simple Node without any childs for emptiness + * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method + * + * @param {Node} node + * @return {Boolean} true if it is empty + */ + static isNodeEmpty(node) { + let nodeText; + if ( this.isElement(node) && this.isNativeInput(node) ) { + nodeText = node.value; + } else { + nodeText = node.textContent.replace('\u200B', ''); } - /** - * breadth-first search (BFS) - * {@link https://en.wikipedia.org/wiki/Breadth-first_search} - * - * @description Pushes to stack all DOM leafs and checks for emptiness - * - * @param {Node} node - * @return {boolean} - */ - static isEmpty(node) { + return nodeText.trim().length === 0; + } - let treeWalker = [], - leafs = []; + /** + * checks node if it is doesn't have any child nodes + * @param {Node} node + * @return {boolean} + */ + static isLeaf(node) { + if (!node) { + return false; + } - if (!node) { + return node.childNodes.length === 0; + } - return true; + /** + * breadth-first search (BFS) + * {@link https://en.wikipedia.org/wiki/Breadth-first_search} + * + * @description Pushes to stack all DOM leafs and checks for emptiness + * + * @param {Node} node + * @return {boolean} + */ + static isEmpty(node) { + let treeWalker = [], + leafs = []; - } + if (!node) { + return true; + } - if (!node.childNodes.length) { + if (!node.childNodes.length) { + return this.isNodeEmpty(node); + } - return this.isNodeEmpty(node); + treeWalker.push(node.firstChild); - } + while ( treeWalker.length > 0 ) { + node = treeWalker.shift(); + if (!node) continue; + + if ( this.isLeaf(node) ) { + leafs.push(node); + } else { treeWalker.push(node.firstChild); + } - while ( treeWalker.length > 0 ) { + while ( node && node.nextSibling ) { + node = node.nextSibling; - node = treeWalker.shift(); + if (!node) continue; - if (!node) continue; - - if ( this.isLeaf(node) ) { - - leafs.push(node); - - } else { - - treeWalker.push(node.firstChild); - - } - - while ( node && node.nextSibling ) { - - node = node.nextSibling; - - if (!node) continue; - - treeWalker.push(node); - - } - - /** - * If one of childs is not empty, checked Node is not empty too - */ - if (node && !this.isNodeEmpty(node)) { - - return false; - - } - - } - - return leafs.every( leaf => this.isNodeEmpty(leaf) ); + treeWalker.push(node); + } + /** + * If one of childs is not empty, checked Node is not empty too + */ + if (node && !this.isNodeEmpty(node)) { + return false; + } } + return leafs.every( leaf => this.isNodeEmpty(leaf) ); + } }; \ No newline at end of file diff --git a/src/components/modules/blockManager.js b/src/components/modules/blockManager.js index 8594ae6d..d12269f8 100644 --- a/src/components/modules/blockManager.js +++ b/src/components/modules/blockManager.js @@ -15,428 +15,355 @@ import Block from '../block'; * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks} */ export default class BlockManager extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); /** - * @constructor - * @param {EditorConfig} config + * Proxy for Blocks instance {@link Blocks} + * + * @type {Proxy} + * @private */ - constructor({config}) { - - super({config}); - - /** - * Proxy for Blocks instance {@link Blocks} - * - * @type {Proxy} - * @private - */ - this._blocks = null; - - /** - * Index of current working block - * - * @type {number} - * @private - */ - this.currentBlockIndex = -1; - - } + this._blocks = null; /** - * Should be called after Editor.UI preparation - * Define this._blocks property + * Index of current working block * - * @returns {Promise} + * @type {number} + * @private */ - prepare() { + this.currentBlockIndex = -1; + } - return new Promise(resolve => { + /** + * Should be called after Editor.UI preparation + * Define this._blocks property + * + * @returns {Promise} + */ + prepare() { + return new Promise(resolve => { + let blocks = new Blocks(this.Editor.UI.nodes.redactor); - let blocks = new Blocks(this.Editor.UI.nodes.redactor); + /** + * We need to use Proxy to overload set/get [] operator. + * So we can use array-like syntax to access blocks + * + * @example + * this._blocks[0] = new Block(...); + * + * block = this._blocks[0]; + * + * @todo proxy the enumerate method + * + * @type {Proxy} + * @private + */ + this._blocks = new Proxy(blocks, { + set: Blocks.set, + get: Blocks.get + }); - /** - * We need to use Proxy to overload set/get [] operator. - * So we can use array-like syntax to access blocks - * - * @example - * this._blocks[0] = new Block(...); - * - * block = this._blocks[0]; - * - * @todo proxy the enumerate method - * - * @type {Proxy} - * @private - */ - this._blocks = new Proxy(blocks, { - set: Blocks.set, - get: Blocks.get - }); + resolve(); + }); + } - resolve(); + /** + * Creates Block instance by tool name + * + * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} + * @param {Object} data - constructor params + * + * @return {Block} + */ + composeBlock(toolName, data) { + let toolInstance = this.Editor.Tools.construct(toolName, data), + block = new Block(toolName, toolInstance); - }); - - } + this.bindEvents(block); /** - * Creates Block instance by tool name - * - * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} - * @param {Object} data - constructor params - * - * @return {Block} - */ - composeBlock(toolName, data) { - - let toolInstance = this.Editor.Tools.construct(toolName, data), - block = new Block(toolName, toolInstance); - - this.bindEvents(block); - - /** * Apply callback before inserting html */ - block.call('appendCallback', {}); + block.call('appendCallback', {}); - return block; + return block; + } + /** + * Bind Events + * @param {Object} block + */ + bindEvents(block) { + this.Editor.Listeners.on(block.pluginsContent, 'keydown', (event) => this.Editor.Keyboard.blockKeydownsListener(event)); + this.Editor.Listeners.on(block.pluginsContent, 'mouseup', (event) => { + this.Editor.InlineToolbar.move(event); + }); + } + + /** + * Set's caret to the next Block + * Before moving caret, we should check if caret position is at the end of Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + */ + navigateNext() { + let caretAtEnd = this.Editor.Caret.isAtEnd; + + if (!caretAtEnd) { + return; } - /** - * Bind Events - * @param {Object} block - */ - bindEvents(block) { - - this.Editor.Listeners.on(block.pluginsContent, 'keydown', (event) => this.Editor.Keyboard.blockKeydownsListener(event)); + let nextBlock = this.nextBlock; + if (!nextBlock) { + return; } - /** - * Set's caret to the next Block - * Before moving caret, we should check if caret position is at the end of Plugins node - * Using {@link Dom#getDeepestNode} to get a last node and match with current selection - */ - navigateNext() { + this.Editor.Caret.setToBlock( nextBlock ); + } - let caretAtEnd = this.Editor.Caret.isAtEnd; + /** + * Set's caret to the previous Block + * Before moving caret, we should check if caret position is start of the Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + */ + navigatePrevious() { + let caretAtStart = this.Editor.Caret.isAtStart; - if (!caretAtEnd) { + if (!caretAtStart) { + return; + } - return; + let previousBlock = this.previousBlock; + if (!previousBlock) { + return; + } + + this.Editor.Caret.setToBlock( previousBlock, 0, true ); + } + + /** + * Insert new block into _blocks + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + insert(toolName, data = {}) { + let block = this.composeBlock(toolName, data); + + this._blocks[++this.currentBlockIndex] = block; + this.Editor.Caret.setToBlock(block); + } + + /** + * Merge two blocks + * @param {Block} targetBlock - previous block will be append to this block + * @param {Block} blockToMerge - block that will be merged with target block + * + * @return {Promise} - the sequence that can be continued + */ + mergeBlocks(targetBlock, blockToMerge) { + let blockToMergeIndex = this._blocks.indexOf(blockToMerge); + + return Promise.resolve() + .then( () => { + if (blockToMerge.isEmpty) { + return; } - let nextBlock = this.nextBlock; + return blockToMerge.data + .then((blockToMergeInfo) => { + targetBlock.mergeWith(blockToMergeInfo.data); + }); + }) + .then( () => { + this.removeBlock(blockToMergeIndex); + this.currentBlockIndex = this._blocks.indexOf(targetBlock); + }); + } - if (!nextBlock) { + /** + * Remove block with passed index or remove last + * @param {Number|null} index + */ + removeBlock(index) { + this._blocks.remove(index); + } + /** + * Split current Block + * 1. Extract content from Caret position to the Block`s end + * 2. Insert a new Block below current one with extracted content + */ + split() { + let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), + wrapper = $.make('div'); - return; - - } - - this.Editor.Caret.setToBlock( nextBlock ); - - - } + wrapper.append(extractedFragment); /** - * Set's caret to the previous Block - * Before moving caret, we should check if caret position is start of the Plugins node - * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + * @todo make object in accordance with Tool */ - navigatePrevious() { + let data = { + text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML, + }; - let caretAtStart = this.Editor.Caret.isAtStart; + this.insert(this.config.initialBlock, data); + } - if (!caretAtStart) { + /** + * Replace current working block + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + replace(toolName, data = {}) { + let block = this.composeBlock(toolName, data); - return; + this._blocks.insert(this.currentBlockIndex, block, true); + } - } + /** + * returns last Block + * @return {Block} + */ + get lastBlock() { + return this._blocks[this._blocks.length - 1]; + } - let previousBlock = this.previousBlock; + /** + * Returns Block by passed index + * @param {Number} index + * @return {Block} + */ + getBlockByIndex(index) { + return this._blocks[index]; + } - if (!previousBlock) { - - return; - - } - - this.Editor.Caret.setToBlock( previousBlock, 0, true ); + /** + * Get Block instance by html element + * @param {HTMLElement} element + * @returns {Block} + */ + getBlock(element) { + let nodes = this._blocks.nodes, + firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`), + index = nodes.indexOf(firstLevelBlock); + if (index >= 0) { + return this._blocks[index]; } + } + + /** + * Get current Block instance + * + * @return {Block} + */ + get currentBlock() { + return this._blocks[this.currentBlockIndex]; + } + + /** + * Returns next Block instance + * @return {Block|null} + */ + get nextBlock() { + let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1); + + if (isLastBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex + 1]; + } + + /** + * Returns previous Block instance + * @return {Block|null} + */ + get previousBlock() { + let isFirstBlock = this.currentBlockIndex === 0; + + if (isFirstBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex - 1]; + } + + /** + * Get working html element + * + * @return {HTMLElement} + */ + get currentNode() { + return this._blocks.nodes[this.currentBlockIndex]; + } + + /** + * Set currentBlockIndex to passed block + * @param {HTMLElement} element + */ + set currentNode(element) { + let nodes = this._blocks.nodes, + firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`); /** - * Insert new block into _blocks - * - * @param {String} toolName — plugin name - * @param {Object} data — plugin data + * Update current Block's index + * @type {number} */ - insert(toolName, data = {}) { - - let block = this.composeBlock(toolName, data); - - this._blocks[++this.currentBlockIndex] = block; - this.Editor.Caret.setToBlock(block); - - } + this.currentBlockIndex = nodes.indexOf(firstLevelBlock); /** - * Merge two blocks - * @param {Block} targetBlock - previous block will be append to this block - * @param {Block} blockToMerge - block that will be merged with target block - * - * @return {Promise} - the sequence that can be continued + * Remove previous selected Block's state */ - mergeBlocks(targetBlock, blockToMerge) { - - let blockToMergeIndex = this._blocks.indexOf(blockToMerge); - - return Promise.resolve() - .then( () => { - - if (blockToMerge.isEmpty) { - - return; - - } - - return blockToMerge.data - .then((blockToMergeInfo) => { - - targetBlock.mergeWith(blockToMergeInfo.data); - - }); - - }) - .then( () => { - - this.removeBlock(blockToMergeIndex); - this.currentBlockIndex = this._blocks.indexOf(targetBlock); - - }); - - - } + this._blocks.array.forEach( block => block.selected = false); /** - * Remove block with passed index or remove last - * @param {Number|null} index + * Mark current Block as selected + * @type {boolean} */ - removeBlock(index) { + this.currentBlock.selected = true; + } - this._blocks.remove(index); + /** + * Get array of Block instances + * + * @returns {Block[]} {@link Blocks#array} + */ + get blocks() { + return this._blocks.array; + } - } + /** + * 1) Find first-level Block from passed child Node + * 2) Mark it as current + * + * @param {Element|Text} childNode - look ahead from this node. + * @throws Error - when passed Node is not included at the Block + */ + setCurrentBlockByChildNode(childNode) { /** - * Split current Block - * 1. Extract content from Caret position to the Block`s end - * 2. Insert a new Block below current one with extracted content + * If node is Text TextNode */ - split() { - - let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), - wrapper = $.make('div'); - - wrapper.append(extractedFragment); - - /** - * @todo make object in accordance with Tool - */ - let data = { - text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML, - }; - - this.insert(this.config.initialBlock, data); - + if (!$.isElement(childNode)) { + childNode = childNode.parentNode; } - /** - * Replace current working block - * - * @param {String} toolName — plugin name - * @param {Object} data — plugin data - */ - replace(toolName, data = {}) { - - let block = this.composeBlock(toolName, data); - - this._blocks.insert(this.currentBlockIndex, block, true); + let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`); + if (parentFirstLevelBlock) { + this.currentNode = parentFirstLevelBlock; + } else { + throw new Error('Can not find a Block from this child Node'); } - - /** - * returns last Block - * @return {Block} - */ - get lastBlock() { - - return this._blocks[this._blocks.length - 1]; - - } - - /** - * Returns Block by passed index - * @param {Number} index - * @return {Block} - */ - getBlockByIndex(index) { - - return this._blocks[index]; - - } - - /** - * Get Block instance by html element - * @param {HTMLElement} element - * @returns {Block} - */ - getBlock(element) { - - let nodes = this._blocks.nodes, - firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`), - index = nodes.indexOf(firstLevelBlock); - - if (index >= 0) { - - return this._blocks[index]; - - } - - } - - /** - * Get current Block instance - * - * @return {Block} - */ - get currentBlock() { - - return this._blocks[this.currentBlockIndex]; - - } - - /** - * Returns next Block instance - * @return {Block|null} - */ - get nextBlock() { - - let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1); - - if (isLastBlock) { - - return null; - - } - - return this._blocks[this.currentBlockIndex + 1]; - - } - - /** - * Returns previous Block instance - * @return {Block|null} - */ - get previousBlock() { - - let isFirstBlock = this.currentBlockIndex === 0; - - if (isFirstBlock) { - - return null; - - } - - return this._blocks[this.currentBlockIndex - 1]; - - } - - /** - * Get working html element - * - * @return {HTMLElement} - */ - get currentNode() { - - return this._blocks.nodes[this.currentBlockIndex]; - - } - - /** - * Set currentBlockIndex to passed block - * @param {HTMLElement} element - */ - set currentNode(element) { - - let nodes = this._blocks.nodes, - firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`); - - /** - * Update current Block's index - * @type {number} - */ - this.currentBlockIndex = nodes.indexOf(firstLevelBlock); - - /** - * Remove previous selected Block's state - */ - this._blocks.array.forEach( block => block.selected = false); - - /** - * Mark current Block as selected - * @type {boolean} - */ - this.currentBlock.selected = true; - - } - - /** - * Get array of Block instances - * - * @returns {Block[]} {@link Blocks#array} - */ - get blocks() { - - return this._blocks.array; - - } - - /** - * 1) Find first-level Block from passed child Node - * 2) Mark it as current - * - * @param {Element|Text} childNode - look ahead from this node. - * @throws Error - when passed Node is not included at the Block - */ - setCurrentBlockByChildNode(childNode) { - - /** - * If node is Text TextNode - */ - if (!$.isElement(childNode)) { - - childNode = childNode.parentNode; - - } - - let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`); - - if (parentFirstLevelBlock) { - - this.currentNode = parentFirstLevelBlock; - - } else { - - throw new Error('Can not find a Block from this child Node'); - - } - - } - -} + } +}; /** * @class Blocks @@ -448,219 +375,173 @@ export default class BlockManager extends Module { * */ class Blocks { + /** + * @constructor + * + * @param {HTMLElement} workingArea — editor`s working node + */ + constructor(workingArea) { + this.blocks = []; + this.workingArea = workingArea; + } - /** - * @constructor - * - * @param {HTMLElement} workingArea — editor`s working node - */ - constructor(workingArea) { - - this.blocks = []; - this.workingArea = workingArea; + /** + * Push back new Block + * + * @param {Block} block + */ + push(block) { + this.blocks.push(block); + this.workingArea.appendChild(block.html); + } + /** + * Insert new Block at passed index + * + * @param {Number} index — index to insert Block + * @param {Block} block — Block to insert + * @param {Boolean} replace — it true, replace block on given index + */ + insert(index, block, replace = false) { + if (!this.length) { + this.push(block); + return; } - /** - * Push back new Block - * - * @param {Block} block - */ - push(block) { + if (index > this.length) { + index = this.length; + } - this.blocks.push(block); + if (replace) { + this.blocks[index].html.remove(); + } + + let deleteCount = replace ? 1 : 0; + + this.blocks.splice(index, deleteCount, block); + + if (index > 0) { + let previousBlock = this.blocks[index - 1]; + + previousBlock.html.insertAdjacentElement('afterend', block.html); + } else { + let nextBlock = this.blocks[index + 1]; + + if (nextBlock) { + nextBlock.html.insertAdjacentElement('beforebegin', block.html); + } else { this.workingArea.appendChild(block.html); + } + } + } + /** + * Remove block + * @param {Number|null} index + */ + remove(index) { + if (!index) { + index = this.length - 1; } - /** - * Insert new Block at passed index - * - * @param {Number} index — index to insert Block - * @param {Block} block — Block to insert - * @param {Boolean} replace — it true, replace block on given index - */ - insert(index, block, replace = false) { + this.blocks[index].html.remove(); + this.blocks.splice(index, 1); + } - if (!this.length) { + /** + * Insert Block after passed target + * + * @todo decide if this method is necessary + * + * @param {Block} targetBlock — target after wich Block should be inserted + * @param {Block} newBlock — Block to insert + */ + insertAfter(targetBlock, newBlock) { + let index = this.blocks.indexOf(targetBlock); - this.push(block); - return; + this.insert(index + 1, newBlock); + } - } + /** + * Get Block by index + * + * @param {Number} index — Block index + * @returns {Block} + */ + get(index) { + return this.blocks[index]; + } - if (index > this.length) { + /** + * Return index of passed Block + * + * @param {Block} block + * @returns {Number} + */ + indexOf(block) { + return this.blocks.indexOf(block); + } - index = this.length; + /** + * Get length of Block instances array + * + * @returns {Number} + */ + get length() { + return this.blocks.length; + } - } + /** + * Get Block instances array + * + * @returns {Block[]} + */ + get array() { + return this.blocks; + } - if (replace) { - - this.blocks[index].html.remove(); - - } - - let deleteCount = replace ? 1 : 0; - - this.blocks.splice(index, deleteCount, block); - - if (index > 0) { - - let previousBlock = this.blocks[index - 1]; - - previousBlock.html.insertAdjacentElement('afterend', block.html); - - } else { - - let nextBlock = this.blocks[index + 1]; - - if (nextBlock) { - - nextBlock.html.insertAdjacentElement('beforebegin', block.html); - - } else { - - this.workingArea.appendChild(block.html); - - } - - } + /** + * Get blocks html elements array + * + * @returns {HTMLElement[]} + */ + get nodes() { + return _.array(this.workingArea.children); + } + /** + * Proxy trap to implement array-like setter + * + * @example + * blocks[0] = new Block(...) + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — block index + * @param {Block} block — Block to set + * @returns {Boolean} + */ + static set(instance, index, block) { + if (isNaN(Number(index))) { + return false; } - /** - * Remove block - * @param {Number|null} index - */ - remove(index) { + instance.insert(index, block); - if (!index) { - - index = this.length - 1; - - } - - this.blocks[index].html.remove(); - this.blocks.splice(index, 1); - - } - - /** - * Insert Block after passed target - * - * @todo decide if this method is necessary - * - * @param {Block} targetBlock — target after wich Block should be inserted - * @param {Block} newBlock — Block to insert - */ - insertAfter(targetBlock, newBlock) { - - let index = this.blocks.indexOf(targetBlock); - - this.insert(index + 1, newBlock); - - } - - /** - * Get Block by index - * - * @param {Number} index — Block index - * @returns {Block} - */ - get(index) { - - return this.blocks[index]; - - } - - /** - * Return index of passed Block - * - * @param {Block} block - * @returns {Number} - */ - indexOf(block) { - - return this.blocks.indexOf(block); - - } - - /** - * Get length of Block instances array - * - * @returns {Number} - */ - get length() { - - return this.blocks.length; - - } - - /** - * Get Block instances array - * - * @returns {Block[]} - */ - get array() { - - return this.blocks; - - } - - /** - * Get blocks html elements array - * - * @returns {HTMLElement[]} - */ - get nodes() { - - return _.array(this.workingArea.children); - - } - - /** - * Proxy trap to implement array-like setter - * - * @example - * blocks[0] = new Block(...) - * - * @param {Blocks} instance — Blocks instance - * @param {Number|String} index — block index - * @param {Block} block — Block to set - * @returns {Boolean} - */ - static set(instance, index, block) { - - if (isNaN(Number(index))) { - - return false; - - } - - instance.insert(index, block); - - return true; - - } - - /** - * Proxy trap to implement array-like getter - * - * @param {Blocks} instance — Blocks instance - * @param {Number|String} index — Block index - * @returns {Block|*} - */ - static get(instance, index) { - - if (isNaN(Number(index))) { - - return instance[index]; - - } - - return instance.get(index); + return true; + } + /** + * Proxy trap to implement array-like getter + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — Block index + * @returns {Block|*} + */ + static get(instance, index) { + if (isNaN(Number(index))) { + return instance[index]; } + return instance.get(index); + } } \ No newline at end of file diff --git a/src/components/modules/caret.js b/src/components/modules/caret.js index 88fbff06..bd55c375 100644 --- a/src/components/modules/caret.js +++ b/src/components/modules/caret.js @@ -15,285 +15,233 @@ import Selection from '../Selection'; export default class Caret extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + } - /** - * @constructor - */ - constructor({config}) { + /** + * Method gets Block instance and puts caret to the text node with offset + * There two ways that method applies caret position: + * - first found text node: sets at the beginning, but you can pass an offset + * - last found text node: sets at the end of the node. Also, you can customize the behaviour + * + * @param {Block} block - Block class + * @param {Number} offset - caret offset regarding to the text node + * @param {Boolean} atEnd - put caret at the end of the text node or not + */ + setToBlock(block, offset = 0, atEnd = false) { + let element = block.pluginsContent; - super({config}); + /** If Element is INPUT */ + if ($.isNativeInput(element)) { + element.focus(); + return; + } + let nodeToSet = $.getDeepestNode(element, atEnd); + + if (atEnd || offset > nodeToSet.length) { + offset = nodeToSet.length; + } + + /** if found deepest node is native input */ + if ($.isNativeInput(nodeToSet)) { + nodeToSet.focus(); + return; } /** - * Method gets Block instance and puts caret to the text node with offset - * There two ways that method applies caret position: - * - first found text node: sets at the beginning, but you can pass an offset - * - last found text node: sets at the end of the node. Also, you can customize the behaviour - * - * @param {Block} block - Block class - * @param {Number} offset - caret offset regarding to the text node - * @param {Boolean} atEnd - put caret at the end of the text node or not - */ - setToBlock(block, offset = 0, atEnd = false) { - - let element = block.pluginsContent; - - /** If Element is INPUT */ - if ($.isNativeInput(element)) { - - element.focus(); - return; - - } - - let nodeToSet = $.getDeepestNode(element, atEnd); - - if (atEnd || offset > nodeToSet.length) { - - offset = nodeToSet.length; - - } - - /** if found deepest node is native input */ - if ($.isNativeInput(nodeToSet)) { - - nodeToSet.focus(); - return; - - } - - /** * @todo try to fix via Promises or use querySelectorAll to not to use timeout */ - _.delay( () => { + _.delay( () => { + this.set(nodeToSet, offset); + }, 20)(); - this.set(nodeToSet, offset); + this.Editor.BlockManager.currentNode = block.wrapper; + } - }, 20)(); + /** + * Creates Document Range and sets caret to the element with offset + * @param {Element} element - target node. + * @param {Number} offset - offset + */ + set( element, offset = 0) { + let range = document.createRange(), + selection = Selection.get(); - this.Editor.BlockManager.currentNode = block.wrapper; + range.setStart(element, offset); + range.setEnd(element, offset); + selection.removeAllRanges(); + selection.addRange(range); + }; + + /** + * Set Caret to the last Block + * If last block is not empty, append another empty block + */ + setToTheLastBlock() { + let lastBlock = this.Editor.BlockManager.lastBlock; + + if (!lastBlock) return; + + /** + * If last block is empty and it is an initialBlock, set to that. + * Otherwise, append new empty block and set to that + */ + if (lastBlock.isEmpty) { + this.setToBlock(lastBlock); + } else { + this.Editor.BlockManager.insert(this.config.initialBlock); + } + } + + /** + * Extract content fragment of current Block from Caret position to the end of the Block + */ + extractFragmentFromCaretPosition() { + let selection = Selection.get(); + + if (selection.rangeCount) { + let selectRange = selection.getRangeAt(0), + blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; + + selectRange.deleteContents(); + + if (blockElem) { + let range = selectRange.cloneRange(true); + + range.selectNodeContents(blockElem); + range.setStart(selectRange.endContainer, selectRange.endOffset); + return range.extractContents(); + } + } + } + + /** + * Get all first-level (first child of [contenteditabel]) siblings from passed node + * Then you can check it for emptiness + * + * @example + * + * + * @return {Element[]} + */ + getHigherLevelSiblings(from, direction ) { + let current = from, + siblings = []; + + /** + * Find passed node's firs-level parent (in example - blockquote) + */ + while (current.parentNode && current.parentNode.contentEditable !== 'true') { + current = current.parentNode; + } + + let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; + + /** + * Find all left/right siblings + */ + while (current[sibling]) { + current = current[sibling]; + siblings.push(current); + } + + return siblings; + } + + /** + * Get's deepest first node and checks if offset is zero + * @return {boolean} + */ + get isAtStart() { + /** + * Don't handle ranges + */ + if (!Selection.isCollapsed) { + return false; + } + + let selection = Selection.get(), + anchorNode = selection.anchorNode, + firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); + + /** + * Workaround case when caret in the text like " |Hello!" + * selection.anchorOffset is 1, but real caret visible position is 0 + * @type {number} + */ + let firstLetterPosition = anchorNode.textContent.search(/\S/); + + if (firstLetterPosition === -1) { // empty text + firstLetterPosition = 0; } /** - * Creates Document Range and sets caret to the element with offset - * @param {Element} element - target node. - * @param {Number} offset - offset - */ - set( element, offset = 0) { - - let range = document.createRange(), - selection = Selection.get(); - - range.setStart(element, offset); - range.setEnd(element, offset); - - selection.removeAllRanges(); - selection.addRange(range); - - }; - - /** - * Set Caret to the last Block - * If last block is not empty, append another empty block - */ - setToTheLastBlock() { - - let lastBlock = this.Editor.BlockManager.lastBlock; - - if (!lastBlock) return; - - /** - * If last block is empty and it is an initialBlock, set to that. - * Otherwise, append new empty block and set to that - */ - if (lastBlock.isEmpty) { - - this.setToBlock(lastBlock); - - } else { - - this.Editor.BlockManager.insert(this.config.initialBlock); - - } - - } - - /** - * Extract content fragment of current Block from Caret position to the end of the Block - */ - extractFragmentFromCaretPosition() { - - let selection = Selection.get(); - - if (selection.rangeCount) { - - let selectRange = selection.getRangeAt(0), - blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; - - selectRange.deleteContents(); - - if (blockElem) { - - let range = selectRange.cloneRange(true); - - range.selectNodeContents(blockElem); - range.setStart(selectRange.endContainer, selectRange.endOffset); - return range.extractContents(); - - } - - } - - } - - /** - * Get all first-level (first child of [contenteditabel]) siblings from passed node - * Then you can check it for emptiness - * - * @example + * In case of * - * - * @return {Element[]} */ - getHigherLevelSiblings(from, direction ) { + if ($.isEmpty(firstNode)) { + let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), + nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) ); - let current = from, - siblings = []; - /** - * Find passed node's firs-level parent (in example - blockquote) - */ - while (current.parentNode && current.parentNode.contentEditable !== 'true') { - - current = current.parentNode; - - } - - let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; - - /** - * Find all left/right siblings - */ - while (current[sibling]) { - - current = current[sibling]; - siblings.push(current); - - } - - return siblings; + if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { + return true; + } } + return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition; + } + + /** + * Get's deepest last node and checks if offset is last node text length + * @return {boolean} + */ + get isAtEnd() { + /** + * Don't handle ranges + */ + if (!Selection.isCollapsed) { + return false; + } + + let selection = Selection.get(), + anchorNode = selection.anchorNode, + lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); + /** - * Get's deepest first node and checks if offset is zero - * @return {boolean} + * In case of + *
    + * adaddad| <-- anchor node + *

    <-- first (and deepest) node is + *
    */ - get isAtStart() { - - /** - * Don't handle ranges - */ - if (!Selection.isCollapsed) { - - return false; - - } - - let selection = Selection.get(), - anchorNode = selection.anchorNode, - firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); - - /** - * Workaround case when caret in the text like " |Hello!" - * selection.anchorOffset is 1, but real caret visible position is 0 - * @type {number} - */ - let firstLetterPosition = anchorNode.textContent.search(/\S/); - - if (firstLetterPosition === -1) { // empty text - - firstLetterPosition = 0; - - } - - /** - * In case of - *
    - *

    <-- first (and deepest) node is - * |adaddad <-- anchor node - *
    - */ - if ($.isEmpty(firstNode)) { - - let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), - nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) ); - - - - if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { - - return true; - - } - - } - - return firstNode === null || anchorNode === firstNode && selection.anchorOffset === firstLetterPosition; - - } - - /** - * Get's deepest last node and checks if offset is last node text length - * @return {boolean} - */ - get isAtEnd() { - - /** - * Don't handle ranges - */ - if (!Selection.isCollapsed) { - - return false; - - } - - let selection = Selection.get(), - anchorNode = selection.anchorNode, - lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); - - /** - * In case of - *
    - * adaddad| <-- anchor node - *

    <-- first (and deepest) node is - *
    - */ - if ($.isEmpty(lastNode)) { - - let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), - nothingAtRight = leftSiblings.every( node => $.isEmpty(node) ); - - if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { - - return true; - - } - - } - - return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length; + if ($.isEmpty(lastNode)) { + let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), + nothingAtRight = leftSiblings.every( node => $.isEmpty(node) ); + if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { + return true; + } } + return anchorNode === lastNode && selection.anchorOffset === lastNode.textContent.length; + } } diff --git a/src/components/modules/events.js b/src/components/modules/events.js index bf26c95e..980dc41a 100644 --- a/src/components/modules/events.js +++ b/src/components/modules/events.js @@ -11,58 +11,44 @@ * @property {Object} subscribers - all subscribers grouped by event name */ export default class Events extends Module { - - /** + /** * @constructor */ - constructor({config}) { - - super({config}); - this.subscribers = {}; + constructor({config}) { + super({config}); + this.subscribers = {}; + } + /** + * @param {String} eventName - event name + * @param {Function} callback - subscriber + */ + on(eventName, callback) { + if (!(eventName in this.subscribers)) { + this.subscribers[eventName] = []; } - /** - * @param {String} eventName - event name - * @param {Function} callback - subscriber - */ - on(eventName, callback) { + // group by events + this.subscribers[eventName].push(callback); + } - if (!(eventName in this.subscribers)) { + /** + * @param {String} eventName - event name + * @param {Object} data - subscribers get this data when they were fired + */ + emit(eventName, data) { + this.subscribers[eventName].reduce(function (previousData, currentHandler) { + let newData = currentHandler(previousData); - this.subscribers[eventName] = []; - - } - - // group by events - this.subscribers[eventName].push(callback); - - } - - /** - * @param {String} eventName - event name - * @param {Object} data - subscribers get this data when they were fired - */ - emit(eventName, data) { - - this.subscribers[eventName].reduce(function (previousData, currentHandler) { - - let newData = currentHandler(previousData); - - return newData ? newData : previousData; - - }, data); - - } - - /** - * Destroyer - * clears subsribers list - */ - destroy() { - - this.subscribers = null; - - } + return newData ? newData : previousData; + }, data); + } + /** + * Destroyer + * clears subsribers list + */ + destroy() { + this.subscribers = null; + } } \ No newline at end of file diff --git a/src/components/modules/keyboard.js b/src/components/modules/keyboard.js index 6facd416..0b6aff6e 100644 --- a/src/components/modules/keyboard.js +++ b/src/components/modules/keyboard.js @@ -12,166 +12,138 @@ * @typedef {Keyboard} Keyboard */ export default class Keyboard extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + } + + /** + * Handler on Block for keyboard keys at keydown event + * + * @param {KeyboardEvent} event + */ + blockKeydownsListener(event) { + switch(event.keyCode) { + case _.keyCodes.BACKSPACE: + + _.log('Backspace key pressed'); + this.backspacePressed(event); + break; + + case _.keyCodes.ENTER: + + _.log('Enter key pressed'); + this.enterPressed(event); + break; + + case _.keyCodes.DOWN: + case _.keyCodes.RIGHT: + + _.log('Right/Down key pressed'); + this.arrowRightAndDownPressed(); + break; + + case _.keyCodes.UP: + case _.keyCodes.LEFT: + + _.log('Left/Up key pressed'); + this.arrowLeftAndUpPressed(); + break; + + default: + + break; + } + } + + /** + * Handle pressing enter key + * + * @param {KeyboardEvent} event + */ + enterPressed(event) { + let currentBlock = this.Editor.BlockManager.currentBlock, + toolsConfig = this.config.toolsConfig[currentBlock.name]; /** - * @constructor + * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. + * Uses for Tools like where line breaks should be handled by default behaviour. */ - constructor({config}) { - - super({config}); - + if (toolsConfig && toolsConfig.enableLineBreaks) { + return; } /** - * Handler on Block for keyboard keys at keydown event + * Allow to create linebreaks by Shift+Enter + */ + if (event.shiftKey) { + return; + } + + + /** + * Split the Current Block into two blocks + */ + this.Editor.BlockManager.split(); + event.preventDefault(); + } + + /** + * Handle backspace keypress on block + * @param {KeyboardEvent} event - keydown + */ + backspacePressed(event) { + const BM = this.Editor.BlockManager; + + let isFirstBlock = BM.currentBlockIndex === 0, + canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; + + if (!canMergeBlocks) { + return; + } + + // preventing browser default behaviour + event.preventDefault(); + + let targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), + blockToMerge = BM.currentBlock; + + /** + * Blocks that can be merged: + * 1) with the same Name + * 2) Tool has 'merge' method * - * @param {KeyboardEvent} event + * other case will handle as usual ARROW LEFT behaviour */ - blockKeydownsListener(event) { - - switch(event.keyCode) { - - case _.keyCodes.BACKSPACE: - - _.log('Backspace key pressed'); - this.backspacePressed(event); - break; - - case _.keyCodes.ENTER: - - _.log('Enter key pressed'); - this.enterPressed(event); - break; - - case _.keyCodes.DOWN: - case _.keyCodes.RIGHT: - - _.log('Right/Down key pressed'); - this.arrowRightAndDownPressed(); - break; - - case _.keyCodes.UP: - case _.keyCodes.LEFT: - - _.log('Left/Up key pressed'); - this.arrowLeftAndUpPressed(); - break; - - default: - - break; - - } - + if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { + BM.navigatePrevious(); } - /** - * Handle pressing enter key - * - * @param {KeyboardEvent} event - */ - enterPressed(event) { + let setCaretToTheEnd = !targetBlock.isEmpty ? true : false; - let currentBlock = this.Editor.BlockManager.currentBlock, - toolsConfig = this.config.toolsConfig[currentBlock.name]; + BM.mergeBlocks(targetBlock, blockToMerge) + .then( () => { + window.setTimeout( () => { + // set caret to the block without offset at the end + this.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd); + this.Editor.Toolbar.close(); + }, 10); + }); + } - /** - * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. - * Uses for Tools like where line breaks should be handled by default behaviour. - */ - if (toolsConfig && toolsConfig.enableLineBreaks) { - - return; - - } - - /** - * Allow to create linebreaks by Shift+Enter - */ - if (event.shiftKey) { - - return; - - } - - - /** - * Split the Current Block into two blocks - */ - this.Editor.BlockManager.split(); - event.preventDefault(); - - } - - /** - * Handle backspace keypress on block - * @param {KeyboardEvent} event - keydown - */ - backspacePressed(event) { - - const BM = this.Editor.BlockManager; - - let isFirstBlock = BM.currentBlockIndex === 0, - canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; - - if (!canMergeBlocks) { - - return; - - } - - // preventing browser default behaviour - event.preventDefault(); - - let targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), - blockToMerge = BM.currentBlock; - - /** - * Blocks that can be merged: - * 1) with the same Name - * 2) Tool has 'merge' method - * - * other case will handle as usual ARROW LEFT behaviour - */ - if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { - - BM.navigatePrevious(); - - } - - let setCaretToTheEnd = !targetBlock.isEmpty ? true : false; - - BM.mergeBlocks(targetBlock, blockToMerge) - .then( () => { - - window.setTimeout( () => { - - // set caret to the block without offset at the end - this.Editor.Caret.setToBlock(BM.currentBlock, 0, setCaretToTheEnd); - this.Editor.Toolbar.close(); - - }, 10); - - }); - - } - - /** - * Handle right and down keyboard keys - */ - arrowRightAndDownPressed() { - - this.Editor.BlockManager.navigateNext(); - - } - - /** - * Handle left and up keyboard keys - */ - arrowLeftAndUpPressed() { - - this.Editor.BlockManager.navigatePrevious(); - - } + /** + * Handle right and down keyboard keys + */ + arrowRightAndDownPressed() { + this.Editor.BlockManager.navigateNext(); + } + /** + * Handle left and up keyboard keys + */ + arrowLeftAndUpPressed() { + this.Editor.BlockManager.navigatePrevious(); + } } \ No newline at end of file diff --git a/src/components/modules/listeners.js b/src/components/modules/listeners.js index f646c2a6..d11f9f65 100644 --- a/src/components/modules/listeners.js +++ b/src/components/modules/listeners.js @@ -15,203 +15,164 @@ */ export default class Listeners extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + this.allListeners = []; + } - /** - * @constructor - * @param {EditorConfig} config - */ - constructor({config}) { + /** + * Assigns event listener on element + * + * @param {Element} element - DOM element that needs to be listened + * @param {String} eventType - event type + * @param {Function} handler - method that will be fired on event + * @param {Boolean} useCapture - use event bubbling + */ + on(element, eventType, handler, useCapture = false) { + let assignedEventData = { + element, + eventType, + handler, + useCapture + }; - super({config}); - this.allListeners = []; + let alreadyExist = this.findOne(element, eventType, handler); + if (alreadyExist) return; + + this.allListeners.push(assignedEventData); + element.addEventListener(eventType, handler, useCapture); + } + + /** + * Removes event listener from element + * + * @param {Element} element - DOM element that we removing listener + * @param {String} eventType - event type + * @param {Function} handler - remove handler, if element listens several handlers on the same event type + * @param {Boolean} useCapture - use event bubbling + */ + off(element, eventType, handler, useCapture = false) { + let existingListeners = this.findAll(element, eventType, handler); + + for (let i = 0; i < existingListeners.length; i++) { + let index = this.allListeners.indexOf(existingListeners[i]); + + if (index > 0) { + this.allListeners.splice(index, 1); + } } - /** - * Assigns event listener on element - * - * @param {Element} element - DOM element that needs to be listened - * @param {String} eventType - event type - * @param {Function} handler - method that will be fired on event - * @param {Boolean} useCapture - use event bubbling - */ - on(element, eventType, handler, useCapture = false) { + element.removeEventListener(eventType, handler, useCapture); + } - let assignedEventData = { - element, - eventType, - handler, - useCapture - }; + /** + * Search method: looks for listener by passed element + * @param {Element} element - searching element + * @returns {Array} listeners that found on element + */ + findByElement(element) { + let listenersOnElement = []; - let alreadyExist = this.findOne(element, eventType, handler); - - if (alreadyExist) return; - - this.allListeners.push(assignedEventData); - element.addEventListener(eventType, handler, useCapture); + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + if (listener.element === element) { + listenersOnElement.push(listener); + } } - /** - * Removes event listener from element - * - * @param {Element} element - DOM element that we removing listener - * @param {String} eventType - event type - * @param {Function} handler - remove handler, if element listens several handlers on the same event type - * @param {Boolean} useCapture - use event bubbling - */ - off(element, eventType, handler, useCapture = false) { + return listenersOnElement; + } - let existingListeners = this.findAll(element, eventType, handler); - - for (let i = 0; i < existingListeners.length; i++) { - - let index = this.allListeners.indexOf(existingListeners[i]); - - if (index > 0) { - - this.allListeners.splice(index, 1); - - } - - } - - element.removeEventListener(eventType, handler, useCapture); + /** + * Search method: looks for listener by passed event type + * @param {String} eventType + * @return {Array} listeners that found on element + */ + findByType(eventType) { + let listenersWithType = []; + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + if (listener.type === eventType) { + listenersWithType.push(listener); + } } - /** - * Search method: looks for listener by passed element - * @param {Element} element - searching element - * @returns {Array} listeners that found on element - */ - findByElement(element) { + return listenersWithType; + } - let listenersOnElement = []; + /** + * Search method: looks for listener by passed handler + * @param {Function} handler + * @return {Array} listeners that found on element + */ + findByHandler(handler) { + let listenersWithHandler = []; - for (let i = 0; i < this.allListeners.length; i++) { - - let listener = this.allListeners[i]; - - if (listener.element === element) { - - listenersOnElement.push(listener); - - } - - } - - return listenersOnElement; + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + if (listener.handler === handler) { + listenersWithHandler.push(listener); + } } - /** - * Search method: looks for listener by passed event type - * @param {String} eventType - * @return {Array} listeners that found on element - */ - findByType(eventType) { + return listenersWithHandler; + } - let listenersWithType = []; + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Element|null} + */ + findOne(element, eventType, handler) { + let foundListeners = this.findAll(element, eventType, handler); - for (let i = 0; i < this.allListeners.length; i++) { + return foundListeners.length > 0 ? foundListeners[0] : null; + } - let listener = this.allListeners[i]; + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Array} + */ + findAll(element, eventType, handler) { + let foundAllListeners, + foundByElements = [], + foundByEventType = [], + foundByHandler = []; - if (listener.type === eventType) { + if (element) + foundByElements = this.findByElement(element); - listenersWithType.push(listener); + if (eventType) + foundByEventType = this.findByType(eventType); - } + if (handler) + foundByHandler = this.findByHandler(handler); - } + foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler); - return listenersWithType; + return foundAllListeners; + } - } - - /** - * Search method: looks for listener by passed handler - * @param {Function} handler - * @return {Array} listeners that found on element - */ - findByHandler(handler) { - - let listenersWithHandler = []; - - for (let i = 0; i < this.allListeners.length; i++) { - - let listener = this.allListeners[i]; - - if (listener.handler === handler) { - - listenersWithHandler.push(listener); - - } - - } - - return listenersWithHandler; - - } - - /** - * @param {Element} element - * @param {String} eventType - * @param {Function} handler - * @return {Element|null} - */ - findOne(element, eventType, handler) { - - let foundListeners = this.findAll(element, eventType, handler); - - return foundListeners.length > 0 ? foundListeners[0] : null; - - } - - /** - * @param {Element} element - * @param {String} eventType - * @param {Function} handler - * @return {Array} - */ - findAll(element, eventType, handler) { - - let foundAllListeners, - foundByElements = [], - foundByEventType = [], - foundByHandler = []; - - if (element) - foundByElements = this.findByElement(element); - - if (eventType) - foundByEventType = this.findByType(eventType); - - if (handler) - foundByHandler = this.findByHandler(handler); - - foundAllListeners = foundByElements.concat(foundByEventType, foundByHandler); - - return foundAllListeners; - - } - - /** - * Removes all listeners - */ - removeAll() { - - this.allListeners.map( (current) => { - - current.element.removeEventListener(current.eventType, current.handler); - - }); - - this.allListeners = []; - - } + /** + * Removes all listeners + */ + removeAll() { + this.allListeners.map( (current) => { + current.element.removeEventListener(current.eventType, current.handler); + }); + this.allListeners = []; + } } \ No newline at end of file diff --git a/src/components/modules/renderer.js b/src/components/modules/renderer.js index d9d3acef..34991b3c 100644 --- a/src/components/modules/renderer.js +++ b/src/components/modules/renderer.js @@ -7,81 +7,71 @@ * @version 2.0.0 */ export default class Renderer extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + } - /** - * @constructor - * @param {EditorConfig} config - */ - constructor({config}) { + /** + * @typedef {Object} RendererItems + * @property {String} type - tool name + * @property {Object} data - tool data + */ - super({config}); + /** + * @example + * + * items: [ + * { + * type : 'paragraph', + * data : { + * text : 'Hello from Codex!' + * } + * }, + * { + * type : 'paragraph', + * data : { + * text : 'Leave feedback if you like it!' + * } + * }, + * ] + * + */ + /** + * Make plugin blocks from array of plugin`s data + * @param {RendererItems[]} items + */ + render(items) { + let chainData = []; + + for (let i = 0; i < items.length; i++) { + chainData.push({ + function: () => this.insertBlock(items[i]) + }); } - /** - * @typedef {Object} RendererItems - * @property {String} type - tool name - * @property {Object} data - tool data - */ + return _.sequence(chainData); + } - /** - * @example - * - * items: [ - * { - * type : 'paragraph', - * data : { - * text : 'Hello from Codex!' - * } - * }, - * { - * type : 'paragraph', - * data : { - * text : 'Leave feedback if you like it!' - * } - * }, - * ] - * - */ + /** + * Get plugin instance + * Add plugin instance to BlockManager + * Insert block to working zone + * + * @param {Object} item + * @returns {Promise.} + * @private + */ + insertBlock(item) { + let tool = item.type, + data = item.data; - /** - * Make plugin blocks from array of plugin`s data - * @param {RendererItems[]} items - */ - render(items) { - - let chainData = []; - - for (let i = 0; i < items.length; i++) { - - chainData.push({ - function: () => this.insertBlock(items[i]) - }); - - } - - return _.sequence(chainData); - - } - - /** - * Get plugin instance - * Add plugin instance to BlockManager - * Insert block to working zone - * - * @param {Object} item - * @returns {Promise.} - * @private - */ - insertBlock(item) { - - let tool = item.type, - data = item.data; - - this.Editor.BlockManager.insert(tool, data); - - return Promise.resolve(); - - } + this.Editor.BlockManager.insert(tool, data); + return Promise.resolve(); + } } \ No newline at end of file diff --git a/src/components/modules/sanitizer.js b/src/components/modules/sanitizer.js index b589f1ab..9bb7425e 100644 --- a/src/components/modules/sanitizer.js +++ b/src/components/modules/sanitizer.js @@ -33,112 +33,91 @@ * } */ export default class Sanitizer extends Module { + /** + * Initializes Sanitizer module + * Sets default configuration if custom not exists + * + * @property {SanitizerConfig} this.defaultConfig + * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library + * + * @param {SanitizerConfig} config + */ + constructor({config}) { + super({config}); - /** - * Initializes Sanitizer module - * Sets default configuration if custom not exists - * - * @property {SanitizerConfig} this.defaultConfig - * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library - * - * @param {SanitizerConfig} config - */ - constructor({config}) { + // default config + this.defaultConfig = null; + this._sanitizerInstance = null; - super({config}); + /** Custom configuration */ + this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; - // default config - this.defaultConfig = null; - this._sanitizerInstance = null; + /** HTML Janitor library */ + this.sanitizerInstance = require('html-janitor'); + } - /** Custom configuration */ - this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; - - /** HTML Janitor library */ - this.sanitizerInstance = require('html-janitor'); - - } - - /** - * If developer uses editor's API, then he can customize sanitize restrictions. - * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere - * At least, if there is no config overrides, that API uses Default configuration - * - * @uses https://www.npmjs.com/package/html-janitor - * - * @param {HTMLJanitor} library - sanitizer extension - */ - set sanitizerInstance(library) { - - this._sanitizerInstance = new library(this.defaultConfig); - - } - - /** - * Sets sanitizer configuration. Uses default config if user didn't pass the restriction - * @param {SanitizerConfig} config - */ - set sanitizerConfig(config) { - - if (_.isEmpty(config)) { - - this.defaultConfig = { - tags: { - p: {}, - a: { - href: true, - target: '_blank', - rel: 'nofollow' - } - } - }; - - } else { - - this.defaultConfig = config; + /** + * If developer uses editor's API, then he can customize sanitize restrictions. + * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere + * At least, if there is no config overrides, that API uses Default configuration + * + * @uses https://www.npmjs.com/package/html-janitor + * + * @param {HTMLJanitor} library - sanitizer extension + */ + set sanitizerInstance(library) { + this._sanitizerInstance = new library(this.defaultConfig); + } + /** + * Sets sanitizer configuration. Uses default config if user didn't pass the restriction + * @param {SanitizerConfig} config + */ + set sanitizerConfig(config) { + if (_.isEmpty(config)) { + this.defaultConfig = { + tags: { + p: {}, + a: { + href: true, + target: '_blank', + rel: 'nofollow' + } } - + }; + } else { + this.defaultConfig = config; } + } - /** - * Cleans string from unwanted tags - * @param {String} taintString - HTML string - * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty - * @return {String} clean HTML - */ - clean(taintString, customConfig = {}) { - - if (_.isEmpty(customConfig)) { - - return this._sanitizerInstance.clean(taintString); - - } else { - - return Sanitizer.clean(taintString, customConfig); - - } - - + /** + * Cleans string from unwanted tags + * @param {String} taintString - HTML string + * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty + * @return {String} clean HTML + */ + clean(taintString, customConfig = {}) { + if (_.isEmpty(customConfig)) { + return this._sanitizerInstance.clean(taintString); + } else { + return Sanitizer.clean(taintString, customConfig); } + } - /** - * Cleans string from unwanted tags - * @static - * - * Method allows to use default config - * - * @param {String} taintString - taint string - * @param {SanitizerConfig} customConfig - allowed tags - * - * @return {String} clean HTML - */ - static clean(taintString, customConfig) { - - let newInstance = Sanitizer(customConfig); - - return newInstance.clean(taintString); - - } + /** + * Cleans string from unwanted tags + * @static + * + * Method allows to use default config + * + * @param {String} taintString - taint string + * @param {SanitizerConfig} customConfig - allowed tags + * + * @return {String} clean HTML + */ + static clean(taintString, customConfig) { + let newInstance = Sanitizer(customConfig); + return newInstance.clean(taintString); + } } diff --git a/src/components/modules/saver.js b/src/components/modules/saver.js index aeff00c8..800a48a8 100644 --- a/src/components/modules/saver.js +++ b/src/components/modules/saver.js @@ -22,77 +22,63 @@ */ export default class Saver extends Module { + /** + * @constructor + * @param config + */ + constructor({config}) { + super({config}); - /** - * @constructor - * @param config - */ - constructor({config}) { + this.output = null; + this.blocksData = []; + } - super({config}); + /** + * Composes new chain of Promises to fire them alternatelly + * @return {SavedData} + */ + save() { + let blocks = this.Editor.BlockManager.blocks, + chainData = []; - this.output = null; - this.blocksData = []; + blocks.forEach((block) => { + chainData.push(block.data); + }); - } + return Promise.all(chainData) + .then((allExtractedData) => this.makeOutput(allExtractedData)) + .then((outputData) => { + return outputData; + }); + } - /** - * Composes new chain of Promises to fire them alternatelly - * @return {SavedData} - */ - save() { + /** + * Creates output object with saved data, time and version of editor + * @param {Object} allExtractedData + * @return {SavedData} + */ + makeOutput(allExtractedData) { + let items = [], + totalTime = 0; - let blocks = this.Editor.BlockManager.blocks, - chainData = []; + console.groupCollapsed('[CodexEditor saving]:'); - blocks.forEach((block) => { + allExtractedData.forEach((extraction) => { + /** Group process info */ + console.log(`«${extraction.tool}» saving info`, extraction); + totalTime += extraction.time; + items.push(extraction.data); + }); - chainData.push(block.data); - - }); - - return Promise.all(chainData) - .then((allExtractedData) => this.makeOutput(allExtractedData)) - .then((outputData) => { - - return outputData; - - }); - - } - - /** - * Creates output object with saved data, time and version of editor - * @param {Object} allExtractedData - * @return {SavedData} - */ - makeOutput(allExtractedData) { - - let items = [], - totalTime = 0; - - console.groupCollapsed('[CodexEditor saving]:'); - - allExtractedData.forEach((extraction, index) => { - - /** Group process info */ - console.log(`«${extraction.tool}» saving info`, extraction); - totalTime += extraction.time; - items.push(extraction.data); - - }); - - console.log('Total', totalTime); - console.groupEnd(); - - return { - time : +new Date(), - items : items, - version : VERSION, - }; - - } + console.log('Total', totalTime); + console.groupEnd(); + return { + time : +new Date(), + items : items, + version : VERSION, + }; + } } // module.exports = (function (saver) { diff --git a/src/components/modules/toolbar-blockSettings.js b/src/components/modules/toolbar-blockSettings.js index 01dd9c1b..b8ab88e3 100644 --- a/src/components/modules/toolbar-blockSettings.js +++ b/src/components/modules/toolbar-blockSettings.js @@ -10,132 +10,111 @@ * |________________________| */ export default class BlockSettings extends Module { + constructor({config}) { + super({config}); - constructor({config}) { + this.nodes = { + wrapper: null, + toolSettings: null, + defaultSettings: null, + buttonRemove: null + }; + } - super({config}); + /** + * Block Settings CSS + * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + */ + static get CSS() { + return { + // Settings Panel + wrapper: 'ce-settings', + wrapperOpened: 'ce-settings--opened', + toolSettings: 'ce-settings__plugin-zone', + defaultSettings: 'ce-settings__default-zone', - this.nodes = { - wrapper: null, - toolSettings: null, - defaultSettings: null, - buttonRemove: null - }; + button: 'ce-settings__button' + }; + } - } + /** + * Panel with block settings with 2 sections: + * - Tool's Settings + * - Default Settings [Move, Remove, etc] + * + * @return {Element} + */ + make() { + this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); + + this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); + this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); + + $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); /** - * Block Settings CSS - * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + * Add default settings that presents for all Blocks */ - static get CSS() { + this.addDefaultSettings(); + } - return { - // Settings Panel - wrapper: 'ce-settings', - wrapperOpened: 'ce-settings--opened', - toolSettings: 'ce-settings__plugin-zone', - defaultSettings: 'ce-settings__default-zone', + /** + * Add Tool's settings + */ + addToolSettings() { + console.log('Block Settings: add settings for ', + this.Editor.BlockManager.currentBlock + ); + } - button: 'ce-settings__button' - }; + /** + * Add default settings + */ + addDefaultSettings() { + /** + * Remove Block Button + * -------------------------------------------- + */ + this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, { + textContent: 'Remove Block' + }); - } + $.append(this.nodes.defaultSettings, this.nodes.buttonRemove); + + this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', (event) => this.removeBlockButtonClicked(event)); + } + + /** + * Clicks on the Remove Block Button + */ + removeBlockButtonClicked() { + console.log('❇️ Remove Block Button clicked'); + } + + /** + * Is Block Settings opened or not + * @returns {boolean} + */ + get opened() { + return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); + } + + /** + * Open Block Settings pane + */ + open() { + this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); /** - * Panel with block settings with 2 sections: - * - Tool's Settings - * - Default Settings [Move, Remove, etc] - * - * @return {Element} + * Fill Tool's settings */ - make() { - - this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); - - this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); - this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); - - $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); - - /** - * Add default settings that presents for all Blocks - */ - this.addDefaultSettings(); - - } - - /** - * Add Tool's settings - */ - addToolSettings() { - - console.log('Block Settings: add settings for ', - this.Editor.BlockManager.currentBlock - ); - - - } - - /** - * Add default settings - */ - addDefaultSettings() { - - /** - * Remove Block Button - * -------------------------------------------- - */ - this.nodes.buttonRemove = $.make('div', BlockSettings.CSS.button, { - textContent: 'Remove Block' - }); - - $.append(this.nodes.defaultSettings, this.nodes.buttonRemove); - - this.Editor.Listeners.on(this.nodes.buttonRemove, 'click', (event) => this.removeBlockButtonClicked(event)); - - } - - /** - * Clicks on the Remove Block Button - */ - removeBlockButtonClicked() { - - console.log('❇️ Remove Block Button clicked'); - - } - - /** - * Is Block Settings opened or not - * @returns {boolean} - */ - get opened() { - - return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); - - } - - /** - * Open Block Settings pane - */ - open() { - - this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); - - /** - * Fill Tool's settings - */ - this.addToolSettings(); - - } - - /** - * Close Block Settings pane - */ - close() { - - this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); - - } + this.addToolSettings(); + } + /** + * Close Block Settings pane + */ + close() { + this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); + } } diff --git a/src/components/modules/toolbar-inline.ts b/src/components/modules/toolbar-inline.ts new file mode 100644 index 00000000..c089a677 --- /dev/null +++ b/src/components/modules/toolbar-inline.ts @@ -0,0 +1,68 @@ +/** + * Inline toolbar with actions that modifies selected text fragment + * + * ________________________ + * | | + * | B i [link] [mark] | + * | _______________________| + */ +declare var Module: any; +declare var $: any; + +/** + * DOM Elements + */ +interface InlineToolbarNodes { + wrapper?: Element; // main wrapper +} + +/** + * CSS + */ +interface InlineToolbarCSS { + inlineToolbar: string; +} + +export default class InlineToolbar extends Module { + + /** + * Inline Toolbar elements + */ + private nodes: InlineToolbarNodes = { + wrapper: null, + }; + + /** + * CSS styles + */ + private CSS: InlineToolbarCSS = { + inlineToolbar: 'ce-inline-toolbar', + }; + + /** + * @constructor + */ + constructor({config}) { + + super({config}); + + } + + /** + * Making DOM + */ + public make() { + + this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar); + + /** + * Append Inline Toolbar to the Editor + */ + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + + } + + public move() { + // moving + } +} diff --git a/src/components/modules/toolbar-toolbox.js b/src/components/modules/toolbar-toolbox.js index e169c12f..1620c96f 100644 --- a/src/components/modules/toolbar-toolbox.js +++ b/src/components/modules/toolbar-toolbox.js @@ -9,215 +9,179 @@ * */ export default class Toolbox extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + + this.nodes = { + toolbox: null, + buttons: [] + }; /** - * @constructor + * Opening state + * @type {boolean} */ - constructor({config}) { + this.opened = false; + } - super({config}); + /** + * CSS styles + * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + */ + static get CSS() { + return { + toolbox: 'ce-toolbox', + toolboxButton: 'ce-toolbox__button', + toolboxOpened: 'ce-toolbox--opened', + }; + } - this.nodes = { - toolbox: null, - buttons: [] - }; + /** + * Makes the Toolbox + */ + make() { + this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); + $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); - /** - * Opening state - * @type {boolean} - */ - this.opened = false; + this.addTools(); + } + /** + * Iterates available tools and appends them to the Toolbox + */ + addTools() { + let tools = this.Editor.Tools.toolsAvailable; + + for (let toolName in tools) { + this.addTool(toolName, tools[toolName]); + } + } + + /** + * Append Tool to the Toolbox + * + * @param {string} toolName - tool name + * @param {Tool} tool - tool class + */ + addTool(toolName, tool) { + if (tool.displayInToolbox && !tool.iconClassName) { + _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); + return; } /** - * CSS styles - * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + * @todo Add checkup for the render method */ - static get CSS() { + // if (typeof tool.render !== 'function') { + // + // _.log('render method missed. Tool %o skipped', 'warn', tool); + // return; + // + // } - return { - toolbox: 'ce-toolbox', - toolboxButton: 'ce-toolbox__button', - toolboxOpened: 'ce-toolbox--opened', - }; + /** + * Skip tools that pass 'displayInToolbox=false' + */ + if (!tool.displayInToolbox) { + return; + } + let button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], { + title: toolName + }); + + /** + * Save tool's name in the button data-name + */ + button.dataset.name = toolName; + + $.append(this.nodes.toolbox, button); + + this.nodes.toolbox.appendChild(button); + this.nodes.buttons.push(button); + + /** + * @todo add event with module Listeners + */ + // this.Editor.Listeners.add(); + button.addEventListener('click', event => { + this.buttonClicked(event); + }, false); + } + + /** + * Toolbox button click listener + * 1) if block is empty -> replace + * 2) if block is not empty -> add new block below + * + * @param {MouseEvent} event + */ + buttonClicked(event) { + let toolButton = event.target, + toolName = toolButton.dataset.name, + tool = this.Editor.Tools.toolClasses[toolName]; + + /** + * @type {Block} + */ + let currentBlock = this.Editor.BlockManager.currentBlock; + + /** + * We do replace if: + * - block is empty + * - block is not irreplaceable + * @type {Array} + */ + if (!tool.irreplaceable && currentBlock.isEmpty) { + this.Editor.BlockManager.replace(toolName); + } else { + this.Editor.BlockManager.insert(toolName); } /** - * Makes the Toolbox + * @todo set caret to the new block */ - make() { - this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); - $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); + // window.setTimeout(function () { - this.addTools(); + /** Set caret to current block */ + // editor.caret.setToBlock(currentInputIndex); - } + // }, 10); /** - * Iterates available tools and appends them to the Toolbox + * Move toolbar when node is changed */ - addTools() { + this.Editor.Toolbar.move(); + } - let tools = this.Editor.Tools.toolsAvailable; + /** + * Open Toolbox with Tools + */ + open() { + this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); + this.opened = true; + } - for (let toolName in tools) { - - this.addTool(toolName, tools[toolName]); - - } + /** + * Close Toolbox + */ + close() { + this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); + this.opened = false; + } + /** + * Close Toolbox + */ + toggle() { + if (!this.opened) { + this.open(); + } else { + this.close(); } - - /** - * Append Tool to the Toolbox - * - * @param {string} toolName - tool name - * @param {Tool} tool - tool class - */ - addTool(toolName, tool) { - - if (tool.displayInToolbox && !tool.iconClassName) { - - _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); - return; - - } - - /** - * @todo Add checkup for the render method - */ - // if (typeof tool.render !== 'function') { - // - // _.log('render method missed. Tool %o skipped', 'warn', tool); - // return; - // - // } - - /** - * Skip tools that pass 'displayInToolbox=false' - */ - if (!tool.displayInToolbox) { - - return; - - } - - let button = $.make('li', [Toolbox.CSS.toolboxButton, tool.iconClassName], { - title: toolName - }); - - /** - * Save tool's name in the button data-name - */ - button.dataset.name = toolName; - - $.append(this.nodes.toolbox, button); - - this.nodes.toolbox.appendChild(button); - this.nodes.buttons.push(button); - - /** - * @todo add event with module Listeners - */ - // this.Editor.Listeners.add(); - button.addEventListener('click', event => { - - this.buttonClicked(event); - - }, false); - - } - - /** - * Toolbox button click listener - * 1) if block is empty -> replace - * 2) if block is not empty -> add new block below - * - * @param {MouseEvent} event - */ - buttonClicked(event) { - - let toolButton = event.target, - toolName = toolButton.dataset.name, - tool = this.Editor.Tools.toolClasses[toolName]; - - /** - * @type {Block} - */ - let currentBlock = this.Editor.BlockManager.currentBlock; - - /** - * We do replace if: - * - block is empty - * - block is not irreplaceable - * @type {Array} - */ - if (!tool.irreplaceable && currentBlock.isEmpty) { - - this.Editor.BlockManager.replace(toolName); - - } else { - - this.Editor.BlockManager.insert(toolName); - - } - - /** - * @todo set caret to the new block - */ - - // window.setTimeout(function () { - - /** Set caret to current block */ - // editor.caret.setToBlock(currentInputIndex); - - // }, 10); - - /** - * Move toolbar when node is changed - */ - this.Editor.Toolbar.move(); - - } - - /** - * Open Toolbox with Tools - */ - open() { - - this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); - this.opened = true; - - } - - /** - * Close Toolbox - */ - close() { - - this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); - this.opened = false; - - } - - /** - * Close Toolbox - */ - toggle() { - - if (!this.opened) { - - this.open(); - - } else { - - this.close(); - - } - - } - + } } \ No newline at end of file diff --git a/src/components/modules/toolbar.js b/src/components/modules/toolbar.js index b4167dac..d852bcd5 100644 --- a/src/components/modules/toolbar.js +++ b/src/components/modules/toolbar.js @@ -50,225 +50,193 @@ * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel */ export default class Toolbar extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + + this.nodes = { + wrapper : null, + content : null, + actions : null, + + // Content Zone + plusButton : null, + + // Actions Zone + blockActionsButtons: null, + settingsToggler : null, + }; + } + + /** + * CSS styles + * @return {Object} + * @constructor + */ + static get CSS() { + return { + toolbar: 'ce-toolbar', + content: 'ce-toolbar__content', + actions: 'ce-toolbar__actions', + + toolbarOpened: 'ce-toolbar--opened', + + // Content Zone + plusButton: 'ce-toolbar__plus', + plusButtonHidden: 'ce-toolbar__plus--hidden', + + // Actions Zone + blockActionsButtons: 'ce-toolbar__actions-buttons', + settingsToggler: 'ce-toolbar__settings-btn', + }; + } + + /** + * Makes toolbar + */ + make() { + this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar); /** - * @constructor + * Make Content Zone and Actions Zone */ - constructor({config}) { + ['content', 'actions'].forEach( el => { + this.nodes[el] = $.make('div', Toolbar.CSS[el]); + $.append(this.nodes.wrapper, this.nodes[el]); + }); - super({config}); - this.nodes = { - wrapper : null, - content : null, - actions : null, + /** + * Fill Content Zone: + * - Plus Button + * - Toolbox + */ + this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton); + $.append(this.nodes.content, this.nodes.plusButton); + this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false); - // Content Zone - plusButton : null, - // Actions Zone - blockActionsButtons: null, - settingsToggler : null, - }; + /** + * Make a Toolbox + */ + this.Editor.Toolbox.make(); + /** + * Fill Actions Zone: + * - Settings Toggler + * - Remove Block Button + * - Settings Panel + */ + this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons); + this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler); + + $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler); + $.append(this.nodes.actions, this.nodes.blockActionsButtons); + + /** + * Make and append Settings Panel + */ + this.Editor.BlockSettings.make(); + $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper); + + /** + * Append toolbar to the Editor + */ + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + + /** + * Bind events on the Toolbar elements + */ + this.bindEvents(); + } + + /** + * Move Toolbar to the Current Block + */ + move() { + /** Close Toolbox when we move toolbar */ + this.Editor.Toolbox.close(); + + let currentNode = this.Editor.BlockManager.currentNode; + + /** + * If no one Block selected as a Current + */ + if (!currentNode) { + return; } /** - * CSS styles - * @return {Object} - * @constructor + * @todo Compute dynamically on prepare + * @type {number} */ - static get CSS() { + const defaultToolbarHeight = 49; + const defaultOffset = 34; - return { - toolbar: 'ce-toolbar', - content: 'ce-toolbar__content', - actions: 'ce-toolbar__actions', + var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset; - toolbarOpened: 'ce-toolbar--opened', + this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`; - // Content Zone - plusButton: 'ce-toolbar__plus', - plusButtonHidden: 'ce-toolbar__plus--hidden', + /** Close trash actions */ + // editor.toolbar.settings.hideRemoveActions(); + } - // Actions Zone - blockActionsButtons: 'ce-toolbar__actions-buttons', - settingsToggler: 'ce-toolbar__settings-btn', - }; + /** + * Open Toolbar with Plus Button + */ + open() { + this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened); + } - } + /** + * Close the Toolbar + */ + close() { + this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened); + } + /** + * Plus Button public methods + * @return {{hide: function(): void, show: function(): void}} + */ + get plusButton() { + return { + hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden), + show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden) + }; + } + + /** + * Handler for Plus Button + * @param {MouseEvent} event + */ + plusButtonClicked() { + this.Editor.Toolbox.toggle(); + } + + /** + * Bind events on the Toolbar Elements: + * - Block Settings + */ + bindEvents() { /** - * Makes toolbar + * Settings toggler */ - make() { - - this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar); - - /** - * Make Content Zone and Actions Zone - */ - ['content', 'actions'].forEach( el => { - - this.nodes[el] = $.make('div', Toolbar.CSS[el]); - $.append(this.nodes.wrapper, this.nodes[el]); - - }); - - - /** - * Fill Content Zone: - * - Plus Button - * - Toolbox - */ - this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton); - $.append(this.nodes.content, this.nodes.plusButton); - this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false); - - - /** - * Make a Toolbox - */ - this.Editor.Toolbox.make(); - - /** - * Fill Actions Zone: - * - Settings Toggler - * - Remove Block Button - * - Settings Panel - */ - this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons); - this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler); - - $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler); - $.append(this.nodes.actions, this.nodes.blockActionsButtons); - - /** - * Make and append Settings Panel - */ - this.Editor.BlockSettings.make(); - $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper); - - /** - * Append toolbar to the Editor - */ - $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); - - /** - * Bind events on the Toolbar elements - */ - this.bindEvents(); + this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => { + this.settingsTogglerClicked(event); + }); + } + /** + * Clicks on the Block Settings toggler + */ + settingsTogglerClicked() { + if (this.Editor.BlockSettings.opened) { + this.Editor.BlockSettings.close(); + } else { + this.Editor.BlockSettings.open(); } - - /** - * Move Toolbar to the Current Block - */ - move() { - - /** Close Toolbox when we move toolbar */ - this.Editor.Toolbox.close(); - - let currentNode = this.Editor.BlockManager.currentNode; - - /** - * If no one Block selected as a Current - */ - if (!currentNode) { - - return; - - } - - /** - * @todo Compute dynamically on prepare - * @type {number} - */ - const defaultToolbarHeight = 49; - const defaultOffset = 34; - - var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset; - - this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`; - - /** Close trash actions */ - // editor.toolbar.settings.hideRemoveActions(); - - } - - /** - * Open Toolbar with Plus Button - */ - open() { - - this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened); - - } - - /** - * Close the Toolbar - */ - close() { - - this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened); - - } - - /** - * Plus Button public methods - * @return {{hide: function(): void, show: function(): void}} - */ - get plusButton() { - - return { - hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden), - show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden) - }; - - } - - /** - * Handler for Plus Button - * @param {MouseEvent} event - */ - plusButtonClicked() { - - this.Editor.Toolbox.toggle(); - - } - - /** - * Bind events on the Toolbar Elements: - * - Block Settings - */ - bindEvents() { - - /** - * Settings toggler - */ - this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => { - - this.settingsTogglerClicked(event); - - }); - - } - - /** - * Clicks on the Block Settings toggler - */ - settingsTogglerClicked() { - - if (this.Editor.BlockSettings.opened) { - - this.Editor.BlockSettings.close(); - - } else { - - this.Editor.BlockSettings.open(); - - } - - } - + } } \ No newline at end of file diff --git a/src/components/modules/tools.js b/src/components/modules/tools.js index 00cc738c..6aba767a 100644 --- a/src/components/modules/tools.js +++ b/src/components/modules/tools.js @@ -41,212 +41,172 @@ * @property {EditorConfig} config - Editor config */ export default class Tools extends Module { + /** + * Returns available Tools + * @return {Tool[]} + */ + get available() { + return this.toolsAvailable; + } + + /** + * Returns unavailable Tools + * @return {Tool[]} + */ + get unavailable() { + return this.toolsUnavailable; + } + + /** + * Static getter for default Tool config fields + * + * @usage Tools.defaultConfig.displayInToolbox + * @return {ToolConfig} + */ + static get defaultConfig() { + return { + iconClassName : '', + displayInToolbox : false, + enableLineBreaks : false, + irreplaceable : false + }; + } + + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); /** - * Returns available Tools - * @return {Tool[]} + * Map {name: Class, ...} where: + * name — block type name in JSON. Got from EditorConfig.tools keys + * @type {Object} */ - get available() { + this.toolClasses = {}; - return this.toolsAvailable; + /** + * Available tools list + * {name: Class, ...} + * @type {Object} + */ + this.toolsAvailable = {}; + /** + * Tools that rejected a prepare method + * {name: Class, ... } + * @type {Object} + */ + this.toolsUnavailable = {}; + } + + /** + * Creates instances via passed or default configuration + * @return {Promise} + */ + prepare() { + if (!this.config.hasOwnProperty('tools')) { + return Promise.reject("Can't start without tools"); + } + + for(let toolName in this.config.tools) { + this.toolClasses[toolName] = this.config.tools[toolName]; } /** - * Returns unavailable Tools - * @return {Tool[]} + * getting classes that has prepare method */ - get unavailable() { - - return this.toolsUnavailable; + let sequenceData = this.getListOfPrepareFunctions(); + /** + * if sequence data contains nothing then resolve current chain and run other module prepare + */ + if (sequenceData.length === 0) { + return Promise.resolve(); } /** - * Static getter for default Tool config fields - * - * @usage Tools.defaultConfig.displayInToolbox - * @return {ToolConfig} + * to see how it works {@link Util#sequence} */ - static get defaultConfig() { + return _.sequence(sequenceData, (data) => { + this.success(data); + }, (data) => { + this.fallback(data); + }); + } - return { - iconClassName : '', - displayInToolbox : false, - enableLineBreaks : false, - irreplaceable : false - }; + /** + * Binds prepare function of plugins with user or default config + * @return {Array} list of functions that needs to be fired sequentially + */ + getListOfPrepareFunctions() { + let toolPreparationList = []; - } - - /** - * @constructor - * - * @param {EditorConfig} config - */ - constructor({config}) { - - super({config}); - - /** - * Map {name: Class, ...} where: - * name — block type name in JSON. Got from EditorConfig.tools keys - * @type {Object} - */ - this.toolClasses = {}; - - /** - * Available tools list - * {name: Class, ...} - * @type {Object} - */ - this.toolsAvailable = {}; - - /** - * Tools that rejected a prepare method - * {name: Class, ... } - * @type {Object} - */ - this.toolsUnavailable = {}; - - } - - /** - * Creates instances via passed or default configuration - * @return {Promise} - */ - prepare() { - - if (!this.config.hasOwnProperty('tools')) { - - return Promise.reject("Can't start without tools"); - - } - - for(let toolName in this.config.tools) { - - this.toolClasses[toolName] = this.config.tools[toolName]; - - } - - /** - * getting classes that has prepare method - */ - let sequenceData = this.getListOfPrepareFunctions(); - - /** - * if sequence data contains nothing then resolve current chain and run other module prepare - */ - if (sequenceData.length === 0) { - - return Promise.resolve(); - - } - - /** - * to see how it works {@link Util#sequence} - */ - return _.sequence(sequenceData, (data) => { - - this.success(data); - - }, (data) => { - - this.fallback(data); + for(let toolName in this.toolClasses) { + let toolClass = this.toolClasses[toolName]; + if (typeof toolClass.prepare === 'function') { + toolPreparationList.push({ + function : toolClass.prepare, + data : { + toolName + } }); - + } else { + /** + * If Tool hasn't a prepare method, mark it as available + */ + this.toolsAvailable[toolName] = toolClass; + } } - /** - * Binds prepare function of plugins with user or default config - * @return {Array} list of functions that needs to be fired sequentially - */ - getListOfPrepareFunctions() { + return toolPreparationList; + } - let toolPreparationList = []; + /** + * @param {ChainData.data} data - append tool to available list + */ + success(data) { + this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; + } - for(let toolName in this.toolClasses) { + /** + * @param {ChainData.data} data - append tool to unavailable list + */ + fallback(data) { + this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; + } - let toolClass = this.toolClasses[toolName]; - - if (typeof toolClass.prepare === 'function') { - - toolPreparationList.push({ - function : toolClass.prepare, - data : { - toolName - } - }); - - } else { - - /** - * If Tool hasn't a prepare method, mark it as available - */ - this.toolsAvailable[toolName] = toolClass; - - } - - } - - return toolPreparationList; + /** + * Return tool`a instance + * + * @param {String} tool — tool name + * @param {Object} data — initial data + * + * @todo throw exceptions if tool doesnt exist + * + */ + construct(tool, data) { + let plugin = this.toolClasses[tool], + config = this.config.toolsConfig[tool]; + if (!config) { + config = this.defaultConfig; } - /** - * @param {ChainData.data} data - append tool to available list - */ - success(data) { + let instance = new plugin(data, config); - this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; - - } - - /** - * @param {ChainData.data} data - append tool to unavailable list - */ - fallback(data) { - - this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; - - } - - /** - * Return tool`a instance - * - * @param {String} tool — tool name - * @param {Object} data — initial data - * - * @todo throw exceptions if tool doesnt exist - * - */ - construct(tool, data) { - - let plugin = this.toolClasses[tool], - config = this.config.toolsConfig[tool]; - - if (!config) { - - config = this.defaultConfig; - - } - - let instance = new plugin(data, config); - - return instance; - - } - - /** - * Check if passed Tool is an instance of Initial Block Tool - * @param {Tool} tool - Tool to check - * @return {Boolean} - */ - isInitial(tool) { - - return tool instanceof this.available[this.config.initialBlock]; - - } + return instance; + } + /** + * Check if passed Tool is an instance of Initial Block Tool + * @param {Tool} tool - Tool to check + * @return {Boolean} + */ + isInitial(tool) { + return tool instanceof this.available[this.config.initialBlock]; + } } \ No newline at end of file diff --git a/src/components/modules/ui.js b/src/components/modules/ui.js index f80cf804..cf17d5c4 100644 --- a/src/components/modules/ui.js +++ b/src/components/modules/ui.js @@ -6,28 +6,28 @@ // let className = { /** - * @const {string} BLOCK_CLASSNAME - redactor blocks name - */ + * @const {string} BLOCK_CLASSNAME - redactor blocks name + */ // BLOCK_CLASSNAME : 'ce-block', /** - * @const {String} wrapper for plugins content - */ + * @const {String} wrapper for plugins content + */ // BLOCK_CONTENT : 'ce-block__content', /** - * @const {String} BLOCK_STRETCHED - makes block stretched - */ + * @const {String} BLOCK_STRETCHED - makes block stretched + */ // BLOCK_STRETCHED : 'ce-block--stretched', /** - * @const {String} BLOCK_HIGHLIGHTED - adds background - */ + * @const {String} BLOCK_HIGHLIGHTED - adds background + */ // BLOCK_HIGHLIGHTED : 'ce-block--focused', /** - * @const {String} - for all default settings - */ + * @const {String} - for all default settings + */ // SETTINGS_ITEM : 'ce-settings__item' // }; @@ -52,305 +52,279 @@ * @property {Element} nodes.redactor - */ export default class UI extends Module { + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); - /** - * @constructor - * - * @param {EditorConfig} config - */ - constructor({config}) { + this.nodes = { + holder: null, + wrapper: null, + redactor: null + }; + } - super({config}); + /** + * Making main interface + */ + prepare() { + return this.make() + /** + * Make toolbar + */ + .then(() => this.Editor.Toolbar.make()) + /** + * Make the Inline toolbar + */ + .then(() => this.Editor.InlineToolbar.make()) + /** + * Load and append CSS + */ + .then(() => this.loadStyles()) + /** + * Bind events for the UI elements + */ + .then(() => this.bindEvents()) - this.nodes = { - holder: null, - wrapper: null, - redactor: null - }; + /** Make container for inline toolbar */ + // .then(makeInlineToolbar_) - } + /** Add inline toolbar tools */ + // .then(addInlineToolbarTools_) - /** - * Making main interface - */ - prepare() { + /** Draw wrapper for notifications */ + // .then(makeNotificationHolder_) - // this.Editor.Toolbar.make(); + /** Add eventlisteners to redactor elements */ + // .then(bindEvents_) - return this.make() - /** - * Make toolbar - */ - .then(() => this.Editor.Toolbar.make()) - /** - * Load and append CSS - */ - .then(() => this.loadStyles()) - /** - * Bind events for the UI elements - */ - .then(() => this.bindEvents()) + .catch(e => { + console.error(e); - /** Make container for inline toolbar */ - // .then(makeInlineToolbar_) + // editor.core.log("Can't draw editor interface"); + }); + } - /** Add inline toolbar tools */ - // .then(addInlineToolbarTools_) - - /** Draw wrapper for notifications */ - // .then(makeNotificationHolder_) - - /** Add eventlisteners to redactor elements */ - // .then(bindEvents_) - - .catch(e => { - - console.error(e); - - // editor.core.log("Can't draw editor interface"); - - }); - - } - - /** + /** * CodeX Editor UI CSS class names * @return {{editorWrapper: string, editorZone: string, block: string}} */ - get CSS() { + get CSS() { + return { + editorWrapper : 'codex-editor', + editorZone : 'codex-editor__redactor', + }; + } - return { - editorWrapper : 'codex-editor', - editorZone : 'codex-editor__redactor', - }; - - } - - /** + /** * Makes CodeX Editor interface * @return {Promise} */ - make() { + make() { + return new Promise( (resolve, reject) => { + /** + * Element where we need to append CodeX Editor + * @type {Element} + */ + this.nodes.holder = document.getElementById(this.config.holderId); - return new Promise( (resolve, reject) => { + if (!this.nodes.holder) { + reject(Error("Holder wasn't found by ID: #" + this.config.holderId)); + return; + } - /** - * Element where we need to append CodeX Editor - * @type {Element} - */ - this.nodes.holder = document.getElementById(this.config.holderId); + /** + * Create and save main UI elements + */ + this.nodes.wrapper = $.make('div', this.CSS.editorWrapper); + this.nodes.redactor = $.make('div', this.CSS.editorZone); - if (!this.nodes.holder) { + this.nodes.wrapper.appendChild(this.nodes.redactor); + this.nodes.holder.appendChild(this.nodes.wrapper); - reject(Error("Holder wasn't found by ID: #" + this.config.holderId)); - return; + resolve(); + }); + } - } - - /** - * Create and save main UI elements - */ - this.nodes.wrapper = $.make('div', this.CSS.editorWrapper); - this.nodes.redactor = $.make('div', this.CSS.editorZone); - - this.nodes.wrapper.appendChild(this.nodes.redactor); - this.nodes.holder.appendChild(this.nodes.wrapper); - - resolve(); - - }); - - } + /** + * Appends CSS + */ + loadStyles() { + /** + * Load CSS + */ + let styles = require('../../styles/main.css'); /** - * Appends CSS + * Make tag */ - loadStyles() { - - /** - * Load CSS - */ - let styles = require('../../styles/main.css'); - - /** - * Make tag - */ - let tag = $.make('style', null, { - textContent: styles.toString() - }); - - /** - * Append styles - */ - $.append(document.head, tag); - - } + let tag = $.make('style', null, { + textContent: styles.toString() + }); /** - * Bind events on the CodeX Editor interface + * Append styles */ - bindEvents() { + $.append(document.head, tag); + } - /** - * @todo bind events with the Listeners module - */ - this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false ); + /** + * Bind events on the CodeX Editor interface + */ + bindEvents() { + /** + * @todo bind events with the Listeners module + */ + this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false ); + } - } + /** + * All clicks on the redactor zone + * + * @param {MouseEvent} event + * + * @description + * 1. Save clicked Block as a current {@link BlockManager#currentNode} + * it uses for the following: + * - add CSS modifier for the selected Block + * - on Enter press, we make a new Block under that + * + * 2. Move and show the Toolbar + * + * 3. Set a Caret + * + * 4. By clicks on the Editor's bottom zone: + * - if last Block is empty, set a Caret to this + * - otherwise, add a new empty Block and set a Caret to that + * + * 5. Hide the Inline Toolbar + * + * @see selectClickedBlock + * + */ + redactorClicked(event) { + let clickedNode = event.target; /** - * All clicks on the redactor zone - * - * @param {MouseEvent} event - * - * @description - * 1. Save clicked Block as a current {@link BlockManager#currentNode} - * it uses for the following: - * - add CSS modifier for the selected Block - * - on Enter press, we make a new Block under that - * - * 2. Move and show the Toolbar - * - * 3. Set a Caret - * - * 4. By clicks on the Editor's bottom zone: - * - if last Block is empty, set a Caret to this - * - otherwise, add a new empty Block and set a Caret to that - * - * 5. Hide the Inline Toolbar - * - * @see selectClickedBlock - * + * Select clicked Block as Current */ - redactorClicked(event) { - - let clickedNode = event.target; - - /** - * Select clicked Block as Current - */ - try { - - this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode); - - } catch (e) { - - /** - * If clicked outside first-level Blocks, set Caret to the last empty Block - */ - this.Editor.Caret.setToTheLastBlock(); - - } + try { + this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode); + } catch (e) { + /** + * If clicked outside first-level Blocks, set Caret to the last empty Block + */ + this.Editor.Caret.setToTheLastBlock(); + } - /** - * @todo hide the Inline Toolbar - */ - // var selectedText = editor.toolbar.inline.getSelectionText(), - // firstLevelBlock; + /** + * @todo hide the Inline Toolbar + */ + // var selectedText = editor.toolbar.inline.getSelectionText(), + // firstLevelBlock; - /** If selection range took off, then we hide inline toolbar */ - // if (selectedText.length === 0) { + /** If selection range took off, then we hide inline toolbar */ + // if (selectedText.length === 0) { - // editor.toolbar.inline.close(); + // editor.toolbar.inline.close(); - // } + // } - /** + /** * /** Update current input index in memory when caret focused into existed input */ - // if (event.target.contentEditable == 'true') { - // - // editor.caret.saveCurrentInputIndex(); - // - // } + // if (event.target.contentEditable == 'true') { + // + // editor.caret.saveCurrentInputIndex(); + // + // } - // if (editor.content.currentNode === null) { - // - // /** - // * If inputs in redactor does not exits, then we put input index 0 not -1 - // */ - // var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0; - // - // /** If we have any inputs */ - // if (editor.state.inputs.length) { - // - // /** getting firstlevel parent of input */ - // firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]); - // - // } - // - // /** If input is empty, then we set caret to the last input */ - // if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) { - // - // editor.caret.setToBlock(indexOfLastInput); - // - // } else { - // - // /** Create new input when caret clicked in redactors area */ - // var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; - // - // editor.content.insertBlock({ - // type : NEW_BLOCK_TYPE, - // block : editor.tools[NEW_BLOCK_TYPE].render() - // }); - // - // /** If there is no inputs except inserted */ - // if (editor.state.inputs.length === 1) { - // - // editor.caret.setToBlock(indexOfLastInput); - // - // } else { - // - // /** Set caret to this appended input */ - // editor.caret.setToNextBlock(indexOfLastInput); - // - // } - // - // } - // - // } else { - // - // /** Close all panels */ - // editor.toolbar.settings.close(); - // editor.toolbar.toolbox.close(); - // - // } - // - /** - * Move toolbar and open - */ - this.Editor.Toolbar.move(); - this.Editor.Toolbar.open(); - // - // var inputIsEmpty = !editor.content.currentNode.textContent.trim(), - // currentNodeType = editor.content.currentNode.dataset.tool, - // isInitialType = currentNodeType == editor.settings.initialBlockPlugin; - // - // + // if (editor.content.currentNode === null) { + // + // /** + // * If inputs in redactor does not exits, then we put input index 0 not -1 + // */ + // var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0; + // + // /** If we have any inputs */ + // if (editor.state.inputs.length) { + // + // /** getting firstlevel parent of input */ + // firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]); + // + // } + // + // /** If input is empty, then we set caret to the last input */ + // if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) { + // + // editor.caret.setToBlock(indexOfLastInput); + // + // } else { + // + // /** Create new input when caret clicked in redactors area */ + // var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + // + // editor.content.insertBlock({ + // type : NEW_BLOCK_TYPE, + // block : editor.tools[NEW_BLOCK_TYPE].render() + // }); + // + // /** If there is no inputs except inserted */ + // if (editor.state.inputs.length === 1) { + // + // editor.caret.setToBlock(indexOfLastInput); + // + // } else { + // + // /** Set caret to this appended input */ + // editor.caret.setToNextBlock(indexOfLastInput); + // + // } + // + // } + // + // } else { + // + // /** Close all panels */ + // editor.toolbar.settings.close(); + // editor.toolbar.toolbox.close(); + // + // } + // + /** + * Move toolbar and open + */ + this.Editor.Toolbar.move(); + this.Editor.Toolbar.open(); + // + // var inputIsEmpty = !editor.content.currentNode.textContent.trim(), + // currentNodeType = editor.content.currentNode.dataset.tool, + // isInitialType = currentNodeType == editor.settings.initialBlockPlugin; + // + // - /** - * Hide the Plus Button - * */ - this.Editor.Toolbar.plusButton.hide(); + /** + * Hide the Plus Button + * */ + this.Editor.Toolbar.plusButton.hide(); - /** - * Show the Plus Button if: - * - Block is an initial-block (Text) - * - Block is empty - */ - let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool), - isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty; - - if (isInitialBlock && isEmptyBlock) { - - this.Editor.Toolbar.plusButton.show(); - - } + /** + * Show the Plus Button if: + * - Block is an initial-block (Text) + * - Block is empty + */ + let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool), + isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty; + if (isInitialBlock && isEmptyBlock) { + this.Editor.Toolbar.plusButton.show(); } - + } } // /** diff --git a/src/components/polyfills.js b/src/components/polyfills.js index 185d0899..2f317fe4 100644 --- a/src/components/polyfills.js +++ b/src/components/polyfills.js @@ -4,21 +4,17 @@ * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest */ if (!Element.prototype.matches) - Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; if (!Element.prototype.closest) - Element.prototype.closest = function (s) { + Element.prototype.closest = function (s) { + var el = this; - var el = this; - - if (!document.documentElement.contains(el)) return null; - do { - - if (el.matches(s)) return el; - el = el.parentElement || el.parentNode; - - } while (el !== null); - return null; - - }; + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null); + return null; + }; diff --git a/src/components/selection.js b/src/components/selection.js index 67b3b42d..6e799483 100644 --- a/src/components/selection.js +++ b/src/components/selection.js @@ -2,64 +2,52 @@ * Working with selection */ export default class Selection { + /** + * @constructor + */ + constructor() { + this.instance = null; + this.selection = null; + } - /** - * @constructor - */ - constructor() { + /** + * Returns window Selection + * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} + * @return {Selection} + */ + static get() { + return window.getSelection(); + } - this.instance = null; - this.selection = null; + /** + * Returns selected anchor + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} + * @return {Node|null} + */ + static getAnchorNode() { + let selection = window.getSelection(); - } + return selection ? selection.anchorNode : null; + } - /** - * Returns window Selection - * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} - * @return {Selection} - */ - static get() { + /** + * Returns selection offset according to the anchor node + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} + * @return {Number|null} + */ + static getAnchorOffset() { + let selection = window.getSelection(); - return window.getSelection(); + return selection ? selection.anchorOffset : null; + } - } - - /** - * Returns selected anchor - * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} - * @return {Node|null} - */ - static getAnchorNode() { - - let selection = window.getSelection(); - - return selection ? selection.anchorNode : null; - - } - - /** - * Returns selection offset according to the anchor node - * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} - * @return {Number|null} - */ - static getAnchorOffset() { - - let selection = window.getSelection(); - - return selection ? selection.anchorOffset : null; - - } - - /** - * Is current selection range collapsed - * @return {boolean|null} - */ - static get isCollapsed() { - - let selection = window.getSelection(); - - return selection ? selection.isCollapsed : null; - - } + /** + * Is current selection range collapsed + * @return {boolean|null} + */ + static get isCollapsed() { + let selection = window.getSelection(); + return selection ? selection.isCollapsed : null; + } } \ No newline at end of file diff --git a/src/components/utils.js b/src/components/utils.js index 3f22348d..b9f0e6fc 100644 --- a/src/components/utils.js +++ b/src/components/utils.js @@ -2,214 +2,170 @@ * Codex Editor Util */ export default class Util { + /** + * Custom logger + * + * @param {string} msg - message + * @param {string} type - logging type 'log'|'warn'|'error'|'info' + * @param {*} args - argument to log with a message + */ + static log(msg, type, args) { + type = type || 'log'; - /** - * Custom logger - * - * @param {string} msg - message - * @param {string} type - logging type 'log'|'warn'|'error'|'info' - * @param {*} args - argument to log with a message - */ - static log(msg, type, args) { + if (!args) { + args = msg || 'undefined'; + msg = '[codex-editor]: %o'; + } else { + msg = '[codex-editor]: ' + msg; + } - type = type || 'log'; + try{ + if ( 'console' in window && window.console[ type ] ) { + if ( args ) window.console[ type ]( msg, args ); + else window.console[ type ]( msg ); + } + } catch(e) { + // do nothing + } + } - if (!args) { + /** + * Returns basic keycodes as constants + * @return {{}} + */ + static get keyCodes() { + return { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + DOWN: 40, + RIGHT: 39, + DELETE: 46, + META: 91 + }; + } - args = msg || 'undefined'; - msg = '[codex-editor]: %o'; - - } else { - - msg = '[codex-editor]: ' + msg; - - } - - try{ - - if ( 'console' in window && window.console[ type ] ) { - - if ( args ) window.console[ type ]( msg, args ); - else window.console[ type ]( msg ); + /** + * @typedef {Object} ChainData + * @property {Object} data - data that will be passed to the success or fallback + * @property {Function} function - function's that must be called asynchronically + */ + /** + * Fires a promise sequence asyncronically + * + * @param {Object[]} chains - list or ChainData's + * @param {Function} success - success callback + * @param {Function} fallback - callback that fires in case of errors + * + * @return {Promise} + */ + static sequence(chains, success = () => {}, fallback = () => {}) { + return new Promise(function (resolve) { + /** + * pluck each element from queue + * First, send resolved Promise as previous value + * Each plugins "prepare" method returns a Promise, that's why + * reduce current element will not be able to continue while can't get + * a resolved Promise + */ + chains.reduce(function (previousValue, currentValue, iteration) { + return previousValue + .then(() => waitNextBlock(currentValue, success, fallback)) + .then(() => { + // finished + if (iteration === chains.length - 1) { + resolve(); } - - } catch(e) { - // do nothing - } - - } + }); + }, Promise.resolve()); + }); /** - * Returns basic keycodes as constants - * @return {{}} - */ - static get keyCodes() { - - return { - BACKSPACE: 8, - TAB: 9, - ENTER: 13, - SHIFT: 16, - CTRL: 17, - ALT: 18, - ESC: 27, - SPACE: 32, - LEFT: 37, - UP: 38, - DOWN: 40, - RIGHT: 39, - DELETE: 46, - META: 91 - }; - - } - - /** - * @typedef {Object} ChainData - * @property {Object} data - data that will be passed to the success or fallback - * @property {Function} function - function's that must be called asynchronically - */ - - /** - * Fires a promise sequence asyncronically + * Decorator * - * @param {Object[]} chains - list or ChainData's - * @param {Function} success - success callback - * @param {Function} fallback - callback that fires in case of errors + * @param {ChainData} chainData + * + * @param {Function} successCallback + * @param {Function} fallbackCallback * * @return {Promise} */ - static sequence(chains, success = () => {}, fallback = () => {}) { - - return new Promise(function (resolve) { - - /** - * pluck each element from queue - * First, send resolved Promise as previous value - * Each plugins "prepare" method returns a Promise, that's why - * reduce current element will not be able to continue while can't get - * a resolved Promise - */ - chains.reduce(function (previousValue, currentValue, iteration) { - - return previousValue - .then(() => waitNextBlock(currentValue, success, fallback)) - .then(() => { - - // finished - if (iteration === chains.length - 1) { - - resolve(); - - } - - }); - - }, Promise.resolve()); - - }); - - /** - * Decorator - * - * @param {ChainData} chainData - * - * @param {Function} successCallback - * @param {Function} fallbackCallback - * - * @return {Promise} - */ - function waitNextBlock(chainData, successCallback, fallbackCallback) { - - return new Promise(function (resolve) { - - chainData.function() - .then(() => { - - successCallback(chainData.data || {}); - - }) - .then(resolve) - .catch(function () { - - fallbackCallback(chainData.data || {}); - - // anyway, go ahead even it falls - resolve(); - - }); - - }); - - } + function waitNextBlock(chainData, successCallback, fallbackCallback) { + return new Promise(function (resolve) { + chainData.function() + .then(() => { + successCallback(chainData.data || {}); + }) + .then(resolve) + .catch(function () { + fallbackCallback(chainData.data || {}); + // anyway, go ahead even it falls + resolve(); + }); + }); } + } - /** - * Make array from array-like collection - * - * @param {*} collection - * - * @return {Array} - */ - static array(collection) { + /** + * Make array from array-like collection + * + * @param {*} collection + * + * @return {Array} + */ + static array(collection) { + return Array.prototype.slice.call(collection); + } - return Array.prototype.slice.call(collection); + /** + * Checks if object is empty + * + * @param {Object} object + * @return {boolean} + */ + static isEmpty(object) { + return Object.keys(object).length === 0 && object.constructor === Object; + } - } + /** + * Check if passed object is a Promise + * @param {*} object - object to check + * @return {Boolean} + */ + static isPromise(object) { + return Promise.resolve(object) === object; + } - /** - * Checks if object is empty - * - * @param {Object} object - * @return {boolean} - */ - static isEmpty(object) { + /** + * Check if passed element is contenteditable + * @param element + * @return {boolean} + */ + static isContentEditable(element) { + return element.contentEditable === 'true'; + } - return Object.keys(object).length === 0 && object.constructor === Object; - - } - - /** - * Check if passed object is a Promise - * @param {*} object - object to check - * @return {Boolean} - */ - static isPromise(object) { - - return Promise.resolve(object) === object; - - } - - /** - * Check if passed element is contenteditable - * @param element - * @return {boolean} - */ - static isContentEditable(element) { - - return element.contentEditable === 'true'; - - } - - /** - * Delays method execution - * - * @param method - * @param timeout - */ - static delay(method, timeout) { - - return function () { - - let context = this, - args = arguments; - - window.setTimeout(() => method.apply(context, args), timeout); - - }; - - } + /** + * Delays method execution + * + * @param method + * @param timeout + */ + static delay(method, timeout) { + return function () { + let context = this, + args = arguments; + window.setTimeout(() => method.apply(context, args), timeout); + }; + } }; \ No newline at end of file diff --git a/src/styles/inline-toolbar.css b/src/styles/inline-toolbar.css new file mode 100644 index 00000000..467bcade --- /dev/null +++ b/src/styles/inline-toolbar.css @@ -0,0 +1,8 @@ +.ce-inline-toolbar { + position: absolute; + z-index: 2; + @apply --overlay-pane; + + width: 100px; + height: 40px; +} \ No newline at end of file diff --git a/src/styles/main.css b/src/styles/main.css index 80e8ae98..2cbe528f 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -2,5 +2,6 @@ @import url('ui.css'); @import url('toolbar.css'); @import url('toolbox.css'); +@import url('inline-toolbar.css'); @import url('settings.css'); @import url('block.css'); diff --git a/src/styles/toolbox.css b/src/styles/toolbox.css index 47162e06..e0df6015 100644 --- a/src/styles/toolbox.css +++ b/src/styles/toolbox.css @@ -1,4 +1,5 @@ .ce-toolbox { + position: absolute; visibility: hidden; transition: opacity 100ms ease; will-change: opacity; diff --git a/src/styles/variables.css b/src/styles/variables.css index 09362a9d..0fac9f69 100644 --- a/src/styles/variables.css +++ b/src/styles/variables.css @@ -20,4 +20,23 @@ */ --toolbar-buttons-size: 34px; + --overlay-pane: { + background: #FFFFFF; + box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26); + border-radius: 4px; + position: relative; + + &::before { + content: ''; + width: 15px; + height: 15px; + position: absolute; + top: -7px; + left: 50%; + margin-left: -7px; + transform: rotate(-45deg); + background: #fff; + } + } + } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..eb2a6754 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions" : { + "target": "es6", + "declaration": false, + } +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000..cbab9661 --- /dev/null +++ b/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "tslint:recommended", + "rules": { + "quotemark": [true, "single"] + } +} diff --git a/webpack.config.js b/webpack.config.js index 0ff3c15b..c44c843b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,7 +20,7 @@ const VERSION = process.env.VERSION || pkg.version; * Plugins for bundle * @type {webpack} */ -var webpack = require('webpack'); +var webpack = require('webpack'); /** * File system @@ -33,147 +33,170 @@ var fs = require('fs'); * Folders and files starting with '_' will be skipped * @type {Array} */ -var editorModules = fs.readdirSync('./src/components/modules').filter( name => /.js$/.test(name) && name.substring(0,1) !== '_' ); +var editorModules = fs.readdirSync('./src/components/modules').filter( name => /.(j|t)s$/.test(name) && name.substring(0,1) !== '_' ); editorModules.forEach( name => { - console.log('Require modules/' + name); + console.log('Require modules/' + name); }); +/** + * Options for the Babel + */ +var babelLoader = { + loader: 'babel-loader', + options: { + cacheDirectory: true, + presets: [ + "env" + ], + plugins: [ + /** + * Dont need to use «.default» after «export default Class Ui {}» + * @see {@link https://github.com/59naga/babel-plugin-add-module-exports} + */ + 'add-module-exports', + /** + * Babel transforms some awesome ES6 features to ES5 with extra code, such as Class, JSX. + * This plugin makes all generated extra codes to one module which significantly reduces the bundle code size. + * + * {@link https://github.com/brianZeng/babel-plugin-transform-helper} + * @since 11 dec 2017 - removed due to plugin does not supports class inheritance + */ + // ['babel-plugin-transform-helper', { + // helperFilename:'build/__tmp_babel_helpers.js' + // }], + 'class-display-name', + ] + } +}; + + module.exports = { - entry: { - 'codex-editor': './src/codex' - }, - output: { - path: path.resolve(__dirname, 'build'), - filename: '[name].js', - library: [ 'CodexEditor' ] - }, + entry: { + 'codex-editor': './src/codex' + }, + output: { + path: path.resolve(__dirname, 'build'), + filename: '[name].js', + library: [ 'CodexEditor' ] + }, - watch: true, + watch: true, + watchOptions: { + aggregateTimeout: 50 + }, - watchOptions: { - aggregateTimeout: 50 - }, + devtool: NODE_ENV == 'development' ? 'source-map' : null, - devtool: NODE_ENV == 'development' ? 'source-map' : null, + /** + * Tell webpack what directories should be searched when resolving modules. + */ + resolve : { + // fallback: path.join(__dirname, 'node_modules'), + modules : [ path.join(__dirname, "src"), "node_modules"], + alias: { + 'utils': path.resolve(__dirname + '/src/components/', './utils'), + 'dom': path.resolve(__dirname + '/src/components/', './dom'), + } + }, + // + + // resolveLoader : { + // modules: [ path.resolve(__dirname, "src"), "node_modules" ], + // moduleTemplates: ['*-webpack-loader', '*-web-loader', '*-loader', '*'], + // extensions: ['.js'] + // }, + + plugins: [ + + /** Pass variables into modules */ + new webpack.DefinePlugin({ + NODE_ENV: JSON.stringify(NODE_ENV), + VERSION: JSON.stringify(VERSION), + editorModules: JSON.stringify(editorModules) + }), /** - * Tell webpack what directories should be searched when resolving modules. + * Setting up a dynamic requires that we use to autoload Editor Modules from 'components/modules' dir + * {@link https://webpack.js.org/plugins/context-replacement-plugin/} */ - resolve : { - // fallback: path.join(__dirname, 'node_modules'), - modules : [ path.join(__dirname, "src"), "node_modules"], - alias: { - 'utils': path.resolve(__dirname + '/src/components/', './utils'), - 'dom': path.resolve(__dirname + '/src/components/', './dom'), - } - }, - // + new webpack.ContextReplacementPlugin( + /src\/components\/modules/, + false, // newContentRecursive=false because we dont need to include folders + new RegExp( + '[^_]' + // dont match names started with '_' + `(${editorModules.join('|')})` + // module names pattern: (events.js|ui.js|...) + '$' // at the end of path + ) + ), - // resolveLoader : { - // modules: [ path.resolve(__dirname, "src"), "node_modules" ], - // moduleTemplates: ['*-webpack-loader', '*-web-loader', '*-loader', '*'], - // extensions: ['.js'] - // }, - - plugins: [ - - /** Pass variables into modules */ - new webpack.DefinePlugin({ - NODE_ENV: JSON.stringify(NODE_ENV), - VERSION: JSON.stringify(VERSION), - editorModules: JSON.stringify(editorModules) - }), - - /** - * Setting up a dynamic requires that we use to autoload Editor Modules from 'components/modules' dir - * {@link https://webpack.js.org/plugins/context-replacement-plugin/} - */ - new webpack.ContextReplacementPlugin( - /src\/components\/modules/, - false, // newContentRecursive=false because we dont need to include folders - new RegExp( - '[^_]' + // dont match names started with '_' - `(${editorModules.join('|')})` + // module names pattern: (events.js|ui.js|...) - '$' // at the end of path - ) - ), - - /** - * Automatically load global visible modules - * instead of having to import/require them everywhere. - */ - new webpack.ProvidePlugin({ - '_': 'utils', - '$': 'dom', - 'Module': './../__module', - }), + /** + * Automatically load global visible modules + * instead of having to import/require them everywhere. + */ + new webpack.ProvidePlugin({ + '_': 'utils', + '$': 'dom', + 'Module': './../__module.ts', + }), - /** Минифицируем CSS и JS */ - // new webpack.optimize.UglifyJsPlugin({ - /** Disable warning messages. Cant disable uglify for 3rd party libs such as html-janitor */ - // compress: { - // warnings: false - // } - // }), + /** Минифицируем CSS и JS */ + // new webpack.optimize.UglifyJsPlugin({ + /** Disable warning messages. Cant disable uglify for 3rd party libs such as html-janitor */ + // compress: { + // warnings: false + // } + // }), - /** Block biuld if errors found */ - // new webpack.NoErrorsPlugin(), + /** Block biuld if errors found */ + // new webpack.NoErrorsPlugin(), - ], + ], - module : { - rules : [ - { - test : /\.js$/, - exclude: /node_modules/, - use : { - loader: 'babel-loader', - options: { - presets: [ __dirname + '/node_modules/babel-preset-es2015' ], - plugins: [ - /** - * Dont need to use «.default» after «export default Class Ui {}» - * @see {@link https://github.com/59naga/babel-plugin-add-module-exports} - */ - 'add-module-exports', - /** - * Babel transforms some awesome ES6 features to ES5 with extra code, such as Class, JSX. - * This plugin makes all generated extra codes to one module which significantly reduces the bundle code size. - * - * {@link https://github.com/brianZeng/babel-plugin-transform-helper} - * @since 11 dec 2017 - removed due to plugin does not supports class inheritance - */ - // ['babel-plugin-transform-helper', { - // helperFilename:'build/__tmp_babel_helpers.js' - // }], - 'class-display-name', - ] - } - } - }, - { - test : /\.js$/, - use: 'eslint-loader?fix=true', - exclude: /(node_modules|build)/ // dont need to look in '/build' to prevent analyse __tmp_babel_helper.js - }, - { - test: /\.css$/, - exclude: /node_modules/, - use: [ - { - loader: 'css-loader', - options: { - // minimize: 1, - importLoaders: 1 - } - }, - 'postcss-loader' - ] - } + module : { + rules : [ + { + test: /\.ts$/, + use: [ + babelLoader, + { + loader: 'ts-loader' + }, + { + loader: 'tslint-loader', + } ] - } -}; \ No newline at end of file + }, + { + test : /\.js$/, + use: [ + babelLoader, + { + loader: 'eslint-loader?fix=true&esModules=true', + } + ], + exclude: /(node_modules|build)/, // dont need to look in '/build' to prevent analyse __tmp_babel_helper.js + }, + { + test: /\.css$/, + exclude: /node_modules/, + use: [ + { + loader: 'css-loader', + options: { + // minimize: 1, + importLoaders: 1 + } + }, + 'postcss-loader' + ] + } + ] + }, + optimization: { + minimize: false + }, +};
  • \n *

    |\n *

    | left first-level siblings\n *

    |\n *
    adaddad
    <-- passed node for example \n *

    |\n *

    | right first-level siblings\n *

    |\n *