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
@@ -14,7 +14,7 @@
14
14
  }
15
15
 
16
16
  /* ---- Top: the pill and the cog ---- */
17
- [data-phone="true"] .controls-pill {
17
+ .astraeus-shell[data-phone="true"] .controls-pill {
18
18
  position: absolute;
19
19
  z-index: 5;
20
20
  top: calc(8px + var(--safe-top));
@@ -24,19 +24,19 @@
24
24
  /* A vertical swipe on the pill is ours (it opens the drawer), not a page pan. */
25
25
  touch-action: none;
26
26
  }
27
- [data-phone="true"] .controls-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
28
- [data-phone="true"] .controls-pill[aria-expanded="true"] { visibility: hidden; }
29
- [data-phone="true"] .developer-mode-toggle { z-index: 9; top: calc(8px + var(--safe-top)); right: calc(8px + var(--safe-right)); }
27
+ .astraeus-shell[data-phone="true"] .controls-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
28
+ .astraeus-shell[data-phone="true"] .controls-pill[aria-expanded="true"] { visibility: hidden; }
29
+ .astraeus-shell[data-phone="true"] .developer-mode-toggle { z-index: 9; top: calc(8px + var(--safe-top)); right: calc(8px + var(--safe-right)); }
30
30
 
31
31
  /* ---- The drawers ---- */
32
- .drawer-handle { position: absolute; left: 50%; display: flex; width: 140px; height: 44px; transform: translateX(-50%); touch-action: none; }
33
- .drawer-handle span { display: block; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ui-color, #f0e6da) 28%, transparent); }
34
- .drawer-handle:hover span { background: color-mix(in srgb, var(--ui-color, #f0e6da) 50%, transparent); }
32
+ .astraeus-shell :where(.drawer-handle) { position: absolute; left: 50%; display: flex; width: 140px; height: 44px; transform: translateX(-50%); touch-action: none; }
33
+ .astraeus-shell .drawer-handle span { display: block; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ui-color, #f0e6da) 28%, transparent); }
34
+ .astraeus-shell .drawer-handle:hover span { background: color-mix(in srgb, var(--ui-color, #f0e6da) 50%, transparent); }
35
35
  /* The hit area (44 px) reaches past the panel's edge so a thumb finds it; the grip is drawn inside the panel. */
36
- .drawer-handle-top { top: -28px; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
37
- .drawer-handle-bottom { bottom: -20px; align-items: flex-start; justify-content: center; padding-top: 12px; }
36
+ .astraeus-shell :where(.drawer-handle-top) { top: -28px; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
37
+ .astraeus-shell :where(.drawer-handle-bottom) { bottom: -20px; align-items: flex-start; justify-content: center; padding-top: 12px; }
38
38
 
39
- [data-phone="true"] .controls-drawer {
39
+ .astraeus-shell[data-phone="true"] .controls-drawer {
40
40
  position: absolute;
41
41
  z-index: 7;
42
42
  top: 0;
@@ -55,13 +55,13 @@
55
55
  visibility: hidden;
56
56
  transition: transform var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s linear var(--drawer-ms, 240ms);
57
57
  }
58
- [data-phone="true"] .controls-drawer[data-open="true"] {
58
+ .astraeus-shell[data-phone="true"] .controls-drawer[data-open="true"] {
59
59
  transform: none;
60
60
  visibility: visible;
61
61
  transition: transform var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s;
62
62
  }
63
- [data-phone="true"] .controls-drawer .shell-toolbar { max-width: none; }
64
- [data-phone="true"] .controls-drawer .top-bar {
63
+ .astraeus-shell[data-phone="true"] .controls-drawer .shell-toolbar { max-width: none; }
64
+ .astraeus-shell[data-phone="true"] .controls-drawer .top-bar {
65
65
  display: grid;
66
66
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
67
67
  gap: 8px;
@@ -71,26 +71,26 @@
71
71
  box-shadow: none;
72
72
  backdrop-filter: none;
73
73
  }
74
- [data-phone="true"] .controls-drawer .object-camera-actions { display: contents; }
75
- [data-phone="true"] .controls-drawer .top-bar-divider { display: none; }
74
+ .astraeus-shell[data-phone="true"] .controls-drawer .object-camera-actions { display: contents; }
75
+ .astraeus-shell[data-phone="true"] .controls-drawer .top-bar-divider { display: none; }
76
76
  /* The object list takes the first row, leaving room for the cog at the right. */
77
- [data-phone="true"] .controls-drawer .object-picker { grid-column: 1 / -1; width: calc(100% - 52px); max-width: none; }
77
+ .astraeus-shell[data-phone="true"] .controls-drawer .object-picker { grid-column: 1 / -1; width: calc(100% - 52px); max-width: none; }
78
78
  /* Each button: icon over a short word. */
79
- [data-phone="true"] .controls-drawer .display-switches { display: contents; }
80
- [data-phone="true"] .controls-drawer .top-bar-button { width: auto; flex-direction: column; gap: 2px; padding: 0 4px; }
81
- [data-phone="true"] .controls-drawer .top-bar-button-text { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
82
- [data-phone="true"] .controls-drawer .switch-control { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
83
- [data-phone="true"] .controls-drawer .scale-toggle { padding: 0 4px; }
84
- [data-phone="true"] .controls-drawer .scale-toggle > span { font-size: 11px; }
85
- [data-phone="true"] .controls-drawer .scale-menu,
86
- [data-phone="true"] .controls-drawer .scale-explanation-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(320px, calc(100vw - 32px)); }
79
+ .astraeus-shell[data-phone="true"] .controls-drawer .display-switches { display: contents; }
80
+ .astraeus-shell[data-phone="true"] .controls-drawer .top-bar-button { width: auto; flex-direction: column; gap: 2px; padding: 0 4px; }
81
+ .astraeus-shell[data-phone="true"] .controls-drawer .top-bar-button-text { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
82
+ .astraeus-shell[data-phone="true"] .controls-drawer .switch-control { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
83
+ .astraeus-shell[data-phone="true"] .controls-drawer .scale-toggle { padding: 0 4px; }
84
+ .astraeus-shell[data-phone="true"] .controls-drawer .scale-toggle > span { font-size: 11px; }
85
+ .astraeus-shell[data-phone="true"] .controls-drawer .scale-menu,
86
+ .astraeus-shell[data-phone="true"] .controls-drawer .scale-explanation-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(320px, calc(100vw - 32px)); }
87
87
  /* The switch panel stays clear of the cog's column (60 px at the right) and the drawer's edge. */
88
- [data-phone="true"] .controls-drawer .switch-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(260px, calc(100vw - 84px)); min-width: 0; }
89
- [data-phone="true"] .controls-drawer .top-bar { position: relative; }
90
- [data-phone="true"] .controls-drawer .scale-control { position: static; }
88
+ .astraeus-shell[data-phone="true"] .controls-drawer .switch-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(260px, calc(100vw - 84px)); min-width: 0; }
89
+ .astraeus-shell[data-phone="true"] .controls-drawer .top-bar { position: relative; }
90
+ .astraeus-shell[data-phone="true"] .controls-drawer .scale-control { position: static; }
91
91
 
92
92
  /* ---- Bottom: the two-line timeline and its drawer ---- */
93
- [data-phone="true"] .timeline-bar {
93
+ .astraeus-shell[data-phone="true"] .timeline-bar {
94
94
  right: calc(8px + var(--safe-right));
95
95
  bottom: calc(8px + var(--safe-bottom));
96
96
  left: calc(8px + var(--safe-left));
@@ -99,26 +99,26 @@
99
99
  padding: 16px 10px 2px;
100
100
  border-radius: 18px;
101
101
  }
102
- [data-phone="true"] .timeline-bar[data-drawer-open="true"] { z-index: 6; background: var(--panel-bg); }
103
- [data-phone="true"] .timeline-main-row { gap: 4px; }
104
- [data-phone="true"] .timeline-time { flex-basis: auto; width: auto; }
105
- [data-phone="true"] .timeline-time-full { display: none; }
106
- [data-phone="true"] .timeline-time-short { display: inline; }
107
- [data-phone="true"] .timeline-bar .timeline-speed select { width: 96px; }
108
- [data-phone="true"] .timeline-scrubber { flex-basis: 100%; }
102
+ .astraeus-shell[data-phone="true"] .timeline-bar[data-drawer-open="true"] { z-index: 6; background: var(--panel-bg); }
103
+ .astraeus-shell[data-phone="true"] .timeline-main-row { gap: 4px; }
104
+ .astraeus-shell[data-phone="true"] .timeline-time { flex-basis: auto; width: auto; }
105
+ .astraeus-shell[data-phone="true"] .timeline-time-full { display: none; }
106
+ .astraeus-shell[data-phone="true"] .timeline-time-short { display: inline; }
107
+ .astraeus-shell[data-phone="true"] .timeline-bar .timeline-speed select { width: 96px; }
108
+ .astraeus-shell[data-phone="true"] .timeline-scrubber { flex-basis: 100%; }
109
109
 
110
- .timeline-drawer {
110
+ .astraeus-shell .timeline-drawer {
111
111
  display: grid;
112
112
  grid-template-rows: 0fr;
113
113
  visibility: hidden;
114
114
  transition: grid-template-rows var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s linear var(--drawer-ms, 240ms);
115
115
  }
116
- .timeline-drawer[data-open="true"] {
116
+ .astraeus-shell .timeline-drawer[data-open="true"] {
117
117
  grid-template-rows: 1fr;
118
118
  visibility: visible;
119
119
  transition: grid-template-rows var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s;
120
120
  }
121
- .timeline-drawer-body {
121
+ .astraeus-shell .timeline-drawer-body {
122
122
  display: flex;
123
123
  flex-direction: column;
124
124
  gap: 10px;
@@ -127,22 +127,22 @@
127
127
  overflow-y: auto;
128
128
  overscroll-behavior: contain;
129
129
  }
130
- .timeline-drawer[data-open="true"] .timeline-drawer-body { padding-top: 10px; }
131
- .timeline-speed-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; color: var(--ui-muted, #c7bdb3); font-size: 13px; }
132
- .timeline-speed-slider input { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ui-accent, #fc6323); }
133
- .timeline-speed-slider output { color: var(--ui-color, #f0e6da); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
130
+ .astraeus-shell .timeline-drawer[data-open="true"] .timeline-drawer-body { padding-top: 10px; }
131
+ .astraeus-shell .timeline-speed-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; color: var(--ui-muted, #c7bdb3); font-size: 13px; }
132
+ .astraeus-shell :where(.timeline-speed-slider) input { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ui-accent, #fc6323); }
133
+ .astraeus-shell .timeline-speed-slider output { color: var(--ui-color, #f0e6da); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
134
134
  /* Inside the drawer the events list is plain content, not a pop-up. */
135
- .timeline-drawer .timeline-expanded { position: static; width: auto; max-height: none; overflow: visible; padding: 0; border: 0; background: none; box-shadow: none; }
135
+ .astraeus-shell .timeline-drawer .timeline-expanded { position: static; width: auto; max-height: none; overflow: visible; padding: 0; border: 0; background: none; box-shadow: none; }
136
136
 
137
137
  /* An event row is two short lines (the time, then its name) so the name is not cut off. */
138
- .timeline-drawer .timeline-expanded li button { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 4px; padding-bottom: 4px; }
139
- .timeline-drawer .timeline-expanded li span { max-width: 100%; white-space: normal; }
138
+ .astraeus-shell .timeline-drawer .timeline-expanded li button { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 4px; padding-bottom: 4px; }
139
+ .astraeus-shell .timeline-drawer .timeline-expanded li span { max-width: 100%; white-space: normal; }
140
140
 
141
141
  /* ---- Sheets: information and story panels ---- */
142
- [data-phone="true"] .sheet-handle { display: block; flex: 0 0 auto; align-self: center; width: 40px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ui-accent, #fc6323) 45%, transparent); }
142
+ .astraeus-shell[data-phone="true"] .sheet-handle { display: block; flex: 0 0 auto; align-self: center; width: 40px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ui-accent, #fc6323) 45%, transparent); }
143
143
  /* Both sheets ride above the timeline bar, so the Play button is never covered (C-053 Observation 2, O-020 Decision 13). */
144
- [data-phone="true"] .info-panel,
145
- [data-phone="true"] .story-panel {
144
+ .astraeus-shell[data-phone="true"] .info-panel,
145
+ .astraeus-shell[data-phone="true"] .story-panel {
146
146
  position: fixed;
147
147
  top: auto;
148
148
  bottom: calc(var(--timeline-space, 150px) + 8px);
@@ -158,12 +158,12 @@
158
158
  border-radius: 16px;
159
159
  animation: story-sheet-in var(--drawer-ms, 240ms) var(--drawer-ease);
160
160
  }
161
- [data-phone="true"] .info-panel { z-index: 8; background: #0e0e13; }
162
- [data-phone="true"] .story-panel { z-index: 4; touch-action: pan-y; } /* a pinch reaches the scene beneath (useZoomThrough); a vertical drag still scrolls or dismisses */
163
- [data-phone="true"] .info-panel-header h2 { margin: 0; font-size: 22px; }
161
+ .astraeus-shell[data-phone="true"] .info-panel { z-index: 8; background: #0e0e13; }
162
+ .astraeus-shell[data-phone="true"] .story-panel { z-index: 4; touch-action: pan-y; } /* a pinch reaches the scene beneath (useZoomThrough); a vertical drag still scrolls or dismisses */
163
+ .astraeus-shell[data-phone="true"] .info-panel-header h2 { margin: 0; font-size: 22px; }
164
164
 
165
165
  /* ---- The Developer panel below the pill, above the timeline ---- */
166
- [data-phone="true"] .developer-tools {
166
+ .astraeus-shell[data-phone="true"] .developer-tools {
167
167
  top: calc(60px + var(--safe-top));
168
168
  right: calc(8px + var(--safe-right));
169
169
  left: calc(8px + var(--safe-left));
@@ -171,12 +171,12 @@
171
171
  max-height: max(160px, calc(100dvh - 60px - var(--safe-top) - var(--timeline-space, 150px) - 16px));
172
172
  padding: 9px;
173
173
  }
174
- [data-phone="true"] .shell-top { top: 8px; left: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: none; }
175
- [data-phone="true"] .astraeus-label { font-size: 12px; }
174
+ .astraeus-shell[data-phone="true"] .shell-top { top: 8px; left: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: none; }
175
+ .astraeus-shell[data-phone="true"] .astraeus-label { font-size: 12px; }
176
176
 
177
177
  @media (prefers-reduced-motion: reduce) {
178
- .controls-drawer,
179
- .timeline-drawer,
180
- .info-panel,
181
- .story-panel { transition: none !important; animation: none !important; }
178
+ .astraeus-shell .controls-drawer,
179
+ .astraeus-shell .timeline-drawer,
180
+ .astraeus-shell .info-panel,
181
+ .astraeus-shell .story-panel { transition: none !important; animation: none !important; }
182
182
  }
@@ -1,61 +1,10 @@
1
- import type { TimeBounds } from "../core/trajectory.js";
2
- /** How a panel's facts are labelled: measured or published values, a model of them, or a picture made to explain. */
3
- export type PanelBadge = "observed" | "modelled" | "illustrative";
4
- export declare const PANEL_BADGES: readonly PanelBadge[];
5
- /** One short story panel, resolved to a UTC time. */
6
- export interface StoryPanel {
7
- readonly id: string;
8
- readonly timeUtcMs: number;
9
- readonly title: string;
10
- /** Paragraphs, in order. */
11
- readonly body: readonly string[];
12
- readonly badge: PanelBadge;
13
- /** Short paragraphs of exact figures and measured-versus-reconstructed notes, shown in the folded section above the sources. Empty when the panel has none. */
14
- readonly details: readonly string[];
15
- /** One line per cited source (PROV-01); never empty. */
16
- readonly sources: readonly string[];
17
- /** A shell object this panel is about; the scene draws a marker on it that reopens the panel. */
18
- readonly objectId?: string;
19
- }
20
- /** The panels an experience offers, with the defaults of the two settings that govern them. */
21
- export interface StoryPanelSet {
22
- readonly panels: readonly StoryPanel[];
23
- /** How long playback holds when a panel opens by itself, in seconds (0 never pauses). */
24
- readonly pauseSeconds: number;
25
- /** Whether panels open by themselves as forward playback reaches them. */
26
- readonly autoOpen: boolean;
27
- }
28
- export declare const DEFAULT_PANEL_PAUSE_SECONDS = 6;
29
- export declare const MAX_PANEL_PAUSE_SECONDS = 20;
30
- /** What a story's settings may point a panel's time at, besides a plain UTC time. */
31
- export interface PanelLookup {
32
- readonly events: readonly {
33
- readonly id: string;
34
- readonly timeUtcMs: number;
35
- }[];
36
- /** Source anchors by id, when the experience has them. */
37
- readonly anchors?: ReadonlyMap<string, number>;
38
- /** Ids a panel's `object` may name. Absent: any id is accepted. */
39
- readonly objectIds?: readonly string[];
40
- /** When given, every panel must fall inside it. */
41
- readonly window?: TimeBounds;
42
- }
43
- /** A panel's settings entry is wrong; the message names the panel and the field. */
44
- export declare class StoryPanelError extends Error {
45
- constructor(panel: string, field: string, problem: string);
46
- }
47
- /**
48
- * Validates a story's panel settings (STYLE-06) and resolves each panel's time. Shape:
49
- * `{ pauseSeconds?, autoOpen?, panels: [{ id, at: { utc | event | anchor }, title, body, details?, badge, sources, object? }] }`.
50
- * Panels come back sorted by time; ids must be unique.
51
- */
52
- export declare function parseStoryPanels(raw: unknown, lookup: PanelLookup): StoryPanelSet;
1
+ import type { StoryPanel } from "../core/storyPanels.js";
2
+ export { checkPanelPlayback, checkStoryPanel, DEFAULT_PANEL_PAUSE_SECONDS, MAX_PANEL_PAUSE_SECONDS, resolveStoryPanels, StoryPanelError, type PanelLookup, type StoryPanel, type StoryPanelSet, } from "../core/storyPanels.js";
53
3
  /**
54
4
  * The panels forward playback just passed: those with `previousMs < time <= currentMs`, in time order.
55
5
  * A backward step or no movement crosses nothing, so loops and rewinds never open a panel.
56
6
  */
57
7
  export declare function panelsCrossed(panels: readonly StoryPanel[], previousMs: number, currentMs: number): readonly StoryPanel[];
58
- export declare const BADGE_LABELS: Readonly<Record<PanelBadge, string>>;
59
8
  /**
60
9
  * Decides, tick by tick, whether playback has just carried the clock across a panel. It remembers the last time it saw;
61
10
  * `rebase` moves that memory when a person seeks, so a jump is never read as playback and opens nothing.
@@ -1,104 +1,4 @@
1
- export const PANEL_BADGES = ["observed", "modelled", "illustrative"];
2
- export const DEFAULT_PANEL_PAUSE_SECONDS = 6;
3
- export const MAX_PANEL_PAUSE_SECONDS = 20;
4
- /** A panel's settings entry is wrong; the message names the panel and the field. */
5
- export class StoryPanelError extends Error {
6
- constructor(panel, field, problem) {
7
- super(`story panel ${panel}: ${field} ${problem}`);
8
- this.name = "StoryPanelError";
9
- }
10
- }
11
- const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
12
- function text(panel, field, value) {
13
- if (typeof value !== "string" || value.trim() === "")
14
- throw new StoryPanelError(panel, field, "must be non-empty text");
15
- return value;
16
- }
17
- function lines(panel, field, value) {
18
- const list = typeof value === "string" ? [value] : value;
19
- if (!Array.isArray(list) || list.length === 0)
20
- throw new StoryPanelError(panel, field, "must be one or more non-empty lines");
21
- return list.map((line, index) => text(panel, `${field}[${index}]`, line));
22
- }
23
- function timeOf(panel, at, lookup) {
24
- if (!isRecord(at))
25
- throw new StoryPanelError(panel, "at", "must name a time: { utc }, { event } or { anchor }");
26
- const keys = ["utc", "event", "anchor"].filter((key) => at[key] !== undefined);
27
- if (keys.length !== 1)
28
- throw new StoryPanelError(panel, "at", "must give exactly one of utc, event or anchor");
29
- if (keys[0] === "utc") {
30
- const utc = text(panel, "at.utc", at.utc);
31
- const ms = Date.parse(utc);
32
- if (!/Z$/.test(utc) || !Number.isFinite(ms))
33
- throw new StoryPanelError(panel, "at.utc", `must be an ISO-8601 UTC time ending in Z, got "${utc}"`);
34
- return ms;
35
- }
36
- if (keys[0] === "event") {
37
- const id = text(panel, "at.event", at.event);
38
- const event = lookup.events.find((candidate) => candidate.id === id);
39
- if (event === undefined)
40
- throw new StoryPanelError(panel, "at.event", `names "${id}", which the experience's events lack`);
41
- return event.timeUtcMs;
42
- }
43
- const id = text(panel, "at.anchor", at.anchor);
44
- const anchor = lookup.anchors?.get(id);
45
- if (anchor === undefined)
46
- throw new StoryPanelError(panel, "at.anchor", `names "${id}", which the experience's anchors lack`);
47
- return anchor;
48
- }
49
- function parsePanel(raw, index, lookup) {
50
- if (!isRecord(raw))
51
- throw new StoryPanelError(`#${index + 1}`, "entry", "must be an object");
52
- const id = text(`#${index + 1}`, "id", raw.id);
53
- const timeUtcMs = timeOf(id, raw.at, lookup);
54
- if (lookup.window !== undefined && (timeUtcMs < lookup.window.startUtcMs || timeUtcMs > lookup.window.endUtcMs)) {
55
- throw new StoryPanelError(id, "at", "falls outside the timeline window");
56
- }
57
- const badge = raw.badge;
58
- if (!PANEL_BADGES.includes(badge))
59
- throw new StoryPanelError(id, "badge", `must be one of ${PANEL_BADGES.join(", ")}, got ${JSON.stringify(badge)}`);
60
- const objectId = raw.object === undefined ? undefined : text(id, "object", raw.object);
61
- if (objectId !== undefined && lookup.objectIds !== undefined && !lookup.objectIds.includes(objectId)) {
62
- throw new StoryPanelError(id, "object", `names "${objectId}", which the experience lacks`);
63
- }
64
- return {
65
- id,
66
- timeUtcMs,
67
- title: text(id, "title", raw.title),
68
- body: lines(id, "body", raw.body),
69
- badge: badge,
70
- details: raw.details === undefined ? [] : lines(id, "details", raw.details),
71
- sources: lines(id, "sources", raw.sources),
72
- ...(objectId === undefined ? {} : { objectId }),
73
- };
74
- }
75
- /**
76
- * Validates a story's panel settings (STYLE-06) and resolves each panel's time. Shape:
77
- * `{ pauseSeconds?, autoOpen?, panels: [{ id, at: { utc | event | anchor }, title, body, details?, badge, sources, object? }] }`.
78
- * Panels come back sorted by time; ids must be unique.
79
- */
80
- export function parseStoryPanels(raw, lookup) {
81
- if (!isRecord(raw))
82
- throw new StoryPanelError("settings", "panels", "must be an object with a panels list");
83
- const list = raw.panels;
84
- if (!Array.isArray(list))
85
- throw new StoryPanelError("settings", "panels", "must be a list");
86
- const pauseSeconds = raw.pauseSeconds ?? DEFAULT_PANEL_PAUSE_SECONDS;
87
- if (typeof pauseSeconds !== "number" || !Number.isFinite(pauseSeconds) || pauseSeconds < 0 || pauseSeconds > MAX_PANEL_PAUSE_SECONDS) {
88
- throw new StoryPanelError("settings", "pauseSeconds", `must be between 0 and ${MAX_PANEL_PAUSE_SECONDS}, got ${JSON.stringify(pauseSeconds)}`);
89
- }
90
- const autoOpen = raw.autoOpen ?? true;
91
- if (typeof autoOpen !== "boolean")
92
- throw new StoryPanelError("settings", "autoOpen", "must be true or false");
93
- const panels = list.map((entry, index) => parsePanel(entry, index, lookup));
94
- const seen = new Set();
95
- for (const panel of panels) {
96
- if (seen.has(panel.id))
97
- throw new StoryPanelError(panel.id, "id", "is used twice");
98
- seen.add(panel.id);
99
- }
100
- return { panels: [...panels].sort((a, b) => a.timeUtcMs - b.timeUtcMs), pauseSeconds, autoOpen };
101
- }
1
+ export { checkPanelPlayback, checkStoryPanel, DEFAULT_PANEL_PAUSE_SECONDS, MAX_PANEL_PAUSE_SECONDS, resolveStoryPanels, StoryPanelError, } from "../core/storyPanels.js";
102
2
  /**
103
3
  * The panels forward playback just passed: those with `previousMs < time <= currentMs`, in time order.
104
4
  * A backward step or no movement crosses nothing, so loops and rewinds never open a panel.
@@ -108,11 +8,6 @@ export function panelsCrossed(panels, previousMs, currentMs) {
108
8
  return [];
109
9
  return panels.filter((panel) => panel.timeUtcMs > previousMs && panel.timeUtcMs <= currentMs);
110
10
  }
111
- export const BADGE_LABELS = {
112
- observed: "Observed",
113
- modelled: "Modelled",
114
- illustrative: "Illustrative",
115
- };
116
11
  /**
117
12
  * Decides, tick by tick, whether playback has just carried the clock across a panel. It remembers the last time it saw;
118
13
  * `rebase` moves that memory when a person seeks, so a jump is never read as playback and opens nothing.