Skip to main content

NodeView

@blockslides/core


@blockslides/core / NodeView

Class: NodeView<Component, NodeEditor, Options>

Defined in: blockslides/packages/core/src/NodeView.ts:16

Type Parameters

Component

Component

NodeEditor

NodeEditor extends SlideEditor = SlideEditor

Options

Options extends NodeViewRendererOptions = NodeViewRendererOptions

Implements

  • NodeView

Constructors

Constructor

new NodeView<Component, NodeEditor, Options>(component, props, options?): NodeView<Component, NodeEditor, Options>

Defined in: blockslides/packages/core/src/NodeView.ts:44

Parameters

component

Component

props

NodeViewRendererProps

options?

Partial<Options>

Returns

NodeView<Component, NodeEditor, Options>

Properties

component

component: Component

Defined in: blockslides/packages/core/src/NodeView.ts:22


editor

editor: NodeEditor

Defined in: blockslides/packages/core/src/NodeView.ts:24


options

options: Options

Defined in: blockslides/packages/core/src/NodeView.ts:26


extension

extension: Node<any, any>

Defined in: blockslides/packages/core/src/NodeView.ts:28


node

node: Node

Defined in: blockslides/packages/core/src/NodeView.ts:30


decorations

decorations: readonly Decoration[]

Defined in: blockslides/packages/core/src/NodeView.ts:32


innerDecorations

innerDecorations: DecorationSource

Defined in: blockslides/packages/core/src/NodeView.ts:34


view

view: EditorView

Defined in: blockslides/packages/core/src/NodeView.ts:36


getPos()

getPos: () => number | undefined

Defined in: blockslides/packages/core/src/NodeView.ts:38

Returns

number | undefined


HTMLAttributes

HTMLAttributes: Record<string, any>

Defined in: blockslides/packages/core/src/NodeView.ts:40


isDragging

isDragging: boolean = false

Defined in: blockslides/packages/core/src/NodeView.ts:42

Accessors

dom

Get Signature

get dom(): HTMLElement

Defined in: blockslides/packages/core/src/NodeView.ts:71

The outer DOM node that represents the document node.

Returns

HTMLElement

Implementation of

ProseMirrorNodeView.dom


contentDOM

Get Signature

get contentDOM(): HTMLElement | null

Defined in: blockslides/packages/core/src/NodeView.ts:75

The DOM node that should hold the node's content. Only meaningful if the node view also defines a dom property and if its node type is not a leaf node type. When this is present, ProseMirror will take care of rendering the node's children into it. When it is not present, the node view itself is responsible for rendering (or deciding not to render) its child nodes.

Returns

HTMLElement | null

Implementation of

ProseMirrorNodeView.contentDOM

Methods

mount()

mount(): void

Defined in: blockslides/packages/core/src/NodeView.ts:66

Returns

void


onDragStart()

onDragStart(event): void

Defined in: blockslides/packages/core/src/NodeView.ts:79

Parameters

event

DragEvent

Returns

void


stopEvent()

stopEvent(event): boolean

Defined in: blockslides/packages/core/src/NodeView.ts:167

Can be used to prevent the editor view from trying to handle some or all DOM events that bubble up from the node view. Events for which this returns true are not handled by the editor.

Parameters

event

Event

Returns

boolean

Implementation of

ProseMirrorNodeView.stopEvent


ignoreMutation()

ignoreMutation(mutation): boolean

Defined in: blockslides/packages/core/src/NodeView.ts:283

Called when a DOM mutation or a selection change happens within the view.

Parameters

mutation

ViewMutationRecord

Returns

boolean

false if the editor should re-read the selection or re-parse the range around the mutation

Implementation of

ProseMirrorNodeView.ignoreMutation


updateAttributes()

updateAttributes(attributes): void

Defined in: blockslides/packages/core/src/NodeView.ts:338

Update the attributes of the prosemirror node.

Parameters

attributes

Record<string, any>

Returns

void


deleteNode()

deleteNode(): void

Defined in: blockslides/packages/core/src/NodeView.ts:358

Delete the node.

Returns

void