astraeus 0.7.0 → 0.8.1

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.
Files changed (287) hide show
  1. package/CHANGELOG.md +189 -0
  2. package/README.md +202 -38
  3. package/data/ephemerides/planets/planets.json +1 -1
  4. package/package.json +5 -4
  5. package/src/api/AstraeusScene.d.ts +21 -5
  6. package/src/api/AstraeusScene.js +34 -10
  7. package/src/api/AstraeusScene.node.js +34 -10
  8. package/src/api/assembleScene.d.ts +36 -0
  9. package/src/api/assembleScene.js +175 -0
  10. package/src/api/bodySetChecks.d.ts +10 -0
  11. package/src/api/bodySetChecks.js +117 -0
  12. package/src/api/bodySetInput.d.ts +81 -0
  13. package/src/api/bodySetInput.js +1 -0
  14. package/src/api/containingBlock.d.ts +6 -0
  15. package/src/api/containingBlock.js +16 -0
  16. package/src/api/data.d.ts +17 -5
  17. package/src/api/data.js +28 -10
  18. package/src/api/definitionOf.d.ts +16 -0
  19. package/src/api/definitionOf.js +20 -0
  20. package/src/api/errors.d.ts +63 -1
  21. package/src/api/frozenCopy.d.ts +6 -0
  22. package/src/api/frozenCopy.js +26 -0
  23. package/src/api/group.d.ts +8 -2
  24. package/src/api/group.js +24 -5
  25. package/src/api/index.d.ts +18 -7
  26. package/src/api/index.js +2 -2
  27. package/src/api/index.node.js +2 -2
  28. package/src/api/listeners.d.ts +5 -0
  29. package/src/api/listeners.js +25 -0
  30. package/src/api/look.d.ts +47 -0
  31. package/src/api/look.js +1 -0
  32. package/src/api/lookInput.d.ts +3 -0
  33. package/src/api/lookInput.js +41 -0
  34. package/src/api/moonPanelInput.d.ts +60 -0
  35. package/src/api/moonPanelInput.js +1 -0
  36. package/src/api/mount.d.ts +9 -19
  37. package/src/api/mount.js +27 -13
  38. package/src/api/mount.node.js +27 -13
  39. package/src/api/pathProvenance.js +1 -1
  40. package/src/api/pickerInput.d.ts +25 -0
  41. package/src/api/pickerInput.js +1 -0
  42. package/src/api/planBodies.d.ts +72 -0
  43. package/src/api/planBodies.js +300 -0
  44. package/src/api/planBodySets.d.ts +68 -0
  45. package/src/api/planBodySets.js +234 -0
  46. package/src/api/planCamera.d.ts +83 -0
  47. package/src/api/planCamera.js +184 -0
  48. package/src/api/planGroups.d.ts +36 -0
  49. package/src/api/planGroups.js +103 -0
  50. package/src/api/planMoonPanel.d.ts +19 -0
  51. package/src/api/planMoonPanel.js +104 -0
  52. package/src/api/planPaths.d.ts +40 -0
  53. package/src/api/planPaths.js +212 -0
  54. package/src/api/planPicker.d.ts +12 -0
  55. package/src/api/planPicker.js +40 -0
  56. package/src/api/planPlaces.d.ts +16 -0
  57. package/src/api/planPlaces.js +99 -0
  58. package/src/api/planStory.d.ts +26 -0
  59. package/src/api/planStory.js +66 -0
  60. package/src/api/planTimeline.d.ts +27 -0
  61. package/src/api/planTimeline.js +68 -0
  62. package/src/api/planViews.d.ts +25 -0
  63. package/src/api/planViews.js +35 -0
  64. package/src/api/prepared.js +4 -1
  65. package/src/api/renamedInputs.d.ts +15 -0
  66. package/src/api/renamedInputs.js +39 -0
  67. package/src/api/scene.d.ts +162 -68
  68. package/src/api/scene.js +247 -793
  69. package/src/api/sceneFreeze.d.ts +4 -0
  70. package/src/api/sceneFreeze.js +10 -0
  71. package/src/api/sceneReads.d.ts +171 -0
  72. package/src/api/sceneReads.js +6 -0
  73. package/src/api/story.d.ts +49 -19
  74. package/src/api/story.js +54 -22
  75. package/src/api/sunOrbit.js +9 -11
  76. package/src/api/time.d.ts +2 -1
  77. package/src/api/time.js +2 -1
  78. package/src/api/viewerCamera.d.ts +22 -0
  79. package/src/api/viewerCamera.js +84 -0
  80. package/src/api/viewerClock.d.ts +30 -0
  81. package/src/api/viewerClock.js +85 -0
  82. package/src/api/viewerFirstDraw.d.ts +14 -0
  83. package/src/api/viewerFirstDraw.js +26 -0
  84. package/src/api/viewerHandle.d.ts +85 -0
  85. package/src/api/viewerHandle.js +32 -0
  86. package/src/api/viewerLink.d.ts +88 -15
  87. package/src/api/viewerLink.js +117 -75
  88. package/src/api/viewerLooks.d.ts +19 -0
  89. package/src/api/viewerLooks.js +37 -0
  90. package/src/api/viewerPicker.d.ts +22 -0
  91. package/src/api/viewerPicker.js +49 -0
  92. package/src/api/viewerSelection.d.ts +30 -0
  93. package/src/api/viewerSelection.js +46 -0
  94. package/src/api/viewerViews.d.ts +10 -0
  95. package/src/api/viewerViews.js +18 -0
  96. package/src/api/viewerZones.d.ts +20 -0
  97. package/src/api/viewerZones.js +47 -0
  98. package/src/api/views.d.ts +7 -6
  99. package/src/api/views.js +12 -6
  100. package/src/app/App.d.ts +5 -3
  101. package/src/app/App.js +211 -82
  102. package/src/app/App.node.js +211 -82
  103. package/src/app/AstraeusScene.d.ts +18 -2
  104. package/src/app/AstraeusScene.js +4 -4
  105. package/src/app/BodyView.d.ts +4 -1
  106. package/src/app/BodyView.js +2 -2
  107. package/src/app/CameraController.d.ts +6 -0
  108. package/src/app/DeveloperSettings.d.ts +1 -4
  109. package/src/app/DeveloperSettings.js +6 -10
  110. package/src/app/FeatureMarkers.d.ts +4 -3
  111. package/src/app/FeatureMarkers.js +8 -13
  112. package/src/app/FrameRateSection.js +2 -1
  113. package/src/app/OrbitSetView.js +1 -1
  114. package/src/app/SettingControls.d.ts +11 -3
  115. package/src/app/SettingControls.js +10 -2
  116. package/src/app/SkyView.d.ts +3 -10
  117. package/src/app/SkyView.js +6 -28
  118. package/src/app/address.d.ts +16 -0
  119. package/src/app/address.js +31 -0
  120. package/src/app/bodyDraw.d.ts +10 -7
  121. package/src/app/bodyDraw.js +12 -32
  122. package/src/app/bodyMetrics.js +2 -2
  123. package/src/app/bodySet.d.ts +4 -20
  124. package/src/app/bodySet.js +5 -16
  125. package/src/app/debugReadout.js +1 -1
  126. package/src/app/displaySwitches.d.ts +4 -0
  127. package/src/app/displaySwitches.js +6 -0
  128. package/src/app/experienceDefinition.d.ts +11 -23
  129. package/src/app/listSwitch.d.ts +8 -14
  130. package/src/app/listSwitch.js +3 -10
  131. package/src/app/liveLook.d.ts +39 -0
  132. package/src/app/liveLook.js +66 -0
  133. package/src/app/look.d.ts +36 -0
  134. package/src/app/look.js +61 -0
  135. package/src/app/mission.d.ts +1 -1
  136. package/src/app/mission.js +1 -1
  137. package/src/app/openClock.d.ts +3 -2
  138. package/src/app/openClock.js +3 -3
  139. package/src/app/sceneCamera.d.ts +2 -0
  140. package/src/app/sceneCamera.js +11 -1
  141. package/src/app/sceneFrame.d.ts +4 -4
  142. package/src/app/sceneFrame.js +13 -8
  143. package/src/app/sceneHooks.js +3 -2
  144. package/src/app/style.css +114 -139
  145. package/src/app/trackedMetrics.d.ts +10 -3
  146. package/src/app/trackedMetrics.js +22 -11
  147. package/src/app/viewLink.d.ts +10 -32
  148. package/src/app/viewLink.js +10 -49
  149. package/src/app/viewerPort.d.ts +52 -0
  150. package/src/app/views.d.ts +3 -0
  151. package/src/assets/bodies/galileanMoons.js +1 -2
  152. package/src/assets/bodies/io.js +2 -2
  153. package/src/assets/bodies/listedMoons.d.ts +1 -1
  154. package/src/assets/bodies/listedMoons.js +2 -3
  155. package/src/assets/bodies/planetSystemMaps.js +2 -3
  156. package/src/assets/bodies/venus.js +2 -6
  157. package/src/assets/catalogue.js +1 -2
  158. package/src/assets/licence.d.ts +3 -3
  159. package/src/assets/licence.js +3 -3
  160. package/src/assets/pictures.d.ts +15 -12
  161. package/src/assets/pictures.js +24 -20
  162. package/src/assets/sky.d.ts +6 -5
  163. package/src/assets/sky.js +6 -9
  164. package/src/assets/visual.d.ts +4 -0
  165. package/src/core/astronomyAdapter.d.ts +1 -1
  166. package/src/core/astronomyAdapter.js +3 -3
  167. package/src/core/bodies/index.d.ts +0 -4
  168. package/src/core/bodies/index.js +14 -18
  169. package/src/core/bodies/jupiter.js +1 -1
  170. package/src/core/bodies/jupiterData.d.ts +0 -1
  171. package/src/core/bodies/jupiterData.js +2 -5
  172. package/src/core/bodies/mars.js +1 -1
  173. package/src/core/bodies/mercury.js +1 -1
  174. package/src/core/bodies/moonSystem.d.ts +1 -1
  175. package/src/core/bodies/moonSystem.js +102 -55
  176. package/src/core/bodies/outerPlanetRingData.js +2 -2
  177. package/src/core/bodies/outerPlanets.d.ts +2 -3
  178. package/src/core/bodies/outerPlanets.js +4 -13
  179. package/src/core/bodies/planetMoons.d.ts +0 -2
  180. package/src/core/bodies/planetMoons.js +1 -18
  181. package/src/core/bodies/planetRecords.d.ts +8 -2
  182. package/src/core/bodies/planetRecords.js +13 -5
  183. package/src/core/bodies/planetTrajectory.d.ts +21 -4
  184. package/src/core/bodies/planetTrajectory.js +29 -5
  185. package/src/core/bodies/venus.js +1 -1
  186. package/src/core/bodySetFamilies.d.ts +20 -0
  187. package/src/core/bodySetFamilies.js +14 -0
  188. package/src/core/chebyshevEphemeris.js +1 -1
  189. package/src/core/elementsBody.d.ts +8 -4
  190. package/src/core/elementsBody.js +32 -11
  191. package/src/core/elementsGroup.d.ts +27 -0
  192. package/src/core/elementsGroup.js +85 -0
  193. package/src/core/events.d.ts +2 -0
  194. package/src/core/events.js +2 -0
  195. package/src/core/illumination.js +1 -1
  196. package/src/core/listedOrbitGroup.d.ts +2 -0
  197. package/src/core/listedOrbitGroup.js +11 -7
  198. package/src/core/moonListText.d.ts +6 -0
  199. package/src/core/moonListText.js +19 -0
  200. package/src/core/moonTrajectory.js +1 -1
  201. package/src/core/pacing.d.ts +38 -3
  202. package/src/core/pacing.js +55 -4
  203. package/src/core/planetModels.d.ts +1 -1
  204. package/src/core/planetModels.js +3 -3
  205. package/src/core/planetSeries.d.ts +10 -2
  206. package/src/core/planetSeries.js +17 -3
  207. package/src/core/pointGroup.js +1 -1
  208. package/src/core/provenance.d.ts +2 -1
  209. package/src/core/provenance.js +2 -2
  210. package/src/core/referenceCenters.js +5 -5
  211. package/src/core/sampledTrajectory.js +1 -1
  212. package/src/core/scalePolicy.d.ts +1 -0
  213. package/src/core/startView.d.ts +19 -0
  214. package/src/core/startView.js +28 -0
  215. package/src/core/state.d.ts +6 -2
  216. package/src/core/state.js +3 -3
  217. package/src/core/storyPanels.d.ts +63 -0
  218. package/src/core/storyPanels.js +111 -0
  219. package/src/core/sunCentredSources.d.ts +4 -0
  220. package/src/core/sunCentredSources.js +9 -2
  221. package/src/core/timeInput.d.ts +4 -0
  222. package/src/core/timeInput.js +4 -0
  223. package/src/shell/AstraeusShell.d.ts +18 -2
  224. package/src/shell/AstraeusShell.js +53 -14
  225. package/src/shell/AstraeusShell.node.js +53 -14
  226. package/src/shell/Collapsible.d.ts +4 -3
  227. package/src/shell/Collapsible.js +5 -5
  228. package/src/shell/ControlsDrawer.d.ts +1 -1
  229. package/src/shell/ControlsDrawer.js +3 -1
  230. package/src/shell/DisplaySwitches.js +2 -1
  231. package/src/shell/InfoPanel.d.ts +3 -1
  232. package/src/shell/InfoPanel.js +5 -4
  233. package/src/shell/MoonFamilyPanel.js +1 -1
  234. package/src/shell/ObjectControls.d.ts +3 -1
  235. package/src/shell/ObjectControls.js +2 -2
  236. package/src/shell/Sources.d.ts +5 -3
  237. package/src/shell/Sources.js +5 -5
  238. package/src/shell/StoryPanelView.d.ts +4 -3
  239. package/src/shell/StoryPanelView.js +8 -6
  240. package/src/shell/SwitchControl.d.ts +5 -11
  241. package/src/shell/SwitchControl.js +2 -20
  242. package/src/shell/TimelineBar.css +81 -81
  243. package/src/shell/TimelineBar.d.ts +5 -2
  244. package/src/shell/TimelineBar.js +9 -8
  245. package/src/shell/TimelineBar.node.js +9 -8
  246. package/src/shell/TopBar.css +22 -22
  247. package/src/shell/TopBar.d.ts +5 -1
  248. package/src/shell/TopBar.js +2 -2
  249. package/src/shell/TopBar.node.js +2 -2
  250. package/src/shell/bootLoader.d.ts +4 -10
  251. package/src/shell/bootLoader.js +6 -52
  252. package/src/shell/embedded.css +18 -18
  253. package/src/shell/experience.d.ts +1 -1
  254. package/src/shell/moonFamilies.d.ts +2 -6
  255. package/src/shell/moonFamilies.js +2 -18
  256. package/src/shell/phone.css +58 -58
  257. package/src/shell/storyPanels.d.ts +2 -53
  258. package/src/shell/storyPanels.js +1 -106
  259. package/src/shell/style.css +153 -134
  260. package/src/shell/useDrawers.d.ts +3 -2
  261. package/src/shell/useDrawers.js +4 -3
  262. package/src/shell/viewerKeys.d.ts +8 -0
  263. package/src/shell/viewerKeys.js +16 -0
  264. package/src/synthetic/syntheticDefinition.js +20 -24
  265. package/src/synthetic/syntheticJourneyScene.js +3 -3
  266. package/src/synthetic/syntheticProbeDefinition.js +2 -1
  267. package/src/synthetic/syntheticViewsDefinition.d.ts +0 -3
  268. package/src/synthetic/syntheticViewsDefinition.js +10 -16
  269. package/data/moons/jupiter.json +0 -3333
  270. package/data/moons/neptune.json +0 -555
  271. package/data/moons/pluto.json +0 -205
  272. package/data/moons/saturn.json +0 -8267
  273. package/data/moons/uranus.json +0 -887
  274. package/src/app/addressNavigation.d.ts +0 -17
  275. package/src/app/addressNavigation.js +0 -16
  276. package/src/assets/bodies/jupiterMoonCatalogue.d.ts +0 -3
  277. package/src/assets/bodies/jupiterMoonCatalogue.js +0 -4
  278. package/src/assets/bodies/outerPlanetCatalogues.d.ts +0 -7
  279. package/src/assets/bodies/outerPlanetCatalogues.js +0 -8
  280. package/src/assets/bodies/swiftTuttle.d.ts +0 -12
  281. package/src/assets/bodies/swiftTuttle.js +0 -13
  282. package/src/assets/moonCatalogue.d.ts +0 -49
  283. package/src/assets/moonCatalogue.js +0 -80
  284. package/src/core/bodies/outerPlanetData.d.ts +0 -4
  285. package/src/core/bodies/outerPlanetData.js +0 -13
  286. package/src/core/bodies/swiftTuttle.d.ts +0 -46
  287. package/src/core/bodies/swiftTuttle.js +0 -106
