/** * PuckSelectionTracker * * A component that watches Puck's selection state and reports changes. * Must be rendered inside the Puck component tree to access the usePuck hook. * * This component enables proactive focus region reporting by converting * Puck's internal selection format to JSON paths that the backend understands. */ export interface PuckSelectionTrackerProps { /** * Callback when selection changes. * @param path - JSON path of the selected item (e.g., "/content/0"), or null if deselected * @param itemId - The component's ID, or null if deselected */ onSelectionChange: (path: string | null, itemId: string | null) => void; } /** * Watches Puck's selection state and calls onSelectionChange when it changes. * * This component renders nothing but uses Puck's internal state to track * which component the user has selected. The path is formatted to match * the JSON path format used by the backend for region conflict detection. * * @example * ```tsx * function PuckWithTracking() { * const { setFocusRegions, clearFocus } = useFocusRegionReporting(); * * const handleSelectionChange = (path, itemId) => { * if (path) { * setFocusRegions([path]); * } else { * clearFocus(); * } * }; * * return ( * * * * ); * } * ``` */ export declare function PuckSelectionTracker({ onSelectionChange, }: PuckSelectionTrackerProps): null;