@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
@@ -2,3 +2,18 @@
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
+ :root{
6
+ --ck-content-font-family:Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
7
+ --ck-content-font-size:medium;
8
+ --ck-content-font-color:#000;
9
+ --ck-content-line-height:1.5;
10
+ --ck-content-word-break:break-word;
11
+ }
12
+
13
+ .ck-content{
14
+ font-family:var(--ck-content-font-family);
15
+ font-size:var(--ck-content-font-size);
16
+ color:var(--ck-content-font-color);
17
+ line-height:var(--ck-content-line-height);
18
+ word-break:var(--ck-content-word-break);
19
+ }
@@ -2,3 +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
+ :root{
6
+ --ck-content-font-family:Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
7
+ --ck-content-font-size:medium;
8
+ --ck-content-font-color:#000;
9
+ --ck-content-line-height:1.5;
10
+ --ck-content-word-break:break-word;
11
+ }
package/dist/index.css CHANGED
@@ -2,3 +2,26 @@
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
+ /*
6
+ * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
7
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
8
+ */
9
+
10
+ :root {
11
+ --ck-content-font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;
12
+ --ck-content-font-size: medium;
13
+ /* stylelint-disable-next-line declaration-property-value-disallowed-list */
14
+ --ck-content-font-color: #000;
15
+ --ck-content-line-height: 1.5;
16
+ --ck-content-word-break: break-word;
17
+ }
18
+
19
+ .ck-content {
20
+ font-family: var(--ck-content-font-family);
21
+ font-size: var(--ck-content-font-size);
22
+ color: var(--ck-content-font-color);
23
+ line-height: var(--ck-content-line-height);
24
+ word-break: var(--ck-content-word-break);
25
+ }
26
+
27
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../theme/core.css","index.css"],"names":[],"mappings":";;;;AAAA,CAAA;ACCA,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ;AAC3E,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC;AAClF,CAAC,CDAC;;AAEF,CAAA,IAAA,CAAA;ACCA,CDAC,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,SAAA,CAAA,CAAA,KAAA,CAAA,CAAA,MAAA,CAAA,CAAA,OAAA,CAAA,CAAA,IAAA,CAAA,KAAuE;ACCxE,CDAC,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,CAAA,MAA8B;ACC/B,CDAC,CAAA,CAAA,CAAA,SAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAA,WAAA,CAAA,QAAA,CAAA,KAAA,CAAA,UAAA,CAAA,IAAA,CAAA,CAA2E;ACC5E,CDAC,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,CAAA,GAA6B;ACC9B,CDAC,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA,CAA6B;ACC9B,CDAC,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAA,CAAA,KAAA,CAAA,IAAmC;AACpC;;AAEA,CAAA,EAAA,CAAA,OAAA,CAAA;ACCA,CDAC,IAAA,CAAA,MAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAA0C;ACC3C,CDAC,IAAA,CAAA,IAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,IAAA,CAAsC;ACCvC,CDAC,KAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAmC;ACCpC,CDAC,IAAA,CAAA,MAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,MAAA,CAA0C;ACC3C,CDAC,IAAA,CAAA,KAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAA,CAAA,OAAA,CAAA,IAAA,CAAA,KAAA,CAAwC;AACzC;;ACEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n:root {\n\t--ck-content-font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n\t--ck-content-font-size: medium;\n\t/* stylelint-disable-next-line declaration-property-value-disallowed-list */\n\t--ck-content-font-color: #000;\n\t--ck-content-line-height: 1.5;\n\t--ck-content-word-break: break-word;\n}\n\n.ck-content {\n\tfont-family: var(--ck-content-font-family);\n\tfont-size: var(--ck-content-font-size);\n\tcolor: var(--ck-content-font-color);\n\tline-height: var(--ck-content-line-height);\n\tword-break: var(--ck-content-word-break);\n}\n","/*\n * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n:root {\n\t--ck-content-font-family: Helvetica, Arial, Tahoma, Verdana, Sans-Serif;\n\t--ck-content-font-size: medium;\n\t/* stylelint-disable-next-line declaration-property-value-disallowed-list */\n\t--ck-content-font-color: #000;\n\t--ck-content-line-height: 1.5;\n\t--ck-content-word-break: break-word;\n}\n\n.ck-content {\n\tfont-family: var(--ck-content-font-family);\n\tfont-size: var(--ck-content-font-size);\n\tcolor: var(--ck-content-font-color);\n\tline-height: var(--ck-content-line-height);\n\tword-break: var(--ck-content-word-break);\n}\n\n/*# sourceMappingURL=index.css.map */"]}
package/dist/index.js 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 { ObservableMixin, insertToPriorityArray, EmitterMixin, CKEditorError, Config, Locale, Collection, KeystrokeHandler, env, global, uid, parseBase64EncodedObject, toArray, crc32, releaseDate, logError, setDataInElement } from '@ckeditor/ckeditor5-utils/dist/index.js';
5
+ import { ObservableMixin, insertToPriorityArray, CKEditorError, EmitterMixin, Config, Locale, Collection, KeystrokeHandler, env, global, uid, parseBase64EncodedObject, toArray, crc32, releaseDate, logError, setDataInElement } from '@ckeditor/ckeditor5-utils/dist/index.js';
6
6
  import { get, set, isFunction } from 'es-toolkit/compat';
7
7
  import { Model, StylesProcessor, DataController, EditingController, Conversion } from '@ckeditor/ckeditor5-engine/dist/index.js';
8
8
  import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/dist/index.js';
@@ -224,7 +224,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
224
224
  * in this method.
225
225
  *
226
226
  * This method is automatically called when
227
- * {@link module:engine/model/document~Document#event:change any changes are applied to the document}.
227
+ * {@link module:engine/model/document~ModelDocument#event:change any changes are applied to the document}.
228
228
  */ refresh() {
229
229
  this.isEnabled = true;
230
230
  }
@@ -387,6 +387,77 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
387
387
  }
388
388
  }
389
389
 
390
+ /**
391
+ * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
392
+ */ class CommandCollection {
393
+ /**
394
+ * Command map.
395
+ */ _commands;
396
+ /**
397
+ * Creates collection instance.
398
+ */ constructor(){
399
+ this._commands = new Map();
400
+ }
401
+ /**
402
+ * Registers a new command.
403
+ *
404
+ * @param commandName The name of the command.
405
+ */ add(commandName, command) {
406
+ this._commands.set(commandName, command);
407
+ }
408
+ /**
409
+ * Retrieves a command from the collection.
410
+ *
411
+ * @param commandName The name of the command.
412
+ */ get(commandName) {
413
+ return this._commands.get(commandName);
414
+ }
415
+ /**
416
+ * Executes a command.
417
+ *
418
+ * @param commandName The name of the command.
419
+ * @param commandParams Command parameters.
420
+ * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
421
+ */ execute(commandName, ...commandParams) {
422
+ const command = this.get(commandName);
423
+ if (!command) {
424
+ /**
425
+ * Command does not exist.
426
+ *
427
+ * @error commandcollection-command-not-found
428
+ * @param {string} commandName Name of the command.
429
+ */ throw new CKEditorError('commandcollection-command-not-found', this, {
430
+ commandName
431
+ });
432
+ }
433
+ return command.execute(...commandParams);
434
+ }
435
+ /**
436
+ * Returns iterator of command names.
437
+ */ *names() {
438
+ yield* this._commands.keys();
439
+ }
440
+ /**
441
+ * Returns iterator of command instances.
442
+ */ *commands() {
443
+ yield* this._commands.values();
444
+ }
445
+ /**
446
+ * Iterable interface.
447
+ *
448
+ * Returns `[ commandName, commandInstance ]` pairs.
449
+ */ [Symbol.iterator]() {
450
+ return this._commands[Symbol.iterator]();
451
+ }
452
+ /**
453
+ * Destroys all collection commands.
454
+ */ destroy() {
455
+ for (const command of this.commands()){
456
+ command.destroy();
457
+ }
458
+ }
459
+ }
460
+
390
461
  /**
391
462
  * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.
392
463
  */ class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
@@ -1194,77 +1265,6 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
1194
1265
  }
