@ckeditor/ckeditor5-engine 40.2.0 → 41.1.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 (245) hide show
  1. package/CHANGELOG.md +34 -34
  2. package/LICENSE.md +1 -1
  3. package/package.json +3 -2
  4. package/src/controller/datacontroller.d.ts +17 -16
  5. package/src/controller/datacontroller.js +12 -12
  6. package/src/controller/editingcontroller.d.ts +8 -8
  7. package/src/controller/editingcontroller.js +8 -8
  8. package/src/conversion/conversion.d.ts +7 -7
  9. package/src/conversion/conversion.js +3 -3
  10. package/src/conversion/conversionhelpers.d.ts +1 -1
  11. package/src/conversion/conversionhelpers.js +1 -1
  12. package/src/conversion/downcastdispatcher.d.ts +14 -14
  13. package/src/conversion/downcastdispatcher.js +3 -3
  14. package/src/conversion/downcasthelpers.d.ts +18 -54
  15. package/src/conversion/downcasthelpers.js +35 -52
  16. package/src/conversion/mapper.d.ts +10 -10
  17. package/src/conversion/mapper.js +6 -6
  18. package/src/conversion/modelconsumable.d.ts +6 -6
  19. package/src/conversion/modelconsumable.js +2 -2
  20. package/src/conversion/upcastdispatcher.d.ts +13 -13
  21. package/src/conversion/upcastdispatcher.js +6 -6
  22. package/src/conversion/upcasthelpers.d.ts +10 -10
  23. package/src/conversion/upcasthelpers.js +6 -6
  24. package/src/conversion/viewconsumable.d.ts +6 -6
  25. package/src/conversion/viewconsumable.js +1 -1
  26. package/src/dataprocessor/basichtmlwriter.d.ts +2 -2
  27. package/src/dataprocessor/basichtmlwriter.js +1 -1
  28. package/src/dataprocessor/dataprocessor.d.ts +3 -3
  29. package/src/dataprocessor/dataprocessor.js +1 -1
  30. package/src/dataprocessor/htmldataprocessor.d.ts +7 -7
  31. package/src/dataprocessor/htmldataprocessor.js +3 -3
  32. package/src/dataprocessor/htmlwriter.d.ts +1 -1
  33. package/src/dataprocessor/htmlwriter.js +1 -1
  34. package/src/dataprocessor/xmldataprocessor.d.ts +7 -7
  35. package/src/dataprocessor/xmldataprocessor.js +3 -3
  36. package/src/dev-utils/model.d.ts +11 -11
  37. package/src/dev-utils/model.js +17 -17
  38. package/src/dev-utils/operationreplayer.d.ts +3 -3
  39. package/src/dev-utils/operationreplayer.js +2 -2
  40. package/src/dev-utils/utils.d.ts +1 -1
  41. package/src/dev-utils/utils.js +1 -1
  42. package/src/dev-utils/view.d.ts +9 -9
  43. package/src/dev-utils/view.js +15 -15
  44. package/src/index.d.ts +107 -108
  45. package/src/index.js +65 -66
  46. package/src/model/batch.d.ts +2 -2
  47. package/src/model/batch.js +1 -1
  48. package/src/model/differ.d.ts +35 -7
  49. package/src/model/differ.js +9 -6
  50. package/src/model/document.d.ts +12 -10
  51. package/src/model/document.js +5 -5
  52. package/src/model/documentfragment.d.ts +5 -5
  53. package/src/model/documentfragment.js +6 -6
  54. package/src/model/documentselection.d.ts +9 -9
  55. package/src/model/documentselection.js +6 -6
  56. package/src/model/element.d.ts +3 -3
  57. package/src/model/element.js +5 -5
  58. package/src/model/history.d.ts +2 -2
  59. package/src/model/history.js +1 -1
  60. package/src/model/item.d.ts +3 -3
  61. package/src/model/item.js +1 -1
  62. package/src/model/liveposition.d.ts +5 -5
  63. package/src/model/liveposition.js +2 -2
  64. package/src/model/liverange.d.ts +6 -6
  65. package/src/model/liverange.js +2 -2
  66. package/src/model/markercollection.d.ts +5 -5
  67. package/src/model/markercollection.js +3 -3
  68. package/src/model/model.d.ts +15 -15
  69. package/src/model/model.js +19 -19
  70. package/src/model/node.d.ts +6 -6
  71. package/src/model/node.js +3 -3
  72. package/src/model/nodelist.d.ts +2 -2
  73. package/src/model/nodelist.js +2 -2
  74. package/src/model/operation/attributeoperation.d.ts +5 -5
  75. package/src/model/operation/attributeoperation.js +4 -4
  76. package/src/model/operation/detachoperation.d.ts +4 -4
  77. package/src/model/operation/detachoperation.js +4 -4
  78. package/src/model/operation/insertoperation.d.ts +7 -7
  79. package/src/model/operation/insertoperation.js +8 -8
  80. package/src/model/operation/markeroperation.d.ts +6 -6
  81. package/src/model/operation/markeroperation.js +3 -3
  82. package/src/model/operation/mergeoperation.d.ts +6 -6
  83. package/src/model/operation/mergeoperation.js +6 -6
  84. package/src/model/operation/moveoperation.d.ts +5 -5
  85. package/src/model/operation/moveoperation.js +5 -5
  86. package/src/model/operation/nooperation.d.ts +3 -3
  87. package/src/model/operation/nooperation.js +2 -2
  88. package/src/model/operation/operation.d.ts +4 -4
  89. package/src/model/operation/operation.js +1 -1
  90. package/src/model/operation/operationfactory.d.ts +3 -3
  91. package/src/model/operation/operationfactory.js +12 -12
  92. package/src/model/operation/renameoperation.d.ts +5 -5
  93. package/src/model/operation/renameoperation.js +4 -4
  94. package/src/model/operation/rootattributeoperation.d.ts +5 -5
  95. package/src/model/operation/rootattributeoperation.js +2 -2
  96. package/src/model/operation/rootoperation.d.ts +4 -4
  97. package/src/model/operation/rootoperation.js +2 -2
  98. package/src/model/operation/splitoperation.d.ts +6 -6
  99. package/src/model/operation/splitoperation.js +6 -6
  100. package/src/model/operation/transform.d.ts +3 -3
  101. package/src/model/operation/transform.js +13 -13
  102. package/src/model/operation/utils.d.ts +7 -7
  103. package/src/model/operation/utils.js +5 -5
  104. package/src/model/position.d.ts +15 -15
  105. package/src/model/position.js +4 -4
  106. package/src/model/range.d.ts +13 -13
  107. package/src/model/range.js +4 -4
  108. package/src/model/rootelement.d.ts +3 -3
  109. package/src/model/rootelement.js +2 -2
  110. package/src/model/schema.d.ts +32 -12
  111. package/src/model/schema.js +52 -7
  112. package/src/model/selection.d.ts +8 -8
  113. package/src/model/selection.js +5 -5
  114. package/src/model/text.d.ts +2 -2
  115. package/src/model/text.js +2 -2
  116. package/src/model/textproxy.d.ts +6 -6
  117. package/src/model/textproxy.js +2 -2
  118. package/src/model/treewalker.d.ts +4 -4
  119. package/src/model/treewalker.js +5 -5
  120. package/src/model/typecheckable.d.ts +14 -14
  121. package/src/model/typecheckable.js +1 -1
  122. package/src/model/utils/autoparagraphing.d.ts +5 -5
  123. package/src/model/utils/autoparagraphing.js +1 -1
  124. package/src/model/utils/deletecontent.d.ts +4 -4
  125. package/src/model/utils/deletecontent.js +4 -4
  126. package/src/model/utils/getselectedcontent.d.ts +5 -5
  127. package/src/model/utils/getselectedcontent.js +1 -1
  128. package/src/model/utils/insertcontent.d.ts +7 -7
  129. package/src/model/utils/insertcontent.js +7 -7
  130. package/src/model/utils/insertobject.d.ts +9 -6
  131. package/src/model/utils/insertobject.js +2 -6
  132. package/src/model/utils/modifyselection.d.ts +4 -4
  133. package/src/model/utils/modifyselection.js +5 -5
  134. package/src/model/utils/selection-post-fixer.d.ts +4 -4
  135. package/src/model/utils/selection-post-fixer.js +3 -3
  136. package/src/model/writer.d.ts +13 -13
  137. package/src/model/writer.js +18 -18
  138. package/src/view/attributeelement.d.ts +4 -4
  139. package/src/view/attributeelement.js +4 -3
  140. package/src/view/containerelement.d.ts +4 -4
  141. package/src/view/containerelement.js +2 -2
  142. package/src/view/datatransfer.d.ts +1 -1
  143. package/src/view/datatransfer.js +1 -1
  144. package/src/view/document.d.ts +5 -5
  145. package/src/view/document.js +3 -3
  146. package/src/view/documentfragment.d.ts +5 -5
  147. package/src/view/documentfragment.js +4 -4
  148. package/src/view/documentselection.d.ts +9 -9
  149. package/src/view/documentselection.js +3 -3
  150. package/src/view/domconverter.d.ts +14 -14
  151. package/src/view/domconverter.js +11 -11
  152. package/src/view/downcastwriter.d.ts +18 -18
  153. package/src/view/downcastwriter.js +12 -12
  154. package/src/view/editableelement.d.ts +5 -5
  155. package/src/view/editableelement.js +2 -2
  156. package/src/view/element.d.ts +6 -6
  157. package/src/view/element.js +6 -6
  158. package/src/view/elementdefinition.d.ts +1 -1
  159. package/src/view/elementdefinition.js +1 -1
  160. package/src/view/emptyelement.d.ts +5 -5
  161. package/src/view/emptyelement.js +3 -3
  162. package/src/view/filler.d.ts +2 -2
  163. package/src/view/filler.js +1 -1
  164. package/src/view/item.d.ts +3 -3
  165. package/src/view/item.js +1 -1
  166. package/src/view/matcher.d.ts +2 -2
  167. package/src/view/matcher.js +1 -1
  168. package/src/view/node.d.ts +6 -6
  169. package/src/view/node.js +3 -3
  170. package/src/view/observer/arrowkeysobserver.d.ts +5 -5
  171. package/src/view/observer/arrowkeysobserver.js +3 -3
  172. package/src/view/observer/bubblingemittermixin.d.ts +3 -3
  173. package/src/view/observer/bubblingemittermixin.js +2 -2
  174. package/src/view/observer/bubblingeventinfo.d.ts +4 -4
  175. package/src/view/observer/bubblingeventinfo.js +1 -1
  176. package/src/view/observer/clickobserver.d.ts +4 -4
  177. package/src/view/observer/clickobserver.js +2 -2
  178. package/src/view/observer/compositionobserver.d.ts +4 -4
  179. package/src/view/observer/compositionobserver.js +2 -2
  180. package/src/view/observer/domeventdata.d.ts +4 -4
  181. package/src/view/observer/domeventdata.js +1 -1
  182. package/src/view/observer/domeventobserver.d.ts +2 -2
  183. package/src/view/observer/domeventobserver.js +3 -3
  184. package/src/view/observer/fakeselectionobserver.d.ts +3 -3
  185. package/src/view/observer/fakeselectionobserver.js +3 -3
  186. package/src/view/observer/focusobserver.d.ts +4 -4
  187. package/src/view/observer/focusobserver.js +2 -2
  188. package/src/view/observer/inputobserver.d.ts +5 -5
  189. package/src/view/observer/inputobserver.js +3 -3
  190. package/src/view/observer/keyobserver.d.ts +3 -3
  191. package/src/view/observer/keyobserver.js +2 -2
  192. package/src/view/observer/mouseobserver.d.ts +3 -3
  193. package/src/view/observer/mouseobserver.js +2 -2
  194. package/src/view/observer/mutationobserver.d.ts +5 -5
  195. package/src/view/observer/mutationobserver.js +3 -3
  196. package/src/view/observer/observer.d.ts +3 -3
  197. package/src/view/observer/observer.js +1 -1
  198. package/src/view/observer/selectionobserver.d.ts +8 -8
  199. package/src/view/observer/selectionobserver.js +4 -4
  200. package/src/view/observer/tabobserver.d.ts +5 -5
  201. package/src/view/observer/tabobserver.js +3 -3
  202. package/src/view/placeholder.d.ts +5 -5
  203. package/src/view/placeholder.js +1 -1
  204. package/src/view/position.d.ts +8 -8
  205. package/src/view/position.js +5 -5
  206. package/src/view/range.d.ts +8 -8
  207. package/src/view/range.js +4 -4
  208. package/src/view/rawelement.d.ts +6 -6
  209. package/src/view/rawelement.js +3 -3
  210. package/src/view/renderer.d.ts +6 -6
  211. package/src/view/renderer.js +4 -4
  212. package/src/view/rooteditableelement.d.ts +3 -3
  213. package/src/view/rooteditableelement.js +2 -2
  214. package/src/view/selection.d.ts +9 -9
  215. package/src/view/selection.js +6 -6
  216. package/src/view/styles/background.d.ts +2 -2
  217. package/src/view/styles/background.js +2 -2
  218. package/src/view/styles/border.d.ts +2 -2
  219. package/src/view/styles/border.js +2 -2
  220. package/src/view/styles/margin.d.ts +2 -2
  221. package/src/view/styles/margin.js +2 -2
  222. package/src/view/styles/padding.d.ts +2 -2
  223. package/src/view/styles/padding.js +2 -2
  224. package/src/view/styles/utils.d.ts +2 -2
  225. package/src/view/styles/utils.js +1 -1
  226. package/src/view/stylesmap.d.ts +2 -2
  227. package/src/view/stylesmap.js +4 -4
  228. package/src/view/text.d.ts +3 -3
  229. package/src/view/text.js +2 -2
  230. package/src/view/textproxy.d.ts +7 -7
  231. package/src/view/textproxy.js +2 -2
  232. package/src/view/treewalker.d.ts +4 -4
  233. package/src/view/treewalker.js +5 -5
  234. package/src/view/typecheckable.d.ts +17 -17
  235. package/src/view/typecheckable.js +1 -1
  236. package/src/view/uielement.d.ts +7 -7
  237. package/src/view/uielement.js +3 -3
  238. package/src/view/upcastwriter.d.ts +10 -10
  239. package/src/view/upcastwriter.js +7 -7
  240. package/src/view/view.d.ts +22 -22
  241. package/src/view/view.js +19 -19
  242. package/theme/placeholder.css +1 -1
  243. package/theme/renderer.css +1 -1
  244. package/src/model/utils/findoptimalinsertionrange.d.ts +0 -32
  245. package/src/model/utils/findoptimalinsertionrange.js +0 -57
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
@@ -7,23 +7,23 @@
7
7
  *
