prosekit/vue
ProseKitProps
editor: Editor
UseExtensionOptions
editor?: MaybeRefOrGetter<Editor>
The editor to add the extension to. If not provided, it will use the editor from the nearest
ProseKit
component.priority?: Priority
Optional priority to add the extension with.
VueMarkViewOptions
Options for defineVueMarkView.
as?: MarkViewDOMSpec
component: VueMarkViewComponent
contentAs?: MarkViewDOMSpec
destroy?: () => void
ignoreMutation?: (mutation: ViewMutationRecord) => boolean | void
name: string
The name of the mark type.
VueMarkViewProps
contentRef: VNodeRef
mark: ShallowRef<Mark>
view: EditorView
VueNodeViewOptions
Options for defineVueNodeView.
as?: NodeViewDOMSpec
component: VueNodeViewComponent
contentAs?: NodeViewDOMSpec
deselectNode?: () => void
destroy?: () => void
ignoreMutation?: (mutation: ViewMutationRecord) => boolean | void
name: string
The name of the node type.
onUpdate?: () => void
selectNode?: () => void
setSelection?: (anchor: number, head: number, root: Document | ShadowRoot) => void
stopEvent?: (event: Event) => boolean
update?: (node: Node, decorations: readonly Decoration[], innerDecorations: DecorationSource) => boolean | void
VueNodeViewProps
contentRef: VNodeRef
decorations: ShallowRef<readonly Decoration[]>
getPos: () => undefined | number
innerDecorations: ShallowRef<DecorationSource>
node: ShallowRef<Node>
selected: ShallowRef<boolean>
setAttrs: (attrs: Attrs) => void
view: EditorView
VueMarkViewComponent
Type: DefineComponent<VueMarkViewProps, any, any>
VueNodeViewComponent
Type: DefineComponent<VueNodeViewProps, any, any>
ProseKit
The root component for a ProseKit editor.
Type: DefineSetupFnComponent<ProseKitProps, {}, {}, ProseKitProps & {}, PublicProps>
defineVueMarkView
function defineVueMarkView(options: VueMarkViewOptions): Extension
Defines a mark view using a Vue component.
defineVueNodeView
function defineVueNodeView(options: VueNodeViewOptions): Extension
Defines a node view using a Vue component.
useDocChange
function useDocChange(handler: (doc: Node) => void, options?: UseExtensionOptions): void
Calls the given handler whenever the editor document changes.
useEditor
function useEditor<E extends Extension>(options?: { update?: boolean }): ShallowRef<Editor<E>>
Retrieves the editor instance from the nearest ProseKit component.
useExtension
function useExtension(extension: MaybeRefOrGetter<null | Extension>, options?: UseExtensionOptions): void
Add an extension to the editor.
useKeymap
function useKeymap(keymap: MaybeRefOrGetter<Keymap>, options?: UseExtensionOptions): void
useStateUpdate
function useStateUpdate(handler: (state: EditorState) => void, options?: UseExtensionOptions): void
Calls the given handler whenever the editor state changes.