import { Editor } from '@tiptap/react'; /** * Reads every piece of toolbar-relevant state from the editor in one pass. * Called by onUpdate, onSelectionUpdate and onFocus so the derivation * logic lives in exactly one place. * * @param editor - The live TipTap editor instance. * @returns A flat object with every derived toolbar value. */ export default function getToolbarSnapshot(editor: Editor): { activeActions: string[]; selectedStyle: string; selectedFontSize: number | undefined; selectedTextColor: string | undefined; selectedBgColor: string | undefined; selectedAlignment: string; selectedLink: import('../types').ActiveLinkData | null; selectedText: string; selectedImage: import('../types').SelectedImageData | null; selectedTable: import('../types').SelectedTableData | null; selectedVideo: import('../types').SelectedVideoData | null; };