ckeditor5-editor-classic-floating 41.0.0 → 41.1.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
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
CKEditor 5 classic floating editor implementation
|
|
2
|
-
========================================
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
5
|
-
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
-
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
-
|
|
8
|
-
The classic editor implementation for CKEditor 5.
|
|
9
|
-
|
|
10
|
-
This package contains the [`ClassicFloatingEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html) class. Follow there to learn more about this type of editor and how to initialize it.
|
|
11
|
-
|
|
12
|
-
This package contains the source version of the classic editor. This kind of editor implementation is also available as a ready-to-use [classic build](https://www.npmjs.com/package/ckeditor5-editor-classic-floating). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
13
|
-
|
|
14
|
-
## Documentation
|
|
15
|
-
|
|
16
|
-
See the [`ckeditor5-editor-classic-floating` package](https://ckeditor.com/docs/ckeditor5/latest/api/editor-classic.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
|
-
|
|
18
|
-
## License
|
|
19
|
-
|
|
20
|
-
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
1
|
+
CKEditor 5 classic floating editor implementation
|
|
2
|
+
========================================
|
|
3
|
+
|
|
4
|
+
[](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-classic)
|
|
5
|
+
[](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
|
|
6
|
+
[](https://app.travis-ci.com/github/ckeditor/ckeditor5)
|
|
7
|
+
|
|
8
|
+
The classic editor implementation for CKEditor 5.
|
|
9
|
+
|
|
10
|
+
This package contains the [`ClassicFloatingEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-classic_classiceditor-ClassicEditor.html) class. Follow there to learn more about this type of editor and how to initialize it.
|
|
11
|
+
|
|
12
|
+
This package contains the source version of the classic editor. This kind of editor implementation is also available as a ready-to-use [classic build](https://www.npmjs.com/package/ckeditor5-editor-classic-floating). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
13
|
+
|
|
14
|
+
## Documentation
|
|
15
|
+
|
|
16
|
+
See the [`ckeditor5-editor-classic-floating` package](https://ckeditor.com/docs/ckeditor5/latest/api/editor-classic.html) page in [CKEditor 5 documentation](https://ckeditor.com/docs/ckeditor5/latest/).
|
|
17
|
+
|
|
18
|
+
## License
|
|
19
|
+
|
|
20
|
+
Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md.
|
|
4
|
-
*/(()=>{var t={404:(t,e,i)=>{"use strict";i.d(e,{c:()=>s});var o=i(849),n=i.n(o)()((function(t){return t[1]}));n.push([t.id,".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-panel)}",""]);const s=n},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}},584:(t,e,i)=>{"use strict";i.d(e,{c:()=>N});var o=i(348),n=i(684),s=i(316);class r extends o.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=(0,o.normalizeToolbarConfig)(t.config.get("toolbar")),this._elementReplacer=new s.ElementReplacer,this.listenTo(t.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,e=t.editing.view,i=e.document.getRoot(),o=t.sourceElement;let s;const r=t.config.get("placeholder");r&&(s="string"==typeof r?r:r[this.view.editable.name]),!s&&o&&"textarea"===o.tagName.toLowerCase()&&(s=o.getAttribute("placeholder")),s&&(i.placeholder=s),(0,n.enablePlaceholder)({view:e,element:i,isDirectHost:!1,keepOnFocus:!0})}_handleScrollToTheSelectionWithStickyPanel(t,e,i){const o=this.view.stickyPanel;if(o.isSticky){const t=new s.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 t=this.view.stickyPanel,e=this.editor.plugins.get("Dialog");e.on("show",(()=>{const i=e.view;i.on("moveTo",((e,n)=>{if(!t.isSticky||i.wasMoved)return;const r=new s.Rect(t.contentPanelElement);n[1]<r.bottom+o.DialogView.defaultOffset&&(n[1]=r.bottom+o.DialogView.defaultOffset)}),{priority:"high"})}),{priority:"low"})}}var c=i(108),l=i.n(c),a=i(128),h={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};l()(a.c,h);a.c.locals;const u=(0,s.toUnit)("px");class d extends o.View{constructor(t,e,i){super(t);const n=this.bindTemplate;this.containerEl=e||s.global.window,this.panelAbsolute=!!i,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 o.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?u(this._contentPanelRect.height):null))}}}).render(),this.contentPanelElement=new o.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?u(this._contentPanelPlaceholder.getBoundingClientRect().width):null)),top:n.to("_stickyTopOffset",(t=>t?u(t):t)),bottom:n.to("_stickyBottomOffset",(t=>t?u(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 s.Rect(this.limiterElement);let e=t.getVisible();if(e){const i=new s.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){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!1,this._stickyTopOffset=t,this._stickyBottomOffset=null,this._marginLeft=u(-s.global.window.scrollX),this.position=e}_stickToBottomOfLimiter(t){this.isSticky=!0,this._isStickyToTheBottomOfLimiter=!0,this._stickyTopOffset=null,this._stickyBottomOffset=t,this._marginLeft=u(-s.global.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 s.Rect(this.contentPanelElement)}}var f=i(404),p={injectType:"singletonStyleTag",attributes:{"data-cke":!0},insert:"head",singleton:!0};l()(f.c,p);f.c.locals;class m extends o.BoxedEditorUIView{constructor(t,e,i={}){super(t),this.stickyPanel=new d(t,i.containerEl,i.panelAbsolute),this.toolbar=new o.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull}),this.editable=new o.InlineEditableUIView(t,e)}render(){super.render(),this.stickyPanel.content.add(this.toolbar),this.top.add(this.stickyPanel),this.main.add(this.editable)}}var g=i(968),y=i(344);const b=function(t){return null!=t&&"object"==typeof t};const v="object"==typeof global&&global&&global.Object===Object&&global;var k="object"==typeof self&&self&&self.Object===Object&&self;const _=(v||k||Function("return this")()).Symbol;var w=Object.prototype,T=w.hasOwnProperty,O=w.toString,S=_?_.toStringTag:void 0;const E=function(t){var e=T.call(t,S),i=t[S];try{t[S]=void 0;var o=!0}catch(t){}var n=O.call(t);return o&&(e?t[S]=i:delete t[S]),n};var P=Object.prototype.toString;const j=function(t){return P.call(t)};var x=_?_.toStringTag:void 0;const C=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?E(t):j(t)};const B=function(t,e){return function(i){return t(e(i))}}(Object.getPrototypeOf,Object);var R=Function.prototype,A=Object.prototype,F=R.toString,L=A.hasOwnProperty,D=F.call(Object);const I=function(t){if(!b(t)||"[object Object]"!=C(t))return!1;var e=B(t);if(null===e)return!0;var i=L.call(e,"constructor")&&e.constructor;return"function"==typeof i&&i instanceof i&&F.call(i)==D};const M=function(t){return b(t)&&1===t.nodeType&&!I(t)};class N extends((0,g.ElementApiMixin)(g.Editor)){constructor(t,e={}){if(!W(t)&&void 0!==e.initialData)throw new s.CKEditorError("editor-create-initial-data",null);super(e),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return W(t)?(0,s.getDataFromElement)(t):t}(t)),W(t)&&(this.sourceElement=t),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),o=new m(this.locale,this.editing.view,{shouldToolbarGroupWhenFull:i,containerEl:e.containerEl,panelAbsolute:e.panelAbsolute});this.ui=new r(this,o),(0,g.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)))}))}}function W(t){return M(t)}N.Context=g.Context,N.EditorWatchdog=y.EditorWatchdog,N.ContextWatchdog=y.ContextWatchdog},532:()=>{},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:()=>t.c});var t=i(584),e=i(532),n={};for(const t in e)["default","ClassicFloatingEditor"].indexOf(t)<0&&(n[t]=()=>e[t]);i.d(o,n)})(),(window.CKEditor5=window.CKEditor5||{}).ckeditor5EditorClassicFloating=o})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ckeditor5-editor-classic-floating",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.1.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.
|
|
15
|
+
"ckeditor5": "41.1.0",
|
|
16
16
|
"lodash-es": "4.17.21",
|
|
17
|
-
"@ckeditor/ckeditor5-ui": "41.
|
|
18
|
-
"@ckeditor/ckeditor5-utils": "41.
|
|
17
|
+
"@ckeditor/ckeditor5-ui": "41.1.0",
|
|
18
|
+
"@ckeditor/ckeditor5-utils": "41.1.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@ckeditor/ckeditor5-basic-styles": "41.
|
|
22
|
-
"@ckeditor/ckeditor5-core": "41.
|
|
21
|
+
"@ckeditor/ckeditor5-basic-styles": "41.1.0",
|
|
22
|
+
"@ckeditor/ckeditor5-core": "41.1.0",
|
|
23
23
|
"@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-undo": "41.
|
|
32
|
-
"@ckeditor/ckeditor5-watchdog": "41.
|
|
24
|
+
"@ckeditor/ckeditor5-engine": "41.1.0",
|
|
25
|
+
"@ckeditor/ckeditor5-enter": "41.1.0",
|
|
26
|
+
"@ckeditor/ckeditor5-heading": "41.1.0",
|
|
27
|
+
"@ckeditor/ckeditor5-image": "41.1.0",
|
|
28
|
+
"@ckeditor/ckeditor5-paragraph": "41.1.0",
|
|
29
|
+
"@ckeditor/ckeditor5-theme-lark": "41.1.0",
|
|
30
|
+
"@ckeditor/ckeditor5-typing": "41.1.0",
|
|
31
|
+
"@ckeditor/ckeditor5-undo": "41.1.0",
|
|
32
|
+
"@ckeditor/ckeditor5-watchdog": "41.1.0",
|
|
33
33
|
"typescript": "5.0.4",
|
|
34
34
|
"webpack": "^5.58.1",
|
|
35
35
|
"webpack-cli": "^4.9.0"
|
|
@@ -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.
|