8
8
  * @module engine/conversion/downcasthelpers
9
9
  */
10
- import ModelRange from '../model/range';
11
- import ModelSelection from '../model/selection';
12
- import ModelDocumentSelection from '../model/documentselection';
13
- import ModelElement from '../model/element';
14
- import ModelPosition from '../model/position';
15
- import ViewAttributeElement from '../view/attributeelement';
16
- import ConversionHelpers from './conversionhelpers';
17
- import type { default as DowncastDispatcher, DowncastConversionApi } from './downcastdispatcher';
18
- import type ModelConsumable from './modelconsumable';
19
- import type ModelNode from '../model/node';
20
- import type ModelItem from '../model/item';
21
- import type ModelTextProxy from '../model/textproxy';
22
- import type ModelText from '../model/text';
23
- import type DowncastWriter from '../view/downcastwriter';
24
- import type ElementDefinition from '../view/elementdefinition';
25
- import type UIElement from '../view/uielement';
26
- import type ViewElement from '../view/element';
10
+ import ModelRange from '../model/range.js';
11
+ import ModelSelection from '../model/selection.js';
12
+ import ModelDocumentSelection from '../model/documentselection.js';
13
+ import ModelElement from '../model/element.js';
14
+ import ModelPosition from '../model/position.js';
15
+ import ViewAttributeElement from '../view/attributeelement.js';
16
+ import ConversionHelpers from './conversionhelpers.js';
17
+ import type { default as DowncastDispatcher, DowncastConversionApi } from './downcastdispatcher.js';
18
+ import type ModelConsumable from './modelconsumable.js';
19
+ import type ModelNode from '../model/node.js';
20
+ import type ModelItem from '../model/item.js';
21
+ import type ModelTextProxy from '../model/textproxy.js';
22
+ import type ModelText from '../model/text.js';
23
+ import type DowncastWriter from '../view/downcastwriter.js';
24
+ import type ElementDefinition from '../view/elementdefinition.js';
25
+ import type UIElement from '../view/uielement.js';
26
+ import type ViewElement from '../view/element.js';
27
27
  import { type EventInfo, type PriorityString } from '@ckeditor/ckeditor5-utils';
