import type * as React from "react"; import type { ToolcraftPanelId, ToolcraftPanelState, } from "../../state/types"; import type { ToolcraftPanelSnapEdge } from "../../contracts/types"; export type { ToolcraftPanelState } from "../../state/types"; export type ToolcraftPanelType = ToolcraftPanelId; export type PanelSnapEdge = ToolcraftPanelSnapEdge; export type PanelSnapPlacement = { offset: PanelPoint; snapEdge?: PanelSnapEdge; }; export type PanelDragMode = "handle" | "panel"; export type PanelPoint = { x: number; y: number; }; export type PanelDimensions = { height: number; width: number; }; export type PanelViewport = PanelDimensions & { offsetLeft: number; offsetTop: number; }; export type PanelSnapConfig = { edges: readonly PanelSnapEdge[]; margin?: number; zone?: number; }; export type PanelPlacement = "floating" | "frame" | "surface"; export type PanelStateChange = (state: Partial) => void; export type PanelHostProps = { children: React.ReactNode; className?: string; dragMode?: PanelDragMode; innerClassName?: string; onPlacementChange?: (placement: PanelSnapPlacement) => void; onPositionChange?: (position: PanelPoint) => void; onResetPosition?: () => void; panelId?: string; panelType: ToolcraftPanelType; position?: PanelPoint; snap?: PanelSnapConfig; snapEdge?: PanelSnapEdge; style?: React.CSSProperties; }; export type PanelStageProps = React.HTMLAttributes & { children: React.ReactNode; }; export type PanelContainerProps = { children: React.ReactNode; className?: string; dragMode?: PanelDragMode; onPanelStateChange?: PanelStateChange; panelClassName?: string; panelState?: ToolcraftPanelState; panelType: ToolcraftPanelType; placement: PanelPlacement; } & Omit, "children" | "className">; export type ToolcraftPanelHostProps = Omit< PanelHostProps, "onPositionChange" | "onResetPosition" | "position" > & { onPositionChange?: (position: PanelPoint) => void; onResetPosition?: () => void; position?: PanelPoint; };