@ckeditor/ckeditor5-engine 31.0.0 → 33.0.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.
- package/LICENSE.md +2 -2
- package/package.json +25 -25
- package/src/controller/datacontroller.js +71 -80
- package/src/controller/editingcontroller.js +83 -6
- package/src/conversion/conversion.js +15 -14
- package/src/conversion/conversionhelpers.js +1 -1
- package/src/conversion/downcastdispatcher.js +298 -367
- package/src/conversion/downcasthelpers.js +771 -63
- package/src/conversion/mapper.js +105 -60
- package/src/conversion/modelconsumable.js +85 -35
- package/src/conversion/upcastdispatcher.js +3 -6
- package/src/conversion/upcasthelpers.js +4 -2
- package/src/conversion/viewconsumable.js +1 -1
- package/src/dataprocessor/basichtmlwriter.js +1 -1
- package/src/dataprocessor/dataprocessor.jsdoc +1 -1
- package/src/dataprocessor/htmldataprocessor.js +9 -31
- package/src/dataprocessor/htmlwriter.js +1 -1
- package/src/dataprocessor/xmldataprocessor.js +1 -1
- package/src/dev-utils/model.js +16 -14
- package/src/dev-utils/operationreplayer.js +1 -1
- package/src/dev-utils/utils.js +1 -1
- package/src/dev-utils/view.js +7 -7
- package/src/index.js +2 -1
- package/src/model/batch.js +77 -10
- package/src/model/differ.js +87 -59
- package/src/model/document.js +13 -4
- package/src/model/documentfragment.js +1 -1
- package/src/model/documentselection.js +1 -1
- package/src/model/element.js +1 -1
- package/src/model/history.js +1 -1
- package/src/model/item.jsdoc +1 -1
- package/src/model/liveposition.js +1 -1
- package/src/model/liverange.js +1 -1
- package/src/model/markercollection.js +29 -5
- package/src/model/model.js +18 -9
- package/src/model/node.js +1 -1
- package/src/model/nodelist.js +1 -1
- package/src/model/operation/attributeoperation.js +1 -1
- package/src/model/operation/detachoperation.js +1 -1
- package/src/model/operation/insertoperation.js +1 -1
- package/src/model/operation/markeroperation.js +1 -1
- package/src/model/operation/mergeoperation.js +1 -1
- package/src/model/operation/moveoperation.js +1 -1
- package/src/model/operation/nooperation.js +1 -1
- package/src/model/operation/operation.js +1 -1
- package/src/model/operation/operationfactory.js +1 -1
- package/src/model/operation/renameoperation.js +1 -1
- package/src/model/operation/rootattributeoperation.js +1 -1
- package/src/model/operation/splitoperation.js +1 -1
- package/src/model/operation/transform.js +1 -1
- package/src/model/operation/utils.js +1 -1
- package/src/model/position.js +1 -1
- package/src/model/range.js +1 -1
- package/src/model/rootelement.js +1 -1
- package/src/model/schema.js +1 -1
- package/src/model/selection.js +1 -1
- package/src/model/text.js +1 -1
- package/src/model/textproxy.js +1 -1
- package/src/model/treewalker.js +1 -1
- package/src/model/utils/autoparagraphing.js +1 -1
- package/src/model/utils/deletecontent.js +1 -1
- package/src/model/utils/getselectedcontent.js +1 -1
- package/src/model/utils/insertcontent.js +1 -1
- package/src/model/utils/modifyselection.js +15 -8
- package/src/model/utils/selection-post-fixer.js +37 -30
- package/src/model/writer.js +17 -27
- package/src/view/attributeelement.js +1 -1
- package/src/view/containerelement.js +1 -1
- package/src/view/document.js +3 -2
- package/src/view/documentfragment.js +1 -1
- package/src/view/documentselection.js +1 -1
- package/src/view/domconverter.js +169 -47
- package/src/view/downcastwriter.js +121 -5
- package/src/view/editableelement.js +1 -1
- package/src/view/element.js +29 -1
- package/src/view/elementdefinition.jsdoc +1 -1
- package/src/view/emptyelement.js +1 -1
- package/src/view/filler.js +1 -1
- package/src/view/item.jsdoc +1 -1
- package/src/view/matcher.js +15 -14
- package/src/view/node.js +1 -1
- package/src/view/observer/arrowkeysobserver.js +1 -1
- package/src/view/observer/bubblingemittermixin.js +1 -1
- package/src/view/observer/bubblingeventinfo.js +1 -1
- package/src/view/observer/clickobserver.js +1 -1
- package/src/view/observer/compositionobserver.js +1 -1
- package/src/view/observer/domeventdata.js +1 -1
- package/src/view/observer/domeventobserver.js +1 -1
- package/src/view/observer/fakeselectionobserver.js +1 -1
- package/src/view/observer/focusobserver.js +1 -1
- package/src/view/observer/inputobserver.js +1 -1
- package/src/view/observer/keyobserver.js +1 -1
- package/src/view/observer/mouseobserver.js +1 -1
- package/src/view/observer/mutationobserver.js +1 -1
- package/src/view/observer/observer.js +1 -1
- package/src/view/observer/selectionobserver.js +3 -3
- package/src/view/placeholder.js +1 -1
- package/src/view/position.js +1 -1
- package/src/view/range.js +1 -1
- package/src/view/rawelement.js +1 -1
- package/src/view/renderer.js +7 -17
- package/src/view/rooteditableelement.js +1 -1
- package/src/view/selection.js +1 -1
- package/src/view/styles/background.js +1 -1
- package/src/view/styles/border.js +1 -1
- package/src/view/styles/margin.js +1 -1
- package/src/view/styles/padding.js +1 -1
- package/src/view/styles/utils.js +1 -1
- package/src/view/stylesmap.js +1 -1
- package/src/view/text.js +1 -1
- package/src/view/textproxy.js +1 -1
- package/src/view/treewalker.js +1 -1
- package/src/view/uielement.js +1 -1
- package/src/view/upcastwriter.js +1 -1
- package/src/view/view.js +1 -1
- package/theme/placeholder.css +10 -1
- package/theme/renderer.css +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
|
|
|
@@ -15,7 +15,7 @@ import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
|
|
|
15
15
|
/**
|
|
16
16
|
* A utility class that helps add converters to upcast and downcast dispatchers.
|
|
17
17
|
*
|
|
18
|
-
* We recommend reading the {@glink framework/guides/
|
|
18
|
+
* We recommend reading the {@glink framework/guides/deep-dive/conversion/intro editor conversion} guide first to
|
|
19
19
|
* understand the core concepts of the conversion mechanisms.
|
|
20
20
|
*
|
|
21
21
|
* An instance of the conversion manager is available in the
|
|
@@ -54,7 +54,7 @@ import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
|
|
|
54
54
|
* * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} –
|
|
55
55
|
* Model attribute to view element and vice versa.
|
|
56
56
|
* * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} –
|
|
57
|
-
* Model attribute to view
|
|
57
|
+
* Model attribute to view attribute and vice versa.
|
|
58
58
|
*/
|
|
59
59
|
export default class Conversion {
|
|
60
60
|
/**
|
|
@@ -102,7 +102,7 @@ export default class Conversion {
|
|
|
102
102
|
|
|
103
103
|
if ( !isUpcast && !isDowncast ) {
|
|
104
104
|
/**
|
|
105
|
-
* Trying to register
|
|
105
|
+
* Trying to register an alias for a dispatcher that nas not been registered.
|
|
106
106
|
*
|
|
107
107
|
* @error conversion-add-alias-dispatcher-not-registered
|
|
108
108
|
*/
|
|
@@ -116,7 +116,7 @@ export default class Conversion {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* Provides a chainable API to assign converters to conversion dispatchers group.
|
|
119
|
+
* Provides a chainable API to assign converters to a conversion dispatchers group.
|
|
120
120
|
*
|
|
121
121
|
* If the given group name has not been registered, the
|
|
122
122
|
* {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.
|
|
@@ -124,7 +124,7 @@ export default class Conversion {
|
|
|
124
124
|
* You can use conversion helpers available directly in the `for()` chain or your custom ones via
|
|
125
125
|
* the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.
|
|
126
126
|
*
|
|
127
|
-
* # Using
|
|
127
|
+
* # Using built-in conversion helpers
|
|
128
128
|
*
|
|
129
129
|
* The `for()` chain comes with a set of conversion helpers which you can use like this:
|
|
130
130
|
*
|
|
@@ -154,7 +154,7 @@ export default class Conversion {
|
|
|
154
154
|
*
|
|
155
155
|
* # Using custom conversion helpers
|
|
156
156
|
*
|
|
157
|
-
* If you need to implement
|
|
157
|
+
* If you need to implement an atypical converter, you can do so by calling:
|
|
158
158
|
*
|
|
159
159
|
* editor.conversion.for( direction ).add( customHelper );
|
|
160
160
|
*
|
|
@@ -191,7 +191,7 @@ export default class Conversion {
|
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Sets up converters between the model and the view that convert a model element to a view element (and vice versa).
|
|
194
|
-
* For example, the model `<paragraph>Foo</paragraph>` is `<p>Foo</p>` in the view.
|
|
194
|
+
* For example, the model `<paragraph>Foo</paragraph>` is turned into `<p>Foo</p>` in the view.
|
|
195
195
|
*
|
|
196
196
|
* // A simple conversion from the `paragraph` model element to the `<p>` view element (and vice versa).
|
|
197
197
|
* editor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );
|
|
@@ -277,7 +277,7 @@ export default class Conversion {
|
|
|
277
277
|
|
|
278
278
|
/**
|
|
279
279
|
* Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).
|
|
280
|
-
* For example, a model text node with `"Foo"` as data and the `bold` attribute
|
|
280
|
+
* For example, a model text node with `"Foo"` as data and the `bold` attribute will be turned to `<strong>Foo</strong>` in the view.
|
|
281
281
|
*
|
|
282
282
|
* // A simple conversion from the `bold=true` attribute to the `<strong>` view element (and vice versa).
|
|
283
283
|
* editor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );
|
|
@@ -427,7 +427,8 @@ export default class Conversion {
|
|
|
427
427
|
* } );
|
|
428
428
|
*
|
|
429
429
|
* The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object
|
|
430
|
-
* describing the attribute key and value to convert or a `String` specifying just the attribute key (
|
|
430
|
+
* describing the attribute key and value to convert or a `String` specifying just the attribute key (in such a case
|
|
431
|
+
* `value` is set to `true`).
|
|
431
432
|
* See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.
|
|
432
433
|
*
|
|
433
434
|
* @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.
|
|
@@ -451,8 +452,8 @@ export default class Conversion {
|
|
|
451
452
|
* Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa). For example,
|
|
452
453
|
* `<imageBlock src='foo.jpg'></imageBlock>` is converted to `<img src='foo.jpg'></img>` (the same attribute key and value).
|
|
453
454
|
* This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.
|
|
454
|
-
* To convert text attributes
|
|
455
|
-
* should be set up.
|
|
455
|
+
* To convert the text attributes,
|
|
456
|
+
* the {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}should be set up.
|
|
456
457
|
*
|
|
457
458
|
* // A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).
|
|
458
459
|
* editor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );
|
|
@@ -527,8 +528,8 @@ export default class Conversion {
|
|
|
527
528
|
* The `definition.model` parameter specifies which model attribute should be converted from and to.
|
|
528
529
|
* It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.
|
|
529
530
|
* The `key` property is the model attribute key to convert from and to.
|
|
530
|
-
* The `values` are the possible model attribute values. If `values` is not set, the model attribute value
|
|
531
|
-
* view attribute value.
|
|
531
|
+
* The `values` are the possible model attribute values. If the `values` parameter is not set, the model attribute value
|
|
532
|
+
* will be the same as the view attribute value.
|
|
532
533
|
* If `name` is set, the conversion will be set up only for model elements with the given name.
|
|
533
534
|
*
|
|
534
535
|
* The `definition.view` parameter specifies which view attribute should be converted from and to.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Copyright (c) 2003-
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
|
|