@ckeditor/ckeditor5-core 45.2.1 → 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-content.css +15 -0
- package/dist/index-editor.css +7 -0
- package/dist/index.css +23 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +80 -93
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/src/accessibility.d.ts +10 -7
- package/src/accessibility.js +4 -1
- package/src/command.d.ts +3 -3
- package/src/command.js +2 -2
- package/src/commandcollection.d.ts +2 -2
- package/src/commandcollection.js +1 -1
- package/src/context.d.ts +3 -3
- package/src/context.js +2 -2
- package/src/contextplugin.d.ts +4 -4
- package/src/contextplugin.js +1 -1
- package/src/editingkeystrokehandler.d.ts +3 -3
- package/src/editingkeystrokehandler.js +2 -2
- package/src/editor/editor.d.ts +9 -8
- package/src/editor/editor.js +9 -8
- package/src/editor/editorconfig.d.ts +4 -4
- package/src/editor/utils/attachtoform.d.ts +2 -2
- package/src/editor/utils/attachtoform.js +1 -1
- package/src/editor/utils/editorusagedata.d.ts +1 -1
- package/src/editor/utils/elementapimixin.d.ts +2 -2
- package/src/editor/utils/elementapimixin.js +1 -3
- package/src/editor/utils/securesourceelement.d.ts +2 -2
- package/src/editor/utils/securesourceelement.js +1 -1
- package/src/index.d.ts +16 -16
- package/src/index.js +14 -11
- package/src/multicommand.d.ts +2 -2
- package/src/multicommand.js +2 -2
- package/src/pendingactions.d.ts +2 -2
- package/src/pendingactions.js +2 -2
- package/src/plugin.d.ts +5 -5
- package/src/plugin.js +1 -1
- package/src/plugincollection.d.ts +1 -1
- package/src/plugincollection.js +1 -1
- package/theme/core.css +21 -0
- package/src/editor/utils/dataapimixin.d.ts +0 -79
- package/src/editor/utils/dataapimixin.js +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "46.0.0-alpha.0",
|
|
4
4
|
"description": "The core architecture of CKEditor 5 – the best browser-based rich text editor.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wysiwyg",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"type": "module",
|
|
25
25
|
"main": "src/index.js",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ckeditor/ckeditor5-engine": "
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "
|
|
30
|
-
"@ckeditor/ckeditor5-watchdog": "
|
|
31
|
-
"es-toolkit": "1.
|
|
27
|
+
"@ckeditor/ckeditor5-engine": "46.0.0-alpha.0",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "46.0.0-alpha.0",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "46.0.0-alpha.0",
|
|
30
|
+
"@ckeditor/ckeditor5-watchdog": "46.0.0-alpha.0",
|
|
31
|
+
"es-toolkit": "1.39.5"
|
|
32
32
|
},
|
|
33
33
|
"author": "CKSource (http://cksource.com/)",
|
|
34
34
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"lang",
|
|
45
45
|
"src/**/*.js",
|
|
46
46
|
"src/**/*.d.ts",
|
|
47
|
+
"theme",
|
|
47
48
|
"CHANGELOG.md"
|
|
48
49
|
],
|
|
49
50
|
"types": "src/index.d.ts",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"default": "./src/*"
|
|
65
66
|
},
|
|
66
67
|
"./lang/*": "./lang/*",
|
|
68
|
+
"./theme/*": "./theme/*",
|
|
67
69
|
"./package.json": "./package.json"
|
|
68
70
|
}
|
|
69
71
|
}
|
package/src/accessibility.d.ts
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
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 type Editor from './editor/editor.js';
|
|
5
|
+
import { type Editor } from './editor/editor.js';
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
6
9
|
export declare const DEFAULT_GROUP_ID: "common";
|
|
7
10
|
/**
|
|
8
11
|
* A common namespace for various accessibility features of the editor.
|
|
@@ -13,7 +16,7 @@ export declare const DEFAULT_GROUP_ID: "common";
|
|
|
13
16
|
* * New info entries can be added using the {@link #addKeystrokeInfoCategory}, {@link #addKeystrokeInfoGroup},
|
|
14
17
|
* and {@link #addKeystrokeInfos} methods.
|
|
15
18
|
*/
|
|
16
|
-
export
|
|
19
|
+
export declare class Accessibility {
|
|
17
20
|
/**
|
|
18
21
|
* Stores information about keystrokes brought by editor features for the users to interact with the editor, mainly
|
|
19
22
|
* keystroke combinations and their accessible labels.
|
|
@@ -31,7 +34,7 @@ export default class Accessibility {
|
|
|
31
34
|
* * unless specified otherwise, new keystrokes are added into the `'contentEditing'` category and the `'common'`
|
|
32
35
|
* keystroke group within that category while using the {@link #addKeystrokeInfos} method.
|
|
33
36
|
*/
|
|
34
|
-
readonly keystrokeInfos:
|
|
37
|
+
readonly keystrokeInfos: KeystrokeInfoDefinitions;
|
|
35
38
|
/**
|
|
36
39
|
* The editor instance.
|
|
37
40
|
*/
|
|
@@ -286,11 +289,11 @@ export interface AddKeystrokeInfosData {
|
|
|
286
289
|
*/
|
|
287
290
|
keystrokes: Array<KeystrokeInfoDefinition>;
|
|
288
291
|
}
|
|
289
|
-
export type
|
|
292
|
+
export type KeystrokeInfoDefinitions = Map<string, KeystrokeInfoCategoryDefinition>;
|
|
290
293
|
/**
|
|
291
294
|
* A category of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
|
|
292
295
|
*/
|
|
293
|
-
export type
|
|
296
|
+
export type KeystrokeInfoCategoryDefinition = {
|
|
294
297
|
/**
|
|
295
298
|
* The unique id of the category.
|
|
296
299
|
*/
|
|
@@ -306,12 +309,12 @@ export type KeystrokeInfoCategory = {
|
|
|
306
309
|
/**
|
|
307
310
|
* Groups of keystrokes within the category.
|
|
308
311
|
*/
|
|
309
|
-
groups: Map<string,
|
|
312
|
+
groups: Map<string, KeystrokeInfoGroupDefinition>;
|
|
310
313
|
};
|
|
311
314
|
/**
|
|
312
315
|
* A group of keystrokes in {@link module:core/accessibility~Accessibility#keystrokeInfos}.
|
|
313
316
|
*/
|
|
314
|
-
export type
|
|
317
|
+
export type KeystrokeInfoGroupDefinition = {
|
|
315
318
|
/**
|
|
316
319
|
* The unique id of the group.
|
|
317
320
|
*/
|
package/src/accessibility.js
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
9
9
|
const DEFAULT_CATEGORY_ID = 'contentEditing';
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
10
13
|
export const DEFAULT_GROUP_ID = 'common';
|
|
11
14
|
/**
|
|
12
15
|
* A common namespace for various accessibility features of the editor.
|
|
@@ -17,7 +20,7 @@ export const DEFAULT_GROUP_ID = 'common';
|
|
|
17
20
|
* * New info entries can be added using the {@link #addKeystrokeInfoCategory}, {@link #addKeystrokeInfoGroup},
|
|
18
21
|
* and {@link #addKeystrokeInfos} methods.
|
|
19
22
|
*/
|
|
20
|
-
export
|
|
23
|
+
export class Accessibility {
|
|
21
24
|
/**
|
|
22
25
|
* Stores information about keystrokes brought by editor features for the users to interact with the editor, mainly
|
|
23
26
|
* keystroke combinations and their accessible labels.
|
package/src/command.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module core/command
|
|
7
7
|
*/
|
|
8
8
|
import { type DecoratedMethodEvent } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Editor from './editor/editor.js';
|
|
9
|
+
import { type Editor } from './editor/editor.js';
|
|
10
10
|
declare const Command_base: {
|
|
11
11
|
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
12
12
|
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
@@ -24,7 +24,7 @@ declare const Command_base: {
|
|
|
24
24
|
* By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode
|
|
25
25
|
* but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export declare class Command extends /* #__PURE__ */ Command_base {
|
|
28
28
|
/**
|
|
29
29
|
* The editor on which this command will be used.
|
|
30
30
|
*/
|
|
@@ -100,7 +100,7 @@ export default class Command extends /* #__PURE__ */ Command_base {
|
|
|
100
100
|
* in this method.
|
|
101
101
|
*
|
|
102
102
|
* This method is automatically called when
|
|
103
|
-
* {@link module:engine/model/document~
|
|
103
|
+
* {@link module:engine/model/document~ModelDocument#event:change any changes are applied to the document}.
|
|
104
104
|
*/
|
|
105
105
|
refresh(): void;
|
|
106
106
|
/**
|
package/src/command.js
CHANGED
|
@@ -19,7 +19,7 @@ import { ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
|
19
19
|
* By default, commands are disabled when the editor is in the {@link module:core/editor/editor~Editor#isReadOnly read-only} mode
|
|
20
20
|
* but commands with the {@link module:core/command~Command#affectsData `affectsData`} flag set to `false` will not be disabled.
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export class Command extends /* #__PURE__ */ ObservableMixin() {
|
|
23
23
|
/**
|
|
24
24
|
* The editor on which this command will be used.
|
|
25
25
|
*/
|
|
@@ -111,7 +111,7 @@ export default class Command extends /* #__PURE__ */ ObservableMixin() {
|
|
|
111
111
|
* in this method.
|
|
112
112
|
*
|
|
113
113
|
* This method is automatically called when
|
|
114
|
-
* {@link module:engine/model/document~
|
|
114
|
+
* {@link module:engine/model/document~ModelDocument#event:change any changes are applied to the document}.
|
|
115
115
|
*/
|
|
116
116
|
refresh() {
|
|
117
117
|
this.isEnabled = true;
|
|
@@ -2,11 +2,11 @@
|
|
|
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 type Command from './command.js';
|
|
5
|
+
import { type Command } from './command.js';
|
|
6
6
|
/**
|
|
7
7
|
* Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export declare class CommandCollection implements Iterable<[string, Command]> {
|
|
10
10
|
/**
|
|
11
11
|
* Command map.
|
|
12
12
|
*/
|
package/src/commandcollection.js
CHANGED
|
@@ -9,7 +9,7 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
|
9
9
|
/**
|
|
10
10
|
* Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export class CommandCollection {
|
|
13
13
|
/**
|
|
14
14
|
* Command map.
|
|
15
15
|
*/
|
package/src/context.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @module core/context
|
|
7
7
|
*/
|
|
8
8
|
import { Config, Collection, Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import PluginCollection from './plugincollection.js';
|
|
10
|
-
import type Editor from './editor/editor.js';
|
|
9
|
+
import { PluginCollection } from './plugincollection.js';
|
|
10
|
+
import { type Editor } from './editor/editor.js';
|
|
11
11
|
import type { LoadedPlugins, PluginConstructor } from './plugin.js';
|
|
12
12
|
import type { EditorConfig } from './editor/editorconfig.js';
|
|
13
13
|
/**
|
|
@@ -37,7 +37,7 @@ import type { EditorConfig } from './editor/editorconfig.js';
|
|
|
37
37
|
*
|
|
38
38
|
* See {@link ~Context.create `Context.create()`} for usage examples.
|
|
39
39
|
*/
|
|
40
|
-
export
|
|
40
|
+
export declare class Context {
|
|
41
41
|
/**
|
|
42
42
|
* Stores all the configurations specific to this context instance.
|
|
43
43
|
*/
|
package/src/context.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module core/context
|
|
7
7
|
*/
|
|
8
8
|
import { Config, Collection, CKEditorError, Locale } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import PluginCollection from './plugincollection.js';
|
|
9
|
+
import { PluginCollection } from './plugincollection.js';
|
|
10
10
|
/**
|
|
11
11
|
* Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
|
|
12
12
|
* or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
|
|
@@ -34,7 +34,7 @@ import PluginCollection from './plugincollection.js';
|
|
|
34
34
|
*
|
|
35
35
|
* See {@link ~Context.create `Context.create()`} for usage examples.
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export class Context {
|
|
38
38
|
/**
|
|
39
39
|
* Stores all the configurations specific to this context instance.
|
|
40
40
|
*/
|
package/src/contextplugin.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module core/contextplugin
|
|
7
7
|
*/
|
|
8
8
|
import { type Collection, type Config, type Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Editor from './editor/editor.js';
|
|
9
|
+
import { type Editor } from './editor/editor.js';
|
|
10
10
|
import type { EditorConfig } from './editor/editorconfig.js';
|
|
11
|
-
import type Context from './context.js';
|
|
11
|
+
import { type Context } from './context.js';
|
|
12
12
|
import type { PluginDependencies, PluginInterface } from './plugin.js';
|
|
13
|
-
import type PluginCollection from './plugincollection.js';
|
|
13
|
+
import { type PluginCollection } from './plugincollection.js';
|
|
14
14
|
declare const ContextPlugin_base: {
|
|
15
15
|
new (): import("@ckeditor/ckeditor5-utils").Observable;
|
|
16
16
|
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
@@ -29,7 +29,7 @@ declare const ContextPlugin_base: {
|
|
|
29
29
|
* * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
|
|
30
30
|
* * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export declare class ContextPlugin extends /* #__PURE__ */ ContextPlugin_base implements PluginInterface {
|
|
33
33
|
/**
|
|
34
34
|
* The context or editor instance.
|
|
35
35
|
*/
|
package/src/contextplugin.js
CHANGED
|
@@ -20,7 +20,7 @@ import { ObservableMixin } from '@ckeditor/ckeditor5-utils';
|
|
|
20
20
|
* * An {@link module:core/plugin~Plugin editor plugin} can require a context plugin.
|
|
21
21
|
* * A context plugin MUST NOT require an {@link module:core/plugin~Plugin editor plugin}.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export class ContextPlugin extends /* #__PURE__ */ ObservableMixin() {
|
|
24
24
|
/**
|
|
25
25
|
* The context or editor instance.
|
|
26
26
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module core/editingkeystrokehandler
|
|
7
7
|
*/
|
|
8
8
|
import { KeystrokeHandler, type PriorityString } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Editor from './editor/editor.js';
|
|
9
|
+
import { type Editor } from './editor/editor.js';
|
|
10
10
|
/**
|
|
11
11
|
* A keystroke handler for editor editing. Its instance is available
|
|
12
12
|
* in {@link module:core/editor/editor~Editor#keystrokes} so plugins
|
|
@@ -20,7 +20,7 @@ import type Editor from './editor/editor.js';
|
|
|
20
20
|
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export declare class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
24
24
|
/**
|
|
25
25
|
* The editor instance.
|
|
26
26
|
*/
|
|
@@ -39,7 +39,7 @@ export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
|
39
39
|
* @param callback If a string is passed, then the keystroke will
|
|
40
40
|
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
41
41
|
* If a function, then it will be called with the
|
|
42
|
-
* {@link module:engine/view/observer/keyobserver~
|
|
42
|
+
* {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
|
|
43
43
|
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
44
44
|
* @param options Additional options.
|
|
45
45
|
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
|
@@ -19,7 +19,7 @@ import { KeystrokeHandler } from '@ckeditor/ckeditor5-utils';
|
|
|
19
19
|
* editor.keystrokes.set( 'Ctrl+Y', 'redo' );
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export
|
|
22
|
+
export class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
23
23
|
/**
|
|
24
24
|
* The editor instance.
|
|
25
25
|
*/
|
|
@@ -41,7 +41,7 @@ export default class EditingKeystrokeHandler extends KeystrokeHandler {
|
|
|
41
41
|
* @param callback If a string is passed, then the keystroke will
|
|
42
42
|
* {@link module:core/editor/editor~Editor#execute execute a command}.
|
|
43
43
|
* If a function, then it will be called with the
|
|
44
|
-
* {@link module:engine/view/observer/keyobserver~
|
|
44
|
+
* {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
|
|
45
45
|
* a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
|
|
46
46
|
* @param options Additional options.
|
|
47
47
|
* @param options.priority The priority of the keystroke callback. The higher the priority value
|
package/src/editor/editor.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ import { Config, type Locale, type LocaleTranslate } from '@ckeditor/ckeditor5-u
|
|
|
6
6
|
import { Conversion, DataController, EditingController, Model } from '@ckeditor/ckeditor5-engine';
|
|
7
7
|
import type { EditorUI } from '@ckeditor/ckeditor5-ui';
|
|
8
8
|
import { ContextWatchdog, EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
|
|
9
|
-
import Context from '../context.js';
|
|
10
|
-
import PluginCollection from '../plugincollection.js';
|
|
11
|
-
import CommandCollection,
|
|
12
|
-
import EditingKeystrokeHandler from '../editingkeystrokehandler.js';
|
|
13
|
-
import Accessibility from '../accessibility.js';
|
|
9
|
+
import { Context } from '../context.js';
|
|
10
|
+
import { PluginCollection } from '../plugincollection.js';
|
|
11
|
+
import { CommandCollection, type CommandsMap } from '../commandcollection.js';
|
|
12
|
+
import { EditingKeystrokeHandler } from '../editingkeystrokehandler.js';
|
|
13
|
+
import { Accessibility } from '../accessibility.js';
|
|
14
14
|
import type { LoadedPlugins, PluginConstructor } from '../plugin.js';
|
|
15
15
|
import type { EditorConfig } from './editorconfig.js';
|
|
16
|
+
import '../../theme/core.css';
|
|
16
17
|
declare global {
|
|
17
18
|
var CKEDITOR_GLOBAL_LICENSE_KEY: string | undefined;
|
|
18
19
|
var CKEDITOR_WARNING_SUPPRESSIONS: Record<string, boolean>;
|
|
@@ -39,7 +40,7 @@ declare const Editor_base: {
|
|
|
39
40
|
* the specific editor implements also the {@link ~Editor#ui} property
|
|
40
41
|
* (as most editor implementations do).
|
|
41
42
|
*/
|
|
42
|
-
export
|
|
43
|
+
export declare abstract class Editor extends /* #__PURE__ */ Editor_base {
|
|
43
44
|
/**
|
|
44
45
|
* A required name of the editor class. The name should reflect the constructor name.
|
|
45
46
|
*/
|
|
@@ -127,7 +128,7 @@ export default abstract class Editor extends /* #__PURE__ */ Editor_base {
|
|
|
127
128
|
* Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
|
|
128
129
|
* by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
|
|
129
130
|
* To handle these specific keystrokes, see the events fired by the
|
|
130
|
-
* {@link module:engine/view/document~
|
|
131
|
+
* {@link module:engine/view/document~ViewDocument editing view document} (`editor.editing.view.document`).
|
|
131
132
|
*/
|
|
132
133
|
readonly keystrokes: EditingKeystrokeHandler;
|
|
133
134
|
/**
|
|
@@ -416,7 +417,7 @@ export default abstract class Editor extends /* #__PURE__ */ Editor_base {
|
|
|
416
417
|
* Focuses the editor.
|
|
417
418
|
*
|
|
418
419
|
* **Note** To explicitly focus the editing area of the editor, use the
|
|
419
|
-
* {@link module:engine/view/view~
|
|
420
|
+
* {@link module:engine/view/view~EditingView#focus `editor.editing.view.focus()`} method of the editing view.
|
|
420
421
|
*
|
|
421
422
|
* Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
|
|
422
423
|
* of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
|
package/src/editor/editor.js
CHANGED
|
@@ -9,12 +9,13 @@ import { set, get } from 'es-toolkit/compat';
|
|
|
9
9
|
import { Config, CKEditorError, ObservableMixin, logError, parseBase64EncodedObject, releaseDate, toArray, uid, crc32 } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
import { Conversion, DataController, EditingController, Model, StylesProcessor } from '@ckeditor/ckeditor5-engine';
|
|
11
11
|
import { ContextWatchdog, EditorWatchdog } from '@ckeditor/ckeditor5-watchdog';
|
|
12
|
-
import Context from '../context.js';
|
|
13
|
-
import PluginCollection from '../plugincollection.js';
|
|
14
|
-
import CommandCollection from '../commandcollection.js';
|
|
15
|
-
import EditingKeystrokeHandler from '../editingkeystrokehandler.js';
|
|
16
|
-
import Accessibility from '../accessibility.js';
|
|
12
|
+
import { Context } from '../context.js';
|
|
13
|
+
import { PluginCollection } from '../plugincollection.js';
|
|
14
|
+
import { CommandCollection } from '../commandcollection.js';
|
|
15
|
+
import { EditingKeystrokeHandler } from '../editingkeystrokehandler.js';
|
|
16
|
+
import { Accessibility } from '../accessibility.js';
|
|
17
17
|
import { getEditorUsageData } from './utils/editorusagedata.js';
|
|
18
|
+
import '../../theme/core.css';
|
|
18
19
|
/**
|
|
19
20
|
* The class representing a basic, generic editor.
|
|
20
21
|
*
|
|
@@ -123,7 +124,7 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
123
124
|
* Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
|
|
124
125
|
* by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
|
|
125
126
|
* To handle these specific keystrokes, see the events fired by the
|
|
126
|
-
* {@link module:engine/view/document~
|
|
127
|
+
* {@link module:engine/view/document~ViewDocument editing view document} (`editor.editing.view.document`).
|
|
127
128
|
*/
|
|
128
129
|
keystrokes;
|
|
129
130
|
/**
|
|
@@ -708,7 +709,7 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
708
709
|
* Focuses the editor.
|
|
709
710
|
*
|
|
710
711
|
* **Note** To explicitly focus the editing area of the editor, use the
|
|
711
|
-
* {@link module:engine/view/view~
|
|
712
|
+
* {@link module:engine/view/view~EditingView#focus `editor.editing.view.focus()`} method of the editing view.
|
|
712
713
|
*
|
|
713
714
|
* Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
|
|
714
715
|
* of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
|
|
@@ -899,7 +900,7 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
899
900
|
return response.json();
|
|
900
901
|
}
|
|
901
902
|
}
|
|
902
|
-
export
|
|
903
|
+
export { Editor };
|
|
903
904
|
function collectUsageData(editor) {
|
|
904
905
|
const collectedData = getEditorUsageData(editor);
|
|
905
906
|
function setUsageData(path, value) {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @module core/editor/editorconfig
|
|
7
7
|
*/
|
|
8
8
|
import type { ArrayOrItem, Translations } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Context from '../context.js';
|
|
9
|
+
import { type Context } from '../context.js';
|
|
10
10
|
import type { PluginConstructor } from '../plugin.js';
|
|
11
|
-
import type Editor from './editor.js';
|
|
11
|
+
import { type Editor } from './editor.js';
|
|
12
12
|
import type { MenuBarConfig } from '@ckeditor/ckeditor5-ui';
|
|
13
13
|
/**
|
|
14
14
|
* CKEditor configuration options.
|
|
@@ -166,7 +166,7 @@ export interface EditorConfig {
|
|
|
166
166
|
* </script>
|
|
167
167
|
* <script type="module">
|
|
168
168
|
* import { ClassicEditor, Essentials, Paragraph } from 'ckeditor5';
|
|
169
|
-
* import translations from 'ckeditor5/dist/translations/pl.js';
|
|
169
|
+
* import { translations } from 'ckeditor5/dist/translations/pl.js';
|
|
170
170
|
*
|
|
171
171
|
* await ClassicEditor.create( document.querySelector( '#editor' ), {
|
|
172
172
|
* plugins: [
|
|
@@ -185,7 +185,7 @@ export interface EditorConfig {
|
|
|
185
185
|
*
|
|
186
186
|
* ```html
|
|
187
187
|
* import { ClassicEditor, Essentials, Paragraph } from 'ckeditor5';
|
|
188
|
-
* import translations from 'ckeditor5/dist/translations/pl.js';
|
|
188
|
+
* import { translations } from 'ckeditor5/dist/translations/pl.js';
|
|
189
189
|
*
|
|
190
190
|
* import 'ckeditor5/dist/styles.css';
|
|
191
191
|
*
|
|
@@ -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 type {
|
|
5
|
+
import type { Editor } from '../editor.js';
|
|
6
6
|
import type { ElementApi } from './elementapimixin.js';
|
|
7
7
|
/**
|
|
8
8
|
* Checks if the editor is initialized on a `<textarea>` element that belongs to a form. If yes, it updates the editor's element
|
|
@@ -12,4 +12,4 @@ import type { ElementApi } from './elementapimixin.js';
|
|
|
12
12
|
*
|
|
13
13
|
* @param editor Editor instance.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare function attachToForm(editor: Editor & ElementApi): void;
|
|
@@ -15,7 +15,7 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
|
15
15
|
*
|
|
16
16
|
* @param editor Editor instance.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export function attachToForm(editor) {
|
|
19
19
|
if (!isFunction(editor.updateSourceElement)) {
|
|
20
20
|
/**
|
|
21
21
|
* The editor passed to `attachToForm()` must implement the
|
|
@@ -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 type Editor from '../editor.js';
|
|
5
|
+
import { type Editor } from '../editor.js';
|
|
6
6
|
/**
|
|
7
7
|
* This part of the code is not executed in open-source implementations using a GPL key.
|
|
8
8
|
* It only runs when a specific license key is provided. If you are uncertain whether
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* @module core/editor/utils/elementapimixin
|
|
7
7
|
*/
|
|
8
8
|
import { type Constructor, type Mixed } from '@ckeditor/ckeditor5-utils';
|
|
9
|
-
import type Editor from '../editor.js';
|
|
9
|
+
import { type Editor } from '../editor.js';
|
|
10
10
|
/**
|
|
11
11
|
* Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export declare function ElementApiMixin<Base extends Constructor<Editor>>(base: Base): Mixed<Base, ElementApi>;
|
|
14
14
|
/**
|
|
15
15
|
* Interface describing an editor that replaced a DOM element (was "initialized on an element").
|
|
16
16
|
*
|
|
@@ -9,7 +9,7 @@ import { CKEditorError, setDataInElement } from '@ckeditor/ckeditor5-utils';
|
|
|
9
9
|
/**
|
|
10
10
|
* Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export function ElementApiMixin(base) {
|
|
13
13
|
class Mixin extends base {
|
|
14
14
|
sourceElement;
|
|
15
15
|
updateSourceElement(data) {
|
|
@@ -40,5 +40,3 @@ export default function ElementApiMixin(base) {
|
|
|
40
40
|
}
|
|
41
41
|
return Mixin;
|
|
42
42
|
}
|
|
43
|
-
// Backward compatibility with `mix`.
|
|
44
|
-
ElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSourceElement;
|
|
@@ -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 type {
|
|
5
|
+
import type { Editor } from '../editor.js';
|
|
6
6
|
/**
|
|
7
7
|
* Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.
|
|
8
8
|
*
|
|
@@ -12,6 +12,6 @@ import type { default as Editor } from '../editor.js';
|
|
|
12
12
|
* @param editor Editor instance.
|
|
13
13
|
* @param sourceElement Element to bind with the editor instance.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare function secureSourceElement(editor: Editor, sourceElement: HTMLElement & {
|
|
16
16
|
ckeditorInstance?: Editor;
|
|
17
17
|
}): void;
|
|
@@ -15,7 +15,7 @@ import { CKEditorError } from '@ckeditor/ckeditor5-utils';
|
|
|
15
15
|
* @param editor Editor instance.
|
|
16
16
|
* @param sourceElement Element to bind with the editor instance.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
18
|
+
export function secureSourceElement(editor, sourceElement) {
|
|
19
19
|
if (sourceElement.ckeditorInstance) {
|
|
20
20
|
/**
|
|
21
21
|
* A DOM element used to create the editor (e.g.
|
package/src/index.d.ts
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module core
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export type
|
|
12
|
-
export type { PluginsMap,
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export { type EditingKeystrokeCallback } from './editingkeystrokehandler.js';
|
|
8
|
+
export { Plugin, type PluginDependencies, type PluginConstructor, type PluginInterface, type PluginClassConstructor, type PluginFunctionConstructor, type PluginStaticMembers, type LoadedPlugins } from './plugin.js';
|
|
9
|
+
export { Command, type CommandExecuteEvent } from './command.js';
|
|
10
|
+
export { MultiCommand } from './multicommand.js';
|
|
11
|
+
export { CommandCollection, type CommandsMap } from './commandcollection.js';
|
|
12
|
+
export type { PluginsMap, PluginCollection, PluginEntry } from './plugincollection.js';
|
|
13
|
+
export { Context, type ContextConfig } from './context.js';
|
|
14
|
+
export { ContextPlugin, type ContextInterface, type ContextPluginDependencies } from './contextplugin.js';
|
|
15
|
+
export { EditingKeystrokeHandler, type EditingKeystrokeCallback } from './editingkeystrokehandler.js';
|
|
16
16
|
export type { PartialBy, NonEmptyArray, HexColor } from './typings.js';
|
|
17
|
-
export {
|
|
18
|
-
export type { EditorConfig, LanguageConfig, ToolbarConfig, ToolbarConfigItem, UiConfig, ViewportOffsetConfig } from './editor/editorconfig.js';
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export
|
|
17
|
+
export { Editor, type EditorCollectUsageDataEvent, type EditorReadyEvent, type EditorDestroyEvent } from './editor/editor.js';
|
|
18
|
+
export type { EditorConfig, LanguageConfig, ToolbarConfig, ToolbarConfigItem, UiConfig, ViewportOffsetConfig, PoweredByConfig } from './editor/editorconfig.js';
|
|
19
|
+
export { attachToForm } from './editor/utils/attachtoform.js';
|
|
20
|
+
export { ElementApiMixin, type ElementApi } from './editor/utils/elementapimixin.js';
|
|
21
|
+
export { secureSourceElement } from './editor/utils/securesourceelement.js';
|
|
22
|
+
export { PendingActions, type PendingAction, type PendingActionsAddEvent, type PendingActionsRemoveEvent } from './pendingactions.js';
|
|
23
|
+
export { Accessibility, DEFAULT_GROUP_ID as _DEFAULT_ACCESSIBILITY_GROUP_ID, type AddKeystrokeInfoCategoryData, type AddKeystrokeInfoGroupData, type AddKeystrokeInfosData, type KeystrokeInfoDefinition, type KeystrokeInfoDefinitions, type KeystrokeInfoGroupDefinition, type KeystrokeInfoCategoryDefinition } from './accessibility.js';
|
|
24
|
+
export { getEditorUsageData as _getEditorUsageData, type EditorUsageData as _EditorUsageData } from './editor/utils/editorusagedata.js';
|
|
25
25
|
import './augmentation.js';
|
package/src/index.js
CHANGED
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module core
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
8
|
+
export { Plugin } from './plugin.js';
|
|
9
|
+
export { Command } from './command.js';
|
|
10
|
+
export { MultiCommand } from './multicommand.js';
|
|
11
|
+
export { CommandCollection } from './commandcollection.js';
|
|
12
|
+
export { Context } from './context.js';
|
|
13
|
+
export { ContextPlugin } from './contextplugin.js';
|
|
14
|
+
export { EditingKeystrokeHandler } from './editingkeystrokehandler.js';
|
|
15
|
+
export { Editor } from './editor/editor.js';
|
|
16
|
+
export { attachToForm } from './editor/utils/attachtoform.js';
|
|
17
|
+
export { ElementApiMixin } from './editor/utils/elementapimixin.js';
|
|
18
|
+
export { secureSourceElement } from './editor/utils/securesourceelement.js';
|
|
19
|
+
export { PendingActions } from './pendingactions.js';
|
|
20
|
+
export { Accessibility, DEFAULT_GROUP_ID as _DEFAULT_ACCESSIBILITY_GROUP_ID } from './accessibility.js';
|
|
21
|
+
export { getEditorUsageData as _getEditorUsageData } from './editor/utils/editorusagedata.js';
|
|
19
22
|
import './augmentation.js';
|
package/src/multicommand.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module core/multicommand
|
|
7
7
|
*/
|
|
8
|
-
import Command from './command.js';
|
|
8
|
+
import { Command } from './command.js';
|
|
9
9
|
import { type PriorityString } from '@ckeditor/ckeditor5-utils';
|
|
10
10
|
/**
|
|
11
11
|
* A CKEditor command that aggregates other commands.
|
|
@@ -31,7 +31,7 @@ import { type PriorityString } from '@ckeditor/ckeditor5-utils';
|
|
|
31
31
|
* multiCommand.execute(); // Will execute commandBar.
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export declare class MultiCommand extends Command {
|
|
35
35
|
/**
|
|
36
36
|
* Registered child commands definitions.
|
|
37
37
|
*/
|