@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.
Files changed (174) hide show
  1. package/dist/accessibility.d.ts +339 -339
  2. package/dist/augmentation.d.ts +8 -8
  3. package/dist/command.d.ts +188 -191
  4. package/dist/commandcollection.d.ts +76 -76
  5. package/dist/context.d.ts +238 -238
  6. package/dist/contextplugin.d.ts +57 -60
  7. package/dist/editingkeystrokehandler.d.ts +49 -49
  8. package/dist/editor/editor.d.ts +538 -576
  9. package/dist/editor/editorconfig.d.ts +1674 -1634
  10. package/dist/editor/utils/attachtoform.d.ts +12 -12
  11. package/dist/editor/utils/editorusagedata.d.ts +51 -51
  12. package/dist/editor/utils/elementapimixin.d.ts +39 -29
  13. package/dist/editor/utils/normalizerootsconfig.d.ts +65 -65
  14. package/dist/editor/utils/registerandinitializerootconfigattributes.d.ts +16 -12
  15. package/dist/editor/utils/rootacceptsblocks.d.ts +13 -13
  16. package/dist/editor/utils/securesourceelement.d.ts +13 -13
  17. package/dist/editor/utils/verifyrootelements.d.ts +8 -8
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.ts +27 -27
  20. package/dist/index.js +3416 -3459
  21. package/dist/index.js.map +1 -1
  22. package/dist/legacyerrors.d.ts +0 -4
  23. package/dist/multicommand.d.ts +61 -61
  24. package/dist/pendingactions.d.ts +111 -111
  25. package/dist/plugin.d.ts +291 -283
  26. package/dist/plugincollection.d.ts +109 -108
  27. package/dist/translations/af.js +1 -1
  28. package/dist/translations/af.umd.js +1 -1
  29. package/dist/translations/ar.js +1 -1
  30. package/dist/translations/ar.umd.js +1 -1
  31. package/dist/translations/ast.js +1 -1
  32. package/dist/translations/ast.umd.js +1 -1
  33. package/dist/translations/az.js +1 -1
  34. package/dist/translations/az.umd.js +1 -1
  35. package/dist/translations/be.js +1 -1
  36. package/dist/translations/be.umd.js +1 -1
  37. package/dist/translations/bg.js +1 -1
  38. package/dist/translations/bg.umd.js +1 -1
  39. package/dist/translations/bn.js +1 -1
  40. package/dist/translations/bn.umd.js +1 -1
  41. package/dist/translations/bs.js +1 -1
  42. package/dist/translations/bs.umd.js +1 -1
  43. package/dist/translations/ca.js +1 -1
  44. package/dist/translations/ca.umd.js +1 -1
  45. package/dist/translations/cs.js +1 -1
  46. package/dist/translations/cs.umd.js +1 -1
  47. package/dist/translations/da.js +1 -1
  48. package/dist/translations/da.umd.js +1 -1
  49. package/dist/translations/de-ch.js +1 -1
  50. package/dist/translations/de-ch.umd.js +1 -1
  51. package/dist/translations/de.js +1 -1
  52. package/dist/translations/de.umd.js +1 -1
  53. package/dist/translations/el.js +1 -1
  54. package/dist/translations/el.umd.js +1 -1
  55. package/dist/translations/en-au.js +1 -1
  56. package/dist/translations/en-au.umd.js +1 -1
  57. package/dist/translations/en-gb.js +1 -1
  58. package/dist/translations/en-gb.umd.js +1 -1
  59. package/dist/translations/en.js +1 -1
  60. package/dist/translations/en.umd.js +1 -1
  61. package/dist/translations/eo.js +1 -1
  62. package/dist/translations/eo.umd.js +1 -1
  63. package/dist/translations/es-co.js +1 -1
  64. package/dist/translations/es-co.umd.js +1 -1
  65. package/dist/translations/es.js +1 -1
  66. package/dist/translations/es.umd.js +1 -1
  67. package/dist/translations/et.js +1 -1
  68. package/dist/translations/et.umd.js +1 -1
  69. package/dist/translations/eu.js +1 -1
  70. package/dist/translations/eu.umd.js +1 -1
  71. package/dist/translations/fa.js +1 -1
  72. package/dist/translations/fa.umd.js +1 -1
  73. package/dist/translations/fi.js +1 -1
  74. package/dist/translations/fi.umd.js +1 -1
  75. package/dist/translations/fr.js +1 -1
  76. package/dist/translations/fr.umd.js +1 -1
  77. package/dist/translations/gl.js +1 -1
  78. package/dist/translations/gl.umd.js +1 -1
  79. package/dist/translations/gu.js +1 -1
  80. package/dist/translations/gu.umd.js +1 -1
  81. package/dist/translations/he.js +1 -1
  82. package/dist/translations/he.umd.js +1 -1
  83. package/dist/translations/hi.js +1 -1
  84. package/dist/translations/hi.umd.js +1 -1
  85. package/dist/translations/hr.js +1 -1
  86. package/dist/translations/hr.umd.js +1 -1
  87. package/dist/translations/hu.js +1 -1
  88. package/dist/translations/hu.umd.js +1 -1
  89. package/dist/translations/hy.js +1 -1
  90. package/dist/translations/hy.umd.js +1 -1
  91. package/dist/translations/id.js +1 -1
  92. package/dist/translations/id.umd.js +1 -1
  93. package/dist/translations/it.js +1 -1
  94. package/dist/translations/it.umd.js +1 -1
  95. package/dist/translations/ja.js +1 -1
  96. package/dist/translations/ja.umd.js +1 -1
  97. package/dist/translations/jv.js +1 -1
  98. package/dist/translations/jv.umd.js +1 -1
  99. package/dist/translations/kk.js +1 -1
  100. package/dist/translations/kk.umd.js +1 -1
  101. package/dist/translations/km.js +1 -1
  102. package/dist/translations/km.umd.js +1 -1
  103. package/dist/translations/kn.js +1 -1
  104. package/dist/translations/kn.umd.js +1 -1
  105. package/dist/translations/ko.js +1 -1
  106. package/dist/translations/ko.umd.js +1 -1
  107. package/dist/translations/ku.js +1 -1
  108. package/dist/translations/ku.umd.js +1 -1
  109. package/dist/translations/lt.js +1 -1
  110. package/dist/translations/lt.umd.js +1 -1
  111. package/dist/translations/lv.js +1 -1
  112. package/dist/translations/lv.umd.js +1 -1
  113. package/dist/translations/ms.js +1 -1
  114. package/dist/translations/ms.umd.js +1 -1
  115. package/dist/translations/nb.js +1 -1
  116. package/dist/translations/nb.umd.js +1 -1
  117. package/dist/translations/ne.js +1 -1
  118. package/dist/translations/ne.umd.js +1 -1
  119. package/dist/translations/nl.js +1 -1
  120. package/dist/translations/nl.umd.js +1 -1
  121. package/dist/translations/no.js +1 -1
  122. package/dist/translations/no.umd.js +1 -1
  123. package/dist/translations/oc.js +1 -1
  124. package/dist/translations/oc.umd.js +1 -1
  125. package/dist/translations/pl.js +1 -1
  126. package/dist/translations/pl.umd.js +1 -1
  127. package/dist/translations/pt-br.js +1 -1
  128. package/dist/translations/pt-br.umd.js +1 -1
  129. package/dist/translations/pt.js +1 -1
  130. package/dist/translations/pt.umd.js +1 -1
  131. package/dist/translations/ro.js +1 -1
  132. package/dist/translations/ro.umd.js +1 -1
  133. package/dist/translations/ru.js +1 -1
  134. package/dist/translations/ru.umd.js +1 -1
  135. package/dist/translations/si.js +1 -1
  136. package/dist/translations/si.umd.js +1 -1
  137. package/dist/translations/sk.js +1 -1
  138. package/dist/translations/sk.umd.js +1 -1
  139. package/dist/translations/sl.js +1 -1
  140. package/dist/translations/sl.umd.js +1 -1
  141. package/dist/translations/sq.js +1 -1
  142. package/dist/translations/sq.umd.js +1 -1
  143. package/dist/translations/sr-latn.js +1 -1
  144. package/dist/translations/sr-latn.umd.js +1 -1
  145. package/dist/translations/sr.js +1 -1
  146. package/dist/translations/sr.umd.js +1 -1
  147. package/dist/translations/sv.js +1 -1
  148. package/dist/translations/sv.umd.js +1 -1
  149. package/dist/translations/th.js +1 -1
  150. package/dist/translations/th.umd.js +1 -1
  151. package/dist/translations/ti.js +1 -1
  152. package/dist/translations/ti.umd.js +1 -1
  153. package/dist/translations/tk.js +1 -1
  154. package/dist/translations/tk.umd.js +1 -1
  155. package/dist/translations/tr.js +1 -1
  156. package/dist/translations/tr.umd.js +1 -1
  157. package/dist/translations/tt.js +1 -1
  158. package/dist/translations/tt.umd.js +1 -1
  159. package/dist/translations/ug.js +1 -1
  160. package/dist/translations/ug.umd.js +1 -1
  161. package/dist/translations/uk.js +1 -1
  162. package/dist/translations/uk.umd.js +1 -1
  163. package/dist/translations/ur.js +1 -1
  164. package/dist/translations/ur.umd.js +1 -1
  165. package/dist/translations/uz.js +1 -1
  166. package/dist/translations/uz.umd.js +1 -1
  167. package/dist/translations/vi.js +1 -1
  168. package/dist/translations/vi.umd.js +1 -1
  169. package/dist/translations/zh-cn.js +1 -1
  170. package/dist/translations/zh-cn.umd.js +1 -1
  171. package/dist/translations/zh.js +1 -1
  172. package/dist/translations/zh.umd.js +1 -1
  173. package/dist/typings.d.ts +10 -7
  174. package/package.json +5 -5
@@ -1,364 +1,364 @@
1
1
  /**
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';
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
- * @internal
8
- */
7
+ * @internal
8
+ */
9
9
  export declare const DEFAULT_GROUP_ID: "common";
10
10
  /**
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
- */
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
- * 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;
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
- * 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
- */
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
- * 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>;
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
- * 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
- */
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
- * 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>;
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
- * 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
- */
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
- * 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>;
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
- * A category of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
295
- */
294
+ * A category of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
295
+ */
296
296
  export type KeystrokeInfoCategoryDefinition = {
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>;
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
- * A group of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
316
- */
315
+ * A group of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
316
+ */
317
317
  export type KeystrokeInfoGroupDefinition = {
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>;
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
- * A keystroke info definition in {@link module:core/accessibility~Accessibility#keystrokeInfos}
333
- */
332
+ * A keystroke info definition in {@link module:core/accessibility~Accessibility#keystrokeInfos}
333
+ */
334
334
  export interface KeystrokeInfoDefinition {
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;
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
  }