@ckeditor/ckeditor5-editor-decoupled 34.1.0 → 35.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +159 -0
- package/LICENSE.md +4 -0
- package/README.md +1 -1
- package/build/editor-decoupled.js +1 -1
- package/package.json +15 -14
- package/src/decouplededitor.js +16 -8
- package/src/decouplededitoruiview.js +7 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
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-decoupled/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-decoupled/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-decoupled/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-decoupled/compare/v15.0.0...v16.0.0) (2019-12-04)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* The main editor toolbar should respect the `config.toolbar.shouldNotGroupWhenFull` configuration (see [ckeditor/ckeditor5#5692](https://github.com/ckeditor/ckeditor5/issues/5692)). ([35b3cbf](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/35b3cbf))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.2.2...v15.0.0) (2019-10-23)
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* Enabled automatic items grouping in the main editor toolbar when there is not enough space to display them in a single row (see [ckeditor/ckeditor5#416](https://github.com/ckeditor/ckeditor5/issues/416)). ([eb52505](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/eb52505))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## [12.2.2](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.2.1...v12.2.2) (2019-08-26)
|
|
38
|
+
|
|
39
|
+
### Other changes
|
|
40
|
+
|
|
41
|
+
* 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). ([2e45069](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/2e45069))
|
|
42
|
+
* Introduced a check that prevents sharing source elements between editor instances. See [ckeditor/ckeditor5#746](https://github.com/ckeditor/ckeditor5/issues/746). ([c73b045](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/c73b045))
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.2.0...v12.2.1) (2019-07-10)
|
|
46
|
+
|
|
47
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.1.1...v12.2.0) (2019-07-04)
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* `DecoupledEditor.create()` will throw an error, when a `<textarea>` element is used. ([af4daea](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/af4daea))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.1.0...v12.1.1) (2019-06-05)
|
|
58
|
+
|
|
59
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v12.0.0...v12.1.0) (2019-04-10)
|
|
63
|
+
|
|
64
|
+
### Features
|
|
65
|
+
|
|
66
|
+
* Introduced `EditorConfig#initialData`. ([7e01ca7](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/7e01ca7))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v11.0.2...v12.0.0) (2019-02-28)
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* 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)). ([edd400f](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/edd400f))
|
|
74
|
+
|
|
75
|
+
### Bug fixes
|
|
76
|
+
|
|
77
|
+
* Fixed memory leaks during editor initialization and destruction (see [ckeditor/ckeditor5#1341](https://github.com/ckeditor/ckeditor5/issues/1341)). ([1e2f912](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/1e2f912))
|
|
78
|
+
|
|
79
|
+
### Other changes
|
|
80
|
+
|
|
81
|
+
* Adjustments to new editor initialisation events. See breaking changes. ([3bb0e40](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/3bb0e40))
|
|
82
|
+
* Editor UI classes API refactoring. See breaking changes. ([844ef9a](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/844ef9a))
|
|
83
|
+
|
|
84
|
+
### BREAKING CHANGES
|
|
85
|
+
|
|
86
|
+
* 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))
|
|
87
|
+
* The second argument of `DecoupledEditorUIView.constructor()` is an editing view instance now.
|
|
88
|
+
* The `editor#dataReady` event was removed. The `editor.data#ready` event has been introduced and should be used instead.
|
|
89
|
+
* The `editor#pluginsReady` event was removed. Use plugin `afterInit()` method instead.
|
|
90
|
+
* Removed `DecoupledEditor#element` property. The `DecoupledEditorUI#element` property should be used instead.
|
|
91
|
+
* Removed `DecoupledEditorUIView#editableElement`. Instead `DecoupledEditorUI#getEditableElement()` method should be used.
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v11.0.1...v11.0.2) (2018-12-05)
|
|
95
|
+
|
|
96
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v11.0.0...v11.0.1) (2018-10-08)
|
|
100
|
+
|
|
101
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v10.0.2...v11.0.0) (2018-07-18)
|
|
105
|
+
|
|
106
|
+
### Other changes
|
|
107
|
+
|
|
108
|
+
* Aligned `DecoupledEditor` to changes in the `EditorWithUI` and `ElementApi` interfaces. ([8c7414b](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/8c7414b))
|
|
109
|
+
* Used the `EditorUI` as a parent class for the `DecoupledEditorUI` (see [ckeditor/ckeditor5-core#130](https://github.com/ckeditor/ckeditor5-core/issues/130)). ([d92da9f](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/d92da9f))
|
|
110
|
+
|
|
111
|
+
### BREAKING CHANGES
|
|
112
|
+
|
|
113
|
+
* The `DecoupledEditor#element` property was renamed to `DecoupledEditor#sourceElement`. See [ckeditor/ckeditor5-core#64](https://github.com/ckeditor/ckeditor5-core/issues/64).
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
## [10.0.2](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v10.0.1...v10.0.2) (2018-06-21)
|
|
117
|
+
|
|
118
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v10.0.0...v10.0.1) (2018-05-22)
|
|
122
|
+
|
|
123
|
+
### Bug fixes
|
|
124
|
+
|
|
125
|
+
* Added missing `return` to the data initialization step (fixes asynchrounous data initialization, important for real-time collaboration features). Closes [#13](https://github.com/ckeditor/ckeditor5-editor-decoupled/issues/13). ([f4e496d](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/f4e496d))
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v1.0.0-beta.4...v10.0.0) (2018-04-25)
|
|
129
|
+
|
|
130
|
+
### Other changes
|
|
131
|
+
|
|
132
|
+
* Changed the license to GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991). ([843896b](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/843896b))
|
|
133
|
+
|
|
134
|
+
### BREAKING CHANGES
|
|
135
|
+
|
|
136
|
+
* 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.
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018-04-19)
|
|
140
|
+
|
|
141
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-decoupled/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018-04-10)
|
|
145
|
+
|
|
146
|
+
### Other changes
|
|
147
|
+
|
|
148
|
+
* Allowed the editable element to be passed into `DecoupledEditor.create()`. Removed `config.toolbarContainer` and `config.editableContainer`. Closes [#10](https://github.com/ckeditor/ckeditor5-editor-decoupled/issues/10). Closes [ckeditor/ckeditor5#912](https://github.com/ckeditor/ckeditor5/issues/912). ([327b2ed](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/327b2ed))
|
|
149
|
+
|
|
150
|
+
### BREAKING CHANGES
|
|
151
|
+
|
|
152
|
+
* The config options `config.toolbarContainer` and `config.editableContainer` have been removed. Please refer to the `DecoupledEditor` class API documentation to learn about possible methods of bootstrapping the UI.
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## 1.0.0-beta.1 (2018-03-15)
|
|
156
|
+
|
|
157
|
+
### Features
|
|
158
|
+
|
|
159
|
+
* The first implementation of the decoupled editor. Closes [#1](https://github.com/ckeditor/ckeditor5-editor-decoupled/issues/1). Closes [ckeditor/ckeditor5#873](https://github.com/ckeditor/ckeditor5/issues/873). ([a1950e8](https://github.com/ckeditor/ckeditor5-editor-decoupled/commit/a1950e8))
|
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/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The decoupled editor implementation for CKEditor 5.
|
|
|
10
10
|
|
|
11
11
|
This package contains the [`DecoupledEditor`](https://ckeditor.com/docs/ckeditor5/latest/api/module_editor-decoupled_decouplededitor-DecoupledEditor.html) class. Follow there to learn more about this type of editor and how to initialize it.
|
|
12
12
|
|
|
13
|
-
This package contains the source version of the decoupled editor. This editor implementation is also available
|
|
13
|
+
This package contains the source version of the decoupled editor. This kind of editor implementation is also available as a ready-to-use [document build](https://www.npmjs.com/package/@ckeditor/ckeditor5-build-decoupled-document). Read more about [CKEditor 5 predefined builds](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/predefined-builds.html) in the CKEditor 5 documentation.
|
|
14
14
|
|
|
15
15
|
## Documentation
|
|
16
16
|
|
|
@@ -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(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>
|
|
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(r){var i=e[r];if(void 0!==i)return i.exports;var n=e[r]={exports:{}};return t[r](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},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 r={};(()=>{"use strict";o.r(r),o.d(r,{DecoupledEditor:()=>P});var t=o(704),e=o(209);const i=function(t){return null!=t&&"object"==typeof t};const n="object"==typeof global&&global&&global.Object===Object&&global;var s="object"==typeof self&&self&&self.Object===Object&&self;const l=(n||s||Function("return this")()).Symbol;var a=Object.prototype,c=a.hasOwnProperty,d=a.toString,u=l?l.toStringTag:void 0;const h=function(t){var e=c.call(t,u),o=t[u];try{t[u]=void 0;var r=!0}catch(t){}var i=d.call(t);return r&&(e?t[u]=o:delete t[u]),i};var b=Object.prototype.toString;const p=function(t){return b.call(t)};var g=l?l.toStringTag:void 0;const f=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":g&&g in Object(t)?h(t):p(t)};const m=function(t,e){return function(o){return t(e(o))}}(Object.getPrototypeOf,Object);var v=Function.prototype,y=Object.prototype,w=v.toString,E=y.hasOwnProperty,j=w.call(Object);const O=function(t){if(!i(t)||"[object Object]"!=f(t))return!1;var e=m(t);if(null===e)return!0;var o=E.call(e,"constructor")&&e.constructor;return"function"==typeof o&&o instanceof o&&w.call(o)==j};const x=function(t){return i(t)&&1===t.nodeType&&!O(t)};var T=o(273),D=o(492);class F extends t.EditorUI{constructor(t,e){super(t),this.view=e}init(){const t=this.editor,e=this.view,o=t.editing.view,r=e.editable,i=o.document.getRoot();e.editable.name=i.rootName,e.render();const n=r.element;this.setEditableElement(r.name,n),this.focusTracker.add(n),e.editable.bind("isFocused").to(this.focusTracker),o.attachDomRoot(n),this._initPlaceholder(),this._initToolbar(),this.fire("ready")}destroy(){const t=this.view;this.editor.editing.view.detachDomRoot(t.editable.name),t.destroy(),super.destroy()}_initToolbar(){const t=this.editor,e=this.view.toolbar;e.fillFromConfig(t.config.get("toolbar"),this.componentFactory),(0,T.enableToolbarKeyboardFocus)({origin:t.editing.view,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e})}_initPlaceholder(){const t=this.editor,e=t.editing.view,o=e.document.getRoot(),r=t.sourceElement,i=t.config.get("placeholder")||r&&"textarea"===r.tagName.toLowerCase()&&r.getAttribute("placeholder");i&&(0,D.enablePlaceholder)({view:e,element:o,text:i,isDirectHost:!1,keepOnFocus:!0})}}class S extends T.EditorUIView{constructor(t,e,o={}){super(t);const r=t.t;this.toolbar=new T.ToolbarView(t,{shouldGroupWhenFull:o.shouldToolbarGroupWhenFull}),this.editable=new T.InlineEditableUIView(t,e,o.editableElement,{label:t=>r("Rich Text Editor. Editing area: %0",t.name)}),this.toolbar.extendTemplate({attributes:{class:["ck-reset_all","ck-rounded-corners"],dir:t.uiLanguageDirection}})}render(){super.render(),this.registerChild([this.toolbar,this.editable])}}class P extends t.Editor{constructor(o,r={}){if(!x(o)&&void 0!==r.initialData)throw new e.CKEditorError("editor-create-initial-data",null);super(r),void 0===this.config.get("initialData")&&this.config.set("initialData",function(t){return x(t)?(0,e.getDataFromElement)(t):t}(o)),x(o)&&(this.sourceElement=o,(0,t.secureSourceElement)(this)),this.model.document.createRoot();const i=!this.config.get("toolbar.shouldNotGroupWhenFull"),n=new S(this.locale,this.editing.view,{editableElement:this.sourceElement,shouldToolbarGroupWhenFull:i});this.ui=new F(this,n)}destroy(){const t=this.getData();return this.ui.destroy(),super.destroy().then((()=>{this.sourceElement&&this.updateSourceElement(t)}))}static create(t,o={}){return new Promise((r=>{if(x(t)&&"TEXTAREA"===t.tagName)throw new e.CKEditorError("editor-wrong-element",null);const i=new this(t,o);r(i.initPlugins().then((()=>i.ui.init())).then((()=>i.data.init(i.config.get("initialData")))).then((()=>i.fire("ready"))).then((()=>i)))}))}}(0,e.mix)(P,t.ElementApiMixin),(0,e.mix)(P,t.DataApiMixin)})(),(window.CKEditor5=window.CKEditor5||{}).editorDecoupled=r})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-decoupled",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.1",
|
|
4
4
|
"description": "Decoupled editor implementation for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
],
|
|
12
12
|
"main": "src/index.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"ckeditor5": "^
|
|
14
|
+
"ckeditor5": "^35.0.1",
|
|
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.0.1",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^35.0.1",
|
|
20
20
|
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
|
21
|
-
"@ckeditor/ckeditor5-engine": "^
|
|
22
|
-
"@ckeditor/ckeditor5-enter": "^
|
|
23
|
-
"@ckeditor/ckeditor5-heading": "^
|
|
24
|
-
"@ckeditor/ckeditor5-paragraph": "^
|
|
25
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
26
|
-
"@ckeditor/ckeditor5-typing": "^
|
|
27
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
28
|
-
"@ckeditor/ckeditor5-undo": "^
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
21
|
+
"@ckeditor/ckeditor5-engine": "^35.0.1",
|
|
22
|
+
"@ckeditor/ckeditor5-enter": "^35.0.1",
|
|
23
|
+
"@ckeditor/ckeditor5-heading": "^35.0.1",
|
|
24
|
+
"@ckeditor/ckeditor5-paragraph": "^35.0.1",
|
|
25
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.0.1",
|
|
26
|
+
"@ckeditor/ckeditor5-typing": "^35.0.1",
|
|
27
|
+
"@ckeditor/ckeditor5-ui": "^35.0.1",
|
|
28
|
+
"@ckeditor/ckeditor5-undo": "^35.0.1",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "^35.0.1",
|
|
30
30
|
"webpack": "^5.58.1",
|
|
31
31
|
"webpack-cli": "^4.9.0"
|
|
32
32
|
},
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"src",
|
|
49
49
|
"theme",
|
|
50
50
|
"build",
|
|
51
|
-
"ckeditor5-metadata.json"
|
|
51
|
+
"ckeditor5-metadata.json",
|
|
52
|
+
"CHANGELOG.md"
|
|
52
53
|
],
|
|
53
54
|
"scripts": {
|
|
54
55
|
"dll:build": "webpack"
|
package/src/decouplededitor.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @module editor-decoupled/decouplededitor
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Editor, DataApiMixin, secureSourceElement } from 'ckeditor5/src/core';
|
|
11
|
-
import { CKEditorError, getDataFromElement,
|
|
10
|
+
import { Editor, ElementApiMixin, DataApiMixin, secureSourceElement } from 'ckeditor5/src/core';
|
|
11
|
+
import { CKEditorError, getDataFromElement, mix } from 'ckeditor5/src/utils';
|
|
12
12
|
|
|
13
13
|
import { isElement } from 'lodash-es';
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ import DecoupledEditorUI from './decouplededitorui';
|
|
|
16
16
|
import DecoupledEditorUIView from './decouplededitoruiview';
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* The {@glink installation/
|
|
19
|
+
* The {@glink installation/getting-started/predefined-builds#document-editor decoupled editor} implementation.
|
|
20
20
|
* It provides an inline editable and a toolbar. However, unlike other editors,
|
|
21
21
|
* it does not render these components anywhere in the DOM unless configured.
|
|
22
22
|
*
|
|
@@ -34,9 +34,9 @@ import DecoupledEditorUIView from './decouplededitoruiview';
|
|
|
34
34
|
* The decoupled editor can be used directly from source (if you installed the
|
|
35
35
|
* [`@ckeditor/ckeditor5-editor-decoupled`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-decoupled) package)
|
|
36
36
|
* but it is also available in the
|
|
37
|
-
* {@glink installation/
|
|
37
|
+
* {@glink installation/getting-started/predefined-builds#document-editor document editor build}.
|
|
38
38
|
*
|
|
39
|
-
* {@glink installation/
|
|
39
|
+
* {@glink installation/getting-started/predefined-builds Builds}
|
|
40
40
|
* are ready-to-use editors with plugins bundled in. When using the editor from
|
|
41
41
|
* source you need to take care of loading all plugins by yourself
|
|
42
42
|
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
|
@@ -46,6 +46,7 @@ import DecoupledEditorUIView from './decouplededitoruiview';
|
|
|
46
46
|
* {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}.
|
|
47
47
|
*
|
|
48
48
|
* @mixes module:core/editor/utils/dataapimixin~DataApiMixin
|
|
49
|
+
* @mixes module:core/editor/utils/elementapimixin~ElementApiMixin
|
|
49
50
|
* @implements module:core/editor/editorwithui~EditorWithUI
|
|
50
51
|
* @extends module:core/editor/editor~Editor
|
|
51
52
|
*/
|
|
@@ -95,6 +96,10 @@ export default class DecoupledEditor extends Editor {
|
|
|
95
96
|
/**
|
|
96
97
|
* Destroys the editor instance, releasing all resources used by it.
|
|
97
98
|
*
|
|
99
|
+
* Updates the original editor element with the data if the
|
|
100
|
+
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
|
|
101
|
+
* configuration option is set to `true`.
|
|
102
|
+
*
|
|
98
103
|
* **Note**: The decoupled editor does not remove the toolbar and editable when destroyed. You can
|
|
99
104
|
* do that yourself in the destruction chain:
|
|
100
105
|
*
|
|
@@ -121,7 +126,7 @@ export default class DecoupledEditor extends Editor {
|
|
|
121
126
|
return super.destroy()
|
|
122
127
|
.then( () => {
|
|
123
128
|
if ( this.sourceElement ) {
|
|
124
|
-
|
|
129
|
+
this.updateSourceElement( data );
|
|
125
130
|
}
|
|
126
131
|
} );
|
|
127
132
|
}
|
|
@@ -206,7 +211,7 @@ export default class DecoupledEditor extends Editor {
|
|
|
206
211
|
* # Using the editor from source
|
|
207
212
|
*
|
|
208
213
|
* The code samples listed in the previous sections of this documentation assume that you are using an
|
|
209
|
-
* {@glink installation/
|
|
214
|
+
* {@glink installation/getting-started/predefined-builds editor build}
|
|
210
215
|
* (for example – `@ckeditor/ckeditor5-build-decoupled`).
|
|
211
216
|
*
|
|
212
217
|
* If you want to use the decoupled editor from source (`@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor`),
|
|
@@ -219,7 +224,9 @@ export default class DecoupledEditor extends Editor {
|
|
|
219
224
|
* or the editor's initial data.
|
|
220
225
|
*
|
|
221
226
|
* If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
|
|
222
|
-
*
|
|
227
|
+
* The editor data will be set back to the original element once the editor is destroyed only if the
|
|
228
|
+
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
|
|
229
|
+
* option is set to `true`.
|
|
223
230
|
*
|
|
224
231
|
* If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
|
|
225
232
|
* It is available via
|
|
@@ -249,6 +256,7 @@ export default class DecoupledEditor extends Editor {
|
|
|
249
256
|
}
|
|
250
257
|
}
|
|
251
258
|
|
|
259
|
+
mix( DecoupledEditor, ElementApiMixin );
|
|
252
260
|
mix( DecoupledEditor, DataApiMixin );
|
|
253
261
|
|
|
254
262
|
function getInitialData( sourceElementOrData ) {
|
|
@@ -36,6 +36,8 @@ export default class DecoupledEditorUIView extends EditorUIView {
|
|
|
36
36
|
constructor( locale, editingView, options = {} ) {
|
|
37
37
|
super( locale );
|
|
38
38
|
|
|
39
|
+
const t = locale.t;
|
|
40
|
+
|
|
39
41
|
/**
|
|
40
42
|
* The main toolbar of the decoupled editor UI.
|
|
41
43
|
*
|
|
@@ -52,7 +54,11 @@ export default class DecoupledEditorUIView extends EditorUIView {
|
|
|
52
54
|
* @readonly
|
|
53
55
|
* @member {module:ui/editableui/inline/inlineeditableuiview~InlineEditableUIView}
|
|
54
56
|
*/
|
|
55
|
-
this.editable = new InlineEditableUIView( locale, editingView, options.editableElement
|
|
57
|
+
this.editable = new InlineEditableUIView( locale, editingView, options.editableElement, {
|
|
58
|
+
label: editableView => {
|
|
59
|
+
return t( 'Rich Text Editor. Editing area: %0', editableView.name );
|
|
60
|
+
}
|
|
61
|
+
} );
|
|
56
62
|
|
|
57
63
|
// This toolbar may be placed anywhere in the page so things like font size need to be reset in it.
|
|
58
64
|
// Because of the above, make sure the toolbar supports rounded corners.
|