@ckeditor/ckeditor5-engine 38.2.0-alpha.1 → 39.0.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 (212) hide show
  1. package/README.md +0 -1
  2. package/package.json +3 -4
  3. package/src/controller/datacontroller.d.ts +15 -15
  4. package/src/controller/datacontroller.js +11 -11
  5. package/src/controller/editingcontroller.d.ts +7 -7
  6. package/src/controller/editingcontroller.js +8 -8
  7. package/src/conversion/conversion.d.ts +6 -6
  8. package/src/conversion/conversion.js +2 -2
  9. package/src/conversion/downcastdispatcher.d.ts +28 -13
  10. package/src/conversion/downcastdispatcher.js +30 -21
  11. package/src/conversion/downcasthelpers.d.ts +21 -21
  12. package/src/conversion/downcasthelpers.js +11 -11
  13. package/src/conversion/mapper.d.ts +9 -9
  14. package/src/conversion/mapper.js +5 -5
  15. package/src/conversion/modelconsumable.d.ts +5 -5
  16. package/src/conversion/modelconsumable.js +1 -1
  17. package/src/conversion/upcastdispatcher.d.ts +12 -12
  18. package/src/conversion/upcastdispatcher.js +5 -5
  19. package/src/conversion/upcasthelpers.d.ts +9 -9
  20. package/src/conversion/upcasthelpers.js +3 -3
  21. package/src/conversion/viewconsumable.d.ts +5 -5
  22. package/src/dataprocessor/basichtmlwriter.d.ts +1 -1
  23. package/src/dataprocessor/dataprocessor.d.ts +2 -2
  24. package/src/dataprocessor/htmldataprocessor.d.ts +6 -6
  25. package/src/dataprocessor/htmldataprocessor.js +2 -2
  26. package/src/dataprocessor/xmldataprocessor.d.ts +6 -6
  27. package/src/dataprocessor/xmldataprocessor.js +2 -2
  28. package/src/dev-utils/model.d.ts +10 -10
  29. package/src/dev-utils/model.js +16 -16
  30. package/src/dev-utils/operationreplayer.d.ts +2 -2
  31. package/src/dev-utils/operationreplayer.js +1 -1
  32. package/src/dev-utils/view.d.ts +8 -8
  33. package/src/dev-utils/view.js +15 -15
  34. package/src/index.d.ts +107 -106
  35. package/src/index.js +65 -64
  36. package/src/model/batch.d.ts +1 -1
  37. package/src/model/differ.d.ts +19 -5
  38. package/src/model/differ.js +72 -13
  39. package/src/model/document.d.ts +18 -12
  40. package/src/model/document.js +18 -13
  41. package/src/model/documentfragment.d.ts +4 -4
  42. package/src/model/documentfragment.js +5 -5
  43. package/src/model/documentselection.d.ts +8 -8
  44. package/src/model/documentselection.js +8 -5
  45. package/src/model/element.d.ts +2 -2
  46. package/src/model/element.js +4 -4
  47. package/src/model/history.d.ts +1 -1
  48. package/src/model/item.d.ts +2 -2
  49. package/src/model/liveposition.d.ts +4 -4
  50. package/src/model/liveposition.js +1 -1
  51. package/src/model/liverange.d.ts +5 -5
  52. package/src/model/liverange.js +1 -1
  53. package/src/model/markercollection.d.ts +4 -4
  54. package/src/model/markercollection.js +2 -2
  55. package/src/model/model.d.ts +14 -15
  56. package/src/model/model.js +18 -19
  57. package/src/model/node.d.ts +5 -5
  58. package/src/model/node.js +2 -2
  59. package/src/model/nodelist.d.ts +1 -1
  60. package/src/model/nodelist.js +1 -1
  61. package/src/model/operation/attributeoperation.d.ts +4 -4
  62. package/src/model/operation/attributeoperation.js +3 -3
  63. package/src/model/operation/detachoperation.d.ts +3 -3
  64. package/src/model/operation/detachoperation.js +3 -3
  65. package/src/model/operation/insertoperation.d.ts +6 -6
  66. package/src/model/operation/insertoperation.js +7 -7
  67. package/src/model/operation/markeroperation.d.ts +5 -5
  68. package/src/model/operation/markeroperation.js +2 -2
  69. package/src/model/operation/mergeoperation.d.ts +5 -5
  70. package/src/model/operation/mergeoperation.js +5 -5
  71. package/src/model/operation/moveoperation.d.ts +4 -4
  72. package/src/model/operation/moveoperation.js +4 -4
  73. package/src/model/operation/nooperation.d.ts +2 -2
  74. package/src/model/operation/nooperation.js +1 -1
  75. package/src/model/operation/operation.d.ts +3 -3
  76. package/src/model/operation/operationfactory.d.ts +2 -2
  77. package/src/model/operation/operationfactory.js +11 -11
  78. package/src/model/operation/renameoperation.d.ts +4 -4
  79. package/src/model/operation/renameoperation.js +3 -3
  80. package/src/model/operation/rootattributeoperation.d.ts +4 -4
  81. package/src/model/operation/rootattributeoperation.js +1 -1
  82. package/src/model/operation/rootoperation.d.ts +3 -7
  83. package/src/model/operation/rootoperation.js +1 -25
  84. package/src/model/operation/splitoperation.d.ts +5 -5
  85. package/src/model/operation/splitoperation.js +5 -5
  86. package/src/model/operation/transform.d.ts +2 -2
  87. package/src/model/operation/transform.js +14 -14
  88. package/src/model/operation/utils.d.ts +6 -6
  89. package/src/model/operation/utils.js +4 -4
  90. package/src/model/position.d.ts +14 -14
  91. package/src/model/position.js +3 -3
  92. package/src/model/range.d.ts +12 -12
  93. package/src/model/range.js +3 -3
  94. package/src/model/rootelement.d.ts +8 -2
  95. package/src/model/rootelement.js +7 -1
  96. package/src/model/schema.d.ts +9 -9
  97. package/src/model/schema.js +10 -5
  98. package/src/model/selection.d.ts +7 -7
  99. package/src/model/selection.js +4 -4
  100. package/src/model/text.d.ts +1 -1
  101. package/src/model/text.js +1 -1
  102. package/src/model/textproxy.d.ts +5 -5
  103. package/src/model/textproxy.js +1 -1
  104. package/src/model/treewalker.d.ts +3 -3
  105. package/src/model/treewalker.js +4 -4
  106. package/src/model/typecheckable.d.ts +13 -13
  107. package/src/model/utils/autoparagraphing.d.ts +4 -4
  108. package/src/model/utils/autoparagraphing.js +1 -2
  109. package/src/model/utils/deletecontent.d.ts +3 -3
  110. package/src/model/utils/deletecontent.js +3 -3
  111. package/src/model/utils/findoptimalinsertionrange.d.ts +4 -4
  112. package/src/model/utils/getselectedcontent.d.ts +4 -4
  113. package/src/model/utils/insertcontent.d.ts +6 -6
  114. package/src/model/utils/insertcontent.js +6 -6
  115. package/src/model/utils/insertobject.d.ts +5 -5
  116. package/src/model/utils/insertobject.js +1 -1
  117. package/src/model/utils/modifyselection.d.ts +3 -3
  118. package/src/model/utils/modifyselection.js +4 -4
  119. package/src/model/utils/selection-post-fixer.d.ts +3 -3
  120. package/src/model/utils/selection-post-fixer.js +2 -2
  121. package/src/model/writer.d.ts +12 -12
  122. package/src/model/writer.js +17 -17
  123. package/src/view/attributeelement.d.ts +3 -3
  124. package/src/view/attributeelement.js +1 -1
  125. package/src/view/containerelement.d.ts +3 -3
  126. package/src/view/containerelement.js +1 -1
  127. package/src/view/document.d.ts +4 -4
  128. package/src/view/document.js +2 -2
  129. package/src/view/documentfragment.d.ts +4 -4
  130. package/src/view/documentfragment.js +3 -3
  131. package/src/view/documentselection.d.ts +8 -8
  132. package/src/view/documentselection.js +2 -2
  133. package/src/view/domconverter.d.ts +19 -13
  134. package/src/view/domconverter.js +28 -10
  135. package/src/view/downcastwriter.d.ts +17 -17
  136. package/src/view/downcastwriter.js +11 -11
  137. package/src/view/editableelement.d.ts +14 -4
  138. package/src/view/editableelement.js +2 -1
  139. package/src/view/element.d.ts +5 -5
  140. package/src/view/element.js +5 -5
  141. package/src/view/emptyelement.d.ts +4 -4
  142. package/src/view/emptyelement.js +2 -2
  143. package/src/view/filler.d.ts +1 -1
  144. package/src/view/item.d.ts +2 -2
  145. package/src/view/matcher.d.ts +1 -1
  146. package/src/view/node.d.ts +5 -5
  147. package/src/view/node.js +2 -2
  148. package/src/view/observer/arrowkeysobserver.d.ts +4 -4
  149. package/src/view/observer/arrowkeysobserver.js +2 -2
  150. package/src/view/observer/bubblingemittermixin.d.ts +2 -2
  151. package/src/view/observer/bubblingemittermixin.js +1 -1
  152. package/src/view/observer/bubblingeventinfo.d.ts +3 -3
  153. package/src/view/observer/clickobserver.d.ts +3 -3
  154. package/src/view/observer/clickobserver.js +1 -1
  155. package/src/view/observer/compositionobserver.d.ts +3 -3
  156. package/src/view/observer/compositionobserver.js +1 -1
  157. package/src/view/observer/domeventdata.d.ts +3 -3
  158. package/src/view/observer/domeventobserver.d.ts +1 -1
  159. package/src/view/observer/domeventobserver.js +2 -2
  160. package/src/view/observer/fakeselectionobserver.d.ts +2 -2
  161. package/src/view/observer/fakeselectionobserver.js +2 -2
  162. package/src/view/observer/focusobserver.d.ts +3 -3
  163. package/src/view/observer/focusobserver.js +1 -1
  164. package/src/view/observer/inputobserver.d.ts +4 -4
  165. package/src/view/observer/inputobserver.js +2 -2
  166. package/src/view/observer/keyobserver.d.ts +2 -2
  167. package/src/view/observer/keyobserver.js +1 -1
  168. package/src/view/observer/mouseobserver.d.ts +2 -2
  169. package/src/view/observer/mouseobserver.js +1 -1
  170. package/src/view/observer/mutationobserver.d.ts +4 -4
  171. package/src/view/observer/mutationobserver.js +2 -2
  172. package/src/view/observer/observer.d.ts +2 -2
  173. package/src/view/observer/selectionobserver.d.ts +7 -7
  174. package/src/view/observer/selectionobserver.js +5 -5
  175. package/src/view/observer/tabobserver.d.ts +4 -4
  176. package/src/view/observer/tabobserver.js +2 -2
  177. package/src/view/placeholder.d.ts +18 -7
  178. package/src/view/placeholder.js +48 -11
  179. package/src/view/position.d.ts +7 -7
  180. package/src/view/position.js +4 -4
  181. package/src/view/range.d.ts +7 -7
  182. package/src/view/range.js +3 -3
  183. package/src/view/rawelement.d.ts +5 -5
  184. package/src/view/rawelement.js +2 -2
  185. package/src/view/renderer.d.ts +5 -5
  186. package/src/view/renderer.js +4 -5
  187. package/src/view/rooteditableelement.d.ts +2 -2
  188. package/src/view/rooteditableelement.js +1 -1
  189. package/src/view/selection.d.ts +8 -8
  190. package/src/view/selection.js +5 -5
  191. package/src/view/styles/background.d.ts +1 -1
  192. package/src/view/styles/background.js +1 -1
  193. package/src/view/styles/border.d.ts +1 -1
  194. package/src/view/styles/border.js +1 -1
  195. package/src/view/styles/margin.d.ts +1 -1
  196. package/src/view/styles/margin.js +1 -1
  197. package/src/view/styles/padding.d.ts +1 -1
  198. package/src/view/styles/padding.js +1 -1
  199. package/src/view/styles/utils.d.ts +1 -1
  200. package/src/view/text.d.ts +2 -2
  201. package/src/view/text.js +1 -1
  202. package/src/view/textproxy.d.ts +6 -6
  203. package/src/view/textproxy.js +1 -1
  204. package/src/view/treewalker.d.ts +3 -3
  205. package/src/view/treewalker.js +4 -4
  206. package/src/view/typecheckable.d.ts +16 -16
  207. package/src/view/uielement.d.ts +6 -6
  208. package/src/view/uielement.js +2 -2
  209. package/src/view/upcastwriter.d.ts +9 -9
  210. package/src/view/upcastwriter.js +6 -6
  211. package/src/view/view.d.ts +26 -19
  212. package/src/view/view.js +31 -19
