DifferItemInsert
A single diff item for inserted nodes.
Properties
-
module:engine/model/differ~DifferItemInsert#actionFurther specifies what kind of action led to generating this change.
The action is set in relation to the document state before any change. It means that, for example, if an element was added and then renamed (during the same batch), the action will be set to
'insert', because when compared to the document state before changes, a new element was inserted, and the renaming does not matter from this point of view. -
attributes : Map<string, unknown>module:engine/model/differ~DifferItemInsert#attributesMap of attributes of the inserted element.
-
before : object | undefinedmodule:engine/model/differ~DifferItemInsert#beforeHolds information about the element state before all changes happened.
For example, when
<paragraph textAlign="right">was changed to<codeBlock language="plaintext">,before.namewill be equal to'paragraph'andbefore.attributesmap will have one entry:'textAlign' -> 'right'.The property is available only if the insertion change was due to element rename or refresh (when
actionproperty is'rename'or'refresh'). As such,beforeproperty is never available for text node changes. -
length : numbermodule:engine/model/differ~DifferItemInsert#lengthThe length of an inserted text node. For elements, it is always 1 as each inserted element is counted as a one.
-
name : stringmodule:engine/model/differ~DifferItemInsert#nameThe name of the inserted elements or
'$text'for a text node. -
module:engine/model/differ~DifferItemInsert#positionThe position where the node was inserted.
-
type : 'insert'module:engine/model/differ~DifferItemInsert#typeThe type of diff item.