@ckeditor/ckeditor5-core 45.0.0 → 45.1.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 +39 -24
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/accessibility.js +5 -5
- package/src/commandcollection.js +1 -1
- package/src/editor/editor.js +16 -7
- package/src/editor/utils/securesourceelement.js +2 -2
- package/src/index.d.ts +1 -1
- package/src/plugincollection.js +17 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-core",
|
|
3
|
-
"version": "45.0.0",
|
|
3
|
+
"version": "45.1.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,10 +24,10 @@
|
|
|
24
24
|
"type": "module",
|
|
25
25
|
"main": "src/index.js",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@ckeditor/ckeditor5-engine": "45.0.0",
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "45.0.0",
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "45.0.0",
|
|
30
|
-
"@ckeditor/ckeditor5-watchdog": "45.0.0",
|
|
27
|
+
"@ckeditor/ckeditor5-engine": "45.1.0-alpha.0",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "45.1.0-alpha.0",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "45.1.0-alpha.0",
|
|
30
|
+
"@ckeditor/ckeditor5-watchdog": "45.1.0-alpha.0",
|
|
31
31
|
"es-toolkit": "1.32.0"
|
|
32
32
|
},
|
|
33
33
|
"author": "CKSource (http://cksource.com/)",
|
package/src/accessibility.js
CHANGED
|
@@ -304,8 +304,8 @@ export default class Accessibility {
|
|
|
304
304
|
* to add a new category or make sure the specified category exists.
|
|
305
305
|
*
|
|
306
306
|
* @error accessibility-unknown-keystroke-info-category
|
|
307
|
-
* @param categoryId The id of the unknown keystroke category.
|
|
308
|
-
* @param keystrokes Keystroke definitions about to be added.
|
|
307
|
+
* @param {string} categoryId The id of the unknown keystroke category.
|
|
308
|
+
* @param {module:core/accessibility~AddKeystrokeInfosData#keystrokes} keystrokes Keystroke definitions about to be added.
|
|
309
309
|
*/
|
|
310
310
|
throw new CKEditorError('accessibility-unknown-keystroke-info-category', this._editor, { categoryId, keystrokes });
|
|
311
311
|
}
|
|
@@ -318,9 +318,9 @@ export default class Accessibility {
|
|
|
318
318
|
* to add a new group or make sure the specified group exists.
|
|
319
319
|
*
|
|
320
320
|
* @error accessibility-unknown-keystroke-info-group
|
|
321
|
-
* @param groupId The id of the unknown keystroke group.
|
|
322
|
-
* @param categoryId The id of category the unknown group should belong to.
|
|
323
|
-
* @param keystrokes Keystroke definitions about to be added.
|
|
321
|
+
* @param {string} groupId The id of the unknown keystroke group.
|
|
322
|
+
* @param {string} categoryId The id of category the unknown group should belong to.
|
|
323
|
+
* @param {module:core/accessibility~AddKeystrokeInfosData#keystrokes} keystrokes Keystroke definitions about to be added.
|
|
324
324
|
*/
|
|
325
325
|
throw new CKEditorError('accessibility-unknown-keystroke-info-group', this._editor, { groupId, categoryId, keystrokes });
|
|
326
326
|
}
|
package/src/commandcollection.js
CHANGED
|
@@ -50,7 +50,7 @@ export default class CommandCollection {
|
|
|
50
50
|
* Command does not exist.
|
|
51
51
|
*
|
|
52
52
|
* @error commandcollection-command-not-found
|
|
53
|
-
* @param commandName Name of the command.
|
|
53
|
+
* @param {string} commandName Name of the command.
|
|
54
54
|
*/
|
|
55
55
|
throw new CKEditorError('commandcollection-command-not-found', this, { commandName });
|
|
56
56
|
}
|
package/src/editor/editor.js
CHANGED
|
@@ -348,6 +348,14 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
348
348
|
// Check if some license host matches the hostname.
|
|
349
349
|
.some(octets => segments.every((segment, index) => octets[index] === segment || octets[index] === '*'));
|
|
350
350
|
}
|
|
351
|
+
function warnAboutNonProductionLicenseKey(licenseType) {
|
|
352
|
+
const capitalizedLicenseType = licenseType[0].toUpperCase() + licenseType.slice(1);
|
|
353
|
+
const article = licenseType === 'evaluation' ? 'an' : 'a';
|
|
354
|
+
console.info(`%cCKEditor 5 ${capitalizedLicenseType} License`, 'color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;');
|
|
355
|
+
console.warn(`⚠️ You are using ${article} ${licenseType} license of CKEditor 5` +
|
|
356
|
+
`${licenseType === 'trial' ? ' which is for evaluation purposes only' : ''}. ` +
|
|
357
|
+
'For production usage, please obtain a production license at https://portal.ckeditor.com/');
|
|
358
|
+
}
|
|
351
359
|
if (licenseKey == 'GPL') {
|
|
352
360
|
if (distributionChannel == 'cloud') {
|
|
353
361
|
blockEditor('distributionChannel');
|
|
@@ -392,12 +400,11 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
392
400
|
}
|
|
393
401
|
if (['development', 'evaluation', 'trial'].includes(licensePayload.licenseType)) {
|
|
394
402
|
const { licenseType } = licensePayload;
|
|
395
|
-
const
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
'For production usage, please obtain a production license at https://portal.ckeditor.com/');
|
|
403
|
+
const sessionStarted = sessionStorage.getItem('ckeditor5-development-session-started');
|
|
404
|
+
if (!sessionStarted) {
|
|
405
|
+
warnAboutNonProductionLicenseKey(licenseType);
|
|
406
|
+
sessionStorage.setItem('ckeditor5-development-session-started', 'true');
|
|
407
|
+
}
|
|
401
408
|
}
|
|
402
409
|
if (['evaluation', 'trial'].includes(licensePayload.licenseType)) {
|
|
403
410
|
const licenseType = licensePayload.licenseType;
|
|
@@ -435,7 +442,7 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
435
442
|
* Please ensure that your setup does not block requests to the validation endpoint.
|
|
436
443
|
*
|
|
437
444
|
* @error license-key-validation-endpoint-not-reachable
|
|
438
|
-
* @param {
|
|
445
|
+
* @param {string} url The URL that was attempted to be reached for validation.
|
|
439
446
|
*/
|
|
440
447
|
logError('license-key-validation-endpoint-not-reachable', { url: licensePayload.usageEndpoint });
|
|
441
448
|
});
|
|
@@ -541,6 +548,7 @@ class Editor extends /* #__PURE__ */ ObservableMixin() {
|
|
|
541
548
|
* The lock ID is missing or it is not a string or symbol.
|
|
542
549
|
*
|
|
543
550
|
* @error editor-read-only-lock-id-invalid
|
|
551
|
+
* @param {never} lockId Lock ID.
|
|
544
552
|
*/
|
|
545
553
|
throw new CKEditorError('editor-read-only-lock-id-invalid', null, { lockId });
|
|
546
554
|
}
|
|
@@ -901,6 +909,7 @@ function collectUsageData(editor) {
|
|
|
901
909
|
* Make sure that you are not setting the same path multiple times.
|
|
902
910
|
*
|
|
903
911
|
* @error editor-usage-data-path-already-set
|
|
912
|
+
* @param {string} path The path that was already set.
|
|
904
913
|
*/
|
|
905
914
|
throw new CKEditorError('editor-usage-data-path-already-set', { path });
|
|
906
915
|
}
|
|
@@ -21,10 +21,10 @@ export default function secureSourceElement(editor, sourceElement) {
|
|
|
21
21
|
* A DOM element used to create the editor (e.g.
|
|
22
22
|
* {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})
|
|
23
23
|
* has already been used to create another editor instance. Make sure each editor is
|
|
24
|
-
* created with
|
|
24
|
+
* created with a unique DOM element.
|
|
25
25
|
*
|
|
26
26
|
* @error editor-source-element-already-used
|
|
27
|
-
* @param element DOM element that caused the collision.
|
|
27
|
+
* @param {HTMLElement} element DOM element that caused the collision.
|
|
28
28
|
*/
|
|
29
29
|
throw new CKEditorError('editor-source-element-already-used', editor);
|
|
30
30
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { default as ContextPlugin, type ContextPluginDependencies } from './cont
|
|
|
15
15
|
export { type EditingKeystrokeCallback } from './editingkeystrokehandler.js';
|
|
16
16
|
export type { PartialBy, NonEmptyArray, HexColor } from './typings.js';
|
|
17
17
|
export { default as Editor, type EditorReadyEvent, type EditorDestroyEvent } from './editor/editor.js';
|
|
18
|
-
export type { EditorConfig, LanguageConfig, ToolbarConfig, ToolbarConfigItem, UiConfig } from './editor/editorconfig.js';
|
|
18
|
+
export type { EditorConfig, LanguageConfig, ToolbarConfig, ToolbarConfigItem, UiConfig, ViewportOffsetConfig } from './editor/editorconfig.js';
|
|
19
19
|
export { default as attachToForm } from './editor/utils/attachtoform.js';
|
|
20
20
|
export { default as DataApiMixin, type DataApi } from './editor/utils/dataapimixin.js';
|
|
21
21
|
export { default as ElementApiMixin, type ElementApi } from './editor/utils/elementapimixin.js';
|
package/src/plugincollection.js
CHANGED
|
@@ -99,7 +99,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
99
99
|
* to check if a plugin was loaded.
|
|
100
100
|
*
|
|
101
101
|
* @error plugincollection-plugin-not-loaded
|
|
102
|
-
* @param plugin The name of the plugin which is not loaded.
|
|
102
|
+
* @param {string} plugin The name of the plugin which is not loaded.
|
|
103
103
|
*/
|
|
104
104
|
throw new CKEditorError('plugincollection-plugin-not-loaded', this._context, { plugin: pluginName });
|
|
105
105
|
}
|
|
@@ -265,8 +265,8 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
265
265
|
* {@glink updating/guides/update-to-26 Migration to 26.0.0} guide.
|
|
266
266
|
*
|
|
267
267
|
* @error plugincollection-soft-required
|
|
268
|
-
* @param missingPlugin The name of the required plugin.
|
|
269
|
-
* @param requiredBy The name of the plugin that requires the other plugin.
|
|
268
|
+
* @param {string} missingPlugin The name of the required plugin.
|
|
269
|
+
* @param {string} requiredBy The name of the plugin that requires the other plugin.
|
|
270
270
|
*/
|
|
271
271
|
throw new CKEditorError('plugincollection-soft-required', context, { missingPlugin: plugin, requiredBy: getPluginName(parentPluginConstructor) });
|
|
272
272
|
}
|
|
@@ -291,7 +291,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
291
291
|
* {@glink getting-started/installation/cloud/quick-start Quick start} guide.
|
|
292
292
|
*
|
|
293
293
|
* @error plugincollection-plugin-not-found
|
|
294
|
-
* @param plugin The name of the plugin which could not be loaded.
|
|
294
|
+
* @param {string} plugin The name of the plugin which could not be loaded.
|
|
295
295
|
*/
|
|
296
296
|
throw new CKEditorError('plugincollection-plugin-not-found', context, { plugin });
|
|
297
297
|
}
|
|
@@ -311,8 +311,8 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
311
311
|
* editor API.
|
|
312
312
|
*
|
|
313
313
|
* @error plugincollection-context-required
|
|
314
|
-
* @param plugin The name of the required plugin.
|
|
315
|
-
* @param requiredBy The name of the parent plugin.
|
|
314
|
+
* @param {string} plugin The name of the required plugin.
|
|
315
|
+
* @param {string} requiredBy The name of the parent plugin.
|
|
316
316
|
*/
|
|
317
317
|
throw new CKEditorError('plugincollection-context-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });
|
|
318
318
|
}
|
|
@@ -327,8 +327,8 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
327
327
|
* Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
|
|
328
328
|
*
|
|
329
329
|
* @error plugincollection-required
|
|
330
|
-
* @param plugin The name of the required plugin.
|
|
331
|
-
* @param requiredBy The name of the parent plugin.
|
|
330
|
+
* @param {string} plugin The name of the required plugin.
|
|
331
|
+
* @param {string} requiredBy The name of the parent plugin.
|
|
332
332
|
*/
|
|
333
333
|
throw new CKEditorError('plugincollection-required', context, { plugin: getPluginName(plugin), requiredBy: getPluginName(parentPluginConstructor) });
|
|
334
334
|
}
|
|
@@ -361,6 +361,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
361
361
|
* The plugin replacing an existing plugin must be a function.
|
|
362
362
|
*
|
|
363
363
|
* @error plugincollection-replace-plugin-invalid-type
|
|
364
|
+
* @param {never} pluginItem The plugin item.
|
|
364
365
|
*/
|
|
365
366
|
throw new CKEditorError('plugincollection-replace-plugin-invalid-type', null, { pluginItem });
|
|
366
367
|
}
|
|
@@ -370,6 +371,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
370
371
|
* The plugin replacing an existing plugin must have a name.
|
|
371
372
|
*
|
|
372
373
|
* @error plugincollection-replace-plugin-missing-name
|
|
374
|
+
* @param {module:core/plugin~PluginConstructor} pluginItem The plugin item.
|
|
373
375
|
*/
|
|
374
376
|
throw new CKEditorError('plugincollection-replace-plugin-missing-name', null, { pluginItem });
|
|
375
377
|
}
|
|
@@ -378,6 +380,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
378
380
|
* The plugin replacing an existing plugin cannot depend on other plugins.
|
|
379
381
|
*
|
|
380
382
|
* @error plugincollection-plugin-for-replacing-cannot-have-dependencies
|
|
383
|
+
* @param {string} pluginName The name of the plugin.
|
|
381
384
|
*/
|
|
382
385
|
throw new CKEditorError('plugincollection-plugin-for-replacing-cannot-have-dependencies', null, { pluginName });
|
|
383
386
|
}
|
|
@@ -388,6 +391,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
388
391
|
* {@link module:core/plugincollection~PluginCollection available plugins} collection.
|
|
389
392
|
*
|
|
390
393
|
* @error plugincollection-plugin-for-replacing-not-exist
|
|
394
|
+
* @param {string} pluginName The name of the plugin.
|
|
391
395
|
*/
|
|
392
396
|
throw new CKEditorError('plugincollection-plugin-for-replacing-not-exist', null, { pluginName });
|
|
393
397
|
}
|
|
@@ -403,6 +407,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
403
407
|
* The replaced plugin will not be loaded so it cannot be replaced.
|
|
404
408
|
*
|
|
405
409
|
* @error plugincollection-plugin-for-replacing-not-loaded
|
|
410
|
+
* @param {string} pluginName The name of the plugin.
|
|
406
411
|
*/
|
|
407
412
|
throw new CKEditorError('plugincollection-plugin-for-replacing-not-loaded', null, { pluginName });
|
|
408
413
|
}
|
|
@@ -411,6 +416,7 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
411
416
|
* The replaced plugin cannot depend on other plugins.
|
|
412
417
|
*
|
|
413
418
|
* @error plugincollection-replaced-plugin-cannot-have-dependencies
|
|
419
|
+
* @param {string} pluginName The name of the plugin.
|
|
414
420
|
*/
|
|
415
421
|
throw new CKEditorError('plugincollection-replaced-plugin-cannot-have-dependencies', null, { pluginName });
|
|
416
422
|
}
|
|
@@ -471,9 +477,9 @@ export default class PluginCollection extends /* #__PURE__ */ EmitterMixin() {
|
|
|
471
477
|
* of the plugin you are installing.
|
|
472
478
|
*
|
|
473
479
|
* @error plugincollection-plugin-name-conflict
|
|
474
|
-
* @param pluginName The duplicated plugin name.
|
|
475
|
-
* @param plugin1 The first plugin constructor.
|
|
476
|
-
* @param plugin2 The second plugin constructor.
|
|
480
|
+
* @param {string} pluginName The duplicated plugin name.
|
|
481
|
+
* @param {module:core/plugin~PluginConstructor} plugin1 The first plugin constructor.
|
|
482
|
+
* @param {module:core/plugin~PluginConstructor} plugin2 The second plugin constructor.
|
|
477
483
|
*/
|
|
478
484
|
throw new CKEditorError('plugincollection-plugin-name-conflict', null, { pluginName, plugin1: this._plugins.get(pluginName).constructor, plugin2: PluginConstructor });
|
|
479
485
|
}
|