|
@@ -105,13 +105,15 @@ export default class DowncastDispatcher {
|
|
|
/**
|
|
/**
|
|
|
* Creates a `DowncastDispatcher` instance.
|
|
* Creates a `DowncastDispatcher` instance.
|
|
|
*
|
|
*
|
|
|
- * @param {Object} [conversionApi] Interface passed by dispatcher to the events calls.
|
|
|
|
|
|
|
+ * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi
|
|
|
|
|
+ * @param {Object} [conversionApi] Additional properties for interface that will be passed to events fired
|
|
|
|
|
+ * by `DowncastDispatcher`.
|
|
|
*/
|
|
*/
|
|
|
constructor( conversionApi = {} ) {
|
|
constructor( conversionApi = {} ) {
|
|
|
/**
|
|
/**
|
|
|
* Interface passed by dispatcher to the events callbacks.
|
|
* Interface passed by dispatcher to the events callbacks.
|
|
|
*
|
|
*
|
|
|
- * @member {Object}
|
|
|
|
|
|
|
+ * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}
|
|
|
*/
|
|
*/
|
|
|
this.conversionApi = extend( { dispatcher: this }, conversionApi );
|
|
this.conversionApi = extend( { dispatcher: this }, conversionApi );
|
|
|
}
|
|
}
|
|
@@ -487,7 +489,8 @@ export default class DowncastDispatcher {
|
|
|
* @param {Object} data Additional information about the change.
|
|
* @param {Object} data Additional information about the change.
|
|
|
* @param {module:engine/model/item~Item} data.item Inserted item.
|
|
* @param {module:engine/model/item~Item} data.item Inserted item.
|
|
|
* @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
|
|
* @param {module:engine/model/range~Range} data.range Range spanning over inserted item.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -503,7 +506,8 @@ export default class DowncastDispatcher {
|
|
|
* @param {Object} data Additional information about the change.
|
|
* @param {Object} data Additional information about the change.
|
|
|
* @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
|
|
* @param {module:engine/model/position~Position} data.position Position from which the node has been removed.
|
|
|
* @param {Number} data.length Offset size of the removed node.
|
|
* @param {Number} data.length Offset size of the removed node.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -529,7 +533,8 @@ export default class DowncastDispatcher {
|
|
|
* @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
|
|
* @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.
|
|
|
* @param {*} data.attributeNewValue New attribute value.
|
|
* @param {*} data.attributeNewValue New attribute value.
|
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -538,7 +543,8 @@ export default class DowncastDispatcher {
|
|
|
* @event selection
|
|
* @event selection
|
|
|
* @param {module:engine/model/selection~Selection} selection Selection that is converted.
|
|
* @param {module:engine/model/selection~Selection} selection Selection that is converted.
|
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -573,7 +579,8 @@ export default class DowncastDispatcher {
|
|
|
* @param {module:engine/model/range~Range} data.markerRange Marker range.
|
|
* @param {module:engine/model/range~Range} data.markerRange Marker range.
|
|
|
* @param {String} data.markerName Marker name.
|
|
* @param {String} data.markerName Marker name.
|
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
* @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -588,7 +595,8 @@ export default class DowncastDispatcher {
|
|
|
* @param {Object} data Additional information about the change.
|
|
* @param {Object} data Additional information about the change.
|
|
|
* @param {module:engine/model/range~Range} data.markerRange Marker range.
|
|
* @param {module:engine/model/range~Range} data.markerRange Marker range.
|
|
|
* @param {String} data.markerName Marker name.
|
|
* @param {String} data.markerName Marker name.
|
|
|
- * @param {Object} conversionApi Conversion interface to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
|
|
|
|
+ * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface
|
|
|
|
|
+ * to be used by callback, passed in `DowncastDispatcher` constructor.
|
|
|
*/
|
|
*/
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -617,3 +625,36 @@ function shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {
|
|
|
|
|
|
|
|
return !hasCustomHandling;
|
|
return !hasCustomHandling;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}
|
|
|
|
|
+ * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}
|
|
|
|
|
+ * fires it's events.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Stores information about what parts of processed model item are still waiting to be handled. After a piece of model item
|
|
|
|
|
+ * was converted, appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * The {@link module:engine/conversion/mapper~Mapper} instance.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @member {module:engine/conversion/mapper~Mapper} #mapper
|
|
|
|
|
+ */
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate data during conversion.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @member {module:engine/view/downcastwriter~DowncastWriter} #writer
|
|
|
|
|
+ */
|