diff --git a/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js b/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js index 4a7fedeb5c..2d3bcf4fb6 100644 --- a/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js +++ b/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ezPluginCustomTag=t():(e.eZ=e.eZ||{},e.eZ.ezAlloyEditor=e.eZ.ezAlloyEditor||{},e.eZ.ezAlloyEditor.ezPluginCustomTag=t())}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=64)}({64:function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t
{content}
',requiredContent:"div",editables:{content:{selector:'[data-ezelement="ezcontent"]'}},upcast:function(e){return"div"===e.name&&"eztemplate"===e.attributes["data-ezelement"]&&!e.attributes["data-eztype"]},insert:function(){var e,n=CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),i=t.widgets.wrapElement(n,this.name),r=new CKEDITOR.dom.documentFragment(i.getDocument());r.append(i),t.widgets.initOn(n,this.name),t.eZ.appendElement(i),e=t.widgets.getByElement(i),e.ready=!0,e.fire("ready"),e.focus()},edit:function(){this.insert()},init:function(){this.on("focus",this.fireEditorInteraction),this.syncAlignment(),this.renderAttributes(),this.renderHeader(),this.getEzContentElement(),this.getEzConfigElement(),this.cancelEditEvents(),this.toggleState({currentTarget:{dataset:{target:"attributes"}}})},clearNode:function(e){for(var t=e.getFirst(),n=void 0;t;)n=t.getNext(),t.remove(),t=n},renderHeader:function(){var t=e.eZ.adminUiConfig.richTextCustomTags[this.getName()];if(t){var n=this.getHeader(),i='\n
\n '+t.label+'\n
\n
\n \n \n
\n ';this.clearNode(n),n.appendHtml(i),this.attachButtonsListeners()}},attachButtonsListeners:function(){var e=this,t=this.getHeader();[t.findOne(".ez-custom-tag__header-btn--attributes"),t.findOne(".ez-custom-tag__header-btn--content")].forEach(function(t){return t.$.addEventListener("click",e.toggleState.bind(e),!1)})},toggleState:function(e){var t=this,n=e.currentTarget.dataset.target,i={attributes:"ez-custom-tag--attributes-visible",content:"ez-custom-tag--content-visible"};Object.entries(i).forEach(function(e){var i=r(e,2),a=i[0],o=i[1];return t.element.$.classList.toggle(o,a===n)})},renderAttributes:function(){var t=this,n=e.eZ.adminUiConfig.richTextCustomTags[this.getName()];if(n){var i=Object.keys(n.attributes).reduce(function(e,i){var r=t.getConfig(i);return e+"

"+n.attributes[i].label+": "+r+"

"},"");this.setWidgetAttributes(i)}},setName:function(e){return this.element.data("ezname",e),window.clearTimeout(this.setNameFireEditorInteractionTimeout),this.setNameFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"nameUpdated"),50),this},getName:function(){return this.element.data("ezname")},cancelEditEvents:function(){var e=function(e){return e.cancel()};this.on("doubleclick",e,null,null,5),this.on("key",e,null,null,5)},syncAlignment:function(){var e=this.element.data("ezalign");e?this.setAlignment(e):this.unsetAlignment()},setAlignment:function(e){this.wrapper.data("ezalign",e),this.element.data("ezalign",e),window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout),this.setAlignmentFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"aligmentUpdated"),50)},unsetAlignment:function(){this.wrapper.data("ezalign",!1),this.element.data("ezalign",!1),window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout),this.unsetAlignmentFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"aligmentRemoved"),50)},isAligned:function(e){return this.wrapper.data("ezalign")===e},setWidgetContent:function(e){for(var t=this.getEzContentElement(),n=t.getFirst(),i=void 0;n;)i=n.getNext(),n.remove(),n=i;return e instanceof CKEDITOR.dom.node?t.append(e):t.appendHtml(e),this},setConfig:function(e,t){var n=this.getValueElement(e);return n||(n=new CKEDITOR.dom.element("span"),n.data("ezelement","ezvalue"),n.data("ezvalue-key",e),this.getEzConfigElement().append(n)),n.setText(t),window.clearTimeout(this.setConfigFireEditorInteractionTimeout),this.setConfigFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"configUpdated"),50),this},setWidgetAttributes:function(e){for(var t=this.getEzAttributesElement(),n=t.getFirst(),i=void 0;n;)i=n.getNext(),n.remove(),n=i;return e instanceof CKEDITOR.dom.node?t.append(e):t.appendHtml(e),this},getConfig:function(e){var t=this.getValueElement(e);return t?t.getText():""},clearConfig:function(){for(var e=this.getEzConfigElement();e.firstChild;)e.removeChild(e.firstChild);window.clearTimeout(this.clearConfigFireEditorInteractionTimeout),this.clearConfigFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"configCleared"),50)},getValueElement:function(e){return this.getEzConfigElement().findOne('[data-ezelement="ezvalue"][data-ezvalue-key="'+e+'"]')},getEzConfigElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezconfig"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("span"),e.data("ezelement","ezconfig"),this.element.append(e)),e},getEzContentElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezcontent"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.data("ezelement","ezcontent"),this.element.append(e)),e},getEzAttributesElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezattributes"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.data("ezelement","ezattributes"),this.element.append(e,!0)),e},getHeader:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return e.classList.contains("ez-custom-tag__header")});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.addClass("ez-custom-tag__header"),this.element.append(e,!0)),e},fireEditorInteraction:function(e){var n=this.getWrapperRegion(),i=e.name||e,r={editor:t,target:this.element.$,name:"widget"+i,pageX:n.left,pageY:n.top+n.height};t.focus(),this.focus(),t.fire("editorInteraction",{nativeEvent:r,selectionData:{element:this.element,region:n}})},moveAfter:function(e){this.wrapper.insertAfter(e),this.fireEditorInteraction("moveAfter")},moveBefore:function(e){this.wrapper.insertBefore(e),this.fireEditorInteraction("moveBefore")},getWrapperRegion:function(){var e=this.wrapper.getWindow().getScrollPosition(),t=this.wrapper.getClientRect();return t.top+=e.y,t.bottom+=e.y,t.left+=e.x,t.right+=e.x,t.direction=CKEDITOR.SELECTION_TOP_TO_BOTTOM,t}})}})}(window)}}).default}); +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ezPluginCustomTag=t():(e.eZ=e.eZ||{},e.eZ.ezAlloyEditor=e.eZ.ezAlloyEditor||{},e.eZ.ezAlloyEditor.ezPluginCustomTag=t())}("undefined"!=typeof self?self:this,function(){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=64)}({64:function(e,t,n){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t
{content}
',requiredContent:"div",editables:{content:{selector:'[data-ezelement="ezcontent"]'}},setNameFireEditorInteractionTimeout:null,setAlignmentFireEditorInteractionTimeout:null,unsetAlignmentFireEditorInteractionTimeout:null,setConfigFireEditorInteractionTimeout:null,clearConfigFireEditorInteractionTimeout:null,upcast:function(e){return"div"===e.name&&"eztemplate"===e.attributes["data-ezelement"]&&!e.attributes["data-eztype"]},insert:function(){var e,n=CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),i=t.widgets.wrapElement(n,this.name),r=new CKEDITOR.dom.documentFragment(i.getDocument());r.append(i),t.widgets.initOn(n,this.name),t.eZ.appendElement(i),e=t.widgets.getByElement(i),e.ready=!0,e.fire("ready"),e.focus()},edit:function(){this.insert()},init:function(){this.on("focus",this.fireEditorInteraction),this.syncAlignment(),this.renderAttributes(),this.renderHeader(),this.getEzContentElement(),this.getEzConfigElement(),this.cancelEditEvents(),this.toggleState({currentTarget:{dataset:{target:"attributes"}}})},clearNode:function(e){for(var t=e.getFirst(),n=void 0;t;)n=t.getNext(),t.remove(),t=n},renderHeader:function(){var t=e.eZ.adminUiConfig.richTextCustomTags[this.getName()];if(t){var n=this.getHeader(),i='\n
\n '+t.label+'\n
\n
\n \n \n
\n ';this.clearNode(n),n.appendHtml(i),this.attachButtonsListeners()}},attachButtonsListeners:function(){var e=this,t=this.getHeader();[t.findOne(".ez-custom-tag__header-btn--attributes"),t.findOne(".ez-custom-tag__header-btn--content")].forEach(function(t){return t.$.addEventListener("click",e.toggleState.bind(e),!1)})},toggleState:function(e){var t=this,n=e.currentTarget.dataset.target,i={attributes:"ez-custom-tag--attributes-visible",content:"ez-custom-tag--content-visible"};Object.entries(i).forEach(function(e){var i=r(e,2),o=i[0],a=i[1];return t.element.$.classList.toggle(a,o===n)})},renderAttributes:function(){var t=this,n=e.eZ.adminUiConfig.richTextCustomTags[this.getName()];if(n){var i=Object.keys(n.attributes).reduce(function(e,i){var r=t.getConfig(i);return e+"

"+n.attributes[i].label+": "+r+"

"},"");this.setWidgetAttributes(i)}},setName:function(e){return this.element.data("ezname",e),window.clearTimeout(this.setNameFireEditorInteractionTimeout),this.setNameFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"nameUpdated"),50),this},getName:function(){return this.element.data("ezname")},cancelEditEvents:function(){var e=function(e){return e.cancel()};this.on("doubleclick",e,null,null,5),this.on("key",e,null,null,5)},syncAlignment:function(){var e=this.element.data("ezalign");e?this.setAlignment(e):this.unsetAlignment()},setAlignment:function(e){this.wrapper.data("ezalign",e),this.element.data("ezalign",e),window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout),this.setAlignmentFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"aligmentUpdated"),50)},unsetAlignment:function(){this.wrapper.data("ezalign",!1),this.element.data("ezalign",!1),window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout),this.unsetAlignmentFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"aligmentRemoved"),50)},isAligned:function(e){return this.wrapper.data("ezalign")===e},setWidgetContent:function(e){for(var t=this.getEzContentElement(),n=t.getFirst(),i=void 0;n;)i=n.getNext(),n.remove(),n=i;return e instanceof CKEDITOR.dom.node?t.append(e):t.appendHtml(e),this},setConfig:function(e,t){var n=this.getValueElement(e);return n||(n=new CKEDITOR.dom.element("span"),n.data("ezelement","ezvalue"),n.data("ezvalue-key",e),this.getEzConfigElement().append(n)),n.setText(t),window.clearTimeout(this.setConfigFireEditorInteractionTimeout),this.setConfigFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"configUpdated"),50),this},setWidgetAttributes:function(e){for(var t=this.getEzAttributesElement(),n=t.getFirst(),i=void 0;n;)i=n.getNext(),n.remove(),n=i;return e instanceof CKEDITOR.dom.node?t.append(e):t.appendHtml(e),this},getConfig:function(e){var t=this.getValueElement(e);return t?t.getText():""},clearConfig:function(){for(var e=this.getEzConfigElement();e.firstChild;)e.removeChild(e.firstChild);window.clearTimeout(this.clearConfigFireEditorInteractionTimeout),this.clearConfigFireEditorInteractionTimeout=window.setTimeout(this.fireEditorInteraction.bind(this,"configCleared"),50)},getValueElement:function(e){return this.getEzConfigElement().findOne('[data-ezelement="ezvalue"][data-ezvalue-key="'+e+'"]')},getEzConfigElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezconfig"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("span"),e.data("ezelement","ezconfig"),this.element.append(e)),e},getEzContentElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezcontent"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.data("ezelement","ezcontent"),this.element.append(e)),e},getEzAttributesElement:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return"ezattributes"===e.dataset.ezelement});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.data("ezelement","ezattributes"),this.element.append(e,!0)),e},getHeader:function(){var e=[].concat(i(this.element.getChildren().$)).find(function(e){return e.classList.contains("ez-custom-tag__header")});return e?e=new CKEDITOR.dom.element(e):(e=new CKEDITOR.dom.element("div"),e.addClass("ez-custom-tag__header"),this.element.append(e,!0)),e},fireEditorInteraction:function(e){var n=this.getWrapperRegion(),i=e.name||e,r={editor:t,target:this.element.$,name:"widget"+i,pageX:n.left,pageY:n.top+n.height};t.focus(),this.focus(),t.fire("editorInteraction",{nativeEvent:r,selectionData:{element:this.element,region:n}})},moveAfter:function(e){this.wrapper.insertAfter(e),this.fireEditorInteraction("moveAfter")},moveBefore:function(e){this.wrapper.insertBefore(e),this.fireEditorInteraction("moveBefore")},getWrapperRegion:function(){var e=this.wrapper.getWindow().getScrollPosition(),t=this.wrapper.getClientRect();return t.top+=e.y,t.bottom+=e.y,t.left+=e.x,t.right+=e.x,t.direction=CKEDITOR.SELECTION_TOP_TO_BOTTOM,t}})}})}(window)}}).default}); //# sourceMappingURL=ezPluginCustomTag.js.map \ No newline at end of file diff --git a/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js.map b/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js.map index c7013a66f3..40cbb53a73 100644 --- a/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js.map +++ b/src/bundle/Resources/public/js/alloyeditor/dist/ezPluginCustomTag.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///ezPluginCustomTag.js","webpack:///webpack/bootstrap f67c4cccd58daf124d17","webpack:///./src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","64","_toConsumableArray","arr","Array","isArray","arr2","length","from","_slicedToArray","sliceIterator","_arr","_n","_d","_e","undefined","_s","_i","Symbol","iterator","next","done","push","value","err","TypeError","global","CKEDITOR","plugins","add","requires","init","editor","widgets","defaults","content","draggable","template","requiredContent","editables","selector","upcast","element","attributes","insert","instance","dom","createFromHtml","output","wrapper","wrapElement","temp","documentFragment","getDocument","append","initOn","eZ","appendElement","getByElement","ready","fire","focus","edit","on","fireEditorInteraction","syncAlignment","renderAttributes","renderHeader","getEzContentElement","getEzConfigElement","cancelEditEvents","toggleState","currentTarget","dataset","target","clearNode","node","getFirst","getNext","remove","customTagConfig","adminUiConfig","richTextCustomTags","getName","header","getHeader","label","appendHtml","attachButtonsListeners","_this","findOne","forEach","btn","$","addEventListener","bind","event","_this2","visibleElement","classes","entries","_ref","_ref2","key","className","classList","toggle","_this3","keys","reduce","total","attr","getConfig","setWidgetAttributes","setName","data","window","clearTimeout","setNameFireEditorInteractionTimeout","setTimeout","cancel","align","setAlignment","unsetAlignment","type","setAlignmentFireEditorInteractionTimeout","unsetAlignmentFireEditorInteractionTimeout","isAligned","setWidgetContent","ezContent","setConfig","valueElement","getValueElement","setText","setConfigFireEditorInteractionTimeout","ezAttributes","getEzAttributesElement","getText","clearConfig","config","firstChild","removeChild","clearConfigFireEditorInteractionTimeout","concat","getChildren","find","child","ezelement","contains","addClass","evt","wrapperRegion","getWrapperRegion","pageX","left","pageY","top","height","nativeEvent","selectionData","region","moveAfter","insertAfter","moveBefore","insertBefore","scroll","getWindow","getScrollPosition","getClientRect","y","bottom","x","right","direction","SELECTION_TOP_TO_BOTTOM"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,kBAAAD,KAEAD,EAAA,GAAAA,EAAA,OAA+BA,EAAA,iBAAAA,EAAA,qBAAiEA,EAAA,mCAAAC,MAC/F,mBAAAK,WAAAC,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAR,OAGA,IAAAC,GAAAQ,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAX,WAUA,OANAM,GAAAE,GAAAI,KAAAX,EAAAD,QAAAC,IAAAD,QAAAO,GAGAN,EAAAU,GAAA,EAGAV,EAAAD,QAvBA,GAAAS,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAf,EAAAgB,EAAAC,GACAV,EAAAW,EAAAlB,EAAAgB,IACAG,OAAAC,eAAApB,EAAAgB,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB,EAAA,SAAAvB,GACA,GAAAgB,GAAAhB,KAAAwB,WACA,WAA2B,MAAAxB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAM,GAAAQ,EAAAE,EAAA,IAAAA,GACAA,G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AOS,EAAOI,EACrBT,EAAOU,QAAUL,EAAOI,EACxBT,EAAON,MAAQW,EAAOM,EACtBX,EAAOY,OAASP,EAAOM,EACvBX,EAAOa,UAAYlJ,SAASmJ,wBAErBd,SAKxB5C,WF6FkB","file":"ezPluginCustomTag.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[\"ezPluginCustomTag\"] = factory();\n\telse\n\t\troot[\"eZ\"] = root[\"eZ\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"] = root[\"eZ\"][\"ezAlloyEditor\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"][\"ezPluginCustomTag\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(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[\"ezPluginCustomTag\"] = factory();\n\telse\n\t\troot[\"eZ\"] = root[\"eZ\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"] = root[\"eZ\"][\"ezAlloyEditor\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"][\"ezPluginCustomTag\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \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 = 64);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 64:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _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); } }\n\n(function (global) {\n var DATA_ALIGNMENT_ATTR = 'ezalign';\n\n if (CKEDITOR.plugins.get('ezcustomtag')) {\n return;\n }\n\n /**\n * CKEditor plugin to configure the widget plugin so that it recognizes the\n * `div[data-ezelement=\"embed\"]` elements as widget.\n *\n * @class ezembed\n * @namespace CKEDITOR.plugins\n * @constructor\n */\n CKEDITOR.plugins.add('ezcustomtag', {\n requires: 'widget,ezaddcontent',\n\n init: function init(editor) {\n editor.widgets.add('ezcustomtag', {\n defaults: {\n name: 'customtag',\n content: ''\n },\n draggable: false,\n template: '
{content}
',\n requiredContent: 'div',\n editables: {\n content: {\n selector: '[data-ezelement=\"ezcontent\"]'\n }\n },\n\n upcast: function upcast(element) {\n return element.name === 'div' && element.attributes['data-ezelement'] === 'eztemplate' && !element.attributes['data-eztype'];\n },\n\n /**\n * Insert an `ezembed` widget in the editor. It overrides the\n * default implementation to make sure that in the case where an\n * embed widget is focused, a new one is added after it.\n *\n * @method insert\n */\n insert: function insert() {\n var element = CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),\n wrapper = editor.widgets.wrapElement(element, this.name),\n temp = new CKEDITOR.dom.documentFragment(wrapper.getDocument()),\n instance;\n\n temp.append(wrapper);\n editor.widgets.initOn(element, this.name);\n editor.eZ.appendElement(wrapper);\n\n instance = editor.widgets.getByElement(wrapper);\n instance.ready = true;\n instance.fire('ready');\n instance.focus();\n },\n\n /**\n * It's not possible to *edit* an embed widget in AlloyEditor,\n * so `edit` directly calls `insert` instead. This is needed\n * because by default, the CKEditor engine calls this method\n * when an embed widget has the focus and the `ezcustomtag` command\n * is executed. In AlloyEditor, we want to insert a new widget,\n * not to `edit` the focused widget as the editing process is\n * provided by the style toolbar.\n *\n * @method edit\n */\n edit: function edit() {\n this.insert();\n },\n\n init: function init() {\n this.on('focus', this.fireEditorInteraction);\n this.syncAlignment();\n this.renderAttributes();\n this.renderHeader();\n this.getEzContentElement();\n this.getEzConfigElement();\n this.cancelEditEvents();\n this.toggleState({\n currentTarget: {\n dataset: {\n target: 'attributes'\n }\n }\n });\n },\n\n /**\n * Clear the node.\n *\n * @method clearNode\n * @param {Element} node\n */\n clearNode: function clearNode(node) {\n var element = node.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n },\n\n\n /**\n * Renders the custom tag header.\n *\n * @method renderHeader\n */\n renderHeader: function renderHeader() {\n var customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n\n var header = this.getHeader();\n var template = '\\n
\\n ' + customTagConfig.label + '\\n
\\n
\\n \\n \\n
\\n ';\n\n this.clearNode(header);\n\n header.appendHtml(template);\n\n this.attachButtonsListeners();\n },\n\n /**\n * Attaches event listeners to toggle state buttons.\n *\n * @method attachButtonsListeners\n */\n attachButtonsListeners: function attachButtonsListeners() {\n var _this = this;\n\n var header = this.getHeader();\n var attributesBtn = header.findOne('.ez-custom-tag__header-btn--attributes');\n var contentBtn = header.findOne('.ez-custom-tag__header-btn--content');\n\n [attributesBtn, contentBtn].forEach(function (btn) {\n return btn.$.addEventListener('click', _this.toggleState.bind(_this), false);\n });\n },\n\n /**\n * Toggles the custom tag state.\n *\n * @method toggleState\n * @param {Event} event\n */\n toggleState: function toggleState(event) {\n var _this2 = this;\n\n var visibleElement = event.currentTarget.dataset.target;\n var classes = {\n attributes: 'ez-custom-tag--attributes-visible',\n content: 'ez-custom-tag--content-visible'\n };\n\n Object.entries(classes).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n className = _ref2[1];\n\n return _this2.element.$.classList.toggle(className, key === visibleElement);\n });\n },\n\n /**\n * Renders the custom tag attributes.\n *\n * @method renderAttributes\n */\n renderAttributes: function renderAttributes() {\n var _this3 = this;\n\n var customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n var attributes = Object.keys(customTagConfig.attributes).reduce(function (total, attr) {\n var value = _this3.getConfig(attr);\n\n return total + '

' + customTagConfig.attributes[attr].label + ': ' + value + '

';\n }, '');\n\n this.setWidgetAttributes(attributes);\n },\n\n /**\n * Sets the `name` of the custom tag.\n *\n * @method setName\n * @param {String} name\n * @return {CKEDITOR.plugins.widget}\n */\n setName: function setName(name) {\n this.element.data('ezname', name);\n window.clearTimeout(this.setNameFireEditorInteractionTimeout);\n this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'nameUpdated'), 50);\n\n return this;\n },\n\n /**\n * Gets the `name` of the custom tag.\n *\n * @method getName\n * @return {CKEDITOR.plugins.widget}\n */\n getName: function getName() {\n return this.element.data('ezname');\n },\n\n /**\n * Cancels the widget events that trigger the `edit` event as\n * an embed widget can not be edited in a *CKEditor way*.\n *\n * @method cancelEditEvents\n */\n cancelEditEvents: function cancelEditEvents() {\n var cancel = function cancel(event) {\n return event.cancel();\n };\n\n this.on('doubleclick', cancel, null, null, 5);\n this.on('key', cancel, null, null, 5);\n },\n\n /**\n * Initializes the alignment on the widget wrapper if the widget\n * is aligned.\n *\n * @method syncAlignment\n */\n syncAlignment: function syncAlignment() {\n var align = this.element.data(DATA_ALIGNMENT_ATTR);\n\n if (align) {\n this.setAlignment(align);\n } else {\n this.unsetAlignment();\n }\n },\n\n /**\n * Sets the alignment of the embed widget to `type` and fires\n * the corresponding `editorInteraction` event.\n *\n * @method setAlignment\n * @param {String} type\n */\n setAlignment: function setAlignment(type) {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, type);\n this.element.data(DATA_ALIGNMENT_ATTR, type);\n window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout);\n this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'aligmentUpdated'), 50);\n },\n\n /**\n * Removes the alignment of the widget and fires the\n * corresponding `editorInteraction` event.\n *\n * @method unsetAlignment\n */\n unsetAlignment: function unsetAlignment() {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, false);\n this.element.data(DATA_ALIGNMENT_ATTR, false);\n window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout);\n this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'aligmentRemoved'), 50);\n },\n\n /**\n * Checks whether the embed is aligned with `type` alignment.\n *\n * @method isAligned\n * @param {String} type\n * @return {Boolean}\n */\n isAligned: function isAligned(type) {\n return this.wrapper.data(DATA_ALIGNMENT_ATTR) === type;\n },\n\n /**\n * Sets the widget content.\n *\n * @method setWidgetContent\n * @param {String|CKEDITOR.dom.node} content\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetContent: function setWidgetContent(content) {\n var ezContent = this.getEzContentElement();\n var element = ezContent.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (content instanceof CKEDITOR.dom.node) {\n ezContent.append(content);\n } else {\n ezContent.appendHtml(content);\n }\n\n return this;\n },\n\n /**\n * Sets a config value under the `key` for the custom tag.\n *\n * @method setConfig\n * @param {String} key\n * @param {String} value\n * @return {CKEDITOR.plugins.widget}\n */\n setConfig: function setConfig(key, value) {\n var valueElement = this.getValueElement(key);\n\n if (!valueElement) {\n valueElement = new CKEDITOR.dom.element('span');\n valueElement.data('ezelement', 'ezvalue');\n valueElement.data('ezvalue-key', key);\n this.getEzConfigElement().append(valueElement);\n }\n\n valueElement.setText(value);\n window.clearTimeout(this.setConfigFireEditorInteractionTimeout);\n this.setConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'configUpdated'), 50);\n\n return this;\n },\n\n /**\n * Sets the widget attributes.\n *\n * @method setWidgetAttributes\n * @param {String|CKEDITOR.dom.node} attributes\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetAttributes: function setWidgetAttributes(attributes) {\n var ezAttributes = this.getEzAttributesElement();\n var element = ezAttributes.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (attributes instanceof CKEDITOR.dom.node) {\n ezAttributes.append(attributes);\n } else {\n ezAttributes.appendHtml(attributes);\n }\n\n return this;\n },\n\n /**\n * Returns the config value for the `key` or empty string if the\n * config key is not found.\n *\n * @method getConfig\n * @return {String}\n */\n getConfig: function getConfig(key) {\n var valueElement = this.getValueElement(key);\n\n return valueElement ? valueElement.getText() : '';\n },\n\n clearConfig: function clearConfig() {\n var config = this.getEzConfigElement();\n\n while (config.firstChild) {\n config.removeChild(config.firstChild);\n }\n\n window.clearTimeout(this.clearConfigFireEditorInteractionTimeout);\n this.clearConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'configCleared'), 50);\n },\n\n /**\n * Returns the Element holding the config under `key`\n *\n * @method getValueElement\n * @param {String} key\n * @return {CKEDITOR.dom.element}\n */\n getValueElement: function getValueElement(key) {\n return this.getEzConfigElement().findOne('[data-ezelement=\"ezvalue\"][data-ezvalue-key=\"' + key + '\"]');\n },\n\n /**\n * Returns the element used as a container the config values. if\n * it does not exist, it is created.\n *\n * @method getEzConfigElement\n * @return {CKEDITOR.dom.element}\n */\n getEzConfigElement: function getEzConfigElement() {\n var config = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezconfig';\n });\n\n if (!config) {\n config = new CKEDITOR.dom.element('span');\n config.data('ezelement', 'ezconfig');\n this.element.append(config);\n } else {\n config = new CKEDITOR.dom.element(config);\n }\n\n return config;\n },\n\n /**\n * Returns the element used as a container the content values. if\n * it does not exist, it is created.\n *\n * @method getEzContentElement\n * @return {CKEDITOR.dom.element}\n */\n getEzContentElement: function getEzContentElement() {\n var content = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezcontent';\n });\n\n if (!content) {\n content = new CKEDITOR.dom.element('div');\n content.data('ezelement', 'ezcontent');\n this.element.append(content);\n } else {\n content = new CKEDITOR.dom.element(content);\n }\n\n return content;\n },\n\n /**\n * Returns the element used as a container the attributes values. if\n * it does not exist, it is created.\n *\n * @method getEzAttributesElement\n * @return {CKEDITOR.dom.element}\n */\n getEzAttributesElement: function getEzAttributesElement() {\n var attributes = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezattributes';\n });\n\n if (!attributes) {\n attributes = new CKEDITOR.dom.element('div');\n attributes.data('ezelement', 'ezattributes');\n this.element.append(attributes, true);\n } else {\n attributes = new CKEDITOR.dom.element(attributes);\n }\n\n return attributes;\n },\n\n /**\n * Returns the element used as a container the header. if\n * it does not exist, it is created.\n *\n * @method getHeader\n * @return {CKEDITOR.dom.element}\n */\n getHeader: function getHeader() {\n var header = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.classList.contains('ez-custom-tag__header');\n });\n\n if (!header) {\n header = new CKEDITOR.dom.element('div');\n header.addClass('ez-custom-tag__header');\n this.element.append(header, true);\n } else {\n header = new CKEDITOR.dom.element(header);\n }\n\n return header;\n },\n\n /**\n * Fires the editorInteraction event so that AlloyEditor editor\n * UI remains visible and is updated. This method also computes\n * `selectionData.region` and the `pageX` and `pageY` properties\n * so that the add toolbar is correctly positioned on the\n * widget.\n *\n * @method fireEditorInteraction\n * @param {Object|String} evt this initial event info object or\n * the event name for which the `editorInteraction` is fired.\n */\n fireEditorInteraction: function fireEditorInteraction(evt) {\n var wrapperRegion = this.getWrapperRegion();\n var name = evt.name || evt;\n var event = {\n editor: editor,\n target: this.element.$,\n name: 'widget' + name,\n pageX: wrapperRegion.left,\n pageY: wrapperRegion.top + wrapperRegion.height\n };\n\n editor.focus();\n this.focus();\n\n editor.fire('editorInteraction', {\n nativeEvent: event,\n selectionData: {\n element: this.element,\n region: wrapperRegion\n }\n });\n },\n\n /**\n * Moves the widget after the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveAfter: function moveAfter(element) {\n this.wrapper.insertAfter(element);\n this.fireEditorInteraction('moveAfter');\n },\n\n /**\n * Moves the widget before the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveBefore: function moveBefore(element) {\n this.wrapper.insertBefore(element);\n this.fireEditorInteraction('moveBefore');\n },\n\n /**\n * Returns the wrapper element region.\n *\n * @method getWrapperRegion\n * @private\n * @return {Object}\n */\n getWrapperRegion: function getWrapperRegion() {\n var scroll = this.wrapper.getWindow().getScrollPosition();\n var region = this.wrapper.getClientRect();\n\n region.top += scroll.y;\n region.bottom += scroll.y;\n region.left += scroll.x;\n region.right += scroll.x;\n region.direction = CKEDITOR.SELECTION_TOP_TO_BOTTOM;\n\n return region;\n }\n });\n }\n });\n})(window);\n\n/***/ })\n\n/******/ })[\"default\"];\n});\n\n\n// WEBPACK FOOTER //\n// ezPluginCustomTag.js"," \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 = 64);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f67c4cccd58daf124d17","(function(global) {\n const DATA_ALIGNMENT_ATTR = 'ezalign';\n\n if (CKEDITOR.plugins.get('ezcustomtag')) {\n return;\n }\n\n /**\n * CKEditor plugin to configure the widget plugin so that it recognizes the\n * `div[data-ezelement=\"embed\"]` elements as widget.\n *\n * @class ezembed\n * @namespace CKEDITOR.plugins\n * @constructor\n */\n CKEDITOR.plugins.add('ezcustomtag', {\n requires: 'widget,ezaddcontent',\n\n init: function(editor) {\n editor.widgets.add('ezcustomtag', {\n defaults: {\n name: 'customtag',\n content: '',\n },\n draggable: false,\n template:\n '
{content}
',\n requiredContent: 'div',\n editables: {\n content: {\n selector: '[data-ezelement=\"ezcontent\"]',\n },\n },\n\n upcast: (element) => {\n return (\n element.name === 'div' &&\n element.attributes['data-ezelement'] === 'eztemplate' &&\n !element.attributes['data-eztype']\n );\n },\n\n /**\n * Insert an `ezembed` widget in the editor. It overrides the\n * default implementation to make sure that in the case where an\n * embed widget is focused, a new one is added after it.\n *\n * @method insert\n */\n insert: function() {\n var element = CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),\n wrapper = editor.widgets.wrapElement(element, this.name),\n temp = new CKEDITOR.dom.documentFragment(wrapper.getDocument()),\n instance;\n\n temp.append(wrapper);\n editor.widgets.initOn(element, this.name);\n editor.eZ.appendElement(wrapper);\n\n instance = editor.widgets.getByElement(wrapper);\n instance.ready = true;\n instance.fire('ready');\n instance.focus();\n },\n\n /**\n * It's not possible to *edit* an embed widget in AlloyEditor,\n * so `edit` directly calls `insert` instead. This is needed\n * because by default, the CKEditor engine calls this method\n * when an embed widget has the focus and the `ezcustomtag` command\n * is executed. In AlloyEditor, we want to insert a new widget,\n * not to `edit` the focused widget as the editing process is\n * provided by the style toolbar.\n *\n * @method edit\n */\n edit: function() {\n this.insert();\n },\n\n init: function() {\n this.on('focus', this.fireEditorInteraction);\n this.syncAlignment();\n this.renderAttributes();\n this.renderHeader();\n this.getEzContentElement();\n this.getEzConfigElement();\n this.cancelEditEvents();\n this.toggleState({\n currentTarget: {\n dataset: {\n target: 'attributes',\n },\n },\n });\n },\n\n /**\n * Clear the node.\n *\n * @method clearNode\n * @param {Element} node\n */\n clearNode(node) {\n let element = node.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n },\n\n /**\n * Renders the custom tag header.\n *\n * @method renderHeader\n */\n renderHeader: function() {\n const customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n\n const header = this.getHeader();\n const template = `\n
\n ${customTagConfig.label}\n
\n
\n \n \n
\n `;\n\n this.clearNode(header);\n\n header.appendHtml(template);\n\n this.attachButtonsListeners();\n },\n\n /**\n * Attaches event listeners to toggle state buttons.\n *\n * @method attachButtonsListeners\n */\n attachButtonsListeners: function() {\n const header = this.getHeader();\n const attributesBtn = header.findOne('.ez-custom-tag__header-btn--attributes');\n const contentBtn = header.findOne('.ez-custom-tag__header-btn--content');\n\n [attributesBtn, contentBtn].forEach((btn) => btn.$.addEventListener('click', this.toggleState.bind(this), false));\n },\n\n /**\n * Toggles the custom tag state.\n *\n * @method toggleState\n * @param {Event} event\n */\n toggleState: function(event) {\n const visibleElement = event.currentTarget.dataset.target;\n const classes = {\n attributes: 'ez-custom-tag--attributes-visible',\n content: 'ez-custom-tag--content-visible',\n };\n\n Object.entries(classes).forEach(([key, className]) =>\n this.element.$.classList.toggle(className, key === visibleElement)\n );\n },\n\n /**\n * Renders the custom tag attributes.\n *\n * @method renderAttributes\n */\n renderAttributes: function() {\n const customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n const attributes = Object.keys(customTagConfig.attributes).reduce((total, attr) => {\n const value = this.getConfig(attr);\n\n return `${total}

${customTagConfig.attributes[attr].label}: ${value}

`;\n }, '');\n\n this.setWidgetAttributes(attributes);\n },\n\n /**\n * Sets the `name` of the custom tag.\n *\n * @method setName\n * @param {String} name\n * @return {CKEDITOR.plugins.widget}\n */\n setName: function(name) {\n this.element.data('ezname', name);\n window.clearTimeout(this.setNameFireEditorInteractionTimeout);\n this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'nameUpdated'), 50);\n\n return this;\n },\n\n /**\n * Gets the `name` of the custom tag.\n *\n * @method getName\n * @return {CKEDITOR.plugins.widget}\n */\n getName: function() {\n return this.element.data('ezname');\n },\n\n /**\n * Cancels the widget events that trigger the `edit` event as\n * an embed widget can not be edited in a *CKEditor way*.\n *\n * @method cancelEditEvents\n */\n cancelEditEvents: function() {\n const cancel = (event) => event.cancel();\n\n this.on('doubleclick', cancel, null, null, 5);\n this.on('key', cancel, null, null, 5);\n },\n\n /**\n * Initializes the alignment on the widget wrapper if the widget\n * is aligned.\n *\n * @method syncAlignment\n */\n syncAlignment: function() {\n const align = this.element.data(DATA_ALIGNMENT_ATTR);\n\n if (align) {\n this.setAlignment(align);\n } else {\n this.unsetAlignment();\n }\n },\n\n /**\n * Sets the alignment of the embed widget to `type` and fires\n * the corresponding `editorInteraction` event.\n *\n * @method setAlignment\n * @param {String} type\n */\n setAlignment: function(type) {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, type);\n this.element.data(DATA_ALIGNMENT_ATTR, type);\n window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout);\n this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'aligmentUpdated'), 50);\n },\n\n /**\n * Removes the alignment of the widget and fires the\n * corresponding `editorInteraction` event.\n *\n * @method unsetAlignment\n */\n unsetAlignment: function() {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, false);\n this.element.data(DATA_ALIGNMENT_ATTR, false);\n window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout);\n this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'aligmentRemoved'), 50);\n },\n\n /**\n * Checks whether the embed is aligned with `type` alignment.\n *\n * @method isAligned\n * @param {String} type\n * @return {Boolean}\n */\n isAligned: function(type) {\n return this.wrapper.data(DATA_ALIGNMENT_ATTR) === type;\n },\n\n /**\n * Sets the widget content.\n *\n * @method setWidgetContent\n * @param {String|CKEDITOR.dom.node} content\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetContent: function(content) {\n const ezContent = this.getEzContentElement();\n let element = ezContent.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (content instanceof CKEDITOR.dom.node) {\n ezContent.append(content);\n } else {\n ezContent.appendHtml(content);\n }\n\n return this;\n },\n\n /**\n * Sets a config value under the `key` for the custom tag.\n *\n * @method setConfig\n * @param {String} key\n * @param {String} value\n * @return {CKEDITOR.plugins.widget}\n */\n setConfig: function(key, value) {\n let valueElement = this.getValueElement(key);\n\n if (!valueElement) {\n valueElement = new CKEDITOR.dom.element('span');\n valueElement.data('ezelement', 'ezvalue');\n valueElement.data('ezvalue-key', key);\n this.getEzConfigElement().append(valueElement);\n }\n\n valueElement.setText(value);\n window.clearTimeout(this.setConfigFireEditorInteractionTimeout);\n this.setConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'configUpdated'), 50);\n\n return this;\n },\n\n /**\n * Sets the widget attributes.\n *\n * @method setWidgetAttributes\n * @param {String|CKEDITOR.dom.node} attributes\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetAttributes: function(attributes) {\n const ezAttributes = this.getEzAttributesElement();\n let element = ezAttributes.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (attributes instanceof CKEDITOR.dom.node) {\n ezAttributes.append(attributes);\n } else {\n ezAttributes.appendHtml(attributes);\n }\n\n return this;\n },\n\n /**\n * Returns the config value for the `key` or empty string if the\n * config key is not found.\n *\n * @method getConfig\n * @return {String}\n */\n getConfig: function(key) {\n const valueElement = this.getValueElement(key);\n\n return valueElement ? valueElement.getText() : '';\n },\n\n clearConfig: function() {\n const config = this.getEzConfigElement();\n\n while (config.firstChild) {\n config.removeChild(config.firstChild);\n }\n\n window.clearTimeout(this.clearConfigFireEditorInteractionTimeout);\n this.clearConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'configCleared'), 50);\n },\n\n /**\n * Returns the Element holding the config under `key`\n *\n * @method getValueElement\n * @param {String} key\n * @return {CKEDITOR.dom.element}\n */\n getValueElement: function(key) {\n return this.getEzConfigElement().findOne('[data-ezelement=\"ezvalue\"][data-ezvalue-key=\"' + key + '\"]');\n },\n\n /**\n * Returns the element used as a container the config values. if\n * it does not exist, it is created.\n *\n * @method getEzConfigElement\n * @return {CKEDITOR.dom.element}\n */\n getEzConfigElement: function() {\n let config = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezconfig');\n\n if (!config) {\n config = new CKEDITOR.dom.element('span');\n config.data('ezelement', 'ezconfig');\n this.element.append(config);\n } else {\n config = new CKEDITOR.dom.element(config);\n }\n\n return config;\n },\n\n /**\n * Returns the element used as a container the content values. if\n * it does not exist, it is created.\n *\n * @method getEzContentElement\n * @return {CKEDITOR.dom.element}\n */\n getEzContentElement: function() {\n let content = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezcontent');\n\n if (!content) {\n content = new CKEDITOR.dom.element('div');\n content.data('ezelement', 'ezcontent');\n this.element.append(content);\n } else {\n content = new CKEDITOR.dom.element(content);\n }\n\n return content;\n },\n\n /**\n * Returns the element used as a container the attributes values. if\n * it does not exist, it is created.\n *\n * @method getEzAttributesElement\n * @return {CKEDITOR.dom.element}\n */\n getEzAttributesElement: function() {\n let attributes = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezattributes');\n\n if (!attributes) {\n attributes = new CKEDITOR.dom.element('div');\n attributes.data('ezelement', 'ezattributes');\n this.element.append(attributes, true);\n } else {\n attributes = new CKEDITOR.dom.element(attributes);\n }\n\n return attributes;\n },\n\n /**\n * Returns the element used as a container the header. if\n * it does not exist, it is created.\n *\n * @method getHeader\n * @return {CKEDITOR.dom.element}\n */\n getHeader: function() {\n let header = [...this.element.getChildren().$].find((child) => child.classList.contains('ez-custom-tag__header'));\n\n if (!header) {\n header = new CKEDITOR.dom.element('div');\n header.addClass('ez-custom-tag__header');\n this.element.append(header, true);\n } else {\n header = new CKEDITOR.dom.element(header);\n }\n\n return header;\n },\n\n /**\n * Fires the editorInteraction event so that AlloyEditor editor\n * UI remains visible and is updated. This method also computes\n * `selectionData.region` and the `pageX` and `pageY` properties\n * so that the add toolbar is correctly positioned on the\n * widget.\n *\n * @method fireEditorInteraction\n * @param {Object|String} evt this initial event info object or\n * the event name for which the `editorInteraction` is fired.\n */\n fireEditorInteraction: function(evt) {\n const wrapperRegion = this.getWrapperRegion();\n const name = evt.name || evt;\n const event = {\n editor: editor,\n target: this.element.$,\n name: 'widget' + name,\n pageX: wrapperRegion.left,\n pageY: wrapperRegion.top + wrapperRegion.height,\n };\n\n editor.focus();\n this.focus();\n\n editor.fire('editorInteraction', {\n nativeEvent: event,\n selectionData: {\n element: this.element,\n region: wrapperRegion,\n },\n });\n },\n\n /**\n * Moves the widget after the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveAfter: function(element) {\n this.wrapper.insertAfter(element);\n this.fireEditorInteraction('moveAfter');\n },\n\n /**\n * Moves the widget before the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveBefore: function(element) {\n this.wrapper.insertBefore(element);\n this.fireEditorInteraction('moveBefore');\n },\n\n /**\n * Returns the wrapper element region.\n *\n * @method getWrapperRegion\n * @private\n * @return {Object}\n */\n getWrapperRegion: function() {\n const scroll = this.wrapper.getWindow().getScrollPosition();\n const region = this.wrapper.getClientRect();\n\n region.top += scroll.y;\n region.bottom += scroll.y;\n region.left += scroll.x;\n region.right += scroll.x;\n region.direction = CKEDITOR.SELECTION_TOP_TO_BOTTOM;\n\n return region;\n },\n });\n },\n });\n})(window);\n\n\n\n// WEBPACK FOOTER //\n// ./src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///ezPluginCustomTag.js","webpack:///webpack/bootstrap 72cc588d59a9ae040ec8","webpack:///./src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js"],"names":["root","factory","exports","module","define","amd","self","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","64","_toConsumableArray","arr","Array","isArray","arr2","length","from","_slicedToArray","sliceIterator","_arr","_n","_d","_e","undefined","_s","_i","Symbol","iterator","next","done","push","value","err","TypeError","global","CKEDITOR","plugins","add","requires","init","editor","widgets","defaults","content","draggable","template","requiredContent","editables","selector","setNameFireEditorInteractionTimeout","setAlignmentFireEditorInteractionTimeout","unsetAlignmentFireEditorInteractionTimeout","setConfigFireEditorInteractionTimeout","clearConfigFireEditorInteractionTimeout","upcast","element","attributes","insert","instance","dom","createFromHtml","output","wrapper","wrapElement","temp","documentFragment","getDocument","append","initOn","eZ","appendElement","getByElement","ready","fire","focus","edit","on","fireEditorInteraction","syncAlignment","renderAttributes","renderHeader","getEzContentElement","getEzConfigElement","cancelEditEvents","toggleState","currentTarget","dataset","target","clearNode","node","getFirst","getNext","remove","customTagConfig","adminUiConfig","richTextCustomTags","getName","header","getHeader","label","appendHtml","attachButtonsListeners","_this","findOne","forEach","btn","$","addEventListener","bind","event","_this2","visibleElement","classes","entries","_ref","_ref2","key","className","classList","toggle","_this3","keys","reduce","total","attr","getConfig","setWidgetAttributes","setName","data","window","clearTimeout","setTimeout","cancel","align","setAlignment","unsetAlignment","type","isAligned","setWidgetContent","ezContent","setConfig","valueElement","getValueElement","setText","ezAttributes","getEzAttributesElement","getText","clearConfig","config","firstChild","removeChild","concat","getChildren","find","child","ezelement","contains","addClass","evt","wrapperRegion","getWrapperRegion","pageX","left","pageY","top","height","nativeEvent","selectionData","region","moveAfter","insertAfter","moveBefore","insertBefore","scroll","getWindow","getScrollPosition","getClientRect","y","bottom","x","right","direction","SELECTION_TOP_TO_BOTTOM"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,kBAAAD,KAEAD,EAAA,GAAAA,EAAA,OAA+BA,EAAA,iBAAAA,EAAA,qBAAi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AS,GAAI9D,UAASwB,IAAIJ,QAAQ,OAClC0C,EAAO4D,SAAS,yBAChB/K,KAAKyE,QAAQY,OAAO8B,GAAQ,IAKzBA,GAcXpB,sBAAuB,SAASiF,GAC5B,GAAMC,GAAgBjL,KAAKkL,mBACrBvK,EAAOqK,EAAIrK,MAAQqK,EACnBjD,GACFrE,OAAQA,EACR+C,OAAQzG,KAAKyE,QAAQmD,EACrBjH,KAAM,SAAWA,EACjBwK,MAAOF,EAAcG,KACrBC,MAAOJ,EAAcK,IAAML,EAAcM,OAG7C7H,GAAOkC,QACP5F,KAAK4F,QAELlC,EAAOiC,KAAK,qBACR6F,YAAazD,EACb0D,eACIhH,QAASzE,KAAKyE,QACdiH,OAAQT,MAapBU,UAAW,SAASlH,GAChBzE,KAAKgF,QAAQ4G,YAAYnH,GACzBzE,KAAK+F,sBAAsB,cAW/B8F,WAAY,SAASpH,GACjBzE,KAAKgF,QAAQ8G,aAAarH,GAC1BzE,KAAK+F,sBAAsB,eAU/BmF,iBAAkB,WACd,GAAMa,GAAS/L,KAAKgF,QAAQgH,YAAYC,oBAClCP,EAAS1L,KAAKgF,QAAQkH,eAQ5B,OANAR,GAAOJ,KAAOS,EAAOI,EACrBT,EAAOU,QAAUL,EAAOI,EACxBT,EAAON,MAAQW,EAAOM,EACtBX,EAAOY,OAASP,EAAOM,EACvBX,EAAOa,UAAYlJ,SAASmJ,wBAErBd,SAKxBvC,WFiFkB","file":"ezPluginCustomTag.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[\"ezPluginCustomTag\"] = factory();\n\telse\n\t\troot[\"eZ\"] = root[\"eZ\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"] = root[\"eZ\"][\"ezAlloyEditor\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"][\"ezPluginCustomTag\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(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[\"ezPluginCustomTag\"] = factory();\n\telse\n\t\troot[\"eZ\"] = root[\"eZ\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"] = root[\"eZ\"][\"ezAlloyEditor\"] || {}, root[\"eZ\"][\"ezAlloyEditor\"][\"ezPluginCustomTag\"] = factory();\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \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 = 64);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 64:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _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); } }\n\n(function (global) {\n var DATA_ALIGNMENT_ATTR = 'ezalign';\n\n if (CKEDITOR.plugins.get('ezcustomtag')) {\n return;\n }\n\n /**\n * CKEditor plugin to configure the widget plugin so that it recognizes the\n * `div[data-ezelement=\"embed\"]` elements as widget.\n *\n * @class ezembed\n * @namespace CKEDITOR.plugins\n * @constructor\n */\n CKEDITOR.plugins.add('ezcustomtag', {\n requires: 'widget,ezaddcontent',\n\n init: function init(editor) {\n editor.widgets.add('ezcustomtag', {\n defaults: {\n name: 'customtag',\n content: ''\n },\n draggable: false,\n template: '
{content}
',\n requiredContent: 'div',\n editables: {\n content: {\n selector: '[data-ezelement=\"ezcontent\"]'\n }\n },\n setNameFireEditorInteractionTimeout: null,\n setAlignmentFireEditorInteractionTimeout: null,\n unsetAlignmentFireEditorInteractionTimeout: null,\n setConfigFireEditorInteractionTimeout: null,\n clearConfigFireEditorInteractionTimeout: null,\n\n upcast: function upcast(element) {\n return element.name === 'div' && element.attributes['data-ezelement'] === 'eztemplate' && !element.attributes['data-eztype'];\n },\n\n /**\n * Insert an `ezembed` widget in the editor. It overrides the\n * default implementation to make sure that in the case where an\n * embed widget is focused, a new one is added after it.\n *\n * @method insert\n */\n insert: function insert() {\n var element = CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),\n wrapper = editor.widgets.wrapElement(element, this.name),\n temp = new CKEDITOR.dom.documentFragment(wrapper.getDocument()),\n instance;\n\n temp.append(wrapper);\n editor.widgets.initOn(element, this.name);\n editor.eZ.appendElement(wrapper);\n\n instance = editor.widgets.getByElement(wrapper);\n instance.ready = true;\n instance.fire('ready');\n instance.focus();\n },\n\n /**\n * It's not possible to *edit* an embed widget in AlloyEditor,\n * so `edit` directly calls `insert` instead. This is needed\n * because by default, the CKEditor engine calls this method\n * when an embed widget has the focus and the `ezcustomtag` command\n * is executed. In AlloyEditor, we want to insert a new widget,\n * not to `edit` the focused widget as the editing process is\n * provided by the style toolbar.\n *\n * @method edit\n */\n edit: function edit() {\n this.insert();\n },\n\n init: function init() {\n this.on('focus', this.fireEditorInteraction);\n this.syncAlignment();\n this.renderAttributes();\n this.renderHeader();\n this.getEzContentElement();\n this.getEzConfigElement();\n this.cancelEditEvents();\n this.toggleState({\n currentTarget: {\n dataset: {\n target: 'attributes'\n }\n }\n });\n },\n\n /**\n * Clear the node.\n *\n * @method clearNode\n * @param {Element} node\n */\n clearNode: function clearNode(node) {\n var element = node.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n },\n\n\n /**\n * Renders the custom tag header.\n *\n * @method renderHeader\n */\n renderHeader: function renderHeader() {\n var customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n\n var header = this.getHeader();\n var template = '\\n
\\n ' + customTagConfig.label + '\\n
\\n
\\n \\n \\n
\\n ';\n\n this.clearNode(header);\n\n header.appendHtml(template);\n\n this.attachButtonsListeners();\n },\n\n /**\n * Attaches event listeners to toggle state buttons.\n *\n * @method attachButtonsListeners\n */\n attachButtonsListeners: function attachButtonsListeners() {\n var _this = this;\n\n var header = this.getHeader();\n var attributesBtn = header.findOne('.ez-custom-tag__header-btn--attributes');\n var contentBtn = header.findOne('.ez-custom-tag__header-btn--content');\n\n [attributesBtn, contentBtn].forEach(function (btn) {\n return btn.$.addEventListener('click', _this.toggleState.bind(_this), false);\n });\n },\n\n /**\n * Toggles the custom tag state.\n *\n * @method toggleState\n * @param {Event} event\n */\n toggleState: function toggleState(event) {\n var _this2 = this;\n\n var visibleElement = event.currentTarget.dataset.target;\n var classes = {\n attributes: 'ez-custom-tag--attributes-visible',\n content: 'ez-custom-tag--content-visible'\n };\n\n Object.entries(classes).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n className = _ref2[1];\n\n return _this2.element.$.classList.toggle(className, key === visibleElement);\n });\n },\n\n /**\n * Renders the custom tag attributes.\n *\n * @method renderAttributes\n */\n renderAttributes: function renderAttributes() {\n var _this3 = this;\n\n var customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n var attributes = Object.keys(customTagConfig.attributes).reduce(function (total, attr) {\n var value = _this3.getConfig(attr);\n\n return total + '

' + customTagConfig.attributes[attr].label + ': ' + value + '

';\n }, '');\n\n this.setWidgetAttributes(attributes);\n },\n\n /**\n * Sets the `name` of the custom tag.\n *\n * @method setName\n * @param {String} name\n * @return {CKEDITOR.plugins.widget}\n */\n setName: function setName(name) {\n this.element.data('ezname', name);\n window.clearTimeout(this.setNameFireEditorInteractionTimeout);\n this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'nameUpdated'), 50);\n\n return this;\n },\n\n /**\n * Gets the `name` of the custom tag.\n *\n * @method getName\n * @return {CKEDITOR.plugins.widget}\n */\n getName: function getName() {\n return this.element.data('ezname');\n },\n\n /**\n * Cancels the widget events that trigger the `edit` event as\n * an embed widget can not be edited in a *CKEditor way*.\n *\n * @method cancelEditEvents\n */\n cancelEditEvents: function cancelEditEvents() {\n var cancel = function cancel(event) {\n return event.cancel();\n };\n\n this.on('doubleclick', cancel, null, null, 5);\n this.on('key', cancel, null, null, 5);\n },\n\n /**\n * Initializes the alignment on the widget wrapper if the widget\n * is aligned.\n *\n * @method syncAlignment\n */\n syncAlignment: function syncAlignment() {\n var align = this.element.data(DATA_ALIGNMENT_ATTR);\n\n if (align) {\n this.setAlignment(align);\n } else {\n this.unsetAlignment();\n }\n },\n\n /**\n * Sets the alignment of the embed widget to `type` and fires\n * the corresponding `editorInteraction` event.\n *\n * @method setAlignment\n * @param {String} type\n */\n setAlignment: function setAlignment(type) {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, type);\n this.element.data(DATA_ALIGNMENT_ATTR, type);\n window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout);\n this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'aligmentUpdated'), 50);\n },\n\n /**\n * Removes the alignment of the widget and fires the\n * corresponding `editorInteraction` event.\n *\n * @method unsetAlignment\n */\n unsetAlignment: function unsetAlignment() {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, false);\n this.element.data(DATA_ALIGNMENT_ATTR, false);\n window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout);\n this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'aligmentRemoved'), 50);\n },\n\n /**\n * Checks whether the embed is aligned with `type` alignment.\n *\n * @method isAligned\n * @param {String} type\n * @return {Boolean}\n */\n isAligned: function isAligned(type) {\n return this.wrapper.data(DATA_ALIGNMENT_ATTR) === type;\n },\n\n /**\n * Sets the widget content.\n *\n * @method setWidgetContent\n * @param {String|CKEDITOR.dom.node} content\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetContent: function setWidgetContent(content) {\n var ezContent = this.getEzContentElement();\n var element = ezContent.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (content instanceof CKEDITOR.dom.node) {\n ezContent.append(content);\n } else {\n ezContent.appendHtml(content);\n }\n\n return this;\n },\n\n /**\n * Sets a config value under the `key` for the custom tag.\n *\n * @method setConfig\n * @param {String} key\n * @param {String} value\n * @return {CKEDITOR.plugins.widget}\n */\n setConfig: function setConfig(key, value) {\n var valueElement = this.getValueElement(key);\n\n if (!valueElement) {\n valueElement = new CKEDITOR.dom.element('span');\n valueElement.data('ezelement', 'ezvalue');\n valueElement.data('ezvalue-key', key);\n this.getEzConfigElement().append(valueElement);\n }\n\n valueElement.setText(value);\n window.clearTimeout(this.setConfigFireEditorInteractionTimeout);\n this.setConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'configUpdated'), 50);\n\n return this;\n },\n\n /**\n * Sets the widget attributes.\n *\n * @method setWidgetAttributes\n * @param {String|CKEDITOR.dom.node} attributes\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetAttributes: function setWidgetAttributes(attributes) {\n var ezAttributes = this.getEzAttributesElement();\n var element = ezAttributes.getFirst();\n var next = void 0;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (attributes instanceof CKEDITOR.dom.node) {\n ezAttributes.append(attributes);\n } else {\n ezAttributes.appendHtml(attributes);\n }\n\n return this;\n },\n\n /**\n * Returns the config value for the `key` or empty string if the\n * config key is not found.\n *\n * @method getConfig\n * @return {String}\n */\n getConfig: function getConfig(key) {\n var valueElement = this.getValueElement(key);\n\n return valueElement ? valueElement.getText() : '';\n },\n\n clearConfig: function clearConfig() {\n var config = this.getEzConfigElement();\n\n while (config.firstChild) {\n config.removeChild(config.firstChild);\n }\n\n window.clearTimeout(this.clearConfigFireEditorInteractionTimeout);\n this.clearConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'configCleared'), 50);\n },\n\n /**\n * Returns the Element holding the config under `key`\n *\n * @method getValueElement\n * @param {String} key\n * @return {CKEDITOR.dom.element}\n */\n getValueElement: function getValueElement(key) {\n return this.getEzConfigElement().findOne('[data-ezelement=\"ezvalue\"][data-ezvalue-key=\"' + key + '\"]');\n },\n\n /**\n * Returns the element used as a container the config values. if\n * it does not exist, it is created.\n *\n * @method getEzConfigElement\n * @return {CKEDITOR.dom.element}\n */\n getEzConfigElement: function getEzConfigElement() {\n var config = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezconfig';\n });\n\n if (!config) {\n config = new CKEDITOR.dom.element('span');\n config.data('ezelement', 'ezconfig');\n this.element.append(config);\n } else {\n config = new CKEDITOR.dom.element(config);\n }\n\n return config;\n },\n\n /**\n * Returns the element used as a container the content values. if\n * it does not exist, it is created.\n *\n * @method getEzContentElement\n * @return {CKEDITOR.dom.element}\n */\n getEzContentElement: function getEzContentElement() {\n var content = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezcontent';\n });\n\n if (!content) {\n content = new CKEDITOR.dom.element('div');\n content.data('ezelement', 'ezcontent');\n this.element.append(content);\n } else {\n content = new CKEDITOR.dom.element(content);\n }\n\n return content;\n },\n\n /**\n * Returns the element used as a container the attributes values. if\n * it does not exist, it is created.\n *\n * @method getEzAttributesElement\n * @return {CKEDITOR.dom.element}\n */\n getEzAttributesElement: function getEzAttributesElement() {\n var attributes = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.dataset.ezelement === 'ezattributes';\n });\n\n if (!attributes) {\n attributes = new CKEDITOR.dom.element('div');\n attributes.data('ezelement', 'ezattributes');\n this.element.append(attributes, true);\n } else {\n attributes = new CKEDITOR.dom.element(attributes);\n }\n\n return attributes;\n },\n\n /**\n * Returns the element used as a container the header. if\n * it does not exist, it is created.\n *\n * @method getHeader\n * @return {CKEDITOR.dom.element}\n */\n getHeader: function getHeader() {\n var header = [].concat(_toConsumableArray(this.element.getChildren().$)).find(function (child) {\n return child.classList.contains('ez-custom-tag__header');\n });\n\n if (!header) {\n header = new CKEDITOR.dom.element('div');\n header.addClass('ez-custom-tag__header');\n this.element.append(header, true);\n } else {\n header = new CKEDITOR.dom.element(header);\n }\n\n return header;\n },\n\n /**\n * Fires the editorInteraction event so that AlloyEditor editor\n * UI remains visible and is updated. This method also computes\n * `selectionData.region` and the `pageX` and `pageY` properties\n * so that the add toolbar is correctly positioned on the\n * widget.\n *\n * @method fireEditorInteraction\n * @param {Object|String} evt this initial event info object or\n * the event name for which the `editorInteraction` is fired.\n */\n fireEditorInteraction: function fireEditorInteraction(evt) {\n var wrapperRegion = this.getWrapperRegion();\n var name = evt.name || evt;\n var event = {\n editor: editor,\n target: this.element.$,\n name: 'widget' + name,\n pageX: wrapperRegion.left,\n pageY: wrapperRegion.top + wrapperRegion.height\n };\n\n editor.focus();\n this.focus();\n\n editor.fire('editorInteraction', {\n nativeEvent: event,\n selectionData: {\n element: this.element,\n region: wrapperRegion\n }\n });\n },\n\n /**\n * Moves the widget after the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveAfter: function moveAfter(element) {\n this.wrapper.insertAfter(element);\n this.fireEditorInteraction('moveAfter');\n },\n\n /**\n * Moves the widget before the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveBefore: function moveBefore(element) {\n this.wrapper.insertBefore(element);\n this.fireEditorInteraction('moveBefore');\n },\n\n /**\n * Returns the wrapper element region.\n *\n * @method getWrapperRegion\n * @private\n * @return {Object}\n */\n getWrapperRegion: function getWrapperRegion() {\n var scroll = this.wrapper.getWindow().getScrollPosition();\n var region = this.wrapper.getClientRect();\n\n region.top += scroll.y;\n region.bottom += scroll.y;\n region.left += scroll.x;\n region.right += scroll.x;\n region.direction = CKEDITOR.SELECTION_TOP_TO_BOTTOM;\n\n return region;\n }\n });\n }\n });\n})(window);\n\n/***/ })\n\n/******/ })[\"default\"];\n});\n\n\n// WEBPACK FOOTER //\n// ezPluginCustomTag.js"," \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 = 64);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 72cc588d59a9ae040ec8","(function(global) {\n const DATA_ALIGNMENT_ATTR = 'ezalign';\n\n if (CKEDITOR.plugins.get('ezcustomtag')) {\n return;\n }\n\n /**\n * CKEditor plugin to configure the widget plugin so that it recognizes the\n * `div[data-ezelement=\"embed\"]` elements as widget.\n *\n * @class ezembed\n * @namespace CKEDITOR.plugins\n * @constructor\n */\n CKEDITOR.plugins.add('ezcustomtag', {\n requires: 'widget,ezaddcontent',\n\n init: function(editor) {\n editor.widgets.add('ezcustomtag', {\n defaults: {\n name: 'customtag',\n content: '',\n },\n draggable: false,\n template:\n '
{content}
',\n requiredContent: 'div',\n editables: {\n content: {\n selector: '[data-ezelement=\"ezcontent\"]',\n },\n },\n setNameFireEditorInteractionTimeout: null,\n setAlignmentFireEditorInteractionTimeout: null,\n unsetAlignmentFireEditorInteractionTimeout: null,\n setConfigFireEditorInteractionTimeout: null,\n clearConfigFireEditorInteractionTimeout: null,\n\n upcast: (element) => {\n return (\n element.name === 'div' &&\n element.attributes['data-ezelement'] === 'eztemplate' &&\n !element.attributes['data-eztype']\n );\n },\n\n /**\n * Insert an `ezembed` widget in the editor. It overrides the\n * default implementation to make sure that in the case where an\n * embed widget is focused, a new one is added after it.\n *\n * @method insert\n */\n insert: function() {\n var element = CKEDITOR.dom.element.createFromHtml(this.template.output(this.defaults)),\n wrapper = editor.widgets.wrapElement(element, this.name),\n temp = new CKEDITOR.dom.documentFragment(wrapper.getDocument()),\n instance;\n\n temp.append(wrapper);\n editor.widgets.initOn(element, this.name);\n editor.eZ.appendElement(wrapper);\n\n instance = editor.widgets.getByElement(wrapper);\n instance.ready = true;\n instance.fire('ready');\n instance.focus();\n },\n\n /**\n * It's not possible to *edit* an embed widget in AlloyEditor,\n * so `edit` directly calls `insert` instead. This is needed\n * because by default, the CKEditor engine calls this method\n * when an embed widget has the focus and the `ezcustomtag` command\n * is executed. In AlloyEditor, we want to insert a new widget,\n * not to `edit` the focused widget as the editing process is\n * provided by the style toolbar.\n *\n * @method edit\n */\n edit: function() {\n this.insert();\n },\n\n init: function() {\n this.on('focus', this.fireEditorInteraction);\n this.syncAlignment();\n this.renderAttributes();\n this.renderHeader();\n this.getEzContentElement();\n this.getEzConfigElement();\n this.cancelEditEvents();\n this.toggleState({\n currentTarget: {\n dataset: {\n target: 'attributes',\n },\n },\n });\n },\n\n /**\n * Clear the node.\n *\n * @method clearNode\n * @param {Element} node\n */\n clearNode(node) {\n let element = node.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n },\n\n /**\n * Renders the custom tag header.\n *\n * @method renderHeader\n */\n renderHeader: function() {\n const customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n\n const header = this.getHeader();\n const template = `\n
\n ${customTagConfig.label}\n
\n
\n \n \n
\n `;\n\n this.clearNode(header);\n\n header.appendHtml(template);\n\n this.attachButtonsListeners();\n },\n\n /**\n * Attaches event listeners to toggle state buttons.\n *\n * @method attachButtonsListeners\n */\n attachButtonsListeners: function() {\n const header = this.getHeader();\n const attributesBtn = header.findOne('.ez-custom-tag__header-btn--attributes');\n const contentBtn = header.findOne('.ez-custom-tag__header-btn--content');\n\n [attributesBtn, contentBtn].forEach((btn) => btn.$.addEventListener('click', this.toggleState.bind(this), false));\n },\n\n /**\n * Toggles the custom tag state.\n *\n * @method toggleState\n * @param {Event} event\n */\n toggleState: function(event) {\n const visibleElement = event.currentTarget.dataset.target;\n const classes = {\n attributes: 'ez-custom-tag--attributes-visible',\n content: 'ez-custom-tag--content-visible',\n };\n\n Object.entries(classes).forEach(([key, className]) =>\n this.element.$.classList.toggle(className, key === visibleElement)\n );\n },\n\n /**\n * Renders the custom tag attributes.\n *\n * @method renderAttributes\n */\n renderAttributes: function() {\n const customTagConfig = global.eZ.adminUiConfig.richTextCustomTags[this.getName()];\n\n if (!customTagConfig) {\n return;\n }\n const attributes = Object.keys(customTagConfig.attributes).reduce((total, attr) => {\n const value = this.getConfig(attr);\n\n return `${total}

${customTagConfig.attributes[attr].label}: ${value}

`;\n }, '');\n\n this.setWidgetAttributes(attributes);\n },\n\n /**\n * Sets the `name` of the custom tag.\n *\n * @method setName\n * @param {String} name\n * @return {CKEDITOR.plugins.widget}\n */\n setName: function(name) {\n this.element.data('ezname', name);\n window.clearTimeout(this.setNameFireEditorInteractionTimeout);\n this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'nameUpdated'), 50);\n\n return this;\n },\n\n /**\n * Gets the `name` of the custom tag.\n *\n * @method getName\n * @return {CKEDITOR.plugins.widget}\n */\n getName: function() {\n return this.element.data('ezname');\n },\n\n /**\n * Cancels the widget events that trigger the `edit` event as\n * an embed widget can not be edited in a *CKEditor way*.\n *\n * @method cancelEditEvents\n */\n cancelEditEvents: function() {\n const cancel = (event) => event.cancel();\n\n this.on('doubleclick', cancel, null, null, 5);\n this.on('key', cancel, null, null, 5);\n },\n\n /**\n * Initializes the alignment on the widget wrapper if the widget\n * is aligned.\n *\n * @method syncAlignment\n */\n syncAlignment: function() {\n const align = this.element.data(DATA_ALIGNMENT_ATTR);\n\n if (align) {\n this.setAlignment(align);\n } else {\n this.unsetAlignment();\n }\n },\n\n /**\n * Sets the alignment of the embed widget to `type` and fires\n * the corresponding `editorInteraction` event.\n *\n * @method setAlignment\n * @param {String} type\n */\n setAlignment: function(type) {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, type);\n this.element.data(DATA_ALIGNMENT_ATTR, type);\n window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout);\n this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(\n this.fireEditorInteraction.bind(this, 'aligmentUpdated'),\n 50\n );\n },\n\n /**\n * Removes the alignment of the widget and fires the\n * corresponding `editorInteraction` event.\n *\n * @method unsetAlignment\n */\n unsetAlignment: function() {\n this.wrapper.data(DATA_ALIGNMENT_ATTR, false);\n this.element.data(DATA_ALIGNMENT_ATTR, false);\n window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout);\n this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(\n this.fireEditorInteraction.bind(this, 'aligmentRemoved'),\n 50\n );\n },\n\n /**\n * Checks whether the embed is aligned with `type` alignment.\n *\n * @method isAligned\n * @param {String} type\n * @return {Boolean}\n */\n isAligned: function(type) {\n return this.wrapper.data(DATA_ALIGNMENT_ATTR) === type;\n },\n\n /**\n * Sets the widget content.\n *\n * @method setWidgetContent\n * @param {String|CKEDITOR.dom.node} content\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetContent: function(content) {\n const ezContent = this.getEzContentElement();\n let element = ezContent.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (content instanceof CKEDITOR.dom.node) {\n ezContent.append(content);\n } else {\n ezContent.appendHtml(content);\n }\n\n return this;\n },\n\n /**\n * Sets a config value under the `key` for the custom tag.\n *\n * @method setConfig\n * @param {String} key\n * @param {String} value\n * @return {CKEDITOR.plugins.widget}\n */\n setConfig: function(key, value) {\n let valueElement = this.getValueElement(key);\n\n if (!valueElement) {\n valueElement = new CKEDITOR.dom.element('span');\n valueElement.data('ezelement', 'ezvalue');\n valueElement.data('ezvalue-key', key);\n this.getEzConfigElement().append(valueElement);\n }\n\n valueElement.setText(value);\n window.clearTimeout(this.setConfigFireEditorInteractionTimeout);\n this.setConfigFireEditorInteractionTimeout = window.setTimeout(\n this.fireEditorInteraction.bind(this, 'configUpdated'),\n 50\n );\n\n return this;\n },\n\n /**\n * Sets the widget attributes.\n *\n * @method setWidgetAttributes\n * @param {String|CKEDITOR.dom.node} attributes\n * @return {CKEDITOR.plugins.widget}\n */\n setWidgetAttributes: function(attributes) {\n const ezAttributes = this.getEzAttributesElement();\n let element = ezAttributes.getFirst();\n let next;\n\n while (element) {\n next = element.getNext();\n element.remove();\n element = next;\n }\n\n if (attributes instanceof CKEDITOR.dom.node) {\n ezAttributes.append(attributes);\n } else {\n ezAttributes.appendHtml(attributes);\n }\n\n return this;\n },\n\n /**\n * Returns the config value for the `key` or empty string if the\n * config key is not found.\n *\n * @method getConfig\n * @return {String}\n */\n getConfig: function(key) {\n const valueElement = this.getValueElement(key);\n\n return valueElement ? valueElement.getText() : '';\n },\n\n clearConfig: function() {\n const config = this.getEzConfigElement();\n\n while (config.firstChild) {\n config.removeChild(config.firstChild);\n }\n\n window.clearTimeout(this.clearConfigFireEditorInteractionTimeout);\n this.clearConfigFireEditorInteractionTimeout = window.setTimeout(\n this.fireEditorInteraction.bind(this, 'configCleared'),\n 50\n );\n },\n\n /**\n * Returns the Element holding the config under `key`\n *\n * @method getValueElement\n * @param {String} key\n * @return {CKEDITOR.dom.element}\n */\n getValueElement: function(key) {\n return this.getEzConfigElement().findOne('[data-ezelement=\"ezvalue\"][data-ezvalue-key=\"' + key + '\"]');\n },\n\n /**\n * Returns the element used as a container the config values. if\n * it does not exist, it is created.\n *\n * @method getEzConfigElement\n * @return {CKEDITOR.dom.element}\n */\n getEzConfigElement: function() {\n let config = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezconfig');\n\n if (!config) {\n config = new CKEDITOR.dom.element('span');\n config.data('ezelement', 'ezconfig');\n this.element.append(config);\n } else {\n config = new CKEDITOR.dom.element(config);\n }\n\n return config;\n },\n\n /**\n * Returns the element used as a container the content values. if\n * it does not exist, it is created.\n *\n * @method getEzContentElement\n * @return {CKEDITOR.dom.element}\n */\n getEzContentElement: function() {\n let content = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezcontent');\n\n if (!content) {\n content = new CKEDITOR.dom.element('div');\n content.data('ezelement', 'ezcontent');\n this.element.append(content);\n } else {\n content = new CKEDITOR.dom.element(content);\n }\n\n return content;\n },\n\n /**\n * Returns the element used as a container the attributes values. if\n * it does not exist, it is created.\n *\n * @method getEzAttributesElement\n * @return {CKEDITOR.dom.element}\n */\n getEzAttributesElement: function() {\n let attributes = [...this.element.getChildren().$].find((child) => child.dataset.ezelement === 'ezattributes');\n\n if (!attributes) {\n attributes = new CKEDITOR.dom.element('div');\n attributes.data('ezelement', 'ezattributes');\n this.element.append(attributes, true);\n } else {\n attributes = new CKEDITOR.dom.element(attributes);\n }\n\n return attributes;\n },\n\n /**\n * Returns the element used as a container the header. if\n * it does not exist, it is created.\n *\n * @method getHeader\n * @return {CKEDITOR.dom.element}\n */\n getHeader: function() {\n let header = [...this.element.getChildren().$].find((child) => child.classList.contains('ez-custom-tag__header'));\n\n if (!header) {\n header = new CKEDITOR.dom.element('div');\n header.addClass('ez-custom-tag__header');\n this.element.append(header, true);\n } else {\n header = new CKEDITOR.dom.element(header);\n }\n\n return header;\n },\n\n /**\n * Fires the editorInteraction event so that AlloyEditor editor\n * UI remains visible and is updated. This method also computes\n * `selectionData.region` and the `pageX` and `pageY` properties\n * so that the add toolbar is correctly positioned on the\n * widget.\n *\n * @method fireEditorInteraction\n * @param {Object|String} evt this initial event info object or\n * the event name for which the `editorInteraction` is fired.\n */\n fireEditorInteraction: function(evt) {\n const wrapperRegion = this.getWrapperRegion();\n const name = evt.name || evt;\n const event = {\n editor: editor,\n target: this.element.$,\n name: 'widget' + name,\n pageX: wrapperRegion.left,\n pageY: wrapperRegion.top + wrapperRegion.height,\n };\n\n editor.focus();\n this.focus();\n\n editor.fire('editorInteraction', {\n nativeEvent: event,\n selectionData: {\n element: this.element,\n region: wrapperRegion,\n },\n });\n },\n\n /**\n * Moves the widget after the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveAfter: function(element) {\n this.wrapper.insertAfter(element);\n this.fireEditorInteraction('moveAfter');\n },\n\n /**\n * Moves the widget before the given element. It also fires the\n * `editorInteraction` event so that the UI can respond to that\n * change.\n *\n * @method moveAfter\n * @param {CKEDITOR.dom.element} element\n */\n moveBefore: function(element) {\n this.wrapper.insertBefore(element);\n this.fireEditorInteraction('moveBefore');\n },\n\n /**\n * Returns the wrapper element region.\n *\n * @method getWrapperRegion\n * @private\n * @return {Object}\n */\n getWrapperRegion: function() {\n const scroll = this.wrapper.getWindow().getScrollPosition();\n const region = this.wrapper.getClientRect();\n\n region.top += scroll.y;\n region.bottom += scroll.y;\n region.left += scroll.x;\n region.right += scroll.x;\n region.direction = CKEDITOR.SELECTION_TOP_TO_BOTTOM;\n\n return region;\n },\n });\n },\n });\n})(window);\n\n\n// WEBPACK FOOTER //\n// ./src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js"],"sourceRoot":""} \ No newline at end of file diff --git a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js index bf0724d930..03014101c9 100644 --- a/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js +++ b/src/bundle/Resources/public/js/alloyeditor/src/plugins/ez-custom-tag.js @@ -31,6 +31,11 @@ selector: '[data-ezelement="ezcontent"]', }, }, + setNameFireEditorInteractionTimeout: null, + setAlignmentFireEditorInteractionTimeout: null, + unsetAlignmentFireEditorInteractionTimeout: null, + setConfigFireEditorInteractionTimeout: null, + clearConfigFireEditorInteractionTimeout: null, upcast: (element) => { return ( @@ -211,7 +216,7 @@ setName: function(name) { this.element.data('ezname', name); window.clearTimeout(this.setNameFireEditorInteractionTimeout); - this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'nameUpdated'), 50); + this.setNameFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this, 'nameUpdated'), 50); return this; }, @@ -266,7 +271,10 @@ this.wrapper.data(DATA_ALIGNMENT_ATTR, type); this.element.data(DATA_ALIGNMENT_ATTR, type); window.clearTimeout(this.setAlignmentFireEditorInteractionTimeout); - this.setAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'aligmentUpdated'), 50); + this.setAlignmentFireEditorInteractionTimeout = window.setTimeout( + this.fireEditorInteraction.bind(this, 'aligmentUpdated'), + 50 + ); }, /** @@ -279,7 +287,10 @@ this.wrapper.data(DATA_ALIGNMENT_ATTR, false); this.element.data(DATA_ALIGNMENT_ATTR, false); window.clearTimeout(this.unsetAlignmentFireEditorInteractionTimeout); - this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'aligmentRemoved'), 50); + this.unsetAlignmentFireEditorInteractionTimeout = window.setTimeout( + this.fireEditorInteraction.bind(this, 'aligmentRemoved'), + 50 + ); }, /** @@ -340,7 +351,10 @@ valueElement.setText(value); window.clearTimeout(this.setConfigFireEditorInteractionTimeout); - this.setConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'configUpdated'), 50); + this.setConfigFireEditorInteractionTimeout = window.setTimeout( + this.fireEditorInteraction.bind(this, 'configUpdated'), + 50 + ); return this; }, @@ -393,7 +407,10 @@ } window.clearTimeout(this.clearConfigFireEditorInteractionTimeout); - this.clearConfigFireEditorInteractionTimeout = window.setTimeout(this.fireEditorInteraction.bind(this,'configCleared'), 50); + this.clearConfigFireEditorInteractionTimeout = window.setTimeout( + this.fireEditorInteraction.bind(this, 'configCleared'), + 50 + ); }, /** @@ -573,4 +590,4 @@ }); }, }); -})(window); +})(window); \ No newline at end of file