@ckeditor/ckeditor5-engine 41.3.0-alpha.3 → 41.3.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.
Files changed (132) hide show
  1. package/package.json +2 -3
  2. package/src/model/node.d.ts +1 -0
  3. package/src/model/node.js +2 -0
  4. package/src/model/position.d.ts +1 -0
  5. package/src/model/position.js +2 -0
  6. package/src/view/node.d.ts +1 -0
  7. package/src/view/node.js +2 -0
  8. package/src/view/position.d.ts +1 -0
  9. package/src/view/position.js +2 -0
  10. package/dist/content-index.css +0 -4
  11. package/dist/editor-index.css +0 -23
  12. package/dist/index.css +0 -49
  13. package/dist/index.css.map +0 -1
  14. package/dist/types/controller/datacontroller.d.ts +0 -339
  15. package/dist/types/controller/editingcontroller.d.ts +0 -102
  16. package/dist/types/conversion/conversion.d.ts +0 -482
  17. package/dist/types/conversion/conversionhelpers.d.ts +0 -30
  18. package/dist/types/conversion/downcastdispatcher.d.ts +0 -566
  19. package/dist/types/conversion/downcasthelpers.d.ts +0 -1194
  20. package/dist/types/conversion/mapper.d.ts +0 -507
  21. package/dist/types/conversion/modelconsumable.d.ts +0 -205
  22. package/dist/types/conversion/upcastdispatcher.d.ts +0 -496
  23. package/dist/types/conversion/upcasthelpers.d.ts +0 -503
  24. package/dist/types/conversion/viewconsumable.d.ts +0 -373
  25. package/dist/types/dataprocessor/basichtmlwriter.d.ts +0 -22
  26. package/dist/types/dataprocessor/dataprocessor.d.ts +0 -65
  27. package/dist/types/dataprocessor/htmldataprocessor.d.ts +0 -80
  28. package/dist/types/dataprocessor/htmlwriter.d.ts +0 -20
  29. package/dist/types/dataprocessor/xmldataprocessor.d.ts +0 -94
  30. package/dist/types/dev-utils/model.d.ts +0 -128
  31. package/dist/types/dev-utils/operationreplayer.d.ts +0 -55
  32. package/dist/types/dev-utils/utils.d.ts +0 -41
  33. package/dist/types/dev-utils/view.d.ts +0 -323
  34. package/dist/types/index.d.ts +0 -117
  35. package/dist/types/model/batch.d.ts +0 -110
  36. package/dist/types/model/differ.d.ts +0 -419
  37. package/dist/types/model/document.d.ts +0 -278
  38. package/dist/types/model/documentfragment.d.ts +0 -204
  39. package/dist/types/model/documentselection.d.ts +0 -424
  40. package/dist/types/model/element.d.ts +0 -169
  41. package/dist/types/model/history.d.ts +0 -118
  42. package/dist/types/model/item.d.ts +0 -18
  43. package/dist/types/model/liveposition.d.ts +0 -81
  44. package/dist/types/model/liverange.d.ts +0 -106
  45. package/dist/types/model/markercollection.d.ts +0 -339
  46. package/dist/types/model/model.d.ts +0 -923
  47. package/dist/types/model/node.d.ts +0 -259
  48. package/dist/types/model/nodelist.d.ts +0 -95
  49. package/dist/types/model/operation/attributeoperation.d.ts +0 -107
  50. package/dist/types/model/operation/detachoperation.d.ts +0 -64
  51. package/dist/types/model/operation/insertoperation.d.ts +0 -94
  52. package/dist/types/model/operation/markeroperation.d.ts +0 -95
  53. package/dist/types/model/operation/mergeoperation.d.ts +0 -104
  54. package/dist/types/model/operation/moveoperation.d.ts +0 -100
  55. package/dist/types/model/operation/nooperation.d.ts +0 -42
  56. package/dist/types/model/operation/operation.d.ts +0 -100
  57. package/dist/types/model/operation/operationfactory.d.ts +0 -22
  58. package/dist/types/model/operation/renameoperation.d.ts +0 -87
  59. package/dist/types/model/operation/rootattributeoperation.d.ts +0 -102
  60. package/dist/types/model/operation/rootoperation.d.ts +0 -80
  61. package/dist/types/model/operation/splitoperation.d.ts +0 -113
  62. package/dist/types/model/operation/transform.d.ts +0 -104
  63. package/dist/types/model/operation/utils.d.ts +0 -75
  64. package/dist/types/model/position.d.ts +0 -542
  65. package/dist/types/model/range.d.ts +0 -462
  66. package/dist/types/model/rootelement.d.ts +0 -64
  67. package/dist/types/model/schema.d.ts +0 -1210
  68. package/dist/types/model/selection.d.ts +0 -486
  69. package/dist/types/model/text.d.ts +0 -70
  70. package/dist/types/model/textproxy.d.ts +0 -148
  71. package/dist/types/model/treewalker.d.ts +0 -190
  72. package/dist/types/model/typecheckable.d.ts +0 -289
  73. package/dist/types/model/utils/autoparagraphing.d.ts +0 -41
  74. package/dist/types/model/utils/deletecontent.d.ts +0 -62
  75. package/dist/types/model/utils/getselectedcontent.d.ts +0 -34
  76. package/dist/types/model/utils/insertcontent.d.ts +0 -50
  77. package/dist/types/model/utils/insertobject.d.ts +0 -51
  78. package/dist/types/model/utils/modifyselection.d.ts +0 -52
  79. package/dist/types/model/utils/selection-post-fixer.d.ts +0 -78
  80. package/dist/types/model/writer.d.ts +0 -855
  81. package/dist/types/view/attributeelement.d.ts +0 -112
  82. package/dist/types/view/containerelement.d.ts +0 -53
  83. package/dist/types/view/datatransfer.d.ts +0 -83
  84. package/dist/types/view/document.d.ts +0 -188
  85. package/dist/types/view/documentfragment.d.ts +0 -157
  86. package/dist/types/view/documentselection.d.ts +0 -310
  87. package/dist/types/view/domconverter.d.ts +0 -656
  88. package/dist/types/view/downcastwriter.d.ts +0 -1000
  89. package/dist/types/view/editableelement.d.ts +0 -66
  90. package/dist/types/view/element.d.ts +0 -472
  91. package/dist/types/view/elementdefinition.d.ts +0 -91
  92. package/dist/types/view/emptyelement.d.ts +0 -45
  93. package/dist/types/view/filler.d.ts +0 -115
  94. package/dist/types/view/item.d.ts +0 -18
  95. package/dist/types/view/matcher.d.ts +0 -490
  96. package/dist/types/view/node.d.ts +0 -166
  97. package/dist/types/view/observer/arrowkeysobserver.d.ts +0 -49
  98. package/dist/types/view/observer/bubblingemittermixin.d.ts +0 -170
  99. package/dist/types/view/observer/bubblingeventinfo.d.ts +0 -51
  100. package/dist/types/view/observer/clickobserver.d.ts +0 -47
  101. package/dist/types/view/observer/compositionobserver.d.ts +0 -86
  102. package/dist/types/view/observer/domeventdata.d.ts +0 -54
  103. package/dist/types/view/observer/domeventobserver.d.ts +0 -77
  104. package/dist/types/view/observer/fakeselectionobserver.d.ts +0 -51
  105. package/dist/types/view/observer/focusobserver.d.ts +0 -86
  106. package/dist/types/view/observer/inputobserver.d.ts +0 -90
  107. package/dist/types/view/observer/keyobserver.d.ts +0 -70
  108. package/dist/types/view/observer/mouseobserver.d.ts +0 -93
  109. package/dist/types/view/observer/mutationobserver.d.ts +0 -90
  110. package/dist/types/view/observer/observer.d.ts +0 -93
  111. package/dist/types/view/observer/selectionobserver.d.ts +0 -152
  112. package/dist/types/view/observer/tabobserver.d.ts +0 -50
  113. package/dist/types/view/placeholder.d.ts +0 -100
  114. package/dist/types/view/position.d.ts +0 -192
  115. package/dist/types/view/range.d.ts +0 -283
  116. package/dist/types/view/rawelement.d.ts +0 -77
  117. package/dist/types/view/renderer.d.ts +0 -269
  118. package/dist/types/view/rooteditableelement.d.ts +0 -45
  119. package/dist/types/view/selection.d.ts +0 -379
  120. package/dist/types/view/styles/background.d.ts +0 -37
  121. package/dist/types/view/styles/border.d.ts +0 -47
  122. package/dist/types/view/styles/margin.d.ts +0 -33
  123. package/dist/types/view/styles/padding.d.ts +0 -33
  124. package/dist/types/view/styles/utils.d.ts +0 -97
  125. package/dist/types/view/stylesmap.d.ts +0 -677
  126. package/dist/types/view/text.d.ts +0 -78
  127. package/dist/types/view/textproxy.d.ts +0 -101
  128. package/dist/types/view/treewalker.d.ts +0 -199
  129. package/dist/types/view/typecheckable.d.ts +0 -452
  130. package/dist/types/view/uielement.d.ts +0 -100
  131. package/dist/types/view/upcastwriter.d.ts +0 -421
  132. package/dist/types/view/view.d.ts +0 -491
