@ckeditor/ckeditor5-engine 45.2.1-alpha.9 → 46.0.0-alpha.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 (241) hide show
  1. package/dist/index.js +2563 -2257
  2. package/dist/index.js.map +1 -1
  3. package/package.json +3 -3
  4. package/src/controller/datacontroller.d.ts +33 -32
  5. package/src/controller/datacontroller.js +29 -28
  6. package/src/controller/editingcontroller.d.ts +8 -8
  7. package/src/controller/editingcontroller.js +10 -10
  8. package/src/conversion/conversion.d.ts +18 -19
  9. package/src/conversion/conversion.js +4 -4
  10. package/src/conversion/conversionhelpers.d.ts +1 -1
  11. package/src/conversion/conversionhelpers.js +1 -1
  12. package/src/conversion/downcastdispatcher.d.ts +63 -69
  13. package/src/conversion/downcastdispatcher.js +16 -16
  14. package/src/conversion/downcasthelpers.d.ts +94 -83
  15. package/src/conversion/downcasthelpers.js +63 -53
  16. package/src/conversion/mapper.d.ts +27 -27
  17. package/src/conversion/mapper.js +15 -15
  18. package/src/conversion/modelconsumable.d.ts +26 -26
  19. package/src/conversion/modelconsumable.js +23 -23
  20. package/src/conversion/upcastdispatcher.d.ts +33 -32
  21. package/src/conversion/upcastdispatcher.js +19 -19
  22. package/src/conversion/upcasthelpers.d.ts +46 -38
  23. package/src/conversion/upcasthelpers.js +33 -24
  24. package/src/conversion/viewconsumable.d.ts +50 -45
  25. package/src/conversion/viewconsumable.js +32 -27
  26. package/src/dataprocessor/basichtmlwriter.d.ts +4 -2
  27. package/src/dataprocessor/basichtmlwriter.js +3 -1
  28. package/src/dataprocessor/dataprocessor.d.ts +7 -6
  29. package/src/dataprocessor/htmldataprocessor.d.ts +10 -10
  30. package/src/dataprocessor/htmldataprocessor.js +6 -6
  31. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  32. package/src/dataprocessor/xmldataprocessor.d.ts +10 -10
  33. package/src/dataprocessor/xmldataprocessor.js +6 -6
  34. package/src/dev-utils/model.d.ts +25 -26
  35. package/src/dev-utils/model.js +35 -36
  36. package/src/dev-utils/operationreplayer.d.ts +5 -3
  37. package/src/dev-utils/operationreplayer.js +4 -2
  38. package/src/dev-utils/utils.d.ts +8 -0
  39. package/src/dev-utils/utils.js +8 -0
  40. package/src/dev-utils/view.d.ts +66 -63
  41. package/src/dev-utils/view.js +144 -134
  42. package/src/index.d.ts +135 -106
  43. package/src/index.js +120 -71
  44. package/src/legacyerrors.d.ts +5 -0
  45. package/src/legacyerrors.js +17 -0
  46. package/src/model/batch.d.ts +2 -15
  47. package/src/model/batch.js +1 -23
  48. package/src/model/differ.d.ts +54 -31
  49. package/src/model/differ.js +15 -15
  50. package/src/model/document.d.ts +31 -31
  51. package/src/model/document.js +13 -13
  52. package/src/model/documentfragment.d.ts +45 -45
  53. package/src/model/documentfragment.js +40 -40
  54. package/src/model/documentselection.d.ts +92 -92
  55. package/src/model/documentselection.js +71 -70
  56. package/src/model/element.d.ts +31 -31
  57. package/src/model/element.js +29 -29
  58. package/src/model/history.d.ts +3 -3
  59. package/src/model/history.js +2 -2
  60. package/src/model/item.d.ts +4 -5
  61. package/src/model/liveposition.d.ts +31 -31
  62. package/src/model/liveposition.js +18 -18
  63. package/src/model/liverange.d.ts +42 -38
  64. package/src/model/liverange.js +17 -16
  65. package/src/model/markercollection.d.ts +41 -40
  66. package/src/model/markercollection.js +22 -20
  67. package/src/model/model.d.ts +82 -81
  68. package/src/model/model.js +54 -54
  69. package/src/model/node.d.ts +48 -48
  70. package/src/model/node.js +31 -31
  71. package/src/model/nodelist.d.ts +17 -17
  72. package/src/model/nodelist.js +11 -11
  73. package/src/model/operation/attributeoperation.d.ts +10 -10
  74. package/src/model/operation/attributeoperation.js +7 -7
  75. package/src/model/operation/detachoperation.d.ts +11 -9
  76. package/src/model/operation/detachoperation.js +8 -6
  77. package/src/model/operation/insertoperation.d.ts +13 -13
  78. package/src/model/operation/insertoperation.js +15 -15
  79. package/src/model/operation/markeroperation.d.ts +12 -12
  80. package/src/model/operation/markeroperation.js +5 -5
  81. package/src/model/operation/mergeoperation.d.ts +16 -16
  82. package/src/model/operation/mergeoperation.js +18 -18
  83. package/src/model/operation/moveoperation.d.ts +16 -16
  84. package/src/model/operation/moveoperation.js +18 -15
  85. package/src/model/operation/nooperation.d.ts +4 -4
  86. package/src/model/operation/nooperation.js +2 -2
  87. package/src/model/operation/operation.d.ts +10 -10
  88. package/src/model/operation/operation.js +5 -5
  89. package/src/model/operation/operationfactory.d.ts +4 -4
  90. package/src/model/operation/operationfactory.js +12 -12
  91. package/src/model/operation/renameoperation.d.ts +10 -10
  92. package/src/model/operation/renameoperation.js +7 -7
  93. package/src/model/operation/rootattributeoperation.d.ts +12 -12
  94. package/src/model/operation/rootattributeoperation.js +8 -8
  95. package/src/model/operation/rootoperation.d.ts +8 -8
  96. package/src/model/operation/rootoperation.js +3 -3
  97. package/src/model/operation/splitoperation.d.ts +17 -17
  98. package/src/model/operation/splitoperation.js +19 -19
  99. package/src/model/operation/transform.d.ts +11 -8
  100. package/src/model/operation/transform.js +66 -49
  101. package/src/model/operation/utils.d.ts +24 -23
  102. package/src/model/operation/utils.js +20 -20
  103. package/src/model/position.d.ts +101 -97
  104. package/src/model/position.js +69 -64
  105. package/src/model/range.d.ts +90 -90
  106. package/src/model/range.js +87 -87
  107. package/src/model/rootelement.d.ts +11 -11
  108. package/src/model/rootelement.js +9 -9
  109. package/src/model/schema.d.ts +158 -154
  110. package/src/model/schema.js +93 -90
  111. package/src/model/selection.d.ts +73 -73
  112. package/src/model/selection.js +62 -62
  113. package/src/model/text.d.ts +11 -10
  114. package/src/model/text.js +11 -10
  115. package/src/model/textproxy.d.ts +39 -38
  116. package/src/model/textproxy.js +31 -30
  117. package/src/model/treewalker.d.ts +37 -37
  118. package/src/model/treewalker.js +14 -14
  119. package/src/model/typecheckable.d.ts +45 -45
  120. package/src/model/typecheckable.js +1 -1
  121. package/src/model/utils/autoparagraphing.d.ts +7 -7
  122. package/src/model/utils/deletecontent.d.ts +7 -5
  123. package/src/model/utils/deletecontent.js +13 -11
  124. package/src/model/utils/getselectedcontent.d.ts +6 -5
  125. package/src/model/utils/getselectedcontent.js +2 -1
  126. package/src/model/utils/insertcontent.d.ts +9 -8
  127. package/src/model/utils/insertcontent.js +41 -40
  128. package/src/model/utils/insertobject.d.ts +9 -9
  129. package/src/model/utils/insertobject.js +4 -4
  130. package/src/model/utils/modifyselection.d.ts +5 -4
  131. package/src/model/utils/modifyselection.js +12 -11
  132. package/src/model/utils/selection-post-fixer.d.ts +12 -8
  133. package/src/model/utils/selection-post-fixer.js +15 -11
  134. package/src/model/writer.d.ts +102 -101
  135. package/src/model/writer.js +99 -98
  136. package/src/view/attributeelement.d.ts +29 -29
  137. package/src/view/attributeelement.js +25 -25
  138. package/src/view/containerelement.d.ts +16 -15
  139. package/src/view/containerelement.js +15 -14
  140. package/src/view/datatransfer.d.ts +7 -7
  141. package/src/view/datatransfer.js +1 -1
  142. package/src/view/document.d.ts +25 -25
  143. package/src/view/document.js +15 -15
  144. package/src/view/documentfragment.d.ts +21 -21
  145. package/src/view/documentfragment.js +14 -14
  146. package/src/view/documentselection.d.ts +65 -63
  147. package/src/view/documentselection.js +27 -25
  148. package/src/view/domconverter.d.ts +94 -89
  149. package/src/view/domconverter.js +78 -73
  150. package/src/view/downcastwriter.d.ts +185 -181
  151. package/src/view/downcastwriter.js +222 -210
  152. package/src/view/editableelement.d.ts +13 -13
  153. package/src/view/editableelement.js +8 -8
  154. package/src/view/element.d.ts +75 -74
  155. package/src/view/element.js +58 -58
  156. package/src/view/elementdefinition.d.ts +3 -4
  157. package/src/view/emptyelement.d.ts +13 -13
  158. package/src/view/emptyelement.js +13 -13
  159. package/src/view/filler.d.ts +14 -3
  160. package/src/view/filler.js +12 -1
  161. package/src/view/item.d.ts +4 -5
  162. package/src/view/matcher.d.ts +22 -19
  163. package/src/view/matcher.js +6 -6
  164. package/src/view/node.d.ts +33 -33
  165. package/src/view/node.js +9 -9
  166. package/src/view/observer/arrowkeysobserver.d.ts +10 -10
  167. package/src/view/observer/arrowkeysobserver.js +5 -5
  168. package/src/view/observer/bubblingemittermixin.d.ts +5 -5
  169. package/src/view/observer/bubblingemittermixin.js +2 -9
  170. package/src/view/observer/bubblingeventinfo.d.ts +9 -9
  171. package/src/view/observer/bubblingeventinfo.js +1 -1
  172. package/src/view/observer/clickobserver.d.ts +8 -8
  173. package/src/view/observer/clickobserver.js +4 -4
  174. package/src/view/observer/compositionobserver.d.ts +19 -19
  175. package/src/view/observer/compositionobserver.js +6 -6
  176. package/src/view/observer/domeventdata.d.ts +9 -9
  177. package/src/view/observer/domeventdata.js +2 -2
  178. package/src/view/observer/domeventobserver.d.ts +3 -3
  179. package/src/view/observer/domeventobserver.js +5 -5
  180. package/src/view/observer/fakeselectionobserver.d.ts +9 -9
  181. package/src/view/observer/fakeselectionobserver.js +8 -8
  182. package/src/view/observer/focusobserver.d.ts +16 -16
  183. package/src/view/observer/focusobserver.js +7 -7
  184. package/src/view/observer/inputobserver.d.ts +18 -18
  185. package/src/view/observer/inputobserver.js +5 -5
  186. package/src/view/observer/keyobserver.d.ts +11 -11
  187. package/src/view/observer/keyobserver.js +3 -3
  188. package/src/view/observer/mouseobserver.d.ts +16 -16
  189. package/src/view/observer/mouseobserver.js +3 -3
  190. package/src/view/observer/mutationobserver.d.ts +21 -21
  191. package/src/view/observer/mutationobserver.js +7 -7
  192. package/src/view/observer/observer.d.ts +12 -12
  193. package/src/view/observer/observer.js +6 -6
  194. package/src/view/observer/selectionobserver.d.ts +33 -33
  195. package/src/view/observer/selectionobserver.js +14 -14
  196. package/src/view/observer/tabobserver.d.ts +10 -10
  197. package/src/view/observer/tabobserver.js +5 -5
  198. package/src/view/observer/touchobserver.d.ts +13 -13
  199. package/src/view/observer/touchobserver.js +3 -3
  200. package/src/view/placeholder.d.ts +21 -21
  201. package/src/view/placeholder.js +23 -23
  202. package/src/view/position.d.ts +49 -49
  203. package/src/view/position.js +42 -42
  204. package/src/view/range.d.ts +76 -74
  205. package/src/view/range.js +67 -65
  206. package/src/view/rawelement.d.ts +19 -19
  207. package/src/view/rawelement.js +16 -16
  208. package/src/view/renderer.d.ts +14 -14
  209. package/src/view/renderer.js +7 -7
  210. package/src/view/rooteditableelement.d.ts +8 -7
  211. package/src/view/rooteditableelement.js +7 -6
  212. package/src/view/selection.d.ts +66 -64
  213. package/src/view/selection.js +50 -48
  214. package/src/view/styles/background.d.ts +2 -2
  215. package/src/view/styles/background.js +9 -9
  216. package/src/view/styles/border.d.ts +2 -2
  217. package/src/view/styles/border.js +13 -13
  218. package/src/view/styles/margin.d.ts +2 -2
  219. package/src/view/styles/margin.js +5 -5
  220. package/src/view/styles/padding.d.ts +2 -2
  221. package/src/view/styles/padding.js +5 -5
  222. package/src/view/styles/utils.d.ts +24 -24
  223. package/src/view/styles/utils.js +25 -25
  224. package/src/view/stylesmap.d.ts +28 -32
  225. package/src/view/stylesmap.js +52 -39
  226. package/src/view/text.d.ts +11 -11
  227. package/src/view/text.js +10 -10
  228. package/src/view/textproxy.d.ts +33 -32
  229. package/src/view/textproxy.js +23 -22
  230. package/src/view/tokenlist.d.ts +14 -14
  231. package/src/view/tokenlist.js +10 -10
  232. package/src/view/treewalker.d.ts +42 -40
  233. package/src/view/treewalker.js +36 -35
  234. package/src/view/typecheckable.d.ts +76 -75
  235. package/src/view/typecheckable.js +1 -1
  236. package/src/view/uielement.d.ts +22 -21
  237. package/src/view/uielement.js +17 -16
  238. package/src/view/upcastwriter.d.ts +70 -70
  239. package/src/view/upcastwriter.js +42 -42
  240. package/src/view/view.d.ts +70 -69
  241. package/src/view/view.js +56 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-engine",
