@ckeditor/ckeditor5-watchdog 45.2.1-alpha.9 → 46.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/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/contextwatchdog.d.ts +6 -6
- package/src/contextwatchdog.js +5 -5
- package/src/editorwatchdog.d.ts +8 -5
- package/src/editorwatchdog.js +3 -3
- package/src/index.d.ts +4 -3
- package/src/index.js +3 -3
- package/src/utils/areconnectedthroughproperties.d.ts +3 -1
- package/src/utils/areconnectedthroughproperties.js +4 -2
- package/src/utils/getsubnodes.d.ts +4 -1
- package/src/utils/getsubnodes.js +4 -1
- package/src/watchdog.d.ts +1 -1
- package/src/watchdog.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-watchdog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "46.0.0-alpha.0",
|
|
4
4
|
"description": "A watchdog feature for CKEditor 5 editors. It keeps a CKEditor 5 editor instance running.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ckeditor/ckeditor5-core": "
|
|
16
|
-
"@ckeditor/ckeditor5-editor-multi-root": "
|
|
17
|
-
"@ckeditor/ckeditor5-engine": "
|
|
18
|
-
"@ckeditor/ckeditor5-utils": "
|
|
19
|
-
"es-toolkit": "1.
|
|
15
|
+
"@ckeditor/ckeditor5-core": "46.0.0-alpha.0",
|
|
16
|
+
"@ckeditor/ckeditor5-editor-multi-root": "46.0.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-engine": "46.0.0-alpha.0",
|
|
18
|
+
"@ckeditor/ckeditor5-utils": "46.0.0-alpha.0",
|
|
19
|
+
"es-toolkit": "1.39.5"
|
|
20
20
|
},
|
|
21
21
|
"author": "CKSource (http://cksource.com/)",
|
|
22
22
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/contextwatchdog.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog/contextwatchdog
|
|
7
7
|
*/
|
|
8
|
-
import Watchdog,
|
|
9
|
-
import EditorWatchdog,
|
|
8
|
+
import { Watchdog, type WatchdogConfig, type WatchdogState } from './watchdog.js';
|
|
9
|
+
import { EditorWatchdog, type EditorWatchdogCreatorFunction } from './editorwatchdog.js';
|
|
10
10
|
import type { ArrayOrItem, CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
11
11
|
import type { Context, Editor, EditorConfig, ContextConfig } from '@ckeditor/ckeditor5-core';
|
|
12
12
|
/**
|
|
@@ -15,7 +15,7 @@ import type { Context, Editor, EditorConfig, ContextConfig } from '@ckeditor/cke
|
|
|
15
15
|
* See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and
|
|
16
16
|
* how to use it.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare class ContextWatchdog<TContext extends Context = Context> extends Watchdog {
|
|
19
19
|
/**
|
|
20
20
|
* A map of internal watchdogs for added items.
|
|
21
21
|
*/
|
|
@@ -187,7 +187,7 @@ export default class ContextWatchdog<TContext extends Context = Context> extends
|
|
|
187
187
|
*
|
|
188
188
|
* @param itemConfigurationOrItemConfigurations An item configuration object or an array of item configurations.
|
|
189
189
|
*/
|
|
190
|
-
add(itemConfigurationOrItemConfigurations: ArrayOrItem<
|
|
190
|
+
add(itemConfigurationOrItemConfigurations: ArrayOrItem<ContextWatchdogItemConfiguration>): Promise<unknown>;
|
|
191
191
|
/**
|
|
192
192
|
* Removes and destroys item(s) with given ID(s).
|
|
193
193
|
*
|
|
@@ -302,7 +302,7 @@ export type ContextWatchdogItemRestartEventData = {
|
|
|
302
302
|
/**
|
|
303
303
|
* The watchdog item configuration interface.
|
|
304
304
|
*/
|
|
305
|
-
export interface
|
|
305
|
+
export interface ContextWatchdogItemConfiguration {
|
|
306
306
|
/**
|
|
307
307
|
* id A unique item identificator.
|
|
308
308
|
*/
|
|
@@ -315,7 +315,7 @@ export interface WatchdogItemConfiguration {
|
|
|
315
315
|
* A function that initializes the item (the editor). The function takes editor initialization arguments
|
|
316
316
|
* and should return a promise. For example: `( el, config ) => ClassicEditor.create( el, config )`.
|
|
317
317
|
*/
|
|
318
|
-
creator:
|
|
318
|
+
creator: EditorWatchdogCreatorFunction;
|
|
319
319
|
/**
|
|
320
320
|
* A function that destroys the item instance (the editor). The function
|
|
321
321
|
* takes an item and should return a promise. For example: `editor => editor.destroy()`
|
package/src/contextwatchdog.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog/contextwatchdog
|
|
7
7
|
*/
|
|
8
|
-
import Watchdog from './watchdog.js';
|
|
9
|
-
import EditorWatchdog from './editorwatchdog.js';
|
|
10
|
-
import areConnectedThroughProperties from './utils/areconnectedthroughproperties.js';
|
|
11
|
-
import getSubNodes from './utils/getsubnodes.js';
|
|
8
|
+
import { Watchdog } from './watchdog.js';
|
|
9
|
+
import { EditorWatchdog } from './editorwatchdog.js';
|
|
10
|
+
import { areConnectedThroughProperties } from './utils/areconnectedthroughproperties.js';
|
|
11
|
+
import { getSubNodes } from './utils/getsubnodes.js';
|
|
12
12
|
const mainQueueId = Symbol('MainQueueId');
|
|
13
13
|
/**
|
|
14
14
|
* A watchdog for the {@link module:core/context~Context} class.
|
|
@@ -16,7 +16,7 @@ const mainQueueId = Symbol('MainQueueId');
|
|
|
16
16
|
* See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and
|
|
17
17
|
* how to use it.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export class ContextWatchdog extends Watchdog {
|
|
20
20
|
/**
|
|
21
21
|
* A map of internal watchdogs for added items.
|
|
22
22
|
*/
|
package/src/editorwatchdog.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 Watchdog,
|
|
5
|
+
import { Watchdog, type WatchdogConfig } from './watchdog.js';
|
|
6
6
|
import type { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
7
7
|
import type { Editor, EditorConfig, Context } from '@ckeditor/ckeditor5-core';
|
|
8
8
|
/**
|
|
@@ -11,7 +11,7 @@ import type { Editor, EditorConfig, Context } from '@ckeditor/ckeditor5-core';
|
|
|
11
11
|
* See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and
|
|
12
12
|
* how to use it.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare class EditorWatchdog<TEditor extends Editor = Editor> extends Watchdog {
|
|
15
15
|
/**
|
|
16
16
|
* The current editor instance.
|
|
17
17
|
*/
|
|
@@ -57,7 +57,7 @@ export default class EditorWatchdog<TEditor extends Editor = Editor> extends Wat
|
|
|
57
57
|
*
|
|
58
58
|
* @see #setCreator
|
|
59
59
|
*/
|
|
60
|
-
protected _creator:
|
|
60
|
+
protected _creator: EditorWatchdogCreatorFunction<TEditor>;
|
|
61
61
|
/**
|
|
62
62
|
* The destruction method.
|
|
63
63
|
*
|
|
@@ -88,7 +88,7 @@ export default class EditorWatchdog<TEditor extends Editor = Editor> extends Wat
|
|
|
88
88
|
* watchdog.setCreator( ( element, config ) => ClassicEditor.create( element, config ) );
|
|
89
89
|
* ```
|
|
90
90
|
*/
|
|
91
|
-
setCreator(creator:
|
|
91
|
+
setCreator(creator: EditorWatchdogCreatorFunction<TEditor>): void;
|
|
92
92
|
/**
|
|
93
93
|
* Sets the function that is responsible for the editor destruction.
|
|
94
94
|
* Overrides the default destruction function, which destroys only the editor instance.
|
|
@@ -158,6 +158,9 @@ export default class EditorWatchdog<TEditor extends Editor = Editor> extends Wat
|
|
|
158
158
|
*/
|
|
159
159
|
private _cloneEditorConfiguration;
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
161
164
|
export type EditorData = {
|
|
162
165
|
roots: Record<string, {
|
|
163
166
|
content: string;
|
|
@@ -185,4 +188,4 @@ export type EditorWatchdogRestartEvent = {
|
|
|
185
188
|
args: [];
|
|
186
189
|
return: undefined;
|
|
187
190
|
};
|
|
188
|
-
export type
|
|
191
|
+
export type EditorWatchdogCreatorFunction<TEditor = Editor> = (elementOrData: HTMLElement | string | Record<string, string> | Record<string, HTMLElement>, config: EditorConfig) => Promise<TEditor>;
|
package/src/editorwatchdog.js
CHANGED
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
* @module watchdog/editorwatchdog
|
|
7
7
|
*/
|
|
8
8
|
import { throttle, cloneDeepWith, isElement } from 'es-toolkit/compat';
|
|
9
|
-
import areConnectedThroughProperties from './utils/areconnectedthroughproperties.js';
|
|
10
|
-
import Watchdog from './watchdog.js';
|
|
9
|
+
import { areConnectedThroughProperties } from './utils/areconnectedthroughproperties.js';
|
|
10
|
+
import { Watchdog } from './watchdog.js';
|
|
11
11
|
/**
|
|
12
12
|
* A watchdog for CKEditor 5 editors.
|
|
13
13
|
*
|
|
14
14
|
* See the {@glink features/watchdog Watchdog feature guide} to learn the rationale behind it and
|
|
15
15
|
* how to use it.
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export class EditorWatchdog extends Watchdog {
|
|
18
18
|
/**
|
|
19
19
|
* The current editor instance.
|
|
20
20
|
*/
|
package/src/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
8
|
+
export { ContextWatchdog, type ContextWatchdogRestartEvent, type ContextWatchdogItemErrorEvent, type ContextWatchdogItemErrorEventData, type ContextWatchdogItemRestartEvent, type ContextWatchdogItemRestartEventData, type ContextWatchdogItemConfiguration } from './contextwatchdog.js';
|
|
9
|
+
export { EditorWatchdog, type EditorWatchdogCreatorFunction, type EditorWatchdogRestartEvent } from './editorwatchdog.js';
|
|
10
|
+
export { Watchdog, type WatchdogConfig } from './watchdog.js';
|
|
11
|
+
export type { EventMap, EventArgs, EventCallback, WatchdogErrorEvent, WatchdogErrorEventData, WatchdogStateChangeEvent, WatchdogState } from './watchdog.js';
|
|
11
12
|
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
8
|
+
export { ContextWatchdog } from './contextwatchdog.js';
|
|
9
|
+
export { EditorWatchdog } from './editorwatchdog.js';
|
|
10
|
+
export { Watchdog } from './watchdog.js';
|
|
11
11
|
import './augmentation.js';
|
|
@@ -4,5 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Traverses both structures to find out whether there is a reference that is shared between both structures.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
7
9
|
*/
|
|
8
|
-
export
|
|
10
|
+
export declare function areConnectedThroughProperties(target1: unknown, target2: unknown, excludedNodes?: Set<unknown>): boolean;
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog/utils/areconnectedthroughproperties
|
|
7
7
|
*/
|
|
8
|
-
import getSubNodes from './getsubnodes.js';
|
|
8
|
+
import { getSubNodes } from './getsubnodes.js';
|
|
9
9
|
/**
|
|
10
10
|
* Traverses both structures to find out whether there is a reference that is shared between both structures.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
11
13
|
*/
|
|
12
|
-
export
|
|
14
|
+
export function areConnectedThroughProperties(target1, target2, excludedNodes = new Set()) {
|
|
13
15
|
if (target1 === target2 && isObject(target1)) {
|
|
14
16
|
return true;
|
|
15
17
|
}
|
|
@@ -5,4 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog/utils/getsubnodes
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSubNodes(head: unknown, excludedProperties?: Set<unknown>): Set<unknown>;
|
package/src/utils/getsubnodes.js
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module watchdog/utils/getsubnodes
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function getSubNodes(head, excludedProperties = new Set()) {
|
|
9
12
|
const nodes = [head];
|
|
10
13
|
// @if CK_DEBUG_WATCHDOG // const prevNodeMap = new Map();
|
|
11
14
|
// Nodes are stored to prevent infinite looping.
|
package/src/watchdog.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { ContextWatchdogItemErrorEvent, ContextWatchdogItemRestartEvent } f
|
|
|
15
15
|
*
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export declare abstract class Watchdog {
|
|
19
19
|
/**
|
|
20
20
|
* An array of crashes saved as an object with the following properties:
|
|
21
21
|
*
|