@@ -1,310 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module engine/view/documentselection
11
- */
12
- import TypeCheckable from './typecheckable.js';
13
- import Selection, { type PlaceOrOffset, type Selectable, type SelectionOptions, type ViewSelectionChangeEvent } from './selection.js';
14
- import type EditableElement from './editableelement.js';
15
- import type Element from './element.js';
16
- import type Node from './node.js';
17
- import type Item from './item.js';
18
- import type { default as Position, PositionOffset } from './position.js';
19
- import type Range from './range.js';
20
- declare const DocumentSelection_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof TypeCheckable, import("@ckeditor/ckeditor5-utils").Emitter>;
21
- /**
22
- * Class representing the document selection in the view.
23
- *
24
- * Its instance is available in {@link module:engine/view/document~Document#selection `Document#selection`}.
25
- *
26
- * It is similar to {@link module:engine/view/selection~Selection} but
27
- * it has a read-only API and can be modified only by the writer available in
28
- * the {@link module:engine/view/view~View#change `View#change()`} block
29
- * (so via {@link module:engine/view/downcastwriter~DowncastWriter#setSelection `DowncastWriter#setSelection()`}).
30
- */
31
- export default class DocumentSelection extends DocumentSelection_base {
32
- /**
33
- * Selection is used internally (`DocumentSelection` is a proxy to that selection).
34
- */
35
- private readonly _selection;
36
- /**
37
- * Creates new DocumentSelection instance.
38
- *
39
- * ```ts
40
- * // Creates collapsed selection at the position of given item and offset.
41
- * const paragraph = writer.createContainerElement( 'paragraph' );
42
- * const selection = new DocumentSelection( paragraph, offset );
43
- *
44
- * // Creates a range inside an {@link module:engine/view/element~Element element} which starts before the
45
- * // first child of that element and ends after the last child of that element.
46
- * const selection = new DocumentSelection( paragraph, 'in' );
47
- *
48
- * // Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends
49
- * // just after the item.
50
- * const selection = new DocumentSelection( paragraph, 'on' );
51
- * ```
52
- *
53
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
54
- *
55
- * ```ts
56
- * // Creates backward selection.
57
- * const selection = new DocumentSelection( element, 'in', { backward: true } );
58
- * ```
59
- *
60
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
61
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
62
- * represented in other way, for example by applying proper CSS class.
63
- *
64
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
65
- * (and be properly handled by screen readers).
66
- *
67
- * ```ts
68
- * // Creates fake selection with label.
69
- * const selection = new DocumentSelection( element, 'in', { fake: true, label: 'foo' } );
70
- * ```
71
- *
72
- * See also: {@link #constructor:SELECTABLE `constructor( selectable, options )`}.
73
- *
74
- * @label NODE_OFFSET
75
- */
76
- constructor(selectable: Node, placeOrOffset: PlaceOrOffset, options?: SelectionOptions);
77
- /**
78
- * Creates new DocumentSelection instance.
79
- *
80
- * ```ts
81
- * // Creates empty selection without ranges.
82
- * const selection = new DocumentSelection();
83
- *
84
- * // Creates selection at the given range.
85
- * const range = writer.createRange( start, end );
86
- * const selection = new DocumentSelection( range );
87
- *
88
- * // Creates selection at the given ranges
89
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
90
- * const selection = new DocumentSelection( ranges );
91
- *
92
- * // Creates selection from the other selection.
93
- * const otherSelection = writer.createSelection();
94
- * const selection = new DocumentSelection( otherSelection );
95
- *
96
- * // Creates selection at the given position.
97
- * const position = writer.createPositionAt( root, offset );
98
- * const selection = new DocumentSelection( position );
99
- * ```
100
- *
101
- * `Selection`'s constructor allow passing additional options (`backward`, `fake` and `label`) as the last argument.
102
- *
103
- * ```ts
104
- * // Creates backward selection.
105
- * const selection = new DocumentSelection( range, { backward: true } );
106
- * ```
107
- *
108
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
109
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
110
- * represented in other way, for example by applying proper CSS class.
111
- *
112
- * Additionally fake's selection label can be provided. It will be used to describe fake selection in DOM
113
- * (and be properly handled by screen readers).
114
- *
115
- * ```ts
116
- * // Creates fake selection with label.
117
- * const selection = new DocumentSelection( range, { fake: true, label: 'foo' } );
118
- * ```
119
- *
120
- * See also: {@link #constructor:NODE_OFFSET `constructor( node, placeOrOffset, options )`}.
121
- *
122
- * @label SELECTABLE
123
- */
124
- constructor(selectable?: Exclude<Selectable, Node>, options?: SelectionOptions);
125
- /**
126
- * Returns true if selection instance is marked as `fake`.
127
- *
128
- * @see #_setTo
129
- */
130
- get isFake(): boolean;
131
- /**
132
- * Returns fake selection label.
133
- *
134
- * @see #_setTo
135
- */
136
- get fakeSelectionLabel(): string;
137
- /**
138
- * Selection anchor. Anchor may be described as a position where the selection starts. Together with
139
- * {@link #focus focus} they define the direction of selection, which is important
140
- * when expanding/shrinking selection. Anchor is always the start or end of the most recent added range.
141
- * It may be a bit unintuitive when there are multiple ranges in selection.
142
- *
143
- * @see #focus
144
- */
145
- get anchor(): Position | null;
146
- /**
147
- * Selection focus. Focus is a position where the selection ends.
148
- *
149
- * @see #anchor
150
- */
151
- get focus(): Position | null;
152
- /**
153
- * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is
154
- * collapsed.
155
- */
156
- get isCollapsed(): boolean;
157
- /**
158
- * Returns number of ranges in selection.
159
- */
160
- get rangeCount(): number;
161
- /**
162
- * Specifies whether the {@link #focus} precedes {@link #anchor}.
163
- */
164
- get isBackward(): boolean;
165
- /**
166
- * {@link module:engine/view/editableelement~EditableElement EditableElement} instance that contains this selection, or `null`
167
- * if the selection is not inside an editable element.
168
- */
169
- get editableElement(): EditableElement | null;
170
- /**
171
- * Used for the compatibility with the {@link module:engine/view/selection~Selection#isEqual} method.
172
- *
173
- * @internal
174
- */
175
- get _ranges(): Array<Range>;
176
- /**
177
- * Returns an iterable that contains copies of all ranges added to the selection.
178
- */
179
- getRanges(): IterableIterator<Range>;
180
- /**
181
- * Returns copy of the first range in the selection. First range is the one which
182
- * {@link module:engine/view/range~Range#start start} position {@link module:engine/view/position~Position#isBefore is before} start
183
- * position of all other ranges (not to confuse with the first range added to the selection).
184
- * Returns `null` if no ranges are added to selection.
185
- */
186
- getFirstRange(): Range | null;
187
- /**
188
- * Returns copy of the last range in the selection. Last range is the one which {@link module:engine/view/range~Range#end end}
189
- * position {@link module:engine/view/position~Position#isAfter is after} end position of all other ranges (not to confuse
190
- * with the last range added to the selection). Returns `null` if no ranges are added to selection.
191
- */
192
- getLastRange(): Range | null;
193
- /**
194
- * Returns copy of the first position in the selection. First position is the position that
195
- * {@link module:engine/view/position~Position#isBefore is before} any other position in the selection ranges.
196
- * Returns `null` if no ranges are added to selection.
197
- */
198
- getFirstPosition(): Position | null;
199
- /**
200
- * Returns copy of the last position in the selection. Last position is the position that
201
- * {@link module:engine/view/position~Position#isAfter is after} any other position in the selection ranges.
202
- * Returns `null` if no ranges are added to selection.
203
- */
204
- getLastPosition(): Position | null;
205
- /**
206
- * Returns the selected element. {@link module:engine/view/element~Element Element} is considered as selected if there is only
207
- * one range in the selection, and that range contains exactly one element.
208
- * Returns `null` if there is no selected element.
209
- */
210
- getSelectedElement(): Element | null;
211
- /**
212
- * Checks whether, this selection is equal to given selection. Selections are equal if they have same directions,
213
- * same number of ranges and all ranges from one selection equal to a range from other selection.
214
- *
215
- * @param otherSelection Selection to compare with.
216
- * @returns `true` if selections are equal, `false` otherwise.
217
- */
218
- isEqual(otherSelection: Selection | DocumentSelection): boolean;
219
- /**
220
- * Checks whether this selection is similar to given selection. Selections are similar if they have same directions, same
221
- * number of ranges, and all {@link module:engine/view/range~Range#getTrimmed trimmed} ranges from one selection are
222
- * equal to any trimmed range from other selection.
223
- *
224
- * @param otherSelection Selection to compare with.
225
- * @returns `true` if selections are similar, `false` otherwise.
226
- */
227
- isSimilar(otherSelection: Selection | DocumentSelection): boolean;
228
- /**
229
- * Sets this selection's ranges and direction to the specified location based on the given
230
- * {@link module:engine/view/selection~Selectable selectable}.
231
- *
232
- * ```ts
233
- * // Sets selection to the given range.
234
- * const range = writer.createRange( start, end );
235
- * documentSelection._setTo( range );
236
- *
237
- * // Sets selection to given ranges.
238
- * const ranges = [ writer.createRange( start1, end2 ), writer.createRange( start2, end2 ) ];
239
- * documentSelection._setTo( range );
240
- *
241
- * // Sets selection to the other selection.
242
- * const otherSelection = writer.createSelection();
243
- * documentSelection._setTo( otherSelection );
244
- *
245
- * // Sets collapsed selection at the given position.
246
- * const position = writer.createPositionAt( root, offset );
247
- * documentSelection._setTo( position );
248
- *
249
- * // Sets collapsed selection at the position of given item and offset.
250
- * documentSelection._setTo( paragraph, offset );
251
- * ```
252
- *
253
- * Creates a range inside an {@link module:engine/view/element~Element element} which starts before the first child of
254
- * that element and ends after the last child of that element.
255
- *
256
- * ```ts
257
- * documentSelection._setTo( paragraph, 'in' );
258
- * ```
259
- *
260
- * Creates a range on an {@link module:engine/view/item~Item item} which starts before the item and ends just after the item.
261
- *
262
- * ```ts
263
- * documentSelection._setTo( paragraph, 'on' );
264
- *
265
- * // Clears selection. Removes all ranges.
266
- * documentSelection._setTo( null );
267
- * ```
268
- *
269
- * `Selection#_setTo()` method allow passing additional options (`backward`, `fake` and `label`) as the last argument.
270
- *
271
- * ```ts
272
- * // Sets selection as backward.
273
- * documentSelection._setTo( range, { backward: true } );
274
- * ```
275
- *
276
- * Fake selection does not render as browser native selection over selected elements and is hidden to the user.
277
- * This way, no native selection UI artifacts are displayed to the user and selection over elements can be
278
- * represented in other way, for example by applying proper CSS class.
279
- *
280
- * Additionally fake's selection label can be provided. It will be used to des cribe fake selection in DOM
281
- * (and be properly handled by screen readers).
282
- *
283
- * ```ts
284
- * // Creates fake selection with label.
285
- * documentSelection._setTo( range, { fake: true, label: 'foo' } );
286
- * ```
287
- *
288
- * @internal
289
- * @fires change
290
- */
291
- _setTo(...args: Parameters<Selection['setTo']>): void;
292
- /**
293
- * Moves {@link #focus} to the specified location.
294
- *
295
- * The location can be specified in the same form as {@link module:engine/view/view~View#createPositionAt view.createPositionAt()}
296
- * parameters.
297
- *
298
- * @internal
299
- * @fires change
300
- * @param offset Offset or one of the flags. Used only when first parameter is a {@link module:engine/view/item~Item view item}.
301
- */
302
- _setFocus(itemOrPosition: Item | Position, offset?: PositionOffset): void;
303
- }
304
- /**
305
- * Fired whenever selection ranges are changed through {@link ~DocumentSelection Selection API}.
306
- *
307
- * @eventName ~DocumentSelection#change
308
- */
309
- export type ViewDocumentSelectionChangeEvent = ViewSelectionChangeEvent;
310
- export {};