From ad5afb456b67d296f29487820a66d4aa3bf7d5ba Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Thu, 17 Sep 2020 11:13:58 +0200 Subject: [PATCH] Renamed #instance to in component data to exclude the editor instance object from internal Vue processing and thus improve performance. --- dist/ckeditor.js | 2 +- dist/ckeditor.js.map | 2 +- src/ckeditor.js | 33 ++++++++++++++-------------- tests/ckeditor.js | 40 +++++++++++++++++----------------- tests/plugin/integration.js | 2 +- tests/plugin/localcomponent.js | 4 ++-- 6 files changed, 42 insertions(+), 41 deletions(-) diff --git a/dist/ckeditor.js b/dist/ckeditor.js index e64aeb2..5f36f82 100644 --- a/dist/ckeditor.js +++ b/dist/ckeditor.js @@ -2,5 +2,5 @@ * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md. */ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor=e():t.CKEditor=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(1))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var i=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r=n(0),o="object"==typeof self&&self&&self.Object===Object&&self,u=r.a||o||Function("return this")(),a=function(){return u.Date.now()},c=u.Symbol,s=Object.prototype,f=s.hasOwnProperty,l=s.toString,d=c?c.toStringTag:void 0;var p=function(t){var e=f.call(t,d),n=t[d];try{t[d]=void 0;var i=!0}catch(t){}var r=l.call(t);return i&&(e?t[d]=n:delete t[d]),r},v=Object.prototype.toString;var y=function(t){return v.call(t)},b="[object Null]",h="[object Undefined]",m=c?c.toStringTag:void 0;var g=function(t){return null==t?void 0===t?h:b:m&&m in Object(t)?p(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},O="[object Symbol]";var w=function(t){return"symbol"==typeof t||j(t)&&g(t)==O},x=NaN,$=/^\s+|\s+$/g,S=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,T=/^0o[0-7]+$/i,_=parseInt;var D=function(t){if("number"==typeof t)return t;if(w(t))return x;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace($,"");var n=E.test(t);return n||T.test(t)?_(t.slice(2),n?2:8):S.test(t)?x:+t},M="Expected a function",P=Math.max,N=Math.min;var F=function(t,e,n){var r,o,u,c,s,f,l=0,d=!1,p=!1,v=!0;if("function"!=typeof t)throw new TypeError(M);function y(e){var n=r,i=o;return r=o=void 0,l=e,c=t.apply(i,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||p&&t-l>=u}function h(){var t=a();if(b(t))return m(t);s=setTimeout(h,function(t){var n=e-(t-f);return p?N(n,u-(t-l)):n}(t))}function m(t){return s=void 0,v&&r?y(t):(r=o=void 0,c)}function g(){var t=a(),n=b(t);if(r=arguments,o=this,f=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(h,e),d?y(t):c}(f);if(p)return clearTimeout(s),s=setTimeout(h,e),y(f)}return void 0===s&&(s=setTimeout(h,e)),c}return e=D(e)||0,i(n)&&(d=!!n.leading,u=(p="maxWait"in n)?P(D(n.maxWait)||0,e):u,v="trailing"in n?!!n.trailing:v),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=f=o=s=void 0},g.flush=function(){return void 0===s?c:m(a())},g};var U={name:"ckeditor",render(t){return t(this.tagName)},props:{editor:{type:Function,default:null},value:{type:String,default:""},config:{type:Object,default:()=>({})},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1}},data:()=>({instance:null,$_lastEditorData:{type:String,default:""}}),mounted(){const t=Object.assign({},this.config);this.value&&(t.initialData=this.value),this.editor.create(this.$el,t).then(t=>{this.instance=t,t.isReadOnly=this.disabled,this.$_setUpEditorEvents(),this.$emit("ready",t)}).catch(t=>{console.error(t)})},beforeDestroy(){this.instance&&(this.instance.destroy(),this.instance=null),this.$emit("destroy",this.instance)},watch:{value(t,e){t!==e&&t!==this.$_lastEditorData&&this.instance.setData(t)},disabled(t){this.instance.isReadOnly=t}},methods:{$_setUpEditorEvents(){const t=this.instance,e=F(e=>{const n=this.$_lastEditorData=t.getData();this.$emit("input",n,e,t)},300,{leading:!0});t.model.document.on("change:data",e),t.editing.view.document.on("focus",e=>{this.$emit("focus",e,t)}),t.editing.view.document.on("blur",e=>{this.$emit("blur",e,t)})}}};const k={install(t){t.component("ckeditor",U)},component:U};e.default=k}]).default}); +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.CKEditor=e():t.CKEditor=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(1))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e);var i=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},r=n(0),o="object"==typeof self&&self&&self.Object===Object&&self,u=r.a||o||Function("return this")(),a=function(){return u.Date.now()},c=u.Symbol,s=Object.prototype,f=s.hasOwnProperty,l=s.toString,d=c?c.toStringTag:void 0;var p=function(t){var e=f.call(t,d),n=t[d];try{t[d]=void 0;var i=!0}catch(t){}var r=l.call(t);return i&&(e?t[d]=n:delete t[d]),r},v=Object.prototype.toString;var y=function(t){return v.call(t)},b="[object Null]",h="[object Undefined]",m=c?c.toStringTag:void 0;var g=function(t){return null==t?void 0===t?h:b:m&&m in Object(t)?p(t):y(t)};var j=function(t){return null!=t&&"object"==typeof t},$="[object Symbol]";var O=function(t){return"symbol"==typeof t||j(t)&&g(t)==$},_=NaN,w=/^\s+|\s+$/g,x=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,E=/^0o[0-7]+$/i,T=parseInt;var D=function(t){if("number"==typeof t)return t;if(O(t))return _;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(w,"");var n=S.test(t);return n||E.test(t)?T(t.slice(2),n?2:8):x.test(t)?_:+t},M="Expected a function",P=Math.max,N=Math.min;var F=function(t,e,n){var r,o,u,c,s,f,l=0,d=!1,p=!1,v=!0;if("function"!=typeof t)throw new TypeError(M);function y(e){var n=r,i=o;return r=o=void 0,l=e,c=t.apply(i,n)}function b(t){var n=t-f;return void 0===f||n>=e||n<0||p&&t-l>=u}function h(){var t=a();if(b(t))return m(t);s=setTimeout(h,function(t){var n=e-(t-f);return p?N(n,u-(t-l)):n}(t))}function m(t){return s=void 0,v&&r?y(t):(r=o=void 0,c)}function g(){var t=a(),n=b(t);if(r=arguments,o=this,f=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(h,e),d?y(t):c}(f);if(p)return clearTimeout(s),s=setTimeout(h,e),y(f)}return void 0===s&&(s=setTimeout(h,e)),c}return e=D(e)||0,i(n)&&(d=!!n.leading,u=(p="maxWait"in n)?P(D(n.maxWait)||0,e):u,v="trailing"in n?!!n.trailing:v),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=f=o=s=void 0},g.flush=function(){return void 0===s?c:m(a())},g};var U={name:"ckeditor",render(t){return t(this.tagName)},props:{editor:{type:Function,default:null},value:{type:String,default:""},config:{type:Object,default:()=>({})},tagName:{type:String,default:"div"},disabled:{type:Boolean,default:!1}},data:()=>({$_instance:null,$_lastEditorData:{type:String,default:""}}),mounted(){const t=Object.assign({},this.config);this.value&&(t.initialData=this.value),this.editor.create(this.$el,t).then(t=>{this.$_instance=t,t.isReadOnly=this.disabled,this.$_setUpEditorEvents(),this.$emit("ready",t)}).catch(t=>{console.error(t)})},beforeDestroy(){this.$_instance&&(this.$_instance.destroy(),this.$_instance=null),this.$emit("destroy",this.$_instance)},watch:{value(t,e){t!==e&&t!==this.$_lastEditorData&&this.$_instance.setData(t)},disabled(t){this.$_instance.isReadOnly=t}},methods:{$_setUpEditorEvents(){const t=this.$_instance,e=F(e=>{const n=this.$_lastEditorData=t.getData();this.$emit("input",n,e,t)},300,{leading:!0});t.model.document.on("change:data",e),t.editing.view.document.on("focus",e=>{this.$emit("focus",e,t)}),t.editing.view.document.on("blur",e=>{this.$emit("blur",e,t)})}}};const k={install(t){t.component("ckeditor",U)},component:U};e.default=k}]).default}); //# sourceMappingURL=ckeditor.js.map \ No newline at end of file diff --git a/dist/ckeditor.js.map b/dist/ckeditor.js.map index 3194cc4..c29c4ed 100644 --- a/dist/ckeditor.js.map +++ b/dist/ckeditor.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://CKEditor/webpack/universalModuleDefinition","webpack://CKEditor/webpack/bootstrap","webpack://CKEditor/./node_modules/lodash-es/_freeGlobal.js","webpack://CKEditor/(webpack)/buildin/global.js","webpack://CKEditor/./node_modules/lodash-es/isObject.js","webpack://CKEditor/./node_modules/lodash-es/_root.js","webpack://CKEditor/./node_modules/lodash-es/now.js","webpack://CKEditor/./node_modules/lodash-es/_Symbol.js","webpack://CKEditor/./node_modules/lodash-es/_getRawTag.js","webpack://CKEditor/./node_modules/lodash-es/_objectToString.js","webpack://CKEditor/./node_modules/lodash-es/_baseGetTag.js","webpack://CKEditor/./node_modules/lodash-es/isObjectLike.js","webpack://CKEditor/./node_modules/lodash-es/isSymbol.js","webpack://CKEditor/./node_modules/lodash-es/toNumber.js","webpack://CKEditor/./node_modules/lodash-es/debounce.js","webpack://CKEditor/./src/ckeditor.js","webpack://CKEditor/./src/plugin.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","freeGlobal","__webpack_exports__","g","this","Function","e","lodash_es_isObject","type","freeSelf","self","_root","_freeGlobal","lodash_es_now","Date","now","_Symbol","objectProto","_getRawTag_hasOwnProperty","nativeObjectToString","toString","symToStringTag","undefined","_getRawTag","isOwn","tag","unmasked","result","_objectToString_nativeObjectToString","_objectToString","nullTag","undefinedTag","_baseGetTag_symToStringTag","_baseGetTag","lodash_es_isObjectLike","symbolTag","lodash_es_isSymbol","NAN","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","lodash_es_toNumber","other","valueOf","replace","isBinary","test","slice","FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","lodash_es_debounce","func","wait","options","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","timeWaiting","remainingWait","debounced","isInvoking","arguments","leadingEdge","clearTimeout","cancel","flush","ckeditor","render","createElement","tagName","props","editor","default","String","config","disabled","Boolean","data","instance","$_lastEditorData","mounted","editorConfig","assign","initialData","$el","then","isReadOnly","$_setUpEditorEvents","$emit","catch","error","console","beforeDestroy","destroy","watch","newValue","oldValue","setData","val","methods","emitDebouncedInputEvent","debounce","evt","getData","model","document","on","editing","view","CKEditor","install","Vue","component","CKEditorComponent"],"mappings":";;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,SAAAD,IAEAD,EAAA,SAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAG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EzB/F,KAAK2G,sBAGL3G,KAAK4G,MAAO,QAASjB,KAErBkB,MAAOC,IACPC,QAAQD,MAAOA,MAIlBE,gBACMhH,KAAKkG,WACTlG,KAAKkG,SAASe,UACdjH,KAAKkG,SAAW,MAKjBlG,KAAK4G,MAAO,UAAW5G,KAAKkG,WAG7BgB,OACCrI,MAAOsI,EAAUC,GAuBXD,IAAaC,GAAYD,IAAanH,KAAKmG,kBAC/CnG,KAAKkG,SAASmB,QAASF,IAKzBpB,SAAUuB,GACTtH,KAAKkG,SAASQ,WAAaY,IAI7BC,SACCZ,sBACC,MAAMhB,EAAS3F,KAAKkG,SAKdsB,EAA0BC,EAAUC,IAIzC,MAAMzB,EAAOjG,KAAKmG,iBAAmBR,EAAOgC,UAG5C3H,KAAK4G,MAAO,QAASX,EAAMyB,EAAK/B,IApIF,KAqIC5B,SAAS,IAMzC4B,EAAOiC,MAAMC,SAASC,GAAI,cAAeN,GAEzC7B,EAAOoC,QAAQC,KAAKH,SAASC,GAAI,QAASJ,IACzC1H,KAAK4G,MAAO,QAASc,EAAK/B,KAG3BA,EAAOoC,QAAQC,KAAKH,SAASC,GAAI,OAAQJ,IACxC1H,KAAK4G,MAAO,OAAQc,EAAK/B,QCpJ7B,MAAMsC,GAMLC,QAASC,GACRA,EAAIC,UAAW,WAAYC,IAE5BD,UAAWC,GAGGJ","file":"ckeditor.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CKEditor\"] = factory();\n\telse\n\t\troot[\"CKEditor\"] = factory();\n})(window, function() {\nreturn "," \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 = 2);\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","/**\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* global console */\n\nimport { debounce } from 'lodash-es';\n\nconst INPUT_EVENT_DEBOUNCE_WAIT = 300;\n\nexport default {\n\tname: 'ckeditor',\n\n\trender( createElement ) {\n\t\treturn createElement( this.tagName );\n\t},\n\n\tprops: {\n\t\teditor: {\n\t\t\ttype: Function,\n\t\t\tdefault: null\n\t\t},\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: ''\n\t\t},\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ( {} )\n\t\t},\n\t\ttagName: {\n\t\t\ttype: String,\n\t\t\tdefault: 'div'\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Don't define it in #props because it produces a warning.\n\t\t\t// https://vuejs.org/v2/guide/components-props.html#One-Way-Data-Flow\n\t\t\tinstance: null,\n\n\t\t\t$_lastEditorData: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: ''\n\t\t\t}\n\t\t};\n\t},\n\n\tmounted() {\n\t\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\t\tconst editorConfig = Object.assign( {}, this.config );\n\n\t\tif ( this.value ) {\n\t\t\teditorConfig.initialData = this.value;\n\t\t}\n\n\t\tthis.editor.create( this.$el, editorConfig )\n\t\t\t.then( editor => {\n\t\t\t\t// Save the reference to the instance for further use.\n\t\t\t\tthis.instance = editor;\n\n\t\t\t\t// Set initial disabled state.\n\t\t\t\teditor.isReadOnly = this.disabled;\n\n\t\t\t\tthis.$_setUpEditorEvents();\n\n\t\t\t\t// Let the world know the editor is ready.\n\t\t\t\tthis.$emit( 'ready', editor );\n\t\t\t} )\n\t\t\t.catch( error => {\n\t\t\t\tconsole.error( error );\n\t\t\t} );\n\t},\n\n\tbeforeDestroy() {\n\t\tif ( this.instance ) {\n\t\t\tthis.instance.destroy();\n\t\t\tthis.instance = null;\n\t\t}\n\n\t\t// Note: By the time the editor is destroyed (promise resolved, editor#destroy fired)\n\t\t// the Vue component will not be able to emit any longer. So emitting #destroy a bit earlier.\n\t\tthis.$emit( 'destroy', this.instance );\n\t},\n\n\twatch: {\n\t\tvalue( newValue, oldValue ) {\n\t\t\t// Synchronize changes of instance#value. There are two sources of changes:\n\t\t\t//\n\t\t\t// External value change ------\\\n\t\t\t// -----> +-----------+\n\t\t\t// | Component |\n\t\t\t// -----> +-----------+\n\t\t\t// Internal data change ------/\n\t\t\t// (typing, commands, collaboration)\n\t\t\t//\n\t\t\t// Case 1: If the change was external (via props), the editor data must be synced with\n\t\t\t// the component using instance#setData() and it is OK to destroy the selection.\n\t\t\t//\n\t\t\t// Case 2: If the change is the result of internal data change, the #value is the same as\n\t\t\t// instance#$_lastEditorData, which has been cached on instance#change:data. If we called\n\t\t\t// instance#setData() at this point, that would demolish the selection.\n\t\t\t//\n\t\t\t// To limit the number of instance#setData() which is time-consuming when there is a\n\t\t\t// lot of data we make sure:\n\t\t\t// * the new value is at least different than the old value (Case 1.)\n\t\t\t// * the new value is different than the last internal instance state (Case 2.)\n\t\t\t//\n\t\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42.\n\t\t\tif ( newValue !== oldValue && newValue !== this.$_lastEditorData ) {\n\t\t\t\tthis.instance.setData( newValue );\n\t\t\t}\n\t\t},\n\n\t\t// Synchronize changes of #disabled.\n\t\tdisabled( val ) {\n\t\t\tthis.instance.isReadOnly = val;\n\t\t}\n\t},\n\n\tmethods: {\n\t\t$_setUpEditorEvents() {\n\t\t\tconst editor = this.instance;\n\t\t\t// Use the leading edge so the first event in the series is emitted immediately.\n\t\t\t// Failing to do so leads to race conditions, for instance, when the component value\n\t\t\t// is set twice in a time span shorter than the debounce time.\n\t\t\t// See https://github.com/ckeditor/ckeditor5-vue/issues/149.\n\t\t\tconst emitDebouncedInputEvent = debounce( evt => {\n\t\t\t\t// Cache the last editor data. This kind of data is a result of typing,\n\t\t\t\t// editor command execution, collaborative changes to the document, etc.\n\t\t\t\t// This data is compared when the component value changes in a 2-way binding.\n\t\t\t\tconst data = this.$_lastEditorData = editor.getData();\n\n\t\t\t\t// The compatibility with the v-model and general Vue.js concept of input–like components.\n\t\t\t\tthis.$emit( 'input', data, evt, editor );\n\t\t\t}, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } );\n\n\t\t\t// Debounce emitting the #input event. When data is huge, instance#getData()\n\t\t\t// takes a lot of time to execute on every single key press and ruins the UX.\n\t\t\t//\n\t\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42\n\t\t\teditor.model.document.on( 'change:data', emitDebouncedInputEvent );\n\n\t\t\teditor.editing.view.document.on( 'focus', evt => {\n\t\t\t\tthis.$emit( 'focus', evt, editor );\n\t\t\t} );\n\n\t\t\teditor.editing.view.document.on( 'blur', evt => {\n\t\t\t\tthis.$emit( 'blur', evt, editor );\n\t\t\t} );\n\t\t}\n\t}\n};\n","/**\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport CKEditorComponent from './ckeditor.js';\n\nconst CKEditor = {\n\t/**\n\t * Installs the plugin, registering the `` component.\n\t *\n\t * @param {Vue} Vue The Vue object.\n\t */\n\tinstall( Vue ) {\n\t\tVue.component( 'ckeditor', CKEditorComponent );\n\t},\n\tcomponent: CKEditorComponent\n};\n\nexport default CKEditor;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://CKEditor/webpack/universalModuleDefinition","webpack://CKEditor/webpack/bootstrap","webpack://CKEditor/./node_modules/lodash-es/_freeGlobal.js","webpack://CKEditor/(webpack)/buildin/global.js","webpack://CKEditor/./node_modules/lodash-es/isObject.js","webpack://CKEditor/./node_modules/lodash-es/_root.js","webpack://CKEditor/./node_modules/lodash-es/now.js","webpack://CKEditor/./node_modules/lodash-es/_Symbol.js","webpack://CKEditor/./node_modules/lodash-es/_getRawTag.js","webpack://CKEditor/./node_modules/lodash-es/_objectToString.js","webpack://CKEditor/./node_modules/lodash-es/_baseGetTag.js","webpack://CKEditor/./node_modules/lodash-es/isObjectLike.js","webpack://CKEditor/./node_modules/lodash-es/isSymbol.js","webpack://CKEditor/./node_modules/lodash-es/toNumber.js","webpack://CKEditor/./node_modules/lodash-es/debounce.js","webpack://CKEditor/./src/ckeditor.js","webpack://CKEditor/./src/plugin.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","freeGlobal","__webpack_exports__","g","this","Function","e","lodash_es_isObject","type","freeSelf","self","_root","_freeGlobal","lodash_es_now","Date","now","_Symbol","objectProto","_getRawTag_hasOwnProperty","nativeObjectToString","toString","symToStringTag","undefined","_getRawTag","isOwn","tag","unmasked","result","_objectToString_nativeObjectToString","_objectToString","nullTag","undefinedTag","_baseGetTag_symToStringTag","_baseGetTag","lodash_es_isObjectLike","symbolTag","lodash_es_isSymbol","NAN","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","lodash_es_toNumber","other","valueOf","replace","isBinary","test","slice","FUNC_ERROR_TEXT","nativeMax","Math","max","nativeMin","min","lodash_es_debounce","func","wait","options","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","timeWaiting","remainingWait","debounced","isInvoking","arguments","leadingEdge","clearTimeout","cancel","flush","ckeditor","render","createElement","tagName","props","editor","default","String","config","disabled","Boolean","data","$_instance","$_lastEditorData","mounted","editorConfig","assign","initialData","$el","then","isReadOnly","$_setUpEditorEvents","$emit","catch","error","console","beforeDestroy","destroy","watch","newValue","oldValue","setData","val","methods","emitDebouncedInputEvent","debounce","evt","getData","model","document","on","editing","view","CKEditor","install","Vue","component","CKEditorComponent"],"mappings":";;;;CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,UAAAH,GACA,iBAAAC,QACAA,QAAA,SAAAD,IAEAD,EAAA,SAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB,EAAAgB,EAAAO,GACAX,OAAAC,eAAAU,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AAS,IAMzC4B,EAAOiC,MAAMC,SAASC,GAAI,cAAeN,GAEzC7B,EAAOoC,QAAQC,KAAKH,SAASC,GAAI,QAASJ,IACzC1H,KAAK4G,MAAO,QAASc,EAAK/B,KAG3BA,EAAOoC,QAAQC,KAAKH,SAASC,GAAI,OAAQJ,IACxC1H,KAAK4G,MAAO,OAAQc,EAAK/B,QCrJ7B,MAAMsC,GAMLC,QAASC,GACRA,EAAIC,UAAW,WAAYC,IAE5BD,UAAWC,GAGGJ","file":"ckeditor.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CKEditor\"] = factory();\n\telse\n\t\troot[\"CKEditor\"] = factory();\n})(window, function() {\nreturn "," \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 = 2);\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nexport default now;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import isObject from './isObject.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nexport default toNumber;\n","import isObject from './isObject.js';\nimport now from './now.js';\nimport toNumber from './toNumber.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport default debounce;\n","/**\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* global console */\n\nimport { debounce } from 'lodash-es';\n\nconst INPUT_EVENT_DEBOUNCE_WAIT = 300;\n\nexport default {\n\tname: 'ckeditor',\n\n\trender( createElement ) {\n\t\treturn createElement( this.tagName );\n\t},\n\n\tprops: {\n\t\teditor: {\n\t\t\ttype: Function,\n\t\t\tdefault: null\n\t\t},\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: ''\n\t\t},\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ( {} )\n\t\t},\n\t\ttagName: {\n\t\t\ttype: String,\n\t\t\tdefault: 'div'\n\t\t},\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Don't define it in #props because it produces a warning.\n\t\t\t// https://vuejs.org/v2/guide/components-props.html#One-Way-Data-Flow\n\t\t\t$_instance: null,\n\n\t\t\t$_lastEditorData: {\n\t\t\t\ttype: String,\n\t\t\t\tdefault: ''\n\t\t\t}\n\t\t};\n\t},\n\n\tmounted() {\n\t\t// Clone the config first so it never gets mutated (across multiple editor instances).\n\t\t// https://github.com/ckeditor/ckeditor5-vue/issues/101\n\t\tconst editorConfig = Object.assign( {}, this.config );\n\n\t\tif ( this.value ) {\n\t\t\teditorConfig.initialData = this.value;\n\t\t}\n\n\t\tthis.editor.create( this.$el, editorConfig )\n\t\t\t.then( editor => {\n\t\t\t\t// Save the reference to the $_instance for further use.\n\t\t\t\tthis.$_instance = editor;\n\n\t\t\t\t// Set initial disabled state.\n\t\t\t\teditor.isReadOnly = this.disabled;\n\n\t\t\t\tthis.$_setUpEditorEvents();\n\n\t\t\t\t// Let the world know the editor is ready.\n\t\t\t\tthis.$emit( 'ready', editor );\n\t\t\t} )\n\t\t\t.catch( error => {\n\t\t\t\tconsole.error( error );\n\t\t\t} );\n\t},\n\n\tbeforeDestroy() {\n\t\tif ( this.$_instance ) {\n\t\t\tthis.$_instance.destroy();\n\t\t\tthis.$_instance = null;\n\t\t}\n\n\t\t// Note: By the time the editor is destroyed (promise resolved, editor#destroy fired)\n\t\t// the Vue component will not be able to emit any longer. So emitting #destroy a bit earlier.\n\t\tthis.$emit( 'destroy', this.$_instance );\n\t},\n\n\twatch: {\n\t\tvalue( newValue, oldValue ) {\n\t\t\t// Synchronize changes of #value. There are two sources of changes:\n\t\t\t//\n\t\t\t// External value change ------\\\n\t\t\t// -----> +-----------+\n\t\t\t// | Component |\n\t\t\t// -----> +-----------+\n\t\t\t// Internal data change ------/\n\t\t\t// (typing, commands, collaboration)\n\t\t\t//\n\t\t\t// Case 1: If the change was external (via props), the editor data must be synced with\n\t\t\t// the component using $_instance#setData() and it is OK to destroy the selection.\n\t\t\t//\n\t\t\t// Case 2: If the change is the result of internal data change, the #value is the same as\n\t\t\t// this.$_lastEditorData, which has been cached on #change:data. If we called\n\t\t\t// $_instance#setData() at this point, that would demolish the selection.\n\t\t\t//\n\t\t\t// To limit the number of $_instance#setData() which is time-consuming when there is a\n\t\t\t// lot of data we make sure:\n\t\t\t// * the new value is at least different than the old value (Case 1.)\n\t\t\t// * the new value is different than the last internal instance state (Case 2.)\n\t\t\t//\n\t\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42.\n\t\t\tif ( newValue !== oldValue && newValue !== this.$_lastEditorData ) {\n\t\t\t\tthis.$_instance.setData( newValue );\n\t\t\t}\n\t\t},\n\n\t\t// Synchronize changes of #disabled.\n\t\tdisabled( val ) {\n\t\t\tthis.$_instance.isReadOnly = val;\n\t\t}\n\t},\n\n\tmethods: {\n\t\t$_setUpEditorEvents() {\n\t\t\tconst editor = this.$_instance;\n\n\t\t\t// Use the leading edge so the first event in the series is emitted immediately.\n\t\t\t// Failing to do so leads to race conditions, for instance, when the component value\n\t\t\t// is set twice in a time span shorter than the debounce time.\n\t\t\t// See https://github.com/ckeditor/ckeditor5-vue/issues/149.\n\t\t\tconst emitDebouncedInputEvent = debounce( evt => {\n\t\t\t\t// Cache the last editor data. This kind of data is a result of typing,\n\t\t\t\t// editor command execution, collaborative changes to the document, etc.\n\t\t\t\t// This data is compared when the component value changes in a 2-way binding.\n\t\t\t\tconst data = this.$_lastEditorData = editor.getData();\n\n\t\t\t\t// The compatibility with the v-model and general Vue.js concept of input–like components.\n\t\t\t\tthis.$emit( 'input', data, evt, editor );\n\t\t\t}, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } );\n\n\t\t\t// Debounce emitting the #input event. When data is huge, $_instance#getData()\n\t\t\t// takes a lot of time to execute on every single key press and ruins the UX.\n\t\t\t//\n\t\t\t// See: https://github.com/ckeditor/ckeditor5-vue/issues/42\n\t\t\teditor.model.document.on( 'change:data', emitDebouncedInputEvent );\n\n\t\t\teditor.editing.view.document.on( 'focus', evt => {\n\t\t\t\tthis.$emit( 'focus', evt, editor );\n\t\t\t} );\n\n\t\t\teditor.editing.view.document.on( 'blur', evt => {\n\t\t\t\tthis.$emit( 'blur', evt, editor );\n\t\t\t} );\n\t\t}\n\t}\n};\n","/**\n * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport CKEditorComponent from './ckeditor.js';\n\nconst CKEditor = {\n\t/**\n\t * Installs the plugin, registering the `` component.\n\t *\n\t * @param {Vue} Vue The Vue object.\n\t */\n\tinstall( Vue ) {\n\t\tVue.component( 'ckeditor', CKEditorComponent );\n\t},\n\tcomponent: CKEditorComponent\n};\n\nexport default CKEditor;\n"],"sourceRoot":""} \ No newline at end of file diff --git a/src/ckeditor.js b/src/ckeditor.js index 4a79225..87abb66 100644 --- a/src/ckeditor.js +++ b/src/ckeditor.js @@ -43,7 +43,7 @@ export default { return { // Don't define it in #props because it produces a warning. // https://vuejs.org/v2/guide/components-props.html#One-Way-Data-Flow - instance: null, + $_instance: null, $_lastEditorData: { type: String, @@ -63,8 +63,8 @@ export default { this.editor.create( this.$el, editorConfig ) .then( editor => { - // Save the reference to the instance for further use. - this.instance = editor; + // Save the reference to the $_instance for further use. + this.$_instance = editor; // Set initial disabled state. editor.isReadOnly = this.disabled; @@ -80,19 +80,19 @@ export default { }, beforeDestroy() { - if ( this.instance ) { - this.instance.destroy(); - this.instance = null; + if ( this.$_instance ) { + this.$_instance.destroy(); + this.$_instance = null; } // Note: By the time the editor is destroyed (promise resolved, editor#destroy fired) // the Vue component will not be able to emit any longer. So emitting #destroy a bit earlier. - this.$emit( 'destroy', this.instance ); + this.$emit( 'destroy', this.$_instance ); }, watch: { value( newValue, oldValue ) { - // Synchronize changes of instance#value. There are two sources of changes: + // Synchronize changes of #value. There are two sources of changes: // // External value change ------\ // -----> +-----------+ @@ -102,32 +102,33 @@ export default { // (typing, commands, collaboration) // // Case 1: If the change was external (via props), the editor data must be synced with - // the component using instance#setData() and it is OK to destroy the selection. + // the component using $_instance#setData() and it is OK to destroy the selection. // // Case 2: If the change is the result of internal data change, the #value is the same as - // instance#$_lastEditorData, which has been cached on instance#change:data. If we called - // instance#setData() at this point, that would demolish the selection. + // this.$_lastEditorData, which has been cached on #change:data. If we called + // $_instance#setData() at this point, that would demolish the selection. // - // To limit the number of instance#setData() which is time-consuming when there is a + // To limit the number of $_instance#setData() which is time-consuming when there is a // lot of data we make sure: // * the new value is at least different than the old value (Case 1.) // * the new value is different than the last internal instance state (Case 2.) // // See: https://github.com/ckeditor/ckeditor5-vue/issues/42. if ( newValue !== oldValue && newValue !== this.$_lastEditorData ) { - this.instance.setData( newValue ); + this.$_instance.setData( newValue ); } }, // Synchronize changes of #disabled. disabled( val ) { - this.instance.isReadOnly = val; + this.$_instance.isReadOnly = val; } }, methods: { $_setUpEditorEvents() { - const editor = this.instance; + const editor = this.$_instance; + // Use the leading edge so the first event in the series is emitted immediately. // Failing to do so leads to race conditions, for instance, when the component value // is set twice in a time span shorter than the debounce time. @@ -142,7 +143,7 @@ export default { this.$emit( 'input', data, evt, editor ); }, INPUT_EVENT_DEBOUNCE_WAIT, { leading: true } ); - // Debounce emitting the #input event. When data is huge, instance#getData() + // Debounce emitting the #input event. When data is huge, $_instance#getData() // takes a lot of time to execute on every single key press and ruins the UX. // // See: https://github.com/ckeditor/ckeditor5-vue/issues/42 diff --git a/tests/ckeditor.js b/tests/ckeditor.js index ad3be54..aae4694 100644 --- a/tests/ckeditor.js +++ b/tests/ckeditor.js @@ -50,7 +50,7 @@ describe( 'CKEditor Component', () => { wrapper.destroy(); sinon.assert.calledOnce( stub ); - expect( vm.instance ).to.be.null; + expect( vm.$_instance ).to.be.null; } ); it( 'should pass the editor promise rejection error to console#error()', async () => { @@ -81,7 +81,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); expect( vm.editor ).to.equal( MockEditor ); - expect( vm.instance ).to.be.instanceOf( MockEditor ); + expect( vm.$_instance ).to.be.instanceOf( MockEditor ); wrapper.destroy(); } ); @@ -100,8 +100,8 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - expect( vm.instance.config.initialData ).to.equal( 'foo' ); - expect( vm.instance.setDataCounter ).to.equal( 0 ); + expect( vm.$_instance.config.initialData ).to.equal( 'foo' ); + expect( vm.$_instance.setDataCounter ).to.equal( 0 ); wrapper.destroy(); } ); @@ -135,7 +135,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - expect( vm.instance.isReadOnly ).to.be.true; + expect( vm.$_instance.isReadOnly ).to.be.true; wrapper.destroy(); } ); } ); @@ -152,7 +152,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - expect( vm.instance.config ).to.deep.equal( { foo: 'bar' } ); + expect( vm.$_instance.config ).to.deep.equal( { foo: 'bar' } ); wrapper.destroy(); } ); @@ -206,7 +206,7 @@ describe( 'CKEditor Component', () => { it( '#instance should be defined', async () => { await Vue.nextTick(); - expect( vm.instance ).to.be.instanceOf( MockEditor ); + expect( vm.$_instance ).to.be.instanceOf( MockEditor ); } ); } ); @@ -218,13 +218,13 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - expect( vm.instance.isReadOnly ).to.be.true; + expect( vm.$_instance.isReadOnly ).to.be.true; wrapper.setProps( { disabled: false } ); await Vue.nextTick(); - expect( vm.instance.isReadOnly ).to.be.false; + expect( vm.$_instance.isReadOnly ).to.be.false; wrapper.destroy(); } ); @@ -232,7 +232,7 @@ describe( 'CKEditor Component', () => { it( '#value should trigger editor#setData', async () => { await Vue.nextTick(); - const spy = sandbox.spy( vm.instance, 'setData' ); + const spy = sandbox.spy( vm.$_instance, 'setData' ); wrapper.setProps( { value: 'foo' } ); await Vue.nextTick(); @@ -263,7 +263,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); expect( wrapper.emitted().ready.length ).to.equal( 1 ); - expect( wrapper.emitted().ready[ 0 ] ).to.deep.equal( [ vm.instance ] ); + expect( wrapper.emitted().ready[ 0 ] ).to.deep.equal( [ vm.$_instance ] ); } ); it( 'should emit #destroy when the editor is destroyed', async () => { @@ -274,7 +274,7 @@ describe( 'CKEditor Component', () => { wrapper.destroy(); expect( wrapper.emitted().destroy.length ).to.equal( 1 ); - expect( wrapper.emitted().destroy[ 0 ] ).to.deep.equal( [ vm.instance ] ); + expect( wrapper.emitted().destroy[ 0 ] ).to.deep.equal( [ vm.$_instance ] ); } ); describe( '#input event', () => { @@ -284,7 +284,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - const on = vm.instance.model.document.on; + const on = vm.$_instance.model.document.on; const evtStub = {}; expect( on.calledOnce ).to.be.true; @@ -299,7 +299,7 @@ describe( 'CKEditor Component', () => { expect( wrapper.emitted().input.length ).to.equal( 1 ); expect( wrapper.emitted().input[ 0 ] ).to.deep.equal( [ - 'foo', evtStub, vm.instance + 'foo', evtStub, vm.$_instance ] ); } ); @@ -310,7 +310,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - const on = vm.instance.model.document.on; + const on = vm.$_instance.model.document.on; const evtStub = {}; expect( on.calledOnce ).to.be.true; @@ -323,7 +323,7 @@ describe( 'CKEditor Component', () => { expect( wrapper.emitted().input.length ).to.equal( 1 ); expect( wrapper.emitted().input[ 0 ] ).to.deep.equal( [ - 'foo', evtStub, vm.instance + 'foo', evtStub, vm.$_instance ] ); } ); } ); @@ -333,7 +333,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - const on = vm.instance.editing.view.document.on; + const on = vm.$_instance.editing.view.document.on; const evtStub = {}; expect( on.calledTwice ).to.be.true; @@ -346,7 +346,7 @@ describe( 'CKEditor Component', () => { expect( wrapper.emitted().focus.length ).to.equal( 1 ); expect( wrapper.emitted().focus[ 0 ] ).to.deep.equal( [ - evtStub, vm.instance + evtStub, vm.$_instance ] ); } ); @@ -355,7 +355,7 @@ describe( 'CKEditor Component', () => { await Vue.nextTick(); - const on = vm.instance.editing.view.document.on; + const on = vm.$_instance.editing.view.document.on; const evtStub = {}; expect( on.calledTwice ).to.be.true; @@ -368,7 +368,7 @@ describe( 'CKEditor Component', () => { expect( wrapper.emitted().blur.length ).to.equal( 1 ); expect( wrapper.emitted().blur[ 0 ] ).to.deep.equal( [ - evtStub, vm.instance + evtStub, vm.$_instance ] ); } ); } ); diff --git a/tests/plugin/integration.js b/tests/plugin/integration.js index 52cb5c3..f248683 100644 --- a/tests/plugin/integration.js +++ b/tests/plugin/integration.js @@ -22,7 +22,7 @@ describe( 'CKEditor plugin', () => { template: '', methods: { onReady: () => { - const instance = wrapper.vm.$children[ 0 ].instance; + const instance = wrapper.vm.$children[ 0 ].$_instance; expect( instance ).to.be.instanceOf( ClassicEditor ); expect( instance.getData() ).to.equal( '

foo

' ); diff --git a/tests/plugin/localcomponent.js b/tests/plugin/localcomponent.js index 1b1c3a9..c7360a9 100644 --- a/tests/plugin/localcomponent.js +++ b/tests/plugin/localcomponent.js @@ -41,7 +41,7 @@ describe( 'CKEditor plugin', () => { await Vue.nextTick(); - expect( wrapperFoo.vm.$children[ 0 ].instance ).to.be.instanceOf( FooEditor ); - expect( wrapperBar.vm.$children[ 0 ].instance ).to.be.instanceOf( BarEditor ); + expect( wrapperFoo.vm.$children[ 0 ].$_instance ).to.be.instanceOf( FooEditor ); + expect( wrapperBar.vm.$children[ 0 ].$_instance ).to.be.instanceOf( BarEditor ); } ); } );