1195
1266
  }
1196
1267
 
1197
- /**
1198
- * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.
1199
- */ class CommandCollection {
1200
- /**
1201
- * Command map.
1202
- */ _commands;
1203
- /**
1204
- * Creates collection instance.
1205
- */ constructor(){
1206
- this._commands = new Map();
1207
- }
1208
- /**
1209
- * Registers a new command.
1210
- *
1211
- * @param commandName The name of the command.
1212
- */ add(commandName, command) {
1213
- this._commands.set(commandName, command);
1214
- }
1215
- /**
1216
- * Retrieves a command from the collection.
1217
- *
1218
- * @param commandName The name of the command.
1219
- */ get(commandName) {
1220
- return this._commands.get(commandName);
1221
- }
1222
- /**
1223
- * Executes a command.
1224
- *
1225
- * @param commandName The name of the command.
1226
- * @param commandParams Command parameters.
1227
- * @returns The value returned by the {@link module:core/command~Command#execute `command.execute()`}.
1228
- */ execute(commandName, ...commandParams) {
1229
- const command = this.get(commandName);
1230
- if (!command) {
1231
- /**
1232
- * Command does not exist.
1233
- *
1234
- * @error commandcollection-command-not-found
1235
- * @param {string} commandName Name of the command.
1236
- */ throw new CKEditorError('commandcollection-command-not-found', this, {
1237
- commandName
1238
- });
1239
- }
1240
- return command.execute(...commandParams);
1241
- }
1242
- /**
1243
- * Returns iterator of command names.
1244
- */ *names() {
1245
- yield* this._commands.keys();
1246
- }
1247
- /**
1248
- * Returns iterator of command instances.
1249
- */ *commands() {
1250
- yield* this._commands.values();
1251
- }
1252
- /**
1253
- * Iterable interface.
1254
- *
1255
- * Returns `[ commandName, commandInstance ]` pairs.
1256
- */ [Symbol.iterator]() {
1257
- return this._commands[Symbol.iterator]();
1258
- }
1259
- /**
1260
- * Destroys all collection commands.
1261
- */ destroy() {
1262
- for (const command of this.commands()){
1263
- command.destroy();
1264
- }
1265
- }
1266
- }
1267
-
1268
1268
  /**
1269
1269
  * A keystroke handler for editor editing. Its instance is available
1270
1270
  * in {@link module:core/editor/editor~Editor#keystrokes} so plugins
@@ -1297,7 +1297,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
1297
1297
  * @param callback If a string is passed, then the keystroke will
1298
1298
  * {@link module:core/editor/editor~Editor#execute execute a command}.
1299
1299
  * If a function, then it will be called with the
1300
- * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and
1300
+ * {@link module:engine/view/observer/keyobserver~ViewDocumentKeyEventData key event data} object and
1301
1301
  * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.
1302
1302
  * @param options Additional options.
1303
1303
  * @param options.priority The priority of the keystroke callback. The higher the priority value
@@ -1316,7 +1316,9 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
1316
1316
  }
1317
1317
 
1318
1318
  const DEFAULT_CATEGORY_ID = 'contentEditing';
1319
- const DEFAULT_GROUP_ID = 'common';
1319
+ /**
1320
+ * @internal
1321
+ */ const DEFAULT_GROUP_ID = 'common';
1320
1322
  /**
1321
1323
  * A common namespace for various accessibility features of the editor.
1322
1324
  *
@@ -1875,7 +1877,7 @@ function getPageSessionID() {
1875
1877
  * Note: Certain typing-oriented keystrokes (like <kbd>Backspace</kbd> or <kbd>Enter</kbd>) are handled
1876
1878
  * by a low-level mechanism and trying to listen to them via the keystroke handler will not work reliably.
1877
1879
  * To handle these specific keystrokes, see the events fired by the
1878
- * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).
1880
+ * {@link module:engine/view/document~ViewDocument editing view document} (`editor.editing.view.document`).
1879
1881
  */ keystrokes;
