@ckeditor/ckeditor5-editor-inline 40.0.0 → 40.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +24 -24
- package/LICENSE.md +3 -3
- package/package.json +2 -2
- package/src/index.d.ts +8 -8
- package/src/index.js +8 -8
- package/src/inlineeditor.d.ts +176 -176
- package/src/inlineeditor.js +226 -226
- package/src/inlineeditorui.d.ts +52 -52
- package/src/inlineeditorui.js +121 -121
- package/src/inlineeditoruiview.d.ts +137 -137
- package/src/inlineeditoruiview.js +130 -130
- package/build/editor-inline.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -5,12 +5,12 @@ All changes in the package are documented in the main repository. See: https://g
|
|
5
5
|
|
6
6
|
Changes for the past releases are available below.
|
7
7
|
|
8
|
-
## [19.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v18.0.0...v19.0.0) (2020
|
8
|
+
## [19.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v18.0.0...v19.0.0) (April 29, 2020)
|
9
9
|
|
10
10
|
Internal changes only (updated dependencies, documentation, etc.).
|
11
11
|
|
12
12
|
|
13
|
-
## [18.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v17.0.0...v18.0.0) (2020
|
13
|
+
## [18.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v17.0.0...v18.0.0) (March 19, 2020)
|
14
14
|
|
15
15
|
### MAJOR BREAKING CHANGES
|
16
16
|
|
@@ -21,22 +21,22 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
21
21
|
* The inline editor toolbar should group items when its width exceeds the editable’s width (see [ckeditor/ckeditor5#5597](https://github.com/ckeditor/ckeditor5/issues/5597)). ([1c5746c](https://github.com/ckeditor/ckeditor5-editor-inline/commit/1c5746c))
|
22
22
|
|
23
23
|
|
24
|
-
## [17.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v16.0.0...v17.0.0) (2020
|
24
|
+
## [17.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v16.0.0...v17.0.0) (February 19, 2020)
|
25
25
|
|
26
26
|
Internal changes only (updated dependencies, documentation, etc.).
|
27
27
|
|
28
28
|
|
29
|
-
## [16.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v15.0.0...v16.0.0) (2019
|
29
|
+
## [16.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v15.0.0...v16.0.0) (December 4, 2019)
|
30
30
|
|
31
31
|
Internal changes only (updated dependencies, documentation, etc.).
|
32
32
|
|
33
33
|
|
34
|
-
## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.3.0...v15.0.0) (2019
|
34
|
+
## [15.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.3.0...v15.0.0) (October 23, 2019)
|
35
35
|
|
36
36
|
Internal changes only (updated dependencies, documentation, etc.).
|
37
37
|
|
38
38
|
|
39
|
-
## [12.3.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.1...v12.3.0) (2019
|
39
|
+
## [12.3.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.1...v12.3.0) (August 26, 2019)
|
40
40
|
|
41
41
|
### Features
|
42
42
|
|
@@ -48,31 +48,31 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
48
48
|
* Introduced a check that prevents sharing source elements between editor instances. See [ckeditor/ckeditor5#746](https://github.com/ckeditor/ckeditor5/issues/746). ([5e42fcf](https://github.com/ckeditor/ckeditor5-editor-inline/commit/5e42fcf))
|
49
49
|
|
50
50
|
|
51
|
-
## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.0...v12.2.1) (2019
|
51
|
+
## [12.2.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.2.0...v12.2.1) (July 10, 2019)
|
52
52
|
|
53
53
|
Internal changes only (updated dependencies, documentation, etc.).
|
54
54
|
|
55
55
|
|
56
|
-
## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.1...v12.2.0) (2019
|
56
|
+
## [12.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.1...v12.2.0) (July 4, 2019)
|
57
57
|
|
58
58
|
### Features
|
59
59
|
|
60
60
|
* `InlineEditor.create()` will throw an error, when a `<textarea>` element is used. ([56c9f40](https://github.com/ckeditor/ckeditor5-editor-inline/commit/56c9f40))
|
61
61
|
|
62
62
|
|
63
|
-
## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.0...v12.1.1) (2019
|
63
|
+
## [12.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.1.0...v12.1.1) (June 6, 2019)
|
64
64
|
|
65
65
|
Internal changes only (updated dependencies, documentation, etc.).
|
66
66
|
|
67
67
|
|
68
|
-
## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.0.0...v12.1.0) (2019
|
68
|
+
## [12.1.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v12.0.0...v12.1.0) (April 4, 2019)
|
69
69
|
|
70
70
|
### Features
|
71
71
|
|
72
72
|
* Introduced `EditorConfig#initialData`. ([59e97b5](https://github.com/ckeditor/ckeditor5-editor-inline/commit/59e97b5))
|
73
73
|
|
74
74
|
|
75
|
-
## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.2...v12.0.0) (2019
|
75
|
+
## [12.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.2...v12.0.0) (February 28, 2019)
|
76
76
|
|
77
77
|
### Features
|
78
78
|
|
@@ -97,12 +97,12 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
97
97
|
* Removed `InlineEditorUIView#editableElement`. Instead `InlineEditorUI#getEditableElement()` method should be used.
|
98
98
|
|
99
99
|
|
100
|
-
## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.1...v11.0.2) (2018
|
100
|
+
## [11.0.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.1...v11.0.2) (December 5, 2018)
|
101
101
|
|
102
102
|
Internal changes only (updated dependencies, documentation, etc.).
|
103
103
|
|
104
104
|
|
105
|
-
## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.0...v11.0.1) (2018
|
105
|
+
## [11.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v11.0.0...v11.0.1) (October 8, 2018)
|
106
106
|
|
107
107
|
### Bug fixes
|
108
108
|
|
@@ -111,7 +111,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
111
111
|
Huge thanks to [Alex Eckermann](https://github.com/alexeckermann) for this contribution!
|
112
112
|
|
113
113
|
|
114
|
-
## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.1...v11.0.0) (2018
|
114
|
+
## [11.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.1...v11.0.0) (July 18, 2018)
|
115
115
|
|
116
116
|
### Features
|
117
117
|
|
@@ -126,12 +126,12 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
126
126
|
* The `InlineEditor#element` property was renamed to `InlineEditor#sourceElement` and `InlineEditor#updateElement()` method to `InlineEditor#updateSourceElement()`. See [ckeditor/ckeditor5-core#64](https://github.com/ckeditor/ckeditor5-core/issues/64).
|
127
127
|
|
128
128
|
|
129
|
-
## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.0...v10.0.1) (2018
|
129
|
+
## [10.0.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v10.0.0...v10.0.1) (June 21, 2018)
|
130
130
|
|
131
131
|
Internal changes only (updated dependencies, documentation, etc.).
|
132
132
|
|
133
133
|
|
134
|
-
## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.4...v10.0.0) (2018
|
134
|
+
## [10.0.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.4...v10.0.0) (April 25, 2018)
|
135
135
|
|
136
136
|
### Other changes
|
137
137
|
|
@@ -142,17 +142,17 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
142
142
|
* The license under which CKEditor 5 is released has been changed from a triple GPL, LGPL and MPL license to a GPL2+ only. See [ckeditor/ckeditor5#991](https://github.com/ckeditor/ckeditor5/issues/991) for more information.
|
143
143
|
|
144
144
|
|
145
|
-
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018
|
145
|
+
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.2...v1.0.0-beta.4) (April 19, 2018)
|
146
146
|
|
147
147
|
Internal changes only (updated dependencies, documentation, etc.).
|
148
148
|
|
149
149
|
|
150
|
-
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018
|
150
|
+
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-beta.1...v1.0.0-beta.2) (April 10, 2018)
|
151
151
|
|
152
152
|
Internal changes only (updated dependencies, documentation, etc.).
|
153
153
|
|
154
154
|
|
155
|
-
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018
|
155
|
+
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (March 15, 2018)
|
156
156
|
|
157
157
|
### Other changes
|
158
158
|
|
@@ -160,19 +160,19 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
160
160
|
* Removed the `.ck-editor-toolbar` class from the toolbar (see [ckeditor/ckeditor5-theme-lark#135](https://github.com/ckeditor/ckeditor5-theme-lark/issues/135)). ([213ddfd](https://github.com/ckeditor/ckeditor5-editor-inline/commit/213ddfd))
|
161
161
|
|
162
162
|
|
163
|
-
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017
|
163
|
+
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (November 14, 2017)
|
164
164
|
|
165
165
|
### Other changes
|
166
166
|
|
167
167
|
* Aligned UI library usage to the [changes in the UI framework](https://github.com/ckeditor/ckeditor5-ui/pull/332).
|
168
168
|
|
169
169
|
|
170
|
-
## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.2.0...v1.0.0-alpha.1) (2017
|
170
|
+
## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.2.0...v1.0.0-alpha.1) (October 3, 2017)
|
171
171
|
|
172
172
|
Internal changes only (updated dependencies, documentation, etc.).
|
173
173
|
|
174
174
|
|
175
|
-
## [0.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.1...v0.2.0) (2017
|
175
|
+
## [0.2.0](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.1...v0.2.0) (September 3, 2017)
|
176
176
|
|
177
177
|
### Bug fixes
|
178
178
|
|
@@ -193,14 +193,14 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
193
193
|
* The `inline.js` file containing `InlineEditor` class has been renamed to `inlineeditor.js`.
|
194
194
|
|
195
195
|
|
196
|
-
## [0.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.0...v0.1.1) (2017
|
196
|
+
## [0.1.1](https://github.com/ckeditor/ckeditor5-editor-inline/compare/v0.1.0...v0.1.1) (May 7, 2017)
|
197
197
|
|
198
198
|
### Bug fixes
|
199
199
|
|
200
200
|
* The position of the floating toolbar should be updated after the editable has grown. Closes [#4](https://github.com/ckeditor/ckeditor5-editor-inline/issues/4). ([ae578b3](https://github.com/ckeditor/ckeditor5-editor-inline/commit/ae578b3))
|
201
201
|
|
202
202
|
|
203
|
-
## 0.1.0 (2017
|
203
|
+
## 0.1.0 (April 5, 2017)
|
204
204
|
|
205
205
|
### Features
|
206
206
|
|
package/LICENSE.md
CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
|
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**Inline editor implementation** – https://github.com/ckeditor/ckeditor5-editor-inline <br>
|
5
|
-
Copyright (c) 2003
|
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
|
|
@@ -13,9 +13,9 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
|
|
13
13
|
|
14
14
|
The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
|
15
15
|
|
16
|
-
*
|
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
17
|
|
18
18
|
Trademarks
|
19
19
|
----------
|
20
20
|
|
21
|
-
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
21
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-editor-inline",
|
3
|
-
"version": "40.
|
3
|
+
"version": "40.2.0",
|
4
4
|
"description": "Inline editor implementation for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
],
|
12
12
|
"main": "src/index.js",
|
13
13
|
"dependencies": {
|
14
|
-
"ckeditor5": "40.
|
14
|
+
"ckeditor5": "40.2.0",
|
15
15
|
"lodash-es": "4.17.21"
|
16
16
|
},
|
17
17
|
"author": "CKSource (http://cksource.com/)",
|
package/src/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module editor-inline
|
7
|
-
*/
|
8
|
-
export { default as InlineEditor } from './inlineeditor';
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module editor-inline
|
7
|
+
*/
|
8
|
+
export { default as InlineEditor } from './inlineeditor';
|
package/src/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module editor-inline
|
7
|
-
*/
|
8
|
-
export { default as InlineEditor } from './inlineeditor';
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module editor-inline
|
7
|
+
*/
|
8
|
+
export { default as InlineEditor } from './inlineeditor';
|
package/src/inlineeditor.d.ts
CHANGED
@@ -1,176 +1,176 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module editor-inline/inlineeditor
|
7
|
-
*/
|
8
|
-
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core';
|
9
|
-
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
10
|
-
import InlineEditorUI from './inlineeditorui';
|
11
|
-
declare const InlineEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
|
12
|
-
/**
|
13
|
-
* The {@glink installation/getting-started/predefined-builds#inline-editor inline editor} implementation.
|
14
|
-
* It uses an inline editable and a floating toolbar.
|
15
|
-
* See the {@glink examples/builds/inline-editor demo}.
|
16
|
-
*
|
17
|
-
* In order to create a inline editor instance, use the static
|
18
|
-
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`} method.
|
19
|
-
*
|
20
|
-
* # Inline editor and inline build
|
21
|
-
*
|
22
|
-
* The inline editor can be used directly from source (if you installed the
|
23
|
-
* [`@ckeditor/ckeditor5-editor-inline`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-inline) package)
|
24
|
-
* but it is also available in the {@glink installation/getting-started/predefined-builds#inline-editor inline build}.
|
25
|
-
*
|
26
|
-
* {@glink installation/getting-started/predefined-builds Builds}
|
27
|
-
* are ready-to-use editors with plugins bundled in. When using the editor from
|
28
|
-
* source you need to take care of loading all plugins by yourself
|
29
|
-
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
30
|
-
* Using the editor from source gives much better flexibility and allows easier customization.
|
31
|
-
*
|
32
|
-
* Read more about initializing the editor from source or as a build in
|
33
|
-
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}.
|
34
|
-
*/
|
35
|
-
export default class InlineEditor extends InlineEditor_base {
|
36
|
-
/**
|
37
|
-
* @inheritDoc
|
38
|
-
*/
|
39
|
-
readonly ui: InlineEditorUI;
|
40
|
-
/**
|
41
|
-
* Creates an instance of the inline editor.
|
42
|
-
*
|
43
|
-
* **Note:** Do not use the constructor to create editor instances. Use the static
|
44
|
-
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`} method instead.
|
45
|
-
*
|
46
|
-
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
47
|
-
* (on which the editor will be initialized) or initial data for the editor. For more information see
|
48
|
-
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}.
|
49
|
-
* @param config The editor configuration.
|
50
|
-
*/
|
51
|
-
protected constructor(sourceElementOrData: HTMLElement | string, config?: EditorConfig);
|
52
|
-
/**
|
53
|
-
* Destroys the editor instance, releasing all resources used by it.
|
54
|
-
*
|
55
|
-
* Updates the original editor element with the data if the
|
56
|
-
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
|
57
|
-
* configuration option is set to `true`.
|
58
|
-
*/
|
59
|
-
destroy(): Promise<unknown>;
|
60
|
-
/**
|
61
|
-
* Creates a new inline editor instance.
|
62
|
-
*
|
63
|
-
* There are three general ways how the editor can be initialized.
|
64
|
-
*
|
65
|
-
* # Using an existing DOM element (and loading data from it)
|
66
|
-
*
|
67
|
-
* You can initialize the editor using an existing DOM element:
|
68
|
-
*
|
69
|
-
* ```ts
|
70
|
-
* InlineEditor
|
71
|
-
* .create( document.querySelector( '#editor' ) )
|
72
|
-
* .then( editor => {
|
73
|
-
* console.log( 'Editor was initialized', editor );
|
74
|
-
* } )
|
75
|
-
* .catch( err => {
|
76
|
-
* console.error( err.stack );
|
77
|
-
* } );
|
78
|
-
* ```
|
79
|
-
*
|
80
|
-
* The element's content will be used as the editor data and the element will become the editable element.
|
81
|
-
*
|
82
|
-
* # Creating a detached editor
|
83
|
-
*
|
84
|
-
* Alternatively, you can initialize the editor by passing the initial data directly as a `String`.
|
85
|
-
* In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:
|
86
|
-
*
|
87
|
-
* ```ts
|
88
|
-
* InlineEditor
|
89
|
-
* .create( '<p>Hello world!</p>' )
|
90
|
-
* .then( editor => {
|
91
|
-
* console.log( 'Editor was initialized', editor );
|
92
|
-
*
|
93
|
-
* // Initial data was provided so the editor UI element needs to be added manually to the DOM.
|
94
|
-
* document.body.appendChild( editor.ui.element );
|
95
|
-
* } )
|
96
|
-
* .catch( err => {
|
97
|
-
* console.error( err.stack );
|
98
|
-
* } );
|
99
|
-
* ```
|
100
|
-
*
|
101
|
-
* This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
|
102
|
-
* web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
|
103
|
-
*
|
104
|
-
* # Using an existing DOM element (and data provided in `config.initialData`)
|
105
|
-
*
|
106
|
-
* You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
|
107
|
-
*
|
108
|
-
* ```ts
|
109
|
-
* InlineEditor
|
110
|
-
* .create( document.querySelector( '#editor' ), {
|
111
|
-
* initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
|
112
|
-
* } )
|
113
|
-
* .then( editor => {
|
114
|
-
* console.log( 'Editor was initialized', editor );
|
115
|
-
* } )
|
116
|
-
* .catch( err => {
|
117
|
-
* console.error( err.stack );
|
118
|
-
* } );
|
119
|
-
* ```
|
120
|
-
*
|
121
|
-
* This method can be used to initialize the editor on an existing element with the specified content in case if your integration
|
122
|
-
* makes it difficult to set the content of the source element.
|
123
|
-
*
|
124
|
-
* Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
|
125
|
-
*
|
126
|
-
* # Configuring the editor
|
127
|
-
*
|
128
|
-
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
129
|
-
* customizing plugins, toolbar and more.
|
130
|
-
*
|
131
|
-
* # Using the editor from source
|
132
|
-
*
|
133
|
-
* The code samples listed in the previous sections of this documentation assume that you are using an
|
134
|
-
* {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-inline`).
|
135
|
-
*
|
136
|
-
* If you want to use the inline editor from source (`@ckeditor/ckeditor5-editor-inline/src/inlineeditor`),
|
137
|
-
* you need to define the list of
|
138
|
-
* {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
|
139
|
-
* {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
|
140
|
-
* source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
|
141
|
-
*
|
142
|
-
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
143
|
-
* or the editor's initial data.
|
144
|
-
*
|
145
|
-
* If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
|
146
|
-
* The editor data will be set back to the original element once the editor is destroyed only if the
|
147
|
-
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
|
148
|
-
* option is set to `true`.
|
149
|
-
*
|
150
|
-
* If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
|
151
|
-
* It is available under the {@link module:editor-inline/inlineeditorui~InlineEditorUI#element `editor.ui.element`} property.
|
152
|
-
*
|
153
|
-
* @param config The editor configuration.
|
154
|
-
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
155
|
-
*/
|
156
|
-
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<InlineEditor>;
|
157
|
-
/**
|
158
|
-
* The {@link module:core/context~Context} class.
|
159
|
-
*
|
160
|
-
* Exposed as static editor field for easier access in editor builds.
|
161
|
-
*/
|
162
|
-
static Context: typeof Context;
|
163
|
-
/**
|
164
|
-
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
165
|
-
*
|
166
|
-
* Exposed as static editor field for easier access in editor builds.
|
167
|
-
*/
|
168
|
-
static EditorWatchdog: typeof EditorWatchdog;
|
169
|
-
/**
|
170
|
-
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
171
|
-
*
|
172
|
-
* Exposed as static editor field for easier access in editor builds.
|
173
|
-
*/
|
174
|
-
static ContextWatchdog: typeof ContextWatchdog;
|
175
|
-
}
|
176
|
-
export {};
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module editor-inline/inlineeditor
|
7
|
+
*/
|
8
|
+
import { Editor, Context, type EditorConfig } from 'ckeditor5/src/core';
|
9
|
+
import { ContextWatchdog, EditorWatchdog } from 'ckeditor5/src/watchdog';
|
10
|
+
import InlineEditorUI from './inlineeditorui';
|
11
|
+
declare const InlineEditor_base: import("ckeditor5/src/utils").Mixed<import("ckeditor5/src/utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
|
12
|
+
/**
|
13
|
+
* The {@glink installation/getting-started/predefined-builds#inline-editor inline editor} implementation.
|
14
|
+
* It uses an inline editable and a floating toolbar.
|
15
|
+
* See the {@glink examples/builds/inline-editor demo}.
|
16
|
+
*
|
17
|
+
* In order to create a inline editor instance, use the static
|
18
|
+
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`} method.
|
19
|
+
*
|
20
|
+
* # Inline editor and inline build
|
21
|
+
*
|
22
|
+
* The inline editor can be used directly from source (if you installed the
|
23
|
+
* [`@ckeditor/ckeditor5-editor-inline`](https://www.npmjs.com/package/@ckeditor/ckeditor5-editor-inline) package)
|
24
|
+
* but it is also available in the {@glink installation/getting-started/predefined-builds#inline-editor inline build}.
|
25
|
+
*
|
26
|
+
* {@glink installation/getting-started/predefined-builds Builds}
|
27
|
+
* are ready-to-use editors with plugins bundled in. When using the editor from
|
28
|
+
* source you need to take care of loading all plugins by yourself
|
29
|
+
* (through the {@link module:core/editor/editorconfig~EditorConfig#plugins `config.plugins`} option).
|
30
|
+
* Using the editor from source gives much better flexibility and allows easier customization.
|
31
|
+
*
|
32
|
+
* Read more about initializing the editor from source or as a build in
|
33
|
+
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}.
|
34
|
+
*/
|
35
|
+
export default class InlineEditor extends InlineEditor_base {
|
36
|
+
/**
|
37
|
+
* @inheritDoc
|
38
|
+
*/
|
39
|
+
readonly ui: InlineEditorUI;
|
40
|
+
/**
|
41
|
+
* Creates an instance of the inline editor.
|
42
|
+
*
|
43
|
+
* **Note:** Do not use the constructor to create editor instances. Use the static
|
44
|
+
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`} method instead.
|
45
|
+
*
|
46
|
+
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
47
|
+
* (on which the editor will be initialized) or initial data for the editor. For more information see
|
48
|
+
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}.
|
49
|
+
* @param config The editor configuration.
|
50
|
+
*/
|
51
|
+
protected constructor(sourceElementOrData: HTMLElement | string, config?: EditorConfig);
|
52
|
+
/**
|
53
|
+
* Destroys the editor instance, releasing all resources used by it.
|
54
|
+
*
|
55
|
+
* Updates the original editor element with the data if the
|
56
|
+
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy `updateSourceElementOnDestroy`}
|
57
|
+
* configuration option is set to `true`.
|
58
|
+
*/
|
59
|
+
destroy(): Promise<unknown>;
|
60
|
+
/**
|
61
|
+
* Creates a new inline editor instance.
|
62
|
+
*
|
63
|
+
* There are three general ways how the editor can be initialized.
|
64
|
+
*
|
65
|
+
* # Using an existing DOM element (and loading data from it)
|
66
|
+
*
|
67
|
+
* You can initialize the editor using an existing DOM element:
|
68
|
+
*
|
69
|
+
* ```ts
|
70
|
+
* InlineEditor
|
71
|
+
* .create( document.querySelector( '#editor' ) )
|
72
|
+
* .then( editor => {
|
73
|
+
* console.log( 'Editor was initialized', editor );
|
74
|
+
* } )
|
75
|
+
* .catch( err => {
|
76
|
+
* console.error( err.stack );
|
77
|
+
* } );
|
78
|
+
* ```
|
79
|
+
*
|
80
|
+
* The element's content will be used as the editor data and the element will become the editable element.
|
81
|
+
*
|
82
|
+
* # Creating a detached editor
|
83
|
+
*
|
84
|
+
* Alternatively, you can initialize the editor by passing the initial data directly as a `String`.
|
85
|
+
* In this case, the editor will render an element that must be inserted into the DOM for the editor to work properly:
|
86
|
+
*
|
87
|
+
* ```ts
|
88
|
+
* InlineEditor
|
89
|
+
* .create( '<p>Hello world!</p>' )
|
90
|
+
* .then( editor => {
|
91
|
+
* console.log( 'Editor was initialized', editor );
|
92
|
+
*
|
93
|
+
* // Initial data was provided so the editor UI element needs to be added manually to the DOM.
|
94
|
+
* document.body.appendChild( editor.ui.element );
|
95
|
+
* } )
|
96
|
+
* .catch( err => {
|
97
|
+
* console.error( err.stack );
|
98
|
+
* } );
|
99
|
+
* ```
|
100
|
+
*
|
101
|
+
* This lets you dynamically append the editor to your web page whenever it is convenient for you. You may use this method if your
|
102
|
+
* web page content is generated on the client side and the DOM structure is not ready at the moment when you initialize the editor.
|
103
|
+
*
|
104
|
+
* # Using an existing DOM element (and data provided in `config.initialData`)
|
105
|
+
*
|
106
|
+
* You can also mix these two ways by providing a DOM element to be used and passing the initial data through the configuration:
|
107
|
+
*
|
108
|
+
* ```ts
|
109
|
+
* InlineEditor
|
110
|
+
* .create( document.querySelector( '#editor' ), {
|
111
|
+
* initialData: '<h2>Initial data</h2><p>Foo bar.</p>'
|
112
|
+
* } )
|
113
|
+
* .then( editor => {
|
114
|
+
* console.log( 'Editor was initialized', editor );
|
115
|
+
* } )
|
116
|
+
* .catch( err => {
|
117
|
+
* console.error( err.stack );
|
118
|
+
* } );
|
119
|
+
* ```
|
120
|
+
*
|
121
|
+
* This method can be used to initialize the editor on an existing element with the specified content in case if your integration
|
122
|
+
* makes it difficult to set the content of the source element.
|
123
|
+
*
|
124
|
+
* Note that an error will be thrown if you pass the initial data both as the first parameter and also in the configuration.
|
125
|
+
*
|
126
|
+
* # Configuring the editor
|
127
|
+
*
|
128
|
+
* See the {@link module:core/editor/editorconfig~EditorConfig editor configuration documentation} to learn more about
|
129
|
+
* customizing plugins, toolbar and more.
|
130
|
+
*
|
131
|
+
* # Using the editor from source
|
132
|
+
*
|
133
|
+
* The code samples listed in the previous sections of this documentation assume that you are using an
|
134
|
+
* {@glink installation/getting-started/predefined-builds editor build} (for example – `@ckeditor/ckeditor5-build-inline`).
|
135
|
+
*
|
136
|
+
* If you want to use the inline editor from source (`@ckeditor/ckeditor5-editor-inline/src/inlineeditor`),
|
137
|
+
* you need to define the list of
|
138
|
+
* {@link module:core/editor/editorconfig~EditorConfig#plugins plugins to be initialized} and
|
139
|
+
* {@link module:core/editor/editorconfig~EditorConfig#toolbar toolbar items}. Read more about using the editor from
|
140
|
+
* source in the {@glink installation/advanced/alternative-setups/integrating-from-source-webpack dedicated guide}.
|
141
|
+
*
|
142
|
+
* @param sourceElementOrData The DOM element that will be the source for the created editor
|
143
|
+
* or the editor's initial data.
|
144
|
+
*
|
145
|
+
* If a DOM element is passed, its content will be automatically loaded to the editor upon initialization.
|
146
|
+
* The editor data will be set back to the original element once the editor is destroyed only if the
|
147
|
+
* {@link module:core/editor/editorconfig~EditorConfig#updateSourceElementOnDestroy updateSourceElementOnDestroy}
|
148
|
+
* option is set to `true`.
|
149
|
+
*
|
150
|
+
* If the initial data is passed, a detached editor will be created. In this case you need to insert it into the DOM manually.
|
151
|
+
* It is available under the {@link module:editor-inline/inlineeditorui~InlineEditorUI#element `editor.ui.element`} property.
|
152
|
+
*
|
153
|
+
* @param config The editor configuration.
|
154
|
+
* @returns A promise resolved once the editor is ready. The promise resolves with the created editor instance.
|
155
|
+
*/
|
156
|
+
static create(sourceElementOrData: HTMLElement | string, config?: EditorConfig): Promise<InlineEditor>;
|
157
|
+
/**
|
158
|
+
* The {@link module:core/context~Context} class.
|
159
|
+
*
|
160
|
+
* Exposed as static editor field for easier access in editor builds.
|
161
|
+
*/
|
162
|
+
static Context: typeof Context;
|
163
|
+
/**
|
164
|
+
* The {@link module:watchdog/editorwatchdog~EditorWatchdog} class.
|
165
|
+
*
|
166
|
+
* Exposed as static editor field for easier access in editor builds.
|
167
|
+
*/
|
168
|
+
static EditorWatchdog: typeof EditorWatchdog;
|
169
|
+
/**
|
170
|
+
* The {@link module:watchdog/contextwatchdog~ContextWatchdog} class.
|
171
|
+
*
|
172
|
+
* Exposed as static editor field for easier access in editor builds.
|
173
|
+
*/
|
174
|
+
static ContextWatchdog: typeof ContextWatchdog;
|
175
|
+
}
|
176
|
+
export {};
|