-
Notifications
You must be signed in to change notification settings - Fork 166
RoosterJs 8 types
(Removed from 8.0.0)
To specify paste type when handle BeforePasteEvent, modify the DOM tree under BeforePasteEvent.fragment directly.
(Removed from 8.0.0)
Use ExtractContentWithDomEvent instead.
(Removed from 8.0.0)
Use ContentChangedEvent instead, check source = ChangeSource.SwitchToDarkMode or ChangeSource.SwitchToLightMode
(Removed from 8.0.0)
Use ClipboardData instead
(Removed from 8.0.0)
Use onExternalContentTransform directly
(moved from roosterjs-editor-core package)
An interface for editor core plugins Reference
Name | Description |
---|---|
pendingFormatState | PendingFormatStatePlugin handles pending format state management |
entity | Entity Plugin handles all operations related to an entity and generate entity specified events |
lifecycle | Copy and paste plugin for handling onCopy and onPaste event |
copyPaste |
Name | Description |
---|---|
copyPlugin | Merged into copyPaste plugin |
pastePlugin | Merged into copyPaste plugin |
Old Name | New Name | Description |
---|---|---|
firefoxTypeAfterLink | TypeAfterLinkPlugin plugin helps workaround a Firefox bug to allow type outside a hyperlink | Callbacks for CSS styles |
(Moved from roosterjs-editor-core package)
Represents the core data structure of an editor Reference
Name | Description |
---|---|
document | This can be calcuated from contentDiv |
scrollContainer | Moved to DOMEventPluginState |
eventHandlerPlugins | No need to have it |
defaultFormat | Moved to LifecyclePluginState |
corePlugins | Merged into plugins |
customData | Moved to LifecyclePluginState |
defaultApi | No need to have it |
currentUndoSnapshot | Moved to UndoPluginState |
cachedSelectionRange | No need to have it |
inDarkMode | Moved to LifecyclePluginState |
darkModeOptions | No need to have it |
(Moved from roosterjs-editor-core package)
A map of all core API functions Reference
Name | Description |
---|---|
ensureTypeInContainer | Ensure user will type into a container element rather than into the editor content DIV directly |
getContent | Get current editor content as HTML string |
restoreUndoSnapshot | Set HTML content to this editor |
setContent | Edit and transform color of elements between light mode and dark mode |
transformColor |
Name | Description |
---|---|
getCustomData | Noe need to have it |
select | Use selectRange instead |
Old Name | New Name | Description |
---|---|---|
editWithUndo | addUndoSnapshot | Call an editing callback with adding undo snapshots around |
(Moved from roosterjs-editor-core package)
The options to specify parameters customizing an editor, used by ctor of Editor class Reference
Name | Description |
---|---|
undoSnapshotService | Undo snapshot service. Use this parameter to customize the undo snapshot service. |
corePluginOverride | A plugin map to override default core Plugin implementation Default value is null |
onExternalContentTransform | Allow propagation of keyboard event |
allowKeyboardEventPropagation | Specify the enabled experimental features |
experimentalFeatures |
Name | Description |
---|---|
undo | Use undoSnapshotService instead |
disableRestoreSelectionOnFocus | No need to have it |
omitContentEditableAttributeChanges | Set contenteditable attribute on editor DIV directly instead |
additionalEditFeatures | Call IEditor.addContentEditFeature instead |
darkModeOptions | Use onExternalContentTransform instead |
customData | No need to have it |
enableExperimentFeatures | Use experimentalFeatures instead |
(Moved from roosterjs-editor-core package)
ContentEditFeature interface that handles keyboard event Reference
(Moved from roosterjs-editor-core package)
Generic ContentEditFeature interface Reference
(Moved from roosterjs-editor-core package)
Interface of an editor plugin Reference
(Moved from roosterjs-editor-core package)
Create a DocumentFragment for paste from a ClipboardData Reference
(Moved from roosterjs-editor-core package)
Focus to editor. If there is a cached selection range, use it as current selection Reference
(Moved from roosterjs-editor-core package)
Get current or cached selection range Reference
(Moved from roosterjs-editor-core package)
Get style based format state from current selection, including font name/size and colors Reference
(Moved from roosterjs-editor-core package)
Check if the editor has focus now Reference
(Moved from roosterjs-editor-core package)
Insert a DOM node into editor content Reference
(Moved from roosterjs-editor-core package)
Change the editor selection to the given range Reference
(Moved from roosterjs-editor-core package)
Trigger a plugin event Reference
(Moved from roosterjs-editor-plugins package)
An interface to define a replacement rule for CustomReplace plugin Reference
(Moved from roosterjs-editor-core package)
Represent an interface to provide functionalities for Undo Snapshots Reference
Name | Description |
---|---|
canUndoAutoComplete | Whether there is a snapshot added before auto complete and it can be undone now |
(Moved from roosterjs-editor-plugins package)
Data provider for PickerPlugin Reference
(Moved from roosterjs-editor-plugins package)
Options for PickerPlugin Reference
(Moved from roosterjs-editor-dom package)
Represent a virtual cell of a virtual table Reference
(Moved from roosterjs-editor-dom package)
A map of style callbacks. Style name should be in lower case Reference
(New in 8.0.0)
A new IEditor interface is introduced and all places that Editor was used as parameter are now replaced by IEditor. Reference
Name | Description |
---|---|
addContentEditFeature | Add a Content Edit feature. |
addDomEventHandler | Add a custom DOM event handler to handle events not handled by roosterjs. Caller need to take the responsibility to dispose the handler properly |
addUndoSnapshot | Add undo snapshot, and execute a format callback function |
collapseNodes | Collapse nodes within the given start and end nodes to their common ascenstor node |
contains | Check if the node falls in the editor content |
deleteNode | Delete a node from editor content |
deleteSelectedContent | Delete selected content |
dispose | Dispose this editor, dispose all plugins and custom data |
ensureTypeInContainer | Ensure user will type into a container element rather than into the editor content DIV directly |
focus | Focus to this editor, the selection was restored to where it was before, no unexpected scroll. |
getBlockElementAtNode | Get BlockElement at given node |
getBlockTraverser | Get a content traverser for current block element start from specified position |
getBodyTraverser | Get a content traverser for the whole editor |
getContent | Get current editor content as HTML string |
getContentSearcherOfCursor | Get a text traverser of current selection |
getCustomData | Get custom data related to this editor |
getDefaultFormat | Get default format of this editor |
getDocument | Get document which contains this editor |
getEditorDomAttribute | Get DOM attribute of editor content DIV |
getElementAtCursor | Get an HTML element from current cursor position |
getFocusedPosition | Get current focused position |
getScrollContainer | Get the scroll container of the editor |
getSelectedRegions | Get impacted regions from selection |
getSelectionPath | Get current selection in a serializable format It does a live pull on the selection |
getSelectionRange | Get current selection range from Editor. |
getSelectionTraverser | Get a content traverser for current selection |
getStyleBasedFormatState | Get style based format state from current selection |
getUndoState | Whether there is an available undo/redo snapshot |
hasFocus | Check if focus is in editor now |
insertContent | Insert HTML content into editor |
insertNode | Insert node into editor |
isDarkMode | Check if the editor is in dark mode |
isDisposed | Get whether this editor is disposed |
isEmpty | Check whether the editor contains any visible content |
isFeatureEnabled | Check if the given experimental feature is enabled |
isInIME | Check if editor is in IME input sequence |
isPositionAtBeginning | Check if this position is at beginning of the editor. |
paste | Paste into editor using a clipboardData object |
queryElements | Query HTML elements in editor by tag name |
redo | Redo next edit operation |
replaceNode | Replace a node in editor content with another node |
runAsync | Run a callback function asynchronously |
select | Select content by range |
setContent | Set HTML content to this editor |
setDarkModeState | Set the dark mode state and transforms the content to match the new state |
setEditorDomAttribute | Set DOM attribute of editor content DIV |
triggerContentChangedEvent | Trigger a ContentChangedEvent |
triggerPluginEvent | Trigger an event to be dispatched to all plugins |
undo | Undo last edit operation |
(New in 8.0.0)
Represents the mode of color transformation. Reference
Name | Description |
---|---|
DarkToLight | Transform from dark to light |
LightToDark | Transform from light to dark |
(New in 8.0.0)
Constants string for dataset names used by dark mode. Reference
Name | Description |
---|---|
OriginalStyleColor | Original style text color |
OriginalStyleBackgroundColor | Original style background color |
OriginalAttributeColor | Original attribute text color |
OriginalAttributeBackgroundColor | Original attribute background color |
(New in 8.0.0)
CSS Class names for Entity. Reference
Name | Description |
---|---|
ENTITY_INFO_NAME | Class name to specify this is an entity |
ENTITY_TYPE_PREFIX | Class name to specify the type of an entity |
ENTITY_ID_PREFIX | Class name to specify the ID of an entity |
ENTITY_READONLY_PREFIX | Class name to specify if the entity is readonly |
(New in 8.0.0)
Experimental feature flags. Reference
Name | Description |
---|---|
ListChain | Enable List Chain for numbering list |
MergePastedLine | When paste, try merge pasted content to the same line with existing content |
NewBullet | Toggle bullet using VList |
NewIndentation | Toggle indentation using VList |
NewNumbering | Toggle numbering using VList |
PasteWithLinkPreview | Try retrieve link preview information when paste |
SingleDirectionResize | Resize an image horizontally or vertically |
(New in 8.0.0)
Represents a mode number to indicate what kind of content to retrieve when call Editor.getContent(). Reference
Name | Description |
---|---|
CleanHTML | The clean content without any temporary content only for editor. |
PlainText | Get plain text content only, all format will be ignored |
RawHTMLOnly | Retrieve the raw HTML string in current editor. Temporary content will be included. |
RawHTMLWithSelection | Retrieve the raw HTML string in current editor with a selection marker. |
Provides a chance for plugin to change the content before it is copied from editor. Reference
(New in 8.0.0)
Name | Description |
---|---|
rawEvent | Raw DOM event |
clonedRoot | An object contains all related data for pasting |
range | The selection range under cloned root |
isCut | Whether this is a cut event |
(New in 8.0.0)
Extract Content with a DOM tree event Reference
Name | Description |
---|---|
clonedRoot | Cloned root element of editor Plugin can change this DOM tree to clean up the markups it added before |
eventDataCache | An optional event cache. This will be consumed by event cache API to store some expensive calculation result. So that for the same event across plugins, the result doesn't need to be calculated again |
eventType | Type of this event |
(New in 8.0.0)
Represents a PluginEvent wrapping native ContextMenu event Reference
Name | Description |
---|---|
items | A callback array to let edtior retrieve context menu itesm related to this event. |
(New in 8.0.0)
Specify if editor can undo/redo an editing operation. Reference
Name | Description |
---|---|
canUndo | Whether the content can be undone |
canRedo | Whether the content can be redone |
(New in 8.0.0)
Options for extractClipboardEvent API. Reference
Name | Description |
---|---|
allowLinkPreview | Whether retrieving value of text/link-preview is allowed |
(New in 8.0.0)
Interface of ContentTraverser, provides traversing of content inside editor. Reference
Name | Description |
---|---|
currentBlockElement | Get current block element |
currentInlineElement | Get current inline element |
getNextBlockElement | Get next block element |
getNextInlineElement | Get next inline element |
getPreviousBlockElement | Get previous block element |
getPreviousInlineElement | Get previous inline element |
(New in 8.0.0)
Interface of PositionContentSearcher, help search content around a position. Reference
Name | Description |
---|---|
forEachTextInlineElement | Get text section before position till stop condition is met |
getInlineElementAfter | Get the inline element after position |
getInlineElementBefore | Get the inline element before position |
getNearestNonTextInlineElement | Get first non textual inline element before position |
getRangeFromText | Try to get a range matches the given text before the position |
getSubStringBefore | Get X number of chars before position |
getWordBefore | Get the word before position |
(New in 8.0.0)
Represents a DOM region. Reference
Name | Description |
---|---|
nodeAfter | A node to define the ending boundary of this region |
nodeBefore | A node to define the beginning boundary of this region |
rootNode | Root node of this region |
skipTags | Tags that child elements will be skipped |
(New in 8.0.0)
RoosterJs build in content edit feature Reference
Name | Description |
---|---|
GenericContentEditFeature | Generic ContentEditFeature interface |
Name | Description |
---|---|
defaultDisabled | Whether this edit feature is disabled by default |
(New in 8.0.0)
An editor plugin which have a state object stored on editor core so that editor and core api can access it Reference
Name | Description |
---|---|
getState | Get plugin state object |
(New in 8.0.0)
A list to specify whether each of the listed content edit features is enabled Reference
Name | Description |
---|---|
ListFeatureSettings | Settings for list features |
QuoteFeatureSettings | Settings for quote features |
TableFeatureSettings | Settings for table features |
StructuredNodeFeatureSettings | Settings for structured node features |
AutoLinkFeatureSettings | Settings for auto link features |
ShortcutFeatureSettings | Settings for shortcut features |
CursorFeatureSettings | Settings for cursor features |
MarkdownFeatureSettings | Settings for mark down features |
EntityFeatureSettings | Settings for entity features |
(New in 8.0.0)
Settings for auto link features Reference
Name | Description |
---|---|
autoLink | When press Space or Enter after a hyperlink-like string, convert the string to a hyperlink |
unlinkWhenBackspaceAfterLink | Unlink when backspace right after a hyperlink |
(New in 8.0.0)
Settings for cursor features Reference
Name | Description |
---|---|
noCycleCursorMove | Chrome may make the cursor move the then end of document if press Ctrl+Left at the beginning of document Let's disable this behaivor |
(New in 8.0.0)
Settings for entity features Reference
Name | Description |
---|---|
backspaceAfterEntity | A content edit feature to trigger EntityOperation event with operation "RemoveFromEnd" when user press BACKSPACE right after an entity |
clickOnEntity | A content edit feature to trigger EntityOperation event with operation "Click" when user clicks on a readonly entity. |
deleteBeforeEntity | A content edit feature to trigger EntityOperation event with operation "RemoveFromStart" when user press DELETE right after an entity |
enterBeforeReadonlyEntity | A content edit feature to split current line into two lines at the cursor when user presses ENTER right before a readonly entity. |
escapeFromEntity | A content edit feature to trigger EntityOperation event with operation "Escape" when user presses ESC on a readonly entity. |
(New in 8.0.0)
Settings for list features Reference
Name | Description |
---|---|
autoBullet | When press space after an asterik or number in an empty line, toggle bullet/numbering |
indentWhenTab | When press Tab in a list, indent current list item |
maintainListChain | When edit with lists, maintain the list numbers of list chain |
mergeInNewLineWhenBackspaceOnFirstChar | When press Backspace on first char in a list, make current item a new line of previous list item |
outdentWhenBackspaceOnEmptyFirstLine | When press BaskSpace on empty line which is the first item of a list, outdent current list item |
outdentWhenEnterOnEmptyLine | When press Enter on empty line in a list, outdent current list item |
outdentWhenShiftTab | When press Shift+Tab in a list, outdent current list item |
(New in 8.0.0)
Settings for mark down features Reference
Name | Description |
---|---|
markdownBold | When typing text surrounded by '*', the symbols will be removed and the text will be bolded. |
markdownInlineCode | When typing text surrounded by '`', the symbols will be removed and the text will be wrapped in a code tag. |
markdownItalic | When typing text surrounded by '_', the symbols will be removed and the text will be italicized. |
markdownStrikethru | When typing text surrounded by '~', the symbols will be removed and the text will be striked through. |
(New in 8.0.0)
Settings for quote features Reference
Name | Description |
---|---|
unquoteWhenBackspaceOnEmptyFirstLine | When press BAckspace on empty line which is the first line of a blockquote, unquote current line |
unquoteWhenEnterOnEmpty | When press Enter on empty line in a blockquote, unquote current line |
(New in 8.0.0)
Settings for shortcut features Reference
Name | Description |
---|---|
defaultShortcut | Respond to default common keyboard short, i.e. Ctrl+B, Ctrl+I, Ctrl+U, Ctrl+Z, Ctrl+Y |
(New in 8.0.0)
Settings for structured node features Reference
Name | Description |
---|---|
insertLineBeforeStructuredNodeFeature | When press Enter at the beginning of first structured element (table, list) and there isn't line before the position we create a new line before so that user got a chance to enter content before the table or list |
(New in 8.0.0)
Settings for table features Reference
Name | Description |
---|---|
tabInTable | When press TAB or SHIFT+TAB key in table cell, jump to next/previous table cell |
upDownInTable | When press Up or Down in table cell, jump to the table cell above/below |
(New in 8.0.0)
The state object for DOMEventPlugin Reference
Name | Description |
---|---|
contextMenuProviders | Context menu providers, that can provide context menu items |
isInIME | Whether editor is in IME input sequence |
scrollContainer | Scroll container of editor |
selectionRange | Cached selection range |
stopPrintableKeyboardEventPropagation | stop propagation of a printable keyboard event |
(New in 8.0.0)
The state object for EditPlugin Reference
Name | Description |
---|---|
features | All content edit features sorted by their keys |
(New in 8.0.0)
The state object for EntityPlugin Reference
Name | Description |
---|---|
clickingPoint | Last clicking point when mouse down event happens |
knownEntityElements | All known entity elements |
(New in 8.0.0)
The state object for LifecyclePlugin Reference
Name | Description |
---|---|
customData | Custom data of this editor |
defaultFormat | Default format of this editor |
experimentalFeatures | Enabled experimental features |
isDarkMode | Whether editor is in dark mode |
onExternalContentTransform | External content transform function to help do color transform for existing content |
(New in 8.0.0)
The state object for PendingFormatStatePlugin Reference
Name | Description |
---|---|
pendableFormatPosition | The position of last pendable format state changing |
pendableFormatState | Current pending format state |
(New in 8.0.0)
The state object for UndoPlugin Reference
Name | Description |
---|---|
autoCompletePosition | Position after last auto complate. Undo autoComplete only works if the current position matches this one |
hasNewContent | Whether there is new content change after last undo snapshot is taken |
isNested | If addUndoSnapshot() is called nested in another one, this will be true |
isRestoring | Whether restoring of undo snapshot is in proguress. |
snapshotsService | Snapshot service for undo, it helps handle snapshot add, remove and retrive |
(New in 8.0.0)
A map of predefined CSS styles for elements Reference
(New in 8.0.0)
Handler function type of DOM event Reference
(New in 8.0.0)
DOM event handler object with mapped plugin event type and handler function Reference
Name | Description |
---|---|
beforeDispatch | Handler function. Besides the mapped plugin event type, this function will also be triggered when correlated DOM event is fired |
pluginEventType | Type of pluign event. The DOM event will be mapped with this plugin event type |
(New in 8.0.0)
Combined event handler type with all 3 posibilities Reference
(New in 8.0.0)
Auto-calculated State object type for plugin with states Reference
(New in 8.0.0)
Call an editing callback with adding undo snapshots around Reference
(New in 8.0.0)
Attach a DOM event to the editor content DIV Reference
(New in 8.0.0)
Get current editor content as HTML string Reference
(New in 8.0.0)
Restore an undo snapshot into editor Reference
(New in 8.0.0)
Set HTML content to this editor. All existing content will be replaced. A ContentChanged event will be triggered if triggerContentChangedEvent is set to true Reference
(New in 8.0.0)
Edit and transform color of elements between light mode and dark mode Reference
Key numbers common used keys. Reference
Name | Description |
---|---|
PAGEUP | PageUp key |
CONTENTCHANGED | A virtual key mapped to ContentChanged event |
RANGE | A virtual key mapped to a key operation when a range is selected |
Ctrl | Ctrl key |
Meta | Meta key |
Shift | Shift key |
Predefined change sources. Reference
Name | Description |
---|---|
SwitchToDarkMode | Editor is switched to dark mode, content color is changed |
SwitchToLightMode | Editor is switched to light mode, content color is changed |
ListChain | List chain reorganized numbers of lists |
Provides a chance for plugin to change the content before it is pasted into editor. Reference
Name | Description |
---|---|
pasteOption | To change paste option, handle BeforePasteEvent and replace the DOM tree in BeforePasteEvent.fragment to be whatever we want |
Editor plugin event type enum. Reference
Name | Description |
---|---|
BeforeCutCopy | Before Paste event, provide a chance to change copied content |
ContextMenu | HTML ContextMenu event |
An object contains all related data for pasting. Reference
Name | Description |
---|---|
linkPreview | Link Preview information provided by Edge |
Represents an entity in editor. Reference
Old Name | New Name | Description |
---|---|---|
contentNode | wrapper | The wrapper DOM node of this entity which holds the info CSS classes of this entity |
The format state of a given node. Reference
Name | Description |
---|---|
canUndo | Moved to EditorUndoState interface |
canRedo | Moved to EditorUndoState interface |
Name | Description |
---|---|
EditorUndoState | Specify if editor can undo/redo an editing operation |
Represents a DOM region with selection information. Reference
Name | Description |
---|---|
RegionBase | Represents a DOM region |
Name | Description |
---|---|
nodeAfter | Moved to RegionBase interface |
nodeBefore | Moved to RegionBase interface |
rootNode | Moved to RegionBase interface |
skipTags | Moved to RegionBase interface |
Represents a data structure of snapshots, this is usually used for undo snapshots. Reference
Name | Description |
---|---|
autoCompleteIndex | Index of snapshot added before an auto complete action |
Options for HtmlSanitizer Reference
Name | Description |
---|---|
additionalPredefinedCssForElement | Additional predefined CSS for element |
additionalTagReplacements | Additional tag replacement, to allow replace a tag to another name, or remove it. |
unknownTagReplacement | Define a replacement tag name of unknown tags. |
Name | Description |
---|---|
allowPreserveWhiteSpace | Use additionalPredefinedCssForElement instead |
additionalAllowedTags | Use additionalTagReplacements instead |
Old Name | New Name | Description |
---|---|---|
styleCallbacks | cssStyleCallbacks | Callbacks for CSS styles |
additionalAllowAttributes | additionalAllowedAttributes | Allowed HTML attributes in addition to default attributes |