prosekit/solid
Interfaces
Section titled “Interfaces”SolidMarkViewProps
Section titled “SolidMarkViewProps”Properties
Section titled “Properties”-
contentRef:MarkViewContentRef
SolidMarkViewOptions
Section titled “SolidMarkViewOptions”Options for defineSolidMarkView.
Properties
Section titled “Properties”-
name:string -
The name of the mark type.
-
as?:MarkViewDOMSpec
-
contentAs?:MarkViewDOMSpec
-
ignoreMutation?: (mutation:ViewMutationRecord) =>boolean|void
-
destroy?: () =>void
SolidNodeViewProps
Section titled “SolidNodeViewProps”Properties
Section titled “Properties”-
contentRef:NodeViewContentRef
-
getPos: () =>number|undefined
-
selected:boolean
-
decorations: readonlyDecoration[]
SolidNodeViewOptions
Section titled “SolidNodeViewOptions”Options for defineSolidNodeView.
Properties
Section titled “Properties”-
name:string -
The name of the node type.
-
as?:NodeViewDOMSpec
-
contentAs?:NodeViewDOMSpec
-
update?: (node:ProseMirrorNode,decorations: readonlyDecoration[],innerDecorations:DecorationSource) =>boolean|void
-
ignoreMutation?: (mutation:ViewMutationRecord) =>boolean|void
-
selectNode?: () =>void
-
deselectNode?: () =>void
-
setSelection?: (anchor:number,head:number,root:Document|ShadowRoot) =>void
-
destroy?: () =>void
-
onUpdate?: () =>void
UseEditorDerivedOptions
Section titled “UseEditorDerivedOptions”Properties
Section titled “Properties”-
editor?:MaybeAccessor<Editor<E>> -
The editor to add the extension to. If not provided, it will use the editor from the nearest
<ProseKit>component.
UseExtensionOptions
Section titled “UseExtensionOptions”Properties
Section titled “Properties”-
editor?:MaybeAccessor<Editor<any>> -
The editor to add the extension to. If not provided, it will use the editor from the nearest
<ProseKit>component.
Type Aliases
Section titled “Type Aliases”ProseKitProps
Section titled “ProseKitProps”-
type ProseKitProps =ParentProps<{editor:Editor; }>
SolidMarkViewComponent
Section titled “SolidMarkViewComponent”-
type SolidMarkViewComponent =Component<SolidMarkViewProps>
SolidNodeViewComponent
Section titled “SolidNodeViewComponent”-
type SolidNodeViewComponent =Component<SolidNodeViewProps>
MaybeAccessor
Section titled “MaybeAccessor”-
type MaybeAccessor<T> =T|Accessor<T> -
T or a reactive/non-reactive function returning T
Variables
Section titled “Variables”ProseKit
Section titled “ProseKit”-
const ProseKit:Component<ProseKitProps> -
The root component for a ProseKit editor.
Functions
Section titled “Functions”defineSolidMarkView()
Section titled “defineSolidMarkView()”-
function defineSolidMarkView(options:SolidMarkViewOptions):Extension -
Defines a mark view using a Solid component.
defineSolidNodeView()
Section titled “defineSolidNodeView()”-
function defineSolidNodeView(options:SolidNodeViewOptions):Extension -
Defines a node view using a Solid component.
useDocChange()
Section titled “useDocChange()”-
function useDocChange(handler: (doc:ProseMirrorNode) =>void,options?:UseExtensionOptions):void -
Calls the given handler whenever the editor document changes.
useEditorDerivedValue()
Section titled “useEditorDerivedValue()”-
function useEditorDerivedValue<E, Derived>(derive: (editor:Editor<E>) =>Derived,options?:UseEditorDerivedOptions<E>):Accessor<Derived> -
Runs a function to derive a value from the editor instance after editor state changes.
This is useful when you need to render something based on the editor state, for example, whether the selected text is wrapped in an italic mark.
It returns an accessor of the derived value that updates whenever the editor state changes.
useEditor()
Section titled “useEditor()”-
Retrieves the editor instance from the nearest ProseKit component.
useExtension()
Section titled “useExtension()”-
function useExtension(extension:Accessor<Extension<ExtensionTyping<any,any,any>> |null>,options?:UseExtensionOptions):void -
Add an extension to the editor.
useKeymap()
Section titled “useKeymap()”-
function useKeymap(keymap: () =>Keymap,options?:UseExtensionOptions):void
useStateUpdate()
Section titled “useStateUpdate()”-
function useStateUpdate(handler: (state:EditorState) =>void,options?:UseExtensionOptions):void -
Calls the given handler whenever the editor state changes.