@@ -2,18 +2,18 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import InsertOperation from './insertoperation.js';
6
- import AttributeOperation from './attributeoperation.js';
7
- import RenameOperation from './renameoperation.js';
8
- import MarkerOperation from './markeroperation.js';
9
- import MoveOperation from './moveoperation.js';
10
- import RootAttributeOperation from './rootattributeoperation.js';
11
- import RootOperation from './rootoperation.js';
12
- import MergeOperation from './mergeoperation.js';
13
- import SplitOperation from './splitoperation.js';
14
- import NoOperation from './nooperation.js';
15
- import Range from '../range.js';
16
- import Position from '../position.js';
5
+ import InsertOperation from './insertoperation';
6
+ import AttributeOperation from './attributeoperation';
7
+ import RenameOperation from './renameoperation';
8
+ import MarkerOperation from './markeroperation';
9
+ import MoveOperation from './moveoperation';
10
+ import RootAttributeOperation from './rootattributeoperation';
11
+ import RootOperation from './rootoperation';
12
+ import MergeOperation from './mergeoperation';
13
+ import SplitOperation from './splitoperation';
14
+ import NoOperation from './nooperation';
15
+ import Range from '../range';
16
+ import Position from '../position';
17
17
  import { compareArrays } from '@ckeditor/ckeditor5-utils';
