···
141
141
</Applet>
142
142
143
143
<Applet title="Orchestrators" list={orchestrators}>
144
144
-
These too are applet compositions. However, unlike themes, these are purely logical, and
145
145
-
reuse applet instances from the parent context (when available). Mostly exist in order to
146
146
-
construct sensible defaults to use across themes and abstractions.
144
144
+
These too are applet compositions. However, unlike themes, these are purely logical.
145
145
+
Mostly exist in order to construct sensible defaults to use across themes and
146
146
+
abstractions.
147
147
</Applet>
148
148
149
149
<Applet title="Output" list={output}>
···
49
49
50
50
await waitUntilAppletIsReady(configurator.input);
51
51
52
52
-
console.log("Ready.");
53
53
-
54
52
const cachedTracks = orchestrator.output.data.tracks.collection;
55
53
await configurator.input.sendAction("contextualize", cachedTracks);
56
54
57
57
-
console.log("Start list.");
58
58
-
59
55
const tracks = await configurator.input.sendAction<Track[]>("list", cachedTracks, {
60
56
timeoutDuration: 60000 * 60 * 24,
61
57
});
62
62
-
63
63
-
console.log("Got tracks", tracks);
64
58
65
59
// Process
66
60
const tracksWithMetadata = await tracks.reduce(
···
1
1
import type { Applet, AppletEvent } from "@web-applets/sdk";
2
2
3
3
+
import QS from "query-string";
3
4
import { applets } from "@web-applets/sdk";
4
5
import { type ElementConfigurator, h } from "spellcaster/hyperscript.js";
5
6
import { effect, isSignal, Signal, signal } from "spellcaster/spellcaster.js";
···
12
13
src: string,
13
14
opts: {
14
15
addSlashSuffix?: boolean;
16
16
+
applets?: Record<string, string>;
15
17
container?: HTMLElement | Element;
16
18
id?: string;
17
19
setHeight?: boolean;
···
24
26
? "/"
25
27
: ""
26
28
}`;
29
29
+
30
30
+
if (opts.applets) {
31
31
+
src = QS.stringifyUrl({ url: src, query: opts.applets });
32
32
+
}
27
33
28
34
const existingFrame: HTMLIFrameElement | null = window.document.querySelector(`[src="${src}"]`);
29
35
···
13
13
14
14
import type * as AudioUI from "@applets/themes/pilot/ui/audio/types.d.ts";
15
15
16
16
+
// TODO: Themes
17
17
+
16
18
const engine = {
17
19
audio: await applet<AudioEngine.State>("../../engine/audio"),
18
20
queue: await applet<QueueEngine.State>("../../engine/queue"),
19
21
};
20
22
21
23
const _orchestrator = {
22
22
-
input: await applet("../../orchestrator/input-cache"),
24
24
+
input: await applet("../../orchestrator/input-cache", {
25
25
+
applets: { input: "todo" },
26
26
+
}),
23
27
output: await applet("../../orchestrator/output-management"),
24
28
queue: await applet("../../orchestrator/single-queue"),
25
29
};