-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheditor-classic.js
4 lines (4 loc) · 10.4 KB
/
editor-classic.js
1
2
3
4
/*!
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var e={662:(e,t,o)=>{"use strict";o.d(t,{A:()=>r});var i=o(935),n=o.n(i)()((function(e){return e[1]}));n.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content{border:solid var(--ck-color-base-border);border-width:1px 1px 0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content.ck-sticky-panel__content_sticky{border-bottom-width:1px}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-menu-bar{border:0;border-bottom:1px solid var(--ck-color-base-border)}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content .ck-toolbar{border:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}",""]);const r=n},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=e(t);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,i){"string"==typeof e&&(e=[[null,e,""]]);var n={};if(i)for(var r=0;r<this.length;r++){var c=this[r][0];null!=c&&(n[c]=!0)}for(var a=0;a<e.length;a++){var s=[].concat(e[a]);i&&n[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),t.push(s))}},t}},591:(e,t,o)=>{"use strict";var i,n=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},r=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),c=[];function a(e){for(var t=-1,o=0;o<c.length;o++)if(c[o].identifier===e){t=o;break}return t}function s(e,t){for(var o={},i=[],n=0;n<e.length;n++){var r=e[n],s=t.base?r[0]+t.base:r[0],l=o[s]||0,d="".concat(s," ").concat(l);o[s]=l+1;var u=a(d),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==u?(c[u].references++,c[u].updater(h)):c.push({identifier:d,updater:k(h,t),references:1}),i.push(d)}return i}function l(e){var t=document.createElement("style"),i=e.attributes||{};if(void 0===i.nonce){var n=o.nc;n&&(i.nonce=n)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var c=r(e.insert||"head");if(!c)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");c.appendChild(t)}return t}var d,u=(d=[],function(e,t){return d[e]=t,d.filter(Boolean).join("\n")});function h(e,t,o,i){var n=o?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,n);else{var r=document.createTextNode(n),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(r,c[t]):e.appendChild(r)}}function p(e,t,o){var i=o.css,n=o.media,r=o.sourceMap;if(n?e.setAttribute("media",n):e.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}var f=null,b=0;function k(e,t){var o,i,n;if(t.singleton){var r=b++;o=f||(f=l(t)),i=h.bind(null,o,r,!1),n=h.bind(null,o,r,!0)}else o=l(t),i=p.bind(null,o,t),n=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(o)};return i(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;i(e=t)}else n()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=n());var o=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var i=0;i<o.length;i++){var n=a(o[i]);c[n].references--}for(var r=s(e,t),l=0;l<o.length;l++){var d=a(o[l]);0===c[d].references&&(c[d].updater(),c.splice(d,1))}o=r}}}},782:(e,t,o)=>{e.exports=o(237)("./src/core.js")},783:(e,t,o)=>{e.exports=o(237)("./src/engine.js")},311:(e,t,o)=>{e.exports=o(237)("./src/ui.js")},584:(e,t,o)=>{e.exports=o(237)("./src/utils.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(i){var n=t[i];if(void 0!==n)return n.exports;var r=t[i]={id:i,exports:{}};return e[i](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{ClassicEditor:()=>D});var e=o(311),t=o(783),n=o(584);class r extends e.EditorUI{constructor(t,o){super(t),this.view=o,this._toolbarConfig=(0,e.normalizeToolbarConfig)(t.config.get("toolbar")),this._elementReplacer=new n.ElementReplacer,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const o=this.editor,i=this.view,n=o.editing.view,r=i.editable,c=n.document.getRoot();r.name=c.rootName,i.render();const a=r.element;this.setEditableElement(r.name,a),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(a),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),i.menuBarView&&(0,e._initMenuBar)(o,i.menuBarView),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const e=this.view,t=this.editor.editing.view;this._elementReplacer.restore(),t.detachDomRoot(e.editable.name),e.destroy()}_initToolbar(){const e=this.view;e.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),e.stickyPanel.limiterElement=e.element,e.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:e})=>e||0)),e.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(e.toolbar)}_initPlaceholder(){const e=this.editor,o=e.editing.view,i=o.document.getRoot(),n=e.sourceElement;let r;const c=e.config.get("placeholder");c&&(r="string"==typeof c?c:c[this.view.editable.name]),!r&&n&&"textarea"===n.tagName.toLowerCase()&&(r=n.getAttribute("placeholder")),r&&(i.placeholder=r),(0,t.enablePlaceholder)({view:o,element:i,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(e,t,o){const i=this.view.stickyPanel;if(i.isSticky){const e=new n.Rect(i.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(i,"change:isSticky",e),setTimeout((()=>{this.stopListening(i,"change:isSticky",e)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const t=this.view.stickyPanel,o=this.editor.plugins.get("Dialog");o.on("show",(()=>{const i=o.view;i.on("moveTo",((o,r)=>{if(!t.isSticky||i.wasMoved)return;const c=new n.Rect(t.contentPanelElement);r[1]<c.bottom+e.DialogView.defaultOffset&&(r[1]=c.bottom+e.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var c=o(591),a=o.n(c),s=o(662),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.A,l);s.A.locals;class d extends e.BoxedEditorUIView{constructor(t,o,i={}){super(t),this.stickyPanel=new e.StickyPanelView(t),this.toolbar=new e.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),i.useMenuBar&&(this.menuBarView=new e.MenuBarView(t)),this.editable=new e.InlineEditableUIView(t,o)}render(){super.render(),this.menuBarView?this.stickyPanel.content.addMany([this.menuBarView,this.toolbar]):this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var u=o(782);const h=function(e){return null!=e&&"object"==typeof e};const p="object"==typeof global&&global&&global.Object===Object&&global;var f="object"==typeof self&&self&&self.Object===Object&&self;const b=(p||f||Function("return this")()).Symbol;var k=Object.prototype,v=k.hasOwnProperty,m=k.toString,g=b?b.toStringTag:void 0;const y=function(e){var t=v.call(e,g),o=e[g];try{e[g]=void 0;var i=!0}catch(e){}var n=m.call(e);return i&&(t?e[g]=o:delete e[g]),n};var w=Object.prototype.toString;const _=function(e){return w.call(e)};var T=b?b.toStringTag:void 0;const S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?y(e):_(e)};const j=function(e,t){return function(o){return e(t(o))}}(Object.getPrototypeOf,Object);var O=Function.prototype,P=Object.prototype,x=O.toString,E=P.hasOwnProperty,C=x.call(Object);const M=function(e){if(!h(e)||"[object Object]"!=S(e))return!1;var t=j(e);if(null===t)return!0;var o=E.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&x.call(o)==C};const B=function(e){return h(e)&&1===e.nodeType&&!M(e)};class D extends((0,u.ElementApiMixin)(u.Editor)){constructor(e,t={}){if(!F(e)&&void 0!==t.initialData)throw new n.CKEditorError("editor-create-initial-data",null);super(t),this.config.define("menuBar.isVisible",!1),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return F(e)?(0,n.getDataFromElement)(e):e}(e)),F(e)&&(this.sourceElement=e),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=this.config.get("menuBar"),c=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,useMenuBar:i.isVisible});this.ui=new r(this,c),(0,u.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((o=>{const i=new this(e,t);o(i.initPlugins().then((()=>i.ui.init(F(e)?e:null))).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function F(e){return B(e)}})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=i})();