@ckeditor/ckeditor5-editor-inline 31.1.0 → 32.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **Inline editor implementation** – https://github.com/ckeditor/ckeditor5-editor-inline <br>
5
- Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
5
+ Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
14
14
  Trademarks
15
15
  ----------
16
16
 
17
- **CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
17
+ **CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
@@ -1,5 +1,4 @@
1
1
  /*!
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource - Frederico Knabben. All rights reserved.
3
3
  * For licensing, see LICENSE.md.
4
- */
5
- window.CKEditor5=window.CKEditor5||{},window.CKEditor5.editorInline=function(t){var e={};function o(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(i,r,function(e){return t[e]}.bind(null,r));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e,o){t.exports=o(3)("./src/utils.js")},function(t,e,o){t.exports=o(3)("./src/core.js")},function(t,e,o){t.exports=o(3)("./src/ui.js")},function(t,e){t.exports=CKEditor5.dll},function(t,e,o){t.exports=o(3)("./src/engine.js")},function(t,e,o){"use strict";(function(t){var o="object"==typeof t&&t&&t.Object===Object&&t;e.a=o}).call(this,o(6))},function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e,o){"use strict";o.r(e),o.d(e,"InlineEditor",(function(){return D}));var i=o(1),r=o(0);var n=function(t){return null!=t&&"object"==typeof t},s=o(5),l="object"==typeof self&&self&&self.Object===Object&&self,a=(s.a||l||Function("return this")()).Symbol,c=Object.prototype,u=c.hasOwnProperty,d=c.toString,h=a?a.toStringTag:void 0;var f=function(t){var e=u.call(t,h),o=t[h];try{t[h]=void 0;var i=!0}catch(t){}var r=d.call(t);return i&&(e?t[h]=o:delete t[h]),r},p=Object.prototype.toString;var b=function(t){return p.call(t)},g=a?a.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?f(t):b(t)};var v=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object),m=Function.prototype,y=Object.prototype,O=m.toString,j=y.hasOwnProperty,T=O.call(Object);var E=function(t){if(!n(t)||"[object Object]"!=w(t))return!1;var e=v(t);if(null===e)return!0;var o=j.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&O.call(o)==T};var P=function(t){return n(t)&&1===t.nodeType&&!E(t)},x=o(2),_=o(4);class F extends i.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=Object(x.normalizeToolbarConfig)(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,o=t.editing.view,i=e.editable,r=o.document.getRoot();i.name=r.rootName,e.render();const n=i.element;this.setEditableElement(i.name,n),this.focusTracker.add(n),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=t.editing.view,r=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",({top:t})=>t),e.listenTo(t.ui,"update",()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})}),r.fillFromConfig(this._toolbarConfig,this.componentFactory),Object(x.enableToolbarKeyboardFocus)({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:r})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.sourceElement,r=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");r&&Object(_.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}const C=Object(r.toUnit)("px");class S extends x.EditorUIView{constructor(t,e,o,i={}){super(t),this.toolbar=new x.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new x.BalloonPanelView(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new x.InlineEditableUIView(t,e,o),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new r.ResizeObserver(t,()=>{this.toolbar.maxWidth=C(new r.Rect(t).width)})}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let o;return o=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,o}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west",config:{withArrow:!1}}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east",config:{withArrow:!1}})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class D extends i.Editor{constructor(t,e){super(e),this.model.document.createRoot(),P(t)&&(this.sourceElement=t,Object(i.secureSourceElement)(this));const o=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new S(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:o});this.ui=new F(this,r),Object(i.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then(()=>{this.sourceElement&&Object(r.setDataInElement)(this.sourceElement,t)})}static create(t,e={}){return new Promise(o=>{const i=P(t);if(i&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const n=new this(t,e);o(n.initPlugins().then(()=>{n.ui.init()}).then(()=>{if(!i&&e.initialData)throw new r.CKEditorError("editor-create-initial-data",null);const o=void 0!==e.initialData?e.initialData:function(t){return P(t)?Object(r.getDataFromElement)(t):t}(t);return n.data.init(o)}).then(()=>n.fire("ready")).then(()=>n))})}}Object(r.mix)(D,i.DataApiMixin),Object(r.mix)(D,i.ElementApiMixin)}]);
4
+ */(()=>{var t={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i](n,n.exports,o),n.exports}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})};var i={};(()=>{"use strict";o.r(i),o.d(i,{InlineEditor:()=>C});var t=o(704),e=o(209);const r=function(t){return null!=t&&"object"==typeof t};const n="object"==typeof global&&global&&global.Object===Object&&global;var s="object"==typeof self&&self&&self.Object===Object&&self;const l=(n||s||Function("return this")()).Symbol;var a=Object.prototype,c=a.hasOwnProperty,d=a.toString,u=l?l.toStringTag:void 0;const h=function(t){var e=c.call(t,u),o=t[u];try{t[u]=void 0;var i=!0}catch(t){}var r=d.call(t);return i&&(e?t[u]=o:delete t[u]),r};var p=Object.prototype.toString;const b=function(t){return p.call(t)};var f=l?l.toStringTag:void 0;const g=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":f&&f in Object(t)?h(t):b(t)};const w=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var m=Function.prototype,v=Object.prototype,y=m.toString,O=v.hasOwnProperty,T=y.call(Object);const j=function(t){if(!r(t)||"[object Object]"!=g(t))return!1;var e=w(t);if(null===e)return!0;var o=O.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&y.call(o)==T};const E=function(t){return r(t)&&1===t.nodeType&&!j(t)};var P=o(273),x=o(492);class _ extends t.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=(0,P.normalizeToolbarConfig)(t.config.get("toolbar"))}get element(){return this.view.editable.element}init(){const t=this.editor,e=this.view,o=t.editing.view,i=e.editable,r=o.document.getRoot();i.name=r.rootName,e.render();const n=i.element;this.setEditableElement(i.name,n),this.focusTracker.add(n),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=t.editing.view,r=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t)),e.listenTo(t.ui,"update",(()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})})),r.fillFromConfig(this._toolbarConfig,this.componentFactory),(0,P.enableToolbarKeyboardFocus)({origin:i,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:r})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.sourceElement,r=t.config.get("placeholder")||i&&"textarea"===i.tagName.toLowerCase()&&i.getAttribute("placeholder");r&&(0,x.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}const F=(0,e.toUnit)("px");class S extends P.EditorUIView{constructor(t,e,o,i={}){super(t),this.toolbar=new P.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new P.BalloonPanelView(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new P.InlineEditableUIView(t,e,o),this._resizeObserver=null}render(){super.render(),this.body.add(this.panel),this.registerChild(this.editable),this.panel.content.add(this.toolbar);if(this.toolbar.options.shouldGroupWhenFull){const t=this.editable.element;this._resizeObserver=new e.ResizeObserver(t,(()=>{this.toolbar.maxWidth=F(new e.Rect(t).width)}))}}destroy(){super.destroy(),this._resizeObserver&&this._resizeObserver.destroy()}_getPanelPositionTop(t,e){let o;return o=t.top>e.height+this.viewportTopOffset?t.top-e.height:t.bottom>e.height+this.viewportTopOffset+50?this.viewportTopOffset:t.bottom,o}_getPanelPositions(){const t=[(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left,name:"toolbar_west",config:{withArrow:!1}}),(t,e)=>({top:this._getPanelPositionTop(t,e),left:t.left+t.width-e.width,name:"toolbar_east",config:{withArrow:!1}})];return"ltr"===this.locale.uiLanguageDirection?t:t.reverse()}}class C extends t.Editor{constructor(e,o){super(o),this.model.document.createRoot(),E(e)&&(this.sourceElement=e,(0,t.secureSourceElement)(this));const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),r=new S(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:i});this.ui=new _(this,r),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&(0,e.setDataInElement)(this.sourceElement,t)}))}static create(t,o={}){return new Promise((i=>{const r=E(t);if(r&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const n=new this(t,o);i(n.initPlugins().then((()=>{n.ui.init()})).then((()=>{if(!r&&o.initialData)throw new e.CKEditorError("editor-create-initial-data",null);const i=void 0!==o.initialData?o.initialData:function(t){return E(t)?(0,e.getDataFromElement)(t):t}(t);return n.data.init(i)})).then((()=>n.fire("ready"))).then((()=>n)))}))}}(0,e.mix)(C,t.DataApiMixin),(0,e.mix)(C,t.ElementApiMixin)})(),(window.CKEditor5=window.CKEditor5||{}).editorInline=i})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-editor-inline",
3
- "version": "31.1.0",
3
+ "version": "32.0.0",
4
4
  "description": "Inline editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,27 +11,27 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "ckeditor5": "^31.1.0",
14
+ "ckeditor5": "^32.0.0",
15
15
  "lodash-es": "^4.17.15"
16
16
  },
17
17
  "devDependencies": {
18
- "@ckeditor/ckeditor5-basic-styles": "^31.1.0",
19
- "@ckeditor/ckeditor5-core": "^31.1.0",
20
- "@ckeditor/ckeditor5-dev-utils": "^26.0.0",
21
- "@ckeditor/ckeditor5-engine": "^31.1.0",
22
- "@ckeditor/ckeditor5-enter": "^31.1.0",
23
- "@ckeditor/ckeditor5-heading": "^31.1.0",
24
- "@ckeditor/ckeditor5-paragraph": "^31.1.0",
25
- "@ckeditor/ckeditor5-theme-lark": "^31.1.0",
26
- "@ckeditor/ckeditor5-typing": "^31.1.0",
27
- "@ckeditor/ckeditor5-ui": "^31.1.0",
28
- "@ckeditor/ckeditor5-undo": "^31.1.0",
29
- "@ckeditor/ckeditor5-utils": "^31.1.0",
30
- "webpack": "^4.43.0",
31
- "webpack-cli": "^3.3.11"
18
+ "@ckeditor/ckeditor5-basic-styles": "^32.0.0",
19
+ "@ckeditor/ckeditor5-core": "^32.0.0",
20
+ "@ckeditor/ckeditor5-dev-utils": "^27.1.0",
21
+ "@ckeditor/ckeditor5-engine": "^32.0.0",
22
+ "@ckeditor/ckeditor5-enter": "^32.0.0",
23
+ "@ckeditor/ckeditor5-heading": "^32.0.0",
24
+ "@ckeditor/ckeditor5-paragraph": "^32.0.0",
25
+ "@ckeditor/ckeditor5-theme-lark": "^32.0.0",
26
+ "@ckeditor/ckeditor5-typing": "^32.0.0",
27
+ "@ckeditor/ckeditor5-ui": "^32.0.0",
28
+ "@ckeditor/ckeditor5-undo": "^32.0.0",
29
+ "@ckeditor/ckeditor5-utils": "^32.0.0",
30
+ "webpack": "^5.58.1",
31
+ "webpack-cli": "^4.9.0"
32
32
  },
33
33
  "engines": {
34
- "node": ">=12.0.0",
34
+ "node": ">=14.0.0",
35
35
  "npm": ">=5.7.1"
36
36
  },
37
37
  "author": "CKSource (http://cksource.com/)",
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5