Browse Source

Rename downcast-converters from module:engine/conversion to downcasthelpers.

Maciej Gołaszewski 7 years ago
parent
commit
2c0a930be5

+ 2 - 2
packages/ckeditor5-engine/src/controller/datacontroller.js

@@ -14,10 +14,10 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 import Mapper from '../conversion/mapper';
 
 import DowncastDispatcher from '../conversion/downcastdispatcher';
-import { insertText } from '../conversion/downcast-converters';
+import { insertText } from '../conversion/downcasthelpers';
 
 import UpcastDispatcher from '../conversion/upcastdispatcher';
-import { convertText, convertToModelFragment } from '../conversion/upcast-converters';
+import { convertText, convertToModelFragment } from '../conversion/upcasthelpers';
 
 import ViewDocumentFragment from '../view/documentfragment';
 import ViewDocument from '../view/document';

+ 1 - 1
packages/ckeditor5-engine/src/controller/editingcontroller.js

@@ -11,7 +11,7 @@ import RootEditableElement from '../view/rooteditableelement';
 import View from '../view/view';
 import Mapper from '../conversion/mapper';
 import DowncastDispatcher from '../conversion/downcastdispatcher';
-import { insertText, remove } from '../conversion/downcast-converters';
+import { insertText, remove } from '../conversion/downcasthelpers';
 import { convertSelectionChange } from '../conversion/upcast-selection-converters';
 import { clearAttributes, convertCollapsedSelection, convertRangeSelection } from '../conversion/downcast-selection-converters';
 

+ 17 - 22
packages/ckeditor5-engine/src/conversion/conversion.js

@@ -38,8 +38,8 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
  *
  * The functions used in `add()` calls are one-way converters (i.e. you need to remember yourself to add
  * a converter in the other direction, if your feature requires that). They are also called "conversion helpers".
- * You can find a set of them in the {@link module:engine/conversion/downcast-converters} and
- * {@link module:engine/conversion/upcast-converters} modules.
+ * You can find a set of them in the {@link module:engine/conversion/downcasthelpers} and
+ * {@link module:engine/conversion/upcasthelpers} modules.
  *
  * Besides allowing to register converters to specific dispatchers, you can also use methods available in this
  * class to add two-way converters (upcast and downcast):
@@ -76,8 +76,8 @@ export default class Conversion {
 	 * module:engine/conversion/upcastdispatcher~UpcastDispatcher|Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
 	 * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} options.dispatcher Dispatcher or array of dispatchers to register
 	 * under the given name.
