@ckeditor/ckeditor5-editor-balloon 35.3.2 → 36.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
  **Balloon editor implementation** – https://github.com/ckeditor/ckeditor5-editor-balloon <br>
5
- Copyright (c) 2003-2022, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 2003-2023, [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-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, 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")},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,{BalloonEditor:()=>C});var t=o(704),e=o(273),r=o(209);const n=function(t){return null!=t&&"object"==typeof t};const s="object"==typeof global&&global&&global.Object===Object&&global;var c="object"==typeof self&&self&&self.Object===Object&&self;const a=(s||c||Function("return this")()).Symbol;var l=Object.prototype,d=l.hasOwnProperty,u=l.toString,h=a?a.toStringTag:void 0;const g=function(t){var e=d.call(t,h),o=t[h];try{t[h]=void 0;var i=!0}catch(t){}var r=u.call(t);return i&&(e?t[h]=o:delete t[h]),r};var p=Object.prototype.toString;const b=function(t){return p.call(t)};var f=a?a.toStringTag:void 0;const m=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":f&&f in Object(t)?g(t):b(t)};const v=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var y=Function.prototype,w=Object.prototype,j=y.toString,E=w.hasOwnProperty,O=j.call(Object);const x=function(t){if(!n(t)||"[object Object]"!=m(t))return!1;var e=v(t);if(null===e)return!0;var o=E.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&j.call(o)==O};const S=function(t){return n(t)&&1===t.nodeType&&!x(t)};var P=o(492);class T extends t.EditorUI{constructor(t,e){super(t),this.view=e}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.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_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,P.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}class D extends e.EditorUIView{constructor(t,o,i){super(t);const r=t.t;this.editable=new e.InlineEditableUIView(t,o,i,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)})}render(){super.render(),this.registerChild(this.editable)}}class C extends t.Editor{constructor(o,i={}){if(!S(o)&&void 0!==i.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return S(t)?(0,r.getDataFromElement)(t):t}(o)),S(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this));const n=this.config.get("plugins");n.push(e.BalloonToolbar),this.config.set("plugins",n),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const s=new D(this.locale,this.editing.view,this.sourceElement);this.ui=new T(this,s),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,e={}){return new Promise((o=>{if(S(t)&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}(0,r.mix)(C,t.DataApiMixin),(0,r.mix)(C,t.ElementApiMixin)})(),(window.CKEditor5=window.CKEditor5||{}).editorBalloon=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")},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,{BalloonEditor:()=>C});var t=o(704),e=o(273),r=o(209),n=o(492);class s extends e.EditorUI{constructor(t,e){super(t),this.view=e}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.fire("ready")}destroy(){super.destroy();const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy()}_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,n.enablePlaceholder)({view:e,element:o,text:r,isDirectHost:!1,keepOnFocus:!0})}}class c extends e.EditorUIView{constructor(t,o,i){super(t);const r=t.t;this.editable=new e.InlineEditableUIView(t,o,i,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)})}render(){super.render(),this.registerChild(this.editable)}}const a=function(t){return null!=t&&"object"==typeof t};const l="object"==typeof global&&global&&global.Object===Object&&global;var d="object"==typeof self&&self&&self.Object===Object&&self;const u=(l||d||Function("return this")()).Symbol;var h=Object.prototype,g=h.hasOwnProperty,p=h.toString,b=u?u.toStringTag:void 0;const f=function(t){var e=g.call(t,b),o=t[b];try{t[b]=void 0;var i=!0}catch(t){}var r=p.call(t);return i&&(e?t[b]=o:delete t[b]),r};var m=Object.prototype.toString;const v=function(t){return m.call(t)};var y=u?u.toStringTag:void 0;const w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?f(t):v(t)};const j=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var E=Function.prototype,O=Object.prototype,x=E.toString,S=O.hasOwnProperty,P=x.call(Object);const T=function(t){if(!a(t)||"[object Object]"!=w(t))return!1;var e=j(t);if(null===e)return!0;var o=S.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&x.call(o)==P};const D=function(t){return a(t)&&1===t.nodeType&&!T(t)};class C extends((0,t.DataApiMixin)((0,t.ElementApiMixin)(t.Editor))){constructor(o,i={}){if(!R(o)&&void 0!==i.initialData)throw new r.CKEditorError("editor-create-initial-data",null);super(i),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return R(t)?(0,r.getDataFromElement)(t):t}(o)),R(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this));const n=this.config.get("plugins");n.push(e.BalloonToolbar),this.config.set("plugins",n),this.config.define("balloonToolbar",this.config.get("toolbar")),this.model.document.createRoot();const a=new c(this.locale,this.editing.view,this.sourceElement);this.ui=new s(this,a),(0,t.attachToForm)(this)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,e={}){return new Promise((o=>{if(R(t)&&"TEXTAREA"===t.tagName)throw new r.CKEditorError("editor-wrong-element",null);const i=new this(t,e);o(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}function R(t){return D(t)}})(),(window.CKEditor5=window.CKEditor5||{}).editorBalloon=i})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-editor-balloon",
3
- "version": "35.3.2",
3
+ "version": "36.0.0",
4
4
  "description": "Balloon editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,23 +11,24 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "ckeditor5": "^35.3.2",
14
+ "ckeditor5": "^36.0.0",
15
15
  "lodash-es": "^4.17.15"
16
16
  },
17
17
  "devDependencies": {
18
- "@ckeditor/ckeditor5-basic-styles": "^35.3.2",
19
- "@ckeditor/ckeditor5-core": "^35.3.2",
20
- "@ckeditor/ckeditor5-dev-utils": "^31.0.0",
21
- "@ckeditor/ckeditor5-engine": "^35.3.2",
22
- "@ckeditor/ckeditor5-enter": "^35.3.2",
23
- "@ckeditor/ckeditor5-heading": "^35.3.2",
24
- "@ckeditor/ckeditor5-image": "^35.3.2",
25
- "@ckeditor/ckeditor5-paragraph": "^35.3.2",
26
- "@ckeditor/ckeditor5-theme-lark": "^35.3.2",
27
- "@ckeditor/ckeditor5-typing": "^35.3.2",
28
- "@ckeditor/ckeditor5-ui": "^35.3.2",
29
- "@ckeditor/ckeditor5-undo": "^35.3.2",
30
- "@ckeditor/ckeditor5-utils": "^35.3.2",
18
+ "@ckeditor/ckeditor5-basic-styles": "^36.0.0",
19
+ "@ckeditor/ckeditor5-core": "^36.0.0",
20
+ "@ckeditor/ckeditor5-dev-utils": "^32.0.0",
21
+ "@ckeditor/ckeditor5-engine": "^36.0.0",
22
+ "@ckeditor/ckeditor5-enter": "^36.0.0",
23
+ "@ckeditor/ckeditor5-heading": "^36.0.0",
24
+ "@ckeditor/ckeditor5-image": "^36.0.0",
25
+ "@ckeditor/ckeditor5-paragraph": "^36.0.0",
26
+ "@ckeditor/ckeditor5-theme-lark": "^36.0.0",
27
+ "@ckeditor/ckeditor5-typing": "^36.0.0",
28
+ "@ckeditor/ckeditor5-ui": "^36.0.0",
29
+ "@ckeditor/ckeditor5-undo": "^36.0.0",
30
+ "@ckeditor/ckeditor5-utils": "^36.0.0",
31
+ "typescript": "^4.8.4",
31
32
  "webpack": "^5.58.1",
32
33
  "webpack-cli": "^4.9.0"
33
34
  },
@@ -46,13 +47,16 @@
46
47
  },
