@ckeditor/ckeditor5-engine 32.0.0 → 34.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 (43) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +2 -1
  3. package/package.json +22 -22
  4. package/src/controller/datacontroller.js +58 -66
  5. package/src/controller/editingcontroller.js +82 -5
  6. package/src/conversion/conversion.js +14 -13
  7. package/src/conversion/downcastdispatcher.js +297 -366
  8. package/src/conversion/downcasthelpers.js +859 -80
  9. package/src/conversion/mapper.js +104 -59
  10. package/src/conversion/modelconsumable.js +84 -34
  11. package/src/conversion/upcastdispatcher.js +33 -6
  12. package/src/conversion/upcasthelpers.js +21 -2
  13. package/src/dataprocessor/htmldataprocessor.js +1 -1
  14. package/src/dev-utils/model.js +13 -11
  15. package/src/index.js +12 -0
  16. package/src/model/batch.js +12 -12
  17. package/src/model/differ.js +114 -68
  18. package/src/model/document.js +32 -31
  19. package/src/model/history.js +160 -22
  20. package/src/model/markercollection.js +28 -4
  21. package/src/model/model.js +122 -4
  22. package/src/model/schema.js +79 -10
  23. package/src/model/treewalker.js +2 -3
  24. package/src/model/utils/deletecontent.js +15 -2
  25. package/src/model/utils/findoptimalinsertionrange.js +68 -0
  26. package/src/model/utils/insertobject.js +173 -0
  27. package/src/model/utils/modifyselection.js +14 -7
  28. package/src/model/writer.js +16 -26
  29. package/src/view/attributeelement.js +0 -10
  30. package/src/view/document.js +2 -1
  31. package/src/view/domconverter.js +47 -11
  32. package/src/view/downcastwriter.js +90 -49
  33. package/src/view/element.js +0 -27
  34. package/src/view/emptyelement.js +0 -3
  35. package/src/view/matcher.js +2 -2
  36. package/src/view/observer/clickobserver.js +0 -1
  37. package/src/view/observer/inputobserver.js +1 -1
  38. package/src/view/observer/tabobserver.js +68 -0
  39. package/src/view/placeholder.js +1 -1
  40. package/src/view/rawelement.js +0 -3
  41. package/src/view/uielement.js +0 -3
  42. package/src/view/view.js +4 -0
  43. package/theme/placeholder.css +9 -0
@@ -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/architecture/editing-engine Editing engine architecture} guide first to
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 element and vice versa.
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 and alias for a dispatcher that nas not been registered.
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 bulit-in conversion helpers
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 a nontypical converter, you can do so by calling:
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 is `<strong>Foo</strong>` in the view.
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 (then `value` is set to `true`).
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 {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}
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 will be the same as the
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.