@ckeditor/ckeditor5-utils 34.2.0 → 35.0.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/CHANGELOG.md +324 -0
- package/LICENSE.md +1 -1
- package/package.json +19 -8
- package/src/areconnectedthroughproperties.js +0 -92
- package/src/ckeditorerror.js +0 -217
- package/src/collection.js +0 -785
- package/src/comparearrays.js +0 -51
- package/src/config.js +0 -246
- package/src/count.js +0 -26
- package/src/diff.js +0 -138
- package/src/difftochanges.js +0 -86
- package/src/dom/createelement.js +0 -49
- package/src/dom/emittermixin.js +0 -341
- package/src/dom/getancestors.js +0 -31
- package/src/dom/getborderwidths.js +0 -27
- package/src/dom/getcommonancestor.js +0 -31
- package/src/dom/getdatafromelement.js +0 -24
- package/src/dom/getpositionedancestor.js +0 -28
- package/src/dom/global.js +0 -26
- package/src/dom/indexof.js +0 -25
- package/src/dom/insertat.js +0 -19
- package/src/dom/iscomment.js +0 -20
- package/src/dom/isnode.js +0 -26
- package/src/dom/isrange.js +0 -18
- package/src/dom/istext.js +0 -18
- package/src/dom/isvisible.js +0 -25
- package/src/dom/iswindow.js +0 -30
- package/src/dom/position.js +0 -518
- package/src/dom/rect.js +0 -443
- package/src/dom/remove.js +0 -21
- package/src/dom/resizeobserver.js +0 -378
- package/src/dom/scroll.js +0 -302
- package/src/dom/setdatainelement.js +0 -24
- package/src/dom/tounit.js +0 -27
- package/src/elementreplacer.js +0 -57
- package/src/emittermixin.js +0 -719
- package/src/env.js +0 -190
- package/src/eventinfo.js +0 -79
- package/src/fastdiff.js +0 -261
- package/src/first.js +0 -24
- package/src/focustracker.js +0 -157
- package/src/index.js +0 -45
- package/src/inserttopriorityarray.js +0 -42
- package/src/isiterable.js +0 -18
- package/src/keyboard.js +0 -301
- package/src/keystrokehandler.js +0 -130
- package/src/language.js +0 -26
- package/src/locale.js +0 -176
- package/src/mapsequal.js +0 -32
- package/src/mix.js +0 -47
- package/src/nth.js +0 -31
- package/src/objecttomap.js +0 -29
- package/src/observablemixin.js +0 -908
- package/src/priorities.js +0 -44
- package/src/spy.js +0 -25
- package/src/toarray.js +0 -18
- package/src/tomap.js +0 -29
- package/src/translation-service.js +0 -216
- package/src/uid.js +0 -59
- package/src/unicode.js +0 -106
- package/src/version.js +0 -157
package/src/dom/tounit.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @module utils/dom/tounit
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Returns a helper function, which adds a desired trailing
|
|
12
|
-
* `unit` to the passed value.
|
|
13
|
-
*
|
|
14
|
-
* @param {String} unit An unit like "px" or "em".
|
|
15
|
-
* @returns {module:utils/dom/tounit~helper}
|
|
16
|
-
*/
|
|
17
|
-
export default function toUnit( unit ) {
|
|
18
|
-
/**
|
|
19
|
-
* A function, which adds a pre–defined trailing `unit`
|
|
20
|
-
* to the passed `value`.
|
|
21
|
-
*
|
|
22
|
-
* @function helper
|
|
23
|
-
* @param {*} value A value to be given the unit.
|
|
24
|
-
* @returns {String} A value with the trailing unit.
|
|
25
|
-
*/
|
|
26
|
-
return value => value + unit;
|
|
27
|
-
}
|
package/src/elementreplacer.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @module utils/elementreplacer
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
|
|
12
|
-
* the original elements from the DOM.
|
|
13
|
-
*/
|
|
14
|
-
export default class ElementReplacer {
|
|
15
|
-
constructor() {
|
|
16
|
-
/**
|
|
17
|
-
* The elements replaced by {@link #replace} and their replacements.
|
|
18
|
-
*
|
|
19
|
-
* @private
|
|
20
|
-
* @member {Array.<Object>}
|
|
21
|
-
*/
|
|
22
|
-
this._replacedElements = [];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Hides the `element` and, if specified, inserts the the given element next to it.
|
|
27
|
-
*
|
|
28
|
-
* The effect of this method can be reverted by {@link #restore}.
|
|
29
|
-
*
|
|
30
|
-
* @param {HTMLElement} element The element to replace.
|
|
31
|
-
* @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.
|
|
32
|
-
*/
|
|
33
|
-
replace( element, newElement ) {
|
|
34
|
-
this._replacedElements.push( { element, newElement } );
|
|
35
|
-
|
|
36
|
-
element.style.display = 'none';
|
|
37
|
-
|
|
38
|
-
if ( newElement ) {
|
|
39
|
-
element.parentNode.insertBefore( newElement, element.nextSibling );
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Restores what {@link #replace} did.
|
|
45
|
-
*/
|
|
46
|
-
restore() {
|
|
47
|
-
this._replacedElements.forEach( ( { element, newElement } ) => {
|
|
48
|
-
element.style.display = '';
|
|
49
|
-
|
|
50
|
-
if ( newElement ) {
|
|
51
|
-
newElement.remove();
|
|
52
|
-
}
|
|
53
|
-
} );
|
|
54
|
-
|
|
55
|
-
this._replacedElements = [];
|
|
56
|
-
}
|
|
57
|
-
}
|