ckeditor5-editor-classic-floating 41.0.0 → 41.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/build/ckeditor5-editor-classic-floating.js +1 -1
- package/build/editor-classic.js +4 -0
- package/package.json +16 -16
- package/src/editor/ClassicFloatingEditor.d.ts +4 -4
- package/src/editor/ClassicFloatingEditor.js +3 -3
- package/src/editor/EditorConfig.d.ts +10 -3
- package/src/editor/EditorConfig.js +4 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/index.ts +2 -1
- package/src/ui/ClassicFloatingEditorUI.d.ts +4 -4
- package/src/ui/ClassicFloatingEditorUI.js +2 -2
- package/src/ui/ClassicFloatingEditorUIView.d.ts +2 -2
- package/src/ui/ClassicFloatingEditorUIView.js +2 -2
- package/src/ui/panel/StickyPanelView.d.ts +3 -3
- package/src/ui/panel/StickyPanelView.js +8 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
CKEditor 5 classic
|
|
1
|
+
CKEditor 5 classic editor implementation
|
|
2
2
|
========================================
|
|
3
3
|
|
|
4
4
|
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
@@ -7,13 +7,13 @@ CKEditor 5 classic floating editor implementation
|
|
|
7
7
|
|
|
8
8
|
The classic editor implementation for CKEditor 5.
|
|
9
9
|
|
|
10
|
-
This package contains the [`
|
|
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
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/ckeditor5-
|
|
12
|
+
This package contains the source version of the classic editor. This kind of editor implementation is also available as a ready-to-use [classic build](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-classic). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
13
13
|
|
|
14
14
|
## Documentation
|
|
15
15
|
|
|
16
|
-
See the [
|
|
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
17
|
|
|
18
18
|
## License
|
|
19
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{var t={404:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}",""]);const s=n},528:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{border-top-left-radius:0;border-top-right-radius:0;border-width:0 1px 1px;box-shadow:var(--ck-drop-shadow),0 0}",""]);const s=n},849:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var s=0;s<this.length;s++){var r=this[s][0];null!=r&&(n[r]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);o&&n[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),e.push(l))}},e}},728:(t,e,i)=>{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function c(t){for(var e=-1,i=0;i<r.length;i++)if(r[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},o=[],n=0;n<t.length;n++){var s=t[n],l=e.base?s[0]+e.base:s[0],a=i[l]||0,h="".concat(l," ").concat(a);i[l]=a+1;var u=c(h),d={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(d)):r.push({identifier:h,updater:m(d,e),references:1}),o.push(h)}return o}function a(t){var e=document.createElement("style"),o=t.attributes||{};if(void 0===o.nonce){var n=i.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var r=s(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}return e}var h,u=(h=[],function(t,e){return h[t]=e,h.filter(Boolean).join("\n")});function d(t,e,i,o){var n=i?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=u(e,n);else{var s=document.createTextNode(n),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(s,r[e]):t.appendChild(s)}}function f(t,e,i){var o=i.css,n=i.media,s=i.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,b=0;function m(t,e){var i,o,n;if(e.singleton){var s=b++;i=p||(p=a(e)),o=d.bind(null,i,s,!1),n=d.bind(null,i,s,!0)}else i=a(e),o=f.bind(null,i,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<i.length;o++){var n=c(i[o]);r[n].references--}for(var s=l(t,e),a=0;a<i.length;a++){var h=c(i[a]);0===r[h].references&&(r[h].updater(),r.splice(h,1))}i=s}}}},968:(t,e,i)=>{t.exports=i(672)("./src/core.js")},684:(t,e,i)=>{t.exports=i(672)("./src/engine.js")},348:(t,e,i)=>{t.exports=i(672)("./src/ui.js")},316:(t,e,i)=>{t.exports=i(672)("./src/utils.js")},344:(t,e,i)=>{t.exports=i(672)("./src/watchdog.js")},672:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var o={};(()=>{"use strict";i.r(o),i.d(o,{ClassicFloatingEditor:()=>Vt});var t=i(348),e=i(684),n=i(316);class s extends t.EditorUI{constructor(e,i){super(e),this.view=i,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new n.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,o=e.editing.view,n=i.editable,s=o.document.getRoot();n.name=s.rootName,i.render();const r=n.element;this.setEditableElement(n.name,r),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let s;const r=t.config.get("placeholder");r&&(s="string"==typeof r?r:r[this.view.editable.name]),!s&&n&&"textarea"===n.tagName.toLowerCase()&&(s=n.getAttribute("placeholder")),s&&(o.placeholder=s),(0,e.enablePlaceholder)({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,i){const o=this.view.stickyPanel;if(o.isSticky){const t=new n.Rect(o.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(o,"change:isSticky",t),setTimeout((()=>{this.stopListening(o,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",(()=>{const o=i.view;o.on("moveTo",((i,s)=>{if(!e.isSticky||o.wasMoved)return;const r=new n.Rect(e.contentPanelElement);s[1]<r.bottom+t.DialogView.defaultOffset&&(s[1]=r.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}const r=function(){try{return navigator.userAgent.toLowerCase()}catch(t){return""}}();c(r),function(t){t.indexOf("windows")}(r),function(t){t.match(/gecko\/\d+/)}(r),function(t){t.indexOf(" applewebkit/")>-1&&t.indexOf("chrome")}(r),function(t){!!t.match(/iphone|ipad/i)||c(t)&&navigator.maxTouchPoints}(r),function(t){t.indexOf("android")}(r),function(t){t.indexOf("chrome/")>-1&&t.indexOf("edge/")}(r),function(){let t=!1;try{t=0==="ć".search(new RegExp("[\\p{L}]","u"))}catch(t){}}();function c(t){return t.indexOf("macintosh")>-1}const l=function(){return function t(){t.called=!0}};class a{constructor(t,e){this.source=t,this.name=e,this.path=[],this.stop=l(),this.off=l()}}const h=new Array(256).fill("").map(((t,e)=>("0"+e.toString(16)).slice(-2)));function u(){const t=4294967296*Math.random()>>>0,e=4294967296*Math.random()>>>0,i=4294967296*Math.random()>>>0,o=4294967296*Math.random()>>>0;return"e"+h[t>>0&255]+h[t>>8&255]+h[t>>16&255]+h[t>>24&255]+h[e>>0&255]+h[e>>8&255]+h[e>>16&255]+h[e>>24&255]+h[i>>0&255]+h[i>>8&255]+h[i>>16&255]+h[i>>24&255]+h[o>>0&255]+h[o>>8&255]+h[o>>16&255]+h[o>>24&255]}const d={get(t="normal"){return"number"!=typeof t?this[t]||this.normal:t},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};function f(t,e){const i=d.get(e.priority);for(let o=0;o<t.length;o++)if(d.get(t[o].priority)<i)return void t.splice(o,0,e);t.push(e)}const p="https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";class b extends Error{constructor(t,e,i){super(function(t,e){const i=new WeakSet,o=(t,e)=>{if("object"==typeof e&&null!==e){if(i.has(e))return`[object ${e.constructor.name}]`;i.add(e)}return e},n=e?` ${JSON.stringify(e,o)}`:"",s=m(t);return t+n+s}(t,i)),this.name="CKEditorError",this.context=e,this.data=i}is(t){return"CKEditorError"===t}static rethrowUnexpectedError(t,e){if(t.is&&t.is("CKEditorError"))throw t;const i=new b(t.message,e);throw i.stack=t.stack,i}}function m(t){return`\nRead more: ${p}#error-${t}`}const g="41.0.0";new Date(2024,0,17);if(globalThis.CKEDITOR_VERSION)throw new b("ckeditor-duplicated-modules",null);globalThis.CKEDITOR_VERSION=g;const v=Symbol("listeningTo"),y=Symbol("emitterId"),w=Symbol("delegations"),_=k(Object);function k(t){if(!t)return _;return class extends t{on(t,e,i){this.listenTo(this,t,e,i)}once(t,e,i){let o=!1;this.listenTo(this,t,((t,...i)=>{o||(o=!0,t.off(),e.call(this,t,...i))}),i)}off(t,e){this.stopListening(this,t,e)}listenTo(t,e,i,o={}){let n,s;this[v]||(this[v]={});const r=this[v];T(t)||E(t);const c=T(t);(n=r[c])||(n=r[c]={emitter:t,callbacks:{}}),(s=n.callbacks[e])||(s=n.callbacks[e]=[]),s.push(i),function(t,e,i,o,n){e._addEventListener?e._addEventListener(i,o,n):t._addEventListener.call(e,i,o,n)}(this,t,e,i,o)}stopListening(t,e,i){const o=this[v];let n=t&&T(t);const s=o&&n?o[n]:void 0,r=s&&e?s.callbacks[e]:void 0;if(!(!o||t&&!s||e&&!r))if(i){C(this,t,e,i);-1!==r.indexOf(i)&&(1===r.length?delete s.callbacks[e]:C(this,t,e,i))}else if(r){for(;i=r.pop();)C(this,t,e,i);delete s.callbacks[e]}else if(s){for(e in s.callbacks)this.stopListening(t,e);delete o[n]}else{for(n in o)this.stopListening(o[n].emitter);delete this[v]}}fire(t,...e){try{const i=t instanceof a?t:new a(this,t),o=i.name;let n=x(this,o);if(i.path.push(this),n){const t=[i,...e];n=Array.from(n);for(let e=0;e<n.length&&(n[e].callback.apply(this,t),i.off.called&&(delete i.off.called,this._removeEventListener(o,n[e].callback)),!i.stop.called);e++);}const s=this[w];if(s){const t=s.get(o),n=s.get("*");t&&L(t,i,e),n&&L(n,i,e)}return i.return}catch(t){b.rethrowUnexpectedError(t,this)}}delegate(...t){return{to:(e,i)=>{this[w]||(this[w]=new Map),t.forEach((t=>{const o=this[w].get(t);o?o.set(e,i):this[w].set(t,new Map([[e,i]]))}))}}}stopDelegating(t,e){if(this[w])if(t)if(e){const i=this[w].get(t);i&&i.delete(e)}else this[w].delete(t);else this[w].clear()}_addEventListener(t,e,i){!function(t,e){const i=O(t);if(i[e])return;let o=e,n=null;const s=[];for(;""!==o&&!i[o];)i[o]={callbacks:[],childEvents:[]},s.push(i[o]),n&&i[o].childEvents.push(n),n=o,o=o.substr(0,o.lastIndexOf(":"));if(""!==o){for(const t of s)t.callbacks=i[o].callbacks.slice();i[o].childEvents.push(n)}}(this,t);const o=S(this,t),n={callback:e,priority:d.get(i.priority)};for(const t of o)f(t,n)}_removeEventListener(t,e){const i=S(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 E(t,e){t[y]||(t[y]=e||u())}function T(t){return t[y]}function O(t){return t._events||Object.defineProperty(t,"_events",{value:{}}),t._events}function S(t,e){const i=O(t)[e];if(!i)return[];let o=[i.callbacks];for(let e=0;e<i.childEvents.length;e++){const n=S(t,i.childEvents[e]);o=o.concat(n)}return o}function x(t,e){let i;return t._events&&(i=t._events[e])&&i.callbacks.length?i.callbacks:e.indexOf(":")>-1?x(t,e.substr(0,e.lastIndexOf(":"))):null}function L(t,e,i){for(let[o,n]of t){n?"function"==typeof n&&(n=n(e.name)):n=e.name;const t=new a(e.source,n);t.path=[...e.path],o.fire(t,...i)}}function C(t,e,i,o){e._removeEventListener?e._removeEventListener(i,o):t._removeEventListener.call(e,i,o)}["on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{k[t]=_.prototype[t]}));const j=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},P=Symbol("observableProperties"),I=Symbol("boundObservables"),R=Symbol("boundProperties"),A=Symbol("decoratedMethods"),N=Symbol("decoratedOriginal"),M=D(k());function D(t){if(!t)return M;return class extends t{set(t,e){if(j(t))return void Object.keys(t).forEach((e=>{this.set(e,t[e])}),this);B(this);const i=this[P];if(t in this&&!i.has(t))throw new b("observable-set-cannot-override",this);Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get:()=>i.get(t),set(e){const o=i.get(t);let n=this.fire(`set:${t}`,t,e,o);void 0===n&&(n=e),o===n&&i.has(t)||(i.set(t,n),this.fire(`change:${t}`,t,n,o))}}),this[t]=e}bind(...t){if(!t.length||!W(t))throw new b("observable-bind-wrong-properties",this);if(new Set(t).size!==t.length)throw new b("observable-bind-duplicate-properties",this);B(this);const e=this[R];t.forEach((t=>{if(e.has(t))throw new b("observable-bind-rebind",this)}));const i=new Map;return t.forEach((t=>{const o={property:t,to:[]};e.set(t,o),i.set(t,o)})),{to:F,toMany:V,_observable:this,_bindProperties:t,_to:[],_bindings:i}}unbind(...t){if(!this[P])return;const e=this[R],i=this[I];if(t.length){if(!W(t))throw new b("observable-unbind-wrong-properties",this);t.forEach((t=>{const o=e.get(t);o&&(o.to.forEach((([t,e])=>{const n=i.get(t),s=n[e];s.delete(o),s.size||delete n[e],Object.keys(n).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){B(this);const e=this[t];if(!e)throw new b("observablemixin-cannot-decorate-undefined",this,{object:this,methodName:t});this.on(t,((t,i)=>{t.return=e.apply(this,i)})),this[t]=function(...e){return this.fire(t,e)},this[t][N]=e,this[A]||(this[A]=[]),this[A].push(t)}stopListening(t,e,i){if(!t&&this[A]){for(const t of this[A])this[t]=this[t][N];delete this[A]}super.stopListening(t,e,i)}}}function B(t){t[P]||(Object.defineProperty(t,P,{value:new Map}),Object.defineProperty(t,I,{value:new Map}),Object.defineProperty(t,R,{value:new Map}))}function F(...t){const e=function(...t){if(!t.length)throw new b("observable-bind-to-parse-error",null);const e={to:[]};let i;"function"==typeof t[t.length-1]&&(e.callback=t.pop());return t.forEach((t=>{if("string"==typeof t)i.properties.push(t);else{if("object"!=typeof t)throw new b("observable-bind-to-parse-error",null);i={observable:t,properties:[]},e.to.push(i)}})),e}(...t),i=Array.from(this._bindings.keys()),o=i.length;if(!e.callback&&e.to.length>1)throw new b("observable-bind-to-no-callback",this);if(o>1&&e.callback)throw new b("observable-bind-to-extra-callback",this);var n;e.to.forEach((t=>{if(t.properties.length&&t.properties.length!==o)throw new b("observable-bind-to-properties-length",this);t.properties.length||(t.properties=this._bindProperties)})),this._to=e.to,e.callback&&(this._bindings.get(i[0]).callback=e.callback),n=this._observable,this._to.forEach((t=>{const e=n[I];let i;e.get(t.observable)||n.listenTo(t.observable,"change",((o,s)=>{i=e.get(t.observable)[s],i&&i.forEach((t=>{z(n,t.property)}))}))})),function(t){let e;t._bindings.forEach(((i,o)=>{t._to.forEach((n=>{e=n.properties[i.callback?0:t._bindProperties.indexOf(o)],i.to.push([n.observable,e]),function(t,e,i,o){const n=t[I],s=n.get(i),r=s||{};r[o]||(r[o]=new Set);r[o].add(e),s||n.set(i,r)}(t._observable,i,n.observable,e)}))}))}(this),this._bindProperties.forEach((t=>{z(this._observable,t)}))}function V(t,e,i){if(this._bindings.size>1)throw new b("observable-bind-to-many-not-one-binding",this);this.to(...function(t,e){const i=t.map((t=>[t,e]));return Array.prototype.concat.apply([],i)}(t,e),i)}function W(t){return t.every((t=>"string"==typeof t))}function z(t,e){const i=t[R].get(e);let o;i.callback?o=i.callback.apply(t,i.to.map((t=>t[0][t[1]]))):(o=i.to[0],o=o[0][o[1]]),Object.prototype.hasOwnProperty.call(t,e)?t[e]=o:t.set(e,o)}function H(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 K(t){const e=Object.prototype.toString.apply(t);return"[object Window]"==e||"[object global]"==e}["set","bind","unbind","decorate","on","once","off","listenTo","stopListening","fire","delegate","stopDelegating","_addEventListener","_removeEventListener"].forEach((t=>{D[t]=M.prototype[t]}));const U=$(k());function $(t){if(!t)return U;return class extends t{listenTo(t,e,i,o={}){if(H(t)||K(t)){const n={capture:!!o.useCapture,passive:!!o.usePassive},s=this._getProxyEmitter(t,n)||new G(t,n);this.listenTo(s,e,i,o)}else super.listenTo(t,e,i,o)}stopListening(t,e,i){if(H(t)||K(t)){const o=this._getAllProxyEmitters(t);for(const t of o)this.stopListening(t,e,i)}else super.stopListening(t,e,i)}_getProxyEmitter(t,e){return function(t,e){const i=t[v];return i&&i[e]?i[e].emitter:null}(this,Y(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=>{$[t]=U.prototype[t]}));class G extends(k()){constructor(t,e){super(),E(this,Y(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),k().prototype._addEventListener.call(this,t,e,i)}_removeEventListener(t,e){k().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 Y(t,e){let i=function(t){return t["data-ck-expando"]||(t["data-ck-expando"]=u())}(t);for(const t of Object.keys(e).sort())e[t]&&(i+="-"+t);return i}let q;try{q={window,document}}catch(t){q={window:{},document:{}}}const X=q;function J(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 Q=["top","right","bottom","left","width","height"];class Z{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}),it(t)||e)if(e){const e=Z.getDomRangeRects(t);tt(this,Z.getBoundingRect(e))}else tt(this,t.getBoundingClientRect());else if(K(t)){const{innerWidth:e,innerHeight:i}=t;tt(this,{top:0,right:e,bottom:i,left:0,width:e,height:i})}else tt(this,t)}clone(){return new Z(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 Z(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(et(t))return e;let i,o=t,n=t.parentNode||t.commonAncestorContainer;for(;n&&!et(n);){const t="visible"===((s=n)instanceof HTMLElement?s.ownerDocument.defaultView.getComputedStyle(s).overflow:"visible");o instanceof HTMLElement&&"absolute"===ot(o)&&(i=o);const r=ot(n);if(t||i&&("relative"===r&&t||"relative"!==r)){o=n,n=n.parentNode;continue}const c=new Z(n),l=e.getIntersection(c);if(!l)return null;l.getArea()<e.getArea()&&(e=l),o=n,n=n.parentNode}var s;return e}isEqual(t){for(const e of Q)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}=X.window,i=this.clone().moveBy(t,e);if(it(i._source)){const t=(o=i._source)&&o.parentNode?o.offsetParent===X.document.body?null:o.offsetParent:null;t&&function(t,e){const i=new Z(e),o=J(e);let n=0,s=0;n-=i.left,s-=i.top,n+=e.scrollLeft,s+=e.scrollTop,n-=o.left,s-=o.top,t.moveBy(n,s)}(i,t)}var o;return i}excludeScrollbarsAndBorders(){const t=this._source;let e,i,o;if(K(t))e=t.innerWidth-t.document.documentElement.clientWidth,i=t.innerHeight-t.document.documentElement.clientHeight,o=t.getComputedStyle(t.document.documentElement).direction;else{const n=J(t);e=t.offsetWidth-t.clientWidth-n.left-n.right,i=t.offsetHeight-t.clientHeight-n.top-n.bottom,o=t.ownerDocument.defaultView.getComputedStyle(t).direction,this.left+=n.left,this.top+=n.top,this.right-=n.right,this.bottom-=n.bottom,this.width=this.right-this.left,this.height=this.bottom-this.top}return this.width-=e,"ltr"===o?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 Z(t));else{let i=t.startContainer;o=i,"[object Text]"==Object.prototype.toString.call(o)&&(i=i.parentNode);const n=new Z(i.getBoundingClientRect());n.right=n.left,n.width=0,e.push(n)}var o;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 o of t)i++,e.left=Math.min(e.left,o.left),e.top=Math.min(e.top,o.top),e.right=Math.max(e.right,o.right),e.bottom=Math.max(e.bottom,o.bottom);return 0==i?null:(e.width=e.right-e.left,e.height=e.bottom-e.top,new Z(e))}}function tt(t,e){for(const i of Q)t[i]=e[i]}function et(t){return!!it(t)&&t===t.ownerDocument.body}function it(t){return null!==t&&"object"==typeof t&&1===t.nodeType&&"function"==typeof t.getBoundingClientRect}function ot(t){return t instanceof HTMLElement?t.ownerDocument.defaultView.getComputedStyle(t).position:"static"}class nt{constructor(t,e){nt._observerInstance||nt._createObserver(),this._element=t,this._callback=e,nt._addElementCallback(t,e),nt._observerInstance.observe(t)}get element(){return this._element}destroy(){nt._deleteElementCallback(this._element,this._callback)}static _addElementCallback(t,e){nt._elementCallbacks||(nt._elementCallbacks=new Map);let i=nt._elementCallbacks.get(t);i||(i=new Set,nt._elementCallbacks.set(t,i)),i.add(e)}static _deleteElementCallback(t,e){const i=nt._getElementCallbacks(t);i&&(i.delete(e),i.size||(nt._elementCallbacks.delete(t),nt._observerInstance.unobserve(t))),nt._elementCallbacks&&!nt._elementCallbacks.size&&(nt._observerInstance=null,nt._elementCallbacks=null)}static _getElementCallbacks(t){return nt._elementCallbacks?nt._elementCallbacks.get(t):null}static _createObserver(){nt._observerInstance=new X.window.ResizeObserver((t=>{for(const e of t){const t=nt._getElementCallbacks(e.target);if(t)for(const i of t)i(e)}}))}}nt._observerInstance=null,nt._elementCallbacks=null;const st=function(){const t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,delete:46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,shift:2228224,alt:4456448,cmd:8912896};for(let e=65;e<=90;e++){t[String.fromCharCode(e).toLowerCase()]=e}for(let e=48;e<=57;e++)t[e-48]=e;for(let e=112;e<=123;e++)t["f"+(e-111)]=e;for(const e of"`-=[];',./\\")t[e]=e.charCodeAt(0);return t}();Object.fromEntries(Object.entries(st).map((([t,e])=>[e,t.charAt(0).toUpperCase()+t.slice(1)])));X.window.CKEDITOR_TRANSLATIONS||(X.window.CKEDITOR_TRANSLATIONS={});k(),Symbol.iterator;$(D());!function(){const t=/\p{Regional_Indicator}{2}/u.source,e="(?:"+[/\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,/\p{Emoji}\u{FE0F}?\u{20E3}/u,/\p{Emoji}\u{FE0F}/u,/(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u].map((t=>t.source)).join("|")+")";new RegExp(`${t}|${e}(?:${e})*`,"ug")}();var rt=i(728),ct=i.n(rt),lt=i(528),at={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ct()(lt.c,at);lt.c.locals;const ht=(ut="px",t=>t+ut);var ut;class dt extends t.View{constructor(e,i,o){super(e);const n=this.bindTemplate;this.containerEl=i||X.window,this.panelAbsolute=!!o,this.set("position",null),this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:n.to("isSticky",(t=>t?"block":"none")),height:n.to("isSticky",(t=>t?ht(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?ht(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:n.to("_stickyTopOffset",(t=>t?ht(t):t)),bottom:n.to("_stickyBottomOffset",(t=>t?ht(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 Z(this.limiterElement);let e=t.getVisible();if(e){const i=new Z(this.containerEl);t.top-=i.top,t.bottom-=i.top,i.top+=this.viewportTopOffset,i.height-=this.viewportTopOffset,e=e.getIntersection(i)}if(e&&t.top<e.top){const i=e.top;if(i+this._contentPanelRect.height+this.limiterBottomOffset>e.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this.panelAbsolute||this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<t.height?this.panelAbsolute?t.top<0&&-t.top<t.height-this.limiterBottomOffset?this._stickToTopOfAncestors(-t.top,"absolute"):this._unstick():this._stickToTopOfAncestors(i):this._unstick()}else this._unstick()}_stickToTopOfAncestors(t,e=null){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=ht(-X.window.scrollX),this.position=e}_stickToBottomOfLimiter(t){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=ht(-X.window.scrollX),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 Z(this.contentPanelElement)}}var ft=i(404),pt={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};ct()(ft.c,pt);ft.c.locals;class bt extends t.BoxedEditorUIView{constructor(e,i,o={}){super(e),this.stickyPanel=new dt(e,o.containerEl,o.panelAbsolute),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,i)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var mt=i(968),gt=i(344);const vt=function(t){return null!=t&&"object"==typeof t};const yt="object"==typeof global&&global&&global.Object===Object&&global;var wt="object"==typeof self&&self&&self.Object===Object&&self;const _t=(yt||wt||Function("return this")()).Symbol;var kt=Object.prototype,Et=kt.hasOwnProperty,Tt=kt.toString,Ot=_t?_t.toStringTag:void 0;const St=function(t){var e=Et.call(t,Ot),i=t[Ot];try{t[Ot]=void 0;var o=!0}catch(t){}var n=Tt.call(t);return o&&(e?t[Ot]=i:delete t[Ot]),n};var xt=Object.prototype.toString;const Lt=function(t){return xt.call(t)};var Ct=_t?_t.toStringTag:void 0;const jt=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ct&&Ct in Object(t)?St(t):Lt(t)};const Pt=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var It=Function.prototype,Rt=Object.prototype,At=It.toString,Nt=Rt.hasOwnProperty,Mt=At.call(Object);const Dt=function(t){if(!vt(t)||"[object Object]"!=jt(t))return!1;var e=Pt(t);if(null===e)return!0;var i=Nt.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&At.call(i)==Mt};const Bt=function(t){return vt(t)&&1===t.nodeType&&!Dt(t)};class Ft extends((0,mt.ElementApiMixin)(mt.Editor)){constructor(t,e={}){if(!Wt(t)&&void 0!==e.initialData)throw new n.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return Wt(t)?(0,n.getDataFromElement)(t):t}(t)),Wt(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new bt(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,o),(0,mt.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(Wt(t)?t:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}Ft.Context=mt.Context,Ft.EditorWatchdog=gt.EditorWatchdog,Ft.ContextWatchdog=gt.ContextWatchdog;const Vt=Ft;function Wt(t){return Bt(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=o})();
|
|
4
|
+
*/(()=>{var t={404:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}",""]);const s=n},128:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{position:fixed;top:0;z-index:var(--ck-z-panel)}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{position:absolute;top:auto}",""]);const s=n},849:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var i=t(e);return e[2]?"@media ".concat(e[2]," {").concat(i,"}"):i})).join("")},e.i=function(t,i,o){"string"==typeof t&&(t=[[null,t,""]]);var n={};if(o)for(var s=0;s<this.length;s++){var r=this[s][0];null!=r&&(n[r]=!0)}for(var c=0;c<t.length;c++){var l=[].concat(t[c]);o&&n[l[0]]||(i&&(l[2]?l[2]="".concat(i," and ").concat(l[2]):l[2]=i),e.push(l))}},e}},108:(t,e,i)=>{"use strict";var o,n=function(){return void 0===o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},s=function(){var t={};return function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(t){i=null}t[e]=i}return t[e]}}(),r=[];function c(t){for(var e=-1,i=0;i<r.length;i++)if(r[i].identifier===t){e=i;break}return e}function l(t,e){for(var i={},o=[],n=0;n<t.length;n++){var s=t[n],l=e.base?s[0]+e.base:s[0],a=i[l]||0,h="".concat(l," ").concat(a);i[l]=a+1;var u=c(h),d={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(r[u].references++,r[u].updater(d)):r.push({identifier:h,updater:g(d,e),references:1}),o.push(h)}return o}function a(t){var e=document.createElement("style"),o=t.attributes||{};if(void 0===o.nonce){var n=i.nc;n&&(o.nonce=n)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var r=s(t.insert||"head");if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(e)}return e}var h,u=(h=[],function(t,e){return h[t]=e,h.filter(Boolean).join("\n")});function d(t,e,i,o){var n=i?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=u(e,n);else{var s=document.createTextNode(n),r=t.childNodes;r[e]&&t.removeChild(r[e]),r.length?t.insertBefore(s,r[e]):t.appendChild(s)}}function f(t,e,i){var o=i.css,n=i.media,s=i.sourceMap;if(n?t.setAttribute("media",n):t.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var i,o,n;if(e.singleton){var s=m++;i=p||(p=a(e)),o=d.bind(null,i,s,!1),n=d.bind(null,i,s,!0)}else i=a(e),o=f.bind(null,i,e),n=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(i)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else n()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=n());var i=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<i.length;o++){var n=c(i[o]);r[n].references--}for(var s=l(t,e),a=0;a<i.length;a++){var h=c(i[a]);0===r[h].references&&(r[h].updater(),r.splice(h,1))}i=s}}}},968:(t,e,i)=>{t.exports=i(672)("./src/core.js")},684:(t,e,i)=>{t.exports=i(672)("./src/engine.js")},348:(t,e,i)=>{t.exports=i(672)("./src/ui.js")},316:(t,e,i)=>{t.exports=i(672)("./src/utils.js")},344:(t,e,i)=>{t.exports=i(672)("./src/watchdog.js")},672:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function i(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={id:o,exports:{}};return t[o](s,s.exports,i),s.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var o in e)i.o(e,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nc=void 0;var o={};(()=>{"use strict";i.r(o),i.d(o,{ClassicFloatingEditor:()=>N});var t=i(348),e=i(684),n=i(316);class s extends t.EditorUI{constructor(e,i){super(e),this.view=i,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new n.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,i=this.view,o=e.editing.view,n=i.editable,s=o.document.getRoot();n.name=s.rootName,i.render();const r=n.element;this.setEditableElement(n.name,r),i.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(r),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,i=t.editing.view,o=i.document.getRoot(),n=t.sourceElement;let s;const r=t.config.get("placeholder");r&&(s="string"==typeof r?r:r[this.view.editable.name]),!s&&n&&"textarea"===n.tagName.toLowerCase()&&(s=n.getAttribute("placeholder")),s&&(o.placeholder=s),(0,e.enablePlaceholder)({view:i,element:o,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,i){const o=this.view.stickyPanel;if(o.isSticky){const t=new n.Rect(o.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(i)};this.listenTo(o,"change:isSticky",t),setTimeout((()=>{this.stopListening(o,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,i=this.editor.plugins.get("Dialog");i.on("show",(()=>{const o=i.view;o.on("moveTo",((i,s)=>{if(!e.isSticky||o.wasMoved)return;const r=new n.Rect(e.contentPanelElement);s[1]<r.bottom+t.DialogView.defaultOffset&&(s[1]=r.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var r=i(108),c=i.n(r),l=i(128),a={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};c()(l.c,a);l.c.locals;const h=(0,n.toUnit)("px");class u extends t.View{constructor(e,i,o){super(e);const s=this.bindTemplate;this.containerEl=i||n.global.window,this.panelAbsolute=!!o,this.set("position",null),this.set("isActive",!1),this.set("isSticky",!1),this.set("limiterElement",null),this.set("limiterBottomOffset",50),this.set("viewportTopOffset",0),this.set("_marginLeft",null),this.set("_isStickyToTheBottomOfLimiter",!1),this.set("_stickyTopOffset",null),this.set("_stickyBottomOffset",null),this.content=this.createCollection(),this._contentPanelPlaceholder=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__placeholder"],style:{display:s.to("isSticky",(t=>t?"block":"none")),height:s.to("isSticky",(t=>t?h(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new t.Template({tag:"div",attributes:{class:["ck","ck-sticky-panel__content",s.if("isSticky","ck-sticky-panel__content_sticky"),s.if("_isStickyToTheBottomOfLimiter","ck-sticky-panel__content_sticky_bottom-limit")],style:{position:s.to("position",(t=>t)),width:s.to("isSticky",(t=>t?h(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:s.to("_stickyTopOffset",(t=>t?h(t):t)),bottom:s.to("_stickyBottomOffset",(t=>t?h(t):t)),marginLeft:s.to("_marginLeft")}},children:this.content}).render(),this.setTemplate({tag:"div",attributes:{class:["ck","ck-sticky-panel"]},children:[this._contentPanelPlaceholder,this.contentPanelElement]})}render(){super.render(),this.checkIfShouldBeSticky(),this.listenTo(this.containerEl,"scroll",(()=>{this.checkIfShouldBeSticky()}),{useCapture:!0}),this.listenTo(this,"change:isActive",(()=>{this.checkIfShouldBeSticky()}))}checkIfShouldBeSticky(){if(!this.limiterElement||!this.isActive)return void this._unstick();const t=new n.Rect(this.limiterElement);let e=t.getVisible();if(e){const i=new n.Rect(this.containerEl);t.top-=i.top,t.bottom-=i.top,i.top+=this.viewportTopOffset,i.height-=this.viewportTopOffset,e=e.getIntersection(i)}if(e&&t.top<e.top){const i=e.top;if(i+this._contentPanelRect.height+this.limiterBottomOffset>e.bottom){const i=Math.max(t.bottom-e.bottom,0)+this.limiterBottomOffset;t.bottom-i>t.top+this._contentPanelRect.height?this.panelAbsolute||this._stickToBottomOfLimiter(i):this._unstick()}else this._contentPanelRect.height+this.limiterBottomOffset<t.height?this.panelAbsolute?t.top<0&&-t.top<t.height-this.limiterBottomOffset?this._stickToTopOfAncestors(-t.top,"absolute"):this._unstick():this._stickToTopOfAncestors(i):this._unstick()}else this._unstick()}_stickToTopOfAncestors(t,e=null){var i;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=h(-(null!==(i=this.containerEl.scrollX)&&void 0!==i?i:this.containerEl.scrollLeft)),this.position=e}_stickToBottomOfLimiter(t){var e;this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=h(-(null!==(e=this.containerEl.scrollX)&&void 0!==e?e:this.containerEl.scrollLeft)),this.position=null}_unstick(){this.isSticky=!1,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=null,this._stickyBottomOffset=null,this._marginLeft=null,this.position=null}get _contentPanelRect(){return new n.Rect(this.contentPanelElement)}}var d=i(404),f={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};c()(d.c,f);d.c.locals;class p extends t.BoxedEditorUIView{constructor(e,i,o={}){super(e),this.stickyPanel=new u(e,o.containerEl,o.panelAbsolute),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,i)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var m=i(968),g=i(344);const y=function(t){return null!=t&&"object"==typeof t};const v="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const k=(v||b||Function("return this")()).Symbol;var _=Object.prototype,w=_.hasOwnProperty,T=_.toString,O=k?k.toStringTag:void 0;const S=function(t){var e=w.call(t,O),i=t[O];try{t[O]=void 0;var o=!0}catch(t){}var n=T.call(t);return o&&(e?t[O]=i:delete t[O]),n};var E=Object.prototype.toString;const P=function(t){return E.call(t)};var j=k?k.toStringTag:void 0;const x=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?S(t):P(t)};const C=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var B=Function.prototype,R=Object.prototype,L=B.toString,A=R.hasOwnProperty,F=L.call(Object);const D=function(t){if(!y(t)||"[object Object]"!=x(t))return!1;var e=C(t);if(null===e)return!0;var i=A.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&L.call(i)==F};const I=function(t){return y(t)&&1===t.nodeType&&!D(t)};class M extends((0,m.ElementApiMixin)(m.Editor)){constructor(t,e={}){if(!W(t)&&void 0!==e.initialData)throw new n.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return W(t)?(0,n.getDataFromElement)(t):t}(t)),W(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new p(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new s(this,o),(0,m.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((i=>{const o=new this(t,e);i(o.initPlugins().then((()=>o.ui.init(W(t)?t:null))).then((()=>o.data.init(o.config.get("initialData")))).then((()=>o.fire("ready"))).then((()=>o)))}))}}M.Context=m.Context,M.EditorWatchdog=g.EditorWatchdog,M.ContextWatchdog=g.ContextWatchdog;const N=M;function W(t){return I(t)}})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=o})();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md.
|
|
4
|
+
*/(()=>{var t={20:(t,e,o)=>{"use strict";o.d(e,{c:()=>n});var i=o(849),r=o.n(i)()((function(t){return t[1]}));r.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}",""]);const n=r},849:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o=t(e);return e[2]?"@media ".concat(e[2]," {").concat(o,"}"):o})).join("")},e.i=function(t,o,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var n=0;n<this.length;n++){var c=this[n][0];null!=c&&(r[c]=!0)}for(var a=0;a<t.length;a++){var s=[].concat(t[a]);i&&r[s[0]]||(o&&(s[2]?s[2]="".concat(o," and ").concat(s[2]):s[2]=o),e.push(s))}},e}},108:(t,e,o)=>{"use strict";var i,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},n=function(){var t={};return function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}t[e]=o}return t[e]}}(),c=[];function a(t){for(var e=-1,o=0;o<c.length;o++)if(c[o].identifier===t){e=o;break}return e}function s(t,e){for(var o={},i=[],r=0;r<t.length;r++){var n=t[r],s=e.base?n[0]+e.base:n[0],l=o[s]||0,d="".concat(s," ").concat(l);o[s]=l+1;var u=a(d),h={css:n[1],media:n[2],sourceMap:n[3]};-1!==u?(c[u].references++,c[u].updater(h)):c.push({identifier:d,updater:k(h,e),references:1}),i.push(d)}return i}function l(t){var e=document.createElement("style"),i=t.attributes||{};if(void 0===i.nonce){var r=o.nc;r&&(i.nonce=r)}if(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),"function"==typeof t.insert)t.insert(e);else{var c=n(t.insert||"head");if(!c)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");c.appendChild(e)}return e}var d,u=(d=[],function(t,e){return d[t]=e,d.filter(Boolean).join("\n")});function h(t,e,o,i){var r=o?"":i.media?"@media ".concat(i.media," {").concat(i.css,"}"):i.css;if(t.styleSheet)t.styleSheet.cssText=u(e,r);else{var n=document.createTextNode(r),c=t.childNodes;c[e]&&t.removeChild(c[e]),c.length?t.insertBefore(n,c[e]):t.appendChild(n)}}function f(t,e,o){var i=o.css,r=o.media,n=o.sourceMap;if(r?t.setAttribute("media",r):t.removeAttribute("media"),n&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(n))))," */")),t.styleSheet)t.styleSheet.cssText=i;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(i))}}var p=null,b=0;function k(t,e){var o,i,r;if(e.singleton){var n=b++;o=p||(p=l(e)),i=h.bind(null,o,n,!1),r=h.bind(null,o,n,!0)}else o=l(e),i=f.bind(null,o,e),r=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(o)};return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e)}else r()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=r());var o=s(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var i=0;i<o.length;i++){var r=a(o[i]);c[r].references--}for(var n=s(t,e),l=0;l<o.length;l++){var d=a(o[l]);0===c[d].references&&(c[d].updater(),c.splice(d,1))}o=n}}}},968:(t,e,o)=>{t.exports=o(672)("./src/core.js")},684:(t,e,o)=>{t.exports=o(672)("./src/engine.js")},348:(t,e,o)=>{t.exports=o(672)("./src/ui.js")},316:(t,e,o)=>{t.exports=o(672)("./src/utils.js")},344:(t,e,o)=>{t.exports=o(672)("./src/watchdog.js")},672:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={id:i,exports:{}};return t[i](n,n.exports,o),n.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{ClassicEditor:()=>M});var t=o(348),e=o(684),r=o(316);class n extends t.EditorUI{constructor(e,o){super(e),this.view=o,this._toolbarConfig=(0,t.normalizeToolbarConfig)(e.config.get("toolbar")),this._elementReplacer=new r.ElementReplacer,this.listenTo(e.editing.view,"scrollToTheSelection",this._handleScrollToTheSelectionWithStickyPanel.bind(this))}get element(){return this.view.element}init(t){const e=this.editor,o=this.view,i=e.editing.view,r=o.editable,n=i.document.getRoot();r.name=n.rootName,o.render();const c=r.element;this.setEditableElement(r.name,c),o.editable.bind("isFocused").to(this.focusTracker),i.attachDomRoot(c),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this._initDialogPluginIntegration(),this.fire("ready")}destroy(){super.destroy();const t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.view;t.stickyPanel.bind("isActive").to(this.focusTracker,"isFocused"),t.stickyPanel.limiterElement=t.element,t.stickyPanel.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),t.toolbar.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(t.toolbar)}_initPlaceholder(){const t=this.editor,o=t.editing.view,i=o.document.getRoot(),r=t.sourceElement;let n;const c=t.config.get("placeholder");c&&(n="string"==typeof c?c:c[this.view.editable.name]),!n&&r&&"textarea"===r.tagName.toLowerCase()&&(n=r.getAttribute("placeholder")),n&&(i.placeholder=n),(0,e.enablePlaceholder)({view:o,element:i,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,o){const i=this.view.stickyPanel;if(i.isSticky){const t=new r.Rect(i.element).height;e.viewportOffset.top+=t}else{const t=()=>{this.editor.editing.view.scrollToTheSelection(o)};this.listenTo(i,"change:isSticky",t),setTimeout((()=>{this.stopListening(i,"change:isSticky",t)}),20)}}_initDialogPluginIntegration(){if(!this.editor.plugins.has("Dialog"))return;const e=this.view.stickyPanel,o=this.editor.plugins.get("Dialog");o.on("show",(()=>{const i=o.view;i.on("moveTo",((o,n)=>{if(!e.isSticky||i.wasMoved)return;const c=new r.Rect(e.contentPanelElement);n[1]<c.bottom+t.DialogView.defaultOffset&&(n[1]=c.bottom+t.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var c=o(108),a=o.n(c),s=o(20),l={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};a()(s.c,l);s.c.locals;class d extends t.BoxedEditorUIView{constructor(e,o,i={}){super(e),this.stickyPanel=new t.StickyPanelView(e),this.toolbar=new t.ToolbarView(e,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new t.InlineEditableUIView(e,o)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var u=o(968),h=o(344);const f=function(t){return null!=t&&"object"==typeof t};const p="object"==typeof global&&global&&global.Object===Object&&global;var b="object"==typeof self&&self&&self.Object===Object&&self;const k=(p||b||Function("return this")()).Symbol;var v=Object.prototype,g=v.hasOwnProperty,m=v.toString,y=k?k.toStringTag:void 0;const w=function(t){var e=g.call(t,y),o=t[y];try{t[y]=void 0;var i=!0}catch(t){}var r=m.call(t);return i&&(e?t[y]=o:delete t[y]),r};var _=Object.prototype.toString;const T=function(t){return _.call(t)};var j=k?k.toStringTag:void 0;const S=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?w(t):T(t)};const O=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var x=Function.prototype,E=Object.prototype,P=x.toString,C=E.hasOwnProperty,D=P.call(Object);const F=function(t){if(!f(t)||"[object Object]"!=S(t))return!1;var e=O(t);if(null===e)return!0;var o=C.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&P.call(o)==D};const R=function(t){return f(t)&&1===t.nodeType&&!F(t)};class M extends((0,u.ElementApiMixin)(u.Editor)){constructor(t,e={}){if(!N(t)&&void 0!==e.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return N(t)?(0,r.getDataFromElement)(t):t}(t)),N(t)&&(this.sourceElement=t),this.model.document.createRoot();const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),i=new d(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:o});this.ui=new n(this,i),(0,u.attachToForm)(this)}destroy(){return this.sourceElement&&this.updateSourceElement(),this.ui.destroy(),super.destroy()}static create(t,e={}){return new Promise((o=>{const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init(N(t)?t:null))).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function N(t){return R(t)}M.Context=u.Context,M.EditorWatchdog=h.EditorWatchdog,M.ContextWatchdog=h.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorClassic=i})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ckeditor5-editor-classic-floating",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.2.0",
|
|
4
4
|
"description": "Classic editor implementation for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.ts",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "41.
|
|
16
|
-
"lodash-es": "4.17.21"
|
|
17
|
-
"@ckeditor/ckeditor5-ui": "41.0.0",
|
|
18
|
-
"@ckeditor/ckeditor5-utils": "41.0.0"
|
|
15
|
+
"ckeditor5": "41.2.0",
|
|
16
|
+
"lodash-es": "4.17.21"
|
|
19
17
|
},
|
|
20
18
|
"devDependencies": {
|
|
21
|
-
"@ckeditor/ckeditor5-basic-styles": "41.
|
|
22
|
-
"@ckeditor/ckeditor5-core": "41.
|
|
19
|
+
"@ckeditor/ckeditor5-basic-styles": "41.2.0",
|
|
20
|
+
"@ckeditor/ckeditor5-core": "41.2.0",
|
|
23
21
|
"@ckeditor/ckeditor5-dev-utils": "^39.0.0",
|
|
24
|
-
"@ckeditor/ckeditor5-engine": "41.
|
|
25
|
-
"@ckeditor/ckeditor5-enter": "41.
|
|
26
|
-
"@ckeditor/ckeditor5-heading": "41.
|
|
27
|
-
"@ckeditor/ckeditor5-image": "41.
|
|
28
|
-
"@ckeditor/ckeditor5-paragraph": "41.
|
|
29
|
-
"@ckeditor/ckeditor5-theme-lark": "41.
|
|
30
|
-
"@ckeditor/ckeditor5-typing": "41.
|
|
31
|
-
"@ckeditor/ckeditor5-
|
|
32
|
-
"@ckeditor/ckeditor5-
|
|
22
|
+
"@ckeditor/ckeditor5-engine": "41.2.0",
|
|
23
|
+
"@ckeditor/ckeditor5-enter": "41.2.0",
|
|
24
|
+
"@ckeditor/ckeditor5-heading": "41.2.0",
|
|
25
|
+
"@ckeditor/ckeditor5-image": "41.2.0",
|
|
26
|
+
"@ckeditor/ckeditor5-paragraph": "41.2.0",
|
|
27
|
+
"@ckeditor/ckeditor5-theme-lark": "41.2.0",
|
|
28
|
+
"@ckeditor/ckeditor5-typing": "41.2.0",
|
|
29
|
+
"@ckeditor/ckeditor5-ui": "41.2.0",
|
|
30
|
+
"@ckeditor/ckeditor5-undo": "41.2.0",
|
|
31
|
+
"@ckeditor/ckeditor5-utils": "41.2.0",
|
|
32
|
+
"@ckeditor/ckeditor5-watchdog": "41.2.0",
|
|
33
33
|
"typescript": "5.0.4",
|
|
34
34
|
"webpack": "^5.58.1",
|
|
35
35
|
"webpack-cli": "^4.9.0"
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module editor-classic/
|
|
6
|
+
* @module editor-classic/classiceditor
|
|
7
7
|
*/
|
|
8
8
|
import ClassicFloatingEditorUI from '../ui/ClassicFloatingEditorUI.js';
|
|
9
9
|
import { Editor, Context } from 'ckeditor5/src/core.js';
|
|
10
10
|
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
|
|
11
|
-
import { EditorConfig } from
|
|
11
|
+
import { type EditorConfig } from './EditorConfig';
|
|
12
12
|
declare const ClassicFloatingEditor_base: import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>;
|
|
13
13
|
/**
|
|
14
14
|
* The {@glink installation/getting-started/predefined-builds#classic-editor classic editor} implementation.
|
|
@@ -16,7 +16,7 @@ declare const ClassicFloatingEditor_base: import("ckeditor5/src/utils.js").Mixed
|
|
|
16
16
|
* See the {@glink examples/builds/classic-editor demo}.
|
|
17
17
|
*
|
|
18
18
|
* In order to create a classic editor instance, use the static
|
|
19
|
-
* {@link module:editor-classic/
|
|
19
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
|
|
20
20
|
*
|
|
21
21
|
* # Classic editor and classic build
|
|
22
22
|
*
|
|
@@ -31,7 +31,7 @@ declare const ClassicFloatingEditor_base: import("ckeditor5/src/utils.js").Mixed
|
|
|
31
31
|
* Using the editor from source gives much better flexibility and allows easier customization.
|
|
32
32
|
*
|
|
33
33
|
* Read more about initializing the editor from source or as a build in
|
|
34
|
-
* {@link module:editor-classic/
|
|
34
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
|
|
35
35
|
*/
|
|
36
36
|
export default class ClassicFloatingEditor extends ClassicFloatingEditor_base {
|
|
37
37
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module editor-classic/
|
|
6
|
+
* @module editor-classic/classiceditor
|
|
7
7
|
*/
|
|
8
8
|
import ClassicFloatingEditorUI from '../ui/ClassicFloatingEditorUI.js';
|
|
9
9
|
import ClassicFloatingEditorUIView from '../ui/ClassicFloatingEditorUIView.js';
|
|
@@ -17,7 +17,7 @@ import { isElement as _isElement } from 'lodash-es';
|
|
|
17
17
|
* See the {@glink examples/builds/classic-editor demo}.
|
|
18
18
|
*
|
|
19
19
|
* In order to create a classic editor instance, use the static
|
|
20
|
-
* {@link module:editor-classic/
|
|
20
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`} method.
|
|
21
21
|
*
|
|
22
22
|
* # Classic editor and classic build
|
|
23
23
|
*
|
|
@@ -32,7 +32,7 @@ import { isElement as _isElement } from 'lodash-es';
|
|
|
32
32
|
* Using the editor from source gives much better flexibility and allows easier customization.
|
|
33
33
|
*
|
|
34
34
|
* Read more about initializing the editor from source or as a build in
|
|
35
|
-
* {@link module:editor-classic/
|
|
35
|
+
* {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}.
|
|
36
36
|
*/
|
|
37
37
|
class ClassicFloatingEditor extends ElementApiMixin(Editor) {
|
|
38
38
|
/**
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module editor-classic/editor/EditorConfig
|
|
7
|
+
*/
|
|
8
|
+
import { type EditorConfig as EditorConfigBase } from 'ckeditor5/src/core.js';
|
|
9
|
+
export type EditorConfig = EditorConfigBase & {
|
|
3
10
|
containerEl?: HTMLElement;
|
|
4
11
|
panelAbsolute?: boolean;
|
|
5
|
-
}
|
|
12
|
+
};
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/index.ts
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module editor-classic/
|
|
6
|
+
* @module editor-classic/classiceditorui
|
|
7
7
|
*/
|
|
8
8
|
import type { Editor } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { EditorUI } from 'ckeditor5/src/ui.js';
|
|
10
|
-
import type ClassicFloatingEditorUIView from './ClassicFloatingEditorUIView
|
|
10
|
+
import type ClassicFloatingEditorUIView from './ClassicFloatingEditorUIView';
|
|
11
11
|
/**
|
|
12
12
|
* The classic editor UI class.
|
|
13
13
|
*/
|
|
@@ -56,7 +56,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
56
56
|
/**
|
|
57
57
|
* Provides an integration between the sticky toolbar and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.
|
|
58
58
|
* It allows the UI-agnostic engine method to consider the geometry of the
|
|
59
|
-
* {@link module:editor-classic/
|
|
59
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel} that pins to the
|
|
60
60
|
* edge of the viewport and can obscure the user caret after scrolling the window.
|
|
61
61
|
*
|
|
62
62
|
* @param evt The `scrollToTheSelection` event info.
|
|
@@ -68,7 +68,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
68
68
|
* Provides an integration between the sticky toolbar and {@link module:ui/dialog/dialog the Dialog plugin}.
|
|
69
69
|
*
|
|
70
70
|
* It moves the dialog down to ensure that the
|
|
71
|
-
* {@link module:editor-classic/
|
|
71
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel sticky panel}
|
|
72
72
|
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
|
73
73
|
*/
|
|
74
74
|
private _initDialogPluginIntegration;
|
|
@@ -124,7 +124,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
124
124
|
/**
|
|
125
125
|
* Provides an integration between the sticky toolbar and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.
|
|
126
126
|
* It allows the UI-agnostic engine method to consider the geometry of the
|
|
127
|
-
* {@link module:editor-classic/
|
|
127
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel} that pins to the
|
|
128
128
|
* edge of the viewport and can obscure the user caret after scrolling the window.
|
|
129
129
|
*
|
|
130
130
|
* @param evt The `scrollToTheSelection` event info.
|
|
@@ -153,7 +153,7 @@ export default class ClassicFloatingEditorUI extends EditorUI {
|
|
|
153
153
|
* Provides an integration between the sticky toolbar and {@link module:ui/dialog/dialog the Dialog plugin}.
|
|
154
154
|
*
|
|
155
155
|
* It moves the dialog down to ensure that the
|
|
156
|
-
* {@link module:editor-classic/
|
|
156
|
+
* {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#stickyPanel sticky panel}
|
|
157
157
|
* used by the editor UI will not get obscured by the dialog when the dialog uses one of its automatic positions.
|
|
158
158
|
*/
|
|
159
159
|
_initDialogPluginIntegration() {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module editor-classic/
|
|
6
|
+
* @module editor-classic/classiceditoruiview
|
|
7
7
|
*/
|
|
8
|
+
import StickyPanelView from './panel/StickyPanelView.js';
|
|
8
9
|
import { BoxedEditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
9
10
|
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
10
11
|
import type { EditingView } from 'ckeditor5/src/engine.js';
|
|
11
|
-
import StickyPanelView from './panel/StickyPanelView.js';
|
|
12
12
|
import '../../theme/classicfloatingeditor.css';
|
|
13
13
|
/**
|
|
14
14
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module editor-classic/
|
|
6
|
+
* @module editor-classic/classiceditoruiview
|
|
7
7
|
*/
|
|
8
|
-
import { BoxedEditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
9
8
|
import StickyPanelView from './panel/StickyPanelView.js';
|
|
9
|
+
import { BoxedEditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
|
|
10
10
|
import '../../theme/classicfloatingeditor.css';
|
|
11
11
|
/**
|
|
12
12
|
* Classic editor UI view. Uses an inline editable and a sticky toolbar, all
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module ui/panel/sticky/stickypanelview
|
|
7
7
|
*/
|
|
8
|
-
import { View, ViewCollection } from '
|
|
9
|
-
import { type Locale } from '
|
|
10
|
-
import '
|
|
8
|
+
import { View, ViewCollection } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import '../../../theme/stickypanel.css';
|
|
11
11
|
/**
|
|
12
12
|
* The sticky panel view class.
|
|
13
13
|
*/
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
* @module ui/panel/sticky/stickypanelview
|
|
7
7
|
*/
|
|
8
8
|
import { View, Template } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { global, toUnit, Rect } from '
|
|
9
|
+
import { global, toUnit, Rect } from 'ckeditor5/src/utils.js';
|
|
10
10
|
// @if CK_DEBUG_STICKYPANEL // const {
|
|
11
11
|
// @if CK_DEBUG_STICKYPANEL // default: RectDrawer,
|
|
12
12
|
// @if CK_DEBUG_STICKYPANEL // diagonalStylesBlack
|
|
13
13
|
// @if CK_DEBUG_STICKYPANEL // } = require( '@ckeditor/ckeditor5-utils/tests/_utils/rectdrawer' );
|
|
14
|
-
import '
|
|
14
|
+
import '../../../theme/stickypanel.css';
|
|
15
15
|
const toPx = toUnit('px');
|
|
16
16
|
/**
|
|
17
17
|
* The sticky panel view class.
|
|
@@ -213,11 +213,13 @@ export default class StickyPanelView extends View {
|
|
|
213
213
|
* @param position
|
|
214
214
|
*/
|
|
215
215
|
_stickToTopOfAncestors(topOffset, position = null) {
|
|
216
|
+
var _a;
|
|
216
217
|
this.isSticky = true;
|
|
217
218
|
this._isStickyToTheBottomOfLimiter = false;
|
|
218
219
|
this._stickyTopOffset = topOffset;
|
|
219
220
|
this._stickyBottomOffset = null;
|
|
220
|
-
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
this._marginLeft = toPx(-((_a = this.containerEl.scrollX) !== null && _a !== void 0 ? _a : this.containerEl.scrollLeft));
|
|
221
223
|
this.position = position;
|
|
222
224
|
}
|
|
223
225
|
/**
|
|
@@ -227,11 +229,13 @@ export default class StickyPanelView extends View {
|
|
|
227
229
|
* @param stickyBottomOffset
|
|
228
230
|
*/
|
|
229
231
|
_stickToBottomOfLimiter(stickyBottomOffset) {
|
|
232
|
+
var _a;
|
|
230
233
|
this.isSticky = true;
|
|
231
234
|
this._isStickyToTheBottomOfLimiter = true;
|
|
232
235
|
this._stickyTopOffset = null;
|
|
233
236
|
this._stickyBottomOffset = stickyBottomOffset;
|
|
234
|
-
|
|
237
|
+
// @ts-ignore
|
|
238
|
+
this._marginLeft = toPx(-((_a = this.containerEl.scrollX) !== null && _a !== void 0 ? _a : this.containerEl.scrollLeft));
|
|
235
239
|
this.position = null;
|
|
236
240
|
}
|
|
237
241
|
/**
|