Options
All
  • Public
  • Public/Protected
  • All
Menu

@udecode/plate - v6.0.0

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

Alignment

Alignment: "left" | "center" | "right" | "justify"

AutoformatRule

ComboboxOnSelectItem

ComboboxOnSelectItem: (editor: SPEditor, item: ComboboxItemData) => any

Type declaration

ComboboxState

ComboboxState: { activeId: string | null; byId: Record<string, ComboboxStoreById>; filteredItems: ComboboxItemData[]; highlightedIndex: number; items: ComboboxItemData[]; popperContainer?: Document | HTMLElement; popperOptions?: UsePopperOptions; targetRange: Range | null; text: string | null }

Type declaration

  • activeId: string | null

    Active id (combobox id which is opened).

  • byId: Record<string, ComboboxStoreById>

    Object whose keys are combobox ids and values are config stores (e.g. one for tag, one for mention,...).

  • filteredItems: ComboboxItemData[]

    Filtered items

  • highlightedIndex: number

    Highlighted index.

  • items: ComboboxItemData[]

    Unfiltered items.

  • Optional popperContainer?: Document | HTMLElement

    Parent element of the popper element (the one that has the scroll).

    default

    document

  • Optional popperOptions?: UsePopperOptions

    Overrides usePopper options.

  • targetRange: Range | null

    Range from the trigger to the cursor.

  • text: string | null

    Text after the trigger.

ComboboxStateById

ComboboxStateById: { filter?: (search: string) => (item: ComboboxItemData) => boolean; id: string; maxSuggestions?: number; onSelectItem: ComboboxOnSelectItem | null; searchPattern?: string; trigger: string }

Type declaration

  • Optional filter?: (search: string) => (item: ComboboxItemData) => boolean

    Items filter function by text.

    default

    (value) => value.text.toLowerCase().startsWith(search.toLowerCase())

  • id: string

    Combobox id.

  • Optional maxSuggestions?: number

    Max number of items.

    default

    items.length

  • onSelectItem: ComboboxOnSelectItem | null

    Called when an item is selected.

  • Optional searchPattern?: string

    Regular expression for search, for example to allow whitespace

  • trigger: string

    Trigger that activates the combobox.

ComboboxStoreById

ComboboxStoreById: StoreApi<string, ComboboxStateById, StateActions<ComboboxStateById>>

DOMHandler

DOMHandler<K, T>: NonNullable<DOMHandlers<T>[K]>

Type parameters

Decorate

Decorate<T>: (editor: T) => (entry: NodeEntry) => Range[] | undefined

Function used to decorate ranges. If the function returns undefined then no ranges are modified. If the function returns an array the returned ranges are merged with the ranges called by other plugins.

Type parameters

Type declaration

    • (editor: T): (entry: NodeEntry) => Range[] | undefined
    • Parameters

      • editor: T

      Returns (entry: NodeEntry) => Range[] | undefined

        • (entry: NodeEntry): Range[] | undefined
        • Parameters

          • entry: NodeEntry

          Returns Range[] | undefined

DefaultPlatePluginKey

DefaultPlatePluginKey: typeof ELEMENT_BLOCKQUOTE | typeof ELEMENT_CODE_BLOCK | typeof ELEMENT_CODE_LINE | typeof ELEMENT_H1 | typeof ELEMENT_H2 | typeof ELEMENT_H3 | typeof ELEMENT_H4 | typeof ELEMENT_H5 | typeof ELEMENT_H6 | typeof ELEMENT_IMAGE | typeof ELEMENT_LI | typeof ELEMENT_LINK | typeof ELEMENT_MEDIA_EMBED | typeof ELEMENT_MENTION | typeof ELEMENT_OL | typeof ELEMENT_PARAGRAPH | typeof ELEMENT_TABLE | typeof ELEMENT_TD | typeof ELEMENT_TH | typeof ELEMENT_TODO_LI | typeof ELEMENT_TR | typeof ELEMENT_UL | typeof MARK_BOLD | typeof MARK_CODE | typeof MARK_HIGHLIGHT | typeof MARK_ITALIC | typeof MARK_KBD | typeof MARK_SEARCH_HIGHLIGHT | typeof MARK_STRIKETHROUGH | typeof MARK_SUBSCRIPT | typeof MARK_SUPERSCRIPT | typeof MARK_UNDERLINE

Deserialize

Deserialize<T>: (editor: T) => { element?: DeserializeNode[]; getFragment?: (fragment: TDescendant[]) => TDescendant[]; isDisabled?: (deserializerId: string) => boolean; leaf?: DeserializeNode[]; preInsert?: (fragment: TDescendant[]) => HandlerReturnType }

HTML Deserializer for element and leaf.

Type parameters

Type declaration

DeserializeHTMLChildren

DeserializeHTMLChildren: ChildNode | TDescendant | string | null

DeserializeHTMLReturn

DeserializeHTMLReturn: string | null | TDescendant[] | TElement | DeserializeHTMLChildren[]

DeserializeNode

DeserializeNode: { deserialize: (el: HTMLElement) => {} | undefined; type: string; withoutChildren?: boolean }

Type declaration

  • deserialize: (el: HTMLElement) => {} | undefined
      • (el: HTMLElement): {} | undefined
      • Parameters

        • el: HTMLElement

        Returns {} | undefined

  • type: string
  • Optional withoutChildren?: boolean

DeserializeOptions

DeserializedHTMLElement

DeserializedHTMLElement: TDescendant

DropDirection

DropDirection: "top" | "bottom" | undefined

EditorEvent

EditorEvent: "blur" | "focus"

EditorId

EditorId: string | null | undefined

A unique id used to store the editor state by id. Required if rendering multiple Plate. Optional otherwise.

default

'main'

EventEditorActions

EventEditorActions: { setEventEditorId: (event: EditorEvent, value: EditorId) => void }

Type declaration

EventEditorState

EventEditorState: Partial<Record<EditorEvent, EditorId>>

FindNodeOptions

FindNodeOptions<T>: EditorNodesOptions<T>

Type parameters

FunctionProperties

FunctionProperties<T>: Pick<T, FunctionPropertyNames<T>>

Get the properties from an interface which are functions

Type parameters

  • T

FunctionPropertyNames

FunctionPropertyNames<T>: {[ K in keyof T]: T[K] extends Function ? K : never }[keyof T]

Get the property names from an interface which are functions

Type parameters

  • T

GetMatchPointsReturnType

GetMatchPointsReturnType: undefined | { afterStartMatchPoint: Point | undefined; beforeEndMatchPoint: Point; beforeStartMatchPoint: Point | undefined }

GetNodeProps

GetNodeProps: (props: SPRenderElementProps | SPRenderLeafProps) => NodeProps | undefined

Map slate node properties to component props.

Type declaration

HandlerReturnType

HandlerReturnType: boolean | void

If true, the next handlers will be skipped.

KEY_PARAGRAPH

KEY_PARAGRAPH: "p"

KeyboardHandler

KeyboardHandler<T>: DOMHandler<"onKeyDown", T>

Type parameters

MediaEmbedElementProps

MentionNode

MoveListItemsOptions

MoveListItemsOptions: { at?: EditorNodesOptions["at"]; increase?: boolean }

Type declaration

  • Optional at?: EditorNodesOptions["at"]
  • Optional increase?: boolean

NodeMatch

NodeMatch<T>: Predicate<T>

Type parameters

NodeProps

NodeProps: {}

Props passed from getNodeProps option.

Type declaration

  • [key: string]: any

OnChange

OnChange<T>: (editor: T) => (value: TNode[]) => HandlerReturnType

Function called whenever a change occurs in the editor. Return false to prevent calling the next plugin handler.

see

{@link SlatePropsOnChange}

Type parameters

Type declaration

OnError

OnError: (err: any) => void

Type declaration

    • (err: any): void
    • Parameters

      • err: any

      Returns void

OnKeyDownElementOptions

OnKeyDownElementOptions: Pick<PlatePluginOptions, "type" | "defaultType" | "hotkey">

Plugin options to get onKeyDown for elements.

OnKeyDownMarkOptions

OnKeyDownMarkOptions: Pick<PlatePluginOptions, "type" | "hotkey" | "clear">

Plugin options to get onKeyDown for marks.

Options

Options<T>: Partial<T> & AnyObject & { key?: string; keys?: string[] }

Type parameters

  • T

OverrideProps

OverrideProps<T>: (editor: T) => GetNodeProps

Type parameters

Type declaration

PlateActions

