@stesura/core/plugins
ProseMirror plugins that make up the editor runtime, and the plugin keys for reading their state.
stesuraPlugins(schema, editorId, configuration?, options?) returns the full set: basePlugins (infrastructure) followed by customPlugins (features). Set an entry to false in options to leave that plugin out, e.g. { history: false } when a collab provider supplies its own undo/redo. configPlugin and viewModeInteractionsPlugin are always included; stesuraKeymapPlugin is not part of the set.
Functions & values
basePlugins
Parameters:| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> | |
editorId | string | |
configuration | ConfigPluginProps | |
props | BasePluginsProps |
closeMathEditor
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
codeHighlightPluginKey
configPlugin
Parameters:| Name | Type | Default |
|---|---|---|
__0 | ConfigPluginProps & { editorId: string; } |
configPluginKey
customPlugins
Parameters:| Name | Type | Default |
|---|---|---|
props | CustomPluginsProps |
docStylingPlugin
Parameters:This function does not accept any parameters.
formatPainterPlugin
Parameters:This function does not accept any parameters.
formatPainterPluginKey
gapCursorClassPlugin
Parameters:This function does not accept any parameters.
getImageUploadPolicy
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState |
getMathEditorState
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState |
headerFooterGuardPlugin
Parameters:This function does not accept any parameters.
headerFooterRegion
Parameters:| Name | Type | Default |
|---|---|---|
sectionIndex | number | |
kind | "header" | "footer" | |
variant | string |
headerFooterSyncPluginKey
headingInputRulesPlugin
Parameters:This function does not accept any parameters.
highlightCounterNodesPlugin
Parameters:This function does not accept any parameters.
highlightPlugin
Parameters:This function does not accept any parameters.
highlightPluginKey
imagePlugin
Parameters:This function does not accept any parameters.
imagePluginKey
imageUploadPolicy
Parameters:| Name | Type | Default |
|---|---|---|
policy | ImageUploadPolicy |
imageUploadPolicyKey
inlineNodeSelectionHandlerPlugin
Parameters:This function does not accept any parameters.
invisibleCharacters
Parameters:This function does not accept any parameters.
invisibleCharactersPluginKey
languagePlugin
Parameters:This function does not accept any parameters.
languagePluginKey
lowlightPlugin
| Name | Type | Default |
|---|---|---|
spec | PluginSpec<CodeHighlightPluginState>The plugin’s spec object . | |
props | EditorProps<Plugin<CodeHighlightPluginState>>The props exported by this plugin. | |
getState | (state: EditorState) => CodeHighlightPluginState | undefinedExtract the plugin’s state field from an editor state. |
mathEditorEnterCmd
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
mathEditorPlugin
Parameters:This function does not accept any parameters.
mathEditorPluginKey
mathPlugins
Parameters:| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> |
numberingInputRulesPlugin
Parameters:This function does not accept any parameters.
numberingPlugin
Parameters:This function does not accept any parameters.
numberingPluginKey
numberingPropsPlugin
Parameters:This function does not accept any parameters.
numberingPropsPluginKey
openMathEditor
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState | |
dispatch | (tr: Transaction) => void | |
view | EditorView |
openMathEditorAt
Parameters:| Name | Type | Default |
|---|---|---|
pos | number |
openMathEditorTarget
Parameters:| Name | Type | Default |
|---|---|---|
state | EditorState |
paginationPluginKey
pendingLinkPlugin
Parameters:This function does not accept any parameters.
pendingLinkPluginKey
searchPlugin
Parameters:| Name | Type | Default |
|---|---|---|
options | { initialQuery?: SearchQuery; initialRange?: { from: number; to: number; }; } |
searchPluginKey
SearchQuery
sectionUnwrapPastePlugin
Parameters:This function does not accept any parameters.
selectAfterMath
Parameters:| Name | Type | Default |
|---|---|---|
pos | number |
selectionHighlightPlugin
Parameters:This function does not accept any parameters.
setMathSource
Parameters:| Name | Type | Default |
|---|---|---|
pos | number | |
source | string |
setPilcrowWidgetFactory
Parameters:| Name | Type | Default |
|---|---|---|
factory | PilcrowWidgetFactory |
spacingPlugin
Parameters:This function does not accept any parameters.
stesuraKeymapPlugin
Parameters:| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> |
stesuraPlugins
Parameters:| Name | Type | Default |
|---|---|---|
schema | Schema<any, any> | |
editorId | string | |
configuration | ConfigPluginProps | |
options | StesuraPluginsOptions |
stripTrackChangesMarksFromSlice
Parameters:| Name | Type | Default |
|---|---|---|
slice | Slice | |
deletion | MarkType | |
insertion | MarkType | |
modification | MarkType |
styleNumberingInstanceId
Parameters:| Name | Type | Default |
|---|---|---|
listRef | string | |
region | string |
styleSheetPlugin
Parameters:This function does not accept any parameters.
styleSheetPluginKey
tableCellSelectionPreserver
Parameters:This function does not accept any parameters.
tableDragHandlePlugin
Parameters:This function does not accept any parameters.
tableDragHandlePluginKey
tableEmptyRowGuardPlugin
Parameters:This function does not accept any parameters.
tableHeaderCellsPlugin
Parameters:This function does not accept any parameters.
tableResizingPlugin
Parameters:| Name | Type | Default |
|---|---|---|
options | TableResizingOptions |
tableSizingPlugin
Parameters:This function does not accept any parameters.
tabStopsPlugin
Parameters:This function does not accept any parameters.
tabStopsPluginKey
TOCplugin
Parameters:This function does not accept any parameters.
tocPluginKey
trackChangesKey
trackChangesStripPastePlugin
Parameters:This function does not accept any parameters.
typographyPlugin
Parameters:This function does not accept any parameters.
uniqueIdPlugin
Parameters:This function does not accept any parameters.
viewModeInteractionsPlugin
Parameters:This function does not accept any parameters.
wordPasteHandlerPlugin
Parameters:This function does not accept any parameters.
wordPasteHandlerPluginKey
wrapSelectionWithPlugin
Parameters:This function does not accept any parameters.
Types
CodeHighlightPluginState
| Name | Type | Default |
|---|---|---|
cache | DecorationCache | |
decorations | DecorationSet | undefined | |
promises | Promise<void>[] |
ConfigPluginProps
PilcrowWidgetFactory
Parameters:| Name | Type | Default |
|---|---|---|
pos | number |
SearchState
| Name | Type | Default |
|---|---|---|
enabled | boolean | |
query | SearchQuery | |
range | { from: number; to: number; } | null | |
deco | DecorationSet |
StesuraPluginsOptions
Other exports
| Export | Type | Description |
|---|---|---|
GAP_CURSOR_ACTIVE_CLASS | "pm-gapcursor-active" | Root class set while the selection is a gap cursor. |
NUMBERING_REGION_BODY | "body" | Counter-stream regions — Word’s “stories”. Numbering DEFINITIONS are document-global; the counters that run off them are per story: the body, all footnotes together, all endnotes together, and each header/footer part. |
NUMBERING_REGION_ENDNOTES | "endnotes" | |
NUMBERING_REGION_FOOTNOTES | "footnotes" | |
OVERSIZED_CLAMPS_POKE | "oversizedClampsPoke" | Payload-less meta key meant to signal that the oversized-node clamp set changed. Currently neither dispatched nor read anywhere. |
PAGINATION_CLEAR_ALL_META | "clearAllPaginationCaches" | Meta key (true) that invalidates every section’s pagination cache, e.g. after a DOCX import. Lives in core so callers need not import pagination. |
PAGINATION_DIRTY_NODES_META | "paginationDirtyNodes" | Meta key carrying node ids (string[]) whose rendered size changed without a doc change, e.g. a nodeview whose async data grew its DOM. Pagination re-measures only those nodes, never wiping the cache. |
PILCROW_CLASS | "pm-pilcrow" | Class the CSS hangs the marker’s styling off. |
Last updated on