@ckeditor/ckeditor5-typing 47.3.0 → 47.4.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.
Files changed (41) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/index-content.css +1 -1
  3. package/dist/index-editor.css +1 -1
  4. package/dist/index.css +1 -1
  5. package/dist/index.js +22 -8
  6. package/dist/index.js.map +1 -1
  7. package/package.json +5 -5
  8. package/src/augmentation.d.ts +1 -1
  9. package/src/augmentation.js +1 -1
  10. package/src/delete.d.ts +1 -1
  11. package/src/delete.js +1 -1
  12. package/src/deletecommand.d.ts +1 -1
  13. package/src/deletecommand.js +1 -1
  14. package/src/deleteobserver.d.ts +1 -1
  15. package/src/deleteobserver.js +1 -1
  16. package/src/index.d.ts +1 -1
  17. package/src/index.js +1 -1
  18. package/src/input.d.ts +1 -1
  19. package/src/input.js +13 -2
  20. package/src/inserttextcommand.d.ts +1 -1
  21. package/src/inserttextcommand.js +1 -1
  22. package/src/inserttextobserver.d.ts +1 -1
  23. package/src/inserttextobserver.js +1 -1
  24. package/src/texttransformation.d.ts +1 -1
  25. package/src/texttransformation.js +6 -3
  26. package/src/textwatcher.d.ts +1 -1
  27. package/src/textwatcher.js +1 -1
  28. package/src/twostepcaretmovement.d.ts +1 -1
  29. package/src/twostepcaretmovement.js +1 -1
  30. package/src/typing.d.ts +1 -1
  31. package/src/typing.js +1 -1
  32. package/src/typingconfig.d.ts +1 -1
  33. package/src/typingconfig.js +1 -1
  34. package/src/utils/changebuffer.d.ts +1 -1
  35. package/src/utils/changebuffer.js +1 -1
  36. package/src/utils/findattributerange.d.ts +1 -1
  37. package/src/utils/findattributerange.js +1 -1
  38. package/src/utils/getlasttextline.d.ts +1 -1
  39. package/src/utils/getlasttextline.js +1 -1
  40. package/src/utils/inlinehighlight.d.ts +1 -1
  41. package/src/utils/inlinehighlight.js +1 -1
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 Typing feature** (https://github.com/ckeditor/ckeditor5)<br>
5
- Copyright (c) 2003–2025, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 2003–2026, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under a dual-license model, this software is available under:
8
8
 
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2026, 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
  */
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2026, 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
  */
package/dist/index.css CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2026, 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
  */
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2026, 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
5
  import { Command, Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
@@ -8,7 +8,7 @@ import { Observer, FocusObserver, ViewDocumentDomEventData, _tryFixingModelRange
8
8
  import { debounce, escapeRegExp } from 'es-toolkit/compat';
9
9
 
10
10
  /**
11
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
11
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
12
12
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
13
13
  */ /**
14
14
  * @module typing/utils/changebuffer
@@ -389,8 +389,19 @@ const TYPING_INPUT_TYPES_ANDROID = [
389
389
  let modelRanges;
390
390
  // If view selection was specified, translate it to model selection.
391
391
  if (viewSelection) {
392
- modelRanges = Array.from(viewSelection.getRanges()).map((viewRange)=>mapper.toModelRange(viewRange)).map((modelRange)=>_tryFixingModelRange(modelRange, model.schema) || modelRange);
393
- } else {
392
+ modelRanges = Array.from(viewSelection.getRanges()).filter((viewRange)=>{
393
+ // On Windows 11 with the US International keyboard, events are batched.
394
+ // In other words, the first backtick press does not send an `insertText` event,
395
+ // and only the second one sends it double (batched).
396
+ // This causes a race condition if during the first backtick insert the element is removed from the tree,
397
+ // and the second event flushes changes, and it's original targetRanges,
398
+ // which were initially good, now refer to a removed element.
399
+ // This is not reproducible on Mac/Linux as they enter composition mode.
400
+ // See more: https://github.com/ckeditor/ckeditor5/issues/18926.
401
+ return viewRange.root.is('rootElement');
402
+ }).map((viewRange)=>mapper.toModelRange(viewRange)).map((modelRange)=>_tryFixingModelRange(modelRange, model.schema) || modelRange);
403
+ }
404
+ if (!modelRanges || !modelRanges.length) {
394
405
  modelRanges = Array.from(modelSelection.getRanges());
395
406
  }
396
407
  let insertText = text;
@@ -1331,7 +1342,7 @@ const DELETE_EVENT_TYPES = {
1331
1342
  }
1332
1343
 
1333
1344
  /**
1334
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
1345
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
1335
1346
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
1336
1347
  */ /**
1337
1348
  * @module typing/utils/getlasttextline
@@ -2346,8 +2357,11 @@ const DEFAULT_TRANSFORMATIONS = [
2346
2357
  const model = this.editor.model;
2347
2358
  const modelSelection = model.document.selection;
2348
2359
  modelSelection.on('change:range', ()=>{
2349
- // Disable plugin when selection is inside a code block.
2350
- this.isEnabled = !modelSelection.anchor.parent.is('element', 'codeBlock');
2360
+ // Disable plugin when selection is inside a code block or inline code.
2361
+ const anchor = modelSelection.anchor;
2362
+ const isInCodeBlock = !!anchor && anchor.parent.is('element', 'codeBlock');
2363
+ const isInInlineCode = modelSelection.hasAttribute('code');
2364
+ this.isEnabled = !(isInCodeBlock || isInInlineCode);
2351
2365
  });
2352
2366
  this._enableTransformationWatchers();
2353
2367
  }
@@ -2474,7 +2488,7 @@ const DEFAULT_TRANSFORMATIONS = [
2474
2488
  }
2475
2489
 
2476
2490
  /**
2477
- * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
2491
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2478
2492
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2479
2493
  */ /**
2480
2494
  * @module typing/utils/findattributerange