@ckeditor/ckeditor5-utils 44.3.0-alpha.7 → 45.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/dist/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
- package/src/ckeditorerror.js +8 -0
- package/src/collection.js +37 -0
- package/src/config.js +5 -1
- package/src/dom/createelement.js +1 -1
- package/src/dom/emittermixin.js +6 -0
- package/src/dom/position.js +7 -1
- package/src/dom/rect.js +42 -0
- package/src/dom/resizeobserver.js +17 -9
- package/src/elementreplacer.js +4 -0
- package/src/eventinfo.js +37 -0
- package/src/focustracker.d.ts +1 -1
- package/src/focustracker.js +17 -17
- package/src/index.d.ts +1 -1
- package/src/keystrokehandler.js +4 -0
- package/src/locale.js +79 -0
- package/src/observablemixin.js +5 -1
- package/src/translation-service.js +1 -1
- package/src/version.d.ts +1 -1
- package/src/version.js +15 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0-alpha.0",
|
|
4
4
|
"description": "Miscellaneous utilities used by CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ckeditor/ckeditor5-ui": "
|
|
16
|
-
"
|
|
17
|
-
"lodash-es": "4.17.21"
|
|
15
|
+
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.0",
|
|
16
|
+
"es-toolkit": "1.32.0"
|
|
18
17
|
},
|
|
19
18
|
"author": "CKSource (http://cksource.com/)",
|
|
20
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/ckeditorerror.js
CHANGED
|
@@ -39,6 +39,14 @@ export const DOCUMENTATION_URL = 'https://ckeditor.com/docs/ckeditor5/latest/sup
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export default class CKEditorError extends Error {
|
|
42
|
+
/**
|
|
43
|
+
* A context of the error by which the Watchdog is able to determine which editor crashed.
|
|
44
|
+
*/
|
|
45
|
+
context;
|
|
46
|
+
/**
|
|
47
|
+
* The additional error data passed to the constructor. Undefined if none was passed.
|
|
48
|
+
*/
|
|
49
|
+
data;
|
|
42
50
|
/**
|
|
43
51
|
* Creates an instance of the CKEditorError class.
|
|
44
52
|
*
|
package/src/collection.js
CHANGED
|
@@ -22,6 +22,43 @@ import isIterable from './isiterable.js';
|
|
|
22
22
|
* @typeParam T The type of the collection element.
|
|
23
23
|
*/
|
|
24
24
|
export default class Collection extends /* #__PURE__ */ EmitterMixin() {
|
|
25
|
+
/**
|
|
26
|
+
* The internal list of items in the collection.
|
|
27
|
+
*/
|
|
28
|
+
_items;
|
|
29
|
+
/**
|
|
30
|
+
* The internal map of items in the collection.
|
|
31
|
+
*/
|
|
32
|
+
_itemMap;
|
|
33
|
+
/**
|
|
34
|
+
* The name of the property which is considered to identify an item.
|
|
35
|
+
*/
|
|
36
|
+
_idProperty;
|
|
37
|
+
/**
|
|
38
|
+
* A collection instance this collection is bound to as a result
|
|
39
|
+
* of calling {@link #bindTo} method.
|
|
40
|
+
*/
|
|
41
|
+
_bindToCollection;
|
|
42
|
+
/**
|
|
43
|
+
* A helper mapping external items of a bound collection ({@link #bindTo})
|
|
44
|
+
* and actual items of this collection. It provides information
|
|
45
|
+
* necessary to properly remove items bound to another collection.
|
|
46
|
+
*
|
|
47
|
+
* See {@link #_bindToInternalToExternalMap}.
|
|
48
|
+
*/
|
|
49
|
+
_bindToExternalToInternalMap;
|
|
50
|
+
/**
|
|
51
|
+
* A helper mapping items of this collection to external items of a bound collection
|
|
52
|
+
* ({@link #bindTo}). It provides information necessary to manage the bindings, e.g.
|
|
53
|
+
* to avoid loops in two–way bindings.
|
|
54
|
+
*
|
|
55
|
+
* See {@link #_bindToExternalToInternalMap}.
|
|
56
|
+
*/
|
|
57
|
+
_bindToInternalToExternalMap;
|
|
58
|
+
/**
|
|
59
|
+
* Stores indexes of skipped items from bound external collection.
|
|
60
|
+
*/
|
|
61
|
+
_skippedIndexesFromExternal;
|
|
25
62
|
constructor(initialItemsOrOptions = {}, options = {}) {
|
|
26
63
|
super();
|
|
27
64
|
const hasInitialItems = isIterable(initialItemsOrOptions);
|
package/src/config.js
CHANGED
|
@@ -5,13 +5,17 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/config
|
|
7
7
|
*/
|
|
8
|
-
import { isPlainObject, isElement, cloneDeepWith } from '
|
|
8
|
+
import { isPlainObject, isElement, cloneDeepWith } from 'es-toolkit/compat';
|
|
9
9
|
/**
|
|
10
10
|
* Handles a configuration dictionary.
|
|
11
11
|
*
|
|
12
12
|
* @typeParam Cfg A type of the configuration dictionary.
|
|
13
13
|
*/
|
|
14
14
|
export default class Config {
|
|
15
|
+
/**
|
|
16
|
+
* Store for the whole configuration.
|
|
17
|
+
*/
|
|
18
|
+
_config;
|
|
15
19
|
/**
|
|
16
20
|
* Creates an instance of the {@link ~Config} class.
|
|
17
21
|
*
|
package/src/dom/createelement.js
CHANGED
package/src/dom/emittermixin.js
CHANGED
|
@@ -111,6 +111,8 @@ export default function DomEmitterMixin(base) {
|
|
|
111
111
|
* fire( click, DOM Event )
|
|
112
112
|
*/
|
|
113
113
|
class ProxyEmitter extends /* #__PURE__ */ EmitterMixin() {
|
|
114
|
+
_domNode;
|
|
115
|
+
_options;
|
|
114
116
|
/**
|
|
115
117
|
* @param node DOM Node that fires events.
|
|
116
118
|
* @param options Additional options.
|
|
@@ -128,6 +130,10 @@ class ProxyEmitter extends /* #__PURE__ */ EmitterMixin() {
|
|
|
128
130
|
// And given options.
|
|
129
131
|
this._options = options;
|
|
130
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* Collection of native DOM listeners.
|
|
135
|
+
*/
|
|
136
|
+
_domListeners;
|
|
131
137
|
/**
|
|
132
138
|
* Registers a callback function to be executed when an event is fired.
|
|
133
139
|
*
|
package/src/dom/position.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import global from './global.js';
|
|
9
9
|
import Rect from './rect.js';
|
|
10
10
|
import getPositionedAncestor from './getpositionedancestor.js';
|
|
11
|
-
import { isFunction } from '
|
|
11
|
+
import { isFunction } from 'es-toolkit/compat';
|
|
12
12
|
// @if CK_DEBUG_POSITION // const {
|
|
13
13
|
// @if CK_DEBUG_POSITION // default: RectDrawer,
|
|
14
14
|
// @if CK_DEBUG_POSITION // diagonalStylesBlack,
|
|
@@ -234,6 +234,12 @@ function getBestPosition(positions, options) {
|
|
|
234
234
|
* in DOM, they will make it display it in the right place in the viewport.
|
|
235
235
|
*/
|
|
236
236
|
class PositionObject {
|
|
237
|
+
name;
|
|
238
|
+
config;
|
|
239
|
+
_positioningFunctionCoordinates;
|
|
240
|
+
_options;
|
|
241
|
+
_cachedRect;
|
|
242
|
+
_cachedAbsoluteRect;
|
|
237
243
|
/**
|
|
238
244
|
* Creates an instance of the {@link module:utils/dom/position~PositionObject} class.
|
|
239
245
|
*
|
package/src/dom/rect.js
CHANGED
|
@@ -18,6 +18,48 @@ const rectProperties = ['top', 'right', 'bottom', 'left', 'width', 'height'];
|
|
|
18
18
|
* to manipulate the rect and compare it against other rect instances.
|
|
19
19
|
*/
|
|
20
20
|
export default class Rect {
|
|
21
|
+
/**
|
|
22
|
+
* The "top" value of the rect.
|
|
23
|
+
*
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
top;
|
|
27
|
+
/**
|
|
28
|
+
* The "right" value of the rect.
|
|
29
|
+
*
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
32
|
+
right;
|
|
33
|
+
/**
|
|
34
|
+
* The "bottom" value of the rect.
|
|
35
|
+
*
|
|
36
|
+
* @readonly
|
|
37
|
+
*/
|
|
38
|
+
bottom;
|
|
39
|
+
/**
|
|
40
|
+
* The "left" value of the rect.
|
|
41
|
+
*
|
|
42
|
+
* @readonly
|
|
43
|
+
*/
|
|
44
|
+
left;
|
|
45
|
+
/**
|
|
46
|
+
* The "width" value of the rect.
|
|
47
|
+
*
|
|
48
|
+
* @readonly
|
|
49
|
+
*/
|
|
50
|
+
width;
|
|
51
|
+
/**
|
|
52
|
+
* The "height" value of the rect.
|
|
53
|
+
*
|
|
54
|
+
* @readonly
|
|
55
|
+
*/
|
|
56
|
+
height;
|
|
57
|
+
/**
|
|
58
|
+
* The object this rect is for.
|
|
59
|
+
*
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
_source;
|
|
21
63
|
/**
|
|
22
64
|
* Creates an instance of rect.
|
|
23
65
|
*
|
|
@@ -23,6 +23,23 @@ import global from './global.js';
|
|
|
23
23
|
* under the hood.
|
|
24
24
|
*/
|
|
25
25
|
class ResizeObserver {
|
|
26
|
+
/**
|
|
27
|
+
* The element observed by this observer.
|
|
28
|
+
*/
|
|
29
|
+
_element;
|
|
30
|
+
/**
|
|
31
|
+
* The callback executed each time {@link #_element} is resized.
|
|
32
|
+
*/
|
|
33
|
+
_callback;
|
|
34
|
+
/**
|
|
35
|
+
* The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
|
|
36
|
+
*/
|
|
37
|
+
static _observerInstance = null;
|
|
38
|
+
/**
|
|
39
|
+
* A mapping of native DOM elements and their callbacks shared across all
|
|
40
|
+
* {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
|
|
41
|
+
*/
|
|
42
|
+
static _elementCallbacks = null;
|
|
26
43
|
/**
|
|
27
44
|
* Creates an instance of the `ResizeObserver` class.
|
|
28
45
|
*
|
|
@@ -115,13 +132,4 @@ class ResizeObserver {
|
|
|
115
132
|
});
|
|
116
133
|
}
|
|
117
134
|
}
|
|
118
|
-
/**
|
|
119
|
-
* The single native observer instance shared across all {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
|
|
120
|
-
*/
|
|
121
|
-
ResizeObserver._observerInstance = null;
|
|
122
|
-
/**
|
|
123
|
-
* A mapping of native DOM elements and their callbacks shared across all
|
|
124
|
-
* {@link module:utils/dom/resizeobserver~ResizeObserver} instances.
|
|
125
|
-
*/
|
|
126
|
-
ResizeObserver._elementCallbacks = null;
|
|
127
135
|
export default ResizeObserver;
|
package/src/elementreplacer.js
CHANGED
package/src/eventinfo.js
CHANGED
|
@@ -11,6 +11,43 @@ import spy from './spy.js';
|
|
|
11
11
|
* manipulate it.
|
|
12
12
|
*/
|
|
13
13
|
export default class EventInfo {
|
|
14
|
+
/**
|
|
15
|
+
* The object that fired the event.
|
|
16
|
+
*/
|
|
17
|
+
source;
|
|
18
|
+
/**
|
|
19
|
+
* The event name.
|
|
20
|
+
*/
|
|
21
|
+
name;
|
|
22
|
+
/**
|
|
23
|
+
* Path this event has followed. See {@link module:utils/emittermixin~Emitter#delegate}.
|
|
24
|
+
*/
|
|
25
|
+
path;
|
|
26
|
+
/**
|
|
27
|
+
* Stops the event emitter to call further callbacks for this event interaction.
|
|
28
|
+
*/
|
|
29
|
+
stop;
|
|
30
|
+
/**
|
|
31
|
+
* Removes the current callback from future interactions of this event.
|
|
32
|
+
*/
|
|
33
|
+
off;
|
|
34
|
+
/**
|
|
35
|
+
* The value which will be returned by {@link module:utils/emittermixin~Emitter#fire}.
|
|
36
|
+
*
|
|
37
|
+
* It's `undefined` by default and can be changed by an event listener:
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* dataController.fire( 'getSelectedContent', ( evt ) => {
|
|
41
|
+
* // This listener will make `dataController.fire( 'getSelectedContent' )`
|
|
42
|
+
* // always return an empty DocumentFragment.
|
|
43
|
+
* evt.return = new DocumentFragment();
|
|
44
|
+
*
|
|
45
|
+
* // Make sure no other listeners are executed.
|
|
46
|
+
* evt.stop();
|
|
47
|
+
* } );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
return;
|
|
14
51
|
/**
|
|
15
52
|
* @param source The emitter.
|
|
16
53
|
* @param name The event name.
|
package/src/focustracker.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { View } from '@ckeditor/ckeditor5-ui';
|
|
6
6
|
declare const FocusTracker_base: import("./mix.js").Mixed<{
|
|
7
7
|
new (): import("./observablemixin.js").Observable;
|
|
8
8
|
prototype: import("./observablemixin.js").Observable;
|
package/src/focustracker.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import DomEmitterMixin from './dom/emittermixin.js';
|
|
10
10
|
import ObservableMixin from './observablemixin.js';
|
|
11
11
|
import CKEditorError from './ckeditorerror.js';
|
|
12
|
-
import { isElement as _isElement } from '
|
|
12
|
+
import { isElement as _isElement } from 'es-toolkit/compat';
|
|
13
13
|
/**
|
|
14
14
|
* Allows observing a group of DOM `Element`s or {@link module:ui/view~View view instances} whether at least one of them (or their child)
|
|
15
15
|
* is focused.
|
|
@@ -24,25 +24,25 @@ import { isElement as _isElement } from 'lodash-es';
|
|
|
24
24
|
* Check out the {@glink framework/deep-dive/ui/focus-tracking "Deep dive into focus tracking"} guide to learn more.
|
|
25
25
|
*/
|
|
26
26
|
export default class FocusTracker extends /* #__PURE__ */ DomEmitterMixin(/* #__PURE__ */ ObservableMixin()) {
|
|
27
|
+
/**
|
|
28
|
+
* List of registered DOM elements.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
_elements = new Set();
|
|
33
|
+
/**
|
|
34
|
+
* List of views with external focus trackers that contribute to the state of this focus tracker.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
_externalViews = new Set();
|
|
39
|
+
/**
|
|
40
|
+
* Asynchronous blur event timeout.
|
|
41
|
+
*/
|
|
42
|
+
_blurTimeout = null;
|
|
27
43
|
// @if CK_DEBUG_FOCUSTRACKER // public _label?: string;
|
|
28
44
|
constructor() {
|
|
29
45
|
super();
|
|
30
|
-
/**
|
|
31
|
-
* List of registered DOM elements.
|
|
32
|
-
*
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
this._elements = new Set();
|
|
36
|
-
/**
|
|
37
|
-
* List of views with external focus trackers that contribute to the state of this focus tracker.
|
|
38
|
-
*
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
this._externalViews = new Set();
|
|
42
|
-
/**
|
|
43
|
-
* Asynchronous blur event timeout.
|
|
44
|
-
*/
|
|
45
|
-
this._blurTimeout = null;
|
|
46
46
|
this.set('isFocused', false);
|
|
47
47
|
this.set('focusedElement', null);
|
|
48
48
|
// @if CK_DEBUG_FOCUSTRACKER // FocusTracker._instances.push( this );
|
package/src/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { default as abortableDebounce, type AbortableFunc } from './abortabledeb
|
|
|
20
20
|
export { default as count } from './count.js';
|
|
21
21
|
export { default as compareArrays } from './comparearrays.js';
|
|
22
22
|
export { default as createElement } from './dom/createelement.js';
|
|
23
|
-
export { default as Config } from './config.js';
|
|
23
|
+
export { default as Config, type GetSubConfig } from './config.js';
|
|
24
24
|
export { default as isIterable } from './isiterable.js';
|
|
25
25
|
export { default as DomEmitterMixin, type DomEmitter } from './dom/emittermixin.js';
|
|
26
26
|
export { default as findClosestScrollableAncestor } from './dom/findclosestscrollableancestor.js';
|
package/src/keystrokehandler.js
CHANGED
|
@@ -43,6 +43,10 @@ import { getCode, parseKeystroke } from './keyboard.js';
|
|
|
43
43
|
*
|
|
44
44
|
*/
|
|
45
45
|
export default class KeystrokeHandler {
|
|
46
|
+
/**
|
|
47
|
+
* Listener used to listen to events for easier keystroke handler destruction.
|
|
48
|
+
*/
|
|
49
|
+
_listener;
|
|
46
50
|
/**
|
|
47
51
|
* Creates an instance of the keystroke handler.
|
|
48
52
|
*/
|
package/src/locale.js
CHANGED
|
@@ -13,6 +13,85 @@ import { getLanguageDirection } from './language.js';
|
|
|
13
13
|
* Represents the localization services.
|
|
14
14
|
*/
|
|
15
15
|
export default class Locale {
|
|
16
|
+
/**
|
|
17
|
+
* The editor UI language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
|
|
18
|
+
*
|
|
19
|
+
* If the {@link #contentLanguage content language} was not specified in the `Locale` constructor,
|
|
20
|
+
* it also defines the language of the content.
|
|
21
|
+
*/
|
|
22
|
+
uiLanguage;
|
|
23
|
+
/**
|
|
24
|
+
* Text direction of the {@link #uiLanguage editor UI language}. Either `'ltr'` or `'rtl'`.
|
|
25
|
+
*/
|
|
26
|
+
uiLanguageDirection;
|
|
27
|
+
/**
|
|
28
|
+
* The editor content language code in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
|
|
29
|
+
*
|
|
30
|
+
* Usually the same as the {@link #uiLanguage editor language}, it can be customized by passing an optional
|
|
31
|
+
* argument to the `Locale` constructor.
|
|
32
|
+
*/
|
|
33
|
+
contentLanguage;
|
|
34
|
+
/**
|
|
35
|
+
* Text direction of the {@link #contentLanguage editor content language}.
|
|
36
|
+
*
|
|
37
|
+
* If the content language was passed directly to the `Locale` constructor, this property represents the
|
|
38
|
+
* direction of that language.
|
|
39
|
+
*
|
|
40
|
+
* If the {@link #contentLanguage editor content language} was derived from the {@link #uiLanguage editor language},
|
|
41
|
+
* the content language direction is the same as the {@link #uiLanguageDirection UI language direction}.
|
|
42
|
+
*
|
|
43
|
+
* The value is either `'ltr'` or `'rtl'`.
|
|
44
|
+
*/
|
|
45
|
+
contentLanguageDirection;
|
|
46
|
+
/**
|
|
47
|
+
* Translates the given message to the {@link #uiLanguage}. This method is also available in
|
|
48
|
+
* {@link module:core/editor/editor~Editor#t `Editor`} and {@link module:ui/view~View#t `View`}.
|
|
49
|
+
*
|
|
50
|
+
* This method's context is statically bound to the `Locale` instance and **should always be called as a function**:
|
|
51
|
+
*
|
|
52
|
+
* ```ts
|
|
53
|
+
* const t = locale.t;
|
|
54
|
+
* t( 'Label' );
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* The message can be either a string or an object implementing the {@link module:utils/translation-service~Message} interface.
|
|
58
|
+
*
|
|
59
|
+
* The message may contain placeholders (`%<index>`) for value(s) that are passed as a `values` parameter.
|
|
60
|
+
* For an array of values, the `%<index>` will be changed to an element of that array at the given index.
|
|
61
|
+
* For a single value passed as the second argument, only the `%0` placeholders will be changed to the provided value.
|
|
62
|
+
*
|
|
63
|
+
* ```ts
|
|
64
|
+
* t( 'Created file "%0" in %1ms.', [ fileName, timeTaken ] );
|
|
65
|
+
* t( 'Created file "%0", fileName );
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* The message supports plural forms. To specify the plural form, use the `plural` property. Singular or plural form
|
|
69
|
+
* will be chosen depending on the first value from the passed `values`. The value of the `plural` property is used
|
|
70
|
+
* as a default plural translation when the translation for the target language is missing.
|
|
71
|
+
*
|
|
72
|
+
* ```ts
|
|
73
|
+
* t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Add a space' for the English language.
|
|
74
|
+
* t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Add 5 spaces' for the English language.
|
|
75
|
+
* t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Add 2 spaces' for the English language.
|
|
76
|
+
*
|
|
77
|
+
* t( { string: 'Add a space', plural: 'Add %0 spaces' }, 1 ); // 'Dodaj spację' for the Polish language.
|
|
78
|
+
* t( { string: 'Add a space', plural: 'Add %0 spaces' }, 5 ); // 'Dodaj 5 spacji' for the Polish language.
|
|
79
|
+
* t( { string: '%1 a space', plural: '%1 %0 spaces' }, [ 2, 'Add' ] ); // 'Dodaj 2 spacje' for the Polish language.
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* * The message should provide an ID using the `id` property when the message strings are not unique and their
|
|
83
|
+
* translations should be different.
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* translate( 'en', { string: 'image', id: 'ADD_IMAGE' } );
|
|
87
|
+
* translate( 'en', { string: 'image', id: 'AN_IMAGE' } );
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
t;
|
|
91
|
+
/**
|
|
92
|
+
* Object that contains translations.
|
|
93
|
+
*/
|
|
94
|
+
translations;
|
|
16
95
|
/**
|
|
17
96
|
* Creates a new instance of the locale class. Learn more about
|
|
18
97
|
* {@glink getting-started/setup/ui-language configuring the language of the editor}.
|
package/src/observablemixin.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import EmitterMixin from './emittermixin.js';
|
|
10
10
|
import CKEditorError from './ckeditorerror.js';
|
|
11
|
-
import { isObject } from '
|
|
11
|
+
import { isObject } from 'es-toolkit/compat';
|
|
12
12
|
const observablePropertiesSymbol = Symbol('observableProperties');
|
|
13
13
|
const boundObservablesSymbol = Symbol('boundObservables');
|
|
14
14
|
const boundPropertiesSymbol = Symbol('boundProperties');
|
|
@@ -204,6 +204,10 @@ export default function ObservableMixin(base) {
|
|
|
204
204
|
}
|
|
205
205
|
super.stopListening(emitter, event, callback);
|
|
206
206
|
}
|
|
207
|
+
[observablePropertiesSymbol];
|
|
208
|
+
[decoratedMethods];
|
|
209
|
+
[boundPropertiesSymbol];
|
|
210
|
+
[boundObservablesSymbol];
|
|
207
211
|
}
|
|
208
212
|
return Mixin;
|
|
209
213
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import CKEditorError from './ckeditorerror.js';
|
|
6
6
|
import global from './dom/global.js';
|
|
7
|
-
import { merge } from '
|
|
7
|
+
import { merge } from 'es-toolkit/compat';
|
|
8
8
|
/* istanbul ignore else -- @preserve */
|
|
9
9
|
if (!global.window.CKEDITOR_TRANSLATIONS) {
|
|
10
10
|
global.window.CKEDITOR_TRANSLATIONS = {};
|
package/src/version.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
declare const version = "
|
|
5
|
+
declare const version = "45.0.0-alpha.0";
|
|
6
6
|
export default version;
|
|
7
7
|
export declare const releaseDate: Date;
|
|
8
8
|
declare global {
|
package/src/version.js
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* @module utils/version
|
|
7
7
|
*/
|
|
8
8
|
import CKEditorError from './ckeditorerror.js';
|
|
9
|
-
const version = '
|
|
9
|
+
const version = '45.0.0-alpha.0';
|
|
10
10
|
export default version;
|
|
11
11
|
// The second argument is not a month. It is `monthIndex` and starts from `0`.
|
|
12
|
-
export const releaseDate = new Date(2025, 2,
|
|
12
|
+
export const releaseDate = new Date(2025, 2, 26);
|
|
13
13
|
/* istanbul ignore next -- @preserve */
|
|
14
14
|
if (globalThis.CKEDITOR_VERSION) {
|
|
15
15
|
/**
|
|
@@ -43,14 +43,14 @@ if (globalThis.CKEDITOR_VERSION) {
|
|
|
43
43
|
*
|
|
44
44
|
* - **New installation methods (NIM)** – Imports from the `ckeditor5` and `ckeditor5-premium-features` packages.
|
|
45
45
|
* - **Optimized build** for the new installation methods – Imports from the `@ckeditor/ckeditor5-<NAME>/dist/index.js`.
|
|
46
|
-
* - **Predefined builds** (
|
|
46
|
+
* - **Predefined builds** (no longer supported) – Imports from the `@ckeditor/ckeditor5-build-<NAME>` packages.
|
|
47
47
|
* - **Default imports** (legacy) – Imports from the `@ckeditor/ckeditor5-<NAME>` packages (default export).
|
|
48
48
|
* - **`src`** (legacy) – Imports from the `@ckeditor/ckeditor5-<NAME>/src/*`.
|
|
49
49
|
* - **DLL builds** (legacy) – Imports from the `ckeditor5/build/<NAME>` and `@ckeditor/ckeditor5-<NAME>/build/*`.
|
|
50
50
|
*
|
|
51
51
|
* The best way to avoid duplicate modules is to avoid mixing these installation methods. For example, if you use imports
|
|
52
52
|
* specific to the optimized build, you should use them for all CKEditor 5 packages. In addition, since
|
|
53
|
-
* the
|
|
53
|
+
* the DLL builds already include the core of the editor, they cannot be used with other types of imports.
|
|
54
54
|
*
|
|
55
55
|
* Here is a matrix showing which installation methods are compatible with each other:
|
|
56
56
|
*
|
|
@@ -89,11 +89,15 @@ if (globalThis.CKEDITOR_VERSION) {
|
|
|
89
89
|
* </details>
|
|
90
90
|
*
|
|
91
91
|
* <details>
|
|
92
|
-
* <summary>(
|
|
92
|
+
* <summary>(Deprecated) Predefined builds</summary>
|
|
93
93
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
94
|
+
* **As of April, 2025 predefined build are no longer supported. Please refer to the
|
|
95
|
+
* {@glink getting-started/index Quick Start} guide
|
|
96
|
+
* to choose one of the modern installation and integration methods available**.
|
|
97
|
+
*
|
|
98
|
+
* If you use the predefined builds, you cannot import any additional plugins.
|
|
99
|
+
* These builds already include the editor's core and selected plugins and importing additional
|
|
100
|
+
* ones will cause some modules to be bundled and loaded twice.
|
|
97
101
|
*
|
|
98
102
|
* Examples of valid and invalid import paths:
|
|
99
103
|
*
|
|
@@ -106,13 +110,9 @@ if (globalThis.CKEDITOR_VERSION) {
|
|
|
106
110
|
* import '@ckeditor/ckeditor5-highlight/build/highlight'; // ❌
|
|
107
111
|
* ```
|
|
108
112
|
*
|
|
109
|
-
* If you are missing some features from the
|
|
110
|
-
* {@glink
|
|
111
|
-
* you should switch to the {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}
|
|
113
|
+
* If you are missing some features from the list of plugins, you should switch to the
|
|
114
|
+
* {@glink updating/nim-migration/migration-to-new-installation-methods new installation methods}
|
|
112
115
|
* which do not have this limitation.
|
|
113
|
-
* If you cannot migrate to the new installation methods, try the
|
|
114
|
-
* {@glink getting-started/legacy/installation-methods/predefined-builds#superbuild superbuild} instead.
|
|
115
|
-
* This build contains all the editor features.
|
|
116
116
|
* </details>
|
|
117
117
|
*
|
|
118
118
|
* <details>
|
|
@@ -123,8 +123,7 @@ if (globalThis.CKEDITOR_VERSION) {
|
|
|
123
123
|
* the `@ckeditor/ckeditor5-<NAME>/src/*` files, it is not recommended as it can make migration to the new installation
|
|
124
124
|
* methods more difficult.
|
|
125
125
|
*
|
|
126
|
-
* If you use this installation method, you should not import code from the `ckeditor5
|
|
127
|
-
* or `@ckeditor/ckeditor5-build-<NAME>` packages.
|
|
126
|
+
* If you use this installation method, you should not import code from the `ckeditor5` or `ckeditor5-premium-features` packages.
|
|
128
127
|
*
|
|
129
128
|
* Examples of valid and invalid import paths:
|
|
130
129
|
*
|