import { P as PolySceneHandle, a as PolyMeshHandle, f as PolyPerspectiveCameraHandle, d as PolyOrthographicCameraHandle } from './types-CfRKEj2z.js'; import { Vec3, Polygon } from '@layoutit/polycss-core'; /** * Shared types, constants, and utilities for orbit/map controls factories. * Not part of the public API surface — use createPolyOrbitControls or * createPolyMapControls. */ interface PolyControlsAnimateOptions { /** * Rotation rate in degrees per 60 Hz-equivalent frame. The tick is * dt-clamped so 0.3 deg/frame ≈ 18 deg/sec on every refresh rate. * Default: 0.3. */ speed?: number; /** Rotation axis. Default: "y" (yaw, rotates around vertical world Z). */ axis?: "x" | "y"; /** Halt the loop while a pointer drag is in progress. Default: true. */ pauseOnInteraction?: boolean; } interface PolyControlsBaseOptions { /** Pointer-drag. Default: true. */ drag?: boolean; /** Wheel / pinch zoom. Default: true. */ wheel?: boolean; /** * When `true`, wheel events change `distance` (camera pull-back in CSS px) * instead of `zoom`. Mirrors Three.js OrbitControls dolly behaviour. * Default: false (zoom mode). */ dolly?: boolean; /** * Drag-direction inversion. `false` = natural, `true` = invert (×-1), * a number multiplies sensitivity (negative inverts). Default: false. */ invert?: boolean | number; /** Minimum CSS zoom. Default: 0.1. */ minZoom?: number; /** Maximum CSS zoom. Default: 10. */ maxZoom?: number; /** Minimum dolly distance in CSS pixels. Default: 0. Only used when `dolly: true`. */ minDistance?: number; /** Maximum dolly distance in CSS pixels. Default: Infinity. Only used when `dolly: true`. */ maxDistance?: number; /** Auto-rotate. Pass false (or omit) to disable. */ animate?: false | PolyControlsAnimateOptions; } interface PolyControlsCamera { rotX: number; rotY: number; zoom: number; target: Vec3; distance: number; } interface PolyControlsChangeEvent { type: "change"; camera: PolyControlsCamera; } interface PolyControlsInteractionEvent { type: "start" | "end"; camera: PolyControlsCamera; } type PolyControlsEvent = PolyControlsChangeEvent | PolyControlsInteractionEvent; type PolyControlsListener = (event: E) => void; interface PolyControlsHandle { update(partial: PolyControlsBaseOptions): void; resume(): void; pause(): void; destroy(): void; addEventListener(type: T, listener: PolyControlsListener>): void; removeEventListener(type: T, listener: PolyControlsListener>): void; hasEventListener(type: T, listener: PolyControlsListener>): boolean; } /** * createPolyOrbitControls — orbit-mode camera input for a PolyScene. * * Left-drag rotates rotX / rotY around the target (orbit). Wheel zooms or * dollies. Mirrors Three.js OrbitControls semantics. * * For map/pan semantics (left-drag pans, right-drag orbits) use * `createPolyMapControls` instead. */ type PolyOrbitControlsOptions = PolyControlsBaseOptions; type PolyOrbitControlsHandle = PolyControlsHandle; declare function createPolyOrbitControls(scene: PolySceneHandle, options?: PolyOrbitControlsOptions): PolyOrbitControlsHandle; declare const ELEMENT_BASE$b: typeof HTMLElement; declare class PolySceneElement extends ELEMENT_BASE$b { static get observedAttributes(): string[]; private _scene; private _implicitCamera; /** * Returns the underlying PolySceneHandle. Children call this during their own * connectedCallback to register meshes. */ getScene(): PolySceneHandle | null; private _findAncestorCamera; private _buildImplicitCamera; private _readNonCameraOptions; private _readDirectionalLight; private _readAmbientLight; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; } declare const ELEMENT_BASE$a: typeof HTMLElement; declare class PolyMeshElement extends ELEMENT_BASE$a { static get observedAttributes(): string[]; private _handle; private _parseResult; private _loadToken; /** Returns the current mesh handle, or null if not yet loaded. */ getMeshHandle(): PolyMeshHandle | null; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; private _tearDown; private _maybeLoad; } declare const ELEMENT_BASE$9: typeof HTMLElement; declare class PolyIframeElement extends ELEMENT_BASE$9 { static get observedAttributes(): string[]; private _wrapper; private _iframe; /** The iframe element this mounted, or null when detached. */ getIframeElement(): HTMLIFrameElement | null; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; private _mount; private _applyGeometry; private _teardown; } declare const ELEMENT_BASE$8: typeof HTMLElement; declare class PolyPolygonElement extends ELEMENT_BASE$8 { static get observedAttributes(): string[]; private _handle; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; private _tearDown; private _mount; } declare const ELEMENT_BASE$7: typeof HTMLElement; declare class PolyOrbitControlsElement extends ELEMENT_BASE$7 { static get observedAttributes(): string[]; private _controls; /** Returns the wrapped PolyOrbitControlsHandle once the element has * connected to its `` ancestor. Lets external callers attach * `change` listeners (or call `update()` / `pause()`) the same way they * would on a vanilla `createPolyOrbitControls(scene, ...)` handle. */ getControls(): PolyOrbitControlsHandle | null; private _readAnimate; private _readOptions; private _findScene; private _attach; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; } declare const ELEMENT_BASE$6: typeof HTMLElement; declare class PolyMapControlsElement extends ELEMENT_BASE$6 { static get observedAttributes(): string[]; private _controls; private _readAnimate; private _readOptions; private _findScene; private _attach; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; } declare const ELEMENT_BASE$5: typeof HTMLElement; declare class PolyFirstPersonControlsElement extends ELEMENT_BASE$5 { static get observedAttributes(): string[]; private _controls; private _readOptions; private _findScene; private _attach; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; } /** * — standalone perspective camera element. * * Wraps `createPolyPerspectiveCamera`. Unlike which owns the * scene DOM, this element provides a camera context that child controls can * read. It creates a `
` wrapper with the * CSS `perspective` property set. * * Attributes (all optional): * perspective — number, CSS perspective in pixels (default 32000) * zoom — number * rot-x — number, degrees (default 65) * rot-y — number, degrees (default 45) * target — "x,y,z" comma-separated world coordinates * distance — number, camera pull-back in CSS pixels */ declare const ELEMENT_BASE$4: typeof HTMLElement; declare class PolyPerspectiveCameraElement extends ELEMENT_BASE$4 { static get observedAttributes(): string[]; private _camera; private _wrapper; /** Returns the camera handle, or null if not yet connected. */ getCamera(): PolyPerspectiveCameraHandle | null; private _readOptions; private _mount; private _teardown; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; } /** * — standalone orthographic camera element. * * Wraps `createPolyOrthographicCamera`. Sets CSS `perspective: none` on the * camera wrapper, disabling perspective projection. * * Attributes (all optional): * zoom — number * rot-x — number, degrees (default 65) * rot-y — number, degrees (default 45) * target — "x,y,z" comma-separated world coordinates * distance — number, camera pull-back in CSS pixels */ declare const ELEMENT_BASE$3: typeof HTMLElement; declare class PolyOrthographicCameraElement extends ELEMENT_BASE$3 { static get observedAttributes(): string[]; private _camera; private _wrapper; /** Returns the camera handle, or null if not yet connected. */ getCamera(): PolyOrthographicCameraHandle | null; private _readOptions; private _mount; private _teardown; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; } /** * — ergonomic alias for . * * The default camera in PolyCSS is orthographic. `` maps to * `PolyOrthographicCameraElement` so the canonical tree shape works without * spelling out "orthographic" when it isn't relevant to the scene being built. * * Use when depth foreshortening is needed. */ declare class PolyCameraElement extends PolyOrthographicCameraElement { } declare const ELEMENT_BASE$2: typeof HTMLElement; declare class PolyTransformControlsElement extends ELEMENT_BASE$2 { static get observedAttributes(): string[]; private _tc; private _findScene; private _findTargetMesh; private _readOptions; private _attach; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; } declare const ELEMENT_BASE$1: typeof HTMLElement; declare class PolySelectElement extends ELEMENT_BASE$1 { static get observedAttributes(): string[]; private _selection; private _findScene; private _readOptions; private _attach; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void; } /** * Primitive shape custom elements — , , , * , , , , * , , . * * Each element reads shape-specific attributes, calls the matching polygon * generator from @layoutit/polycss-core, then registers the result with the * nearest ancestor using the same mechanism as . * * Attribute naming follows kebab-case conventions: `radial-segments`, * `tubular-segments`, `radius-top`, `half-thickness`, etc. */ declare const ELEMENT_BASE: typeof HTMLElement; /** * Base class for all primitive shape elements. Subclasses implement * `buildPolygons()` which returns a Polygon[] from this element's attributes. */ declare abstract class PolyShapeElement extends ELEMENT_BASE { private _handle; abstract buildPolygons(): Polygon[]; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; private _tearDown; private _mount; } declare class PolyBoxElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyPlaneElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyRingElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyOctahedronElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyTetrahedronElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyIcosahedronElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyDodecahedronElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolySphereElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyCylinderElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyConeElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } declare class PolyTorusElement extends PolyShapeElement { static get observedAttributes(): string[]; buildPolygons(): Polygon[]; } export { PolySceneElement as A, PolySelectElement as B, PolySphereElement as C, PolyTetrahedronElement as D, PolyTorusElement as E, PolyTransformControlsElement as F, createPolyOrbitControls as G, type PolyControlsHandle as P, type PolyControlsBaseOptions as a, type PolyControlsEvent as b, type PolyControlsListener as c, PolyBoxElement as d, PolyCameraElement as e, PolyConeElement as f, type PolyControlsAnimateOptions as g, type PolyControlsCamera as h, type PolyControlsChangeEvent as i, type PolyControlsInteractionEvent as j, PolyCylinderElement as k, PolyDodecahedronElement as l, PolyFirstPersonControlsElement as m, PolyIcosahedronElement as n, PolyIframeElement as o, PolyMapControlsElement as p, PolyMeshElement as q, PolyOctahedronElement as r, PolyOrbitControlsElement as s, type PolyOrbitControlsHandle as t, type PolyOrbitControlsOptions as u, PolyOrthographicCameraElement as v, PolyPerspectiveCameraElement as w, PolyPlaneElement as x, PolyPolygonElement as y, PolyRingElement as z };