@ckeditor/ckeditor5-core 45.2.1 → 46.0.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.
Files changed (42) hide show
  1. package/dist/index-content.css +15 -0
  2. package/dist/index-editor.css +7 -0
  3. package/dist/index.css +23 -0
  4. package/dist/index.css.map +1 -0
  5. package/dist/index.js +80 -93
  6. package/dist/index.js.map +1 -1
  7. package/package.json +8 -6
  8. package/src/accessibility.d.ts +10 -7
  9. package/src/accessibility.js +4 -1
  10. package/src/command.d.ts +3 -3
  11. package/src/command.js +2 -2
  12. package/src/commandcollection.d.ts +2 -2
  13. package/src/commandcollection.js +1 -1
  14. package/src/context.d.ts +3 -3
  15. package/src/context.js +2 -2
  16. package/src/contextplugin.d.ts +4 -4
  17. package/src/contextplugin.js +1 -1
  18. package/src/editingkeystrokehandler.d.ts +3 -3
  19. package/src/editingkeystrokehandler.js +2 -2
  20. package/src/editor/editor.d.ts +9 -8
  21. package/src/editor/editor.js +9 -8
  22. package/src/editor/editorconfig.d.ts +4 -4
  23. package/src/editor/utils/attachtoform.d.ts +2 -2
  24. package/src/editor/utils/attachtoform.js +1 -1
  25. package/src/editor/utils/editorusagedata.d.ts +1 -1
  26. package/src/editor/utils/elementapimixin.d.ts +2 -2
  27. package/src/editor/utils/elementapimixin.js +1 -3
  28. package/src/editor/utils/securesourceelement.d.ts +2 -2
  29. package/src/editor/utils/securesourceelement.js +1 -1
  30. package/src/index.d.ts +16 -16
  31. package/src/index.js +14 -11
  32. package/src/multicommand.d.ts +2 -2
  33. package/src/multicommand.js +2 -2
  34. package/src/pendingactions.d.ts +2 -2
  35. package/src/pendingactions.js +2 -2
  36. package/src/plugin.d.ts +5 -5
  37. package/src/plugin.js +1 -1
  38. package/src/plugincollection.d.ts +1 -1
  39. package/src/plugincollection.js +1 -1
  40. package/theme/core.css +21 -0
  41. package/src/editor/utils/dataapimixin.d.ts +0 -79
  42. package/src/editor/utils/dataapimixin.js +0 -12
@@ -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 { insertToPriorityArray } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * A CKEditor command that aggregates other commands.
@@ -31,7 +31,7 @@ import { insertToPriorityArray } from '@ckeditor/ckeditor5-utils';
31
31
  * multiCommand.execute(); // Will execute commandBar.
32
32
  * ```
33
33
  */
34
- export default class MultiCommand extends Command {
34
+ export class MultiCommand extends Command {
35
35
  /**
36
36
  * Registered child commands definitions.
37
37
  */
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module core/pendingactions
7
7
  */
8
- import ContextPlugin from './contextplugin.js';
8
+ import { ContextPlugin } from './contextplugin.js';
9
9
  import { type CollectionAddEvent, type CollectionRemoveEvent, type Observable } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * The list of pending editor actions.
@@ -52,7 +52,7 @@ import { type CollectionAddEvent, type CollectionRemoveEvent, type Observable }
52
52
  * Read more about saving the data in the
53
53
  * {@glink getting-started/setup/getting-and-setting-data Saving and getting data} guide.
54
54
  */
55
- export default class PendingActions extends ContextPlugin implements Iterable<PendingAction> {
55
+ export declare class PendingActions extends ContextPlugin implements Iterable<PendingAction> {
56
56
  /**
57
57
  * Defines whether there is any registered pending action.
58
58
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module core/pendingactions
7
7
  */
8
- import ContextPlugin from './contextplugin.js';
8
+ import { ContextPlugin } from './contextplugin.js';
9
9
  import { CKEditorError, Collection, ObservableMixin } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * The list of pending editor actions.
@@ -52,7 +52,7 @@ import { CKEditorError, Collection, ObservableMixin } from '@ckeditor/ckeditor5-
52
52
  * Read more about saving the data in the
53
53
  * {@glink getting-started/setup/getting-and-setting-data Saving and getting data} guide.
54
54
  */
55
- export default class PendingActions extends ContextPlugin {
55
+ export class PendingActions extends ContextPlugin {
56
56
  /**
57
57
  * A list of pending actions.
58
58
  */
package/src/plugin.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 type Editor from './editor/editor.js';
5
+ import { type Editor } from './editor/editor.js';
6
6
  declare const Plugin_base: {
7
7
  new (): import("@ckeditor/ckeditor5-utils").Observable;
8
8
  prototype: import("@ckeditor/ckeditor5-utils").Observable;
@@ -10,7 +10,7 @@ declare const Plugin_base: {
10
10
  /**
11
11
  * The base class for CKEditor plugin classes.
12
12
  */
13
- export default class Plugin extends /* #__PURE__ */ Plugin_base implements PluginInterface {
13
+ export declare class Plugin extends /* #__PURE__ */ Plugin_base implements PluginInterface {
14
14
  /**
15
15
  * The editor instance.
16
16
  *
@@ -237,9 +237,9 @@ export interface PluginStaticMembers<TContext = Editor> {
237
237
  * To keep the plugin class definition tight it is recommended to define this property as a static getter:
238
238
  *
239
239
  * ```ts
240
- * import Image from './image.js';
240
+ * import { Image } from './image.js';
241
241
  *
