@vibefield/puppeteer-views 0.0.0-stage → 0.2.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.
- package/LICENSE +21 -0
- package/dist/bar/InstrumentBar.d.ts +81 -0
- package/dist/bar/InstrumentBar.d.ts.map +1 -0
- package/dist/bar/InstrumentBar.js +86 -0
- package/dist/bar/InstrumentBar.js.map +1 -0
- package/dist/bar/ProfileTabs.d.ts +24 -0
- package/dist/bar/ProfileTabs.d.ts.map +1 -0
- package/dist/bar/ProfileTabs.js +141 -0
- package/dist/bar/ProfileTabs.js.map +1 -0
- package/dist/chrome/ChromeBoundary.d.ts +60 -0
- package/dist/chrome/ChromeBoundary.d.ts.map +1 -0
- package/dist/chrome/ChromeBoundary.js +70 -0
- package/dist/chrome/ChromeBoundary.js.map +1 -0
- package/dist/chrome/stage.d.ts +8 -0
- package/dist/chrome/stage.d.ts.map +1 -0
- package/dist/chrome/stage.js +8 -0
- package/dist/chrome/stage.js.map +1 -0
- package/dist/colour/pane-colours.d.ts +21 -0
- package/dist/colour/pane-colours.d.ts.map +1 -0
- package/dist/colour/pane-colours.js +25 -0
- package/dist/colour/pane-colours.js.map +1 -0
- package/dist/colour/project-tint.d.ts +23 -0
- package/dist/colour/project-tint.d.ts.map +1 -0
- package/dist/colour/project-tint.js +100 -0
- package/dist/colour/project-tint.js.map +1 -0
- package/dist/deck/DeckFrames.d.ts +71 -0
- package/dist/deck/DeckFrames.d.ts.map +1 -0
- package/dist/deck/DeckFrames.js +50 -0
- package/dist/deck/DeckFrames.js.map +1 -0
- package/dist/deck/PaneFrame.d.ts +80 -0
- package/dist/deck/PaneFrame.d.ts.map +1 -0
- package/dist/deck/PaneFrame.js +118 -0
- package/dist/deck/PaneFrame.js.map +1 -0
- package/dist/deck/completed-agent-panes.d.ts +24 -0
- package/dist/deck/completed-agent-panes.d.ts.map +1 -0
- package/dist/deck/completed-agent-panes.js +72 -0
- package/dist/deck/completed-agent-panes.js.map +1 -0
- package/dist/deck/deck-zoom.d.ts +40 -0
- package/dist/deck/deck-zoom.d.ts.map +1 -0
- package/dist/deck/deck-zoom.js +200 -0
- package/dist/deck/deck-zoom.js.map +1 -0
- package/dist/deck/index.d.ts +8 -0
- package/dist/deck/index.d.ts.map +1 -0
- package/dist/deck/index.js +13 -0
- package/dist/deck/index.js.map +1 -0
- package/dist/deck/pane-elements.d.ts +24 -0
- package/dist/deck/pane-elements.d.ts.map +1 -0
- package/dist/deck/pane-elements.js +73 -0
- package/dist/deck/pane-elements.js.map +1 -0
- package/dist/deck/pane-frame.d.ts +88 -0
- package/dist/deck/pane-frame.d.ts.map +1 -0
- package/dist/deck/pane-frame.js +51 -0
- package/dist/deck/pane-frame.js.map +1 -0
- package/dist/deck/unused-pane-sessions.d.ts +24 -0
- package/dist/deck/unused-pane-sessions.d.ts.map +1 -0
- package/dist/deck/unused-pane-sessions.js +75 -0
- package/dist/deck/unused-pane-sessions.js.map +1 -0
- package/dist/deck/use-deck-zoom.d.ts +10 -0
- package/dist/deck/use-deck-zoom.d.ts.map +1 -0
- package/dist/deck/use-deck-zoom.js +31 -0
- package/dist/deck/use-deck-zoom.js.map +1 -0
- package/dist/find/FindSheet.d.ts +23 -0
- package/dist/find/FindSheet.d.ts.map +1 -0
- package/dist/find/FindSheet.js +197 -0
- package/dist/find/FindSheet.js.map +1 -0
- package/dist/find/find-agent.d.ts +35 -0
- package/dist/find/find-agent.d.ts.map +1 -0
- package/dist/find/find-agent.js +2 -0
- package/dist/find/find-agent.js.map +1 -0
- package/dist/find/find-model.d.ts +93 -0
- package/dist/find/find-model.d.ts.map +1 -0
- package/dist/find/find-model.js +372 -0
- package/dist/find/find-model.js.map +1 -0
- package/dist/find/history-port.d.ts +78 -0
- package/dist/find/history-port.d.ts.map +1 -0
- package/dist/find/history-port.js +9 -0
- package/dist/find/history-port.js.map +1 -0
- package/dist/icons/ServiceMark.d.ts +32 -0
- package/dist/icons/ServiceMark.d.ts.map +1 -0
- package/dist/icons/ServiceMark.js +57 -0
- package/dist/icons/ServiceMark.js.map +1 -0
- package/dist/icons/profile-glyph-suggest.d.ts +8 -0
- package/dist/icons/profile-glyph-suggest.d.ts.map +1 -0
- package/dist/icons/profile-glyph-suggest.js +42 -0
- package/dist/icons/profile-glyph-suggest.js.map +1 -0
- package/dist/icons/service-marks.d.ts +5 -0
- package/dist/icons/service-marks.d.ts.map +1 -0
- package/dist/icons/service-marks.js +81 -0
- package/dist/icons/service-marks.js.map +1 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +86 -0
- package/dist/index.js.map +1 -0
- package/dist/lab/lab-clock.d.ts +11 -0
- package/dist/lab/lab-clock.d.ts.map +1 -0
- package/dist/lab/lab-clock.js +48 -0
- package/dist/lab/lab-clock.js.map +1 -0
- package/dist/lab/lab-model.d.ts +10 -0
- package/dist/lab/lab-model.d.ts.map +1 -0
- package/dist/lab/lab-model.js +146 -0
- package/dist/lab/lab-model.js.map +1 -0
- package/dist/lab/lab-stage.d.ts +72 -0
- package/dist/lab/lab-stage.d.ts.map +1 -0
- package/dist/lab/lab-stage.js +201 -0
- package/dist/lab/lab-stage.js.map +1 -0
- package/dist/lab/lab-world.d.ts +33 -0
- package/dist/lab/lab-world.d.ts.map +1 -0
- package/dist/lab/lab-world.js +394 -0
- package/dist/lab/lab-world.js.map +1 -0
- package/dist/lab/view-lab.css +98 -0
- package/dist/launcher/DeckLaunchers.d.ts +92 -0
- package/dist/launcher/DeckLaunchers.d.ts.map +1 -0
- package/dist/launcher/DeckLaunchers.js +377 -0
- package/dist/launcher/DeckLaunchers.js.map +1 -0
- package/dist/launcher/PaneLaunch.d.ts +50 -0
- package/dist/launcher/PaneLaunch.d.ts.map +1 -0
- package/dist/launcher/PaneLaunch.js +318 -0
- package/dist/launcher/PaneLaunch.js.map +1 -0
- package/dist/launcher/PaneLaunchChrome.d.ts +49 -0
- package/dist/launcher/PaneLaunchChrome.d.ts.map +1 -0
- package/dist/launcher/PaneLaunchChrome.js +32 -0
- package/dist/launcher/PaneLaunchChrome.js.map +1 -0
- package/dist/launcher/PaneLauncher.d.ts +97 -0
- package/dist/launcher/PaneLauncher.d.ts.map +1 -0
- package/dist/launcher/PaneLauncher.js +349 -0
- package/dist/launcher/PaneLauncher.js.map +1 -0
- package/dist/launcher/PaneLauncherChrome.d.ts +97 -0
- package/dist/launcher/PaneLauncherChrome.d.ts.map +1 -0
- package/dist/launcher/PaneLauncherChrome.js +131 -0
- package/dist/launcher/PaneLauncherChrome.js.map +1 -0
- package/dist/launcher/index.d.ts +9 -0
- package/dist/launcher/index.d.ts.map +1 -0
- package/dist/launcher/index.js +16 -0
- package/dist/launcher/index.js.map +1 -0
- package/dist/launcher/launch-model.d.ts +162 -0
- package/dist/launcher/launch-model.d.ts.map +1 -0
- package/dist/launcher/launch-model.js +169 -0
- package/dist/launcher/launch-model.js.map +1 -0
- package/dist/launcher/launcher-model.d.ts +268 -0
- package/dist/launcher/launcher-model.d.ts.map +1 -0
- package/dist/launcher/launcher-model.js +443 -0
- package/dist/launcher/launcher-model.js.map +1 -0
- package/dist/launcher/launcher-port.d.ts +115 -0
- package/dist/launcher/launcher-port.d.ts.map +1 -0
- package/dist/launcher/launcher-port.js +12 -0
- package/dist/launcher/launcher-port.js.map +1 -0
- package/dist/monitor/agent-status.d.ts +13 -0
- package/dist/monitor/agent-status.d.ts.map +1 -0
- package/dist/monitor/agent-status.js +5 -0
- package/dist/monitor/agent-status.js.map +1 -0
- package/dist/monitor/agents.d.ts +6 -0
- package/dist/monitor/agents.d.ts.map +1 -0
- package/dist/monitor/agents.js +21 -0
- package/dist/monitor/agents.js.map +1 -0
- package/dist/monitor/cost-format.d.ts +3 -0
- package/dist/monitor/cost-format.d.ts.map +1 -0
- package/dist/monitor/cost-format.js +12 -0
- package/dist/monitor/cost-format.js.map +1 -0
- package/dist/monitor/folder-name.d.ts +3 -0
- package/dist/monitor/folder-name.d.ts.map +1 -0
- package/dist/monitor/folder-name.js +6 -0
- package/dist/monitor/folder-name.js.map +1 -0
- package/dist/monitor/palette.d.ts +94 -0
- package/dist/monitor/palette.d.ts.map +1 -0
- package/dist/monitor/palette.js +157 -0
- package/dist/monitor/palette.js.map +1 -0
- package/dist/monitor/parameters.d.ts +33 -0
- package/dist/monitor/parameters.d.ts.map +1 -0
- package/dist/monitor/parameters.js +53 -0
- package/dist/monitor/parameters.js.map +1 -0
- package/dist/monitor/recede.d.ts +14 -0
- package/dist/monitor/recede.d.ts.map +1 -0
- package/dist/monitor/recede.js +35 -0
- package/dist/monitor/recede.js.map +1 -0
- package/dist/monitor/registry.d.ts +14 -0
- package/dist/monitor/registry.d.ts.map +1 -0
- package/dist/monitor/registry.js +36 -0
- package/dist/monitor/registry.js.map +1 -0
- package/dist/monitor/remote-write.d.ts +16 -0
- package/dist/monitor/remote-write.d.ts.map +1 -0
- package/dist/monitor/remote-write.js +21 -0
- package/dist/monitor/remote-write.js.map +1 -0
- package/dist/monitor/types.d.ts +205 -0
- package/dist/monitor/types.d.ts.map +1 -0
- package/dist/monitor/types.js +2 -0
- package/dist/monitor/types.js.map +1 -0
- package/dist/styles/bar.css +396 -0
- package/dist/styles/deck-frame.css +439 -0
- package/dist/styles/deck-zoom.css +70 -0
- package/dist/styles/find-sheet.css +270 -0
- package/dist/styles/pane-launcher.css +955 -0
- package/dist/styles/usage.css +368 -0
- package/dist/styles/views.css +12 -0
- package/dist/usage/UsageColumn.d.ts +8 -0
- package/dist/usage/UsageColumn.d.ts.map +1 -0
- package/dist/usage/UsageColumn.js +133 -0
- package/dist/usage/UsageColumn.js.map +1 -0
- package/dist/usage/account-usage-port.d.ts +12 -0
- package/dist/usage/account-usage-port.d.ts.map +1 -0
- package/dist/usage/account-usage-port.js +2 -0
- package/dist/usage/account-usage-port.js.map +1 -0
- package/dist/usage/account-usage.d.ts +86 -0
- package/dist/usage/account-usage.d.ts.map +1 -0
- package/dist/usage/account-usage.js +262 -0
- package/dist/usage/account-usage.js.map +1 -0
- package/dist/views/list/AgentList.d.ts +4 -0
- package/dist/views/list/AgentList.d.ts.map +1 -0
- package/dist/views/list/AgentList.js +101 -0
- package/dist/views/list/AgentList.js.map +1 -0
- package/dist/views/list/ListSpawnMenu.d.ts +20 -0
- package/dist/views/list/ListSpawnMenu.d.ts.map +1 -0
- package/dist/views/list/ListSpawnMenu.js +143 -0
- package/dist/views/list/ListSpawnMenu.js.map +1 -0
- package/dist/views/list/index.d.ts +8 -0
- package/dist/views/list/index.d.ts.map +1 -0
- package/dist/views/list/index.js +43 -0
- package/dist/views/list/index.js.map +1 -0
- package/dist/views/list/lab/main.d.ts +2 -0
- package/dist/views/list/lab/main.d.ts.map +1 -0
- package/dist/views/list/lab/main.js +25 -0
- package/dist/views/list/lab/main.js.map +1 -0
- package/dist/views/list/list-parameters.d.ts +9 -0
- package/dist/views/list/list-parameters.d.ts.map +1 -0
- package/dist/views/list/list-parameters.js +27 -0
- package/dist/views/list/list-parameters.js.map +1 -0
- package/dist/views/list/list.css +387 -0
- package/dist/views/rain/RainView.d.ts +4 -0
- package/dist/views/rain/RainView.d.ts.map +1 -0
- package/dist/views/rain/RainView.js +282 -0
- package/dist/views/rain/RainView.js.map +1 -0
- package/dist/views/rain/index.d.ts +8 -0
- package/dist/views/rain/index.d.ts.map +1 -0
- package/dist/views/rain/index.js +53 -0
- package/dist/views/rain/index.js.map +1 -0
- package/dist/views/rain/lab/main.d.ts +2 -0
- package/dist/views/rain/lab/main.d.ts.map +1 -0
- package/dist/views/rain/lab/main.js +26 -0
- package/dist/views/rain/lab/main.js.map +1 -0
- package/dist/views/rain/rain-parameters.d.ts +15 -0
- package/dist/views/rain/rain-parameters.d.ts.map +1 -0
- package/dist/views/rain/rain-parameters.js +52 -0
- package/dist/views/rain/rain-parameters.js.map +1 -0
- package/dist/views/rain/rain-streams.d.ts +44 -0
- package/dist/views/rain/rain-streams.d.ts.map +1 -0
- package/dist/views/rain/rain-streams.js +101 -0
- package/dist/views/rain/rain-streams.js.map +1 -0
- package/dist/views/rain/rain.css +200 -0
- package/dist/views/spend/SpendView.d.ts +30 -0
- package/dist/views/spend/SpendView.d.ts.map +1 -0
- package/dist/views/spend/SpendView.js +645 -0
- package/dist/views/spend/SpendView.js.map +1 -0
- package/dist/views/spend/index.d.ts +8 -0
- package/dist/views/spend/index.d.ts.map +1 -0
- package/dist/views/spend/index.js +54 -0
- package/dist/views/spend/index.js.map +1 -0
- package/dist/views/spend/lab/main.d.ts +2 -0
- package/dist/views/spend/lab/main.d.ts.map +1 -0
- package/dist/views/spend/lab/main.js +237 -0
- package/dist/views/spend/lab/main.js.map +1 -0
- package/dist/views/spend/lab/spend-fixtures.d.ts +72 -0
- package/dist/views/spend/lab/spend-fixtures.d.ts.map +1 -0
- package/dist/views/spend/lab/spend-fixtures.js +412 -0
- package/dist/views/spend/lab/spend-fixtures.js.map +1 -0
- package/dist/views/spend/spend-ink.d.ts +18 -0
- package/dist/views/spend/spend-ink.d.ts.map +1 -0
- package/dist/views/spend/spend-ink.js +50 -0
- package/dist/views/spend/spend-ink.js.map +1 -0
- package/dist/views/spend/spend-list.d.ts +48 -0
- package/dist/views/spend/spend-list.d.ts.map +1 -0
- package/dist/views/spend/spend-list.js +93 -0
- package/dist/views/spend/spend-list.js.map +1 -0
- package/dist/views/spend/spend-paint.d.ts +88 -0
- package/dist/views/spend/spend-paint.d.ts.map +1 -0
- package/dist/views/spend/spend-paint.js +225 -0
- package/dist/views/spend/spend-paint.js.map +1 -0
- package/dist/views/spend/spend-parameters.d.ts +11 -0
- package/dist/views/spend/spend-parameters.d.ts.map +1 -0
- package/dist/views/spend/spend-parameters.js +27 -0
- package/dist/views/spend/spend-parameters.js.map +1 -0
- package/dist/views/spend/spend-scale.d.ts +43 -0
- package/dist/views/spend/spend-scale.d.ts.map +1 -0
- package/dist/views/spend/spend-scale.js +71 -0
- package/dist/views/spend/spend-scale.js.map +1 -0
- package/dist/views/spend/spend-series.d.ts +91 -0
- package/dist/views/spend/spend-series.d.ts.map +1 -0
- package/dist/views/spend/spend-series.js +212 -0
- package/dist/views/spend/spend-series.js.map +1 -0
- package/dist/views/spend/spend-words.d.ts +82 -0
- package/dist/views/spend/spend-words.d.ts.map +1 -0
- package/dist/views/spend/spend-words.js +164 -0
- package/dist/views/spend/spend-words.js.map +1 -0
- package/dist/views/spend/spend.css +585 -0
- package/dist/views/swarm/AgentSwarm.d.ts +4 -0
- package/dist/views/swarm/AgentSwarm.d.ts.map +1 -0
- package/dist/views/swarm/AgentSwarm.js +969 -0
- package/dist/views/swarm/AgentSwarm.js.map +1 -0
- package/dist/views/swarm/bloom/SpawnBloom.d.ts +26 -0
- package/dist/views/swarm/bloom/SpawnBloom.d.ts.map +1 -0
- package/dist/views/swarm/bloom/SpawnBloom.js +332 -0
- package/dist/views/swarm/bloom/SpawnBloom.js.map +1 -0
- package/dist/views/swarm/bloom/birth.d.ts +70 -0
- package/dist/views/swarm/bloom/birth.d.ts.map +1 -0
- package/dist/views/swarm/bloom/birth.js +89 -0
- package/dist/views/swarm/bloom/birth.js.map +1 -0
- package/dist/views/swarm/bloom/canvas-measure.d.ts +11 -0
- package/dist/views/swarm/bloom/canvas-measure.d.ts.map +1 -0
- package/dist/views/swarm/bloom/canvas-measure.js +37 -0
- package/dist/views/swarm/bloom/canvas-measure.js.map +1 -0
- package/dist/views/swarm/bloom/constants.d.ts +93 -0
- package/dist/views/swarm/bloom/constants.d.ts.map +1 -0
- package/dist/views/swarm/bloom/constants.js +94 -0
- package/dist/views/swarm/bloom/constants.js.map +1 -0
- package/dist/views/swarm/bloom/field-frame.d.ts +69 -0
- package/dist/views/swarm/bloom/field-frame.d.ts.map +1 -0
- package/dist/views/swarm/bloom/field-frame.js +104 -0
- package/dist/views/swarm/bloom/field-frame.js.map +1 -0
- package/dist/views/swarm/bloom/geometry.d.ts +187 -0
- package/dist/views/swarm/bloom/geometry.d.ts.map +1 -0
- package/dist/views/swarm/bloom/geometry.js +379 -0
- package/dist/views/swarm/bloom/geometry.js.map +1 -0
- package/dist/views/swarm/bloom/index.d.ts +8 -0
- package/dist/views/swarm/bloom/index.d.ts.map +1 -0
- package/dist/views/swarm/bloom/index.js +13 -0
- package/dist/views/swarm/bloom/index.js.map +1 -0
- package/dist/views/swarm/bloom/menu.d.ts +5 -0
- package/dist/views/swarm/bloom/menu.d.ts.map +1 -0
- package/dist/views/swarm/bloom/menu.js +14 -0
- package/dist/views/swarm/bloom/menu.js.map +1 -0
- package/dist/views/swarm/bloom/model.d.ts +255 -0
- package/dist/views/swarm/bloom/model.d.ts.map +1 -0
- package/dist/views/swarm/bloom/model.js +678 -0
- package/dist/views/swarm/bloom/model.js.map +1 -0
- package/dist/views/swarm/bloom/scenarios.d.ts +7 -0
- package/dist/views/swarm/bloom/scenarios.d.ts.map +1 -0
- package/dist/views/swarm/bloom/scenarios.js +57 -0
- package/dist/views/swarm/bloom/scenarios.js.map +1 -0
- package/dist/views/swarm/bloom/spawn-bloom.css +407 -0
- package/dist/views/swarm/bloom/targeting.d.ts +60 -0
- package/dist/views/swarm/bloom/targeting.d.ts.map +1 -0
- package/dist/views/swarm/bloom/targeting.js +74 -0
- package/dist/views/swarm/bloom/targeting.js.map +1 -0
- package/dist/views/swarm/bloom/use-spawn-bloom.d.ts +100 -0
- package/dist/views/swarm/bloom/use-spawn-bloom.d.ts.map +1 -0
- package/dist/views/swarm/bloom/use-spawn-bloom.js +333 -0
- package/dist/views/swarm/bloom/use-spawn-bloom.js.map +1 -0
- package/dist/views/swarm/bloom/words.d.ts +73 -0
- package/dist/views/swarm/bloom/words.d.ts.map +1 -0
- package/dist/views/swarm/bloom/words.js +195 -0
- package/dist/views/swarm/bloom/words.js.map +1 -0
- package/dist/views/swarm/body-id.d.ts +13 -0
- package/dist/views/swarm/body-id.d.ts.map +1 -0
- package/dist/views/swarm/body-id.js +12 -0
- package/dist/views/swarm/body-id.js.map +1 -0
- package/dist/views/swarm/bubble-model.d.ts +128 -0
- package/dist/views/swarm/bubble-model.d.ts.map +1 -0
- package/dist/views/swarm/bubble-model.js +421 -0
- package/dist/views/swarm/bubble-model.js.map +1 -0
- package/dist/views/swarm/gpu/frame-layout.d.ts +52 -0
- package/dist/views/swarm/gpu/frame-layout.d.ts.map +1 -0
- package/dist/views/swarm/gpu/frame-layout.js +122 -0
- package/dist/views/swarm/gpu/frame-layout.js.map +1 -0
- package/dist/views/swarm/gpu/glyph-atlas.d.ts +63 -0
- package/dist/views/swarm/gpu/glyph-atlas.d.ts.map +1 -0
- package/dist/views/swarm/gpu/glyph-atlas.js +207 -0
- package/dist/views/swarm/gpu/glyph-atlas.js.map +1 -0
- package/dist/views/swarm/gpu/profile-icons.d.ts +4 -0
- package/dist/views/swarm/gpu/profile-icons.d.ts.map +1 -0
- package/dist/views/swarm/gpu/profile-icons.js +18 -0
- package/dist/views/swarm/gpu/profile-icons.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/body.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/body.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/body.wgsl.js +162 -0
- package/dist/views/swarm/gpu/shaders/body.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/common.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/common.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/common.wgsl.js +171 -0
- package/dist/views/swarm/gpu/shaders/common.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/erase.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/erase.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/erase.wgsl.js +61 -0
- package/dist/views/swarm/gpu/shaders/erase.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/field.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/field.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/field.wgsl.js +47 -0
- package/dist/views/swarm/gpu/shaders/field.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/glow.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/glow.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/glow.wgsl.js +39 -0
- package/dist/views/swarm/gpu/shaders/glow.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/hub.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/hub.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/hub.wgsl.js +48 -0
- package/dist/views/swarm/gpu/shaders/hub.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/shadow.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/shadow.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/shadow.wgsl.js +37 -0
- package/dist/views/swarm/gpu/shaders/shadow.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/shaders/text.wgsl.d.ts +3 -0
- package/dist/views/swarm/gpu/shaders/text.wgsl.d.ts.map +1 -0
- package/dist/views/swarm/gpu/shaders/text.wgsl.js +51 -0
- package/dist/views/swarm/gpu/shaders/text.wgsl.js.map +1 -0
- package/dist/views/swarm/gpu/swarm-renderer.d.ts +155 -0
- package/dist/views/swarm/gpu/swarm-renderer.d.ts.map +1 -0
- package/dist/views/swarm/gpu/swarm-renderer.js +696 -0
- package/dist/views/swarm/gpu/swarm-renderer.js.map +1 -0
- package/dist/views/swarm/index.d.ts +9 -0
- package/dist/views/swarm/index.d.ts.map +1 -0
- package/dist/views/swarm/index.js +40 -0
- package/dist/views/swarm/index.js.map +1 -0
- package/dist/views/swarm/lab/fixtures.d.ts +148 -0
- package/dist/views/swarm/lab/fixtures.d.ts.map +1 -0
- package/dist/views/swarm/lab/fixtures.js +821 -0
- package/dist/views/swarm/lab/fixtures.js.map +1 -0
- package/dist/views/swarm/lab/lab.css +315 -0
- package/dist/views/swarm/lab/main.d.ts +2 -0
- package/dist/views/swarm/lab/main.d.ts.map +1 -0
- package/dist/views/swarm/lab/main.js +474 -0
- package/dist/views/swarm/lab/main.js.map +1 -0
- package/dist/views/swarm/physics/driver.d.ts +23 -0
- package/dist/views/swarm/physics/driver.d.ts.map +1 -0
- package/dist/views/swarm/physics/driver.js +68 -0
- package/dist/views/swarm/physics/driver.js.map +1 -0
- package/dist/views/swarm/physics/frame.d.ts +28 -0
- package/dist/views/swarm/physics/frame.d.ts.map +1 -0
- package/dist/views/swarm/physics/frame.js +47 -0
- package/dist/views/swarm/physics/frame.js.map +1 -0
- package/dist/views/swarm/physics/host.d.ts +28 -0
- package/dist/views/swarm/physics/host.d.ts.map +1 -0
- package/dist/views/swarm/physics/host.js +168 -0
- package/dist/views/swarm/physics/host.js.map +1 -0
- package/dist/views/swarm/physics/index.d.ts +6 -0
- package/dist/views/swarm/physics/index.d.ts.map +1 -0
- package/dist/views/swarm/physics/index.js +14 -0
- package/dist/views/swarm/physics/index.js.map +1 -0
- package/dist/views/swarm/physics/inline-driver.d.ts +27 -0
- package/dist/views/swarm/physics/inline-driver.d.ts.map +1 -0
- package/dist/views/swarm/physics/inline-driver.js +37 -0
- package/dist/views/swarm/physics/inline-driver.js.map +1 -0
- package/dist/views/swarm/physics/protocol.d.ts +125 -0
- package/dist/views/swarm/physics/protocol.d.ts.map +1 -0
- package/dist/views/swarm/physics/protocol.js +4 -0
- package/dist/views/swarm/physics/protocol.js.map +1 -0
- package/dist/views/swarm/physics/spawn-clamp.d.ts +11 -0
- package/dist/views/swarm/physics/spawn-clamp.d.ts.map +1 -0
- package/dist/views/swarm/physics/spawn-clamp.js +15 -0
- package/dist/views/swarm/physics/spawn-clamp.js.map +1 -0
- package/dist/views/swarm/physics/swarm-physics.worker.d.ts +2 -0
- package/dist/views/swarm/physics/swarm-physics.worker.d.ts.map +1 -0
- package/dist/views/swarm/physics/swarm-physics.worker.js +66 -0
- package/dist/views/swarm/physics/swarm-physics.worker.js.map +1 -0
- package/dist/views/swarm/physics/world.d.ts +174 -0
- package/dist/views/swarm/physics/world.d.ts.map +1 -0
- package/dist/views/swarm/physics/world.js +454 -0
- package/dist/views/swarm/physics/world.js.map +1 -0
- package/dist/views/swarm/swarm-parameters.d.ts +50 -0
- package/dist/views/swarm/swarm-parameters.d.ts.map +1 -0
- package/dist/views/swarm/swarm-parameters.js +103 -0
- package/dist/views/swarm/swarm-parameters.js.map +1 -0
- package/dist/views/swarm/swarm-theme.d.ts +5 -0
- package/dist/views/swarm/swarm-theme.d.ts.map +1 -0
- package/dist/views/swarm/swarm-theme.js +63 -0
- package/dist/views/swarm/swarm-theme.js.map +1 -0
- package/dist/views/swarm/swarm.css +136 -0
- package/dist/views/swarm/text-layout.d.ts +72 -0
- package/dist/views/swarm/text-layout.d.ts.map +1 -0
- package/dist/views/swarm/text-layout.js +76 -0
- package/dist/views/swarm/text-layout.js.map +1 -0
- package/dist/views/swarm/weight.d.ts +44 -0
- package/dist/views/swarm/weight.d.ts.map +1 -0
- package/dist/views/swarm/weight.js +57 -0
- package/dist/views/swarm/weight.js.map +1 -0
- package/dist/views/timeline/TimelineView.d.ts +9 -0
- package/dist/views/timeline/TimelineView.d.ts.map +1 -0
- package/dist/views/timeline/TimelineView.js +889 -0
- package/dist/views/timeline/TimelineView.js.map +1 -0
- package/dist/views/timeline/index.d.ts +11 -0
- package/dist/views/timeline/index.d.ts.map +1 -0
- package/dist/views/timeline/index.js +63 -0
- package/dist/views/timeline/index.js.map +1 -0
- package/dist/views/timeline/lab/main.d.ts +2 -0
- package/dist/views/timeline/lab/main.d.ts.map +1 -0
- package/dist/views/timeline/lab/main.js +114 -0
- package/dist/views/timeline/lab/main.js.map +1 -0
- package/dist/views/timeline/lab/timeline-fixtures.d.ts +31 -0
- package/dist/views/timeline/lab/timeline-fixtures.d.ts.map +1 -0
- package/dist/views/timeline/lab/timeline-fixtures.js +337 -0
- package/dist/views/timeline/lab/timeline-fixtures.js.map +1 -0
- package/dist/views/timeline/pulse-map.d.ts +63 -0
- package/dist/views/timeline/pulse-map.d.ts.map +1 -0
- package/dist/views/timeline/pulse-map.js +162 -0
- package/dist/views/timeline/pulse-map.js.map +1 -0
- package/dist/views/timeline/timeline-inks.d.ts +28 -0
- package/dist/views/timeline/timeline-inks.d.ts.map +1 -0
- package/dist/views/timeline/timeline-inks.js +35 -0
- package/dist/views/timeline/timeline-inks.js.map +1 -0
- package/dist/views/timeline/timeline-lanes.d.ts +139 -0
- package/dist/views/timeline/timeline-lanes.d.ts.map +1 -0
- package/dist/views/timeline/timeline-lanes.js +240 -0
- package/dist/views/timeline/timeline-lanes.js.map +1 -0
- package/dist/views/timeline/timeline-paint.d.ts +39 -0
- package/dist/views/timeline/timeline-paint.d.ts.map +1 -0
- package/dist/views/timeline/timeline-paint.js +242 -0
- package/dist/views/timeline/timeline-paint.js.map +1 -0
- package/dist/views/timeline/timeline-parameters.d.ts +11 -0
- package/dist/views/timeline/timeline-parameters.d.ts.map +1 -0
- package/dist/views/timeline/timeline-parameters.js +27 -0
- package/dist/views/timeline/timeline-parameters.js.map +1 -0
- package/dist/views/timeline/timeline-scale.d.ts +73 -0
- package/dist/views/timeline/timeline-scale.d.ts.map +1 -0
- package/dist/views/timeline/timeline-scale.js +152 -0
- package/dist/views/timeline/timeline-scale.js.map +1 -0
- package/dist/views/timeline/timeline-words.d.ts +46 -0
- package/dist/views/timeline/timeline-words.d.ts.map +1 -0
- package/dist/views/timeline/timeline-words.js +132 -0
- package/dist/views/timeline/timeline-words.js.map +1 -0
- package/dist/views/timeline/timeline.css +875 -0
- package/dist/views/timeline/wake-geometry.d.ts +88 -0
- package/dist/views/timeline/wake-geometry.d.ts.map +1 -0
- package/dist/views/timeline/wake-geometry.js +243 -0
- package/dist/views/timeline/wake-geometry.js.map +1 -0
- package/package.json +78 -3
- package/README.md +0 -3
|
@@ -0,0 +1,889 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { canvasRatio, createMotionLoop, formatClock, formatWords, keyLegend, sizeCanvas, } from '@vibefield/puppeteer-view-sdk/toolkit';
|
|
4
|
+
import { pulseMap, pulsePastFor, pulseRowsFor, PULSE_GEOMETRY } from './pulse-map.js';
|
|
5
|
+
import { css, resolveTimelineInks } from './timeline-inks.js';
|
|
6
|
+
import { dayStart, earliestHead, laneContentKey, scrolledOutKey, stateAt, stepLight, timelineLanes, withoutScrolledOut, } from './timeline-lanes.js';
|
|
7
|
+
import { paintPulse, paintWakes } from './timeline-paint.js';
|
|
8
|
+
import { normalizeTimelineParameters } from './timeline-parameters.js';
|
|
9
|
+
import { clampSpan, followNow, glideTween, headAt, initialScale, panBy, tickStep, ticksBetween, tweenAt, settledScale, tweenBetween, zoomAt, ZOOM_PRESETS, } from './timeline-scale.js';
|
|
10
|
+
import { laneLabel, laneName, laneSubLine, OPENS_IN_HISTORY, readoutAt, recordState } from './timeline-words.js';
|
|
11
|
+
// The timeline — Godview's swarm through time (DESIGN §8; TL, design F
|
|
12
|
+
// "Wakes" with its map of the day, `draft/godview-timeline/`). Each lane is
|
|
13
|
+
// one wake painted into a canvas, the swarm's bodies sit at the head, and the
|
|
14
|
+
// map above is a scrubber over the whole day.
|
|
15
|
+
//
|
|
16
|
+
// An SDK view (MV-6): it reads its input alone (the model's rows, the theme,
|
|
17
|
+
// the stage, its parameters, and the record's past when the host lends it) and
|
|
18
|
+
// calls `commands.select`. Each lane is its row's birth and its current state
|
|
19
|
+
// (`timeline-lanes.ts`); the view remembers nothing a row did, and draws what
|
|
20
|
+
// the record says of the past only as the host hands it (`history`, T0): a
|
|
21
|
+
// row's past before its current state, and the runs that ended, faint, until
|
|
22
|
+
// they scroll out (TL-D6). Those are lit and read. Where the host lends
|
|
23
|
+
// `commands.openEnded` (TV-8) a press on one, Enter on it lit, or its button
|
|
24
|
+
// in the reader's list asks the host to open it; the view opens nothing
|
|
25
|
+
// itself, and its `past:` id never reaches `select`. Where the host lends
|
|
26
|
+
// none, an ended run is no control at all: no pointer cursor, no button.
|
|
27
|
+
//
|
|
28
|
+
// React lays the lanes out (names, heads, the offscreen buttons); everything
|
|
29
|
+
// that moves with time — the wakes, the map, the ticks, the clock chip and the
|
|
30
|
+
// readouts — is drawn by one draw that repaints only what changed. With motion
|
|
31
|
+
// it runs every frame (the toolkit's loop); still (animations off, or motion
|
|
32
|
+
// reduced) no frame loop runs (MV-W4): the clock is information, so the view
|
|
33
|
+
// draws once a second on a timer, and once when anything changes.
|
|
34
|
+
const MAP_STRIP = 46;
|
|
35
|
+
const AXIS = 22;
|
|
36
|
+
const TERMINAL_LANE = 18;
|
|
37
|
+
const DIVIDER = 20;
|
|
38
|
+
const MAP_LEFT = 14;
|
|
39
|
+
const LANE_MIN = 24;
|
|
40
|
+
const MINUTE = 60_000;
|
|
41
|
+
/**
|
|
42
|
+
* With ended runs lent, the wake canvas covers the window the lanes scroll to and this much either side: a scroll that
|
|
43
|
+
* small repaints nothing.
|
|
44
|
+
*/
|
|
45
|
+
const OVERSCAN = 120;
|
|
46
|
+
function columnsFor(width) {
|
|
47
|
+
const names = width >= 900 ? 196 : width >= 640 ? 166 : 116;
|
|
48
|
+
const head = width >= 900 ? 170 : width >= 640 ? 148 : 104;
|
|
49
|
+
return { width, names, head, x1: Math.max(1, width - head), narrow: width < 640 };
|
|
50
|
+
}
|
|
51
|
+
function layoutLanes(set, bodyHeight, laneMax) {
|
|
52
|
+
const count = set.agents.length;
|
|
53
|
+
const terminals = set.terminals.length;
|
|
54
|
+
const block = terminals ? terminals * TERMINAL_LANE + DIVIDER : 0;
|
|
55
|
+
const room = Math.floor((bodyHeight - 6 - block) / Math.max(1, count));
|
|
56
|
+
const h = Math.min(laneMax, Math.max(LANE_MIN, room));
|
|
57
|
+
const placed = [];
|
|
58
|
+
let y = 2;
|
|
59
|
+
for (const lane of set.agents) {
|
|
60
|
+
placed.push({ lane, y, h });
|
|
61
|
+
y += h;
|
|
62
|
+
}
|
|
63
|
+
let divider;
|
|
64
|
+
if (terminals) {
|
|
65
|
+
divider = y;
|
|
66
|
+
y += DIVIDER;
|
|
67
|
+
for (const lane of set.terminals) {
|
|
68
|
+
placed.push({ lane, y, h: TERMINAL_LANE });
|
|
69
|
+
y += TERMINAL_LANE;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return { placed, divider, height: y + 4 };
|
|
73
|
+
}
|
|
74
|
+
/** Whether the element has the keyboard's focus ring (a click's focus does not). */
|
|
75
|
+
function focusVisible(element) {
|
|
76
|
+
try {
|
|
77
|
+
return element.matches(':focus-visible');
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function dayLabel(t) {
|
|
84
|
+
return new Date(t).toLocaleDateString(undefined, { weekday: 'short', day: 'numeric' }).toUpperCase();
|
|
85
|
+
}
|
|
86
|
+
const set = (element, key, value) => {
|
|
87
|
+
if (element && element.style.getPropertyValue(key) !== value)
|
|
88
|
+
element.style.setProperty(key, value);
|
|
89
|
+
};
|
|
90
|
+
function FolderMark({ terminal }) {
|
|
91
|
+
return (_jsx("svg", { className: "vf-monitor-timeline-mark", viewBox: "0 0 24 24", "aria-hidden": "true", children: terminal ? (_jsx("path", { d: "M3 8a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3ZM7 9.5l3 2.5-3 2.5M12 15h4.5" })) : (_jsx("path", { d: "M3.5 7a2 2 0 0 1 2-2h4l2 2h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z" })) }));
|
|
92
|
+
}
|
|
93
|
+
/** A peer's lane: a desktop's line mark, its name in the title (the row carries no OS to draw by yet). */
|
|
94
|
+
function PeerMark({ name }) {
|
|
95
|
+
return (_jsxs("svg", { className: "vf-monitor-timeline-mark is-peer", viewBox: "0 0 24 24", role: "img", "aria-label": `on ${name}`, children: [_jsx("title", { children: name }), _jsx("path", { d: "M4.5 5h15a1.5 1.5 0 0 1 1.5 1.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 15.5v-9A1.5 1.5 0 0 1 4.5 5ZM9 20.5h6M12 17v3.5" })] }));
|
|
96
|
+
}
|
|
97
|
+
/** A lane's name row, floated over the wakes' far end: a row's project, or an ended run's own name, faint. */
|
|
98
|
+
function nameRow({ lane, y, h }) {
|
|
99
|
+
const sub = laneSubLine(lane);
|
|
100
|
+
const two = h >= 30 && lane.kind === 'agent' && sub !== '';
|
|
101
|
+
const device = lane.ended === undefined ? lane.row.device : lane.ended.device;
|
|
102
|
+
const active = lane.row?.active === true;
|
|
103
|
+
const pane = lane.row?.attachment;
|
|
104
|
+
return (_jsxs("div", { className: `vf-monitor-timeline-name${two ? ' is-two' : ''}${lane.kind === 'terminal' ? ' is-terminal' : ''}${lane.ended !== undefined ? ' is-ended' : ''}${lane.receded ? ' is-receded' : ''}${active ? ' is-active' : ''}`, style: { top: y, height: h, '--mv-timeline-colour': lane.colour }, children: [pane ? (_jsx("i", { className: `vf-monitor-timeline-band${active ? ' is-active' : ''}`, style: pane.colour ? { background: pane.colour } : undefined })) : null, _jsxs("span", { className: "vf-monitor-timeline-who", children: [device.self ? null : _jsx(PeerMark, { name: device.name }), _jsx(FolderMark, { terminal: lane.kind === 'terminal' }), _jsx("b", { children: laneName(lane) })] }), two ? _jsx("small", { children: sub }) : null] }, lane.id));
|
|
105
|
+
}
|
|
106
|
+
/** A lane's head row: its body and its readout, which the draw lights and writes. */
|
|
107
|
+
function headRow({ lane, y, h }, ref) {
|
|
108
|
+
return (_jsxs("div", { ref: ref, className: `vf-monitor-timeline-head${lane.kind === 'terminal' ? ' is-terminal' : ''}${h < 30 ? ' is-one' : ''}${lane.receded ? ' is-receded' : ''}`, style: {
|
|
109
|
+
top: y,
|
|
110
|
+
height: h,
|
|
111
|
+
'--mv-timeline-lane-height': `${h}px`,
|
|
112
|
+
'--mv-timeline-colour': lane.colour,
|
|
113
|
+
}, children: [_jsx("i", { className: "vf-monitor-timeline-body-mark" }), _jsxs("span", { className: "vf-monitor-timeline-readout", children: [_jsx("b", {}), _jsx("small", {})] })] }, lane.id));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The key that brings the head back to now. The manifest declares it, the map hears it, and the now button, which does
|
|
117
|
+
* the same, prints its legend under the mark (M177 ruling 4).
|
|
118
|
+
*/
|
|
119
|
+
export const NOW_KEY = 'End';
|
|
120
|
+
function NowMark() {
|
|
121
|
+
return (_jsx("svg", { className: "vf-monitor-timeline-now-mark", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { d: "M4 12h10.5M11 8.5l3.5 3.5-3.5 3.5M19.5 4.5v15" }) }));
|
|
122
|
+
}
|
|
123
|
+
export function TimelineView({ input, commands }) {
|
|
124
|
+
const { model, parameters, theme, stage } = input;
|
|
125
|
+
const rows = model.agents;
|
|
126
|
+
// The record's past, when the host lends it (absent: runtime only, exactly as before).
|
|
127
|
+
const history = input.capabilities.history;
|
|
128
|
+
// Ended runs can make the rows far taller than the stage: only then does the wake canvas cover just the window.
|
|
129
|
+
const tall = history !== undefined && history.ended.length > 0;
|
|
130
|
+
// The record not whole (partial, unavailable): the backend's one sentence, said as it said it. Whole: no words.
|
|
131
|
+
const recordWords = history !== undefined && history.state !== 'complete' ? history.detail : undefined;
|
|
132
|
+
const settings = useMemo(() => normalizeTimelineParameters(parameters), [parameters]);
|
|
133
|
+
// The host's animations switch and the person's reduced-motion preference: either one stills the view.
|
|
134
|
+
const motion = theme.animations && !theme.reducedMotion;
|
|
135
|
+
const rootRef = useRef(null);
|
|
136
|
+
const bodyRef = useRef(null);
|
|
137
|
+
const rowsRef = useRef(null);
|
|
138
|
+
const wakeRef = useRef(null);
|
|
139
|
+
const mapBoxRef = useRef(null);
|
|
140
|
+
const mapRef = useRef(null);
|
|
141
|
+
const dimLeftRef = useRef(null);
|
|
142
|
+
const dimRightRef = useRef(null);
|
|
143
|
+
const knobRef = useRef(null);
|
|
144
|
+
const tipRef = useRef(null);
|
|
145
|
+
const sinceRef = useRef(null);
|
|
146
|
+
const ticksRef = useRef(null);
|
|
147
|
+
const chipRef = useRef(null);
|
|
148
|
+
const focusRingRef = useRef(null);
|
|
149
|
+
const headEls = useRef([]);
|
|
150
|
+
/** One stable ref per head slot, for the rows held by identity (a fresh ref would re-attach on every render). */
|
|
151
|
+
const headRefs = useRef([]);
|
|
152
|
+
/**
|
|
153
|
+
* An ended run's three rows (its name, its head, its line in the screen reader's list), held by identity: a model
|
|
154
|
+
* publish rebuilds the live lanes, never these. An ended lane keeps its object while the history does, so its rows
|
|
155
|
+
* are built again only for a new history, a new place in the layout, or (its spoken line) a new minute or a host
|
|
156
|
+
* that began or stopped lending `openEnded`: the line is keyed on the command's presence, never on the commands
|
|
157
|
+
* object, and its press reads the command through the ref. The lit lane and the head's moment never reach them: the
|
|
158
|
+
* draw lights the canvas and writes the readouts itself.
|
|
159
|
+
*/
|
|
160
|
+
const endedRows = useRef(new WeakMap());
|
|
161
|
+
const [size, setSize] = useState({ width: 0, height: 0 });
|
|
162
|
+
/** Ended runs that have scrolled out of the window, as one key (changes rarely; empty without history). */
|
|
163
|
+
const [scrolledOut, setScrolledOut] = useState('');
|
|
164
|
+
const [bar, setBar] = useState({ spanMs: initialScale(0).spanMs, live: true });
|
|
165
|
+
// The history's own lanes are built once per history object; the rows join them by id on every publish.
|
|
166
|
+
const laneSet = useMemo(() => timelineLanes(rows, Date.now(), history), [rows, history]);
|
|
167
|
+
const visible = useMemo(() => withoutScrolledOut(laneSet, scrolledOut), [laneSet, scrolledOut]);
|
|
168
|
+
const columns = columnsFor(size.width);
|
|
169
|
+
const bodyHeight = Math.max(0, size.height - MAP_STRIP - AXIS);
|
|
170
|
+
const layout = useMemo(() => layoutLanes(visible, bodyHeight, settings.laneMax), [visible, bodyHeight, settings.laneMax]);
|
|
171
|
+
// What the canvases draw of the layout: a model that changes none of it repaints nothing.
|
|
172
|
+
const layoutKey = useMemo(() => `${laneContentKey(layout.placed.map((placed) => placed.lane))}#${bodyHeight}#${settings.laneMax}`, [layout, bodyHeight, settings.laneMax]);
|
|
173
|
+
// What the draw reads: the latest of everything, through refs, so a new row
|
|
174
|
+
// or a theme change repaints the next frame without tearing the loop down.
|
|
175
|
+
const scaleRef = useRef(initialScale(Date.now()));
|
|
176
|
+
const tweenRef = useRef(null);
|
|
177
|
+
const laneSetRef = useRef(laneSet);
|
|
178
|
+
const historyRef = useRef(history);
|
|
179
|
+
const tallRef = useRef(tall);
|
|
180
|
+
const scrolledOutRef = useRef(scrolledOut);
|
|
181
|
+
/** The body's scroll, as its scroll events last said it (read there, never in the draw, which writes the DOM). */
|
|
182
|
+
const scrollRef = useRef(0);
|
|
183
|
+
/** Where the wake canvas stands in the rows: it moves only when the window the body shows leaves it. */
|
|
184
|
+
const canvasTopRef = useRef(0);
|
|
185
|
+
const layoutRef = useRef(layout);
|
|
186
|
+
const columnsRef = useRef(columns);
|
|
187
|
+
const bodyHeightRef = useRef(bodyHeight);
|
|
188
|
+
const settingsRef = useRef(settings);
|
|
189
|
+
const commandsRef = useRef(commands);
|
|
190
|
+
const inksRef = useRef(null);
|
|
191
|
+
const fontRef = useRef('ui-monospace, monospace');
|
|
192
|
+
/** The lit lane and the keyboard's lane, by id: indices go stale when a lane is added or leaves. */
|
|
193
|
+
const litRef = useRef(null);
|
|
194
|
+
const focusRef = useRef(null);
|
|
195
|
+
/** The ended lane under the pointer, while the host can open it (TV-8): the cursor says it is a control. */
|
|
196
|
+
const pointedRef = useRef(null);
|
|
197
|
+
const revRef = useRef(0);
|
|
198
|
+
/** The wakes want a repaint (the light moved, the scale was put); the map has its own, since its lens is DOM. */
|
|
199
|
+
const dirtyRef = useRef(true);
|
|
200
|
+
const mapDirtyRef = useRef(true);
|
|
201
|
+
const wakeKeyRef = useRef('');
|
|
202
|
+
const mapKeyRef = useRef('');
|
|
203
|
+
const tickKeyRef = useRef('');
|
|
204
|
+
const headKeysRef = useRef([]);
|
|
205
|
+
const mapRangeRef = useRef([0, 1]);
|
|
206
|
+
/** Motion is allowed: tweens play and the owed body rings. */
|
|
207
|
+
const motionRef = useRef(motion);
|
|
208
|
+
const readoutKeyRef = useRef('');
|
|
209
|
+
const barRef = useRef(bar);
|
|
210
|
+
const drawRef = useRef(() => undefined);
|
|
211
|
+
const loopRef = useRef(null);
|
|
212
|
+
const frameRef = useRef(0);
|
|
213
|
+
laneSetRef.current = laneSet;
|
|
214
|
+
historyRef.current = history;
|
|
215
|
+
tallRef.current = tall;
|
|
216
|
+
scrolledOutRef.current = scrolledOut;
|
|
217
|
+
layoutRef.current = layout;
|
|
218
|
+
columnsRef.current = columns;
|
|
219
|
+
bodyHeightRef.current = bodyHeight;
|
|
220
|
+
settingsRef.current = settings;
|
|
221
|
+
commandsRef.current = commands;
|
|
222
|
+
motionRef.current = motion;
|
|
223
|
+
/** One frame for a still view; with motion the loop's next frame draws anyway. */
|
|
224
|
+
const requestDraw = useCallback(() => {
|
|
225
|
+
if (loopRef.current?.running || frameRef.current !== 0)
|
|
226
|
+
return;
|
|
227
|
+
frameRef.current = requestAnimationFrame((time) => {
|
|
228
|
+
frameRef.current = 0;
|
|
229
|
+
drawRef.current(time);
|
|
230
|
+
});
|
|
231
|
+
}, []);
|
|
232
|
+
/** The wakes repaint: the light moved, the scale was put. */
|
|
233
|
+
const invalidate = useCallback(() => {
|
|
234
|
+
dirtyRef.current = true;
|
|
235
|
+
requestDraw();
|
|
236
|
+
}, [requestDraw]);
|
|
237
|
+
// The palette, resolved once per theme into the numbers the canvases want;
|
|
238
|
+
// the state lights also reach the DOM bodies as custom properties, so the
|
|
239
|
+
// CSS never names a colour of its own.
|
|
240
|
+
useLayoutEffect(() => {
|
|
241
|
+
const root = rootRef.current;
|
|
242
|
+
if (!root)
|
|
243
|
+
return;
|
|
244
|
+
const inks = resolveTimelineInks(theme.tokens, root);
|
|
245
|
+
inksRef.current = inks;
|
|
246
|
+
fontRef.current = getComputedStyle(root).fontFamily || fontRef.current;
|
|
247
|
+
root.dataset.ground = inks.dark ? 'dark' : 'light';
|
|
248
|
+
set(root, '--mv-timeline-orange', css(inks.orange));
|
|
249
|
+
set(root, '--mv-timeline-blue', css(inks.blue));
|
|
250
|
+
set(root, '--mv-timeline-orange-ink', css(inks.orangeInk));
|
|
251
|
+
set(root, '--mv-timeline-blue-ink', css(inks.blueInk));
|
|
252
|
+
set(root, '--mv-timeline-orange-ground', css(inks.orangeGround));
|
|
253
|
+
set(root, '--mv-timeline-blue-ground', css(inks.blueGround));
|
|
254
|
+
revRef.current += 1;
|
|
255
|
+
headKeysRef.current = [];
|
|
256
|
+
dirtyRef.current = true;
|
|
257
|
+
mapDirtyRef.current = true;
|
|
258
|
+
requestDraw();
|
|
259
|
+
}, [theme.tokens, requestDraw]);
|
|
260
|
+
useLayoutEffect(() => {
|
|
261
|
+
const root = rootRef.current;
|
|
262
|
+
if (!root)
|
|
263
|
+
return;
|
|
264
|
+
const measure = () => setSize((current) => current.width === root.clientWidth && current.height === root.clientHeight
|
|
265
|
+
? current
|
|
266
|
+
: { width: root.clientWidth, height: root.clientHeight });
|
|
267
|
+
measure();
|
|
268
|
+
const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(measure);
|
|
269
|
+
observer?.observe(root);
|
|
270
|
+
return () => observer?.disconnect();
|
|
271
|
+
}, []);
|
|
272
|
+
const earliest = useCallback((scale, nowMs) => {
|
|
273
|
+
return earliestHead(laneSetRef.current, scale.spanMs, nowMs);
|
|
274
|
+
}, []);
|
|
275
|
+
/** A held head no earlier than the map allows at its span: a zoom out near the day's start stays on the map. */
|
|
276
|
+
const clampHead = useCallback((scale, nowMs) => scale.live ? scale : headAt(scale, scale.endMs, nowMs, earliest(scale, nowMs)), [earliest]);
|
|
277
|
+
/** Put a new scale in place now: a drag, a key, the map. Any tween stops. */
|
|
278
|
+
const place = useCallback((next) => {
|
|
279
|
+
tweenRef.current = null;
|
|
280
|
+
scaleRef.current = next;
|
|
281
|
+
invalidate();
|
|
282
|
+
}, [invalidate]);
|
|
283
|
+
/** The scale as the loop last drew it, mid-tween included. */
|
|
284
|
+
const current = useCallback(() => {
|
|
285
|
+
const tween = tweenRef.current;
|
|
286
|
+
if (!tween)
|
|
287
|
+
return scaleRef.current;
|
|
288
|
+
return tweenAt(tween, performance.now(), Date.now(), !motionRef.current).scale;
|
|
289
|
+
}, []);
|
|
290
|
+
/** Zoom to `spanMs` about the head (a preset, − =), building on any tween's target. */
|
|
291
|
+
const zoomTo = useCallback((spanMs) => {
|
|
292
|
+
const now = Date.now();
|
|
293
|
+
const base = settledScale(scaleRef.current, tweenRef.current, now);
|
|
294
|
+
const target = clampHead(zoomAt(base, spanMs, 0, columnsRef.current.x1, now), now);
|
|
295
|
+
if (!motionRef.current) {
|
|
296
|
+
place(target);
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
const from = current();
|
|
300
|
+
scaleRef.current = from;
|
|
301
|
+
tweenRef.current = tweenBetween(from, target, performance.now());
|
|
302
|
+
invalidate();
|
|
303
|
+
}, [clampHead, current, invalidate, place]);
|
|
304
|
+
/** Pinch or ⌘-scroll: zoom about the pointer, easing toward a target that each event moves on. */
|
|
305
|
+
const zoomAround = useCallback((factor, anchorFromHeadPx) => {
|
|
306
|
+
const now = Date.now();
|
|
307
|
+
const base = settledScale(scaleRef.current, tweenRef.current, now);
|
|
308
|
+
const target = clampHead(zoomAt(base, clampSpan(base.spanMs * factor), anchorFromHeadPx, columnsRef.current.x1, now), now);
|
|
309
|
+
if (!motionRef.current) {
|
|
310
|
+
place(target);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
const from = current();
|
|
314
|
+
scaleRef.current = from;
|
|
315
|
+
tweenRef.current = tweenBetween(from, target, performance.now());
|
|
316
|
+
invalidate();
|
|
317
|
+
}, [clampHead, current, invalidate, place]);
|
|
318
|
+
const toNow = useCallback(() => {
|
|
319
|
+
const from = current();
|
|
320
|
+
if (from.live && !tweenRef.current)
|
|
321
|
+
return;
|
|
322
|
+
scaleRef.current = from;
|
|
323
|
+
tweenRef.current = glideTween(from, performance.now());
|
|
324
|
+
invalidate();
|
|
325
|
+
}, [current, invalidate]);
|
|
326
|
+
const pan = useCallback((deltaMs) => {
|
|
327
|
+
const now = Date.now();
|
|
328
|
+
const from = current();
|
|
329
|
+
place(panBy(from, deltaMs, now, earliest(from, now)));
|
|
330
|
+
}, [current, earliest, place]);
|
|
331
|
+
const placedOf = (id) => id === null ? undefined : layoutRef.current.placed.find((placed) => placed.lane.id === id);
|
|
332
|
+
const choose = useCallback((id) => {
|
|
333
|
+
const placed = placedOf(id);
|
|
334
|
+
if (!placed)
|
|
335
|
+
return;
|
|
336
|
+
// An ended run's `past:` id never reaches `select` (the backend's). The host opens it where it lends the command
|
|
337
|
+
// (TV-8); where it lends none the run is lit and read, and this does nothing.
|
|
338
|
+
if (placed.lane.ended !== undefined)
|
|
339
|
+
commandsRef.current.openEnded?.(placed.lane.id);
|
|
340
|
+
else
|
|
341
|
+
commandsRef.current.select(placed.lane.id);
|
|
342
|
+
}, []);
|
|
343
|
+
/** The pointer's lane: over an ended run the host can open the root says so, and the cursor is a control's. */
|
|
344
|
+
const point = useCallback((placed) => {
|
|
345
|
+
const opens = placed?.lane.ended !== undefined && commandsRef.current.openEnded !== undefined;
|
|
346
|
+
const id = opens ? placed.lane.id : null;
|
|
347
|
+
const was = pointedRef.current;
|
|
348
|
+
pointedRef.current = id;
|
|
349
|
+
if ((was === null) === (id === null))
|
|
350
|
+
return;
|
|
351
|
+
if (id === null)
|
|
352
|
+
rootRef.current?.removeAttribute('data-opens');
|
|
353
|
+
else
|
|
354
|
+
rootRef.current?.setAttribute('data-opens', 'true');
|
|
355
|
+
}, []);
|
|
356
|
+
const light = useCallback((id) => {
|
|
357
|
+
if (litRef.current === id)
|
|
358
|
+
return;
|
|
359
|
+
litRef.current = id;
|
|
360
|
+
invalidate();
|
|
361
|
+
}, [invalidate]);
|
|
362
|
+
/** The keyboard's ring on its lane (CSS shows it only for keyboard focus); `reveal` scrolls it into view. */
|
|
363
|
+
const paintFocusRing = useCallback((reveal = false) => {
|
|
364
|
+
const ring = focusRingRef.current;
|
|
365
|
+
const placed = placedOf(focusRef.current);
|
|
366
|
+
if (!ring)
|
|
367
|
+
return;
|
|
368
|
+
ring.hidden = !placed;
|
|
369
|
+
if (!placed)
|
|
370
|
+
return;
|
|
371
|
+
ring.style.top = `${placed.y}px`;
|
|
372
|
+
ring.style.height = `${placed.h}px`;
|
|
373
|
+
const body = bodyRef.current;
|
|
374
|
+
if (body && reveal) {
|
|
375
|
+
if (placed.y < body.scrollTop)
|
|
376
|
+
body.scrollTop = placed.y;
|
|
377
|
+
else if (placed.y + placed.h > body.scrollTop + body.clientHeight)
|
|
378
|
+
body.scrollTop = placed.y + placed.h - body.clientHeight;
|
|
379
|
+
}
|
|
380
|
+
}, []);
|
|
381
|
+
// The ring follows its lane's id through a new layout; a lane that left takes the ring with it, and the pointer's
|
|
382
|
+
// ended lane its cursor.
|
|
383
|
+
useLayoutEffect(() => {
|
|
384
|
+
paintFocusRing();
|
|
385
|
+
if (pointedRef.current !== null)
|
|
386
|
+
point(placedOf(pointedRef.current));
|
|
387
|
+
}, [layout, paintFocusRing, point]);
|
|
388
|
+
// ───────────────────────────── the draw
|
|
389
|
+
useEffect(() => {
|
|
390
|
+
let lastSecond = -1;
|
|
391
|
+
const draw = (time) => {
|
|
392
|
+
const root = rootRef.current;
|
|
393
|
+
const inks = inksRef.current;
|
|
394
|
+
const cols = columnsRef.current;
|
|
395
|
+
if (!root || !inks || cols.width <= 0)
|
|
396
|
+
return;
|
|
397
|
+
const now = Date.now();
|
|
398
|
+
const moving = motionRef.current;
|
|
399
|
+
let scale = scaleRef.current;
|
|
400
|
+
const tween = tweenRef.current;
|
|
401
|
+
if (tween) {
|
|
402
|
+
const step = tweenAt(tween, time, now, !moving);
|
|
403
|
+
scale = step.scale;
|
|
404
|
+
if (step.done)
|
|
405
|
+
tweenRef.current = null;
|
|
406
|
+
scaleRef.current = scale;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
scale = followNow(scale, now);
|
|
410
|
+
scaleRef.current = scale;
|
|
411
|
+
}
|
|
412
|
+
const following = scale.live || (tween?.live === true && tween.toEndMs === 'now');
|
|
413
|
+
const t1 = scale.endMs;
|
|
414
|
+
const t0 = t1 - scale.spanMs;
|
|
415
|
+
const k = cols.x1 / scale.spanMs;
|
|
416
|
+
const all = laneSetRef.current;
|
|
417
|
+
// An ended run stays until it has scrolled out past the left edge (TL-D6).
|
|
418
|
+
if (historyRef.current !== undefined || scrolledOutRef.current !== '') {
|
|
419
|
+
const out = historyRef.current === undefined ? '' : scrolledOutKey(all, t0);
|
|
420
|
+
if (out !== scrolledOutRef.current) {
|
|
421
|
+
scrolledOutRef.current = out;
|
|
422
|
+
setScrolledOut(out);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
const lay = layoutRef.current;
|
|
426
|
+
// A move between displays changes the ratio: both canvases repaint at the new one.
|
|
427
|
+
const ratio = canvasRatio(2);
|
|
428
|
+
const view = bodyHeightRef.current;
|
|
429
|
+
const rowsHeight = Math.max(lay.height, view);
|
|
430
|
+
// Ended runs can make the rows far taller than the stage: the wake canvas then covers only the window the body
|
|
431
|
+
// shows and a margin either side, and moves when that window leaves it. Otherwise it is as tall as the rows, as
|
|
432
|
+
// before.
|
|
433
|
+
let canvasHeight = rowsHeight;
|
|
434
|
+
let canvasTop = 0;
|
|
435
|
+
if (tallRef.current) {
|
|
436
|
+
canvasHeight = Math.min(rowsHeight, view + 2 * OVERSCAN);
|
|
437
|
+
canvasTop = canvasTopRef.current;
|
|
438
|
+
const scrollTop = scrollRef.current;
|
|
439
|
+
if (scrollTop < canvasTop ||
|
|
440
|
+
scrollTop + view > canvasTop + canvasHeight ||
|
|
441
|
+
canvasTop + canvasHeight > rowsHeight) {
|
|
442
|
+
canvasTop = Math.max(0, Math.min(rowsHeight - canvasHeight, Math.round(scrollTop - OVERSCAN)));
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
canvasTopRef.current = canvasTop;
|
|
446
|
+
const second = Math.floor(now / 1000);
|
|
447
|
+
const tick = second !== lastSecond;
|
|
448
|
+
lastSecond = second;
|
|
449
|
+
// The wakes: repainted when the head has moved a third of a pixel, or anything else changed.
|
|
450
|
+
const wake = wakeRef.current;
|
|
451
|
+
const lit = litRef.current === null ? -1 : lay.placed.findIndex((placed) => placed.lane.id === litRef.current);
|
|
452
|
+
const wakeKey = `${Math.round(t1 * k * 3)}|${Math.round(scale.spanMs)}|${revRef.current}|${lit}|${cols.x1}x${canvasHeight}+${canvasTop}@${ratio}`;
|
|
453
|
+
if (wake && (wakeKey !== wakeKeyRef.current || dirtyRef.current)) {
|
|
454
|
+
wakeKeyRef.current = wakeKey;
|
|
455
|
+
sizeCanvas(wake, cols.x1, canvasHeight, { maxRatio: 2 });
|
|
456
|
+
set(wake, 'top', canvasTop === 0 ? '' : `${canvasTop}px`);
|
|
457
|
+
const ctx = wake.getContext('2d');
|
|
458
|
+
if (ctx) {
|
|
459
|
+
paintWakes(ctx, {
|
|
460
|
+
width: cols.x1,
|
|
461
|
+
height: canvasHeight,
|
|
462
|
+
ratio,
|
|
463
|
+
lanes: lay.placed,
|
|
464
|
+
t0,
|
|
465
|
+
t1,
|
|
466
|
+
nowMs: now,
|
|
467
|
+
lit,
|
|
468
|
+
glow: settingsRef.current.glow,
|
|
469
|
+
top: canvasTop,
|
|
470
|
+
}, inks);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
// The axis: wall-clock ticks, rebuilt when their step or range moves, slid the rest of the time.
|
|
474
|
+
const layer = ticksRef.current;
|
|
475
|
+
if (layer) {
|
|
476
|
+
const step = tickStep(k);
|
|
477
|
+
const origin = Math.floor(t0 / step) * step;
|
|
478
|
+
const tickKey = `${step}|${origin}|${Math.round(k * 1e9)}`;
|
|
479
|
+
if (tickKey !== tickKeyRef.current) {
|
|
480
|
+
tickKeyRef.current = tickKey;
|
|
481
|
+
const html = [];
|
|
482
|
+
for (const mark of ticksBetween(origin - step, origin + scale.spanMs + 2 * step, step)) {
|
|
483
|
+
const d = new Date(mark.t);
|
|
484
|
+
const midnight = d.getHours() === 0 && d.getMinutes() === 0;
|
|
485
|
+
html.push(`<span class="vf-monitor-timeline-tick${mark.hour ? ' is-hour' : ''}" style="left:${((mark.t - origin) * k).toFixed(1)}px">${midnight ? dayLabel(mark.t) : formatClock(mark.t)}</span>`);
|
|
486
|
+
}
|
|
487
|
+
layer.innerHTML = html.join('');
|
|
488
|
+
}
|
|
489
|
+
set(layer, 'transform', `translate3d(${((origin - t0) * k).toFixed(2)}px,0,0)`);
|
|
490
|
+
}
|
|
491
|
+
const chip = chipRef.current;
|
|
492
|
+
if (chip) {
|
|
493
|
+
const text = following ? formatClock(now, true) : formatClock(t1);
|
|
494
|
+
if (chip.textContent !== text)
|
|
495
|
+
chip.textContent = text;
|
|
496
|
+
}
|
|
497
|
+
root.dataset.detached = following ? 'false' : 'true';
|
|
498
|
+
// The map: its content moves once a second (its right end is now); its lens every frame.
|
|
499
|
+
const box = mapBoxRef.current;
|
|
500
|
+
const mapCanvas = mapRef.current;
|
|
501
|
+
if (box && mapCanvas) {
|
|
502
|
+
const width = Math.max(1, cols.x1 - MAP_LEFT);
|
|
503
|
+
const start = dayStart(all, scale.spanMs, now);
|
|
504
|
+
mapRangeRef.current = [start, now];
|
|
505
|
+
const mapKey = `${revRef.current}|${width}|${Math.round(start / 1000)}@${ratio}`;
|
|
506
|
+
if (tick || mapKey !== mapKeyRef.current || mapDirtyRef.current) {
|
|
507
|
+
mapKeyRef.current = mapKey;
|
|
508
|
+
mapDirtyRef.current = false;
|
|
509
|
+
sizeCanvas(mapCanvas, width, PULSE_GEOMETRY.height, { maxRatio: 2 });
|
|
510
|
+
const ctx = mapCanvas.getContext('2d');
|
|
511
|
+
if (ctx) {
|
|
512
|
+
const map = pulseMap(pulseRowsFor(all.agents, now), start, now, { ...PULSE_GEOMETRY, width }, pulsePastFor(all.agents));
|
|
513
|
+
paintPulse(ctx, mapCanvas, map, { width, height: PULSE_GEOMETRY.height, ratio, startMs: start, nowMs: now, font: fontRef.current }, inks);
|
|
514
|
+
}
|
|
515
|
+
const since = `SINCE ${formatClock(start)}`;
|
|
516
|
+
if (sinceRef.current && sinceRef.current.textContent !== since)
|
|
517
|
+
sinceRef.current.textContent = since;
|
|
518
|
+
}
|
|
519
|
+
const range = Math.max(1, now - start);
|
|
520
|
+
const left = Math.min(1, Math.max(0, (t0 - start) / range)) * width;
|
|
521
|
+
const right = Math.min(1, Math.max(0, (t1 - start) / range)) * width;
|
|
522
|
+
set(dimLeftRef.current, 'width', `${left.toFixed(1)}px`);
|
|
523
|
+
set(dimRightRef.current, 'left', `${right.toFixed(1)}px`);
|
|
524
|
+
set(dimRightRef.current, 'width', `${Math.max(0, width - right).toFixed(1)}px`);
|
|
525
|
+
set(knobRef.current, 'left', `${right.toFixed(1)}px`);
|
|
526
|
+
knobRef.current?.classList.toggle('is-back', !following);
|
|
527
|
+
const say = following ? `Now, ${formatClock(now)}` : `${formatClock(t1)}, ${formatWords(now - t1)} ago`;
|
|
528
|
+
// Each attribute on its own: a render may have reset any of them to its own moment.
|
|
529
|
+
const aria = [
|
|
530
|
+
['aria-valuetext', say],
|
|
531
|
+
['aria-valuemin', String(Math.round(start))],
|
|
532
|
+
['aria-valuemax', String(Math.round(now / 1000) * 1000)],
|
|
533
|
+
['aria-valuenow', String(Math.round(following ? now / 1000 : t1 / 1000) * 1000)],
|
|
534
|
+
];
|
|
535
|
+
for (const [name, value] of aria)
|
|
536
|
+
if (box.getAttribute(name) !== value)
|
|
537
|
+
box.setAttribute(name, value);
|
|
538
|
+
}
|
|
539
|
+
// The bodies relight to the head's moment; following now they are now (TL-D13).
|
|
540
|
+
const at = following ? now : t1;
|
|
541
|
+
// Once a second following now; looking back, when the head moves; and when the lanes change.
|
|
542
|
+
const readoutKey = `${following ? second : Math.round(t1 / 1000)}|${revRef.current}`;
|
|
543
|
+
const readoutsDue = readoutKey !== readoutKeyRef.current;
|
|
544
|
+
readoutKeyRef.current = readoutKey;
|
|
545
|
+
if (readoutsDue)
|
|
546
|
+
lay.placed.forEach((placed, index) => {
|
|
547
|
+
const el = headEls.current[index];
|
|
548
|
+
if (!el)
|
|
549
|
+
return;
|
|
550
|
+
const readout = readoutAt(placed.lane, stateAt(placed.lane, at), at, following, now);
|
|
551
|
+
const key = `${readout.tone}|${readout.big}|${readout.small}|${readout.owed}${readout.recorded ? '|r' : ''}`;
|
|
552
|
+
if (headKeysRef.current[index] === key)
|
|
553
|
+
return;
|
|
554
|
+
headKeysRef.current[index] = key;
|
|
555
|
+
el.dataset.tone = readout.tone;
|
|
556
|
+
el.dataset.owed = readout.owed ? 'true' : 'false';
|
|
557
|
+
// Words from the record may take a second line rather than be cut (timeline.css).
|
|
558
|
+
if (readout.recorded)
|
|
559
|
+
el.dataset.recorded = 'true';
|
|
560
|
+
else if (el.dataset.recorded !== undefined)
|
|
561
|
+
delete el.dataset.recorded;
|
|
562
|
+
const big = el.querySelector('b');
|
|
563
|
+
const small = el.querySelector('small');
|
|
564
|
+
if (big)
|
|
565
|
+
big.textContent = readout.big;
|
|
566
|
+
if (small)
|
|
567
|
+
small.textContent = readout.small;
|
|
568
|
+
});
|
|
569
|
+
dirtyRef.current = false;
|
|
570
|
+
const preset = Math.round(scale.spanMs / 1000) * 1000;
|
|
571
|
+
if (barRef.current.spanMs !== preset || barRef.current.live !== following) {
|
|
572
|
+
barRef.current = { spanMs: preset, live: following };
|
|
573
|
+
setBar(barRef.current);
|
|
574
|
+
}
|
|
575
|
+
// A tween still landing wants its next frame; a still view lands it at once.
|
|
576
|
+
if (tweenRef.current)
|
|
577
|
+
requestDraw();
|
|
578
|
+
};
|
|
579
|
+
drawRef.current = draw;
|
|
580
|
+
return () => {
|
|
581
|
+
drawRef.current = () => undefined;
|
|
582
|
+
};
|
|
583
|
+
}, [requestDraw]);
|
|
584
|
+
// ───────────────────────────── when it draws
|
|
585
|
+
// With motion, every frame: the toolkit's loop asks for none while animations are off or motion is reduced.
|
|
586
|
+
useEffect(() => {
|
|
587
|
+
const loop = createMotionLoop((time) => drawRef.current(time), {
|
|
588
|
+
animations: theme.animations,
|
|
589
|
+
reducedMotion: theme.reducedMotion,
|
|
590
|
+
});
|
|
591
|
+
loopRef.current = loop;
|
|
592
|
+
return () => {
|
|
593
|
+
loop.dispose();
|
|
594
|
+
loopRef.current = null;
|
|
595
|
+
if (frameRef.current !== 0)
|
|
596
|
+
cancelAnimationFrame(frameRef.current);
|
|
597
|
+
frameRef.current = 0;
|
|
598
|
+
};
|
|
599
|
+
// the loop lives as long as the view; the switches reach it below
|
|
600
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
601
|
+
}, []);
|
|
602
|
+
// Still, the clock keeps time once a second, on the second, from a timer rather than a frame loop.
|
|
603
|
+
useEffect(() => {
|
|
604
|
+
loopRef.current?.update({ animations: theme.animations, reducedMotion: theme.reducedMotion });
|
|
605
|
+
requestDraw();
|
|
606
|
+
if (motion)
|
|
607
|
+
return;
|
|
608
|
+
let timer;
|
|
609
|
+
const second = () => {
|
|
610
|
+
timer = setTimeout(second, 1000 - (Date.now() % 1000));
|
|
611
|
+
drawRef.current(performance.now());
|
|
612
|
+
};
|
|
613
|
+
timer = setTimeout(second, 1000 - (Date.now() % 1000));
|
|
614
|
+
return () => clearTimeout(timer);
|
|
615
|
+
}, [motion, theme.animations, theme.reducedMotion, requestDraw]);
|
|
616
|
+
// A new layout, width, tuning or history: every canvas and readout draws again, once.
|
|
617
|
+
useEffect(() => {
|
|
618
|
+
revRef.current += 1;
|
|
619
|
+
headKeysRef.current = [];
|
|
620
|
+
dirtyRef.current = true;
|
|
621
|
+
mapDirtyRef.current = true;
|
|
622
|
+
requestDraw();
|
|
623
|
+
}, [layoutKey, columns.width, settings, history, requestDraw]);
|
|
624
|
+
// ───────────────────────────── pointing
|
|
625
|
+
const pointer = useRef(null);
|
|
626
|
+
const local = (event) => {
|
|
627
|
+
const rect = rowsRef.current?.getBoundingClientRect();
|
|
628
|
+
return rect ? { x: event.clientX - rect.left, y: event.clientY - rect.top } : { x: 0, y: 0 };
|
|
629
|
+
};
|
|
630
|
+
const placedAt = (y) => layoutRef.current.placed.find((p) => y >= p.y && y < p.y + p.h);
|
|
631
|
+
const laneAt = (y) => placedAt(y)?.lane.id ?? null;
|
|
632
|
+
const dropDrag = () => {
|
|
633
|
+
pointer.current = null;
|
|
634
|
+
rootRef.current?.removeAttribute('data-panning');
|
|
635
|
+
};
|
|
636
|
+
const onPointerDown = (event) => {
|
|
637
|
+
if (event.button !== 0)
|
|
638
|
+
return;
|
|
639
|
+
const { x } = local(event);
|
|
640
|
+
pointer.current = { x: event.clientX, id: event.pointerId, moved: false, inTrack: x <= columnsRef.current.x1 };
|
|
641
|
+
};
|
|
642
|
+
const onPointerMove = (event) => {
|
|
643
|
+
let drag = pointer.current;
|
|
644
|
+
// A press released outside the view never reached pointerup here: no button down, no drag.
|
|
645
|
+
if (drag && (event.buttons & 1) === 0) {
|
|
646
|
+
dropDrag();
|
|
647
|
+
drag = null;
|
|
648
|
+
}
|
|
649
|
+
if (drag?.inTrack) {
|
|
650
|
+
const dx = event.clientX - drag.x;
|
|
651
|
+
if (!drag.moved && Math.abs(dx) > 4) {
|
|
652
|
+
drag.moved = true;
|
|
653
|
+
event.currentTarget.setPointerCapture?.(drag.id);
|
|
654
|
+
rootRef.current?.setAttribute('data-panning', 'true');
|
|
655
|
+
}
|
|
656
|
+
if (drag.moved) {
|
|
657
|
+
const k = columnsRef.current.x1 / current().spanMs;
|
|
658
|
+
pan(-dx / k);
|
|
659
|
+
drag.x = event.clientX;
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
const over = placedAt(local(event).y);
|
|
664
|
+
light(over?.lane.id ?? null);
|
|
665
|
+
point(over);
|
|
666
|
+
};
|
|
667
|
+
const onPointerEnd = (event) => {
|
|
668
|
+
const drag = pointer.current;
|
|
669
|
+
dropDrag();
|
|
670
|
+
if (!drag || drag.moved || event.type !== 'pointerup')
|
|
671
|
+
return;
|
|
672
|
+
const id = laneAt(local(event).y);
|
|
673
|
+
if (id !== null) {
|
|
674
|
+
focusRef.current = id;
|
|
675
|
+
paintFocusRing();
|
|
676
|
+
choose(id);
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
useEffect(() => {
|
|
680
|
+
const body = bodyRef.current;
|
|
681
|
+
if (!body)
|
|
682
|
+
return;
|
|
683
|
+
const wheel = (event) => {
|
|
684
|
+
const { x } = local(event);
|
|
685
|
+
const cols = columnsRef.current;
|
|
686
|
+
if (event.ctrlKey || event.metaKey) {
|
|
687
|
+
event.preventDefault();
|
|
688
|
+
const factor = Math.exp(event.deltaY * (event.ctrlKey ? 0.012 : 0.004));
|
|
689
|
+
zoomAround(factor, cols.x1 - Math.min(cols.x1, Math.max(0, x)));
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
const horizontal = Math.abs(event.deltaX) > Math.abs(event.deltaY) || event.shiftKey;
|
|
693
|
+
const overflow = body.scrollHeight > body.clientHeight + 1;
|
|
694
|
+
if (horizontal || !overflow) {
|
|
695
|
+
event.preventDefault();
|
|
696
|
+
const delta = horizontal ? (event.shiftKey && !event.deltaX ? event.deltaY : event.deltaX) : event.deltaY;
|
|
697
|
+
pan(delta * (current().spanMs / cols.x1));
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
body.addEventListener('wheel', wheel, { passive: false });
|
|
701
|
+
return () => body.removeEventListener('wheel', wheel);
|
|
702
|
+
}, [current, pan, zoomAround]);
|
|
703
|
+
const onBodyKey = (event) => {
|
|
704
|
+
const count = layoutRef.current.placed.length;
|
|
705
|
+
if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
|
706
|
+
if (!count)
|
|
707
|
+
return;
|
|
708
|
+
event.preventDefault();
|
|
709
|
+
const lanes = layoutRef.current.placed.map((placed) => placed.lane);
|
|
710
|
+
const from = lanes.findIndex((lane) => lane.id === focusRef.current);
|
|
711
|
+
focusRef.current = lanes[stepLight(lanes, from, event.key === 'ArrowDown' ? 1 : -1)]?.id ?? focusRef.current;
|
|
712
|
+
paintFocusRing(true);
|
|
713
|
+
light(focusRef.current);
|
|
714
|
+
}
|
|
715
|
+
else if (event.key === 'Enter' && focusRef.current !== null) {
|
|
716
|
+
event.preventDefault();
|
|
717
|
+
choose(focusRef.current);
|
|
718
|
+
}
|
|
719
|
+
else if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
720
|
+
event.preventDefault();
|
|
721
|
+
pan((event.key === 'ArrowLeft' ? -1 : 1) * current().spanMs * 0.125);
|
|
722
|
+
}
|
|
723
|
+
else if (event.key === '-' || event.key === '=' || event.key === '+') {
|
|
724
|
+
event.preventDefault();
|
|
725
|
+
const base = settledScale(scaleRef.current, tweenRef.current, Date.now());
|
|
726
|
+
zoomTo(base.spanMs * (event.key === '-' ? 2 : 0.5));
|
|
727
|
+
}
|
|
728
|
+
};
|
|
729
|
+
// ───────────────────────────── the map: a scrubber
|
|
730
|
+
const scrubbing = useRef(false);
|
|
731
|
+
const mapFraction = (clientX) => {
|
|
732
|
+
const rect = mapBoxRef.current?.getBoundingClientRect();
|
|
733
|
+
if (!rect || rect.width <= 0)
|
|
734
|
+
return { f: 1, x: 0, width: 1 };
|
|
735
|
+
const x = clientX - rect.left;
|
|
736
|
+
return { f: Math.min(1, Math.max(0, x / rect.width)), x, width: rect.width };
|
|
737
|
+
};
|
|
738
|
+
const scrubTo = (clientX) => {
|
|
739
|
+
const { f, width } = mapFraction(clientX);
|
|
740
|
+
const now = Date.now();
|
|
741
|
+
const [start, end] = mapRangeRef.current;
|
|
742
|
+
const scale = current();
|
|
743
|
+
if (f >= 1 - 5 / width) {
|
|
744
|
+
place({ spanMs: scale.spanMs, endMs: now, live: true });
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
place(headAt(scale, start + f * (end - start), now, earliest(scale, now)));
|
|
748
|
+
};
|
|
749
|
+
const showTip = (clientX) => {
|
|
750
|
+
const tip = tipRef.current;
|
|
751
|
+
if (!tip)
|
|
752
|
+
return;
|
|
753
|
+
const { f, x, width } = mapFraction(clientX);
|
|
754
|
+
const [start, end] = mapRangeRef.current;
|
|
755
|
+
tip.textContent = f >= 1 - 5 / width ? 'NOW' : formatClock(start + f * (end - start));
|
|
756
|
+
tip.style.left = `${Math.min(width - 20, Math.max(20, x))}px`;
|
|
757
|
+
tip.hidden = false;
|
|
758
|
+
};
|
|
759
|
+
const onMapDown = (event) => {
|
|
760
|
+
if (event.button !== 0)
|
|
761
|
+
return;
|
|
762
|
+
event.preventDefault();
|
|
763
|
+
event.currentTarget.focus({ preventScroll: true });
|
|
764
|
+
scrubbing.current = true;
|
|
765
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
766
|
+
rootRef.current?.setAttribute('data-scrubbing', 'true');
|
|
767
|
+
scrubTo(event.clientX);
|
|
768
|
+
showTip(event.clientX);
|
|
769
|
+
};
|
|
770
|
+
const onMapMove = (event) => {
|
|
771
|
+
showTip(event.clientX);
|
|
772
|
+
if (scrubbing.current)
|
|
773
|
+
scrubTo(event.clientX);
|
|
774
|
+
};
|
|
775
|
+
const onMapEnd = () => {
|
|
776
|
+
scrubbing.current = false;
|
|
777
|
+
rootRef.current?.removeAttribute('data-scrubbing');
|
|
778
|
+
};
|
|
779
|
+
const onMapKey = (event) => {
|
|
780
|
+
const now = Date.now();
|
|
781
|
+
const scale = current();
|
|
782
|
+
if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {
|
|
783
|
+
event.preventDefault();
|
|
784
|
+
const step = (event.shiftKey ? 30 : 5) * MINUTE;
|
|
785
|
+
pan(event.key === 'ArrowLeft' ? -step : step);
|
|
786
|
+
}
|
|
787
|
+
else if (event.key === 'Home') {
|
|
788
|
+
event.preventDefault();
|
|
789
|
+
place(headAt(scale, earliest(scale, now), now, earliest(scale, now)));
|
|
790
|
+
}
|
|
791
|
+
else if (event.key === NOW_KEY) {
|
|
792
|
+
event.preventDefault();
|
|
793
|
+
toNow();
|
|
794
|
+
}
|
|
795
|
+
};
|
|
796
|
+
// The slider's values from the first render (the draw keeps them current between renders).
|
|
797
|
+
const renderNow = Date.now();
|
|
798
|
+
const renderScale = followNow(scaleRef.current, renderNow);
|
|
799
|
+
const slider = {
|
|
800
|
+
min: dayStart(laneSet, renderScale.spanMs, renderNow),
|
|
801
|
+
max: renderNow,
|
|
802
|
+
now: renderScale.endMs,
|
|
803
|
+
text: renderScale.live
|
|
804
|
+
? `Now, ${formatClock(renderNow)}`
|
|
805
|
+
: `${formatClock(renderScale.endMs)}, ${formatWords(renderNow - renderScale.endMs)} ago`,
|
|
806
|
+
};
|
|
807
|
+
const presetIndex = ZOOM_PRESETS.findIndex((preset) => Math.abs(preset.spanMs - bar.spanMs) < 1000);
|
|
808
|
+
const nextPreset = ZOOM_PRESETS[(presetIndex + 1) % ZOOM_PRESETS.length];
|
|
809
|
+
// The view's own properties (L18): its geometry from the stage (the chrome it clears on the left and, M58, above)
|
|
810
|
+
// and its columns, the ground from the palette.
|
|
811
|
+
const rootStyle = {
|
|
812
|
+
'--mv-timeline-inset-left': `${stage.insets.left}px`,
|
|
813
|
+
'--mv-timeline-inset-top': `${stage.insets.top}px`,
|
|
814
|
+
'--mv-timeline-ground': theme.tokens.timeline.ground,
|
|
815
|
+
'--mv-timeline-x1': `${columns.x1}px`,
|
|
816
|
+
'--mv-timeline-head': `${columns.head}px`,
|
|
817
|
+
'--mv-timeline-names': `${columns.names}px`,
|
|
818
|
+
};
|
|
819
|
+
const empty = layout.placed.length === 0;
|
|
820
|
+
// Whether the host can open an ended run (TV-8): its presence alone, so a new commands object rebuilds no row.
|
|
821
|
+
const opens = commands.openEnded !== undefined;
|
|
822
|
+
/** An ended run's rows, from the cache while its place, the minute and the host's door hold (see `endedRows`). */
|
|
823
|
+
const endedRowsAt = (placed, index) => {
|
|
824
|
+
const { lane } = placed;
|
|
825
|
+
const place = `${placed.y}|${placed.h}|${index}`;
|
|
826
|
+
const minute = Math.floor(renderNow / MINUTE);
|
|
827
|
+
let rows = endedRows.current.get(lane);
|
|
828
|
+
if (rows === undefined || rows.place !== place) {
|
|
829
|
+
const ref = (headRefs.current[index] ??= (element) => {
|
|
830
|
+
headEls.current[index] = element;
|
|
831
|
+
});
|
|
832
|
+
rows = {
|
|
833
|
+
place,
|
|
834
|
+
minute: -1,
|
|
835
|
+
opens: rows?.opens ?? opens,
|
|
836
|
+
name: nameRow(placed),
|
|
837
|
+
head: headRow(placed, ref),
|
|
838
|
+
item: rows?.item ?? null,
|
|
839
|
+
};
|
|
840
|
+
}
|
|
841
|
+
if (rows.minute !== minute || rows.opens !== opens || rows.item === null) {
|
|
842
|
+
rows = {
|
|
843
|
+
...rows,
|
|
844
|
+
minute,
|
|
845
|
+
opens,
|
|
846
|
+
item: (_jsx("li", { children: opens ? (
|
|
847
|
+
// The host can open it: a control, as a row's is. The press reads the command through the ref.
|
|
848
|
+
_jsx("button", { type: "button", onClick: () => commandsRef.current.openEnded?.(lane.id), children: `${laneLabel(lane, renderNow)}, ${OPENS_IN_HISTORY}` })) : (
|
|
849
|
+
// No host to open it: an ended run is read, never opened, and there is no control to press.
|
|
850
|
+
_jsx("span", { children: laneLabel(lane, renderNow) })) }, lane.id)),
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
endedRows.current.set(lane, rows);
|
|
854
|
+
return rows;
|
|
855
|
+
};
|
|
856
|
+
return (_jsxs("div", { ref: rootRef, className: `vf-monitor-timeline${columns.narrow ? ' is-narrow' : ''}`, style: rootStyle, "data-motion": motion ? 'on' : 'off', children: [_jsxs("div", { className: "vf-monitor-timeline-map", children: [_jsxs("div", { ref: mapBoxRef, className: "vf-monitor-timeline-map-box", role: "slider", tabIndex: 0, "aria-valuemin": Math.round(slider.min), "aria-valuemax": Math.round(slider.max / 1000) * 1000, "aria-valuenow": Math.round(slider.now / 1000) * 1000, "aria-valuetext": slider.text, "aria-label": "The head\u2019s moment in the day", title: "The whole day. Press to put the head there; drag to play it back.", onPointerDown: onMapDown, onPointerMove: onMapMove, onPointerUp: onMapEnd, onPointerCancel: onMapEnd, onPointerLeave: () => {
|
|
857
|
+
if (!scrubbing.current && tipRef.current)
|
|
858
|
+
tipRef.current.hidden = true;
|
|
859
|
+
}, onKeyDown: onMapKey, children: [_jsx("canvas", { ref: mapRef, className: "vf-monitor-timeline-map-canvas", "aria-hidden": "true" }), _jsx("i", { ref: dimLeftRef, className: "vf-monitor-timeline-map-dim is-left", "aria-hidden": "true" }), _jsx("i", { ref: dimRightRef, className: "vf-monitor-timeline-map-dim is-right", "aria-hidden": "true" }), _jsx("i", { ref: knobRef, className: "vf-monitor-timeline-map-head", "aria-hidden": "true" }), _jsx("span", { ref: tipRef, className: "vf-monitor-timeline-map-tip", "aria-hidden": "true", hidden: true })] }), _jsxs("div", { className: "vf-monitor-timeline-tools", children: [columns.narrow ? (_jsx("button", { type: "button", className: "vf-monitor-timeline-tool", title: nextPreset.title, "aria-label": `Span ${ZOOM_PRESETS[presetIndex]?.label ?? 'custom'}; ${nextPreset.title}`, onClick: () => zoomTo(nextPreset.spanMs), children: ZOOM_PRESETS[presetIndex]?.label ?? '—' })) : (_jsx("div", { className: "vf-monitor-timeline-zoom", role: "group", "aria-label": "Time span", children: ZOOM_PRESETS.map((preset) => (_jsx("button", { type: "button", className: "vf-monitor-timeline-tool", title: preset.title, "aria-pressed": preset.spanMs === ZOOM_PRESETS[presetIndex]?.spanMs, onClick: () => zoomTo(preset.spanMs), children: preset.label }, preset.id))) })), _jsxs("button", { type: "button", className: "vf-monitor-timeline-tool is-now", "aria-pressed": bar.live, "aria-label": bar.live ? 'Following now' : 'Back to now', title: bar.live ? 'Following now' : 'Back to now', onClick: toNow, children: [_jsx(NowMark, {}), _jsx("span", { className: "vf-monitor-timeline-key", "aria-hidden": "true", children: keyLegend(NOW_KEY) })] })] }), _jsx("span", { ref: sinceRef, className: "vf-monitor-timeline-since", "aria-hidden": "true" }), recordWords === undefined ? null : (_jsx("p", { className: "vf-monitor-timeline-record", role: "status", title: recordWords, children: columns.narrow ? (
|
|
860
|
+
// Too narrow for the sentence: the state, in SINCE's words; the sentence stays for a reader and the title.
|
|
861
|
+
_jsxs(_Fragment, { children: [_jsx("span", { className: "vf-monitor-timeline-record-state", "aria-hidden": "true", children: recordState(history.state) }), _jsx("span", { className: "vf-monitor-timeline-unseen-text", children: recordWords })] })) : (recordWords) }))] }), _jsxs("div", { className: "vf-monitor-timeline-axis", "aria-hidden": "true", children: [_jsx("div", { className: "vf-monitor-timeline-axis-clip", children: _jsx("div", { ref: ticksRef, className: "vf-monitor-timeline-ticks" }) }), _jsx("div", { ref: chipRef, className: "vf-monitor-timeline-chip" })] }), _jsx("div", { ref: bodyRef, className: "vf-monitor-timeline-body", tabIndex: 0, role: "group", "aria-label": "Agents over time. Up and down light a lane, Enter opens it, left and right move through time, minus and equals zoom.", onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerEnd, onPointerCancel: onPointerEnd, onPointerLeave: (event) => {
|
|
862
|
+
dropDrag();
|
|
863
|
+
point(undefined);
|
|
864
|
+
// The keyboard's lane keeps the light while the body holds focus.
|
|
865
|
+
light(event.currentTarget.matches(':focus') ? focusRef.current : null);
|
|
866
|
+
}, onLostPointerCapture: dropDrag, onScroll: (event) => {
|
|
867
|
+
scrollRef.current = event.currentTarget.scrollTop;
|
|
868
|
+
// Only a canvas that covers part of the rows (ended runs lent) has anything to move.
|
|
869
|
+
if (tallRef.current)
|
|
870
|
+
requestDraw();
|
|
871
|
+
}, onKeyDown: onBodyKey, onFocus: (event) => {
|
|
872
|
+
// A click's focus takes the lane it lands on (pointerup); the keyboard's enters at the first.
|
|
873
|
+
if (focusRef.current === null && focusVisible(event.currentTarget)) {
|
|
874
|
+
const lanes = layoutRef.current.placed.map((placed) => placed.lane);
|
|
875
|
+
focusRef.current = lanes[stepLight(lanes, -1, 1)]?.id ?? null;
|
|
876
|
+
}
|
|
877
|
+
paintFocusRing(true);
|
|
878
|
+
}, children: _jsxs("div", { ref: rowsRef, className: "vf-monitor-timeline-rows", style: { height: layout.height }, children: [_jsx("canvas", { ref: wakeRef, className: "vf-monitor-timeline-wakes", "aria-hidden": "true" }), layout.divider === undefined ? null : (_jsx("div", { className: "vf-monitor-timeline-divider", style: { top: layout.divider, height: DIVIDER }, "aria-hidden": "true", children: _jsx("span", { children: "TERMINALS" }) })), _jsx("div", { className: "vf-monitor-timeline-names", "aria-hidden": "true", children: layout.placed.map((placed, index) => placed.lane.ended === undefined ? nameRow(placed) : endedRowsAt(placed, index).name) }), _jsx("div", { className: "vf-monitor-timeline-heads", "aria-hidden": "true", children: layout.placed.map((placed, index) => placed.lane.ended === undefined
|
|
879
|
+
? headRow(placed, (element) => {
|
|
880
|
+
headEls.current[index] = element;
|
|
881
|
+
})
|
|
882
|
+
: endedRowsAt(placed, index).head) }), _jsx("div", { ref: focusRingRef, className: "vf-monitor-timeline-focus", hidden: true, "aria-hidden": "true" })] }) }), empty ? (_jsxs("div", { className: "vf-monitor-timeline-empty", children: [_jsx("span", { children: "NO ACTIVE AGENTS" }), _jsx("small", { children: "Launch an agent from a terminal pane." })] })) : null, _jsx("ul", { className: "vf-monitor-timeline-agents", children: layout.placed.map((placed, index) => {
|
|
883
|
+
const { lane } = placed;
|
|
884
|
+
if (lane.ended !== undefined)
|
|
885
|
+
return endedRowsAt(placed, index).item;
|
|
886
|
+
return (_jsx("li", { children: _jsx("button", { type: "button", onClick: () => commands.select(lane.id), "aria-current": lane.row.active ? 'true' : undefined, children: laneLabel(lane, Date.now()) }) }, lane.id));
|
|
887
|
+
}) })] }));
|
|
888
|
+
}
|
|
889
|
+
//# sourceMappingURL=TimelineView.js.map
|