18
18
  const transformations = new Map();
19
19
  /**
@@ -1641,8 +1641,8 @@ setTransformation(RootAttributeOperation, RootAttributeOperation, (a, b, context
1641
1641
  return [a];
1642
1642
  });
1643
1643
  // -----------------------
1644
- setTransformation(RootOperation, RootOperation, (a, b, context) => {
1645
- if (a.rootName === b.rootName && a.isAdd === b.isAdd && !context.bWasUndone) {
1644
+ setTransformation(RootOperation, RootOperation, (a, b) => {
1645
+ if (a.rootName === b.rootName && a.isAdd === b.isAdd) {
1646
1646
  return [new NoOperation(0)];
1647
1647
  }
1648
1648
  return [a];
@@ -5,12 +5,12 @@
5
5
  /**
6
6
  * @module engine/model/operation/utils
7
7
  */
8
- import Node from '../node.js';
9
- import Range from '../range.js';
10
- import type DocumentFragment from '../documentfragment.js';
11
- import type Item from '../item.js';
12
- import type NodeList from '../nodelist.js';
13
- import type Position from '../position.js';
8
+ import Node from '../node';
9
+ import Range from '../range';
10
+ import type DocumentFragment from '../documentfragment';
11
+ import type Item from '../item';
12
+ import type NodeList from '../nodelist';
13
+ import type Position from '../position';
14
14
  /**
15
15
  * Inserts given nodes at given position.
16
16
  *
@@ -5,10 +5,10 @@
5
5
  /**
6
6
  * @module engine/model/operation/utils
7
7
  */