242
- * export default class ImageCaption {
242
+ * export class ImageCaption {
243
243
  * static get requires() {
244
244
  * return [ Image ];
245
245
  * }
@@ -257,7 +257,7 @@ export interface PluginStaticMembers<TContext = Editor> {
257
257
  * To keep the plugin class definition tight, it is recommended to define this property as a static getter:
258
258
  *
259
259
  * ```ts
260
- * export default class ImageCaption {
260
+ * export class ImageCaption {
261
261
  * static get pluginName() {
262
262
  * return 'ImageCaption';
263
263
  * }
package/src/plugin.js CHANGED
@@ -10,7 +10,7 @@ import { ObservableMixin } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * The base class for CKEditor plugin classes.
12
12
  */
13
- export default class Plugin extends /* #__PURE__ */ ObservableMixin() {
13
+ export class Plugin extends /* #__PURE__ */ ObservableMixin() {
14
14
  /**
15
15
  * The editor instance.
16
16
  *
@@ -10,7 +10,7 @@ declare const PluginCollection_base: {
10
10
  /**
11
11
  * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
12
12
  */
13
- export default class PluginCollection<TContext extends object> extends /* #__PURE__ */ PluginCollection_base implements Iterable<PluginEntry<TContext>> {
13
+ export declare class PluginCollection<TContext extends object> extends /* #__PURE__ */ PluginCollection_base implements Iterable<PluginEntry<TContext>> {
14
14
  private _context;
15
15
  private _plugins;
16
16
  /**
@@ -9,7 +9,7 @@ import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
9
9
  /**
10
10
  * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
11
11
  */
12
- export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
12
+ export class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
13
13
  _context;
14
14
  _plugins = new Map();
15
15
  /**
package/theme/core.css ADDED
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2003-2025, 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
+
6
+ :root {
7
+ --ck-content-font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
8
+ --ck-content-font-size: medium;
9
+ /* stylelint-disable-next-line declaration-property-value-disallowed-list */
10
+ --ck-content-font-color: #000;
11
+ --ck-content-line-height: 1.5;
12
+ --ck-content-word-break: break-word;
13
+ }
14
+
15
+ .ck-content {
16
+ font-family: var(--ck-content-font-family);
17
+ font-size: var(--ck-content-font-size);
18
+ color: var(--ck-content-font-color);
19
+ line-height: var(--ck-content-line-height);
20
+ word-break: var(--ck-content-word-break);
21
+ }
@@ -1,79 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * @module core/editor/utils/dataapimixin
7
- */
8
- import type Editor from '../editor.js';
9
- import type { Constructor } from '@ckeditor/ckeditor5-utils';
10
- /**
11
- * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
12
- *
13
- * @deprecated This functionality is already implemented by the `Editor` class.
14
- */
15
- export default function DataApiMixin<Base extends Constructor<Editor>>(base: Base): Base;
16
- /**
17
- * Interface defining editor methods for setting and getting data to and from the editor's main root element
18
- * using the {@link module:core/editor/editor~Editor#data data pipeline}.
19
- *
20
- * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement
21
- * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented
22
- * differently.
23
- *
24
- * @deprecated This interface is implemented by all `Editor` instances by default.
25
- */
26
- export interface DataApi {
27
- /**
28
- * Sets the data in the editor.
29
- *
30
- * ```ts
31
- * editor.setData( '<p>This is editor!</p>' );
32
- * ```
33
- *
34
- * If your editor implementation uses multiple roots, you should pass an object with keys corresponding
35
- * to the editor root names and values equal to the data that should be set in each root:
36
- *
37
- * ```ts
38
- * editor.setData( {
39
- * header: '<p>Content for header part.</p>',
40
- * content: '<p>Content for main part.</p>',
41
- * footer: '<p>Content for footer part.</p>'
42
- * } );
43
- * ```
44
- *
45
- * By default the editor accepts HTML. This can be controlled by injecting a different data processor.
46
- * See the {@glink features/markdown Markdown output} guide for more details.
47
- *
48
- * @param data Input data.
49
- */
50
- setData(data: string | Record<string, string>): void;
51
- /**
52
- * Gets the data from the editor.
53
- *
54
- * ```ts
55
- * editor.getData(); // -> '<p>This is editor!</p>'
56
- * ```
57
- *
58
- * If your editor implementation uses multiple roots, you should pass root name as one of the options:
59
- *
60
- * ```ts
61
- * editor.getData( { rootName: 'header' } ); // -> '<p>Content for header part.</p>'
62
- * ```
63
- *
64
- * By default, the editor outputs HTML. This can be controlled by injecting a different data processor.
65
- * See the {@glink features/markdown Markdown output} guide for more details.
66
- *
67
- * A warning is logged when you try to retrieve data for a detached root, as most probably this is a mistake. A detached root should
68
- * be treated like it is removed, and you should not save its data. Note, that the detached root data is always an empty string.
69
- *
70
- * @param options Additional configuration for the retrieved data.
71
- * Editor features may introduce more configuration options that can be set through this parameter.
72
- * @param options.rootName Root name. Default to `'main'`.
73
- * @param options.trim Whether returned data should be trimmed. This option is set to `'empty'` by default,
74
- * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming
75
- * use `'none'`. In such cases exact content will be returned (for example `'<p>&nbsp;</p>'` for an empty editor).
76
- * @returns Output data.
77
- */
78
- getData(options?: Record<string, unknown>): string;
79
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2025, 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
- /**
6
- * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
7
- *
8
- * @deprecated This functionality is already implemented by the `Editor` class.
9
- */
10
- export default function DataApiMixin(base) {
11
- return base;
12
- }