@ckeditor/ckeditor5-editor-classic 40.2.0 → 41.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/build/editor-classic.js +2 -2
- package/package.json +3 -2
- package/src/classiceditor.d.ts +5 -5
- package/src/classiceditor.js +8 -7
- package/src/classiceditorui.d.ts +12 -4
- package/src/classiceditorui.js +32 -4
- package/src/classiceditoruiview.d.ts +5 -5
- package/src/classiceditoruiview.js +2 -2
- package/src/index.d.ts +2 -2
- package/src/index.js +2 -2
- package/theme/classiceditor.css +2 -2
package/LICENSE.md
CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
|
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**Classic editor implementation** – https://github.com/ckeditor/ckeditor5-editor-classic <br>
|
5
|
-
Copyright (c) 2003–
|
5
|
+
Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
6
6
|
|
7
7
|
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
|
8
8
|
|
package/build/editor-classic.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
|
-
* @license Copyright (c) 2003-
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md.
|
4
|
-
*/(()=>{var e={73:(e,t,o)=>{"use strict";o.d(t,{Z:()=>n});var r=o(609),i=o.n(r)()((function(e){return e[1]}));i.push([e.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.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=i},609: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,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var n=0;n<this.length;n++){var c=this[n][0];null!=c&&(i[c]=!0)}for(var a=0;a<e.length;a++){var s=[].concat(e[a]);r&&i[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),t.push(s))}},t}},62:(e,t,o)=>{"use strict";var r,i=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},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={},r=[],i=0;i<e.length;i++){var n=e[i],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}),r.push(d)}return r}function l(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var i=o.nc;i&&(r.nonce=i)}if(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),"function"==typeof e.insert)e.insert(t);else{var 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,r){var i=o?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=u(t,i);else{var n=document.createTextNode(i),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 r=o.css,i=o.media,n=o.sourceMap;if(i?e.setAttribute("media",i):e.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var f=null,b=0;function k(e,t){var o,r,i;if(t.singleton){var n=b++;o=f||(f=l(t)),r=h.bind(null,o,n,!1),i=h.bind(null,o,n,!0)}else o=l(t),r=p.bind(null,o,t),i=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(o)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=i());var o=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<o.length;r++){var i=a(o[r]);c[i].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}}}},704:(e,t,o)=>{e.exports=o(79)("./src/core.js")},492:(e,t,o)=>{e.exports=o(79)("./src/engine.js")},273:(e,t,o)=>{e.exports=o(79)("./src/ui.js")},209:(e,t,o)=>{e.exports=o(79)("./src/utils.js")},434:(e,t,o)=>{e.exports=o(79)("./src/watchdog.js")},79:e=>{"use strict";e.exports=CKEditor5.dll}},t={};function o(r){var i=t[r];if(void 0!==i)return i.exports;var n=t[r]={id:r,exports:{}};return e[r](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 r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},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 r={};(()=>{"use strict";o.r(r),o.d(r,{ClassicEditor:()=>D});var e=o(273),t=o(492),i=o(209);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 i.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,r=t.editing.view,i=o.editable,n=r.document.getRoot();i.name=n.rootName,o.render();const c=i.element;this.setEditableElement(i.name,c),o.editable.bind("isFocused").to(this.focusTracker),r.attachDomRoot(c),e&&this._elementReplacer.replace(e,this.element),this._initPlaceholder(),this._initToolbar(),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,r=o.document.getRoot(),i=e.sourceElement;let n;const c=e.config.get("placeholder");c&&(n="string"==typeof c?c:c[this.view.editable.name]),!n&&i&&"textarea"===i.tagName.toLowerCase()&&(n=i.getAttribute("placeholder")),n&&(r.placeholder=n),(0,t.enablePlaceholder)({view:o,element:r,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(e,t,o){const r=this.view.stickyPanel;if(r.isSticky){const e=new i.Rect(r.element).height;t.viewportOffset.top+=e}else{const e=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(r,"change:isSticky",e),setTimeout((()=>{this.stopListening(r,"change:isSticky",e)}),20)}}}var c=o(62),a=o.n(c),s=o(73),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.Z,l);s.Z.locals;class d extends e.BoxedEditorUIView{constructor(t,o,r={}){super(t),this.stickyPanel=new e.StickyPanelView(t),this.toolbar=new e.ToolbarView(t,{shouldGroupWhenFull:r.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(704),h=o(434);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,m=v.hasOwnProperty,g=v.toString,y=k?k.toStringTag:void 0;const _=function(e){var t=m.call(e,y),o=e[y];try{e[y]=void 0;var r=!0}catch(e){}var i=g.call(e);return r&&(t?e[y]=o:delete e[y]),i};var w=Object.prototype.toString;const T=function(e){return w.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)?_(e):T(e)};const x=function(e,t){return function(o){return e(t(o))}}(Object.getPrototypeOf,Object);var E=Function.prototype,O=Object.prototype,C=E.toString,P=O.hasOwnProperty,F=C.call(Object);const M=function(e){if(!p(e)||"[object Object]"!=S(e))return!1;var t=x(e);if(null===t)return!0;var o=P.call(t,"constructor")&&t.constructor;return"function"==typeof o&&o instanceof o&&C.call(o)==F};const R=function(e){return p(e)&&1===e.nodeType&&!M(e)};class D extends((0,u.DataApiMixin)((0,u.ElementApiMixin)(u.Editor))){constructor(e,t={}){if(!N(e)&&void 0!==t.initialData)throw new i.CKEditorError("editor-create-initial-data",null);super(t),void 0===this.config.get("initialData")&&this.config.set("initialData",function(e){return N(e)?(0,i.getDataFromElement)(e):e}(e)),N(e)&&(this.sourceElement=e),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o});this.ui=new n(this,r),(0,u.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(e,t={}){return new Promise((o=>{const r=new this(e,t);o(r.initPlugins().then((()=>r.ui.init(N(e)?e:null))).then((()=>r.data.init(r.config.get("initialData")))).then((()=>r.fire("ready"))).then((()=>r)))}))}}function N(e){return R(e)}D.Context=u.Context,D.EditorWatchdog=h.EditorWatchdog,D.ContextWatchdog=h.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=r})();
|
4
|
+
*/(()=>{var t={655:(t,e,o)=>{"use strict";o.d(e,{Z:()=>n});var i=o(609),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},609: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}},62:(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}}}},704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},434:(t,e,o)=>{t.exports=o(79)("./src/watchdog.js")},79: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:()=>N});var t=o(273),e=o(492),r=o(209);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(62),a=o.n(c),s=o(655),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.Z,l);s.Z.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(704),h=o(434);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 x=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var O=Function.prototype,E=Object.prototype,P=O.toString,C=E.hasOwnProperty,D=P.call(Object);const F=function(t){if(!f(t)||"[object Object]"!=S(t))return!1;var e=x(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 M=function(t){return f(t)&&1===t.nodeType&&!F(t)};class R extends((0,u.DataApiMixin)((0,u.ElementApiMixin)(u.Editor))){constructor(t,e={}){if(!W(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 W(t)?(0,r.getDataFromElement)(t):t}(t)),W(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(W(t)?t:null))).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}R.Context=u.Context,R.EditorWatchdog=h.EditorWatchdog,R.ContextWatchdog=h.ContextWatchdog;const N=R;function W(t){return M(t)}})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=i})();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-classic",
|
3
|
-
"version": "
|
3
|
+
"version": "41.0.0",
|
4
4
|
"description": "Classic editor implementation for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -9,9 +9,10 @@
|
|
9
9
|
"ckeditor5-editor",
|
10
10
|
"ckeditor5-dll"
|
11
11
|
],
|
12
|
+
"type": "module",
|
12
13
|
"main": "src/index.js",
|
13
14
|
"dependencies": {
|
14
|
-
"ckeditor5": "
|
15
|
+
"ckeditor5": "41.0.0",
|
15
16
|
"lodash-es": "4.17.21"
|
16
17
|
},
|
17
18
|
"author": "CKSource (http://cksource.com/)",
|
package/src/classiceditor.d.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic/classiceditor
|
7
7
|
*/
|
8
|
-
import ClassicEditorUI from './classiceditorui';
|
9
|
-
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core';
|
10
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
11
|
-
declare const ClassicEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
|
8
|
+
import ClassicEditorUI from './classiceditorui.js';
|
9
|
+
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core.js';
|
10
|
+
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
11
|
+
declare const ClassicEditor_base: import("ckeditor5/src/utils.js").Mixed<import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>, import("ckeditor5/src/core.js").DataApi>;
|
12
12
|
/**
|
13
13
|
* The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.
|
14
14
|
* It uses an inline editable and a sticky toolbar, all enclosed in a boxed UI.
|
package/src/classiceditor.js
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic/classiceditor
|
7
7
|
*/
|
8
|
-
import ClassicEditorUI from './classiceditorui';
|
9
|
-
import ClassicEditorUIView from './classiceditoruiview';
|
10
|
-
import { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm } from 'ckeditor5/src/core';
|
11
|
-
import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils';
|
12
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
8
|
+
import ClassicEditorUI from './classiceditorui.js';
|
9
|
+
import ClassicEditorUIView from './classiceditoruiview.js';
|
10
|
+
import { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm } from 'ckeditor5/src/core.js';
|
11
|
+
import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils.js';
|
12
|
+
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
13
13
|
import { isElement as _isElement } from 'lodash-es';
|
14
14
|
/**
|
15
15
|
* The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.
|
@@ -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
|
-
|
37
|
+
class ClassicEditor extends DataApiMixin(ElementApiMixin(Editor)) {
|
38
38
|
/**
|
39
39
|
* Creates an instance of the classic editor.
|
40
40
|
*
|
@@ -211,6 +211,7 @@ ClassicEditor.EditorWatchdog = EditorWatchdog;
|
|
211
211
|
* Exposed as static editor field for easier access in editor builds.
|
212
212
|
*/
|
213
213
|
ClassicEditor.ContextWatchdog = ContextWatchdog;
|
214
|
+
export default ClassicEditor;
|
214
215
|
function getInitialData(sourceElementOrData) {
|
215
216
|
return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
|
216
217
|
}
|
package/src/classiceditorui.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic/classiceditorui
|
7
7
|
*/
|
8
|
-
import type { Editor } from 'ckeditor5/src/core';
|
9
|
-
import { EditorUI } from 'ckeditor5/src/ui';
|
10
|
-
import type ClassicEditorUIView from './classiceditoruiview';
|
8
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
9
|
+
import { EditorUI } from 'ckeditor5/src/ui.js';
|
10
|
+
import type ClassicEditorUIView from './classiceditoruiview.js';
|
11
11
|
/**
|
12
12
|
* The classic editor UI class.
|
13
13
|
*/
|
@@ -64,4 +64,12 @@ export default class ClassicEditorUI extends EditorUI {
|
|
64
64
|
* @param originalArgs The original arguments passed to `scrollViewportToShowTarget()` method (see implementation to learn more).
|
65
65
|
*/
|
66
66
|
private _handleScrollToTheSelectionWithStickyPanel;
|
67
|
+
/**
|
68
|
+
* Provides an integration between the sticky toolbar and {@link module:ui/dialog/dialog the Dialog plugin}.
|
69
|
+
*
|
70
|
+
* It moves the dialog down to ensure that the
|
71
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel sticky panel}
|
72
|
+
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
73
|
+
*/
|
74
|
+
private _initDialogPluginIntegration;
|
67
75
|
}
|
package/src/classiceditorui.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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 } from 'ckeditor5/src/ui';
|
6
|
-
import { enablePlaceholder } from 'ckeditor5/src/engine';
|
7
|
-
import { ElementReplacer, Rect } from 'ckeditor5/src/utils';
|
5
|
+
import { EditorUI, normalizeToolbarConfig, DialogView } from 'ckeditor5/src/ui.js';
|
6
|
+
import { enablePlaceholder } from 'ckeditor5/src/engine.js';
|
7
|
+
import { ElementReplacer, Rect } from 'ckeditor5/src/utils.js';
|
8
8
|
/**
|
9
9
|
* The classic editor UI class.
|
10
10
|
*/
|
@@ -68,6 +68,7 @@ export default class ClassicEditorUI extends EditorUI {
|
|
68
68
|
}
|
69
69
|
this._initPlaceholder();
|
70
70
|
this._initToolbar();
|
71
|
+
this._initDialogPluginIntegration();
|
71
72
|
this.fire('ready');
|
72
73
|
}
|
73
74
|
/**
|
@@ -148,4 +149,31 @@ export default class ClassicEditorUI extends EditorUI {
|
|
148
149
|
}, 20);
|
149
150
|
}
|
150
151
|
}
|
152
|
+
/**
|
153
|
+
* Provides an integration between the sticky toolbar and {@link module:ui/dialog/dialog the Dialog plugin}.
|
154
|
+
*
|
155
|
+
* It moves the dialog down to ensure that the
|
156
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel sticky panel}
|
157
|
+
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
158
|
+
*/
|
159
|
+
_initDialogPluginIntegration() {
|
160
|
+
if (!this.editor.plugins.has('Dialog')) {
|
161
|
+
return;
|
162
|
+
}
|
163
|
+
const stickyPanel = this.view.stickyPanel;
|
164
|
+
const dialogPlugin = this.editor.plugins.get('Dialog');
|
165
|
+
dialogPlugin.on('show', () => {
|
166
|
+
const dialogView = dialogPlugin.view;
|
167
|
+
dialogView.on('moveTo', (evt, data) => {
|
168
|
+
// Engage only when the panel is sticky, and the dialog is using one of default positions.
|
169
|
+
if (!stickyPanel.isSticky || dialogView.wasMoved) {
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
const stickyPanelContentRect = new Rect(stickyPanel.contentPanelElement);
|
173
|
+
if (data[1] < stickyPanelContentRect.bottom + DialogView.defaultOffset) {
|
174
|
+
data[1] = stickyPanelContentRect.bottom + DialogView.defaultOffset;
|
175
|
+
}
|
176
|
+
}, { priority: 'high' });
|
177
|
+
}, { priority: 'low' });
|
178
|
+
}
|
151
179
|
}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic/classiceditoruiview
|
7
7
|
*/
|
8
|
-
import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui';
|
9
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
10
|
-
import type {
|
8
|
+
import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui.js';
|
9
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
10
|
+
import type { EditingView } from 'ckeditor5/src/engine.js';
|
11
11
|
import '../theme/classiceditor.css';
|
12
12
|
/**
|
13
13
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
@@ -37,7 +37,7 @@ export default class ClassicEditorUIView extends BoxedEditorUIView {
|
|
37
37
|
* in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
|
38
38
|
* See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
|
39
39
|
*/
|
40
|
-
constructor(locale: Locale, editingView:
|
40
|
+
constructor(locale: Locale, editingView: EditingView, options?: {
|
41
41
|
shouldToolbarGroupWhenFull?: boolean;
|
42
42
|
});
|
43
43
|
/**
|
@@ -1,11 +1,11 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic/classiceditoruiview
|
7
7
|
*/
|
8
|
-
import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui';
|
8
|
+
import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui.js';
|
9
9
|
import '../theme/classiceditor.css';
|
10
10
|
/**
|
11
11
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
package/src/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic
|
7
7
|
*/
|
8
|
-
export { default as ClassicEditor } from './classiceditor';
|
8
|
+
export { default as ClassicEditor } from './classiceditor.js';
|
package/src/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
* @license Copyright (c) 2003-
|
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
5
|
/**
|
6
6
|
* @module editor-classic
|
7
7
|
*/
|
8
|
-
export { default as ClassicEditor } from './classiceditor';
|
8
|
+
export { default as ClassicEditor } from './classiceditor.js';
|
package/theme/classiceditor.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2003-
|
2
|
+
* 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
5
|
|
@@ -11,6 +11,6 @@
|
|
11
11
|
|
12
12
|
& .ck-editor__top .ck-sticky-panel .ck-toolbar {
|
13
13
|
/* https://github.com/ckeditor/ckeditor5-editor-classic/issues/62 */
|
14
|
-
z-index: var(--ck-z-
|
14
|
+
z-index: var(--ck-z-panel);
|
15
15
|
}
|
16
16
|
}
|