astraeus 0.6.0 → 0.8.0

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 (288) hide show
  1. package/CHANGELOG.md +192 -0
  2. package/README.md +205 -34
  3. package/package.json +5 -4
  4. package/src/api/AstraeusScene.d.ts +24 -6
  5. package/src/api/AstraeusScene.js +46 -19
  6. package/src/api/AstraeusScene.node.js +46 -19
  7. package/src/api/assembleScene.d.ts +36 -0
  8. package/src/api/assembleScene.js +175 -0
  9. package/src/api/bodySetChecks.d.ts +10 -0
  10. package/src/api/bodySetChecks.js +117 -0
  11. package/src/api/bodySetInput.d.ts +81 -0
  12. package/src/api/bodySetInput.js +1 -0
  13. package/src/api/containingBlock.d.ts +6 -0
  14. package/src/api/containingBlock.js +16 -0
  15. package/src/api/data.d.ts +17 -5
  16. package/src/api/data.js +28 -10
  17. package/src/api/definitionOf.d.ts +16 -0
  18. package/src/api/definitionOf.js +20 -0
  19. package/src/api/errors.d.ts +61 -1
  20. package/src/api/frozenCopy.d.ts +6 -0
  21. package/src/api/frozenCopy.js +26 -0
  22. package/src/api/group.d.ts +8 -2
  23. package/src/api/group.js +24 -5
  24. package/src/api/index.d.ts +19 -7
  25. package/src/api/index.js +2 -2
  26. package/src/api/index.node.js +2 -2
  27. package/src/api/listeners.d.ts +5 -0
  28. package/src/api/listeners.js +25 -0
  29. package/src/api/look.d.ts +47 -0
  30. package/src/api/look.js +1 -0
  31. package/src/api/lookInput.d.ts +3 -0
  32. package/src/api/lookInput.js +41 -0
  33. package/src/api/moonPanelInput.d.ts +60 -0
  34. package/src/api/moonPanelInput.js +1 -0
  35. package/src/api/mount.d.ts +10 -16
  36. package/src/api/mount.js +27 -11
  37. package/src/api/mount.node.js +27 -11
  38. package/src/api/pathProvenance.d.ts +15 -6
  39. package/src/api/pathProvenance.js +23 -11
  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 +176 -65
  68. package/src/api/scene.js +257 -725
  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/sphereOfInfluence.d.ts +20 -0
  74. package/src/api/sphereOfInfluence.js +48 -0
  75. package/src/api/story.d.ts +49 -19
  76. package/src/api/story.js +54 -22
  77. package/src/api/sunOrbit.js +9 -11
  78. package/src/api/time.d.ts +2 -1
  79. package/src/api/time.js +2 -1
  80. package/src/api/viewerCamera.d.ts +22 -0
  81. package/src/api/viewerCamera.js +84 -0
  82. package/src/api/viewerClock.d.ts +30 -0
  83. package/src/api/viewerClock.js +85 -0
  84. package/src/api/viewerFirstDraw.d.ts +14 -0
  85. package/src/api/viewerFirstDraw.js +26 -0
  86. package/src/api/viewerHandle.d.ts +79 -0
  87. package/src/api/viewerHandle.js +31 -0
  88. package/src/api/viewerLink.d.ts +91 -13
  89. package/src/api/viewerLink.js +111 -64
  90. package/src/api/viewerLooks.d.ts +19 -0
  91. package/src/api/viewerLooks.js +37 -0
  92. package/src/api/viewerPicker.d.ts +22 -0
  93. package/src/api/viewerPicker.js +49 -0
  94. package/src/api/viewerSelection.d.ts +25 -0
  95. package/src/api/viewerSelection.js +31 -0
  96. package/src/api/viewerViews.d.ts +10 -0
  97. package/src/api/viewerViews.js +18 -0
  98. package/src/api/viewerZones.d.ts +20 -0
  99. package/src/api/viewerZones.js +47 -0
  100. package/src/api/views.d.ts +41 -0
  101. package/src/api/views.js +82 -0
  102. package/src/app/App.d.ts +5 -3
  103. package/src/app/App.js +211 -75
  104. package/src/app/App.node.js +211 -75
  105. package/src/app/AstraeusScene.d.ts +19 -2
  106. package/src/app/AstraeusScene.js +4 -4
  107. package/src/app/BodyView.d.ts +4 -1
  108. package/src/app/BodyView.js +2 -2
  109. package/src/app/CameraController.d.ts +12 -0
  110. package/src/app/CameraController.js +3 -1
  111. package/src/app/DeveloperSettings.d.ts +1 -4
  112. package/src/app/DeveloperSettings.js +6 -10
  113. package/src/app/FeatureMarkers.d.ts +4 -3
  114. package/src/app/FeatureMarkers.js +8 -13
  115. package/src/app/FrameRateSection.js +2 -1
  116. package/src/app/OrbitSetView.js +1 -1
  117. package/src/app/SettingControls.d.ts +11 -3
  118. package/src/app/SettingControls.js +10 -2
  119. package/src/app/SkyView.d.ts +3 -10
  120. package/src/app/SkyView.js +6 -28
  121. package/src/app/StoryMarkers.d.ts +4 -1
  122. package/src/app/StoryMarkers.js +3 -2
  123. package/src/app/TrackedBodyView.d.ts +1 -1
  124. package/src/app/TrackedBodyView.js +20 -11
  125. package/src/app/address.d.ts +16 -0
  126. package/src/app/address.js +31 -0
  127. package/src/app/bodyDraw.d.ts +10 -7
  128. package/src/app/bodyDraw.js +12 -32
  129. package/src/app/bodyMetrics.js +2 -2
  130. package/src/app/bodySet.d.ts +4 -20
  131. package/src/app/bodySet.js +5 -16
  132. package/src/app/debugReadout.js +1 -1
  133. package/src/app/displaySwitches.d.ts +4 -0
  134. package/src/app/displaySwitches.js +6 -0
  135. package/src/app/experienceDefinition.d.ts +14 -23
  136. package/src/app/listSwitch.d.ts +8 -14
  137. package/src/app/listSwitch.js +3 -10
  138. package/src/app/liveLook.d.ts +39 -0
  139. package/src/app/liveLook.js +66 -0
  140. package/src/app/look.d.ts +36 -0
  141. package/src/app/look.js +61 -0
  142. package/src/app/mission.d.ts +16 -3
  143. package/src/app/mission.js +16 -1
  144. package/src/app/openClock.d.ts +3 -2
  145. package/src/app/openClock.js +3 -3
  146. package/src/app/sceneCamera.d.ts +2 -0
  147. package/src/app/sceneCamera.js +23 -0
  148. package/src/app/sceneFrame.d.ts +6 -4
  149. package/src/app/sceneFrame.js +55 -14
  150. package/src/app/sceneHooks.js +3 -2
  151. package/src/app/style.css +114 -139
  152. package/src/app/trackedMetrics.d.ts +10 -3
  153. package/src/app/trackedMetrics.js +22 -11
  154. package/src/app/viewHiding.d.ts +13 -0
  155. package/src/app/viewHiding.js +37 -0
  156. package/src/app/viewLink.d.ts +10 -32
  157. package/src/app/viewLink.js +10 -49
  158. package/src/app/viewerPort.d.ts +56 -0
  159. package/src/app/views.d.ts +32 -0
  160. package/src/app/views.js +2 -0
  161. package/src/assets/bodies/galileanMoons.js +1 -2
  162. package/src/assets/bodies/io.js +2 -2
  163. package/src/assets/bodies/listedMoons.d.ts +1 -1
  164. package/src/assets/bodies/listedMoons.js +2 -3
  165. package/src/assets/bodies/planetSystemMaps.js +2 -3
  166. package/src/assets/bodies/venus.js +2 -6
  167. package/src/assets/catalogue.js +1 -2
  168. package/src/assets/licence.d.ts +3 -3
  169. package/src/assets/licence.js +3 -3
  170. package/src/assets/pictures.d.ts +15 -12
  171. package/src/assets/pictures.js +24 -20
  172. package/src/assets/sky.d.ts +6 -5
  173. package/src/assets/sky.js +6 -9
  174. package/src/assets/visual.d.ts +4 -0
  175. package/src/core/bodies/index.d.ts +0 -4
  176. package/src/core/bodies/index.js +1 -6
  177. package/src/core/bodies/jupiterData.d.ts +0 -1
  178. package/src/core/bodies/jupiterData.js +2 -5
  179. package/src/core/bodies/moonSystem.d.ts +1 -1
  180. package/src/core/bodies/moonSystem.js +102 -55
  181. package/src/core/bodies/outerPlanetRingData.js +2 -2
  182. package/src/core/bodies/planetTrajectory.js +1 -1
  183. package/src/core/bodySetFamilies.d.ts +20 -0
  184. package/src/core/bodySetFamilies.js +14 -0
  185. package/src/core/chebyshevEphemeris.js +1 -1
  186. package/src/core/elementsBody.d.ts +8 -4
  187. package/src/core/elementsBody.js +32 -11
  188. package/src/core/elementsGroup.d.ts +27 -0
  189. package/src/core/elementsGroup.js +85 -0
  190. package/src/core/events.d.ts +2 -0
  191. package/src/core/events.js +2 -0
  192. package/src/core/illumination.js +1 -1
  193. package/src/core/listedOrbitGroup.d.ts +2 -0
  194. package/src/core/listedOrbitGroup.js +11 -7
  195. package/src/core/moonListText.d.ts +6 -0
  196. package/src/core/moonListText.js +19 -0
  197. package/src/core/moonTrajectory.js +1 -1
  198. package/src/core/pacing.d.ts +38 -3
  199. package/src/core/pacing.js +55 -4
  200. package/src/core/planetModels.js +2 -2
  201. package/src/core/planetSeries.d.ts +8 -0
  202. package/src/core/planetSeries.js +16 -2
  203. package/src/core/pointGroup.js +1 -1
  204. package/src/core/provenance.d.ts +2 -1
  205. package/src/core/provenance.js +2 -2
  206. package/src/core/referenceCenters.js +5 -5
  207. package/src/core/sampledTrajectory.js +1 -1
  208. package/src/core/scalePolicy.d.ts +1 -0
  209. package/src/core/startView.d.ts +19 -0
  210. package/src/core/startView.js +28 -0
  211. package/src/core/state.d.ts +6 -2
  212. package/src/core/state.js +3 -3
  213. package/src/core/storyPanels.d.ts +63 -0
  214. package/src/core/storyPanels.js +111 -0
  215. package/src/core/sunCentredSources.d.ts +4 -0
  216. package/src/core/sunCentredSources.js +9 -2
  217. package/src/core/timeInput.d.ts +4 -0
  218. package/src/core/timeInput.js +4 -0
  219. package/src/shell/AstraeusShell.d.ts +17 -3
  220. package/src/shell/AstraeusShell.js +60 -13
  221. package/src/shell/AstraeusShell.node.js +60 -13
  222. package/src/shell/Collapsible.d.ts +4 -3
  223. package/src/shell/Collapsible.js +5 -5
  224. package/src/shell/ControlsDrawer.d.ts +1 -1
  225. package/src/shell/ControlsDrawer.js +3 -1
  226. package/src/shell/DisplaySwitches.d.ts +18 -1
  227. package/src/shell/DisplaySwitches.js +20 -6
  228. package/src/shell/InfoPanel.d.ts +3 -1
  229. package/src/shell/InfoPanel.js +5 -4
  230. package/src/shell/MoonFamilyPanel.js +1 -1
  231. package/src/shell/ObjectControls.d.ts +3 -1
  232. package/src/shell/ObjectControls.js +2 -2
  233. package/src/shell/Sources.d.ts +5 -3
  234. package/src/shell/Sources.js +5 -5
  235. package/src/shell/StoryPanelView.d.ts +4 -3
  236. package/src/shell/StoryPanelView.js +8 -6
  237. package/src/shell/SwitchControl.d.ts +5 -11
  238. package/src/shell/SwitchControl.js +2 -20
  239. package/src/shell/TimelineBar.css +84 -66
  240. package/src/shell/TimelineBar.d.ts +5 -2
  241. package/src/shell/TimelineBar.js +37 -11
  242. package/src/shell/TimelineBar.node.js +37 -11
  243. package/src/shell/TopBar.css +22 -22
  244. package/src/shell/TopBar.d.ts +9 -3
  245. package/src/shell/TopBar.js +5 -5
  246. package/src/shell/TopBar.node.js +5 -5
  247. package/src/shell/bootLoader.d.ts +4 -10
  248. package/src/shell/bootLoader.js +6 -52
  249. package/src/shell/embedded.css +18 -18
  250. package/src/shell/experience.d.ts +1 -1
  251. package/src/shell/moonFamilies.d.ts +2 -6
  252. package/src/shell/moonFamilies.js +2 -18
  253. package/src/shell/phone.css +58 -58
  254. package/src/shell/storyPanels.d.ts +2 -53
  255. package/src/shell/storyPanels.js +1 -106
  256. package/src/shell/style.css +153 -134
  257. package/src/shell/timelineModel.d.ts +13 -0
  258. package/src/shell/timelineModel.js +25 -0
  259. package/src/shell/useDrawers.d.ts +3 -2
  260. package/src/shell/useDrawers.js +4 -3
  261. package/src/shell/viewCamera.d.ts +4 -0
  262. package/src/shell/viewCamera.js +13 -0
  263. package/src/shell/viewerKeys.d.ts +8 -0
  264. package/src/shell/viewerKeys.js +16 -0
  265. package/src/synthetic/syntheticDefinition.js +20 -24
  266. package/src/synthetic/syntheticJourneyScene.js +14 -4
  267. package/src/synthetic/syntheticProbeDefinition.js +2 -1
  268. package/src/synthetic/syntheticViewsDefinition.d.ts +3 -0
  269. package/src/synthetic/syntheticViewsDefinition.js +38 -0
  270. package/data/moons/jupiter.json +0 -3333
  271. package/data/moons/neptune.json +0 -555
  272. package/data/moons/pluto.json +0 -205
  273. package/data/moons/saturn.json +0 -8267
  274. package/data/moons/uranus.json +0 -887
  275. package/src/app/addressNavigation.d.ts +0 -17
  276. package/src/app/addressNavigation.js +0 -16
  277. package/src/assets/bodies/jupiterMoonCatalogue.d.ts +0 -3
  278. package/src/assets/bodies/jupiterMoonCatalogue.js +0 -4
  279. package/src/assets/bodies/outerPlanetCatalogues.d.ts +0 -7
  280. package/src/assets/bodies/outerPlanetCatalogues.js +0 -8
  281. package/src/assets/bodies/swiftTuttle.d.ts +0 -12
  282. package/src/assets/bodies/swiftTuttle.js +0 -13
  283. package/src/assets/moonCatalogue.d.ts +0 -49
  284. package/src/assets/moonCatalogue.js +0 -80
  285. package/src/core/bodies/outerPlanetData.d.ts +0 -4
  286. package/src/core/bodies/outerPlanetData.js +0 -13
  287. package/src/core/bodies/swiftTuttle.d.ts +0 -46
  288. package/src/core/bodies/swiftTuttle.js +0 -106
