ckeditor5-editor-classic-floating 47.5.1 → 47.5.5
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/CHANGELOG.md +4 -4
- package/LICENSE.md +21 -26
- package/README.md +26 -29
- package/build/ckeditor5-editor-classic-floating.js +1 -1
- package/dist/classiceditor.d.ts +138 -0
- package/dist/classiceditorui.d.ts +86 -0
- package/dist/classiceditoruiview.d.ts +58 -0
- package/dist/index-content.css +1 -1
- package/dist/index-editor.css +18 -18
- package/dist/index.css +32 -32
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.js +45 -40
- package/dist/index.js.map +1 -1
- package/dist/stickypanelview.d.ts +169 -0
- package/package.json +61 -61
- package/src/classiceditor.d.ts +5 -12
- package/src/classiceditor.js +6 -16
- package/src/classiceditorui.d.ts +4 -4
- package/src/classiceditorui.js +8 -22
- package/src/classiceditoruiview.d.ts +4 -4
- package/src/classiceditoruiview.js +4 -17
- package/src/index.d.ts +9 -6
- package/src/index.js +3 -9
- package/src/index.ts +10 -6
- package/src/stickypanelview.d.ts +9 -6
- package/src/stickypanelview.js +30 -41
- package/theme/classiceditor.css +16 -16
- package/theme/stickypanel.css +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Changelog
|
|
2
|
-
=========
|
|
3
|
-
|
|
4
|
-
All changes in the package are documented in https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
|
1
|
+
Changelog
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
All changes in the package are documented in https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
package/LICENSE.md
CHANGED
|
@@ -1,26 +1,21 @@
|
|
|
1
|
-
Software License Agreement
|
|
2
|
-
==========================
|
|
3
|
-
|
|
4
|
-
**
|
|
5
|
-
Copyright (c) 2003–
|
|
6
|
-
|
|
7
|
-
Licensed under
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Trademarks
|
|
24
|
-
----------
|
|
25
|
-
|
|
26
|
-
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
|
1
|
+
Software License Agreement
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
**Classic editor implementation** – https://github.com/ckeditor/ckeditor5-editor-classic <br>
|
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
|
6
|
+
|
|
7
|
+
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
|
8
|
+
|
|
9
|
+
Sources of Intellectual Property Included in CKEditor
|
|
10
|
+
-----------------------------------------------------
|
|
11
|
+
|
|
12
|
+
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
|
|
13
|
+
|
|
14
|
+
The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
|
|
15
|
+
|
|
16
|
+
* Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
|
17
|
+
|
|
18
|
+
Trademarks
|
|
19
|
+
----------
|
|
20
|
+
|
|
21
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/README.md
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
CKEditor 5 classic editor implementation
|
|
2
|
-
========================================
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
5
|
-
[ class. Follow there to learn more about this type of editor and how to initialize it.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* or commercial license terms from CKSource Holding sp. z o.o.
|
|
28
|
-
|
|
29
|
-
For more information, see: [https://ckeditor.com/legal/ckeditor-licensing-options](https://ckeditor.com/legal/ckeditor-licensing-options).
|
|
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/getting-started/legacy/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
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install ckeditor5
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
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-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{var t={8(t,e,i){"use strict";i.d(e,{A:()=>l});var o=i(802),n=i.n(o),s=i(35),r=i.n(s)()(n());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)}",""]);const l=r},542(t,e,i){"use strict";i.d(e,{A:()=>l});var o=i(802),n=i.n(o),s=i(35),r=i.n(s)()(n());r.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 l=r},35(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i="",o=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),o&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),o&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i}).join("")},e.i=function(t,i,o,n,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(o)for(var l=0;l<this.length;l++){var c=this[l][0];null!=c&&(r[c]=!0)}for(var a=0;a<t.length;a++){var h=[].concat(t[a]);o&&r[h[0]]||(void 0!==s&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=s),i&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=i):h[2]=i),n&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=n):h[4]="".concat(n)),e.push(h))}},e}},802(t){"use strict";t.exports=function(t){return t[1]}},345(t){"use strict";var e=[];function i(t){for(var i=-1,o=0;o<e.length;o++)if(e[o].identifier===t){i=o;break}return i}function o(t,o){for(var s={},r=[],l=0;l<t.length;l++){var c=t[l],a=o.base?c[0]+o.base:c[0],h=s[a]||0,u="".concat(a," ").concat(h);s[a]=h+1;var d=i(u),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==d)e[d].references++,e[d].updater(f);else{var p=n(f,o);o.byIndex=l,e.splice(l,0,{identifier:u,updater:p,references:1})}r.push(u)}return r}function n(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,n){var s=o(t=t||[],n=n||{});return function(t){t=t||[];for(var r=0;r<s.length;r++){var l=i(s[r]);e[l].references--}for(var c=o(t,n),a=0;a<s.length;a++){var h=i(s[a]);0===e[h].references&&(e[h].updater(),e.splice(h,1))}s=c}}},758(t){"use strict";var e={};t.exports=function(t,i){var o=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(i)}},725(t){"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},667(t){"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}},321(t){"use strict";var e,i=(e=[],function(t,i){return e[t]=i,e.filter(Boolean).join("\n")});function o(t,e,o,n){var s;if(o)s="";else{s="",n.supports&&(s+="@supports (".concat(n.supports,") {")),n.media&&(s+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(s+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),s+=n.css,r&&(s+="}"),n.media&&(s+="}"),n.supports&&(s+="}")}if(t.styleSheet)t.styleSheet.cssText=i(e,s);else{var l=document.createTextNode(s),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(l,c[e]):t.appendChild(l)}}var n={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=n.singletonCounter++,i=n.singleton||(n.singleton=t.insertStyleElement(t));return{update:function(t){o(i,e,!1,t)},remove:function(t){o(i,e,!0,t)}}}},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")},237(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})};var o={};(()=>{"use strict";i.r(o),i.d(o,{ClassicEditor:()=>S,ClassicEditorUI:()=>s,ClassicEditorUIView:()=>_,StickyPanelView:()=>b});var t=i(311),e=i(783),n=i(584);class s extends t.EditorUI{view;_toolbarConfig;_elementReplacer;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(),i.menuBarView&&this.initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.getDomRoot(t.editable.name)&&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",({visualTop: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.enableViewPlaceholder)({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,e=this.editor.plugins.get("ContextualBalloon");e.on("getPositionOptions",e=>{const i=e.return;if(!i||!t.isSticky||!t.element)return;const o=new n.Rect(t.element).height,s="function"==typeof i.target?i.target():i.target,r="function"==typeof i.limiter?i.limiter():i.limiter;if(s&&r&&new n.Rect(s).height>=new n.Rect(r).height-o)return;const l={...i.viewportOffsetConfig},c=(l.top||0)+o;e.return={...i,viewportOffsetConfig:{...l,top:c}}},{priority:"low"});const i=()=>{e.visibleView&&e.updatePosition()};this.listenTo(t,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_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||o.isModal)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(345),l=i.n(r),c=i(321),a=i.n(c),h=i(758),u=i.n(h),d=i(667),f=i.n(d),p=i(725),m=i.n(p),g=i(542),y={attributes:{"data-cke":!0}};y.setAttributes=f(),y.insert=u().bind(null,"head"),y.domAPI=a(),y.insertStyleElement=m();l()(g.A,y);g.A&&g.A.locals&&g.A.locals;const k=(0,n.toUnit)("px");class b extends t.View{content;containerEl;panelAbsolute;contentPanelElement;_contentPanelPlaceholder;constructor(e,i={}){super(e);const o=this.bindTemplate;this.containerEl=i.containerEl||n.global.window,this.panelAbsolute=!!i.panelAbsolute,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?k(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?k(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:o.to("_stickyTopOffset",t=>t?k(t):t),bottom:o.to("_stickyBottomOffset",t=>t?k(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()}),n.global.window.visualViewport&&(this.listenTo(n.global.window.visualViewport,"scroll",()=>{this.checkIfShouldBeSticky()}),this.listenTo(n.global.window.visualViewport,"resize",()=>{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)}const{left:i,top:o}=(0,n.getVisualViewportOffset)();if(t.moveBy(i,o),e&&e.moveBy(i,o),e&&t.top<e.top)if(this._contentPanelRect.height+this.limiterBottomOffset>e.height){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+i+1<t.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(e.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(t,e=null){let i;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,i=this.containerEl instanceof HTMLElement?this.containerEl.scrollLeft:this.containerEl.scrollX,this._marginLeft=k(-i+(0,n.getVisualViewportOffset)().left),this.position=e}_stickToBottomOfLimiter(t){let e;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,e=this.containerEl instanceof HTMLElement?this.containerEl.scrollLeft:this.containerEl.scrollX,this._marginLeft=k(-e+(0,n.getVisualViewportOffset)().left),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 v=i(8),w={attributes:{"data-cke":!0}};w.setAttributes=f(),w.insert=u().bind(null,"head"),w.domAPI=a(),w.insertStyleElement=m();l()(v.A,w);v.A&&v.A.locals&&v.A.locals;class _ extends t.BoxedEditorUIView{stickyPanel;toolbar;editable;constructor(e,i,o={}){super(e),this.stickyPanel=new b(e,o),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),o.useMenuBar&&(this.menuBarView=new t.MenuBarView(e)),this.editable=new t.InlineEditableUIView(e,i,void 0,{label:o.label})}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 T=i(782);function O(t){return function(t){return"object"==typeof t&&null!==t}(t)&&1===t.nodeType&&!function(t){if("object"!=typeof t)return!1;if(null==t)return!1;if(null===Object.getPrototypeOf(t))return!0;if("[object Object]"!==Object.prototype.toString.call(t)){const e=t[Symbol.toStringTag];return null!=e&&(!!Object.getOwnPropertyDescriptor(t,Symbol.toStringTag)?.writable&&t.toString()===`[object ${e}]`)}let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)}class S extends((0,T.ElementApiMixin)(T.Editor)){static get editorName(){return"ClassicEditor"}ui;constructor(t,e={}){if(!E(t)&&void 0!==e.initialData)throw new n.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 E(t)?(0,n.getDataFromElement)(t):t}(t)),E(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=this.config.get("menuBar"),r=new _(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:o.isVisible,label:this.config.get("label"),containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,r),(0,T.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(E(t)?t:null)).then(()=>o.data.init(o.config.get("initialData"))).then(()=>o.fire("ready")).then(()=>o))})}}function E(t){return O(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=o})();
|
|
4
|
+
*/(()=>{var t={662(t,e,i){"use strict";i.d(e,{A:()=>c});var n=i(758),o=i.n(n),s=i(935),r=i.n(s)()(o());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)}",""]);const c=r},428(t,e,i){"use strict";i.d(e,{A:()=>c});var n=i(758),o=i.n(n),s=i(935),r=i.n(s)()(o());r.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 c=r},935(t){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var i="",n=void 0!==e[5];return e[4]&&(i+="@supports (".concat(e[4],") {")),e[2]&&(i+="@media ".concat(e[2]," {")),n&&(i+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),i+=t(e),n&&(i+="}"),e[2]&&(i+="}"),e[4]&&(i+="}"),i}).join("")},e.i=function(t,i,n,o,s){"string"==typeof t&&(t=[[null,t,void 0]]);var r={};if(n)for(var c=0;c<this.length;c++){var l=this[c][0];null!=l&&(r[l]=!0)}for(var a=0;a<t.length;a++){var h=[].concat(t[a]);n&&r[h[0]]||(void 0!==s&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=s),i&&(h[2]?(h[1]="@media ".concat(h[2]," {").concat(h[1],"}"),h[2]=i):h[2]=i),o&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=o):h[4]="".concat(o)),e.push(h))}},e}},758(t){"use strict";t.exports=function(t){return t[1]}},591(t){"use strict";var e=[];function i(t){for(var i=-1,n=0;n<e.length;n++)if(e[n].identifier===t){i=n;break}return i}function n(t,n){for(var s={},r=[],c=0;c<t.length;c++){var l=t[c],a=n.base?l[0]+n.base:l[0],h=s[a]||0,u="".concat(a," ").concat(h);s[a]=h+1;var f=i(u),d={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==f)e[f].references++,e[f].updater(d);else{var p=o(d,n);n.byIndex=c,e.splice(c,0,{identifier:u,updater:p,references:1})}r.push(u)}return r}function o(t,e){var i=e.domAPI(e);i.update(t);return function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;i.update(t=e)}else i.remove()}}t.exports=function(t,o){var s=n(t=t||[],o=o||{});return function(t){t=t||[];for(var r=0;r<s.length;r++){var c=i(s[r]);e[c].references--}for(var l=n(t,o),a=0;a<s.length;a++){var h=i(s[a]);0===e[h].references&&(e[h].updater(),e.splice(h,1))}s=l}}},128(t){"use strict";var e={};t.exports=function(t,i){var n=function(t){if(void 0===e[t]){var i=document.querySelector(t);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}e[t]=i}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},51(t){"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},21(t){"use strict";t.exports=function(t,e){Object.keys(e).forEach(function(i){t.setAttribute(i,e[i])})}},639(t){"use strict";var e,i=(e=[],function(t,i){return e[t]=i,e.filter(Boolean).join("\n")});function n(t,e,n,o){var s;if(n)s="";else{s="",o.supports&&(s+="@supports (".concat(o.supports,") {")),o.media&&(s+="@media ".concat(o.media," {"));var r=void 0!==o.layer;r&&(s+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),s+=o.css,r&&(s+="}"),o.media&&(s+="}"),o.supports&&(s+="}")}if(t.styleSheet)t.styleSheet.cssText=i(e,s);else{var c=document.createTextNode(s),l=t.childNodes;l[e]&&t.removeChild(l[e]),l.length?t.insertBefore(c,l[e]):t.appendChild(c)}}var o={singleton:null,singletonCounter:0};t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=o.singletonCounter++,i=o.singleton||(o.singleton=t.insertStyleElement(t));return{update:function(t){n(i,e,!1,t)},remove:function(t){n(i,e,!0,t)}}}},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")},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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),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})};var n={};(()=>{"use strict";i.r(n),i.d(n,{ClassicEditor:()=>ie});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._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(),i.menuBarView&&this._initMenuBar(i.menuBarView),this._initDialogPluginIntegration(),this._initContextualBalloonIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.getDomRoot(t.editable.name)&&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,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})}_initContextualBalloonIntegration(){if(!this.editor.plugins.has("ContextualBalloon"))return;const{stickyPanel:t}=this.view,e=this.editor.plugins.get("ContextualBalloon");e.on("getPositionOptions",e=>{const i=e.return;if(!i||!t.isSticky||!t.element)return;const n=new o.Rect(t.element).height,s="function"==typeof i.target?i.target():i.target,r="function"==typeof i.limiter?i.limiter():i.limiter;if(s&&r&&new o.Rect(s).height>=new o.Rect(r).height-n)return;const c={...i.viewportOffsetConfig},l=(c.top||0)+n;e.return={...i,viewportOffsetConfig:{...c,top:l}}},{priority:"low"});const i=()=>{e.visibleView&&e.updatePosition()};this.listenTo(t,"change:isSticky",i),this.listenTo(this.editor.ui,"change:viewportOffset",i)}_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"})}}let r;try{r={window,document}}catch(t){r={window:{},document:{}}}const c=r;function l(){try{return navigator.userAgent.toLowerCase()}catch(t){return""}}const a=l(),h={isMac:u(a),isWindows:f(a),isGecko:d(a),isSafari:p(a),isiOS:m(a),isAndroid:b(a),isBlink:g(a),get isMediaForcedColors(){return!!c.window.matchMedia&&c.window.matchMedia("(forced-colors: active)").matches},get isMotionReduced(){return!!c.window.matchMedia&&c.window.matchMedia("(prefers-reduced-motion)").matches},features:{isRegExpUnicodePropertySupported:v()}};function u(t){return t.indexOf("macintosh")>-1}function f(t){return t.indexOf("windows")>-1}function d(t){return!!t.match(/gecko\/\d+/)}function p(t){return t.indexOf(" applewebkit/")>-1&&-1===t.indexOf("chrome")}function m(t){return!!t.match(/iphone|ipad/i)||u(t)&&navigator.maxTouchPoints>0}function b(t){return t.indexOf("android")>-1}function g(t){return t.indexOf("chrome/")>-1&&t.indexOf("edge/")<0}function v(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}return t}const y=function(){return function t(){t.called=!0}};class w{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=y(),this.off=y()}}const _=new Array(256).fill("").map((t,e)=>("0"+e.toString(16)).slice(-2));function k(){const[t,e,i,n]=crypto.getRandomValues(new Uint32Array(4));return"e"+_[255&t]+_[t>>8&255]+_[t>>16&255]+_[t>>24&255]+_[255&e]+_[e>>8&255]+_[e>>16&255]+_[e>>24&255]+_[255&i]+_[i>>8&255]+_[i>>16&255]+_[i>>24&255]+_[255&n]+_[n>>8&255]+_[n>>16&255]+_[n>>24&255]}const E={get(t="normal"){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function T(t,e){const i=E.get(e.priority);for(let n=0;n<t.length;n++)if(E.get(t[n].priority)<i)return void t.splice(n,0,e);t.push(e)}class O 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=S(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 O(t.message,e);throw i.stack=t.stack,i}}function S(t){return`\nRead more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-${t}`}const L="43.3.1";new Date(2024,10,6);if(globalThis.CKEDITOR_VERSION)throw new O("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=L;const x=Symbol("listeningTo"),P=Symbol("emitterId"),C=Symbol("delegations"),I=A(Object);function A(t){if(!t)return I;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[x]||(this[x]={});const r=this[x];B(t)||j(t);const c=B(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[x];let o=t&&B(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){F(this,t,e,i);-1!==r.indexOf(i)&&(1===r.length?delete s.callbacks[e]:F(this,t,e,i))}else if(r){for(;i=r.pop();)F(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[x]}}fire(t,...e){try{const i=t instanceof w?t:new w(this,t),n=i.name;let o=N(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[C];if(s){const t=s.get(n),o=s.get("*");t&&V(t,i,e),o&&V(o,i,e)}return i.return}catch(t){O.rethrowUnexpectedError(t,this)}}delegate(...t){return{to:(e,i)=>{this[C]||(this[C]=new Map),t.forEach(t=>{const n=this[C].get(t);n?n.set(e,i):this[C].set(t,new Map([[e,i]]))})}}}stopDelegating(t,e){if(this[C])if(t)if(e){const i=this[C].get(t);i&&i.delete(e)}else this[C].delete(t);else this[C].clear()}_addEventListener(t,e,i){!function(t,e){const i=M(t);if(i[e])return;let n=e,o=null;const s=[];for(;""!==n&&!i[n];)i[n]=R(),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=D(this,t),o={callback:e,priority:E.get(i.priority)};for(const t of n)T(t,o)}_removeEventListener(t,e){const i=D(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 j(t,e){t[P]||(t[P]=e||k())}function B(t){return t[P]}function M(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function R(){return{callbacks:[],childEvents:[]}}function D(t,e){const i=M(t)[e];if(!i)return[];let n=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){const o=D(t,i.childEvents[e]);n=n.concat(o)}return n}function N(t,e){let i;return t._events&&(i=t._events[e])&&i.callbacks.length?i.callbacks:e.indexOf(":")>-1?N(t,e.substr(0,e.lastIndexOf(":"))):null}function V(t,e,i){for(let[n,o]of t){o?"function"==typeof o&&(o=o(e.name)):o=e.name;const t=new w(e.source,o);t.path=[...e.path],n.fire(t,...i)}}function F(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=>{A[t]=I.prototype[t]});const W=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},H=Symbol("observableProperties"),z=Symbol("boundObservables"),K=Symbol("boundProperties"),U=Symbol("decoratedMethods"),G=Symbol("decoratedOriginal"),Y=$(A());function $(t){var e;if(!t)return Y;class i extends(e=t,e){set(t,e){if(W(t))return void Object.keys(t).forEach(e=>{this.set(e,t[e])},this);q(this);const i=this[H];if(t in this&&!i.has(t))throw new O("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||!Q(t))throw new O("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new O("observable-bind-duplicate-properties",this);q(this);const e=this[K];t.forEach(t=>{if(e.has(t))throw new O("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:X,toMany:J,_observable:this,_bindProperties:t,_to:[],_bindings:i}}unbind(...t){if(!this[H])return;const e=this[K],i=this[z];if(t.length){if(!Q(t))throw new O("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){q(this);const e=this[t];if(!e)throw new O("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][G]=e,this[U]||(this[U]=[]),this[U].push(t)}stopListening(t,e,i){if(!t&&this[U]){for(const t of this[U])this[t]=this[t][G];delete this[U]}super.stopListening(t,e,i)}}return i}function q(t){t[H]||(Object.defineProperty(t,H,{value:new Map}),Object.defineProperty(t,z,{value:new Map}),Object.defineProperty(t,K,{value:new Map}))}function X(...t){const e=function(...t){if(!t.length)throw new O("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 O("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 O("observable-bind-to-no-callback",this);if(n>1&&e.callback)throw new O("observable-bind-to-extra-callback",this);var o;e.to.forEach(t=>{if(t.properties.length&&t.properties.length!==n)throw new O("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[z];let i;e.get(t.observable)||o.listenTo(t.observable,"change",(n,s)=>{i=e.get(t.observable)[s],i&&i.forEach(t=>{Z(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[z],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=>{Z(this._observable,t)})}function J(t,e,i){if(this._bindings.size>1)throw new O("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 Q(t){return t.every(t=>"string"==typeof t)}function Z(t,e){const i=t[K].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 tt(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 et(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=>{$[t]=Y.prototype[t]});const it=nt(A());function nt(t){if(!t)return it;return class extends t{listenTo(t,e,i,n={}){if(tt(t)||et(t)){const o={capture:!!n.useCapture,passive:!!n.usePassive},s=this._getProxyEmitter(t,o)||new ot(t,o);this.listenTo(s,e,i,n)}else super.listenTo(t,e,i,n)}stopListening(t,e,i){if(tt(t)||et(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[x];return i&&i[e]?i[e].emitter:null}(this,st(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=>{nt[t]=it.prototype[t]});class ot extends(A()){constructor(t,e){super(),j(this,st(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),A().prototype._addEventListener.call(this,t,e,i)}_removeEventListener(t,e){A().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 st(t,e){let i=function(t){return t["data-ck-expando"]||(t["data-ck-expando"]=k())}(t);for(const t of Object.keys(e).sort())e[t]&&(i+="-"+t);return i}function rt(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 ct=["top","right","bottom","left","width","height"];class lt{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}),ut(t)||e)if(e){const e=lt.getDomRangeRects(t);at(this,lt.getBoundingRect(e))}else at(this,t.getBoundingClientRect());else if(et(t)){const{innerWidth:e,innerHeight:i}=t;at(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else at(this,t)}clone(){return new lt(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 lt(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(ht(t))return e;let i,n=t,o=t.parentNode||t.commonAncestorContainer;for(;o&&!ht(o);){const t="visible"===dt(o);n instanceof HTMLElement&&"absolute"===ft(n)&&(i=n);const s=ft(o);if(t||i&&("relative"===s&&t||"relative"!==s)){n=o,o=o.parentNode;continue}const r=new lt(o),c=e.getIntersection(r);if(!c)return null;c.getArea()<e.getArea()&&(e=c),n=o,o=o.parentNode}return e}isEqual(t){for(const e of ct)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}=c.window,i=this.clone().moveBy(t,e);if(ut(i._source)){const t=(n=i._source)&&n.parentNode?n.offsetParent===c.document.body?null:n.offsetParent:null;t&&function(t,e){const i=new lt(e),n=rt(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(et(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=rt(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 lt(t));else{let i=t.startContainer;n=i,"[object Text]"==Object.prototype.toString.call(n)&&(i=i.parentNode);const o=new lt(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 lt(e))}}function at(t,e){for(const i of ct)t[i]=e[i]}function ht(t){return!!ut(t)&&t===t.ownerDocument.body}function ut(t){return null!==t&&"object"==typeof t&&1===t.nodeType&&"function"==typeof t.getBoundingClientRect}function ft(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).position:"static"}function dt(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).overflow:"visible"}class pt{static{this._observerInstance=null}static{this._elementCallbacks=null}constructor(t,e){pt._observerInstance||pt._createObserver(),this._element=t,this._callback=e,pt._addElementCallback(t,e),pt._observerInstance.observe(t)}get element(){return this._element}destroy(){pt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){pt._elementCallbacks||(pt._elementCallbacks=new Map);let i=pt._elementCallbacks.get(t);i||(i=new Set,pt._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=pt._getElementCallbacks(t);i&&(i.delete(e),i.size||(pt._elementCallbacks.delete(t),pt._observerInstance.unobserve(t))),pt._elementCallbacks&&!pt._elementCallbacks.size&&(pt._observerInstance=null,pt._elementCallbacks=null)}static _getElementCallbacks(t){return pt._elementCallbacks?pt._elementCallbacks.get(t):null}static _createObserver(){pt._observerInstance=new c.window.ResizeObserver(t=>{for(const e of t){const t=pt._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}})}}function mt(t){return e=>e+t}c.window.CKEDITOR_TRANSLATIONS||(c.window.CKEDITOR_TRANSLATIONS={});Symbol.iterator;const bt=function(t){return null!=t&&"object"==typeof t};const gt="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;var vt="object"==typeof self&&self&&self.Object===Object&&self;const yt=(gt||vt||Function("return this")()).Symbol;var wt=Object.prototype,_t=wt.hasOwnProperty,kt=wt.toString,Et=yt?yt.toStringTag:void 0;const Tt=function(t){var e=_t.call(t,Et),i=t[Et];try{t[Et]=void 0;var n=!0}catch(t){}var o=kt.call(t);return n&&(e?t[Et]=i:delete t[Et]),o};var Ot=Object.prototype.toString;const St=function(t){return Ot.call(t)};var Lt=yt?yt.toStringTag:void 0;const xt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Lt&&Lt in Object(t)?Tt(t):St(t)};const Pt=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var Ct=Function.prototype,It=Object.prototype,At=Ct.toString,jt=It.hasOwnProperty,Bt=At.call(Object);const Mt=function(t){if(!bt(t)||"[object Object]"!=xt(t))return!1;var e=Pt(t);if(null===e)return!0;var i=jt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&At.call(i)==Bt};const Rt=function(t){return bt(t)&&1===t.nodeType&&!Mt(t)};var Dt=i(591),Nt=i.n(Dt),Vt=i(639),Ft=i.n(Vt),Wt=i(128),Ht=i.n(Wt),zt=i(21),Kt=i.n(zt),Ut=i(51),Gt=i.n(Ut),Yt=i(428),$t={attributes:{"data-cke":!0}};$t.setAttributes=Kt(),$t.insert=Ht().bind(null,"head"),$t.domAPI=Ft(),$t.insertStyleElement=Gt();Nt()(Yt.A,$t);Yt.A&&Yt.A.locals&&Yt.A.locals;const qt=mt("px");function Xt(){const t=c.window.visualViewport;if(!t||!h.isiOS&&!h.isSafari)return{left:0,top:0};return{left:Math.max(Math.round(t.offsetLeft),0),top:Math.max(Math.round(t.offsetTop),0)}}class Jt extends t.View{constructor(e,i={}){super(e);const n=this.bindTemplate;this.containerEl=i.containerEl||c.window,this.panelAbsolute=!!i.panelAbsolute,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:n.to("isSticky",t=>t?"block":"none"),height:n.to("isSticky",t=>t?qt(this._contentPanelRect.height):null)}}}).render(),this.contentPanelElement=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",n.if("isSticky","ck-sticky-panel__content_sticky"),n.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{position:n.to("position",t=>t),width:n.to("isSticky",t=>t?qt(this._contentPanelPlaceholder.getBoundingClientRect().width):null),top:n.to("_stickyTopOffset",t=>t?qt(t):t),bottom:n.to("_stickyBottomOffset",t=>t?qt(t):t),marginLeft:n.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 lt(this.limiterElement);let e=t.getVisible();if(e){const i=new lt(this.containerEl);i.top+=this.viewportTopOffset,i.height-=this.viewportTopOffset,t.top-=i.top,t.bottom-=i.top,e=e.getIntersection(i)}const{left:i,top:n}=Xt();if(t.moveBy(i,n),e&&e.moveBy(i,n),e&&t.top<e.top)if(this._contentPanelRect.height+this.limiterBottomOffset>e.height){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;this._contentPanelRect.height+i+1<t.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(e.top):this._unstick();else this._unstick()}_stickToTopOfAncestors(t,e=null){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null;let i=0;i=this.containerEl instanceof HTMLElement?this.containerEl.scrollLeft:this.containerEl.scrollX,this._marginLeft=qt(-i+Xt().left),this.position=e}_stickToBottomOfLimiter(t){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t;let e=0;e=this.containerEl instanceof HTMLElement?this.containerEl.scrollLeft:this.containerEl.scrollX,this._marginLeft=qt(-e+Xt().left),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 lt(this.contentPanelElement)}}var Qt=i(662),Zt={attributes:{"data-cke":!0}};Zt.setAttributes=Kt(),Zt.insert=Ht().bind(null,"head"),Zt.domAPI=Ft(),Zt.insertStyleElement=Gt();Nt()(Qt.A,Zt);Qt.A&&Qt.A.locals&&Qt.A.locals;class te extends t.BoxedEditorUIView{constructor(e,i,n={}){super(e),this.stickyPanel=new Jt(e,n),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:n.shouldToolbarGroupWhenFull}),n.useMenuBar&&(this.menuBarView=new t.MenuBarView(e)),this.editable=new t.InlineEditableUIView(e,i,void 0,{label:n.label})}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 ee=i(782);class ie extends((0,ee.ElementApiMixin)(ee.Editor)){constructor(t,e={}){if(!ne(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 ne(t)?(0,o.getDataFromElement)(t):t}(t)),ne(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=this.config.get("menuBar"),r=new te(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,useMenuBar:n.isVisible,label:this.config.get("label"),containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,r),(0,ee.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(ne(t)?t:null)).then(()=>n.data.init(n.config.get("initialData"))).then(()=>n.fire("ready")).then(()=>n))})}}function ne(t){return Rt(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=n})();
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module editor-classic/classiceditor
|
|
11
|
+
*/
|
|
12
|
+
import ClassicEditorUI from './classiceditorui.js';
|
|
13
|
+
import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
|
|
14
|
+
declare const ClassicEditor_base: import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>;
|
|
15
|
+
/**
|
|
16
|
+
* The classic editor implementation. It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
|
|
17
|
+
* See the {@glink examples/builds/classic-editor demo}.
|
|
18
|
+
*
|
|
19
|
+
* In order to create a classic editor instance, use the static
|
|
20
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
|
|
21
|
+
*/
|
|
22
|
+
export default class ClassicEditor extends /* #__PURE__ */ ClassicEditor_base {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
readonly ui: ClassicEditorUI;
|
|
27
|
+
/**
|
|
28
|
+
* Creates an instance of the classic editor.
|
|
29
|
+
*
|
|
30
|
+
* **Note:** do not use the constructor to create editor instances. Use the static
|
|
31
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method instead.
|
|
32
|
+
*
|
|
33
|
+
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
|
34
|
+
* or the editor's initial data. For more information see
|
|
35
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
|
|
36
|
+
* @param config The editor configuration.
|
|
37
|
+
*/
|
|
38
|
+
protected constructor(sourceElementOrData: HTMLElement | string, config?: EditorConfig);
|
|
39
|
+
/**
|
|
40
|
+
* Destroys the editor instance, releasing all resources used by it.
|
|
41
|
+
*
|
|
42
|
+
* Updates the original editor element with the data if the
|
|
43
|
+
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
|
|
44
|
+
* configuration option is set to `true`.
|
|
45
|
+
*/
|
|
46
|
+
destroy(): Promise<unknown>;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new classic editor instance.
|
|
49
|
+
*
|
|
50
|
+
* There are three ways how the editor can be initialized.
|
|
51
|
+
*
|
|
52
|
+
* # Replacing a DOM element (and loading data from it)
|
|
53
|
+
*
|
|
54
|
+
* You can initialize the editor using an existing DOM element:
|
|
55
|
+
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* ClassicEditor
|
|
58
|
+
* .create( document.querySelector( '#editor' ) )
|
|
59
|
+
* .then( editor => {
|
|
60
|
+
* console.log( 'Editor was initialized', editor );
|
|
61
|
+
* } )
|
|
62
|
+
* .catch( err => {
|
|
63
|
+
* console.error( err.stack );
|
|
64
|
+
* } );
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* The element's content will be used as the editor data and the element will be replaced by the editor UI.
|
|
68
|
+
*
|
|
69
|
+
* # Creating a detached editor
|
|
70
|
+
*
|
|
71
|
+
* Alternatively, you can initialize the editor by passing the initial data directly as a string.
|
|
72
|
+
* In this case, the editor will render an element that must be inserted into the DOM:
|
|
73
|
+
*
|
|
74
|
+
* ```ts
|
|
75
|
+
* ClassicEditor
|
|
76
|
+
* .create( '<p>Hello world!</p>' )
|
|
77
|
+
* .then( editor => {
|
|
78
|
+
* console.log( 'Editor was initialized', editor );
|
|
79
|
+
*
|
|
80
|
+
* // Initial data was provided so the editor UI element needs to be added manually to the DOM.
|
|
81
|
+
* document.body.appendChild( editor.ui.element );
|
|
82
|
+
* } )
|
|
83
|
+
* .catch( err => {
|
|
84
|
+
* console.error( err.stack );
|
|
85
|
+
* } );
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
|
|
89
|
+
* web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
|
|
90
|
+
*
|
|
91
|
+
* # Replacing a DOM element (and data provided in `config.initialData`)
|
|
92
|
+
*
|
|
93
|
+
* You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
|
|
94
|
+
*
|
|
95
|
+
* ```ts
|
|
96
|
+
* ClassicEditor
|
|
97
|
+
* .create( document.querySelector( '#editor' ), {
|
|
98
|
+
* initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
|
|
99
|
+
* } )
|
|
100
|
+
* .then( editor => {
|
|
101
|
+
* console.log( 'Editor was initialized', editor );
|
|
102
|
+
* } )
|
|
103
|
+
* .catch( err => {
|
|
104
|
+
* console.error( err.stack );
|
|
105
|
+
* } );
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* This method can be used to initialize the editor on an existing element with the specified content in case if your integration
|
|
109
|
+
* makes it difficult to set the content of the source element.
|
|
110
|
+
*
|
|
111
|
+
* Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
|
|
112
|
+
*
|
|
113
|
+
* # Configuring the editor
|
|
114
|
+
*
|
|
115
|
+
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
|
116
|
+
* customizing plugins, toolbar and more.
|
|
117
|
+
*
|
|
118
|
+
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
|
119
|
+
* or the editor's initial data.
|
|
120
|
+
*
|
|
121
|
+
* If a DOM element is passed, its content will be automatically loaded to the editor upon initialization
|
|
122
|
+
* and the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element editor element} will replace the passed element
|
|
123
|
+
* in the DOM (the original one will be hidden and the editor will be injected next to it).
|
|
124
|
+
*
|
|
125
|
+
* If the {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
|
|
126
|
+
* option is set to `true`, the editor data will be set back to the original element once the editor is destroyed and when a form,
|
|
127
|
+
* in which this element is contained, is submitted (if the original element is a `<textarea>`). This ensures seamless integration
|
|
128
|
+
* with native web forms.
|
|
129
|
+
*
|
|
130
|
+
* If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
|
|
131
|
+
* It is available under the {@link module:editor-classic/classiceditorui~ClassicEditorUI#element `editor.ui.element`} property.
|
|
132
|
+
*
|
|
133
|
+
* @param config The editor configuration.
|
|
134
|
+
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
|
135
|
+
*/
|
|
136
|
+
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<ClassicEditor>;
|
|
137
|
+
}
|
|
138
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module editor-classic/classiceditorui
|
|
11
|
+
*/
|
|
12
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import { EditorUI } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import type ClassicEditorUIView from './classiceditoruiview.js';
|
|
15
|
+
/**
|
|
16
|
+
* The classic editor UI class.
|
|
17
|
+
*/
|
|
18
|
+
export default class ClassicEditorUI extends EditorUI {
|
|
19
|
+
/**
|
|
20
|
+
* The main (top–most) view of the editor UI.
|
|
21
|
+
*/
|
|
22
|
+
readonly view: ClassicEditorUIView;
|
|
23
|
+
/**
|
|
24
|
+
* A normalized `config.toolbar` object.
|
|
25
|
+
*/
|
|
26
|
+
private readonly _toolbarConfig;
|
|
27
|
+
/**
|
|
28
|
+
* The element replacer instance used to hide the editor's source element.
|
|
29
|
+
*/
|
|
30
|
+
private readonly _elementReplacer;
|
|
31
|
+
/**
|
|
32
|
+
* Creates an instance of the classic editor UI class.
|
|
33
|
+
*
|
|
34
|
+
* @param editor The editor instance.
|
|
35
|
+
* @param view The view of the UI.
|
|
36
|
+
*/
|
|
37
|
+
constructor(editor: Editor, view: ClassicEditorUIView);
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
get element(): HTMLElement | null;
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the UI.
|
|
44
|
+
*
|
|
45
|
+
* @param replacementElement The DOM element that will be the source for the created editor.
|
|
46
|
+
*/
|
|
47
|
+
init(replacementElement: HTMLElement | null): void;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
destroy(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Initializes the editor toolbar.
|
|
54
|
+
*/
|
|
55
|
+
private _initToolbar;
|
|
56
|
+
/**
|
|
57
|
+
* Enable the placeholder text on the editing root.
|
|
58
|
+
*/
|
|
59
|
+
private _initPlaceholder;
|
|
60
|
+
/**
|
|
61
|
+
* Provides an integration between the sticky toolbar and {@link module:ui/panel/balloon/contextualballoon contextual balloon plugin}.
|
|
62
|
+
* It allows the contextual balloon to consider the height of the
|
|
63
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel}. It prevents the balloon from overlapping
|
|
64
|
+
* the sticky toolbar by adjusting the balloon's position using viewport offset configuration.
|
|
65
|
+
*/
|
|
66
|
+
private _initContextualBalloonIntegration;
|
|
67
|
+
/**
|
|
68
|
+
* Provides an integration between the sticky toolbar and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.
|
|
69
|
+
* It allows the UI-agnostic engine method to consider the geometry of the
|
|
70
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel} that pins to the
|
|
71
|
+
* edge of the viewport and can obscure the user caret after scrolling the window.
|
|
72
|
+
*
|
|
73
|
+
* @param evt The `scrollToTheSelection` event info.
|
|
74
|
+
* @param data The payload carried by the `scrollToTheSelection` event.
|
|
75
|
+
* @param originalArgs The original arguments passed to `scrollViewportToShowTarget()` method (see implementation to learn more).
|
|
76
|
+
*/
|
|
77
|
+
private _handleScrollToTheSelectionWithStickyPanel;
|
|
78
|
+
/**
|
|
79
|
+
* Provides an integration between the sticky toolbar and {@link module:ui/dialog/dialog the Dialog plugin}.
|
|
80
|
+
*
|
|
81
|
+
* It moves the dialog down to ensure that the
|
|
82
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel sticky panel}
|
|
83
|
+
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
|
84
|
+
*/
|
|
85
|
+
private _initDialogPluginIntegration;
|
|
86
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2026, 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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module editor-classic/classiceditoruiview
|
|
11
|
+
*/
|
|
12
|
+
import StickyPanelView from './stickypanelview.js';
|
|
13
|
+
import { BoxedEditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
14
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
15
|
+
import type { EditingView } from 'ckeditor5/src/engine.js';
|
|
16
|
+
import '../theme/classiceditor.css';
|
|
17
|
+
/**
|
|
18
|
+
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
|
19
|
+
* enclosed in a boxed UI view.
|
|
20
|
+
*/
|
|
21
|
+
export default class ClassicEditorUIView extends BoxedEditorUIView {
|
|
22
|
+
/**
|
|
23
|
+
* Sticky panel view instance. This is a parent view of a {@link #toolbar}
|
|
24
|
+
* that makes toolbar sticky.
|
|
25
|
+
*/
|
|
26
|
+
readonly stickyPanel: StickyPanelView;
|
|
27
|
+
/**
|
|
28
|
+
* Toolbar view instance.
|
|
29
|
+
*/
|
|
30
|
+
readonly toolbar: ToolbarView;
|
|
31
|
+
/**
|
|
32
|
+
* Editable UI view.
|
|
33
|
+
*/
|
|
34
|
+
readonly editable: InlineEditableUIView;
|
|
35
|
+
/**
|
|
36
|
+
* Creates an instance of the classic editor UI view.
|
|
37
|
+
*
|
|
38
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
39
|
+
* @param editingView The editing view instance this view is related to.
|
|
40
|
+
* @param options Configuration options for the view instance.
|
|
41
|
+
* @param options.shouldToolbarGroupWhenFull When set `true` enables automatic items grouping
|
|
42
|
+
* in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
|
|
43
|
+
* See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
|
|
44
|
+
* @param options.label When set, this value will be used as an accessible `aria-label` of the
|
|
45
|
+
* {@link module:ui/editableui/editableuiview~EditableUIView editable view}.
|
|
46
|
+
*/
|
|
47
|
+
constructor(locale: Locale, editingView: EditingView, options?: {
|
|
48
|
+
shouldToolbarGroupWhenFull?: boolean;
|
|
49
|
+
useMenuBar?: boolean;
|
|
50
|
+
label?: string | Record<string, string>;
|
|
51
|
+
containerEl?: HTMLElement;
|
|
52
|
+
panelAbsolute?: boolean;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
render(): void;
|
|
58
|
+
}
|
package/dist/index-content.css
CHANGED
package/dist/index-editor.css
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
.ck.ck-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{
|
|
6
|
+
z-index:var(--ck-z-panel);
|
|
7
|
+
position:fixed;
|
|
8
|
+
top:0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{
|
|
12
|
+
top:auto;
|
|
13
|
+
position:absolute;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ck.ck-editor{
|
|
17
|
+
position:relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{
|
|
21
|
+
z-index:var(--ck-z-panel);
|
|
22
22
|
}
|