3
- "version": "45.2.1-alpha.9",
3
+ "version": "46.0.0-alpha.0",
4
4
  "description": "The editing engine of CKEditor 5 – the best browser-based rich text editor.",
5
5
  "keywords": [
6
6
  "wysiwyg",
@@ -24,8 +24,8 @@
24
24
  "type": "module",
25
25
  "main": "src/index.js",
26
26
  "dependencies": {
27
- "@ckeditor/ckeditor5-utils": "45.2.1-alpha.9",
28
- "es-toolkit": "1.32.0"
27
+ "@ckeditor/ckeditor5-utils": "46.0.0-alpha.0",
28
+ "es-toolkit": "1.39.5"
29
29
  },
30
30
  "author": "CKSource (http://cksource.com/)",
31
31
  "license": "SEE LICENSE IN LICENSE.md",
@@ -2,21 +2,21 @@
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
- import Mapper from '../conversion/mapper.js';
6
- import DowncastDispatcher from '../conversion/downcastdispatcher.js';
7
- import UpcastDispatcher from '../conversion/upcastdispatcher.js';
8
- import ViewDocumentFragment from '../view/documentfragment.js';
9
- import ViewDocument from '../view/document.js';
10
- import type ViewElement from '../view/element.js';
5
+ import { Mapper } from '../conversion/mapper.js';
6
+ import { DowncastDispatcher } from '../conversion/downcastdispatcher.js';
7
+ import { UpcastDispatcher } from '../conversion/upcastdispatcher.js';
8
+ import { ViewDocumentFragment } from '../view/documentfragment.js';
9
+ import { ViewDocument } from '../view/document.js';
10
+ import { type ViewElement } from '../view/element.js';
11
11
  import type { StylesProcessor } from '../view/stylesmap.js';
12
12
  import type { MatcherPattern } from '../view/matcher.js';
13
- import type Model from '../model/model.js';
14
- import type ModelElement from '../model/element.js';
15
- import type ModelDocumentFragment from '../model/documentfragment.js';
16
- import type { SchemaContextDefinition } from '../model/schema.js';
13
+ import { type Model } from '../model/model.js';
14
+ import { type ModelElement } from '../model/element.js';
15
+ import { type ModelDocumentFragment } from '../model/documentfragment.js';
16
+ import type { ModelSchemaContextDefinition } from '../model/schema.js';
17
17
  import type { BatchType } from '../model/batch.js';
18
- import HtmlDataProcessor from '../dataprocessor/htmldataprocessor.js';
19
- import type DataProcessor from '../dataprocessor/dataprocessor.js';
18
+ import { HtmlDataProcessor } from '../dataprocessor/htmldataprocessor.js';
19
+ import { type DataProcessor } from '../dataprocessor/dataprocessor.js';
20
20
  declare const DataController_base: {
21
21
  new (): import("@ckeditor/ckeditor5-utils").Emitter;
22
22
  prototype: import("@ckeditor/ckeditor5-utils").Emitter;
@@ -38,7 +38,7 @@ declare const DataController_base: {
38
38
  * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
39
39
  * ```
40
40
  */
41
- export default class DataController extends /* #__PURE__ */ DataController_base {
41
+ export declare class DataController extends /* #__PURE__ */ DataController_base {
42
42
  /**
43
43
  * Data model.
44
44
  */
@@ -108,8 +108,8 @@ export default class DataController extends /* #__PURE__ */ DataController_base
108
108
  [key: string]: unknown;
109
109
  }): string;
110
110
  /**
111
- * Returns the content of the given {@link module:engine/model/element~Element model's element} or
112
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
111
+ * Returns the content of the given {@link module:engine/model/element~ModelElement model's element} or
112
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} converted by the downcast converters
113
113
  * attached to the {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
114
114
  *
115
115
  * @param modelElementOrFragment The element whose content will be stringified.
@@ -118,22 +118,22 @@ export default class DataController extends /* #__PURE__ */ DataController_base
118
118
  */
119
119
  stringify(modelElementOrFragment: ModelElement | ModelDocumentFragment, options?: Record<string, unknown>): string;
120
120
  /**
121
- * Returns the content of the given {@link module:engine/model/element~Element model element} or
122
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
121
+ * Returns the content of the given {@link module:engine/model/element~ModelElement model element} or
122
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} converted by the downcast
123
123
  * converters attached to {@link #downcastDispatcher} into a
124
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
124
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}.
125
125
  *
126
126
  * @fires toView
127
127
  * @param modelElementOrFragment Element or document fragment whose content will be converted.
128
128
  * @param options Additional configuration that will be available through the
129
129
  * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
130
- * @returns Output view DocumentFragment.
130
+ * @returns Output view ModelDocumentFragment.
131
131
  */
132
132
  toView(modelElementOrFragment: ModelElement | ModelDocumentFragment, options?: Record<string, unknown>): ViewDocumentFragment;
133
133
  /**
134
134
  * Sets the initial input data parsed by the {@link #processor data processor} and
135
135
  * converted by the {@link #upcastDispatcher view-to-model converters}.
136
- * Initial data can be only set to a document whose {@link module:engine/model/document~Document#version} is equal 0.
136
+ * Initial data can be only set to a document whose {@link module:engine/model/document~ModelDocument#version} is equal 0.
137
137
  *
138
138
  * **Note** This method is {@link module:utils/observablemixin~Observable#decorate decorated} which is
139
139
  * used by e.g. collaborative editing plugin that syncs remote data on init.
@@ -160,7 +160,7 @@ export default class DataController extends /* #__PURE__ */ DataController_base
160
160
  * Sets the input data parsed by the {@link #processor data processor} and
161
161
  * converted by the {@link #upcastDispatcher view-to-model converters}.
162
162
  * This method can be used any time to replace existing editor data with the new one without clearing the
163
- * {@link module:engine/model/document~Document#history document history}.
163
+ * {@link module:engine/model/document~ModelDocument#history document history}.
164
164
  *
165
165
  * This method also creates a batch with all the changes applied. If all you need is to parse data, use
166
166
  * the {@link #parse} method.
@@ -206,14 +206,14 @@ export default class DataController extends /* #__PURE__ */ DataController_base
206
206
  * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
207
207
  * @returns Parsed data.
208
208
  */
209
- parse(data: string, context?: SchemaContextDefinition): ModelDocumentFragment;
209
+ parse(data: string, context?: ModelSchemaContextDefinition): ModelDocumentFragment;
210
210
  /**
211
- * Returns the result of the given {@link module:engine/view/element~Element view element} or
212
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
213
- * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
211
+ * Returns the result of the given {@link module:engine/view/element~ViewElement view element} or
212
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment} converted by the
213
+ * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~ModelDocumentFragment}.
214
214
  *
215
215
  * When marker elements were converted during the conversion process, it will be set as a document fragment's
216
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
216
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment#markers static markers map}.
217
217
  *
218
218
  * @fires toModel
219
219
  * @param viewElementOrFragment The element or document fragment whose content will be converted.
@@ -221,16 +221,16 @@ export default class DataController extends /* #__PURE__ */ DataController_base
221
221
  * See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.
222
222
  * @returns Output document fragment.
223
223
  */
224
- toModel(viewElementOrFragment: ViewElement | ViewDocumentFragment, context?: SchemaContextDefinition): ModelDocumentFragment;
224
+ toModel(viewElementOrFragment: ViewElement | ViewDocumentFragment, context?: ModelSchemaContextDefinition): ModelDocumentFragment;
225
225
  /**
226
226
  * Adds the style processor normalization rules.
227
227
  *
228
228
  * You can implement your own rules as well as use one of the available processor rules:
229
229
  *
230
- * * background: {@link module:engine/view/styles/background~addBackgroundRules}
231
- * * border: {@link module:engine/view/styles/border~addBorderRules}
232
- * * margin: {@link module:engine/view/styles/margin~addMarginRules}
233
- * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
230
+ * * background: {@link module:engine/view/styles/background~addBackgroundStylesRules}
231
+ * * border: {@link module:engine/view/styles/border~addBorderStylesRules}
232
+ * * margin: {@link module:engine/view/styles/margin~addMarginStylesRules}
233
+ * * padding: {@link module:engine/view/styles/padding~addPaddingStylesRules}
234
234
  */
235
235
  addStyleProcessorRules(callback: (stylesProcessor: StylesProcessor) => void): void;
236
236
  /**
@@ -238,7 +238,8 @@ export default class DataController extends /* #__PURE__ */ DataController_base
238
238
  * and a {@link #processor processor} for view elements whose content should be treated as raw data
239
239
  * and not processed during the conversion from DOM to view elements.
240
240
  *
241
- * The raw data can be later accessed by the {@link module:engine/view/element~Element#getCustomProperty view element custom property}
241
+ * The raw data can be later accessed by the
242
+ * {@link module:engine/view/element~ViewElement#getCustomProperty view element custom property}
242
243
  * `"$rawContent"`.
243
244
  *
244
245
  * @param pattern Pattern matching all view elements whose content should be treated as a raw data.
@@ -6,17 +6,17 @@
6
6
  * @module engine/controller/datacontroller
7
7
  */
8
8
  import { CKEditorError, EmitterMixin, ObservableMixin, logWarning } from '@ckeditor/ckeditor5-utils';
9
- import Mapper from '../conversion/mapper.js';
10
- import DowncastDispatcher from '../conversion/downcastdispatcher.js';
9
+ import { Mapper } from '../conversion/mapper.js';
10
+ import { DowncastDispatcher } from '../conversion/downcastdispatcher.js';
11
11
  import { insertAttributesAndChildren, insertText } from '../conversion/downcasthelpers.js';
12
- import UpcastDispatcher from '../conversion/upcastdispatcher.js';
12
+ import { UpcastDispatcher } from '../conversion/upcastdispatcher.js';
13
13
  import { convertText, convertToModelFragment } from '../conversion/upcasthelpers.js';
14
- import ViewDocumentFragment from '../view/documentfragment.js';
15
- import ViewDocument from '../view/document.js';
16
- import ViewDowncastWriter from '../view/downcastwriter.js';
17
- import ModelRange from '../model/range.js';
14
+ import { ViewDocumentFragment } from '../view/documentfragment.js';
15
+ import { ViewDocument } from '../view/document.js';
16
+ import { ViewDowncastWriter } from '../view/downcastwriter.js';
17
+ import { ModelRange } from '../model/range.js';
18
18
  import { autoParagraphEmptyRoots } from '../model/utils/autoparagraphing.js';
19
- import HtmlDataProcessor from '../dataprocessor/htmldataprocessor.js';
19
+ import { HtmlDataProcessor } from '../dataprocessor/htmldataprocessor.js';
20
20
  /**
21
21
  * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document
22
22
  * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}
@@ -34,7 +34,7 @@ import HtmlDataProcessor from '../dataprocessor/htmldataprocessor.js';
34
34
  * editor.data.get( { rootName: 'customRoot' } ); // -> '<p>Hello!</p>'
35
35
  * ```
36
36
  */
37
- export default class DataController extends /* #__PURE__ */ EmitterMixin() {
37
+ export class DataController extends /* #__PURE__ */ EmitterMixin() {
38
38
  /**
39
39
  * Data model.
40
40
  */
@@ -176,8 +176,8 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
176
176
  return this.stringify(root, options);
177
177
  }
178
178
  /**
179
- * Returns the content of the given {@link module:engine/model/element~Element model's element} or
180
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters
179
+ * Returns the content of the given {@link module:engine/model/element~ModelElement model's element} or
180
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} converted by the downcast converters
181
181
  * attached to the {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.
182
182
  *
183
183
  * @param modelElementOrFragment The element whose content will be stringified.
@@ -191,16 +191,16 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
191
191
  return this.processor.toData(viewDocumentFragment);
192
192
  }
193
193
  /**
194
- * Returns the content of the given {@link module:engine/model/element~Element model element} or
195
- * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast
194
+ * Returns the content of the given {@link module:engine/model/element~ModelElement model element} or
195
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment model document fragment} converted by the downcast
196
196
  * converters attached to {@link #downcastDispatcher} into a
197
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.
197
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment}.
198
198
  *
199
199
  * @fires toView
200
200
  * @param modelElementOrFragment Element or document fragment whose content will be converted.
201
201
  * @param options Additional configuration that will be available through the
202
202
  * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi#options} during the conversion process.
203
- * @returns Output view DocumentFragment.
203
+ * @returns Output view ModelDocumentFragment.
204
204
  */
205
205
  toView(modelElementOrFragment, options = {}) {
206
206
  const viewDocument = this.viewDocument;
@@ -225,7 +225,7 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
225
225
  /**
226
226
  * Sets the initial input data parsed by the {@link #processor data processor} and
227
227
  * converted by the {@link #upcastDispatcher view-to-model converters}.
228
- * Initial data can be only set to a document whose {@link module:engine/model/document~Document#version} is equal 0.
228
+ * Initial data can be only set to a document whose {@link module:engine/model/document~ModelDocument#version} is equal 0.
229
229
  *
230
230
  * **Note** This method is {@link module:utils/observablemixin~Observable#decorate decorated} which is
231
231
  * used by e.g. collaborative editing plugin that syncs remote data on init.
@@ -250,9 +250,9 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
250
250
  init(data) {
251
251
  if (this.model.document.version) {
252
252
  /**
253
- * Cannot set initial data to a non-empty {@link module:engine/model/document~Document}.
253
+ * Cannot set initial data to a non-empty {@link module:engine/model/document~ModelDocument}.
254
254
  * Initial data should be set once, during the {@link module:core/editor/editor~Editor} initialization,
255
- * when the {@link module:engine/model/document~Document#version} is equal 0.
255
+ * when the {@link module:engine/model/document~ModelDocument#version} is equal 0.
256
256
  *
257
257
  * @error datacontroller-init-document-not-empty
258
258
  */
@@ -294,7 +294,7 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
294
294
  * Sets the input data parsed by the {@link #processor data processor} and
295
295
  * converted by the {@link #upcastDispatcher view-to-model converters}.
296
296
  * This method can be used any time to replace existing editor data with the new one without clearing the
297
- * {@link module:engine/model/document~Document#history document history}.
297
+ * {@link module:engine/model/document~ModelDocument#history document history}.
298
298
  *
299
299
  * This method also creates a batch with all the changes applied. If all you need is to parse data, use
300
300
  * the {@link #parse} method.
@@ -379,12 +379,12 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
379
379
  return this.toModel(viewDocumentFragment, context);
380
380
  }
381
381
  /**
382
- * Returns the result of the given {@link module:engine/view/element~Element view element} or
383
- * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the
384
- * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.
382
+ * Returns the result of the given {@link module:engine/view/element~ViewElement view element} or
383
+ * {@link module:engine/view/documentfragment~ViewDocumentFragment view document fragment} converted by the
384
+ * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~ModelDocumentFragment}.
385
385
  *
386
386
  * When marker elements were converted during the conversion process, it will be set as a document fragment's
387
- * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.
387
+ * {@link module:engine/model/documentfragment~ModelDocumentFragment#markers static markers map}.
388
388
  *
389
389
  * @fires toModel
390
390
  * @param viewElementOrFragment The element or document fragment whose content will be converted.
@@ -402,10 +402,10 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
402
402
  *
403
403
  * You can implement your own rules as well as use one of the available processor rules:
404
404
  *
405
- * * background: {@link module:engine/view/styles/background~addBackgroundRules}
406
- * * border: {@link module:engine/view/styles/border~addBorderRules}
407
- * * margin: {@link module:engine/view/styles/margin~addMarginRules}
408
- * * padding: {@link module:engine/view/styles/padding~addPaddingRules}
405
+ * * background: {@link module:engine/view/styles/background~addBackgroundStylesRules}
406
+ * * border: {@link module:engine/view/styles/border~addBorderStylesRules}
407
+ * * margin: {@link module:engine/view/styles/margin~addMarginStylesRules}
408
+ * * padding: {@link module:engine/view/styles/padding~addPaddingStylesRules}
409
409
  */
410
410
  addStyleProcessorRules(callback) {
411
411
  callback(this.stylesProcessor);
@@ -415,7 +415,8 @@ export default class DataController extends /* #__PURE__ */ EmitterMixin() {
415
415
  * and a {@link #processor processor} for view elements whose content should be treated as raw data
416
416
  * and not processed during the conversion from DOM to view elements.
417
417
  *
418
- * The raw data can be later accessed by the {@link module:engine/view/element~Element#getCustomProperty view element custom property}
418
+ * The raw data can be later accessed by the
419
+ * {@link module:engine/view/element~ViewElement#getCustomProperty view element custom property}
419
420
  * `"$rawContent"`.
420
421
  *
421
422
  * @param pattern Pattern matching all view elements whose content should be treated as a raw data.
@@ -2,11 +2,11 @@
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
- import View from '../view/view.js';
6
- import Mapper from '../conversion/mapper.js';
7
- import DowncastDispatcher from '../conversion/downcastdispatcher.js';
8
- import type { default as Model } from '../model/model.js';
9
- import type ModelItem from '../model/item.js';
5
+ import { EditingView } from '../view/view.js';
6
+ import { Mapper } from '../conversion/mapper.js';
7
+ import { DowncastDispatcher } from '../conversion/downcastdispatcher.js';
8
+ import type { Model } from '../model/model.js';
9
+ import { type ModelItem } from '../model/item.js';
10
10
  import type { Marker } from '../model/markercollection.js';
11
11
  import type { StylesProcessor } from '../view/stylesmap.js';
12
12
  declare const EditingController_base: {
@@ -18,7 +18,7 @@ declare const EditingController_base: {
18
18
  * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
19
19
  * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
20
20
  */
21
- export default class EditingController extends /* #__PURE__ */ EditingController_base {
21
+ export declare class EditingController extends /* #__PURE__ */ EditingController_base {
22
22
  /**
23
23
  * Editor model.
24
24
  */
@@ -26,7 +26,7 @@ export default class EditingController extends /* #__PURE__ */ EditingController
26
26
  /**
27
27
  * Editing view controller.
28
28
  */
29
- readonly view: View;
29
+ readonly view: EditingView;
30
30
  /**
31
31
  * A mapper that describes the model-view binding.
32
32
  */
@@ -50,7 +50,7 @@ export default class EditingController extends /* #__PURE__ */ EditingController
50
50
  /**
51
51
  * Calling this method will refresh the marker by triggering the downcast conversion for it.
52
52
  *
53
- * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~Element view element}
53
+ * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~ViewElement view element}
54
54
  * without changing any marker data. For instance:
55
55
  *
56
56
  * ```ts
@@ -6,10 +6,10 @@
6
6
  * @module engine/controller/editingcontroller
7
7
  */
8
8
  import { CKEditorError, ObservableMixin } from '@ckeditor/ckeditor5-utils';
9
- import RootEditableElement from '../view/rooteditableelement.js';
10
- import View from '../view/view.js';
11
- import Mapper from '../conversion/mapper.js';
12
- import DowncastDispatcher from '../conversion/downcastdispatcher.js';
9
+ import { ViewRootEditableElement } from '../view/rooteditableelement.js';
10
+ import { EditingView } from '../view/view.js';
11
+ import { Mapper } from '../conversion/mapper.js';
12
+ import { DowncastDispatcher } from '../conversion/downcastdispatcher.js';
13
13
  import { cleanSelection, convertCollapsedSelection, convertRangeSelection, insertAttributesAndChildren, insertText, remove } from '../conversion/downcasthelpers.js';
14
14
  import { convertSelectionChange } from '../conversion/upcasthelpers.js';
15
15
  // @if CK_DEBUG_ENGINE // const { dumpTrees, initDocumentDumping } = require( '../dev-utils/utils' );
@@ -18,7 +18,7 @@ import { convertSelectionChange } from '../conversion/upcasthelpers.js';
18
18
  * including selection handling. It also creates the {@link ~EditingController#view view} which builds a
19
19
  * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.
20
20
  */
21
- export default class EditingController extends /* #__PURE__ */ ObservableMixin() {
21
+ export class EditingController extends /* #__PURE__ */ ObservableMixin() {
22
22
  /**
23
23
  * Editor model.
24
24
  */
@@ -44,7 +44,7 @@ export default class EditingController extends /* #__PURE__ */ ObservableMixin()
44
44
  constructor(model, stylesProcessor) {
45
45
  super();
46
46
  this.model = model;
47
- this.view = new View(stylesProcessor);
47
+ this.view = new EditingView(stylesProcessor);
48
48
  this.mapper = new Mapper();
49
49
  this.downcastDispatcher = new DowncastDispatcher({
50
50
  mapper: this.mapper,
@@ -83,15 +83,15 @@ export default class EditingController extends /* #__PURE__ */ ObservableMixin()
83
83
  this.downcastDispatcher.on('cleanSelection', cleanSelection());
84
84
  this.downcastDispatcher.on('selection', convertRangeSelection(), { priority: 'low' });
85
85
  this.downcastDispatcher.on('selection', convertCollapsedSelection(), { priority: 'low' });
86
- // Binds {@link module:engine/view/document~Document#roots view roots collection} to
87
- // {@link module:engine/model/document~Document#roots model roots collection} so creating
86
+ // Binds {@link module:engine/view/document~ViewDocument#roots view roots collection} to
87
+ // {@link module:engine/model/document~ModelDocument#roots model roots collection} so creating
88
88
  // model root automatically creates corresponding view root.
89
89
  this.view.document.roots.bindTo(this.model.document.roots).using(root => {
90
90
  // $graveyard is a special root that has no reflection in the view.
91
91
  if (root.rootName == '$graveyard') {
92
92
  return null;
93
93
  }
94
- const viewRoot = new RootEditableElement(this.view.document, root.name);
94
+ const viewRoot = new ViewRootEditableElement(this.view.document, root.name);
95
95
  viewRoot.rootName = root.rootName;
96
96
  this.mapper.bindElements(root, viewRoot);
97
97
  return viewRoot;
@@ -115,7 +115,7 @@ export default class EditingController extends /* #__PURE__ */ ObservableMixin()
115
115
  /**
116
116
  * Calling this method will refresh the marker by triggering the downcast conversion for it.
117
117
  *
118
- * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~Element view element}
118
+ * Reconverting the marker is useful when you want to change its {@link module:engine/view/element~ViewElement view element}
119
119
  * without changing any marker data. For instance:
120
120
  *
121
121
  * ```ts
@@ -6,11 +6,11 @@
6
6
  * @module engine/conversion/conversion
7
7
  */
8
8
  import { type ArrayOrItem, type PriorityString } from '@ckeditor/ckeditor5-utils';
9
- import UpcastHelpers from './upcasthelpers.js';
10
- import DowncastHelpers, { type AttributeCreatorFunction, type AttributeDescriptor } from './downcasthelpers.js';
11
- import type DowncastDispatcher from './downcastdispatcher.js';
12
- import type UpcastDispatcher from './upcastdispatcher.js';
13
- import type ElementDefinition from '../view/elementdefinition.js';
9
+ import { UpcastHelpers } from './upcasthelpers.js';
10
+ import { DowncastHelpers, type DowncastAttributeCreatorFunction, type DowncastAttributeDescriptor } from './downcasthelpers.js';
11
+ import { type DowncastDispatcher } from './downcastdispatcher.js';
12
+ import { type UpcastDispatcher } from './upcastdispatcher.js';
13
+ import { type ViewElementDefinition } from '../view/elementdefinition.js';
14
14
  import type { MatcherPattern } from '../view/matcher.js';
15
15
  /**
16
16
  * A utility class that helps add converters to upcast and downcast dispatchers.
@@ -58,7 +58,7 @@ import type { MatcherPattern } from '../view/matcher.js';
58
58
  * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;
59
59
  * Model attribute to view attribute and vice versa.
60
60
  */
61
- export default class Conversion {
61
+ export declare class Conversion {
62
62
  /**
63
63
  * Maps dispatchers group name to ConversionHelpers instances.
64
64
  */
@@ -149,8 +149,8 @@ export default class Conversion {
149
149
  */
150
150
  elementToElement(definition: {
151
151
  model: string;
152
- view: ElementDefinition;
153
- upcastAlso?: ArrayOrItem<ElementDefinition | MatcherPattern>;
152
+ view: ViewElementDefinition;
153
+ upcastAlso?: ArrayOrItem<ViewElementDefinition | MatcherPattern>;
154
154
  converterPriority?: PriorityString;
155
155
  }): void;
156
156
  /**
@@ -317,7 +317,7 @@ export default class Conversion {
317
317
  key: string;
318
318
  name?: string;
319
319
  };
320
- view: ElementDefinition;
320
+ view: ViewElementDefinition;
321
321
  upcastAlso?: ArrayOrItem<MatcherPattern>;
322
322
  converterPriority?: PriorityString;
323
323
  } | {
@@ -326,14 +326,14 @@ export default class Conversion {
326
326
  name?: string;
327
327
  values: Array<TValues>;
328
328
  };
329
- view: Record<TValues, ElementDefinition>;
329
+ view: Record<TValues, ViewElementDefinition>;
330
330
  upcastAlso?: Record<TValues, ArrayOrItem<MatcherPattern>>;
331
331
  converterPriority?: PriorityString;
332
332
  }): void;
333
333
  /**
334
334
  * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,
335
335
  * `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
336
- * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
336
+ * This type of converters is intended to be used with {@link module:engine/model/element~ModelElement model element} nodes.
337
337
  * To convert the text attributes,
338
338
  * the {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}should be set up.
339
339
  *
@@ -446,12 +446,12 @@ export default class Conversion {
446
446
  key: string;
447
447
  name?: string;
448
448
  };
449
- view: string | (AttributeDescriptor & {
449
+ view: string | (DowncastAttributeDescriptor & {
450
450
  name?: string;
451
451
  });
452
- upcastAlso?: ArrayOrItem<string | (AttributeDescriptor & {
452
+ upcastAlso?: ArrayOrItem<string | (DowncastAttributeDescriptor & {
453
453
  name?: string;
454
- }) | AttributeCreatorFunction>;
454
+ }) | DowncastAttributeCreatorFunction>;
455
455
  converterPriority?: PriorityString;
456
456
  } | {
457
457
  model: {
@@ -459,12 +459,12 @@ export default class Conversion {
459
459
  name?: string;
460
460
  values: Array<TValues>;
461
461
  };
462
- view: Record<TValues, (AttributeDescriptor & {
462
+ view: Record<TValues, (DowncastAttributeDescriptor & {
463
463
  name?: string;
464
464
  })>;
465
- upcastAlso?: Record<TValues, (AttributeDescriptor & {
465
+ upcastAlso?: Record<TValues, (DowncastAttributeDescriptor & {
466
466
  name?: string;
467
- }) | AttributeCreatorFunction>;
467
+ }) | DowncastAttributeCreatorFunction>;
468
468
  converterPriority?: PriorityString;
469
469
  }): void;
470
470
  /**
@@ -477,5 +477,4 @@ export default class Conversion {
477
477
  */
478
478
  private _createConversionHelpers;
479
479
  }
480
- type ConversionType<T extends string> = T extends `${string}Downcast` ? DowncastHelpers : T extends `${string}Upcast` ? UpcastHelpers : DowncastHelpers | UpcastHelpers;
481
- export {};
480
+ export type ConversionType<T extends string> = T extends `${string}Downcast` ? DowncastHelpers : T extends `${string}Upcast` ? UpcastHelpers : DowncastHelpers | UpcastHelpers;
@@ -6,8 +6,8 @@
6
6
  * @module engine/conversion/conversion
7
7
  */
8
8
  import { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';
9
- import UpcastHelpers from './upcasthelpers.js';
10
- import DowncastHelpers from './downcasthelpers.js';
9
+ import { UpcastHelpers } from './upcasthelpers.js';
10
+ import { DowncastHelpers } from './downcasthelpers.js';
11
11
  /**
12
12
  * A utility class that helps add converters to upcast and downcast dispatchers.
13
13
  *
@@ -54,7 +54,7 @@ import DowncastHelpers from './downcasthelpers.js';
54
54
  * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} &ndash;
55
55
  * Model attribute to view attribute and vice versa.
56
56
  */
57
- export default class Conversion {
57
+ export class Conversion {
58
58
  /**
59
59
  * Maps dispatchers group name to ConversionHelpers instances.
60
60
  */
@@ -436,7 +436,7 @@ export default class Conversion {
436
436
  /**
437
437
  * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,
438
438
  * `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
439
- * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
439
+ * This type of converters is intended to be used with {@link module:engine/model/element~ModelElement model element} nodes.
440
440
  * To convert the text attributes,
441
441
  * the {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}should be set up.
442
442
  *
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Base class for conversion helpers.
10
10
  */
11
- export default class ConversionHelpers<TDispatcher> {
11
+ export declare class ConversionHelpers<TDispatcher> {
12
12
  private readonly _dispatchers;
13
13
  /**
14
14
  * Creates a conversion helpers instance.
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Base class for conversion helpers.
10
10
  */
11
- export default class ConversionHelpers {
11
+ export class ConversionHelpers {
12
12
  _dispatchers;
13
13
  /**
14
14
  * Creates a conversion helpers instance.