@@ -23,6 +23,6 @@ export function MoonFamilyPanel({ list, highlightedFamily, onHighlight, onSelect
23
23
  const folded = list.families.filter((family) => family !== featured);
24
24
  return (_jsxs("section", { className: "moon-panel", "aria-label": `${list.planetLabel}'s moons`, "data-highlight": highlightedFamily ?? "", children: [_jsx("p", { className: "moon-note moon-summary", "data-moon-summary": moonFamilyListSummary(list), children: moonFamilyListSummary(list) }), _jsxs("label", { className: "moon-search", htmlFor: searchId, children: [_jsx("span", { className: "moon-search-label", children: "Find a moon" }), _jsx("input", { id: searchId, type: "search", className: "moon-search-input", value: query, placeholder: "Name or designation", autoComplete: "off", spellCheck: false, onChange: (event) => setQuery(event.target.value) })] }), searching && (_jsx("div", { className: "moon-results", role: "group", "aria-label": "Search results", "aria-live": "polite", children: matches.length === 0 ? _jsxs("p", { className: "moon-note", children: ["No moon matches \u201C", query.trim(), "\u201D."] }) : (_jsx("ul", { className: "moon-list", children: matches.map(({ moon, familyLabel }) => moonButton(moon, familyLabel)) })) })), _jsxs("div", { className: "moon-families", hidden: searching, children: [featured !== undefined && (_jsxs("div", { className: "moon-featured", "data-moon-family": featured.id, "data-lit": highlightedFamily === featured.id, children: [_jsx("h3", { className: "moon-featured-heading", children: _jsxs("button", { type: "button", className: "ui-row", "aria-pressed": highlightedFamily === featured.id, "data-moon-light": featured.id, onClick: () => onHighlight(highlightedFamily === featured.id ? null : featured.id), children: [_jsx("span", { children: featured.label }), _jsx("span", { className: "moon-count", children: moonCountText(featured.moons.length) })] }) }), _jsx("p", { className: "moon-note", children: featured.description }), _jsx("ul", { className: "moon-pictures", children: featured.moons.map((moon) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "ui-row moon-picture", "data-moon": moon.id, "data-closes-drawer": "", onClick: () => onSelectMoon(moon.id), children: [moon.pictureUrl !== undefined && _jsx("span", { className: "moon-disc", style: { backgroundImage: `url(${moon.pictureUrl})` }, "aria-hidden": "true" }), _jsx("span", { children: moon.label })] }) }, moon.id))) })] })), folded.map((family) => {
25
25
  const { named, unnamed } = splitNamed(family.moons);
26
- return (_jsx("div", { className: "moon-family", "data-moon-family": family.id, "data-lit": highlightedFamily === family.id, children: _jsxs(Collapsible, { id: `moons-${family.id}`, title: `${family.label} (${family.moons.length})`, remember: false, nested: true, onOpenChange: (open) => toggleLight(family, open), children: [_jsx("p", { className: "moon-note", children: family.description }), named.length > 0 && _jsx("ul", { className: "moon-list", children: named.map((moon) => moonButton(moon)) }), unnamed.length > 0 && (_jsx(Collapsible, { id: `moons-${family.id}-unnamed`, title: `+${unnamed.length} unnamed`, remember: false, level: 4, nested: true, children: _jsx("ul", { className: "moon-list", children: unnamed.map((moon) => moonButton(moon)) }) }))] }) }, family.id));
26
+ return (_jsx("div", { className: "moon-family", "data-moon-family": family.id, "data-lit": highlightedFamily === family.id, children: _jsxs(Collapsible, { fold: `moons-${family.id}`, title: `${family.label} (${family.moons.length})`, remember: false, nested: true, onOpenChange: (open) => toggleLight(family, open), children: [_jsx("p", { className: "moon-note", children: family.description }), named.length > 0 && _jsx("ul", { className: "moon-list", children: named.map((moon) => moonButton(moon)) }), unnamed.length > 0 && (_jsx(Collapsible, { fold: `moons-${family.id}-unnamed`, title: `+${unnamed.length} unnamed`, remember: false, level: 4, nested: true, children: _jsx("ul", { className: "moon-list", children: unnamed.map((moon) => moonButton(moon)) }) }))] }) }, family.id));
27
27
  })] })] }));
28
28
  }
@@ -8,6 +8,8 @@ interface Props {
8
8
  readonly onCameraPreset: (preset: ExperienceCameraPreset) => void;
9
9
  readonly infoOpen: boolean;
10
10
  readonly onToggleInfo: () => void;
11
+ /** The id of the information panel the Info button opens, made once per viewer by the shell. */
12
+ readonly infoPanelId: string;
11
13
  }
