import { Editor } from '@tiptap/react'; import { SelectedVideoData } from '../types'; /** * Reads the video node at the current selection/cursor position and extracts * the src, alignment, width, and height attributes. * * Returns null when: * - The cursor is not on a video node * - The video node is not the currently active/selected node * * IMPORTANT: Uses editor.isActive('video') to ensure the video node itself is selected, * not just present in the selection range. This prevents the bubble menu from showing * when the cursor is merely near a video—it only shows when the video is actively selected. * * @param editor - The live TipTap editor instance. * @returns An object with `src`, `alignment`, `width`, and `height`, or null if no video is selected. */ export default function getSelectedVideo(editor: Editor): SelectedVideoData | null;