47
48
  "files": [
48
49
  "lang",
49
- "src",
50
+ "src/**/*.js",
51
+ "src/**/*.d.ts",
50
52
  "theme",
51
53
  "build",
52
54
  "ckeditor5-metadata.json",
53
55
  "CHANGELOG.md"
54
56
  ],
55
57
  "scripts": {
56
- "dll:build": "webpack"
58
+ "dll:build": "webpack",
59
+ "build": "tsc -p ./tsconfig.release.json",
60
+ "postversion": "npm run build"
57
61
  }
58
62
  }
@@ -1,21 +1,16 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, 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
-
6
5
  /**
7
6
  * @module editor-balloon/ballooneditor
8
7
  */
9
-
10
8
  import { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core';
11
9
  import { BalloonToolbar } from 'ckeditor5/src/ui';
12
- import { CKEditorError, getDataFromElement, mix } from 'ckeditor5/src/utils';
13
-
14
- import { isElement } from 'lodash-es';
15
-
10
+ import { CKEditorError, getDataFromElement } from 'ckeditor5/src/utils';
16
11
  import BalloonEditorUI from './ballooneditorui';
17
12
  import BalloonEditorUIView from './ballooneditoruiview';
18
-
13
+ import { isElement as _isElement } from 'lodash-es';
19
14
  /**
20
15
  * The {@glink installation/getting-started/predefined-builds#balloon-editor balloon editor}
21
16
  * implementation (Medium-like editor).
@@ -39,197 +34,177 @@ import BalloonEditorUIView from './ballooneditoruiview';
39
34
  *
40
35
  * Read more about initializing the editor from source or as a build in
41
36
  * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
42
- *
43
- * @mixes module:core/editor/utils/dataapimixin~DataApiMixin
44
- * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
45
- * @implements module:core/editor/editorwithui~EditorWithUI
46
- * @extends module:core/editor/editor~Editor
47
37
  */
48
- export default class BalloonEditor extends Editor {
49
- /**
50
- * Creates an instance of the balloon editor.
51
- *
52
- * **Note:** do not use the constructor to create editor instances. Use the static
53
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method instead.
54
- *
55
- * @protected
56
- * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
57
- * (on which the editor will be initialized) or initial data for the editor. For more information see
58
- * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
59
- * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
60
- */
61
- constructor( sourceElementOrData, config = {} ) {
62
- // If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.
63
- if ( !isElement( sourceElementOrData ) && config.initialData !== undefined ) {
64
- // Documented in core/editor/editorconfig.jsdoc.
65
- // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
66
- throw new CKEditorError( 'editor-create-initial-data', null );
67
- }
68
-
69
- super( config );
70
-
71
- if ( this.config.get( 'initialData' ) === undefined ) {
72
- this.config.set( 'initialData', getInitialData( sourceElementOrData ) );
73
- }
74
-
75
- if ( isElement( sourceElementOrData ) ) {
76
- this.sourceElement = sourceElementOrData;
77
- secureSourceElement( this );
78
- }
79
-
80
- const plugins = this.config.get( 'plugins' );
81
- plugins.push( BalloonToolbar );
82
-
83
- this.config.set( 'plugins', plugins );
84
-
85
- this.config.define( 'balloonToolbar', this.config.get( 'toolbar' ) );
86
-
87
- this.model.document.createRoot();
88
-
89
- const view = new BalloonEditorUIView( this.locale, this.editing.view, this.sourceElement );
90
- this.ui = new BalloonEditorUI( this, view );
91
-
92
- attachToForm( this );
93
- }
94
-
95
- /**
96
- * Destroys the editor instance, releasing all resources used by it.
97
- *
98
- * Updates the original editor element with the data if the
99
- * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
100
- * configuration option is set to `true`.
101
- *
102
- * @returns {Promise}
103
- */
104
- destroy() {
105
- // Cache the data, then destroy.
106
- // It's safe to assume that the model->view conversion will not work after super.destroy().
107
- const data = this.getData();
108
-
109
- this.ui.destroy();
110
-
111
- return super.destroy()
112
- .then( () => {
113
- if ( this.sourceElement ) {
114
- this.updateSourceElement( data );
115
- }
116
- } );
117
- }
118
-
119
- /**
120
- * Creates a new balloon editor instance.
121
- *
122
- * There are three general ways how the editor can be initialized.
123
- *
124
- * # Using an existing DOM element (and loading data from it)
125
- *
126
- * You can initialize the editor using an existing DOM element:
127
- *
128
- * BalloonEditor
129
- * .create( document.querySelector( '#editor' ) )
130
- * .then( editor => {
131
- * console.log( 'Editor was initialized', editor );
132
- * } )
133
- * .catch( err => {
134
- * console.error( err.stack );
135
- * } );
136
- *
137
- * The element's content will be used as the editor data and the element will become the editable element.
138
- *
139
- * # Creating a detached editor
140
- *
141
- * Alternatively, you can initialize the editor by passing the initial data directly as a string.
142
- * In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:
143
- *
144
- * BalloonEditor
145
- * .create( '<p>Hello world!</p>' )
146
- * .then( editor => {
147
- * console.log( 'Editor was initialized', editor );
148
- *
149
- * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
150
- * document.body.appendChild( editor.ui.element );
151
- * } )
152
- * .catch( err => {
153
- * console.error( err.stack );
154
- * } );
155
- *
156
- * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
157
- * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
158
- *
159
- * # Using an existing DOM element (and data provided in `config.initialData`)
160
- *
161
- * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
162
- *
163
- * BalloonEditor
164
- * .create( document.querySelector( '#editor' ), {
165
- * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
166
- * } )
167
- * .then( editor => {
168
- * console.log( 'Editor was initialized', editor );
169
- * } )
170
- * .catch( err => {
171
- * console.error( err.stack );
172
- * } );
173
- *
174
- * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
175
- * makes it difficult to set the content of the source element.
176
- *
177
- * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
178
- *
179
- * # Configuring the editor
180
- *
181
- * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
182
- * customizing plugins, toolbar and more.
183
- *
184
- * # Using the editor from source
185
- *
186
- * The code samples listed in the previous sections of this documentation assume that you are using an
187
- * {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-balloon`).
188
- *
189
- * If you want to use the balloon editor from source (`@ckeditor/ckeditor5-editor-balloon/src/ballooneditor`),
190
- * you need to define the list of
191
- * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
192
- * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
193
- * source in the {@glink installation/advanced/alternative-setups/integrating-from-source dedicated guide}.
194
- *
195
- * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor
196
- * or the editor's initial data.
197
- *
198
- * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
199
- * The editor data will be set back to the original element once the editor is destroyed only if the
200
- * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
201
- * option is set to `true`.
202
- *
203
- * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
204
- * It is available under the {@link module:editor-balloon/ballooneditorui~BalloonEditorUI#element `editor.ui.element`} property.
205
- *
206
- * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.
207
- * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.
208
- */
209
- static create( sourceElementOrData, config = {} ) {
210
- return new Promise( resolve => {
211
- if ( isElement( sourceElementOrData ) && sourceElementOrData.tagName === 'TEXTAREA' ) {
212
- // Documented in core/editor/editor.js
213
- // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
214
- throw new CKEditorError( 'editor-wrong-element', null );
215
- }
216
-
217
- const editor = new this( sourceElementOrData, config );
218
-
219
- resolve(
220
- editor.initPlugins()
221
- .then( () => editor.ui.init() )
222
- .then( () => editor.data.init( editor.config.get( 'initialData' ) ) )
223
- .then( () => editor.fire( 'ready' ) )
224
- .then( () => editor )
225
- );
226
- } );
227
- }
38
+ export default class BalloonEditor extends DataApiMixin(ElementApiMixin(Editor)) {
39
+ /**
40
+ * Creates an instance of the balloon editor.
41
+ *
42
+ * **Note:** do not use the constructor to create editor instances. Use the static
43
+ * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method instead.
44
+ *
45
+ * @param sourceElementOrData The DOM element that will be the source for the created editor
46
+ * (on which the editor will be initialized) or initial data for the editor. For more information see
47
+ * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.
48
+ * @param config The editor configuration.
49
+ */
50
+ constructor(sourceElementOrData, config = {}) {
51
+ // If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.
52
+ if (!isElement(sourceElementOrData) && config.initialData !== undefined) {
53
+ // Documented in core/editor/editorconfig.jsdoc.
54
+ // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
55
+ throw new CKEditorError('editor-create-initial-data', null);
56
+ }
57
+ super(config);
58
+ if (this.config.get('initialData') === undefined) {
59
+ this.config.set('initialData', getInitialData(sourceElementOrData));
60
+ }
61
+ if (isElement(sourceElementOrData)) {
62
+ this.sourceElement = sourceElementOrData;
63
+ secureSourceElement(this);
64
+ }
65
+ const plugins = this.config.get('plugins');
66
+ plugins.push(BalloonToolbar);
67
+ this.config.set('plugins', plugins);
68
+ this.config.define('balloonToolbar', this.config.get('toolbar'));
69
+ this.model.document.createRoot();
70
+ const view = new BalloonEditorUIView(this.locale, this.editing.view, this.sourceElement);
71
+ this.ui = new BalloonEditorUI(this, view);
72
+ attachToForm(this);
73
+ }
74
+ /**
75
+ * Destroys the editor instance, releasing all resources used by it.
76
+ *
77
+ * Updates the original editor element with the data if the
78
+ * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
79
+ * configuration option is set to `true`.
80
+ */
81
+ destroy() {
82
+ // Cache the data, then destroy.
83
+ // It's safe to assume that the model->view conversion will not work after super.destroy().
84
+ const data = this.getData();
85
+ this.ui.destroy();
86
+ return super.destroy()
87
+ .then(() => {
88
+ if (this.sourceElement) {
89
+ this.updateSourceElement(data);
90
+ }
91
+ });
92
+ }
93
+ /**
94
+ * Creates a new balloon editor instance.
95
+ *
96
+ * There are three general ways how the editor can be initialized.
97
+ *
98
+ * # Using an existing DOM element (and loading data from it)
99
+ *
100
+ * You can initialize the editor using an existing DOM element:
101
+ *
102
+ * ```ts
103
+ * BalloonEditor
104
+ * .create( document.querySelector( '#editor' ) )
105
+ * .then( editor => {
106
+ * console.log( 'Editor was initialized', editor );
107
+ * } )
108
+ * .catch( err => {
109
+ * console.error( err.stack );
110
+ * } );
111
+ * ```
112
+ *
113
+ * The element's content will be used as the editor data and the element will become the editable element.
114
+ *
115
+ * # Creating a detached editor
116
+ *
117
+ * Alternatively, you can initialize the editor by passing the initial data directly as a string.
118
+ * In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:
119
+ *
120
+ * ```ts
121
+ * BalloonEditor
122
+ * .create( '<p>Hello world!</p>' )
123
+ * .then( editor => {
124
+ * console.log( 'Editor was initialized', editor );
125
+ *
126
+ * // Initial data was provided so the editor UI element needs to be added manually to the DOM.
127
+ * document.body.appendChild( editor.ui.element );
128
+ * } )
129
+ * .catch( err => {
130
+ * console.error( err.stack );
131
+ * } );
132
+ * ```
133
+ *
134
+ * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
135
+ * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
136
+ *
137
+ * # Using an existing DOM element (and data provided in `config.initialData`)
138
+ *
139
+ * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
140
+ *
141
+ * ```ts
142
+ * BalloonEditor
143
+ * .create( document.querySelector( '#editor' ), {
144
+ * initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
145
+ * } )
146
+ * .then( editor => {
147
+ * console.log( 'Editor was initialized', editor );
148
+ * } )
149
+ * .catch( err => {
150
+ * console.error( err.stack );
151
+ * } );
152
+ * ```
153
+ *
154
+ * This method can be used to initialize the editor on an existing element with the specified content in case if your integration
155
+ * makes it difficult to set the content of the source element.
156
+ *
157
+ * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
158
+ *
159
+ * # Configuring the editor
160
+ *
161
+ * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
162
+ * customizing plugins, toolbar and more.
163
+ *
164
+ * # Using the editor from source
165
+ *
166
+ * The code samples listed in the previous sections of this documentation assume that you are using an
167
+ * {@glink installation/getting-started/predefined-builds editor build} (for example `@ckeditor/ckeditor5-build-balloon`).
168
+ *
169
+ * If you want to use the balloon editor from source (`@ckeditor/ckeditor5-editor-balloon/src/ballooneditor`),
170
+ * you need to define the list of
171
+ * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
172
+ * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
173
+ * source in the {@glink installation/advanced/alternative-setups/integrating-from-source dedicated guide}.
174
+ *
175
+ * @param sourceElementOrData The DOM element that will be the source for the created editor
176
+ * or the editor's initial data.
177
+ *
178
+ * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
179
+ * The editor data will be set back to the original element once the editor is destroyed only if the
180
+ * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
181
+ * option is set to `true`.
182
+ *
183
+ * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
184
+ * It is available under the {@link module:editor-balloon/ballooneditorui~BalloonEditorUI#element `editor.ui.element`} property.
185
+ *
186
+ * @param config The editor configuration.
187
+ * @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
188
+ */
189
+ static create(sourceElementOrData, config = {}) {
190
+ return new Promise(resolve => {
191
+ if (isElement(sourceElementOrData) && sourceElementOrData.tagName === 'TEXTAREA') {
192
+ // Documented in core/editor/editor.js
193
+ // eslint-disable-next-line ckeditor5-rules/ckeditor-error-message
194
+ throw new CKEditorError('editor-wrong-element', null);
195
+ }
196
+ const editor = new this(sourceElementOrData, config);
197
+ resolve(editor.initPlugins()
198
+ .then(() => editor.ui.init())
199
+ .then(() => editor.data.init(editor.config.get('initialData')))
200
+ .then(() => editor.fire('ready'))
201
+ .then(() => editor));
202
+ });
203
+ }
204
+ }
205
+ function getInitialData(sourceElementOrData) {
206
+ return isElement(sourceElementOrData) ? getDataFromElement(sourceElementOrData) : sourceElementOrData;
228
207
  }
229
-
230
- mix( BalloonEditor, DataApiMixin );
231
- mix( BalloonEditor, ElementApiMixin );
232
-
233
- function getInitialData( sourceElementOrData ) {
234
- return isElement( sourceElementOrData ) ? getDataFromElement( sourceElementOrData ) : sourceElementOrData;
208
+ function isElement(value) {
209
+ return _isElement(value);
235
210
  }
@@ -1,122 +1,90 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, 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
-
6
- /**
7
- * @module editor-balloon/ballooneditorui
8
- */
9
-
10
- import { EditorUI } from 'ckeditor5/src/core';
5
+ import { EditorUI } from 'ckeditor5/src/ui';
11
6
  import { enablePlaceholder } from 'ckeditor5/src/engine';
12
-
13
7
  /**
14
8
  * The balloon editor UI class.
15
- *
16
- * @extends module:core/editor/editorui~EditorUI
17
9
  */
18
10
  export default class BalloonEditorUI extends EditorUI {
19
- /**
20
- * Creates an instance of the balloon editor UI class.
21
- *
22
- * @param {module:core/editor/editor~Editor} editor The editor instance.
23
- * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.
24
- */
25
- constructor( editor, view ) {
26
- super( editor );
27
-
28
- /**
29
- * The main (top–most) view of the editor UI.
30
- *
31
- * @readonly
32
- * @member {module:ui/editorui/editoruiview~EditorUIView} #view
33
- */
34
- this.view = view;
35
- }
36
-
37
- /**
38
- * @inheritDoc
39
- */
40
- get element() {
41
- return this.view.editable.element;
42
- }
43
-
44
- /**
45
- * Initializes the UI.
46
- */
47
- init() {
48
- const editor = this.editor;
49
- const view = this.view;
50
- const editingView = editor.editing.view;
51
- const editable = view.editable;
52
- const editingRoot = editingView.document.getRoot();
53
-
54
- // The editable UI and editing root should share the same name. Then name is used
55
- // to recognize the particular editable, for instance in ARIA attributes.
56
- editable.name = editingRoot.rootName;
57
-
58
- view.render();
59
-
60
- // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
61
- // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
62
- const editableElement = editable.element;
63
-
64
- // Register the editable UI view in the editor. A single editor instance can aggregate multiple
65
- // editable areas (roots) but the balloon editor has only one.
66
- this.setEditableElement( editable.name, editableElement );
67
-
68
- // Let the editable UI element respond to the changes in the global editor focus
69
- // tracker. It has been added to the same tracker a few lines above but, in reality, there are
70
- // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
71
- // as they have focus, the editable should act like it is focused too (although technically
72
- // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
73
- // Doing otherwise will result in editable focus styles disappearing, once e.g. the
74
- // toolbar gets focused.
75
- editable.bind( 'isFocused' ).to( this.focusTracker );
76
-
77
- // Bind the editable UI element to the editing view, making it an end– and entry–point
78
- // of the editor's engine. This is where the engine meets the UI.
79
- editingView.attachDomRoot( editableElement );
80
-
81
- this._initPlaceholder();
82
- this.fire( 'ready' );
83
- }
84
-
85
- /**
86
- * @inheritDoc
87
- */
88
- destroy() {
89
- super.destroy();
90
-
91
- const view = this.view;
92
- const editingView = this.editor.editing.view;
93
-
94
- editingView.detachDomRoot( view.editable.name );
95
- view.destroy();
96
- }
97
-
98
- /**
99
- * Enable the placeholder text on the editing root, if any was configured.
100
- *
101
- * @private
102
- */
103
- _initPlaceholder() {
104
- const editor = this.editor;
105
- const editingView = editor.editing.view;
106
- const editingRoot = editingView.document.getRoot();
107
- const sourceElement = editor.sourceElement;
108
-
109
- const placeholderText = editor.config.get( 'placeholder' ) ||
110
- sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );
111
-
112
- if ( placeholderText ) {
113
- enablePlaceholder( {
114
- view: editingView,
115
- element: editingRoot,
116
- text: placeholderText,
117
- isDirectHost: false,
118
- keepOnFocus: true
119
- } );
120
- }
121
- }
11
+ /**
12
+ * Creates an instance of the balloon editor UI class.
13
+ *
14
+ * @param editor The editor instance.
15
+ * @param view The view of the UI.
16
+ */
17
+ constructor(editor, view) {
18
+ super(editor);
19
+ this.view = view;
20
+ }
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ get element() {
25
+ return this.view.editable.element;
26
+ }
27
+ /**
28
+ * Initializes the UI.
29
+ */
30
+ init() {
31
+ const editor = this.editor;
32
+ const view = this.view;
33
+ const editingView = editor.editing.view;
34
+ const editable = view.editable;
35
+ const editingRoot = editingView.document.getRoot();
36
+ // The editable UI and editing root should share the same name. Then name is used
37
+ // to recognize the particular editable, for instance in ARIA attributes.
38
+ editable.name = editingRoot.rootName;
39
+ view.render();
40
+ // The editable UI element in DOM is available for sure only after the editor UI view has been rendered.
41
+ // But it can be available earlier if a DOM element has been passed to BalloonEditor.create().
42
+ const editableElement = editable.element;
43
+ // Register the editable UI view in the editor. A single editor instance can aggregate multiple
44
+ // editable areas (roots) but the balloon editor has only one.
45
+ this.setEditableElement(editable.name, editableElement);
46
+ // Let the editable UI element respond to the changes in the global editor focus
47
+ // tracker. It has been added to the same tracker a few lines above but, in reality, there are
48
+ // many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
49
+ // as they have focus, the editable should act like it is focused too (although technically
50
+ // it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.
51
+ // Doing otherwise will result in editable focus styles disappearing, once e.g. the
52
+ // toolbar gets focused.
53
+ editable.bind('isFocused').to(this.focusTracker);
54
+ // Bind the editable UI element to the editing view, making it an end– and entry–point
55
+ // of the editor's engine. This is where the engine meets the UI.
56
+ editingView.attachDomRoot(editableElement);
57
+ this._initPlaceholder();
58
+ this.fire('ready');
59
+ }
60
+ /**
61
+ * @inheritDoc
62
+ */
63
+ destroy() {
64
+ super.destroy();
65
+ const view = this.view;
66
+ const editingView = this.editor.editing.view;
67
+ editingView.detachDomRoot(view.editable.name);
68
+ view.destroy();
69
+ }
70
+ /**
71
+ * Enable the placeholder text on the editing root, if any was configured.
72
+ */
73
+ _initPlaceholder() {
74
+ const editor = this.editor;
75
+ const editingView = editor.editing.view;
76
+ const editingRoot = editingView.document.getRoot();
77
+ const sourceElement = editor.sourceElement;
78
+ const placeholderText = editor.config.get('placeholder') ||
79
+ sourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute('placeholder');
80
+ if (placeholderText) {
81
+ enablePlaceholder({
82
+ view: editingView,
83
+ element: editingRoot,
84
+ text: placeholderText,
85
+ isDirectHost: false,
86
+ keepOnFocus: true
87
+ });
88
+ }
89
+ }
122
90
  }
@@ -1,52 +1,37 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, 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
-
6
5
  /**
7
6
  * @module editor-balloon/ballooneditoruiview
8
7
  */
9
-
10
8
  import { EditorUIView, InlineEditableUIView } from 'ckeditor5/src/ui';
11
-
12
9
  /**
13
10
  * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}.
14
- *
15
- * @extends module:ui/editorui/editoruiview~EditorUIView
16
11
  */
17
12
  export default class BalloonEditorUIView extends EditorUIView {
18
- /**
19
- * Creates an instance of the balloon editor UI view.
20
- *
21
- * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.
22
- * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.
23
- * @param {HTMLElement} [editableElement] The editable element. If not specified, it will be automatically created by
24
- * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.
25
- */
26
- constructor( locale, editingView, editableElement ) {
27
- super( locale );
28
-
29
- const t = locale.t;
30
-
31
- /**
32
- * The editable UI view.
33
- *
34
- * @readonly
35
- * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
36
- */
37
- this.editable = new InlineEditableUIView( locale, editingView, editableElement, {
38
- label: editableView => {
39
- return t( 'Rich Text Editor. Editing area: %0', editableView.name );
40
- }
41
- } );
42
- }
43
-
44
- /**
45
- * @inheritDoc
46
- */
47
- render() {
48
- super.render();
49
-
50
- this.registerChild( this.editable );
51
- }
13
+ /**
14
+ * Creates an instance of the balloon editor UI view.
15
+ *
16
+ * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
17
+ * @param editingView The editing view instance this view is related to.
18
+ * @param editableElement The editable element. If not specified, it will be automatically created by
19
+ * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.
20
+ */
21
+ constructor(locale, editingView, editableElement) {
22
+ super(locale);
23
+ const t = locale.t;
24
+ this.editable = new InlineEditableUIView(locale, editingView, editableElement, {
25
+ label: editableView => {
26
+ return t('Rich Text Editor. Editing area: %0', editableView.name);
27
+ }
28
+ });
29
+ }
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ render() {
34
+ super.render();
35
+ this.registerChild(this.editable);
36
+ }
52
37
  }
package/src/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, 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
-
6
5
  /**
7
6
  * @module editor-balloon
8
7
  */
9
-
10
8
  export { default as BalloonEditor } from './ballooneditor';
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-balloon.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE8G;AAC5D;AAC2B;;AAEvC;;AAEU;AACQ;;AAExD;AACA,QAAQ;AACR;AACA,0DAA0D,8DAA8D;AACxH,YAAY,2CAA2C;AACvD;AACA;AACA,IAAI,yFAAyF;AAC7F;AACA;AACA;AACA;AACA;AACA,oCAAoC,mFAAmF;AACvH;AACA,IAAI;AACJ;AACA;AACA,iBAAiB,6EAA6E;AAC9F;AACA;AACA;AACA,IAAI,wFAAwF;AAC5F;AACA;AACA;AACA;AACA;AACA;AACe,4BAA4B,sDAAM;AACjD;AACA;AACA;AACA;AACA,KAAK,yFAAyF;AAC9F;AACA;AACA,YAAY,oBAAoB;AAChC;AACA,KAAK,wFAAwF;AAC7F,YAAY,8CAA8C;AAC1D;AACA,+CAA+C;AAC/C;AACA,QAAQ,qDAAS;AACjB;AACA;AACA,aAAa,8DAAa;AAC1B;;AAEA;;AAEA;AACA;AACA;;AAEA,OAAO,qDAAS;AAChB;AACA,GAAG,uEAAmB;AACtB;;AAEA;AACA,gBAAgB,4DAAc;;AAE9B;;AAEA;;AAEA;;AAEA,mBAAmB,4DAAmB;AACtC,gBAAgB,wDAAe;;AAE/B,EAAE,gEAAY;AACd;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uFAAuF;AACpG;AACA;AACA;AACA;AACA;AACA,KAAK,oEAAoE;AACzE;AACA;AACA;AACA,KAAK,sFAAsF;AAC3F,KAAK,yEAAyE;AAC9E,mBAAmB,wFAAwF;AAC3G;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,yFAAyF;AACxH;AACA,YAAY,8CAA8C;AAC1D,cAAc,SAAS;AACvB;AACA,iDAAiD;AACjD;AACA,QAAQ,qDAAS;AACjB;AACA;AACA,cAAc,8DAAa;AAC3B;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA,wDAAG,iBAAiB,4DAAY;AAChC,wDAAG,iBAAiB,+DAAe;;AAEnC;AACA,QAAQ,qDAAS,0BAA0B,uEAAkB;AAC7D;;;;;;;;;;;;;;;;;;AC1OA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE8C;AACW;;AAEzD;AACA;AACA;AACA;AACA;AACe,8BAA8B,wDAAQ;AACrD;AACA;AACA;AACA,YAAY,kCAAkC;AAC9C,YAAY,8CAA8C;AAC1D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc,8CAA8C;AAC5D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG,uEAAiB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;;;;;;ACzHA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEsE;;AAEtE;AACA,wCAAwC,4EAA4E;AACpH;AACA;AACA;AACe,kCAAkC,0DAAY;AAC7D;AACA;AACA;AACA,YAAY,4BAA4B,YAAY,+CAA+C;AACnG,YAAY,8BAA8B;AAC1C,YAAY,aAAa;AACzB,KAAK,yDAAyD;AAC9D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,sBAAsB,kEAAoB;AAC1C;AACA;AACA;AACA,IAAI;AACJ;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;ACnDA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;;;;;;;ACA8B;;AAE9B;AACA,aAAa,uDAAW;;AAExB,iEAAe,MAAM,EAAC;;;;;;;;;;;;;;;;;;;ACLY;AACM;AACU;;AAElD;AACA;AACA;;AAEA;AACA,qBAAqB,kDAAM,GAAG,8DAAkB;;AAEhD;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,yDAAS;AACf,MAAM,8DAAc;AACpB;;AAEA,iEAAe,UAAU,EAAC;;;;;;;;;;;;;;;;AC3B1B;AACA;;AAEA,iEAAe,UAAU,EAAC;;;;;;;;;;;;;;;;;ACHU;;AAEpC;AACA,mBAAmB,uDAAO;;AAE1B,iEAAe,YAAY,EAAC;;;;;;;;;;;;;;;;;ACLM;;AAElC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB,kDAAM,GAAG,8DAAkB;;AAEhD;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;;AAEJ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA,iEAAe,SAAS,EAAC;;;;;;;;;;;;;;;;AC7CzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA,iEAAe,cAAc,EAAC;;;;;;;;;;;;;;;;ACrB9B;AACA;AACA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,aAAa,UAAU;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,OAAO,EAAC;;;;;;;;;;;;;;;;;ACdmB;;AAE1C;AACA;;AAEA;AACA,WAAW,sDAAU;;AAErB,iEAAe,IAAI,EAAC;;;;;;;;;;;;;;;;;;ACRyB;AACE;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4DAAY,oCAAoC,6DAAa;AACtE;;AAEA,iEAAe,SAAS,EAAC;;;;;;;;;;;;;;;;ACxBzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,YAAY,EAAC;;;;;;;;;;;;;;;;;;;AC5Bc;AACI;AACD;;AAE7C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,GAAG;AACd,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,gBAAgB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,4DAAY,WAAW,0DAAU;AACxC;AACA;AACA,cAAc,4DAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,aAAa,EAAC;;;;;;;UC7D7B;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAE2D","sources":["webpack://CKEditor5.editorBalloon/./src/ballooneditor.js","webpack://CKEditor5.editorBalloon/./src/ballooneditorui.js","webpack://CKEditor5.editorBalloon/./src/ballooneditoruiview.js","webpack://CKEditor5.editorBalloon/delegated \"./src/core.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.editorBalloon/delegated \"./src/engine.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.editorBalloon/delegated \"./src/ui.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.editorBalloon/delegated \"./src/utils.js\" from dll-reference CKEditor5.dll","webpack://CKEditor5.editorBalloon/external var \"CKEditor5.dll\"","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_Symbol.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_baseGetTag.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_freeGlobal.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_getPrototype.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_getRawTag.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_objectToString.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_overArg.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/_root.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/isElement.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/isObjectLike.js","webpack://CKEditor5.editorBalloon/../../node_modules/lodash-es/isPlainObject.js","webpack://CKEditor5.editorBalloon/webpack/bootstrap","webpack://CKEditor5.editorBalloon/webpack/runtime/define property getters","webpack://CKEditor5.editorBalloon/webpack/runtime/hasOwnProperty shorthand","webpack://CKEditor5.editorBalloon/webpack/runtime/make namespace object","webpack://CKEditor5.editorBalloon/./src/index.js"],"sourcesContent":["/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module editor-balloon/ballooneditor\n */\n\nimport { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core';\nimport { BalloonToolbar } from 'ckeditor5/src/ui';\nimport { CKEditorError, getDataFromElement, mix } from 'ckeditor5/src/utils';\n\nimport { isElement } from 'lodash-es';\n\nimport BalloonEditorUI from './ballooneditorui';\nimport BalloonEditorUIView from './ballooneditoruiview';\n\n/**\n * The {@glink installation/getting-started/predefined-builds#balloon-editor balloon editor}\n * implementation (Medium-like editor).\n * It uses an inline editable and a toolbar based on the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}.\n * See the {@glink examples/builds/balloon-editor demo}.\n *\n * In order to create a balloon editor instance, use the static\n * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method.\n *\n * # Balloon editor and balloon build\n *\n * The balloon editor can be used directly from source (if you installed the\n * [`@ckeditor/ckeditor5-editor-balloon`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-balloon) package)\n * but it is also available in the {@glink installation/getting-started/predefined-builds#balloon-editor balloon build}.\n *\n * {@glink installation/getting-started/predefined-builds Builds}\n * are ready-to-use editors with plugins bundled in. When using the editor from\n * source you need to take care of loading all plugins by yourself\n * (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).\n * Using the editor from source gives much better flexibility and allows easier customization.\n *\n * Read more about initializing the editor from source or as a build in\n * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.\n *\n * @mixes module:core/editor/utils/dataapimixin~DataApiMixin\n * @mixes module:core/editor/utils/elementapimixin~ElementApiMixin\n * @implements module:core/editor/editorwithui~EditorWithUI\n * @extends module:core/editor/editor~Editor\n */\nexport default class BalloonEditor extends Editor {\n\t/**\n\t * Creates an instance of the balloon editor.\n\t *\n\t * **Note:** do not use the constructor to create editor instances. Use the static\n\t * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`} method instead.\n\t *\n\t * @protected\n\t * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor\n\t * (on which the editor will be initialized) or initial data for the editor. For more information see\n\t * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}.\n\t * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.\n\t */\n\tconstructor( sourceElementOrData, config = {} ) {\n\t\t// If both `config.initialData` is set and initial data is passed as the constructor parameter, then throw.\n\t\tif ( !isElement( sourceElementOrData ) && config.initialData !== undefined ) {\n\t\t\t// Documented in core/editor/editorconfig.jsdoc.\n\t\t\t// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message\n\t\t\tthrow new CKEditorError( 'editor-create-initial-data', null );\n\t\t}\n\n\t\tsuper( config );\n\n\t\tif ( this.config.get( 'initialData' ) === undefined ) {\n\t\t\tthis.config.set( 'initialData', getInitialData( sourceElementOrData ) );\n\t\t}\n\n\t\tif ( isElement( sourceElementOrData ) ) {\n\t\t\tthis.sourceElement = sourceElementOrData;\n\t\t\tsecureSourceElement( this );\n\t\t}\n\n\t\tconst plugins = this.config.get( 'plugins' );\n\t\tplugins.push( BalloonToolbar );\n\n\t\tthis.config.set( 'plugins', plugins );\n\n\t\tthis.config.define( 'balloonToolbar', this.config.get( 'toolbar' ) );\n\n\t\tthis.model.document.createRoot();\n\n\t\tconst view = new BalloonEditorUIView( this.locale, this.editing.view, this.sourceElement );\n\t\tthis.ui = new BalloonEditorUI( this, view );\n\n\t\tattachToForm( this );\n\t}\n\n\t/**\n\t * Destroys the editor instance, releasing all resources used by it.\n\t *\n\t * Updates the original editor element with the data if the\n\t * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}\n\t * configuration option is set to `true`.\n\t *\n\t * @returns {Promise}\n\t */\n\tdestroy() {\n\t\t// Cache the data, then destroy.\n\t\t// It's safe to assume that the model->view conversion will not work after super.destroy().\n\t\tconst data = this.getData();\n\n\t\tthis.ui.destroy();\n\n\t\treturn super.destroy()\n\t\t\t.then( () => {\n\t\t\t\tif ( this.sourceElement ) {\n\t\t\t\t\tthis.updateSourceElement( data );\n\t\t\t\t}\n\t\t\t} );\n\t}\n\n\t/**\n\t * Creates a new balloon editor instance.\n\t *\n\t * There are three general ways how the editor can be initialized.\n\t *\n\t * # Using an existing DOM element (and loading data from it)\n\t *\n\t * You can initialize the editor using an existing DOM element:\n\t *\n\t *\t\tBalloonEditor\n\t *\t\t\t.create( document.querySelector( '#editor' ) )\n\t *\t\t\t.then( editor => {\n\t *\t\t\t\tconsole.log( 'Editor was initialized', editor );\n\t *\t\t\t} )\n\t *\t\t\t.catch( err => {\n\t *\t\t\t\tconsole.error( err.stack );\n\t *\t\t\t} );\n\t *\n\t * The element's content will be used as the editor data and the element will become the editable element.\n\t *\n\t * # Creating a detached editor\n\t *\n\t * Alternatively, you can initialize the editor by passing the initial data directly as a string.\n\t * In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:\n\t *\n\t *\t\tBalloonEditor\n\t *\t\t\t.create( '<p>Hello world!</p>' )\n\t *\t\t\t.then( editor => {\n\t *\t\t\t\tconsole.log( 'Editor was initialized', editor );\n\t *\n\t *\t\t\t\t// Initial data was provided so the editor UI element needs to be added manually to the DOM.\n\t *\t\t\t\tdocument.body.appendChild( editor.ui.element );\n\t *\t\t\t} )\n\t *\t\t\t.catch( err => {\n\t *\t\t\t\tconsole.error( err.stack );\n\t *\t\t\t} );\n\t *\n\t * This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your\n\t * web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.\n\t *\n\t * # Using an existing DOM element (and data provided in `config.initialData`)\n\t *\n\t * You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:\n\t *\n\t *\t\tBalloonEditor\n\t *\t\t\t.create( document.querySelector( '#editor' ), {\n\t *\t\t\t\tinitialData: '<h2>Initial data</h2><p>Foo bar.</p>'\n\t *\t\t\t} )\n\t *\t\t\t.then( editor => {\n\t *\t\t\t\tconsole.log( 'Editor was initialized', editor );\n\t *\t\t\t} )\n\t *\t\t\t.catch( err => {\n\t *\t\t\t\tconsole.error( err.stack );\n\t *\t\t\t} );\n\t *\n\t * This method can be used to initialize the editor on an existing element with the specified content in case if your integration\n\t * makes it difficult to set the content of the source element.\n\t *\n\t * Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.\n\t *\n\t * # Configuring the editor\n\t *\n\t * See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about\n\t * customizing plugins, toolbar and more.\n\t *\n\t * # Using the editor from source\n\t *\n\t * The code samples listed in the previous sections of this documentation assume that you are using an\n\t * {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-balloon`).\n\t *\n\t * If you want to use the balloon editor from source (`@ckeditor/ckeditor5-editor-balloon/src/ballooneditor`),\n\t * you need to define the list of\n\t * {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and\n\t * {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from\n\t * source in the {@glink installation/advanced/alternative-setups/integrating-from-source dedicated guide}.\n\t *\n\t * @param {HTMLElement|String} sourceElementOrData The DOM element that will be the source for the created editor\n\t * or the editor's initial data.\n\t *\n\t * If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.\n\t * The editor data will be set back to the original element once the editor is destroyed only if the\n\t * {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}\n\t * option is set to `true`.\n\t *\n\t * If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.\n\t * It is available under the {@link module:editor-balloon/ballooneditorui~BalloonEditorUI#element `editor.ui.element`} property.\n\t *\n\t * @param {module:core/editor/editorconfig~EditorConfig} [config] The editor configuration.\n\t * @returns {Promise} A promise resolved once the editor is ready. The promise resolves with the created editor instance.\n\t */\n\tstatic create( sourceElementOrData, config = {} ) {\n\t\treturn new Promise( resolve => {\n\t\t\tif ( isElement( sourceElementOrData ) && sourceElementOrData.tagName === 'TEXTAREA' ) {\n\t\t\t\t// Documented in core/editor/editor.js\n\t\t\t\t// eslint-disable-next-line ckeditor5-rules/ckeditor-error-message\n\t\t\t\tthrow new CKEditorError( 'editor-wrong-element', null );\n\t\t\t}\n\n\t\t\tconst editor = new this( sourceElementOrData, config );\n\n\t\t\tresolve(\n\t\t\t\teditor.initPlugins()\n\t\t\t\t\t.then( () => editor.ui.init() )\n\t\t\t\t\t.then( () => editor.data.init( editor.config.get( 'initialData' ) ) )\n\t\t\t\t\t.then( () => editor.fire( 'ready' ) )\n\t\t\t\t\t.then( () => editor )\n\t\t\t);\n\t\t} );\n\t}\n}\n\nmix( BalloonEditor, DataApiMixin );\nmix( BalloonEditor, ElementApiMixin );\n\nfunction getInitialData( sourceElementOrData ) {\n\treturn isElement( sourceElementOrData ) ? getDataFromElement( sourceElementOrData ) : sourceElementOrData;\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module editor-balloon/ballooneditorui\n */\n\nimport { EditorUI } from 'ckeditor5/src/core';\nimport { enablePlaceholder } from 'ckeditor5/src/engine';\n\n/**\n * The balloon editor UI class.\n *\n * @extends module:core/editor/editorui~EditorUI\n */\nexport default class BalloonEditorUI extends EditorUI {\n\t/**\n\t * Creates an instance of the balloon editor UI class.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor The editor instance.\n\t * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.\n\t */\n\tconstructor( editor, view ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * The main (top–most) view of the editor UI.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/editorui/editoruiview~EditorUIView} #view\n\t\t */\n\t\tthis.view = view;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget element() {\n\t\treturn this.view.editable.element;\n\t}\n\n\t/**\n\t * Initializes the UI.\n\t */\n\tinit() {\n\t\tconst editor = this.editor;\n\t\tconst view = this.view;\n\t\tconst editingView = editor.editing.view;\n\t\tconst editable = view.editable;\n\t\tconst editingRoot = editingView.document.getRoot();\n\n\t\t// The editable UI and editing root should share the same name. Then name is used\n\t\t// to recognize the particular editable, for instance in ARIA attributes.\n\t\teditable.name = editingRoot.rootName;\n\n\t\tview.render();\n\n\t\t// The editable UI element in DOM is available for sure only after the editor UI view has been rendered.\n\t\t// But it can be available earlier if a DOM element has been passed to BalloonEditor.create().\n\t\tconst editableElement = editable.element;\n\n\t\t// Register the editable UI view in the editor. A single editor instance can aggregate multiple\n\t\t// editable areas (roots) but the balloon editor has only one.\n\t\tthis.setEditableElement( editable.name, editableElement );\n\n\t\t// Let the editable UI element respond to the changes in the global editor focus\n\t\t// tracker. It has been added to the same tracker a few lines above but, in reality, there are\n\t\t// many focusable areas in the editor, like balloons, toolbars or dropdowns and as long\n\t\t// as they have focus, the editable should act like it is focused too (although technically\n\t\t// it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.\n\t\t// Doing otherwise will result in editable focus styles disappearing, once e.g. the\n\t\t// toolbar gets focused.\n\t\teditable.bind( 'isFocused' ).to( this.focusTracker );\n\n\t\t// Bind the editable UI element to the editing view, making it an end– and entry–point\n\t\t// of the editor's engine. This is where the engine meets the UI.\n\t\teditingView.attachDomRoot( editableElement );\n\n\t\tthis._initPlaceholder();\n\t\tthis.fire( 'ready' );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\n\t\tconst view = this.view;\n\t\tconst editingView = this.editor.editing.view;\n\n\t\teditingView.detachDomRoot( view.editable.name );\n\t\tview.destroy();\n\t}\n\n\t/**\n\t * Enable the placeholder text on the editing root, if any was configured.\n\t *\n\t * @private\n\t */\n\t_initPlaceholder() {\n\t\tconst editor = this.editor;\n\t\tconst editingView = editor.editing.view;\n\t\tconst editingRoot = editingView.document.getRoot();\n\t\tconst sourceElement = editor.sourceElement;\n\n\t\tconst placeholderText = editor.config.get( 'placeholder' ) ||\n\t\t\tsourceElement && sourceElement.tagName.toLowerCase() === 'textarea' && sourceElement.getAttribute( 'placeholder' );\n\n\t\tif ( placeholderText ) {\n\t\t\tenablePlaceholder( {\n\t\t\t\tview: editingView,\n\t\t\t\telement: editingRoot,\n\t\t\t\ttext: placeholderText,\n\t\t\t\tisDirectHost: false,\n\t\t\t\tkeepOnFocus: true\n\t\t\t} );\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module editor-balloon/ballooneditoruiview\n */\n\nimport { EditorUIView, InlineEditableUIView } from 'ckeditor5/src/ui';\n\n/**\n * Contextual editor UI view. Uses the {@link module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}.\n *\n * @extends module:ui/editorui/editoruiview~EditorUIView\n */\nexport default class BalloonEditorUIView extends EditorUIView {\n\t/**\n\t * Creates an instance of the balloon editor UI view.\n\t *\n\t * @param {module:utils/locale~Locale} locale The {@link module:core/editor/editor~Editor#locale} instance.\n\t * @param {module:engine/view/view~View} editingView The editing view instance this view is related to.\n\t * @param {HTMLElement} [editableElement] The editable element. If not specified, it will be automatically created by\n\t * {@link module:ui/editableui/editableuiview~EditableUIView}. Otherwise, the given element will be used.\n\t */\n\tconstructor( locale, editingView, editableElement ) {\n\t\tsuper( locale );\n\n\t\tconst t = locale.t;\n\n\t\t/**\n\t\t * The editable UI view.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}\n\t\t */\n\t\tthis.editable = new InlineEditableUIView( locale, editingView, editableElement, {\n\t\t\tlabel: editableView => {\n\t\t\t\treturn t( 'Rich Text Editor. Editing area: %0', editableView.name );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\trender() {\n\t\tsuper.render();\n\n\t\tthis.registerChild( this.editable );\n\t}\n}\n","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/core.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/engine.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/ui.js\");","module.exports = (__webpack_require__(/*! dll-reference CKEditor5.dll */ \"dll-reference CKEditor5.dll\"))(\"./src/utils.js\");","module.exports = CKEditor5.dll;","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import isObjectLike from './isObjectLike.js';\nimport isPlainObject from './isPlainObject.js';\n\n/**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('<body>');\n * // => false\n */\nfunction isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n}\n\nexport default isElement;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module editor-balloon\n */\n\nexport { default as BalloonEditor } from './ballooneditor';\n"],"names":[],"sourceRoot":""}