8
- import Node from '../node.js';
9
- import Range from '../range.js';
10
- import Text from '../text.js';
11
- import TextProxy from '../textproxy.js';
8
+ import Node from '../node';
9
+ import Range from '../range';
10
+ import Text from '../text';
11
+ import TextProxy from '../textproxy';
12
12
  import { CKEditorError, isIterable } from '@ckeditor/ckeditor5-utils';
13
13
  /**
14
14
  * Inserts given nodes at given position.
@@ -5,20 +5,20 @@
5
5
  /**
6
6
  * @module engine/model/position
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import { type TreeWalkerOptions, type TreeWalkerValue } from './treewalker.js';
10
- import type Document from './document.js';
11
- import type DocumentFragment from './documentfragment.js';
12
- import type Element from './element.js';
13
- import type InsertOperation from './operation/insertoperation.js';
14
- import type Item from './item.js';
15
- import type MergeOperation from './operation/mergeoperation.js';
16
- import type MoveOperation from './operation/moveoperation.js';
17
- import type Node from './node.js';
18
- import type Operation from './operation/operation.js';
19
- import type SplitOperation from './operation/splitoperation.js';
20
- import type Text from './text.js';
21
- import '@ckeditor/ckeditor5-utils/src/version.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import { type TreeWalkerOptions, type TreeWalkerValue } from './treewalker';
10
+ import type Document from './document';
11
+ import type DocumentFragment from './documentfragment';
12
+ import type Element from './element';
13
+ import type InsertOperation from './operation/insertoperation';
14
+ import type Item from './item';
15
+ import type MergeOperation from './operation/mergeoperation';
16
+ import type MoveOperation from './operation/moveoperation';
17
+ import type Node from './node';
18
+ import type Operation from './operation/operation';
19
+ import type SplitOperation from './operation/splitoperation';
20
+ import type Text from './text';
21
+ import '@ckeditor/ckeditor5-utils/src/version';
22
22
  /**
23
23
  * Represents a position in the model tree.
24
24
  *
@@ -5,11 +5,11 @@
5
5
  /**
6
6
  * @module engine/model/position
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import TreeWalker from './treewalker.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import TreeWalker from './treewalker';
10
10
  import { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';
11
11
  // To check if component is loaded more than once.
12
- import '@ckeditor/ckeditor5-utils/src/version.js';
12
+ import '@ckeditor/ckeditor5-utils/src/version';
13
13
  /**
14
14
  * Represents a position in the model tree.
15
15
  *
@@ -5,18 +5,18 @@
5
5
  /**
6
6
  * @module engine/model/range
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import Position from './position.js';
10
- import TreeWalker, { type TreeWalkerOptions, type TreeWalkerValue } from './treewalker.js';
11
- import type Document from './document.js';
12
- import type DocumentFragment from './documentfragment.js';
13
- import type Element from './element.js';
14
- import type InsertOperation from './operation/insertoperation.js';
15
- import type Item from './item.js';
16
- import type MergeOperation from './operation/mergeoperation.js';
17
- import type MoveOperation from './operation/moveoperation.js';
18
- import type Operation from './operation/operation.js';
19
- import type SplitOperation from './operation/splitoperation.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import Position from './position';
10
+ import TreeWalker, { type TreeWalkerOptions, type TreeWalkerValue } from './treewalker';
11
+ import type Document from './document';
12
+ import type DocumentFragment from './documentfragment';
13
+ import type Element from './element';
14
+ import type InsertOperation from './operation/insertoperation';
15
+ import type Item from './item';
16
+ import type MergeOperation from './operation/mergeoperation';
17
+ import type MoveOperation from './operation/moveoperation';
18
+ import type Operation from './operation/operation';
19
+ import type SplitOperation from './operation/splitoperation';
20
20
  /**
21
21
  * Represents a range in the model tree.
22
22
  *
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/range
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import Position from './position.js';
10
- import TreeWalker from './treewalker.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import Position from './position';
10
+ import TreeWalker from './treewalker';
11
11
  import { CKEditorError, compareArrays } from '@ckeditor/ckeditor5-utils';
12
12
  /**
13
13
  * Represents a range in the model tree.
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @module engine/model/rootelement
7
7
  */