@@ -1,6 +1,6 @@
1
1
  import type { ViewHidden } from "./viewHiding.js";
2
2
  import type { SimulationClock } from "../core/clock.js";
3
- import type { Pacing } from "../core/pacing.js";
3
+ import type { PaceView, Pacing } from "../core/pacing.js";
4
4
  import type { BodyId } from "../core/body.js";
5
5
  import type { ScalePolicy } from "../core/scalePolicy.js";
6
6
  import type { StateResolver } from "../core/stateResolver.js";
@@ -18,6 +18,7 @@ import type { FrameStats } from "./frameStats.js";
18
18
  import type { GroupFill } from "./FrameRateSection.js";
19
19
  import { type BodySetLayer, type BodySetLook } from "./bodySet.js";
20
20
  import type { RingLook } from "../assets/rings.js";
21
+ import type { Pictures } from "../assets/pictures.js";
21
22
  import { type StoryMarkerSpec } from "./StoryMarkers.js";
22
23
  import { type FeatureMarkerSpec } from "./FeatureMarkers.js";
23
24
  import type { ExperienceObject } from "../shell/experience.js";
@@ -56,21 +57,26 @@ export interface SceneRuntime {
56
57
  readonly overrides?: ReadonlyMap<BodyId, VisualOverride>;
57
58
  /** Whether bodies may use their desktop texture variant on wide viewports (the definition's opt-in). Absent: no. */
58
59
  readonly desktopTextures?: boolean;
60
+ /** The pictures of the data packages this viewer was given (the definition's `pictures`); absent: none, so bodies are flat colours and the sky has no Milky Way. */
61
+ readonly pictures?: Pictures;
59
62
  /** Paths the `sun-centred` layer draws; empty when the experience has none. */
60
63
  readonly paths?: readonly PathLayer[];
61
64
  /** The experience's declared camera reach; empty keeps the built-in limits. */
62
65
  readonly cameraReach: CameraReach;
63
- /** The sky behind the scene: whether it is drawn and how bright. Absent means no sky. */
66
+ /** The sky behind the scene: whether it is drawn and how bright. Absent means no sky. `live`: the host may show a sky that starts hidden (`SceneControls.skyVisible`), so it is built either way. */
64
67
  readonly sky?: {
65
68
  readonly visible: boolean;
66
69
  readonly starBrightness: number;
67
70
  readonly milkyWayBrightness: number;
68
71
  readonly milkyWay: boolean;
72
+ readonly live?: boolean;
69
73
  };
70
74
  }