PlateActions<T>: { clearState: (id?: string) => void; incrementKeyChange: (id?: string) => void; resetEditor: (id?: string) => void; setEditor: (value: PlateState<T>["editor"], id?: string) => void; setEnabled: (value: PlateState<T>["enabled"], id?: string) => void; setInitialState: (value?: Partial<PlateState<T>>, id?: string) => void; setPluginKeys: (value: PlateState<T>["pluginKeys"], id?: string) => void; setPlugins: (value: PlateState<T>["plugins"], id?: string) => void; setSelection: (value: PlateState<T>["selection"], id?: string) => void; setValue: (value: PlateState<T>["value"], id?: string) => void }

Type parameters

Type declaration

  • clearState: (id?: string) => void

    Remove state by id. Called by Plate on unmount.

      • (id?: string): void
      • Parameters

        • Optional id: string

        Returns void

  • incrementKeyChange: (id?: string) => void
      • (id?: string): void
      • Parameters

        • Optional id: string

        Returns void

  • resetEditor: (id?: string) => void

    Set a new editor with plate.

      • (id?: string): void
      • Parameters

        • Optional id: string

        Returns void

  • setEditor: (value: PlateState<T>["editor"], id?: string) => void
      • (value: PlateState<T>["editor"], id?: string): void
      • Parameters

        • value: PlateState<T>["editor"]
        • Optional id: string

        Returns void

  • setEnabled: (value: PlateState<T>["enabled"], id?: string) => void
      • (value: PlateState<T>["enabled"], id?: string): void
      • Parameters

        • value: PlateState<T>["enabled"]
        • Optional id: string

        Returns void

  • setInitialState: (value?: Partial<PlateState<T>>, id?: string) => void

    Set initial state by id. Called by Plate on mount.

      • (value?: Partial<PlateState<T>>, id?: string): void
      • Parameters

        • Optional value: Partial<PlateState<T>>
        • Optional id: string

        Returns void

  • setPluginKeys: (value: PlateState<T>["pluginKeys"], id?: string) => void
      • (value: PlateState<T>["pluginKeys"], id?: string): void
      • Parameters

        • value: PlateState<T>["pluginKeys"]
        • Optional id: string

        Returns void

  • setPlugins: (value: PlateState<T>["plugins"], id?: string) => void
      • (value: PlateState<T>["plugins"], id?: string): void
      • Parameters

        • value: PlateState<T>["plugins"]
        • Optional id: string

        Returns void

  • setSelection: (value: PlateState<T>["selection"], id?: string) => void
      • (value: PlateState<T>["selection"], id?: string): void
      • Parameters

        • value: PlateState<T>["selection"]
        • Optional id: string

        Returns void

  • setValue: (value: PlateState<T>["value"], id?: string) => void
      • (value: PlateState<T>["value"], id?: string): void
      • Parameters

        • value: PlateState<T>["value"]
        • Optional id: string

        Returns void

PlateOptions

PlateOptions<T>: Record<PluginKey, PlatePluginOptions<T>>

Plate options stored by plugin key. Each plugin can access the options by its plugin key.

default

{}

see

PluginKey

Type parameters

PlatePluginComponent

PlatePluginComponent: FunctionComponent

React component rendering a slate element or leaf.

default

DefaultElement | DefaultLeaf

PlatePluginOptions

PlatePluginOptions<T>: T & { clear?: string | string[]; component?: PlatePluginComponent; defaultType?: string; deserialize?: Partial<DeserializeOptions>; getNodeProps?: GetNodeProps; hotkey?: string | string[]; overrideProps?: GetNodeProps | NodeProps; type: string }

Type parameters

PlateState

PlateState<T>: { editor?: T; enabled?: boolean; keyChange?: number; pluginKeys: string[]; plugins: PlatePlugin<T>[]; selection: Editor["selection"]; value: TDescendant[] }

Type parameters

Type declaration

  • Optional editor?: T

    Slate editor reference.

    default

    pipe(createEditor(), withPlate({ id, plugins, options, components }))

  • Optional enabled?: boolean

    If true, plate will create the editor with withPlate. If false, plate will remove the editor from the store.

    default

    true

  • Optional keyChange?: number

    A key that is incremented on each editor change.

  • pluginKeys: string[]

    Element keys used by the plugins

  • plugins: PlatePlugin<T>[]

    Plate plugins.

    default

    [createReactPlugin(), createHistoryPlugin()]

  • selection: Editor["selection"]
  • value: TDescendant[]

    Editor value.

    default

    [{ children: [{ text: '' }]}]

PlateStates

PlateStates<T>: Record<string, PlateState<T>>
see

EditorId

Type parameters

PluginKey

PluginKey: string

A unique key to store the plugin options by key.

PortalBodyProps

PortalBodyProps: { children: ReactNode; element?: Element }

Type declaration

  • children: ReactNode
  • Optional element?: Element

Predicate

Predicate<T>: PredicateObj<T> | PredicateFn<T>

Type parameters

  • T

PredicateFn

PredicateFn<T>: (obj: T) => boolean

Type parameters

  • T

Type declaration

    • (obj: T): boolean
    • Parameters

      • obj: T

      Returns boolean

PredicateObj

PredicateObj<T>: Partial<Record<keyof T, any | any[]>>

Type parameters

  • T

RenderElement

RenderElement<T>: (editor: T) => (props: SPRenderElementProps) => JSX.Element | undefined

Function used to render an element. If the function returns undefined then the next RenderElement function is called. If the function renders a JSX element then that JSX element is rendered.

Type parameters

Type declaration

RenderLeaf

RenderLeaf<T>: (editor: T) => (props: TRenderLeafProps) => JSX.Element

Function used to render the children of a leaf. If the function returns undefined then the next RenderLeaf function is called and the current children are not modified. The children passed to the function may be the result of a previous plugin. To wrap the previous plugin simply return the passed children. You do not need to add the attributes to your return value. The attributes are added by default. RenderLeaf always returns a JSX element (even if unmodified) to support multiple marks on a node.

Type parameters

Type declaration

RenderNodeOptions

RenderNodeOptions: Pick<PlatePluginOptions, "type" | "component" | "getNodeProps" | "overrideProps">

Plugin options to get renderElement for elements and renderLeaf for marks.

SPRenderElementProps

SPRenderElementProps<EElement>: SPRenderNodeProps & TRenderElementProps<EElement>

Type parameters

SPRenderLeafProps

SPRenderLeafProps<EText>: SPRenderNodeProps & TRenderLeafProps<EText>

Type parameters

SelectOnBackspacePluginOptions

SelectOnBackspacePluginOptions: QueryNodeOptions

StyledElementProps

StyledElementProps<TElement, TStyles>: SPRenderElementProps<TElement> & StyledProps<TStyles> & HTMLAttributes<HTMLElement>

Type parameters

  • TElement = Element

  • TStyles = {}

StyledLeafProps

StyledLeafProps<TText, TStyles>: SPRenderLeafProps<TText> & StyledProps<TStyles>

Type parameters

  • TText = Text

  • TStyles = {}

TAncestor

TAncestor<TExtension>: TEditor<TExtension> | TElement<TExtension>

Type parameters

TDescendant

TDescendant<TExtension>: TElement<TExtension> | TText<TExtension>

Type parameters

TEditor

TEditor<TExtension>: Editor & TExtension & AnyObject & { children: TDescendant[] }

Type parameters

TElement

TElement<TExtension>: Element & TExtension & AnyObject & { children: TDescendant[]; type: string }

Type parameters

TNode

TNode<TExtension>: TEditor<TExtension> | TElement<TExtension> | TText<TExtension>

Type parameters

TNodeMatch

TNodeMatch<T>: ((node: TNode, path: Path) => node is T) | ((node: TNode, path: Path) => boolean)

Type parameters

TRenderElementProps

TRenderElementProps<TExtension>: Omit<RenderElementProps, "element"> & { element: TElement<TExtension> }

Type parameters

TRenderLeafProps

TRenderLeafProps<TExtension>: Omit<RenderLeafProps, "leaf" | "text"> & { leaf: TText<Extension & TExtension>; text: TText<Extension & TExtension> }

Type parameters

TText

TText<TExtension>: Text & TExtension & AnyObject

Type parameters

TodoListElementProps

UnindentListItemsOptions

UnindentListItemsOptions: Omit<MoveListItemsOptions, "increase">

UsePlateOptions

usePlate options

Type parameters

UsePopperOptions

UsePopperOptions: Omit<Partial<PopperJS.Options>, "modifiers"> & { createPopper?: typeof PopperJS.createPopper; modifiers?: ReadonlyArray<Partial<Modifier<string, object>>> }