-	 * @param {module:engine/conversion/downcast-converters~DowncastHelpers|
-	 * module:engine/conversion/upcast-converters~UpcastHelpers} helpers
+	 * @param {module:engine/conversion/downcasthelpers~DowncastHelpers|
+	 * module:engine/conversion/upcasthelpers~UpcastHelpers} helpers
 	 */
 	register( name, group ) {
 		if ( this._dispatchersGroups.has( name ) ) {
@@ -92,7 +92,6 @@ export default class Conversion {
 		this._dispatchersGroups.set( name, group );
 	}
 
-	/* eslint-disable max-len */
 	/**
 	 * Provides chainable API to assign converters to dispatchers registered under a given group name. Converters are added
 	 * by calling the {@link module:engine/conversion/conversion~ConversionHelpers#add `.add()`} method of an
@@ -113,18 +112,18 @@ export default class Conversion {
 	 *
 	 * For downcast (model-to-view conversion), these are:
 	 *
-	 * * {@link module:engine/conversion/downcast-converters~DowncastHelpers#elementToElement Downcast element-to-element converter},
-	 * * {@link module:engine/conversion/downcast-converters~DowncastHelpers#attributeToElement Downcast attribute-to-element converter},
-	 * * {@link module:engine/conversion/downcast-converters~DowncastHelpers#attributeToAttribute Downcast attribute-to-attribute converter}.
-	 * * {@link module:engine/conversion/downcast-converters~DowncastHelpers#markerToElement Downcast marker-to-element converter}.
-	 * * {@link module:engine/conversion/downcast-converters~DowncastHelpers#markerToHighlight Downcast marker-to-highlight converter}.
+	 * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement Downcast element-to-element converter},
+	 * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement Downcast attribute-to-element converter},
+	 * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute Downcast attribute-to-attribute converter}.
+	 * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement Downcast marker-to-element converter}.
+	 * * {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight Downcast marker-to-highlight converter}.
 	 *
 	 * For upcast (view-to-model conversion), these are:
 	 *
-	 * * {@link module:engine/conversion/upcast-converters~UpcastHelpers#elementToElement Upcast element-to-element converter},
-	 * * {@link module:engine/conversion/upcast-converters~UpcastHelpers#elementToAttribute Upcast attribute-to-element converter},
-	 * * {@link module:engine/conversion/upcast-converters~UpcastHelpers#attributeToAttribute Upcast attribute-to-attribute converter}.
-	 * * {@link module:engine/conversion/upcast-converters~UpcastHelpers#elementToMarker Upcast element-to-marker converter}.
+	 * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement Upcast element-to-element converter},
+	 * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute Upcast attribute-to-element converter},
+	 * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute Upcast attribute-to-attribute converter}.
+	 * * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker Upcast element-to-marker converter}.
 	 *
 	 * An example of using conversion helpers to convert the `paragraph` model element to the `p` view element (and back):
 	 *
@@ -136,10 +135,8 @@ export default class Conversion {
 	 *		editor.conversion.for( 'upcast' ).elementToElement( config ) );
 	 *
 	 * @param {String} groupName The name of dispatchers group to add the converters to.
-	 * @returns {module:engine/conversion/conversion~ConversionHelpers|module:engine/conversion/downcast-converters~DowncastHelpers|
-	 * module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers| module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
-	/* eslint-enable max-len */
 	for( groupName ) {
 		const group = this._getDispatchersGroup( groupName );
 
@@ -574,7 +571,7 @@ export default class Conversion {
  * @property {String} name Group name
  * @property {Array.<module:engine/conversion/downcastdispatcher~DowncastDispatcher|
  * module:engine/conversion/upcastdispatcher~UpcastDispatcher>} dispatchers
- * @property {module:engine/conversion/downcast-converters~DowncastHelpers|module:engine/conversion/upcast-converters~UpcastHelpers} helpers
+ * @property {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers} helpers
  */
 
 // Helper function that creates a joint array out of an item passed in `definition.view` and items passed in
@@ -609,8 +606,7 @@ function* _getUpcastDefinition( model, view, upcastAlso ) {
 }
 
 /**
- * Base class for conversion utilises.
- *
+ * Base class for conversion helpers.
  */
 export class ConversionHelpers {
 	/**
@@ -630,8 +626,7 @@ export class ConversionHelpers {
 	 * method description
 	 *
 	 * @param {Function} conversionHelper The function to be called on event.
-	 * @returns {module:engine/conversion/conversion~ConversionHelpers|module:engine/conversion/downcast-converters~DowncastHelpers|
-	 * module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers| module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
 	add( conversionHelper ) {
 		this._addToDispatchers( conversionHelper );

+ 18 - 18
packages/ckeditor5-engine/src/conversion/downcast-converters.js

@@ -17,7 +17,7 @@ import { cloneDeep } from 'lodash-es';
 /**
  * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.
  *
- * @module engine/conversion/downcast-converters
+ * @module engine/conversion/downcasthelpers
  */
 
 /**
@@ -66,7 +66,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
 	 * that takes the model element and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}
 	 * as parameters and returns a view container element.
-	 * @returns {module:engine/conversion/downcast-converters~DowncastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
 	 */
 	elementToElement( config ) {
 		return this.add( _downcastElementToElement( config ) );
@@ -151,7 +151,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * as parameters and returns a view attribute element. If `config.model.values` is
 	 * given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/downcast-converters~DowncastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
 	 */
 	attributeToElement( config ) {
 		return this.add( _downcastAttributeToElement( config ) );
@@ -217,7 +217,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to
 	 * `{ key, value }` objects or a functions.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/downcast-converters~DowncastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
 	 */
 	attributeToAttribute( config ) {
 		return this.add( _downcastAttributeToAttribute( config ) );
@@ -279,7 +279,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function
 	 * that takes the model marker data as a parameter and returns a view UI element.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/downcast-converters~DowncastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
 	 */
 	markerToElement( config ) {
 		return this.add( _downcastMarkerToElement( config ) );
@@ -289,7 +289,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * Model marker to highlight conversion helper.
 	 *
 	 * This conversion results in creating a highlight on view nodes. For this kind of conversion,
-	 * {@link module:engine/conversion/downcast-converters~HighlightDescriptor} should be provided.
+	 * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.
 	 *
 	 * For text nodes, a `<span>` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes
 	 * in the converted marker range. For example, a model marker set like this: `<paragraph>F[oo b]ar</paragraph>` becomes
@@ -326,7 +326,7 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 *
 	 * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function
 	 * receives the `data` object as a parameter and should return a
-	 * {@link module:engine/conversion/downcast-converters~HighlightDescriptor highlight descriptor}.
+	 * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.
 	 * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.
 	 *
 	 * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter
@@ -335,10 +335,10 @@ export default class DowncastHelpers extends ConversionHelpers {
 	 * @method #markerToHighlight
 	 * @param {Object} config Conversion configuration.
 	 * @param {String} config.model The name of the model marker (or model marker group) to convert.
-	 * @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} config.view A highlight descriptor
+	 * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
 	 * that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/downcast-converters~DowncastHelpers}
+	 * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}
 	 */
 	markerToHighlight( config ) {
 		return this.add( _downcastMarkerToHighlight( config ) );
@@ -734,7 +734,7 @@ export function wrap( elementCreator ) {
 /**
  * Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with
  * {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.
- * See {link module:engine/conversion/downcast-converters~createViewElementFromHighlightDescriptor}.
+ * See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.
  *
  * It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be
  * created and the selection will be put inside it.
@@ -746,7 +746,7 @@ export function wrap( elementCreator ) {
  * This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name
  * using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  *
- * @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} highlightDescriptor
+ * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  * @returns {Function}
  */
 export function highlightText( highlightDescriptor ) {
@@ -809,7 +809,7 @@ export function highlightText( highlightDescriptor ) {
  * This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using
  * the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.
  *
- * @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} highlightDescriptor
+ * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  * @returns {Function}
  */
 export function highlightElement( highlightDescriptor ) {
@@ -856,7 +856,7 @@ export function highlightElement( highlightDescriptor ) {
  * Both text nodes and elements are handled by this converter but they are handled a bit differently.
  *
  * Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the
- * provided highlight descriptor. See {link module:engine/conversion/downcast-converters~HighlightDescriptor}.
+ * provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.
  *
  * For elements, the converter checks if an element has the `removeHighlight` function stored as a
  * {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.
@@ -871,7 +871,7 @@ export function highlightElement( highlightDescriptor ) {
  *
  * This converter unbinds elements from the marker name.
  *
- * @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} highlightDescriptor
+ * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor
  * @returns {Function}
  */
 export function removeHighlight( highlightDescriptor ) {
@@ -916,10 +916,10 @@ export function removeHighlight( highlightDescriptor ) {
 
 /**
  * Creates a `<span>` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information
- * provided by the {@link module:engine/conversion/downcast-converters~HighlightDescriptor highlight descriptor} object. If a priority
+ * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If a priority
  * is not provided in the descriptor, the default priority will be used.
  *
- * @param {module:engine/conversion/downcast-converters~HighlightDescriptor} descriptor
+ * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor
  * @returns {module:engine/view/attributeelement~AttributeElement}
  */
 export function createViewElementFromHighlightDescriptor( descriptor ) {
@@ -1062,7 +1062,7 @@ function _downcastMarkerToElement( config ) {
 //
 // @param {Object} config Conversion configuration.
 // @param {String} config.model The name of the model marker (or model marker group) to convert.
-// @param {module:engine/conversion/downcast-converters~HighlightDescriptor|Function} config.view A highlight descriptor
+// @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor
 // that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.
 // @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
 // @returns {Function} Conversion helper.
@@ -1217,7 +1217,7 @@ function _prepareDescriptor( highlightDescriptor, data, conversionApi ) {
  *  * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the
  *  given ID from the element.
  *
- * @typedef {Object} module:engine/conversion/downcast-converters~HighlightDescriptor
+ * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor
  *
  * @property {String|Array.<String>} classes A CSS class or an array of classes to set. If the descriptor is used to
  * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set

+ 7 - 7
packages/ckeditor5-engine/src/conversion/upcast-converters.js

@@ -13,7 +13,7 @@ import { cloneDeep } from 'lodash-es';
  * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for
  * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.
  *
- * @module engine/conversion/upcast-converters
+ * @module engine/conversion/upcasthelpers
  */
 
 /**
@@ -69,7 +69,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element
 	 * instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
 	elementToElement( config ) {
 		return this.add( _upcastElementToElement( config ) );
@@ -87,7 +87,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 *
 	 * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).
 	 * Even though `<strong>` is over `<p>` element, `bold="true"` was added to the text. See
-	 * {@link module:engine/conversion/upcast-converters~UpcastHelpers#attributeToAttribute} for comparison.
+	 * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.
 	 *
 	 * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.
 	 *
@@ -155,7 +155,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 * the model attribute. `value` property may be set as a function that takes a view element and returns the value.
 	 * If `String` is given, the model attribute value will be set to `true`.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
 	elementToAttribute( config ) {
 		return this.add( _upcastElementToAttribute( config ) );
@@ -173,7 +173,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 *		<div class="dark"><div>foo</div></div>    -->    <div dark="true"><div>foo</div></div>
 	 *
 	 * Above, `class="dark"` attribute is added only to the `<div>` elements that has it. This is in contrary to
-	 * {@link module:engine/conversion/upcast-converters~UpcastHelpers#elementToAttribute} which sets attributes for
+	 * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for
 	 * all the children in the model:
 	 *
 	 *		<strong>Foo</strong>   -->   <strong><p>Foo</p></strong>   -->   <paragraph><$text bold="true">Foo</$text></paragraph>
@@ -249,7 +249,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 * the model attribute. `value` property may be set as a function that takes a view element and returns the value.
 	 * If `String` is given, the model attribute value will be same as view attribute value.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.
-	 * @returns {module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
 	attributeToAttribute( config ) {
 		return this.add( _upcastAttributeToAttribute( config ) );
@@ -298,7 +298,7 @@ export default class UpcastHelpers extends ConversionHelpers {
 	 * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns
 	 * a model marker name.
 	 * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.
-	 * @returns {module:engine/conversion/upcast-converters~UpcastHelpers}
+	 * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}
 	 */
 	elementToMarker( config ) {
 		return this.add( _upcastElementToMarker( config ) );

+ 1 - 1
packages/ckeditor5-engine/src/dev-utils/model.js

@@ -32,7 +32,7 @@ import {
 	convertRangeSelection,
 	convertCollapsedSelection,
 } from '../conversion/downcast-selection-converters';
-import { insertText, insertElement, wrap, insertUIElement } from '../conversion/downcast-converters';
+import { insertText, insertElement, wrap, insertUIElement } from '../conversion/downcasthelpers';
 
 import { isPlainObject } from 'lodash-es';
 import toMap from '@ckeditor/ckeditor5-utils/src/tomap';

+ 2 - 2
packages/ckeditor5-engine/src/model/markercollection.js

@@ -300,9 +300,9 @@ mix( MarkerCollection, EmitterMixin );
  *
  * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and
  * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.
- * Use {@link module:engine/conversion/downcast-converters downcast converters} or attach a custom converter to mentioned events.
+ * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.
  * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.
- * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcast-converters upcast converters} or
+ * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or
  * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.
  *
  * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes

+ 2 - 2
packages/ckeditor5-engine/tests/controller/datacontroller.js

@@ -18,8 +18,8 @@ import { parse as parseView, stringify as stringifyView } from '../../src/dev-ut
 
 import count from '@ckeditor/ckeditor5-utils/src/count';
 
-import UpcastHelpers from '../../src/conversion/upcast-converters';
-import DowncastHelpers from '../../src/conversion/downcast-converters';
+import UpcastHelpers from '../../src/conversion/upcasthelpers';
+import DowncastHelpers from '../../src/conversion/downcasthelpers';
 
 describe( 'DataController', () => {
 	let model, modelDocument, htmlDataProcessor, data, schema, upcastHelpers, downcastHelpers;

+ 1 - 1
packages/ckeditor5-engine/tests/controller/editingcontroller.js

@@ -14,7 +14,7 @@ import View from '../../src/view/view';
 import Mapper from '../../src/conversion/mapper';
 import DowncastDispatcher from '../../src/conversion/downcastdispatcher';
 
-import DowncastHelpers from '../../src/conversion/downcast-converters';
+import DowncastHelpers from '../../src/conversion/downcasthelpers';
 import Model from '../../src/model/model';
 import ModelPosition from '../../src/model/position';
 import ModelRange from '../../src/model/range';

+ 8 - 8
packages/ckeditor5-engine/tests/conversion/conversion.js

@@ -8,8 +8,8 @@ import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
 
 import UpcastDispatcher from '../../src/conversion/upcastdispatcher';
 
-import { upcastHelpers, convertText, convertToModelFragment } from '../../src/conversion/upcast-converters';
-import { downcastHelpers } from '../../src/conversion/downcast-converters';
+import UpcastHelpers, { convertText, convertToModelFragment } from '../../src/conversion/upcasthelpers';
+import DowncastHelpers from '../../src/conversion/downcasthelpers';
 
 import EditingController from '../../src/controller/editingcontroller';
 
@@ -31,15 +31,15 @@ describe( 'Conversion', () => {
 		dispA = Symbol( 'dispA' );
 		dispB = Symbol( 'dispB' );
 
-		conversion.register( { name: 'ab', dispatcher: [ dispA, dispB ] } );
-		conversion.register( { name: 'a', dispatcher: dispA } );
-		conversion.register( { name: 'b', dispatcher: dispB } );
+		conversion.register( 'ab', new UpcastHelpers( [ dispA, dispB ] ) );
+		conversion.register( 'a', new UpcastHelpers( dispA ) );
+		conversion.register( 'b', new UpcastHelpers( dispB ) );
 	} );
 
 	describe( 'register()', () => {
 		it( 'should throw when trying to use same group name twice', () => {
 			expect( () => {
-				conversion.register( { name: 'ab' } );
+				conversion.register( 'ab' );
 			} ).to.throw( CKEditorError, /conversion-register-group-exists/ );
 		} );
 	} );
@@ -118,8 +118,8 @@ describe( 'Conversion', () => {
 			viewDispatcher.on( 'documentFragment', convertToModelFragment(), { priority: 'lowest' } );
 
 			conversion = new Conversion();
-			conversion.register( { name: 'upcast', dispatcher: [ viewDispatcher ], helpers: upcastHelpers } );
-			conversion.register( { name: 'downcast', dispatcher: [ controller.downcastDispatcher ], helpers: downcastHelpers } );
+			conversion.register( 'upcast', new UpcastHelpers( [ viewDispatcher ] ) );
+			conversion.register( 'downcast', new DowncastHelpers( controller.downcastDispatcher ) );
 		} );
 
 		describe( 'elementToElement', () => {

+ 1 - 1
packages/ckeditor5-engine/tests/conversion/downcast-selection-converters.js

@@ -23,7 +23,7 @@ import {
 	highlightElement,
 	highlightText,
 	removeHighlight
-} from '../../src/conversion/downcast-converters';
+} from '../../src/conversion/downcasthelpers';
 
 import createViewRoot from '../view/_utils/createroot';
 import { stringify as stringifyView } from '../../src/dev-utils/view';

+ 1 - 1
packages/ckeditor5-engine/tests/conversion/downcast-converters.js

@@ -23,7 +23,7 @@ import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
 import DowncastHelpers, {
 	insertElement, insertUIElement, changeAttribute, wrap, removeUIElement,
 	highlightElement, highlightText, removeHighlight, createViewElementFromHighlightDescriptor
-} from '../../src/conversion/downcast-converters';
+} from '../../src/conversion/downcasthelpers';
 
 import { stringify } from '../../src/dev-utils/view';
 

+ 1 - 1
packages/ckeditor5-engine/tests/conversion/upcast-converters.js

@@ -19,7 +19,7 @@ import ModelText from '../../src/model/text';
 import ModelRange from '../../src/model/range';
 import ModelPosition from '../../src/model/position';
 
-import UpcastHelpers, { convertToModelFragment, convertText } from '../../src/conversion/upcast-converters';
+import UpcastHelpers, { convertToModelFragment, convertText } from '../../src/conversion/upcasthelpers';
 
 import { stringify } from '../../src/dev-utils/model';