@ckeditor/ckeditor5-editor-balloon 34.2.0 → 35.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +170 -0
- package/LICENSE.md +4 -0
- package/build/editor-balloon.js +1 -1
- package/package.json +16 -14
- package/src/ballooneditor.js +12 -8
- package/src/ballooneditorui.js +0 -20
- package/src/ballooneditoruiview.js +7 -1
package/CHANGELOG.md
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
Changelog
|
2
|
+
=========
|
3
|
+
|
4
|
+
All changes in the package are documented in the main repository. See: https://github.com/ckeditor/ckeditor5/blob/master/CHANGELOG.md.
|
5
|
+
|
6
|
+
Changes for the past releases are available below.
|
7
|
+
|
8
|
+
## [19.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v18.0.0...v19.0.0) (2020-04-29)
|
9
|
+
|
10
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
11
|
+
|
12
|
+
|
13
|
+
## [18.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v17.0.0...v18.0.0) (2020-03-19)
|
14
|
+
|
15
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
16
|
+
|
17
|
+
|
18
|
+
## [17.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v16.0.0...v17.0.0) (2020-02-19)
|
19
|
+
|
20
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
21
|
+
|
22
|
+
|
23
|
+
## [16.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v15.0.0...v16.0.0) (2019-12-04)
|
24
|
+
|
25
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
26
|
+
|
27
|
+
|
28
|
+
## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.2.2...v15.0.0) (2019-10-23)
|
29
|
+
|
30
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
31
|
+
|
32
|
+
|
33
|
+
## [12.2.2](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.2.1...v12.2.2) (2019-08-26)
|
34
|
+
|
35
|
+
### Other changes
|
36
|
+
|
37
|
+
* The issue tracker for this package was moved to https://github.com/ckeditor/ckeditor5/issues. See [ckeditor/ckeditor5#1988](https://github.com/ckeditor/ckeditor5/issues/1988). ([36f5ae9](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/36f5ae9))
|
38
|
+
* Introduced a check that prevents sharing source elements between editor instances. See [ckeditor/ckeditor5#746](https://github.com/ckeditor/ckeditor5/issues/746). ([5159981](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/5159981))
|
39
|
+
|
40
|
+
|
41
|
+
## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.2.0...v12.2.1) (2019-07-10)
|
42
|
+
|
43
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
44
|
+
|
45
|
+
|
46
|
+
## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.1.1...v12.2.0) (2019-07-04)
|
47
|
+
|
48
|
+
### Features
|
49
|
+
|
50
|
+
* `BalloonEditor.create()` will throw an error, when textarea element is used. ([83552e2](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/83552e2))
|
51
|
+
|
52
|
+
|
53
|
+
## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.1.0...v12.1.1) (2019-06-05)
|
54
|
+
|
55
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
56
|
+
|
57
|
+
|
58
|
+
## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v12.0.0...v12.1.0) (2019-04-10)
|
59
|
+
|
60
|
+
### Features
|
61
|
+
|
62
|
+
* Introduced `EditorConfig#initialData`. ([678528f](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/678528f))
|
63
|
+
|
64
|
+
|
65
|
+
## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v11.0.2...v12.0.0) (2019-02-28)
|
66
|
+
|
67
|
+
### Features
|
68
|
+
|
69
|
+
* Added support for the `config.placeholder` option which allows configuring the empty editor content placeholder (see [ckeditor/ckeditor5#479](https://github.com/ckeditor/ckeditor5/issues/479)). ([7f39e5e](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/7f39e5e))
|
70
|
+
|
71
|
+
### Bug fixes
|
72
|
+
|
73
|
+
* Fixed memory leaks during editor initialization and destruction (see [ckeditor/ckeditor5#1341](https://github.com/ckeditor/ckeditor5/issues/1341)). ([c959daf](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/c959daf))
|
74
|
+
|
75
|
+
### Other changes
|
76
|
+
|
77
|
+
* Adjustments to new editor initialization events. See breaking changes. ([1bb0285](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/1bb0285))
|
78
|
+
* Editor UI classes API refactoring. See breaking changes. ([dd43e7a](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/dd43e7a))
|
79
|
+
|
80
|
+
### BREAKING CHANGES
|
81
|
+
|
82
|
+
* Upgraded minimal versions of Node to `8.0.0` and npm to `5.7.1`. See: [ckeditor/ckeditor5#1507](https://github.com/ckeditor/ckeditor5/issues/1507). ([612ea3c](https://github.com/ckeditor/ckeditor5-cloud-services/commit/612ea3c))
|
83
|
+
* The second argument of `BalloonEditorUIView.constructor()` is an editing view instance now.
|
84
|
+
* The `editor#dataReady` event was removed. The `editor.data#ready` event has been introduced and should be used instead.
|
85
|
+
* The `editor#pluginsReady` event was removed. Use plugin `afterInit()` method instead.
|
86
|
+
* Removed `BalloonEditor#element` property. The `BalloonEditorUI#element` property should be used instead.
|
87
|
+
* Removed `BalloonEditorUIView#editableElement`. Instead `BalloonEditorUI#getEditableElement()` method should be used.
|
88
|
+
|
89
|
+
|
90
|
+
## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v11.0.1...v11.0.2) (2018-12-05)
|
91
|
+
|
92
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
93
|
+
|
94
|
+
|
95
|
+
## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v11.0.0...v11.0.1) (2018-10-08)
|
96
|
+
|
97
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
98
|
+
|
99
|
+
|
100
|
+
## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v10.0.1...v11.0.0) (2018-07-18)
|
101
|
+
|
102
|
+
### Features
|
103
|
+
|
104
|
+
* Editor can now be created with initial data passed to the `create()` method. Closes [#18](https://github.com/ckeditor/ckeditor5-editor-balloon/issues/18). ([48c265c](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/48c265c))
|
105
|
+
|
106
|
+
### Other changes
|
107
|
+
|
108
|
+
* Used the `EditorUI` as a parent class for the `BalloonEditorUI` (see [ckeditor/ckeditor5-core#130](https://github.com/ckeditor/ckeditor5-core/issues/130)). ([03af1c0](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/03af1c0))
|
109
|
+
|
110
|
+
### BREAKING CHANGES
|
111
|
+
|
112
|
+
* The `BalloonEditor#element` property was renamed to `BalloonEditor#sourceElement` and `BalloonEditor#updateElement()` method to `BalloonEditor#updateSourceElement()`. See [ckeditor/ckeditor5-core#64](https://github.com/ckeditor/ckeditor5-core/issues/64).
|
113
|
+
|
114
|
+
|
115
|
+
## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v10.0.0...v10.0.1) (2018-06-21)
|
116
|
+
|
117
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
118
|
+
|
119
|
+
|
120
|
+
## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
|
121
|
+
|
122
|
+
### Other changes
|
123
|
+
|
124
|
+
* Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([00d20c1](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/00d20c1))
|
125
|
+
|
126
|
+
### BREAKING CHANGES
|
127
|
+
|
128
|
+
* The license under which CKEditor 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.
|
129
|
+
|
130
|
+
|
131
|
+
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
|
132
|
+
|
133
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
134
|
+
|
135
|
+
|
136
|
+
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
|
137
|
+
|
138
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
139
|
+
|
140
|
+
|
141
|
+
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018-03-15)
|
142
|
+
|
143
|
+
### Other changes
|
144
|
+
|
145
|
+
* Migrated the editor styles to PostCSS (see [ckeditor/ckeditor5-ui#144](https://github.com/ckeditor/ckeditor5-ui/issues/144)). ([bd239e9](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/bd239e9))
|
146
|
+
|
147
|
+
|
148
|
+
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017-11-14)
|
149
|
+
|
150
|
+
### Other changes
|
151
|
+
|
152
|
+
* Aligned UI library usage to the [changes in the UI framework](https://github.com/ckeditor/ckeditor5-ui/pull/332).
|
153
|
+
|
154
|
+
|
155
|
+
## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-editor-balloon/compare/v0.1.0...v1.0.0-alpha.1) (2017-10-03)
|
156
|
+
|
157
|
+
### Other changes
|
158
|
+
|
159
|
+
* The editor name has been changed from `@ckeditor/ckeditor5-build-balloon-toolbar` to `@ckeditor/ckeditor5-build-balloon` (the class name has been changed to `BalloonEditor`). See [ckeditor/ckeditor5#546](https://github.com/ckeditor/ckeditor5/issues/546) for more information. ([5fc4f60](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/5fc4f60))
|
160
|
+
|
161
|
+
### BREAKING CHANGES
|
162
|
+
|
163
|
+
* The editor name has been changed. See [ckeditor/ckeditor5#546](https://github.com/ckeditor/ckeditor5/issues/546).
|
164
|
+
|
165
|
+
|
166
|
+
## 0.1.0 (2017-09-03)
|
167
|
+
|
168
|
+
### Features
|
169
|
+
|
170
|
+
* The first implementation of the balloon editor. Closes [#1](https://github.com/ckeditor/ckeditor5-editor-balloon/issues/1). ([a4462ac](https://github.com/ckeditor/ckeditor5-editor-balloon/commit/a4462ac))
|
package/LICENSE.md
CHANGED
@@ -11,6 +11,10 @@ Sources of Intellectual Property Included in CKEditor
|
|
11
11
|
|
12
12
|
Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
|
13
13
|
|
14
|
+
The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
|
15
|
+
|
16
|
+
* lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
17
|
+
|
14
18
|
Trademarks
|
15
19
|
----------
|
16
20
|
|
package/build/editor-balloon.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
/*!
|
2
2
|
* @license Copyright (c) 2003-2022, 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(
|
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(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.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})();
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-balloon",
|
3
|
-
"version": "
|
3
|
+
"version": "35.1.0",
|
4
4
|
"description": "Balloon editor implementation for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -11,22 +11,23 @@
|
|
11
11
|
],
|
12
12
|
"main": "src/index.js",
|
13
13
|
"dependencies": {
|
14
|
-
"ckeditor5": "^
|
14
|
+
"ckeditor5": "^35.1.0",
|
15
15
|
"lodash-es": "^4.17.15"
|
16
16
|
},
|
17
17
|
"devDependencies": {
|
18
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
19
|
-
"@ckeditor/ckeditor5-core": "^
|
18
|
+
"@ckeditor/ckeditor5-basic-styles": "^35.1.0",
|
19
|
+
"@ckeditor/ckeditor5-core": "^35.1.0",
|
20
20
|
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
21
|
-
"@ckeditor/ckeditor5-engine": "^
|
22
|
-
"@ckeditor/ckeditor5-enter": "^
|
23
|
-
"@ckeditor/ckeditor5-heading": "^
|
24
|
-
"@ckeditor/ckeditor5-
|
25
|
-
"@ckeditor/ckeditor5-
|
26
|
-
"@ckeditor/ckeditor5-
|
27
|
-
"@ckeditor/ckeditor5-
|
28
|
-
"@ckeditor/ckeditor5-
|
29
|
-
"@ckeditor/ckeditor5-
|
21
|
+
"@ckeditor/ckeditor5-engine": "^35.1.0",
|
22
|
+
"@ckeditor/ckeditor5-enter": "^35.1.0",
|
23
|
+
"@ckeditor/ckeditor5-heading": "^35.1.0",
|
24
|
+
"@ckeditor/ckeditor5-image": "^35.1.0",
|
25
|
+
"@ckeditor/ckeditor5-paragraph": "^35.1.0",
|
26
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.1.0",
|
27
|
+
"@ckeditor/ckeditor5-typing": "^35.1.0",
|
28
|
+
"@ckeditor/ckeditor5-ui": "^35.1.0",
|
29
|
+
"@ckeditor/ckeditor5-undo": "^35.1.0",
|
30
|
+
"@ckeditor/ckeditor5-utils": "^35.1.0",
|
30
31
|
"webpack": "^5.58.1",
|
31
32
|
"webpack-cli": "^4.9.0"
|
32
33
|
},
|
@@ -48,7 +49,8 @@
|
|
48
49
|
"src",
|
49
50
|
"theme",
|
50
51
|
"build",
|
51
|
-
"ckeditor5-metadata.json"
|
52
|
+
"ckeditor5-metadata.json",
|
53
|
+
"CHANGELOG.md"
|
52
54
|
],
|
53
55
|
"scripts": {
|
54
56
|
"dll:build": "webpack"
|
package/src/ballooneditor.js
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
import { Editor, DataApiMixin, ElementApiMixin, attachToForm, secureSourceElement } from 'ckeditor5/src/core';
|
11
11
|
import { BalloonToolbar } from 'ckeditor5/src/ui';
|
12
|
-
import { CKEditorError,
|
12
|
+
import { CKEditorError, getDataFromElement, mix } from 'ckeditor5/src/utils';
|
13
13
|
|
14
14
|
import { isElement } from 'lodash-es';
|
15
15
|
|
@@ -17,7 +17,7 @@ import BalloonEditorUI from './ballooneditorui';
|
|
17
17
|
import BalloonEditorUIView from './ballooneditoruiview';
|
18
18
|
|
19
19
|
/**
|
20
|
-
* The {@glink installation/
|
20
|
+
* The {@glink installation/getting-started/predefined-builds#balloon-editor balloon editor}
|
21
21
|
* implementation (Medium-like editor).
|
22
22
|
* It uses an inline editable and a toolbar based on the {@link module:ui/toolbar/balloon/balloontoolbar~BalloonToolbar}.
|
23
23
|
* See the {@glink examples/builds/balloon-editor demo}.
|
@@ -29,9 +29,9 @@ import BalloonEditorUIView from './ballooneditoruiview';
|
|
29
29
|
*
|
30
30
|
* The balloon editor can be used directly from source (if you installed the
|
31
31
|
* [`@ckeditor/ckeditor5-editor-balloon`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-balloon) package)
|
32
|
-
* but it is also available in the {@glink installation/
|
32
|
+
* but it is also available in the {@glink installation/getting-started/predefined-builds#balloon-editor balloon build}.
|
33
33
|
*
|
34
|
-
* {@glink installation/
|
34
|
+
* {@glink installation/getting-started/predefined-builds Builds}
|
35
35
|
* are ready-to-use editors with plugins bundled in. When using the editor from
|
36
36
|
* source you need to take care of loading all plugins by yourself
|
37
37
|
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
@@ -95,7 +95,9 @@ export default class BalloonEditor extends Editor {
|
|
95
95
|
/**
|
96
96
|
* Destroys the editor instance, releasing all resources used by it.
|
97
97
|
*
|
98
|
-
* Updates the original editor element with the data
|
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`.
|
99
101
|
*
|
100
102
|
* @returns {Promise}
|
101
103
|
*/
|
@@ -109,7 +111,7 @@ export default class BalloonEditor extends Editor {
|
|
109
111
|
return super.destroy()
|
110
112
|
.then( () => {
|
111
113
|
if ( this.sourceElement ) {
|
112
|
-
|
114
|
+
this.updateSourceElement( data );
|
113
115
|
}
|
114
116
|
} );
|
115
117
|
}
|
@@ -182,7 +184,7 @@ export default class BalloonEditor extends Editor {
|
|
182
184
|
* # Using the editor from source
|
183
185
|
*
|
184
186
|
* The code samples listed in the previous sections of this documentation assume that you are using an
|
185
|
-
* {@glink installation/
|
187
|
+
* {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-balloon`).
|
186
188
|
*
|
187
189
|
* If you want to use the balloon editor from source (`@ckeditor/ckeditor5-editor-balloon/src/ballooneditor`),
|
188
190
|
* you need to define the list of
|
@@ -194,7 +196,9 @@ export default class BalloonEditor extends Editor {
|
|
194
196
|
* or the editor's initial data.
|
195
197
|
*
|
196
198
|
* If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
|
197
|
-
*
|
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`.
|
198
202
|
*
|
199
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.
|
200
204
|
* It is available under the {@link module:editor-balloon/ballooneditorui~BalloonEditorUI#element `editor.ui.element`} property.
|
package/src/ballooneditorui.js
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
*/
|
9
9
|
|
10
10
|
import { EditorUI } from 'ckeditor5/src/core';
|
11
|
-
import { enableToolbarKeyboardFocus } from 'ckeditor5/src/ui';
|
12
11
|
import { enablePlaceholder } from 'ckeditor5/src/engine';
|
13
12
|
|
14
13
|
/**
|
@@ -48,7 +47,6 @@ export default class BalloonEditorUI extends EditorUI {
|
|
48
47
|
init() {
|
49
48
|
const editor = this.editor;
|
50
49
|
const view = this.view;
|
51
|
-
const balloonToolbar = editor.plugins.get( 'BalloonToolbar' );
|
52
50
|
const editingView = editor.editing.view;
|
53
51
|
const editable = view.editable;
|
54
52
|
const editingRoot = editingView.document.getRoot();
|
@@ -67,11 +65,6 @@ export default class BalloonEditorUI extends EditorUI {
|
|
67
65
|
// editable areas (roots) but the balloon editor has only one.
|
68
66
|
this.setEditableElement( editable.name, editableElement );
|
69
67
|
|
70
|
-
// Let the global focus tracker know that the editable UI element is focusable and
|
71
|
-
// belongs to the editor. From now on, the focus tracker will sustain the editor focus
|
72
|
-
// as long as the editable is focused (e.g. the user is typing).
|
73
|
-
this.focusTracker.add( editableElement );
|
74
|
-
|
75
68
|
// Let the editable UI element respond to the changes in the global editor focus
|
76
69
|
// tracker. It has been added to the same tracker a few lines above but, in reality, there are
|
77
70
|
// many focusable areas in the editor, like balloons, toolbars or dropdowns and as long
|
@@ -85,19 +78,6 @@ export default class BalloonEditorUI extends EditorUI {
|
|
85
78
|
// of the editor's engine. This is where the engine meets the UI.
|
86
79
|
editingView.attachDomRoot( editableElement );
|
87
80
|
|
88
|
-
enableToolbarKeyboardFocus( {
|
89
|
-
origin: editingView,
|
90
|
-
originFocusTracker: this.focusTracker,
|
91
|
-
originKeystrokeHandler: editor.keystrokes,
|
92
|
-
toolbar: balloonToolbar.toolbarView,
|
93
|
-
beforeFocus() {
|
94
|
-
balloonToolbar.show();
|
95
|
-
},
|
96
|
-
afterBlur() {
|
97
|
-
balloonToolbar.hide();
|
98
|
-
}
|
99
|
-
} );
|
100
|
-
|
101
81
|
this._initPlaceholder();
|
102
82
|
this.fire( 'ready' );
|
103
83
|
}
|
@@ -26,13 +26,19 @@ export default class BalloonEditorUIView extends EditorUIView {
|
|
26
26
|
constructor( locale, editingView, editableElement ) {
|
27
27
|
super( locale );
|
28
28
|
|
29
|
+
const t = locale.t;
|
30
|
+
|
29
31
|
/**
|
30
32
|
* The editable UI view.
|
31
33
|
*
|
32
34
|
* @readonly
|
33
35
|
* @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
|
34
36
|
*/
|
35
|
-
this.editable = new InlineEditableUIView( locale, editingView, editableElement
|
37
|
+
this.editable = new InlineEditableUIView( locale, editingView, editableElement, {
|
38
|
+
label: editableView => {
|
39
|
+
return t( 'Rich Text Editor. Editing area: %0', editableView.name );
|
40
|
+
}
|
41
|
+
} );
|
36
42
|
}
|
37
43
|
|
38
44
|
/**
|