@ckeditor/ckeditor5-utils 46.1.1 → 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/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/decodelicensekey.d.ts +10 -0
- package/src/decodelicensekey.js +30 -0
- package/src/dom/resizeobserver.js +1 -2
- package/src/fastdiff.js +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/isfeatureblockedbylicensekey.d.ts +14 -0
- package/src/isfeatureblockedbylicensekey.js +17 -0
- package/src/language.js +6 -6
- package/src/version.d.ts +1 -1
- package/src/version.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "47.0.0-alpha.0",
|
|
4
4
|
"description": "Miscellaneous utilities used by CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@ckeditor/ckeditor5-ui": "
|
|
15
|
+
"@ckeditor/ckeditor5-ui": "47.0.0-alpha.0",
|
|
16
16
|
"es-toolkit": "1.39.5"
|
|
17
17
|
},
|
|
18
18
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
* Parses the provided license key and returns the decoded object, or null if the decoding was unsuccessful.
|
|
7
|
+
*
|
|
8
|
+
* @param licenseKey The license key to decode.
|
|
9
|
+
*/
|
|
10
|
+
export declare function decodeLicenseKey(licenseKey?: string): Record<string, any> | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 utils/decodelicensekey
|
|
7
|
+
*/
|
|
8
|
+
import { parseBase64EncodedObject } from './parsebase64encodedobject.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parses the provided license key and returns the decoded object, or null if the decoding was unsuccessful.
|
|
11
|
+
*
|
|
12
|
+
* @param licenseKey The license key to decode.
|
|
13
|
+
*/
|
|
14
|
+
export function decodeLicenseKey(licenseKey) {
|
|
15
|
+
if (!licenseKey) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const encodedPayload = getLicenseKeyPayload(licenseKey);
|
|
19
|
+
if (!encodedPayload) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return parseBase64EncodedObject(encodedPayload);
|
|
23
|
+
}
|
|
24
|
+
function getLicenseKeyPayload(licenseKey) {
|
|
25
|
+
const parts = licenseKey.split('.');
|
|
26
|
+
if (parts.length != 3) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return parts[1];
|
|
30
|
+
}
|
|
@@ -22,7 +22,7 @@ import { global } from './global.js';
|
|
|
22
22
|
* It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
|
|
23
23
|
* under the hood.
|
|
24
24
|
*/
|
|
25
|
-
class ResizeObserver {
|
|
25
|
+
export class ResizeObserver {
|
|
26
26
|
/**
|
|
27
27
|
* The element observed by this observer.
|
|
28
28
|
*/
|
|
@@ -132,4 +132,3 @@ class ResizeObserver {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
export { ResizeObserver };
|
package/src/fastdiff.js
CHANGED
|
@@ -211,7 +211,7 @@ function changeIndexesToChanges(newArray, changeIndexes) {
|
|
|
211
211
|
}
|
|
212
212
|
if (lastIndexOld - firstIndex > 0) {
|
|
213
213
|
result.push({
|
|
214
|
-
index: firstIndex + (lastIndexNew - firstIndex),
|
|
214
|
+
index: firstIndex + (lastIndexNew - firstIndex), // Increase index of what was inserted.
|
|
215
215
|
type: 'delete',
|
|
216
216
|
howMany: lastIndexOld - firstIndex
|
|
217
217
|
});
|
package/src/index.d.ts
CHANGED
|
@@ -74,4 +74,6 @@ export { collectStylesheets } from './collectstylesheets.js';
|
|
|
74
74
|
export { formatHtml } from './formathtml.js';
|
|
75
75
|
export { spy } from './spy.js';
|
|
76
76
|
export { isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol, isInsideEmojiSequence } from './unicode.js';
|
|
77
|
+
export { decodeLicenseKey } from './decodelicensekey.js';
|
|
78
|
+
export { isFeatureBlockedByLicenseKey } from './isfeatureblockedbylicensekey.js';
|
|
77
79
|
export { version, releaseDate } from './version.js';
|
package/src/index.js
CHANGED
|
@@ -73,4 +73,6 @@ export { collectStylesheets } from './collectstylesheets.js';
|
|
|
73
73
|
export { formatHtml } from './formathtml.js';
|
|
74
74
|
export { spy } from './spy.js';
|
|
75
75
|
export { isCombiningMark, isHighSurrogateHalf, isLowSurrogateHalf, isInsideSurrogatePair, isInsideCombinedSymbol, isInsideEmojiSequence } from './unicode.js';
|
|
76
|
+
export { decodeLicenseKey } from './decodelicensekey.js';
|
|
77
|
+
export { isFeatureBlockedByLicenseKey } from './isfeatureblockedbylicensekey.js';
|
|
76
78
|
export { version, releaseDate } from './version.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
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 utils/isfeatureblockedbylicensekey
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Checks whether a feature (represented by an unique id) is blocked by the provided license key.
|
|
10
|
+
*
|
|
11
|
+
* @param licensePayload Decoded license key.
|
|
12
|
+
* @param licenseFeatureCode An unique feature id to check.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isFeatureBlockedByLicenseKey(licensePayload: Record<string, any>, licenseFeatureCode: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 utils/isfeatureblockedbylicensekey
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Checks whether a feature (represented by an unique id) is blocked by the provided license key.
|
|
10
|
+
*
|
|
11
|
+
* @param licensePayload Decoded license key.
|
|
12
|
+
* @param licenseFeatureCode An unique feature id to check.
|
|
13
|
+
*/
|
|
14
|
+
export function isFeatureBlockedByLicenseKey(licensePayload, licenseFeatureCode) {
|
|
15
|
+
const blockedFeatures = licensePayload.removeFeatures || [];
|
|
16
|
+
return blockedFeatures.includes(licenseFeatureCode);
|
|
17
|
+
}
|
package/src/language.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
5
|
const RTL_LANGUAGE_CODES = [
|
|
6
|
-
'ar', 'ara',
|
|
7
|
-
'dv', 'div',
|
|
8
|
-
'fa', 'per', 'fas',
|
|
9
|
-
'he', 'heb',
|
|
10
|
-
'ku', 'kur',
|
|
11
|
-
'ug', 'uig',
|
|
6
|
+
'ar', 'ara', // Arabic
|
|
7
|
+
'dv', 'div', // Dhivehi
|
|
8
|
+
'fa', 'per', 'fas', // Persian
|
|
9
|
+
'he', 'heb', // Hebrew
|
|
10
|
+
'ku', 'kur', // Kurdish
|
|
11
|
+
'ug', 'uig', // Uighur, Uyghur
|
|
12
12
|
'ur', 'urd' // Urdu
|
|
13
13
|
];
|
|
14
14
|
/**
|
package/src/version.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
|
-
export declare const version = "
|
|
5
|
+
export declare const version = "47.0.0-alpha.0";
|
|
6
6
|
export declare const releaseDate: Date;
|
|
7
7
|
declare global {
|
|
8
8
|
var CKEDITOR_VERSION: string;
|
package/src/version.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* @module utils/version
|
|
7
7
|
*/
|
|
8
8
|
import { CKEditorError } from './ckeditorerror.js';
|
|
9
|
-
export const version = '
|
|
9
|
+
export const version = '47.0.0-alpha.0';
|
|
10
10
|
// The second argument is not a month. It is `monthIndex` and starts from `0`.
|
|
11
|
-
export const releaseDate = new Date(2025, 8,
|
|
11
|
+
export const releaseDate = new Date(2025, 8, 24);
|
|
12
12
|
/* istanbul ignore next -- @preserve */
|
|
13
13
|
if (globalThis.CKEDITOR_VERSION) {
|
|
14
14
|
/**
|