import type { DomEditViewport } from "../components/editor/domEditing"; import { getDomLayerPatchTarget, isElementComputedVisible, resolveAllVisualDomEditTargets, } from "../components/editor/domEditingElement"; import { isHtmlElement } from "../components/editor/domEditingDom"; import { getEventTargetElement } from "./studioHelpers"; interface PreviewLocalPointer { x: number; y: number; viewport: DomEditViewport; } // An element is "full-bleed" when its box spans nearly the whole composition on // BOTH axes. Such elements (scene wrappers, backdrops) are excluded from canvas // click-picking so a click lands on inner content — or deselects on empty area — // instead of grabbing the giant container. The Layers panel still selects them. // ponytail: pure size heuristic; tighten the ratio if decorative full-bleed art // should remain canvas-selectable. const FULL_BLEED_RATIO = 0.95; // Media leaves (a hero/background video, a full-bleed image, an / // backdrop) ARE the content a user clicks — they must stay canvas-selectable even // at full-bleed. Only empty containers (scene wrappers, layout backdrops) get // excluded. Without this, a full-bleed