prosekit/web/block-handle
Anatomy
Section titled “Anatomy”Classes
Section titled “Classes”BlockHandleAddElement
Section titled “BlockHandleAddElement”<prosekit-block-handle-add> custom element.
Properties: BlockHandleAddProps
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”Methods
Section titled “Methods”-
addController(controller:ReactiveController):void
-
removeController(controller:ReactiveController):void
-
connectedCallback():void
-
disconnectedCallback():void
BlockHandleDraggableElement
Section titled “BlockHandleDraggableElement”<prosekit-block-handle-draggable> custom element.
Properties: BlockHandleDraggableProps
Data attributes:
| Attribute | Description |
|---|---|
data-dragging | Present when the element is being dragged |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”Methods
Section titled “Methods”-
addController(controller:ReactiveController):void
-
removeController(controller:ReactiveController):void
-
connectedCallback():void
-
disconnectedCallback():void
BlockHandlePopupElement
Section titled “BlockHandlePopupElement”<prosekit-block-handle-popup> custom element.
Properties: BlockHandlePopupProps
Data attributes:
| Attribute | Description |
|---|---|
data-state | "open" when the block handle is visible, "closed" otherwise |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”Methods
Section titled “Methods”-
addController(controller:ReactiveController):void
-
removeController(controller:ReactiveController):void
-
connectedCallback():void
-
disconnectedCallback():void
BlockHandlePositionerElement
Section titled “BlockHandlePositionerElement”<prosekit-block-handle-positioner> custom element.
Properties: BlockHandlePositionerProps
Data attributes:
| Attribute | Description |
|---|---|
data-state | "open" when the block handle is visible, "closed" otherwise |
data-side | The side of the anchor element the positioner is on |
data-align | The alignment of the positioner relative to the anchor element |
CSS variables:
| Variable | Description |
|---|---|
--transform-origin | The coordinates that this element is anchored to. Useful for scale animations. |
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”Properties
Section titled “Properties”-
strategy:"fixed"|"absolute" -
The strategy to use for positioning
Default
Section titled “Default”"absolute"
-
autoUpdate:boolean|AutoUpdateOptions -
Options to activate auto-update listeners
https://floating-ui.com/docs/autoUpdate
Default
Section titled “Default”true
-
offset:OffsetOptions -
The distance between the reference and floating element.
Default
Section titled “Default”6
-
overlap:boolean -
Whether the floating element can overlap the reference element to keep it in view.
Default
Section titled “Default”false
-
fitViewport:boolean -
Whether to constrain the floating element's width and height to not exceed the viewport.
Default
Section titled “Default”false
-
sameWidth:boolean -
Whether to constrain the floating element's width so that it matches the reference element.
Default
Section titled “Default”false
-
sameHeight:boolean -
Whether to constrain the floating element's height so that it matches the reference element.
Default
Section titled “Default”false
-
inline:boolean -
Whether to improve positioning for inline reference elements that span over multiple lines.
Default
Section titled “Default”false
-
boundary:Boundary -
Describes the clipping element(s) or area that overflow will be checked relative to. Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
Default
Section titled “Default”'clippingAncestors'
-
rootBoundary:RootBoundary -
Describes the root boundary that the element will be checked for overflow relative to. Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
Default
Section titled “Default”'viewport'
-
overflowPadding:number -
Describes the virtual padding around the boundary to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
Default
Section titled “Default”4
-
elementContext:ElementContext -
The element that will be used to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#elementcontext for more information.
Default
Section titled “Default”'floating'
-
altBoundary:boolean -
Whether to check the alternate elementContext's boundary. Please see https://floating-ui.com/docs/detectoverflow#altboundary for more information.
Default
Section titled “Default”false
-
placement:Placement -
The placement of the popover, relative to the hovered block.
Default
Section titled “Default”"left"
-
hoist:boolean -
Whether to use the browser Popover API to place the floating element on top of other page content.
Default
Section titled “Default”false
Methods
Section titled “Methods”-
addController(controller:ReactiveController):void
-
removeController(controller:ReactiveController):void
-
connectedCallback():void
-
disconnectedCallback():void
BlockHandleStateChangeEvent
Section titled “BlockHandleStateChangeEvent”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”-
new BlockHandleStateChangeEvent(state: {node:ProseMirrorNode;pos:number; } |null):BlockHandleStateChangeEvent
Properties
Section titled “Properties”-
detail: {node:ProseMirrorNode;pos:number; } |null -
The currently hovered block's node and position, or
nullif no block is hovered.
BlockHandleRootElement
Section titled “BlockHandleRootElement”<prosekit-block-handle-root> custom element.
Properties: BlockHandleRootProps
Events: BlockHandleRootEvents
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”Methods
Section titled “Methods”-
addController(controller:ReactiveController):void
-
removeController(controller:ReactiveController):void
-
connectedCallback():void
-
disconnectedCallback():void
Interfaces
Section titled “Interfaces”BlockHandleAddProps
Section titled “BlockHandleAddProps”BlockHandleDraggableProps
Section titled “BlockHandleDraggableProps”BlockHandlePopupProps
Section titled “BlockHandlePopupProps”BlockHandlePositionerProps
Section titled “BlockHandlePositionerProps”Properties
Section titled “Properties”-
strategy:"fixed"|"absolute" -
The strategy to use for positioning
Default
Section titled “Default”"absolute"
-
autoUpdate:boolean|AutoUpdateOptions -
Options to activate auto-update listeners
https://floating-ui.com/docs/autoUpdate
Default
Section titled “Default”true
-
offset:OffsetOptions -
The distance between the reference and floating element.
Default
Section titled “Default”6
-
overlap:boolean -
Whether the floating element can overlap the reference element to keep it in view.
Default
Section titled “Default”false
-
fitViewport:boolean -
Whether to constrain the floating element's width and height to not exceed the viewport.
Default
Section titled “Default”false
-
sameWidth:boolean -
Whether to constrain the floating element's width so that it matches the reference element.
Default
Section titled “Default”false
-
sameHeight:boolean -
Whether to constrain the floating element's height so that it matches the reference element.
Default
Section titled “Default”false
-
inline:boolean -
Whether to improve positioning for inline reference elements that span over multiple lines.
Default
Section titled “Default”false
-
boundary:Boundary -
Describes the clipping element(s) or area that overflow will be checked relative to. Please see https://floating-ui.com/docs/detectoverflow#boundary for more information.
Default
Section titled “Default”'clippingAncestors'
-
rootBoundary:RootBoundary -
Describes the root boundary that the element will be checked for overflow relative to. Please see https://floating-ui.com/docs/detectoverflow#rootboundary for more information.
Default
Section titled “Default”'viewport'
-
overflowPadding:number -
Describes the virtual padding around the boundary to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#padding for more information.
Default
Section titled “Default”4
-
elementContext:ElementContext -
The element that will be used to check for overflow. Please see https://floating-ui.com/docs/detectoverflow#elementcontext for more information.
Default
Section titled “Default”'floating'
-
altBoundary:boolean -
Whether to check the alternate elementContext's boundary. Please see https://floating-ui.com/docs/detectoverflow#altboundary for more information.
Default
Section titled “Default”false
-
placement:Placement -
The placement of the popover, relative to the hovered block.
Default
Section titled “Default”"left"
-
hoist:boolean -
Whether to use the browser Popover API to place the floating element on top of other page content.
Default
Section titled “Default”false
BlockHandleRootProps
Section titled “BlockHandleRootProps”BlockHandleRootEvents
Section titled “BlockHandleRootEvents”Properties
Section titled “Properties”-
Fired when the hovered block changes.