MarkConfig
@blockslides/core / MarkConfig
Interface: MarkConfig<Options, Storage>
Defined in: blockslides/packages/core/src/Mark.ts:13
Extends
ExtendableConfig<Options,Storage,MarkConfig<Options,Storage>,MarkType>
Type Parameters
Options
Options = any
Storage
Storage = any
Properties
name
name:
string
Defined in: blockslides/packages/core/src/Extendable.ts:50
The extension name - this must be unique. It will be used to identify the extension.
Example
'myExtension'
Inherited from
priority?
optionalpriority:number
Defined in: blockslides/packages/core/src/Extendable.ts:58
The priority of your extension. The higher, the earlier it will be called and will take precedence over other extensions with a lower priority.
Default
100
Example
101
Inherited from
addOptions()?
optionaladdOptions: (this) =>Options
Defined in: blockslides/packages/core/src/Extendable.ts:60
Parameters
this
name
string
parent
(...args) => Options | undefined
Returns
Options
Inherited from
addStorage()?
optionaladdStorage: (this) =>Storage
Defined in: blockslides/packages/core/src/Extendable.ts:66
Parameters
this
name
string
options
Options
parent
(...args) => Storage | undefined
Returns
Storage
Inherited from
addGlobalAttributes()?
optionaladdGlobalAttributes: (this) =>GlobalAttributes
Defined in: blockslides/packages/core/src/Extendable.ts:72
Parameters
this
name
string
options
Options
storage
Storage
extensions
(Node<any, any> | Mark<any, any>)[]
parent
(...args) => GlobalAttributes | undefined
Returns
Inherited from
ExtendableConfig.addGlobalAttributes
addCommands()?
optionaladdCommands: (this) =>Partial<RawCommands>
Defined in: blockslides/packages/core/src/Extendable.ts:80
Parameters
this
name
string
options
Options
storage
Storage
editor
type
MarkType
parent
(...args) => ReturnType<Required<T>[P]> | undefined
Returns
Partial<RawCommands>
Inherited from
addKeyboardShortcuts()?
optionaladdKeyboardShortcuts: (this) =>object
Defined in: blockslides/packages/core/src/Extendable.ts:89
Parameters
this
name
string
options
Options
storage
Storage
editor
type
MarkType
parent
(...args) => object | undefined
Returns
object
Inherited from
ExtendableConfig.addKeyboardShortcuts
addInputRules()?
optionaladdInputRules: (this) =>InputRule[]
Defined in: blockslides/packages/core/src/Extendable.ts:100
Parameters
this
name
string
options
Options
storage
Storage
editor
type
MarkType
parent
(...args) => InputRule[] | undefined
Returns
Inherited from
ExtendableConfig.addInputRules
addPasteRules()?
optionaladdPasteRules: (this) =>PasteRule[]
Defined in: blockslides/packages/core/src/Extendable.ts:109
Parameters
this
name
string
options
Options
storage
Storage
editor
type
MarkType
parent
(...args) => PasteRule[] | undefined
Returns
Inherited from
ExtendableConfig.addPasteRules
addProseMirrorPlugins()?
optionaladdProseMirrorPlugins: (this) =>Plugin<any>[]
Defined in: blockslides/packages/core/src/Extendable.ts:118
Parameters
this
name
string
options
Options
storage
Storage
editor
type
MarkType
parent
(...args) => Plugin<any>[] | undefined
Returns
Plugin<any>[]
Inherited from
ExtendableConfig.addProseMirrorPlugins
addExtensions()?
optionaladdExtensions: (this) =>Extensions
Defined in: blockslides/packages/core/src/Extendable.ts:127
Parameters
this
name
string
options
Options
storage
Storage
parent
(...args) => Extensions | undefined
Returns
Inherited from
ExtendableConfig.addExtensions
markdownTokenName?
optionalmarkdownTokenName:string
Defined in: blockslides/packages/core/src/Extendable.ts:134
Inherited from
ExtendableConfig.markdownTokenName
parseMarkdown()?
optionalparseMarkdown: (token,helpers) =>MarkdownParseResult
Defined in: blockslides/packages/core/src/Extendable.ts:139
The parse function used by the markdown parser to convert markdown tokens to ProseMirror nodes.
Parameters
token
helpers
Returns
Inherited from
ExtendableConfig.parseMarkdown
renderMarkdown()?
optionalrenderMarkdown: (node,helpers,ctx) =>string
Defined in: blockslides/packages/core/src/Extendable.ts:147
The serializer function used by the markdown serializer to convert ProseMirror nodes to markdown tokens.
Parameters
node
helpers
ctx
Returns
string
Inherited from
ExtendableConfig.renderMarkdown
markdownTokenizer?
optionalmarkdownTokenizer:MarkdownTokenizer
Defined in: blockslides/packages/core/src/Extendable.ts:158
The markdown tokenizer responsible for turning a markdown string into tokens
Custom tokenizers are only needed when you want to parse non-standard markdown token.
Inherited from
ExtendableConfig.markdownTokenizer
markdownOptions?
optionalmarkdownOptions:object
Defined in: blockslides/packages/core/src/Extendable.ts:163
Optional markdown options for indentation
indentsContent?
optionalindentsContent:boolean
Defines if this markdown element should indent it's child elements
Inherited from
ExtendableConfig.markdownOptions
extendNodeSchema?
optionalextendNodeSchema: (this,extension) =>Record<string,any> |null
Defined in: blockslides/packages/core/src/Extendable.ts:180
This function extends the schema of the node.
Example
extendNodeSchema() {
return {
group: 'inline',
selectable: false,
}
}
Inherited from
ExtendableConfig.extendNodeSchema
extendMarkSchema?
optionalextendMarkSchema: (this,extension) =>Record<string,any> |null
Defined in: blockslides/packages/core/src/Extendable.ts:202
This function extends the schema of the mark.
Example
extendMarkSchema() {
return {
group: 'inline',
selectable: false,
}
}
Inherited from
ExtendableConfig.extendMarkSchema
onBeforeCreate?
optionalonBeforeCreate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:217
The editor is not ready yet.
Inherited from
ExtendableConfig.onBeforeCreate
onCreate?
optionalonCreate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:234
The editor is ready.
Inherited from
onUpdate?
optionalonUpdate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:251
The content has changed.
Inherited from
onSelectionUpdate?
optionalonSelectionUpdate: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:268
The selection has changed.
Inherited from
ExtendableConfig.onSelectionUpdate
onTransaction?
optionalonTransaction: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:285
The editor state has changed.
Inherited from
ExtendableConfig.onTransaction
onFocus?
optionalonFocus: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:302
The editor is focused.
Inherited from
onBlur?
optionalonBlur: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:319
The editor isn’t focused anymore.
Inherited from
onDestroy?
optionalonDestroy: (this,event) =>void|null
Defined in: blockslides/packages/core/src/Extendable.ts:336
The editor is destroyed.
Inherited from
addMarkView?
optionaladdMarkView: (this) =>MarkViewRenderer|null
Defined in: blockslides/packages/core/src/Mark.ts:23
Mark View
keepOnSplit?
optionalkeepOnSplit:boolean| () =>boolean
Defined in: blockslides/packages/core/src/Mark.ts:37
Keep mark after split node
inclusive?
optionalinclusive:boolean| (this) =>boolean|undefined
Defined in: blockslides/packages/core/src/Mark.ts:42
Inclusive
excludes?
optionalexcludes:string| (this) =>string|undefined
Defined in: blockslides/packages/core/src/Mark.ts:55
Excludes
exitable?
optionalexitable:boolean| () =>boolean
Defined in: blockslides/packages/core/src/Mark.ts:68
Marks this Mark as exitable
group?
optionalgroup:string| (this) =>string|undefined
Defined in: blockslides/packages/core/src/Mark.ts:73
Group
spanning?
optionalspanning:boolean| (this) =>boolean|undefined
Defined in: blockslides/packages/core/src/Mark.ts:86
Spanning
code?
optionalcode:boolean| (this) =>boolean
Defined in: blockslides/packages/core/src/Mark.ts:99
Code
parseHTML()?
optionalparseHTML: (this) => readonlyParseRule[] |undefined
Defined in: blockslides/packages/core/src/Mark.ts:112
Parse HTML
Parameters
this
name
string
options
Options
storage
Storage
parent
(...args) => readonly ParseRule[] | undefined | undefined
editor?
Returns
readonly ParseRule[] | undefined
renderHTML?
optionalrenderHTML: (this,props) =>DOMOutputSpec|null
Defined in: blockslides/packages/core/src/Mark.ts:123
Render HTML
addAttributes()?
optionaladdAttributes: (this) => { } |Attributes
Defined in: blockslides/packages/core/src/Mark.ts:142
Attributes
Parameters
this
name
string
options
Options
storage
Storage
parent
(...args) => { } | Attributes | undefined
editor?
Returns
{ } | Attributes