@ckeditor/ckeditor5-utils 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
@@ -959,9 +959,9 @@ diff.fastDiff = fastDiff;
959
959
  ];
960
960
  }
961
961
 
962
- const version = '45.0.0';
962
+ const version = '45.1.0-alpha.1';
963
963
  // The second argument is not a month. It is `monthIndex` and starts from `0`.
964
- const releaseDate = new Date(2025, 3, 7);
964
+ const releaseDate = new Date(2025, 4, 8);
965
965
  /* istanbul ignore next -- @preserve */ if (globalThis.CKEDITOR_VERSION) {
966
966
  /**
967
967
  * This error is thrown when, due to a mistake in the way CKEditor 5 was installed,
@@ -1711,8 +1711,8 @@ function ObservableMixin(base) {
1711
1711
  * Cannot decorate an undefined method.
1712
1712
  *
1713
1713
  * @error observablemixin-cannot-decorate-undefined
1714
- * @param {Object} object The object which method should be decorated.
1715
- * @param {String} methodName Name of the method which does not exist.
1714
+ * @param {object} object The object which method should be decorated.
1715
+ * @param {string} methodName Name of the method which does not exist.
1716
1716
  */ throw new CKEditorError('observablemixin-cannot-decorate-undefined', this, {
1717
1717
  object: this,
1718
1718
  methodName
@@ -3895,6 +3895,24 @@ const rectProperties = [
3895
3895
  }
3896
3896
  }
3897
3897
 
3898
+ /**
3899
+ * Returns the visual viewport offsets to adjust elements with `position: fixed` style.
3900
+ */ function getVisualViewportOffset() {
3901
+ const visualViewport = global.window.visualViewport;
3902
+ if (!visualViewport || !(env.isiOS || env.isSafari)) {
3903
+ return {
3904
+ left: 0,
3905
+ top: 0
3906
+ };
3907
+ }
3908
+ const left = Math.max(Math.round(visualViewport.offsetLeft), 0);
3909
+ const top = Math.max(Math.round(visualViewport.offsetTop), 0);
3910
+ return {
3911
+ left,
3912
+ top
3913
+ };
3914
+ }
3915
+
3898
3916
  /**
3899
3917
  * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
3900
3918
  * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
@@ -4323,7 +4341,7 @@ const keyCodeNames = /* #__PURE__ */ Object.fromEntries(/* #__PURE__ */ Object.e
4323
4341
  * Unknown key name. Only key names included in the {@link module:utils/keyboard#keyCodes} can be used.
4324
4342
  *
4325
4343
  * @error keyboard-unknown-key
4326
- * @param {String} key
4344
+ * @param {string} key Ths specified key name.
4327
4345
  */ throw new CKEditorError('keyboard-unknown-key', null, {
4328
4346
  key
4329
4347
  });
@@ -4517,7 +4535,9 @@ function splitKeystrokeText(keystroke) {
4517
4535
  'ku',
4518
4536
  'kur',
4519
4537
  'ug',
4520
- 'uig' // Uighur, Uyghur
4538
+ 'uig',
4539
+ 'ur',
4540
+ 'urd' // Urdu
4521
4541
  ];
4522
4542
  /**
4523
4543
  * Helps determine whether a language text direction is LTR or RTL.
@@ -4817,7 +4837,7 @@ function getNumberOfLanguages(translations) {
4817
4837
  * @param options.contentLanguage The editor content language code in the
4818
4838
  * [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format. If not specified, the same as `options.language`.
4819
4839
  * See {@link #contentLanguage}.
4820
- * @param translations Translations passed as a editor config parameter.
4840
+ * @param options.translations Translations passed as a editor config parameter.
4821
4841
  */ constructor({ uiLanguage = 'en', contentLanguage, translations } = {}){
4822
4842
  this.uiLanguage = uiLanguage;
4823
4843
  this.contentLanguage = contentLanguage || this.uiLanguage;
@@ -5940,11 +5960,12 @@ function isFocusedView(subTreeRoot, view) {
5940
5960
  /**
5941
5961
  * Tries calling the given callback until it sucessfully resolves.
5942
5962
  *
5943
- * If the callback fails `maxRetries` times, the returned promise is rejected with the last error.
5963
+ * If the callback fails `maxAttempts` times, the returned promise is rejected with the last error.
5944
5964
  *
5945
5965
  * @typeParam TResult The result of a successful callback invocation.
5946
5966
  * @param callback The function to call until it succeeds.
5947
- * @param options.maxRetries Maximum number of retries.
5967
+ * @param options Configuration options.
5968
+ * @param options.maxAttempts Maximum number of attempts.
5948
5969
  * @param options.retryDelay The time in milliseconds between attempts. By default it implements exponential back-off policy.
5949
5970
  * @param options.signal The signal to abort further retries. The callback itself is not aborted automatically.
5950
5971
  */ async function retry(callback, options = {}) {
@@ -5993,10 +6014,9 @@ function isFocusedView(subTreeRoot, view) {
5993
6014
  * spliceArray( [ 1, 2 ], [], 0 ); // [ 1, 2 ]
5994
6015
  * ```
5995
6016
  *
5996
- * @param target Array to be spliced.
5997
- * @param source Array of elements to be inserted to target.
5998
- * @param start Index at which nodes should be inserted/removed.
5999
- * @param count Number of items.
6017
+ * @param targetArray Array to be spliced.
6018
+ * @param insertArray Array of elements to be inserted to target.
6019
+ * @param index Index at which nodes should be inserted.
6000
6020
  *
6001
6021
  * @returns New spliced array.
6002
6022
  */ function spliceArray(targetArray, insertArray, index) {
@@ -6241,5 +6261,5 @@ function buildEmojiRegexp() {
6241
6261
  return new RegExp(sequence, 'ug');
6242
6262
  }
6243
6263
 
6244
- export { CKEditorError, Collection, Config, DomEmitterMixin, ElementReplacer, EmitterMixin, EventInfo, FocusTracker, KeystrokeHandler, Locale, ObservableMixin, Rect, ResizeObserver, abortableDebounce, add, collectStylesheets, compareArrays, count, crc32, createElement, delay, diff, diffToChanges, env, exponentialDelay, fastDiff, findClosestScrollableAncestor, first, getAncestors, getBorderWidths, getCode, getDataFromElement, getEnvKeystrokeText, getLanguageDirection, getLocalizedArrowKeyCodeDirection, getOptimalPosition, getRangeFromMouseEvent, global, indexOf, insertAt, insertToPriorityArray, isArrowKeyCode, isCombiningMark, isComment, isForwardArrowKeyCode, isHighSurrogateHalf, isInsideCombinedSymbol, isInsideEmojiSequence, isInsideSurrogatePair, isIterable, isLowSurrogateHalf, isNode, isRange, isText, isValidAttributeName, isViewWithFocusTracker, isVisible, keyCodes, logError, logWarning, mix, parseBase64EncodedObject, parseKeystroke, priorities, releaseDate, remove, retry, scrollAncestorsToShowTarget, scrollViewportToShowTarget, setDataInElement, spliceArray, toArray, toMap, toUnit, uid, version, wait };
6264
+ export { CKEditorError, Collection, Config, DomEmitterMixin, ElementReplacer, EmitterMixin, EventInfo, FocusTracker, KeystrokeHandler, Locale, ObservableMixin, Rect, ResizeObserver, abortableDebounce, add, collectStylesheets, compareArrays, count, crc32, createElement, delay, diff, diffToChanges, env, exponentialDelay, fastDiff, findClosestScrollableAncestor, first, getAncestors, getBorderWidths, getCode, getDataFromElement, getEnvKeystrokeText, getLanguageDirection, getLocalizedArrowKeyCodeDirection, getOptimalPosition, getRangeFromMouseEvent, getVisualViewportOffset, global, indexOf, insertAt, insertToPriorityArray, isArrowKeyCode, isCombiningMark, isComment, isForwardArrowKeyCode, isHighSurrogateHalf, isInsideCombinedSymbol, isInsideEmojiSequence, isInsideSurrogatePair, isIterable, isLowSurrogateHalf, isNode, isRange, isText, isValidAttributeName, isViewWithFocusTracker, isVisible, keyCodes, logError, logWarning, mix, parseBase64EncodedObject, parseKeystroke, priorities, releaseDate, remove, retry, scrollAncestorsToShowTarget, scrollViewportToShowTarget, setDataInElement, spliceArray, toArray, toMap, toUnit, uid, version, wait };
6245
6265
  //# sourceMappingURL=index.js.map