/* eslint-disable */ /* Shared wireframe primitives v2 — clean, client-readable. */ const { useState, useEffect, useMemo, useRef, useCallback } = React; /* --------- Placeholder (video / image) --------- */ function Placeholder({ x, y, w, h, label, desc, tag, style, bleed }) { return (
{tag ?
{tag}
: null} {!bleed &&
{label}
} {!bleed && desc ?
{desc}
: null}
); } /* --------- Wireframe Button --------- */ function WfBtn({ children, primary, ghost, icon, lg, x, y, w, h, onClick, style }) { const cls = ["wf-btn"]; if (primary) cls.push("primary"); if (ghost) cls.push("ghost"); if (icon) cls.push("icon"); if (lg) cls.push("lg"); const pos = x !== undefined ? { position: "absolute", left: x, top: y, width: w, height: h } : {}; return ( ); } /* --------- Generic Popup --------- */ function Popup({ x, y, w, h, eyebrow, title, children, onClose, style }) { return (
{eyebrow ?
{eyebrow}
: null} {title ?
{title}
: null} {children}
); } /* --------- Bottom navigation Next/Back — disabled per user request --------- */ function SceneNav() { return null; } /* --------- Draggable horizontal slider --------- */ function HSlider({ x, y, w, value, onChange, ticks }) { const trackRef = useRef(null); const draggingRef = useRef(false); const setFromEvent = (e) => { const track = trackRef.current; if (!track) return; const r = track.getBoundingClientRect(); const clientX = e.touches ? e.touches[0].clientX : e.clientX; const v = Math.max(0, Math.min(1, (clientX - r.left) / r.width)); onChange(v); }; const onPointerDown = (e) => { draggingRef.current = true; setFromEvent(e); e.preventDefault(); }; useEffect(() => { const move = (e) => { if (draggingRef.current) setFromEvent(e); }; const up = () => { draggingRef.current = false; }; window.addEventListener("mousemove", move); window.addEventListener("mouseup", up); window.addEventListener("touchmove", move, { passive: false }); window.addEventListener("touchend", up); return () => { window.removeEventListener("mousemove", move); window.removeEventListener("mouseup", up); window.removeEventListener("touchmove", move); window.removeEventListener("touchend", up); }; }); return (
{(ticks || []).map((t, i) => (
))}
); } /* --------- Draggable vertical slider --------- */ function VSlider({ x, y, h, value, onChange }) { const trackRef = useRef(null); const draggingRef = useRef(false); const setFromEvent = (e) => { const track = trackRef.current; if (!track) return; const r = track.getBoundingClientRect(); const clientY = e.touches ? e.touches[0].clientY : e.clientY; const v = Math.max(0, Math.min(1, (clientY - r.top) / r.height)); onChange(v); }; const onPointerDown = (e) => { draggingRef.current = true; setFromEvent(e); e.preventDefault(); }; useEffect(() => { const move = (e) => { if (draggingRef.current) setFromEvent(e); }; const up = () => { draggingRef.current = false; }; window.addEventListener("mousemove", move); window.addEventListener("mouseup", up); window.addEventListener("touchmove", move, { passive: false }); window.addEventListener("touchend", up); return () => { window.removeEventListener("mousemove", move); window.removeEventListener("mouseup", up); window.removeEventListener("touchmove", move); window.removeEventListener("touchend", up); }; }); return (
); } /* --------- Text placeholder bars --------- */ function TxtBars({ x, y, w, lines = 3, style }) { return (
{Array.from({ length: lines }).map((_, i) => (
))}
); } Object.assign(window, { Placeholder, WfBtn, Popup, SceneNav, HSlider, VSlider, TxtBars, });