@ckeditor/ckeditor5-editor-multi-root 46.1.1-alpha.3 → 47.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-editor-multi-root",
3
- "version": "46.1.1-alpha.3",
3
+ "version": "47.0.0-alpha.0",
4
4
  "description": "Multi-root editor implementation for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,11 +12,11 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "@ckeditor/ckeditor5-core": "46.1.1-alpha.3",
16
- "@ckeditor/ckeditor5-engine": "46.1.1-alpha.3",
17
- "@ckeditor/ckeditor5-ui": "46.1.1-alpha.3",
18
- "@ckeditor/ckeditor5-utils": "46.1.1-alpha.3",
19
- "ckeditor5": "46.1.1-alpha.3",
15
+ "@ckeditor/ckeditor5-core": "47.0.0-alpha.0",
16
+ "@ckeditor/ckeditor5-engine": "47.0.0-alpha.0",
17
+ "@ckeditor/ckeditor5-ui": "47.0.0-alpha.0",
18
+ "@ckeditor/ckeditor5-utils": "47.0.0-alpha.0",
19
+ "ckeditor5": "47.0.0-alpha.0",
20
20
  "es-toolkit": "1.39.5"
21
21
  },
22
22
  "author": "CKSource (http://cksource.com/)",
@@ -6,7 +6,7 @@
6
6
  * @module editor-multi-root/multirooteditor
7
7
  */
8
8
  import { Editor, secureSourceElement } from 'ckeditor5/src/core.js';
9
- import { CKEditorError, getDataFromElement, setDataInElement, logWarning } from 'ckeditor5/src/utils.js';
9
+ import { CKEditorError, getDataFromElement, setDataInElement, logWarning, decodeLicenseKey, isFeatureBlockedByLicenseKey } from 'ckeditor5/src/utils.js';
10
10
  import { MultiRootEditorUI } from './multirooteditorui.js';
11
11
  import { MultiRootEditorUIView } from './multirooteditoruiview.js';
12
12
  import { isElement as _isElement } from 'es-toolkit/compat';
@@ -215,6 +215,18 @@ export class MultiRootEditor extends Editor {
215
215
  evt.stop();
216
216
  }
217
217
  }, { priority: 'highest' });
218
+ verifyLicenseKey(this);
219
+ function verifyLicenseKey(editor) {
220
+ const licenseKey = editor.config.get('licenseKey');
221
+ const decodedPayload = decodeLicenseKey(licenseKey);
222
+ if (!decodedPayload) {
223
+ return;
224
+ }
225
+ if (isFeatureBlockedByLicenseKey(decodedPayload, 'MRE')) {
226
+ editor.enableReadOnlyMode(Symbol('invalidLicense'));
227
+ editor._showLicenseError('featureNotAllowed', 'Multi-root editor');
228
+ }
229
+ }
218
230
  }
219
231
  /**
220
232
  * Destroys the editor instance, releasing all resources used by it.