28
28
  /**
29
29
  * Downcast conversion helper functions.
@@ -203,42 +203,6 @@ export default class DowncastHelpers extends ConversionHelpers<DowncastDispatche
203
203
  * The children of the model's `<table>` element will be inserted into the `<tbody>` element.
204
204
  * If the `elementToElement()` helper was used, the children would be inserted into the `<figure>`.
205
205
  *
206
- * An example converter that converts the following model structure:
207
- *
208
- * ```xml
209
- * <wrappedParagraph>Some text.</wrappedParagraph>
210
- * ```
211
- *
212
- * into this structure in the view:
213
- *
214
- * ```html
215
- * <div class="wrapper">
216
- * <p>Some text.</p>
217
- * </div>
218
- * ```
219
- *
220
- * would look like this:
221
- *
222
- * ```ts
223
- * editor.conversion.for( 'downcast' ).elementToStructure( {
224
- * model: 'wrappedParagraph',
225
- * view: ( modelElement, conversionApi ) => {
226
- * const { writer } = conversionApi;
227
- *
228
- * const wrapperViewElement = writer.createContainerElement( 'div', { class: 'wrapper' } );
229
- * const paragraphViewElement = writer.createContainerElement( 'p' );
230
- *
231
- * writer.insert( writer.createPositionAt( wrapperViewElement, 0 ), paragraphViewElement );
232
- * writer.insert( writer.createPositionAt( paragraphViewElement, 0 ), writer.createSlot() );
233
- *
234
- * return wrapperViewElement;
235
- * }
236
- * } );
237
- * ```
238
- *
239
- * The `createSlot()` function can also take a callback that allows filtering which children of the model element
240
- * should be converted into this slot.
241
- *
242
206
  * Imagine a table feature where for this model structure:
243
207
  *
244
208
  * ```xml
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
@@ -7,13 +7,14 @@
7
7
  *
8
8
  * @module engine/conversion/downcasthelpers
9
9
  */