WithOptional

WithOptional<T, K>: Omit<T, K> & Partial<Pick<T, K>>

Type parameters

  • T

  • K: keyof T

WithOverride

WithOverride<TEditorInput, TEditorOutputExtension>: <T>(editor: T) => T & TEditorOutputExtension

Plate plugin overriding the editor methods. Naming convention is with*.

Type parameters

Type declaration

    • <T>(editor: T): T & TEditorOutputExtension
    • Type parameters

      • T: TEditorInput

      Parameters

      • editor: T

      Returns T & TEditorOutputExtension

WithSelectOnBackspaceOptions

WithSelectOnBackspaceOptions: SelectOnBackspacePluginOptions

Variables

Const CLASS_TODO_LIST_CHECKED

CLASS_TODO_LIST_CHECKED: "slate-TodoListElement-rootChecked" = "slate-TodoListElement-rootChecked"

Const CODE_BLOCK_LANGUAGES

CODE_BLOCK_LANGUAGES: Record<string, string>

Const CODE_BLOCK_LANGUAGES_POPULAR

CODE_BLOCK_LANGUAGES_POPULAR: Record<string, string>

Const COMBOBOX_TRIGGER_MENTION

COMBOBOX_TRIGGER_MENTION: "@" = "@"

Const DEFAULTS_BLOCKQUOTE

DEFAULTS_BLOCKQUOTE: Partial<PlatePluginOptions>

Const DEFAULTS_BOLD

DEFAULTS_BOLD: Partial<PlatePluginOptions>

Const DEFAULTS_CODE

DEFAULTS_CODE: Partial<PlatePluginOptions>

Const DEFAULTS_CODE_BLOCK

DEFAULTS_CODE_BLOCK: Partial<CodeBlockPluginOptions>

Const DEFAULTS_H1

DEFAULTS_H1: { hotkey: string[] }

Type declaration

  • hotkey: string[]

Const DEFAULTS_H2

DEFAULTS_H2: { hotkey: string[] }

Type declaration

  • hotkey: string[]

Const DEFAULTS_H3

DEFAULTS_H3: { hotkey: string[] }

Type declaration

  • hotkey: string[]

Const DEFAULTS_HIGHLIGHT

DEFAULTS_HIGHLIGHT: Partial<PlatePluginOptions>

Const DEFAULTS_ITALIC

DEFAULTS_ITALIC: Partial<PlatePluginOptions>

Const DEFAULTS_LINK

DEFAULTS_LINK: Partial<PlatePluginOptions>

Const DEFAULTS_PARAGRAPH

DEFAULTS_PARAGRAPH: Partial<PlatePluginOptions>

Const DEFAULTS_STRIKETHROUGH

DEFAULTS_STRIKETHROUGH: Partial<PlatePluginOptions>

Const DEFAULTS_SUBSCRIPT

DEFAULTS_SUBSCRIPT: Partial<PlatePluginOptions>

Const DEFAULTS_SUPERSCRIPT

DEFAULTS_SUPERSCRIPT: Partial<PlatePluginOptions>

Const DEFAULTS_TD

DEFAULTS_TD: Partial<PlatePluginOptions>

Const DEFAULTS_TH

DEFAULTS_TH: Partial<PlatePluginOptions>

Const DEFAULTS_TODO_LIST

DEFAULTS_TODO_LIST: Partial<PlatePluginOptions>

Const DEFAULTS_UNDERLINE

DEFAULTS_UNDERLINE: Partial<PlatePluginOptions>

Const DEFAULT_ALIGNMENT

DEFAULT_ALIGNMENT: Alignment

Const DEFAULT_ALIGNMENTS

DEFAULT_ALIGNMENTS: Alignment[]

Const DEFAULT_HEADING_LEVEL

DEFAULT_HEADING_LEVEL: 6 = 6

Const DOM_HANDLERS

DOM_HANDLERS: keyof DOMHandlers[]

Const ELEMENT_BLOCKQUOTE

ELEMENT_BLOCKQUOTE: "blockquote" = "blockquote"

Const ELEMENT_CODE_BLOCK

ELEMENT_CODE_BLOCK: "code_block" = "code_block"

Const ELEMENT_CODE_LINE

ELEMENT_CODE_LINE: "code_line" = "code_line"

Const ELEMENT_DEFAULT

ELEMENT_DEFAULT: "p" = "p"

Const ELEMENT_H1

ELEMENT_H1: "h1" = "h1"

Const ELEMENT_H2

ELEMENT_H2: "h2" = "h2"

Const ELEMENT_H3

ELEMENT_H3: "h3" = "h3"

Const ELEMENT_H4

ELEMENT_H4: "h4" = "h4"

Const ELEMENT_H5

ELEMENT_H5: "h5" = "h5"

Const ELEMENT_H6

ELEMENT_H6: "h6" = "h6"

Const ELEMENT_HR

ELEMENT_HR: "hr" = "hr"

Const ELEMENT_IMAGE

ELEMENT_IMAGE: "img" = "img"

Const ELEMENT_LI

ELEMENT_LI: "li" = "li"

Const ELEMENT_LIC

ELEMENT_LIC: "lic" = "lic"

Const ELEMENT_LINK

ELEMENT_LINK: "a" = "a"

Const ELEMENT_MEDIA_EMBED

ELEMENT_MEDIA_EMBED: "media_embed" = "media_embed"

Const ELEMENT_MENTION

ELEMENT_MENTION: "mention" = "mention"

Const ELEMENT_OL

ELEMENT_OL: "ol" = "ol"

Const ELEMENT_PARAGRAPH

ELEMENT_PARAGRAPH: "p" = "p"

Const ELEMENT_TABLE

ELEMENT_TABLE: "table" = "table"

Const ELEMENT_TD

ELEMENT_TD: "td" = "td"

Const ELEMENT_TH

ELEMENT_TH: "th" = "th"

Const ELEMENT_TODO_LI

ELEMENT_TODO_LI: "action_item" = "action_item"

Const ELEMENT_TR

ELEMENT_TR: "tr" = "tr"

Const ELEMENT_UL

ELEMENT_UL: "ul" = "ul"

Const EditorStateEffect

EditorStateEffect: MemoExoticComponent

Const HeadingToolbar

HeadingToolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>

Const KEYS_CODE_BLOCK

KEYS_CODE_BLOCK: string[]

Const KEYS_HEADING

KEYS_HEADING: string[]

Const KEYS_LIST

KEYS_LIST: string[]

Const KEYS_TABLE

KEYS_TABLE: string[]

Const KEY_ALIGN

KEY_ALIGN: "align" = "align"

Const KEY_INDENT

KEY_INDENT: "indent" = "indent"

Const MARK_BG_COLOR

MARK_BG_COLOR: "backgroundColor" = "backgroundColor"

Const MARK_BOLD

MARK_BOLD: "bold" = "bold"

Const MARK_CODE

MARK_CODE: "code" = "code"

Const MARK_COLOR

MARK_COLOR: "color" = "color"

Const MARK_FONT_SIZE

MARK_FONT_SIZE: "fontSize" = "fontSize"

Const MARK_HIGHLIGHT

MARK_HIGHLIGHT: "highlight" = "highlight"

Const MARK_ITALIC

MARK_ITALIC: "italic" = "italic"

Const MARK_KBD

MARK_KBD: "kbd" = "kbd"

Const MARK_PRISM

MARK_PRISM: "prism" = "prism"

Const MARK_SEARCH_HIGHLIGHT

MARK_SEARCH_HIGHLIGHT: "search_highlight" = "search_highlight"

Const MARK_STRIKETHROUGH

MARK_STRIKETHROUGH: "strikethrough" = "strikethrough"

Const MARK_SUBSCRIPT

MARK_SUBSCRIPT: "subscript" = "subscript"

Const MARK_SUPERSCRIPT

MARK_SUPERSCRIPT: "superscript" = "superscript"

Const MARK_UNDERLINE

MARK_UNDERLINE: "underline" = "underline"

Const SIMULATE_BACKSPACE

SIMULATE_BACKSPACE: any

Const Toolbar

Toolbar: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>

Const ToolbarBase

ToolbarBase: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement>>

Const astDeserializerId

astDeserializerId: "AST Deserializer" = "AST Deserializer"

Const autoformatArrow

autoformatArrow: AutoformatRule[]

Const autoformatComparison

autoformatComparison: AutoformatRule[]

Const autoformatDivision

autoformatDivision: AutoformatRule[]

Const autoformatEquality

autoformatEquality: AutoformatRule[]

Const autoformatFraction

autoformatFraction: AutoformatRule[]

