Skip to content

RoosterJs 8 dom

Jiuqing Song edited this page Jan 12, 2021 · 1 revision

Changes in roosterjs-editor-dom package in RoosterJs 8.0.0

Removed interfaces/types

NodeBlockElement class

(Removed from 8.0.0)

This class still exists, but it was made as private. Using BlockElement interface instead.

StartEndBlockElement class

(Removed from 8.0.0)

This class still exists, but it was made as private. Using BlockElement interface instead.

isRtl function

(Removed from 8.0.0)

adjustNodeInsertPosition function

(Removed from 8.0.0)

It is only used by core API insertNode, so integrate it with the core API.

getRangeFromSelectionPath function

(Removed from 8.0.0)

Use setHtmlWithSelectionPath instead.

Interfaces/Types moved from other packages

safeInstanceOf function

(Moved from roosterjs-cross-window package)

Check if the given object is instance of the target type Reference

HtmlSanitizer class

(Moved from roosterjs-html-santizier package)

Provide the ability to sanitize given HTML with specified options Reference

getEntityFromElement function

(Moved from roosterjs-editor-plugins package)

Get Entity object from an entity root element Reference

cacheGetEventData function

(Moved from roosterjs-editor-core package)

Gets the cached event data by cache key from event object if there is already one. Otherwise, call getter function to create one, and cache it. Reference

clearEventDataCache function

(Moved from roosterjs-editor-core package)

Clear a cached object by its key from an event object Reference

isModifierKey function

(Moved from roosterjs-editor-core package)

Returns true when the event was fired from a modifier key, otherwise false Reference

isCharacterValue function

(Moved from roosterjs-editor-core package)

eturns true when the event was fired from a key that produces a character value Reference

Interfaces/Types moved to other packages

VCell interface

(Moved to roosterjs-editor-types package)

New types/interfaces/enums

arrayPush function

(New in 8.0.0)

A type-safe wrapper for Array.prototype.push.apply() Reference

readFile function

(New in 8.0.0)

Read a file object and invoke a callback function with the data url of this file Reference

VListChain class

(New in 8.0.0)

Represent a chain of list nodes.  Reference

New members:

Name Description
canAppendAtCursor Check if a list with the given start number can be appended next to the last list before cursor
commit After change the lists, commit the change to all lists in this chain to update the list number, and clear the temporary dataset values added to list node
createVListAtBlock Create a VList to wrap the block of the given node, and append to current chain
createListChains Create an array of VListChain from current region in editor

getSelectionRangeInRegion function

(New in 8.0.0)

Get the selection range in the given region Reference

mergeBlocksInRegion function

(New in 8.0.0)

Merge a BlockElement of given node after another node Reference

addRangeToSelection function

(New in 8.0.0)

Add the given range into selection of the given document Reference

deleteSelectedContent function

(New in 8.0.0)

Delete selected content, and return the new positon to select Reference

addSnapshot function

(New in 8.0.0)

Add a new snapshot to the given snapshots data structure Reference

New parameters:

Name Description
isAutoCompleteSnapshot Whether this is a snapshot before auto complete action

canUndoAutoComplete function

(New in 8.0.0)

Whether there is a snapshot added before auto complete and it can be undone now Reference

commitEntity function

(New in 8.0.0)

Commit information of an entity (type, isReadonly, id) into the wrapper node as CSS Classes Reference

getStyles function

(New in 8.0.0)

Get CSS styles of a given element in name-value pair format Reference

setStyles function

(New in 8.0.0)

Set styles to an HTML element. If styles are empty, remove 'style' attribute Reference

Modified existing types/interfaces/enums

ContentTraverser class

Traversing of content inside editor Reference

New base interfaces:

Name Description
IContentTraverser Interface of ContentTraverser, provides traversing of content inside editor.

PositionContentSearcher class

The class that helps search content around a position Reference

New base interfaces:

Name Description
IPositionContentSearcher The interface that helps search content around a position

extractClipboardEvent function

Extract a Clipboard event Reference

New parameters:

Name Description
options An optional option to customize the behavior

VList class

Represent a bullet or a numbering list Reference

New members:

Name Description
getLastItemNumber Get list number of the last item in this VList. If there is no order list item, result will be undefined

Removed members:

Name Description
getFirstOrLastNode No need to have it
Clone this wiki locally