@ckeditor/ckeditor5-core 45.0.0 → 45.1.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.
package/dist/index.js CHANGED
@@ -474,7 +474,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
474
474
  * to check if a plugin was loaded.
475
475
  *
476
476
  * @error plugincollection-plugin-not-loaded
477
- * @param plugin The name of the plugin which is not loaded.
477
+ * @param {string} plugin The name of the plugin which is not loaded.
478
478
  */ throw new CKEditorError('plugincollection-plugin-not-loaded', this._context, {
479
479
  plugin: pluginName
480
480
  });
@@ -629,8 +629,8 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
629
629
  * {@glink updating/guides/update-to-26 Migration to 26.0.0} guide.
630
630
  *
631
631
  * @error plugincollection-soft-required
632
- * @param missingPlugin The name of the required plugin.
633
- * @param requiredBy The name of the plugin that requires the other plugin.
632
+ * @param {string} missingPlugin The name of the required plugin.
633
+ * @param {string} requiredBy The name of the plugin that requires the other plugin.
634
634
  */ throw new CKEditorError('plugincollection-soft-required', context, {
635
635
  missingPlugin: plugin,
636
636
  requiredBy: getPluginName(parentPluginConstructor)
@@ -657,7 +657,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
657
657
  * {@glink getting-started/installation/cloud/quick-start Quick start} guide.
658
658
  *
659
659
  * @error plugincollection-plugin-not-found
660
- * @param plugin The name of the plugin which could not be loaded.
660
+ * @param {string} plugin The name of the plugin which could not be loaded.
661
661
  */ throw new CKEditorError('plugincollection-plugin-not-found', context, {
662
662
  plugin
663
663
  });
@@ -678,8 +678,8 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
678
678
  * editor API.
679
679
  *
680
680
  * @error plugincollection-context-required
681
- * @param plugin The name of the required plugin.
682
- * @param requiredBy The name of the parent plugin.
681
+ * @param {string} plugin The name of the required plugin.
682
+ * @param {string} requiredBy The name of the parent plugin.
683
683
  */ throw new CKEditorError('plugincollection-context-required', context, {
684
684
  plugin: getPluginName(plugin),
685
685
  requiredBy: getPluginName(parentPluginConstructor)
@@ -696,8 +696,8 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
696
696
  * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.
697
697
  *
698
698
  * @error plugincollection-required
699
- * @param plugin The name of the required plugin.
700
- * @param requiredBy The name of the parent plugin.
699
+ * @param {string} plugin The name of the required plugin.
700
+ * @param {string} requiredBy The name of the parent plugin.
701
701
  */ throw new CKEditorError('plugincollection-required', context, {
702
702
  plugin: getPluginName(plugin),
703
703
  requiredBy: getPluginName(parentPluginConstructor)
@@ -731,6 +731,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
731
731
  * The plugin replacing an existing plugin must be a function.
732
732
  *
733
733
  * @error plugincollection-replace-plugin-invalid-type
734
+ * @param {never} pluginItem The plugin item.
734
735
  */ throw new CKEditorError('plugincollection-replace-plugin-invalid-type', null, {
735
736
  pluginItem
736
737
  });
@@ -741,6 +742,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
741
742
  * The plugin replacing an existing plugin must have a name.
742
743
  *
743
744
  * @error plugincollection-replace-plugin-missing-name
745
+ * @param {module:core/plugin~PluginConstructor} pluginItem The plugin item.
744
746
  */ throw new CKEditorError('plugincollection-replace-plugin-missing-name', null, {
745
747
  pluginItem
746
748
  });
@@ -750,6 +752,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
750
752
  * The plugin replacing an existing plugin cannot depend on other plugins.
751
753
  *
752
754
  * @error plugincollection-plugin-for-replacing-cannot-have-dependencies
755
+ * @param {string} pluginName The name of the plugin.
753
756
  */ throw new CKEditorError('plugincollection-plugin-for-replacing-cannot-have-dependencies', null, {
754
757
  pluginName
755
758
  });
@@ -761,6 +764,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
761
764
  * {@link module:core/plugincollection~PluginCollection available plugins} collection.
762
765
  *
763
766
  * @error plugincollection-plugin-for-replacing-not-exist
767
+ * @param {string} pluginName The name of the plugin.
764
768
  */ throw new CKEditorError('plugincollection-plugin-for-replacing-not-exist', null, {
765
769
  pluginName
766
770
  });
@@ -777,6 +781,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
777
781
  * The replaced plugin will not be loaded so it cannot be replaced.
778
782
  *
779
783
  * @error plugincollection-plugin-for-replacing-not-loaded
784
+ * @param {string} pluginName The name of the plugin.
780
785
  */ throw new CKEditorError('plugincollection-plugin-for-replacing-not-loaded', null, {
781
786
  pluginName
782
787
  });
@@ -786,6 +791,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
786
791
  * The replaced plugin cannot depend on other plugins.
787
792
  *
788
793
  * @error plugincollection-replaced-plugin-cannot-have-dependencies
794
+ * @param {string} pluginName The name of the plugin.
789
795
  */ throw new CKEditorError('plugincollection-replaced-plugin-cannot-have-dependencies', null, {
790
796
  pluginName
791
797
  });
@@ -845,9 +851,9 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
845
851
  * of the plugin you are installing.
846
852
  *
847
853
  * @error plugincollection-plugin-name-conflict
848
- * @param pluginName The duplicated plugin name.
849
- * @param plugin1 The first plugin constructor.
850
- * @param plugin2 The second plugin constructor.
854
+ * @param {string} pluginName The duplicated plugin name.
855
+ * @param {module:core/plugin~PluginConstructor} plugin1 The first plugin constructor.
856
+ * @param {module:core/plugin~PluginConstructor} plugin2 The second plugin constructor.
851
857
  */ throw new CKEditorError('plugincollection-plugin-name-conflict', null, {
852
858
  pluginName,
853
859
  plugin1: this._plugins.get(pluginName).constructor,
@@ -1226,7 +1232,7 @@ import { EditorWatchdog, ContextWatchdog } from '@ckeditor/ckeditor5-watchdog/di
1226
1232
  * Command does not exist.
1227
1233
  *
1228
1234
  * @error commandcollection-command-not-found
1229
- * @param commandName Name of the command.
1235
+ * @param {string} commandName Name of the command.
1230
1236
  */ throw new CKEditorError('commandcollection-command-not-found', this, {
1231
1237
  commandName
1232
1238
  });
@@ -1630,8 +1636,8 @@ const DEFAULT_GROUP_ID = 'common';
1630
1636
  * to add a new category or make sure the specified category exists.
1631
1637
  *
1632
1638
  * @error accessibility-unknown-keystroke-info-category
1633
- * @param categoryId The id of the unknown keystroke category.
1634
- * @param keystrokes Keystroke definitions about to be added.
1639
+ * @param {string} categoryId The id of the unknown keystroke category.
1640
+ * @param {module:core/accessibility~AddKeystrokeInfosData#keystrokes} keystrokes Keystroke definitions about to be added.
1635
1641
  */ throw new CKEditorError('accessibility-unknown-keystroke-info-category', this._editor, {
1636
1642
  categoryId,
1637
1643
  keystrokes
@@ -1646,9 +1652,9 @@ const DEFAULT_GROUP_ID = 'common';
1646
1652
  * to add a new group or make sure the specified group exists.
1647
1653
  *
1648
1654
  * @error accessibility-unknown-keystroke-info-group
1649
- * @param groupId The id of the unknown keystroke group.
1650
- * @param categoryId The id of category the unknown group should belong to.
1651
- * @param keystrokes Keystroke definitions about to be added.
1655
+ * @param {string} groupId The id of the unknown keystroke group.
1656
+ * @param {string} categoryId The id of category the unknown group should belong to.
1657
+ * @param {module:core/accessibility~AddKeystrokeInfosData#keystrokes} keystrokes Keystroke definitions about to be added.
1652
1658
  */ throw new CKEditorError('accessibility-unknown-keystroke-info-group', this._editor, {
1653
1659
  groupId,
1654
1660
  categoryId,
@@ -2092,6 +2098,12 @@ function getPageSessionID() {
2092
2098
  .map((host)=>Array(segments.length - host.length).fill(host[0] === '*' ? '*' : '').concat(host))// Check if some license host matches the hostname.
2093
2099
  .some((octets)=>segments.every((segment, index)=>octets[index] === segment || octets[index] === '*'));
2094
2100
  }
2101
+ function warnAboutNonProductionLicenseKey(licenseType) {
2102
+ const capitalizedLicenseType = licenseType[0].toUpperCase() + licenseType.slice(1);
2103
+ const article = licenseType === 'evaluation' ? 'an' : 'a';
2104
+ console.info(`%cCKEditor 5 ${capitalizedLicenseType} License`, 'color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;');
2105
+ console.warn(`⚠️ You are using ${article} ${licenseType} license of CKEditor 5` + `${licenseType === 'trial' ? ' which is for evaluation purposes only' : ''}. ` + 'For production usage, please obtain a production license at https://portal.ckeditor.com/');
2106
+ }
2095
2107
  if (licenseKey == 'GPL') {
2096
2108
  if (distributionChannel == 'cloud') {
2097
2109
  blockEditor('distributionChannel');
@@ -2143,10 +2155,11 @@ function getPageSessionID() {
2143
2155
  'trial'
2144
2156
  ].includes(licensePayload.licenseType)) {
2145
2157
  const { licenseType } = licensePayload;
2146
- const capitalizedLicenseType = licenseType[0].toUpperCase() + licenseType.slice(1);
2147
- const article = licenseType === 'evaluation' ? 'an' : 'a';
2148
- console.info(`%cCKEditor 5 ${capitalizedLicenseType} License`, 'color: #ffffff; background: #743CCD; font-size: 14px; padding: 4px 8px; border-radius: 4px;');
2149
- console.warn(`⚠️ You are using ${article} ${licenseType} license of CKEditor 5` + `${licenseType === 'trial' ? ' which is for evaluation purposes only' : ''}. ` + 'For production usage, please obtain a production license at https://portal.ckeditor.com/');
2158
+ const sessionStarted = sessionStorage.getItem('ckeditor5-development-session-started');
2159
+ if (!sessionStarted) {
2160
+ warnAboutNonProductionLicenseKey(licenseType);
2161
+ sessionStorage.setItem('ckeditor5-development-session-started', 'true');
2162
+ }
2150
2163
  }
2151
2164
  if ([
2152
2165
  'evaluation',
@@ -2186,7 +2199,7 @@ function getPageSessionID() {
2186
2199
  * Please ensure that your setup does not block requests to the validation endpoint.
2187
2200
  *
2188
2201
  * @error license-key-validation-endpoint-not-reachable
2189
- * @param {String} url The URL that was attempted to be reached for validation.
2202
+ * @param {string} url The URL that was attempted to be reached for validation.
2190
2203
  */ logError('license-key-validation-endpoint-not-reachable', {
2191
2204
  url: licensePayload.usageEndpoint
2192
2205
  });
@@ -2292,6 +2305,7 @@ function getPageSessionID() {
2292
2305
  * The lock ID is missing or it is not a string or symbol.
2293
2306
  *
2294
2307
  * @error editor-read-only-lock-id-invalid
2308
+ * @param {never} lockId Lock ID.
2295
2309
  */ throw new CKEditorError('editor-read-only-lock-id-invalid', null, {
2296
2310
  lockId
2297
2311
  });
@@ -2627,6 +2641,7 @@ function collectUsageData(editor) {
2627
2641
  * Make sure that you are not setting the same path multiple times.
2628
2642
  *
2629
2643
  * @error editor-usage-data-path-already-set
2644
+ * @param {string} path The path that was already set.
2630
2645
  */ throw new CKEditorError('editor-usage-data-path-already-set', {
2631
2646
  path
2632
2647
  });
@@ -2764,10 +2779,10 @@ ElementApiMixin.updateSourceElement = ElementApiMixin(Object).prototype.updateSo
2764
2779
  * A DOM element used to create the editor (e.g.
2765
2780
  * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`})
2766
2781
  * has already been used to create another editor instance. Make sure each editor is
2767
- * created with an unique DOM element.
2782
+ * created with a unique DOM element.
2768
2783
  *
2769
2784
  * @error editor-source-element-already-used
2770
- * @param element DOM element that caused the collision.
2785
+ * @param {HTMLElement} element DOM element that caused the collision.
2771
2786
  */ throw new CKEditorError('editor-source-element-already-used', editor);
2772
2787
  }
2773
2788
  sourceElement.ckeditorInstance = editor;