Const autoformatLegal

autoformatLegal: AutoformatRule[]

Const autoformatLegalHtml

autoformatLegalHtml: AutoformatRule[]

Const autoformatMath

autoformatMath: AutoformatRule[]

Const autoformatOperation

autoformatOperation: AutoformatRule[]

Const autoformatPunctuation

autoformatPunctuation: AutoformatRule[]

Const autoformatSmartQuotes

autoformatSmartQuotes: AutoformatRule[]

Const autoformatSubscriptNumbers

autoformatSubscriptNumbers: AutoformatRule[]

Const autoformatSubscriptSymbols

autoformatSubscriptSymbols: AutoformatRule[]

Const autoformatSuperscriptNumbers

autoformatSuperscriptNumbers: AutoformatRule[]

Const autoformatSuperscriptSymbols

autoformatSuperscriptSymbols: AutoformatRule[]

Const comboboxStore

comboboxStore: StoreApi<"combobox", ComboboxState, SetRecord & { mergeState: MergeState; state: SetImmerState } & { open: (state: Pick<ComboboxState, "activeId" | "targetRange" | "text">) => void; reset: () => void; setComboboxById: (state: ComboboxStateById) => void }, { isOpen: () => boolean }>

Const csvDeserializerId

csvDeserializerId: "CSV Deserializer" = "CSV Deserializer"

Const eventEditorStore

eventEditorStore: StoreApi

Store where the keys are event names and the values are editor ids.

Const grabberTooltipProps

grabberTooltipProps: TippyProps

Const htmlDeserializerId

htmlDeserializerId: "HTML Deserializer" = "HTML Deserializer"

Const mdDeserializerId

mdDeserializerId: "MD Deserializer" = "MD Deserializer"

Const plateStore

plateStore: StoreApi

Plate vanilla store.

see

zustand vanilla store

Const useEventEditorStore

useEventEditorStore: UseStore

Store where the keys are event names and the values are editor ids.

see

zustand store

Const usePlateStore

usePlateStore: UseStore

Plate store.

see

zustand store

Const virtualReference

virtualReference: PopperJS.VirtualElement

Functions

Const BalloonToolbar

  • Parameters

    Returns Element

Const BlockquoteElement

  • Parameters

    Returns Element

Const CodeBlockElement

  • Parameters

    Returns Element

Const CodeBlockSelectElement

  • CodeBlockSelectElement(__namedParameters: { className?: string; css?: CSSProp<any>; lang?: string; onChange: Function }): Element
  • Parameters

    • __namedParameters: { className?: string; css?: CSSProp<any>; lang?: string; onChange: Function }
      • Optional className?: string
      • Optional css?: CSSProp<any>
      • Optional lang?: string
      • onChange: Function

    Returns Element

Const CodeLineElement

  • Parameters

    Returns Element

Const ColorPicker

  • ColorPicker(__namedParameters: { color: undefined | string; updateColor: (ev: any, colorObj: string) => void }): Element
  • Parameters

    • __namedParameters: { color: undefined | string; updateColor: (ev: any, colorObj: string) => void }
      • color: undefined | string
      • updateColor: (ev: any, colorObj: string) => void
          • (ev: any, colorObj: string): void
          • Parameters

            • ev: any
            • colorObj: string

            Returns void

    Returns Element

Const Combobox

  • Register the combobox id, trigger, onSelectItem Renders the combobox if active.

    Parameters

    Returns null | Element

Const Draggable

  • Parameters

    Returns Element

Const EditablePlugins

  • {@link Editable} with plugins support.

    Parameters

    Returns Element

Const HrElement

  • Parameters

    Returns Element

Const ImageElement

  • Parameters

    Returns Element

Const ImageHandle

  • Parameters

    Returns Element

Const LinkElement

Const MediaEmbedElement

  • Parameters

    Returns Element

Const MediaEmbedUrlInput

  • MediaEmbedUrlInput(__namedParameters: { className?: string; css?: CSSProp<any>; onChange: Function; url: string }): Element
  • Parameters

    • __namedParameters: { className?: string; css?: CSSProp<any>; onChange: Function; url: string }
      • Optional className?: string
      • Optional css?: CSSProp<any>
      • onChange: Function
      • url: string

    Returns Element

Const MentionCombobox

  • MentionCombobox(__namedParameters: Pick<ComboboxProps, "component" | "items" | "onRenderItem"> & { createMentionNode?: CreateMentionNode; id?: string; insertSpaceAfterMention?: boolean; searchPattern?: string; trigger?: string } & PlatePluginKey): null | Element
  • Parameters

    • __namedParameters: Pick<ComboboxProps, "component" | "items" | "onRenderItem"> & { createMentionNode?: CreateMentionNode; id?: string; insertSpaceAfterMention?: boolean; searchPattern?: string; trigger?: string } & PlatePluginKey

    Returns null | Element

Const MentionElement

  • Parameters

    Returns Element

Const Placeholder

  • Parameters

    Returns any

Const Plate

  • Plate<T>(__namedParameters: PlateProps<T>): null | Element
  • Type parameters

    Parameters

    Returns null | Element

Const PortalBody

  • Parameters

    Returns ReactPortal

Const StyledElement

  • StyledElement with no default styles.

    Parameters

    Returns Element

Const StyledLeaf

  • StyledLeaf with no default styles.

    Parameters

    Returns Element

Const TableElement

  • Parameters

    Returns Element

Const TodoListElement

  • Parameters

    Returns Element

Const ToolbarAlign

  • Parameters

    Returns Element

Const ToolbarButton

  • Parameters

    Returns Element

Const ToolbarCodeBlock

  • Parameters

    Returns null | Element

Const ToolbarColorPicker

  • ToolbarColorPicker(__namedParameters: { icon: ReactNode; pluginKey?: string }): Element
  • Parameters

    • __namedParameters: { icon: ReactNode; pluginKey?: string }
      • icon: ReactNode
      • Optional pluginKey?: string

    Returns Element

Const ToolbarDropdown

  • ToolbarDropdown(__namedParameters: { children: ReactNode; control: ReactNode; onClose?: (ev: MouseEvent) => void }): Element
  • Parameters

    • __namedParameters: { children: ReactNode; control: ReactNode; onClose?: (ev: MouseEvent) => void }
      • children: ReactNode
      • control: ReactNode
      • Optional onClose?: (ev: MouseEvent) => void
          • (ev: MouseEvent): void
          • Parameters

            • ev: MouseEvent

            Returns void

    Returns Element

Const ToolbarElement

  • Toolbar button to toggle the type of elements in selection.

    Parameters

    Returns Element

Const ToolbarImage

  • Parameters

    Returns Element

Const ToolbarLink

  • Parameters

    Returns Element

Const ToolbarList

  • Parameters

    Returns Element

Const ToolbarMark

  • Toolbar button to toggle the mark of the leaves in selection.

    Parameters

    Returns Element

Const ToolbarMediaEmbed

  • Parameters

    Returns Element

Const ToolbarSearchHighlight

  • Parameters

    Returns Element

Const ToolbarTable

  • Parameters

    Returns Element

Const addColumn

  • Parameters

    Returns void

Const addRow

  • Parameters

    Returns void

Const applyDeepToNodes

  • Recursively apply an operation to children nodes with a query.

    Parameters

    Returns void

Const autoformatBlock

Const autoformatMark

Const autoformatText

Const createAlignPlugin

  • Enables support for text alignment, useful to align your content to left, right, center or justify.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createAutoformatPlugin

Const createBasicElementPlugins

Const createBasicMarkPlugins

  • Enables support for basic marks:

    • Bold
    • Code
    • Italic
    • Strikethrough
    • Subscript
    • Superscript
    • Underline

    Returns PlatePlugin<SPEditor>[]

Const createBlockquotePlugin

  • Enables support for block quotes, useful for quotations and passages.

    Returns PlatePlugin<SPEditor>

Const createBoldPlugin

  • Enables support for bold formatting

    Returns PlatePlugin<SPEditor>

Const createCodeBlockPlugin

  • Enables support for pre-formatted code blocks.

    Returns PlatePlugin<SPEditor>

Const createCodePlugin

  • Enables support for code formatting

    Returns PlatePlugin<SPEditor>

Const createComboboxPlugin

  • Returns PlatePlugin<SPEditor>

Const createDeserializeAstPlugin

Const createDeserializeCSVPlugin

Const createDeserializeHTMLPlugin

Const createDeserializeMDPlugin

Const createDndPlugin

