@ckeditor/ckeditor5-ui 48.2.0-alpha.7 → 48.3.0-alpha.0
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/dist/arialiveannouncer.d.ts +90 -90
- package/dist/augmentation.d.ts +86 -86
- package/dist/autocomplete/autocompleteview.d.ts +70 -70
- package/dist/badge/badge.d.ts +119 -121
- package/dist/bindings/addkeyboardhandlingforgrid.d.ts +22 -22
- package/dist/bindings/clickoutsidehandler.d.ts +25 -25
- package/dist/bindings/csstransitiondisablermixin.d.ts +47 -36
- package/dist/bindings/draggableviewmixin.d.ts +45 -37
- package/dist/bindings/preventdefault.d.ts +30 -30
- package/dist/bindings/submithandler.d.ts +49 -49
- package/dist/button/button.d.ts +167 -167
- package/dist/button/buttonlabel.d.ts +28 -28
- package/dist/button/buttonlabelview.d.ts +26 -26
- package/dist/button/buttonview.d.ts +192 -192
- package/dist/button/filedialogbuttonview.d.ts +107 -99
- package/dist/button/listitembuttonview.d.ts +73 -73
- package/dist/button/switchbuttonview.d.ts +40 -40
- package/dist/collapsible/collapsibleview.d.ts +63 -63
- package/dist/colorgrid/colorgridview.d.ts +117 -117
- package/dist/colorgrid/colortileview.d.ts +21 -21
- package/dist/colorgrid/utils.d.ts +35 -35
- package/dist/colorpicker/colorpickerview.d.ts +155 -157
- package/dist/colorpicker/utils.d.ts +37 -37
- package/dist/colorselector/colorgridsfragmentview.d.ts +191 -191
- package/dist/colorselector/colorpickerfragmentview.d.ts +129 -129
- package/dist/colorselector/colorselectorview.d.ts +227 -229
- package/dist/colorselector/documentcolorcollection.d.ts +52 -59
- package/dist/componentfactory.d.ts +76 -76
- package/dist/dialog/dialog.d.ts +311 -288
- package/dist/dialog/dialogactionsview.d.ts +62 -62
- package/dist/dialog/dialogcontentview.d.ts +22 -22
- package/dist/dialog/dialogview.d.ts +255 -251
- package/dist/dropdown/button/dropdownbutton.d.ts +17 -17
- package/dist/dropdown/button/dropdownbuttonview.d.ts +41 -41
- package/dist/dropdown/button/splitbuttonview.d.ts +155 -155
- package/dist/dropdown/dropdownpanelfocusable.d.ts +16 -16
- package/dist/dropdown/dropdownpanelview.d.ts +56 -56
- package/dist/dropdown/dropdownview.d.ts +326 -326
- package/dist/dropdown/menu/dropdownmenubehaviors.d.ts +43 -43
- package/dist/dropdown/menu/dropdownmenubuttonview.d.ts +29 -29
- package/dist/dropdown/menu/dropdownmenulistitembuttonview.d.ts +12 -12
- package/dist/dropdown/menu/dropdownmenulistitemview.d.ts +17 -17
- package/dist/dropdown/menu/dropdownmenulistview.d.ts +19 -19
- package/dist/dropdown/menu/dropdownmenunestedmenupanelview.d.ts +28 -28
- package/dist/dropdown/menu/dropdownmenunestedmenuview.d.ts +126 -126
- package/dist/dropdown/menu/dropdownmenurootlistview.d.ts +132 -132
- package/dist/dropdown/menu/utils.d.ts +112 -112
- package/dist/dropdown/utils.d.ts +272 -272
- package/dist/editableui/editableuiview.d.ts +78 -78
- package/dist/editableui/inline/inlineeditableuiview.d.ts +38 -38
- package/dist/editorui/accessibilityhelp/accessibilityhelp.d.ts +50 -50
- package/dist/editorui/accessibilityhelp/accessibilityhelpcontentview.d.ts +30 -30
- package/dist/editorui/bodycollection.d.ts +86 -86
- package/dist/editorui/boxed/boxededitoruiview.d.ts +35 -35
- package/dist/editorui/editorui.d.ts +348 -351
- package/dist/editorui/editoruiview.d.ts +53 -53
- package/dist/editorui/evaluationbadge.d.ts +28 -28
- package/dist/editorui/poweredby.d.ts +25 -25
- package/dist/focuscycler.d.ts +265 -270
- package/dist/formheader/formheaderview.d.ts +53 -53
- package/dist/formrow/formrowview.d.ts +52 -52
- package/dist/highlightedtext/buttonlabelwithhighlightview.d.ts +25 -25
- package/dist/highlightedtext/highlightedtextview.d.ts +33 -33
- package/dist/highlightedtext/labelwithhighlightview.d.ts +21 -21
- package/dist/icon/iconview.d.ts +83 -83
- package/dist/iframe/iframeview.d.ts +42 -42
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +136 -136
- package/dist/index.js +16467 -17751
- package/dist/index.js.map +1 -1
- package/dist/input/inputbase.d.ts +114 -114
- package/dist/input/inputview.d.ts +28 -28
- package/dist/inputnumber/inputnumberview.d.ts +44 -44
- package/dist/inputtext/inputtextview.d.ts +13 -13
- package/dist/label/labelview.d.ts +31 -31
- package/dist/labeledfield/labeledfieldview.d.ts +180 -180
- package/dist/labeledfield/utils.d.ts +112 -112
- package/dist/labeledinput/labeledinputview.d.ts +120 -120
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/list/listitemgroupview.d.ts +54 -54
- package/dist/list/listitemview.d.ts +31 -31
- package/dist/list/listseparatorview.d.ts +13 -13
- package/dist/list/listview.d.ts +119 -119
- package/dist/menubar/menubarmenubuttonview.d.ts +28 -28
- package/dist/menubar/menubarmenulistitembuttonview.d.ts +16 -16
- package/dist/menubar/menubarmenulistitemfiledialogbuttonview.d.ts +18 -18
- package/dist/menubar/menubarmenulistitemview.d.ts +20 -20
- package/dist/menubar/menubarmenulistview.d.ts +24 -24
- package/dist/menubar/menubarmenupanelview.d.ts +47 -47
- package/dist/menubar/menubarmenuview.d.ts +113 -113
- package/dist/menubar/menubarview.d.ts +145 -145
- package/dist/menubar/utils.d.ts +455 -455
- package/dist/model.d.ts +19 -18
- package/dist/notification/notification.d.ts +200 -200
- package/dist/panel/balloon/balloonpanelview.d.ts +692 -692
- package/dist/panel/balloon/contextualballoon.d.ts +298 -298
- package/dist/panel/sticky/stickypanelview.d.ts +151 -151
- package/dist/search/filteredview.d.ts +23 -23
- package/dist/search/filtergroupanditemnames.d.ts +11 -11
- package/dist/search/searchinfoview.d.ts +39 -39
- package/dist/search/searchresultsview.d.ts +49 -49
- package/dist/search/text/searchtextqueryview.d.ts +63 -63
- package/dist/search/text/searchtextview.d.ts +203 -203
- package/dist/spinner/spinnerview.d.ts +20 -20
- package/dist/template.d.ts +897 -902
- package/dist/textarea/textareaview.d.ts +96 -96
- package/dist/toolbar/balloon/balloontoolbar.d.ts +122 -122
- package/dist/toolbar/block/blockbuttonview.d.ts +30 -30
- package/dist/toolbar/block/blocktoolbar.d.ts +166 -166
- package/dist/toolbar/normalizetoolbarconfig.d.ts +35 -35
- package/dist/toolbar/toolbarlinebreakview.d.ts +13 -13
- package/dist/toolbar/toolbarseparatorview.d.ts +13 -13
- package/dist/toolbar/toolbarview.d.ts +271 -271
- package/dist/tooltipmanager.d.ts +190 -193
- package/dist/view.d.ts +385 -388
- package/dist/viewcollection.d.ts +134 -134
- package/package.json +6 -6
|
@@ -1,369 +1,366 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { ComponentFactory } from
|
|
9
|
-
import { TooltipManager } from
|
|
10
|
-
import { PoweredBy } from
|
|
11
|
-
import { EvaluationBadge } from
|
|
12
|
-
import { AriaLiveAnnouncer } from
|
|
13
|
-
import { type EditorUIView } from
|
|
14
|
-
import { type ToolbarView } from
|
|
15
|
-
import { FocusTracker } from
|
|
16
|
-
import type { Editor, ViewportOffsetConfig } from
|
|
17
|
-
import type { MenuBarView, MenuBarConfigAddedGroup, MenuBarConfigAddedItem, MenuBarConfigAddedMenu } from
|
|
18
|
-
declare const
|
|
19
|
-
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
20
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
21
|
-
};
|
|
6
|
+
* @module ui/editorui/editorui
|
|
7
|
+
*/
|
|
8
|
+
import { ComponentFactory } from "../componentfactory.js";
|
|
9
|
+
import { TooltipManager } from "../tooltipmanager.js";
|
|
10
|
+
import { PoweredBy } from "./poweredby.js";
|
|
11
|
+
import { EvaluationBadge } from "./evaluationbadge.js";
|
|
12
|
+
import { AriaLiveAnnouncer } from "../arialiveannouncer.js";
|
|
13
|
+
import { type EditorUIView } from "./editoruiview.js";
|
|
14
|
+
import { type ToolbarView } from "../toolbar/toolbarview.js";
|
|
15
|
+
import { FocusTracker, type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
16
|
+
import type { Editor, ViewportOffsetConfig } from "@ckeditor/ckeditor5-core";
|
|
17
|
+
import type { MenuBarView, MenuBarConfigAddedGroup, MenuBarConfigAddedItem, MenuBarConfigAddedMenu } from "../menubar/menubarview.js";
|
|
18
|
+
declare const EditorUIBase: ObservableMixinConstructor;
|
|
22
19
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export declare abstract class EditorUI extends
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
20
|
+
* A class providing the minimal interface that is required to successfully bootstrap any editor UI.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class EditorUI extends EditorUIBase {
|
|
23
|
+
/**
|
|
24
|
+
* The editor that the UI belongs to.
|
|
25
|
+
*/
|
|
26
|
+
readonly editor: Editor;
|
|
27
|
+
/**
|
|
28
|
+
* An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins
|
|
29
|
+
* to register factories of specific UI components.
|
|
30
|
+
*/
|
|
31
|
+
readonly componentFactory: ComponentFactory;
|
|
32
|
+
/**
|
|
33
|
+
* Stores the information about the editor UI focus and propagates it so various plugins and components
|
|
34
|
+
* are unified as a focus group.
|
|
35
|
+
*/
|
|
36
|
+
readonly focusTracker: FocusTracker;
|
|
37
|
+
/**
|
|
38
|
+
* Manages the tooltips displayed on mouseover and focus across the UI.
|
|
39
|
+
*/
|
|
40
|
+
readonly tooltipManager: TooltipManager;
|
|
41
|
+
/**
|
|
42
|
+
* A helper that enables the "powered by" feature in the editor and renders a link to the project's webpage.
|
|
43
|
+
*/
|
|
44
|
+
readonly poweredBy: PoweredBy;
|
|
45
|
+
/**
|
|
46
|
+
* A helper that enables the "evaluation badge" feature in the editor.
|
|
47
|
+
*/
|
|
48
|
+
readonly evaluationBadge: EvaluationBadge;
|
|
49
|
+
/**
|
|
50
|
+
* A helper that manages the content of an `aria-live` regions used by editor features to announce status changes
|
|
51
|
+
* to screen readers.
|
|
52
|
+
*/
|
|
53
|
+
readonly ariaLiveAnnouncer: AriaLiveAnnouncer;
|
|
54
|
+
/**
|
|
55
|
+
* Indicates the UI is ready. Set `true` after {@link #event:ready} event is fired.
|
|
56
|
+
*
|
|
57
|
+
* @readonly
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
isReady: boolean;
|
|
61
|
+
abstract get view(): EditorUIView;
|
|
62
|
+
/**
|
|
63
|
+
* Stores viewport offsets from every direction.
|
|
64
|
+
*
|
|
65
|
+
* Viewport offset can be used to constrain balloons or other UI elements into an element smaller than the viewport.
|
|
66
|
+
* This can be useful if there are any other absolutely positioned elements that may interfere with editor UI.
|
|
67
|
+
*
|
|
68
|
+
* Example `editor.ui.viewportOffset` returns:
|
|
69
|
+
*
|
|
70
|
+
* ```js
|
|
71
|
+
* {
|
|
72
|
+
* top: 50,
|
|
73
|
+
* right: 50,
|
|
74
|
+
* bottom: 50,
|
|
75
|
+
* left: 50,
|
|
76
|
+
* visualTop: 50
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* This property can be overriden after editor already being initialized:
|
|
81
|
+
*
|
|
82
|
+
* ```js
|
|
83
|
+
* editor.ui.viewportOffset = {
|
|
84
|
+
* top: 100,
|
|
85
|
+
* right: 0,
|
|
86
|
+
* bottom: 0,
|
|
87
|
+
* left: 0
|
|
88
|
+
* };
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @observable
|
|
92
|
+
*/
|
|
93
|
+
viewportOffset: ViewportOffset;
|
|
94
|
+
/**
|
|
95
|
+
* Stores all editable elements used by the editor instance.
|
|
96
|
+
*/
|
|
97
|
+
private _editableElementsMap;
|
|
98
|
+
/**
|
|
99
|
+
* All available & focusable toolbars.
|
|
100
|
+
*/
|
|
101
|
+
private _focusableToolbarDefinitions;
|
|
102
|
+
/**
|
|
103
|
+
* All additional menu bar items, groups or menus that have their default location defined.
|
|
104
|
+
*/
|
|
105
|
+
private _extraMenuBarElements;
|
|
106
|
+
/**
|
|
107
|
+
* The last focused element to which focus should return on `Esc` press.
|
|
108
|
+
*/
|
|
109
|
+
private _lastFocusedForeignElement;
|
|
110
|
+
/**
|
|
111
|
+
* The DOM emitter instance used for visual viewport watching.
|
|
112
|
+
*/
|
|
113
|
+
private _domEmitter?;
|
|
114
|
+
/**
|
|
115
|
+
* Creates an instance of the editor UI class.
|
|
116
|
+
*
|
|
117
|
+
* @param editor The editor instance.
|
|
118
|
+
*/
|
|
119
|
+
constructor(editor: Editor);
|
|
120
|
+
/**
|
|
121
|
+
* The main (outermost) DOM element of the editor UI.
|
|
122
|
+
*
|
|
123
|
+
* For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `<div>` which
|
|
124
|
+
* wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}
|
|
125
|
+
* it is the editable element itself (as there is no other wrapper). However, in
|
|
126
|
+
* {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not
|
|
127
|
+
* come with a single "main" HTML element (its editable element and toolbar are separate).
|
|
128
|
+
*
|
|
129
|
+
* This property can be understood as a shorthand for retrieving the element that a specific editor integration
|
|
130
|
+
* considers to be its main DOM element.
|
|
131
|
+
*/
|
|
132
|
+
get element(): HTMLElement | null;
|
|
133
|
+
/**
|
|
134
|
+
* Fires the {@link module:ui/editorui/editorui~EditorUI#event:update `update`} event.
|
|
135
|
+
*
|
|
136
|
+
* This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to
|
|
137
|
+
* some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).
|
|
138
|
+
*/
|
|
139
|
+
update(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Destroys the UI.
|
|
142
|
+
*/
|
|
143
|
+
destroy(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Stores the native DOM editable element used by the editor under a unique name.
|
|
146
|
+
*
|
|
147
|
+
* Also, registers the element in the editor to maintain the accessibility of the UI. When the user is editing text in a focusable
|
|
148
|
+
* editable area, they can use the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke to navigate over editor toolbars. See {@link #addToolbar}.
|
|
149
|
+
*
|
|
150
|
+
* @param rootName The unique name of the editable element.
|
|
151
|
+
* @param domElement The native DOM editable element.
|
|
152
|
+
*/
|
|
153
|
+
setEditableElement(rootName: string, domElement: HTMLElement): void;
|
|
154
|
+
/**
|
|
155
|
+
* Removes the editable from the editor UI. Removes all handlers added by {@link #setEditableElement}.
|
|
156
|
+
*
|
|
157
|
+
* @param rootName The name of the editable element to remove.
|
|
158
|
+
*/
|
|
159
|
+
removeEditableElement(rootName: string): void;
|
|
160
|
+
/**
|
|
161
|
+
* Returns the editable editor element with the given name or null if editable does not exist.
|
|
162
|
+
*
|
|
163
|
+
* @param rootName The editable name.
|
|
164
|
+
*/
|
|
165
|
+
getEditableElement(rootName?: string): HTMLElement | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Returns array of names of all editor editable elements.
|
|
168
|
+
*/
|
|
169
|
+
getEditableElementsNames(): IterableIterator<string>;
|
|
170
|
+
/**
|
|
171
|
+
* Adds a toolbar to the editor UI. Used primarily to maintain the accessibility of the UI.
|
|
172
|
+
*
|
|
173
|
+
* Focusable toolbars can be accessed (focused) by users by pressing the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.
|
|
174
|
+
* Successive keystroke presses navigate over available toolbars.
|
|
175
|
+
*
|
|
176
|
+
* @param toolbarView A instance of the toolbar to be registered.
|
|
177
|
+
*/
|
|
178
|
+
addToolbar(toolbarView: ToolbarView, options?: FocusableToolbarOptions): void;
|
|
179
|
+
/**
|
|
180
|
+
* Registers an extra menu bar element, which could be a single item, a group of items, or a menu containing groups.
|
|
181
|
+
*
|
|
182
|
+
* ```ts
|
|
183
|
+
* // Register a new menu bar item.
|
|
184
|
+
* editor.ui.extendMenuBar( {
|
|
185
|
+
* item: 'menuBar:customFunctionButton',
|
|
186
|
+
* position: 'after:menuBar:bold'
|
|
187
|
+
* } );
|
|
188
|
+
*
|
|
189
|
+
* // Register a new menu bar group.
|
|
190
|
+
* editor.ui.extendMenuBar( {
|
|
191
|
+
* group: {
|
|
192
|
+
* groupId: 'customGroup',
|
|
193
|
+
* items: [
|
|
194
|
+
* 'menuBar:customFunctionButton'
|
|
195
|
+
* ]
|
|
196
|
+
* },
|
|
197
|
+
* position: 'start:help'
|
|
198
|
+
* } );
|
|
199
|
+
*
|
|
200
|
+
* // Register a new menu bar menu.
|
|
201
|
+
* editor.ui.extendMenuBar( {
|
|
202
|
+
* menu: {
|
|
203
|
+
* menuId: 'customMenu',
|
|
204
|
+
* label: 'customMenu',
|
|
205
|
+
* groups: [
|
|
206
|
+
* {
|
|
207
|
+
* groupId: 'customGroup',
|
|
208
|
+
* items: [
|
|
209
|
+
* 'menuBar:customFunctionButton'
|
|
210
|
+
* ]
|
|
211
|
+
* }
|
|
212
|
+
* ]
|
|
213
|
+
* },
|
|
214
|
+
* position: 'after:help'
|
|
215
|
+
* } );
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
extendMenuBar(config: MenuBarConfigAddedItem | MenuBarConfigAddedGroup | MenuBarConfigAddedMenu): void;
|
|
219
|
+
/**
|
|
220
|
+
* Initializes menu bar.
|
|
221
|
+
*/
|
|
222
|
+
initMenuBar(menuBarView: MenuBarView): void;
|
|
223
|
+
/**
|
|
224
|
+
* Returns viewport offsets object:
|
|
225
|
+
*
|
|
226
|
+
* ```js
|
|
227
|
+
* {
|
|
228
|
+
* top: Number,
|
|
229
|
+
* right: Number,
|
|
230
|
+
* bottom: Number,
|
|
231
|
+
* left: Number
|
|
232
|
+
* }
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* Only top property is currently supported.
|
|
236
|
+
*/
|
|
237
|
+
private _readViewportOffsetFromConfig;
|
|
238
|
+
/**
|
|
239
|
+
* Starts listening for <kbd>Alt</kbd> + <kbd>F10</kbd> and <kbd>Esc</kbd> keystrokes in the context of focusable
|
|
240
|
+
* {@link #setEditableElement editable elements} and {@link #addToolbar toolbars}
|
|
241
|
+
* to allow users navigate across the UI.
|
|
242
|
+
*/
|
|
243
|
+
private _initFocusTracking;
|
|
244
|
+
/**
|
|
245
|
+
* Saves last focused element that doen not belong to editing view to restore focus on `Esc`.
|
|
246
|
+
*/
|
|
247
|
+
private _saveLastFocusedForeignElement;
|
|
248
|
+
/**
|
|
249
|
+
* Returns definitions of toolbars that could potentially be focused, sorted by their importance for the user.
|
|
250
|
+
*
|
|
251
|
+
* Focusable toolbars candidates are either:
|
|
252
|
+
* * already visible,
|
|
253
|
+
* * have `beforeFocus()` set in their {@link module:ui/editorui/editorui~FocusableToolbarDefinition definition} that suggests that
|
|
254
|
+
* they might show up when called. Keep in mind that determining whether a toolbar will show up (and become focusable) is impossible
|
|
255
|
+
* at this stage because it depends on its implementation, that in turn depends on the editing context (selection).
|
|
256
|
+
*
|
|
257
|
+
* **Note**: Contextual toolbars take precedence over regular toolbars.
|
|
258
|
+
*/
|
|
259
|
+
private _getFocusableCandidateToolbarDefinitions;
|
|
260
|
+
/**
|
|
261
|
+
* Returns a definition of the toolbar that is currently visible and focused (one of its children has focus).
|
|
262
|
+
*
|
|
263
|
+
* `null` is returned when no toolbar is currently focused.
|
|
264
|
+
*/
|
|
265
|
+
private _getCurrentFocusedToolbarDefinition;
|
|
266
|
+
/**
|
|
267
|
+
* Focuses a focusable toolbar candidate using its definition.
|
|
268
|
+
*
|
|
269
|
+
* @param candidateToolbarDefinition A definition of the toolbar to focus.
|
|
270
|
+
* @returns `true` when the toolbar candidate was focused. `false` otherwise.
|
|
271
|
+
*/
|
|
272
|
+
private _focusFocusableCandidateToolbar;
|
|
273
|
+
/**
|
|
274
|
+
* Provides an integration between {@link #viewportOffset} and {@link module:utils/dom/scroll~scrollViewportToShowTarget}.
|
|
275
|
+
* It allows the UI-agnostic engine method to consider user-configured viewport offsets specific for the integration.
|
|
276
|
+
*
|
|
277
|
+
* @param evt The `scrollToTheSelection` event info.
|
|
278
|
+
* @param data The payload carried by the `scrollToTheSelection` event.
|
|
279
|
+
*/
|
|
280
|
+
private _handleScrollToTheSelection;
|
|
281
|
+
/**
|
|
282
|
+
* Ensures that the focus tracker is aware of all views' DOM elements in the body collection.
|
|
283
|
+
*/
|
|
284
|
+
private _bindBodyCollectionWithFocusTracker;
|
|
285
|
+
/**
|
|
286
|
+
* Set initial viewport offset and setup visualTop augmentation.
|
|
287
|
+
*/
|
|
288
|
+
private _initViewportOffset;
|
|
289
|
+
/**
|
|
290
|
+
* Listen to visual viewport changes and update the viewportOffset with the visualTop property
|
|
291
|
+
* according to the visible part of it (visual viewport).
|
|
292
|
+
*/
|
|
293
|
+
private _initVisualViewportSupport;
|
|
294
|
+
/**
|
|
295
|
+
* Calculate the viewport top offset according to the visible part of it (visual viewport).
|
|
296
|
+
*/
|
|
297
|
+
private _getVisualViewportTopOffset;
|
|
301
298
|
}
|
|
302
299
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
300
|
+
* Fired when the editor UI is ready.
|
|
301
|
+
*
|
|
302
|
+
* Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.
|
|
303
|
+
*
|
|
304
|
+
* @eventName ~EditorUI#ready
|
|
305
|
+
*/
|
|
309
306
|
export type EditorUIReadyEvent = {
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
name: "ready";
|
|
308
|
+
args: [];
|
|
312
309
|
};
|
|
313
310
|
/**
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
311
|
+
* Fired whenever the UI (all related components) should be refreshed.
|
|
312
|
+
*
|
|
313
|
+
* **Note:**: The event is fired after each {@link module:engine/view/document~ViewDocument#event:layoutChanged}.
|
|
314
|
+
* It can also be fired manually via the {@link module:ui/editorui/editorui~EditorUI#update} method.
|
|
315
|
+
*
|
|
316
|
+
* @eventName ~EditorUI#update
|
|
317
|
+
*/
|
|
321
318
|
export type EditorUIUpdateEvent = {
|
|
322
|
-
|
|
323
|
-
|
|
319
|
+
name: "update";
|
|
320
|
+
args: [];
|
|
324
321
|
};
|
|
325
322
|
/**
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
* A definition of a focusable toolbar. Used by {@link module:ui/editorui/editorui~EditorUI#addToolbar}.
|
|
324
|
+
*/
|
|
328
325
|
export interface FocusableToolbarDefinition {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
326
|
+
/**
|
|
327
|
+
* An instance of a focusable toolbar view.
|
|
328
|
+
*/
|
|
329
|
+
toolbarView: ToolbarView;
|
|
330
|
+
/**
|
|
331
|
+
* Options of a focusable toolbar view:
|
|
332
|
+
*
|
|
333
|
+
* * `isContextual`: Marks the higher priority toolbar. For example when there are 2 visible toolbars,
|
|
334
|
+
* it allows to distinguish which toolbar should be focused first after the `alt+f10` keystroke
|
|
335
|
+
* * `beforeFocus`: A callback executed before the `ToolbarView` gains focus upon the `Alt+F10` keystroke.
|
|
336
|
+
* * `afterBlur`: A callback executed after `ToolbarView` loses focus upon `Esc` keystroke but before
|
|
337
|
+
* the focus goes back to the `origin`.
|
|
338
|
+
*/
|
|
339
|
+
options: FocusableToolbarOptions;
|
|
343
340
|
}
|
|
344
341
|
export interface FocusableToolbarOptions {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
342
|
+
/**
|
|
343
|
+
* Set `true` if the toolbar is attached to the content of the editor. Such toolbar takes
|
|
344
|
+
* a precedence over other toolbars when a user pressed <kbd>Alt</kbd> + <kbd>F10</kbd>.
|
|
345
|
+
*/
|
|
346
|
+
isContextual?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Specify a callback executed before the toolbar instance DOM element gains focus
|
|
349
|
+
* upon the <kbd>Alt</kbd> + <kbd>F10</kbd> keystroke.
|
|
350
|
+
*/
|
|
351
|
+
beforeFocus?: () => void;
|
|
352
|
+
/**
|
|
353
|
+
* Specify a callback executed after the toolbar instance DOM element loses focus upon
|
|
354
|
+
* <kbd>Esc</kbd> keystroke but before the focus goes back to the {@link ~EditorUI#setEditableElement editable element}.
|
|
355
|
+
*/
|
|
356
|
+
afterBlur?: () => void;
|
|
360
357
|
}
|
|
361
358
|
export interface ViewportOffset extends ViewportOffsetConfig {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
359
|
+
/**
|
|
360
|
+
* The top offset of the visual viewport.
|
|
361
|
+
*
|
|
362
|
+
* This value is calculated based on the visual viewport position.
|
|
363
|
+
*/
|
|
364
|
+
visualTop?: number;
|
|
368
365
|
}
|
|
369
366
|
export {};
|