@lumencast/runtime 0.1.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 +201 -0
- package/README.md +79 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/animate/crossfade.d.ts +13 -0
- package/dist/animate/crossfade.d.ts.map +1 -0
- package/dist/animate/crossfade.js +10 -0
- package/dist/animate/crossfade.js.map +1 -0
- package/dist/animate/keyframes.d.ts +42 -0
- package/dist/animate/keyframes.d.ts.map +1 -0
- package/dist/animate/keyframes.js +94 -0
- package/dist/animate/keyframes.js.map +1 -0
- package/dist/animate/transitions.d.ts +38 -0
- package/dist/animate/transitions.d.ts.map +1 -0
- package/dist/animate/transitions.js +81 -0
- package/dist/animate/transitions.js.map +1 -0
- package/dist/app.d.ts +16 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +35 -0
- package/dist/app.js.map +1 -0
- package/dist/broadcast-BqOhSNsY.js +11 -0
- package/dist/broadcast-BqOhSNsY.js.map +1 -0
- package/dist/control-CRFn328D.js +16 -0
- package/dist/control-CRFn328D.js.map +1 -0
- package/dist/dev-entry.d.ts +2 -0
- package/dist/dev-entry.d.ts.map +1 -0
- package/dist/dev-entry.js +31 -0
- package/dist/dev-entry.js.map +1 -0
- package/dist/index-DUhPPRvw.js +583 -0
- package/dist/index-DUhPPRvw.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.html +46 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/validate-options.d.ts +5 -0
- package/dist/internal/validate-options.d.ts.map +1 -0
- package/dist/internal/validate-options.js +19 -0
- package/dist/internal/validate-options.js.map +1 -0
- package/dist/lumencast.js +5 -0
- package/dist/lumencast.js.map +1 -0
- package/dist/modes/broadcast.d.ts +3 -0
- package/dist/modes/broadcast.d.ts.map +1 -0
- package/dist/modes/broadcast.js +9 -0
- package/dist/modes/broadcast.js.map +1 -0
- package/dist/modes/control.d.ts +4 -0
- package/dist/modes/control.d.ts.map +1 -0
- package/dist/modes/control.js +12 -0
- package/dist/modes/control.js.map +1 -0
- package/dist/modes/test.d.ts +4 -0
- package/dist/modes/test.d.ts.map +1 -0
- package/dist/modes/test.js +13 -0
- package/dist/modes/test.js.map +1 -0
- package/dist/mount.d.ts +3 -0
- package/dist/mount.d.ts.map +1 -0
- package/dist/mount.js +144 -0
- package/dist/mount.js.map +1 -0
- package/dist/overlay/control.d.ts +2 -0
- package/dist/overlay/control.d.ts.map +1 -0
- package/dist/overlay/control.js +127 -0
- package/dist/overlay/control.js.map +1 -0
- package/dist/overlay/runtime-context.d.ts +20 -0
- package/dist/overlay/runtime-context.d.ts.map +1 -0
- package/dist/overlay/runtime-context.js +14 -0
- package/dist/overlay/runtime-context.js.map +1 -0
- package/dist/overlay/status-pill.d.ts +2 -0
- package/dist/overlay/status-pill.d.ts.map +1 -0
- package/dist/overlay/status-pill.js +29 -0
- package/dist/overlay/status-pill.js.map +1 -0
- package/dist/overlay/test.d.ts +5 -0
- package/dist/overlay/test.d.ts.map +1 -0
- package/dist/overlay/test.js +116 -0
- package/dist/overlay/test.js.map +1 -0
- package/dist/render/bundle.d.ts +102 -0
- package/dist/render/bundle.d.ts.map +1 -0
- package/dist/render/bundle.js +86 -0
- package/dist/render/bundle.js.map +1 -0
- package/dist/render/fill.d.ts +41 -0
- package/dist/render/fill.d.ts.map +1 -0
- package/dist/render/fill.js +95 -0
- package/dist/render/fill.js.map +1 -0
- package/dist/render/keyframe-player.d.ts +10 -0
- package/dist/render/keyframe-player.d.ts.map +1 -0
- package/dist/render/keyframe-player.js +65 -0
- package/dist/render/keyframe-player.js.map +1 -0
- package/dist/render/primitives/frame.d.ts +12 -0
- package/dist/render/primitives/frame.d.ts.map +1 -0
- package/dist/render/primitives/frame.js +65 -0
- package/dist/render/primitives/frame.js.map +1 -0
- package/dist/render/primitives/grid.d.ts +4 -0
- package/dist/render/primitives/grid.d.ts.map +1 -0
- package/dist/render/primitives/grid.js +14 -0
- package/dist/render/primitives/grid.js.map +1 -0
- package/dist/render/primitives/image.d.ts +5 -0
- package/dist/render/primitives/image.d.ts.map +1 -0
- package/dist/render/primitives/image.js +25 -0
- package/dist/render/primitives/image.js.map +1 -0
- package/dist/render/primitives/index.d.ts +10 -0
- package/dist/render/primitives/index.d.ts.map +1 -0
- package/dist/render/primitives/index.js +22 -0
- package/dist/render/primitives/index.js.map +1 -0
- package/dist/render/primitives/instance.d.ts +4 -0
- package/dist/render/primitives/instance.d.ts.map +1 -0
- package/dist/render/primitives/instance.js +35 -0
- package/dist/render/primitives/instance.js.map +1 -0
- package/dist/render/primitives/media.d.ts +6 -0
- package/dist/render/primitives/media.d.ts.map +1 -0
- package/dist/render/primitives/media.js +19 -0
- package/dist/render/primitives/media.js.map +1 -0
- package/dist/render/primitives/shape.d.ts +12 -0
- package/dist/render/primitives/shape.d.ts.map +1 -0
- package/dist/render/primitives/shape.js +66 -0
- package/dist/render/primitives/shape.js.map +1 -0
- package/dist/render/primitives/stack.d.ts +13 -0
- package/dist/render/primitives/stack.d.ts.map +1 -0
- package/dist/render/primitives/stack.js +45 -0
- package/dist/render/primitives/stack.js.map +1 -0
- package/dist/render/primitives/text.d.ts +6 -0
- package/dist/render/primitives/text.d.ts.map +1 -0
- package/dist/render/primitives/text.js +27 -0
- package/dist/render/primitives/text.js.map +1 -0
- package/dist/render/scope.d.ts +10 -0
- package/dist/render/scope.d.ts.map +1 -0
- package/dist/render/scope.js +27 -0
- package/dist/render/scope.js.map +1 -0
- package/dist/render/stagger-context.d.ts +9 -0
- package/dist/render/stagger-context.d.ts.map +1 -0
- package/dist/render/stagger-context.js +22 -0
- package/dist/render/stagger-context.js.map +1 -0
- package/dist/render/tree.d.ts +9 -0
- package/dist/render/tree.d.ts.map +1 -0
- package/dist/render/tree.js +139 -0
- package/dist/render/tree.js.map +1 -0
- package/dist/render/universal-wrapper.d.ts +16 -0
- package/dist/render/universal-wrapper.d.ts.map +1 -0
- package/dist/render/universal-wrapper.js +58 -0
- package/dist/render/universal-wrapper.js.map +1 -0
- package/dist/state/apply-delta.d.ts +11 -0
- package/dist/state/apply-delta.d.ts.map +1 -0
- package/dist/state/apply-delta.js +23 -0
- package/dist/state/apply-delta.js.map +1 -0
- package/dist/state/apply-snapshot.d.ts +6 -0
- package/dist/state/apply-snapshot.d.ts.map +1 -0
- package/dist/state/apply-snapshot.js +6 -0
- package/dist/state/apply-snapshot.js.map +1 -0
- package/dist/state/store.d.ts +28 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +119 -0
- package/dist/state/store.js.map +1 -0
- package/dist/status-pill-DCHvrd_y.js +241 -0
- package/dist/status-pill-DCHvrd_y.js.map +1 -0
- package/dist/test-DBCtwx_I.js +210 -0
- package/dist/test-DBCtwx_I.js.map +1 -0
- package/dist/transport/reconnect.d.ts +22 -0
- package/dist/transport/reconnect.d.ts.map +1 -0
- package/dist/transport/reconnect.js +60 -0
- package/dist/transport/reconnect.js.map +1 -0
- package/dist/transport/ws.d.ts +66 -0
- package/dist/transport/ws.d.ts.map +1 -0
- package/dist/transport/ws.js +270 -0
- package/dist/transport/ws.js.map +1 -0
- package/dist/tree-CnhX02kd.js +494 -0
- package/dist/tree-CnhX02kd.js.map +1 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -0
- package/src/animate/crossfade.tsx +31 -0
- package/src/animate/keyframes.ts +142 -0
- package/src/animate/transitions.ts +116 -0
- package/src/app.tsx +84 -0
- package/src/dev-entry.tsx +38 -0
- package/src/index.ts +24 -0
- package/src/internal/validate-options.ts +20 -0
- package/src/modes/broadcast.tsx +8 -0
- package/src/modes/control.tsx +17 -0
- package/src/modes/test.tsx +19 -0
- package/src/mount.ts +169 -0
- package/src/overlay/control.tsx +239 -0
- package/src/overlay/runtime-context.tsx +37 -0
- package/src/overlay/status-pill.tsx +37 -0
- package/src/overlay/test.tsx +213 -0
- package/src/render/bundle.ts +208 -0
- package/src/render/fill.tsx +163 -0
- package/src/render/keyframe-player.tsx +89 -0
- package/src/render/primitives/frame.tsx +78 -0
- package/src/render/primitives/grid.tsx +20 -0
- package/src/render/primitives/image.tsx +35 -0
- package/src/render/primitives/index.ts +35 -0
- package/src/render/primitives/instance.tsx +70 -0
- package/src/render/primitives/media.tsx +28 -0
- package/src/render/primitives/shape.tsx +135 -0
- package/src/render/primitives/stack.tsx +48 -0
- package/src/render/primitives/text.tsx +38 -0
- package/src/render/scope.tsx +27 -0
- package/src/render/stagger-context.tsx +24 -0
- package/src/render/tree.tsx +182 -0
- package/src/render/universal-wrapper.tsx +95 -0
- package/src/state/apply-delta.ts +24 -0
- package/src/state/apply-snapshot.ts +8 -0
- package/src/state/store.ts +141 -0
- package/src/transport/reconnect.ts +83 -0
- package/src/transport/ws.ts +359 -0
- package/src/types.ts +54 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export type TransitionKind = "none" | "tween" | "spring" | "crossfade";
|
|
2
|
+
export interface TweenTransition {
|
|
3
|
+
kind: "tween";
|
|
4
|
+
duration_ms: number;
|
|
5
|
+
ease?: "linear" | "cubic-in" | "cubic-out" | "cubic-in-out";
|
|
6
|
+
}
|
|
7
|
+
export interface SpringTransition {
|
|
8
|
+
kind: "spring";
|
|
9
|
+
stiffness?: number;
|
|
10
|
+
damping?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CrossfadeTransition {
|
|
13
|
+
kind: "crossfade";
|
|
14
|
+
duration_ms?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface NoTransition {
|
|
17
|
+
kind: "none";
|
|
18
|
+
}
|
|
19
|
+
export type Transition = NoTransition | TweenTransition | SpringTransition | CrossfadeTransition;
|
|
20
|
+
export type FramerEasing = "linear" | "easeIn" | "easeOut" | "easeInOut";
|
|
21
|
+
export interface FramerTransition {
|
|
22
|
+
duration?: number;
|
|
23
|
+
ease?: FramerEasing;
|
|
24
|
+
type?: "tween" | "spring";
|
|
25
|
+
stiffness?: number;
|
|
26
|
+
damping?: number;
|
|
27
|
+
}
|
|
28
|
+
export declare function toFramer(t: Transition | undefined): FramerTransition;
|
|
29
|
+
/**
|
|
30
|
+
* Parse a wire-format `TransitionSpec` (LSDP/1.1 §3.2.2) into the
|
|
31
|
+
* runtime's local Transition type. Returns `undefined` for malformed
|
|
32
|
+
* input so the caller falls back to whatever bundle-level default
|
|
33
|
+
* applies. The wire shape uses kebab-case `easing` values
|
|
34
|
+
* (`linear`, `ease-in`, `ease-out`, `ease-in-out`) which we map to
|
|
35
|
+
* the runtime's `cubic-*` vocabulary.
|
|
36
|
+
*/
|
|
37
|
+
export declare function parseWireTransition(value: unknown): Transition | undefined;
|
|
38
|
+
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../src/animate/transitions.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;CAC7D;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,eAAe,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAEjG,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAWD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,gBAAgB,CAsBpE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAmB1E"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
// Local Transition type + Framer Motion translation.
|
|
2
|
+
//
|
|
3
|
+
// LSML 1.0 §6 declares `animate` directives at the primitive level (transition,
|
|
4
|
+
// transform, opacity, filter). LSDP/1.1 §3.2.2 added per-leaf transition
|
|
5
|
+
// directives on delta patches — incoming deltas can carry a transition hint
|
|
6
|
+
// that overrides the bundle-level default for the next animation cycle.
|
|
7
|
+
// `parseWireTransition` ingests the wire shape ; `Store.lastTransition(path)`
|
|
8
|
+
// surfaces the most-recent directive to the renderer.
|
|
9
|
+
//
|
|
10
|
+
// We deliberately animate only GPU-friendly properties (transform, opacity,
|
|
11
|
+
// filter). Primitives enforce this at the DOM level by exposing those props as
|
|
12
|
+
// motion-bindable values rather than raw CSS.
|
|
13
|
+
const NO_ANIMATION = { duration: 0 };
|
|
14
|
+
const EASE_MAP = {
|
|
15
|
+
linear: "linear",
|
|
16
|
+
"cubic-in": "easeIn",
|
|
17
|
+
"cubic-out": "easeOut",
|
|
18
|
+
"cubic-in-out": "easeInOut",
|
|
19
|
+
};
|
|
20
|
+
export function toFramer(t) {
|
|
21
|
+
if (!t || t.kind === "none")
|
|
22
|
+
return NO_ANIMATION;
|
|
23
|
+
if (t.kind === "tween") {
|
|
24
|
+
return {
|
|
25
|
+
type: "tween",
|
|
26
|
+
duration: (t.duration_ms ?? 0) / 1000,
|
|
27
|
+
ease: t.ease ? (EASE_MAP[t.ease] ?? "easeOut") : "easeOut",
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (t.kind === "spring") {
|
|
31
|
+
return {
|
|
32
|
+
type: "spring",
|
|
33
|
+
...(t.stiffness !== undefined ? { stiffness: t.stiffness } : {}),
|
|
34
|
+
...(t.damping !== undefined ? { damping: t.damping } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
// crossfade at the per-prop level degenerates into a tween on opacity.
|
|
38
|
+
return {
|
|
39
|
+
type: "tween",
|
|
40
|
+
duration: (t.duration_ms ?? 400) / 1000,
|
|
41
|
+
ease: "easeInOut",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse a wire-format `TransitionSpec` (LSDP/1.1 §3.2.2) into the
|
|
46
|
+
* runtime's local Transition type. Returns `undefined` for malformed
|
|
47
|
+
* input so the caller falls back to whatever bundle-level default
|
|
48
|
+
* applies. The wire shape uses kebab-case `easing` values
|
|
49
|
+
* (`linear`, `ease-in`, `ease-out`, `ease-in-out`) which we map to
|
|
50
|
+
* the runtime's `cubic-*` vocabulary.
|
|
51
|
+
*/
|
|
52
|
+
export function parseWireTransition(value) {
|
|
53
|
+
if (typeof value !== "object" || value === null)
|
|
54
|
+
return undefined;
|
|
55
|
+
const v = value;
|
|
56
|
+
const kind = v.kind;
|
|
57
|
+
if (kind === "snap") {
|
|
58
|
+
return { kind: "none" };
|
|
59
|
+
}
|
|
60
|
+
if (kind === "tween") {
|
|
61
|
+
const duration_ms = typeof v.duration_ms === "number" ? v.duration_ms : 0;
|
|
62
|
+
const easing = WIRE_EASING_MAP[v.easing] ?? "cubic-out";
|
|
63
|
+
return { kind: "tween", duration_ms, ease: easing };
|
|
64
|
+
}
|
|
65
|
+
if (kind === "spring") {
|
|
66
|
+
const out = { kind: "spring" };
|
|
67
|
+
if (typeof v.stiffness === "number")
|
|
68
|
+
out.stiffness = v.stiffness;
|
|
69
|
+
if (typeof v.damping === "number")
|
|
70
|
+
out.damping = v.damping;
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const WIRE_EASING_MAP = {
|
|
76
|
+
linear: "linear",
|
|
77
|
+
"ease-in": "cubic-in",
|
|
78
|
+
"ease-out": "cubic-out",
|
|
79
|
+
"ease-in-out": "cubic-in-out",
|
|
80
|
+
};
|
|
81
|
+
//# sourceMappingURL=transitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../src/animate/transitions.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,EAAE;AACF,gFAAgF;AAChF,yEAAyE;AACzE,4EAA4E;AAC5E,wEAAwE;AACxE,8EAA8E;AAC9E,sDAAsD;AACtD,EAAE;AACF,4EAA4E;AAC5E,+EAA+E;AAC/E,8CAA8C;AAqC9C,MAAM,YAAY,GAAqB,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAEvD,MAAM,QAAQ,GAAiC;IAC7C,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,QAAQ;IACpB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,WAAW;CAC5B,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,CAAyB;IAChD,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,YAAY,CAAC;IACjD,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO;YACL,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,GAAG,IAAI;YACrC,IAAI,EAAE,CAAC,CAAC,IAAI,C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AC,MAAgB,CAAC,IAAI,WAAW,CAAC;QAClE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACtD,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,MAAM,GAAG,GAAqB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QACjD,IAAI,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ;YAAE,GAAG,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;QACjE,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ;YAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;QAC3D,OAAO,GAAG,CAAC;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,eAAe,GAAyE;IAC5F,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,UAAU;IACrB,UAAU,EAAE,WAAW;IACvB,aAAa,EAAE,cAAc;CAC9B,CAAC"}
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Signal } from "@preact/signals-react";
|
|
2
|
+
import type { Patch } from "@lumencast/protocol";
|
|
3
|
+
import type { Store } from "./state/store.js";
|
|
4
|
+
import type { RenderBundle } from "./render/bundle.js";
|
|
5
|
+
import type { ConnectionStatus } from "./transport/ws.js";
|
|
6
|
+
import type { LumencastMode } from "./types.js";
|
|
7
|
+
export interface LumencastAppProps {
|
|
8
|
+
mode: LumencastMode;
|
|
9
|
+
store: Store;
|
|
10
|
+
bundleSignal: Signal<RenderBundle | null>;
|
|
11
|
+
statusSignal: Signal<ConnectionStatus>;
|
|
12
|
+
crossfadeKeySignal: Signal<string>;
|
|
13
|
+
sendInput: (patches: Patch[]) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function LumencastApp({ mode, store, bundleSignal, statusSignal, crossfadeKeySignal, sendInput, }: LumencastAppProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAUhD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,EAAE,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC1C,YAAY,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACvC,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,SAAS,GACV,EAAE,iBAAiB,kDAqCnB"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Top-level React component for a mounted Lumencast instance. Reads the runtime
|
|
3
|
+
// signals (bundle / status) and dispatches to the right mode.
|
|
4
|
+
//
|
|
5
|
+
// Per-mode code splitting: BroadcastMode / ControlMode / TestMode live in
|
|
6
|
+
// separate chunks loaded only when the corresponding mode is requested. A
|
|
7
|
+
// broadcast mount never downloads the overlay or test code — the broadcast
|
|
8
|
+
// chunk is the bare minimum a CEF host needs to render the scene.
|
|
9
|
+
//
|
|
10
|
+
// Crossfade: AnimatePresence freezes the props of an exiting child so its render
|
|
11
|
+
// tree keeps using the values it held at the moment it started exiting.
|
|
12
|
+
import { useSignals } from "@preact/signals-react/runtime";
|
|
13
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
14
|
+
import { lazy, Suspense } from "react";
|
|
15
|
+
import { LumencastRuntimeProvider } from "./overlay/runtime-context.js";
|
|
16
|
+
const LazyBroadcastMode = lazy(() => import("./modes/broadcast.js").then((m) => ({ default: m.BroadcastMode })));
|
|
17
|
+
const LazyControlMode = lazy(() => import("./modes/control.js").then((m) => ({ default: m.ControlMode })));
|
|
18
|
+
const LazyTestMode = lazy(() => import("./modes/test.js").then((m) => ({ default: m.TestMode })));
|
|
19
|
+
export function LumencastApp({ mode, store, bundleSignal, statusSignal, crossfadeKeySignal, sendInput, }) {
|
|
20
|
+
useSignals();
|
|
21
|
+
const bundle = bundleSignal.value;
|
|
22
|
+
const status = statusSignal.value;
|
|
23
|
+
const trackKey = crossfadeKeySignal.value;
|
|
24
|
+
if (!bundle)
|
|
25
|
+
return null;
|
|
26
|
+
const ModeComponent = mode === "broadcast" ? LazyBroadcastMode : mode === "control" ? LazyControlMode : LazyTestMode;
|
|
27
|
+
return (_jsx(AnimatePresence, { mode: "sync", children: _jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.4, ease: "easeInOut" }, style: { position: "absolute", inset: 0 }, children: _jsx(LumencastRuntimeProvider, { value: {
|
|
28
|
+
mode,
|
|
29
|
+
store,
|
|
30
|
+
bundle,
|
|
31
|
+
status,
|
|
32
|
+
sendInput,
|
|
33
|
+
}, children: _jsx(Suspense, { fallback: null, children: _jsx(ModeComponent, {}) }) }) }, trackKey) }));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=app.js.map
|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M,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC;IAClC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC;IAC1C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,aAAa,GACjB,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC;IAEjG,OAAO,CACL,KAAC,eAAe,IAAC,IAAI,EAAC,MAAM,YAC1B,KAAC,MAAM,CAAC,GAAG,IAET,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EACvB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EACvB,IAAI,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EACpB,UAAU,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,EAChD,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,YAEzC,KAAC,wBAAwB,IACvB,KAAK,EAAE;oBACL,IAAI;oBACJ,KAAK;oBACL,MAAM;oBACN,MAAM;oBACN,SAAS;iBACV,YAED,KAAC,QAAQ,IAAC,QAAQ,EAAE,IAAI,YACtB,KAAC,aAAa,KAAG,GACR,GACc,IAnBtB,QAAQ,CAoBF,GACG,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { T as e } from "./tree-CnhX02kd.js";
|
|
3
|
+
import { u as m } from "./index-DUhPPRvw.js";
|
|
4
|
+
function a() {
|
|
5
|
+
const { store: o, bundle: r } = m();
|
|
6
|
+
return /* @__PURE__ */ t(e, { node: r.root, store: o });
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
a as BroadcastMode
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=broadcast-BqOhSNsY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast-BqOhSNsY.js","sources":["../src/modes/broadcast.tsx"],"sourcesContent":["import { Tree } from \"../render/tree\";\nimport { useLumencastRuntime } from \"../overlay/runtime-context\";\n\n/** Broadcast mode : pure scene render, no UI chrome. */\nexport function BroadcastMode() {\n const { store, bundle } = useLumencastRuntime();\n return <Tree node={bundle.root} store={store} />;\n}\n"],"names":["BroadcastMode","store","bundle","useLumencastRuntime","jsx","Tree"],"mappings":";;;AAIO,SAASA,IAAgB;AAC9B,QAAM,EAAE,OAAAC,GAAO,QAAAC,EAAA,IAAWC,EAAA;AAC1B,SAAO,gBAAAC,EAACC,GAAA,EAAK,MAAMH,EAAO,MAAM,OAAAD,GAAc;AAChD;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs as e, Fragment as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { T as s } from "./tree-CnhX02kd.js";
|
|
3
|
+
import { S as m, C as a } from "./status-pill-DCHvrd_y.js";
|
|
4
|
+
import { u as i } from "./index-DUhPPRvw.js";
|
|
5
|
+
function c() {
|
|
6
|
+
const { store: r, bundle: t } = i();
|
|
7
|
+
return /* @__PURE__ */ e(n, { children: [
|
|
8
|
+
/* @__PURE__ */ o(s, { node: t.root, store: r }),
|
|
9
|
+
/* @__PURE__ */ o(m, {}),
|
|
10
|
+
/* @__PURE__ */ o(a, {})
|
|
11
|
+
] });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
c as ControlMode
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=control-CRFn328D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-CRFn328D.js","sources":["../src/modes/control.tsx"],"sourcesContent":["import { Tree } from \"../render/tree\";\nimport { ControlPanel } from \"../overlay/control\";\nimport { StatusPill } from \"../overlay/status-pill\";\nimport { useLumencastRuntime } from \"../overlay/runtime-context\";\n\n/** Control mode : scene + operator overlay (status pill + fields\n * panel from operator_inputs). */\nexport function ControlMode() {\n const { store, bundle } = useLumencastRuntime();\n return (\n <>\n <Tree node={bundle.root} store={store} />\n <StatusPill />\n <ControlPanel />\n </>\n );\n}\n"],"names":["ControlMode","store","bundle","useLumencastRuntime","jsxs","Fragment","jsx","Tree","StatusPill","ControlPanel"],"mappings":";;;;AAOO,SAASA,IAAc;AAC5B,QAAM,EAAE,OAAAC,GAAO,QAAAC,EAAA,IAAWC,EAAA;AAC1B,SACE,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAK,MAAML,EAAO,MAAM,OAAAD,GAAc;AAAA,sBACtCO,GAAA,EAAW;AAAA,sBACXC,GAAA,CAAA,CAAa;AAAA,EAAA,GAChB;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-entry.d.ts","sourceRoot":"","sources":["../src/dev-entry.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Dev entry point — only used during `vite dev` and Playwright E2E tests.
|
|
2
|
+
// Reads URL query params, calls mount(). Mirrors the production
|
|
3
|
+
// build-host-html.mjs behavior so tests exercise a real bootstrap.
|
|
4
|
+
import { mount } from "./index.js";
|
|
5
|
+
const params = new URLSearchParams(window.location.search);
|
|
6
|
+
const serverUrl = params.get("server") ?? `ws://${location.host}/lsdp/v1`;
|
|
7
|
+
const token = params.get("token") ?? "any";
|
|
8
|
+
const modeParam = params.get("mode") ?? "broadcast";
|
|
9
|
+
const mode = ["broadcast", "control", "test"].includes(modeParam)
|
|
10
|
+
? modeParam
|
|
11
|
+
: "broadcast";
|
|
12
|
+
const scene = params.get("scene") ?? undefined;
|
|
13
|
+
const testSession = params.get("session") ?? undefined;
|
|
14
|
+
const target = document.getElementById("scene");
|
|
15
|
+
if (!(target instanceof HTMLElement)) {
|
|
16
|
+
document.body.textContent = "lumencast dev: #scene target missing";
|
|
17
|
+
throw new Error("dev-entry: #scene missing");
|
|
18
|
+
}
|
|
19
|
+
const handle = mount({
|
|
20
|
+
target,
|
|
21
|
+
serverUrl,
|
|
22
|
+
token,
|
|
23
|
+
mode,
|
|
24
|
+
...(mode === "test" && scene ? { scene } : {}),
|
|
25
|
+
...(mode === "test" && testSession ? { testSession } : {}),
|
|
26
|
+
onError: (err) => console.error("[lumencast]", err),
|
|
27
|
+
onStatus: (status) => target.setAttribute("data-status", status),
|
|
28
|
+
});
|
|
29
|
+
// Expose the handle to Playwright tests for setToken/disconnect drills.
|
|
30
|
+
window.__lumencast = handle;
|
|
31
|
+
//# sourceMappingURL=dev-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-entry.js","sourceRoot":"","sources":["../src/dev-entry.tsx"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,gEAAgE;AAChE,mEAAmE;AAEnE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC3D,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,QAAQ,QAAQ,CAAC,IAAI,UAAU,CAAC;AAC1E,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;AAC3C,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC;AACpD,MAAM,IAAI,GAAmB,CAAC,WAAW,EAAE,SAAS,EAAE,MAAM,CAAW,CAAC,QAAQ,CAC9E,SAA0B,CAC3B;IACC,CAAC,CAAE,SAA2B;IAC9B,CAAC,CAAC,WAAW,CAAC;AAChB,MAAM,KAAK,GAAG,MAAM,C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