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.
- package/adapters/webaudio.mjs +6 -4
- package/hello/run.js +82 -16
- package/lib/routes.mjs +1 -1
- package/lib/show.mjs +186 -11
- package/package.json +4 -4
- package/player/boot.mjs +467 -15
- package/player/controller.mjs +593 -22
- package/player/devchannel.mjs +15 -10
- package/player/index.html +4 -0
- package/player/page.mjs +6 -0
- package/player/player.css +682 -5
- package/player/transport.mjs +1445 -0
- package/resources/editor/.animader/schemas/metadata.json +3 -3
- package/resources/editor/.animader/schemas/pngine.sjon +128 -7
- package/src/commands/dev.mjs +3 -2
- package/toolchain/manifest.json +17 -17
- package/toolchain/uniform-type-name.js +17 -4
package/player/devchannel.mjs
CHANGED
|
@@ -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
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
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
|
|
80
|
-
//
|
|
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' },
|