@ckeditor/ckeditor5-utils 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/abortabledebounce.d.ts +19 -13
- package/dist/areconnectedthroughproperties.d.ts +7 -7
- package/dist/ckeditorerror.d.ts +113 -113
- package/dist/collection.d.ts +419 -415
- package/dist/collectstylesheets.d.ts +9 -9
- package/dist/comparearrays.d.ts +25 -25
- package/dist/config.d.ts +159 -156
- package/dist/count.d.ts +14 -14
- package/dist/crc32.d.ts +19 -19
- package/dist/decodelicensekey.d.ts +7 -7
- package/dist/delay.d.ts +13 -13
- package/dist/diff.d.ts +32 -27
- package/dist/difftochanges.d.ts +47 -47
- package/dist/dom/createelement.d.ts +43 -43
- package/dist/dom/emittermixin.d.ts +144 -135
- package/dist/dom/findclosestscrollableancestor.d.ts +8 -8
- package/dist/dom/getancestors.d.ts +13 -13
- package/dist/dom/getborderwidths.d.ts +16 -16
- package/dist/dom/getcommonancestor.d.ts +9 -9
- package/dist/dom/getdatafromelement.d.ts +10 -10
- package/dist/dom/getpositionedancestor.d.ts +7 -7
- package/dist/dom/getrangefrommouseevent.d.ts +12 -12
- package/dist/dom/getvisualviewportoffset.d.ts +7 -7
- package/dist/dom/global.d.ts +24 -24
- package/dist/dom/indexof.d.ts +10 -10
- package/dist/dom/insertat.d.ts +11 -11
- package/dist/dom/iscomment.d.ts +7 -7
- package/dist/dom/isnode.d.ts +7 -7
- package/dist/dom/isrange.d.ts +7 -7
- package/dist/dom/istext.d.ts +7 -7
- package/dist/dom/isvalidattributename.d.ts +7 -7
- package/dist/dom/isvisible.d.ts +12 -12
- package/dist/dom/iswindow.d.ts +7 -7
- package/dist/dom/position.d.ts +200 -200
- package/dist/dom/rect.d.ts +194 -194
- package/dist/dom/remove.d.ts +9 -9
- package/dist/dom/resizeobserver.d.ts +70 -70
- package/dist/dom/scroll.d.ts +75 -72
- package/dist/dom/setdatainelement.d.ts +10 -10
- package/dist/dom/tounit.d.ts +16 -16
- package/dist/elementreplacer.d.ts +26 -26
- package/dist/emittermixin.d.ts +290 -280
- package/dist/env.d.ts +124 -124
- package/dist/eventinfo.d.ts +58 -55
- package/dist/fastdiff.d.ts +112 -109
- package/dist/first.d.ts +7 -7
- package/dist/focustracker.d.ts +133 -131
- package/dist/formathtml.d.ts +15 -15
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +78 -77
- package/dist/index.js +5695 -6360
- package/dist/index.js.map +1 -1
- package/dist/inserttopriorityarray.d.ts +23 -23
- package/dist/isfeatureblockedbylicensekey.d.ts +10 -10
- package/dist/isiterable.d.ts +10 -10
- package/dist/keyboard.d.ts +107 -109
- package/dist/keystrokehandler.d.ts +90 -90
- package/dist/language.d.ts +12 -12
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/locale.d.ts +122 -122
- package/dist/mapsequal.d.ts +11 -11
- package/dist/mix.d.ts +54 -53
- package/dist/nth.d.ts +12 -12
- package/dist/objecttomap.d.ts +18 -18
- package/dist/observablemixin.d.ts +621 -539
- package/dist/parsebase64encodedobject.d.ts +7 -7
- package/dist/parsedimensionwithunit.d.ts +40 -0
- package/dist/priorities.d.ts +24 -24
- package/dist/retry.d.ts +27 -27
- package/dist/splicearray.d.ts +22 -22
- package/dist/spy.d.ts +15 -15
- package/dist/toarray.d.ts +17 -17
- package/dist/tomap.d.ts +15 -15
- package/dist/translation-service.d.ts +157 -157
- package/dist/uid.d.ts +12 -12
- package/dist/unicode.d.ts +42 -42
- package/dist/version.d.ts +5 -5
- package/dist/wait.d.ts +11 -11
- package/package.json +2 -2
- package/dist/index.css.map +0 -1
|
@@ -1,30 +1,30 @@
|
|
|
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 { type PriorityString } from
|
|
6
|
+
* @module utils/inserttopriorityarray
|
|
7
|
+
*/
|
|
8
|
+
import { type PriorityString } from "./priorities.js";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
* The priority object descriptor.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* const objectWithPriority = {
|
|
14
|
+
* priority: 'high'
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
18
|
export interface ObjectWithPriority {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Priority of the object.
|
|
21
|
+
*/
|
|
22
|
+
priority: PriorityString;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
* Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.
|
|
26
|
+
*
|
|
27
|
+
* @param objects Array of objects with priority to insert object to.
|
|
28
|
+
* @param objectToInsert Object with `priority` property.
|
|
29
|
+
*/
|
|
30
30
|
export declare function insertToPriorityArray<T extends ObjectWithPriority>(objects: Array<T>, objectToInsert: T): void;
|
|
@@ -1,14 +1,14 @@
|
|
|
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
|
-
|
|
6
|
+
* @module utils/isfeatureblockedbylicensekey
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
* Checks whether a feature (represented by an unique id) is blocked by the provided license key.
|
|
10
|
+
*
|
|
11
|
+
* @param licensePayload Decoded license key.
|
|
12
|
+
* @param licenseFeatureCode An unique feature id to check.
|
|
13
|
+
*/
|
|
14
14
|
export declare function isFeatureBlockedByLicenseKey(licensePayload: Record<string, any>, licenseFeatureCode: string): boolean;
|
package/dist/isiterable.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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
|
-
|
|
6
|
+
* @module utils/isiterable
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
* Checks if value implements iterator interface.
|
|
10
|
+
*
|
|
11
|
+
* @param value The value to check.
|
|
12
|
+
* @returns True if value implements iterator interface.
|
|
13
|
+
*/
|
|
14
14
|
export declare function isIterable(value: any): value is Iterable<any>;
|
package/dist/keyboard.d.ts
CHANGED
|
@@ -1,127 +1,125 @@
|
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
import type { LanguageDirection } from
|
|
6
|
+
* A set of utilities related to keyboard support.
|
|
7
|
+
*
|
|
8
|
+
* @module utils/keyboard
|
|
9
|
+
*/
|
|
10
|
+
import type { LanguageDirection } from "./language.js";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export declare const keyCodes:
|
|
25
|
-
readonly [keyCode: string]: number;
|
|
26
|
-
};
|
|
12
|
+
* An object with `keyName => keyCode` pairs for a set of known keys.
|
|
13
|
+
*
|
|
14
|
+
* Contains:
|
|
15
|
+
*
|
|
16
|
+
* * `a-z`,
|
|
17
|
+
* * `0-9`,
|
|
18
|
+
* * `f1-f12`,
|
|
19
|
+
* * `` ` ``, `-`, `=`, `[`, `]`, `;`, `'`, `,`, `.`, `/`, `\`,
|
|
20
|
+
* * `arrow(left|up|right|bottom)`,
|
|
21
|
+
* * `backspace`, `delete`, `end`, `enter`, `esc`, `home`, `tab`,
|
|
22
|
+
* * `ctrl`, `cmd`, `shift`, `alt`.
|
|
23
|
+
*/
|
|
24
|
+
export declare const keyCodes: Record<string, number>;
|
|
27
25
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
* Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
|
|
27
|
+
*
|
|
28
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
29
|
+
*
|
|
30
|
+
* @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.
|
|
31
|
+
* @returns Key or keystroke code.
|
|
32
|
+
*/
|
|
35
33
|
export declare function getCode(key: string | Readonly<KeystrokeInfo>): number;
|
|
36
34
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
35
|
+
* Parses the keystroke and returns a keystroke code that will match the code returned by
|
|
36
|
+
* {@link module:utils/keyboard~getCode} for the corresponding {@link module:utils/keyboard~KeystrokeInfo keystroke info}.
|
|
37
|
+
*
|
|
38
|
+
* The keystroke can be passed in two formats:
|
|
39
|
+
*
|
|
40
|
+
* * as a single string – e.g. `ctrl + A`,
|
|
41
|
+
* * as an array of {@link module:utils/keyboard~keyCodes known key names} and key codes – e.g.:
|
|
42
|
+
* * `[ 'ctrl', 32 ]` (ctrl + space),
|
|
43
|
+
* * `[ 'ctrl', 'a' ]` (ctrl + A).
|
|
44
|
+
*
|
|
45
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
46
|
+
*
|
|
47
|
+
* Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
|
|
48
|
+
*
|
|
49
|
+
* Note: On macOS, keystroke handling is translating the `Ctrl` key to the `Cmd` key and handling only that keystroke.
|
|
50
|
+
* For example, a registered keystroke `Ctrl+A` will be translated to `Cmd+A` on macOS. To disable the translation of some keystroke,
|
|
51
|
+
* use the forced modifier: `Ctrl!+A` (note the exclamation mark).
|
|
52
|
+
*
|
|
53
|
+
* @param keystroke The keystroke definition.
|
|
54
|
+
* @returns Keystroke code.
|
|
55
|
+
*/
|
|
58
56
|
export declare function parseKeystroke(keystroke: string | ReadonlyArray<number | string>): number;
|
|
59
57
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export declare function getEnvKeystrokeText(keystroke: string, forcedEnv?:
|
|
58
|
+
* Translates any keystroke string text like `"Ctrl+A"` to an
|
|
59
|
+
* environment–specific keystroke, i.e. `"⌘A"` on macOS.
|
|
60
|
+
*
|
|
61
|
+
* @param keystroke The keystroke text.
|
|
62
|
+
* @param [forcedEnv] The environment to force the key translation to. If not provided, the current environment is used.
|
|
63
|
+
* @returns The keystroke text specific for the environment.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getEnvKeystrokeText(keystroke: string, forcedEnv?: "PC" | "Mac"): string;
|
|
68
66
|
/**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
* Returns `true` if the provided key code represents one of the arrow keys.
|
|
68
|
+
*
|
|
69
|
+
* @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
|
|
70
|
+
*/
|
|
73
71
|
export declare function isArrowKeyCode(keyCode: number): boolean;
|
|
74
72
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
export type ArrowKeyCodeDirection =
|
|
73
|
+
* String representing a direction of an arrow key kode.
|
|
74
|
+
*/
|
|
75
|
+
export type ArrowKeyCodeDirection = "left" | "up" | "right" | "down";
|
|
78
76
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
77
|
+
* Returns the direction in which the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
|
|
78
|
+
* will move when the provided arrow key code is pressed considering the language direction of the editor content.
|
|
79
|
+
*
|
|
80
|
+
* For instance, in right–to–left (RTL) content languages, pressing the left arrow means moving the selection right (forward)
|
|
81
|
+
* in the model structure. Similarly, pressing the right arrow moves the selection left (backward).
|
|
82
|
+
*
|
|
83
|
+
* @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
|
|
84
|
+
* @param contentLanguageDirection The content language direction, corresponding to
|
|
85
|
+
* {@link module:utils/locale~Locale#contentLanguageDirection}.
|
|
86
|
+
* @returns Localized arrow direction or `undefined` for non-arrow key codes.
|
|
87
|
+
*/
|
|
90
88
|
export declare function getLocalizedArrowKeyCodeDirection(keyCode: number, contentLanguageDirection: LanguageDirection): ArrowKeyCodeDirection | undefined;
|
|
91
89
|
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
* Determines if the provided key code moves the {@link module:engine/model/documentselection~ModelDocumentSelection selection}
|
|
91
|
+
* forward or backward considering the language direction of the editor content.
|
|
92
|
+
*
|
|
93
|
+
* For instance, in right–to–left (RTL) languages, pressing the left arrow means moving forward
|
|
94
|
+
* in the model structure. Similarly, pressing the right arrow moves the selection backward.
|
|
95
|
+
*
|
|
96
|
+
* @param keyCode A key code as in {@link module:utils/keyboard~KeystrokeInfo#keyCode}.
|
|
97
|
+
* @param contentLanguageDirection The content language direction, corresponding to
|
|
98
|
+
* {@link module:utils/locale~Locale#contentLanguageDirection}.
|
|
99
|
+
*/
|
|
102
100
|
export declare function isForwardArrowKeyCode(keyCode: number, contentLanguageDirection: LanguageDirection): boolean;
|
|
103
101
|
/**
|
|
104
|
-
|
|
105
|
-
|
|
102
|
+
* Information about the keystroke.
|
|
103
|
+
*/
|
|
106
104
|
export interface KeystrokeInfo {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
105
|
+
/**
|
|
106
|
+
* The [key code](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode).
|
|
107
|
+
*/
|
|
108
|
+
keyCode: number;
|
|
109
|
+
/**
|
|
110
|
+
* Whether the <kbd>Alt</kbd> modifier was pressed.
|
|
111
|
+
*/
|
|
112
|
+
altKey: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Whether the <kbd>Cmd</kbd> modifier was pressed.
|
|
115
|
+
*/
|
|
116
|
+
metaKey: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Whether the <kbd>Ctrl</kbd> modifier was pressed.
|
|
119
|
+
*/
|
|
120
|
+
ctrlKey: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the <kbd>Shift</kbd> modifier was pressed.
|
|
123
|
+
*/
|
|
124
|
+
shiftKey: boolean;
|
|
127
125
|
}
|
|
@@ -1,97 +1,97 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { Emitter } from
|
|
6
|
-
import { type KeystrokeInfo } from
|
|
7
|
-
import type { PriorityString } 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 { Emitter } from "./emittermixin.js";
|
|
6
|
+
import { type KeystrokeInfo } from "./keyboard.js";
|
|
7
|
+
import type { PriorityString } from "./priorities.js";
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
9
|
+
* Keystroke handler allows registering callbacks for given keystrokes.
|
|
10
|
+
*
|
|
11
|
+
* The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}
|
|
12
|
+
* property. It allows listening to keystrokes executed in the editing view:
|
|
13
|
+
*
|
|
14
|
+
* ```ts
|
|
15
|
+
* editor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {
|
|
16
|
+
* console.log( 'Ctrl+A has been pressed' );
|
|
17
|
+
* cancel();
|
|
18
|
+
* } );
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}
|
|
22
|
+
* can use it like this:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* class MyView extends View {
|
|
26
|
+
* constructor() {
|
|
27
|
+
* this.keystrokes = new KeystrokeHandler();
|
|
28
|
+
*
|
|
29
|
+
* this.keystrokes.set( 'tab', handleTabKey );
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* render() {
|
|
33
|
+
* super.render();
|
|
34
|
+
*
|
|
35
|
+
* this.keystrokes.listenTo( this.element );
|
|
36
|
+
* }
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* That keystroke handler will listen to `keydown` events fired in this view's main element.
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
43
|
export declare class KeystrokeHandler {
|
|
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
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Listener used to listen to events for easier keystroke handler destruction.
|
|
46
|
+
*/
|
|
47
|
+
private readonly _listener;
|
|
48
|
+
/**
|
|
49
|
+
* Creates an instance of the keystroke handler.
|
|
50
|
+
*/
|
|
51
|
+
constructor();
|
|
52
|
+
/**
|
|
53
|
+
* Starts listening for `keydown` events from a given emitter.
|
|
54
|
+
*/
|
|
55
|
+
listenTo(emitter: Emitter | HTMLElement | Window): void;
|
|
56
|
+
/**
|
|
57
|
+
* Registers a handler for the specified keystroke.
|
|
58
|
+
*
|
|
59
|
+
* @param keystroke Keystroke defined in a format accepted by
|
|
60
|
+
* the {@link module:utils/keyboard~parseKeystroke} function.
|
|
61
|
+
* @param callback A function called with the
|
|
62
|
+
* {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
|
|
63
|
+
* a helper function to call both `preventDefault()` and `stopPropagation()` on the underlying event.
|
|
64
|
+
* @param options Additional options.
|
|
65
|
+
*/
|
|
66
|
+
set(keystroke: string | ReadonlyArray<string | number>, callback: (ev: KeyboardEvent, cancel: () => void) => void, options?: KeystrokeHandlerOptions): void;
|
|
67
|
+
/**
|
|
68
|
+
* Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.
|
|
69
|
+
*
|
|
70
|
+
* @param keyEvtData Key event data.
|
|
71
|
+
* @returns Whether the keystroke was handled.
|
|
72
|
+
*/
|
|
73
|
+
press(keyEvtData: Readonly<KeystrokeInfo>): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Stops listening to `keydown` events from the given emitter.
|
|
76
|
+
*/
|
|
77
|
+
stopListening(emitter?: Emitter | HTMLElement | Window): void;
|
|
78
|
+
/**
|
|
79
|
+
* Destroys the keystroke handler.
|
|
80
|
+
*/
|
|
81
|
+
destroy(): void;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
* {@link module:utils/keystrokehandler~KeystrokeHandler#set} method options.
|
|
85
|
+
*/
|
|
86
86
|
export interface KeystrokeHandlerOptions {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The priority of the keystroke callback. The higher the priority value the sooner the callback will be executed.
|
|
89
|
+
* Keystrokes having the same priority are called in the order they were added.
|
|
90
|
+
*/
|
|
91
|
+
readonly priority?: PriorityString;
|
|
92
|
+
/**
|
|
93
|
+
* An optional callback function allowing for filtering keystrokes based on arbitrary criteria.
|
|
94
|
+
* The callback function receives `keydown` DOM event as a parameter.
|
|
95
|
+
*/
|
|
96
|
+
readonly filter?: (keyEvtData: KeyboardEvent) => boolean;
|
|
97
97
|
}
|
package/dist/language.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
|
|
6
|
+
* @module utils/language
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export type LanguageDirection =
|
|
9
|
+
* String representing a language direction.
|
|
10
|
+
*/
|
|
11
|
+
export type LanguageDirection = "ltr" | "rtl";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
* Helps determine whether a language text direction is LTR or RTL.
|
|
14
|
+
*
|
|
15
|
+
* @param languageCode The ISO 639-1 or ISO 639-2 language code.
|
|
16
|
+
*/
|
|
17
17
|
export declare function getLanguageDirection(languageCode: string): LanguageDirection;
|