8
- import Element from './element.js';
9
- import type Document from './document.js';
8
+ import Element from './element';
9
+ import type Document from './document';
10
10
  /**
11
11
  * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
12
12
  */
@@ -23,6 +23,12 @@ export default class RootElement extends Element {
23
23
  * @internal
24
24
  */
25
25
  _isAttached: boolean;
26
+ /**
27
+ * Informs if the root element is loaded (default).
28
+ *
29
+ * @internal
30
+ */
31
+ _isLoaded: boolean;
26
32
  /**
27
33
  * Creates root element.
28
34
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/model/rootelement
7
7
  */
8
- import Element from './element.js';
8
+ import Element from './element';
9
9
  /**
10
10
  * Type of {@link module:engine/model/element~Element} that is a root of a model tree.
11
11
  */
@@ -23,6 +23,12 @@ export default class RootElement extends Element {
23
23
  * @internal
24
24
  */
25
25
  this._isAttached = true;
26
+ /**
27
+ * Informs if the root element is loaded (default).
28
+ *
29
+ * @internal
30
+ */
31
+ this._isLoaded = true;
26
32
  this._document = document;
27
33
  this.rootName = rootName;
28
34
  }
@@ -5,15 +5,15 @@
5
5
  /**
6
6
  * @module engine/model/schema
7
7
  */
8
- import Element from './element.js';
9
- import Position from './position.js';
10
- import Range from './range.js';
11
- import type DocumentFragment from './documentfragment.js';
12
- import type DocumentSelection from './documentselection.js';
13
- import type Item from './item.js';
14
- import type Node from './node.js';
15
- import type Selection from './selection.js';
16
- import type Writer from './writer.js';
8
+ import Element from './element';
9
+ import Position from './position';
10
+ import Range from './range';
11
+ import type DocumentFragment from './documentfragment';
12
+ import type DocumentSelection from './documentselection';
13
+ import type Item from './item';
14
+ import type Node from './node';
15
+ import type Selection from './selection';
16
+ import type Writer from './writer';
17
17
  declare const Schema_base: {
18
18
  new (): import("@ckeditor/ckeditor5-utils").Observable;
19
19
  prototype: import("@ckeditor/ckeditor5-utils").Observable;
@@ -5,11 +5,11 @@
5
5
  /**
6
6
  * @module engine/model/schema
7
7
  */
8
- import Element from './element.js';
9
- import Position from './position.js';
10
- import Range from './range.js';
11
- import Text from './text.js';
12
- import TreeWalker from './treewalker.js';
8
+ import Element from './element';
9
+ import Position from './position';
10
+ import Range from './range';
11
+ import Text from './text';
12
+ import TreeWalker from './treewalker';
13
13
  import { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';
14
14
  /**
15
15
  * The model's schema. It defines the allowed and disallowed structures of nodes as well as nodes' attributes.
@@ -677,6 +677,11 @@ export default class Schema extends ObservableMixin() {
677
677
  * @returns Nearest selection range or `null` if one cannot be found.
678
678
  */
679
679
  getNearestSelectionRange(position, direction = 'both') {
680
+ if (position.root.rootName == '$graveyard') {
681
+ // No valid selection range in the graveyard.
682
+ // This is important when getting the document selection default range.
683
+ return null;
684
+ }
680
685
  // Return collapsed range if provided position is valid.
681
686
  if (this.checkChild(position, '$text')) {
682
687
  return new Range(position);
@@ -5,13 +5,13 @@
5
5
  /**
6
6
  * @module engine/model/selection
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import Node from './node.js';
10
- import Position, { type PositionOffset } from './position.js';
11
- import Range from './range.js';
12
- import type DocumentSelection from './documentselection.js';
13
- import type Element from './element.js';
14
- import type Item from './item.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import Node from './node';
10
+ import Position, { type PositionOffset } from './position';
11
+ import Range from './range';
12
+ import type DocumentSelection from './documentselection';
13
+ import type Element from './element';
14
+ import type Item from './item';
15
15
  declare const Selection_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
16
16
  /**
17
17
  * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
@@ -5,10 +5,10 @@
5
5
  /**
6
6
  * @module engine/model/selection
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import Node from './node.js';
10
- import Position from './position.js';
11
- import Range from './range.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import Node from './node';
10
+ import Position from './position';
11
+ import Range from './range';
12
12
  import { CKEditorError, EmitterMixin, isIterable } from '@ckeditor/ckeditor5-utils';
13
13
  /**
14
14
  * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/model/text
7
7
  */
8
- import Node, { type NodeAttributes } from './node.js';
8
+ import Node, { type NodeAttributes } from './node';
9
9
  /**
10
10
  * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
11
11
  *
package/src/model/text.js CHANGED
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/model/text
7
7
  */
8
- import Node from './node.js';
8
+ import Node from './node';
9
9
  // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
10
10
  /**
11
11
  * Model text node. Type of {@link module:engine/model/node~Node node} that contains {@link module:engine/model/text~Text#data text data}.
@@ -5,11 +5,11 @@
5
5
  /**
6
6
  * @module engine/model/textproxy
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
9
- import type DocumentFragment from './documentfragment.js';
10
- import type Element from './element.js';
11
- import type Node from './node.js';
12
- import type Text from './text.js';
8
+ import TypeCheckable from './typecheckable';
9
+ import type DocumentFragment from './documentfragment';
10
+ import type Element from './element';
11
+ import type Node from './node';
12
+ import type Text from './text';
13
13
  /**
14
14
  * `TextProxy` represents a part of {@link module:engine/model/text~Text text node}.
15
15
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/model/textproxy
7
7
  */
8
- import TypeCheckable from './typecheckable.js';
8
+ import TypeCheckable from './typecheckable';
9
9
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
10
10
  // @if CK_DEBUG_ENGINE // const { convertMapToStringifiedObject } = require( '../dev-utils/utils' );
11
11
  /**
@@ -2,9 +2,9 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import { default as Position } from './position.js';
6
- import type Item from './item.js';
7
- import type Range from './range.js';
5
+ import { default as Position } from './position';
6
+ import type Item from './item';
7
+ import type Range from './range';
8
8
  /**
9
9
  * Position iterator class. It allows to iterate forward and backward over the document.
10
10
  */
@@ -5,10 +5,10 @@
5
5
  /**
6
6
  * @module engine/model/treewalker
7
7
  */
8
- import Element from './element.js';
9
- import { default as Position, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition } from './position.js';
10
- import Text from './text.js';
11
- import TextProxy from './textproxy.js';
8
+ import Element from './element';
9
+ import { default as Position, getTextNodeAtPosition, getNodeAfterPosition, getNodeBeforePosition } from './position';
10
+ import Text from './text';
11
+ import TextProxy from './textproxy';
12
12
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
13
13
  /**
14
14
  * Position iterator class. It allows to iterate forward and backward over the document.
@@ -5,19 +5,19 @@
5
5
  /**
6
6
  * @module engine/model/typecheckable
7
7
  */
8
- import type { Marker } from './markercollection.js';
9
- import type DocumentFragment from './documentfragment.js';
10
- import type DocumentSelection from './documentselection.js';
11
- import type Element from './element.js';
12
- import type LivePosition from './liveposition.js';
13
- import type LiveRange from './liverange.js';
14
- import type Node from './node.js';
15
- import type Position from './position.js';
16
- import type Range from './range.js';
17
- import type RootElement from './rootelement.js';
18
- import type Selection from './selection.js';
19
- import type Text from './text.js';
20
- import type TextProxy from './textproxy.js';
8
+ import type { Marker } from './markercollection';
9
+ import type DocumentFragment from './documentfragment';
10
+ import type DocumentSelection from './documentselection';
11
+ import type Element from './element';
12
+ import type LivePosition from './liveposition';
13
+ import type LiveRange from './liverange';
14
+ import type Node from './node';
15
+ import type Position from './position';
16
+ import type Range from './range';
17
+ import type RootElement from './rootelement';
18
+ import type Selection from './selection';
19
+ import type Text from './text';
20
+ import type TextProxy from './textproxy';
21
21
  export default abstract class TypeCheckable {
22
22
  /**
23
23
  * Checks whether the object is of type {@link module:engine/model/node~Node} or its subclass.
@@ -2,10 +2,10 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type Node from '../node.js';
6
- import type Position from '../position.js';
7
- import type Schema from '../schema.js';
8
- import type Writer from '../writer.js';
5
+ import type Node from '../node';
6
+ import type Position from '../position';
7
+ import type Schema from '../schema';
8
+ import type Writer from '../writer';
9
9
  /**
10
10
  * @module engine/model/utils/autoparagraphing
11
11
  */
@@ -14,8 +14,7 @@
14
14
  */
15
15
  export function autoParagraphEmptyRoots(writer) {
16
16
  const { schema, document } = writer.model;
17
- for (const rootName of document.getRootNames()) {
18
- const root = document.getRoot(rootName);
17
+ for (const root of document.getRoots()) {
19
18
  if (root.isEmpty && !schema.checkChild(root, '$text')) {
20
19
  // If paragraph element is allowed in the root, create paragraph element.
21
20
  if (schema.checkChild(root, 'paragraph')) {
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/utils/deletecontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import type Model from '../model.js';
10
- import type Selection from '../selection.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import type Model from '../model';
10
+ import type Selection from '../selection';
11
11
  /**
12
12
  * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
13
13
  *
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/utils/deletecontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import LivePosition from '../liveposition.js';
10
- import Range from '../range.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import LivePosition from '../liveposition';
10
+ import Range from '../range';
11
11
  /**
12
12
  * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.
13
13
  *
@@ -2,10 +2,10 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type DocumentSelection from '../documentselection.js';
6
- import type Model from '../model.js';
7
- import type Range from '../range.js';
8
- import type Selection from '../selection.js';
5
+ import type DocumentSelection from '../documentselection';
6
+ import type Model from '../model';
7
+ import type Range from '../range';
8
+ import type Selection from '../selection';
9
9
  /**
10
10
  * Returns a model range which is optimal (in terms of UX) for inserting a widget block.
11
11
  *
@@ -2,10 +2,10 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type DocumentFragment from '../documentfragment.js';
6
- import type DocumentSelection from '../documentselection.js';
7
- import type Model from '../model.js';
8
- import type Selection from '../selection.js';
5
+ import type DocumentFragment from '../documentfragment';
6
+ import type DocumentSelection from '../documentselection';
7
+ import type Model from '../model';
8
+ import type Selection from '../selection';
9
9
  /**
10
10
  * @module engine/model/utils/getselectedcontent
11
11
  */
@@ -5,12 +5,12 @@
5
5
  /**
6
6
  * @module engine/model/utils/insertcontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import Range from '../range.js';
10
- import type DocumentFragment from '../documentfragment.js';
11
- import type Item from '../item.js';
12
- import type Model from '../model.js';
13
- import type Selection from '../selection.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import Range from '../range';
10
+ import type DocumentFragment from '../documentfragment';
11
+ import type Item from '../item';
12
+ import type Model from '../model';
13
+ import type Selection from '../selection';
14
14
  /**
15
15
  * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
16
16
  *
@@ -5,12 +5,12 @@
5
5
  /**
6
6
  * @module engine/model/utils/insertcontent
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import Element from '../element.js';
10
- import LivePosition from '../liveposition.js';
11
- import LiveRange from '../liverange.js';
12
- import Position from '../position.js';
13
- import Range from '../range.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import Element from '../element';
10
+ import LivePosition from '../liveposition';
11
+ import LiveRange from '../liverange';
12
+ import Position from '../position';
13
+ import Range from '../range';
14
14
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
15
15
  /**
16
16
  * Inserts content into the editor (specified selection) as one would expect the paste functionality to work.
@@ -2,11 +2,11 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type DocumentSelection from '../documentselection.js';
6
- import type Selection from '../selection.js';
7
- import type Element from '../element.js';
8
- import type Model from '../model.js';
9
- import type Range from '../range.js';
5
+ import type DocumentSelection from '../documentselection';
6
+ import type Selection from '../selection';
7
+ import type Element from '../element';
8
+ import type Model from '../model';
9
+ import type Range from '../range';
10
10
  /**
11
11
  * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.
12
12
  *
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * @module engine/model/utils/insertobject
7
7
  */
8
- import { findOptimalInsertionRange } from './findoptimalinsertionrange.js';
8
+ import { findOptimalInsertionRange } from './findoptimalinsertionrange';
9
9
  import { CKEditorError, first } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * Inserts an {@glink framework/deep-dive/schema#object-elements object element} at a specific position in the editor content.
@@ -5,9 +5,9 @@
5
5
  /**
6
6
  * @module engine/model/utils/modifyselection
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import type Model from '../model.js';
10
- import type Selection from '../selection.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import type Model from '../model';
10
+ import type Selection from '../selection';
11
11
  /**
12
12
  * Modifies the selection. Currently, the supported modifications are:
13
13
  *
@@ -5,10 +5,10 @@
5
5
  /**
6
6
  * @module engine/model/utils/modifyselection
7
7
  */
8
- import DocumentSelection from '../documentselection.js';
9
- import Position from '../position.js';
10
- import Range from '../range.js';
11
- import TreeWalker from '../treewalker.js';
8
+ import DocumentSelection from '../documentselection';
9
+ import Position from '../position';
10
+ import Range from '../range';
11
+ import TreeWalker from '../treewalker';
12
12
  import { isInsideSurrogatePair, isInsideCombinedSymbol, isInsideEmojiSequence } from '@ckeditor/ckeditor5-utils';
13
13
  const wordBoundaryCharacters = ' ,.?!:;"-()';
14
14
  /**
@@ -2,9 +2,9 @@
2
2
  * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import Range from '../range.js';
6
- import type Model from '../model.js';
7
- import type Schema from '../schema.js';
5
+ import Range from '../range';
6
+ import type Model from '../model';
7
+ import type Schema from '../schema';
8
8
  /**
9
9
  * Injects selection post-fixer to the model.
10
10
  *