ckeditor5-editor-classic-floating 41.2.0 → 41.3.1
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 +20 -20
- package/build/ckeditor5-editor-classic-floating.js +1 -1
- package/build/editor-classic.js +1 -1
- package/package.json +21 -19
- package/src/augmentation.d.ts +10 -0
- package/src/{editor/EditorConfig.js → augmentation.js} +1 -1
- package/src/{editor/ClassicFloatingEditor.d.ts → classiceditor.d.ts} +7 -8
- package/src/{editor/ClassicFloatingEditor.js → classiceditor.js} +12 -9
- package/src/{ui/ClassicFloatingEditorUI.d.ts → classiceditorui.d.ts} +16 -4
- package/src/{ui/ClassicFloatingEditorUI.js → classiceditorui.js} +36 -2
- package/src/{ui/ClassicFloatingEditorUIView.d.ts → classiceditoruiview.d.ts} +9 -4
- package/src/{ui/ClassicFloatingEditorUIView.js → classiceditoruiview.js} +14 -6
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/src/index.ts +3 -2
- package/src/{ui/panel/StickyPanelView.d.ts → stickypanelview.d.ts} +2 -2
- package/src/{ui/panel/StickyPanelView.js → stickypanelview.js} +3 -5
- package/src/editor/EditorConfig.d.ts +0 -12
- /package/theme/{classicfloatingeditor.css → classiceditor.css} +0 -0
package/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
CKEditor 5 classic editor implementation
|
|
2
|
-
========================================
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
5
|
-
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
-
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
-
|
|
8
|
-
The classic editor implementation for CKEditor 5.
|
|
9
|
-
|
|
10
|
-
This package contains the [`ClassicEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html) class. Follow there to learn more about this type of editor and how to initialize it.
|
|
11
|
-
|
|
12
|
-
This package contains the source version of the classic editor. This kind of editor implementation is also available as a ready-to-use [classic build](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-classic). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
13
|
-
|
|
14
|
-
## Documentation
|
|
15
|
-
|
|
16
|
-
See the [`@ckeditor/ckeditor5-editor-classic` package](https://ckeditor.com/docs/ckeditor5/latest/api/editor-classic.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
|
-
|
|
18
|
-
## License
|
|
19
|
-
|
|
20
|
-
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
1
|
+
CKEditor 5 classic editor implementation
|
|
2
|
+
========================================
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
5
|
+
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
+
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
+
|
|
8
|
+
The classic editor implementation for CKEditor 5.
|
|
9
|
+
|
|
10
|
+
This package contains the [`ClassicEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html) class. Follow there to learn more about this type of editor and how to initialize it.
|
|
11
|
+
|
|
12
|
+
This package contains the source version of the classic editor. This kind of editor implementation is also available as a ready-to-use [classic build](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-classic). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
13
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
See the [`@ckeditor/ckeditor5-editor-classic` package](https://ckeditor.com/docs/ckeditor5/latest/api/editor-classic.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{var t={404:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}",""]);const s=n},128:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}",""]);const s=n},849:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var s=0;s<this.length;s++){var r=this[s][0];null!=r&&(n[r]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);o&&n[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),e.push(l))}},e}},108:(t,e,i)=>{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function c(t){for(var e=-1,i=0;i<r.length;i++)if(r[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},o=[],n=0;n<t.length;n++){var s=t[n],l=e.base?s[0]+e.base:s[0],a=i[l]||0,h="".concat(l," ").concat(a);i[l]=a+1;var u=c(h),d={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(d)):r.push({identifier:h,updater:g(d,e),references:1}),o.push(h)}return o}function a(t){var e=document.createElement("style"),o=t.attributes||{};if(void 0===o.nonce){var n=i.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var r=s(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}return e}var h,u=(h=[],function(t,e){return h[t]=e,h.filter(Boolean).join("\n")});function d(t,e,i,o){var n=i?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=u(e,n);else{var s=document.createTextNode(n),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(s,r[e]):t.appendChild(s)}}function f(t,e,i){var o=i.css,n=i.media,s=i.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var i,o,n;if(e.singleton){var s=m++;i=p||(p=a(e)),o=d.bind(null,i,s,!1),n=d.bind(null,i,s,!0)}else i=a(e),o=f.bind(null,i,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<i.length;o++){var n=c(i[o]);r[n].references--}for(var s=l(t,e),a=0;a<i.length;a++){var h=c(i[a]);0===r[h].references&&(r[h].updater(),r.splice(h,1))}i=s}}}},968:(t,e,i)=>{t.exports=i(672)("./src/core.js")},684:(t,e,i)=>{t.exports=i(672)("./src/engine.js")},348:(t,e,i)=>{t.exports=i(672)("./src/ui.js")},316:(t,e,i)=>{t.exports=i(672)("./src/utils.js")},344:(t,e,i)=>{t.exports=i(672)("./src/watchdog.js")},672:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var o={};(()=>{"use strict";i.r(o),i.d(o,{ClassicFloatingEditor:()=>N});var t=i(348),e=i(684),n=i(316);class s extends t.EditorUI{constructor(e,i){super(e),this.view=i,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new n.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,o=e.editing.view,n=i.editable,s=o.document.getRoot();n.name=s.rootName,i.render();const r=n.element;this.setEditableElement(n.name,r),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let s;const r=t.config.get("placeholder");r&&(s="string"==typeof r?r:r[this.view.editable.name]),!s&&n&&"textarea"===n.tagName.toLowerCase()&&(s=n.getAttribute("placeholder")),s&&(o.placeholder=s),(0,e.enablePlaceholder)({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,i){const o=this.view.stickyPanel;if(o.isSticky){const t=new n.Rect(o.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(o,"change:isSticky",t),setTimeout((()=>{this.stopListening(o,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",(()=>{const o=i.view;o.on("moveTo",((i,s)=>{if(!e.isSticky||o.wasMoved)return;const r=new n.Rect(e.contentPanelElement);s[1]<r.bottom+t.DialogView.defaultOffset&&(s[1]=r.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var r=i(108),c=i.n(r),l=i(128),a={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};c()(l.c,a);l.c.locals;const h=(0,n.toUnit)("px");class u extends t.View{constructor(e,i,o){super(e);const s=this.bindTemplate;this.containerEl=i||n.global.window,this.panelAbsolute=!!o,this.set("position",null),this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:s.to("isSticky",(t=>t?"block":"none")),height:s.to("isSticky",(t=>t?h(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",s.if("isSticky","ck-sticky-panel__content_sticky"),s.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{position:s.to("position",(t=>t)),width:s.to("isSticky",(t=>t?h(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:s.to("_stickyTopOffset",(t=>t?h(t):t)),bottom:s.to("_stickyBottomOffset",(t=>t?h(t):t)),marginLeft:s.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(this.containerEl,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new n.Rect(this.limiterElement);let e=t.getVisible();if(e){const i=new n.Rect(this.containerEl);t.top-=i.top,t.bottom-=i.top,i.top+=this.viewportTopOffset,i.height-=this.viewportTopOffset,e=e.getIntersection(i)}if(e&&t.top<e.top){const i=e.top;if(i+this._contentPanelRect.height+this.limiterBottomOffset>e.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this.panelAbsolute||this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<t.height?this.panelAbsolute?t.top<0&&-t.top<t.height-this.limiterBottomOffset?this._stickToTopOfAncestors(-t.top,"absolute"):this._unstick():this._stickToTopOfAncestors(i):this._unstick()}else this._unstick()}_stickToTopOfAncestors(t,e=null){var i;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=h(-(null!==(i=this.containerEl.scrollX)&&void 0!==i?i:this.containerEl.scrollLeft)),this.position=e}_stickToBottomOfLimiter(t){var e;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=h(-(null!==(e=this.containerEl.scrollX)&&void 0!==e?e:this.containerEl.scrollLeft)),this.position=null}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null,this.position=null}get _contentPanelRect(){return new n.Rect(this.contentPanelElement)}}var d=i(404),f={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};c()(d.c,f);d.c.locals;class p extends t.BoxedEditorUIView{constructor(e,i,o={}){super(e),this.stickyPanel=new u(e,o.containerEl,o.panelAbsolute),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,i)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var m=i(968),g=i(344);const y=function(t){return null!=t&&"object"==typeof t};const v="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const k=(v||b||Function("return this")()).Symbol;var _=Object.prototype,w=_.hasOwnProperty,T=_.toString,O=k?k.toStringTag:void 0;const S=function(t){var e=w.call(t,O),i=t[O];try{t[O]=void 0;var o=!0}catch(t){}var n=T.call(t);return o&&(e?t[O]=i:delete t[O]),n};var E=Object.prototype.toString;const P=function(t){return E.call(t)};var j=k?k.toStringTag:void 0;const x=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?S(t):P(t)};const C=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var B=Function.prototype,R=Object.prototype,L=B.toString,A=R.hasOwnProperty,F=L.call(Object);const D=function(t){if(!y(t)||"[object Object]"!=x(t))return!1;var e=C(t);if(null===e)return!0;var i=A.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&L.call(i)==F};const I=function(t){return y(t)&&1===t.nodeType&&!D(t)};class M extends((0,m.ElementApiMixin)(m.Editor)){constructor(t,e={}){if(!W(t)&&void 0!==e.initialData)throw new n.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return W(t)?(0,n.getDataFromElement)(t):t}(t)),W(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new p(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,o),(0,m.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((i=>{const o=new this(t,e);i(o.initPlugins().then((()=>o.ui.init(W(t)?t:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}M.Context=m.Context,M.EditorWatchdog=g.EditorWatchdog,M.ContextWatchdog=g.ContextWatchdog;const N=M;function W(t){return I(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=o})();
|
|
4
|
+
*/(()=>{var t={662:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(935),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}",""]);const s=o},428:(t,e,i)=>{"use strict";i.d(e,{A:()=>s});var n=i(935),o=i.n(n)()((function(t){return t[1]}));o.push([t.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}",""]);const s=o},935:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,n){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(n)for(var s=0;s<this.length;s++){var r=this[s][0];null!=r&&(o[r]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);n&&o[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),e.push(l))}},e}},591:(t,e,i)=>{"use strict";var n,o=function(){return void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n},s=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function c(t){for(var e=-1,i=0;i<r.length;i++)if(r[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},n=[],o=0;o<t.length;o++){var s=t[o],l=e.base?s[0]+e.base:s[0],a=i[l]||0,h="".concat(l," ").concat(a);i[l]=a+1;var u=c(h),f={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(f)):r.push({identifier:h,updater:b(f,e),references:1}),n.push(h)}return n}function a(t){var e=document.createElement("style"),n=t.attributes||{};if(void 0===n.nonce){var o=i.nc;o&&(n.nonce=o)}if(Object.keys(n).forEach((function(t){e.setAttribute(t,n[t])})),"function"==typeof t.insert)t.insert(e);else{var r=s(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}return e}var h,u=(h=[],function(t,e){return h[t]=e,h.filter(Boolean).join("\n")});function f(t,e,i,n){var o=i?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(t.styleSheet)t.styleSheet.cssText=u(e,o);else{var s=document.createTextNode(o),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(s,r[e]):t.appendChild(s)}}function d(t,e,i){var n=i.css,o=i.media,s=i.sourceMap;if(o?t.setAttribute("media",o):t.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var p=null,m=0;function b(t,e){var i,n,o;if(e.singleton){var s=m++;i=p||(p=a(e)),n=f.bind(null,i,s,!1),o=f.bind(null,i,s,!0)}else i=a(e),n=d.bind(null,i,e),o=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return n(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;n(t=e)}else o()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=o());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var n=0;n<i.length;n++){var o=c(i[n]);r[o].references--}for(var s=l(t,e),a=0;a<i.length;a++){var h=c(i[a]);0===r[h].references&&(r[h].updater(),r.splice(h,1))}i=s}}}},782:(t,e,i)=>{t.exports=i(237)("./src/core.js")},783:(t,e,i)=>{t.exports=i(237)("./src/engine.js")},311:(t,e,i)=>{t.exports=i(237)("./src/ui.js")},584:(t,e,i)=>{t.exports=i(237)("./src/utils.js")},602:(t,e,i)=>{t.exports=i(237)("./src/watchdog.js")},237:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(n){var o=e[n];if(void 0!==o)return o.exports;var s=e[n]={id:n,exports:{}};return t[n](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{"use strict";i.r(n),i.d(n,{ClassicEditor:()=>Ht});var t=i(311),e=i(783),o=i(584);class s extends t.EditorUI{constructor(e,i){super(e),this.view=i,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._menuBarConfig=(0,t.normalizeMenuBarConfig)(e.config.get("menuBar")||{}),this._elementReplacer=new o.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,n=e.editing.view,o=i.editable,s=n.document.getRoot();o.name=s.rootName,i.render();const r=o.element;this.setEditableElement(o.name,r),i.editable.bind("isFocused").to(this.focusTracker),n.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initMenuBar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initMenuBar(){const t=this.view;t.menuBarView&&(this._setupMenuBarBehaviors(t.menuBarView.element),t.menuBarView.fillFromConfig(this._menuBarConfig,this.componentFactory))}_initPlaceholder(){const t=this.editor,i=t.editing.view,n=i.document.getRoot(),o=t.sourceElement;let s;const r=t.config.get("placeholder");r&&(s="string"==typeof r?r:r[this.view.editable.name]),!s&&o&&"textarea"===o.tagName.toLowerCase()&&(s=o.getAttribute("placeholder")),s&&(n.placeholder=s),(0,e.enablePlaceholder)({view:i,element:n,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,i){const n=this.view.stickyPanel;if(n.isSticky){const t=new o.Rect(n.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(n,"change:isSticky",t),setTimeout((()=>{this.stopListening(n,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",(()=>{const n=i.view;n.on("moveTo",((i,s)=>{if(!e.isSticky||n.wasMoved)return;const r=new o.Rect(e.contentPanelElement);s[1]<r.bottom+t.DialogView.defaultOffset&&(s[1]=r.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}_setupMenuBarBehaviors(t){const e=this.editor;this.focusTracker.add(t),e.keystrokes.listenTo(t),e.keystrokes.set("Esc",((i,n)=>{t.contains(this.focusTracker.focusedElement)&&(e.editing.view.focus(),n())})),e.keystrokes.set("Alt+F9",((e,i)=>{t.contains(this.focusTracker.focusedElement)||(this.view.menuBarView.focus(),i())}))}}const r=function(){try{return navigator.userAgent.toLowerCase()}catch(t){return""}}();l(r),c=r,c.indexOf("windows"),function(t){t.match(/gecko\/\d+/)}(r),function(t){t.indexOf(" applewebkit/")>-1&&t.indexOf("chrome")}(r),function(t){!!t.match(/iphone|ipad/i)||l(t)&&navigator.maxTouchPoints}(r),function(t){t.indexOf("android")}(r),function(t){t.indexOf("chrome/")>-1&&t.indexOf("edge/")}(r),function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}}();var c;function l(t){return t.indexOf("macintosh")>-1}const a=function(){return function t(){t.called=!0}};class h{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=a(),this.off=a()}}const u=new Array(256).fill("").map(((t,e)=>("0"+e.toString(16)).slice(-2)));function f(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,n=4294967296*Math.random()>>>0;return"e"+u[255&t]+u[t>>8&255]+u[t>>16&255]+u[t>>24&255]+u[255&e]+u[e>>8&255]+u[e>>16&255]+u[e>>24&255]+u[255&i]+u[i>>8&255]+u[i>>16&255]+u[i>>24&255]+u[255&n]+u[n>>8&255]+u[n>>16&255]+u[n>>24&255]}const d={get(t="normal"){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function p(t,e){const i=d.get(e.priority);for(let n=0;n<t.length;n++)if(d.get(t[n].priority)<i)return void t.splice(n,0,e);t.push(e)}const m="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class b extends Error{constructor(t,e,i){super(function(t,e){const i=new WeakSet,n=(t,e)=>{if("object"==typeof e&&null!==e){if(i.has(e))return`[object ${e.constructor.name}]`;i.add(e)}return e},o=e?` ${JSON.stringify(e,n)}`:"",s=g(t);return t+o+s}(t,i)),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new b(t.message,e);throw i.stack=t.stack,i}}function g(t){return`\nRead more: ${m}#error-${t}`}const v="41.3.1";new Date(2024,3,16);if(globalThis.CKEDITOR_VERSION)throw new b("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=v;const w=Symbol("listeningTo"),y=Symbol("emitterId"),_=Symbol("delegations"),k=E(Object);function E(t){if(!t)return k;return class extends t{on(t,e,i){this.listenTo(this,t,e,i)}once(t,e,i){let n=!1;this.listenTo(this,t,((t,...i)=>{n||(n=!0,t.off(),e.call(this,t,...i))}),i)}off(t,e){this.stopListening(this,t,e)}listenTo(t,e,i,n={}){let o,s;this[w]||(this[w]={});const r=this[w];O(t)||T(t);const c=O(t);(o=r[c])||(o=r[c]={emitter:t,callbacks:{}}),(s=o.callbacks[e])||(s=o.callbacks[e]=[]),s.push(i),function(t,e,i,n,o){e._addEventListener?e._addEventListener(i,n,o):t._addEventListener.call(e,i,n,o)}(this,t,e,i,n)}stopListening(t,e,i){const n=this[w];let o=t&&O(t);const s=n&&o?n[o]:void 0,r=s&&e?s.callbacks[e]:void 0;if(!(!n||t&&!s||e&&!r))if(i){j(this,t,e,i);-1!==r.indexOf(i)&&(1===r.length?delete s.callbacks[e]:j(this,t,e,i))}else if(r){for(;i=r.pop();)j(this,t,e,i);delete s.callbacks[e]}else if(s){for(e in s.callbacks)this.stopListening(t,e);delete n[o]}else{for(o in n)this.stopListening(n[o].emitter);delete this[w]}}fire(t,...e){try{const i=t instanceof h?t:new h(this,t),n=i.name;let o=L(this,n);if(i.path.push(this),o){const t=[i,...e];o=Array.from(o);for(let e=0;e<o.length&&(o[e].callback.apply(this,t),i.off.called&&(delete i.off.called,this._removeEventListener(n,o[e].callback)),!i.stop.called);e++);}const s=this[_];if(s){const t=s.get(n),o=s.get("*");t&&C(t,i,e),o&&C(o,i,e)}return i.return}catch(t){b.rethrowUnexpectedError(t,this)}}delegate(...t){return{to:(e,i)=>{this[_]||(this[_]=new Map),t.forEach((t=>{const n=this[_].get(t);n?n.set(e,i):this[_].set(t,new Map([[e,i]]))}))}}}stopDelegating(t,e){if(this[_])if(t)if(e){const i=this[_].get(t);i&&i.delete(e)}else this[_].delete(t);else this[_].clear()}_addEventListener(t,e,i){!function(t,e){const i=S(t);if(i[e])return;let n=e,o=null;const s=[];for(;""!==n&&!i[n];)i[n]={callbacks:[],childEvents:[]},s.push(i[n]),o&&i[n].childEvents.push(o),o=n,n=n.substr(0,n.lastIndexOf(":"));if(""!==n){for(const t of s)t.callbacks=i[n].callbacks.slice();i[n].childEvents.push(o)}}(this,t);const n=x(this,t),o={callback:e,priority:d.get(i.priority)};for(const t of n)p(t,o)}_removeEventListener(t,e){const i=x(this,t);for(const t of i)for(let i=0;i<t.length;i++)t[i].callback==e&&(t.splice(i,1),i--)}}}function T(t,e){t[y]||(t[y]=e||f())}function O(t){return t[y]}function S(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function x(t,e){const i=S(t)[e];if(!i)return[];let n=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){const o=x(t,i.childEvents[e]);n=n.concat(o)}return n}function L(t,e){let i;return t._events&&(i=t._events[e])&&i.callbacks.length?i.callbacks:e.indexOf(":")>-1?L(t,e.substr(0,e.lastIndexOf(":"))):null}function C(t,e,i){for(let[n,o]of t){o?"function"==typeof o&&(o=o(e.name)):o=e.name;const t=new h(e.source,o);t.path=[...e.path],n.fire(t,...i)}}function j(t,e,i,n){e._removeEventListener?e._removeEventListener(i,n):t._removeEventListener.call(e,i,n)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{E[t]=k.prototype[t]}));const P=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},I=Symbol("observableProperties"),B=Symbol("boundObservables"),R=Symbol("boundProperties"),A=Symbol("decoratedMethods"),M=Symbol("decoratedOriginal"),N=D(E());function D(t){if(!t)return N;return class extends t{set(t,e){if(P(t))return void Object.keys(t).forEach((e=>{this.set(e,t[e])}),this);V(this);const i=this[I];if(t in this&&!i.has(t))throw new b("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const n=i.get(t);let o=this.fire(`set:${t}`,t,e,n);void 0===o&&(o=e),n===o&&i.has(t)||(i.set(t,o),this.fire(`change:${t}`,t,o,n))}}),this[t]=e}bind(...t){if(!t.length||!z(t))throw new b("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new b("observable-bind-duplicate-properties",this);V(this);const e=this[R];t.forEach((t=>{if(e.has(t))throw new b("observable-bind-rebind",this)}));const i=new Map;return t.forEach((t=>{const n={property:t,to:[]};e.set(t,n),i.set(t,n)})),{to:F,toMany:W,_observable:this,_bindProperties:t,_to:[],_bindings:i}}unbind(...t){if(!this[I])return;const e=this[R],i=this[B];if(t.length){if(!z(t))throw new b("observable-unbind-wrong-properties",this);t.forEach((t=>{const n=e.get(t);n&&(n.to.forEach((([t,e])=>{const o=i.get(t),s=o[e];s.delete(n),s.size||delete o[e],Object.keys(o).length||(i.delete(t),this.stopListening(t,"change"))})),e.delete(t))}))}else i.forEach(((t,e)=>{this.stopListening(e,"change")})),i.clear(),e.clear()}decorate(t){V(this);const e=this[t];if(!e)throw new b("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,((t,i)=>{t.return=e.apply(this,i)})),this[t]=function(...e){return this.fire(t,e)},this[t][M]=e,this[A]||(this[A]=[]),this[A].push(t)}stopListening(t,e,i){if(!t&&this[A]){for(const t of this[A])this[t]=this[t][M];delete this[A]}super.stopListening(t,e,i)}}}function V(t){t[I]||(Object.defineProperty(t,I,{value:new Map}),Object.defineProperty(t,B,{value:new Map}),Object.defineProperty(t,R,{value:new Map}))}function F(...t){const e=function(...t){if(!t.length)throw new b("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach((t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new b("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}})),e}(...t),i=Array.from(this._bindings.keys()),n=i.length;if(!e.callback&&e.to.length>1)throw new b("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new b("observable-bind-to-extra-callback",this);var o;e.to.forEach((t=>{if(t.properties.length&&t.properties.length!==n)throw new b("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)})),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),o=this._observable,this._to.forEach((t=>{const e=o[B];let i;e.get(t.observable)||o.listenTo(t.observable,"change",((n,s)=>{i=e.get(t.observable)[s],i&&i.forEach((t=>{H(o,t.property)}))}))})),function(t){let e;t._bindings.forEach(((i,n)=>{t._to.forEach((o=>{e=o.properties[i.callback?0:t._bindProperties.indexOf(n)],i.to.push([o.observable,e]),function(t,e,i,n){const o=t[B],s=o.get(i),r=s||{};r[n]||(r[n]=new Set);r[n].add(e),s||o.set(i,r)}(t._observable,i,o.observable,e)}))}))}(this),this._bindProperties.forEach((t=>{H(this._observable,t)}))}function W(t,e,i){if(this._bindings.size>1)throw new b("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map((t=>[t,e]));return Array.prototype.concat.apply([],i)}(t,e),i)}function z(t){return t.every((t=>"string"==typeof t))}function H(t,e){const i=t[R].get(e);let n;i.callback?n=i.callback.apply(t,i.to.map((t=>t[0][t[1]]))):(n=i.to[0],n=n[0][n[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=n:t.set(e,n)}function K(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node}return!1}function U(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{D[t]=N.prototype[t]}));const $=G(E());function G(t){if(!t)return $;return class extends t{listenTo(t,e,i,n={}){if(K(t)||U(t)){const o={capture:!!n.useCapture,passive:!!n.usePassive},s=this._getProxyEmitter(t,o)||new Y(t,o);this.listenTo(s,e,i,n)}else super.listenTo(t,e,i,n)}stopListening(t,e,i){if(K(t)||U(t)){const n=this._getAllProxyEmitters(t);for(const t of n)this.stopListening(t,e,i)}else super.stopListening(t,e,i)}_getProxyEmitter(t,e){return function(t,e){const i=t[w];return i&&i[e]?i[e].emitter:null}(this,q(t,e))}_getAllProxyEmitters(t){return[{capture:!1,passive:!1},{capture:!1,passive:!0},{capture:!0,passive:!1},{capture:!0,passive:!0}].map((e=>this._getProxyEmitter(t,e))).filter((t=>!!t))}}}["_getProxyEmitter","_getAllProxyEmitters","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{G[t]=$.prototype[t]}));class Y extends(E()){constructor(t,e){super(),T(this,q(t,e)),this._domNode=t,this._options=e}attach(t){if(this._domListeners&&this._domListeners[t])return;const e=this._createDomListener(t);this._domNode.addEventListener(t,e,this._options),this._domListeners||(this._domListeners={}),this._domListeners[t]=e}detach(t){let e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener()}_addEventListener(t,e,i){this.attach(t),E().prototype._addEventListener.call(this,t,e,i)}_removeEventListener(t,e){E().prototype._removeEventListener.call(this,t,e),this.detach(t)}_createDomListener(t){const e=e=>{this.fire(t,e)};return e.removeListener=()=>{this._domNode.removeEventListener(t,e,this._options),delete this._domListeners[t]},e}}function q(t,e){let i=function(t){return t["data-ck-expando"]||(t["data-ck-expando"]=f())}(t);for(const t of Object.keys(e).sort())e[t]&&(i+="-"+t);return i}let X;try{X={window,document}}catch(t){X={window:{},document:{}}}const J=X;function Q(t){const e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)}}const Z=["top","right","bottom","left","width","height"];class tt{constructor(t){const e=(i=t,"[object Range]"==Object.prototype.toString.apply(i));var i;if(Object.defineProperty(this,"_source",{value:t._source||t,writable:!0,enumerable:!1}),nt(t)||e)if(e){const e=tt.getDomRangeRects(t);et(this,tt.getBoundingRect(e))}else et(this,t.getBoundingClientRect());else if(U(t)){const{innerWidth:e,innerHeight:i}=t;et(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else et(this,t)}clone(){return new tt(this)}moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this}moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this}getIntersection(t){const e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left),width:0,height:0};if(e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0)return null;{const t=new tt(e);return t._source=this._source,t}}getIntersectionArea(t){const e=this.getIntersection(t);return e?e.getArea():0}getArea(){return this.width*this.height}getVisible(){const t=this._source;let e=this.clone();if(it(t))return e;let i,n=t,o=t.parentNode||t.commonAncestorContainer;for(;o&&!it(o);){const t="visible"===((s=o)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible");n instanceof HTMLElement&&"absolute"===ot(n)&&(i=n);const r=ot(o);if(t||i&&("relative"===r&&t||"relative"!==r)){n=o,o=o.parentNode;continue}const c=new tt(o),l=e.getIntersection(c);if(!l)return null;l.getArea()<e.getArea()&&(e=l),n=o,o=o.parentNode}var s;return e}isEqual(t){for(const e of Z)if(this[e]!==t[e])return!1;return!0}contains(t){const e=this.getIntersection(t);return!(!e||!e.isEqual(t))}toAbsoluteRect(){const{scrollX:t,scrollY:e}=J.window,i=this.clone().moveBy(t,e);if(nt(i._source)){const t=(n=i._source)&&n.parentNode?n.offsetParent===J.document.body?null:n.offsetParent:null;t&&function(t,e){const i=new tt(e),n=Q(e);let o=0,s=0;o-=i.left,s-=i.top,o+=e.scrollLeft,s+=e.scrollTop,o-=n.left,s-=n.top,t.moveBy(o,s)}(i,t)}var n;return i}excludeScrollbarsAndBorders(){const t=this._source;let e,i,n;if(U(t))e=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,n=t.getComputedStyle(t.document.documentElement).direction;else{const o=Q(t);e=t.offsetWidth-t.clientWidth-o.left-o.right,i=t.offsetHeight-t.clientHeight-o.top-o.bottom,n=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=o.left,this.top+=o.top,this.right-=o.right,this.bottom-=o.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,"ltr"===n?this.right-=e:this.left+=e,this.height-=i,this.bottom-=i,this}static getDomRangeRects(t){const e=[],i=Array.from(t.getClientRects());if(i.length)for(const t of i)e.push(new tt(t));else{let i=t.startContainer;n=i,"[object Text]"==Object.prototype.toString.call(n)&&(i=i.parentNode);const o=new tt(i.getBoundingClientRect());o.right=o.left,o.width=0,e.push(o)}var n;return e}static getBoundingRect(t){const e={left:Number.POSITIVE_INFINITY,top:Number.POSITIVE_INFINITY,right:Number.NEGATIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY,width:0,height:0};let i=0;for(const n of t)i++,e.left=Math.min(e.left,n.left),e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom);return 0==i?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new tt(e))}}function et(t,e){for(const i of Z)t[i]=e[i]}function it(t){return!!nt(t)&&t===t.ownerDocument.body}function nt(t){return null!==t&&"object"==typeof t&&1===t.nodeType&&"function"==typeof t.getBoundingClientRect}function ot(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).position:"static"}const st=class{constructor(t,e){st._observerInstance||st._createObserver(),this._element=t,this._callback=e,st._addElementCallback(t,e),st._observerInstance.observe(t)}get element(){return this._element}destroy(){st._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){st._elementCallbacks||(st._elementCallbacks=new Map);let i=st._elementCallbacks.get(t);i||(i=new Set,st._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=st._getElementCallbacks(t);i&&(i.delete(e),i.size||(st._elementCallbacks.delete(t),st._observerInstance.unobserve(t))),st._elementCallbacks&&!st._elementCallbacks.size&&(st._observerInstance=null,st._elementCallbacks=null)}static _getElementCallbacks(t){return st._elementCallbacks?st._elementCallbacks.get(t):null}static _createObserver(){st._observerInstance=new J.window.ResizeObserver((t=>{for(const e of t){const t=st._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}}))}};let rt=st;rt._observerInstance=null,rt._elementCallbacks=null;Math.pow;const ct={37:"←",38:"↑",39:"→",40:"↓",9:"⇥",33:"Page Up",34:"Page Down"},lt=function(){const t={pageup:33,pagedown:34,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){t[String.fromCharCode(e).toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;return Object.assign(t,{"'":222,",":108,"-":109,".":110,"/":111,";":186,"=":187,"[":219,"\\":220,"]":221,"`":223}),t}();Object.fromEntries(Object.entries(lt).map((([t,e])=>{let i;return i=e in ct?ct[e]:t.charAt(0).toUpperCase()+t.slice(1),[e,i]})));J.window.CKEDITOR_TRANSLATIONS||(J.window.CKEDITOR_TRANSLATIONS={});E(),Symbol.iterator;G(D());Math.pow;!function(){const t=[new RegExp("\\p{Emoji}[\\u{E0020}-\\u{E007E}]+\\u{E007F}","u"),new RegExp("\\p{Emoji}\\u{FE0F}?\\u{20E3}","u"),new RegExp("\\p{Emoji}\\u{FE0F}","u"),new RegExp("(?=\\p{General_Category=Other_Symbol})\\p{Emoji}\\p{Emoji_Modifier}*","u")],e=new RegExp("\\p{Regional_Indicator}{2}","u").source,i="(?:"+t.map((t=>t.source)).join("|")+")";new RegExp(`${e}|${i}(?:${i})*`,"ug")}();var at=i(591),ht=i.n(at),ut=i(428),ft={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ht()(ut.A,ft);ut.A.locals;const dt=(pt="px",t=>t+pt);var pt;class mt extends t.View{constructor(e,i,n){super(e);const o=this.bindTemplate;this.containerEl=i||J.window,this.panelAbsolute=!!n,this.set("position",null),this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:o.to("isSticky",(t=>t?"block":"none")),height:o.to("isSticky",(t=>t?dt(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",o.if("isSticky","ck-sticky-panel__content_sticky"),o.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{position:o.to("position",(t=>t)),width:o.to("isSticky",(t=>t?dt(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:o.to("_stickyTopOffset",(t=>t?dt(t):t)),bottom:o.to("_stickyBottomOffset",(t=>t?dt(t):t)),marginLeft:o.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(this.containerEl,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new tt(this.limiterElement);let e=t.getVisible();if(e){const i=new tt(this.containerEl);t.top-=i.top,t.bottom-=i.top,i.top+=this.viewportTopOffset,i.height-=this.viewportTopOffset,e=e.getIntersection(i)}if(e&&t.top<e.top){const i=e.top;if(i+this._contentPanelRect.height+this.limiterBottomOffset>e.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<t.height?this.panelAbsolute?t.top<0&&-t.top<t.height-this.limiterBottomOffset?this._stickToTopOfAncestors(-t.top,"absolute"):this._unstick():this._stickToTopOfAncestors(i):this._unstick()}else this._unstick()}_stickToTopOfAncestors(t,e=null){var i;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=dt(-(null!==(i=this.containerEl.scrollX)&&void 0!==i?i:this.containerEl.scrollLeft)),this.position=e}_stickToBottomOfLimiter(t){var e;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=dt(-(null!==(e=this.containerEl.scrollX)&&void 0!==e?e:this.containerEl.scrollLeft)),this.position=null}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null,this.position=null}get _contentPanelRect(){return new tt(this.contentPanelElement)}}var bt=i(662),gt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ht()(bt.A,gt);bt.A.locals;class vt extends t.BoxedEditorUIView{constructor(e,i,n={}){super(e),this.stickyPanel=new mt(e,n.containerEl,n.panelAbsolute),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),n.useMenuBar&&(this.menuBarView=new t.MenuBarView(e)),this.editable=new t.InlineEditableUIView(e,i)}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 wt=i(782),yt=i(602);const _t=function(t){return null!=t&&"object"==typeof t};const kt="object"==typeof global&&global&&global.Object===Object&&global;var Et="object"==typeof self&&self&&self.Object===Object&&self;const Tt=(kt||Et||Function("return this")()).Symbol;var Ot=Object.prototype,St=Ot.hasOwnProperty,xt=Ot.toString,Lt=Tt?Tt.toStringTag:void 0;const Ct=function(t){var e=St.call(t,Lt),i=t[Lt];try{t[Lt]=void 0;var n=!0}catch(t){}var o=xt.call(t);return n&&(e?t[Lt]=i:delete t[Lt]),o};var jt=Object.prototype.toString;const Pt=function(t){return jt.call(t)};var It=Tt?Tt.toStringTag:void 0;const Bt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":It&&It in Object(t)?Ct(t):Pt(t)};const Rt=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var At=Function.prototype,Mt=Object.prototype,Nt=At.toString,Dt=Mt.hasOwnProperty,Vt=Nt.call(Object);const Ft=function(t){if(!_t(t)||"[object Object]"!=Bt(t))return!1;var e=Rt(t);if(null===e)return!0;var i=Dt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&Nt.call(i)==Vt};const Wt=function(t){return _t(t)&&1===t.nodeType&&!Ft(t)};class zt extends((0,wt.ElementApiMixin)(wt.Editor)){constructor(t,e={}){if(!Kt(t)&&void 0!==e.initialData)throw new o.CKEditorError("editor-create-initial-data",null);super(e),this.config.define("menuBar.isVisible",!1),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return Kt(t)?(0,o.getDataFromElement)(t):t}(t)),Kt(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),r=new vt(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:n.isVisible,containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,r),(0,wt.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((i=>{const n=new this(t,e);i(n.initPlugins().then((()=>n.ui.init(Kt(t)?t:null))).then((()=>n.data.init(n.config.get("initialData")))).then((()=>n.fire("ready"))).then((()=>n)))}))}}zt.Context=wt.Context,zt.EditorWatchdog=yt.EditorWatchdog,zt.ContextWatchdog=yt.ContextWatchdog;const Ht=zt;function Kt(t){return Wt(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=n})();
|
package/build/editor-classic.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{var t={20:(t,e,o)=>{"use strict";o.d(e,{c:()=>n});var i=o(849),r=o.n(i)()((function(t){return t[1]}));r.push([t.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-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.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-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius: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 n=r},849:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o=t(e);return e[2]?"@media ".concat(e[2]," {").concat(o,"}"):o})).join("")},e.i=function(t,o,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var n=0;n<this.length;n++){var c=this[n][0];null!=c&&(r[c]=!0)}for(var a=0;a<t.length;a++){var s=[].concat(t[a]);i&&r[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),e.push(s))}},e}},108:(t,e,o)=>{"use strict";var i,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},n=function(){var t={};return function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}t[e]=o}return t[e]}}(),c=[];function a(t){for(var e=-1,o=0;o<c.length;o++)if(c[o].identifier===t){e=o;break}return e}function s(t,e){for(var o={},i=[],r=0;r<t.length;r++){var n=t[r],s=e.base?n[0]+e.base:n[0],l=o[s]||0,d="".concat(s," ").concat(l);o[s]=l+1;var u=a(d),h={css:n[1],media:n[2],sourceMap:n[3]};-1!==u?(c[u].references++,c[u].updater(h)):c.push({identifier:d,updater:k(h,e),references:1}),i.push(d)}return i}function l(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var r=o.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var c=n(t.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(e)}return e}var d,u=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function h(t,e,o,i){var r=o?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=u(e,r);else{var n=document.createTextNode(r),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(n,c[e]):t.appendChild(n)}}function f(t,e,o){var i=o.css,r=o.media,n=o.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var p=null,b=0;function k(t,e){var o,i,r;if(e.singleton){var n=b++;o=p||(p=l(e)),i=h.bind(null,o,n,!1),r=h.bind(null,o,n,!0)}else o=l(e),i=f.bind(null,o,e),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(o)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=r());var o=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var i=0;i<o.length;i++){var r=a(o[i]);c[r].references--}for(var n=s(t,e),l=0;l<o.length;l++){var d=a(o[l]);0===c[d].references&&(c[d].updater(),c.splice(d,1))}o=n}}}},968:(t,e,o)=>{t.exports=o(672)("./src/core.js")},684:(t,e,o)=>{t.exports=o(672)("./src/engine.js")},348:(t,e,o)=>{t.exports=o(672)("./src/ui.js")},316:(t,e,o)=>{t.exports=o(672)("./src/utils.js")},344:(t,e,o)=>{t.exports=o(672)("./src/watchdog.js")},672:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,o),n.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{ClassicEditor:()=>M});var t=o(348),e=o(684),r=o(316);class n extends t.EditorUI{constructor(e,o){super(e),this.view=o,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new r.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,o=this.view,i=e.editing.view,r=o.editable,n=i.document.getRoot();r.name=n.rootName,o.render();const c=r.element;this.setEditableElement(r.name,c),o.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(c),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,o=t.editing.view,i=o.document.getRoot(),r=t.sourceElement;let n;const c=t.config.get("placeholder");c&&(n="string"==typeof c?c:c[this.view.editable.name]),!n&&r&&"textarea"===r.tagName.toLowerCase()&&(n=r.getAttribute("placeholder")),n&&(i.placeholder=n),(0,e.enablePlaceholder)({view:o,element:i,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,o){const i=this.view.stickyPanel;if(i.isSticky){const t=new r.Rect(i.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(i,"change:isSticky",t),setTimeout((()=>{this.stopListening(i,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,o=this.editor.plugins.get("Dialog");o.on("show",(()=>{const i=o.view;i.on("moveTo",((o,n)=>{if(!e.isSticky||i.wasMoved)return;const c=new r.Rect(e.contentPanelElement);n[1]<c.bottom+t.DialogView.defaultOffset&&(n[1]=c.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var c=o(108),a=o.n(c),s=o(20),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.c,l);s.c.locals;class d extends t.BoxedEditorUIView{constructor(e,o,i={}){super(e),this.stickyPanel=new t.StickyPanelView(e),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,o)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var u=o(968),h=o(344);const f=function(t){return null!=t&&"object"==typeof t};const p="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const k=(p||b||Function("return this")()).Symbol;var v=Object.prototype,g=v.hasOwnProperty,m=v.toString,y=k?k.toStringTag:void 0;const w=function(t){var e=g.call(t,y),o=t[y];try{t[y]=void 0;var i=!0}catch(t){}var r=m.call(t);return i&&(e?t[y]=o:delete t[y]),r};var _=Object.prototype.toString;const T=function(t){return _.call(t)};var j=k?k.toStringTag:void 0;const S=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?w(t):T(t)};const O=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var x=Function.prototype,E=Object.prototype,P=x.toString,C=E.hasOwnProperty,D=P.call(Object);const F=function(t){if(!f(t)||"[object Object]"!=S(t))return!1;var e=O(t);if(null===e)return!0;var o=C.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&P.call(o)==D};const R=function(t){return f(t)&&1===t.nodeType&&!F(t)};class M extends((0,u.ElementApiMixin)(u.Editor)){constructor(t,e={}){if(!N(t)&&void 0!==e.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return N(t)?(0,r.getDataFromElement)(t):t}(t)),N(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o});this.ui=new n(this,i),(0,u.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((o=>{const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init(N(t)?t:null))).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function N(t){return R(t)}M.Context=u.Context,M.EditorWatchdog=h.EditorWatchdog,M.ContextWatchdog=h.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=i})();
|
|
4
|
+
*/(()=>{var e={662:(e,t,o)=>{"use strict";o.d(t,{A:()=>n});var i=o(935),r=o.n(i)()((function(e){return e[1]}));r.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-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.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-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius: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 n=r},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 r={};if(i)for(var n=0;n<this.length;n++){var c=this[n][0];null!=c&&(r[c]=!0)}for(var a=0;a<e.length;a++){var s=[].concat(e[a]);i&&r[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,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},n=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=[],r=0;r<e.length;r++){var n=e[r],s=t.base?n[0]+t.base:n[0],l=o[s]||0,d="".concat(s," ").concat(l);o[s]=l+1;var u=a(d),h={css:n[1],media:n[2],sourceMap:n[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 r=o.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),"function"==typeof e.insert)e.insert(t);else{var c=n(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 r=o?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(e.styleSheet)e.styleSheet.cssText=u(t,r);else{var n=document.createTextNode(r),c=e.childNodes;c[t]&&e.removeChild(c[t]),c.length?e.insertBefore(n,c[t]):e.appendChild(n)}}function p(e,t,o){var i=o.css,r=o.media,n=o.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),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,r;if(t.singleton){var n=b++;o=f||(f=l(t)),i=h.bind(null,o,n,!1),r=h.bind(null,o,n,!0)}else o=l(t),i=p.bind(null,o,t),r=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 r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=r());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 r=a(o[i]);c[r].references--}for(var n=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=n}}}},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")},602:(e,t,o)=>{e.exports=o(237)("./src/watchdog.js")},237:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(i){var r=t[i];if(void 0!==r)return r.exports;var n=t[i]={id:i,exports:{}};return e[i](n,n.exports,o),n.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:()=>R});var e=o(311),t=o(783),r=o(584);class n extends e.EditorUI{constructor(t,o){super(t),this.view=o,this._toolbarConfig=(0,e.normalizeToolbarConfig)(t.config.get("toolbar")),this._elementReplacer=new r.ElementReplacer,this.listenTo(t.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(e){const t=this.editor,o=this.view,i=t.editing.view,r=o.editable,n=i.document.getRoot();r.name=n.rootName,o.render();const c=r.element;this.setEditableElement(r.name,c),o.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),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(),r=e.sourceElement;let n;const c=e.config.get("placeholder");c&&(n="string"==typeof c?c:c[this.view.editable.name]),!n&&r&&"textarea"===r.tagName.toLowerCase()&&(n=r.getAttribute("placeholder")),n&&(i.placeholder=n),(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 r.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,n)=>{if(!t.isSticky||i.wasMoved)return;const c=new r.Rect(t.contentPanelElement);n[1]<c.bottom+e.DialogView.defaultOffset&&(n[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,i.containerEl,i.panelAbsolute),this.toolbar=new e.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new e.InlineEditableUIView(t,o)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var u=o(782),h=o(602);const p=function(e){return null!=e&&"object"==typeof e};const f="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const k=(f||b||Function("return this")()).Symbol;var v=Object.prototype,g=v.hasOwnProperty,m=v.toString,y=k?k.toStringTag:void 0;const w=function(e){var t=g.call(e,y),o=e[y];try{e[y]=void 0;var i=!0}catch(e){}var r=m.call(e);return i&&(t?e[y]=o:delete e[y]),r};var _=Object.prototype.toString;const T=function(e){return _.call(e)};var j=k?k.toStringTag:void 0;const S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?w(e):T(e)};const E=function(e,t){return function(o){return e(t(o))}}(Object.getPrototypeOf,Object);var O=Function.prototype,x=Object.prototype,P=O.toString,C=x.hasOwnProperty,D=P.call(Object);const F=function(e){if(!p(e)||"[object Object]"!=S(e))return!1;var t=E(e);if(null===t)return!0;var o=C.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&P.call(o)==D};const A=function(e){return p(e)&&1===e.nodeType&&!F(e)};class R extends((0,u.ElementApiMixin)(u.Editor)){constructor(e,t={}){if(!M(e)&&void 0!==t.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(t),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return M(e)?(0,r.getDataFromElement)(e):e}(e)),M(e)&&(this.sourceElement=e),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o,containerEl:t.containerEl,panelAbsolute:t.panelAbsolute});this.ui=new n(this,i),(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(M(e)?e:null))).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function M(e){return A(e)}R.Context=u.Context,R.EditorWatchdog=h.EditorWatchdog,R.ContextWatchdog=h.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=i})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ckeditor5-editor-classic-floating",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.3.1",
|
|
4
4
|
"description": "Classic editor implementation for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "41.
|
|
15
|
+
"ckeditor5": "41.3.1",
|
|
16
16
|
"lodash-es": "4.17.21"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@ckeditor/ckeditor5-basic-styles": "41.
|
|
20
|
-
"@ckeditor/ckeditor5-core": "41.
|
|
21
|
-
"@ckeditor/ckeditor5-dev-utils": "^39.
|
|
22
|
-
"@ckeditor/ckeditor5-engine": "41.
|
|
23
|
-
"@ckeditor/ckeditor5-enter": "41.
|
|
24
|
-
"@ckeditor/ckeditor5-heading": "41.
|
|
25
|
-
"@ckeditor/ckeditor5-image": "41.
|
|
26
|
-
"@ckeditor/ckeditor5-paragraph": "41.
|
|
27
|
-
"@ckeditor/ckeditor5-theme-lark": "41.
|
|
28
|
-
"@ckeditor/ckeditor5-typing": "41.
|
|
29
|
-
"@ckeditor/ckeditor5-ui": "41.
|
|
30
|
-
"@ckeditor/ckeditor5-undo": "41.
|
|
31
|
-
"@ckeditor/ckeditor5-utils": "41.
|
|
32
|
-
"@ckeditor/ckeditor5-watchdog": "41.
|
|
19
|
+
"@ckeditor/ckeditor5-basic-styles": "41.3.1",
|
|
20
|
+
"@ckeditor/ckeditor5-core": "41.3.1",
|
|
21
|
+
"@ckeditor/ckeditor5-dev-utils": "^39.7.0",
|
|
22
|
+
"@ckeditor/ckeditor5-engine": "41.3.1",
|
|
23
|
+
"@ckeditor/ckeditor5-enter": "41.3.1",
|
|
24
|
+
"@ckeditor/ckeditor5-heading": "41.3.1",
|
|
25
|
+
"@ckeditor/ckeditor5-image": "41.3.1",
|
|
26
|
+
"@ckeditor/ckeditor5-paragraph": "41.3.1",
|
|
27
|
+
"@ckeditor/ckeditor5-theme-lark": "41.3.1",
|
|
28
|
+
"@ckeditor/ckeditor5-typing": "41.3.1",
|
|
29
|
+
"@ckeditor/ckeditor5-ui": "41.3.1",
|
|
30
|
+
"@ckeditor/ckeditor5-undo": "41.3.1",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "41.3.1",
|
|
32
|
+
"@ckeditor/ckeditor5-watchdog": "41.3.1",
|
|
33
33
|
"typescript": "5.0.4",
|
|
34
34
|
"webpack": "^5.58.1",
|
|
35
35
|
"webpack-cli": "^4.9.0"
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
|
-
"url": "https://github.com/
|
|
44
|
-
"directory": "packages/ckeditor5-editor-classic"
|
|
43
|
+
"url": "https://github.com/toannv17/ckeditor5.git",
|
|
44
|
+
"directory": "packages/ckeditor5-editor-classic-floating"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
|
+
"dist",
|
|
47
48
|
"lang",
|
|
48
49
|
"src/**/*.js",
|
|
49
50
|
"src/**/*.d.ts",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
],
|
|
55
56
|
"scripts": {
|
|
56
57
|
"dll:build": "webpack",
|
|
57
|
-
"build": "tsc -p ./tsconfig.json"
|
|
58
|
+
"build": "tsc -p ./tsconfig.json",
|
|
59
|
+
"build:dist": "node ../../scripts/build-package.mjs"
|
|
58
60
|
}
|
|
59
61
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
6
|
+
interface EditorConfig {
|
|
7
|
+
containerEl?: HTMLElement;
|
|
8
|
+
panelAbsolute?: boolean;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-classic/classiceditor
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
8
|
+
import ClassicEditorUI from './classiceditorui.js';
|
|
9
|
+
import { type EditorConfig } from 'ckeditor5/src/core.js';
|
|
10
10
|
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
|
11
|
-
|
|
12
|
-
declare const ClassicFloatingEditor_base: import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>;
|
|
11
|
+
declare const ClassicEditor_base: any;
|
|
13
12
|
/**
|
|
14
13
|
* The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.
|
|
15
14
|
* It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
|
|
@@ -33,11 +32,11 @@ declare const ClassicFloatingEditor_base: import("ckeditor5/src/utils.js").Mixed
|
|
|
33
32
|
* Read more about initializing the editor from source or as a build in
|
|
34
33
|
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
|
|
35
34
|
*/
|
|
36
|
-
export default class
|
|
35
|
+
export default class ClassicEditor extends ClassicEditor_base {
|
|
37
36
|
/**
|
|
38
37
|
* @inheritDoc
|
|
39
38
|
*/
|
|
40
|
-
readonly ui:
|
|
39
|
+
readonly ui: ClassicEditorUI;
|
|
41
40
|
/**
|
|
42
41
|
* Creates an instance of the classic editor.
|
|
43
42
|
*
|
|
@@ -158,13 +157,13 @@ export default class ClassicFloatingEditor extends ClassicFloatingEditor_base {
|
|
|
158
157
|
* @param config The editor configuration.
|
|
159
158
|
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
|
160
159
|
*/
|
|
161
|
-
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<
|
|
160
|
+
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<ClassicEditor>;
|
|
162
161
|
/**
|
|
163
162
|
* The {@link module:core/context~Context} class.
|
|
164
163
|
*
|
|
165
164
|
* Exposed as static editor field for easier access in editor builds.
|
|
166
165
|
*/
|
|
167
|
-
static Context:
|
|
166
|
+
static Context: any;
|
|
168
167
|
/**
|
|
169
168
|
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
|
170
169
|
*
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-classic/classiceditor
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import ClassicEditorUI from './classiceditorui.js';
|
|
9
|
+
import ClassicEditorUIView from './classiceditoruiview.js';
|
|
10
10
|
import { Editor, Context, ElementApiMixin, attachToForm } from 'ckeditor5/src/core.js';
|
|
11
11
|
import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils.js';
|
|
12
12
|
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
|
@@ -34,7 +34,7 @@ import { isElement as _isElement } from 'lodash-es';
|
|
|
34
34
|
* Read more about initializing the editor from source or as a build in
|
|
35
35
|
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
|
|
36
36
|
*/
|
|
37
|
-
class
|
|
37
|
+
class ClassicEditor extends ElementApiMixin(Editor) {
|
|
38
38
|
/**
|
|
39
39
|
* Creates an instance of the classic editor.
|
|
40
40
|
*
|
|
@@ -54,6 +54,7 @@ class ClassicFloatingEditor extends ElementApiMixin(Editor) {
|
|
|
54
54
|
throw new CKEditorError('editor-create-initial-data', null);
|
|
55
55
|
}
|
|
56
56
|
super(config);
|
|
57
|
+
this.config.define('menuBar.isVisible', false);
|
|
57
58
|
if (this.config.get('initialData') === undefined) {
|
|
58
59
|
this.config.set('initialData', getInitialData(sourceElementOrData));
|
|
59
60
|
}
|
|
@@ -62,12 +63,14 @@ class ClassicFloatingEditor extends ElementApiMixin(Editor) {
|
|
|
62
63
|
}
|
|
63
64
|
this.model.document.createRoot();
|
|
64
65
|
const shouldToolbarGroupWhenFull = !this.config.get('toolbar.shouldNotGroupWhenFull');
|
|
65
|
-
const
|
|
66
|
+
const menuBarConfig = this.config.get('menuBar');
|
|
67
|
+
const view = new ClassicEditorUIView(this.locale, this.editing.view, {
|
|
66
68
|
shouldToolbarGroupWhenFull,
|
|
69
|
+
useMenuBar: menuBarConfig.isVisible,
|
|
67
70
|
containerEl: config.containerEl,
|
|
68
71
|
panelAbsolute: config.panelAbsolute
|
|
69
72
|
});
|
|
70
|
-
this.ui = new
|
|
73
|
+
this.ui = new ClassicEditorUI(this, view);
|
|
71
74
|
attachToForm(this);
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
@@ -200,20 +203,20 @@ class ClassicFloatingEditor extends ElementApiMixin(Editor) {
|
|
|
200
203
|
*
|
|
201
204
|
* Exposed as static editor field for easier access in editor builds.
|
|
202
205
|
*/
|
|
203
|
-
|
|
206
|
+
ClassicEditor.Context = Context;
|
|
204
207
|
/**
|
|
205
208
|
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
|
206
209
|
*
|
|
207
210
|
* Exposed as static editor field for easier access in editor builds.
|
|
208
211
|
*/
|
|
209
|
-
|
|
212
|
+
ClassicEditor.EditorWatchdog = EditorWatchdog;
|
|
210
213
|
/**
|
|
211
214
|
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
|
212
215
|
*
|
|
213
216
|
* Exposed as static editor field for easier access in editor builds.
|
|
214
217
|
*/
|
|
215
|
-
|
|
216
|
-
export default
|
|
218
|
+
ClassicEditor.ContextWatchdog = ContextWatchdog;
|
|
219
|
+
export default ClassicEditor;
|
|
217
220
|
function getInitialData(sourceElementOrData) {
|
|
218
221
|
return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
|
|
219
222
|
}
|
|
@@ -7,19 +7,23 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { Editor } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { EditorUI } from 'ckeditor5/src/ui.js';
|
|
10
|
-
import type
|
|
10
|
+
import type ClassicEditorUIView from './classiceditoruiview.js';
|
|
11
11
|
/**
|
|
12
12
|
* The classic editor UI class.
|
|
13
13
|
*/
|
|
14
|
-
export default class
|
|
14
|
+
export default class ClassicEditorUI extends EditorUI {
|
|
15
15
|
/**
|
|
16
16
|
* The main (top–most) view of the editor UI.
|
|
17
17
|
*/
|
|
18
|
-
readonly view:
|
|
18
|
+
readonly view: ClassicEditorUIView;
|
|
19
19
|
/**
|
|
20
20
|
* A normalized `config.toolbar` object.
|
|
21
21
|
*/
|
|
22
22
|
private readonly _toolbarConfig;
|
|
23
|
+
/**
|
|
24
|
+
* A normalized `config.menuBar` object.
|
|
25
|
+
*/
|
|
26
|
+
private readonly _menuBarConfig;
|
|
23
27
|
/**
|
|
24
28
|
* The element replacer instance used to hide the editor's source element.
|
|
25
29
|
*/
|
|
@@ -30,7 +34,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
30
34
|
* @param editor The editor instance.
|
|
31
35
|
* @param view The view of the UI.
|
|
32
36
|
*/
|
|
33
|
-
constructor(editor: Editor, view:
|
|
37
|
+
constructor(editor: Editor, view: ClassicEditorUIView);
|
|
34
38
|
/**
|
|
35
39
|
* @inheritDoc
|
|
36
40
|
*/
|
|
@@ -49,6 +53,10 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
49
53
|
* Initializes the editor toolbar.
|
|
50
54
|
*/
|
|
51
55
|
private _initToolbar;
|
|
56
|
+
/**
|
|
57
|
+
* Initializes the editor menu bar.
|
|
58
|
+
*/
|
|
59
|
+
private _initMenuBar;
|
|
52
60
|
/**
|
|
53
61
|
* Enable the placeholder text on the editing root.
|
|
54
62
|
*/
|
|
@@ -72,4 +80,8 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
72
80
|
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
|
73
81
|
*/
|
|
74
82
|
private _initDialogPluginIntegration;
|
|
83
|
+
/**
|
|
84
|
+
* Handles focus and keystrokes for menu bar element.
|
|
85
|
+
*/
|
|
86
|
+
private _setupMenuBarBehaviors;
|
|
75
87
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
import { EditorUI, normalizeToolbarConfig, DialogView } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import { EditorUI, normalizeToolbarConfig, normalizeMenuBarConfig, DialogView } from 'ckeditor5/src/ui.js';
|
|
6
6
|
import { enablePlaceholder } from 'ckeditor5/src/engine.js';
|
|
7
7
|
import { ElementReplacer, Rect } from 'ckeditor5/src/utils.js';
|
|
8
8
|
/**
|
|
9
9
|
* The classic editor UI class.
|
|
10
10
|
*/
|
|
11
|
-
export default class
|
|
11
|
+
export default class ClassicEditorUI extends EditorUI {
|
|
12
12
|
/**
|
|
13
13
|
* Creates an instance of the classic editor UI class.
|
|
14
14
|
*
|
|
@@ -19,6 +19,8 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
19
19
|
super(editor);
|
|
20
20
|
this.view = view;
|
|
21
21
|
this._toolbarConfig = normalizeToolbarConfig(editor.config.get('toolbar'));
|
|
22
|
+
// We use config.define in ClassicEditor, there will always be some configuration.
|
|
23
|
+
this._menuBarConfig = normalizeMenuBarConfig(editor.config.get('menuBar') || {});
|
|
22
24
|
this._elementReplacer = new ElementReplacer();
|
|
23
25
|
this.listenTo(editor.editing.view, 'scrollToTheSelection', this._handleScrollToTheSelectionWithStickyPanel.bind(this));
|
|
24
26
|
}
|
|
@@ -68,6 +70,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
68
70
|
}
|
|
69
71
|
this._initPlaceholder();
|
|
70
72
|
this._initToolbar();
|
|
73
|
+
this._initMenuBar();
|
|
71
74
|
this._initDialogPluginIntegration();
|
|
72
75
|
this.fire('ready');
|
|
73
76
|
}
|
|
@@ -95,6 +98,17 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
95
98
|
// Register the toolbar so it becomes available for Alt+F10 and Esc navigation.
|
|
96
99
|
this.addToolbar(view.toolbar);
|
|
97
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Initializes the editor menu bar.
|
|
103
|
+
*/
|
|
104
|
+
_initMenuBar() {
|
|
105
|
+
const view = this.view;
|
|
106
|
+
if (!view.menuBarView) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
this._setupMenuBarBehaviors(view.menuBarView.element);
|
|
110
|
+
view.menuBarView.fillFromConfig(this._menuBarConfig, this.componentFactory);
|
|
111
|
+
}
|
|
98
112
|
/**
|
|
99
113
|
* Enable the placeholder text on the editing root.
|
|
100
114
|
*/
|
|
@@ -176,4 +190,24 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
176
190
|
}, { priority: 'high' });
|
|
177
191
|
}, { priority: 'low' });
|
|
178
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* Handles focus and keystrokes for menu bar element.
|
|
195
|
+
*/
|
|
196
|
+
_setupMenuBarBehaviors(menuBarViewElement) {
|
|
197
|
+
const editor = this.editor;
|
|
198
|
+
this.focusTracker.add(menuBarViewElement);
|
|
199
|
+
editor.keystrokes.listenTo(menuBarViewElement);
|
|
200
|
+
editor.keystrokes.set('Esc', (data, cancel) => {
|
|
201
|
+
if (menuBarViewElement.contains(this.focusTracker.focusedElement)) {
|
|
202
|
+
editor.editing.view.focus();
|
|
203
|
+
cancel();
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
editor.keystrokes.set('Alt+F9', (data, cancel) => {
|
|
207
|
+
if (!menuBarViewElement.contains(this.focusTracker.focusedElement)) {
|
|
208
|
+
this.view.menuBarView.focus();
|
|
209
|
+
cancel();
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
179
213
|
}
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-classic/classiceditoruiview
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import { BoxedEditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
8
|
+
import { BoxedEditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
10
9
|
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
11
10
|
import type { EditingView } from 'ckeditor5/src/engine.js';
|
|
12
|
-
import '
|
|
11
|
+
import StickyPanelView from './stickypanelview.js';
|
|
12
|
+
import '../theme/classiceditor.css';
|
|
13
13
|
/**
|
|
14
14
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
|
15
15
|
* enclosed in a boxed UI view.
|
|
16
16
|
*/
|
|
17
|
-
export default class
|
|
17
|
+
export default class ClassicEditorUIView extends BoxedEditorUIView {
|
|
18
18
|
/**
|
|
19
19
|
* Sticky panel view instance. This is a parent view of a {@link #toolbar}
|
|
20
20
|
* that makes toolbar sticky.
|
|
@@ -24,6 +24,10 @@ export default class ClassicFloatingEditorUIView extends BoxedEditorUIView {
|
|
|
24
24
|
* Toolbar view instance.
|
|
25
25
|
*/
|
|
26
26
|
readonly toolbar: ToolbarView;
|
|
27
|
+
/**
|
|
28
|
+
* Menu bar view instance.
|
|
29
|
+
*/
|
|
30
|
+
readonly menuBarView?: MenuBarView;
|
|
27
31
|
/**
|
|
28
32
|
* Editable UI view.
|
|
29
33
|
*/
|
|
@@ -40,6 +44,7 @@ export default class ClassicFloatingEditorUIView extends BoxedEditorUIView {
|
|
|
40
44
|
*/
|
|
41
45
|
constructor(locale: Locale, editingView: EditingView, options?: {
|
|
42
46
|
shouldToolbarGroupWhenFull?: boolean;
|
|
47
|
+
useMenuBar?: boolean;
|
|
43
48
|
containerEl?: HTMLElement;
|
|
44
49
|
panelAbsolute?: boolean;
|
|
45
50
|
});
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module editor-classic/classiceditoruiview
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import '
|
|
8
|
+
import { BoxedEditorUIView, InlineEditableUIView, MenuBarView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import StickyPanelView from './stickypanelview.js';
|
|
10
|
+
import '../theme/classiceditor.css';
|
|
11
11
|
/**
|
|
12
12
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
|
13
13
|
* enclosed in a boxed UI view.
|
|
14
14
|
*/
|
|
15
|
-
export default class
|
|
15
|
+
export default class ClassicEditorUIView extends BoxedEditorUIView {
|
|
16
16
|
/**
|
|
17
17
|
* Creates an instance of the classic editor UI view.
|
|
18
18
|
*
|
|
@@ -29,6 +29,9 @@ export default class ClassicFloatingEditorUIView extends BoxedEditorUIView {
|
|
|
29
29
|
this.toolbar = new ToolbarView(locale, {
|
|
30
30
|
shouldGroupWhenFull: options.shouldToolbarGroupWhenFull
|
|
31
31
|
});
|
|
32
|
+
if (options.useMenuBar) {
|
|
33
|
+
this.menuBarView = new MenuBarView(locale);
|
|
34
|
+
}
|
|
32
35
|
this.editable = new InlineEditableUIView(locale, editingView);
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
@@ -36,8 +39,13 @@ export default class ClassicFloatingEditorUIView extends BoxedEditorUIView {
|
|
|
36
39
|
*/
|
|
37
40
|
render() {
|
|
38
41
|
super.render();
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
if (this.menuBarView) {
|
|
43
|
+
// Set toolbar as a child of a stickyPanel and makes toolbar sticky.
|
|
44
|
+
this.stickyPanel.content.addMany([this.menuBarView, this.toolbar]);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.stickyPanel.content.add(this.toolbar);
|
|
48
|
+
}
|
|
41
49
|
this.top.add(this.stickyPanel);
|
|
42
50
|
this.main.add(this.editable);
|
|
43
51
|
}
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/index.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module ui/panel/sticky/stickypanelview
|
|
7
7
|
*/
|
|
8
8
|
import { View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { type Locale } from 'ckeditor5
|
|
10
|
-
import '
|
|
9
|
+
import { type Locale } from '@ckeditor/ckeditor5-utils';
|
|
10
|
+
import '../theme/stickypanel.css';
|
|
11
11
|
/**
|
|
12
12
|
* The sticky panel view class.
|
|
13
13
|
*/
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* @module ui/panel/sticky/stickypanelview
|
|
7
7
|
*/
|
|
8
8
|
import { View, Template } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { global, toUnit, Rect } from 'ckeditor5
|
|
9
|
+
import { global, toUnit, Rect } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
// @if CK_DEBUG_STICKYPANEL // const {
|
|
11
11
|
// @if CK_DEBUG_STICKYPANEL // default: RectDrawer,
|
|
12
12
|
// @if CK_DEBUG_STICKYPANEL // diagonalStylesBlack
|
|
13
13
|
// @if CK_DEBUG_STICKYPANEL // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );
|
|
14
|
-
import '
|
|
14
|
+
import '../theme/stickypanel.css';
|
|
15
15
|
const toPx = toUnit('px');
|
|
16
16
|
/**
|
|
17
17
|
* The sticky panel view class.
|
|
@@ -161,9 +161,7 @@ export default class StickyPanelView extends View {
|
|
|
161
161
|
// Check if sticking the panel to the bottom of the limiter does not cause it to suddenly
|
|
162
162
|
// move upwards if there's not enough space for it.
|
|
163
163
|
if (limiterRect.bottom - stickyBottomOffset > limiterRect.top + this._contentPanelRect.height) {
|
|
164
|
-
|
|
165
|
-
this._stickToBottomOfLimiter(stickyBottomOffset);
|
|
166
|
-
}
|
|
164
|
+
this._stickToBottomOfLimiter(stickyBottomOffset);
|
|
167
165
|
}
|
|
168
166
|
else {
|
|
169
167
|
this._unstick();
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module editor-classic/editor/EditorConfig
|
|
7
|
-
*/
|
|
8
|
-
import { type EditorConfig as EditorConfigBase } from 'ckeditor5/src/core.js';
|
|
9
|
-
export type EditorConfig = EditorConfigBase & {
|
|
10
|
-
containerEl?: HTMLElement;
|
|
11
|
-
panelAbsolute?: boolean;
|
|
12
|
-
};
|
|
File without changes
|