Skip to content

Vizel API / core/src / createVizelMultiBlockSelectionExtension

Function: createVizelMultiBlockSelectionExtension()

ts
function createVizelMultiBlockSelectionExtension(_options?): Extension;

Defined in: packages/core/src/extensions/multi-block-selection.ts:230

Create the multi-block range selection extension. The extension is part of the always-on core and carries no opt-in feature flag.

Behavior:

  • Tracks Selection transitions and exposes the resulting block range via vizelMultiBlockSelectionPluginKey.getState(state).
  • Decorates each block in the range with data-vizel-block-selected="true" so framework styles can render a range highlight.
  • Hooks Tab / Shift+Tab / Backspace / Delete in addKeyboardShortcuts to apply the operation to every block in the range when a multi-block range is active. Single-block selections fall through to Tiptap's defaults.

Note on Tiptap conflicts: when a multi-block range is active, the shortcuts above intercept the keypress before the default Tab / Shift+Tab / Backspace / Delete handlers run. Single-block selections see the default behavior unchanged, so list indentation and inline deletion semantics are preserved exactly as Tiptap ships them.

Parameters

ParameterType
_optionsVizelMultiBlockSelectionOptions

Returns

Extension

Released under the MIT License.