Const createDocumentNode

  • createDocumentNode(type?: string, text?: string, remaining?: any[]): any[]
  • Parameters

    • Optional type: string
    • Optional text: string
    • Optional remaining: any[]

    Returns any[]

Const createEditorPlugins

Const createElementWithSlate

  • createElementWithSlate(slateProps?: Partial<SlateProps>): FunctionComponentElement<{ children: ReactNode; editor: ReactEditor; onChange: (value: Descendant[]) => void; value: Descendant[] }>
  • Create a React element wrapped in a Slate provider. By default, it will use an empty editor. TODO: allow other providers

    Parameters

    Returns FunctionComponentElement<{ children: ReactNode; editor: ReactEditor; onChange: (value: Descendant[]) => void; value: Descendant[] }>

Const createExitBreakPlugin

  • Insert soft break following configurable rules. Each rule specifies a hotkey and query options.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createFontBackgroundColorPlugin

  • Returns PlatePlugin<SPEditor>

Const createFontColorPlugin

  • Returns PlatePlugin<SPEditor>

Const createFontSizePlugin

  • Returns PlatePlugin<SPEditor>

Const createHeadingPlugin

  • Enables support for headings with configurable levels (from 1 to 6).

    Parameters

    Returns PlatePlugin<SPEditor>

Const createHighlightPlugin

  • Enables support for highlights, useful when reviewing content or highlighting it for future reference.

    Returns PlatePlugin<SPEditor>

Const createHistoryPlugin

Const createHorizontalRulePlugin

  • Returns PlatePlugin<SPEditor>

Const createImagePlugin

Const createIndentPlugin

Const createInlineVoidPlugin

Const createItalicPlugin

  • Enables support for italic formatting.

    Returns PlatePlugin<SPEditor>

Const createKbdPlugin

  • Enables support for code formatting

    Returns PlatePlugin<SPEditor>

Const createLinkPlugin

  • Enables support for hyperlinks.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createListPlugin

  • Enables support for bulleted, numbered and to-do lists.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createMediaEmbedPlugin

  • Enables support for embeddable media such as YouTube or Vimeo videos, Instagram posts and tweets or Google Maps.

    Parameters

    • Optional __namedParameters: { pluginKey?: string }
      • Optional pluginKey?: string

    Returns PlatePlugin<SPEditor>

Const createMentionPlugin

  • Enables support for autocompleting @mentions.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createNode

  • Parameters

    • Optional type: string
    • Optional text: string

    Returns TElement<AnyObject>

Const createNodeHOC

Const createNodeIdPlugin

Const createNodesHOC

  • createNodesHOC<T>(HOC: FunctionComponent<T>): (components: any, options: Options<T> | Options<T>[]) => any
  • Create components HOC by plugin key.

    Type parameters

    • T

    Parameters

    • HOC: FunctionComponent<T>

    Returns (components: any, options: Options<T> | Options<T>[]) => any

Const createNodesWithHOC

  • createNodesWithHOC<T>(withHOC: (component: any, props: T) => any): (components: any, options: Options<T> | Options<T>[]) => any
  • Create components HOC by plugin key with a custom HOC.

    Type parameters

    • T

    Parameters

    • withHOC: (component: any, props: T) => any
        • (component: any, props: T): any
        • Parameters

          • component: any
          • props: T

          Returns any

    Returns (components: any, options: Options<T> | Options<T>[]) => any

Const createNormalizeTypesPlugin

Const createParagraphPlugin

  • Enables support for paragraphs.

    Returns PlatePlugin<SPEditor>

Const createPlateComponents

Const createPlateOptions

Const createReactPlugin

  • see

    {@link withReact}

    Returns PlatePlugin<SPEditor>

Const createRemoveEmptyNodesPlugin

  • Parameters

    • options: { type: string | string[] }
      • type: string | string[]

    Returns PlatePlugin<SPEditor>

Const createResetNodePlugin

Const createSelectOnBackspacePlugin

Const createSingleLinePlugin

  • Forces editor to only have one line.

    Returns PlatePlugin<SPEditor>

Const createSoftBreakPlugin

  • Insert soft break following configurable rules. Each rule specifies a hotkey and query options.

    Parameters

    Returns PlatePlugin<SPEditor>

Const createStrikethroughPlugin

  • Enables support for strikethrough formatting.

    Returns PlatePlugin<SPEditor>

Const createStyles

  • createStyles<T>(props: T, styles: NonNullable<T["styles"]> | NonNullable<T["styles"]>[]): { root: Style } & Record<keyof NonNullable<T["styles"]>, undefined | Style>
  • Type parameters

    • T: { classNames?: any; prefixClassNames?: string; styles?: NonNullable<T["styles"]> } = StyledProps<{}>

    Parameters

    • props: T
    • styles: NonNullable<T["styles"]> | NonNullable<T["styles"]>[]

    Returns { root: Style } & Record<keyof NonNullable<T["styles"]>, undefined | Style>

Const createSubscriptPlugin

  • Enables support for subscript formatting.

    Returns PlatePlugin<SPEditor>

Const createSuperscriptPlugin

  • Enables support for superscript formatting.

    Returns PlatePlugin<SPEditor>

Const createTablePlugin

  • Enables support for tables.

    Returns PlatePlugin<SPEditor>

Const createTodoListPlugin

  • Returns PlatePlugin<SPEditor>

Const createTrailingBlockPlugin

Const createUnderlinePlugin

  • Enables support for underline formatting.

    Returns PlatePlugin<SPEditor>

Const defaultsDeepToNodes

  • Recursively merge a source object to children nodes with a query.

    Parameters

    Returns void

Const deleteColumn

  • Parameters

    Returns void

Const deleteFragment

  • deleteFragment(editor: TEditor<AnyObject>, options?: { at?: Location; distance?: number; hanging?: boolean; reverse?: boolean; test?: any; unit?: "block" | "character" | "word" | "line"; voids?: boolean }): void
  • Parameters

    • editor: TEditor<AnyObject>
    • Optional options: { at?: Location; distance?: number; hanging?: boolean; reverse?: boolean; test?: any; unit?: "block" | "character" | "word" | "line"; voids?: boolean }
      • Optional at?: Location
      • Optional distance?: number
      • Optional hanging?: boolean
      • Optional reverse?: boolean
      • Optional test?: any
      • Optional unit?: "block" | "character" | "word" | "line"
      • Optional voids?: boolean

    Returns void

Const deleteRow

  • Parameters

    Returns void

Const deleteStartSpace

  • If there is a whitespace character at the start of the code line, delete it.

    Parameters

    Returns boolean

Const deleteTable

  • Parameters

    Returns void

Const deserializeCSV

  • deserializeCSV<T>(editor: T, content: string, header: undefined | boolean, errorTolerance: number): undefined | any[]
  • Type parameters

    Parameters

    • editor: T
    • content: string
    • header: undefined | boolean
    • errorTolerance: number

    Returns undefined | any[]

Const deserializeHTMLElement

  • Deserialize HTML element.

    Type parameters

    Parameters

    • editor: T
    • __namedParameters: { element: HTMLElement; plugins: PlatePlugin<T>[] }

    Returns DeserializeHTMLReturn

Const deserializeHTMLNode

Const deserializeHTMLToBreak

  • deserializeHTMLToBreak(node: HTMLElement | ChildNode): undefined | "\n"
  • Deserialize HTML to break line.

    Parameters

    • node: HTMLElement | ChildNode

    Returns undefined | "\n"

Const deserializeHTMLToDocumentFragment

  • deserializeHTMLToDocumentFragment<T>(editor: T, __namedParameters: { element: string | HTMLElement; plugins: PlatePlugin<T>[]; stripWhitespace?: boolean }): any[]
  • Deserialize HTML element to a valid document fragment.

    Type parameters

    Parameters

    • editor: T
    • __namedParameters: { element: string | HTMLElement; plugins: PlatePlugin<T>[]; stripWhitespace?: boolean }
      • element: string | HTMLElement
      • plugins: PlatePlugin<T>[]
      • Optional stripWhitespace?: boolean

    Returns any[]

Const deserializeHTMLToElement

  • deserializeHTMLToElement<T>(editor: T, __namedParameters: { children: any[]; element: HTMLElement; plugins: PlatePlugin<T>[] }): undefined | TElement<AnyObject>
  • Deserialize HTML to Element.

    Type parameters

    Parameters

    • editor: T
    • __namedParameters: { children: any[]; element: HTMLElement; plugins: PlatePlugin<T>[] }
      • children: any[]
      • element: HTMLElement
      • plugins: PlatePlugin<T>[]

    Returns undefined | TElement<AnyObject>

