@chuzi/shared 1.3.41 → 1.3.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +3 -1
- package/dist/api/index.js +3 -1
- package/dist/api/index.js.map +1 -1
- package/dist/config/index.d.ts +15 -1
- package/dist/config/index.js +252 -13
- package/dist/config/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +255 -14
- package/dist/index.js.map +1 -1
- package/dist/realms/cosmos/components/index.d.ts +2 -0
- package/dist/realms/cosmos/components/index.js +12 -8
- package/dist/realms/cosmos/components/index.js.map +1 -1
- package/dist/realms/cosmos/index.js +1 -1
- package/dist/realms/cosmos/index.js.map +1 -1
- package/dist/types/index.d.ts +38 -1
- package/dist/types/index.js.map +1 -1
- package/dist/ui/index.js +171 -12
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ interface ConstellationStoryOverlay {
|
|
|
46
46
|
chosenByPrefix: string;
|
|
47
47
|
directorName?: string | null;
|
|
48
48
|
directorAvatarUrl?: string | null;
|
|
49
|
+
/** Procedural avatar when no uploaded photo (e.g. constellation seal). */
|
|
50
|
+
directorAvatarFallback?: ReactNode;
|
|
49
51
|
contentRating?: string | null;
|
|
50
52
|
genre?: string | null;
|
|
51
53
|
/** Shown between rating and genre. */
|
|
@@ -80,7 +80,7 @@ var DEFAULT_CONSTELLATION_APPEARANCE = {
|
|
|
80
80
|
titleOpacity: 0.82,
|
|
81
81
|
titleColor: "#c8dce8",
|
|
82
82
|
titleLetterSpacing: 6,
|
|
83
|
-
titleYOffset:
|
|
83
|
+
titleYOffset: 16,
|
|
84
84
|
titleDistanceFactor: 12,
|
|
85
85
|
htmlZIndexRange: [8, 0],
|
|
86
86
|
previewWidth: 148,
|
|
@@ -178,8 +178,8 @@ function computeConstellationBounds(positions) {
|
|
|
178
178
|
}
|
|
179
179
|
return {
|
|
180
180
|
center: [(minX + maxX) / 2, sumY / positions.length, (minZ + maxZ) / 2],
|
|
181
|
-
spanX: Math.max(
|
|
182
|
-
spanZ: Math.max(
|
|
181
|
+
spanX: Math.max(10, maxX - minX + 6),
|
|
182
|
+
spanZ: Math.max(8, maxZ - minZ + 5)
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
185
|
var WORLD_TO_SVG = 58;
|
|
@@ -300,7 +300,8 @@ function ConstellationTitle({
|
|
|
300
300
|
display: "flex",
|
|
301
301
|
flexDirection: "column",
|
|
302
302
|
alignItems: "center",
|
|
303
|
-
gap:
|
|
303
|
+
gap: 8,
|
|
304
|
+
marginTop: 4
|
|
304
305
|
},
|
|
305
306
|
children: [
|
|
306
307
|
titleControl,
|
|
@@ -311,8 +312,9 @@ function ConstellationTitle({
|
|
|
311
312
|
display: "flex",
|
|
312
313
|
flexDirection: "column",
|
|
313
314
|
alignItems: "center",
|
|
314
|
-
gap:
|
|
315
|
+
gap: 6,
|
|
315
316
|
maxWidth: svgWidth,
|
|
317
|
+
marginTop: 6,
|
|
316
318
|
pointerEvents: "none"
|
|
317
319
|
},
|
|
318
320
|
children: [
|
|
@@ -321,7 +323,8 @@ function ConstellationTitle({
|
|
|
321
323
|
{
|
|
322
324
|
prefix: storyOverlay.chosenByPrefix,
|
|
323
325
|
name: storyOverlay.directorName,
|
|
324
|
-
avatarUrl: storyOverlay.directorAvatarUrl ?? null
|
|
326
|
+
avatarUrl: storyOverlay.directorAvatarUrl ?? null,
|
|
327
|
+
avatarFallback: storyOverlay.directorAvatarFallback
|
|
325
328
|
}
|
|
326
329
|
) : null,
|
|
327
330
|
hasRatingGenre ? /* @__PURE__ */ jsx(
|
|
@@ -346,7 +349,8 @@ function ConstellationTitle({
|
|
|
346
349
|
function DirectorCredit({
|
|
347
350
|
prefix,
|
|
348
351
|
name,
|
|
349
|
-
avatarUrl
|
|
352
|
+
avatarUrl,
|
|
353
|
+
avatarFallback
|
|
350
354
|
}) {
|
|
351
355
|
const initial = name.trim().charAt(0).toUpperCase() || "?";
|
|
352
356
|
return /* @__PURE__ */ jsxs(
|
|
@@ -389,7 +393,7 @@ function DirectorCredit({
|
|
|
389
393
|
alt: "",
|
|
390
394
|
style: { width: "100%", height: "100%", objectFit: "cover" }
|
|
391
395
|
}
|
|
392
|
-
) : initial
|
|
396
|
+
) : avatarFallback ? avatarFallback : initial
|
|
393
397
|
}
|
|
394
398
|
),
|
|
395
399
|
/* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: name })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/themes/index.ts","../../../../src/realms/cosmos/components/World.tsx","../../../../src/realms/cosmos/components/Star.tsx","../../../../src/realms/cosmos/appearance.ts","../../../../src/realms/cosmos/components/ConstellationEdge.tsx","../../../../src/realms/cosmos/components/ConstellationTitle.tsx","../../../../src/realms/cosmos/components/StarBillboard.tsx","../../../../src/realms/cosmos/components/Constellation.tsx","../../../../src/realms/cosmos/index.ts","../../../../src/realms/cosmos/components/layout.ts","../../../../src/realms/cosmos/components/CosmosSandbox.tsx"],"names":["DreiStars","jsxs","jsx","Html","useMemo"],"mappings":";;;;;;;;;AAgBO,IAAM,YAAA,GAAkD;AAAA,EAC7D,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,SAOV,CAUF,CAAA;ACjBO,SAAS,KAAA,CAAM,EAAE,QAAA,EAAU,GAAA,GAAM,CAAC,CAAA,EAAG,CAAC,GAAE,EAAe;AAC5D,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,EAAE,QAAA,EAAU,CAAC,CAAA,EAAG,CAAA,EAAG,EAAE,CAAA,EAAG,GAAA,EAAK,EAAA,EAAI,IAAA,EAAM,GAAA,EAAK,KAAK,GAAA,EAAI;AAAA,MAC7D,GAAA;AAAA,MACA,EAAA,EAAI,EAAE,SAAA,EAAW,IAAA,EAAK;AAAA,MAEtB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,OA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CAAI,CAAC,EAAE,IAAA,EAAM,MAAA,EAAO,qBAC1BA,GAAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MAEC,MAAA;AAAA,MACA,QAAA,EAAU,YAAA,GAAe,MAAM,YAAA,CAAa,IAAI,CAAA,GAAI;AAAA,KAAA;AAAA,IAF/C,IAAA,CAAK;AAAA,GAIb,CAAA,EACH,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { RealmId } from \"../types/index.js\";\n\n/**\n * CSS custom property tokens, mirroring public/css/chuzi-realms.css.\n * Use these for any non-DOM rendering (e.g. React Native, canvas).\n */\nexport interface RealmThemeTokens {\n bgDeep: string;\n bgMid: string;\n accent: string;\n accentSoft: string;\n text: string;\n muted: string;\n effectLine: string;\n}\n\nexport const THEME_TOKENS: Record<RealmId, RealmThemeTokens> = {\n cosmos: {\n bgDeep: \"#04070d\",\n bgMid: \"#0a1020\",\n accent: \"#7eb8ff\",\n accentSoft: \"rgba(126, 184, 255, 0.35)\",\n text: \"#e8f0ff\",\n muted: \"rgba(232, 240, 255, 0.65)\",\n effectLine: \"#ffb347\",\n },\n wilds: {\n bgDeep: \"#0d120c\",\n bgMid: \"#152018\",\n accent: \"#7bc96f\",\n accentSoft: \"rgba(123, 201, 111, 0.35)\",\n text: \"#eef6ea\",\n muted: \"rgba(238, 246, 234, 0.7)\",\n effectLine: \"#b78aff\",\n },\n};\n\n/**\n * Scene tree visualization theme, mirroring the THEMES object in\n * resources/js/scene-tree-viewer.js.\n */\nexport interface SceneTreeTheme {\n bg: string;\n edgeChoice: string;\n edgeGoto: string;\n nodeDefault: string;\n nodeActive: string;\n borderDefault: string;\n borderActive: string;\n labelDefault: string;\n labelActive: string;\n nodeLockedFill: string;\n nodeLockedBorder: string;\n labelLocked: string;\n nodeShape: \"star\" | \"rect\";\n rectRx: number;\n}\n\nexport const SCENE_TREE_THEMES: Record<RealmId, SceneTreeTheme> = {\n cosmos: {\n bg: \"#020408\",\n edgeChoice: \"#e8f0ff\",\n edgeGoto: \"#4a9fff\",\n nodeDefault: \"#ffffff\",\n nodeActive: \"#ffd47e\",\n borderDefault: \"#3a5080\",\n borderActive: \"#fff6d0\",\n labelDefault: \"rgba(220, 232, 255, 0.92)\",\n labelActive: \"rgba(255, 246, 220, 0.98)\",\n nodeLockedFill: \"#151a28\",\n nodeLockedBorder: \"#2a3348\",\n labelLocked: \"rgba(200, 210, 230, 0.35)\",\n nodeShape: \"star\",\n rectRx: 2,\n },\n wilds: {\n bg: \"#04070d\",\n edgeChoice: \"#ffffff\",\n edgeGoto: \"#6ecf7a\",\n nodeDefault: \"#e8f5e4\",\n nodeActive: \"#d31e2f\",\n borderDefault: \"#2d4a32\",\n borderActive: \"#ff9ea8\",\n labelDefault: \"rgba(232, 245, 228, 0.92)\",\n labelActive: \"rgba(255, 214, 219, 0.98)\",\n nodeLockedFill: \"#1a221c\",\n nodeLockedBorder: \"#2a3d30\",\n labelLocked: \"rgba(200, 220, 200, 0.38)\",\n nodeShape: \"rect\",\n rectRx: 3,\n },\n};\n\n/**\n * Get theme tokens for a realm, defaulting to wilds.\n */\nexport function getThemeTokens(realmId: RealmId | null | undefined): RealmThemeTokens {\n return THEME_TOKENS[realmId ?? \"wilds\"] ?? THEME_TOKENS.wilds;\n}\n\n/**\n * Get scene tree theme for a realm, defaulting to wilds.\n */\nexport function getSceneTreeTheme(realmId: RealmId | null | undefined): SceneTreeTheme {\n return SCENE_TREE_THEMES[realmId ?? \"wilds\"] ?? SCENE_TREE_THEMES.wilds;\n}\n","import { Canvas } from \"@react-three/fiber\";\nimport { OrbitControls, Stars as DreiStars } from \"@react-three/drei\";\nimport type { ReactNode } from \"react\";\nimport { THEME_TOKENS } from \"../../../themes/index.js\";\n\nexport interface WorldProps {\n children: ReactNode;\n /** Pixel device ratio cap. Default 2 — keeps perf bounded on retina laptops. */\n dpr?: number | [number, number];\n}\n\n/**\n * Cosmos environment shell. Wraps an r3f Canvas with deep-space background,\n * ambient starfield (drei <Stars> for the *backdrop* — distinct from our\n * film-stars), and a placeholder OrbitControls camera. The real NavRig\n * (consuming an IntentSource and doing focus-snap on dpad) replaces\n * OrbitControls in a follow-up package.\n */\nexport function World({ children, dpr = [1, 2] }: WorldProps) {\n return (\n <Canvas\n camera={{ position: [0, 6, 32], fov: 60, near: 0.1, far: 500 }}\n dpr={dpr}\n gl={{ antialias: true }}\n >\n <color attach=\"background\" args={[THEME_TOKENS.cosmos.bgDeep]} />\n <ambientLight intensity={0.15} />\n <DreiStars\n radius={120}\n depth={60}\n count={3000}\n factor={4}\n fade\n saturation={0.4}\n />\n <OrbitControls enablePan={false} maxDistance={80} minDistance={4} />\n {children}\n </Canvas>\n );\n}\n","import { useRef } from \"react\";\nimport { useFrame } from \"@react-three/fiber\";\nimport type { Mesh } from \"three\";\nimport type { AtomVisualProps } from \"../../index.js\";\n\nexport interface StarProps {\n visual: AtomVisualProps;\n onSelect?: () => void;\n /** Reduce brightness and saturation to indicate an unwatched scene. */\n dimmed?: boolean;\n /** Non-navigable — suppresses click and lowers brightness further. */\n locked?: boolean;\n}\n\n/**\n * One film as a star. Color is HSL-derived from the realm mapping's hue +\n * intensity. Each star pulses on its own phase so a thousand of them don't\n * breathe in lockstep — gives the field life without per-star animation\n * state.\n */\nexport function Star({ visual, onSelect, dimmed, locked }: StarProps) {\n const ref = useRef<Mesh>(null);\n\n useFrame(({ clock }) => {\n if (!ref.current) return;\n const phase = visual.position[0] * 0.7 + visual.position[2] * 0.3;\n const pulse = 1 + Math.sin(clock.elapsedTime * 0.8 + phase) * 0.05;\n ref.current.scale.setScalar(visual.scale * pulse);\n });\n\n const saturation = dimmed || locked ? 25 : 75;\n const lightness = dimmed || locked\n ? 25 + visual.intensity * 10\n : 50 + visual.intensity * 25;\n const color = `hsl(${visual.hue}, ${saturation}%, ${lightness}%)`;\n\n const handleClick = locked\n ? undefined\n : onSelect\n ? (e: any) => {\n e.stopPropagation();\n onSelect();\n }\n : undefined;\n\n return (\n <mesh\n ref={ref}\n position={visual.position}\n onClick={handleClick}\n >\n <sphereGeometry args={[0.5, 16, 16]} />\n <meshBasicMaterial\n color={color}\n toneMapped={false}\n transparent={!!(dimmed || locked)}\n opacity={dimmed ? 0.35 : locked ? 0.25 : 1}\n />\n </mesh>\n );\n}\n","/**\n * Constellation presentation tokens — consumed by the cosmos realm camera,\n * star billboards, and ghost title typography. Admins can override via\n * saved experience / appearance templates.\n */\nexport interface ConstellationAppearance {\n /** Rainbow arc title above the constellation (SVG px). */\n titleFontSize: number;\n titleOpacity: number;\n titleColor: string;\n titleLetterSpacing: number;\n /** World-space lift above constellation center. */\n titleYOffset: number;\n /** Html distance factor for the arc title billboard. */\n titleDistanceFactor: number;\n /** DOM z-index ceiling for constellation Html overlays (keep below editor). */\n htmlZIndexRange: [number, number];\n\n /** Per-star preview card + label. */\n previewWidth: number;\n previewHeight: number;\n previewOffsetY: number;\n labelFontSize: number;\n labelLetterSpacing: number;\n labelGap: number;\n /** Reserved space below preview for the 2×2 HUD control grid (px). */\n controlsGridHeight: number;\n billboardDistanceFactor: number;\n\n /** Camera — floating-in-space slide between stars. */\n cameraDefaultOffset: [number, number, number];\n cameraTargetOffset: [number, number, number];\n /** 0–1 lerp factor per frame while gliding (lower = smoother / pressurized). */\n cameraSlideLerp: number;\n cameraArrivalThreshold: number;\n}\n\nexport const DEFAULT_CONSTELLATION_APPEARANCE: ConstellationAppearance = {\n titleFontSize: 34,\n titleOpacity: 0.82,\n titleColor: \"#c8dce8\",\n titleLetterSpacing: 6,\n titleYOffset: 8,\n titleDistanceFactor: 12,\n htmlZIndexRange: [8, 0],\n\n previewWidth: 148,\n previewHeight: 96,\n previewOffsetY: 2.4,\n labelFontSize: 13,\n labelLetterSpacing: 1.2,\n labelGap: 10,\n controlsGridHeight: 92,\n billboardDistanceFactor: 10,\n\n cameraDefaultOffset: [0, 4, 12],\n cameraTargetOffset: [0, 0, 0],\n cameraSlideLerp: 0.035,\n cameraArrivalThreshold: 0.08,\n};\n\nexport function mergeConstellationAppearance(\n overrides?: Partial<ConstellationAppearance>,\n): ConstellationAppearance {\n return { ...DEFAULT_CONSTELLATION_APPEARANCE, ...overrides };\n}\n","import { useMemo } from \"react\";\nimport { Line } from \"@react-three/drei\";\nimport * as THREE from \"three\";\n\nexport type ConstellationEdgeVariant = \"solid\" | \"dotted\";\n\nexport interface ConstellationEdgeProps {\n from: [number, number, number];\n to: [number, number, number];\n hueA: number;\n hueB: number;\n /** Inward gap so the line doesn't touch the star spheres. */\n gap?: number;\n intensityA?: number;\n intensityB?: number;\n /** Reduce opacity to indicate an unwatched connection. */\n dimmed?: boolean;\n /** @deprecated All edges render as soft solid glow; variant is ignored. */\n variant?: ConstellationEdgeVariant;\n}\n\n/**\n * A luminous line connecting two stars in a constellation. Endpoints are\n * pulled inward so the line floats between the stars rather than touching\n * them. Color interpolates from hueA to hueB via vertex colors.\n */\nexport function ConstellationEdge({\n from,\n to,\n hueA,\n hueB,\n gap = 0.55,\n intensityA = 0.5,\n intensityB = 0.5,\n dimmed,\n}: ConstellationEdgeProps) {\n const { points, colorA, colorB, glowA, glowB } = useMemo(() => {\n const a = new THREE.Vector3(...from);\n const b = new THREE.Vector3(...to);\n const dir = b.clone().sub(a);\n const len = dir.length();\n\n if (len < gap * 2.5) {\n return { points: null, colorA: null, colorB: null, glowA: null, glowB: null };\n }\n\n dir.normalize();\n const start = a.clone().add(dir.clone().multiplyScalar(gap));\n const end = b.clone().sub(dir.clone().multiplyScalar(gap));\n\n const lA = 55 + intensityA * 20;\n const lB = 55 + intensityB * 20;\n\n const cA = new THREE.Color(`hsl(${hueA}, 70%, ${lA}%)`);\n const cB = new THREE.Color(`hsl(${hueB}, 70%, ${lB}%)`);\n\n const gA = new THREE.Color(`hsl(${hueA}, 50%, ${lA + 10}%)`);\n const gB = new THREE.Color(`hsl(${hueB}, 50%, ${lB + 10}%)`);\n\n return {\n points: [start, end] as [THREE.Vector3, THREE.Vector3],\n colorA: cA,\n colorB: cB,\n glowA: gA,\n glowB: gB,\n };\n }, [from, to, hueA, hueB, gap, intensityA, intensityB]);\n\n if (!points || !colorA || !colorB || !glowA || !glowB) return null;\n\n const glowOpacity = dimmed ? 0.04 : 0.12;\n const coreOpacity = dimmed ? 0.15 : 0.6;\n\n return (\n <group>\n <Line\n points={points}\n vertexColors={[glowA, glowB]}\n lineWidth={4}\n transparent\n opacity={glowOpacity}\n toneMapped={false}\n />\n <Line\n points={points}\n vertexColors={[colorA, colorB]}\n lineWidth={1.5}\n transparent\n opacity={coreOpacity}\n toneMapped={false}\n />\n </group>\n );\n}\n","import { useId, type ReactNode } from \"react\";\nimport { Billboard, Html } from \"@react-three/drei\";\nimport type { ConstellationAppearance } from \"../appearance.js\";\n\nexport interface ConstellationBounds {\n center: [number, number, number];\n spanX: number;\n spanZ: number;\n}\n\nexport function computeConstellationBounds(\n positions: [number, number, number][],\n): ConstellationBounds | null {\n if (positions.length === 0) return null;\n\n let minX = Infinity;\n let maxX = -Infinity;\n let minZ = Infinity;\n let maxZ = -Infinity;\n let sumY = 0;\n\n for (const [x, y, z] of positions) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minZ = Math.min(minZ, z);\n maxZ = Math.max(maxZ, z);\n sumY += y;\n }\n\n return {\n center: [(minX + maxX) / 2, sumY / positions.length, (minZ + maxZ) / 2],\n spanX: Math.max(6, maxX - minX + 4),\n spanZ: Math.max(4, maxZ - minZ + 3),\n };\n}\n\nexport interface ConstellationStoryOverlay {\n /** Localized prefix, e.g. \"Chosen by\". */\n chosenByPrefix: string;\n directorName?: string | null;\n directorAvatarUrl?: string | null;\n contentRating?: string | null;\n genre?: string | null;\n /** Shown between rating and genre. */\n ratingGenreSeparator?: string;\n /** When true the arched title is clickable. */\n editable?: boolean;\n onEditClick?: () => void;\n /** Accessible label for the editable title control. */\n editAriaLabel?: string;\n}\n\nexport interface ConstellationTitleProps {\n title: string;\n bounds: ConstellationBounds;\n appearance: ConstellationAppearance;\n /** World position of the title (first) scene — arc starts here. */\n arcFrom?: [number, number, number];\n /** World position of the end scene — arc ends here. */\n arcTo?: [number, number, number];\n storyOverlay?: ConstellationStoryOverlay;\n}\n\nconst WORLD_TO_SVG = 58;\n\n/**\n * Vintage cartography-style ocean label arcing from title scene to end scene.\n */\nexport function ConstellationTitle({\n title,\n bounds,\n appearance,\n arcFrom,\n arcTo,\n storyOverlay,\n}: ConstellationTitleProps) {\n const gradientId = useId().replace(/:/g, \"\");\n const pathId = `arc-${gradientId}`;\n\n if (!title.trim()) return null;\n\n const span = Math.max(bounds.spanX, bounds.spanZ);\n const svgWidth = Math.max(420, Math.round(span * WORLD_TO_SVG + 80));\n const svgHeight = 110;\n\n const centerX = svgWidth / 2;\n const arcY = svgHeight * 0.88;\n const arcPeak = svgHeight * 0.06;\n\n let arcStartX = svgWidth * 0.04;\n let arcEndX = svgWidth * 0.96;\n\n if (arcFrom && arcTo) {\n const [fromX] = arcFrom;\n const [toX] = arcTo;\n arcStartX = centerX + (fromX - bounds.center[0]) * WORLD_TO_SVG;\n arcEndX = centerX + (toX - bounds.center[0]) * WORLD_TO_SVG;\n arcStartX = Math.max(12, Math.min(arcStartX, svgWidth - 12));\n arcEndX = Math.max(12, Math.min(arcEndX, svgWidth - 12));\n if (arcStartX > arcEndX) {\n const swap = arcStartX;\n arcStartX = arcEndX;\n arcEndX = swap;\n }\n }\n\n const arcMidX = (arcStartX + arcEndX) / 2;\n const arcPath = `M ${arcStartX} ${arcY} Q ${arcMidX} ${arcPeak} ${arcEndX} ${arcY}`;\n\n const editable = !!(storyOverlay?.editable && storyOverlay.onEditClick);\n const hasDirector = !!(\n storyOverlay?.directorName && storyOverlay.directorName.trim()\n );\n const hasRatingGenre = !!(\n storyOverlay?.contentRating || storyOverlay?.genre\n );\n const showOverlay = hasDirector || hasRatingGenre;\n\n const titleControl = (\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n style={{\n overflow: \"visible\",\n display: \"block\",\n cursor: editable ? \"pointer\" : undefined,\n }}\n aria-hidden={editable ? undefined : true}\n role={editable ? \"button\" : undefined}\n tabIndex={editable ? 0 : undefined}\n aria-label={editable ? storyOverlay?.editAriaLabel : undefined}\n onClick={editable ? storyOverlay?.onEditClick : undefined}\n onKeyDown={\n editable\n ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n storyOverlay?.onEditClick?.();\n }\n }\n : undefined\n }\n >\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor=\"#8ab4c8\" />\n <stop offset=\"35%\" stopColor=\"#c8d8e4\" />\n <stop offset=\"65%\" stopColor=\"#e8dcc8\" />\n <stop offset=\"100%\" stopColor=\"#8ab4c8\" />\n </linearGradient>\n <path id={pathId} d={arcPath} fill=\"none\" />\n </defs>\n <text\n fill={`url(#${gradientId})`}\n fontFamily=\"'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif\"\n fontSize={appearance.titleFontSize}\n fontWeight={700}\n fontStyle=\"italic\"\n letterSpacing={appearance.titleLetterSpacing}\n opacity={appearance.titleOpacity}\n stroke=\"rgba(20,40,60,0.35)\"\n strokeWidth={0.6}\n paintOrder=\"stroke fill\"\n style={{ pointerEvents: \"none\" }}\n >\n <textPath href={`#${pathId}`} startOffset=\"50%\" textAnchor=\"middle\">\n {title.toUpperCase()}\n </textPath>\n </text>\n </svg>\n );\n\n return (\n <Billboard\n position={[\n bounds.center[0],\n bounds.center[1] + appearance.titleYOffset,\n bounds.center[2],\n ]}\n >\n <Html\n center\n transform\n distanceFactor={appearance.titleDistanceFactor}\n zIndexRange={appearance.htmlZIndexRange}\n occlude={false}\n style={{\n pointerEvents: editable ? \"auto\" : \"none\",\n userSelect: \"none\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 6,\n }}\n >\n {titleControl}\n\n {showOverlay ? (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 4,\n maxWidth: svgWidth,\n pointerEvents: \"none\",\n }}\n >\n {hasDirector ? (\n <DirectorCredit\n prefix={storyOverlay!.chosenByPrefix}\n name={storyOverlay!.directorName!}\n avatarUrl={storyOverlay!.directorAvatarUrl ?? null}\n />\n ) : null}\n\n {hasRatingGenre ? (\n <RatingGenreLine\n contentRating={storyOverlay!.contentRating ?? null}\n genre={storyOverlay!.genre ?? null}\n separator={storyOverlay!.ratingGenreSeparator ?? \" · \"}\n />\n ) : null}\n </div>\n ) : null}\n </div>\n </Html>\n </Billboard>\n );\n}\n\nfunction DirectorCredit({\n prefix,\n name,\n avatarUrl,\n}: {\n prefix: string;\n name: string;\n avatarUrl: string | null;\n}) {\n const initial = name.trim().charAt(0).toUpperCase() || \"?\";\n\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 11,\n color: \"rgba(232,240,255,0.72)\",\n letterSpacing: 0.35,\n textShadow: \"0 1px 8px rgba(0,0,0,0.95)\",\n whiteSpace: \"nowrap\",\n }}\n >\n <span style={{ opacity: 0.85 }}>{prefix}</span>\n <span\n style={{\n width: 20,\n height: 20,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"rgba(255,255,255,0.1)\",\n border: \"1px solid rgba(126,184,255,0.35)\",\n fontSize: 9,\n fontWeight: 700,\n color: \"rgba(232,240,255,0.9)\",\n }}\n >\n {avatarUrl ? (\n <img\n src={avatarUrl}\n alt=\"\"\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </span>\n <span style={{ fontWeight: 600 }}>{name}</span>\n </div>\n );\n}\n\nfunction RatingGenreLine({\n contentRating,\n genre,\n separator,\n}: {\n contentRating: string | null;\n genre: string | null;\n separator: string;\n}) {\n const parts: ReactNode[] = [];\n if (contentRating) {\n parts.push(\n <span key=\"rating\" style={{ fontWeight: 700 }}>\n {contentRating}\n </span>,\n );\n }\n if (genre) {\n parts.push(<span key=\"genre\">{genre}</span>);\n }\n if (parts.length === 0) return null;\n\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 0,\n fontSize: 10,\n letterSpacing: 0.5,\n textTransform: \"uppercase\",\n color: \"rgba(232,240,255,0.55)\",\n textShadow: \"0 1px 6px rgba(0,0,0,0.95)\",\n }}\n >\n {parts.map((part, i) => (\n <span key={i}>\n {i > 0 ? separator : null}\n {part}\n </span>\n ))}\n </div>\n );\n}\n","import { Html } from \"@react-three/drei\";\nimport type { ReactNode } from \"react\";\nimport type { ConstellationAppearance } from \"../appearance.js\";\n\nexport interface StarBillboardProps {\n label: string;\n appearance: ConstellationAppearance;\n previewImageUrl?: string | null;\n previewContent?: ReactNode;\n dimmed?: boolean;\n focused?: boolean;\n visible?: boolean;\n /** Control strip rendered flush beneath the preview when focused. */\n controlsSlot?: ReactNode;\n}\n\n/**\n * Floating preview card and scene label above a star. Unfocused previews\n * are dimmed; labels stay prominent. Anchor sits at preview bottom-center\n * so attached controls align with the card edge.\n */\nexport function StarBillboard({\n label,\n appearance,\n previewImageUrl,\n previewContent,\n dimmed,\n focused,\n visible = true,\n controlsSlot,\n}: StarBillboardProps) {\n if (!visible) return null;\n\n const borderColor = focused\n ? \"rgba(126,184,255,0.75)\"\n : \"rgba(126,184,255,0.22)\";\n const previewOpacity = focused ? 1 : dimmed ? 0.22 : 0.34;\n const previewFilter = focused\n ? \"brightness(1.08) saturate(1.1)\"\n : \"brightness(0.72) saturate(0.65)\";\n const hasControls = !!(focused && controlsSlot);\n\n return (\n <Html\n position={[0, appearance.previewOffsetY, 0]}\n center\n transform\n distanceFactor={appearance.billboardDistanceFactor}\n zIndexRange={appearance.htmlZIndexRange}\n occlude={false}\n style={{\n pointerEvents: \"none\",\n userSelect: \"none\",\n }}\n >\n <style>{`\n @keyframes chuziPreviewFocusIn {\n 0% { opacity: 0.4; transform: scale(0.9); filter: brightness(0.8) saturate(0.7); }\n 55% { opacity: 1; transform: scale(1.05); filter: brightness(1.12) saturate(1.15); }\n 100% { opacity: 1; transform: scale(1); filter: brightness(1.08) saturate(1.1); }\n }\n @keyframes chuziPreviewFocusOut {\n 0% { opacity: 1; transform: scale(1); }\n 100% { opacity: ${previewOpacity}; transform: scale(0.96); }\n }\n `}</style>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n transform: `translateY(-${appearance.previewHeight / 2}px)`,\n }}\n >\n <div\n key={focused ? \"focused\" : \"unfocused\"}\n style={{\n width: appearance.previewWidth,\n height: appearance.previewHeight,\n borderRadius: hasControls ? \"8px 8px 0 0\" : 8,\n overflow: \"hidden\",\n border: `1px solid ${borderColor}`,\n borderBottom: hasControls ? \"none\" : `1px solid ${borderColor}`,\n background: \"rgba(4,7,13,0.92)\",\n boxShadow: focused\n ? \"0 0 28px rgba(126,184,255,0.45), 0 4px 24px rgba(0,0,0,0.5)\"\n : \"0 4px 20px rgba(0,0,0,0.55)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: previewOpacity,\n filter: previewFilter,\n transition: \"border-color 0.35s ease, box-shadow 0.35s ease\",\n animation: focused\n ? \"chuziPreviewFocusIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1) forwards\"\n : \"chuziPreviewFocusOut 0.32s ease forwards\",\n }}\n >\n {previewImageUrl ? (\n <img\n src={previewImageUrl}\n alt=\"\"\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n }}\n />\n ) : (\n previewContent ?? (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background:\n \"radial-gradient(ellipse at 30% 20%, rgba(80,120,200,0.2) 0%, rgba(10,14,30,0.95) 70%)\",\n }}\n />\n )\n )}\n </div>\n\n {hasControls ? (\n <div\n style={{\n width: appearance.previewWidth,\n pointerEvents: \"auto\",\n flexShrink: 0,\n }}\n >\n {controlsSlot}\n </div>\n ) : null}\n\n <div\n style={{\n marginTop: appearance.labelGap,\n fontSize: appearance.labelFontSize,\n fontWeight: 700,\n letterSpacing: appearance.labelLetterSpacing,\n textTransform: \"uppercase\",\n color: \"rgba(232,240,255,0.96)\",\n textAlign: \"center\",\n textShadow:\n \"0 0 18px rgba(0,0,0,0.95), 0 2px 12px rgba(0,0,0,0.95), 0 0 6px rgba(126,184,255,0.25)\",\n whiteSpace: \"nowrap\",\n maxWidth: appearance.previewWidth + 48,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {label}\n </div>\n </div>\n </Html>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { AtomVisualProps } from \"../../index.js\";\nimport {\n mergeConstellationAppearance,\n type ConstellationAppearance,\n} from \"../appearance.js\";\nimport { Star } from \"./Star.js\";\nimport { ConstellationEdge } from \"./ConstellationEdge.js\";\nimport {\n ConstellationTitle,\n computeConstellationBounds,\n type ConstellationStoryOverlay,\n} from \"./ConstellationTitle.js\";\nimport { StarBillboard } from \"./StarBillboard.js\";\n\nexport interface ConstellationSceneEntry {\n id: string;\n /** Visual with final position already computed by the consumer. */\n visual: AtomVisualProps;\n /** Scene label shown beneath the preview card. */\n label?: string;\n /** Static preview image (coverbox, poster frame, etc.). */\n previewImageUrl?: string | null;\n /** Custom preview when no image URL is available. */\n previewContent?: ReactNode;\n /** When true the star renders at reduced brightness/saturation. */\n dimmed?: boolean;\n /** When true the star is non-navigable (click suppressed). */\n locked?: boolean;\n /** Highlight this star's billboard (focused traversal). */\n focused?: boolean;\n /** Control strip slot — rendered beneath preview when focused. */\n controlsSlot?: ReactNode;\n}\n\nexport interface ConstellationEdgeEntry {\n source: string;\n target: string;\n type: \"choice\" | \"go_to_scene\" | \"sequential\";\n}\n\nexport interface ConstellationProps {\n /** Scene entries with positions already computed by the consumer. */\n scenes: ConstellationSceneEntry[];\n /** Film title rendered as ghost typography across the group. */\n storyTitle?: string;\n /** Director credit, rating, and genre beneath the arched title. */\n storyOverlay?: ConstellationStoryOverlay;\n /** Explicit story-flow edges (goto + choice). No implicit sequential links. */\n edges?: ConstellationEdgeEntry[];\n appearance?: Partial<ConstellationAppearance>;\n /** When false, hide Html billboards and arc title (e.g. while editor is open). */\n showOverlays?: boolean;\n onSceneSelect?: (index: number) => void;\n}\n\n/**\n * A single story rendered as a constellation: scene-stars connected by\n * luminous gradient edges. This is the cosmos realm's `Group` component —\n * identical rendering for own and others' stories.\n */\nexport function Constellation({\n scenes,\n storyTitle,\n storyOverlay,\n edges = [],\n appearance: appearanceOverrides,\n showOverlays = true,\n onSceneSelect,\n}: ConstellationProps) {\n const appearance = mergeConstellationAppearance(appearanceOverrides);\n const sceneMap = new Map(scenes.map((s, i) => [s.id, { entry: s, index: i }]));\n const bounds = computeConstellationBounds(\n scenes.map((s) => s.visual.position),\n );\n\n const resolvedEdges: {\n from: ConstellationSceneEntry;\n to: ConstellationSceneEntry;\n type: ConstellationEdgeEntry[\"type\"];\n }[] = [];\n\n for (const edge of edges) {\n const src = sceneMap.get(edge.source);\n const tgt = sceneMap.get(edge.target);\n if (src && tgt) {\n resolvedEdges.push({ from: src.entry, to: tgt.entry, type: edge.type });\n }\n }\n\n return (\n <group>\n {showOverlays && storyTitle && bounds ? (\n <ConstellationTitle\n title={storyTitle}\n bounds={bounds}\n appearance={appearance}\n arcFrom={scenes[0]?.visual.position}\n arcTo={scenes[scenes.length - 1]?.visual.position}\n storyOverlay={storyOverlay}\n />\n ) : null}\n\n {scenes.map((entry, i) => (\n <group key={entry.id} position={entry.visual.position}>\n <Star\n visual={{ ...entry.visual, position: [0, 0, 0] }}\n dimmed={entry.dimmed}\n locked={entry.locked}\n onSelect={onSceneSelect ? () => onSceneSelect(i) : undefined}\n />\n\n {showOverlays &&\n (entry.label || entry.previewImageUrl || entry.previewContent) ? (\n <StarBillboard\n label={entry.label ?? \"\"}\n appearance={appearance}\n previewImageUrl={entry.previewImageUrl}\n previewContent={entry.previewContent}\n dimmed={entry.dimmed}\n focused={entry.focused}\n controlsSlot={entry.controlsSlot}\n visible={showOverlays}\n />\n ) : null}\n </group>\n ))}\n\n {resolvedEdges.map(({ from, to, type }) => {\n const edgeDimmed = !!(from.dimmed || to.dimmed);\n return (\n <ConstellationEdge\n key={`edge-${from.id}-${to.id}-${type}`}\n from={from.visual.position}\n to={to.visual.position}\n hueA={from.visual.hue}\n hueB={to.visual.hue}\n intensityA={from.visual.intensity}\n intensityB={to.visual.intensity}\n dimmed={edgeDimmed}\n />\n );\n })}\n </group>\n );\n}\n\n","import type { StoryListItem } from \"../../types/index.js\";\nimport type { AtomMapping, AtomState, AudioPalette, MotionTokens } from \"../index.js\";\n\n/**\n * COSMOS realm — pure-data layer. The 3D components (World, Star, NavRig,\n * EngageTransition) live in a follow-up package once the JSX build is\n * wired up; this file owns the realm's mapping and tuning constants so\n * they can be consumed today by any non-3D surface (catalog list, search,\n * preview cards, sound design tooling).\n *\n * Mapping rationale:\n * runtime → scale (longer film = bigger star)\n * popularity → intensity (more watches = brighter)\n * mood → hue (warm/cool palette by tone)\n * genre → spectral hint (small offset on top of mood, reads as\n * \"stellar class\" — drama is yellow-G,\n * thriller is blue-O, romance is red-M).\n * state → orbit-ring rendering (handled by Atom component).\n */\n\nconst GENRE_HUE_OFFSET: Record<string, number> = {\n drama: 50,\n thriller: 220,\n horror: 0,\n comedy: 35,\n romance: 340,\n scifi: 200,\n documentary: 180,\n animation: 280,\n};\n\nconst MOOD_HUE: Record<string, number> = {\n bright: 50,\n warm: 25,\n bittersweet: 290,\n somber: 230,\n tense: 210,\n playful: 110,\n melancholy: 250,\n};\n\nfunction clamp01(n: number): number {\n return Math.max(0, Math.min(1, n));\n}\n\nfunction popularityToIntensity(film: StoryListItem): number {\n // Log-compress: a 100x more-watched film should not be 100x brighter.\n const watches = Math.max(0, film.watch_starts_count);\n const log = Math.log10(1 + watches);\n // Rough cap at ~6 (1M watches saturates the scale).\n return clamp01(log / 6);\n}\n\nfunction deriveScale(film: StoryListItem): number {\n // We don't have runtime in StoryListItem yet; proxy with scenes_count.\n // Caps the starfield from going visually noisy.\n const scenes = film.scenes_count ?? 1;\n return clamp01(0.25 + Math.log10(1 + scenes) / 4);\n}\n\nfunction deriveHue(film: StoryListItem): number {\n const genreKey = (film.genre ?? \"\").toLowerCase().replace(/[^a-z]/g, \"\");\n const moodKey = \"\";\n const moodHue = MOOD_HUE[moodKey];\n const genreOffset = GENRE_HUE_OFFSET[genreKey];\n if (moodHue !== undefined) return moodHue;\n if (genreOffset !== undefined) return genreOffset;\n return 210;\n}\n\nfunction deriveState(film: StoryListItem): AtomState {\n // Without per-user progress threaded through, default; the consuming\n // app will overlay state from CatalogResponse.meta.progress.\n return film.published ? \"default\" : \"new\";\n}\n\nexport const cosmosMapping: AtomMapping = (film) => ({\n position: [0, 0, 0], // assigned by the realm's spatial layouter\n scale: deriveScale(film),\n hue: deriveHue(film),\n intensity: popularityToIntensity(film),\n state: deriveState(film),\n metadata: {\n title: film.title,\n popularity: film.watch_starts_count,\n genre: film.genre,\n },\n});\n\nexport const cosmosMotion: MotionTokens = {\n flightAcceleration: 14,\n flightDamping: 0.92,\n focusEaseMs: 380,\n engageDurationMs: 900,\n backDurationMs: 900,\n};\n\nexport {\n DEFAULT_CONSTELLATION_APPEARANCE,\n mergeConstellationAppearance,\n} from \"./appearance.js\";\nexport type { ConstellationAppearance } from \"./appearance.js\";\n\nexport const cosmosAudio: AudioPalette = {\n // Asset paths are resolved by the host app's asset bundler; chuzi-shared\n // only declares the contract. Replace with CDN URLs at integration time.\n ambientLoop: \"audio/cosmos/ambient-deep.ogg\",\n focusChime: \"audio/cosmos/focus-shimmer.ogg\",\n engageImpact: \"audio/cosmos/dolly-in.ogg\",\n backWhoosh: \"audio/cosmos/dolly-out.ogg\",\n};\n","/**\n * Spatial distribution helpers for the cosmos realm. Kept as a stand-alone\n * module so non-3D surfaces (search overlays, accessibility list view,\n * minimap) can compute and reuse positions without pulling in three.js.\n */\n\nexport type Vec3 = [number, number, number];\n\nexport interface DistributeOptions {\n /** Outer radius of the disk in world units. */\n radius?: number;\n /** Vertical jitter band (±). Larger values flatten the disk less. */\n thickness?: number;\n /** Deterministic seed; identical seeds produce identical layouts. */\n seed?: number;\n}\n\n/**\n * Galaxy-disk distribution: stars cluster denser toward the center\n * (sqrt-r weighting), with a vertical jitter band. Deterministic when a\n * seed is provided so the same catalog produces the same starfield across\n * sessions.\n */\nexport function distributeStars(\n count: number,\n options: DistributeOptions = {},\n): Vec3[] {\n const radius = options.radius ?? 25;\n const thickness = options.thickness ?? 4;\n const random = options.seed !== undefined ? mulberry32(options.seed) : Math.random;\n\n const positions: Vec3[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.sqrt(random()) * radius;\n const theta = random() * Math.PI * 2;\n const y = (random() - 0.5) * thickness;\n positions.push([Math.cos(theta) * r, y, Math.sin(theta) * r]);\n }\n return positions;\n}\n\nfunction mulberry32(seed: number): () => number {\n let s = seed >>> 0;\n return () => {\n s = (s + 0x6d2b79f5) >>> 0;\n let t = s;\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n","import { useMemo } from \"react\";\nimport type { StoryListItem } from \"../../../types/index.js\";\nimport { cosmosMapping } from \"../index.js\";\nimport { Star } from \"./Star.js\";\nimport { World } from \"./World.js\";\nimport { distributeStars, type Vec3 } from \"./layout.js\";\n\nexport interface CosmosSandboxProps {\n films: StoryListItem[];\n onFilmSelect?: (film: StoryListItem) => void;\n /** Layout seed — same seed + same films = same layout. */\n seed?: number;\n}\n\n/**\n * Drop-in 3D sandbox. Hands a list of films, gets back a navigable\n * starfield where each star is a film. Useful for: integration tests, the\n * realm-picker preview thumbnail, the editor's \"preview as star\" mode, and\n * as the smoke-test entry while migrating chuzi-web off Laravel.\n */\nexport function CosmosSandbox({\n films,\n onFilmSelect,\n seed = 1,\n}: CosmosSandboxProps) {\n const placed = useMemo(() => {\n const positions: Vec3[] = distributeStars(films.length, { seed });\n return films.map((film, i) => ({\n film,\n visual: { ...cosmosMapping(film), position: positions[i] },\n }));\n }, [films, seed]);\n\n return (\n <World>\n {placed.map(({ film, visual }) => (\n <Star\n key={film.id}\n visual={visual}\n onSelect={onFilmSelect ? () => onFilmSelect(film) : undefined}\n />\n ))}\n </World>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/themes/index.ts","../../../../src/realms/cosmos/components/World.tsx","../../../../src/realms/cosmos/components/Star.tsx","../../../../src/realms/cosmos/appearance.ts","../../../../src/realms/cosmos/components/ConstellationEdge.tsx","../../../../src/realms/cosmos/components/ConstellationTitle.tsx","../../../../src/realms/cosmos/components/StarBillboard.tsx","../../../../src/realms/cosmos/components/Constellation.tsx","../../../../src/realms/cosmos/index.ts","../../../../src/realms/cosmos/components/layout.ts","../../../../src/realms/cosmos/components/CosmosSandbox.tsx"],"names":["DreiStars","jsxs","jsx","Html","useMemo"],"mappings":";;;;;;;;;AAgBO,IAAM,YAAA,GAAkD;AAAA,EAC7D,MAAA,EAAQ;AAAA,IACN,MAAA,EAAQ,SAOV,CAUF,CAAA;ACjBO,SAAS,KAAA,CAAM,EAAE,QAAA,EAAU,GAAA,GAAM,CAAC,CAAA,EAAG,CAAC,GAAE,EAAe;AAC5D,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,MAAA,EAAQ,EAAE,QAAA,EAAU,CAAC,CAAA,EAAG,CAAA,EAAG,EAAE,CAAA,EAAG,GAAA,EAAK,EAAA,EAAI,IAAA,EAAM,GAAA,EAAK,KAAK,GAAA,EAAI;AAAA,MAC7D,GAAA;AAAA,MACA,EAAA,EAAI,EAAE,SAAA,EAAW,IAAA,EAAK;AAAA,MAEtB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,OAAA,EAAA,EAAM,QAAO,YAAA,EAAa,IAAA,EAAM,CAAC,YAAA,CAAa,MAAA,C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EF,GAAAA,CAAC,KAAA,EAAA,EACE,QAAA,EAAA,MAAA,CAAO,GAAA,CAAI,CAAC,EAAE,IAAA,EAAM,MAAA,EAAO,qBAC1BA,GAAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MAEC,MAAA;AAAA,MACA,QAAA,EAAU,YAAA,GAAe,MAAM,YAAA,CAAa,IAAI,CAAA,GAAI;AAAA,KAAA;AAAA,IAF/C,IAAA,CAAK;AAAA,GAIb,CAAA,EACH,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { RealmId } from \"../types/index.js\";\n\n/**\n * CSS custom property tokens, mirroring public/css/chuzi-realms.css.\n * Use these for any non-DOM rendering (e.g. React Native, canvas).\n */\nexport interface RealmThemeTokens {\n bgDeep: string;\n bgMid: string;\n accent: string;\n accentSoft: string;\n text: string;\n muted: string;\n effectLine: string;\n}\n\nexport const THEME_TOKENS: Record<RealmId, RealmThemeTokens> = {\n cosmos: {\n bgDeep: \"#04070d\",\n bgMid: \"#0a1020\",\n accent: \"#7eb8ff\",\n accentSoft: \"rgba(126, 184, 255, 0.35)\",\n text: \"#e8f0ff\",\n muted: \"rgba(232, 240, 255, 0.65)\",\n effectLine: \"#ffb347\",\n },\n wilds: {\n bgDeep: \"#0d120c\",\n bgMid: \"#152018\",\n accent: \"#7bc96f\",\n accentSoft: \"rgba(123, 201, 111, 0.35)\",\n text: \"#eef6ea\",\n muted: \"rgba(238, 246, 234, 0.7)\",\n effectLine: \"#b78aff\",\n },\n};\n\n/**\n * Scene tree visualization theme, mirroring the THEMES object in\n * resources/js/scene-tree-viewer.js.\n */\nexport interface SceneTreeTheme {\n bg: string;\n edgeChoice: string;\n edgeGoto: string;\n nodeDefault: string;\n nodeActive: string;\n borderDefault: string;\n borderActive: string;\n labelDefault: string;\n labelActive: string;\n nodeLockedFill: string;\n nodeLockedBorder: string;\n labelLocked: string;\n nodeShape: \"star\" | \"rect\";\n rectRx: number;\n}\n\nexport const SCENE_TREE_THEMES: Record<RealmId, SceneTreeTheme> = {\n cosmos: {\n bg: \"#020408\",\n edgeChoice: \"#e8f0ff\",\n edgeGoto: \"#4a9fff\",\n nodeDefault: \"#ffffff\",\n nodeActive: \"#ffd47e\",\n borderDefault: \"#3a5080\",\n borderActive: \"#fff6d0\",\n labelDefault: \"rgba(220, 232, 255, 0.92)\",\n labelActive: \"rgba(255, 246, 220, 0.98)\",\n nodeLockedFill: \"#151a28\",\n nodeLockedBorder: \"#2a3348\",\n labelLocked: \"rgba(200, 210, 230, 0.35)\",\n nodeShape: \"star\",\n rectRx: 2,\n },\n wilds: {\n bg: \"#04070d\",\n edgeChoice: \"#ffffff\",\n edgeGoto: \"#6ecf7a\",\n nodeDefault: \"#e8f5e4\",\n nodeActive: \"#d31e2f\",\n borderDefault: \"#2d4a32\",\n borderActive: \"#ff9ea8\",\n labelDefault: \"rgba(232, 245, 228, 0.92)\",\n labelActive: \"rgba(255, 214, 219, 0.98)\",\n nodeLockedFill: \"#1a221c\",\n nodeLockedBorder: \"#2a3d30\",\n labelLocked: \"rgba(200, 220, 200, 0.38)\",\n nodeShape: \"rect\",\n rectRx: 3,\n },\n};\n\n/**\n * Get theme tokens for a realm, defaulting to wilds.\n */\nexport function getThemeTokens(realmId: RealmId | null | undefined): RealmThemeTokens {\n return THEME_TOKENS[realmId ?? \"wilds\"] ?? THEME_TOKENS.wilds;\n}\n\n/**\n * Get scene tree theme for a realm, defaulting to wilds.\n */\nexport function getSceneTreeTheme(realmId: RealmId | null | undefined): SceneTreeTheme {\n return SCENE_TREE_THEMES[realmId ?? \"wilds\"] ?? SCENE_TREE_THEMES.wilds;\n}\n","import { Canvas } from \"@react-three/fiber\";\nimport { OrbitControls, Stars as DreiStars } from \"@react-three/drei\";\nimport type { ReactNode } from \"react\";\nimport { THEME_TOKENS } from \"../../../themes/index.js\";\n\nexport interface WorldProps {\n children: ReactNode;\n /** Pixel device ratio cap. Default 2 — keeps perf bounded on retina laptops. */\n dpr?: number | [number, number];\n}\n\n/**\n * Cosmos environment shell. Wraps an r3f Canvas with deep-space background,\n * ambient starfield (drei <Stars> for the *backdrop* — distinct from our\n * film-stars), and a placeholder OrbitControls camera. The real NavRig\n * (consuming an IntentSource and doing focus-snap on dpad) replaces\n * OrbitControls in a follow-up package.\n */\nexport function World({ children, dpr = [1, 2] }: WorldProps) {\n return (\n <Canvas\n camera={{ position: [0, 6, 32], fov: 60, near: 0.1, far: 500 }}\n dpr={dpr}\n gl={{ antialias: true }}\n >\n <color attach=\"background\" args={[THEME_TOKENS.cosmos.bgDeep]} />\n <ambientLight intensity={0.15} />\n <DreiStars\n radius={120}\n depth={60}\n count={3000}\n factor={4}\n fade\n saturation={0.4}\n />\n <OrbitControls enablePan={false} maxDistance={80} minDistance={4} />\n {children}\n </Canvas>\n );\n}\n","import { useRef } from \"react\";\nimport { useFrame } from \"@react-three/fiber\";\nimport type { Mesh } from \"three\";\nimport type { AtomVisualProps } from \"../../index.js\";\n\nexport interface StarProps {\n visual: AtomVisualProps;\n onSelect?: () => void;\n /** Reduce brightness and saturation to indicate an unwatched scene. */\n dimmed?: boolean;\n /** Non-navigable — suppresses click and lowers brightness further. */\n locked?: boolean;\n}\n\n/**\n * One film as a star. Color is HSL-derived from the realm mapping's hue +\n * intensity. Each star pulses on its own phase so a thousand of them don't\n * breathe in lockstep — gives the field life without per-star animation\n * state.\n */\nexport function Star({ visual, onSelect, dimmed, locked }: StarProps) {\n const ref = useRef<Mesh>(null);\n\n useFrame(({ clock }) => {\n if (!ref.current) return;\n const phase = visual.position[0] * 0.7 + visual.position[2] * 0.3;\n const pulse = 1 + Math.sin(clock.elapsedTime * 0.8 + phase) * 0.05;\n ref.current.scale.setScalar(visual.scale * pulse);\n });\n\n const saturation = dimmed || locked ? 25 : 75;\n const lightness = dimmed || locked\n ? 25 + visual.intensity * 10\n : 50 + visual.intensity * 25;\n const color = `hsl(${visual.hue}, ${saturation}%, ${lightness}%)`;\n\n const handleClick = locked\n ? undefined\n : onSelect\n ? (e: any) => {\n e.stopPropagation();\n onSelect();\n }\n : undefined;\n\n return (\n <mesh\n ref={ref}\n position={visual.position}\n onClick={handleClick}\n >\n <sphereGeometry args={[0.5, 16, 16]} />\n <meshBasicMaterial\n color={color}\n toneMapped={false}\n transparent={!!(dimmed || locked)}\n opacity={dimmed ? 0.35 : locked ? 0.25 : 1}\n />\n </mesh>\n );\n}\n","/**\n * Constellation presentation tokens — consumed by the cosmos realm camera,\n * star billboards, and ghost title typography. Admins can override via\n * saved experience / appearance templates.\n */\nexport interface ConstellationAppearance {\n /** Rainbow arc title above the constellation (SVG px). */\n titleFontSize: number;\n titleOpacity: number;\n titleColor: string;\n titleLetterSpacing: number;\n /** World-space lift above constellation center. */\n titleYOffset: number;\n /** Html distance factor for the arc title billboard. */\n titleDistanceFactor: number;\n /** DOM z-index ceiling for constellation Html overlays (keep below editor). */\n htmlZIndexRange: [number, number];\n\n /** Per-star preview card + label. */\n previewWidth: number;\n previewHeight: number;\n previewOffsetY: number;\n labelFontSize: number;\n labelLetterSpacing: number;\n labelGap: number;\n /** Reserved space below preview for the 2×2 HUD control grid (px). */\n controlsGridHeight: number;\n billboardDistanceFactor: number;\n\n /** Camera — floating-in-space slide between stars. */\n cameraDefaultOffset: [number, number, number];\n cameraTargetOffset: [number, number, number];\n /** 0–1 lerp factor per frame while gliding (lower = smoother / pressurized). */\n cameraSlideLerp: number;\n cameraArrivalThreshold: number;\n}\n\nexport const DEFAULT_CONSTELLATION_APPEARANCE: ConstellationAppearance = {\n titleFontSize: 34,\n titleOpacity: 0.82,\n titleColor: \"#c8dce8\",\n titleLetterSpacing: 6,\n titleYOffset: 16,\n titleDistanceFactor: 12,\n htmlZIndexRange: [8, 0],\n\n previewWidth: 148,\n previewHeight: 96,\n previewOffsetY: 2.4,\n labelFontSize: 13,\n labelLetterSpacing: 1.2,\n labelGap: 10,\n controlsGridHeight: 92,\n billboardDistanceFactor: 10,\n\n cameraDefaultOffset: [0, 4, 12],\n cameraTargetOffset: [0, 0, 0],\n cameraSlideLerp: 0.035,\n cameraArrivalThreshold: 0.08,\n};\n\nexport function mergeConstellationAppearance(\n overrides?: Partial<ConstellationAppearance>,\n): ConstellationAppearance {\n return { ...DEFAULT_CONSTELLATION_APPEARANCE, ...overrides };\n}\n","import { useMemo } from \"react\";\nimport { Line } from \"@react-three/drei\";\nimport * as THREE from \"three\";\n\nexport type ConstellationEdgeVariant = \"solid\" | \"dotted\";\n\nexport interface ConstellationEdgeProps {\n from: [number, number, number];\n to: [number, number, number];\n hueA: number;\n hueB: number;\n /** Inward gap so the line doesn't touch the star spheres. */\n gap?: number;\n intensityA?: number;\n intensityB?: number;\n /** Reduce opacity to indicate an unwatched connection. */\n dimmed?: boolean;\n /** @deprecated All edges render as soft solid glow; variant is ignored. */\n variant?: ConstellationEdgeVariant;\n}\n\n/**\n * A luminous line connecting two stars in a constellation. Endpoints are\n * pulled inward so the line floats between the stars rather than touching\n * them. Color interpolates from hueA to hueB via vertex colors.\n */\nexport function ConstellationEdge({\n from,\n to,\n hueA,\n hueB,\n gap = 0.55,\n intensityA = 0.5,\n intensityB = 0.5,\n dimmed,\n}: ConstellationEdgeProps) {\n const { points, colorA, colorB, glowA, glowB } = useMemo(() => {\n const a = new THREE.Vector3(...from);\n const b = new THREE.Vector3(...to);\n const dir = b.clone().sub(a);\n const len = dir.length();\n\n if (len < gap * 2.5) {\n return { points: null, colorA: null, colorB: null, glowA: null, glowB: null };\n }\n\n dir.normalize();\n const start = a.clone().add(dir.clone().multiplyScalar(gap));\n const end = b.clone().sub(dir.clone().multiplyScalar(gap));\n\n const lA = 55 + intensityA * 20;\n const lB = 55 + intensityB * 20;\n\n const cA = new THREE.Color(`hsl(${hueA}, 70%, ${lA}%)`);\n const cB = new THREE.Color(`hsl(${hueB}, 70%, ${lB}%)`);\n\n const gA = new THREE.Color(`hsl(${hueA}, 50%, ${lA + 10}%)`);\n const gB = new THREE.Color(`hsl(${hueB}, 50%, ${lB + 10}%)`);\n\n return {\n points: [start, end] as [THREE.Vector3, THREE.Vector3],\n colorA: cA,\n colorB: cB,\n glowA: gA,\n glowB: gB,\n };\n }, [from, to, hueA, hueB, gap, intensityA, intensityB]);\n\n if (!points || !colorA || !colorB || !glowA || !glowB) return null;\n\n const glowOpacity = dimmed ? 0.04 : 0.12;\n const coreOpacity = dimmed ? 0.15 : 0.6;\n\n return (\n <group>\n <Line\n points={points}\n vertexColors={[glowA, glowB]}\n lineWidth={4}\n transparent\n opacity={glowOpacity}\n toneMapped={false}\n />\n <Line\n points={points}\n vertexColors={[colorA, colorB]}\n lineWidth={1.5}\n transparent\n opacity={coreOpacity}\n toneMapped={false}\n />\n </group>\n );\n}\n","import { useId, type ReactNode } from \"react\";\nimport { Billboard, Html } from \"@react-three/drei\";\nimport type { ConstellationAppearance } from \"../appearance.js\";\n\nexport interface ConstellationBounds {\n center: [number, number, number];\n spanX: number;\n spanZ: number;\n}\n\nexport function computeConstellationBounds(\n positions: [number, number, number][],\n): ConstellationBounds | null {\n if (positions.length === 0) return null;\n\n let minX = Infinity;\n let maxX = -Infinity;\n let minZ = Infinity;\n let maxZ = -Infinity;\n let sumY = 0;\n\n for (const [x, y, z] of positions) {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minZ = Math.min(minZ, z);\n maxZ = Math.max(maxZ, z);\n sumY += y;\n }\n\n return {\n center: [(minX + maxX) / 2, sumY / positions.length, (minZ + maxZ) / 2],\n spanX: Math.max(10, maxX - minX + 6),\n spanZ: Math.max(8, maxZ - minZ + 5),\n };\n}\n\nexport interface ConstellationStoryOverlay {\n /** Localized prefix, e.g. \"Chosen by\". */\n chosenByPrefix: string;\n directorName?: string | null;\n directorAvatarUrl?: string | null;\n /** Procedural avatar when no uploaded photo (e.g. constellation seal). */\n directorAvatarFallback?: ReactNode;\n contentRating?: string | null;\n genre?: string | null;\n /** Shown between rating and genre. */\n ratingGenreSeparator?: string;\n /** When true the arched title is clickable. */\n editable?: boolean;\n onEditClick?: () => void;\n /** Accessible label for the editable title control. */\n editAriaLabel?: string;\n}\n\nexport interface ConstellationTitleProps {\n title: string;\n bounds: ConstellationBounds;\n appearance: ConstellationAppearance;\n /** World position of the title (first) scene — arc starts here. */\n arcFrom?: [number, number, number];\n /** World position of the end scene — arc ends here. */\n arcTo?: [number, number, number];\n storyOverlay?: ConstellationStoryOverlay;\n}\n\nconst WORLD_TO_SVG = 58;\n\n/**\n * Vintage cartography-style ocean label arcing from title scene to end scene.\n */\nexport function ConstellationTitle({\n title,\n bounds,\n appearance,\n arcFrom,\n arcTo,\n storyOverlay,\n}: ConstellationTitleProps) {\n const gradientId = useId().replace(/:/g, \"\");\n const pathId = `arc-${gradientId}`;\n\n if (!title.trim()) return null;\n\n const span = Math.max(bounds.spanX, bounds.spanZ);\n const svgWidth = Math.max(420, Math.round(span * WORLD_TO_SVG + 80));\n const svgHeight = 110;\n\n const centerX = svgWidth / 2;\n const arcY = svgHeight * 0.88;\n const arcPeak = svgHeight * 0.06;\n\n let arcStartX = svgWidth * 0.04;\n let arcEndX = svgWidth * 0.96;\n\n if (arcFrom && arcTo) {\n const [fromX] = arcFrom;\n const [toX] = arcTo;\n arcStartX = centerX + (fromX - bounds.center[0]) * WORLD_TO_SVG;\n arcEndX = centerX + (toX - bounds.center[0]) * WORLD_TO_SVG;\n arcStartX = Math.max(12, Math.min(arcStartX, svgWidth - 12));\n arcEndX = Math.max(12, Math.min(arcEndX, svgWidth - 12));\n if (arcStartX > arcEndX) {\n const swap = arcStartX;\n arcStartX = arcEndX;\n arcEndX = swap;\n }\n }\n\n const arcMidX = (arcStartX + arcEndX) / 2;\n const arcPath = `M ${arcStartX} ${arcY} Q ${arcMidX} ${arcPeak} ${arcEndX} ${arcY}`;\n\n const editable = !!(storyOverlay?.editable && storyOverlay.onEditClick);\n const hasDirector = !!(\n storyOverlay?.directorName && storyOverlay.directorName.trim()\n );\n const hasRatingGenre = !!(\n storyOverlay?.contentRating || storyOverlay?.genre\n );\n const showOverlay = hasDirector || hasRatingGenre;\n\n const titleControl = (\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n style={{\n overflow: \"visible\",\n display: \"block\",\n cursor: editable ? \"pointer\" : undefined,\n }}\n aria-hidden={editable ? undefined : true}\n role={editable ? \"button\" : undefined}\n tabIndex={editable ? 0 : undefined}\n aria-label={editable ? storyOverlay?.editAriaLabel : undefined}\n onClick={editable ? storyOverlay?.onEditClick : undefined}\n onKeyDown={\n editable\n ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n storyOverlay?.onEditClick?.();\n }\n }\n : undefined\n }\n >\n <defs>\n <linearGradient id={gradientId} x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\">\n <stop offset=\"0%\" stopColor=\"#8ab4c8\" />\n <stop offset=\"35%\" stopColor=\"#c8d8e4\" />\n <stop offset=\"65%\" stopColor=\"#e8dcc8\" />\n <stop offset=\"100%\" stopColor=\"#8ab4c8\" />\n </linearGradient>\n <path id={pathId} d={arcPath} fill=\"none\" />\n </defs>\n <text\n fill={`url(#${gradientId})`}\n fontFamily=\"'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif\"\n fontSize={appearance.titleFontSize}\n fontWeight={700}\n fontStyle=\"italic\"\n letterSpacing={appearance.titleLetterSpacing}\n opacity={appearance.titleOpacity}\n stroke=\"rgba(20,40,60,0.35)\"\n strokeWidth={0.6}\n paintOrder=\"stroke fill\"\n style={{ pointerEvents: \"none\" }}\n >\n <textPath href={`#${pathId}`} startOffset=\"50%\" textAnchor=\"middle\">\n {title.toUpperCase()}\n </textPath>\n </text>\n </svg>\n );\n\n return (\n <Billboard\n position={[\n bounds.center[0],\n bounds.center[1] + appearance.titleYOffset,\n bounds.center[2],\n ]}\n >\n <Html\n center\n transform\n distanceFactor={appearance.titleDistanceFactor}\n zIndexRange={appearance.htmlZIndexRange}\n occlude={false}\n style={{\n pointerEvents: editable ? \"auto\" : \"none\",\n userSelect: \"none\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 8,\n marginTop: 4,\n }}\n >\n {titleControl}\n\n {showOverlay ? (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 6,\n maxWidth: svgWidth,\n marginTop: 6,\n pointerEvents: \"none\",\n }}\n >\n {hasDirector ? (\n <DirectorCredit\n prefix={storyOverlay!.chosenByPrefix}\n name={storyOverlay!.directorName!}\n avatarUrl={storyOverlay!.directorAvatarUrl ?? null}\n avatarFallback={storyOverlay!.directorAvatarFallback}\n />\n ) : null}\n\n {hasRatingGenre ? (\n <RatingGenreLine\n contentRating={storyOverlay!.contentRating ?? null}\n genre={storyOverlay!.genre ?? null}\n separator={storyOverlay!.ratingGenreSeparator ?? \" · \"}\n />\n ) : null}\n </div>\n ) : null}\n </div>\n </Html>\n </Billboard>\n );\n}\n\nfunction DirectorCredit({\n prefix,\n name,\n avatarUrl,\n avatarFallback,\n}: {\n prefix: string;\n name: string;\n avatarUrl: string | null;\n avatarFallback?: ReactNode;\n}) {\n const initial = name.trim().charAt(0).toUpperCase() || \"?\";\n\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 11,\n color: \"rgba(232,240,255,0.72)\",\n letterSpacing: 0.35,\n textShadow: \"0 1px 8px rgba(0,0,0,0.95)\",\n whiteSpace: \"nowrap\",\n }}\n >\n <span style={{ opacity: 0.85 }}>{prefix}</span>\n <span\n style={{\n width: 20,\n height: 20,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"rgba(255,255,255,0.1)\",\n border: \"1px solid rgba(126,184,255,0.35)\",\n fontSize: 9,\n fontWeight: 700,\n color: \"rgba(232,240,255,0.9)\",\n }}\n >\n {avatarUrl ? (\n <img\n src={avatarUrl}\n alt=\"\"\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : avatarFallback ? (\n avatarFallback\n ) : (\n initial\n )}\n </span>\n <span style={{ fontWeight: 600 }}>{name}</span>\n </div>\n );\n}\n\nfunction RatingGenreLine({\n contentRating,\n genre,\n separator,\n}: {\n contentRating: string | null;\n genre: string | null;\n separator: string;\n}) {\n const parts: ReactNode[] = [];\n if (contentRating) {\n parts.push(\n <span key=\"rating\" style={{ fontWeight: 700 }}>\n {contentRating}\n </span>,\n );\n }\n if (genre) {\n parts.push(<span key=\"genre\">{genre}</span>);\n }\n if (parts.length === 0) return null;\n\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 0,\n fontSize: 10,\n letterSpacing: 0.5,\n textTransform: \"uppercase\",\n color: \"rgba(232,240,255,0.55)\",\n textShadow: \"0 1px 6px rgba(0,0,0,0.95)\",\n }}\n >\n {parts.map((part, i) => (\n <span key={i}>\n {i > 0 ? separator : null}\n {part}\n </span>\n ))}\n </div>\n );\n}\n","import { Html } from \"@react-three/drei\";\nimport type { ReactNode } from \"react\";\nimport type { ConstellationAppearance } from \"../appearance.js\";\n\nexport interface StarBillboardProps {\n label: string;\n appearance: ConstellationAppearance;\n previewImageUrl?: string | null;\n previewContent?: ReactNode;\n dimmed?: boolean;\n focused?: boolean;\n visible?: boolean;\n /** Control strip rendered flush beneath the preview when focused. */\n controlsSlot?: ReactNode;\n}\n\n/**\n * Floating preview card and scene label above a star. Unfocused previews\n * are dimmed; labels stay prominent. Anchor sits at preview bottom-center\n * so attached controls align with the card edge.\n */\nexport function StarBillboard({\n label,\n appearance,\n previewImageUrl,\n previewContent,\n dimmed,\n focused,\n visible = true,\n controlsSlot,\n}: StarBillboardProps) {\n if (!visible) return null;\n\n const borderColor = focused\n ? \"rgba(126,184,255,0.75)\"\n : \"rgba(126,184,255,0.22)\";\n const previewOpacity = focused ? 1 : dimmed ? 0.22 : 0.34;\n const previewFilter = focused\n ? \"brightness(1.08) saturate(1.1)\"\n : \"brightness(0.72) saturate(0.65)\";\n const hasControls = !!(focused && controlsSlot);\n\n return (\n <Html\n position={[0, appearance.previewOffsetY, 0]}\n center\n transform\n distanceFactor={appearance.billboardDistanceFactor}\n zIndexRange={appearance.htmlZIndexRange}\n occlude={false}\n style={{\n pointerEvents: \"none\",\n userSelect: \"none\",\n }}\n >\n <style>{`\n @keyframes chuziPreviewFocusIn {\n 0% { opacity: 0.4; transform: scale(0.9); filter: brightness(0.8) saturate(0.7); }\n 55% { opacity: 1; transform: scale(1.05); filter: brightness(1.12) saturate(1.15); }\n 100% { opacity: 1; transform: scale(1); filter: brightness(1.08) saturate(1.1); }\n }\n @keyframes chuziPreviewFocusOut {\n 0% { opacity: 1; transform: scale(1); }\n 100% { opacity: ${previewOpacity}; transform: scale(0.96); }\n }\n `}</style>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n transform: `translateY(-${appearance.previewHeight / 2}px)`,\n }}\n >\n <div\n key={focused ? \"focused\" : \"unfocused\"}\n style={{\n width: appearance.previewWidth,\n height: appearance.previewHeight,\n borderRadius: hasControls ? \"8px 8px 0 0\" : 8,\n overflow: \"hidden\",\n border: `1px solid ${borderColor}`,\n borderBottom: hasControls ? \"none\" : `1px solid ${borderColor}`,\n background: \"rgba(4,7,13,0.92)\",\n boxShadow: focused\n ? \"0 0 28px rgba(126,184,255,0.45), 0 4px 24px rgba(0,0,0,0.5)\"\n : \"0 4px 20px rgba(0,0,0,0.55)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: previewOpacity,\n filter: previewFilter,\n transition: \"border-color 0.35s ease, box-shadow 0.35s ease\",\n animation: focused\n ? \"chuziPreviewFocusIn 0.48s cubic-bezier(0.34, 1.45, 0.64, 1) forwards\"\n : \"chuziPreviewFocusOut 0.32s ease forwards\",\n }}\n >\n {previewImageUrl ? (\n <img\n src={previewImageUrl}\n alt=\"\"\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n display: \"block\",\n }}\n />\n ) : (\n previewContent ?? (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background:\n \"radial-gradient(ellipse at 30% 20%, rgba(80,120,200,0.2) 0%, rgba(10,14,30,0.95) 70%)\",\n }}\n />\n )\n )}\n </div>\n\n {hasControls ? (\n <div\n style={{\n width: appearance.previewWidth,\n pointerEvents: \"auto\",\n flexShrink: 0,\n }}\n >\n {controlsSlot}\n </div>\n ) : null}\n\n <div\n style={{\n marginTop: appearance.labelGap,\n fontSize: appearance.labelFontSize,\n fontWeight: 700,\n letterSpacing: appearance.labelLetterSpacing,\n textTransform: \"uppercase\",\n color: \"rgba(232,240,255,0.96)\",\n textAlign: \"center\",\n textShadow:\n \"0 0 18px rgba(0,0,0,0.95), 0 2px 12px rgba(0,0,0,0.95), 0 0 6px rgba(126,184,255,0.25)\",\n whiteSpace: \"nowrap\",\n maxWidth: appearance.previewWidth + 48,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {label}\n </div>\n </div>\n </Html>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { AtomVisualProps } from \"../../index.js\";\nimport {\n mergeConstellationAppearance,\n type ConstellationAppearance,\n} from \"../appearance.js\";\nimport { Star } from \"./Star.js\";\nimport { ConstellationEdge } from \"./ConstellationEdge.js\";\nimport {\n ConstellationTitle,\n computeConstellationBounds,\n type ConstellationStoryOverlay,\n} from \"./ConstellationTitle.js\";\nimport { StarBillboard } from \"./StarBillboard.js\";\n\nexport interface ConstellationSceneEntry {\n id: string;\n /** Visual with final position already computed by the consumer. */\n visual: AtomVisualProps;\n /** Scene label shown beneath the preview card. */\n label?: string;\n /** Static preview image (coverbox, poster frame, etc.). */\n previewImageUrl?: string | null;\n /** Custom preview when no image URL is available. */\n previewContent?: ReactNode;\n /** When true the star renders at reduced brightness/saturation. */\n dimmed?: boolean;\n /** When true the star is non-navigable (click suppressed). */\n locked?: boolean;\n /** Highlight this star's billboard (focused traversal). */\n focused?: boolean;\n /** Control strip slot — rendered beneath preview when focused. */\n controlsSlot?: ReactNode;\n}\n\nexport interface ConstellationEdgeEntry {\n source: string;\n target: string;\n type: \"choice\" | \"go_to_scene\" | \"sequential\";\n}\n\nexport interface ConstellationProps {\n /** Scene entries with positions already computed by the consumer. */\n scenes: ConstellationSceneEntry[];\n /** Film title rendered as ghost typography across the group. */\n storyTitle?: string;\n /** Director credit, rating, and genre beneath the arched title. */\n storyOverlay?: ConstellationStoryOverlay;\n /** Explicit story-flow edges (goto + choice). No implicit sequential links. */\n edges?: ConstellationEdgeEntry[];\n appearance?: Partial<ConstellationAppearance>;\n /** When false, hide Html billboards and arc title (e.g. while editor is open). */\n showOverlays?: boolean;\n onSceneSelect?: (index: number) => void;\n}\n\n/**\n * A single story rendered as a constellation: scene-stars connected by\n * luminous gradient edges. This is the cosmos realm's `Group` component —\n * identical rendering for own and others' stories.\n */\nexport function Constellation({\n scenes,\n storyTitle,\n storyOverlay,\n edges = [],\n appearance: appearanceOverrides,\n showOverlays = true,\n onSceneSelect,\n}: ConstellationProps) {\n const appearance = mergeConstellationAppearance(appearanceOverrides);\n const sceneMap = new Map(scenes.map((s, i) => [s.id, { entry: s, index: i }]));\n const bounds = computeConstellationBounds(\n scenes.map((s) => s.visual.position),\n );\n\n const resolvedEdges: {\n from: ConstellationSceneEntry;\n to: ConstellationSceneEntry;\n type: ConstellationEdgeEntry[\"type\"];\n }[] = [];\n\n for (const edge of edges) {\n const src = sceneMap.get(edge.source);\n const tgt = sceneMap.get(edge.target);\n if (src && tgt) {\n resolvedEdges.push({ from: src.entry, to: tgt.entry, type: edge.type });\n }\n }\n\n return (\n <group>\n {showOverlays && storyTitle && bounds ? (\n <ConstellationTitle\n title={storyTitle}\n bounds={bounds}\n appearance={appearance}\n arcFrom={scenes[0]?.visual.position}\n arcTo={scenes[scenes.length - 1]?.visual.position}\n storyOverlay={storyOverlay}\n />\n ) : null}\n\n {scenes.map((entry, i) => (\n <group key={entry.id} position={entry.visual.position}>\n <Star\n visual={{ ...entry.visual, position: [0, 0, 0] }}\n dimmed={entry.dimmed}\n locked={entry.locked}\n onSelect={onSceneSelect ? () => onSceneSelect(i) : undefined}\n />\n\n {showOverlays &&\n (entry.label || entry.previewImageUrl || entry.previewContent) ? (\n <StarBillboard\n label={entry.label ?? \"\"}\n appearance={appearance}\n previewImageUrl={entry.previewImageUrl}\n previewContent={entry.previewContent}\n dimmed={entry.dimmed}\n focused={entry.focused}\n controlsSlot={entry.controlsSlot}\n visible={showOverlays}\n />\n ) : null}\n </group>\n ))}\n\n {resolvedEdges.map(({ from, to, type }) => {\n const edgeDimmed = !!(from.dimmed || to.dimmed);\n return (\n <ConstellationEdge\n key={`edge-${from.id}-${to.id}-${type}`}\n from={from.visual.position}\n to={to.visual.position}\n hueA={from.visual.hue}\n hueB={to.visual.hue}\n intensityA={from.visual.intensity}\n intensityB={to.visual.intensity}\n dimmed={edgeDimmed}\n />\n );\n })}\n </group>\n );\n}\n\n","import type { StoryListItem } from \"../../types/index.js\";\nimport type { AtomMapping, AtomState, AudioPalette, MotionTokens } from \"../index.js\";\n\n/**\n * COSMOS realm — pure-data layer. The 3D components (World, Star, NavRig,\n * EngageTransition) live in a follow-up package once the JSX build is\n * wired up; this file owns the realm's mapping and tuning constants so\n * they can be consumed today by any non-3D surface (catalog list, search,\n * preview cards, sound design tooling).\n *\n * Mapping rationale:\n * runtime → scale (longer film = bigger star)\n * popularity → intensity (more watches = brighter)\n * mood → hue (warm/cool palette by tone)\n * genre → spectral hint (small offset on top of mood, reads as\n * \"stellar class\" — drama is yellow-G,\n * thriller is blue-O, romance is red-M).\n * state → orbit-ring rendering (handled by Atom component).\n */\n\nconst GENRE_HUE_OFFSET: Record<string, number> = {\n drama: 50,\n thriller: 220,\n horror: 0,\n comedy: 35,\n romance: 340,\n scifi: 200,\n documentary: 180,\n animation: 280,\n};\n\nconst MOOD_HUE: Record<string, number> = {\n bright: 50,\n warm: 25,\n bittersweet: 290,\n somber: 230,\n tense: 210,\n playful: 110,\n melancholy: 250,\n};\n\nfunction clamp01(n: number): number {\n return Math.max(0, Math.min(1, n));\n}\n\nfunction popularityToIntensity(film: StoryListItem): number {\n // Log-compress: a 100x more-watched film should not be 100x brighter.\n const watches = Math.max(0, film.watch_starts_count);\n const log = Math.log10(1 + watches);\n // Rough cap at ~6 (1M watches saturates the scale).\n return clamp01(log / 6);\n}\n\nfunction deriveScale(film: StoryListItem): number {\n // We don't have runtime in StoryListItem yet; proxy with scenes_count.\n // Caps the starfield from going visually noisy.\n const scenes = film.scenes_count ?? 1;\n return clamp01(0.25 + Math.log10(1 + scenes) / 4);\n}\n\nfunction deriveHue(film: StoryListItem): number {\n const genreKey = (film.genre ?? \"\").toLowerCase().replace(/[^a-z]/g, \"\");\n const moodKey = \"\";\n const moodHue = MOOD_HUE[moodKey];\n const genreOffset = GENRE_HUE_OFFSET[genreKey];\n if (moodHue !== undefined) return moodHue;\n if (genreOffset !== undefined) return genreOffset;\n return 210;\n}\n\nfunction deriveState(film: StoryListItem): AtomState {\n // Without per-user progress threaded through, default; the consuming\n // app will overlay state from CatalogResponse.meta.progress.\n return film.published ? \"default\" : \"new\";\n}\n\nexport const cosmosMapping: AtomMapping = (film) => ({\n position: [0, 0, 0], // assigned by the realm's spatial layouter\n scale: deriveScale(film),\n hue: deriveHue(film),\n intensity: popularityToIntensity(film),\n state: deriveState(film),\n metadata: {\n title: film.title,\n popularity: film.watch_starts_count,\n genre: film.genre,\n },\n});\n\nexport const cosmosMotion: MotionTokens = {\n flightAcceleration: 14,\n flightDamping: 0.92,\n focusEaseMs: 380,\n engageDurationMs: 900,\n backDurationMs: 900,\n};\n\nexport {\n DEFAULT_CONSTELLATION_APPEARANCE,\n mergeConstellationAppearance,\n} from \"./appearance.js\";\nexport type { ConstellationAppearance } from \"./appearance.js\";\n\nexport const cosmosAudio: AudioPalette = {\n // Asset paths are resolved by the host app's asset bundler; chuzi-shared\n // only declares the contract. Replace with CDN URLs at integration time.\n ambientLoop: \"audio/cosmos/ambient-deep.ogg\",\n focusChime: \"audio/cosmos/focus-shimmer.ogg\",\n engageImpact: \"audio/cosmos/dolly-in.ogg\",\n backWhoosh: \"audio/cosmos/dolly-out.ogg\",\n};\n","/**\n * Spatial distribution helpers for the cosmos realm. Kept as a stand-alone\n * module so non-3D surfaces (search overlays, accessibility list view,\n * minimap) can compute and reuse positions without pulling in three.js.\n */\n\nexport type Vec3 = [number, number, number];\n\nexport interface DistributeOptions {\n /** Outer radius of the disk in world units. */\n radius?: number;\n /** Vertical jitter band (±). Larger values flatten the disk less. */\n thickness?: number;\n /** Deterministic seed; identical seeds produce identical layouts. */\n seed?: number;\n}\n\n/**\n * Galaxy-disk distribution: stars cluster denser toward the center\n * (sqrt-r weighting), with a vertical jitter band. Deterministic when a\n * seed is provided so the same catalog produces the same starfield across\n * sessions.\n */\nexport function distributeStars(\n count: number,\n options: DistributeOptions = {},\n): Vec3[] {\n const radius = options.radius ?? 25;\n const thickness = options.thickness ?? 4;\n const random = options.seed !== undefined ? mulberry32(options.seed) : Math.random;\n\n const positions: Vec3[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.sqrt(random()) * radius;\n const theta = random() * Math.PI * 2;\n const y = (random() - 0.5) * thickness;\n positions.push([Math.cos(theta) * r, y, Math.sin(theta) * r]);\n }\n return positions;\n}\n\nfunction mulberry32(seed: number): () => number {\n let s = seed >>> 0;\n return () => {\n s = (s + 0x6d2b79f5) >>> 0;\n let t = s;\n t = Math.imul(t ^ (t >>> 15), t | 1);\n t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n","import { useMemo } from \"react\";\nimport type { StoryListItem } from \"../../../types/index.js\";\nimport { cosmosMapping } from \"../index.js\";\nimport { Star } from \"./Star.js\";\nimport { World } from \"./World.js\";\nimport { distributeStars, type Vec3 } from \"./layout.js\";\n\nexport interface CosmosSandboxProps {\n films: StoryListItem[];\n onFilmSelect?: (film: StoryListItem) => void;\n /** Layout seed — same seed + same films = same layout. */\n seed?: number;\n}\n\n/**\n * Drop-in 3D sandbox. Hands a list of films, gets back a navigable\n * starfield where each star is a film. Useful for: integration tests, the\n * realm-picker preview thumbnail, the editor's \"preview as star\" mode, and\n * as the smoke-test entry while migrating chuzi-web off Laravel.\n */\nexport function CosmosSandbox({\n films,\n onFilmSelect,\n seed = 1,\n}: CosmosSandboxProps) {\n const placed = useMemo(() => {\n const positions: Vec3[] = distributeStars(films.length, { seed });\n return films.map((film, i) => ({\n film,\n visual: { ...cosmosMapping(film), position: positions[i] },\n }));\n }, [films, seed]);\n\n return (\n <World>\n {placed.map(({ film, visual }) => (\n <Star\n key={film.id}\n visual={visual}\n onSelect={onFilmSelect ? () => onFilmSelect(film) : undefined}\n />\n ))}\n </World>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/realms/cosmos/appearance.ts","../../../src/realms/cosmos/index.ts"],"names":[],"mappings":";AAqCO,IAAM,gCAAA,GAA4D;AAAA,EACvE,aAAA,EAAe,EAAA;AAAA,EACf,YAAA,EAAc,IAAA;AAAA,EACd,UAAA,EAAY,SAAA;AAAA,EACZ,kBAAA,EAAoB,CAAA;AAAA,EACpB,YAAA,EAAc,
|
|
1
|
+
{"version":3,"sources":["../../../src/realms/cosmos/appearance.ts","../../../src/realms/cosmos/index.ts"],"names":[],"mappings":";AAqCO,IAAM,gCAAA,GAA4D;AAAA,EACvE,aAAA,EAAe,EAAA;AAAA,EACf,YAAA,EAAc,IAAA;AAAA,EACd,UAAA,EAAY,SAAA;AAAA,EACZ,kBAAA,EAAoB,CAAA;AAAA,EACpB,YAAA,EAAc,EAAA;AAAA,EACd,mBAAA,EAAqB,EAAA;AAAA,EACrB,eAAA,EAAiB,CAAC,CAAA,EAAG,CAAC,CAAA;AAAA,EAEtB,YAAA,EAAc,GAAA;AAAA,EACd,aAAA,EAAe,EAAA;AAAA,EACf,cAAA,EAAgB,GAAA;AAAA,EAChB,aAAA,EAAe,EA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GAA6B;AAAA,EACxC,kBAAA,EAAoB,EAAA;AAAA,EACpB,aAAA,EAAe,IAAA;AAAA,EACf,WAAA,EAAa,GAAA;AAAA,EACb,gBAAA,EAAkB,GAAA;AAAA,EAClB,cAAA,EAAgB;AAClB;AAQO,IAAM,WAAA,GAA4B;AAAA;AAAA;AAAA,EAGvC,WAAA,EAAa,+BAAA;AAAA,EACb,UAAA,EAAY,gCAAA;AAAA,EACZ,YAAA,EAAc,2BAAA;AAAA,EACd,UAAA,EAAY;AACd","file":"index.js","sourcesContent":["/**\n * Constellation presentation tokens — consumed by the cosmos realm camera,\n * star billboards, and ghost title typography. Admins can override via\n * saved experience / appearance templates.\n */\nexport interface ConstellationAppearance {\n /** Rainbow arc title above the constellation (SVG px). */\n titleFontSize: number;\n titleOpacity: number;\n titleColor: string;\n titleLetterSpacing: number;\n /** World-space lift above constellation center. */\n titleYOffset: number;\n /** Html distance factor for the arc title billboard. */\n titleDistanceFactor: number;\n /** DOM z-index ceiling for constellation Html overlays (keep below editor). */\n htmlZIndexRange: [number, number];\n\n /** Per-star preview card + label. */\n previewWidth: number;\n previewHeight: number;\n previewOffsetY: number;\n labelFontSize: number;\n labelLetterSpacing: number;\n labelGap: number;\n /** Reserved space below preview for the 2×2 HUD control grid (px). */\n controlsGridHeight: number;\n billboardDistanceFactor: number;\n\n /** Camera — floating-in-space slide between stars. */\n cameraDefaultOffset: [number, number, number];\n cameraTargetOffset: [number, number, number];\n /** 0–1 lerp factor per frame while gliding (lower = smoother / pressurized). */\n cameraSlideLerp: number;\n cameraArrivalThreshold: number;\n}\n\nexport const DEFAULT_CONSTELLATION_APPEARANCE: ConstellationAppearance = {\n titleFontSize: 34,\n titleOpacity: 0.82,\n titleColor: \"#c8dce8\",\n titleLetterSpacing: 6,\n titleYOffset: 16,\n titleDistanceFactor: 12,\n htmlZIndexRange: [8, 0],\n\n previewWidth: 148,\n previewHeight: 96,\n previewOffsetY: 2.4,\n labelFontSize: 13,\n labelLetterSpacing: 1.2,\n labelGap: 10,\n controlsGridHeight: 92,\n billboardDistanceFactor: 10,\n\n cameraDefaultOffset: [0, 4, 12],\n cameraTargetOffset: [0, 0, 0],\n cameraSlideLerp: 0.035,\n cameraArrivalThreshold: 0.08,\n};\n\nexport function mergeConstellationAppearance(\n overrides?: Partial<ConstellationAppearance>,\n): ConstellationAppearance {\n return { ...DEFAULT_CONSTELLATION_APPEARANCE, ...overrides };\n}\n","import type { StoryListItem } from \"../../types/index.js\";\nimport type { AtomMapping, AtomState, AudioPalette, MotionTokens } from \"../index.js\";\n\n/**\n * COSMOS realm — pure-data layer. The 3D components (World, Star, NavRig,\n * EngageTransition) live in a follow-up package once the JSX build is\n * wired up; this file owns the realm's mapping and tuning constants so\n * they can be consumed today by any non-3D surface (catalog list, search,\n * preview cards, sound design tooling).\n *\n * Mapping rationale:\n * runtime → scale (longer film = bigger star)\n * popularity → intensity (more watches = brighter)\n * mood → hue (warm/cool palette by tone)\n * genre → spectral hint (small offset on top of mood, reads as\n * \"stellar class\" — drama is yellow-G,\n * thriller is blue-O, romance is red-M).\n * state → orbit-ring rendering (handled by Atom component).\n */\n\nconst GENRE_HUE_OFFSET: Record<string, number> = {\n drama: 50,\n thriller: 220,\n horror: 0,\n comedy: 35,\n romance: 340,\n scifi: 200,\n documentary: 180,\n animation: 280,\n};\n\nconst MOOD_HUE: Record<string, number> = {\n bright: 50,\n warm: 25,\n bittersweet: 290,\n somber: 230,\n tense: 210,\n playful: 110,\n melancholy: 250,\n};\n\nfunction clamp01(n: number): number {\n return Math.max(0, Math.min(1, n));\n}\n\nfunction popularityToIntensity(film: StoryListItem): number {\n // Log-compress: a 100x more-watched film should not be 100x brighter.\n const watches = Math.max(0, film.watch_starts_count);\n const log = Math.log10(1 + watches);\n // Rough cap at ~6 (1M watches saturates the scale).\n return clamp01(log / 6);\n}\n\nfunction deriveScale(film: StoryListItem): number {\n // We don't have runtime in StoryListItem yet; proxy with scenes_count.\n // Caps the starfield from going visually noisy.\n const scenes = film.scenes_count ?? 1;\n return clamp01(0.25 + Math.log10(1 + scenes) / 4);\n}\n\nfunction deriveHue(film: StoryListItem): number {\n const genreKey = (film.genre ?? \"\").toLowerCase().replace(/[^a-z]/g, \"\");\n const moodKey = \"\";\n const moodHue = MOOD_HUE[moodKey];\n const genreOffset = GENRE_HUE_OFFSET[genreKey];\n if (moodHue !== undefined) return moodHue;\n if (genreOffset !== undefined) return genreOffset;\n return 210;\n}\n\nfunction deriveState(film: StoryListItem): AtomState {\n // Without per-user progress threaded through, default; the consuming\n // app will overlay state from CatalogResponse.meta.progress.\n return film.published ? \"default\" : \"new\";\n}\n\nexport const cosmosMapping: AtomMapping = (film) => ({\n position: [0, 0, 0], // assigned by the realm's spatial layouter\n scale: deriveScale(film),\n hue: deriveHue(film),\n intensity: popularityToIntensity(film),\n state: deriveState(film),\n metadata: {\n title: film.title,\n popularity: film.watch_starts_count,\n genre: film.genre,\n },\n});\n\nexport const cosmosMotion: MotionTokens = {\n flightAcceleration: 14,\n flightDamping: 0.92,\n focusEaseMs: 380,\n engageDurationMs: 900,\n backDurationMs: 900,\n};\n\nexport {\n DEFAULT_CONSTELLATION_APPEARANCE,\n mergeConstellationAppearance,\n} from \"./appearance.js\";\nexport type { ConstellationAppearance } from \"./appearance.js\";\n\nexport const cosmosAudio: AudioPalette = {\n // Asset paths are resolved by the host app's asset bundler; chuzi-shared\n // only declares the contract. Replace with CDN URLs at integration time.\n ambientLoop: \"audio/cosmos/ambient-deep.ogg\",\n focusChime: \"audio/cosmos/focus-shimmer.ogg\",\n engageImpact: \"audio/cosmos/dolly-in.ogg\",\n backWhoosh: \"audio/cosmos/dolly-out.ogg\",\n};\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -511,6 +511,43 @@ interface StoryStyleResponse {
|
|
|
511
511
|
has_style: boolean;
|
|
512
512
|
style_context: AiGeneration["style_context"] | null;
|
|
513
513
|
}
|
|
514
|
+
interface AiStoryScenePayload {
|
|
515
|
+
title: string;
|
|
516
|
+
text: string;
|
|
517
|
+
font_family: string;
|
|
518
|
+
text_color: string;
|
|
519
|
+
background_color: string;
|
|
520
|
+
scene_color: string | null;
|
|
521
|
+
}
|
|
522
|
+
interface AiStoryEstimateRequest {
|
|
523
|
+
answers: Record<string, string>;
|
|
524
|
+
}
|
|
525
|
+
interface AiStoryTokenEstimate {
|
|
526
|
+
input_tokens: number;
|
|
527
|
+
output_tokens: number;
|
|
528
|
+
credits_needed: number;
|
|
529
|
+
}
|
|
530
|
+
interface AiStoryEstimateResponse {
|
|
531
|
+
estimate: AiStoryTokenEstimate;
|
|
532
|
+
balance: CreditBalance;
|
|
533
|
+
can_afford: boolean;
|
|
534
|
+
}
|
|
535
|
+
interface AiStoryGenerateRequest {
|
|
536
|
+
answers: Record<string, string>;
|
|
537
|
+
}
|
|
538
|
+
interface AiStoryGenerationResult {
|
|
539
|
+
id: string;
|
|
540
|
+
title: string;
|
|
541
|
+
scenes: AiStoryScenePayload[];
|
|
542
|
+
input_tokens: number;
|
|
543
|
+
output_tokens: number;
|
|
544
|
+
credits_charged: number;
|
|
545
|
+
model_id: string;
|
|
546
|
+
}
|
|
547
|
+
interface AiStoryGenerateResponse {
|
|
548
|
+
generation: AiStoryGenerationResult;
|
|
549
|
+
balance: CreditBalance;
|
|
550
|
+
}
|
|
514
551
|
interface MediaItem {
|
|
515
552
|
id: string;
|
|
516
553
|
user_id: string;
|
|
@@ -644,4 +681,4 @@ declare function computeSceneVisibility(sceneList: Pick<SceneListItem, "is_title
|
|
|
644
681
|
endingSeen: boolean;
|
|
645
682
|
}): SceneVisibility[];
|
|
646
683
|
|
|
647
|
-
export { type AcceptGenerationRequest, type AcceptGenerationResponse, type AiGeneration, type AiGenerationShowResponse, type AiGenerationStatus, type BookmarkListItem, type BookmarkListResponse, type BookmarkResponse, type CatalogResponse, type ContentRating, type ContentRatingDefinition, type CreateSceneActionRequest, type CreateSceneRequest, type CreateStoryRequest, type CreditBalance, type CreditBalanceResponse, type CreditPack, type CreditPool, type EngagementResponse, type GenerateImageRequest, type GenerateImageResponse, type GrantCreditsRequest, type GrantCreditsResponse, type HistoryEntry, type LineType, type LocaleId, type MagicLinkRequest, type MagicLinkRequestResponse, type MagicLinkVerifyRequest, type MagicLinkVerifyResponse, type MediaItem, type MineResponse, type OidcExchangeRequest, type OidcExchangeResponse, type PaginatedLink, type PaginatedResponse, type PasswordLoginRequest, type PasswordLoginResponse, type PaymentMethod, type PlayUrlResponse, type PopularChoice, type PublicDirectorProfile, type PurchaseAmountRequest, type PurchaseCreditsRequest, type PurchaseCreditsResponse, type RealmConfigResponse, type RealmDefinition, type RealmId, type RegisterMediaRequest, type RegisterMediaResponse, type RejectGenerationRequest, type RejectGenerationResponse, type SaveBookmarkRequest, type SceneActionItem, type SceneActionPayload, type SceneChoice, type SceneListItem, type SceneMapEntry, type SceneMapResponse, type SceneNode, type SceneTextContent, type SceneVisibility, type SourceUrlResponse, type StateUpdate, type StorePaymentMethodRequest, type StoryListItem, type StoryPreview, type StoryProgress, type StoryStyleResponse, type TagListResponse, type TextLine, type TrackEngagementRequest, type TranscodeRequest, type TranscodeResponse, type TreeGraph, type TreeGraphEdge, type TreeGraphNode, type UpdateLocaleRequest, type UpdateLocaleResponse, type UpdateProfileRequest, type UpdateProfileResponse, type UpdateRealmRequest, type UpdateRealmResponse, type UpdateSceneActionRequest, type UpdateSceneRequest, type UpdateStoryRequest, type UploadCostResponse, type UploadUrlRequest, type UploadUrlResponse, type UserProfile, type UsernameAvailabilityResponse, type VisibilityCondition, type VisibilityRules, type WatchSnapshot, computeSceneVisibility };
|
|
684
|
+
export { type AcceptGenerationRequest, type AcceptGenerationResponse, type AiGeneration, type AiGenerationShowResponse, type AiGenerationStatus, type AiStoryEstimateRequest, type AiStoryEstimateResponse, type AiStoryGenerateRequest, type AiStoryGenerateResponse, type AiStoryGenerationResult, type AiStoryScenePayload, type AiStoryTokenEstimate, type BookmarkListItem, type BookmarkListResponse, type BookmarkResponse, type CatalogResponse, type ContentRating, type ContentRatingDefinition, type CreateSceneActionRequest, type CreateSceneRequest, type CreateStoryRequest, type CreditBalance, type CreditBalanceResponse, type CreditPack, type CreditPool, type EngagementResponse, type GenerateImageRequest, type GenerateImageResponse, type GrantCreditsRequest, type GrantCreditsResponse, type HistoryEntry, type LineType, type LocaleId, type MagicLinkRequest, type MagicLinkRequestResponse, type MagicLinkVerifyRequest, type MagicLinkVerifyResponse, type MediaItem, type MineResponse, type OidcExchangeRequest, type OidcExchangeResponse, type PaginatedLink, type PaginatedResponse, type PasswordLoginRequest, type PasswordLoginResponse, type PaymentMethod, type PlayUrlResponse, type PopularChoice, type PublicDirectorProfile, type PurchaseAmountRequest, type PurchaseCreditsRequest, type PurchaseCreditsResponse, type RealmConfigResponse, type RealmDefinition, type RealmId, type RegisterMediaRequest, type RegisterMediaResponse, type RejectGenerationRequest, type RejectGenerationResponse, type SaveBookmarkRequest, type SceneActionItem, type SceneActionPayload, type SceneChoice, type SceneListItem, type SceneMapEntry, type SceneMapResponse, type SceneNode, type SceneTextContent, type SceneVisibility, type SourceUrlResponse, type StateUpdate, type StorePaymentMethodRequest, type StoryListItem, type StoryPreview, type StoryProgress, type StoryStyleResponse, type TagListResponse, type TextLine, type TrackEngagementRequest, type TranscodeRequest, type TranscodeResponse, type TreeGraph, type TreeGraphEdge, type TreeGraphNode, type UpdateLocaleRequest, type UpdateLocaleResponse, type UpdateProfileRequest, type UpdateProfileResponse, type UpdateRealmRequest, type UpdateRealmResponse, type UpdateSceneActionRequest, type UpdateSceneRequest, type UpdateStoryRequest, type UploadCostResponse, type UploadUrlRequest, type UploadUrlResponse, type UserProfile, type UsernameAvailabilityResponse, type VisibilityCondition, type VisibilityRules, type WatchSnapshot, computeSceneVisibility };
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"names":[],"mappings":";AAyvBO,SAAS,sBAAA,CACd,WACA,IAAA,EACmB;AACnB,EAAA,IAAI,IAAA,CAAK,SAAA,IAAa,IAAA,CAAK,UAAA,EAAY;AACrC,IAAA,OAAO,SAAA,CAAU,IAAI,OAAO,EAAE,WAAW,IAAA,EAAM,MAAA,EAAQ,OAAM,CAAE,CAAA;AAAA,EACjE;AACA,EAAA,OAAO,SAAA,CAAU,GAAA,CAAI,CAAC,KAAA,MAAW;AAAA,IAC/B,WAAW,KAAA,CAAM,QAAA;AAAA,IACjB,MAAA,EAAQ,CAAC,KAAA,CAAM;AAAA,GACjB,CAAE,CAAA;AACJ","file":"index.js","sourcesContent":["// ── Auth ──\n\nexport interface MagicLinkRequest {\n email: string;\n username?: string;\n device_name?: string;\n}\n\nexport interface MagicLinkRequestResponse {\n message: string;\n}\n\nexport interface MagicLinkVerifyRequest {\n email: string;\n token: string;\n device_name?: string;\n}\n\nexport interface MagicLinkVerifyResponse {\n token?: string;\n user: UserProfile;\n}\n\nexport interface OidcExchangeRequest {\n code: string;\n code_verifier: string;\n redirect_uri: string;\n device_name?: string;\n}\n\nexport interface OidcExchangeResponse {\n token?: string;\n user: UserProfile;\n}\n\nexport interface PasswordLoginRequest {\n email: string;\n password: string;\n device_name?: string;\n}\n\nexport interface PasswordLoginResponse {\n token?: string;\n user: UserProfile;\n}\n\n// ── User ──\n\nexport interface UserProfile {\n id: string;\n name: string;\n username: string;\n email: string;\n realm: RealmId | null;\n needs_realm_choice: boolean;\n locale: LocaleId | null;\n avatar_url: string | null;\n is_admin: boolean;\n created_at: string;\n}\n\nexport interface UpdateRealmRequest {\n realm: RealmId;\n}\n\nexport interface UpdateRealmResponse {\n realm: RealmId;\n user: UserProfile;\n}\n\nexport interface UpdateProfileRequest {\n name?: string;\n username?: string;\n}\n\nexport interface UpdateProfileResponse {\n user: UserProfile;\n}\n\nexport interface UsernameAvailabilityResponse {\n username: string;\n available: boolean;\n suggestion?: string;\n}\n\nexport interface PublicDirectorProfile {\n id: string;\n name: string;\n avatar_url: string | null;\n realm: RealmId | null;\n stories_count: number;\n}\n\n// ── Credits & payments ──\n\nexport type CreditPool = \"watch\" | \"create\";\n\nexport interface CreditBalance {\n watch: number;\n create: number;\n}\n\nexport interface CreditPack {\n id: string;\n pool: CreditPool;\n name: string;\n credits: number;\n price_cents: number;\n price: string;\n}\n\nexport interface PaymentMethod {\n id: string;\n type: string;\n last_four: string;\n label: string | null;\n is_default: boolean;\n created_at: string;\n}\n\nexport interface CreditBalanceResponse {\n balance: CreditBalance;\n}\n\nexport interface UploadCostResponse {\n file_size_bytes: number;\n file_size_mb: number;\n base_size_mb: number;\n credits_needed: number;\n balance: CreditBalance;\n can_afford: boolean;\n}\n\nexport interface PurchaseCreditsRequest {\n pack_id: string;\n payment_method_id?: string;\n}\n\nexport interface PurchaseAmountRequest {\n pool: CreditPool;\n credits: number;\n payment_method_id?: string;\n}\n\nexport interface PurchaseCreditsResponse {\n message: string;\n transaction_id?: string;\n balance: CreditBalance;\n}\n\nexport interface StorePaymentMethodRequest {\n type?: string;\n last_four: string;\n label?: string;\n}\n\nexport interface GrantCreditsRequest {\n user_id: string;\n pool: CreditPool;\n amount: number;\n note?: string;\n}\n\nexport interface GrantCreditsResponse {\n message: string;\n balance: CreditBalance;\n}\n\n// ── Catalog ──\n\nexport interface StoryListItem {\n id: string;\n title: string;\n description: string | null;\n genre: string | null;\n content_rating: ContentRating | null;\n published: boolean;\n published_version: number;\n watch_starts_count: number;\n choice_clicks_count: number;\n scenes_count: number;\n choices_count: number;\n tags: string[];\n creator: {\n id: string;\n name: string;\n } | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface StoryPreview {\n source: \"trailer\" | \"title_scene\" | \"none\";\n title: string;\n preview_url: string | null;\n media_type: string | null;\n is_ready: boolean;\n}\n\nexport interface PopularChoice {\n label: string;\n click_count: number;\n}\n\nexport interface StoryProgress {\n last_scene_id: string | null;\n bookmark_code: string | null;\n playback_seconds: number;\n watched_version: number;\n last_watched_at: string | null;\n}\n\nexport interface CatalogResponse {\n data: StoryListItem[];\n meta: {\n previews: Record<string, StoryPreview>;\n popular_choices: Record<string, PopularChoice[]>;\n creator_avatars: Record<string, string>;\n coverboxes: Record<string, string | null>;\n progress: Record<string, StoryProgress>;\n };\n}\n\nexport interface MineResponse {\n stories: StoryListItem[];\n data?: StoryListItem[];\n progress?: Record<string, StoryProgress>;\n meta: {\n coverboxes: Record<string, string | null>;\n };\n}\n\n// ── Watch / Scene Map ──\n\nexport interface SceneChoice {\n id: string;\n label: string;\n choice_type: string;\n choice_icon: string | null;\n choice_icon_media_id: string | null;\n choice_icon_url: string | null;\n reveal_mode: string;\n start_time_seconds: number | null;\n pause_for_choice: boolean;\n end_time_seconds: number | null;\n target_scene_id: string;\n x: number;\n y: number;\n w: number;\n h: number;\n arrow_rotation: number;\n arrow_scale: number;\n fade_in_ms?: number | null;\n fade_out_ms?: number | null;\n duration_ms?: number | null;\n visibility_rules: VisibilityRules | null;\n state_updates: StateUpdate[];\n}\n\nexport interface VisibilityRules {\n mode: \"all\" | \"any\";\n conditions: VisibilityCondition[];\n}\n\nexport interface VisibilityCondition {\n variable?: string;\n key?: string;\n operator?: string;\n value?: string;\n}\n\nexport interface StateUpdate {\n variable?: string;\n key?: string;\n action?: string;\n value?: string;\n}\n\nexport interface SceneNode {\n type: string;\n properties?: Record<string, unknown>;\n children?: SceneNode[];\n}\n\nexport type SceneActionPayload = Record<string, unknown> | unknown[];\n\nexport interface SceneMapEntry {\n scene_id: string;\n scene_title: string;\n color: string | null;\n is_title: boolean;\n media_title: string | null;\n media_type: string | null;\n media_url: string | null;\n stream_status: string | null;\n choice_style: string;\n choice_overlay_mode: string;\n goto_scene_id: string | null;\n choices: SceneChoice[];\n nodes: SceneNode[];\n}\n\nexport interface TreeGraphNode {\n id: string;\n title: string;\n is_title: boolean;\n is_end: boolean;\n level: number;\n index: number;\n x: number;\n y: number;\n color: string | null;\n}\n\nexport interface TreeGraphEdge {\n id: string;\n source: string;\n target: string;\n type: \"choice\" | \"go_to_scene\";\n}\n\nexport interface TreeGraph {\n nodes: TreeGraphNode[];\n edges: TreeGraphEdge[];\n meta: {\n root_id: string | null;\n level_count: number;\n };\n}\n\nexport interface WatchSnapshot {\n scene_id: string | null;\n state: Record<string, string>;\n history: HistoryEntry[];\n path: string[];\n visited_scene_ids?: string[];\n playback_seconds: number;\n}\n\nexport interface HistoryEntry {\n choice_id: string;\n scene_id: string;\n target_scene_id: string | null;\n at: string | null;\n path_index: number | null;\n}\n\nexport interface SceneMapResponse {\n story: {\n id: string;\n title: string;\n description: string | null;\n genre: string | null;\n content_rating: ContentRating | null;\n published_version: number;\n watch_starts_count: number;\n choice_clicks_count: number;\n };\n start_scene_id: string;\n scene_map: Record<string, SceneMapEntry>;\n tree_graph: TreeGraph;\n initial_snapshot: WatchSnapshot;\n initial_bookmark_code: string | null;\n}\n\n// ── Engagement ──\n\nexport interface TrackEngagementRequest {\n event: \"play_start\" | \"choice_click\";\n choice_id?: string;\n}\n\nexport interface EngagementResponse {\n watch_starts_count: number;\n choice_clicks_count: number;\n}\n\n// ── Bookmarks ──\n\nexport interface SaveBookmarkRequest {\n snapshot: WatchSnapshot;\n}\n\nexport interface BookmarkResponse {\n code: string;\n snapshot: WatchSnapshot;\n}\n\nexport interface BookmarkListItem {\n code: string;\n snapshot: WatchSnapshot;\n updated_at: string;\n}\n\nexport interface BookmarkListResponse {\n bookmarks: BookmarkListItem[];\n}\n\n// ── Pagination ──\n\nexport interface PaginatedLink {\n url: string | null;\n label: string;\n active: boolean;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n current_page: number;\n first_page_url: string;\n from: number | null;\n last_page: number;\n last_page_url: string;\n links: PaginatedLink[];\n next_page_url: string | null;\n path: string;\n per_page: number;\n prev_page_url: string | null;\n to: number | null;\n total: number;\n}\n\n// ── Scenes ──\n\nexport type LineType = \"text\" | \"sound\" | \"image\";\n\nexport interface TextLine {\n id: string;\n type?: LineType;\n media_id?: string;\n html: string;\n appear_at_ms: number;\n fade_in_ms: number;\n fade_out_ms: number;\n duration_ms: number;\n position_x?: number;\n position_y?: number;\n width_pct?: number;\n height_pct?: number;\n persist?: boolean;\n}\n\nexport interface SceneTextContent {\n html: string;\n lines?: TextLine[];\n}\n\nexport interface SceneListItem {\n id: string;\n story_id: string;\n title: string;\n order: number;\n is_title: boolean;\n is_end: boolean;\n color: string | null;\n media_id: string | null;\n alt_media_id: string | null;\n media_mode: \"text\" | \"imagery\" | \"film\" | null;\n text_content: SceneTextContent | null;\n text_style: {\n font_family?: string | null;\n text_color?: string | null;\n background_color?: string | null;\n } | null;\n goto_scene_id?: string | null;\n choice_end_time_seconds?: number | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface UpdateSceneRequest {\n title?: string;\n order?: number;\n media_id?: string | null;\n alt_media_id?: string | null;\n media_mode?: \"text\" | \"imagery\" | \"film\" | null;\n text_content?: SceneTextContent | null;\n text_style?: {\n font_family?: string | null;\n text_color?: string | null;\n background_color?: string | null;\n } | null;\n color?: string | null;\n is_title?: boolean;\n is_end?: boolean;\n goto_scene_id?: string | null;\n choice_style?: string | null;\n choice_overlay_mode?: string | null;\n choice_reveal_mode?: string | null;\n choice_start_time_seconds?: number | null;\n choice_pause_for_choice?: boolean;\n choice_end_time_seconds?: number | null;\n}\n\nexport interface CreateSceneRequest {\n story_id: string;\n title: string;\n order?: number;\n is_title?: boolean;\n is_end?: boolean;\n}\n\nexport interface SceneActionItem {\n id: string;\n scene_id: string;\n name: string;\n type: string | null;\n scene_choice_id: string | null;\n order: number;\n duration: number;\n properties: SceneActionPayload | null;\n subproperties: SceneActionPayload | null;\n created_at?: string;\n updated_at?: string;\n}\n\nexport interface CreateSceneActionRequest {\n scene_id: string;\n name: string;\n type?: string | null;\n order?: number;\n duration?: number;\n properties?: SceneActionPayload | null;\n subproperties?: SceneActionPayload | null;\n}\n\nexport interface UpdateSceneActionRequest {\n name?: string;\n type?: string | null;\n order?: number;\n duration?: number;\n properties?: SceneActionPayload;\n subproperties?: SceneActionPayload;\n}\n\n// ── AI Generation ──\n\nexport type AiGenerationStatus =\n | \"pending\"\n | \"generating\"\n | \"ready\"\n | \"failed\"\n | \"accepted\"\n | \"rejected\";\n\nexport interface GenerateImageRequest {\n story_id: string;\n scene_id?: string;\n prompt: string;\n mood?: string;\n visual_style?: string;\n rejection_feedback?: string;\n previous_generation_id?: string;\n}\n\nexport interface AiGeneration {\n id: string;\n story_id: string;\n scene_id: string | null;\n status: AiGenerationStatus;\n user_prompt: string;\n style_context: {\n mood?: string;\n visual_style?: string;\n subject_prompt: string;\n full_prompt: string;\n negative_prompt?: string;\n };\n preview_url?: string;\n rejection_feedback: string | null;\n media_id: string | null;\n attempt_number: number;\n credits_charged: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface GenerateImageResponse {\n generation: AiGeneration;\n balance: { watch: number; create: number };\n}\n\nexport interface AiGenerationShowResponse {\n generation: AiGeneration;\n}\n\nexport interface AcceptGenerationRequest {\n scene_id: string;\n}\n\nexport interface AcceptGenerationResponse {\n generation: AiGeneration;\n scene: SceneListItem;\n media: MediaItem;\n}\n\nexport interface RejectGenerationRequest {\n feedback: string;\n}\n\nexport interface RejectGenerationResponse {\n generation: AiGeneration;\n}\n\nexport interface StoryStyleResponse {\n has_style: boolean;\n style_context: AiGeneration[\"style_context\"] | null;\n}\n\n// ── Media ──\n\nexport interface MediaItem {\n id: string;\n user_id: string;\n s3_key: string;\n source_path: string;\n output_prefix: string | null;\n status: \"uploaded\" | \"processing\" | \"ready\" | \"error\";\n meta: Record<string, unknown>;\n order: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface UploadUrlRequest {\n filename: string;\n contentType: string;\n}\n\nexport interface UploadUrlResponse {\n key: string;\n uploadUrl: string;\n}\n\nexport interface RegisterMediaRequest {\n key: string;\n s3_key: string;\n filename: string;\n content_type?: string;\n title?: string;\n file_size?: number;\n}\n\nexport interface RegisterMediaResponse extends MediaItem {\n credits_charged: number;\n balance: number;\n}\n\nexport interface TranscodeRequest {\n media_id: string;\n}\n\nexport interface TranscodeResponse {\n message: string;\n job_id: string | null;\n manifest_path?: string;\n}\n\nexport interface PlayUrlResponse {\n play_url: string;\n status: string;\n}\n\nexport interface SourceUrlResponse {\n url: string;\n}\n\n// ── Story authoring ──\n\nexport interface CreateStoryRequest {\n title: string;\n description?: string | null;\n genre?: string | null;\n content_rating?: ContentRating | null;\n}\n\nexport interface UpdateStoryRequest {\n title?: string;\n description?: string | null;\n genre?: string | null;\n content_rating?: ContentRating | null;\n published?: boolean;\n tags?: string[];\n}\n\nexport interface TagListResponse {\n data: string[];\n}\n\n// ── Content Ratings ──\n\nexport type ContentRating = \"G\" | \"PG\" | \"PG-13\" | \"R\" | \"NC-17\";\n\nexport interface ContentRatingDefinition {\n id: ContentRating;\n label: string;\n description: string;\n}\n\n// ── Realm Config ──\n\nexport type RealmId = \"cosmos\" | \"wilds\";\n\n/** Supported UI locales — matches PHP `chuzi_realms.supported_locales`. */\nexport type LocaleId = \"en\" | \"es\" | \"fr\" | \"de\" | \"pt\";\n\nexport interface RealmDefinition {\n label: string;\n short_label: string;\n /** Canonical English lexicon (always present). */\n lexicon: Record<string, string>;\n /** Optional per-locale overrides; missing keys fall through to `lexicon`. */\n locales?: Partial<Record<LocaleId, Record<string, string>>>;\n}\n\nexport interface RealmConfigResponse {\n realms: Record<RealmId, RealmDefinition>;\n fallback_lexicon: Record<string, string>;\n fallback_locales?: Partial<Record<LocaleId, Record<string, string>>>;\n intro: {\n line1: string;\n line2: string;\n };\n intro_locales?: Partial<Record<LocaleId, { line1: string; line2: string }>>;\n profile: {\n title: string;\n current_prefix: string;\n switch_prompt: string;\n };\n profile_locales?: Partial<Record<LocaleId, { title: string; current_prefix: string; switch_prompt: string }>>;\n allowed_realm_ids: RealmId[];\n supported_locales: LocaleId[];\n locale_labels?: Partial<Record<LocaleId, string>>;\n}\n\nexport interface UpdateLocaleRequest {\n locale: LocaleId;\n}\n\nexport interface UpdateLocaleResponse {\n locale: LocaleId;\n}\n\n// ── Scene Visibility ──\n\nexport interface SceneVisibility {\n /** Whether the user can navigate to this scene-star. */\n navigable: boolean;\n /** Whether the star/edge should render at reduced opacity. */\n dimmed: boolean;\n}\n\n/**\n * Compute per-scene navigable/dimmed flags for a constellation.\n *\n * Rules:\n * - If `isCreator` is true, everything is navigable and bright.\n * - Title scenes are always navigable and bright.\n * - If the user has watched the ending (`endingSeen`), all scenes unlock.\n * - Otherwise non-title scenes are locked and dimmed.\n */\nexport function computeSceneVisibility(\n sceneList: Pick<SceneListItem, \"is_title\" | \"is_end\">[],\n opts: { isCreator: boolean; endingSeen: boolean },\n): SceneVisibility[] {\n if (opts.isCreator || opts.endingSeen) {\n return sceneList.map(() => ({ navigable: true, dimmed: false }));\n }\n return sceneList.map((scene) => ({\n navigable: scene.is_title,\n dimmed: !scene.is_title,\n }));\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"names":[],"mappings":";AAuyBO,SAAS,sBAAA,CACd,WACA,IAAA,EACmB;AACnB,EAAA,IAAI,IAAA,CAAK,SAAA,IAAa,IAAA,CAAK,UAAA,EAAY;AACrC,IAAA,OAAO,SAAA,CAAU,IAAI,OAAO,EAAE,WAAW,IAAA,EAAM,MAAA,EAAQ,OAAM,CAAE,CAAA;AAAA,EACjE;AACA,EAAA,OAAO,SAAA,CAAU,GAAA,CAAI,CAAC,KAAA,MAAW;AAAA,IAC/B,WAAW,KAAA,CAAM,QAAA;AAAA,IACjB,MAAA,EAAQ,CAAC,KAAA,CAAM;AAAA,GACjB,CAAE,CAAA;AACJ","file":"index.js","sourcesContent":["// ── Auth ──\n\nexport interface MagicLinkRequest {\n email: string;\n username?: string;\n device_name?: string;\n}\n\nexport interface MagicLinkRequestResponse {\n message: string;\n}\n\nexport interface MagicLinkVerifyRequest {\n email: string;\n token: string;\n device_name?: string;\n}\n\nexport interface MagicLinkVerifyResponse {\n token?: string;\n user: UserProfile;\n}\n\nexport interface OidcExchangeRequest {\n code: string;\n code_verifier: string;\n redirect_uri: string;\n device_name?: string;\n}\n\nexport interface OidcExchangeResponse {\n token?: string;\n user: UserProfile;\n}\n\nexport interface PasswordLoginRequest {\n email: string;\n password: string;\n device_name?: string;\n}\n\nexport interface PasswordLoginResponse {\n token?: string;\n user: UserProfile;\n}\n\n// ── User ──\n\nexport interface UserProfile {\n id: string;\n name: string;\n username: string;\n email: string;\n realm: RealmId | null;\n needs_realm_choice: boolean;\n locale: LocaleId | null;\n avatar_url: string | null;\n is_admin: boolean;\n created_at: string;\n}\n\nexport interface UpdateRealmRequest {\n realm: RealmId;\n}\n\nexport interface UpdateRealmResponse {\n realm: RealmId;\n user: UserProfile;\n}\n\nexport interface UpdateProfileRequest {\n name?: string;\n username?: string;\n}\n\nexport interface UpdateProfileResponse {\n user: UserProfile;\n}\n\nexport interface UsernameAvailabilityResponse {\n username: string;\n available: boolean;\n suggestion?: string;\n}\n\nexport interface PublicDirectorProfile {\n id: string;\n name: string;\n avatar_url: string | null;\n realm: RealmId | null;\n stories_count: number;\n}\n\n// ── Credits & payments ──\n\nexport type CreditPool = \"watch\" | \"create\";\n\nexport interface CreditBalance {\n watch: number;\n create: number;\n}\n\nexport interface CreditPack {\n id: string;\n pool: CreditPool;\n name: string;\n credits: number;\n price_cents: number;\n price: string;\n}\n\nexport interface PaymentMethod {\n id: string;\n type: string;\n last_four: string;\n label: string | null;\n is_default: boolean;\n created_at: string;\n}\n\nexport interface CreditBalanceResponse {\n balance: CreditBalance;\n}\n\nexport interface UploadCostResponse {\n file_size_bytes: number;\n file_size_mb: number;\n base_size_mb: number;\n credits_needed: number;\n balance: CreditBalance;\n can_afford: boolean;\n}\n\nexport interface PurchaseCreditsRequest {\n pack_id: string;\n payment_method_id?: string;\n}\n\nexport interface PurchaseAmountRequest {\n pool: CreditPool;\n credits: number;\n payment_method_id?: string;\n}\n\nexport interface PurchaseCreditsResponse {\n message: string;\n transaction_id?: string;\n balance: CreditBalance;\n}\n\nexport interface StorePaymentMethodRequest {\n type?: string;\n last_four: string;\n label?: string;\n}\n\nexport interface GrantCreditsRequest {\n user_id: string;\n pool: CreditPool;\n amount: number;\n note?: string;\n}\n\nexport interface GrantCreditsResponse {\n message: string;\n balance: CreditBalance;\n}\n\n// ── Catalog ──\n\nexport interface StoryListItem {\n id: string;\n title: string;\n description: string | null;\n genre: string | null;\n content_rating: ContentRating | null;\n published: boolean;\n published_version: number;\n watch_starts_count: number;\n choice_clicks_count: number;\n scenes_count: number;\n choices_count: number;\n tags: string[];\n creator: {\n id: string;\n name: string;\n } | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface StoryPreview {\n source: \"trailer\" | \"title_scene\" | \"none\";\n title: string;\n preview_url: string | null;\n media_type: string | null;\n is_ready: boolean;\n}\n\nexport interface PopularChoice {\n label: string;\n click_count: number;\n}\n\nexport interface StoryProgress {\n last_scene_id: string | null;\n bookmark_code: string | null;\n playback_seconds: number;\n watched_version: number;\n last_watched_at: string | null;\n}\n\nexport interface CatalogResponse {\n data: StoryListItem[];\n meta: {\n previews: Record<string, StoryPreview>;\n popular_choices: Record<string, PopularChoice[]>;\n creator_avatars: Record<string, string>;\n coverboxes: Record<string, string | null>;\n progress: Record<string, StoryProgress>;\n };\n}\n\nexport interface MineResponse {\n stories: StoryListItem[];\n data?: StoryListItem[];\n progress?: Record<string, StoryProgress>;\n meta: {\n coverboxes: Record<string, string | null>;\n };\n}\n\n// ── Watch / Scene Map ──\n\nexport interface SceneChoice {\n id: string;\n label: string;\n choice_type: string;\n choice_icon: string | null;\n choice_icon_media_id: string | null;\n choice_icon_url: string | null;\n reveal_mode: string;\n start_time_seconds: number | null;\n pause_for_choice: boolean;\n end_time_seconds: number | null;\n target_scene_id: string;\n x: number;\n y: number;\n w: number;\n h: number;\n arrow_rotation: number;\n arrow_scale: number;\n fade_in_ms?: number | null;\n fade_out_ms?: number | null;\n duration_ms?: number | null;\n visibility_rules: VisibilityRules | null;\n state_updates: StateUpdate[];\n}\n\nexport interface VisibilityRules {\n mode: \"all\" | \"any\";\n conditions: VisibilityCondition[];\n}\n\nexport interface VisibilityCondition {\n variable?: string;\n key?: string;\n operator?: string;\n value?: string;\n}\n\nexport interface StateUpdate {\n variable?: string;\n key?: string;\n action?: string;\n value?: string;\n}\n\nexport interface SceneNode {\n type: string;\n properties?: Record<string, unknown>;\n children?: SceneNode[];\n}\n\nexport type SceneActionPayload = Record<string, unknown> | unknown[];\n\nexport interface SceneMapEntry {\n scene_id: string;\n scene_title: string;\n color: string | null;\n is_title: boolean;\n media_title: string | null;\n media_type: string | null;\n media_url: string | null;\n stream_status: string | null;\n choice_style: string;\n choice_overlay_mode: string;\n goto_scene_id: string | null;\n choices: SceneChoice[];\n nodes: SceneNode[];\n}\n\nexport interface TreeGraphNode {\n id: string;\n title: string;\n is_title: boolean;\n is_end: boolean;\n level: number;\n index: number;\n x: number;\n y: number;\n color: string | null;\n}\n\nexport interface TreeGraphEdge {\n id: string;\n source: string;\n target: string;\n type: \"choice\" | \"go_to_scene\";\n}\n\nexport interface TreeGraph {\n nodes: TreeGraphNode[];\n edges: TreeGraphEdge[];\n meta: {\n root_id: string | null;\n level_count: number;\n };\n}\n\nexport interface WatchSnapshot {\n scene_id: string | null;\n state: Record<string, string>;\n history: HistoryEntry[];\n path: string[];\n visited_scene_ids?: string[];\n playback_seconds: number;\n}\n\nexport interface HistoryEntry {\n choice_id: string;\n scene_id: string;\n target_scene_id: string | null;\n at: string | null;\n path_index: number | null;\n}\n\nexport interface SceneMapResponse {\n story: {\n id: string;\n title: string;\n description: string | null;\n genre: string | null;\n content_rating: ContentRating | null;\n published_version: number;\n watch_starts_count: number;\n choice_clicks_count: number;\n };\n start_scene_id: string;\n scene_map: Record<string, SceneMapEntry>;\n tree_graph: TreeGraph;\n initial_snapshot: WatchSnapshot;\n initial_bookmark_code: string | null;\n}\n\n// ── Engagement ──\n\nexport interface TrackEngagementRequest {\n event: \"play_start\" | \"choice_click\";\n choice_id?: string;\n}\n\nexport interface EngagementResponse {\n watch_starts_count: number;\n choice_clicks_count: number;\n}\n\n// ── Bookmarks ──\n\nexport interface SaveBookmarkRequest {\n snapshot: WatchSnapshot;\n}\n\nexport interface BookmarkResponse {\n code: string;\n snapshot: WatchSnapshot;\n}\n\nexport interface BookmarkListItem {\n code: string;\n snapshot: WatchSnapshot;\n updated_at: string;\n}\n\nexport interface BookmarkListResponse {\n bookmarks: BookmarkListItem[];\n}\n\n// ── Pagination ──\n\nexport interface PaginatedLink {\n url: string | null;\n label: string;\n active: boolean;\n}\n\nexport interface PaginatedResponse<T> {\n data: T[];\n current_page: number;\n first_page_url: string;\n from: number | null;\n last_page: number;\n last_page_url: string;\n links: PaginatedLink[];\n next_page_url: string | null;\n path: string;\n per_page: number;\n prev_page_url: string | null;\n to: number | null;\n total: number;\n}\n\n// ── Scenes ──\n\nexport type LineType = \"text\" | \"sound\" | \"image\";\n\nexport interface TextLine {\n id: string;\n type?: LineType;\n media_id?: string;\n html: string;\n appear_at_ms: number;\n fade_in_ms: number;\n fade_out_ms: number;\n duration_ms: number;\n position_x?: number;\n position_y?: number;\n width_pct?: number;\n height_pct?: number;\n persist?: boolean;\n}\n\nexport interface SceneTextContent {\n html: string;\n lines?: TextLine[];\n}\n\nexport interface SceneListItem {\n id: string;\n story_id: string;\n title: string;\n order: number;\n is_title: boolean;\n is_end: boolean;\n color: string | null;\n media_id: string | null;\n alt_media_id: string | null;\n media_mode: \"text\" | \"imagery\" | \"film\" | null;\n text_content: SceneTextContent | null;\n text_style: {\n font_family?: string | null;\n text_color?: string | null;\n background_color?: string | null;\n } | null;\n goto_scene_id?: string | null;\n choice_end_time_seconds?: number | null;\n created_at: string;\n updated_at: string;\n}\n\nexport interface UpdateSceneRequest {\n title?: string;\n order?: number;\n media_id?: string | null;\n alt_media_id?: string | null;\n media_mode?: \"text\" | \"imagery\" | \"film\" | null;\n text_content?: SceneTextContent | null;\n text_style?: {\n font_family?: string | null;\n text_color?: string | null;\n background_color?: string | null;\n } | null;\n color?: string | null;\n is_title?: boolean;\n is_end?: boolean;\n goto_scene_id?: string | null;\n choice_style?: string | null;\n choice_overlay_mode?: string | null;\n choice_reveal_mode?: string | null;\n choice_start_time_seconds?: number | null;\n choice_pause_for_choice?: boolean;\n choice_end_time_seconds?: number | null;\n}\n\nexport interface CreateSceneRequest {\n story_id: string;\n title: string;\n order?: number;\n is_title?: boolean;\n is_end?: boolean;\n}\n\nexport interface SceneActionItem {\n id: string;\n scene_id: string;\n name: string;\n type: string | null;\n scene_choice_id: string | null;\n order: number;\n duration: number;\n properties: SceneActionPayload | null;\n subproperties: SceneActionPayload | null;\n created_at?: string;\n updated_at?: string;\n}\n\nexport interface CreateSceneActionRequest {\n scene_id: string;\n name: string;\n type?: string | null;\n order?: number;\n duration?: number;\n properties?: SceneActionPayload | null;\n subproperties?: SceneActionPayload | null;\n}\n\nexport interface UpdateSceneActionRequest {\n name?: string;\n type?: string | null;\n order?: number;\n duration?: number;\n properties?: SceneActionPayload;\n subproperties?: SceneActionPayload;\n}\n\n// ── AI Generation ──\n\nexport type AiGenerationStatus =\n | \"pending\"\n | \"generating\"\n | \"ready\"\n | \"failed\"\n | \"accepted\"\n | \"rejected\";\n\nexport interface GenerateImageRequest {\n story_id: string;\n scene_id?: string;\n prompt: string;\n mood?: string;\n visual_style?: string;\n rejection_feedback?: string;\n previous_generation_id?: string;\n}\n\nexport interface AiGeneration {\n id: string;\n story_id: string;\n scene_id: string | null;\n status: AiGenerationStatus;\n user_prompt: string;\n style_context: {\n mood?: string;\n visual_style?: string;\n subject_prompt: string;\n full_prompt: string;\n negative_prompt?: string;\n };\n preview_url?: string;\n rejection_feedback: string | null;\n media_id: string | null;\n attempt_number: number;\n credits_charged: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface GenerateImageResponse {\n generation: AiGeneration;\n balance: { watch: number; create: number };\n}\n\nexport interface AiGenerationShowResponse {\n generation: AiGeneration;\n}\n\nexport interface AcceptGenerationRequest {\n scene_id: string;\n}\n\nexport interface AcceptGenerationResponse {\n generation: AiGeneration;\n scene: SceneListItem;\n media: MediaItem;\n}\n\nexport interface RejectGenerationRequest {\n feedback: string;\n}\n\nexport interface RejectGenerationResponse {\n generation: AiGeneration;\n}\n\nexport interface StoryStyleResponse {\n has_style: boolean;\n style_context: AiGeneration[\"style_context\"] | null;\n}\n\n// ── Chuzi AI (Bedrock short-story generation) ──\n\nexport interface AiStoryScenePayload {\n title: string;\n text: string;\n font_family: string;\n text_color: string;\n background_color: string;\n scene_color: string | null;\n}\n\nexport interface AiStoryEstimateRequest {\n answers: Record<string, string>;\n}\n\nexport interface AiStoryTokenEstimate {\n input_tokens: number;\n output_tokens: number;\n credits_needed: number;\n}\n\nexport interface AiStoryEstimateResponse {\n estimate: AiStoryTokenEstimate;\n balance: CreditBalance;\n can_afford: boolean;\n}\n\nexport interface AiStoryGenerateRequest {\n answers: Record<string, string>;\n}\n\nexport interface AiStoryGenerationResult {\n id: string;\n title: string;\n scenes: AiStoryScenePayload[];\n input_tokens: number;\n output_tokens: number;\n credits_charged: number;\n model_id: string;\n}\n\nexport interface AiStoryGenerateResponse {\n generation: AiStoryGenerationResult;\n balance: CreditBalance;\n}\n\n// ── Media ──\n\nexport interface MediaItem {\n id: string;\n user_id: string;\n s3_key: string;\n source_path: string;\n output_prefix: string | null;\n status: \"uploaded\" | \"processing\" | \"ready\" | \"error\";\n meta: Record<string, unknown>;\n order: number;\n created_at: string;\n updated_at: string;\n}\n\nexport interface UploadUrlRequest {\n filename: string;\n contentType: string;\n}\n\nexport interface UploadUrlResponse {\n key: string;\n uploadUrl: string;\n}\n\nexport interface RegisterMediaRequest {\n key: string;\n s3_key: string;\n filename: string;\n content_type?: string;\n title?: string;\n file_size?: number;\n}\n\nexport interface RegisterMediaResponse extends MediaItem {\n credits_charged: number;\n balance: number;\n}\n\nexport interface TranscodeRequest {\n media_id: string;\n}\n\nexport interface TranscodeResponse {\n message: string;\n job_id: string | null;\n manifest_path?: string;\n}\n\nexport interface PlayUrlResponse {\n play_url: string;\n status: string;\n}\n\nexport interface SourceUrlResponse {\n url: string;\n}\n\n// ── Story authoring ──\n\nexport interface CreateStoryRequest {\n title: string;\n description?: string | null;\n genre?: string | null;\n content_rating?: ContentRating | null;\n}\n\nexport interface UpdateStoryRequest {\n title?: string;\n description?: string | null;\n genre?: string | null;\n content_rating?: ContentRating | null;\n published?: boolean;\n tags?: string[];\n}\n\nexport interface TagListResponse {\n data: string[];\n}\n\n// ── Content Ratings ──\n\nexport type ContentRating = \"G\" | \"PG\" | \"PG-13\" | \"R\" | \"NC-17\";\n\nexport interface ContentRatingDefinition {\n id: ContentRating;\n label: string;\n description: string;\n}\n\n// ── Realm Config ──\n\nexport type RealmId = \"cosmos\" | \"wilds\";\n\n/** Supported UI locales — matches PHP `chuzi_realms.supported_locales`. */\nexport type LocaleId = \"en\" | \"es\" | \"fr\" | \"de\" | \"pt\";\n\nexport interface RealmDefinition {\n label: string;\n short_label: string;\n /** Canonical English lexicon (always present). */\n lexicon: Record<string, string>;\n /** Optional per-locale overrides; missing keys fall through to `lexicon`. */\n locales?: Partial<Record<LocaleId, Record<string, string>>>;\n}\n\nexport interface RealmConfigResponse {\n realms: Record<RealmId, RealmDefinition>;\n fallback_lexicon: Record<string, string>;\n fallback_locales?: Partial<Record<LocaleId, Record<string, string>>>;\n intro: {\n line1: string;\n line2: string;\n };\n intro_locales?: Partial<Record<LocaleId, { line1: string; line2: string }>>;\n profile: {\n title: string;\n current_prefix: string;\n switch_prompt: string;\n };\n profile_locales?: Partial<Record<LocaleId, { title: string; current_prefix: string; switch_prompt: string }>>;\n allowed_realm_ids: RealmId[];\n supported_locales: LocaleId[];\n locale_labels?: Partial<Record<LocaleId, string>>;\n}\n\nexport interface UpdateLocaleRequest {\n locale: LocaleId;\n}\n\nexport interface UpdateLocaleResponse {\n locale: LocaleId;\n}\n\n// ── Scene Visibility ──\n\nexport interface SceneVisibility {\n /** Whether the user can navigate to this scene-star. */\n navigable: boolean;\n /** Whether the star/edge should render at reduced opacity. */\n dimmed: boolean;\n}\n\n/**\n * Compute per-scene navigable/dimmed flags for a constellation.\n *\n * Rules:\n * - If `isCreator` is true, everything is navigable and bright.\n * - Title scenes are always navigable and bright.\n * - If the user has watched the ending (`endingSeen`), all scenes unlock.\n * - Otherwise non-title scenes are locked and dimmed.\n */\nexport function computeSceneVisibility(\n sceneList: Pick<SceneListItem, \"is_title\" | \"is_end\">[],\n opts: { isCreator: boolean; endingSeen: boolean },\n): SceneVisibility[] {\n if (opts.isCreator || opts.endingSeen) {\n return sceneList.map(() => ({ navigable: true, dimmed: false }));\n }\n return sceneList.map((scene) => ({\n navigable: scene.is_title,\n dimmed: !scene.is_title,\n }));\n}\n"]}
|