@ckeditor/ckeditor5-editor-inline 40.1.0 → 41.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,12 +5,12 @@ All changes in the package are documented in the main repository. See: https://g
5
5
 
6
6
  Changes for the past releases are available below.
7
7
 
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v18.0.0...v19.0.0) (2020-04-29)
8
+ ## [19.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
9
 
10
10
  Internal changes only (updated dependencies, documentation, etc.).
11
11
 
12
12
 
13
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v17.0.0...v18.0.0) (2020-03-19)
13
+ ## [18.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v17.0.0...v18.0.0) (March 19, 2020)
14
14
 
15
15
  ### MAJOR BREAKING CHANGES
16
16
 
@@ -21,22 +21,22 @@ Internal changes only (updated dependencies, documentation, etc.).
21
21
  * The inline editor toolbar should group items when its width exceeds the editable’s width (see [ckeditor/ckeditor5#5597](https://github.com/ckeditor/ckeditor5/issues/5597)). ([1c5746c](https://github.com/ckeditor/ckeditor5-editor-inline/commit/1c5746c))
22
22
 
23
23
 
24
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v16.0.0...v17.0.0) (2020-02-19)
24
+ ## [17.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v16.0.0...v17.0.0) (February 19, 2020)
25
25
 
26
26
  Internal changes only (updated dependencies, documentation, etc.).
27
27
 
28
28
 
29
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v15.0.0...v16.0.0) (2019-12-04)
29
+ ## [16.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v15.0.0...v16.0.0) (December 4, 2019)
30
30
 
31
31
  Internal changes only (updated dependencies, documentation, etc.).
32
32
 
33
33
 
34
- ## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.3.0...v15.0.0) (2019-10-23)
34
+ ## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.3.0...v15.0.0) (October 23, 2019)
35
35
 
36
36
  Internal changes only (updated dependencies, documentation, etc.).
37
37
 
38
38
 
39
- ## [12.3.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.1...v12.3.0) (2019-08-26)
39
+ ## [12.3.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.1...v12.3.0) (August 26, 2019)
40
40
 
41
41
  ### Features
42
42
 
