@sqlrooms/documents / useSelectedBlockOrPanel
Function: useSelectedBlockOrPanel()
useSelectedBlockOrPanel(
editor):SelectedItem
Hook that returns the currently selected block or panel.
Priority order:
- Panel selection from blockSelection store (custom selection)
- Block selection from TipTap editor state (node selection)
- null if neither is selected
Parameters
| Parameter | Type | Description |
|---|---|---|
editor | Editor | null | TipTap editor instance |
Returns
Selected block/panel info or null