1880
1882
  /**
1881
1883
  * Shorthand for {@link module:utils/locale~Locale#t}.
@@ -2456,7 +2458,7 @@ function getPageSessionID() {
2456
2458
  * Focuses the editor.
2457
2459
  *
2458
2460
  * **Note** To explicitly focus the editing area of the editor, use the
2459
- * {@link module:engine/view/view~View#focus `editor.editing.view.focus()`} method of the editing view.
2461
+ * {@link module:engine/view/view~EditingView#focus `editor.editing.view.focus()`} method of the editing view.
2460
2462
  *
2461
2463
  * Check out the {@glink framework/deep-dive/ui/focus-tracking#focus-in-the-editor-ui Focus in the editor UI} section
2462
2464
  * of the {@glink framework/deep-dive/ui/focus-tracking Deep dive into focus tracking} guide to learn more.
@@ -2717,19 +2719,6 @@ function isTextArea(sourceElement) {
2717
2719
  return !!sourceElement && sourceElement.tagName.toLowerCase() === 'textarea';
2718
2720
  }
2719
2721
 
2720
- /**
2721
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2722
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2723
- */ /**
2724
- * @module core/editor/utils/dataapimixin
2725
- */ /**
2726
- * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.
2727
- *
2728
- * @deprecated This functionality is already implemented by the `Editor` class.
2729
- */ function DataApiMixin(base) {
2730
- return base;
2731
- }
2732
-
2733
2722
  /**
2734
2723
  * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.
2735
2724
  */ function ElementApiMixin(base) {
@@ -2762,8 +2751,6 @@ function isTextArea(sourceElement) {
2762
2751
  }
2763
2752
  return Mixin;
2764
2753
  }
2765
- // Backward compatibility with `mix`.
2766
- ElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSourceElement;
2767
2754
 
2768
2755
  /**
2769
2756
  * Marks the source element on which the editor was initialized. This prevents other editor instances from using this element.
@@ -2902,5 +2889,5 @@ ElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSo
2902
2889
  }
2903
2890
  }
2904
2891
 
2905
- export { Command, Context, ContextPlugin, DataApiMixin, Editor, ElementApiMixin, MultiCommand, PendingActions, Plugin, attachToForm, secureSourceElement };
2892
+ export { Accessibility, Command, CommandCollection, Context, ContextPlugin, EditingKeystrokeHandler, Editor, ElementApiMixin, MultiCommand, PendingActions, Plugin, DEFAULT_GROUP_ID as _DEFAULT_ACCESSIBILITY_GROUP_ID, getEditorUsageData as _getEditorUsageData, attachToForm, secureSourceElement };
2906
2893
  //# sourceMappingURL=index.js.map