animader-cli 0.4.0 → 0.6.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.
@@ -4,14 +4,18 @@
4
4
  //
5
5
  // The protocol is deliberately small and honest: on a successful build the
6
6
  // server broadcasts `reload` with the URL of the new generation, and the
7
- // page does a full location.replace onto it — playback stops, the page
8
- // boots into READY and requires Start again. No state is preserved and no
9
- // hot reload is claimed or attempted. On a failed build the server
10
- // broadcasts `stale` with the build error: the page keeps the last
11
- // successful view and shows a clear indication; recovery is the next
12
- // successful edit's reload. A (re)connecting client is greeted with the
13
- // CURRENT generation, so a channel that reconnects after a reload lands on
14
- // whatever is served now.
7
+ // page does a full location.replace onto it. Playback stops; the dev page
8
+ // writes the visible tick to sessionStorage on the way out (boot.mjs owns
9
+ // that store) and the fresh page comes back paused at that moment — a
10
+ // `?t=<seconds>` moment on the reload URL wins — so a rebuild keeps the
11
+ // frame being inspected instead of returning to zero. No hot reload is
12
+ // claimed or attempted; the published release entry never carries this
13
+ // channel and never reads or writes the store. On a failed build the server
14
+ // broadcasts `stale`
15
+ // with the build error: the page keeps the last successful view and shows a
16
+ // clear indication; recovery is the next successful edit's reload. A
17
+ // (re)connecting client is greeted with the CURRENT generation, so a
18
+ // channel that reconnects after a reload lands on whatever is served now.
15
19
  //
16
20
  // The client uses the browser's own EventSource reconnection; no timers,
17
21
  // no workers, no second clock.
@@ -76,8 +80,9 @@ export function connectDevChannel({ generation, onStale = () => {}, eventSourceC
76
80
  return;
77
81
  }
78
82
  if (detail && typeof detail.url === 'string' && detail.url.startsWith('/')) {
79
- // Stop playback and reload onto the new generation: a fresh boot, a
80
- // fresh READY, Start pressed again by the person editing.
83
+ // Stop playback and reload onto the new generation: a fresh boot that
84
+ // restores the moment the page wrote on the way out (or the reload
85
+ // URL's `?t=`), paused and never playing.
81
86
  window.location.replace(detail.url);
82
87
  }
83
88
  });
package/player/index.html CHANGED
@@ -19,6 +19,10 @@
19
19
  <div id="controls" class="panel" role="group" aria-label="Playback controls">
20
20
  <button id="primary" type="button" data-player-control="primary" hidden>Start</button>
21
21
  <button id="fullscreen" type="button" class="secondary" data-player-control="fullscreen" hidden>Fullscreen</button>
22
+ <div id="readout" class="readout" hidden>
23
+ <span id="readout-position"></span>
24
+ <span id="readout-elapsed"></span>
25
+ </div>
22
26
  </div>
23
27
  <div id="error" class="banner" role="alert" tabindex="-1" hidden>
24
28
  <span class="marker">error:</span> <span id="error-message"></span>
package/player/page.mjs CHANGED
@@ -99,6 +99,12 @@ const devProfile = {
99
99
  configUrl: `${prefix}/config.json`,
100
100
  manifestUrl: null,
101
101
  configManifestPath: null,
102
+ // The dev-only chrome lives behind this profile seam: boot never imports it,
103
+ // and the release entry does not carry this file at all.
104
+ loadChrome: async (options) => {
105
+ const { mountTransport } = await importModule('./transport.mjs');
106
+ return mountTransport(options);
107
+ },
102
108
  assets: [
103
109
  { key: 'payload', url: `${prefix}/project/out/show.png`, kind: 'bytes' },
104
110
  { key: 'timeline', url: `${prefix}/project/timeline.piece.sjon`, kind: 'text' },