@ckeditor/ckeditor5-core 48.2.0 → 48.3.0-alpha.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/dist/accessibility.d.ts +339 -339
- package/dist/augmentation.d.ts +8 -8
- package/dist/command.d.ts +188 -191
- package/dist/commandcollection.d.ts +76 -76
- package/dist/context.d.ts +238 -238
- package/dist/contextplugin.d.ts +57 -60
- package/dist/editingkeystrokehandler.d.ts +49 -49
- package/dist/editor/editor.d.ts +538 -576
- package/dist/editor/editorconfig.d.ts +1674 -1634
- package/dist/editor/utils/attachtoform.d.ts +12 -12
- package/dist/editor/utils/editorusagedata.d.ts +51 -51
- package/dist/editor/utils/elementapimixin.d.ts +39 -29
- package/dist/editor/utils/normalizerootsconfig.d.ts +65 -65
- package/dist/editor/utils/registerandinitializerootconfigattributes.d.ts +16 -12
- package/dist/editor/utils/rootacceptsblocks.d.ts +13 -13
- package/dist/editor/utils/securesourceelement.d.ts +13 -13
- package/dist/editor/utils/verifyrootelements.d.ts +8 -8
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +3416 -3459
- package/dist/index.js.map +1 -1
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/multicommand.d.ts +61 -61
- package/dist/pendingactions.d.ts +111 -111
- package/dist/plugin.d.ts +291 -283
- package/dist/plugincollection.d.ts +109 -108
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/dist/typings.d.ts +10 -7
- package/package.json +5 -5
package/dist/accessibility.d.ts
CHANGED
|
@@ -1,364 +1,364 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { type Editor } from
|
|
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
|
+
import { type Editor } from "./editor/editor.js";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
9
|
export declare const DEFAULT_GROUP_ID: "common";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
* A common namespace for various accessibility features of the editor.
|
|
12
|
+
*
|
|
13
|
+
* **Information about editor keystrokes**
|
|
14
|
+
*
|
|
15
|
+
* * The information about keystrokes available in the editor is stored in the {@link #keystrokeInfos} property.
|
|
16
|
+
* * New info entries can be added using the {@link #addKeystrokeInfoCategory}, {@link #addKeystrokeInfoGroup},
|
|
17
|
+
* and {@link #addKeystrokeInfos} methods.
|
|
18
|
+
*/
|
|
19
19
|
export declare class Accessibility {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Stores information about keystrokes brought by editor features for the users to interact with the editor, mainly
|
|
22
|
+
* keystroke combinations and their accessible labels.
|
|
23
|
+
*
|
|
24
|
+
* This information is particularly useful for screen reader and other assistive technology users. It gets displayed
|
|
25
|
+
* by the {@link module:ui/editorui/accessibilityhelp/accessibilityhelp~AccessibilityHelp Accessibility help} dialog.
|
|
26
|
+
*
|
|
27
|
+
* Keystrokes are organized in categories and groups. They can be added using ({@link #addKeystrokeInfoCategory},
|
|
28
|
+
* {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}) methods.
|
|
29
|
+
*
|
|
30
|
+
* Please note that:
|
|
31
|
+
* * two categories are always available:
|
|
32
|
+
* * `'contentEditing'` for keystrokes related to content creation,
|
|
33
|
+
* * `'navigation'` for keystrokes related to navigation in the UI and the content.
|
|
34
|
+
* * unless specified otherwise, new keystrokes are added into the `'contentEditing'` category and the `'common'`
|
|
35
|
+
* keystroke group within that category while using the {@link #addKeystrokeInfos} method.
|
|
36
|
+
*/
|
|
37
|
+
readonly keystrokeInfos: KeystrokeInfoDefinitions;
|
|
38
|
+
/**
|
|
39
|
+
* The editor instance.
|
|
40
|
+
*/
|
|
41
|
+
private readonly _editor;
|
|
42
|
+
/**
|
|
43
|
+
* @inheritDoc
|
|
44
|
+
*/
|
|
45
|
+
constructor(editor: Editor);
|
|
46
|
+
/**
|
|
47
|
+
* Adds a top-level category in the {@link #keystrokeInfos keystroke information database} with a label and optional description.
|
|
48
|
+
*
|
|
49
|
+
* Categories organize keystrokes and help users to find the right keystroke. Each category can have multiple groups
|
|
50
|
+
* of keystrokes that narrow down the context in which the keystrokes are available. Every keystroke category comes
|
|
51
|
+
* with a `'common'` group by default.
|
|
52
|
+
*
|
|
53
|
+
* By default, two categories are available:
|
|
54
|
+
* * `'contentEditing'` for keystrokes related to content creation,
|
|
55
|
+
* * `'navigation'` for keystrokes related to navigation in the UI and the content.
|
|
56
|
+
*
|
|
57
|
+
* To create a new keystroke category with new groups, use the following code:
|
|
58
|
+
*
|
|
59
|
+
* ```js
|
|
60
|
+
* class MyPlugin extends Plugin {
|
|
61
|
+
* // ...
|
|
62
|
+
* init() {
|
|
63
|
+
* const editor = this.editor;
|
|
64
|
+
* const t = editor.t;
|
|
65
|
+
*
|
|
66
|
+
* // ...
|
|
67
|
+
*
|
|
68
|
+
* editor.accessibility.addKeystrokeInfoCategory( {
|
|
69
|
+
* id: 'myCategory',
|
|
70
|
+
* label: t( 'My category' ),
|
|
71
|
+
* description: t( 'My category description.' ),
|
|
72
|
+
* groups: [
|
|
73
|
+
* {
|
|
74
|
+
* id: 'myGroup',
|
|
75
|
+
* label: t( 'My keystroke group' ),
|
|
76
|
+
* keystrokes: [
|
|
77
|
+
* {
|
|
78
|
+
* label: t( 'Keystroke label 1' ),
|
|
79
|
+
* keystroke: 'Ctrl+Shift+N'
|
|
80
|
+
* },
|
|
81
|
+
* {
|
|
82
|
+
* label: t( 'Keystroke label 2' ),
|
|
83
|
+
* keystroke: 'Ctrl+Shift+M'
|
|
84
|
+
* }
|
|
85
|
+
* ]
|
|
86
|
+
* }
|
|
87
|
+
* ]
|
|
88
|
+
* };
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfos}.
|
|
94
|
+
*/
|
|
95
|
+
addKeystrokeInfoCategory({ id, label, description, groups }: AddKeystrokeInfoCategoryData): void;
|
|
96
|
+
/**
|
|
97
|
+
* Adds a group of keystrokes in a specific category to the {@link #keystrokeInfos keystroke information database}.
|
|
98
|
+
*
|
|
99
|
+
* Groups narrow down the context in which the keystrokes are available. When `categoryId` is not specified,
|
|
100
|
+
* the group goes to the `'contentEditing'` category (default).
|
|
101
|
+
*
|
|
102
|
+
* To create a new group within an existing category, use the following code:
|
|
103
|
+
*
|
|
104
|
+
* ```js
|
|
105
|
+
* class MyPlugin extends Plugin {
|
|
106
|
+
* // ...
|
|
107
|
+
* init() {
|
|
108
|
+
* const editor = this.editor;
|
|
109
|
+
* const t = editor.t;
|
|
110
|
+
*
|
|
111
|
+
* // ...
|
|
112
|
+
*
|
|
113
|
+
* editor.accessibility.addKeystrokeInfoGroup( {
|
|
114
|
+
* id: 'myGroup',
|
|
115
|
+
* categoryId: 'navigation',
|
|
116
|
+
* label: t( 'My keystroke group' ),
|
|
117
|
+
* keystrokes: [
|
|
118
|
+
* {
|
|
119
|
+
* label: t( 'Keystroke label 1' ),
|
|
120
|
+
* keystroke: 'Ctrl+Shift+N'
|
|
121
|
+
* },
|
|
122
|
+
* {
|
|
123
|
+
* label: t( 'Keystroke label 2' ),
|
|
124
|
+
* keystroke: 'Ctrl+Shift+M'
|
|
125
|
+
* }
|
|
126
|
+
* ]
|
|
127
|
+
* } );
|
|
128
|
+
* }
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*
|
|
132
|
+
* See {@link #keystrokeInfos}, {@link #addKeystrokeInfoCategory}, and {@link #addKeystrokeInfos}.
|
|
133
|
+
*/
|
|
134
|
+
addKeystrokeInfoGroup({ categoryId, id, label, keystrokes }: AddKeystrokeInfoGroupData): void;
|
|
135
|
+
/**
|
|
136
|
+
* Adds information about keystrokes to the {@link #keystrokeInfos keystroke information database}.
|
|
137
|
+
*
|
|
138
|
+
* Keystrokes without specified `groupId` or `categoryId` go to the `'common'` group in the `'contentEditing'` category (default).
|
|
139
|
+
*
|
|
140
|
+
* To add a keystroke brought by your plugin (using default group and category), use the following code:
|
|
141
|
+
*
|
|
142
|
+
* ```js
|
|
143
|
+
* class MyPlugin extends Plugin {
|
|
144
|
+
* // ...
|
|
145
|
+
* init() {
|
|
146
|
+
* const editor = this.editor;
|
|
147
|
+
* const t = editor.t;
|
|
148
|
+
*
|
|
149
|
+
* // ...
|
|
150
|
+
*
|
|
151
|
+
* editor.accessibility.addKeystrokeInfos( {
|
|
152
|
+
* keystrokes: [
|
|
153
|
+
* {
|
|
154
|
+
* label: t( 'Keystroke label' ),
|
|
155
|
+
* keystroke: 'CTRL+B'
|
|
156
|
+
* }
|
|
157
|
+
* ]
|
|
158
|
+
* } );
|
|
159
|
+
* }
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
162
|
+
* To add a keystroke in a specific existing `'widget'` group in the default `'contentEditing'` category:
|
|
163
|
+
*
|
|
164
|
+
* ```js
|
|
165
|
+
* class MyPlugin extends Plugin {
|
|
166
|
+
* // ...
|
|
167
|
+
* init() {
|
|
168
|
+
* const editor = this.editor;
|
|
169
|
+
* const t = editor.t;
|
|
170
|
+
*
|
|
171
|
+
* // ...
|
|
172
|
+
*
|
|
173
|
+
* editor.accessibility.addKeystrokeInfos( {
|
|
174
|
+
* // Add a keystroke to the existing "widget" group.
|
|
175
|
+
* groupId: 'widget',
|
|
176
|
+
* keystrokes: [
|
|
177
|
+
* {
|
|
178
|
+
* label: t( 'A an action on a selected widget' ),
|
|
179
|
+
* keystroke: 'Ctrl+D',
|
|
180
|
+
* }
|
|
181
|
+
* ]
|
|
182
|
+
* } );
|
|
183
|
+
* }
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* To add a keystroke to another existing category (using default group):
|
|
188
|
+
*
|
|
189
|
+
* ```js
|
|
190
|
+
* class MyPlugin extends Plugin {
|
|
191
|
+
* // ...
|
|
192
|
+
* init() {
|
|
193
|
+
* const editor = this.editor;
|
|
194
|
+
* const t = editor.t;
|
|
195
|
+
*
|
|
196
|
+
* // ...
|
|
197
|
+
*
|
|
198
|
+
* editor.accessibility.addKeystrokeInfos( {
|
|
199
|
+
* // Add keystrokes to the "navigation" category (one of defaults).
|
|
200
|
+
* categoryId: 'navigation',
|
|
201
|
+
* keystrokes: [
|
|
202
|
+
* {
|
|
203
|
+
* label: t( 'Keystroke label' ),
|
|
204
|
+
* keystroke: 'CTRL+B'
|
|
205
|
+
* }
|
|
206
|
+
* ]
|
|
207
|
+
* } );
|
|
208
|
+
* }
|
|
209
|
+
* }
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* See {@link #keystrokeInfos}, {@link #addKeystrokeInfoGroup}, and {@link #addKeystrokeInfoCategory}.
|
|
213
|
+
*/
|
|
214
|
+
addKeystrokeInfos({ categoryId, groupId, keystrokes }: AddKeystrokeInfosData): void;
|
|
215
215
|
}
|
|
216
216
|
/**
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
217
|
+
* A description of category of keystrokes accepted by the {@link module:core/accessibility~Accessibility#addKeystrokeInfoCategory} method.
|
|
218
|
+
*
|
|
219
|
+
* Top-level categories organize keystrokes and help users to find the right keystroke. Each category can have multiple groups of
|
|
220
|
+
* keystrokes that narrow down the context in which the keystrokes are available.
|
|
221
|
+
*
|
|
222
|
+
* See {@link module:core/accessibility~Accessibility#addKeystrokeInfoGroup} and
|
|
223
|
+
* {@link module:core/accessibility~Accessibility#addKeystrokeInfos}.
|
|
224
|
+
*/
|
|
225
225
|
export interface AddKeystrokeInfoCategoryData {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
226
|
+
/**
|
|
227
|
+
* The unique id of the category.
|
|
228
|
+
*/
|
|
229
|
+
id: string;
|
|
230
|
+
/**
|
|
231
|
+
* The label of the category.
|
|
232
|
+
*/
|
|
233
|
+
label: string;
|
|
234
|
+
/**
|
|
235
|
+
* The description of the category (optional).
|
|
236
|
+
*/
|
|
237
|
+
description?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Groups of keystrokes within the category.
|
|
240
|
+
*/
|
|
241
|
+
groups?: Array<AddKeystrokeInfoGroupData>;
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
244
|
+
* A description of keystroke group accepted by the {@link module:core/accessibility~Accessibility#addKeystrokeInfoGroup} method.
|
|
245
|
+
*
|
|
246
|
+
* Groups narrow down the context in which the keystrokes are available. When `categoryId` is not specified, the group goes
|
|
247
|
+
* to the `'contentEditing'` category (default).
|
|
248
|
+
*
|
|
249
|
+
* See {@link module:core/accessibility~Accessibility#addKeystrokeInfoCategory} and
|
|
250
|
+
* {@link module:core/accessibility~Accessibility#addKeystrokeInfos}.
|
|
251
|
+
*/
|
|
252
252
|
export interface AddKeystrokeInfoGroupData {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
253
|
+
/**
|
|
254
|
+
* The category id the group belongs to.
|
|
255
|
+
*/
|
|
256
|
+
categoryId?: string;
|
|
257
|
+
/**
|
|
258
|
+
* The unique id of the group.
|
|
259
|
+
*/
|
|
260
|
+
id: string;
|
|
261
|
+
/**
|
|
262
|
+
* The label of the group (optional).
|
|
263
|
+
*/
|
|
264
|
+
label?: string;
|
|
265
|
+
/**
|
|
266
|
+
* Keystroke definitions within the group.
|
|
267
|
+
*/
|
|
268
|
+
keystrokes?: Array<KeystrokeInfoDefinition>;
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
271
|
+
* Description of keystrokes accepted by the {@link module:core/accessibility~Accessibility#addKeystrokeInfos} method.
|
|
272
|
+
*
|
|
273
|
+
* Keystrokes without specified `groupId` or `categoryId` go to the `'common'` group in the `'contentEditing'` category (default).
|
|
274
|
+
*
|
|
275
|
+
* See {@link module:core/accessibility~Accessibility#addKeystrokeInfoCategory} and
|
|
276
|
+
* {@link module:core/accessibility~Accessibility#addKeystrokeInfoGroup}.
|
|
277
|
+
*/
|
|
278
278
|
export interface AddKeystrokeInfosData {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
279
|
+
/**
|
|
280
|
+
* The category id the keystrokes belong to.
|
|
281
|
+
*/
|
|
282
|
+
categoryId?: string;
|
|
283
|
+
/**
|
|
284
|
+
* The group id the keystrokes belong to.
|
|
285
|
+
*/
|
|
286
|
+
groupId?: string;
|
|
287
|
+
/**
|
|
288
|
+
* An array of keystroke definitions.
|
|
289
|
+
*/
|
|
290
|
+
keystrokes: Array<KeystrokeInfoDefinition>;
|
|
291
291
|
}
|
|
292
292
|
export type KeystrokeInfoDefinitions = Map<string, KeystrokeInfoCategoryDefinition>;
|
|
293
293
|
/**
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
* A category of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
|
|
295
|
+
*/
|
|
296
296
|
export type KeystrokeInfoCategoryDefinition = {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
297
|
+
/**
|
|
298
|
+
* The unique id of the category.
|
|
299
|
+
*/
|
|
300
|
+
id: string;
|
|
301
|
+
/**
|
|
302
|
+
* The label of the category.
|
|
303
|
+
*/
|
|
304
|
+
label: string;
|
|
305
|
+
/**
|
|
306
|
+
* The description of the category (optional).
|
|
307
|
+
*/
|
|
308
|
+
description?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Groups of keystrokes within the category.
|
|
311
|
+
*/
|
|
312
|
+
groups: Map<string, KeystrokeInfoGroupDefinition>;
|
|
313
313
|
};
|
|
314
314
|
/**
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
* A group of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
|
|
316
|
+
*/
|
|
317
317
|
export type KeystrokeInfoGroupDefinition = {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
318
|
+
/**
|
|
319
|
+
* The unique id of the group.
|
|
320
|
+
*/
|
|
321
|
+
id: string;
|
|
322
|
+
/**
|
|
323
|
+
* The label of the group (optional).
|
|
324
|
+
*/
|
|
325
|
+
label?: string;
|
|
326
|
+
/**
|
|
327
|
+
* Keystroke definitions within the group.
|
|
328
|
+
*/
|
|
329
|
+
keystrokes: Array<KeystrokeInfoDefinition>;
|
|
330
330
|
};
|
|
331
331
|
/**
|
|
332
|
-
|
|
333
|
-
|
|
332
|
+
* A keystroke info definition in {@link module:core/accessibility~Accessibility#keystrokeInfos}
|
|
333
|
+
*/
|
|
334
334
|
export interface KeystrokeInfoDefinition {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
335
|
+
/**
|
|
336
|
+
* The label of the keystroke. It should briefly describe the action that the keystroke performs. It may contain HTML.
|
|
337
|
+
*/
|
|
338
|
+
label: string;
|
|
339
|
+
/**
|
|
340
|
+
* The keystroke string. In its basic form, it must be a combination of {@link module:utils/keyboard#keyCodes known key names}
|
|
341
|
+
* joined by the `+` sign, the same as the keystroke format accepted by the
|
|
342
|
+
* {@link module:utils/keystrokehandler~KeystrokeHandler#set `KeystrokeHandler#set()`} method used to register most of the
|
|
343
|
+
* keystroke interactions in the editor.
|
|
344
|
+
*
|
|
345
|
+
* * The keystroke string can represent a single keystroke, for instance: `keystroke: 'Ctrl+B'`, `keystroke: 'Shift+Enter'`,
|
|
346
|
+
* `keystroke: 'Alt+F10'`, etc.
|
|
347
|
+
* * The keystroke can be activated by successive press of multiple keys. For instance `keystroke: [ [ 'arrowleft', 'arrowleft' ] ]`
|
|
348
|
+
* will indicate that a specific action will be performed by pressing <kbd>←</kbd> twice in a row.
|
|
349
|
+
* * Keystrokes can have alternatives. For instance `keystroke: [ [ 'Ctrl+Y' ], [ 'Ctrl+Shift+Z' ] ]` will indicate that
|
|
350
|
+
* a specific action can be performed by pressing either <kbd>Ctrl</kbd> + <kbd>Y</kbd> or
|
|
351
|
+
* <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Z</kbd>.
|
|
352
|
+
*
|
|
353
|
+
* Please note that the keystrokes are automatically translated to the environment-specific form. For example, `Ctrl+A`
|
|
354
|
+
* will be rendered as `⌘A` in the {@link module:utils/env~EnvType#isMac Mac environment}. Always use the IBM PC keyboard
|
|
355
|
+
* syntax, for instance `Ctrl` instead of `⌘`, `Alt` instead of `⌥`, etc.
|
|
356
|
+
*/
|
|
357
|
+
keystroke: string | Array<string> | Array<Array<string>>;
|
|
358
|
+
/**
|
|
359
|
+
* This (optional) flag suggests that the keystroke(s) may require a function (<kbd>Fn</kbd>) key to be pressed
|
|
360
|
+
* in order to work in the {@link module:utils/env~EnvType#isMac Mac environment}. If set `true`, an additional
|
|
361
|
+
* information will be displayed next to the keystroke.
|
|
362
|
+
*/
|
|
363
|
+
mayRequireFn?: boolean;
|
|
364
364
|
}
|