@ckeditor/ckeditor5-utils 37.0.0-alpha.0 → 37.0.0-alpha.2
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/package.json +6 -6
- package/src/collection.d.ts +3 -3
- package/src/dom/createelement.d.ts +2 -0
- package/src/dom/findclosestscrollableancestor.d.ts +1 -1
- package/src/dom/findclosestscrollableancestor.js +1 -1
- package/src/index.d.ts +6 -5
- package/src/index.js +1 -0
- package/src/keyboard.d.ts +3 -3
- package/src/keyboard.js +5 -5
- package/src/observablemixin.d.ts +2 -2
- package/src/version.d.ts +1 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-utils",
|
|
3
|
-
"version": "37.0.0-alpha.
|
|
3
|
+
"version": "37.0.0-alpha.2",
|
|
4
4
|
"description": "Miscellaneous utilities used by CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"lodash-es": "^4.17.15"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ckeditor/ckeditor5-build-classic": "^37.0.0-alpha.
|
|
18
|
-
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.
|
|
19
|
-
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.
|
|
20
|
-
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.
|
|
17
|
+
"@ckeditor/ckeditor5-build-classic": "^37.0.0-alpha.2",
|
|
18
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.2",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.2",
|
|
20
|
+
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.2",
|
|
21
21
|
"@types/lodash-es": "^4.17.6",
|
|
22
22
|
"typescript": "^4.8.4"
|
|
23
23
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"CHANGELOG.md"
|
|
47
47
|
],
|
|
48
48
|
"scripts": {
|
|
49
|
-
"build": "tsc -p ./tsconfig.
|
|
49
|
+
"build": "tsc -p ./tsconfig.json",
|
|
50
50
|
"postversion": "npm run build"
|
|
51
51
|
},
|
|
52
52
|
"types": "src/index.d.ts"
|
package/src/collection.d.ts
CHANGED
|
@@ -356,7 +356,7 @@ export default class Collection<T extends Record<string, any>> extends Collectio
|
|
|
356
356
|
/**
|
|
357
357
|
* Fired when an item is added to the collection.
|
|
358
358
|
*
|
|
359
|
-
* @eventName add
|
|
359
|
+
* @eventName ~Collection#add
|
|
360
360
|
* @param item The added item.
|
|
361
361
|
* @param index An index where the addition occurred.
|
|
362
362
|
*/
|
|
@@ -367,7 +367,7 @@ export type CollectionAddEvent<T = any> = {
|
|
|
367
367
|
/**
|
|
368
368
|
* Fired when the collection was changed due to adding or removing items.
|
|
369
369
|
*
|
|
370
|
-
* @eventName change
|
|
370
|
+
* @eventName ~Collection#change
|
|
371
371
|
* @param data Changed items.
|
|
372
372
|
*/
|
|
373
373
|
export type CollectionChangeEvent<T = any> = {
|
|
@@ -394,7 +394,7 @@ export type CollectionChangeEventData<T = any> = {
|
|
|
394
394
|
/**
|
|
395
395
|
* Fired when an item is removed from the collection.
|
|
396
396
|
*
|
|
397
|
-
* @eventName remove
|
|
397
|
+
* @eventName ~Collection#remove
|
|
398
398
|
* @param item The removed item.
|
|
399
399
|
* @param index Index from which item was removed.
|
|
400
400
|
*/
|
|
@@ -28,6 +28,7 @@ type ChildrenElements = Node | string | Iterable<Node | string>;
|
|
|
28
28
|
* createElement( document, 'p', null, [ createElement(...) ] ); // <p><...></p>
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
|
+
* @label HTML_ELEMENT
|
|
31
32
|
* @param doc Document used to create the element.
|
|
32
33
|
* @param name Name of the HTML element.
|
|
33
34
|
* @param attributes Object where keys represent attribute keys and values represent attribute values.
|
|
@@ -45,6 +46,7 @@ export default function createElement<T extends keyof HTMLElementTagNameMap>(doc
|
|
|
45
46
|
* createElement( document, 'mask', { xmlns: 'http://www.w3.org/2000/svg' }, [ createElement(...) ] ); // <mask><...></mask>
|
|
46
47
|
* ```
|
|
47
48
|
*
|
|
49
|
+
* @label SVG_ELEMENT
|
|
48
50
|
* @param doc Document used to create the element.
|
|
49
51
|
* @param name Name of the SVG element.
|
|
50
52
|
* @param attributes Object where keys represent attribute keys and values represent attribute values.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module utils/dom/
|
|
6
|
+
* @module utils/dom/findclosestscrollableancestor
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Returns the closest scrollable ancestor of a DOM element.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* @module utils/dom/
|
|
6
|
+
* @module utils/dom/findclosestscrollableancestor
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Returns the closest scrollable ancestor of a DOM element.
|
package/src/index.d.ts
CHANGED
|
@@ -8,11 +8,12 @@
|
|
|
8
8
|
export { default as env } from './env';
|
|
9
9
|
export { default as diff, type DiffResult } from './diff';
|
|
10
10
|
export { default as fastDiff } from './fastdiff';
|
|
11
|
+
export { default as diffToChanges } from './difftochanges';
|
|
11
12
|
export { default as mix } from './mix';
|
|
12
|
-
export { Constructor, Mixed } from './mix';
|
|
13
|
-
export { default as EmitterMixin, Emitter, type BaseEvent, type CallbackOptions, type EmitterMixinDelegateChain, type GetCallback, type GetCallbackOptions, type GetEventInfo, type GetNameOrEventInfo } from './emittermixin';
|
|
13
|
+
export type { Constructor, Mixed } from './mix';
|
|
14
|
+
export { default as EmitterMixin, type Emitter, type BaseEvent, type CallbackOptions, type EmitterMixinDelegateChain, type GetCallback, type GetCallbackOptions, type GetEventInfo, type GetNameOrEventInfo } from './emittermixin';
|
|
14
15
|
export { default as EventInfo } from './eventinfo';
|
|
15
|
-
export { default as ObservableMixin, Observable, type DecoratedMethodEvent, type ObservableChangeEvent, type ObservableSetEvent } from './observablemixin';
|
|
16
|
+
export { default as ObservableMixin, type Observable, type DecoratedMethodEvent, type ObservableChangeEvent, type ObservableSetEvent } from './observablemixin';
|
|
16
17
|
export { default as CKEditorError, logError, logWarning } from './ckeditorerror';
|
|
17
18
|
export { default as ElementReplacer } from './elementreplacer';
|
|
18
19
|
export { default as count } from './count';
|
|
@@ -20,7 +21,7 @@ export { default as compareArrays } from './comparearrays';
|
|
|
20
21
|
export { default as createElement } from './dom/createelement';
|
|
21
22
|
export { default as Config } from './config';
|
|
22
23
|
export { default as isIterable } from './isiterable';
|
|
23
|
-
export { default as DomEmitterMixin, DomEmitter } from './dom/emittermixin';
|
|
24
|
+
export { default as DomEmitterMixin, type DomEmitter } from './dom/emittermixin';
|
|
24
25
|
export { default as findClosestScrollableAncestor } from './dom/findclosestscrollableancestor';
|
|
25
26
|
export { default as global } from './dom/global';
|
|
26
27
|
export { default as getAncestors } from './dom/getancestors';
|
|
@@ -41,7 +42,7 @@ export { default as remove } from './dom/remove';
|
|
|
41
42
|
export * from './dom/scroll';
|
|
42
43
|
export * from './keyboard';
|
|
43
44
|
export * from './language';
|
|
44
|
-
export { default as Locale, LocaleTranslate } from './locale';
|
|
45
|
+
export { default as Locale, type LocaleTranslate } from './locale';
|
|
45
46
|
export { default as Collection, type CollectionAddEvent, type CollectionChangeEvent, type CollectionRemoveEvent } from './collection';
|
|
46
47
|
export { default as first } from './first';
|
|
47
48
|
export { default as FocusTracker } from './focustracker';
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
export { default as env } from './env';
|
|
9
9
|
export { default as diff } from './diff';
|
|
10
10
|
export { default as fastDiff } from './fastdiff';
|
|
11
|
+
export { default as diffToChanges } from './difftochanges';
|
|
11
12
|
export { default as mix } from './mix';
|
|
12
13
|
export { default as EmitterMixin } from './emittermixin';
|
|
13
14
|
export { default as EventInfo } from './eventinfo';
|
package/src/keyboard.d.ts
CHANGED
|
@@ -27,9 +27,9 @@ export declare const keyCodes: {
|
|
|
27
27
|
/**
|
|
28
28
|
* Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
|
|
29
29
|
*
|
|
30
|
-
* Note: Key names are matched with {@link module:utils/keyboard
|
|
30
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
31
31
|
*
|
|
32
|
-
* @param key A key name (see {@link module:utils/keyboard
|
|
32
|
+
* @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.
|
|
33
33
|
* @returns Key or keystroke code.
|
|
34
34
|
*/
|
|
35
35
|
export declare function getCode(key: string | Readonly<KeystrokeInfo>): number;
|
|
@@ -44,7 +44,7 @@ export declare function getCode(key: string | Readonly<KeystrokeInfo>): number;
|
|
|
44
44
|
* * `[ 'ctrl', 32 ]` (ctrl + space),
|
|
45
45
|
* * `[ 'ctrl', 'a' ]` (ctrl + A).
|
|
46
46
|
*
|
|
47
|
-
* Note: Key names are matched with {@link module:utils/keyboard
|
|
47
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
48
48
|
*
|
|
49
49
|
* Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
|
|
50
50
|
*
|
package/src/keyboard.js
CHANGED
|
@@ -33,9 +33,9 @@ const keyCodeNames = Object.fromEntries(Object.entries(keyCodes).map(([name, cod
|
|
|
33
33
|
/**
|
|
34
34
|
* Converts a key name or {@link module:utils/keyboard~KeystrokeInfo keystroke info} into a key code.
|
|
35
35
|
*
|
|
36
|
-
* Note: Key names are matched with {@link module:utils/keyboard
|
|
36
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
37
37
|
*
|
|
38
|
-
* @param key A key name (see {@link module:utils/keyboard
|
|
38
|
+
* @param key A key name (see {@link module:utils/keyboard#keyCodes}) or a keystroke data object.
|
|
39
39
|
* @returns Key or keystroke code.
|
|
40
40
|
*/
|
|
41
41
|
export function getCode(key) {
|
|
@@ -44,7 +44,7 @@ export function getCode(key) {
|
|
|
44
44
|
keyCode = keyCodes[key.toLowerCase()];
|
|
45
45
|
if (!keyCode) {
|
|
46
46
|
/**
|
|
47
|
-
* Unknown key name. Only key names included in the {@link module:utils/keyboard
|
|
47
|
+
* Unknown key name. Only key names included in the {@link module:utils/keyboard#keyCodes} can be used.
|
|
48
48
|
*
|
|
49
49
|
* @error keyboard-unknown-key
|
|
50
50
|
* @param {String} key
|
|
@@ -72,7 +72,7 @@ export function getCode(key) {
|
|
|
72
72
|
* * `[ 'ctrl', 32 ]` (ctrl + space),
|
|
73
73
|
* * `[ 'ctrl', 'a' ]` (ctrl + A).
|
|
74
74
|
*
|
|
75
|
-
* Note: Key names are matched with {@link module:utils/keyboard
|
|
75
|
+
* Note: Key names are matched with {@link module:utils/keyboard#keyCodes} in a case-insensitive way.
|
|
76
76
|
*
|
|
77
77
|
* Note: Only keystrokes with a single non-modifier key are supported (e.g. `ctrl+A` is OK, but `ctrl+A+B` is not).
|
|
78
78
|
*
|
|
@@ -152,7 +152,7 @@ export function getLocalizedArrowKeyCodeDirection(keyCode, contentLanguageDirect
|
|
|
152
152
|
*
|
|
153
153
|
* See: {@link module:utils/keyboard~getCode}.
|
|
154
154
|
*
|
|
155
|
-
* @param key The key name (see {@link module:utils/keyboard
|
|
155
|
+
* @param key The key name (see {@link module:utils/keyboard#keyCodes}).
|
|
156
156
|
* @returns Key code.
|
|
157
157
|
*/
|
|
158
158
|
function getEnvKeyCode(key) {
|
package/src/observablemixin.d.ts
CHANGED
|
@@ -441,7 +441,7 @@ export interface Observable extends Emitter {
|
|
|
441
441
|
* observable.prop = 2; // -> 'prop has changed from 1 to 2'
|
|
442
442
|
* ```
|
|
443
443
|
*
|
|
444
|
-
* @eventName change:\{property\}
|
|
444
|
+
* @eventName ~Observable#change:\{property\}
|
|
445
445
|
* @param {String} name The property name.
|
|
446
446
|
* @param {*} value The new property value.
|
|
447
447
|
* @param {*} oldValue The previous property value.
|
|
@@ -478,7 +478,7 @@ export type ObservableChangeEvent<TValue = any> = {
|
|
|
478
478
|
*
|
|
479
479
|
* **Note:** The event is fired even when the new value is the same as the old value.
|
|
480
480
|
*
|
|
481
|
-
* @eventName set:\{property\}
|
|
481
|
+
* @eventName ~Observable#set:\{property\}
|
|
482
482
|
* @param {String} name The property name.
|
|
483
483
|
* @param {*} value The new property value.
|
|
484
484
|
* @param {*} oldValue The previous property value.
|
package/src/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
declare const version = "37.0.0-alpha.
|
|
5
|
+
declare const version = "37.0.0-alpha.2";
|
|
6
6
|
export default version;
|
|
7
7
|
declare global {
|
|
8
8
|
var CKEDITOR_VERSION: string;
|
package/src/version.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/* globals window, global */
|
|
9
9
|
import CKEditorError from './ckeditorerror';
|
|
10
|
-
const version = '37.0.0-alpha.
|
|
10
|
+
const version = '37.0.0-alpha.2';
|
|
11
11
|
export default version;
|
|
12
12
|
/* istanbul ignore next */
|
|
13
13
|
const windowOrGlobal = typeof window === 'object' ? window : global;
|