Const deserializeHTMLToFragment

  • deserializeHTMLToFragment(__namedParameters: { children: any[]; element: HTMLElement }): undefined | any[]
  • Deserialize HTML body element to Fragment.

    Parameters

    • __namedParameters: { children: any[]; element: HTMLElement }
      • children: any[]
      • element: HTMLElement

    Returns undefined | any[]

Const deserializeHTMLToMarks

  • Deserialize HTML to TDescendant[] with marks on Text. Build the leaf from the leaf deserializers of each plugin.

    Type parameters

    Parameters

    Returns any[]

Const deserializeHTMLToText

  • deserializeHTMLToText(node: HTMLElement | ChildNode): undefined | null | string
  • Deserialize HTML text node to text.

    Parameters

    • node: HTMLElement | ChildNode

    Returns undefined | null | string

Const deserializeMD

  • deserializeMD(editor: SPEditor, content: string): any
  • Deserialize content from Markdown format to Slate format. editor needs

    Parameters

    Returns any

Const escapeRegExp

  • escapeRegExp(text: string): string
  • Parameters

    • text: string

    Returns string

Const exitBreakAtEdges

  • exitBreakAtEdges(editor: TEditor<AnyObject>, __namedParameters: { end?: boolean; start?: boolean }): { isEdge: boolean; isStart: boolean; queryEdge: boolean }
  • Check if the selection is at the edge of its parent block. If it is and if the selection is expanded, delete its content.

    Parameters

    • editor: TEditor<AnyObject>
    • __namedParameters: { end?: boolean; start?: boolean }
      • Optional end?: boolean
      • Optional start?: boolean

    Returns { isEdge: boolean; isStart: boolean; queryEdge: boolean }

    • isEdge: boolean
    • isStart: boolean
    • queryEdge: boolean

filterBreaklines

  • filterBreaklines(item: any): boolean
  • Parameters

    • item: any

    Returns boolean

Const findDescendant

Const findNode

Const flatMapByKey

  • flatMapByKey<TItem, TKey>(arr: TItem[], key: TKey): FlattenIfArray<NonNullable<TItem[TKey]>>[]
  • Flat map an array of object by key.

    Type parameters

    • TItem

    • TKey: string | number | symbol

    Parameters

    • arr: TItem[]
    • key: TKey

    Returns FlattenIfArray<NonNullable<TItem[TKey]>>[]

Const focusBlockStartById

  • focusBlockStartById(editor: ReactEditor, id: string): void
  • Select the start of a block by id and focus the editor.

    Parameters

    • editor: ReactEditor
    • id: string

    Returns void

Const getAbove

Const getAlignOverrideProps

  • Returns OverrideProps<SPEditor>

Const getAndUpsertLink

  • getAndUpsertLink<T>(editor: T, getLinkUrl?: (prevUrl: null | string) => Promise<null | string>): Promise<void>
  • Type parameters

    Parameters

    • editor: T
    • Optional getLinkUrl: (prevUrl: null | string) => Promise<null | string>
        • (prevUrl: null | string): Promise<null | string>
        • Parameters

          • prevUrl: null | string

          Returns Promise<null | string>

    Returns Promise<void>

Const getBalloonToolbarStyles

Const getBlockAbove

Const getBlockquoteDeserialize

  • Returns Deserialize<SPEditor>

Const getBlockquoteElementStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getBlocksWithId

Const getBoldDeserialize

  • Returns Deserialize<SPEditor>

getCellInNextTableRow

  • getCellInNextTableRow(editor: TEditor, currentRowPath: Path): NodeEntry | undefined
  • Parameters

    • editor: TEditor
    • currentRowPath: Path

    Returns NodeEntry | undefined

getCellInPreviousTableRow

  • getCellInPreviousTableRow(editor: TEditor, currentRowPath: Path): NodeEntry | undefined
  • Parameters

    • editor: TEditor
    • currentRowPath: Path

    Returns NodeEntry | undefined

Const getChildren

  • getChildren<T>(nodeEntry: NodeEntry<T>): NodeEntry<any>[]
  • Get children node entries of a node entry. TODO: try Node.children

    Type parameters

    Parameters

    • nodeEntry: NodeEntry<T>

    Returns NodeEntry<any>[]

Const getCodeBlockDecorate

  • Returns Decorate<SPEditor>

Const getCodeBlockDeserialize

  • Returns Deserialize<SPEditor>

Const getCodeBlockElementStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

getCodeBlockInsertFragment

  • Parameters

    Returns (fragment: TDescendant[]) => void

Const getCodeBlockOnKeyDown

Const getCodeBlockPluginOptions

Const getCodeBlockRenderLeaf

  • Returns RenderLeaf<SPEditor>

Const getCodeBlockType

  • getCodeBlockType<T>(editor: T): string
  • Type parameters

    Parameters

    • editor: T

    Returns string

Const getCodeDeserialize

  • Returns Deserialize<SPEditor>

Const getCodeLineDecorate

  • Returns Decorate<SPEditor>

Const getCodeLineElementStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getCodeLineEntry

  • If at (default = selection) is in ul>li>p, return li and ul node entries.

    Parameters

    • editor: SPEditor
    • Optional __namedParameters: { at?: null | Location }
      • Optional at?: null | Location

    Returns undefined | { codeBlock: NodeEntry<TAncestor<AnyObject>>; codeLine: NodeEntry<TAncestor<AnyObject>> }

Const getCodeLinePluginOptions

Const getCodeLineType

  • getCodeLineType<T>(editor: T): string
  • Type parameters

    Parameters

    • editor: T

    Returns string

Const getCodeLines

  • getCodeLines(editor: SPEditor, __namedParameters?: { at?: null | Location }): undefined | NodeEntry<TNode<AnyObject>>[]
  • Get code line entries

    Parameters

    • editor: SPEditor
    • Optional __namedParameters: { at?: null | Location }
      • Optional at?: null | Location

    Returns undefined | NodeEntry<TNode<AnyObject>>[]

Const getComboboxOnChange

  • For each combobox state (byId):

    • if the selection is collapsed
    • if the cursor follows the trigger
    • if there is text without whitespaces after the trigger
    • open the combobox: set id, search, targetRange in the store Close the combobox if needed

    Returns OnChange<SPEditor>

Const getComboboxOnKeyDown

  • If the combobox is open, handle:

    • down (next item)
    • up (previous item)
    • escape (reset combobox)
    • tab, enter (select item)

    Returns (editor: SPEditor) => (event: KeyboardEvent<Element>) => HandlerReturnType

Const getComboboxStoreById

  • Parameters

    • id: null | string

    Returns null | ComboboxStoreById

Const getComboboxStyles

Const getDeepInlineChildren

  • getDeepInlineChildren(editor: SPEditor, __namedParameters: { children: NodeEntry<any>[] }): NodeEntry<any>[]
  • Recursively get all the:

    • block children
    • inline children except those at excludeDepth

    Parameters

    • editor: SPEditor
    • __namedParameters: { children: NodeEntry<any>[] }
      • children: NodeEntry<any>[]

    Returns NodeEntry<any>[]

Const getDraggableStyles

Const getEditableRenderElement

Const getEditableRenderLeaf

Const getEditorOptions

  • Get editor.options.

    Type parameters

    Parameters

    Returns PlateOptions<T>

Const getElementDeserializer

Const getEmptyCellNode

  • getEmptyCellNode(editor: SPEditor, __namedParameters: TablePluginOptions): { children: { children: { text: string }[]; type: string }[]; type: string }
  • Parameters

    Returns { children: { children: { text: string }[]; type: string }[]; type: string }

    • children: { children: { text: string }[]; type: string }[]
    • type: string

Const getEmptyRowNode

  • getEmptyRowNode(editor: SPEditor, __namedParameters: TablePluginOptions & { colCount: number }): { children: { children: { children: { text: string }[]; type: string }[]; type: string }[]; type: string }
  • Parameters

    Returns { children: { children: { children: { text: string }[]; type: string }[]; type: string }[]; type: string }

    • children: { children: { children: { text: string }[]; type: string }[]; type: string }[]
    • type: string

Const getEmptyTableNode

  • getEmptyTableNode(editor: SPEditor, __namedParameters: TablePluginOptions): { children: { children: { children: { children: { text: string }[]; type: string }[]; type: string }[]; type: string }[]; type: string }
  • Parameters

    Returns { children: { children: { children: { children: { text: string }[]; type: string }[]; type: string }[]; type: string }[]; type: string }

    • children: { children: { children: { children: { text: string }[]; type: string }[]; type: string }[]; type: string }[]
    • type: string

