@ckeditor/ckeditor5-html-embed 29.0.0 → 31.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,11 +9,11 @@ This package implements the HTML embed feature for CKEditor 5. It allows embeddi
9
9
 
10
10
  ## Demo
11
11
 
12
- Check out the demo in the [HTML embed feature](https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html) guide.
12
+ Check out the demo in the [HTML embed feature guide](https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html#demo).
13
13
 
14
14
  ## Documentation
15
15
 
16
- See the [`@ckeditor/ckeditor5-html-embed` package](https://ckeditor.com/docs/ckeditor5/latest/api/html-embed.html) page as well as the [HTML embed feature guide](https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html) in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
16
+ See the [`@ckeditor/ckeditor5-html-embed` package](https://ckeditor.com/docs/ckeditor5/latest/api/html-embed.html) page as well as the [HTML embed feature](https://ckeditor.com/docs/ckeditor5/latest/features/html-embed.html) guide in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
17
17
 
18
18
  ## License
19
19
 
@@ -2,4 +2,4 @@
2
2
  * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
4
  */
5
- window.CKEditor5=window.CKEditor5||{},window.CKEditor5.htmlEmbed=function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){e.exports=n(3)("./src/core.js")},function(e,t,n){e.exports=n(3)("./src/utils.js")},function(e,t,n){e.exports=n(3)("./src/widget.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,n){e.exports=n(3)("./src/ui.js")},function(e,t,n){var r=n(6),a=n(7);"string"==typeof(a=a.__esModule?a.default:a)&&(a=[[e.i,a,""]]);var i={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(a,i);e.exports=a.locals||{}},function(e,t,n){"use strict";var r,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},i=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function c(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],a=0;a<e.length;a++){var i=e[a],l=t.base?i[0]+t.base:i[0],d=n[l]||0,s="".concat(l," ").concat(d);n[l]=d+1;var m=c(s),u={css:i[1],media:i[2],sourceMap:i[3]};-1!==m?(o[m].references++,o[m].updater(u)):o.push({identifier:s,updater:w(u,t),references:1}),r.push(s)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var a=n.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=i(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var s,m=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function u(e,t,n,r){var a=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,a);else{var i=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(i,o[t]):e.appendChild(i)}}function b(e,t,n){var r=n.css,a=n.media,i=n.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),i&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var h=null,p=0;function w(e,t){var n,r,a;if(t.singleton){var i=p++;n=h||(h=d(t)),r=u.bind(null,n,i,!1),a=u.bind(null,n,i,!0)}else n=d(t),r=b.bind(null,n,t),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=a());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var a=c(n[r]);o[a].references--}for(var i=l(e,t),d=0;d<n.length;d++){var s=c(n[d]);0===o[s].references&&(o[s].updater(),o.splice(s,1))}n=i}}}},function(e,t){e.exports=".ck-widget.raw-html-embed{margin:1em auto;position:relative;display:flow-root}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.ck-content .raw-html-embed{margin:1em auto;min-width:15em;font-style:normal}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:hsl(0deg 0% 45%)}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:hsl(0deg 0% 60%);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;text-align:center;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}"},function(e,t,n){"use strict";n.r(t),n.d(t,"HtmlEmbed",(function(){return b})),n.d(t,"HtmlEmbedEditing",(function(){return s})),n.d(t,"HtmlEmbedUI",(function(){return u}));var r=n(0),a=n(2),i=n(4),o=n(1);class c extends r.Command{refresh(){const e=this.editor.model,t=e.schema,n=e.document.selection;this.isEnabled=function(e,t,n){const r=function(e,t){const n=Object(a.findOptimalInsertionRange)(e,t).start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,n);return t.checkChild(r,"rawHtml")}(n,t,e)}execute(){const e=this.editor.model;e.change(t=>{const n=t.createElement("rawHtml");e.insertContent(n),t.setSelection(n,"on")})}}class l extends r.Command{refresh(){const e=d(this.editor.model.document.selection);this.isEnabled=!!e}execute(e){const t=this.editor.model,n=d(t.document.selection);t.change(t=>{t.setAttribute("value",e,n)})}}function d(e){const t=e.getSelectedElement();return t&&t.is("element","rawHtml")?t:null}n(5);class s extends r.Plugin{static get pluginName(){return"HtmlEmbedEditing"}constructor(e){super(e),e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:e=>(Object(o.logWarning)("html-embed-provide-sanitize-function"),{html:e,hasChanged:!1})})}init(){const e=this.editor;e.model.schema.register("rawHtml",{isObject:!0,allowWhere:"$block",allowAttributes:["value"]}),e.commands.add("updateHtmlEmbed",new l(e)),e.commands.add("insertHtmlEmbed",new c(e)),this._setupConversion()}_setupConversion(){const e=this.editor,t=e.t,n=e.editing.view,r=e.config.get("htmlEmbed");function i({domElement:e,editor:n,state:r,props:a}){e.textContent="";const i=e.ownerDocument;let l;if(r.isEditable){const t={isDisabled:!1,placeholder:a.textareaPlaceholder};l=c({domDocument:i,state:r,props:t}),e.append(l)}else if(r.showPreviews){const c={sanitizeHtml:a.sanitizeHtml};e.append(function({domDocument:e,state:n,props:r,editor:a}){const i=r.sanitizeHtml(n.getRawHtmlValue()),c=n.getRawHtmlValue().length>0?t("No preview available"):t("Empty snippet content"),l=Object(o.createElement)(e,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},c),d=Object(o.createElement)(e,"div",{class:"raw-html-embed__preview-content",dir:a.locale.contentLanguageDirection}),s=e.createRange().createContextualFragment(i.html);d.appendChild(s);return Object(o.createElement)(e,"div",{class:"raw-html-embed__preview"},[l,d])}({domDocument:i,state:r,props:c,editor:n}))}else{const t={isDisabled:!0,placeholder:a.textareaPlaceholder};e.append(c({domDocument:i,state:r,props:t}))}const d={onEditClick:a.onEditClick,onSaveClick:()=>{a.onSaveClick(l.value)},onCancelClick:a.onCancelClick};e.prepend(function({editor:e,domDocument:t,state:n,props:r}){const a=Object(o.createElement)(t,"div",{class:"raw-html-embed__buttons-wrapper"}),i=m(e,"edit"),c=m(e,"save"),l=m(e,"cancel");if(n.isEditable){const e=c.cloneNode(!0),t=l.cloneNode(!0);e.addEventListener("click",e=>{e.preventDefault(),r.onSaveClick()}),t.addEventListener("click",e=>{e.preventDefault(),r.onCancelClick()}),a.appendChild(e),a.appendChild(t)}else{const e=i.cloneNode(!0);e.addEventListener("click",e=>{e.preventDefault(),r.onEditClick()}),a.appendChild(e)}return a}({editor:n,domDocument:i,state:r,props:d}))}function c({domDocument:e,state:t,props:n}){const r=Object(o.createElement)(e,"textarea",{placeholder:n.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return r.disabled=n.isDisabled,r.value=t.getRawHtmlValue(),r}e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(e,{writer:t})=>t.createElement("rawHtml",{value:e.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(e,{writer:t})=>t.createRawElement("div",{class:"raw-html-embed"},(function(t){t.innerHTML=e.getAttribute("value")||""}))}),e.conversion.for("editingDowncast").elementToElement({triggerBy:{attributes:["value"]},model:"rawHtml",view:(o,{writer:c})=>{let l,d,s;const m=c.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":t("HTML snippet"),dir:e.locale.uiLanguageDirection}),u=c.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(t){l=t,i({domElement:t,editor:e,state:d,props:s}),l.addEventListener("mousedown",()=>{if(d.isEditable){const t=e.model;t.document.selection.getSelectedElement()!==o&&t.change(e=>e.setSelection(o,"on"))}},!0)})),b={makeEditable(){d=Object.assign({},d,{isEditable:!0}),i({domElement:l,editor:e,state:d,props:s}),n.change(e=>{e.setAttribute("data-cke-ignore-events","true",u)}),l.querySelector("textarea").focus()},save(t){t!==d.getRawHtmlValue()?(e.execute("updateHtmlEmbed",t),e.editing.view.focus()):this.cancel()},cancel(){d=Object.assign({},d,{isEditable:!1}),i({domElement:l,editor:e,state:d,props:s}),e.editing.view.focus(),n.change(e=>{e.removeAttribute("data-cke-ignore-events",u)})}};return d={showPreviews:r.showPreviews,isEditable:!1,getRawHtmlValue:()=>o.getAttribute("value")||""},s={sanitizeHtml:r.sanitizeHtml,textareaPlaceholder:t("Paste raw HTML here..."),onEditClick(){b.makeEditable()},onSaveClick(e){b.save(e)},onCancelClick(){b.cancel()}},c.insert(c.createPositionAt(m,0),u),c.setCustomProperty("rawHtmlApi",b,m),c.setCustomProperty("rawHtml",!0,m),Object(a.toWidget)(m,c,{widgetLabel:t("HTML snippet"),hasSelectionHandle:!0})}})}}function m(e,t){const n=e.locale.t,a=new i.ButtonView(e.locale),o=e.commands.get("updateHtmlEmbed");return a.set({tooltipPosition:"rtl"===e.locale.uiLanguageDirection?"e":"w",icon:r.icons.pencil,tooltip:!0}),a.render(),"edit"===t?a.set({icon:r.icons.pencil,label:n("Edit source"),class:"raw-html-embed__edit-button"}):"save"===t?(a.set({icon:r.icons.check,label:n("Save changes"),class:"raw-html-embed__save-button"}),a.bind("isEnabled").to(o,"isEnabled")):a.set({icon:r.icons.cancel,label:n("Cancel"),class:"raw-html-embed__cancel-button"}),a.destroy(),a.element.cloneNode(!0)}class u extends r.Plugin{static get pluginName(){return"HtmlEmbedUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("htmlEmbed",n=>{const r=e.commands.get("insertHtmlEmbed"),a=new i.ButtonView(n);return a.set({label:t("Insert HTML"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z"/></svg>',tooltip:!0}),a.bind("isEnabled").to(r,"isEnabled"),this.listenTo(a,"execute",()=>{e.execute("insertHtmlEmbed"),e.editing.view.focus();e.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),a})}}class b extends r.Plugin{static get requires(){return[s,u,a.Widget]}static get pluginName(){return"HtmlEmbed"}}}]);
5
+ !function(e){const t=e.en=e.en||{};t.dictionary=Object.assign(t.dictionary||{},{"Edit source":"Edit source","Empty snippet content":"Empty snippet content","HTML snippet":"HTML snippet","Insert HTML":"Insert HTML","No preview available":"No preview available","Paste raw HTML here...":"Paste raw HTML here...","Save changes":"Save changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={})),window.CKEditor5=window.CKEditor5||{},window.CKEditor5.htmlEmbed=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=8)}([function(e,t,n){e.exports=n(3)("./src/core.js")},function(e,t,n){e.exports=n(3)("./src/utils.js")},function(e,t,n){e.exports=n(3)("./src/widget.js")},function(e,t){e.exports=CKEditor5.dll},function(e,t,n){e.exports=n(3)("./src/ui.js")},function(e,t,n){var r=n(6),i=n(7);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var a={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};r(i,a);e.exports=i.locals||{}},function(e,t,n){"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),o=[];function c(e){for(var t=-1,n=0;n<o.length;n++)if(o[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],i=0;i<e.length;i++){var a=e[i],l=t.base?a[0]+t.base:a[0],d=n[l]||0,s="".concat(l," ").concat(d);n[l]=d+1;var m=c(s),u={css:a[1],media:a[2],sourceMap:a[3]};-1!==m?(o[m].references++,o[m].updater(u)):o.push({identifier:s,updater:w(u,t),references:1}),r.push(s)}return r}function d(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=n.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var o=a(e.insert||"head");if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(t)}return t}var s,m=(s=[],function(e,t){return s[e]=t,s.filter(Boolean).join("\n")});function u(e,t,n,r){var i=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=m(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function b(e,t,n){var r=n.css,i=n.media,a=n.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var p=null,h=0;function w(e,t){var n,r,i;if(t.singleton){var a=h++;n=p||(p=d(t)),r=u.bind(null,n,a,!1),i=u.bind(null,n,a,!0)}else n=d(t),r=b.bind(null,n,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var i=c(n[r]);o[i].references--}for(var a=l(e,t),d=0;d<n.length;d++){var s=c(n[d]);0===o[s].references&&(o[s].updater(),o.splice(s,1))}n=a}}}},function(e,t){e.exports=".ck-widget.raw-html-embed{margin:.9em auto;position:relative;display:flow-root;min-width:15em;font-style:normal}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:#737373}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:#999;transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}"},function(e,t,n){"use strict";n.r(t),n.d(t,"HtmlEmbed",(function(){return u})),n.d(t,"HtmlEmbedEditing",(function(){return d})),n.d(t,"HtmlEmbedUI",(function(){return m}));var r=n(0),i=n(2),a=n(4),o=n(1);class c extends r.Command{refresh(){const e=this.editor.model,t=e.schema,n=e.document.selection,r=l(n);this.isEnabled=function(e,t,n){const r=function(e,t){const n=Object(i.findOptimalInsertionRange)(e,t).start.parent;if(n.isEmpty&&!n.is("element","$root"))return n.parent;return n}(e,n);return t.checkChild(r,"rawHtml")}(n,t,e),this.value=r?r.getAttribute("value")||"":null}execute(e){const t=this.editor.model,n=t.document.selection;t.change(r=>{let i;null!==this.value?i=l(n):(i=r.createElement("rawHtml"),t.insertContent(i),r.setSelection(i,"on")),r.setAttribute("value",e,i)})}}function l(e){const t=e.getSelectedElement();return t&&t.is("element","rawHtml")?t:null}n(5);class d extends r.Plugin{static get pluginName(){return"HtmlEmbedEditing"}constructor(e){super(e),e.config.define("htmlEmbed",{showPreviews:!1,sanitizeHtml:e=>(Object(o.logWarning)("html-embed-provide-sanitize-function"),{html:e,hasChanged:!1})}),this._widgetButtonViewReferences=new Set}init(){const e=this.editor;e.model.schema.register("rawHtml",{isObject:!0,allowWhere:"$block",allowAttributes:["value"]}),e.commands.add("htmlEmbed",new c(e)),this._setupConversion()}_setupConversion(){const e=this.editor,t=e.t,n=e.editing.view,r=this._widgetButtonViewReferences,a=e.config.get("htmlEmbed");function c({domElement:e,editor:n,state:i,props:a}){e.textContent="";const c=e.ownerDocument;let d;if(i.isEditable){const t={isDisabled:!1,placeholder:a.textareaPlaceholder};d=l({domDocument:c,state:i,props:t}),e.append(d)}else if(i.showPreviews){const r={sanitizeHtml:a.sanitizeHtml};e.append(function({domDocument:e,state:n,props:r,editor:i}){const a=r.sanitizeHtml(n.getRawHtmlValue()),c=n.getRawHtmlValue().length>0?t("No preview available"):t("Empty snippet content"),l=Object(o.createElement)(e,"div",{class:"ck ck-reset_all raw-html-embed__preview-placeholder"},c),d=Object(o.createElement)(e,"div",{class:"raw-html-embed__preview-content",dir:i.locale.contentLanguageDirection}),s=e.createRange().createContextualFragment(a.html);d.appendChild(s);return Object(o.createElement)(e,"div",{class:"raw-html-embed__preview"},[l,d])}({domDocument:c,state:i,props:r,editor:n}))}else{const t={isDisabled:!0,placeholder:a.textareaPlaceholder};e.append(l({domDocument:c,state:i,props:t}))}const m={onEditClick:a.onEditClick,onSaveClick:()=>{a.onSaveClick(d.value)},onCancelClick:a.onCancelClick};e.prepend(function({editor:e,domDocument:t,state:n,props:i}){const a=Object(o.createElement)(t,"div",{class:"raw-html-embed__buttons-wrapper"});if(n.isEditable){const t=s(e,"save",i.onSaveClick),n=s(e,"cancel",i.onCancelClick);a.append(t.element,n.element),r.add(t).add(n)}else{const t=s(e,"edit",i.onEditClick);a.append(t.element),r.add(t)}return a}({editor:n,domDocument:c,state:i,props:m}))}function l({domDocument:e,state:t,props:n}){const r=Object(o.createElement)(e,"textarea",{placeholder:n.placeholder,class:"ck ck-reset ck-input ck-input-text raw-html-embed__source"});return r.disabled=n.isDisabled,r.value=t.getRawHtmlValue(),r}this.editor.editing.view.on("render",()=>{for(const e of r){if(e.element.isConnected)return;e.destroy(),r.delete(e)}},{priority:"lowest"}),e.data.registerRawContentMatcher({name:"div",classes:"raw-html-embed"}),e.conversion.for("upcast").elementToElement({view:{name:"div",classes:"raw-html-embed"},model:(e,{writer:t})=>t.createElement("rawHtml",{value:e.getCustomProperty("$rawContent")})}),e.conversion.for("dataDowncast").elementToElement({model:"rawHtml",view:(e,{writer:t})=>t.createRawElement("div",{class:"raw-html-embed"},(function(t){t.innerHTML=e.getAttribute("value")||""}))}),e.conversion.for("editingDowncast").elementToElement({triggerBy:{attributes:["value"]},model:"rawHtml",view:(r,{writer:o})=>{let l,d,s;const m=o.createContainerElement("div",{class:"raw-html-embed","data-html-embed-label":t("HTML snippet"),dir:e.locale.uiLanguageDirection}),u=o.createRawElement("div",{class:"raw-html-embed__content-wrapper"},(function(t){l=t,c({domElement:t,editor:e,state:d,props:s}),l.addEventListener("mousedown",()=>{if(d.isEditable){const t=e.model;t.document.selection.getSelectedElement()!==r&&t.change(e=>e.setSelection(r,"on"))}},!0)})),b={makeEditable(){d=Object.assign({},d,{isEditable:!0}),c({domElement:l,editor:e,state:d,props:s}),n.change(e=>{e.setAttribute("data-cke-ignore-events","true",u)}),l.querySelector("textarea").focus()},save(t){t!==d.getRawHtmlValue()?(e.execute("htmlEmbed",t),e.editing.view.focus()):this.cancel()},cancel(){d=Object.assign({},d,{isEditable:!1}),c({domElement:l,editor:e,state:d,props:s}),e.editing.view.focus(),n.change(e=>{e.removeAttribute("data-cke-ignore-events",u)})}};return d={showPreviews:a.showPreviews,isEditable:!1,getRawHtmlValue:()=>r.getAttribute("value")||""},s={sanitizeHtml:a.sanitizeHtml,textareaPlaceholder:t("Paste raw HTML here..."),onEditClick(){b.makeEditable()},onSaveClick(e){b.save(e)},onCancelClick(){b.cancel()}},o.insert(o.createPositionAt(m,0),u),o.setCustomProperty("rawHtmlApi",b,m),o.setCustomProperty("rawHtml",!0,m),Object(i.toWidget)(m,o,{widgetLabel:t("HTML snippet"),hasSelectionHandle:!0})}})}}function s(e,t,n){const i=e.locale.t,o=new a.ButtonView(e.locale),c=e.commands.get("htmlEmbed");return o.set({class:`raw-html-embed__${t}-button`,icon:r.icons.pencil,tooltip:!0,tooltipPosition:"rtl"===e.locale.uiLanguageDirection?"e":"w"}),o.render(),"edit"===t?(o.set({icon:r.icons.pencil,label:i("Edit source")}),o.bind("isEnabled").to(c)):"save"===t?(o.set({icon:r.icons.check,label:i("Save changes")}),o.bind("isEnabled").to(c)):o.set({icon:r.icons.cancel,label:i("Cancel")}),o.on("execute",n),o}class m extends r.Plugin{static get pluginName(){return"HtmlEmbedUI"}init(){const e=this.editor,t=e.t;e.ui.componentFactory.add("htmlEmbed",n=>{const r=e.commands.get("htmlEmbed"),i=new a.ButtonView(n);return i.set({label:t("Insert HTML"),icon:'<svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z"/></svg>',tooltip:!0}),i.bind("isEnabled").to(r,"isEnabled"),this.listenTo(i,"execute",()=>{e.execute("htmlEmbed"),e.editing.view.focus();e.editing.view.document.selection.getSelectedElement().getCustomProperty("rawHtmlApi").makeEditable()}),i})}}class u extends r.Plugin{static get requires(){return[d,m,i.Widget]}static get pluginName(){return"HtmlEmbed"}}}]);
@@ -0,0 +1 @@
1
+ !function(i){const e=i.cs=i.cs||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"Upravit zdroj","Empty snippet content":"Prázdný obsah kódu","HTML snippet":"Kód HTML","Insert HTML":"Vložit kód HTML","No preview available":"Náhled není k dispozici","Paste raw HTML here...":"Sem vložte kód HTML ...","Save changes":"Uložit změny"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e["de-ch"]=e["de-ch"]||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Quelle bearbeiten","Empty snippet content":"Codeschnipsel ohne Inhalt","HTML snippet":"HTML-Codeschnipsel","Insert HTML":"HTML einfügen","No preview available":"Keine Vorschau verfügbar","Paste raw HTML here...":"HTML-Code hier einfügen…","Save changes":"Änderungen speichern"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.de=e.de||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Quelle bearbeiten","Empty snippet content":"Leerer Snippet-Inhalt","HTML snippet":"HTML-Snippet","Insert HTML":"HTML einfügen","No preview available":"Keine Vorschau verfügbar","Paste raw HTML here...":"Rohes HTML hier einfügen…","Save changes":"Änderungen speichern"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e["en-au"]=e["en-au"]||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Edit source","Empty snippet content":"","HTML snippet":"HTML snippet","Insert HTML":"Insert HTML","No preview available":"","Paste raw HTML here...":"Paste raw HTML here...","Save changes":"Save changes"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.es=e.es||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Editar fuente","Empty snippet content":"","HTML snippet":"","Insert HTML":"Insertar HTML","No preview available":"No hay ninguna previsualización","Paste raw HTML here...":"Pegue HTML en bruto aquí…","Save changes":"Guardar cambios"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.fr=e.fr||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Modifier la source","Empty snippet content":"Aucun contenu pour ce fragment de code","HTML snippet":"Code HTML","Insert HTML":"Insérer du code HTML","No preview available":"Aucun aperçu disponible","Paste raw HTML here...":"Collez le code HTML brut ici...","Save changes":"Enregistrer les changements"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const i=e.gl=e.gl||{};i.dictionary=Object.assign(i.dictionary||{},{"Edit source":"Editar fonte","Empty snippet content":"Contido de fragmento de código baleiro","HTML snippet":"Fragmento HTML","Insert HTML":"Inserir HTML","No preview available":"Non hai vista previa dispoñíbel","Paste raw HTML here...":"Pegar HTML en bruto aquí…","Save changes":"Gardar cambios"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const e=i.hr=i.hr||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"Uredi izvorni kod","Empty snippet content":"","HTML snippet":"HTML isječak","Insert HTML":"Ubaci HTML","No preview available":"","Paste raw HTML here...":"Zalijepi ovdje čisti HTML...","Save changes":"Snimi promjene"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const s=e.hu=e.hu||{};s.dictionary=Object.assign(s.dictionary||{},{"Edit source":"Forrás szerkesztése","Empty snippet content":"Üres kódrészleti tartalom","HTML snippet":"HTML kódrészlet","Insert HTML":"HTML beillesztése","No preview available":"Nincs elérhető előnézet","Paste raw HTML here...":"Másolja ide a HTML forrás szövegét...","Save changes":"Módosítások mentése"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const a=n.id=n.id||{};a.dictionary=Object.assign(a.dictionary||{},{"Edit source":"Sunting sumber","Empty snippet content":"Konten potongan kosong","HTML snippet":"Potongan HTML","Insert HTML":"Sisipkan HTML","No preview available":"Pratinjau tidak tersedia","Paste raw HTML here...":"Tempelkan HTML apa adanya di sini...","Save changes":"Simpan perubahan"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const e=i.it=i.it||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"Modifica sorgente","Empty snippet content":"Contenuto frammento di codice vuoto","HTML snippet":"Frammento HTML","Insert HTML":"Inserisci HTML","No preview available":"Nessuna anteprima disponibile","Paste raw HTML here...":"Incolla qui HTML non elaborato...","Save changes":"Salva modifiche"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.nl=e.nl||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Bron bewerken","Empty snippet content":"","HTML snippet":"","Insert HTML":"HTML invoegen","No preview available":"Geen voorbeeld beschikbaar","Paste raw HTML here...":"","Save changes":"Aanpassingen bewaren"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(t){const n=t.pl=t.pl||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Edytuj źródło","Empty snippet content":"Brak kodu","HTML snippet":"Kod HTML","Insert HTML":"Wstaw kod HTML","No preview available":"Podgląd nie jest dostępny","Paste raw HTML here...":"Wstaw tutaj czysty kod HTML...","Save changes":"Zapisz zmiany"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const t=e["pt-br"]=e["pt-br"]||{};t.dictionary=Object.assign(t.dictionary||{},{"Edit source":"Editar código","Empty snippet content":"","HTML snippet":"Snippet HTML","Insert HTML":"Inserir HTML","No preview available":"","Paste raw HTML here...":"","Save changes":"Salvar alterações"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const e=i.ro=i.ro||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"Editează sursa","Empty snippet content":"Golește conținutul fragmentului","HTML snippet":"Fragment HTML","Insert HTML":"Inserează HTML","No preview available":"Previzualizare indisponibilă","Paste raw HTML here...":"Inserați aici HTML brut... ","Save changes":"Salvează schimbările"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.ru=e.ru||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Изменить код","Empty snippet content":"Нет контента","HTML snippet":"HTML сниппет","Insert HTML":"Вставить HTML","No preview available":"Предпросмотр недоступен","Paste raw HTML here...":"Вставьте HTML код сюда...","Save changes":"Сохранить изменения"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(i){const e=i.sk=i.sk||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"Upraviť zdroj","Empty snippet content":"Prázdny obsah kódu","HTML snippet":"Kód HTML","Insert HTML":"Vložiť kód HTML","No preview available":"Náhľad nie je k dispozícii","Paste raw HTML here...":"Sem vložte kód HTML...","Save changes":"Uložiť zmeny"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const i=e.sl=e.sl||{};i.dictionary=Object.assign(i.dictionary||{},{"Edit source":"Uredi izvorno kodo","Empty snippet content":"","HTML snippet":"HTML izsek","Insert HTML":"Vstavi HTML","No preview available":"","Paste raw HTML here...":"Prilepi HTML kodo ...","Save changes":"Shrani spremembe"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e["sr-latn"]=e["sr-latn"]||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Uredi izvor","Empty snippet content":"Sadržaj praznog isečka","HTML snippet":"HTML deo","Insert HTML":"Umetni HTML","No preview available":"Prikaz nije dostupan","Paste raw HTML here...":"Ovde nalepite HTML ...","Save changes":"Sačuvaj promene"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.sr=e.sr||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Уреди извор","Empty snippet content":"Садрћај празног исечка","HTML snippet":"ХТМЛ део","Insert HTML":"Уметни ХТМЛ","No preview available":"Приказ није доступан","Paste raw HTML here...":"Овде налепите ХТМЛ","Save changes":"Сачувај измене"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(e){const n=e.uk=e.uk||{};n.dictionary=Object.assign(n.dictionary||{},{"Edit source":"Редагувати джерело","Empty snippet content":"Порожній вміст","HTML snippet":"Фрагмент HTML","Insert HTML":"Вставити HTML","No preview available":"Попередній перегляд недоступний","Paste raw HTML here...":"Вставте сюди необроблений HTML...","Save changes":"Зберегти зміни"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const i=n.vi=n.vi||{};i.dictionary=Object.assign(i.dictionary||{},{"Edit source":"Sửa nguồn","Empty snippet content":"","HTML snippet":"Mẫu HTML","Insert HTML":"Chèn HTML","No preview available":"","Paste raw HTML here...":"Dán mã HTML nguyên bản tại đây...","Save changes":"Lưu thay đổi"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1 @@
1
+ !function(n){const e=n["zh-cn"]=n["zh-cn"]||{};e.dictionary=Object.assign(e.dictionary||{},{"Edit source":"编辑源代码","Empty snippet content":"空片段内容","HTML snippet":"HTML 代码片段","Insert HTML":"插入 HTML","No preview available":"预览不可用","Paste raw HTML here...":"在这里粘贴 HTML 源代码","Save changes":"保存更改"})}(window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={}));
@@ -0,0 +1,30 @@
1
+ {
2
+ "plugins": [
3
+ {
4
+ "name": "HTML embed",
5
+ "className": "HtmlEmbed",
6
+ "description": "Allows for embedding an arbitrary HTML snippet in the editor.",
7
+ "docs": "features/html-embed.html",
8
+ "path": "src/htmlembed.js",
9
+ "uiComponents": [
10
+ {
11
+ "type": "Button",
12
+ "name": "htmlEmbed",
13
+ "iconPath": "theme/icons/html.svg"
14
+ }
15
+ ],
16
+ "htmlOutput": [
17
+ {
18
+ "elements": "div",
19
+ "classes": "raw-html-embed"
20
+ },
21
+ {
22
+ "elements": "*",
23
+ "classes": "*",
24
+ "styles": "*",
25
+ "_comment": "The plugin can output any arbitrary HTML provided by the user. That HTML is always wrapped with a `<div class=\"raw-html-embed\">` element."
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
@@ -18,7 +18,7 @@ msgstr ""
18
18
 
19
19
  msgctxt "Toolbar button tooltip for the HTML embed feature."
20
20
  msgid "Insert HTML"
21
- msgstr ""
21
+ msgstr "HTML invoegen"
22
22
 
23
23
  msgctxt "The HTML snippet."
24
24
  msgid "HTML snippet"
@@ -30,11 +30,11 @@ msgstr ""
30
30
 
31
31
  msgctxt "A label of a button that switches the HTML embed to the source editing mode."
32
32
  msgid "Edit source"
33
- msgstr ""
33
+ msgstr "Bron bewerken"
34
34
 
35
35
  msgctxt "A label of a button that saves the HTML embed content and navigates back to the preview."
36
36
  msgid "Save changes"
37
- msgstr ""
37
+ msgstr "Aanpassingen bewaren"
38
38
 
39
39
  msgctxt "An information displayed in the HTML embed preview if the content is not previewable."
40
40
  msgid "No preview available"
@@ -22,7 +22,7 @@ msgstr "Wstaw kod HTML"
22
22
 
23
23
  msgctxt "The HTML snippet."
24
24
  msgid "HTML snippet"
25
- msgstr ""
25
+ msgstr "Kod HTML"
26
26
 
27
27
  msgctxt "A placeholder that will be displayed in the raw HTML textarea field."
28
28
  msgid "Paste raw HTML here..."
@@ -42,4 +42,4 @@ msgstr "Podgląd nie jest dostępny"
42
42
 
43
43
  msgctxt "An information displayed in the HTML embed preview if the HTML snippet has no content."
44
44
  msgid "Empty snippet content"
45
- msgstr ""
45
+ msgstr "Brak kodu"
@@ -38,8 +38,8 @@ msgstr "Сохранить изменения"
38
38
 
39
39
  msgctxt "An information displayed in the HTML embed preview if the content is not previewable."
40
40
  msgid "No preview available"
41
- msgstr ""
41
+ msgstr "Предпросмотр недоступен"
42
42
 
43
43
  msgctxt "An information displayed in the HTML embed preview if the HTML snippet has no content."
44
44
  msgid "Empty snippet content"
45
- msgstr ""
45
+ msgstr "Нет контента"
@@ -38,8 +38,8 @@ msgstr "保存更改"
38
38
 
39
39
  msgctxt "An information displayed in the HTML embed preview if the content is not previewable."
40
40
  msgid "No preview available"
41
- msgstr ""
41
+ msgstr "预览不可用"
42
42
 
43
43
  msgctxt "An information displayed in the HTML embed preview if the HTML snippet has no content."
44
44
  msgid "Empty snippet content"
45
- msgstr ""
45
+ msgstr "空片段内容"
package/package.json CHANGED
@@ -1,31 +1,32 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-html-embed",
3
- "version": "29.0.0",
3
+ "version": "31.0.0",
4
4
  "description": "HTML embed feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
7
7
  "ckeditor5",
8
8
  "ckeditor 5",
9
9
  "ckeditor5-feature",
10
- "ckeditor5-plugin"
10
+ "ckeditor5-plugin",
11
+ "ckeditor5-dll"
11
12
  ],
12
13
  "main": "src/index.js",
13
14
  "dependencies": {
14
- "ckeditor5": "^29.0.0"
15
+ "ckeditor5": "^31.0.0"
15
16
  },
16
17
  "devDependencies": {
17
- "@ckeditor/ckeditor5-basic-styles": "^29.0.0",
18
- "@ckeditor/ckeditor5-core": "^29.0.0",
19
- "@ckeditor/ckeditor5-dev-utils": "^25.0.0",
20
- "@ckeditor/ckeditor5-clipboard": "^29.0.0",
21
- "@ckeditor/ckeditor5-editor-classic": "^29.0.0",
22
- "@ckeditor/ckeditor5-engine": "^29.0.0",
23
- "@ckeditor/ckeditor5-media-embed": "^29.0.0",
24
- "@ckeditor/ckeditor5-paragraph": "^29.0.0",
25
- "@ckeditor/ckeditor5-table": "^29.0.0",
26
- "@ckeditor/ckeditor5-ui": "^29.0.0",
27
- "@ckeditor/ckeditor5-theme-lark": "^29.0.0",
28
- "@ckeditor/ckeditor5-widget": "^29.0.0",
18
+ "@ckeditor/ckeditor5-basic-styles": "^31.0.0",
19
+ "@ckeditor/ckeditor5-core": "^31.0.0",
20
+ "@ckeditor/ckeditor5-dev-utils": "^25.4.0",
21
+ "@ckeditor/ckeditor5-clipboard": "^31.0.0",
22
+ "@ckeditor/ckeditor5-editor-classic": "^31.0.0",
23
+ "@ckeditor/ckeditor5-engine": "^31.0.0",
24
+ "@ckeditor/ckeditor5-media-embed": "^31.0.0",
25
+ "@ckeditor/ckeditor5-paragraph": "^31.0.0",
26
+ "@ckeditor/ckeditor5-table": "^31.0.0",
27
+ "@ckeditor/ckeditor5-ui": "^31.0.0",
28
+ "@ckeditor/ckeditor5-theme-lark": "^31.0.0",
29
+ "@ckeditor/ckeditor5-widget": "^31.0.0",
29
30
  "lodash-es": "^4.17.15",
30
31
  "sanitize-html": "^2.1.0",
31
32
  "webpack": "^4.43.0",
@@ -48,7 +49,8 @@
48
49
  "lang",
49
50
  "src",
50
51
  "theme",
51
- "build"
52
+ "build",
53
+ "ckeditor5-metadata.json"
52
54
  ],
53
55
  "scripts": {
54
56
  "dll:build": "webpack"
@@ -0,0 +1,117 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ /**
7
+ * @module html-embed/htmlembedcommand
8
+ */
9
+
10
+ import { Command } from 'ckeditor5/src/core';
11
+ import { findOptimalInsertionRange } from 'ckeditor5/src/widget';
12
+
13
+ /**
14
+ * The insert HTML embed element command.
15
+ *
16
+ * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'htmlEmbed'`.
17
+ *
18
+ * To insert an empty HTML embed element at the current selection, execute the command:
19
+ *
20
+ * editor.execute( 'htmlEmbed' );
21
+ *
22
+ * You can specify the initial content of a new HTML embed in the argument:
23
+ *
24
+ * editor.execute( 'htmlEmbed', '<b>Initial content.</b>' );
25
+ *
26
+ * To update the content of the HTML embed, select it in the model and pass the content in the argument:
27
+ *
28
+ * editor.execute( 'htmlEmbed', '<b>New content of an existing embed.</b>' );
29
+ *
30
+ * @extends module:core/command~Command
31
+ */
32
+ export default class HtmlEmbedCommand extends Command {
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ refresh() {
37
+ const model = this.editor.model;
38
+ const schema = model.schema;
39
+ const selection = model.document.selection;
40
+ const selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );
41
+
42
+ this.isEnabled = isHtmlEmbedAllowedInParent( selection, schema, model );
43
+ this.value = selectedRawHtmlElement ? selectedRawHtmlElement.getAttribute( 'value' ) || '' : null;
44
+ }
45
+
46
+ /**
47
+ * Executes the command, which either:
48
+ *
49
+ * * creates and inserts a new HTML embed element if none was selected,
50
+ * * updates the content of the HTML embed if one was selected.
51
+ *
52
+ * @fires execute
53
+ * @param {String} [value] When passed, the value (content) will be set on a new embed or a selected one.
54
+ */
55
+ execute( value ) {
56
+ const model = this.editor.model;
57
+ const selection = model.document.selection;
58
+
59
+ model.change( writer => {
60
+ let htmlEmbedElement;
61
+
62
+ // If the command has a non-null value, there must be some HTML embed selected in the model.
63
+ if ( this.value !== null ) {
64
+ htmlEmbedElement = getSelectedRawHtmlModelWidget( selection );
65
+ } else {
66
+ htmlEmbedElement = writer.createElement( 'rawHtml' );
67
+
68
+ model.insertContent( htmlEmbedElement );
69
+ writer.setSelection( htmlEmbedElement, 'on' );
70
+ }
71
+
72
+ writer.setAttribute( 'value', value, htmlEmbedElement );
73
+ } );
74
+ }
75
+ }
76
+
77
+ // Checks if an HTML embed is allowed by the schema in the optimal insertion parent.
78
+ //
79
+ // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
80
+ // @param {module:engine/model/schema~Schema} schema
81
+ // @param {module:engine/model/model~Model} model
82
+ // @returns {Boolean}
83
+ function isHtmlEmbedAllowedInParent( selection, schema, model ) {
84
+ const parent = getInsertHtmlEmbedParent( selection, model );
85
+
86
+ return schema.checkChild( parent, 'rawHtml' );
87
+ }
88
+
89
+ // Returns a node that will be used to insert a html embed with `model.insertContent` to check if a html embed element can be placed there.
90
+ //
91
+ // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
92
+ // @param {module:engine/model/model~Model} model
93
+ // @returns {module:engine/model/element~Element}
94
+ function getInsertHtmlEmbedParent( selection, model ) {
95
+ const insertionRange = findOptimalInsertionRange( selection, model );
96
+ const parent = insertionRange.start.parent;
97
+
98
+ if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
99
+ return parent.parent;
100
+ }
101
+
102
+ return parent;
103
+ }
104
+
105
+ // Returns the selected HTML embed element in the model, if any.
106
+ //
107
+ // @param {module:engine/model/selection~Selection} selection
108
+ // @returns {module:engine/model/element~Element|null}
109
+ function getSelectedRawHtmlModelWidget( selection ) {
110
+ const selectedElement = selection.getSelectedElement();
111
+
112
+ if ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {
113
+ return selectedElement;
114
+ }
115
+
116
+ return null;
117
+ }
@@ -12,8 +12,7 @@ import { ButtonView } from 'ckeditor5/src/ui';
12
12
  import { toWidget } from 'ckeditor5/src/widget';
13
13
  import { logWarning, createElement } from 'ckeditor5/src/utils';
14
14
 
15
- import InsertHtmlEmbedCommand from './inserthtmlembedcommand';
16
- import UpdateHtmlEmbedCommand from './updatehtmlembedcommand';
15
+ import HtmlEmbedCommand from './htmlembedcommand';
17
16
 
18
17
  import '../theme/htmlembed.css';
19
18
 
@@ -55,6 +54,15 @@ export default class HtmlEmbedEditing extends Plugin {
55
54
  };
56
55
  }
57
56
  } );
57
+
58
+ /**
59
+ * Keeps references to {@link module:ui/button/buttonview~ButtonView edit, save, and cancel} button instances created for
60
+ * each widget so they can be destroyed if they are no longer in DOM after the editing view was re-rendered.
61
+ *
62
+ * @private
63
+ * @member {Set.<module:ui/button/buttonview~ButtonView>} #_widgetButtonViewReferences
64
+ */
65
+ this._widgetButtonViewReferences = new Set();
58
66
  }
59
67
 
60
68
  /**
@@ -70,8 +78,7 @@ export default class HtmlEmbedEditing extends Plugin {
70
78
  allowAttributes: [ 'value' ]
71
79
  } );
72
80
 
73
- editor.commands.add( 'updateHtmlEmbed', new UpdateHtmlEmbedCommand( editor ) );
74
- editor.commands.add( 'insertHtmlEmbed', new InsertHtmlEmbedCommand( editor ) );
81
+ editor.commands.add( 'htmlEmbed', new HtmlEmbedCommand( editor ) );
75
82
 
76
83
  this._setupConversion();
77
84
  }
@@ -85,9 +92,23 @@ export default class HtmlEmbedEditing extends Plugin {
85
92
  const editor = this.editor;
86
93
  const t = editor.t;
87
94
  const view = editor.editing.view;
95
+ const widgetButtonViewReferences = this._widgetButtonViewReferences;
88
96
 
89
97
  const htmlEmbedConfig = editor.config.get( 'htmlEmbed' );
90
98
 
99
+ // Destroy UI buttons created for widgets that have been removed from the view document (e.g. in the previous conversion).
100
+ // This prevents unexpected memory leaks from UI views.
101
+ this.editor.editing.view.on( 'render', () => {
102
+ for ( const buttonView of widgetButtonViewReferences ) {
103
+ if ( buttonView.element.isConnected ) {
104
+ return;
105
+ }
106
+
107
+ buttonView.destroy();
108
+ widgetButtonViewReferences.delete( buttonView );
109
+ }
110
+ }, { priority: 'lowest' } );
111
+
91
112
  // Register div.raw-html-embed as a raw content element so all of it's content will be provided
92
113
  // as a view element's custom property while data upcasting.
93
114
  editor.data.registerRawContentMatcher( {
@@ -176,7 +197,7 @@ export default class HtmlEmbedEditing extends Plugin {
176
197
  // If the value didn't change, we just cancel. If it changed,
177
198
  // it's enough to update the model – the entire widget will be reconverted.
178
199
  if ( newValue !== state.getRawHtmlValue() ) {
179
- editor.execute( 'updateHtmlEmbed', newValue );
200
+ editor.execute( 'htmlEmbed', newValue );
180
201
  editor.editing.view.focus();
181
202
  } else {
182
203
  this.cancel();
@@ -275,36 +296,18 @@ export default class HtmlEmbedEditing extends Plugin {
275
296
  const domButtonsWrapper = createElement( domDocument, 'div', {
276
297
  class: 'raw-html-embed__buttons-wrapper'
277
298
  } );
278
- // TODO these should be cached and we should only clone here these cached nodes!
279
- const domEditButton = createDomButton( editor, 'edit' );
280
- const domSaveButton = createDomButton( editor, 'save' );
281
- const domCancelButton = createDomButton( editor, 'cancel' );
282
299
 
283
300
  if ( state.isEditable ) {
284
- const clonedDomSaveButton = domSaveButton.cloneNode( true );
285
- const clonedDomCancelButton = domCancelButton.cloneNode( true );
286
-
287
- clonedDomSaveButton.addEventListener( 'click', evt => {
288
- evt.preventDefault();
289
- props.onSaveClick( );
290
- } );
301
+ const saveButtonView = createUIButton( editor, 'save', props.onSaveClick );
302
+ const cancelButtonView = createUIButton( editor, 'cancel', props.onCancelClick );
291
303
 
292
- clonedDomCancelButton.addEventListener( 'click', evt => {
293
- evt.preventDefault();
294
- props.onCancelClick( );
295
- } );
296
-
297
- domButtonsWrapper.appendChild( clonedDomSaveButton );
298
- domButtonsWrapper.appendChild( clonedDomCancelButton );
304
+ domButtonsWrapper.append( saveButtonView.element, cancelButtonView.element );
305
+ widgetButtonViewReferences.add( saveButtonView ).add( cancelButtonView );
299
306
  } else {
300
- const clonedDomEditButton = domEditButton.cloneNode( true );
301
-
302
- clonedDomEditButton.addEventListener( 'click', evt => {
303
- evt.preventDefault();
304
- props.onEditClick();
305
- } );
307
+ const editButtonView = createUIButton( editor, 'edit', props.onEditClick );
306
308
 
307
- domButtonsWrapper.appendChild( clonedDomEditButton );
309
+ domButtonsWrapper.append( editButtonView.element );
310
+ widgetButtonViewReferences.add( editButtonView );
308
311
  }
309
312
 
310
313
  return domButtonsWrapper;
@@ -355,20 +358,22 @@ export default class HtmlEmbedEditing extends Plugin {
355
358
  }
356
359
  }
357
360
 
358
- // Returns a toggle mode button DOM element that can be cloned and used in conversion.
361
+ // Returns a UI button view that can be used in conversion.
359
362
  //
360
363
  // @param {module:utils/locale~Locale} locale Editor locale.
361
364
  // @param {'edit'|'save'|'cancel'} type Type of button to create.
362
- // @returns {HTMLElement}
363
- function createDomButton( editor, type ) {
365
+ // @param {Function} onClick The callback executed on button click.
366
+ // @returns {module:ui/button/buttonview~ButtonView}
367
+ function createUIButton( editor, type, onClick ) {
364
368
  const t = editor.locale.t;
365
369
  const buttonView = new ButtonView( editor.locale );
366
- const command = editor.commands.get( 'updateHtmlEmbed' );
370
+ const command = editor.commands.get( 'htmlEmbed' );
367
371
 
368
372
  buttonView.set( {
369
- tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w',
373
+ class: `raw-html-embed__${ type }-button`,
370
374
  icon: icons.pencil,
371
- tooltip: true
375
+ tooltip: true,
376
+ tooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w'
372
377
  } );
373
378
 
374
379
  buttonView.render();
@@ -376,25 +381,25 @@ function createDomButton( editor, type ) {
376
381
  if ( type === 'edit' ) {
377
382
  buttonView.set( {
378
383
  icon: icons.pencil,
379
- label: t( 'Edit source' ),
380
- class: 'raw-html-embed__edit-button'
384
+ label: t( 'Edit source' )
381
385
  } );
386
+
387
+ buttonView.bind( 'isEnabled' ).to( command );
382
388
  } else if ( type === 'save' ) {
383
389
  buttonView.set( {
384
390
  icon: icons.check,
385
- label: t( 'Save changes' ),
386
- class: 'raw-html-embed__save-button'
391
+ label: t( 'Save changes' )
387
392
  } );
388
- buttonView.bind( 'isEnabled' ).to( command, 'isEnabled' );
393
+
394
+ buttonView.bind( 'isEnabled' ).to( command );
389
395
  } else {
390
396
  buttonView.set( {
391
397
  icon: icons.cancel,
392
- label: t( 'Cancel' ),
393
- class: 'raw-html-embed__cancel-button'
398
+ label: t( 'Cancel' )
394
399
  } );
395
400
  }
396
401
 
397
- buttonView.destroy();
402
+ buttonView.on( 'execute', onClick );
398
403
 
399
- return buttonView.element.cloneNode( true );
404
+ return buttonView;
400
405
  }
@@ -34,7 +34,7 @@ export default class HtmlEmbedUI extends Plugin {
34
34
 
35
35
  // Add the `htmlEmbed` button to feature components.
36
36
  editor.ui.componentFactory.add( 'htmlEmbed', locale => {
37
- const command = editor.commands.get( 'insertHtmlEmbed' );
37
+ const command = editor.commands.get( 'htmlEmbed' );
38
38
  const view = new ButtonView( locale );
39
39
 
40
40
  view.set( {
@@ -47,7 +47,7 @@ export default class HtmlEmbedUI extends Plugin {
47
47
 
48
48
  // Execute the command.
49
49
  this.listenTo( view, 'execute', () => {
50
- editor.execute( 'insertHtmlEmbed' );
50
+ editor.execute( 'htmlEmbed' );
51
51
  editor.editing.view.focus();
52
52
 
53
53
  const widgetWrapper = editor.editing.view.document.selection.getSelectedElement();
package/CHANGELOG.md DELETED
@@ -1,4 +0,0 @@
1
- Changelog
2
- =========
3
-
4
- All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack://CKEditor5.htmlEmbed/webpack/bootstrap","webpack://CKEditor5.htmlEmbed/./theme/htmlembed.css","webpack://CKEditor5.htmlEmbed//Users/pomek/Projects/ckeditor/ckeditor5/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://CKEditor5.htmlEmbed/./src/htmlembed.js","webpack://CKEditor5.htmlEmbed/./src/htmlembedediting.js","webpack://CKEditor5.htmlEmbed/./src/htmlembedui.js","webpack://CKEditor5.htmlEmbed/./src/index.js","webpack://CKEditor5.htmlEmbed/./src/inserthtmlembedcommand.js","webpack://CKEditor5.htmlEmbed/./src/updatehtmlembedcommand.js","webpack://CKEditor5.htmlEmbed/./theme/htmlembed.css?c0e4","webpack://CKEditor5.htmlEmbed/./theme/icons/html.svg","webpack://CKEditor5.htmlEmbed/delegated ./core.js from dll-reference CKEditor5.dll","webpack://CKEditor5.htmlEmbed/delegated ./ui.js from dll-reference CKEditor5.dll","webpack://CKEditor5.htmlEmbed/delegated ./utils.js from dll-reference CKEditor5.dll","webpack://CKEditor5.htmlEmbed/delegated ./widget.js from dll-reference CKEditor5.dll","webpack://CKEditor5.htmlEmbed/external \"CKEditor5.dll\""],"names":[],"mappings":";;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,4CAA4C,gBAAgB,kBAAkB,kBAAkB,iCAAiC,kBAAkB,UAAU,2DAA2D,kBAAkB,aAAa,sBAAsB,mDAAmD,kBAAkB,gBAAgB,aAAa,2DAA2D,WAAW,kBAAkB,YAAY,cAAc,yBAAyB,mBAAmB,+DAA+D,kBAAkB,OAAO,MAAM,QAAQ,SAAS,aAAa,mBAAmB,uBAAuB,4BAA4B,gBAAgB,eAAe,kBAAkB,MAAM,mEAAmE,mCAAmC,4CAA4C,0FAA0F,2EAA2E,uDAAuD,0BAA0B,mCAAmC,iDAAiD,+DAA+D,kGAAkG,mCAAmC,gBAAgB,mCAAmC,iBAAiB,iCAAiC,oCAAoC,0DAA0D,gCAAgC,4BAA4B,2GAA2G,mIAAmI,kEAAkE,sCAAsC,mCAAmC,gCAAgC,0CAA0C,UAAU,iCAAiC,iIAAiI,iBAAiB,uFAAuF,MAAM,uDAAuD,6FAA6F,MAAM,uDAAuD,wCAAwC,wFAAwF,MAAM,uDAAuD,2DAA2D,mCAAmC,2DAA2D,+BAA+B,iCAAiC,kGAAkG,kCAAkC,oGAAoG,oCAAoC,wFAAwF,mCAAmC,oEAAoE,gCAAgC,WAAW,kDAAkD,sBAAsB,0CAA0C,yCAAyC,YAAY,YAAY,mCAAmC,sBAAsB,WAAW,qBAAqB,mCAAmC,gBAAgB,cAAc,4DAA4D,2DAA2D,iDAAiD,mEAAmE,UAAU,mDAAmD,mDAAmD,yCAAyC,2FAA2F,oBAAoB,2DAA2D,sBAAsB,kBAAkB,iDAAiD,6DAA6D,iBAAiB,kBAAkB,+DAA+D,iDAAiD,C;;;;;;;;;;;;ACAtnJ;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,KAAwC,GAAG,sBAAiB,GAAG,SAAI;;AAEnF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,qEAAqE,qBAAqB,aAAa;;AAEvG;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,yDAAyD;AACzD,GAAG;;AAEH;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB,6BAA6B;AACjD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,E;;;;;;;;;;;;AC5QA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACE;;AAEI;AACV;;AAExC;AACA;AACA;AACA;AACA;AACA,uCAAuC,8CAA8C;AACrF;AACA;AACA;AACe,wBAAwB,yDAAM;AAC7C;AACA;AACA;AACA;AACA,WAAW,yDAAgB,EAAE,oDAAW,EAAE,2DAAM;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,QAAQ,sEAAsE;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,iGAAiG;AACrG;AACA,+DAA+D,+CAA+C;AAC9G,QAAQ,sCAAsC;AAC9C;AACA,YAAY,QAAQ;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA,+DAA+D,+CAA+C;AAC9G,QAAQ,sCAAsC;AAC9C;AACA;AACA,qBAAqB,0DAA0D;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,IAAI,gGAAgG;AACpG;AACA,YAAY,SAAS;AACrB;;AAEA;AACA,8BAA8B,+DAA+D;AAC7F;AACA;AACA;;AAEA;AACA,yDAAyD,iEAAiE;AAC1H;AACA,YAAY,OAAO;AACnB;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;;;;;;;;;;;;;AC3HA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEmD;AACL;AACE;AACgB;;AAEF;AACA;;AAE9B;;AAEhC;AACA;AACA;AACA;AACA;AACe,+BAA+B,yDAAM;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,8CAA8C;AACzF;AACA;AACA;AACA,IAAI,sEAAU;;AAEd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH,8CAA8C,+DAAsB;AACpE,8CAA8C,+DAAsB;;AAEpE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,IAAI;AACJ,0BAA0B,SAAS;AACnC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA,0BAA0B,SAAS;AACnC,4CAA4C,0BAA0B;AACtE;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA,IAAI;AACJ;AACA,0BAA0B,SAAS;AACnC;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,qBAAqB,mCAAmC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,KAAK;;AAEL;AACA;AACA;AACA,+BAA+B;AAC/B;AACA,OAAO;;AAEP,sBAAsB,sDAAsD;;AAE5E;AACA;AACA,OAAO;;AAEP;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,MAAM;AACN;AACA,+BAA+B;AAC/B;AACA,OAAO;;AAEP,sBAAsB,sDAAsD;AAC5E;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,WAAW,qEAAQ;AACnB;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH,2BAA2B,mCAAmC;AAC9D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC,2CAA2C;;AAEjF;AACA,IAAI;AACJ;AACA;AACA;;AAEA,gDAAgD,2DAA2D;AAC3G,IAAI;AACJ;AACA;AACA;AACA;;AAEA,2CAA2C,2CAA2C;AACtF;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,iDAAiD,yDAAyD;AAC1G;;AAEA,qCAAqC,oCAAoC;AACzE,6BAA6B,yEAAa;AAC1C;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;;AAEA,+BAA+B,4BAA4B;AAC3D,uBAAuB,yEAAa;AACpC;AACA;AACA,IAAI;;AAEJ;AACA;;AAEA;AACA;;AAEA,oCAAoC,oCAAoC;AACxE;AACA;AACA;AACA;;AAEA,iCAAiC,yEAAa;AAC9C;AACA,IAAI;;AAEJ,6BAA6B,yEAAa;AAC1C;AACA;AACA,IAAI;;AAEJ;;AAEA,+BAA+B,yEAAa;AAC5C;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY,2BAA2B;AACvC,YAAY,uBAAuB;AACnC,cAAc;AACd;AACA;AACA,wBAAwB,2DAAU;AAClC;;AAEA;AACA;AACA,QAAQ,wDAAK;AACb;AACA,EAAE;;AAEF;;AAEA;AACA;AACA,SAAS,wDAAK;AACd;AACA;AACA,GAAG;AACH,EAAE;AACF;AACA,SAAS,wDAAK;AACd;AACA;AACA,GAAG;AACH;AACA,EAAE;AACF;AACA,SAAS,wDAAK;AACd;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;;;;;;;;;;;;;ACzYA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE4C;AACE;;AAEM;;AAEpD;AACA;AACA;AACA;AACA;AACe,0BAA0B,yDAAM;AAC/C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oBAAoB,2DAAU;;AAE9B;AACA;AACA,UAAU,6DAAa;AACvB;AACA,IAAI;;AAEJ;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI;;AAEJ;AACA,GAAG;AACH;AACA;;;;;;;;;;;;;AC5DA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEoC;AACc;AACV;;AAEzB;AACf,CAAC,6DAAS;AACV,CAAC,2EAAgB;AACjB,CAAC,iEAAW;AACZ,CAAC,EAAC;;;;;;;;;;;;;ACjBF;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE6C;AAC+C;;AAE5F;AACA;AACA;AACA,iCAAiC,0DAA0D;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACe,qCAAqC,0DAAO;AAC3D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,WAAW,gCAAgC;AAC3C,aAAa;AACb;AACA;AACA;;AAEA;AACA,GAAG,mFAAsB;AACzB;;AAEA;AACA;AACA,WAAW,gGAAgG;AAC3G,WAAW,kCAAkC;AAC7C,WAAW,gCAAgC;AAC3C,aAAa;AACb;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,gGAAgG;AAC3G,WAAW,gCAAgC;AAC3C,aAAa;AACb;AACA,kBAAkB,yFAA4B;;AAE9C;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACvFA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE6C;;AAE7C;AACA;AACA;AACA,iCAAiC,0DAA0D;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA;AACe,qCAAqC,0DAAO;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,WAAW,wCAAwC;AACnD,aAAa;AACb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;AC/DA,UAAU,mBAAO,CAAC,6JAA8E;AAChG,0BAA0B,mBAAO,CAAC,kJAA+E;;AAEjH;;AAEA;AACA,0BAA0B,QAAS;AACnC;;AAEA,eAAe,+CAA+C;;AAE9D;AACA;;AAEA;;;;AAIA,sC;;;;;;;;;;;;AClBA;AAAe,utBAAwpB,E;;;;;;;;;;;ACAvqB,0H;;;;;;;;;;;ACAA,wH;;;;;;;;;;;ACAA,2H;;;;;;;;;;;ACAA,4H;;;;;;;;;;;ACAA,+B","file":"html-embed.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/index.js\");\n","module.exports = \".ck-widget.raw-html-embed{margin:1em auto;position:relative;display:flow-root}.ck-widget.raw-html-embed:before{position:absolute;z-index:1}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{position:absolute;display:flex;flex-direction:column}.ck-widget.raw-html-embed .raw-html-embed__preview{position:relative;overflow:hidden;display:flex}.ck-widget.raw-html-embed .raw-html-embed__preview-content{width:100%;position:relative;margin:auto;display:table;border-collapse:separate;border-spacing:7px}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.ck-content .raw-html-embed{margin:1em auto;min-width:15em;font-style:normal}:root{--ck-html-embed-content-width:calc(100% - var(--ck-icon-size)*1.5);--ck-html-embed-source-height:10em;--ck-html-embed-unfocused-outline-width:1px;--ck-html-embed-content-min-height:calc(var(--ck-icon-size) + var(--ck-spacing-standard));--ck-html-embed-source-disabled-background:var(--ck-color-base-foreground);--ck-html-embed-source-disabled-color:hsl(0deg 0% 45%)}.ck-widget.raw-html-embed{font-size:var(--ck-font-size-base);background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed:not(.ck-widget_selected):not(:hover){outline:var(--ck-html-embed-unfocused-outline-width) dashed var(--ck-color-widget-blurred-border)}.ck-widget.raw-html-embed[dir=ltr]{text-align:left}.ck-widget.raw-html-embed[dir=rtl]{text-align:right}.ck-widget.raw-html-embed:before{content:attr(data-html-embed-label);top:calc(var(--ck-html-embed-unfocused-outline-width)*-1);left:var(--ck-spacing-standard);background:hsl(0deg 0% 60%);transition:background var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);padding:calc(var(--ck-spacing-tiny) + var(--ck-html-embed-unfocused-outline-width)) var(--ck-spacing-small) var(--ck-spacing-tiny);border-radius:0 0 var(--ck-border-radius) var(--ck-border-radius);color:var(--ck-color-base-background);font-size:var(--ck-font-size-tiny);font-family:var(--ck-font-face)}.ck-widget.raw-html-embed[dir=rtl]:before{left:auto;right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed[dir=ltr] .ck-widget__type-around .ck-widget__type-around__button.ck-widget__type-around__button_before{margin-left:50px}.ck.ck-editor__editable.ck-blurred .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck.ck-editor__editable:not(.ck-blurred) .ck-widget.raw-html-embed.ck-widget_selected:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small);background:var(--ck-color-focus-border)}.ck.ck-editor__editable .ck-widget.raw-html-embed:not(.ck-widget_selected):hover:before{top:0;padding:var(--ck-spacing-tiny) var(--ck-spacing-small)}.ck-widget.raw-html-embed .raw-html-embed__content-wrapper{padding:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper{top:var(--ck-spacing-standard);right:var(--ck-spacing-standard)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__save-button{color:var(--ck-color-button-save)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button.raw-html-embed__cancel-button{color:var(--ck-color-button-cancel)}.ck-widget.raw-html-embed .raw-html-embed__buttons-wrapper .ck-button:not(:first-child){margin-top:var(--ck-spacing-small)}.ck-widget.raw-html-embed[dir=rtl] .raw-html-embed__buttons-wrapper{left:var(--ck-spacing-standard);right:auto}.ck-widget.raw-html-embed .raw-html-embed__source{box-sizing:border-box;height:var(--ck-html-embed-source-height);width:var(--ck-html-embed-content-width);resize:none;min-width:0;padding:var(--ck-spacing-standard);font-family:monospace;tab-size:4;white-space:pre-wrap;font-size:var(--ck-font-size-base);text-align:left;direction:ltr}.ck-widget.raw-html-embed .raw-html-embed__source[disabled]{background:var(--ck-html-embed-source-disabled-background);color:var(--ck-html-embed-source-disabled-color);-webkit-text-fill-color:var(--ck-html-embed-source-disabled-color);opacity:1}.ck-widget.raw-html-embed .raw-html-embed__preview{min-height:var(--ck-html-embed-content-min-height);width:var(--ck-html-embed-content-width)}.ck-editor__editable:not(.ck-read-only) .ck-widget.raw-html-embed .raw-html-embed__preview{pointer-events:none}.ck-widget.raw-html-embed .raw-html-embed__preview-content{box-sizing:border-box;text-align:center;background-color:var(--ck-color-base-foreground)}.ck-widget.raw-html-embed .raw-html-embed__preview-content>*{margin-left:auto;margin-right:auto}.ck-widget.raw-html-embed .raw-html-embed__preview-placeholder{color:var(--ck-html-embed-source-disabled-color)}\"","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>\n // tags it will allow on a page\n\n if (!options.singleton && typeof options.singleton !== 'boolean') {\n options.singleton = isOldIE();\n }\n\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n if (Object.prototype.toString.call(newList) !== '[object Array]') {\n return;\n }\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDom[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDom[_index].references === 0) {\n stylesInDom[_index].updater();\n\n stylesInDom.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed/htmlembed\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { Widget } from 'ckeditor5/src/widget';\n\nimport HtmlEmbedEditing from './htmlembedediting';\nimport HtmlEmbedUI from './htmlembedui';\n\n/**\n * The HTML embed feature.\n *\n * It allows inserting HTML snippets directly into the editor.\n *\n * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class HtmlEmbed extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get requires() {\n\t\treturn [ HtmlEmbedEditing, HtmlEmbedUI, Widget ];\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'HtmlEmbed';\n\t}\n}\n\n/**\n * The configuration of the HTML embed feature.\n *\n *\t\tClassicEditor\n *\t\t\t.create( editorElement, {\n * \t\t\t\thtmlEmbed: ... // HTML embed feature options.\n *\t\t\t} )\n *\t\t\t.then( ... )\n *\t\t\t.catch( ... );\n *\n * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.\n *\n * @interface HtmlEmbedConfig\n */\n\n/**\n * Whether the feature should render previews of the embedded HTML.\n *\n * When set to `true`, the feature will produce a preview of the inserted HTML based on a sanitized\n * version of the HTML provided by the user.\n *\n * The function responsible for sanitizing the HTML needs to be specified in\n * {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml `config.htmlEmbed.sanitizeHtml()`}.\n *\n * Read more about the security aspect of this feature in the {@glink features/html-embed#security \"Security\"} section of\n * the {@glink features/html-embed HTML embed} feature guide.\n *\n * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews=false]\n */\n\n/**\n * Callback used to sanitize the HTML provided by the user when generating previews of it in the editor.\n *\n * We strongly recommend overwriting the default function to avoid XSS vulnerabilities.\n *\n * Read more about the security aspect of this feature in the {@glink features/html-embed#security \"Security\"} section of\n * the {@glink features/html-embed HTML embed} feature guide.\n *\n * The function receives the input HTML (as a string), and should return an object\n * that matches the {@link module:html-embed/htmlembed~HtmlEmbedSanitizeOutput} interface.\n *\n * \tClassicEditor\n * \t\t\t.create( editorElement, {\n * \t\t\t\thtmlEmbed: {\n * \t\t\t\t\tshowPreviews: true,\n * \t\t\t\t\tsanitizeHtml( inputHtml ) {\n * \t\t\t\t\t\t// Strip unsafe elements and attributes, e.g.:\n * \t\t\t\t\t\t// the `<script>` elements and `on*` attributes.\n * \t\t\t\t\t\tconst outputHtml = sanitize( inputHtml );\n *\n * \t\t\t\t\t\treturn {\n * \t\t\t\t\t\t\thtml: outputHtml,\n *\t\t\t\t\t\t\t// true or false depending on whether the sanitizer stripped anything.\n * \t\t\t\t\t\t\thasChanged: ...\n * \t\t\t\t\t\t};\n * \t\t\t\t\t},\n * \t\t\t\t}\n * \t\t\t} )\n * \t\t\t.then( ... )\n * \t\t\t.catch( ... );\n *\n * **Note:** The function is used only when the feature\n * {@link module:html-embed/htmlembed~HtmlEmbedConfig#showPreviews is configured to render previews}.\n *\n * @member {Function} [module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml]\n */\n\n/**\n * An object returned by the {@link module:html-embed/htmlembed~HtmlEmbedConfig#sanitizeHtml} function.\n *\n * @interface HtmlEmbedSanitizeOutput\n */\n\n/**\n * An output (safe) HTML that will be inserted into the {@glink framework/guides/architecture/editing-engine editing view}.\n *\n * @member {String} module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#html\n */\n\n/**\n * A flag that indicates whether the output HTML is different than the input value.\n *\n * @member {Boolean} [module:html-embed/htmlembed~HtmlEmbedSanitizeOutput#hasChanged]\n */\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed/htmlembedediting\n */\n\nimport { Plugin, icons } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\nimport { toWidget } from 'ckeditor5/src/widget';\nimport { logWarning, createElement } from 'ckeditor5/src/utils';\n\nimport InsertHtmlEmbedCommand from './inserthtmlembedcommand';\nimport UpdateHtmlEmbedCommand from './updatehtmlembedcommand';\n\nimport '../theme/htmlembed.css';\n\n/**\n * The HTML embed editing feature.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class HtmlEmbedEditing extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'HtmlEmbedEditing';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tconstructor( editor ) {\n\t\tsuper( editor );\n\n\t\teditor.config.define( 'htmlEmbed', {\n\t\t\tshowPreviews: false,\n\t\t\tsanitizeHtml: rawHtml => {\n\t\t\t\t/**\n\t\t\t\t * When using the HTML embed feature with the `htmlEmbed.showPreviews=true` option, it is strongly recommended to\n\t\t\t\t * define a sanitize function that will clean up the input HTML in order to avoid XSS vulnerability.\n\t\t\t\t *\n\t\t\t\t * For a detailed overview, check the {@glink features/html-embed HTML embed feature} documentation.\n\t\t\t\t *\n\t\t\t\t * @error html-embed-provide-sanitize-function\n\t\t\t\t */\n\t\t\t\tlogWarning( 'html-embed-provide-sanitize-function' );\n\n\t\t\t\treturn {\n\t\t\t\t\thtml: rawHtml,\n\t\t\t\t\thasChanged: false\n\t\t\t\t};\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst schema = editor.model.schema;\n\n\t\tschema.register( 'rawHtml', {\n\t\t\tisObject: true,\n\t\t\tallowWhere: '$block',\n\t\t\tallowAttributes: [ 'value' ]\n\t\t} );\n\n\t\teditor.commands.add( 'updateHtmlEmbed', new UpdateHtmlEmbedCommand( editor ) );\n\t\teditor.commands.add( 'insertHtmlEmbed', new InsertHtmlEmbedCommand( editor ) );\n\n\t\tthis._setupConversion();\n\t}\n\n\t/**\n\t * Prepares converters for the feature.\n\t *\n\t * @private\n\t */\n\t_setupConversion() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\t\tconst view = editor.editing.view;\n\n\t\tconst htmlEmbedConfig = editor.config.get( 'htmlEmbed' );\n\n\t\t// Register div.raw-html-embed as a raw content element so all of it's content will be provided\n\t\t// as a view element's custom property while data upcasting.\n\t\teditor.data.registerRawContentMatcher( {\n\t\t\tname: 'div',\n\t\t\tclasses: 'raw-html-embed'\n\t\t} );\n\n\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t\t\tview: {\n\t\t\t\tname: 'div',\n\t\t\t\tclasses: 'raw-html-embed'\n\t\t\t},\n\t\t\tmodel: ( viewElement, { writer } ) => {\n\t\t\t\t// The div.raw-html-embed is registered as a raw content element,\n\t\t\t\t// so all it's content is available in a custom property.\n\t\t\t\treturn writer.createElement( 'rawHtml', {\n\t\t\t\t\tvalue: viewElement.getCustomProperty( '$rawContent' )\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\teditor.conversion.for( 'dataDowncast' ).elementToElement( {\n\t\t\tmodel: 'rawHtml',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\treturn writer.createRawElement( 'div', { class: 'raw-html-embed' }, function( domElement ) {\n\t\t\t\t\tdomElement.innerHTML = modelElement.getAttribute( 'value' ) || '';\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\teditor.conversion.for( 'editingDowncast' ).elementToElement( {\n\t\t\ttriggerBy: {\n\t\t\t\tattributes: [ 'value' ]\n\t\t\t},\n\t\t\tmodel: 'rawHtml',\n\t\t\tview: ( modelElement, { writer } ) => {\n\t\t\t\tlet domContentWrapper, state, props;\n\n\t\t\t\tconst viewContainer = writer.createContainerElement( 'div', {\n\t\t\t\t\tclass: 'raw-html-embed',\n\t\t\t\t\t'data-html-embed-label': t( 'HTML snippet' ),\n\t\t\t\t\tdir: editor.locale.uiLanguageDirection\n\t\t\t\t} );\n\t\t\t\t// Widget cannot be a raw element because the widget system would not be able\n\t\t\t\t// to add its UI to it. Thus, we need this wrapper.\n\t\t\t\tconst viewContentWrapper = writer.createRawElement( 'div', {\n\t\t\t\t\tclass: 'raw-html-embed__content-wrapper'\n\t\t\t\t}, function( domElement ) {\n\t\t\t\t\tdomContentWrapper = domElement;\n\n\t\t\t\t\trenderContent( { domElement, editor, state, props } );\n\n\t\t\t\t\t// Since there is a `data-cke-ignore-events` attribute set on the wrapper element in the editable mode,\n\t\t\t\t\t// the explicit `mousedown` handler on the `capture` phase is needed to move the selection onto the whole\n\t\t\t\t\t// HTML embed widget.\n\t\t\t\t\tdomContentWrapper.addEventListener( 'mousedown', () => {\n\t\t\t\t\t\tif ( state.isEditable ) {\n\t\t\t\t\t\t\tconst model = editor.model;\n\t\t\t\t\t\t\tconst selectedElement = model.document.selection.getSelectedElement();\n\n\t\t\t\t\t\t\t// Move the selection onto the whole HTML embed widget if it's currently not selected.\n\t\t\t\t\t\t\tif ( selectedElement !== modelElement ) {\n\t\t\t\t\t\t\t\tmodel.change( writer => writer.setSelection( modelElement, 'on' ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}, true );\n\t\t\t\t} );\n\n\t\t\t\t// API exposed on each raw HTML embed widget so other features can control a particular widget.\n\t\t\t\tconst rawHtmlApi = {\n\t\t\t\t\tmakeEditable() {\n\t\t\t\t\t\tstate = Object.assign( {}, state, {\n\t\t\t\t\t\t\tisEditable: true\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\trenderContent( { domElement: domContentWrapper, editor, state, props } );\n\n\t\t\t\t\t\tview.change( writer => {\n\t\t\t\t\t\t\twriter.setAttribute( 'data-cke-ignore-events', 'true', viewContentWrapper );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// This could be potentially pulled to a separate method called focusTextarea().\n\t\t\t\t\t\tdomContentWrapper.querySelector( 'textarea' ).focus();\n\t\t\t\t\t},\n\t\t\t\t\tsave( newValue ) {\n\t\t\t\t\t\t// If the value didn't change, we just cancel. If it changed,\n\t\t\t\t\t\t// it's enough to update the model – the entire widget will be reconverted.\n\t\t\t\t\t\tif ( newValue !== state.getRawHtmlValue() ) {\n\t\t\t\t\t\t\teditor.execute( 'updateHtmlEmbed', newValue );\n\t\t\t\t\t\t\teditor.editing.view.focus();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\tcancel() {\n\t\t\t\t\t\tstate = Object.assign( {}, state, {\n\t\t\t\t\t\t\tisEditable: false\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\trenderContent( { domElement: domContentWrapper, editor, state, props } );\n\t\t\t\t\t\teditor.editing.view.focus();\n\n\t\t\t\t\t\tview.change( writer => {\n\t\t\t\t\t\t\twriter.removeAttribute( 'data-cke-ignore-events', viewContentWrapper );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tstate = {\n\t\t\t\t\tshowPreviews: htmlEmbedConfig.showPreviews,\n\t\t\t\t\tisEditable: false,\n\t\t\t\t\tgetRawHtmlValue: () => modelElement.getAttribute( 'value' ) || ''\n\t\t\t\t};\n\n\t\t\t\tprops = {\n\t\t\t\t\tsanitizeHtml: htmlEmbedConfig.sanitizeHtml,\n\t\t\t\t\ttextareaPlaceholder: t( 'Paste raw HTML here...' ),\n\n\t\t\t\t\tonEditClick() {\n\t\t\t\t\t\trawHtmlApi.makeEditable();\n\t\t\t\t\t},\n\t\t\t\t\tonSaveClick( newValue ) {\n\t\t\t\t\t\trawHtmlApi.save( newValue );\n\t\t\t\t\t},\n\t\t\t\t\tonCancelClick() {\n\t\t\t\t\t\trawHtmlApi.cancel();\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\twriter.insert( writer.createPositionAt( viewContainer, 0 ), viewContentWrapper );\n\n\t\t\t\twriter.setCustomProperty( 'rawHtmlApi', rawHtmlApi, viewContainer );\n\t\t\t\twriter.setCustomProperty( 'rawHtml', true, viewContainer );\n\n\t\t\t\treturn toWidget( viewContainer, writer, {\n\t\t\t\t\twidgetLabel: t( 'HTML snippet' ),\n\t\t\t\t\thasSelectionHandle: true\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\tfunction renderContent( { domElement, editor, state, props } ) {\n\t\t\t// Remove all children;\n\t\t\tdomElement.textContent = '';\n\n\t\t\tconst domDocument = domElement.ownerDocument;\n\t\t\tlet domTextarea;\n\n\t\t\tif ( state.isEditable ) {\n\t\t\t\tconst textareaProps = {\n\t\t\t\t\tisDisabled: false,\n\t\t\t\t\tplaceholder: props.textareaPlaceholder\n\t\t\t\t};\n\n\t\t\t\tdomTextarea = createDomTextarea( { domDocument, state, props: textareaProps } );\n\n\t\t\t\tdomElement.append( domTextarea );\n\t\t\t} else if ( state.showPreviews ) {\n\t\t\t\tconst previewContainerProps = {\n\t\t\t\t\tsanitizeHtml: props.sanitizeHtml\n\t\t\t\t};\n\n\t\t\t\tdomElement.append( createPreviewContainer( { domDocument, state, props: previewContainerProps, editor } ) );\n\t\t\t} else {\n\t\t\t\tconst textareaProps = {\n\t\t\t\t\tisDisabled: true,\n\t\t\t\t\tplaceholder: props.textareaPlaceholder\n\t\t\t\t};\n\n\t\t\t\tdomElement.append( createDomTextarea( { domDocument, state, props: textareaProps } ) );\n\t\t\t}\n\n\t\t\tconst buttonsWrapperProps = {\n\t\t\t\tonEditClick: props.onEditClick,\n\t\t\t\tonSaveClick: () => {\n\t\t\t\t\tprops.onSaveClick( domTextarea.value );\n\t\t\t\t},\n\t\t\t\tonCancelClick: props.onCancelClick\n\t\t\t};\n\t\t\tdomElement.prepend( createDomButtonsWrapper( { editor, domDocument, state, props: buttonsWrapperProps } ) );\n\t\t}\n\n\t\tfunction createDomButtonsWrapper( { editor, domDocument, state, props } ) {\n\t\t\tconst domButtonsWrapper = createElement( domDocument, 'div', {\n\t\t\t\tclass: 'raw-html-embed__buttons-wrapper'\n\t\t\t} );\n\t\t\t// TODO these should be cached and we should only clone here these cached nodes!\n\t\t\tconst domEditButton = createDomButton( editor, 'edit' );\n\t\t\tconst domSaveButton = createDomButton( editor, 'save' );\n\t\t\tconst domCancelButton = createDomButton( editor, 'cancel' );\n\n\t\t\tif ( state.isEditable ) {\n\t\t\t\tconst clonedDomSaveButton = domSaveButton.cloneNode( true );\n\t\t\t\tconst clonedDomCancelButton = domCancelButton.cloneNode( true );\n\n\t\t\t\tclonedDomSaveButton.addEventListener( 'click', evt => {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\tprops.onSaveClick( );\n\t\t\t\t} );\n\n\t\t\t\tclonedDomCancelButton.addEventListener( 'click', evt => {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\tprops.onCancelClick( );\n\t\t\t\t} );\n\n\t\t\t\tdomButtonsWrapper.appendChild( clonedDomSaveButton );\n\t\t\t\tdomButtonsWrapper.appendChild( clonedDomCancelButton );\n\t\t\t} else {\n\t\t\t\tconst clonedDomEditButton = domEditButton.cloneNode( true );\n\n\t\t\t\tclonedDomEditButton.addEventListener( 'click', evt => {\n\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\tprops.onEditClick();\n\t\t\t\t} );\n\n\t\t\t\tdomButtonsWrapper.appendChild( clonedDomEditButton );\n\t\t\t}\n\n\t\t\treturn domButtonsWrapper;\n\t\t}\n\n\t\tfunction createDomTextarea( { domDocument, state, props } ) {\n\t\t\tconst domTextarea = createElement( domDocument, 'textarea', {\n\t\t\t\tplaceholder: props.placeholder,\n\t\t\t\tclass: 'ck ck-reset ck-input ck-input-text raw-html-embed__source'\n\t\t\t} );\n\n\t\t\tdomTextarea.disabled = props.isDisabled;\n\t\t\tdomTextarea.value = state.getRawHtmlValue();\n\n\t\t\treturn domTextarea;\n\t\t}\n\n\t\tfunction createPreviewContainer( { domDocument, state, props, editor } ) {\n\t\t\tconst sanitizedOutput = props.sanitizeHtml( state.getRawHtmlValue() );\n\t\t\tconst placeholderText = state.getRawHtmlValue().length > 0 ?\n\t\t\t\tt( 'No preview available' ) :\n\t\t\t\tt( 'Empty snippet content' );\n\n\t\t\tconst domPreviewPlaceholder = createElement( domDocument, 'div', {\n\t\t\t\tclass: 'ck ck-reset_all raw-html-embed__preview-placeholder'\n\t\t\t}, placeholderText );\n\n\t\t\tconst domPreviewContent = createElement( domDocument, 'div', {\n\t\t\t\tclass: 'raw-html-embed__preview-content',\n\t\t\t\tdir: editor.locale.contentLanguageDirection\n\t\t\t} );\n\n\t\t\tdomPreviewContent.innerHTML = sanitizedOutput.html;\n\n\t\t\tconst domPreviewContainer = createElement( domDocument, 'div', {\n\t\t\t\tclass: 'raw-html-embed__preview'\n\t\t\t}, [\n\t\t\t\tdomPreviewPlaceholder, domPreviewContent\n\t\t\t] );\n\n\t\t\treturn domPreviewContainer;\n\t\t}\n\t}\n}\n\n// Returns a toggle mode button DOM element that can be cloned and used in conversion.\n//\n// @param {module:utils/locale~Locale} locale Editor locale.\n// @param {'edit'|'save'|'cancel'} type Type of button to create.\n// @returns {HTMLElement}\nfunction createDomButton( editor, type ) {\n\tconst t = editor.locale.t;\n\tconst buttonView = new ButtonView( editor.locale );\n\tconst command = editor.commands.get( 'updateHtmlEmbed' );\n\n\tbuttonView.set( {\n\t\ttooltipPosition: editor.locale.uiLanguageDirection === 'rtl' ? 'e' : 'w',\n\t\ticon: icons.pencil,\n\t\ttooltip: true\n\t} );\n\n\tbuttonView.render();\n\n\tif ( type === 'edit' ) {\n\t\tbuttonView.set( {\n\t\t\ticon: icons.pencil,\n\t\t\tlabel: t( 'Edit source' ),\n\t\t\tclass: 'raw-html-embed__edit-button'\n\t\t} );\n\t} else if ( type === 'save' ) {\n\t\tbuttonView.set( {\n\t\t\ticon: icons.check,\n\t\t\tlabel: t( 'Save changes' ),\n\t\t\tclass: 'raw-html-embed__save-button'\n\t\t} );\n\t\tbuttonView.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\t} else {\n\t\tbuttonView.set( {\n\t\t\ticon: icons.cancel,\n\t\t\tlabel: t( 'Cancel' ),\n\t\t\tclass: 'raw-html-embed__cancel-button'\n\t\t} );\n\t}\n\n\tbuttonView.destroy();\n\n\treturn buttonView.element.cloneNode( true );\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed/htmlembedui\n */\n\nimport { Plugin } from 'ckeditor5/src/core';\nimport { ButtonView } from 'ckeditor5/src/ui';\n\nimport htmlEmbedIcon from '../theme/icons/html.svg';\n\n/**\n * The HTML embed UI plugin.\n *\n * @extends module:core/plugin~Plugin\n */\nexport default class HtmlEmbedUI extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get pluginName() {\n\t\treturn 'HtmlEmbedUI';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst t = editor.t;\n\n\t\t// Add the `htmlEmbed` button to feature components.\n\t\teditor.ui.componentFactory.add( 'htmlEmbed', locale => {\n\t\t\tconst command = editor.commands.get( 'insertHtmlEmbed' );\n\t\t\tconst view = new ButtonView( locale );\n\n\t\t\tview.set( {\n\t\t\t\tlabel: t( 'Insert HTML' ),\n\t\t\t\ticon: htmlEmbedIcon,\n\t\t\t\ttooltip: true\n\t\t\t} );\n\n\t\t\tview.bind( 'isEnabled' ).to( command, 'isEnabled' );\n\n\t\t\t// Execute the command.\n\t\t\tthis.listenTo( view, 'execute', () => {\n\t\t\t\teditor.execute( 'insertHtmlEmbed' );\n\t\t\t\teditor.editing.view.focus();\n\n\t\t\t\tconst widgetWrapper = editor.editing.view.document.selection.getSelectedElement();\n\n\t\t\t\twidgetWrapper.getCustomProperty( 'rawHtmlApi' ).makeEditable();\n\t\t\t} );\n\n\t\t\treturn view;\n\t\t} );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed\n */\n\nimport HtmlEmbed from './htmlembed';\nimport HtmlEmbedEditing from './htmlembedediting';\nimport HtmlEmbedUI from './htmlembedui';\n\nexport default {\n\tHtmlEmbed,\n\tHtmlEmbedEditing,\n\tHtmlEmbedUI\n};\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed/inserthtmlembedcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\nimport { findOptimalInsertionPosition, checkSelectionOnObject } from 'ckeditor5/src/widget';\n\n/**\n * The insert HTML embed element command.\n *\n * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'insertHtmlEmbed'`.\n *\n * To insert the HTML embed element at the current selection, execute the command:\n *\n *\t\teditor.execute( 'insertHtmlEmbed' );\n *\n * @extends module:core/command~Command\n */\nexport default class InsertHtmlEmbedCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tthis.isEnabled = isHtmlEmbedAllowed( this.editor.model );\n\t}\n\n\t/**\n\t * Executes the command, which creates and inserts a new HTML embed element.\n\t *\n\t * @fires execute\n\t */\n\texecute() {\n\t\tconst model = this.editor.model;\n\n\t\tmodel.change( writer => {\n\t\t\tconst rawHtmlElement = writer.createElement( 'rawHtml' );\n\n\t\t\tmodel.insertContent( rawHtmlElement );\n\t\t\twriter.setSelection( rawHtmlElement, 'on' );\n\t\t} );\n\t}\n}\n\n// Checks if the `htmlEmbed` element can be inserted at the current model selection.\n//\n// @param {module:engine/model/model~Model} model\n// @returns {Boolean}\nfunction isHtmlEmbedAllowed( model ) {\n\tconst schema = model.schema;\n\tconst selection = model.document.selection;\n\n\treturn isHtmlEmbedAllowedInParent( selection, schema, model ) &&\n\t\t!checkSelectionOnObject( selection, schema );\n}\n\n// Checks if an HTML embed is allowed by the schema in the optimal insertion parent.\n//\n// @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n// @param {module:engine/model/schema~Schema} schema\n// @param {module:engine/model/model~Model} model Model instance.\n// @returns {Boolean}\nfunction isHtmlEmbedAllowedInParent( selection, schema, model ) {\n\tconst parent = getInsertPageBreakParent( selection, model );\n\n\treturn schema.checkChild( parent, 'rawHtml' );\n}\n\n// Returns a node that will be used to insert a page break with `model.insertContent` to check if a html embed element can be placed there.\n//\n// @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n// @param {module:engine/model/model~Model} model Model instance.\n// @returns {module:engine/model/element~Element}\nfunction getInsertPageBreakParent( selection, model ) {\n\tconst insertAt = findOptimalInsertionPosition( selection, model );\n\n\tconst parent = insertAt.parent;\n\n\tif ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {\n\t\treturn parent.parent;\n\t}\n\n\treturn parent;\n}\n","/**\n * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module html-embed/updatehtmlembedcommand\n */\n\nimport { Command } from 'ckeditor5/src/core';\n\n/**\n * The update HTML embed value command.\n *\n * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'updateHtmlEmbed'`.\n *\n * To update the value of the HTML embed element at the current selection, execute the command:\n *\n *\t\teditor.execute( 'updateHtmlEmbed', '<b>HTML.</b>' );\n *\n * @extends module:core/command~Command\n */\nexport default class UpdateHtmlEmbedCommand extends Command {\n\t/**\n\t * @inheritDoc\n\t */\n\trefresh() {\n\t\tconst model = this.editor.model;\n\t\tconst selection = model.document.selection;\n\t\tconst rawHtmlElement = getSelectedRawHtmlModelWidget( selection );\n\n\t\tthis.isEnabled = !!rawHtmlElement;\n\t}\n\n\t/**\n\t * Executes the command, which updates the `value` attribute of the embedded HTML element:\n\t *\n\t * @fires execute\n\t * @param {String} value HTML as a string.\n\t */\n\texecute( value ) {\n\t\tconst model = this.editor.model;\n\t\tconst selection = model.document.selection;\n\t\tconst selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );\n\n\t\tmodel.change( writer => {\n\t\t\twriter.setAttribute( 'value', value, selectedRawHtmlElement );\n\t\t} );\n\t}\n}\n\n// Returns the selected HTML embed element in the model, if any.\n//\n// @param {module:engine/model/selection~Selection} selection\n// @returns {module:engine/model/element~Element|null}\nfunction getSelectedRawHtmlModelWidget( selection ) {\n\tconst selectedElement = selection.getSelectedElement();\n\n\tif ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {\n\t\treturn selectedElement;\n\t}\n\n\treturn null;\n}\n","var api = require(\"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../../node_modules/postcss-loader/src/index.js??ref--5-1!./htmlembed.css\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {\"injectType\":\"singletonStyleTag\",\"attributes\":{\"data-cke\":true}};\n\noptions.insert = \"head\";\noptions.singleton = true;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","export default \"<svg viewBox=\\\"0 0 20 20\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M17 0a2 2 0 0 1 2 2v7a1 1 0 0 1 1 1v5a1 1 0 0 1-.883.993l-.118.006L19 17a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2l-.001-1.001-.116-.006A1 1 0 0 1 0 15v-5a1 1 0 0 1 .999-1L1 2a2 2 0 0 1 2-2h14zm.499 15.999h-15L2.5 17a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5l-.001-1.001zm-3.478-6.013l-.014.014H14v.007l-1.525 1.525-1.46-1.46-.015.013V10h-1v5h1v-3.53l1.428 1.43.048.043.131-.129L14 11.421V15h1v-5h-.965l-.014-.014zM2 10H1v5h1v-2h2v2h1v-5H4v2H2v-2zm7 0H6v1h1v4h1v-4h1v-1zm8 0h-1v5h3v-1h-2v-4zm0-8.5H3a.5.5 0 0 0-.5.5l-.001 6.999h15L17.5 2a.5.5 0 0 0-.5-.5zM10 7v1H4V7h6zm3-2v1H4V5h9zm-3-2v1H4V3h6z\\\"/></svg>\";","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/utils.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/widget.js\");","module.exports = CKEditor5.dll;"],"sourceRoot":""}
@@ -1,79 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
-
6
- /**
7
- * @module html-embed/inserthtmlembedcommand
8
- */
9
-
10
- import { Command } from 'ckeditor5/src/core';
11
- import { findOptimalInsertionRange } from 'ckeditor5/src/widget';
12
-
13
- /**
14
- * The insert HTML embed element command.
15
- *
16
- * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'insertHtmlEmbed'`.
17
- *
18
- * To insert the HTML embed element at the current selection, execute the command:
19
- *
20
- * editor.execute( 'insertHtmlEmbed' );
21
- *
22
- * @extends module:core/command~Command
23
- */
24
- export default class InsertHtmlEmbedCommand extends Command {
25
- /**
26
- * @inheritDoc
27
- */
28
- refresh() {
29
- const model = this.editor.model;
30
- const schema = model.schema;
31
- const selection = model.document.selection;
32
-
33
- this.isEnabled = isHtmlEmbedAllowedInParent( selection, schema, model );
34
- }
35
-
36
- /**
37
- * Executes the command, which creates and inserts a new HTML embed element.
38
- *
39
- * @fires execute
40
- */
41
- execute() {
42
- const model = this.editor.model;
43
-
44
- model.change( writer => {
45
- const rawHtmlElement = writer.createElement( 'rawHtml' );
46
-
47
- model.insertContent( rawHtmlElement );
48
- writer.setSelection( rawHtmlElement, 'on' );
49
- } );
50
- }
51
- }
52
-
53
- // Checks if an HTML embed is allowed by the schema in the optimal insertion parent.
54
- //
55
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
56
- // @param {module:engine/model/schema~Schema} schema
57
- // @param {module:engine/model/model~Model} model Model instance.
58
- // @returns {Boolean}
59
- function isHtmlEmbedAllowedInParent( selection, schema, model ) {
60
- const parent = getInsertHtmlEmbedParent( selection, model );
61
-
62
- return schema.checkChild( parent, 'rawHtml' );
63
- }
64
-
65
- // Returns a node that will be used to insert a html embed with `model.insertContent` to check if a html embed element can be placed there.
66
- //
67
- // @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection
68
- // @param {module:engine/model/model~Model} model Model instance.
69
- // @returns {module:engine/model/element~Element}
70
- function getInsertHtmlEmbedParent( selection, model ) {
71
- const insertionRange = findOptimalInsertionRange( selection, model );
72
- const parent = insertionRange.start.parent;
73
-
74
- if ( parent.isEmpty && !parent.is( 'element', '$root' ) ) {
75
- return parent.parent;
76
- }
77
-
78
- return parent;
79
- }
@@ -1,64 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
-
6
- /**
7
- * @module html-embed/updatehtmlembedcommand
8
- */
9
-
10
- import { Command } from 'ckeditor5/src/core';
11
-
12
- /**
13
- * The update HTML embed value command.
14
- *
15
- * The command is registered by {@link module:html-embed/htmlembedediting~HtmlEmbedEditing} as `'updateHtmlEmbed'`.
16
- *
17
- * To update the value of the HTML embed element at the current selection, execute the command:
18
- *
19
- * editor.execute( 'updateHtmlEmbed', '<b>HTML.</b>' );
20
- *
21
- * @extends module:core/command~Command
22
- */
23
- export default class UpdateHtmlEmbedCommand extends Command {
24
- /**
25
- * @inheritDoc
26
- */
27
- refresh() {
28
- const model = this.editor.model;
29
- const selection = model.document.selection;
30
- const rawHtmlElement = getSelectedRawHtmlModelWidget( selection );
31
-
32
- this.isEnabled = !!rawHtmlElement;
33
- }
34
-
35
- /**
36
- * Executes the command, which updates the `value` attribute of the embedded HTML element:
37
- *
38
- * @fires execute
39
- * @param {String} value HTML as a string.
40
- */
41
- execute( value ) {
42
- const model = this.editor.model;
43
- const selection = model.document.selection;
44
- const selectedRawHtmlElement = getSelectedRawHtmlModelWidget( selection );
45
-
46
- model.change( writer => {
47
- writer.setAttribute( 'value', value, selectedRawHtmlElement );
48
- } );
49
- }
50
- }
51
-
52
- // Returns the selected HTML embed element in the model, if any.
53
- //
54
- // @param {module:engine/model/selection~Selection} selection
55
- // @returns {module:engine/model/element~Element|null}
56
- function getSelectedRawHtmlModelWidget( selection ) {
57
- const selectedElement = selection.getSelectedElement();
58
-
59
- if ( selectedElement && selectedElement.is( 'element', 'rawHtml' ) ) {
60
- return selectedElement;
61
- }
62
-
63
- return null;
64
- }