10
- import ModelRange from '../model/range';
11
- import ModelSelection from '../model/selection';
12
- import ModelDocumentSelection from '../model/documentselection';
13
- import ModelElement from '../model/element';
14
- import ModelPosition from '../model/position';
15
- import ViewAttributeElement from '../view/attributeelement';
16
- import ConversionHelpers from './conversionhelpers';
10
+ import ModelRange from '../model/range.js';
11
+ import ModelSelection from '../model/selection.js';
12
+ import ModelDocumentSelection from '../model/documentselection.js';
13
+ import ModelElement from '../model/element.js';
14
+ import ModelPosition from '../model/position.js';
15
+ import ViewAttributeElement from '../view/attributeelement.js';
16
+ import ConversionHelpers from './conversionhelpers.js';
17
+ import StylesMap from '../view/stylesmap.js';
17
18
  import { CKEditorError, toArray } from '@ckeditor/ckeditor5-utils';
18
19
  import { cloneDeep } from 'lodash-es';
19
20
  /**
@@ -188,42 +189,6 @@ export default class DowncastHelpers extends ConversionHelpers {
188
189
  * The children of the model's `<table>` element will be inserted into the `<tbody>` element.
189
190
  * If the `elementToElement()` helper was used, the children would be inserted into the `<figure>`.
190
191
  *
191
- * An example converter that converts the following model structure:
192
- *
193
- * ```xml
194
- * <wrappedParagraph>Some text.</wrappedParagraph>
195
- * ```
196
- *
197
- * into this structure in the view:
198
- *
199
- * ```html
200
- * <div class="wrapper">
201
- * <p>Some text.</p>
202
- * </div>
203
- * ```
204
- *
205
- * would look like this:
206
- *
207
- * ```ts
208
- * editor.conversion.for( 'downcast' ).elementToStructure( {
209
- * model: 'wrappedParagraph',
210
- * view: ( modelElement, conversionApi ) => {
211
- * const { writer } = conversionApi;
212
- *
213
- * const wrapperViewElement = writer.createContainerElement( 'div', { class: 'wrapper' } );
214
- * const paragraphViewElement = writer.createContainerElement( 'p' );
215
- *
216
- * writer.insert( writer.createPositionAt( wrapperViewElement, 0 ), paragraphViewElement );
217
- * writer.insert( writer.createPositionAt( paragraphViewElement, 0 ), writer.createSlot() );
218
- *
219
- * return wrapperViewElement;
220
- * }
221
- * } );
222
- * ```
223
- *
224
- * The `createSlot()` function can also take a callback that allows filtering which children of the model element
225
- * should be converted into this slot.
226
- *
227
192
  * Imagine a table feature where for this model structure:
228
193
  *
229
194
  * ```xml
@@ -1389,15 +1354,24 @@ function changeAttribute(attributeCreator) {
1389
1354
  // First remove the old attribute if there was one.
1390
1355
  if (data.attributeOldValue !== null && oldAttribute) {
1391
1356
  if (oldAttribute.key == 'class') {
1392
- const classes = toArray(oldAttribute.value);
1357
+ const classes = typeof oldAttribute.value == 'string' ? oldAttribute.value.split(/\s+/) : oldAttribute.value;
1393
1358
  for (const className of classes) {
1394
1359
  viewWriter.removeClass(className, viewElement);
1395
1360
  }
1396
1361
  }
1397
1362
  else if (oldAttribute.key == 'style') {
1398
- const keys = Object.keys(oldAttribute.value);
1399
- for (const key of keys) {
1400
- viewWriter.removeStyle(key, viewElement);
1363
+ if (typeof oldAttribute.value == 'string') {
1364
+ const styles = new StylesMap(viewWriter.document.stylesProcessor);
1365
+ styles.setTo(oldAttribute.value);
1366
+ for (const [key] of styles.getStylesEntries()) {
1367
+ viewWriter.removeStyle(key, viewElement);
1368
+ }
1369
+ }
1370
+ else {
1371
+ const keys = Object.keys(oldAttribute.value);
1372
+ for (const key of keys) {
1373
+ viewWriter.removeStyle(key, viewElement);
1374
+ }
1401
1375
  }
1402
1376
  }
1403
1377
  else {
@@ -1407,15 +1381,24 @@ function changeAttribute(attributeCreator) {
1407
1381
  // Then set the new attribute.
1408
1382
  if (data.attributeNewValue !== null && newAttribute) {
1409
1383
  if (newAttribute.key == 'class') {
1410
- const classes = toArray(newAttribute.value);
1384
+ const classes = typeof newAttribute.value == 'string' ? newAttribute.value.split(/\s+/) : newAttribute.value;
1411
1385
  for (const className of classes) {
1412
1386
  viewWriter.addClass(className, viewElement);
1413
1387
  }
1414
1388
  }
1415
1389
  else if (newAttribute.key == 'style') {
1416
- const keys = Object.keys(newAttribute.value);
1417
- for (const key of keys) {
1418
- viewWriter.setStyle(key, newAttribute.value[key], viewElement);
1390
+ if (typeof newAttribute.value == 'string') {
1391
+ const styles = new StylesMap(viewWriter.document.stylesProcessor);
1392
+ styles.setTo(newAttribute.value);
1393
+ for (const [key, value] of styles.getStylesEntries()) {
1394
+ viewWriter.setStyle(key, value, viewElement);
1395
+ }
1396
+ }
1397
+ else {
1398
+ const keys = Object.keys(newAttribute.value);
1399
+ for (const key of keys) {
1400
+ viewWriter.setStyle(key, newAttribute.value[key], viewElement);
1401
+ }
1419
1402
  }
1420
1403
  }
1421
1404
  else {
@@ -1,19 +1,19 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/mapper
7
7
  */