Const getExitBreakOnKeyDown

Const getFontBackgroundColorDeserialize

Const getFontColorDeserialize

Const getFontSizeDeserialize

Const getHandler

  • getHandler<T>(cb?: T, ...args: Parameters<T>): () => void
  • Call a handler if defined

    Type parameters

    • T: (...args: any) => any

    Parameters

    • Optional cb: T
    • Rest ...args: Parameters<T>

    Returns () => void

      • (): void
      • Returns void

Const getHeadingDeserialize

Const getHeadingRenderElement

  • Font sizes are relative to the base font size H1 - fs * 20/11 H2 - fs * 16/11 H3 - fs * 14/11 H4 - fs * 12/11 H5 - fs * 1 H6 - fs * 1

    Parameters

    Returns RenderElement<SPEditor>

Const getHeadingToolbarStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getHighestEmptyList

  • getHighestEmptyList(editor: SPEditor, __namedParameters: { diffListPath?: Path; liPath: Path }): undefined | Path
  • Find the highest end list that can be deleted. Its path should be different to diffListPath. If the highest end list 2+ items, return liPath. Get the parent list until:

    • the list has less than 2 items.
    • its path is not equals to diffListPath.

    Parameters

    • editor: SPEditor
    • __namedParameters: { diffListPath?: Path; liPath: Path }
      • Optional diffListPath?: Path
      • liPath: Path

    Returns undefined | Path

Const getHighlightDeserialize

  • Returns Deserialize<SPEditor>

Const getHorizontalRuleDeserialize

  • Returns Deserialize<SPEditor>

Const getHoverDirection

  • getHoverDirection(dragItem: DragItemBlock, monitor: DropTargetMonitor<unknown, unknown>, ref: any, hoverId: string): DropDirection
  • If dragging a block A over another block B: get the direction of block A relative to block B.

    Parameters

    • dragItem: DragItemBlock
    • monitor: DropTargetMonitor<unknown, unknown>
    • ref: any
    • hoverId: string

    Returns DropDirection

Const getHrElementStyles

  • Parameters

    Returns { root: Style } & Record<"root" | "hr", undefined | Style>

Const getImageDeserialize

  • Returns Deserialize<SPEditor>

Const getImageElementStyles

Const getIndentDepth

Const getIndentOverrideProps

Const getInlineTypes

  • getInlineTypes<T>(editor: T, plugins: PlatePlugin<T>[]): string[]
  • Get inline types from the plugins

    Type parameters

    Parameters

    Returns string[]

Const getItalicDeserialize

  • Returns Deserialize<SPEditor>

Const getKbdDeserialize

Const getLastChild

  • Get the last child of a node or null if no children.

    Parameters

    Returns null | NodeEntry<any>

Const getLastChildPath

  • Get last child path. If there is no child, last index is 0.

    Parameters

    Returns Path

Const getLastNode

  • getLastNode(editor: TEditor<AnyObject>, level: number): undefined | NodeEntry<any>
  • Get the last node at a given level.

    Parameters

    Returns undefined | NodeEntry<any>

Const getLeafDeserializer

Const getLinkDeserialize

  • Returns Deserialize<SPEditor>

Const getLinkElementStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getLinkOnKeyDown

Const getListDeleteBackward

  • getListDeleteBackward(editor: SPEditor, unit: "block" | "character" | "word" | "line"): boolean
  • Parameters

    • editor: SPEditor
    • unit: "block" | "character" | "word" | "line"

    Returns boolean

Const getListDeleteForward

  • getListDeleteForward(editor: SPEditor): boolean
  • Parameters

    Returns boolean

Const getListDeleteFragment

  • getListDeleteFragment(editor: SPEditor): boolean
  • Parameters

    Returns boolean

Const getListDeserialize

  • Returns Deserialize<SPEditor>

Const getListInsertBreak

  • getListInsertBreak(editor: SPEditor): undefined | true
  • Parameters

    Returns undefined | true

Const getListInsertFragment

  • getListInsertFragment(editor: SPEditor): (fragment: any[]) => void
  • Parameters

    Returns (fragment: any[]) => void

      • (fragment: any[]): void
      • Parameters

        • fragment: any[]

        Returns void

Const getListItemEntry

  • Returns the nearest li and ul / ol wrapping node entries for a given path (default = selection)

    Parameters

    • editor: SPEditor
    • Optional __namedParameters: { at?: null | Location }
      • Optional at?: null | Location

    Returns undefined | { list: NodeEntry<TElement<AnyObject>>; listItem: NodeEntry<TElement<AnyObject>> }

Const getListNormalizer

  • Normalize list node to force the ul>li>p+ul structure.

    Parameters

    Returns (__namedParameters: NodeEntry<Node>) => void

      • (__namedParameters: NodeEntry<Node>): void
      • Parameters

        • __namedParameters: NodeEntry<Node>

        Returns void

Const getListOnKeyDown

  • getListOnKeyDown(pluginKeys?: string | string[]): (editor: SPEditor) => (event: KeyboardEvent<Element>) => HandlerReturnType

Const getListRoot

  • getListRoot(editor: SPEditor, at?: null | BasePoint | Path | BaseRange): undefined | NodeEntry<Ancestor>
  • Searches upward for the root list element

    Parameters

    • editor: SPEditor
    • Optional at: null | BasePoint | Path | BaseRange

    Returns undefined | NodeEntry<Ancestor>

Const getListTypes

  • getListTypes(editor: SPEditor): string[]
  • Parameters

    Returns string[]

Const getMark

  • Get selected mark by type.

    Parameters

    Returns any

Const getMatchPoints

  • getMatchPoints(editor: TEditor<AnyObject>, __namedParameters: MatchRange): undefined | { afterStartMatchPoint: undefined | BasePoint; beforeEndMatchPoint: BasePoint; beforeStartMatchPoint: undefined | BasePoint }
  • Parameters

    Returns undefined | { afterStartMatchPoint: undefined | BasePoint; beforeEndMatchPoint: BasePoint; beforeStartMatchPoint: undefined | BasePoint }

Const getMatchRange

  • getMatchRange(__namedParameters: { match: string | MatchRange; trigger: undefined | string | string[] }): { end: string; start: string; triggers: string[] }
  • Parameters

    • __namedParameters: { match: string | MatchRange; trigger: undefined | string | string[] }
      • match: string | MatchRange
      • trigger: undefined | string | string[]

    Returns { end: string; start: string; triggers: string[] }

    • end: string
    • start: string
    • triggers: string[]

Const getMediaEmbedDeserialize

  • Parameters

    • Optional pluginKey: string

    Returns Deserialize<SPEditor>

Const getMediaEmbedElementStyles

Const getMentionDeserialize

  • Parameters

    • Optional pluginKey: string

    Returns Deserialize<SPEditor>

Const getMentionElementStyles

  • Parameters

    Returns { root: Style } & Record<never, undefined | Style>

Const getMentionOnSelectItem

Const getNewDirection

  • getNewDirection(previousDir: string, dir?: string): undefined | "" | "bottom" | "top"
  • Get new direction if updated

    Parameters

    • previousDir: string
    • Optional dir: string

    Returns undefined | "" | "bottom" | "top"

Const getNextIndex

  • getNextIndex(i: number, max: number): number
  • Get next index from 0 to max. If index is max, get to 0.

    Parameters

    • i: number
    • max: number

    Returns number

Const getNextNonDisabledIndex

  • getNextNonDisabledIndex(moveAmount: number, baseIndex: number, itemCount: number, getItemNodeFromIndex: any, circular: boolean): number
  • Returns the next index in the list of an item that is not disabled.

    Parameters

    • moveAmount: number

      Number of positions to move. Negative to move backwards, positive forwards.

    • baseIndex: number

      The initial position to move from.

    • itemCount: number

      The total number of items.

    • getItemNodeFromIndex: any

      Used to check if item is disabled.

    • circular: boolean

      Specify if navigation is circular. Default is true.

    Returns number

    The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.

Const getNextSiblingNodes

  • Get the next sibling nodes after a path.

    Parameters

    • ancestorEntry: NodeEntry<TAncestor<AnyObject>>

      Ancestor of the sibling nodes

    • path: Path

      Path of the reference node

    Returns any[]

getNextTableCell

  • getNextTableCell(editor: TEditor, currentCell: NodeEntry, currentPath: Path, currentRow: NodeEntry): NodeEntry | undefined
  • Parameters

    • editor: TEditor
    • currentCell: NodeEntry
    • currentPath: Path
    • currentRow: NodeEntry

    Returns NodeEntry | undefined

