@ckeditor/ckeditor5-widget 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 +7 -7
- package/src/augmentation.d.ts +13 -13
- package/src/augmentation.js +5 -5
- package/src/highlightstack.d.ts +74 -74
- package/src/highlightstack.js +129 -129
- package/src/index.d.ts +13 -13
- package/src/index.js +13 -13
- package/src/utils.d.ts +198 -198
- package/src/utils.js +348 -348
- package/src/verticalnavigation.d.ts +15 -15
- package/src/verticalnavigation.js +196 -196
- package/src/widget.d.ts +95 -91
- package/src/widget.js +429 -380
- package/src/widgetresize/resizer.d.ts +177 -177
- package/src/widgetresize/resizer.js +372 -372
- package/src/widgetresize/resizerstate.d.ts +125 -125
- package/src/widgetresize/resizerstate.js +150 -150
- package/src/widgetresize/sizeview.d.ts +55 -55
- package/src/widgetresize/sizeview.js +63 -63
- package/src/widgetresize.d.ts +125 -125
- package/src/widgetresize.js +188 -188
- package/src/widgettoolbarrepository.d.ts +94 -94
- package/src/widgettoolbarrepository.js +268 -268
- package/src/widgettypearound/utils.d.ts +38 -38
- package/src/widgettypearound/utils.js +52 -52
- package/src/widgettypearound/widgettypearound.d.ts +229 -229
- package/src/widgettypearound/widgettypearound.js +773 -773
package/CHANGELOG.md
CHANGED
@@ -5,7 +5,7 @@ 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-widget/compare/v18.0.0...v19.0.0) (2020
|
8
|
+
## [19.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v18.0.0...v19.0.0) (April 29, 2020)
|
9
9
|
|
10
10
|
### MINOR BREAKING CHANGES
|
11
11
|
|
@@ -21,12 +21,12 @@ Changes for the past releases are available below.
|
|
21
21
|
* Updated translations. ([79d1a21](https://github.com/ckeditor/ckeditor5-widget/commit/79d1a21))
|
22
22
|
|
23
23
|
|
24
|
-
## [18.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v17.0.0...v18.0.0) (2020
|
24
|
+
## [18.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v17.0.0...v18.0.0) (March 19, 2020)
|
25
25
|
|
26
26
|
Internal changes only (updated dependencies, documentation, etc.).
|
27
27
|
|
28
28
|
|
29
|
-
## [17.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v16.0.0...v17.0.0) (2020
|
29
|
+
## [17.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v16.0.0...v17.0.0) (February 19, 2020)
|
30
30
|
|
31
31
|
### MINOR BREAKING CHANGES
|
32
32
|
|
@@ -46,14 +46,14 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
46
46
|
* Updated translations. ([75b8c83](https://github.com/ckeditor/ckeditor5-widget/commit/75b8c83))
|
47
47
|
|
48
48
|
|
49
|
-
## [16.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v15.0.0...v16.0.0) (2019
|
49
|
+
## [16.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v15.0.0...v16.0.0) (December 4, 2019)
|
50
50
|
|
51
51
|
### Other changes
|
52
52
|
|
53
53
|
* Updated translations. ([b3bf5f0](https://github.com/ckeditor/ckeditor5-widget/commit/b3bf5f0))
|
54
54
|
|
55
55
|
|
56
|
-
## [15.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v11.1.0...v15.0.0) (2019
|
56
|
+
## [15.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v11.1.0...v15.0.0) (October 23, 2019)
|
57
57
|
|
58
58
|
### MAJOR BREAKING CHANGES
|
59
59
|
|
@@ -73,7 +73,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
73
73
|
* Updated translations. ([b9cb673](https://github.com/ckeditor/ckeditor5-widget/commit/b9cb673)) ([daea4f5](https://github.com/ckeditor/ckeditor5-widget/commit/daea4f5))
|
74
74
|
|
75
75
|
|
76
|
-
## [11.1.0](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.4...v11.1.0) (2019
|
76
|
+
## [11.1.0](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.4...v11.1.0) (August 26, 2019)
|
77
77
|
|
78
78
|
### Features
|
79
79
|
|
@@ -90,31 +90,31 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
90
90
|
* The widget toolbar should have a proper `aria-label` attribute (see [ckeditor/ckeditor5#1404](https://github.com/ckeditor/ckeditor5/issues/1404)). ([aec5888](https://github.com/ckeditor/ckeditor5-widget/commit/aec5888))
|
91
91
|
|
92
92
|
|
93
|
-
## [11.0.4](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.3...v11.0.4) (2019
|
93
|
+
## [11.0.4](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.3...v11.0.4) (July 10, 2019)
|
94
94
|
|
95
95
|
Internal changes only (updated dependencies, documentation, etc.).
|
96
96
|
|
97
97
|
|
98
|
-
## [11.0.3](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.2...v11.0.3) (2019
|
98
|
+
## [11.0.3](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.2...v11.0.3) (July 4, 2019)
|
99
99
|
|
100
100
|
### Bug fixes
|
101
101
|
|
102
102
|
* A proper `DomConverter` method should be used to map a view to DOM when getting balloon position data. Closes [#87](https://github.com/ckeditor/ckeditor5-widget/issues/87). ([160333a](https://github.com/ckeditor/ckeditor5-widget/commit/160333a))
|
103
103
|
|
104
104
|
|
105
|
-
## [11.0.2](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.1...v11.0.2) (2019
|
105
|
+
## [11.0.2](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.1...v11.0.2) (June 6, 2019)
|
106
106
|
|
107
107
|
Internal changes only (updated dependencies, documentation, etc.).
|
108
108
|
|
109
109
|
|
110
|
-
## [11.0.1](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.0...v11.0.1) (2019
|
110
|
+
## [11.0.1](https://github.com/ckeditor/ckeditor5-widget/compare/v11.0.0...v11.0.1) (April 4, 2019)
|
111
111
|
|
112
112
|
### Bug fixes
|
113
113
|
|
114
114
|
* Triple clicking inside a nested editable should not select the entire widget in Safari. Closes [ckeditor/ckeditor5#1463](https://github.com/ckeditor/ckeditor5/issues/1463). ([b7c4765](https://github.com/ckeditor/ckeditor5-widget/commit/b7c4765))
|
115
115
|
|
116
116
|
|
117
|
-
## [11.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.3.1...v11.0.0) (2019
|
117
|
+
## [11.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.3.1...v11.0.0) (February 28, 2019)
|
118
118
|
|
119
119
|
### Bug fixes
|
120
120
|
|
@@ -136,7 +136,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
136
136
|
* The `visibleWhen()` function, a property of an object passed into `WidgetToolbarRepository.register()`, has been renamed to `getRelatedElement()` and must return an editing `View` element the toolbar should be attached to (instead of `Boolean`).
|
137
137
|
|
138
138
|
|
139
|
-
## [10.3.1](https://github.com/ckeditor/ckeditor5-widget/compare/v10.3.0...v10.3.1) (2018
|
139
|
+
## [10.3.1](https://github.com/ckeditor/ckeditor5-widget/compare/v10.3.0...v10.3.1) (December 5, 2018)
|
140
140
|
|
141
141
|
### Bug fixes
|
142
142
|
|
@@ -147,7 +147,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
147
147
|
* Improved SVG icons size. See [ckeditor/ckeditor5-theme-lark#206](https://github.com/ckeditor/ckeditor5-theme-lark/issues/206). ([5b7a457](https://github.com/ckeditor/ckeditor5-widget/commit/5b7a457))
|
148
148
|
|
149
149
|
|
150
|
-
## [10.3.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.2.0...v10.3.0) (2018
|
150
|
+
## [10.3.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.2.0...v10.3.0) (October 8, 2018)
|
151
151
|
|
152
152
|
### Features
|
153
153
|
|
@@ -155,7 +155,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
155
155
|
* Introduced the widget toolbar repository. Closes [ckeditor/ckeditor5-ui#442](https://github.com/ckeditor/ckeditor5-ui/issues/442). ([bc45176](https://github.com/ckeditor/ckeditor5-widget/commit/bc45176))
|
156
156
|
|
157
157
|
|
158
|
-
## [10.2.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.1.0...v10.2.0) (2018
|
158
|
+
## [10.2.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.1.0...v10.2.0) (July 18, 2018)
|
159
159
|
|
160
160
|
### Features
|
161
161
|
|
@@ -166,14 +166,14 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
166
166
|
* Do not set the `contenteditable` property for widgets and their nested editables on Edge due to an awful instability which it causes in this browser. Closes [ckeditor/ckeditor5#1079](https://github.com/ckeditor/ckeditor5/issues/1079). Closes [ckeditor/ckeditor5#1067](https://github.com/ckeditor/ckeditor5/issues/1067). ([ee530b1](https://github.com/ckeditor/ckeditor5-widget/commit/ee530b1))
|
167
167
|
|
168
168
|
|
169
|
-
## [10.1.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.0.0...v10.1.0) (2018
|
169
|
+
## [10.1.0](https://github.com/ckeditor/ckeditor5-widget/compare/v10.0.0...v10.1.0) (June 21, 2018)
|
170
170
|
|
171
171
|
### Features
|
172
172
|
|
173
173
|
* Creating a paragraph next to the selected widget is possible using the (<kbd>Shift</kbd>+)<kbd>Enter</kbd> key (see [ckeditor/ckeditor5#407](https://github.com/ckeditor/ckeditor5/issues/407)). ([d68b7d0](https://github.com/ckeditor/ckeditor5-widget/commit/d68b7d0))
|
174
174
|
|
175
175
|
|
176
|
-
## [10.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.4...v10.0.0) (2018
|
176
|
+
## [10.0.0](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.4...v10.0.0) (April 25, 2018)
|
177
177
|
|
178
178
|
### Other changes
|
179
179
|
|
@@ -184,12 +184,12 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
184
184
|
* 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.
|
185
185
|
|
186
186
|
|
187
|
-
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.2...v1.0.0-beta.4) (2018
|
187
|
+
## [1.0.0-beta.4](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.2...v1.0.0-beta.4) (April 19, 2018)
|
188
188
|
|
189
189
|
Internal changes only (updated dependencies, documentation, etc.).
|
190
190
|
|
191
191
|
|
192
|
-
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2018
|
192
|
+
## [1.0.0-beta.2](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-beta.1...v1.0.0-beta.2) (April 10, 2018)
|
193
193
|
|
194
194
|
### Bug fixes
|
195
195
|
|
@@ -204,7 +204,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
204
204
|
* The `.ck-editable` class is no longer available. Use the `.ck-editor__nested-editable` class instead.
|
205
205
|
|
206
206
|
|
207
|
-
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (2018
|
207
|
+
## [1.0.0-beta.1](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-alpha.2...v1.0.0-beta.1) (March 15, 2018)
|
208
208
|
|
209
209
|
### Other changes
|
210
210
|
|
@@ -213,7 +213,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
213
213
|
* Switched to handling deletion around widgets by using the `delete` event instead of listening directly on key events. Closes [#29](https://github.com/ckeditor/ckeditor5-widget/issues/29). ([ee6cc95](https://github.com/ckeditor/ckeditor5-widget/commit/ee6cc95))
|
214
214
|
|
215
215
|
|
216
|
-
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2017
|
216
|
+
## [1.0.0-alpha.2](https://github.com/ckeditor/ckeditor5-widget/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (November 14, 2017)
|
217
217
|
|
218
218
|
### Bug fixes
|
219
219
|
|
@@ -225,7 +225,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
225
225
|
* Widgets highlight remove handler will now use only descriptor id, instead of the full descriptor. ([1dfdc83](https://github.com/ckeditor/ckeditor5-widget/commit/1dfdc83))
|
226
226
|
|
227
227
|
|
228
|
-
## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-widget/compare/v0.2.0...v1.0.0-alpha.1) (2017
|
228
|
+
## [1.0.0-alpha.1](https://github.com/ckeditor/ckeditor5-widget/compare/v0.2.0...v1.0.0-alpha.1) (October 3, 2017)
|
229
229
|
|
230
230
|
### Bug fixes
|
231
231
|
|
@@ -233,7 +233,7 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
233
233
|
* Nested element structures next to widgets will be correctly removed when pressing <kbd>Backspace</kbd> or <kbd>Delete</kbd>. Closes [#19](https://github.com/ckeditor/ckeditor5-widget/issues/19). ([27ee848](https://github.com/ckeditor/ckeditor5-widget/commit/27ee848))
|
234
234
|
|
235
235
|
|
236
|
-
## [0.2.0](https://github.com/ckeditor/ckeditor5-widget/compare/v0.1.1...v0.2.0) (2017
|
236
|
+
## [0.2.0](https://github.com/ckeditor/ckeditor5-widget/compare/v0.1.1...v0.2.0) (September 3, 2017)
|
237
237
|
|
238
238
|
### Bug fixes
|
239
239
|
|
@@ -249,11 +249,11 @@ Internal changes only (updated dependencies, documentation, etc.).
|
|
249
249
|
* Introduced highlights support for widgets. Closes [#11](https://github.com/ckeditor/ckeditor5-widget/issues/11). ([0bd3d66](https://github.com/ckeditor/ckeditor5-widget/commit/0bd3d66))
|
250
250
|
|
251
251
|
|
252
|
-
## [0.1.1](https://github.com/ckeditor/ckeditor5-widget/compare/v0.1.0...v0.1.1) (2017
|
252
|
+
## [0.1.1](https://github.com/ckeditor/ckeditor5-widget/compare/v0.1.0...v0.1.1) (May 7, 2017)
|
253
253
|
|
254
254
|
Internal changes only (updated dependencies, documentation, etc.).
|
255
255
|
|
256
|
-
## 0.1.0 (2017
|
256
|
+
## 0.1.0 (April 5, 2017)
|
257
257
|
|
258
258
|
### Features
|
259
259
|
|
package/LICENSE.md
CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
|
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**CKEditor 5 widget API** – https://github.com/ckeditor/ckeditor5-image <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-widget",
|
3
|
-
"version": "40.
|
3
|
+
"version": "40.2.0",
|
4
4
|
"description": "Widget API for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -11,12 +11,12 @@
|
|
11
11
|
],
|
12
12
|
"main": "src/index.js",
|
13
13
|
"dependencies": {
|
14
|
-
"@ckeditor/ckeditor5-core": "40.
|
15
|
-
"@ckeditor/ckeditor5-engine": "40.
|
16
|
-
"@ckeditor/ckeditor5-enter": "40.
|
17
|
-
"@ckeditor/ckeditor5-ui": "40.
|
18
|
-
"@ckeditor/ckeditor5-utils": "40.
|
19
|
-
"@ckeditor/ckeditor5-typing": "40.
|
14
|
+
"@ckeditor/ckeditor5-core": "40.2.0",
|
15
|
+
"@ckeditor/ckeditor5-engine": "40.2.0",
|
16
|
+
"@ckeditor/ckeditor5-enter": "40.2.0",
|
17
|
+
"@ckeditor/ckeditor5-ui": "40.2.0",
|
18
|
+
"@ckeditor/ckeditor5-utils": "40.2.0",
|
19
|
+
"@ckeditor/ckeditor5-typing": "40.2.0",
|
20
20
|
"lodash-es": "4.17.21"
|
21
21
|
},
|
22
22
|
"author": "CKSource (http://cksource.com/)",
|
package/src/augmentation.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
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
|
-
import type { Widget, WidgetResize, WidgetToolbarRepository, WidgetTypeAround } from './index';
|
6
|
-
declare module '@ckeditor/ckeditor5-core' {
|
7
|
-
interface PluginsMap {
|
8
|
-
[Widget.pluginName]: Widget;
|
9
|
-
[WidgetResize.pluginName]: WidgetResize;
|
10
|
-
[WidgetToolbarRepository.pluginName]: WidgetToolbarRepository;
|
11
|
-
[WidgetTypeAround.pluginName]: WidgetTypeAround;
|
12
|
-
}
|
13
|
-
}
|
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
|
+
import type { Widget, WidgetResize, WidgetToolbarRepository, WidgetTypeAround } from './index';
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
7
|
+
interface PluginsMap {
|
8
|
+
[Widget.pluginName]: Widget;
|
9
|
+
[WidgetResize.pluginName]: WidgetResize;
|
10
|
+
[WidgetToolbarRepository.pluginName]: WidgetToolbarRepository;
|
11
|
+
[WidgetTypeAround.pluginName]: WidgetTypeAround;
|
12
|
+
}
|
13
|
+
}
|
package/src/augmentation.js
CHANGED
@@ -1,5 +1,5 @@
|
|
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
|
-
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
|
+
export {};
|
package/src/highlightstack.d.ts
CHANGED
@@ -1,74 +1,74 @@
|
|
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
|
-
import type { DowncastWriter, HighlightDescriptor } from '@ckeditor/ckeditor5-engine';
|
6
|
-
declare const HighlightStack_base: {
|
7
|
-
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
8
|
-
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
9
|
-
};
|
10
|
-
/**
|
11
|
-
* Class used to handle the correct order of highlights on elements.
|
12
|
-
*
|
13
|
-
* When different highlights are applied to same element the correct order should be preserved:
|
14
|
-
*
|
15
|
-
* * highlight with highest priority should be applied,
|
16
|
-
* * if two highlights have same priority - sort by CSS class provided in
|
17
|
-
* {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
|
18
|
-
*
|
19
|
-
* This way, highlight will be applied with the same rules it is applied on texts.
|
20
|
-
*/
|
21
|
-
export default class HighlightStack extends HighlightStack_base {
|
22
|
-
private readonly _stack;
|
23
|
-
/**
|
24
|
-
* Adds highlight descriptor to the stack.
|
25
|
-
*
|
26
|
-
* @fires change:top
|
27
|
-
*/
|
28
|
-
add(descriptor: HighlightDescriptor, writer: DowncastWriter): void;
|
29
|
-
/**
|
30
|
-
* Removes highlight descriptor from the stack.
|
31
|
-
*
|
32
|
-
* @fires change:top
|
33
|
-
* @param id Id of the descriptor to remove.
|
34
|
-
*/
|
35
|
-
remove(id: string, writer: DowncastWriter): void;
|
36
|
-
/**
|
37
|
-
* Inserts a given descriptor in correct place in the stack. It also takes care about updating information
|
38
|
-
* when descriptor with same id is already present.
|
39
|
-
*/
|
40
|
-
private _insertDescriptor;
|
41
|
-
/**
|
42
|
-
* Removes descriptor with given id from the stack.
|
43
|
-
*
|
44
|
-
* @param id Descriptor's id.
|
45
|
-
*/
|
46
|
-
private _removeDescriptor;
|
47
|
-
}
|
48
|
-
/**
|
49
|
-
* Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
|
50
|
-
*
|
51
|
-
* @eventName ~HighlightStack#change:top
|
52
|
-
*/
|
53
|
-
export type HighlightStackChangeEvent = {
|
54
|
-
name: 'change' | 'change:top';
|
55
|
-
args: [HighlightStackChangeEventData];
|
56
|
-
};
|
57
|
-
/**
|
58
|
-
* Additional information about the change.
|
59
|
-
*/
|
60
|
-
export type HighlightStackChangeEventData = {
|
61
|
-
/**
|
62
|
-
* Old highlight descriptor. It will be `undefined` when first descriptor is added to the stack.
|
63
|
-
*/
|
64
|
-
oldDescriptor: HighlightDescriptor;
|
65
|
-
/**
|
66
|
-
* New highlight descriptor. It will be `undefined` when last descriptor is removed from the stack.
|
67
|
-
*/
|
68
|
-
newDescriptor: HighlightDescriptor;
|
69
|
-
/**
|
70
|
-
* View writer that can be used to modify element.
|
71
|
-
*/
|
72
|
-
writer: DowncastWriter;
|
73
|
-
};
|
74
|
-
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
|
+
import type { DowncastWriter, HighlightDescriptor } from '@ckeditor/ckeditor5-engine';
|
6
|
+
declare const HighlightStack_base: {
|
7
|
+
new (): import("@ckeditor/ckeditor5-utils").Emitter;
|
8
|
+
prototype: import("@ckeditor/ckeditor5-utils").Emitter;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Class used to handle the correct order of highlights on elements.
|
12
|
+
*
|
13
|
+
* When different highlights are applied to same element the correct order should be preserved:
|
14
|
+
*
|
15
|
+
* * highlight with highest priority should be applied,
|
16
|
+
* * if two highlights have same priority - sort by CSS class provided in
|
17
|
+
* {@link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
|
18
|
+
*
|
19
|
+
* This way, highlight will be applied with the same rules it is applied on texts.
|
20
|
+
*/
|
21
|
+
export default class HighlightStack extends HighlightStack_base {
|
22
|
+
private readonly _stack;
|
23
|
+
/**
|
24
|
+
* Adds highlight descriptor to the stack.
|
25
|
+
*
|
26
|
+
* @fires change:top
|
27
|
+
*/
|
28
|
+
add(descriptor: HighlightDescriptor, writer: DowncastWriter): void;
|
29
|
+
/**
|
30
|
+
* Removes highlight descriptor from the stack.
|
31
|
+
*
|
32
|
+
* @fires change:top
|
33
|
+
* @param id Id of the descriptor to remove.
|
34
|
+
*/
|
35
|
+
remove(id: string, writer: DowncastWriter): void;
|
36
|
+
/**
|
37
|
+
* Inserts a given descriptor in correct place in the stack. It also takes care about updating information
|
38
|
+
* when descriptor with same id is already present.
|
39
|
+
*/
|
40
|
+
private _insertDescriptor;
|
41
|
+
/**
|
42
|
+
* Removes descriptor with given id from the stack.
|
43
|
+
*
|
44
|
+
* @param id Descriptor's id.
|
45
|
+
*/
|
46
|
+
private _removeDescriptor;
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* Fired when top element on {@link module:widget/highlightstack~HighlightStack} has been changed
|
50
|
+
*
|
51
|
+
* @eventName ~HighlightStack#change:top
|
52
|
+
*/
|
53
|
+
export type HighlightStackChangeEvent = {
|
54
|
+
name: 'change' | 'change:top';
|
55
|
+
args: [HighlightStackChangeEventData];
|
56
|
+
};
|
57
|
+
/**
|
58
|
+
* Additional information about the change.
|
59
|
+
*/
|
60
|
+
export type HighlightStackChangeEventData = {
|
61
|
+
/**
|
62
|
+
* Old highlight descriptor. It will be `undefined` when first descriptor is added to the stack.
|
63
|
+
*/
|
64
|
+
oldDescriptor: HighlightDescriptor;
|
65
|
+
/**
|
66
|
+
* New highlight descriptor. It will be `undefined` when last descriptor is removed from the stack.
|
67
|
+
*/
|
68
|
+
newDescriptor: HighlightDescriptor;
|
69
|
+
/**
|
70
|
+
* View writer that can be used to modify element.
|
71
|
+
*/
|
72
|
+
writer: DowncastWriter;
|
73
|
+
};
|
74
|
+
export {};
|