71
75
  export interface SceneControls {
72
76
  policy: ScalePolicy;
73
77
  cameraRequest: CameraRequest | null;
78
+ /** The host's last `setCamera`, kept so the opening view and a view's own camera rule cannot discard it. Absent: none. */
79
+ hostCameraRequest?: CameraRequest | null;
74
80
  /** Presentation only: show source-anchor ID labels beside the anchor dots. */
75
81
  showAnchorLabels: boolean;
76
82
  /** Presentation only: draw the Milky Way picture behind the stars (the stars are always drawn while the sky is). */
@@ -90,12 +96,16 @@ export interface SceneControls {
90
96
  /** Presentation only: live sky strengths, 0 to 2, set from Developer > Display settings. */
91
97
  starBrightness: number;
92
98
  milkyWayBrightness: number;
99
+ /** Presentation only: false hides the whole sky (stars and Milky Way) without rebuilding it (live; `Scene.setLook({ skyVisible })`). Absent: shown. */
100
+ skyVisible?: boolean;
93
101
  /** Presentation only: light every body from the camera's side, keeping its shading (Developer > Sky and Sun). Off: true sunlight. */
94
102
  illuminateAll: boolean;
95
103
  /** Looping playback is on (live; set from the experience, `?loop=` and Developer > Display settings). Needs `SceneRuntime.loopWindow`. */
96
104
  loop?: boolean;
97
105
  /** Paced playback is in charge of the rate (live): true until a visitor or the host picks a speed, true again when they choose Auto. Meaningful with `SceneRuntime.pacing`. */
98
106
  paceAuto?: boolean;
107
+ /** Which event zones pace the clock (the showing view's events) and the ease after a view switch. Read and updated by `applyPacing`. */
108
+ pace?: PaceView;
99
109
  /** The render-frame up vector now in force (live; Developer > Display settings). Absent: the runtime's own. Switching it re-poses the camera in place. */
100
110
  up?: RenderVector;
101
111
  /** Ids of objects whose label is switched off (live). Their objects stay listed and selectable. */
@@ -128,6 +138,10 @@ export interface SceneControls {
128
138
  startView?: StartView;
129
139
  /** The camera's current view, written every frame by the scene for "Copy view link". */
130
140
  viewReadout?: StartView;
141
+ /** How long the loading cover fades when the first frame is drawn (the address's `loadfade` when the address is on, else the saved setting). */
142
+ loadFadeSeconds?: number;
143
+ /** Whether wide screens draw the larger desktop pictures: set when the viewer is built, read back by `look`. */
144
+ desktopPictures: boolean;
131
145
  }
132
146
  export type SceneReadout = DebugReadout;
133
147
  interface Props {
@@ -138,6 +152,8 @@ interface Props {
138
152
  };
139
153
  /** Changes when the scale policy changes so mesh radii re-render. */
140
154
  readonly scaleId: ScalePolicy["id"];
155
+ /** Told once when the scene's first frame has been drawn (the host's `onFirstDraw`). */
156
+ readonly onFirstDraw?: () => void;
141
157
  }
142
158
  export declare function AstraeusScene(props: Props): import("react").JSX.Element;
143
159
  export {};
@@ -18,7 +18,7 @@ export function AstraeusScene(props) {
18
18
  const layers = useMemo(() => assignBodyLayers(runtime.bodies, TRACK_LAYER, catalogue), [runtime.bodies, catalogue]);
19
19
  const lightLayers = useMemo(() => runtime.bodies.filter((id) => catalogue.get(id).visual.light !== undefined).map((id) => layers.get(id)), [runtime.bodies, layers, catalogue]);
20
20
  // One frame state for the whole canvas: the scene contents decide whether a frame is drawn and the layered render obeys.
21
- const frameState = useRef(createFrameState(props.controls.policy.id));
21
+ const frameState = useRef(createFrameState(props.controls.policy.id, props.onFirstDraw));
22
22
  return (_jsxs(Canvas, { camera: { fov: 45, near: 0.05, far: runtime.cameraReach.far ?? DEFAULT_CAMERA_FAR },
23
23
  // Logarithmic depth (O-048 T-204, I-117): a planet near the camera keeps its depth precision however far the far plane reaches. Every custom shader in src/app carries the log-depth chunks (tests/logDepth.test.ts).
24
24
  gl: { antialias: true, logarithmicDepthBuffer: true }, style: { background: "#000000" }, "data-testid": "earth-moon-canvas", "data-scene-center": runtime.sceneCenter, "data-bodies": runtime.bodies.join(","), "data-lighting": "per-body", "data-composition-paths": runtime.composition?.paths?.length ?? 0, "data-point-groups": runtime.groups.length, "data-sun-centred": (runtime.sun === undefined ? 0 : 1) + (runtime.paths?.length ?? 0), "data-rings": runtime.bodies.map((id) => (runtime.overrides?.get(id)?.rings ?? catalogue.get(id).visual.rings)?.bands.length ?? 0).reduce((sum, n) => sum + n, 0), children: [_jsx(SceneContents, { ...props, layers: layers, frameState: frameState }), _jsx(LayeredRender, { lightLayers: lightLayers, state: frameState })] }));
@@ -40,10 +40,10 @@ function SceneContents({ runtime, controls, readout, layers, frameState }) {
40
40
  const layerRefs = useOverlayLayers(gl.domElement, controls, trackedViews, bodySetViews);
41
41
  useScenePointer(gl.domElement, runtime, controls, catalogue, orbit, frameState);
42
42
  useSceneFrame(rootRef, { runtime, controls, readout, catalogue, origin, orbit, state: frameState, assets, bodyRefs, lightRefs, placement, views, layers: layerRefs, bodyFamilies, readoutPair, pairLabels });
43
- return (_jsxs("group", { ref: rootRef, children: [assets.map((asset) => (_jsx(SceneBody, { asset: asset, layer: layers.get(asset.definition.id), controls: controls, desktopTextures: runtime.desktopTextures === true, ringLookOf: ringLookOf, onParts: partsFor.get(asset.definition.id), groupRef: refFor(groupRefs.current, asset.definition.id), orientRef: refFor(orientRefs.current, asset.definition.id), lightRef: refFor(lightRefs.current, asset.definition.id) }, asset.definition.id))), skyView !== null && _jsx("primitive", { object: skyView.group }), compositionPaths.map((view) => _jsx("primitive", { object: view.group }, view.id)), trackedViews.map((view) => _jsx("primitive", { object: view.group }, view.body.id)), groupViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), sunCentredViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), bodySetViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), orbitSetViews.map((view) => _jsx("primitive", { object: view.group }, view.id))] }));
43
+ return (_jsxs("group", { ref: rootRef, children: [assets.map((asset) => (_jsx(SceneBody, { asset: asset, layer: layers.get(asset.definition.id), controls: controls, desktopTextures: runtime.desktopTextures === true, pictures: runtime.pictures, ringLookOf: ringLookOf, onParts: partsFor.get(asset.definition.id), groupRef: refFor(groupRefs.current, asset.definition.id), orientRef: refFor(orientRefs.current, asset.definition.id), lightRef: refFor(lightRefs.current, asset.definition.id) }, asset.definition.id))), skyView !== null && _jsx("primitive", { object: skyView.group }), compositionPaths.map((view) => _jsx("primitive", { object: view.group }, view.id)), trackedViews.map((view) => _jsx("primitive", { object: view.group }, view.body.id)), groupViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), sunCentredViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), bodySetViews.map((view) => _jsx("primitive", { object: view.group }, view.id)), orbitSetViews.map((view) => _jsx("primitive", { object: view.group }, view.id))] }));
44
44
  }
45
45
  /** One catalogued body: its view and, when its record has a light, the ambient and directional light on its layer. */