Const getNextWrappingIndex

  • getNextWrappingIndex(moveAmount: number, baseIndex: number, itemCount: number, getItemNodeFromIndex: any, circular?: boolean): number
  • Returns the new index in the list, in a circular way. If next value is out of bonds from the total, it will wrap to either 0 or itemCount - 1.

    Parameters

    • moveAmount: number

      Number of positions to move. Negative to move backwards, positive forwards.

    • baseIndex: number

      The initial position to move from.

    • itemCount: number

      The total number of items.

    • getItemNodeFromIndex: any

      Used to check if item is disabled.

    • Optional circular: boolean

      Specify if navigation is circular. Default is true.

    Returns number

    The new index after the move.

Const getNode

  • Get the descendant node referred to by a specific path. If the path is an empty array, it refers to the root node itself. If the node is not found, return null.

    Type parameters

    • T: Node

    Parameters

    Returns null | T

Const getNodeDeserializer

  • Get a deserializer by type, node names, class names and styles.

    Parameters

    Returns DeserializeNode[]

Const getNodes

Const getNodesRange

  • getNodesRange(editor: TEditor<AnyObject>, nodeEntries: NodeEntry<Node>[]): undefined | BaseRange
  • Get node entries range.

    Parameters

    Returns undefined | BaseRange

Const getParagraphDeserialize

  • Returns Deserialize<SPEditor>

Const getParent

Const getPlaceholderStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getPlatePluginOptions

  • Get SP options by plugin key.

    Type parameters

    Parameters

    • Optional editor: SPEditor
    • Optional pluginKey: string

    Returns PlatePluginOptions<T>

Const getPlatePluginType

  • getPlatePluginType(editor?: SPEditor, pluginKey?: string): string
  • Get SP type option by plugin key.

    Parameters

    • Optional editor: SPEditor
    • Optional pluginKey: string

    Returns string

Const getPlatePluginTypes

  • getPlatePluginTypes(pluginKey: string | string[]): (editor: SPEditor) => string[]
  • Parameters

    • pluginKey: string | string[]

    Returns (editor: SPEditor) => string[]

Const getPlatePluginWithOverrides

  • getPlatePluginWithOverrides<T, V>(withOverrides: V): (...options: Parameters<V>) => PlatePlugin<T>
  • Helper to get a plate plugin returning withOverrides

    Type parameters

    Parameters

    • withOverrides: V

    Returns (...options: Parameters<V>) => PlatePlugin<T>

      • Parameters

        • Rest ...options: Parameters<V>

        Returns PlatePlugin<T>

Const getPlateState

  • If id is defined, get the state by id. Else, get the first state.

    Type parameters

    Parameters

    Returns undefined | PlateState<T>

Const getPointBefore

  • {@link Editor.before} with additional options. TODO: support for sequence of any characters.

    Parameters

    Returns any

Const getPointFromLocation

  • getPointFromLocation(editor: TEditor<AnyObject>, __namedParameters?: { at?: null | Location; focus?: boolean }): undefined | BasePoint
  • Get the point from a location (default: selection). If the location is a range, get the anchor point. If the location is a path, get the point at this path with offset 0. If focus is true, get the focus point.

    Parameters

    • editor: TEditor<AnyObject>
    • Optional __namedParameters: { at?: null | Location; focus?: boolean }
      • Optional at?: null | Location
      • Optional focus?: boolean

    Returns undefined | BasePoint

Const getPointNextToVoid

  • getPointNextToVoid(editor: TEditor<AnyObject>, __namedParameters: { after?: boolean; at: BasePoint }): BasePoint
  • If the start point is inside an inline void, get the point before or after it.

    Parameters

    • editor: TEditor<AnyObject>
    • __namedParameters: { after?: boolean; at: BasePoint }
      • Optional after?: boolean

        Get the point after (instead of before) the void node.

      • at: BasePoint

    Returns BasePoint

Const getPreventDefaultHandler

  • getPreventDefaultHandler<T>(cb?: T, ...args: Parameters<T>): (event: any) => void
  • Prevent default and call a handler if defined

    Type parameters

    • T: (...args: any) => any

    Parameters

    • Optional cb: T
    • Rest ...args: Parameters<T>

    Returns (event: any) => void

      • (event: any): void
      • Parameters

        • event: any

        Returns void

Const getPreviousBlockById

  • Find the block before a block by id. If not found, find the first block by id and return [null, its previous path]

    Parameters

    Returns undefined | NodeEntry<Node>

Const getPreviousIndex

  • getPreviousIndex(i: number, max: number): number
  • Get previous index from 0 to max. If index is 0, get to max.

    Parameters

    • i: number
    • max: number

    Returns number

Const getPreviousPath

  • getPreviousPath(path: Path): undefined | Path
  • Parameters

    • path: Path

    Returns undefined | Path

getPreviousTableCell

  • getPreviousTableCell(editor: TEditor, currentCell: NodeEntry, currentPath: Path, currentRow: NodeEntry): NodeEntry | undefined
  • Parameters

    • editor: TEditor
    • currentCell: NodeEntry
    • currentPath: Path
    • currentRow: NodeEntry

    Returns NodeEntry | undefined

Const getQueryOptions

  • Extended query options for slate queries:

    • match can be an object predicate where one of the values should include the node value. Example: { type: ['1', '2'] } will match the nodes having one of these 2 types.

    Type parameters

    • T

    Parameters

    Returns any

Const getRangeBefore

Const getRangeBoundingClientRect

  • getRangeBoundingClientRect(editor: ReactEditor, at: null | BaseRange): undefined | DOMRect
  • Get bounding client rect by slate range

    Parameters

    • editor: ReactEditor
    • at: null | BaseRange

    Returns undefined | DOMRect

Const getRangeFromBlockStart

  • Get the range from the start of the block above a location (default: selection) to the location.

    Parameters

    Returns undefined | { anchor: BasePoint; focus: BasePoint }

Const getRenderElement

Const getRenderLeaf

Const getRenderNodeProps

  • Computes className and nodeProps

    Parameters

    Returns { className: string; nodeProps: any }

    • className: string
    • nodeProps: any

Const getResetNodeOnKeyDown

Const getSearchHighlightDecorate

Const getSelectionBoundingClientRect

  • getSelectionBoundingClientRect(): undefined | DOMRect
  • Get bounding client rect of the window selection

    Returns undefined | DOMRect

Const getSelectionText

  • Get the selected text. Return empty string if no selection.

    Parameters

    Returns string

Const getSetStateByKey

  • getSetStateByKey<T>(key: string, stateId?: string): (value: T, id?: string) => undefined | void | ""
  • Type parameters

    • T

    Parameters

    • key: string
    • Optional stateId: string

    Returns (value: T, id?: string) => undefined | void | ""

      • (value: T, id?: string): undefined | void | ""
      • Parameters

        • value: T
        • Optional id: string

        Returns undefined | void | ""

Const getSingleLineKeyDown

Const getSlateClass

  • getSlateClass(type: string): string
  • Get slate class name: slate-

    Parameters

    • type: string

    Returns string

Const getSoftBreakOnKeyDown

Const getStateById

Const getStrikethroughDeserialize

  • Returns Deserialize<SPEditor>

Const getStyledNodeStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getSubscriptDeserialize

  • Returns Deserialize<SPEditor>

Const getSuperscriptDeserialize

  • Returns Deserialize<SPEditor>

Const getTableCellEntry

  • If at (default = selection) is in table>tr>td or table>tr>th, return table, tr, and td or th node entries.

    Parameters

    • editor: SPEditor
    • Optional __namedParameters: { at?: null | Location }
      • Optional at?: null | Location

    Returns undefined | { tableCell: NodeEntry<TAncestor<AnyObject>>; tableElement: NodeEntry<TAncestor<AnyObject>>; tableRow: NodeEntry<TAncestor<AnyObject>> }

Const getTableDeserialize

  • Returns Deserialize<SPEditor>

Const getTableElementStyles

  • Parameters

    Returns { root: Style } & Record<"root", undefined | Style>

Const getTableOnKeyDown

  • getTableOnKeyDown<T>(): (editor: T) => (event: KeyboardEvent<Element>) => HandlerReturnType

Const getText

  • See {@link Editor.string}. If at is not defined, return an empty string.

    Parameters

    Returns string

Const getTextFromTrigger

  • getTextFromTrigger(editor: BaseEditor, __namedParameters: { at: BasePoint; searchPattern?: string; trigger: string }): undefined | { range: BaseRange; textAfterTrigger: string }
  • Get text and range from trigger to cursor