12
- export declare function ObjectControls({ experience, timeUtcMs, selectedObjectId, activePresetId, onSelectObject, onCameraPreset, infoOpen, onToggleInfo, }: Props): import("react").JSX.Element;
14
+ export declare function ObjectControls({ experience, timeUtcMs, selectedObjectId, activePresetId, onSelectObject, onCameraPreset, infoOpen, onToggleInfo, infoPanelId, }: Props): import("react").JSX.Element;
13
15
  export {};
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { findCameraPreset, focusPresetFor, isObjectAvailable, listedObjects, relatedObjects } from "./objectModel.js";
3
3
  import { ButtonText, FocusIcon, FollowIcon, InfoIcon, OrbitIcon, OverviewIcon } from "./topBarIcons.js";
4
- export function ObjectControls({ experience, timeUtcMs, selectedObjectId, activePresetId, onSelectObject, onCameraPreset, infoOpen, onToggleInfo, }) {
4
+ export function ObjectControls({ experience, timeUtcMs, selectedObjectId, activePresetId, onSelectObject, onCameraPreset, infoOpen, onToggleInfo, infoPanelId, }) {
5
5
  const selected = experience.objects.find((object) => object.id === selectedObjectId);
6
6
  const selectedAvailable = selected !== undefined && isObjectAvailable(selected, timeUtcMs);
7
7
  const overview = findCameraPreset(experience, "overview");
@@ -14,5 +14,5 @@ export function ObjectControls({ experience, timeUtcMs, selectedObjectId, active
14
14
  return (_jsxs("section", { className: "object-controls", "aria-label": "Object and camera controls", children: [_jsx("select", { className: "object-picker", "data-closes-drawer": "", "aria-label": "Select object", value: selectedObjectId, onChange: (event) => onSelectObject(event.target.value), children: listedObjects(experience, selectedObjectId).map((object) => {
15
15
  const available = isObjectAvailable(object, timeUtcMs);
16
16
  return (_jsxs("option", { value: object.id, disabled: !available, "data-available": available, "data-available-from": object.availability?.startUtcMs, "data-available-to": object.availability?.endUtcMs, children: [object.label, available ? "" : " (Unavailable)"] }, object.id));
17
- }) }), _jsxs("button", { type: "button", className: "top-bar-button ui-icon object-info-toggle", "data-closes-drawer": "", "aria-label": selected === undefined ? "Information" : `Information about ${selected.label}`, title: selected === undefined ? "Information" : `Information about ${selected.label}`, "aria-expanded": infoOpen, "aria-controls": "info-panel", disabled: !selectedAvailable, onClick: onToggleInfo, children: [_jsx(InfoIcon, {}), _jsx(ButtonText, { children: "Info" })] }), _jsxs("div", { className: "object-camera-actions", children: [renderPreset(focus), renderPreset(follow), renderPreset(overview), related.map((object) => (_jsxs("button", { type: "button", className: "top-bar-button ui-icon object-related", "aria-label": object.label, title: object.label, "data-related-object": object.id, disabled: !isObjectAvailable(object, timeUtcMs), onClick: () => onSelectObject(object.id), children: [_jsx(OrbitIcon, {}), _jsx(ButtonText, { children: object.label })] }, object.id)))] })] }));
17
+ }) }), _jsxs("button", { type: "button", className: "top-bar-button ui-icon object-info-toggle", "data-closes-drawer": "", "aria-label": selected === undefined ? "Information" : `Information about ${selected.label}`, title: selected === undefined ? "Information" : `Information about ${selected.label}`, "aria-expanded": infoOpen, "aria-controls": infoPanelId, disabled: !selectedAvailable, onClick: onToggleInfo, children: [_jsx(InfoIcon, {}), _jsx(ButtonText, { children: "Info" })] }), _jsxs("div", { className: "object-camera-actions", children: [renderPreset(focus), renderPreset(follow), renderPreset(overview), related.map((object) => (_jsxs("button", { type: "button", className: "top-bar-button ui-icon object-related", "aria-label": object.label, title: object.label, "data-related-object": object.id, disabled: !isObjectAvailable(object, timeUtcMs), onClick: () => onSelectObject(object.id), children: [_jsx(OrbitIcon, {}), _jsx(ButtonText, { children: object.label })] }, object.id)))] })] }));
18
18
  }
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * A collapsible section, closed until tapped (O-020 Decision 4). The credits stay complete and one tap away (PROV-01).
3
- * Shared by the information and story panels. With `details` it is "The details and sources" (O-015 Decision 5): the
4
- * details paragraphs first, then the sources; without, it is "Sources".
3
+ * Shared by the information and story panels. With `details` it is "The details and sources" (O-015 Decision 5); without, it is "Sources".
4
+ * Inside: the details paragraphs, then the `accuracy` and `notes` when given, then the sources.
5
5
  */