8
- import ModelPosition from '../model/position';
9
- import ModelRange from '../model/range';
10
- import ViewPosition from '../view/position';
11
- import ViewRange from '../view/range';
12
- import type ViewDocumentFragment from '../view/documentfragment';
13
- import type ViewElement from '../view/element';
14
- import type ModelElement from '../model/element';
15
- import type ModelDocumentFragment from '../model/documentfragment';
16
- import type ViewNode from '../view/node';
8
+ import ModelPosition from '../model/position.js';
9
+ import ModelRange from '../model/range.js';
10
+ import ViewPosition from '../view/position.js';
11
+ import ViewRange from '../view/range.js';
12
+ import type ViewDocumentFragment from '../view/documentfragment.js';
13
+ import type ViewElement from '../view/element.js';
14
+ import type ModelElement from '../model/element.js';
15
+ import type ModelDocumentFragment from '../model/documentfragment.js';
16
+ import type ViewNode from '../view/node.js';
17
17
  declare const Mapper_base: {
18
18
  new (): import("@ckeditor/ckeditor5-utils").Emitter;
19
19
  prototype: import("@ckeditor/ckeditor5-utils").Emitter;
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/mapper
7
7
  */
8
- import ModelPosition from '../model/position';
9
- import ModelRange from '../model/range';
10
- import ViewPosition from '../view/position';
11
- import ViewRange from '../view/range';
12
- import ViewText from '../view/text';
8
+ import ModelPosition from '../model/position.js';
9
+ import ModelRange from '../model/range.js';
10
+ import ViewPosition from '../view/position.js';
11
+ import ViewRange from '../view/range.js';
12
+ import ViewText from '../view/text.js';
13
13
  import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
14
14
  /**
15
15
  * Maps elements, positions and markers between the {@link module:engine/view/document~Document view} and
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/modelconsumable
7
7
  */
8
- import TextProxy from '../model/textproxy';
9
- import type Item from '../model/item';
10
- import type Selection from '../model/selection';
11
- import type DocumentSelection from '../model/documentselection';
12
- import type Range from '../model/range';
8
+ import TextProxy from '../model/textproxy.js';
9
+ import type Item from '../model/item.js';
10
+ import type Selection from '../model/selection.js';
11
+ import type DocumentSelection from '../model/documentselection.js';
12
+ import type Range from '../model/range.js';
13
13
  /**
14
14
  * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.
15
15
  *
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/modelconsumable
7
7
  */
8
- import TextProxy from '../model/textproxy';
8
+ import TextProxy from '../model/textproxy.js';
9
9
  import { CKEditorError } from '@ckeditor/ckeditor5-utils';
10
10
  /**
11
11
  * Manages a list of consumable values for the {@link module:engine/model/item~Item model items}.
@@ -1,22 +1,22 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/upcastdispatcher
7
7
  */
8
- import ViewConsumable from './viewconsumable';
9
- import ModelRange from '../model/range';
10
- import ModelPosition from '../model/position';
11
- import type ModelElement from '../model/element';
12
- import type ModelNode from '../model/node';
13
- import type ViewElement from '../view/element';
14
- import type ViewText from '../view/text';
15
- import type ViewDocumentFragment from '../view/documentfragment';
16
- import type ModelDocumentFragment from '../model/documentfragment';
17
- import type { default as Schema, SchemaContextDefinition } from '../model/schema';
18
- import type ModelWriter from '../model/writer';
19
- import type ViewItem from '../view/item';
8
+ import ViewConsumable from './viewconsumable.js';
9
+ import ModelRange from '../model/range.js';
10
+ import ModelPosition from '../model/position.js';
11
+ import type ModelElement from '../model/element.js';
12
+ import type ModelNode from '../model/node.js';
13
+ import type ViewElement from '../view/element.js';
14
+ import type ViewText from '../view/text.js';
15
+ import type ViewDocumentFragment from '../view/documentfragment.js';
16
+ import type ModelDocumentFragment from '../model/documentfragment.js';
17
+ import type { default as Schema, SchemaContextDefinition } from '../model/schema.js';
18
+ import type ModelWriter from '../model/writer.js';
19
+ import type ViewItem from '../view/item.js';
20
20
  declare const UpcastDispatcher_base: {
21
21
  new (): import("@ckeditor/ckeditor5-utils").Emitter;
22
22
  prototype: import("@ckeditor/ckeditor5-utils").Emitter;
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/conversion/upcastdispatcher
7
7
  */
8
- import ViewConsumable from './viewconsumable';
9
- import ModelRange from '../model/range';
10
- import ModelPosition from '../model/position';
11
- import { SchemaContext } from '../model/schema'; // eslint-disable-line no-duplicate-imports
12
- import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';
8
+ import ViewConsumable from './viewconsumable.js';
9
+ import ModelRange from '../model/range.js';
10
+ import ModelPosition from '../model/position.js';
11
+ import { SchemaContext } from '../model/schema.js'; // eslint-disable-line no-duplicate-imports
12
+ import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';
13
13
  import { CKEditorError, EmitterMixin } from '@ckeditor/ckeditor5-utils';
14
14
  /**
15
15
  * Upcast dispatcher is a central point of the view-to-model conversion, which is a process of
@@ -1,16 +1,16 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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 ClassPatterns, type MatcherPattern, type PropertyPatterns } from '../view/matcher';
6
- import ConversionHelpers from './conversionhelpers';
7
- import type { default as UpcastDispatcher, UpcastConversionApi, UpcastConversionData } from './upcastdispatcher';
8
- import type ModelElement from '../model/element';
9
- import type { ViewDocumentFragment, ViewElement, ViewText } from '../index';
10
- import type Mapper from './mapper';
11
- import type Model from '../model/model';
12
- import type ViewSelection from '../view/selection';
13
- import type ViewDocumentSelection from '../view/documentselection';
5
+ import { type ClassPatterns, type MatcherPattern, type PropertyPatterns } from '../view/matcher.js';
6
+ import ConversionHelpers from './conversionhelpers.js';
7
+ import type { default as UpcastDispatcher, UpcastConversionApi, UpcastConversionData } from './upcastdispatcher.js';
8
+ import type ModelElement from '../model/element.js';
9
+ import type { ViewDocumentFragment, ViewElement, ViewText } from '../index.js';
10
+ import type Mapper from './mapper.js';
11
+ import type Model from '../model/model.js';
12
+ import type ViewSelection from '../view/selection.js';
13
+ import type ViewDocumentSelection from '../view/documentselection.js';
14
14
  import { type EventInfo, type PriorityString } from '@ckeditor/ckeditor5-utils';
15
15
  /**
16
16
  * Contains the {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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 Matcher from '../view/matcher';
6
- import ConversionHelpers from './conversionhelpers';
7
- import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing';
5
+ import Matcher from '../view/matcher.js';
6
+ import ConversionHelpers from './conversionhelpers.js';
7
+ import { isParagraphable, wrapInParagraph } from '../model/utils/autoparagraphing.js';
8
8
  import { priorities } from '@ckeditor/ckeditor5-utils';
9
9
  import { cloneDeep } from 'lodash-es';
10
10
  /**
@@ -776,15 +776,15 @@ function normalizeViewAttributeKeyValueConfig(config) {
776
776
  config.view = { key: config.view };
777
777
  }
778
778
  const key = config.view.key;
779
+ const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
779
780
  let normalized;
780
781
  if (key == 'class' || key == 'style') {
781
782
  const keyName = key == 'class' ? 'classes' : 'styles';
782
783
  normalized = {
783
- [keyName]: config.view.value
784
+ [keyName]: value
784
785
  };
785
786
  }
786
787
  else {
787
- const value = typeof config.view.value == 'undefined' ? /[\s\S]*/ : config.view.value;
788
788
  normalized = {
789
789
  attributes: {
790
790
  [key]: value
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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 Element from '../view/element';
6
- import type Node from '../view/node';
7
- import type Text from '../view/text';
8
- import type DocumentFragment from '../view/documentfragment';
9
- import type { Match } from '../view/matcher';
5
+ import type Element from '../view/element.js';
6
+ import type Node from '../view/node.js';
7
+ import type Text from '../view/text.js';
8
+ import type DocumentFragment from '../view/documentfragment.js';
9
+ import type { Match } from '../view/matcher.js';
10
10
  /**
11
11
  * Class used for handling consumption of view {@link module:engine/view/element~Element elements},
12
12
  * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/dataprocessor/basichtmlwriter
7
7
  */
8
- import type HtmlWriter from './htmlwriter';
8
+ import type HtmlWriter from './htmlwriter.js';
9
9
  /**
10
10
  * Basic HTML writer. It uses the native `innerHTML` property for basic conversion
11
11
  * from a document fragment to an HTML string.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  import { global } from '@ckeditor/ckeditor5-utils';
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/dataprocessor/dataprocessor
7
7
  */
8
- import type ViewDocumentFragment from '../view/documentfragment';
9
- import type { MatcherPattern } from '../view/matcher';
8
+ import type ViewDocumentFragment from '../view/documentfragment.js';
9
+ import type { MatcherPattern } from '../view/matcher.js';
10
10
  /**
11
11
  * The data processor interface. It should be implemented by actual data processors.
12
12
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  export {};
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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 DomConverter from '../view/domconverter';
6
- import type DataProcessor from './dataprocessor';
7
- import type HtmlWriter from './htmlwriter';
8
- import type ViewDocument from '../view/document';
9
- import type ViewDocumentFragment from '../view/documentfragment';
10
- import type { MatcherPattern } from '../view/matcher';
5
+ import DomConverter from '../view/domconverter.js';
6
+ import type DataProcessor from './dataprocessor.js';
7
+ import type HtmlWriter from './htmlwriter.js';
8
+ import type ViewDocument from '../view/document.js';
9
+ import type ViewDocumentFragment from '../view/documentfragment.js';
10
+ import type { MatcherPattern } from '../view/matcher.js';
11
11
  /**
12
12
  * The HTML data processor class.
13
13
  * This data processor implementation uses HTML as input and output data.
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/dataprocessor/htmldataprocessor
7
7
  */
8
8
  /* globals DOMParser */
9
- import BasicHtmlWriter from './basichtmlwriter';
10
- import DomConverter from '../view/domconverter';
9
+ import BasicHtmlWriter from './basichtmlwriter.js';
10
+ import DomConverter from '../view/domconverter.js';
11
11
  /**
12
12
  * The HTML data processor class.
13
13
  * This data processor implementation uses HTML as input and output data.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  export {};
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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 DomConverter from '../view/domconverter';
6
- import type DataProcessor from './dataprocessor';
7
- import type HtmlWriter from './htmlwriter';
8
- import type ViewDocument from '../view/document';
9
- import type ViewDocumentFragment from '../view/documentfragment';
10
- import type { MatcherPattern } from '../view/matcher';
5
+ import DomConverter from '../view/domconverter.js';
6
+ import type DataProcessor from './dataprocessor.js';
7
+ import type HtmlWriter from './htmlwriter.js';
8
+ import type ViewDocument from '../view/document.js';
9
+ import type ViewDocumentFragment from '../view/documentfragment.js';
10
+ import type { MatcherPattern } from '../view/matcher.js';
11
11
  /**
12
12
  * The XML data processor class.
13
13
  * This data processor implementation uses XML as input and output data.
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2024, 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
5
  /**
6
6
  * @module engine/dataprocessor/xmldataprocessor
7
7
  */
8
8
  /* globals DOMParser */
9
- import BasicHtmlWriter from './basichtmlwriter';
10
- import DomConverter from '../view/domconverter';
9
+ import BasicHtmlWriter from './basichtmlwriter.js';
10
+ import DomConverter from '../view/domconverter.js';
11
11
  /**
12
12
  * The XML data processor class.
13
13
  * This data processor implementation uses XML as input and output data.