@ckeditor/ckeditor5-typing 44.2.1 → 44.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-typing",
3
- "version": "44.2.1",
3
+ "version": "44.3.0-alpha.1",
4
4
  "description": "Typing feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,9 +13,9 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "44.2.1",
17
- "@ckeditor/ckeditor5-engine": "44.2.1",
18
- "@ckeditor/ckeditor5-utils": "44.2.1",
16
+ "@ckeditor/ckeditor5-core": "44.3.0-alpha.1",
17
+ "@ckeditor/ckeditor5-engine": "44.3.0-alpha.1",
18
+ "@ckeditor/ckeditor5-utils": "44.3.0-alpha.1",
19
19
  "lodash-es": "4.17.21"
20
20
  },
21
21
  "author": "CKSource (http://cksource.com/)",
package/src/delete.d.ts CHANGED
@@ -2,9 +2,6 @@
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
- /**
6
- * @module typing/delete
7
- */
8
5
  import { Plugin } from '@ckeditor/ckeditor5-core';
9
6
  /**
10
7
  * The delete and backspace feature. Handles keys such as <kbd>Delete</kbd> and <kbd>Backspace</kbd>, other
package/src/delete.js CHANGED
@@ -2,10 +2,8 @@
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
- /**
6
- * @module typing/delete
7
- */
8
5
  import { Plugin } from '@ckeditor/ckeditor5-core';
6
+ import { keyCodes } from '@ckeditor/ckeditor5-utils';
9
7
  import DeleteCommand from './deletecommand.js';
10
8
  import DeleteObserver from './deleteobserver.js';
11
9
  /**
@@ -61,6 +59,19 @@ export default class Delete extends Plugin {
61
59
  editor.execute(commandName, commandData);
62
60
  view.scrollToTheSelection();
63
61
  }, { priority: 'low' });
62
+ // Handle the Backspace key while at the beginning of a nested editable. See https://github.com/ckeditor/ckeditor5/issues/17383.
63
+ this.listenTo(viewDocument, 'keydown', (evt, data) => {
64
+ if (viewDocument.isComposing ||
65
+ data.keyCode != keyCodes.backspace ||
66
+ !modelDocument.selection.isCollapsed) {
67
+ return;
68
+ }
69
+ const ancestorLimit = editor.model.schema.getLimitElement(modelDocument.selection);
70
+ const limitStartPosition = editor.model.createPositionAt(ancestorLimit, 0);
71
+ if (limitStartPosition.isTouching(modelDocument.selection.getFirstPosition())) {
72
+ data.preventDefault();
73
+ }
74
+ });
64
75
  if (this.editor.plugins.has('UndoEditing')) {
65
76
  this.listenTo(viewDocument, 'delete', (evt, data) => {
66
77
  if (this._undoOnBackspace && data.direction == 'backward' && data.sequence == 1 && data.unit == 'codePoint') {