6
- export declare function Sources({ sources, details }: {
6
+ export declare function Sources({ sources, details, accuracy, notes }: {
7
7
  readonly sources: readonly string[];
8
8
  readonly details?: readonly string[];
9
+ readonly accuracy?: string;
10
+ readonly notes?: string;
9
11
  }): import("react").JSX.Element;
@@ -1,9 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * A collapsible section, closed until tapped (O-020 Decision 4). The credits stay complete and one tap away (PROV-01).
4
- * Shared by the information and story panels. With `details` it is "The details and sources" (O-015 Decision 5): the
5
- * details paragraphs first, then the sources; without, it is "Sources".
4
+ * Shared by the information and story panels. With `details` it is "The details and sources" (O-015 Decision 5); without, it is "Sources".
5
+ * Inside: the details paragraphs, then the `accuracy` and `notes` when given, then the sources.
6
6
  */
7
- export function Sources({ sources, details = [] }) {
8
- return (_jsxs("details", { className: "sources-section", children: [_jsxs("summary", { className: "ui-button ui-row", children: [details.length > 0 ? _jsx("span", { children: "The details and sources" }) : _jsxs("span", { children: ["Sources ", _jsxs("span", { className: "sources-count", children: ["\u00B7 ", sources.length] })] }), _jsx("svg", { width: "14", height: "14", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.6", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M2 4l4 4 4-4" }) })] }), details.length > 0 && _jsx("div", { className: "sources-details", children: details.map((paragraph) => _jsx("p", { children: paragraph }, paragraph)) }), _jsx("ul", { children: sources.map((source) => _jsx("li", { children: source }, source)) })] }));
7
+ export function Sources({ sources, details = [], accuracy, notes = "" }) {
8
+ return (_jsxs("details", { className: "sources-section", children: [_jsxs("summary", { className: "ui-button ui-row", children: [details.length > 0 ? _jsx("span", { children: "The details and sources" }) : _jsxs("span", { children: ["Sources ", _jsxs("span", { className: "sources-count", children: ["\u00B7 ", sources.length] })] }), _jsx("svg", { width: "14", height: "14", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.6", "aria-hidden": "true", focusable: "false", children: _jsx("path", { d: "M2 4l4 4 4-4" }) })] }), details.length > 0 && _jsx("div", { className: "sources-details", children: details.map((paragraph) => _jsx("p", { children: paragraph }, paragraph)) }), accuracy !== undefined && (_jsxs("dl", { className: "provenance-detail sources-trust", children: [_jsx("dt", { children: "Accuracy" }), _jsx("dd", { children: accuracy }), notes.length > 0 && _jsxs(_Fragment, { children: [_jsx("dt", { children: "Notes" }), _jsx("dd", { children: notes })] })] })), _jsx("ul", { children: sources.map((source) => _jsx("li", { children: source }, source)) })] }));
9
9
  }
@@ -1,7 +1,8 @@
1
- import { type PanelBadge, type StoryPanel } from "./storyPanels.js";
1
+ import type { ProvenanceSourceType } from "../core/provenance.js";
2
+ import type { StoryPanel } from "./storyPanels.js";
2
3
  /** A small pill saying how far to trust a panel's facts, after Planetary Explorer's Badge. */
3
- export declare function StoryBadge({ badge }: {
4
- readonly badge: PanelBadge;
4
+ export declare function StoryBadge({ sourceType }: {
5
+ readonly sourceType: ProvenanceSourceType;
5
6
  }): import("react").JSX.Element;
6
7
  interface Props {
7
8
  readonly panel: StoryPanel;
@@ -1,26 +1,28 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef } from "react";
2
+ import { useEffect, useId, useRef } from "react";
3
+ import { keyIsForViewer } from "./viewerKeys.js";
3
4
  import { Sources } from "./Sources.js";
4
- import { BADGE_LABELS } from "./storyPanels.js";
5
+ import { PROVENANCE_STATUS } from "./infoModel.js";
5
6
  import { useSwipeToDismiss } from "./useSwipeToDismiss.js";
6
7
  import { useZoomThrough } from "./useZoomThrough.js";
7
8
  /** A small pill saying how far to trust a panel's facts, after Planetary Explorer's Badge. */
8
- export function StoryBadge({ badge }) {
9
- return _jsx("span", { className: "story-badge", "data-badge": badge, children: BADGE_LABELS[badge] });
9
+ export function StoryBadge({ sourceType }) {
10
+ return _jsx("span", { className: "story-badge", "data-badge": sourceType, children: PROVENANCE_STATUS[sourceType] });
10
11
  }
11
12
  /**
12
13
  * One story panel: a side panel beside the scene on a wide screen, a bottom sheet with a grab handle on a phone
13
14
  * (the stylesheet chooses). Closing, Escape and a swipe down all dismiss it.
14
15
  */
15
16
  export function StoryPanelView({ panel, holding, onClose, onContinue }) {
17
+ const titleId = `${useId()}-title`;
16
18
  const sheet = useRef(null);
17
19
  useSwipeToDismiss(sheet, onClose);
18
20
  useZoomThrough(sheet);
19
21
  useEffect(() => {
20
- const onKey = (event) => { if (!event.defaultPrevented && event.key === "Escape")
22
+ const onKey = (event) => { if (!event.defaultPrevented && event.key === "Escape" && keyIsForViewer(event, sheet.current))
21
23
  onClose(); };
22
24
  document.addEventListener("keydown", onKey);
23
25
  return () => document.removeEventListener("keydown", onKey);
24
26
  }, [onClose]);
25
- return (_jsxs("aside", { className: "story-panel", ref: sheet, role: "dialog", "aria-modal": "false", "aria-labelledby": "story-panel-title", "data-panel-id": panel.id, children: [_jsx("div", { className: "sheet-handle", "aria-hidden": "true" }), _jsxs("header", { className: "story-panel-header", children: [_jsx(StoryBadge, { badge: panel.badge }), _jsx("button", { type: "button", className: "story-panel-close ui-icon", "aria-label": "Close story panel", onClick: onClose, children: "\u00D7" })] }), _jsx("h2", { id: "story-panel-title", children: panel.title }), _jsx("div", { className: "story-panel-body", children: panel.body.map((paragraph) => _jsx("p", { children: paragraph }, paragraph)) }), _jsx(Sources, { sources: panel.sources, details: panel.details }), holding && _jsx("button", { type: "button", className: "story-panel-continue ui-accent", onClick: onContinue, children: "Continue playback" })] }));
27
+ return (_jsxs("aside", { className: "story-panel", ref: sheet, role: "dialog", "aria-modal": "false", "aria-labelledby": titleId, "data-panel-id": panel.id, children: [_jsx("div", { className: "sheet-handle", "aria-hidden": "true" }), _jsxs("header", { className: "story-panel-header", children: [_jsx(StoryBadge, { sourceType: panel.provenance.sourceType }), _jsx("button", { type: "button", className: "story-panel-close ui-icon", "aria-label": "Close story panel", onClick: onClose, children: "\u00D7" })] }), _jsx("h2", { id: titleId, children: panel.title }), _jsx("div", { className: "story-panel-body", children: panel.body.map((paragraph) => _jsx("p", { children: paragraph }, paragraph)) }), _jsx(Sources, { sources: panel.provenance.sources, details: panel.details, accuracy: panel.provenance.accuracy, notes: panel.provenance.notes }), holding && _jsx("button", { type: "button", className: "story-panel-continue ui-accent", onClick: onContinue, children: "Continue playback" })] }));
26
28
  }
@@ -1,24 +1,18 @@
1
- /** A choice an experience offers between versions of itself (for example which of two related stories to show). Names come from the experience's data, never from the shell. */
1
+ /** A choice a host offers between versions of its scene (a host's picker, `Scene.setPicker`): the control only reports a press, it never reads or writes the address. Names come from the host's data, never from the shell. */
2
2
  export interface ExperienceSwitch {
3
3
  /** The accessible name of the group. */
4
4
  readonly label: string;
5
- /** The address parameter that carries the choice. */
5
+ /** Names the choice; drawn as `data-switch-param`. */
6
6
  readonly param: string;
7
- /** Address parameters the switch carries over to the new version (the clock's `t`, for versions that share one timeline); the camera `view` and the rest are dropped. */
8
- readonly keep?: readonly string[];
9
- /** The clock's time now, in UTC ms: when `keep` names `t`, the switch carries this time, not the one the address was opened with. Given by the app, which owns the clock. */
10
- readonly currentTimeUtcMs?: () => number;
11
- /** Opens the address a choice leads to inside the running page (the entry pushes it into history and rebuilds); absent: the page navigates to it. Given by the entry through the app. */
12
- readonly open?: (address: string) => void;
7
+ /** A press of an option other than the pressed one calls this with the option's value and does nothing else. */
8
+ readonly choose: (value: string) => void;
13
9
  readonly options: readonly {
14
10
  readonly label: string;
15
11
  readonly value: string;
16
12
  readonly active: boolean;
17
13
  }[];
18
14
  }
19
- /** The address a choice leads to: the current one with the parameter set, and the camera view and time dropped (each version opens on its own) unless `keep` names the time; a kept time is `timeUtcMs` (the clock now) when given. */
20
- export declare function switchAddress(href: string, param: string, value: string, keep?: readonly string[], timeUtcMs?: number): string;
21
- /** One button per option in the top bar (and the phone drawer); choosing one asks for the new address to be opened. Fewer than two options: nothing to choose, no control. */
15
+ /** One button per option in the top bar (and the phone drawer); choosing one reports it to the host. Fewer than two options: nothing to choose, no control. */
22
16
  export declare function SwitchControl({ choice }: {
23
17
  readonly choice: ExperienceSwitch;
24
18
  }): import("react").JSX.Element | null;
@@ -1,26 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- /** The address a choice leads to: the current one with the parameter set, and the camera view and time dropped (each version opens on its own) unless `keep` names the time; a kept time is `timeUtcMs` (the clock now) when given. */
3
- export function switchAddress(href, param, value, keep = [], timeUtcMs) {
4
- const url = new URL(href);
5
- url.searchParams.set(param, value);
6
- // The clock's time at the press (whole seconds, as the view link writes it) replaces whatever `t` the address was opened with.
7
- if (keep.includes("t") && timeUtcMs !== undefined)
8
- url.searchParams.set("t", new Date(Math.round(timeUtcMs / 1000) * 1000).toISOString());
9
- for (const own of ["view", "t"])
10
- if (!keep.includes(own))
11
- url.searchParams.delete(own);
12
- return url.toString();
13
- }
14
- function openAddress(choice, address) {
15
- if (choice.open !== undefined)
16
- choice.open(address);
17
- else
18
- window.location.assign(address);
19
- }
20
- /** One button per option in the top bar (and the phone drawer); choosing one asks for the new address to be opened. Fewer than two options: nothing to choose, no control. */
2
+ /** One button per option in the top bar (and the phone drawer); choosing one reports it to the host. Fewer than two options: nothing to choose, no control. */
21
3
  export function SwitchControl({ choice }) {
22
4
  if (choice.options.length < 2)
23
5
  return null;
24
6
  return (_jsx("section", { className: "switch-control", role: "group", "aria-label": choice.label, "data-switch-param": choice.param, children: choice.options.map((option) => (_jsx("button", { type: "button", className: `switch-option top-bar-button ${option.active ? "ui-accent" : ""}`, "aria-pressed": option.active, "data-switch-value": option.value, onClick: () => { if (!option.active)
25
- openAddress(choice, switchAddress(window.location.href, choice.param, option.value, choice.keep, choice.currentTimeUtcMs?.())); }, children: _jsx("span", { children: option.label }) }, option.value))) }));
7
+ choice.choose(option.value); }, children: _jsx("span", { children: option.label }) }, option.value))) }));
26
8
  }
@@ -1,5 +1,5 @@
1
1
  /* The timeline bar: one slim line on larger screens, two lines on phones and tablets (T-080, O-020). Its rules live here, beside TimelineBar.tsx. */
2
- .timeline-bar {
2
+ .astraeus-shell .timeline-bar {
3
3
  position: absolute;
4
4
  z-index: 3;
5
5
  right: 12px;
@@ -14,11 +14,14 @@
14
14
  backdrop-filter: blur(10px);
15
15
  }
16
16
  /* The open Events list rises over the panel rather than hiding behind it. */
17
- .timeline-bar:has(.timeline-event-list[open]) { z-index: 5; }
17
+ .astraeus-shell .timeline-bar:has(.timeline-event-list[open]) { z-index: 5; }
18
+ /* An open marker group lists above the bar; the bar rises over the phone information sheet (z-index 8) so each item stays reachable (O-050 T-217). */
19
+ .astraeus-shell .timeline-bar:has(.timeline-group-list),
20
+ .astraeus-shell[data-phone="true"] .timeline-bar:has(.timeline-group-list) { z-index: 9; }
18
21
 
19
- .timeline-main-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
20
- .timeline-transport { display: flex; flex: 0 0 auto; gap: 4px; }
21
- .timeline-time {
22
+ .astraeus-shell .timeline-main-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
23
+ .astraeus-shell .timeline-transport { display: flex; flex: 0 0 auto; gap: 4px; }
24
+ .astraeus-shell .timeline-time {
22
25
  /* A fixed width: the stamp changes length as it plays (milliseconds appear and vanish) and must not shift the scrubber beside it. */
23
26
  flex: 0 0 24ch;
24
27
  width: 24ch;
@@ -26,16 +29,16 @@
26
29
  font-variant-numeric: tabular-nums;
27
30
  white-space: nowrap;
28
31
  }
29
- .timeline-time-short { display: none; }
30
- .timeline-speed { display: flex; flex: 0 0 auto; align-items: center; color: var(--ui-muted, #c7bdb3); }
31
- .timeline-speed > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
32
- .timeline-bar .timeline-speed select { width: 210px; max-width: 30vw; }
33
- .timeline-scrubber { display: flex; flex: 1 1 0; flex-direction: column; gap: 1px; min-width: 0; }
32
+ .astraeus-shell .timeline-time-short { display: none; }
33
+ .astraeus-shell .timeline-speed { display: flex; flex: 0 0 auto; align-items: center; color: var(--ui-muted, #c7bdb3); }
34
+ .astraeus-shell .timeline-speed > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
35
+ .astraeus-shell .timeline-bar .timeline-speed select { width: 210px; max-width: 30vw; }
36
+ .astraeus-shell .timeline-scrubber { display: flex; flex: 1 1 0; flex-direction: column; gap: 1px; min-width: 0; }
34
37
 
35
38
  /* Events: a button on the line; what just happened, what is next and the full list open above it. */
36
- .timeline-event-list { position: relative; flex: 0 0 auto; }
37
- .timeline-event-list summary span { color: var(--ui-data, #b1a1df); }
38
- .timeline-expanded {
39
+ .astraeus-shell .timeline-event-list { position: relative; flex: 0 0 auto; }
40
+ .astraeus-shell .timeline-event-list summary span { color: var(--ui-data, #b1a1df); }
41
+ .astraeus-shell .timeline-expanded {
39
42
  position: absolute;
40
43
  z-index: 6;
41
44
  right: 0;
@@ -52,73 +55,88 @@
52
55
  background: rgba(13, 13, 13, .97);
53
56
  box-shadow: 0 8px 24px rgba(0, 0, 0, .42);
54
57
  }
55
- .timeline-expanded ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
56
- .timeline-expanded li { margin: 0; padding: 0; }
57
- .timeline-expanded li button { justify-content: flex-start; align-items: baseline; gap: 10px; }
58
- .timeline-expanded li time { flex: 0 0 auto; color: var(--ui-data, #b1a1df); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
59
- .timeline-expanded li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
60
- .timeline-event-context { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 4px 6px; border-bottom: 1px solid #2b2927; color: var(--ui-muted, #c7bdb3); }
61
- .timeline-event-context > span { padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
58
+ .astraeus-shell .timeline-expanded ol { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
59
+ .astraeus-shell .timeline-expanded li { margin: 0; padding: 0; }
60
+ .astraeus-shell :where(.timeline-expanded) li button { justify-content: flex-start; align-items: baseline; gap: 10px; }
61
+ .astraeus-shell .timeline-expanded li time { flex: 0 0 auto; color: var(--ui-data, #b1a1df); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
62
+ .astraeus-shell .timeline-expanded li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
63
+ .astraeus-shell .timeline-event-context { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 2px 4px 6px; border-bottom: 1px solid #2b2927; color: var(--ui-muted, #c7bdb3); }
64
+ .astraeus-shell .timeline-event-context > span { padding: 2px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
62
65
  .astraeus-shell .timeline-event-current { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
63
- .timeline-event-current span { color: var(--ui-data, #b1a1df); }
64
- .timeline-event-context strong { color: var(--ui-color, #f0e6da); font-weight: 600; }
66
+ .astraeus-shell .timeline-event-current span { color: var(--ui-data, #b1a1df); }
67
+ .astraeus-shell .timeline-event-context strong { color: var(--ui-color, #f0e6da); font-weight: 600; }
65
68
 
66
69
  /* The scrubber, its event marks and the activity glow. */
67
- .timeline-track { position: relative; display: flex; align-items: center; height: 22px; }
68
- .timeline-track input[type="range"] { position: relative; z-index: 1; width: 100%; height: 22px; margin: 0; accent-color: var(--ui-accent, #fc6323); background: transparent; cursor: pointer; }
69
- .timeline-markers { position: absolute; z-index: 2; inset: 0 8px; pointer-events: none; }
70
- .timeline-marker { position: absolute; top: calc(50% - 10px); width: 18px; min-height: 20px !important; height: 20px; padding: 0 !important; border: 0 !important; border-radius: 3px !important; background: transparent !important; opacity: .9; transform: translateX(-50%); pointer-events: auto; }
71
- .timeline-marker::after { display: block; width: 2px; height: 14px; margin: auto; border-radius: 2px; background: var(--ui-data, #b1a1df); content: ""; }
72
- .timeline-marker:hover::after,
73
- .timeline-marker:focus-visible::after { background: var(--ui-accent, #fc6323); }
70
+ .astraeus-shell .timeline-track { position: relative; display: flex; align-items: center; height: 22px; }
71
+ .astraeus-shell :where(.timeline-track) input[type="range"] { position: relative; z-index: 1; width: 100%; height: 22px; margin: 0; accent-color: var(--ui-accent, #fc6323); background: transparent; cursor: pointer; }
72
+ .astraeus-shell .timeline-markers { position: absolute; z-index: 2; inset: 0 8px; pointer-events: none; }
73
+ .astraeus-shell .timeline-marker { position: absolute; top: calc(50% - 10px); width: 18px; min-height: 20px !important; height: 20px; padding: 0 !important; border: 0 !important; border-radius: 3px !important; background: transparent !important; opacity: .9; transform: translateX(-50%); pointer-events: auto; }
74
+ .astraeus-shell .timeline-marker::after { display: block; width: 2px; height: 14px; margin: auto; border-radius: 2px; background: var(--ui-data, #b1a1df); content: ""; }
75
+ .astraeus-shell .timeline-marker:hover::after,
76
+ .astraeus-shell .timeline-marker:focus-visible::after { background: var(--ui-accent, #fc6323); }
74
77
  /* T-084: the activity is a glow inside the track. The input's own track turns transparent; the glow (brightness follows the rate) sits behind it, the played part keeps the accent colour, and the thumb stays a clear disc. */
75
- .timeline-glow { position: absolute; z-index: 0; top: 50%; right: 8px; left: 8px; height: var(--glow-thickness, 6px); transform: translateY(-50%); border-radius: 999px; pointer-events: none; }
76
- .timeline-glow-ahead,
77
- .timeline-glow-line { position: absolute; inset: 0; border-radius: inherit; background: var(--glow-ahead); }
78
- .timeline-glow-ahead::after,
79
- .timeline-glow-line::after { position: absolute; inset: 0; border-radius: inherit; background: inherit; filter: blur(var(--glow-halo, 7px)); content: ""; }
78
+ .astraeus-shell .timeline-glow { position: absolute; z-index: 0; top: 50%; right: 8px; left: 8px; height: var(--glow-thickness, 6px); transform: translateY(-50%); border-radius: 999px; pointer-events: none; }
79
+ .astraeus-shell .timeline-glow-ahead,
80
+ .astraeus-shell .timeline-glow-line { position: absolute; inset: 0; border-radius: inherit; background: var(--glow-ahead); }
81
+ .astraeus-shell .timeline-glow-ahead::after,
82
+ .astraeus-shell .timeline-glow-line::after { position: absolute; inset: 0; border-radius: inherit; background: inherit; filter: blur(var(--glow-halo, 7px)); content: ""; }
80
83
  /* The played part is the same shape in the accent colour, clipped at the playhead (the clip leaves room above and below for the halo). */
81
- .timeline-glow-played { position: absolute; inset: 0; clip-path: inset(-24px var(--glow-played-edge, 100%) -24px -24px); }
82
- .timeline-glow-line { background: var(--glow-played); }
84
+ .astraeus-shell .timeline-glow-played { position: absolute; inset: 0; clip-path: inset(-24px var(--glow-played-edge, 100%) -24px -24px); }
85
+ .astraeus-shell .timeline-glow-line { background: var(--glow-played); }
83
86
  /* The peak mark rides above the line (diamond and a short stem), so an event or story-panel mark that falls on the peak stays pressable at the line itself. */
84
- .timeline-marker.timeline-window-peak { top: calc(50% - 18px); width: 16px; min-height: 12px !important; height: 12px; }
85
- .timeline-window-peak::before { position: absolute; top: 7px; left: 50%; height: 9px; border-left: 1px solid var(--ui-accent, #fc6323); content: ""; }
86
- .timeline-window-peak::after { width: 9px !important; height: 9px !important; margin-top: 1.5px !important; border-radius: 1px !important; background: var(--ui-accent, #fc6323) !important; box-shadow: 0 0 0 2px rgba(13, 13, 13, .8); transform: rotate(45deg); }
87
- .timeline-track .timeline-marker::after { background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 1px rgba(13, 13, 13, .6); }
88
- .timeline-track .timeline-marker:hover::after,
89
- .timeline-track .timeline-marker:focus-visible::after { background: var(--ui-accent, #fc6323); }
90
- .timeline-track input[type="range"] { -webkit-appearance: none; appearance: none; }
91
- .timeline-track input[type="range"]::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
92
- .timeline-track input[type="range"]::-moz-range-track { height: 22px; background: transparent; border: 0; }
93
- .timeline-track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 3px; border: 2px solid var(--ui-accent, #fc6323); border-radius: 50%; background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 2px rgba(13, 13, 13, .85), 0 1px 6px rgba(0, 0, 0, .6); }
94
- .timeline-track input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 16px; border: 2px solid var(--ui-accent, #fc6323); border-radius: 50%; background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 2px rgba(13, 13, 13, .85), 0 1px 6px rgba(0, 0, 0, .6); }
95
- .timeline-track input[type="range"]:focus-visible { outline: 2px solid var(--ui-accent, #fc6323); outline-offset: 2px; border-radius: 8px; }
96
- .timeline-bar .timeline-marker-label { display: none; bottom: calc(100% + 6px); left: 50%; max-width: min(300px, 65vw); color: var(--ui-color, #f0e6da); transform: translateX(-50%); }
97
- .timeline-bar .timeline-marker:hover .timeline-marker-label,
98
- .timeline-bar .timeline-marker:focus .timeline-marker-label { display: block; }
99
- .timeline-bounds { display: none; justify-content: space-between; color: var(--ui-subtle, #a99e94); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
100
- .timeline-panel-marker::after { width: 8px !important; height: 8px !important; border: 1.5px solid var(--ui-accent, #fc6323); border-radius: 50% !important; background: rgba(0, 0, 0, .55) !important; }
101
- .timeline-panel-marker[aria-pressed="true"]::after { background: var(--ui-accent, #fc6323) !important; }
87
+ .astraeus-shell .timeline-marker.timeline-window-peak { top: calc(50% - 18px); width: 16px; min-height: 12px !important; height: 12px; }
88
+ .astraeus-shell .timeline-window-peak::before { position: absolute; top: 7px; left: 50%; height: 9px; border-left: 1px solid var(--ui-accent, #fc6323); content: ""; }
89
+ .astraeus-shell .timeline-window-peak::after { width: 9px !important; height: 9px !important; margin-top: 1.5px !important; border-radius: 1px !important; background: var(--ui-accent, #fc6323) !important; box-shadow: 0 0 0 2px rgba(13, 13, 13, .8); transform: rotate(45deg); }
90
+ .astraeus-shell .timeline-track .timeline-marker::after { background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 1px rgba(13, 13, 13, .6); }
91
+ .astraeus-shell .timeline-track .timeline-marker:hover::after,
92
+ .astraeus-shell .timeline-track .timeline-marker:focus-visible::after { background: var(--ui-accent, #fc6323); }
93
+ .astraeus-shell .timeline-track input[type="range"] { -webkit-appearance: none; appearance: none; }
94
+ .astraeus-shell .timeline-track input[type="range"]::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
95
+ .astraeus-shell .timeline-track input[type="range"]::-moz-range-track { height: 22px; background: transparent; border: 0; }
96
+ .astraeus-shell .timeline-track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 3px; border: 2px solid var(--ui-accent, #fc6323); border-radius: 50%; background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 2px rgba(13, 13, 13, .85), 0 1px 6px rgba(0, 0, 0, .6); }
97
+ .astraeus-shell .timeline-track input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 16px; height: 16px; border: 2px solid var(--ui-accent, #fc6323); border-radius: 50%; background: var(--ui-color, #f0e6da); box-shadow: 0 0 0 2px rgba(13, 13, 13, .85), 0 1px 6px rgba(0, 0, 0, .6); }
98
+ .astraeus-shell :where(.timeline-track) input[type="range"]:focus-visible { outline: 2px solid var(--ui-accent, #fc6323); outline-offset: 2px; border-radius: 8px; }
99
+ .astraeus-shell .timeline-bar .timeline-marker-label { display: none; bottom: calc(100% + 6px); left: 50%; max-width: min(300px, 65vw); color: var(--ui-color, #f0e6da); transform: translateX(-50%); }
100
+ .astraeus-shell .timeline-bar .timeline-marker:hover .timeline-marker-label,
101
+ .astraeus-shell .timeline-bar .timeline-marker:focus .timeline-marker-label { display: block; }
102
+ .astraeus-shell .timeline-bounds { display: none; justify-content: space-between; color: var(--ui-subtle, #a99e94); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric: tabular-nums; }
103
+ .astraeus-shell .timeline-panel-marker::after { width: 8px !important; height: 8px !important; border: 1.5px solid var(--ui-accent, #fc6323); border-radius: 50% !important; background: rgba(0, 0, 0, .55) !important; }
104
+ .astraeus-shell .timeline-panel-marker[aria-pressed="true"]::after { background: var(--ui-accent, #fc6323) !important; }
102
105
  .astraeus-shell:has(.timeline-bar) .shell-top { --shell-timeline-space: 84px; }
103
106
 
104
107
  /* Tablets and phones: two lines. Transport, time and speed above; scrubber and Events below. Sizes of the controls come from controls.css. */
105
108
  @media (max-width: 900px) {
106
- .timeline-bar { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 8px; padding: 8px; }
107
- .timeline-main-row { flex-wrap: wrap; gap: 4px 6px; }
108
- .timeline-transport { gap: 0; }
109
- .timeline-time { margin-left: auto; font-size: 12px; }
110
- .timeline-bar .timeline-speed select { width: 180px; }
109
+ .astraeus-shell .timeline-bar { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 8px; padding: 8px; }
110
+ .astraeus-shell .timeline-main-row { flex-wrap: wrap; gap: 4px 6px; }
111
+ .astraeus-shell .timeline-transport { gap: 0; }
112
+ .astraeus-shell .timeline-time { margin-left: auto; font-size: 12px; }
113
+ .astraeus-shell .timeline-bar .timeline-speed select { width: 180px; }
111
114
  /* Line two (scrubber, Events) starts on its own row: the scrubber is too wide to share line one. */
112
- .timeline-scrubber { order: 4; flex: 1 1 calc(100% - 128px); }
113
- .timeline-event-list { order: 5; }
114
- .timeline-track { height: 44px; }
115
- .timeline-track input[type="range"] { height: 44px; }
115
+ .astraeus-shell .timeline-scrubber { order: 4; flex: 1 1 calc(100% - 128px); }
116
+ .astraeus-shell .timeline-event-list { order: 5; }
117
+ .astraeus-shell .timeline-track { height: 44px; }
118
+ .astraeus-shell .timeline-track input[type="range"] { height: 44px; }
116
119
  .astraeus-shell:has(.timeline-bar) .shell-top { --shell-timeline-space: 150px; }
117
120
  }
118
121
  @media (prefers-reduced-motion: reduce) {
119
- .timeline-bar { scroll-behavior: auto; transition: none !important; }
122
+ .astraeus-shell .timeline-bar { scroll-behavior: auto; transition: none !important; }
120
123
  }
121
124
 
122
125
  /* No timeline (experience.hideTimeline): nothing sits at the bottom, so nothing is reserved for it on a wide or a phone screen. */
123
- main.astraeus-shell[data-timeline-hidden="true"] { --timeline-space: 0px; }
124
- main.astraeus-shell[data-timeline-hidden="true"] .shell-top { --shell-timeline-space: 0px; }
126
+ .astraeus-shell:is(main)[data-timeline-hidden="true"] { --timeline-space: 0px; }
127
+ .astraeus-shell:is(main)[data-timeline-hidden="true"] .shell-top { --shell-timeline-space: 0px; }
128
+
129
+ /* Markers that sit closer than the minimum spacing gather under one numbered mark; pressing it lists them, each a full-size button. The list opens above the track, aligned to the screen side the mark is near so it stays on a phone. */
130
+ .astraeus-shell .timeline-marker-group { position: absolute; top: 0; height: 100%; width: 18px; transform: translateX(-50%); pointer-events: none; }
131
+ .astraeus-shell .timeline-marker-group .timeline-group-toggle { left: 0; width: 100%; pointer-events: auto; }
132
+ .astraeus-shell .timeline-marker-group .timeline-group-toggle::after { display: none; }
133
+ .astraeus-shell .timeline-group-count { display: block; width: 18px; height: 18px; border: 1.5px solid var(--ui-accent, #fc6323); border-radius: 50%; background: rgba(13, 13, 13, .85); color: var(--ui-color, #f0e6da); font: 600 11px/15px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }
134
+ .astraeus-shell .timeline-group-toggle:hover .timeline-group-count,
135
+ .astraeus-shell .timeline-group-toggle:focus-visible .timeline-group-count,
136
+ .astraeus-shell .timeline-group-toggle[aria-expanded="true"] .timeline-group-count { background: var(--ui-accent, #fc6323); color: #0d0d0d; }
137
+ .astraeus-shell .timeline-group-list { position: absolute; z-index: 3; bottom: calc(100% + 6px); left: 50%; display: flex; flex-direction: column; gap: 2px; width: max-content; max-width: min(300px, calc(100vw - 32px)); max-height: 40vh; margin: 0; padding: 4px; overflow-y: auto; border: 1px solid #2b2927; border-radius: 6px; background: rgba(13, 13, 13, .95); list-style: none; transform: translateX(-50%); pointer-events: auto; }
138
+ .astraeus-shell .timeline-marker-group[data-align="start"] .timeline-group-list { left: 0; transform: none; }
139
+ .astraeus-shell .timeline-marker-group[data-align="end"] .timeline-group-list { right: 0; left: auto; transform: none; }
140
+ .astraeus-shell :where(.timeline-group-item) { display: block; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; color: var(--ui-color, #f0e6da); font: inherit; text-align: left; white-space: normal; cursor: pointer; }
141
+ .astraeus-shell .timeline-group-item:hover,
142
+ .astraeus-shell .timeline-group-item:focus-visible { background: #2b2927; }
@@ -33,18 +33,21 @@ interface Props {
33
33
  readonly onOpenChange: (open: boolean) => void;
34
34
  readonly swipeThresholdPx: number;
35
35
  };
36
+ /** The id of the information panel the event buttons open, made once per viewer by the shell. */
37
+ readonly infoPanelId: string;
36
38
  }
37
- export declare function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels, openPanelId, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook, drawer }: Props): import("react").JSX.Element;
39
+ export declare function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels, openPanelId, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook, drawer, infoPanelId }: Props): import("react").JSX.Element;
38
40
  interface ExpandedProps {
39
41
  readonly experience: ExperienceConfig;
40
42
  readonly snapshot: ClockSnapshot;
41
43
  readonly onEventSeek: (event: TimelineEvent) => void;
42
44
  readonly onEventInfo: (event: TimelineEvent) => void;
43
45
  readonly onWindowInfo: (window: TimelineWindow) => void;
46
+ readonly infoPanelId: string;
44
47
  }
45
48
  /**
46
49
  * The timeline's expanded content: "Just happened / Up next / Inside" and the full event list.
47
50
  * On larger screens it opens from the Events button; the phone drawer shows the same content when expanded.
48
51
  */
49
- export declare function TimelineExpanded({ experience, snapshot, onEventSeek, onEventInfo, onWindowInfo }: ExpandedProps): import("react").JSX.Element;
52
+ export declare function TimelineExpanded({ experience, snapshot, onEventSeek, onEventInfo, onWindowInfo, infoPanelId }: ExpandedProps): import("react").JSX.Element;
50
53
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, useState } from "react";
3
- import { eventContextAt, eventPositionPercent, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent, speedsOf, TIMELINE_STEP_MS, clampToBounds, formatRateCompact, formatRate } from "./timelineModel.js";
2
+ import { useEffect, useId, useMemo, useRef, useState } from "react";
3
+ import { eventContextAt, formatUtcTimestamp, formatWindowRate, navigationStops, windowContextAt, timePositionPercent, speedsOf, TIMELINE_STEP_MS, clampToBounds, formatRateCompact, formatRate, groupMarkers } from "./timelineModel.js";
4
4
  import { activityAt, DEFAULT_TIMELINE_GLOW, glowDescription, glowGradient, glowProfile, glowTooltip } from "./timelineGlow.js";
5
5
  import { Label } from "./Label.js";
6
6
  import { useDrawerSwipe } from "./useDrawerSwipe.js";
@@ -19,7 +19,8 @@ function seekValueText(timeUtcMs, activityNow) {
19
19
  return formatUtcTimestamp(timeUtcMs);
20
20
  return `${formatUtcTimestamp(timeUtcMs)}, ${activityNow.window.label}: ${formatWindowRate(activityNow.rate, activityNow.window.rate.unit)}`;
21
21
  }
22
- export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer }) {
22
+ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChange, paceAuto, onSeek, panels = [], openPanelId = null, onPanelOpen, onEventSeek, onEventInfo, onWindowSeek, onWindowInfo, glowLook = DEFAULT_TIMELINE_GLOW, drawer, infoPanelId }) {
23
+ const drawerId = `${useId()}-timeline-drawer`;
23
24
  const windows = experience.windows ?? [];
24
25
  const profile = useMemo(() => glowProfile(windows, experience.window), [windows, experience.window]);
25
26
  const gradients = useMemo(() => ({ ahead: glowGradient(profile, glowLook, "ahead"), played: glowGradient(profile, glowLook, "played") }), [profile, glowLook]);
@@ -53,19 +54,44 @@ export function TimelineBar({ experience, snapshot, onTogglePlayback, onRateChan
53
54
  });
54
55
  const speedIndex = Math.max(0, speeds.findIndex((speed) => speed.rate === snapshot.rate));
55
56
  const speedText = paceAuto === true ? autoLabel(true, snapshot.rate) : speeds[speedIndex]?.label;
57
+ const markersRef = useRef(null);
58
+ const [trackWidth, setTrackWidth] = useState(0);
59
+ const [openGroup, setOpenGroup] = useState(null);
60
+ useEffect(() => {
61
+ const node = markersRef.current;
62
+ if (node === null)
63
+ return undefined;
64
+ const measure = () => { const width = node.getBoundingClientRect().width; if (width > 0)
65
+ setTrackWidth(width); };
66
+ measure();
67
+ if (typeof ResizeObserver === "undefined")
68
+ return undefined;
69
+ const observer = new ResizeObserver(measure);
70
+ observer.observe(node);
71
+ return () => observer.disconnect();
72
+ }, [drawer?.open]);
73
+ const markers = [
74
+ ...experience.events.map((event) => ({ kind: "event", key: event.id, timeUtcMs: event.timeUtcMs, text: event.label, ariaLabel: `Go to ${event.label}`, activate: () => { onEventSeek(event); onEventInfo(event); } })),
75
+ ...panels.map((panel) => ({ kind: "panel", key: panel.id, timeUtcMs: panel.timeUtcMs, text: panel.title, ariaLabel: `Open story panel: ${panel.title}`, activate: () => onPanelOpen?.(panel) })),
76
+ ...windows.flatMap((window) => window.peakUtcMs === undefined ? [] : [{ kind: "peak", key: `peak-${window.id}`, timeUtcMs: window.peakUtcMs, text: `${window.label} peak`, ariaLabel: `Go to peak of ${window.label}`, activate: () => { onWindowSeek(window, window.peakUtcMs ?? 0); onWindowInfo(window); } }]),
77
+ ];
78
+ const groups = groupMarkers(markers, experience.window, trackWidth);
79
+ const renderMarker = (marker, percent) => marker.kind === "event" ? (_jsx("button", { className: "timeline-marker", type: "button", "aria-label": marker.ariaLabel, title: marker.text, style: { left: `${percent}%` }, onClick: marker.activate, children: _jsx(Label, { text: marker.text, className: "timeline-marker-label" }) }, marker.key)) : marker.kind === "panel" ? (_jsx("button", { className: "timeline-marker timeline-panel-marker", type: "button", "data-panel-id": marker.key, "aria-pressed": openPanelId === marker.key, "aria-label": marker.ariaLabel, title: marker.text, style: { left: `${percent}%` }, onClick: marker.activate, children: _jsx(Label, { text: marker.text, className: "timeline-marker-label" }) }, marker.key)) : (_jsx("button", { type: "button", className: "timeline-marker timeline-window-peak", "aria-label": marker.ariaLabel, title: marker.text, "data-time-utc-ms": marker.timeUtcMs, style: { left: `${percent}%` }, onClick: marker.activate }, marker.key));
56
80
  const scrubber = (_jsxs("div", { className: "timeline-scrubber", children: [_jsxs("div", { className: "timeline-track", title: profile === null ? undefined : hoverTitle ?? description, onPointerMove: moveOnTrack, onPointerLeave: () => setHoverTitle(null), children: [_jsxs("div", { className: "timeline-glow", ...(description === "" ? { "aria-hidden": true } : { role: "img", "aria-label": description }), style: {
57
81
  "--glow-ahead": gradients.ahead,
58
82
  "--glow-played": gradients.played,
59
83
  "--glow-played-edge": `${(100 - playedPercent).toFixed(3)}%`,
60
84
  "--glow-thickness": `${glowLook.thicknessPx}px`,
61
85
  "--glow-halo": `${glowLook.haloPx}px`,
62
- }, children: [_jsx("span", { className: "timeline-glow-ahead" }), _jsx("span", { className: "timeline-glow-played", children: _jsx("span", { className: "timeline-glow-line" }) })] }), _jsxs("div", { className: "timeline-markers", "aria-label": "Timeline event markers", children: [experience.events.map((event) => (_jsx("button", { className: "timeline-marker", type: "button", "aria-label": `Go to ${event.label}`, title: event.label, style: { left: `${eventPositionPercent(event, experience.window)}%` }, onClick: () => { onEventSeek(event); onEventInfo(event); }, children: _jsx(Label, { text: event.label, className: "timeline-marker-label" }) }, event.id))), panels.map((panel) => (_jsx("button", { className: "timeline-marker timeline-panel-marker", type: "button", "data-panel-id": panel.id, "aria-pressed": openPanelId === panel.id, "aria-label": `Open story panel: ${panel.title}`, title: panel.title, style: { left: `${timePositionPercent(panel.timeUtcMs, experience.window)}%` }, onClick: () => onPanelOpen?.(panel), children: _jsx(Label, { text: panel.title, className: "timeline-marker-label" }) }, panel.id))), windows.filter((window) => window.peakUtcMs !== undefined).map((window) => (_jsx("button", { type: "button", className: "timeline-marker timeline-window-peak", "aria-label": `Go to peak of ${window.label}`, title: `${window.label} peak`, "data-time-utc-ms": window.peakUtcMs, style: { left: `${timePositionPercent(window.peakUtcMs ?? 0, experience.window)}%` }, onClick: () => { if (window.peakUtcMs !== undefined)
63
- onWindowSeek(window, window.peakUtcMs); onWindowInfo(window); } }, `peak-${window.id}`)))] }), _jsx("input", { type: "range", "aria-label": "Seek timeline", "aria-valuetext": valueText, min: experience.window.startUtcMs, max: experience.window.endUtcMs, step: TIMELINE_STEP_MS, value: clampToBounds(snapshot.timeUtcMs, experience.window), onChange: (event) => onSeek(Number(event.target.value)) })] }), _jsxs("div", { className: "timeline-bounds", "aria-hidden": "true", children: [_jsx("time", { dateTime: formatUtcTimestamp(experience.window.startUtcMs), children: formatUtcTimestamp(experience.window.startUtcMs).slice(0, 10) }), _jsx("time", { dateTime: formatUtcTimestamp(experience.window.endUtcMs), children: formatUtcTimestamp(experience.window.endUtcMs).slice(0, 10) })] })] }));
64
- return (_jsxs("section", { className: "timeline-bar", "aria-label": "Timeline controls", "data-drawer-open": drawer?.open, children: [drawer !== undefined && (_jsx("button", { type: "button", className: "drawer-handle drawer-handle-top ui-bare", "aria-label": "Timeline drawer", "aria-expanded": drawer.open, "aria-controls": "timeline-drawer", ...handle, children: _jsx("span", {}) })), _jsxs("div", { className: "timeline-main-row", children: [_jsxs("div", { className: "timeline-transport", children: [_jsx("button", { type: "button", className: "timeline-play ui-icon ui-accent", title: snapshot.playing ? "Pause" : "Play", onClick: onTogglePlayback, "aria-label": snapshot.playing ? "Pause playback" : "Play playback", children: snapshot.playing ? _jsx(Symbol, { path: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) : _jsx(Symbol, { path: "M7 5v14l12-7z" }) }), _jsx("button", { type: "button", className: "timeline-previous ui-icon ui-ghost", "aria-label": stopLabel("Previous", navigation.previous), title: stopLabel("Previous", navigation.previous), disabled: navigation.previous === null, onClick: () => { if (navigation.previous !== null)
86
+ }, children: [_jsx("span", { className: "timeline-glow-ahead" }), _jsx("span", { className: "timeline-glow-played", children: _jsx("span", { className: "timeline-glow-line" }) })] }), _jsx("div", { className: "timeline-markers", ref: markersRef, "aria-label": "Timeline event markers", children: groups.map((group) => group.members.length === 1
87
+ ? renderMarker(group.members[0], group.positionPercent)
88
+ : (_jsxs("div", { className: "timeline-marker-group", "data-align": group.positionPercent < 25 ? "start" : group.positionPercent > 75 ? "end" : "middle", style: { left: `${group.positionPercent}%` }, onKeyDown: (event) => { if (event.key === "Escape")
89
+ setOpenGroup(null); }, children: [_jsx("button", { type: "button", className: "timeline-marker timeline-group-toggle", "aria-expanded": openGroup === group.members[0].key, "aria-label": `${group.members.length} markers close together: show list`, title: `${group.members.length} markers`, onClick: () => setOpenGroup((open) => (open === group.members[0].key ? null : group.members[0].key)), children: _jsx("span", { className: "timeline-group-count", children: group.members.length }) }), openGroup === group.members[0].key && (_jsx("ul", { className: "timeline-group-list", "aria-label": "Markers close together", children: group.members.map((member) => (_jsx("li", { children: _jsx("button", { type: "button", className: "timeline-group-item", "aria-label": member.ariaLabel, "data-time-utc-ms": member.timeUtcMs, "data-panel-id": member.kind === "panel" ? member.key : undefined, onClick: () => { member.activate(); setOpenGroup(null); }, children: member.text }) }, member.key))) }))] }, `group-${group.members[0].key}`))) }), _jsx("input", { type: "range", "aria-label": "Seek timeline", "aria-valuetext": valueText, min: experience.window.startUtcMs, max: experience.window.endUtcMs, step: TIMELINE_STEP_MS, value: clampToBounds(snapshot.timeUtcMs, experience.window), onChange: (event) => onSeek(Number(event.target.value)) })] }), _jsxs("div", { className: "timeline-bounds", "aria-hidden": "true", children: [_jsx("time", { dateTime: formatUtcTimestamp(experience.window.startUtcMs), children: formatUtcTimestamp(experience.window.startUtcMs).slice(0, 10) }), _jsx("time", { dateTime: formatUtcTimestamp(experience.window.endUtcMs), children: formatUtcTimestamp(experience.window.endUtcMs).slice(0, 10) })] })] }));
90
+ return (_jsxs("section", { className: "timeline-bar", "aria-label": "Timeline controls", "data-drawer-open": drawer?.open, children: [drawer !== undefined && (_jsx("button", { type: "button", className: "drawer-handle drawer-handle-top ui-bare", "aria-label": "Timeline drawer", "aria-expanded": drawer.open, "aria-controls": drawerId, ...handle, children: _jsx("span", {}) })), _jsxs("div", { className: "timeline-main-row", children: [_jsxs("div", { className: "timeline-transport", children: [_jsx("button", { type: "button", className: "timeline-play ui-icon ui-accent", title: snapshot.playing ? "Pause" : "Play", onClick: onTogglePlayback, "aria-label": snapshot.playing ? "Pause playback" : "Play playback", children: snapshot.playing ? _jsx(Symbol, { path: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) : _jsx(Symbol, { path: "M7 5v14l12-7z" }) }), _jsx("button", { type: "button", className: "timeline-previous ui-icon ui-ghost", "aria-label": stopLabel("Previous", navigation.previous), title: stopLabel("Previous", navigation.previous), disabled: navigation.previous === null, onClick: () => { if (navigation.previous !== null)
65
91
  goToStop(navigation.previous); }, children: _jsx(Symbol, { path: "M6 5h2v14H6zM19 5v14L9 12z" }) }), _jsx("button", { type: "button", className: "timeline-next ui-icon ui-ghost", "aria-label": stopLabel("Next", navigation.next), title: stopLabel("Next", navigation.next), disabled: navigation.next === null, onClick: () => { if (navigation.next !== null)
66
- goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }), _jsx(SpeedMenu, { speeds: speeds, rate: snapshot.rate, paceAuto: paceAuto, compact: drawer !== undefined, onRateChange: onRateChange }), scrubber, drawer === undefined && (_jsxs("details", { className: "timeline-event-list", children: [_jsxs("summary", { className: "ui-button", title: "Events: what just happened, what is next, and the full list", children: ["Events ", _jsxs("span", { children: ["(", experience.events.length, ")"] })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }))] }), drawer !== undefined && (_jsx("div", { id: "timeline-drawer", className: "timeline-drawer", role: "region", "aria-label": "Timeline details", "data-open": drawer.open, onClick: (event) => { const closer = event.target.closest("[data-closes-drawer]"); if (closer !== null && closer.tagName !== "SELECT")
92
+ goToStop(navigation.next); }, children: _jsx(Symbol, { path: "M16 5h2v14h-2zM5 5v14l10-7z" }) })] }), _jsxs("time", { className: "timeline-time", dateTime: timestamp, "aria-label": timestamp, children: [_jsx("span", { className: "timeline-time-full", children: timestamp }), _jsx("span", { className: "timeline-time-short", "aria-hidden": "true", children: timestamp.slice(0, 16).replace("T", " ") })] }), _jsx(SpeedMenu, { speeds: speeds, rate: snapshot.rate, paceAuto: paceAuto, compact: drawer !== undefined, onRateChange: onRateChange }), scrubber, drawer === undefined && (_jsxs("details", { className: "timeline-event-list", children: [_jsxs("summary", { className: "ui-button", title: "Events: what just happened, what is next, and the full list", children: ["Events ", _jsxs("span", { children: ["(", experience.events.length, ")"] })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo, infoPanelId: infoPanelId })] }))] }), drawer !== undefined && (_jsx("div", { id: drawerId, className: "timeline-drawer", role: "region", "aria-label": "Timeline details", "data-open": drawer.open, onClick: (event) => { const closer = event.target.closest("[data-closes-drawer]"); if (closer !== null && closer.tagName !== "SELECT")
67
93
  drawer.onOpenChange(false); }, children: _jsxs("div", { className: "timeline-drawer-body", children: [_jsxs("div", { className: "timeline-speed-slider", children: [_jsx("span", { "aria-hidden": "true", children: "Playback speed" }), _jsx("input", { type: "range", "aria-label": "Speed slider", "aria-valuetext": speedText, min: 0, max: speeds.length - 1, step: 1, value: speedIndex, onChange: (event) => { const next = speeds[Number(event.target.value)]; if (next !== undefined)
68
- onRateChange(next.rate); } }), _jsx("output", { children: speedText })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo })] }) }))] }));
94
+ onRateChange(next.rate); } }), _jsx("output", { children: speedText })] }), _jsx(TimelineExpanded, { experience: experience, snapshot: snapshot, onEventSeek: onEventSeek, onEventInfo: onEventInfo, onWindowInfo: onWindowInfo, infoPanelId: infoPanelId })] }) }))] }));
69
95
  }
70
96
  /** A 24x24 filled symbol; the button around it carries the accessible name and tooltip. */
71
97
  function Symbol({ path }) {
@@ -75,11 +101,11 @@ function Symbol({ path }) {
75
101
  * The timeline's expanded content: "Just happened / Up next / Inside" and the full event list.
76
102
  * On larger screens it opens from the Events button; the phone drawer shows the same content when expanded.
77
103
  */
78
- export function TimelineExpanded({ experience, snapshot, onEventSeek, onEventInfo, onWindowInfo }) {
104
+ export function TimelineExpanded({ experience, snapshot, onEventSeek, onEventInfo, onWindowInfo, infoPanelId }) {
79
105
  const context = eventContextAt(experience.events, snapshot.timeUtcMs);
80
106
  const inside = windowContextAt(experience.windows ?? [], snapshot.timeUtcMs);
81
107
  return (_jsxs("div", { className: "timeline-expanded", children: [_jsxs("div", { className: "timeline-event-context", "aria-label": "Event context", children: [context.current === null
82
108
  ? _jsxs("span", { children: [_jsx("strong", { children: "Just happened:" }), " No event yet"] })
83
- : (_jsxs("button", { type: "button", className: "timeline-event-current ui-row", "data-closes-drawer": "", "aria-label": `Information about ${context.current.label}`, "aria-controls": "info-panel", onClick: () => { if (context.current !== null)
84
- onEventInfo(context.current); }, children: [_jsx("strong", { children: "Just happened:" }), " ", context.current.label, " ", _jsx("span", { "aria-hidden": "true", children: "\u24D8" })] })), _jsxs("span", { children: [_jsx("strong", { children: "Up next:" }), " ", context.next?.label ?? "No upcoming event"] }), inside.map(({ window, rate }) => (_jsxs("button", { type: "button", className: "timeline-event-current timeline-window-current ui-row", "data-closes-drawer": "", "aria-label": `Information about ${window.label}`, "aria-controls": "info-panel", onClick: () => onWindowInfo(window), children: [_jsx("strong", { children: "Inside:" }), " ", window.label, rate !== null && window.rate !== undefined && _jsxs(_Fragment, { children: [" \u2014 ", formatWindowRate(rate, window.rate.unit)] }), " ", _jsx("span", { "aria-hidden": "true", children: "\u24D8" })] }, window.id)))] }), _jsx("ol", { children: experience.events.map((event) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "ui-row", "data-closes-drawer": "", "aria-current": context.current?.id === event.id ? "time" : undefined, onClick: () => { onEventSeek(event); onEventInfo(event); }, children: [_jsx("time", { dateTime: formatUtcTimestamp(event.timeUtcMs), children: formatUtcTimestamp(event.timeUtcMs) }), _jsx("span", { children: event.label })] }) }, event.id))) })] }));
109
+ : (_jsxs("button", { type: "button", className: "timeline-event-current ui-row", "data-closes-drawer": "", "aria-label": `Information about ${context.current.label}`, "aria-controls": infoPanelId, onClick: () => { if (context.current !== null)
110
+ onEventInfo(context.current); }, children: [_jsx("strong", { children: "Just happened:" }), " ", context.current.label, " ", _jsx("span", { "aria-hidden": "true", children: "\u24D8" })] })), _jsxs("span", { children: [_jsx("strong", { children: "Up next:" }), " ", context.next?.label ?? "No upcoming event"] }), inside.map(({ window, rate }) => (_jsxs("button", { type: "button", className: "timeline-event-current timeline-window-current ui-row", "data-closes-drawer": "", "aria-label": `Information about ${window.label}`, "aria-controls": infoPanelId, onClick: () => onWindowInfo(window), children: [_jsx("strong", { children: "Inside:" }), " ", window.label, rate !== null && window.rate !== undefined && _jsxs(_Fragment, { children: [" \u2014 ", formatWindowRate(rate, window.rate.unit)] }), " ", _jsx("span", { "aria-hidden": "true", children: "\u24D8" })] }, window.id)))] }), _jsx("ol", { children: experience.events.map((event) => (_jsx("li", { children: _jsxs("button", { type: "button", className: "ui-row", "data-closes-drawer": "", "aria-current": context.current?.id === event.id ? "time" : undefined, onClick: () => { onEventSeek(event); onEventInfo(event); }, children: [_jsx("time", { dateTime: formatUtcTimestamp(event.timeUtcMs), children: formatUtcTimestamp(event.timeUtcMs) }), _jsx("span", { children: event.label })] }) }, event.id))) })] }));
85
111
  }