@@ -48,31 +48,31 @@ Internal changes only (updated dependencies, documentation, etc.).
48
48
  * Introduced a check that prevents sharing source elements between editor instances. See [ckeditor/ckeditor5#746](https://github.com/ckeditor/ckeditor5/issues/746). ([5e42fcf](https://github.com/ckeditor/ckeditor5-editor-inline/commit/5e42fcf))
49
49
 
50
50
 
51
- ## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.0...v12.2.1) (2019-07-10)
51
+ ## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.0...v12.2.1) (July 10, 2019)
52
52
 
53
53
  Internal changes only (updated dependencies, documentation, etc.).
54
54
 
55
55
 
56
- ## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.1...v12.2.0) (2019-07-04)
56
+ ## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.1...v12.2.0) (July 4, 2019)
57
57
 
58
58
  ### Features
59
59
 
60
60
  * `InlineEditor.create()` will throw an error, when a `<textarea>` element is used. ([56c9f40](https://github.com/ckeditor/ckeditor5-editor-inline/commit/56c9f40))
61
61
 
62
62
 
63
- ## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.0...v12.1.1) (2019-06-05)
63
+ ## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.0...v12.1.1) (June 6, 2019)
64
64
 
65
65
  Internal changes only (updated dependencies, documentation, etc.).
66
66
 
67
67
 
68
- ## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.0.0...v12.1.0) (2019-04-10)
68
+ ## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.0.0...v12.1.0) (April 4, 2019)
69
69
 
70
70
  ### Features
71
71
 
72
72
  * Introduced `EditorConfig#initialData`. ([59e97b5](https://github.com/ckeditor/ckeditor5-editor-inline/commit/59e97b5))
73
73
 
74
74
 
75
- ## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.2...v12.0.0) (2019-02-28)
75
+ ## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.2...v12.0.0) (February 28, 2019)
76
76
 
77
77
  ### Features
78
78
 
@@ -97,12 +97,12 @@ Internal changes only (updated dependencies, documentation, etc.).
97
97
  * Removed `InlineEditorUIView#editableElement`. Instead `InlineEditorUI#getEditableElement()` method should be used.
98
98
 
99
99
 
100
- ## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.1...v11.0.2) (2018-12-05)
100
+ ## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.1...v11.0.2) (December 5, 2018)
101
101
 
102
102
  Internal changes only (updated dependencies, documentation, etc.).
103
103
 
104
104
 
105
- ## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.0...v11.0.1) (2018-10-08)
105
+ ## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.0...v11.0.1) (October 8, 2018)
106
106
 
107
107
  ### Bug fixes
108
108
 
@@ -111,7 +111,7 @@ Internal changes only (updated dependencies, documentation, etc.).
111
111
  Huge thanks to [Alex Eckermann](https://github.com/alexeckermann) for this contribution!
112
112
 
113
113
 
114
- ## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.1...v11.0.0) (2018-07-18)
114
+ ## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.1...v11.0.0) (July 18, 2018)
115
115
 
116
116
  ### Features
117
117
 
@@ -126,12 +126,12 @@ Internal changes only (updated dependencies, documentation, etc.).
126
126
  * The `InlineEditor#element` property was renamed to `InlineEditor#sourceElement` and `InlineEditor#updateElement()` method to `InlineEditor#updateSourceElement()`. See [ckeditor/ckeditor5-core#64](https://github.com/ckeditor/ckeditor5-core/issues/64).
127
127
 
128
128
 
129
- ## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.0...v10.0.1) (2018-06-21)
129
+ ## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.0...v10.0.1) (June 21, 2018)
130
130
 
131
131
  Internal changes only (updated dependencies, documentation, etc.).
132
132
 
133
133
 
134
- ## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
134
+ ## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.4...v10.0.0) (April 25, 2018)
135
135
 
136
136
  ### Other changes
137
137
 
@@ -142,17 +142,17 @@ Internal changes only (updated dependencies, documentation, etc.).
142
142
  * The license under which CKEditor&nbsp;5 is released has been changed from a triple GPL, LGPL and MPL license to a GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991) for more information.
143
143
 
144
144
 
145
- ## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
145
+ ## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.2...v1.0.0-beta.4) (April 19, 2018)
146
146
 
147
147
  Internal changes only (updated dependencies, documentation, etc.).
148
148
 
149
149
 
150
- ## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
150
+ ## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.1...v1.0.0-beta.2) (April 10, 2018)
151
151
 
152
152
  Internal changes only (updated dependencies, documentation, etc.).
153
153
 
154
154
 
155
- ## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018-03-15)
155
+ ## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (March 15, 2018)
156
156
 
157
157
  ### Other changes
158
158
 
@@ -160,19 +160,19 @@ Internal changes only (updated dependencies, documentation, etc.).
160
160
  * Removed the `.ck-editor-toolbar` class from the toolbar (see [ckeditor/ckeditor5-theme-lark#135](https://github.com/ckeditor/ckeditor5-theme-lark/issues/135)). ([213ddfd](https://github.com/ckeditor/ckeditor5-editor-inline/commit/213ddfd))
161
161
 
162
162
 
163
- ## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017-11-14)
163
+ ## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (November 14, 2017)
164
164
 
165
165
  ### Other changes
166
166
 
167
167
  * Aligned UI library usage to the [changes in the UI framework](https://github.com/ckeditor/ckeditor5-ui/pull/332).
168
168
 
169
169
 
170
- ## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.2.0...v1.0.0-alpha.1) (2017-10-03)
170
+ ## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.2.0...v1.0.0-alpha.1) (October 3, 2017)
171
171
 
172
172
  Internal changes only (updated dependencies, documentation, etc.).
173
173
 
174
174
 
175
- ## [0.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.1...v0.2.0) (2017-09-03)
175
+ ## [0.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.1...v0.2.0) (September 3, 2017)
176
176
 
177
177
  ### Bug fixes
178
178
 
@@ -193,14 +193,14 @@ Internal changes only (updated dependencies, documentation, etc.).
193
193
  * The `inline.js` file containing `InlineEditor` class has been renamed to `inlineeditor.js`.
194
194
 
195
195
 
196
- ## [0.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.0...v0.1.1) (2017-05-07)
196
+ ## [0.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.0...v0.1.1) (May 7, 2017)
197
197
 
198
198
  ### Bug fixes
199
199
 
200
200
  * The position of the floating toolbar should be updated after the editable has grown. Closes [#4](https://github.com/ckeditor/ckeditor5-editor-inline/issues/4). ([ae578b3](https://github.com/ckeditor/ckeditor5-editor-inline/commit/ae578b3))
201
201
 
202
202
 
203
- ## 0.1.0 (2017-04-05)
203
+ ## 0.1.0 (April 5, 2017)
204
204
 
205
205
  ### Features
206
206
 
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–2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 2003–2024, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -1,4 +1,4 @@
1
1
  /*!
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
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={704:(t,e,o)=>{t.exports=o(79)("./src/core.js")},492:(t,e,o)=>{t.exports=o(79)("./src/engine.js")},273:(t,e,o)=>{t.exports=o(79)("./src/ui.js")},209:(t,e,o)=>{t.exports=o(79)("./src/utils.js")},434:(t,e,o)=>{t.exports=o(79)("./src/watchdog.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={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:()=>D});var t=o(704),e=o(209),r=o(434),n=o(273),s=o(492);class l extends n.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=(0,n.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),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),e.listenTo(t.ui,"update",(()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})})),i.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(i)}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.config.get("placeholder");if(i){const t="string"==typeof i?i:i[o.rootName];t&&(o.placeholder=t)}(0,s.enablePlaceholder)({view:e,element:o,isDirectHost:!1,keepOnFocus:!0})}}const a=(0,e.toUnit)("px");class c extends n.EditorUIView{constructor(t,e,o,i={}){super(t);const r=t.t;this.toolbar=new n.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new n.BalloonPanelView(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new n.InlineEditableUIView(t,e,o,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),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=a(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()}}const d=function(t){return null!=t&&"object"==typeof t};const h="object"==typeof global&&global&&global.Object===Object&&global;var u="object"==typeof self&&self&&self.Object===Object&&self;const p=(h||u||Function("return this")()).Symbol;var b=Object.prototype,f=b.hasOwnProperty,g=b.toString,w=p?p.toStringTag:void 0;const v=function(t){var e=f.call(t,w),o=t[w];try{t[w]=void 0;var i=!0}catch(t){}var r=g.call(t);return i&&(e?t[w]=o:delete t[w]),r};var m=Object.prototype.toString;const y=function(t){return m.call(t)};var O=p?p.toStringTag:void 0;const T=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?v(t):y(t)};const j=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var E=Function.prototype,P=Object.prototype,x=E.toString,_=P.hasOwnProperty,F=x.call(Object);const C=function(t){if(!d(t)||"[object Object]"!=T(t))return!1;var e=j(t);if(null===e)return!0;var o=_.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&x.call(o)==F};const S=function(t){return d(t)&&1===t.nodeType&&!C(t)};class D extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,i={}){if(!W(o)&&void 0!==i.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return W(t)?(0,e.getDataFromElement)(t):t}(o)),this.model.document.createRoot(),W(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this,o));const r=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new c(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:r});this.ui=new l(this,n),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((i=>{if(W(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const r=new this(t,o);i(r.initPlugins().then((()=>r.ui.init())).then((()=>r.data.init(r.config.get("initialData")))).then((()=>r.fire("ready"))).then((()=>r)))}))}}function W(t){return S(t)}D.Context=t.Context,D.EditorWatchdog=r.EditorWatchdog,D.ContextWatchdog=r.ContextWatchdog})(),(window.CKEditor5=window.CKEditor5||{}).editorInline=i})();
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")},434:(t,e,o)=>{t.exports=o(79)("./src/watchdog.js")},79:t=>{"use strict";t.exports=CKEditor5.dll}},e={};function o(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={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:()=>W});var t=o(704),e=o(209),r=o(434),n=o(273),s=o(492);class l extends n.EditorUI{constructor(t,e){super(t),this.view=e,this._toolbarConfig=(0,n.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),i.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_initToolbar(){const t=this.editor,e=this.view,o=e.editable.element,i=e.toolbar;e.panel.bind("isVisible").to(this.focusTracker,"isFocused"),e.bind("viewportTopOffset").to(this,"viewportOffset",(({top:t})=>t||0)),e.listenTo(t.ui,"update",(()=>{e.panel.isVisible&&e.panel.pin({target:o,positions:e.panelPositions})})),i.fillFromConfig(this._toolbarConfig,this.componentFactory),this.addToolbar(i)}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),i=t.config.get("placeholder");if(i){const t="string"==typeof i?i:i[o.rootName];t&&(o.placeholder=t)}(0,s.enablePlaceholder)({view:e,element:o,isDirectHost:!1,keepOnFocus:!0})}}const a=(0,e.toUnit)("px");class c extends n.EditorUIView{constructor(t,e,o,i={}){super(t);const r=t.t;this.toolbar=new n.ToolbarView(t,{shouldGroupWhenFull:i.shouldToolbarGroupWhenFull,isFloating:!0}),this.set("viewportTopOffset",0),this.panel=new n.BalloonPanelView(t),this.panelPositions=this._getPanelPositions(),this.panel.extendTemplate({attributes:{class:"ck-toolbar-container"}}),this.editable=new n.InlineEditableUIView(t,e,o,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),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=a(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()}}const d=function(t){return null!=t&&"object"==typeof t};const h="object"==typeof global&&global&&global.Object===Object&&global;var u="object"==typeof self&&self&&self.Object===Object&&self;const p=(h||u||Function("return this")()).Symbol;var b=Object.prototype,f=b.hasOwnProperty,g=b.toString,w=p?p.toStringTag:void 0;const v=function(t){var e=f.call(t,w),o=t[w];try{t[w]=void 0;var i=!0}catch(t){}var r=g.call(t);return i&&(e?t[w]=o:delete t[w]),r};var m=Object.prototype.toString;const y=function(t){return m.call(t)};var O=p?p.toStringTag:void 0;const T=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?v(t):y(t)};const j=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var E=Function.prototype,P=Object.prototype,x=E.toString,_=P.hasOwnProperty,F=x.call(Object);const C=function(t){if(!d(t)||"[object Object]"!=T(t))return!1;var e=j(t);if(null===e)return!0;var o=_.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&x.call(o)==F};const S=function(t){return d(t)&&1===t.nodeType&&!C(t)};class D extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,i={}){if(!R(o)&&void 0!==i.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return R(t)?(0,e.getDataFromElement)(t):t}(o)),this.model.document.createRoot(),R(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this,o));const r=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new c(this.locale,this.editing.view,this.sourceElement,{shouldToolbarGroupWhenFull:r});this.ui=new l(this,n),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((i=>{if(R(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const r=new this(t,o);i(r.initPlugins().then((()=>r.ui.init())).then((()=>r.data.init(r.config.get("initialData")))).then((()=>r.fire("ready"))).then((()=>r)))}))}}D.Context=t.Context,D.EditorWatchdog=r.EditorWatchdog,D.ContextWatchdog=r.ContextWatchdog;const W=D;function R(t){return S(t)}})(),(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": "40.1.0",
3
+ "version": "41.0.0",
4
4
  "description": "Inline editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -9,9 +9,10 @@
9
9
  "ckeditor5-editor",
10
10
  "ckeditor5-dll"
11
11
  ],
12
+ "type": "module",
12
13
  "main": "src/index.js",
13
14
  "dependencies": {
14
- "ckeditor5": "40.1.0",
15
+ "ckeditor5": "41.0.0",
15
16
  "lodash-es": "4.17.21"
16
17
  },
17
18
  "author": "CKSource (http://cksource.com/)",
package/src/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline
7
7
  */
8
- export { default as InlineEditor } from './inlineeditor';
8
+ export { default as InlineEditor } from './inlineeditor.js';
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline
7
7
  */
8
- export { default as InlineEditor } from './inlineeditor';
8
+ export { default as InlineEditor } from './inlineeditor.js';
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline/inlineeditor
7
7
  */
8
- import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core';
9
- import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
10
- import InlineEditorUI from './inlineeditorui';
11
- declare const InlineEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
8
+ import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core.js';
9
+ import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
10
+ import InlineEditorUI from './inlineeditorui.js';
11
+ declare const InlineEditor_base: import("ckeditor5/src/utils.js").Mixed<import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>, import("ckeditor5/src/core.js").DataApi>;
12
12
  /**
13
13
  * The {@glink installation/getting-started/predefined-builds#inline-editor inline editor} implementation.
14
14
  * It uses an inline editable and a floating toolbar.
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline/inlineeditor
7
7
  */
8
- import { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core';
9
- import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils';
10
- import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
11
- import InlineEditorUI from './inlineeditorui';
12
- import InlineEditorUIView from './inlineeditoruiview';
8
+ import { Editor, Context, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core.js';
9
+ import { getDataFromElement, CKEditorError } from 'ckeditor5/src/utils.js';
10
+ import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog.js';
11
+ import InlineEditorUI from './inlineeditorui.js';
12
+ import InlineEditorUIView from './inlineeditoruiview.js';
13
13
  import { isElement as _isElement } from 'lodash-es';
14
14
  /**
15
15
  * The {@glink installation/getting-started/predefined-builds#inline-editor inline editor} implementation.
@@ -34,7 +34,7 @@ import { isElement as _isElement } from 'lodash-es';
34
34
  * Read more about initializing the editor from source or as a build in
35
35
  * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}.
36
36
  */
37
- export default class InlineEditor extends DataApiMixin(ElementApiMixin(Editor)) {
37
+ class InlineEditor extends DataApiMixin(ElementApiMixin(Editor)) {
38
38
  /**
39
39
  * Creates an instance of the inline editor.
40
40
  *
@@ -218,6 +218,7 @@ InlineEditor.EditorWatchdog = EditorWatchdog;
218
218
  * Exposed as static editor field for easier access in editor builds.
219
219
  */
220
220
  InlineEditor.ContextWatchdog = ContextWatchdog;
221
+ export default InlineEditor;
221
222
  function getInitialData(sourceElementOrData) {
222
223
  return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
223
224
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline/inlineeditorui
7
7
  */
8
- import { type Editor } from 'ckeditor5/src/core';
9
- import { EditorUI } from 'ckeditor5/src/ui';
10
- import type InlineEditorUIView from './inlineeditoruiview';
8
+ import { type Editor } from 'ckeditor5/src/core.js';
9
+ import { EditorUI } from 'ckeditor5/src/ui.js';
10
+ import type InlineEditorUIView from './inlineeditoruiview.js';
11
11
  /**
12
12
  * The inline editor UI class.
13
13
  *
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import { EditorUI, normalizeToolbarConfig } from 'ckeditor5/src/ui';
6
- import { enablePlaceholder } from 'ckeditor5/src/engine';
5
+ import { EditorUI, normalizeToolbarConfig } from 'ckeditor5/src/ui.js';
6
+ import { enablePlaceholder } from 'ckeditor5/src/engine.js';
7
7
  /**
8
8
  * The inline editor UI class.
9
9
  *
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline/inlineeditoruiview
7
7
  */
8
- import { BalloonPanelView, EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui';
9
- import { type PositioningFunction, type Locale } from 'ckeditor5/src/utils';
10
- import type { View } from 'ckeditor5/src/engine';
8
+ import { BalloonPanelView, EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
9
+ import { type PositioningFunction, type Locale } from 'ckeditor5/src/utils.js';
10
+ import type { EditingView } from 'ckeditor5/src/engine.js';
11
11
  /**
12
12
  * Inline editor UI view. Uses an nline editable and a floating toolbar.
13
13
  */
@@ -110,7 +110,7 @@ export default class InlineEditorUIView extends EditorUIView {
110
110
  * in the main {@link module:editor-inline/inlineeditoruiview~InlineEditorUIView#toolbar toolbar}.
111
111
  * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
112
112
  */
113
- constructor(locale: Locale, editingView: View, editableElement?: HTMLElement, options?: {
113
+ constructor(locale: Locale, editingView: EditingView, editableElement?: HTMLElement, options?: {
114
114
  shouldToolbarGroupWhenFull?: boolean;
115
115
  });
116
116
  /**
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
  /**
6
6
  * @module editor-inline/inlineeditoruiview
7
7
  */
8
- import { BalloonPanelView, EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui';
9
- import { Rect, ResizeObserver, toUnit } from 'ckeditor5/src/utils';
8
+ import { BalloonPanelView, EditorUIView, InlineEditableUIView, ToolbarView } from 'ckeditor5/src/ui.js';
9
+ import { Rect, ResizeObserver, toUnit } from 'ckeditor5/src/utils.js';
10
10
  const toPx = toUnit('px');
11
11
  /**
12
12
  * Inline editor UI view. Uses an nline editable and a floating toolbar.