46
- function SceneBody({ asset, layer, controls, desktopTextures, ringLookOf, onParts, groupRef, orientRef, lightRef }) {
46
+ function SceneBody({ asset, layer, controls, desktopTextures, pictures, ringLookOf, onParts, groupRef, orientRef, lightRef }) {
47
47
  const light = asset.visual.light;
48
- return (_jsxs("group", { children: [_jsx(BodyView, { asset: asset, policy: controls.policy, desktopTextures: desktopTextures, layer: layer, markerLayer: TRACK_LAYER, markerPx: controls.bodyMarker.markerPx, glowLook: controls.glowLook, ringLookOf: ringLookOf, onParts: onParts, groupRef: groupRef, orientRef: orientRef }), light !== undefined && (_jsxs(_Fragment, { children: [_jsx("ambientLight", { layers: layer, intensity: light.ambient }), _jsx("directionalLight", { ref: lightRef, layers: layer, intensity: light.directional })] }))] }));
48
+ return (_jsxs("group", { children: [_jsx(BodyView, { asset: asset, policy: controls.policy, desktopTextures: desktopTextures, pictures: pictures, layer: layer, markerLayer: TRACK_LAYER, markerPx: controls.bodyMarker.markerPx, glowLook: controls.glowLook, ringLookOf: ringLookOf, onParts: onParts, groupRef: groupRef, orientRef: orientRef }), light !== undefined && (_jsxs(_Fragment, { children: [_jsx("ambientLight", { layers: layer, intensity: light.ambient }), _jsx("directionalLight", { ref: lightRef, layers: layer, intensity: light.directional })] }))] }));
49
49
  }
@@ -1,5 +1,6 @@
1
1
  import { type Group } from "three";
2
2
  import type { BodyAsset } from "../assets/catalogue.js";
3
+ import type { Pictures } from "../assets/pictures.js";
3
4
  import type { ScalePolicy } from "../core/scalePolicy.js";
4
5
  import { type RingLook } from "../assets/rings.js";
5
6
  import { type GlowLook } from "./bodyDraw.js";
@@ -18,6 +19,8 @@ interface BodyViewProps {
18
19
  readonly markerPx?: number;
19
20
  /** The experience's opt-in to desktop texture variants (default off). */
20
21
  readonly desktopTextures?: boolean;
22
+ /** The pictures this viewer was given; a look naming a picture not held here is a flat colour. */
23
+ readonly pictures?: Pictures;
21
24
  /** The live halo settings for a body whose record has a glow. */
22
25
  readonly glowLook?: GlowLook;
23
26
  /** The group the scene positions. */
@@ -33,5 +36,5 @@ interface BodyViewProps {
33
36
  * Draws any catalogued body from its visual record: a sphere or spheroid with an optional atmosphere, or a marker. A sphere also carries a
34
37
  * hidden marker at the same place; the scene shows it instead of the sphere when the sphere would be smaller than a few pixels.
35
38
  */
36
- export declare function BodyView({ asset, policy, layer, markerLayer, markerPx, glowLook, desktopTextures, groupRef, orientRef, onParts, ringLookOf }: BodyViewProps): import("react").JSX.Element;
39
+ export declare function BodyView({ asset, policy, layer, markerLayer, markerPx, glowLook, desktopTextures, pictures, groupRef, orientRef, onParts, ringLookOf }: BodyViewProps): import("react").JSX.Element;
37
40
  export {};
@@ -12,8 +12,8 @@ import { applyGlowLook, createGlow, createMarker, describeBody, DEFAULT_BODY_MAR
12
12
  * Draws any catalogued body from its visual record: a sphere or spheroid with an optional atmosphere, or a marker. A sphere also carries a
13
13
  * hidden marker at the same place; the scene shows it instead of the sphere when the sphere would be smaller than a few pixels.
14
14
  */
15
- export function BodyView({ asset, policy, layer, markerLayer, markerPx = DEFAULT_BODY_MARKER.markerPx, glowLook, desktopTextures = false, groupRef, orientRef, onParts, ringLookOf }) {
16
- const plan = describeBody(asset, policy, desktopTextures);
15
+ export function BodyView({ asset, policy, layer, markerLayer, markerPx = DEFAULT_BODY_MARKER.markerPx, glowLook, desktopTextures = false, pictures, groupRef, orientRef, onParts, ringLookOf }) {
16
+ const plan = describeBody(asset, policy, desktopTextures, pictures);
17
17
  // A body with a halo draws no marker dot: the halo is its marker.
18
18
  const marker = useMemo(() => (plan.kind === "marker" && asset.visual.glow === undefined ? createMarker(asset, layer).group : null), [asset, plan.kind, layer]);
19
19
  const standIn = useMemo(() => (plan.kind === "sphere" ? createMarker(asset, markerLayer, undefined, markerPx).group : null), [asset, plan.kind, markerLayer, markerPx]);
@@ -2,6 +2,7 @@ import { PerspectiveCamera } from "three";
2
2
  import type { FloatingOrigin } from "./floatingOrigin.js";
3
3
  import type { RenderVector } from "./renderCoordinates.js";
4
4
  import { type PickPointer } from "./scenePicking.js";
5
+ import type { StartView } from "./viewLink.js";
5
6
  /** The id of a catalogued body, or of any tracked trajectory body, group or path. */
6
7
  export type FocusId = string;
7
8
  /** Focus re-frames the target; follow keeps the current framing; overview frames Earth and Moon. */
@@ -14,6 +15,11 @@ export type CameraRequest = {
14
15
  /** Holds the camera where it is: its target becomes the point it looks at now, fixed in the scene frame; the pose is kept. A later focus, follow or overview request replaces it. */
15
16
  | {
16
17
  readonly kind: "hold";
18
+ }
19
+ /** Puts the camera back on a pose read earlier: it follows the pose's object and eases to its angles and distance (the offset is the object's own, so a moving object is followed from where it is now). */
20
+ | {
21
+ readonly kind: "pose";
22
+ readonly view: StartView;
17
23
  };
18
24
  export interface OrbitCameraState {
19
25
  azimuth: number;
@@ -6,7 +6,6 @@ import type { SceneControls } from "./AstraeusScene.js";
6
6
  import { type DebugReadout } from "./DebugOverlay.js";
7
7
  import { type GroupFill } from "./FrameRateSection.js";
8
8
  import type { FrameSnapshot } from "./frameStats.js";
9
- import type { ExperienceDefinition } from "./experienceDefinition.js";
10
9
  import { type StartView } from "./viewLink.js";
11
10
  import type { ViewUp } from "./viewUp.js";
12
11
  /** The Developer tools' settings bodies that App.tsx hands whole to its folds; each only reads its props and writes the scene's live controls. */
@@ -69,12 +68,10 @@ export declare function ViewLinkReadout({ viewNow, viewLink, scale, upChoice }:
69
68
  readonly scale: string;
70
69
  readonly upChoice: ViewUp;
71
70
  }): import("react").JSX.Element;
72
- export declare function UnderTheHoodSettings({ hud, frames, fills, fpsHistory, alternates }: {
71
+ export declare function UnderTheHoodSettings({ hud, frames, fills, fpsHistory }: {
73
72
  readonly hud: DebugReadout | null;
74
73
  readonly frames: FrameSnapshot | null;
75
74
  readonly fills: readonly GroupFill[];
76
75
  readonly fpsHistory: readonly number[];
77
- /** The experience's alternate data sets; absent or empty: no Data group. */
78
- readonly alternates: ExperienceDefinition["alternates"];
79
76
  }): import("react").JSX.Element;
80
77
  export {};
@@ -7,15 +7,15 @@ import { MAX_PANEL_PAUSE_SECONDS } from "../shell/storyPanels.js";
7
7
  import { DebugOverlay } from "./DebugOverlay.js";
8
8
  import { FrameRateSection } from "./FrameRateSection.js";
9
9
  import { formatView } from "./viewLink.js";
10
- import { SettingButtons, SettingColor, SettingGroup, SettingSlider } from "./SettingControls.js";
10
+ import { HudSection, SettingButtons, SettingColor, SettingGroup, SettingSlider } from "./SettingControls.js";
11
11
  export function StoryPanelSettings({ storyAutoOpen, setStoryAutoOpen, storyPauseSeconds, setStoryPauseSeconds }) {
12
- return (_jsxs(SettingGroup, { id: "story-panels", title: "Story panels", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": storyAutoOpen, onClick: () => setStoryAutoOpen(!storyAutoOpen), children: "Open panels automatically" }) }), _jsx(SettingSlider, { label: "Pause when a panel opens (s)", ariaLabel: "Story panel pause", testId: "story-pause-value", display: storyPauseSeconds === 0 ? "off" : storyPauseSeconds.toFixed(1), min: 0, max: MAX_PANEL_PAUSE_SECONDS, step: 0.5, value: storyPauseSeconds, onChange: setStoryPauseSeconds })] }));
12
+ return (_jsxs(SettingGroup, { name: "story-panels", title: "Story panels", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": storyAutoOpen, onClick: () => setStoryAutoOpen(!storyAutoOpen), children: "Open panels automatically" }) }), _jsx(SettingSlider, { label: "Pause when a panel opens (s)", ariaLabel: "Story panel pause", testId: "story-pause-value", display: storyPauseSeconds === 0 ? "off" : storyPauseSeconds.toFixed(1), min: 0, max: MAX_PANEL_PAUSE_SECONDS, step: 0.5, value: storyPauseSeconds, onChange: setStoryPauseSeconds })] }));
13
13
  }
14
14
  export function MoonsAndRingsSettings({ bodySets, ringSystems, setLook, changeSetLook, ringLook, changeRing, controls, setSetLook, setRingLook }) {
15
- return (_jsxs(_Fragment, { children: [bodySets.length > 0 && (_jsxs(SettingGroup, { id: "body-set-dots", title: "Small moons", children: [_jsx(SettingSlider, { label: "Dot size (px)", ariaLabel: "Small moon dot size", testId: "body-set-dot-px", display: setLook.dotPx.toFixed(1), min: BODY_SET_LOOK_LIMITS.dotPx.min, max: BODY_SET_LOOK_LIMITS.dotPx.max, step: 0.5, value: setLook.dotPx, onChange: (dotPx) => changeSetLook({ dotPx }) }), _jsx(SettingColor, { label: "Dot colour", ariaLabel: "Small moon dot colour", testId: "body-set-dot-color", value: setLook.dotColor, onChange: (dotColor) => changeSetLook({ dotColor }) }), _jsx(SettingSlider, { label: "Name when ball is (px)", ariaLabel: "Small moon name distance", testId: "body-set-label-px", display: setLook.labelNearPx.toFixed(0), min: BODY_SET_LOOK_LIMITS.labelNearPx.min, max: BODY_SET_LOOK_LIMITS.labelNearPx.max, step: 1, value: setLook.labelNearPx, onChange: (labelNearPx) => changeSetLook({ labelNearPx }) })] })), bodySets.length > 0 && (_jsxs(SettingGroup, { id: "body-set-orbits", title: "Moon orbits by family", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": setLook.orbitsOn, onClick: () => changeSetLook({ orbitsOn: !setLook.orbitsOn }), children: "Moon orbits" }) }), _jsx(SettingSlider, { label: "Orbit opacity", ariaLabel: "Moon orbit opacity", testId: "body-set-orbit-opacity", display: setLook.orbitOpacity.toFixed(2), min: BODY_SET_LOOK_LIMITS.orbitOpacity.min, max: BODY_SET_LOOK_LIMITS.orbitOpacity.max, step: 0.01, value: setLook.orbitOpacity, onChange: (orbitOpacity) => changeSetLook({ orbitOpacity }) }), _jsx(SettingSlider, { label: "Zoom boost", ariaLabel: "Moon orbit zoom boost", testId: "body-set-orbit-boost", display: setLook.orbitZoomBoost.toFixed(2), min: BODY_SET_LOOK_LIMITS.orbitZoomBoost.min, max: BODY_SET_LOOK_LIMITS.orbitZoomBoost.max, step: 0.01, value: setLook.orbitZoomBoost, onChange: (orbitZoomBoost) => changeSetLook({ orbitZoomBoost }) }), _jsx(SettingColor, { label: "Highlight colour", ariaLabel: "Moon family highlight colour", testId: "body-set-highlight-color", value: setLook.highlightColor, onChange: (highlightColor) => changeSetLook({ highlightColor }) }), _jsx(SettingSlider, { label: "Highlight orbit brightness", ariaLabel: "Moon family highlight orbit brightness", testId: "body-set-highlight-gain", display: setLook.highlightOrbitGain.toFixed(1), min: BODY_SET_LOOK_LIMITS.highlightOrbitGain.min, max: BODY_SET_LOOK_LIMITS.highlightOrbitGain.max, step: 0.5, value: setLook.highlightOrbitGain, onChange: (highlightOrbitGain) => changeSetLook({ highlightOrbitGain }) }), bodySets.flatMap((layer) => layer.families.map((family) => (_jsx(SettingColor, { label: family.label, ariaLabel: `${family.label} orbit colour`, testId: `body-set-family-${family.id}`, value: familyColorOf(layer, setLook, family.id), onChange: (color) => changeSetLook({ familyColors: { ...setLook.familyColors, [family.id]: color } }) }, `${layer.id}-${family.id}`)))), _jsx(SettingButtons, { children: _jsx("button", { onClick: () => { delete controls.current.bodySetLook; setSetLook(DEFAULT_BODY_SET_LOOK); }, children: "Reset moons" }) })] })), ringSystems.map((rings) => (_jsxs(SettingGroup, { id: `rings-${rings.body}`, title: "Rings", children: [ringBandsWithLook(rings, ringLook).map((band) => (_jsxs("div", { children: [_jsx(SettingColor, { label: band.label, ariaLabel: `${band.label} colour`, testId: `ring-${band.id}-color`, value: band.color, onChange: (color) => changeRing(band.id, { color }) }), _jsx(SettingSlider, { label: `${band.label} opacity`, ariaLabel: `${band.label}: opacity`, testId: `ring-${band.id}-opacity`, display: band.opacity.toFixed(3), min: 0, max: 1, step: 0.005, value: band.opacity, onChange: (opacity) => changeRing(band.id, { opacity }) })] }, band.id))), _jsx(SettingButtons, { children: _jsx("button", { onClick: () => { delete controls.current.ringLook; setRingLook({}); }, children: "Reset rings" }) })] }, rings.body)))] }));
15
+ return (_jsxs(_Fragment, { children: [bodySets.length > 0 && (_jsxs(SettingGroup, { name: "body-set-dots", title: "Small moons", children: [_jsx(SettingSlider, { label: "Dot size (px)", ariaLabel: "Small moon dot size", testId: "body-set-dot-px", display: setLook.dotPx.toFixed(1), min: BODY_SET_LOOK_LIMITS.dotPx.min, max: BODY_SET_LOOK_LIMITS.dotPx.max, step: 0.5, value: setLook.dotPx, onChange: (dotPx) => changeSetLook({ dotPx }) }), _jsx(SettingColor, { label: "Dot colour", ariaLabel: "Small moon dot colour", testId: "body-set-dot-color", value: setLook.dotColor, onChange: (dotColor) => changeSetLook({ dotColor }) }), _jsx(SettingSlider, { label: "Name when ball is (px)", ariaLabel: "Small moon name distance", testId: "body-set-label-px", display: setLook.labelNearPx.toFixed(0), min: BODY_SET_LOOK_LIMITS.labelNearPx.min, max: BODY_SET_LOOK_LIMITS.labelNearPx.max, step: 1, value: setLook.labelNearPx, onChange: (labelNearPx) => changeSetLook({ labelNearPx }) })] })), bodySets.length > 0 && (_jsxs(SettingGroup, { name: "body-set-orbits", title: "Moon orbits by family", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": setLook.orbitsOn, onClick: () => changeSetLook({ orbitsOn: !setLook.orbitsOn }), children: "Moon orbits" }) }), _jsx(SettingSlider, { label: "Orbit opacity", ariaLabel: "Moon orbit opacity", testId: "body-set-orbit-opacity", display: setLook.orbitOpacity.toFixed(2), min: BODY_SET_LOOK_LIMITS.orbitOpacity.min, max: BODY_SET_LOOK_LIMITS.orbitOpacity.max, step: 0.01, value: setLook.orbitOpacity, onChange: (orbitOpacity) => changeSetLook({ orbitOpacity }) }), _jsx(SettingSlider, { label: "Zoom boost", ariaLabel: "Moon orbit zoom boost", testId: "body-set-orbit-boost", display: setLook.orbitZoomBoost.toFixed(2), min: BODY_SET_LOOK_LIMITS.orbitZoomBoost.min, max: BODY_SET_LOOK_LIMITS.orbitZoomBoost.max, step: 0.01, value: setLook.orbitZoomBoost, onChange: (orbitZoomBoost) => changeSetLook({ orbitZoomBoost }) }), _jsx(SettingColor, { label: "Highlight colour", ariaLabel: "Moon family highlight colour", testId: "body-set-highlight-color", value: setLook.highlightColor, onChange: (highlightColor) => changeSetLook({ highlightColor }) }), _jsx(SettingSlider, { label: "Highlight orbit brightness", ariaLabel: "Moon family highlight orbit brightness", testId: "body-set-highlight-gain", display: setLook.highlightOrbitGain.toFixed(1), min: BODY_SET_LOOK_LIMITS.highlightOrbitGain.min, max: BODY_SET_LOOK_LIMITS.highlightOrbitGain.max, step: 0.5, value: setLook.highlightOrbitGain, onChange: (highlightOrbitGain) => changeSetLook({ highlightOrbitGain }) }), bodySets.flatMap((layer) => layer.families.map((family) => (_jsx(SettingColor, { label: family.label, ariaLabel: `${family.label} orbit colour`, testId: `body-set-family-${family.id}`, value: familyColorOf(layer, setLook, family.id), onChange: (color) => changeSetLook({ familyColors: { ...setLook.familyColors, [family.id]: color } }) }, `${layer.id}-${family.id}`)))), _jsx(SettingButtons, { children: _jsx("button", { onClick: () => { delete controls.current.bodySetLook; setSetLook(DEFAULT_BODY_SET_LOOK); }, children: "Reset moons" }) })] })), ringSystems.map((rings) => (_jsxs(SettingGroup, { name: `rings-${rings.body}`, title: "Rings", children: [ringBandsWithLook(rings, ringLook).map((band) => (_jsxs("div", { children: [_jsx(SettingColor, { label: band.label, ariaLabel: `${band.label} colour`, testId: `ring-${band.id}-color`, value: band.color, onChange: (color) => changeRing(band.id, { color }) }), _jsx(SettingSlider, { label: `${band.label} opacity`, ariaLabel: `${band.label}: opacity`, testId: `ring-${band.id}-opacity`, display: band.opacity.toFixed(3), min: 0, max: 1, step: 0.005, value: band.opacity, onChange: (opacity) => changeRing(band.id, { opacity }) })] }, band.id))), _jsx(SettingButtons, { children: _jsx("button", { onClick: () => { delete controls.current.ringLook; setRingLook({}); }, children: "Reset rings" }) })] }, rings.body)))] }));
16
16
  }
17
17
  export function SkyAndSunSettings({ illuminateAll, setIlluminateAll, visible, glowShown, setGlowShown, controls, milkyWayOn, setMilkyWayOn, starBrightness, setStarBrightness, milkyWayBrightness, setMilkyWayBrightness }) {
18
- return (_jsxs(_Fragment, { children: [_jsx(SettingGroup, { id: "lighting", title: "Lighting", children: _jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": illuminateAll, "aria-label": "Illuminate all", onClick: () => { controls.current.illuminateAll = !illuminateAll; setIlluminateAll(!illuminateAll); }, children: "Illuminate all" }) }) }), visible && (_jsxs(SettingGroup, { id: "sky", title: "Sky", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": milkyWayOn, onClick: () => { controls.current.showMilkyWay = !milkyWayOn; setMilkyWayOn(!milkyWayOn); }, children: "Milky Way picture" }) }), _jsx(SettingSlider, { label: "Star brightness", ariaLabel: "Star brightness", testId: "star-brightness-value", display: starBrightness.toFixed(2), min: 0, max: 2, step: 0.05, value: starBrightness, onChange: (value) => { controls.current.starBrightness = value; setStarBrightness(value); } }), _jsx(SettingSlider, { label: "Milky Way brightness", ariaLabel: "Milky Way brightness", testId: "milky-way-brightness-value", display: milkyWayBrightness.toFixed(2), min: 0, max: 2, step: 0.05, value: milkyWayBrightness, onChange: (value) => { controls.current.milkyWayBrightness = value; setMilkyWayBrightness(value); } })] })), glowShown !== null && (_jsxs(SettingGroup, { id: "glow", title: "Sun glow", children: [_jsx(SettingSlider, { label: "Glow size (px)", ariaLabel: "Sun glow size", testId: "sun-glow-size-value", display: glowShown.sizePx.toFixed(0), min: GLOW_LIMITS.sizePx.min, max: GLOW_LIMITS.sizePx.max, step: 1, value: glowShown.sizePx, onChange: (value) => { controls.current.glowLook.sizePx = value; setGlowShown({ ...controls.current.glowLook }); } }), _jsx(SettingSlider, { label: "Glow brightness", ariaLabel: "Sun glow brightness", testId: "sun-glow-brightness-value", display: glowShown.brightness.toFixed(2), min: GLOW_LIMITS.brightness.min, max: GLOW_LIMITS.brightness.max, step: 0.05, value: glowShown.brightness, onChange: (value) => { controls.current.glowLook.brightness = value; setGlowShown({ ...controls.current.glowLook }); } }), _jsx(SettingSlider, { label: "Glow reach (\u00D7 disc)", ariaLabel: "Sun glow reach", testId: "sun-glow-scale-value", display: glowShown.scale.toFixed(1), min: GLOW_LIMITS.scale.min, max: GLOW_LIMITS.scale.max, step: 0.1, value: glowShown.scale, onChange: (value) => { controls.current.glowLook.scale = value; setGlowShown({ ...controls.current.glowLook }); } })] }))] }));
18
+ return (_jsxs(_Fragment, { children: [_jsx(SettingGroup, { name: "lighting", title: "Lighting", children: _jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": illuminateAll, "aria-label": "Illuminate all", onClick: () => { controls.current.illuminateAll = !illuminateAll; setIlluminateAll(!illuminateAll); }, children: "Illuminate all" }) }) }), visible && (_jsxs(SettingGroup, { name: "sky", title: "Sky", children: [_jsx(SettingButtons, { children: _jsx("button", { "aria-pressed": milkyWayOn, onClick: () => { controls.current.showMilkyWay = !milkyWayOn; setMilkyWayOn(!milkyWayOn); }, children: "Milky Way picture" }) }), _jsx(SettingSlider, { label: "Star brightness", ariaLabel: "Star brightness", testId: "star-brightness-value", display: starBrightness.toFixed(2), min: 0, max: 2, step: 0.05, value: starBrightness, onChange: (value) => { controls.current.starBrightness = value; setStarBrightness(value); } }), _jsx(SettingSlider, { label: "Milky Way brightness", ariaLabel: "Milky Way brightness", testId: "milky-way-brightness-value", display: milkyWayBrightness.toFixed(2), min: 0, max: 2, step: 0.05, value: milkyWayBrightness, onChange: (value) => { controls.current.milkyWayBrightness = value; setMilkyWayBrightness(value); } })] })), glowShown !== null && (_jsxs(SettingGroup, { name: "glow", title: "Sun glow", children: [_jsx(SettingSlider, { label: "Glow size (px)", ariaLabel: "Sun glow size", testId: "sun-glow-size-value", display: glowShown.sizePx.toFixed(0), min: GLOW_LIMITS.sizePx.min, max: GLOW_LIMITS.sizePx.max, step: 1, value: glowShown.sizePx, onChange: (value) => { controls.current.glowLook.sizePx = value; setGlowShown({ ...controls.current.glowLook }); } }), _jsx(SettingSlider, { label: "Glow brightness", ariaLabel: "Sun glow brightness", testId: "sun-glow-brightness-value", display: glowShown.brightness.toFixed(2), min: GLOW_LIMITS.brightness.min, max: GLOW_LIMITS.brightness.max, step: 0.05, value: glowShown.brightness, onChange: (value) => { controls.current.glowLook.brightness = value; setGlowShown({ ...controls.current.glowLook }); } }), _jsx(SettingSlider, { label: "Glow reach (\u00D7 disc)", ariaLabel: "Sun glow reach", testId: "sun-glow-scale-value", display: glowShown.scale.toFixed(1), min: GLOW_LIMITS.scale.min, max: GLOW_LIMITS.scale.max, step: 0.1, value: glowShown.scale, onChange: (value) => { controls.current.glowLook.scale = value; setGlowShown({ ...controls.current.glowLook }); } })] }))] }));
19
19
  }
20
20
  export function LabelSettings({ controls, hoverBrightness, setHoverBrightness, labelToggles, trackedCount, anchorLabels, setAnchorLabels, hiddenLabels, setHiddenLabels }) {
21
21
  return (_jsxs(_Fragment, { children: [_jsx(SettingSlider, { label: "Hover name brightness", ariaLabel: "Hover name brightness", testId: "hover-brightness-value", display: hoverBrightness.toFixed(2), min: HOVER_BRIGHTNESS_LIMITS.min, max: HOVER_BRIGHTNESS_LIMITS.max, step: 0.05, value: hoverBrightness, onChange: (value) => { controls.current.hoverBrightness = value; setHoverBrightness(value); } }), (labelToggles.length > 0 || trackedCount > 0) && _jsxs(SettingButtons, { children: [trackedCount > 0 && _jsx("button", { "aria-pressed": anchorLabels, onClick: () => { controls.current.showAnchorLabels = !anchorLabels; setAnchorLabels(!anchorLabels); }, children: "Anchor labels" }), labelToggles.map((object) => (_jsx("button", { "aria-pressed": !hiddenLabels.has(object.id), onClick: () => {
@@ -31,10 +31,6 @@ export function LabelSettings({ controls, hoverBrightness, setHoverBrightness, l
31
31
  export function ViewLinkReadout({ viewNow, viewLink, scale, upChoice }) {
32
32
  return (_jsxs(_Fragment, { children: [viewNow !== null && _jsx("p", { className: "view-link-values", "data-testid": "view-values", children: `View: ${formatView(viewNow).replace(/%2C/g, ",")} (focus, azimuth °, elevation °, distance) · scale ${scale} · up ${upChoice}` }), viewLink !== null && (_jsxs("p", { className: "view-link-field", children: [_jsx("input", { readOnly: true, "aria-label": "View link", "data-testid": "view-link", value: viewLink.url, onFocus: (event) => event.currentTarget.select() }), _jsx("span", { children: viewLink.copied ? "Copied to the clipboard." : "Clipboard unavailable: select the link above and copy it." })] }))] }));
33
33
  }
34
- export function UnderTheHoodSettings({ hud, frames, fills, fpsHistory, alternates }) {
35
- return (_jsxs(_Fragment, { children: [hud !== null && (_jsxs("section", { className: "hud-section", "aria-labelledby": "developer-scene-heading", children: [_jsx("h4", { id: "developer-scene-heading", children: "Scene instrumentation" }), _jsx(DebugOverlay, { readout: hud })] })), _jsx(FrameRateSection, { frames: frames, fills: fills, fpsHistory: fpsHistory }), alternates !== undefined && alternates.length > 0 && (_jsx(SettingGroup, { id: "data", title: "Data", children: _jsx(SettingButtons, { children: alternates?.map((alternate) => (_jsx("button", { "aria-pressed": alternate.active, onClick: () => {
36
- const url = new URL(window.location.href);
37
- url.searchParams.set(alternate.param, alternate.value);
38
- window.location.assign(url.toString());
39
- }, children: alternate.label }, `${alternate.param}=${alternate.value}`))) }) }))] }));
34
+ export function UnderTheHoodSettings({ hud, frames, fills, fpsHistory }) {
35
+ return (_jsxs(_Fragment, { children: [hud !== null && (_jsx(HudSection, { level: 4, heading: "Scene instrumentation", children: _jsx(DebugOverlay, { readout: hud }) })), _jsx(FrameRateSection, { frames: frames, fills: fills, fpsHistory: fpsHistory })] }));
40
36
  }
@@ -1,5 +1,6 @@
1
1
  import { type Camera, type Object3D } from "three";
2
2
  import type { BodyFeatureSet } from "../shell/bodyFeatures.js";
3
+ import type { LookInput } from "./look.js";
3
4
  /** The donor's `latLonToXYZ`, verbatim: a point on a sphere of `radius`, in the body's own frame (Three.js SphereGeometry UV layout). */
4
5
  export declare function latLonToXYZ(lat: number, lon: number, radius: number): [number, number, number];
5
6
  /** The donor's horizon rule: a marker hides once its surface point is this far past the edge. */
@@ -10,11 +11,11 @@ export declare function isFeatureVisible(surfaceNormal: readonly [number, number
10
11
  export declare const MARKER_RADIUS_MULTIPLIER = 1.02;
11
12
  /**
12
13
  * Presentation only. A body drawn narrower than this many screen pixels shows no markers (they would crowd into a smudge); the donor's
13
- * moon fills the screen, so it has no such rule. Live through `?featurepx=`.
14
+ * moon fills the screen, so it has no such rule. Set through `Scene.setLook` (`featureMinBodyPx`), or live through `?featurepx=`.
14
15
  */
15
16
  export declare const DEFAULT_FEATURE_MIN_BODY_PX = 60;
16
- /** `?featurepx=<n>` sets the narrowest body that still shows its markers; an unusable value keeps the default with a console warning. */
17
- export declare function featureMinBodyPxFromSearch(search: string, fallback?: number): number;
17
+ /** The narrowest body that still shows its markers: the look's `featureMinBodyPx`, else the default. */
18
+ export declare function featureMinBodyPxOf(look: LookInput): number;
18
19
  /**
19
20
  * The shell's own panels, which own their screen areas: a marker whose point falls under one is hidden, so a marker never shows through or
20
21
  * competes with the information panel, the moons sheet and its button, the timeline, the top bar, story panels or the phone drawers.
@@ -4,6 +4,7 @@
4
4
  import { Vector3 } from "three";
5
5
  import { projectedRadiusPx } from "./bodyDraw.js";
6
6
  import { featureColor, featureKey } from "../shell/bodyFeatures.js";
7
+ import { VIEWER_ROOT_CLASS } from "../shell/viewerKeys.js";
7
8
  /** The donor's `latLonToXYZ`, verbatim: a point on a sphere of `radius`, in the body's own frame (Three.js SphereGeometry UV layout). */
8
9
  export function latLonToXYZ(lat, lon, radius) {
9
10
  const phi = (90 - lat) * (Math.PI / 180); // polar angle from +Y
@@ -34,20 +35,12 @@ export function isFeatureVisible(surfaceNormal, cameraLocalPosition, sphereRadiu
34
35
  export const MARKER_RADIUS_MULTIPLIER = 1.02;
35
36
  /**
36
37
  * Presentation only. A body drawn narrower than this many screen pixels shows no markers (they would crowd into a smudge); the donor's
37
- * moon fills the screen, so it has no such rule. Live through `?featurepx=`.
38
+ * moon fills the screen, so it has no such rule. Set through `Scene.setLook` (`featureMinBodyPx`), or live through `?featurepx=`.
38
39
  */
39
40
  export const DEFAULT_FEATURE_MIN_BODY_PX = 60;
40
- /** `?featurepx=<n>` sets the narrowest body that still shows its markers; an unusable value keeps the default with a console warning. */
41
- export function featureMinBodyPxFromSearch(search, fallback = DEFAULT_FEATURE_MIN_BODY_PX) {
42
- const raw = new URLSearchParams(search).get("featurepx");
43
- if (raw === null)
44
- return fallback;
45
- const value = raw.trim() === "" ? Number.NaN : Number(raw);
46
- if (!Number.isFinite(value) || value < 0 || value > 2000) {
47
- console.warn(`?featurepx=${raw} ignored: the value must be a number from 0 to 2000`);
48
- return fallback;
49
- }
50
- return value;
41
+ /** The narrowest body that still shows its markers: the look's `featureMinBodyPx`, else the default. */
42
+ export function featureMinBodyPxOf(look) {
43
+ return look.featureMinBodyPx ?? DEFAULT_FEATURE_MIN_BODY_PX;
51
44
  }
52
45
  /**
53
46
  * The shell's own panels, which own their screen areas: a marker whose point falls under one is hidden, so a marker never shows through or
@@ -183,7 +176,9 @@ export class FeatureMarkerLayer {
183
176
  return;
184
177
  this.#measuredAt = now;
185
178
  const origin = this.#root.getBoundingClientRect();
186
- this.#occluders = [...document.querySelectorAll(FEATURE_OCCLUDER_SELECTOR)].flatMap((element) => {
179
+ // Only this viewer's own panels count: a second viewer on the page has its own (O-055).
180
+ const viewer = this.#root.closest(`.${VIEWER_ROOT_CLASS}`);
181
+ this.#occluders = [...(viewer?.querySelectorAll(FEATURE_OCCLUDER_SELECTOR) ?? [])].flatMap((element) => {
187
182
  if (this.#root.contains(element))
188
183
  return [];
189
184
  const box = element.getBoundingClientRect();
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { HudSection } from "./SettingControls.js";
2
3
  import { FRAME_BUDGET_MS, fpsTone, frameTone } from "./frameStats.js";
3
4
  /** Developer tools section: how smoothly this browser is drawing the scene. Presentation only. */
4
5
  const GRAPH_WIDTH = 300;
@@ -31,5 +32,5 @@ function overTone(frames) {
31
32
  return frames.overBudget === 0 ? "good" : frames.overBudget * 10 <= frames.frames ? "warn" : "bad";
32
33
  }
33
34
  export function FrameRateSection({ frames, fills, fpsHistory = [] }) {
34
- return (_jsxs("section", { className: "hud-section hud-section-frame", "aria-labelledby": "developer-frame-rate-heading", "data-testid": "frame-rate", children: [_jsx("h4", { id: "developer-frame-rate-heading", children: "Frame rate" }), _jsxs("div", { className: "frame-body", children: [frames === null || frames.frames === 0 ? _jsx("p", { children: "Measuring\u2026" }) : (_jsxs("dl", { className: "frame-readouts", "aria-label": "Frame timing", children: [_jsxs("div", { children: [_jsx("dt", { children: "Frames per second" }), _jsx("dd", { "data-frame-fps": true, className: `tone-${fpsTone(frames.fps)}`, children: frames.fps.toFixed(1) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Longest recent frame" }), _jsxs("dd", { "data-frame-longest": true, className: `tone-${frameTone(frames.longestMs)}`, children: [frames.longestMs.toFixed(1), " ms"] })] }), _jsxs("div", { children: [_jsxs("dt", { children: ["Frames over ", FRAME_BUDGET_MS, " ms"] }), _jsxs("dd", { "data-frame-over": true, className: `tone-${overTone(frames)}`, children: [frames.overBudget, " of ", frames.frames] })] }), fills.map((fill) => _jsxs("div", { children: [_jsxs("dt", { children: ["Position fills: ", fill.id] }), _jsx("dd", { "data-fill-count": fill.id, children: fill.count })] }, fill.id))] })), fpsHistory.length > 1 && (_jsxs("div", { className: "frame-graph", children: [_jsx(FpsGraph, { history: fpsHistory }), _jsxs("p", { className: "fps-graph-key", children: [_jsx("span", { className: "tone-good", children: "\u25CF smooth, 50+" }), _jsx("span", { className: "tone-warn", children: "\u25CF uneven, 30\u201350" }), _jsx("span", { className: "tone-bad", children: "\u25CF rough, under 30" })] })] }))] }), _jsx("p", { children: "These figures are for this browser and machine, measured over the last second or so." })] }));
35
+ return (_jsxs(HudSection, { className: "hud-section hud-section-frame", level: 4, heading: "Frame rate", testId: "frame-rate", children: [_jsxs("div", { className: "frame-body", children: [frames === null || frames.frames === 0 ? _jsx("p", { children: "Measuring\u2026" }) : (_jsxs("dl", { className: "frame-readouts", "aria-label": "Frame timing", children: [_jsxs("div", { children: [_jsx("dt", { children: "Frames per second" }), _jsx("dd", { "data-frame-fps": true, className: `tone-${fpsTone(frames.fps)}`, children: frames.fps.toFixed(1) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Longest recent frame" }), _jsxs("dd", { "data-frame-longest": true, className: `tone-${frameTone(frames.longestMs)}`, children: [frames.longestMs.toFixed(1), " ms"] })] }), _jsxs("div", { children: [_jsxs("dt", { children: ["Frames over ", FRAME_BUDGET_MS, " ms"] }), _jsxs("dd", { "data-frame-over": true, className: `tone-${overTone(frames)}`, children: [frames.overBudget, " of ", frames.frames] })] }), fills.map((fill) => _jsxs("div", { children: [_jsxs("dt", { children: ["Position fills: ", fill.id] }), _jsx("dd", { "data-fill-count": fill.id, children: fill.count })] }, fill.id))] })), fpsHistory.length > 1 && (_jsxs("div", { className: "frame-graph", children: [_jsx(FpsGraph, { history: fpsHistory }), _jsxs("p", { className: "fps-graph-key", children: [_jsx("span", { className: "tone-good", children: "\u25CF smooth, 50+" }), _jsx("span", { className: "tone-warn", children: "\u25CF uneven, 30\u201350" }), _jsx("span", { className: "tone-bad", children: "\u25CF rough, under 30" })] })] }))] }), _jsx("p", { children: "These figures are for this browser and machine, measured over the last second or so." })] }));
35
36
  }
@@ -436,7 +436,7 @@ export class OrbitSetView {
436
436
  uniforms.uFar.value = look.orbitZoomFarRatio;
437
437
  this.layer.families.forEach((family, index) => {
438
438
  uniforms.uColors.value[index].set(look.highlightFamily === family.id ? look.highlightColor : familyColorOf(this.layer, look, family.id));
439
- uniforms.uGains.value[index] = familyGainOf(look, family.id);
439
+ uniforms.uGains.value[index] = familyGainOf(look, family.id, family.brightness);
440
440
  });
441
441
  this.#material.depthTest = trueScale;
442
442
  }
@@ -1,10 +1,18 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  /** A titled group of developer settings. The title names the group for assistive technology too. */
3
- export declare function SettingGroup({ id, title, children }: {
4
- readonly id: string;
3
+ export declare function SettingGroup({ name, title, children }: {
4
+ readonly name: string;
5
5
  readonly title: string;
6
6
  readonly children: ReactNode;
7
7
  }): import("react").JSX.Element;
8
+ /** A developer-drawer section named by its own heading; the heading id is made per viewer. */
9
+ export declare function HudSection({ className, level, heading, testId, children }: {
10
+ readonly className?: string;
11
+ readonly level: 3 | 4;
12
+ readonly heading: ReactNode;
13
+ readonly testId?: string;
14
+ readonly children: ReactNode;
15
+ }): import("react").JSX.Element;
8
16
  /** One slider setting on one row: label on the left, the control in the middle, the value on the right. */
9
17
  export declare function SettingSlider({ label, ariaLabel, testId, display, min, max, step, value, onChange }: {
10
18
  readonly label: string;
@@ -1,7 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from "react";
2
3
  /** A titled group of developer settings. The title names the group for assistive technology too. */
3
- export function SettingGroup({ id, title, children }) {
4
- return (_jsxs("div", { className: "setting-group", role: "group", "aria-labelledby": `setting-group-${id}`, children: [_jsx("h4", { id: `setting-group-${id}`, children: title }), children] }));
4
+ export function SettingGroup({ name, title, children }) {
5
+ const titleId = `${useId()}-title`;
6
+ return (_jsxs("div", { className: "setting-group", role: "group", "aria-labelledby": titleId, "data-setting-group": name, children: [_jsx("h4", { id: titleId, children: title }), children] }));
7
+ }
8
+ /** A developer-drawer section named by its own heading; the heading id is made per viewer. */
9
+ export function HudSection({ className = "hud-section", level, heading, testId, children }) {
10
+ const headingId = `${useId()}-heading`;
11
+ const Heading = level === 3 ? "h3" : "h4";
12
+ return (_jsxs("section", { className: className, "aria-labelledby": headingId, "data-testid": testId, children: [_jsx(Heading, { id: headingId, children: heading }), children] }));
5
13
  }
6
14
  /** One slider setting on one row: label on the left, the control in the middle, the value on the right. */
7
15
  export function SettingSlider({ label, ariaLabel, testId, display, min, max, step, value, onChange }) {
@@ -13,8 +13,10 @@ export interface SkyViewOptions {
13
13
  readonly milkyWay?: boolean;
14
14
  /** Legacy: ready textures, one per tile (a test may pass empty ones). Overrides `picture`. */
15
15
  readonly pictures?: readonly Texture[];
16
- /** The picture to draw, as a tile grid; defaults to the Milky Way picture. `null` draws none until `requestPicture` is called. */
16
+ /** The picture to draw, as a tile grid; defaults to `pictureSet`. `null` draws none until `requestPicture` is called. */
17
17
  readonly picture?: PictureSet | null;
18
+ /** The Milky Way picture of the pictures this viewer was given (`milkyWayPicture(pictures)`); defaults to none, so a sky given no pictures draws no picture. */
19
+ readonly pictureSet?: PictureSet;
18
20
  }
19
21
  /**
20
22
  * The sky: stars and the Milky Way picture at infinity. The group is put on the camera's position every frame, so what is drawn
@@ -52,12 +54,3 @@ export declare class SkyView {
52
54
  }
53
55
  /** The probe direction in the render frame, for tests and the browser check. */
54
56
  export declare const SKY_PROBE_DIRECTION: readonly [number, number, number];
55
- /** `?milkyway=off` or `?milkyway=on` overrides the experience's picture setting for a comparison; anything else is null (no override). */
56
- export declare function milkyWayFromSearch(search: string): boolean | null;
57
- /**
58
- * A brightness override from the address (`?stars=1.4`, `?milkywaybrightness=0.8`): null when absent. A value that is not a number
59
- * from 0 to 2 is ignored with a console warning, never thrown.
60
- */
61
- export declare function brightnessFromSearch(search: string, key: "stars" | "milkywaybrightness"): number | null;
62
- /** `?sky=off` hides the sky for a comparison; anything else keeps the experience's own setting. */
63
- export declare function skyHiddenBySearch(search: string): boolean;
@@ -1,5 +1,5 @@
1
1
  import { AdditiveBlending, BufferAttribute, BufferGeometry, DoubleSide, LinearFilter, LinearMipmapLinearFilter, Group, Mesh, Points, ShaderMaterial, NoColorSpace, TextureLoader, Vector3 } from "three";
2
- import { MILKY_WAY_PICTURE } from "../assets/sky.js";
2
+ import { milkyWayPicture } from "../assets/sky.js";
3
3
  import { buildPictureMesh, buildStarBuffers } from "./skyModel.js";
4
4
  // Both draws sit before everything else in the first pass (the layer-0 pass), ignore depth, and write none.
5
5
  const SKY_ORDER = -1000;
@@ -75,16 +75,18 @@ export class SkyView {
75
75
  #brightness;
76
76
  #maxAnisotropy;
77
77
  #held = false;
78
+ #set;
78
79
  /** `options.picture` is the tile set; the scene passes the one it resolved, a test may pass `pictures` (empty textures). */
79
80
  constructor(options) {
80
81
  const { starBrightness, milkyWayBrightness, pixelRatio, maxAnisotropy = 1 } = options;
81
82
  this.#pictureOn = options.milkyWay ?? false;
82
83
  this.#brightness = milkyWayBrightness;
83
84
  this.#maxAnisotropy = maxAnisotropy;
85
+ this.#set = options.pictureSet ?? milkyWayPicture({});
84
86
  if (options.pictures !== undefined)
85
- this.#build(MILKY_WAY_PICTURE, options.pictures);
87
+ this.#build(this.#set, options.pictures);
86
88
  else if (options.picture !== null)
87
- this.#build(options.picture ?? MILKY_WAY_PICTURE);
89
+ this.#build(options.picture ?? this.#set);
88
90
  this.#starMaterial = new ShaderMaterial({
89
91
  vertexShader: STAR_VERTEX,
90
92
  fragmentShader: STAR_FRAGMENT,
@@ -151,7 +153,7 @@ export class SkyView {
151
153
  /** Builds the Milky Way picture the first time it is wanted (nothing is decoded while the picture stays off); a no-op once a picture is held. */
152
154
  requestPicture() {
153
155
  if (!this.#held)
154
- this.#build(MILKY_WAY_PICTURE);
156
+ this.#build(this.#set);
155
157
  }
156
158
  /** Sets the star strength in place (0 to 2); no rebuild. */
157
159
  setStarBrightness(value) {
@@ -222,27 +224,3 @@ export class SkyView {
222
224
  }
223
225
  /** The probe direction in the render frame, for tests and the browser check. */
224
226
  export const SKY_PROBE_DIRECTION = [PROBE_DIRECTION.x, PROBE_DIRECTION.y, PROBE_DIRECTION.z];
225
- /** `?milkyway=off` or `?milkyway=on` overrides the experience's picture setting for a comparison; anything else is null (no override). */
226
- export function milkyWayFromSearch(search) {
227
- const value = new URLSearchParams(search).get("milkyway");
228
- return value === "off" ? false : value === "on" ? true : null;
229
- }
230
- /**
231
- * A brightness override from the address (`?stars=1.4`, `?milkywaybrightness=0.8`): null when absent. A value that is not a number
232
- * from 0 to 2 is ignored with a console warning, never thrown.
233
- */
234
- export function brightnessFromSearch(search, key) {
235
- const raw = new URLSearchParams(search).get(key);
236
- if (raw === null)
237
- return null;
238
- const value = raw.trim() === "" ? Number.NaN : Number(raw);
239
- if (!Number.isFinite(value) || value < 0 || value > 2) {
240
- console.warn(`?${key}=${raw} ignored: the value must be a number from 0 to 2`);
241
- return null;
242
- }
243
- return value;
244
- }
245
- /** `?sky=off` hides the sky for a comparison; anything else keeps the experience's own setting. */
246
- export function skyHiddenBySearch(search) {
247
- return new URLSearchParams(search).get("sky") === "off";
248
- }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The one place the viewer touches the page address (O-052 T-223). It reads or writes the address only when the host turned `address` on;
3
+ * every parameter reader takes the search text this gives, so a new parameter cannot bypass the switch (`tests/addressRule.test.ts`).
4
+ * The developer data switch navigates the page itself and is the only other reader, listed in that test.
5
+ */
6
+ import { type ViewLinkState } from "./viewLink.js";
7
+ /** The address search (`?a=b`) the viewer may read: the page's when `enabled`, else empty, as if the address carried nothing. */
8
+ export declare function addressSearch(enabled: boolean | undefined): string;
9
+ /**
10
+ * Writes the view link into the address (so a reload keeps the view), then copies the full link. `copied` is false when the clipboard refuses; the caller then shows the link to copy by hand.
11
+ * Only called with the address option on; the copy-link button is not offered otherwise.
12
+ */
13
+ export declare function shareViewLink(state: ViewLinkState): Promise<{
14
+ readonly url: string;
15
+ readonly copied: boolean;
16
+ }>;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * The one place the viewer touches the page address (O-052 T-223). It reads or writes the address only when the host turned `address` on;
3
+ * every parameter reader takes the search text this gives, so a new parameter cannot bypass the switch (`tests/addressRule.test.ts`).
4
+ * The developer data switch navigates the page itself and is the only other reader, listed in that test.
5
+ */
6
+ import { viewLinkSearch } from "./viewLink.js";
7
+ /** The address search (`?a=b`) the viewer may read: the page's when `enabled`, else empty, as if the address carried nothing. */
8
+ export function addressSearch(enabled) {
9
+ return enabled === true ? window.location.search : "";
10
+ }
11
+ /**
12
+ * Writes the view link into the address (so a reload keeps the view), then copies the full link. `copied` is false when the clipboard refuses; the caller then shows the link to copy by hand.
13
+ * Only called with the address option on; the copy-link button is not offered otherwise.
14
+ */
15
+ export async function shareViewLink(state) {
16
+ const search = viewLinkSearch(window.location.search, state);
17
+ try {
18
+ window.history.replaceState(null, "", `${window.location.pathname}${search}${window.location.hash}`);
19
+ }
20
+ catch { /* the link below still works */ }
21
+ const url = `${window.location.origin}${window.location.pathname}${search}`;
22
+ let copied = false;
23
+ try {
24
+ await navigator.clipboard.writeText(url);
25
+ copied = true;
26
+ }
27
+ catch {
28
+ copied = false;
29
+ }
30
+ return { url, copied };
31
+ }
@@ -1,8 +1,10 @@
1
1
  import { BufferAttribute, Group, Sprite } from "three";
2
2
  import type { BodyAsset } from "../assets/catalogue.js";
3
+ import { type Pictures } from "../assets/pictures.js";
3
4
  import type { AtmosphereConfig, BodyMaterialConfig } from "../assets/visual.js";
4
5
  import type { CelestialBodyDefinition } from "../core/body.js";
5
6
  import type { ScalePolicy } from "../core/scalePolicy.js";
7
+ import type { LookInput } from "./look.js";
6
8
  /** The two radii a body is drawn with, in scaled units. Equal for a sphere. */
7
9
  export interface DrawnRadii {
8
10
  readonly equatorial: number;
@@ -16,7 +18,7 @@ export interface DrawnRadii {
16
18
  export declare function drawnRadii(definition: CelestialBodyDefinition, policy: ScalePolicy): DrawnRadii;
17
19
  /**
18
20
  * How a body that would be a speck is drawn. Look-and-feel numbers, not rules: they change how a body is shown, never where it is,
19
- * so they are settings with defaults (Developer > Display settings, or `?markerpx=` in the address).
21
+ * so they are settings with defaults (Developer > Display settings, `Scene.setLook`, or `?markerpx=` in the address).
20
22
  */
21
23
  export interface BodyMarkerSettings {
22
24
  /** A sphere whose drawn radius is under this many screen pixels is drawn as a marker instead. 0 never swaps. */
@@ -29,8 +31,8 @@ export declare const DEFAULT_BODY_MARKER: BodyMarkerSettings;
29
31
  export declare function projectedRadiusPx(radiusUnits: number, distanceUnits: number, fovDeg: number, viewportHeightPx: number): number;
30
32
  /** The marker rule: a sphere is drawn as a marker when its screen radius falls below the threshold; at the threshold it is still a sphere. */
31
33
  export declare function drawsAsMarker(radiusPx: number, settings?: BodyMarkerSettings): boolean;
32
- /** `?markerpx=<n>` sets the swap threshold for a comparison; an unusable value keeps the default with a console warning. */
33
- export declare function markerSettingsFromSearch(search: string, base?: BodyMarkerSettings): BodyMarkerSettings;
34
+ /** The marker settings in force: the default with the look's `markerSwapRadiusPx` laid over it. */
35
+ export declare function markerSettingsOf(look: LookInput, base?: BodyMarkerSettings): BodyMarkerSettings;
34
36
  /** A marker's colour and screen size: the experience's choice, else the record's, else the settings' default. */
35
37
  export declare function markerOf(asset: BodyAsset, override?: {
36
38
  readonly color?: string;
@@ -59,9 +61,10 @@ export interface BodyDrawPlan {
59
61
  }
60
62
  /**
61
63
  * `desktopTextures` (the experience definition's opt-in, default off) lets a body with a desktop texture variant use it from its
62
- * minimum viewport width up; without it the base file is used at any width.
64
+ * minimum viewport width up; without it the base file is used at any width. `pictures` are the ones this viewer was given: a look that names a picture
65
+ * the viewer does not hold is drawn as a flat colour.
63
66
  */
64
- export declare function describeBody(asset: BodyAsset, policy: ScalePolicy, desktopTextures?: boolean): BodyDrawPlan;
67
+ export declare function describeBody(asset: BodyAsset, policy: ScalePolicy, desktopTextures?: boolean, pictures?: Pictures): BodyDrawPlan;
65
68
  /** The live halo settings: the least width on screen, how far it reaches past the body's disc, and its strength. Presentation only. */
66
69
  export interface GlowLook {
67
70
  /** Least width of the halo on screen, px. */
@@ -88,8 +91,8 @@ export declare const GLOW_LIMITS: {
88
91
  readonly max: 6;
89
92
  };
90
93
  };
91
- /** `?sunglow=<px>`, `?sunbrightness=<0..2>` and `?sunglowscale=<1..6>` override the record's halo; an unusable value keeps it with a console warning. */
92
- export declare function glowLookFromSearch(search: string, base: GlowLook): GlowLook;
94
+ /** The halo in force: the record's `base` with the look's `sunGlow` values laid over it. */
95
+ export declare function glowLookOf(look: LookInput, base: GlowLook): GlowLook;
93
96
  /** The first halo any of these bodies' records carries: what the live settings start from. */
94
97
  export declare function baseGlowOf(assets: readonly BodyAsset[]): GlowLook | null;
95
98
  /** The halo's width on screen, px: the setting, or `scale` times the body's projected diameter when that is more. */