@moku-labs/game 0.15.0 → 0.15.2
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/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +2 -2
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/cli.mjs +75 -36
- package/dist/{commands-DAETmK86.d.mts → commands-C_GccOFq.d.mts} +7 -6
- package/dist/control.d.mts +30 -18
- package/dist/control.mjs +2 -2
- package/dist/{define-BASd9ZUh.d.mts → define-DnO7ZLGl.d.mts} +2 -2
- package/dist/{dev-DbHgx-R-.mjs → dev-BNndV-hU.mjs} +4 -4
- package/dist/{headless-cFveciuY.d.mts → headless-D6BrEwCf.d.mts} +1 -1
- package/dist/{index-DedbED3T.d.mts → index-w2uyRKkj.d.mts} +16 -4
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +6 -6
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/project.d.mts +4 -4
- package/dist/project.mjs +1 -1
- package/dist/{run-BbipFRc6.mjs → run-C07NXds7.mjs} +35 -25
- package/dist/{runtime-DoSlRx8X.d.mts → runtime-kOH8InAs.d.mts} +1 -1
- package/dist/{sources-Cdvb0rOS.mjs → sources-OvHvyeJS.mjs} +1 -1
- package/dist/{src-BEbJ_sSx.mjs → src-Ca8W8Dvv.mjs} +5331 -1719
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-BGcda5Le.d.mts → types-BHgJ1F6f.d.mts} +940 -86
- package/dist/{types-7GXcXxxv.d.mts → types-Bm7DVtA_.d.mts} +36 -10
- package/dist/{types-C73hbmxi.d.mts → types-DEYQF_tT.d.mts} +4 -4
- package/dist/{types-GHE4J5Uf.d.mts → types-fpFKYm6E.d.mts} +142 -43
- package/dist/{types-DngFQJro.d.mts → types-jiWJhLPE.d.mts} +2 -2
- package/dist/{visual-_XhoGeIC.d.mts → visual-BvkKJOSz.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +2 -2
- package/dist/{watch-BEdrp80i.mjs → watch-BSgptowj.mjs} +16 -6
- package/llms.txt +6 -4
- package/package.json +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as MotionCause, En as ProjectionMotion, Hr as Api, Jt as TransformValue, Mn as Api$1, Mt as ViewportSize, Qr as Require, Sn as Motion, Sr as Json, T as Api$3, Tn as NumericFields, Zt as Api$2, fr as Answer, in as AnyComponentValue, jn as ViewHandle, ln as Entity, nn as AnyComponent, or as Descriptor, pr as Api$5, rn as AnyComponentType, s as Events$1, sn as ComponentType, t as Api$4, ur as Hint, vn as TagType, wn as MotionHandle, yn as ChangeHook } from "./types-BHgJ1F6f.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
|
|
@@ -1211,6 +1211,25 @@ type InputApi = {
|
|
|
1211
1211
|
* ```
|
|
1212
1212
|
*/
|
|
1213
1213
|
cursor(): string;
|
|
1214
|
+
/**
|
|
1215
|
+
* How many listeners and controls are registered now: every `onTap`, `onPointer` and `onKey`
|
|
1216
|
+
* listener and every `controls.add` registration whose remover has not run. The pointer and key
|
|
1217
|
+
* listeners input itself opens on the canvas are not counted. A screen entered and left returns
|
|
1218
|
+
* the count to where it was; a count that grows with every visit is a listener left behind. It
|
|
1219
|
+
* reads four lengths and allocates nothing, so a monitor may call it every second.
|
|
1220
|
+
*
|
|
1221
|
+
* @returns The number of registered listeners and controls.
|
|
1222
|
+
* @example
|
|
1223
|
+
* ```ts
|
|
1224
|
+
* // A test checks that a popup takes its Escape listener back when it closes.
|
|
1225
|
+
* const before = app.input.listeners();
|
|
1226
|
+
* const off = app.input.onKey(key => key.key === "Escape");
|
|
1227
|
+
* app.input.listeners() - before; // 1
|
|
1228
|
+
* off();
|
|
1229
|
+
* app.input.listeners() - before; // 0
|
|
1230
|
+
* ```
|
|
1231
|
+
*/
|
|
1232
|
+
listeners(): number;
|
|
1214
1233
|
/**
|
|
1215
1234
|
* The components that make a view a control besides input's own: the cursor shows
|
|
1216
1235
|
* `config.cursor.control` over a view that carries one of them.
|
|
@@ -1611,11 +1630,6 @@ type DrawnLabel = {
|
|
|
1611
1630
|
/**
|
|
1612
1631
|
* A dev warning that is written once per key. Pure modules take it as an argument, so nothing
|
|
1613
1632
|
* below the plugin context reaches the log itself.
|
|
1614
|
-
*
|
|
1615
|
-
* @example
|
|
1616
|
-
* ```ts
|
|
1617
|
-
* const warn: Warn = (key, message) => seen.has(key) || log.warn(message);
|
|
1618
|
-
* ```
|
|
1619
1633
|
*/
|
|
1620
1634
|
type Warn = (key: string, message: string, data?: Record<string, unknown>) => void;
|
|
1621
1635
|
/**
|
|
@@ -1632,18 +1646,21 @@ type LayoutOptions = {
|
|
|
1632
1646
|
/**
|
|
1633
1647
|
* What was resolved for one entity last, so the frame step knows whether anything moved. `unit`
|
|
1634
1648
|
* is what the shown string of a bound label was built from: the rounded value for `"int"`, whole
|
|
1635
|
-
* seconds for a time format.
|
|
1649
|
+
* seconds for a time format. `bindRef` is the bind object `bind` was keyed from, so the key is
|
|
1650
|
+
* built once per attached bind and a frame compares one reference.
|
|
1636
1651
|
*
|
|
1637
1652
|
* @example
|
|
1638
1653
|
* ```ts
|
|
1654
|
+
* const left = bind(Countdown, "left", { format: "mm:ss" });
|
|
1639
1655
|
* const seen: SeenText = {
|
|
1640
|
-
* content: "", style: "digits", bind: "Countdown.left:mm:ss", locale: "ru", unit: 95
|
|
1656
|
+
* content: "", style: "digits", bindRef: left, bind: "Countdown.left:mm:ss", locale: "ru", unit: 95
|
|
1641
1657
|
* };
|
|
1642
1658
|
* ```
|
|
1643
1659
|
*/
|
|
1644
1660
|
type SeenText = {
|
|
1645
1661
|
content: unknown;
|
|
1646
1662
|
style: string;
|
|
1663
|
+
bindRef: TextBind | undefined;
|
|
1647
1664
|
bind: string | undefined;
|
|
1648
1665
|
locale: string;
|
|
1649
1666
|
unit: number | undefined;
|
|
@@ -2464,6 +2481,8 @@ type PopupLink = {
|
|
|
2464
2481
|
* popup (its open is an event), the cause of its projection view otherwise, `"mount"` after a
|
|
2465
2482
|
* restore or a load. `slot` is the host element the root is laid out in (`undefined` for the
|
|
2466
2483
|
* viewport), `slotRect` the content box it was last solved in, in the host's own units.
|
|
2484
|
+
* `pending` is true while the solve running now still waits to lay the root out; `mountRoot`
|
|
2485
|
+
* creates it `false`.
|
|
2467
2486
|
*/
|
|
2468
2487
|
type Root = {
|
|
2469
2488
|
entity: Entity;
|
|
@@ -2484,6 +2503,7 @@ type Root = {
|
|
|
2484
2503
|
w: number;
|
|
2485
2504
|
h: number;
|
|
2486
2505
|
} | undefined;
|
|
2506
|
+
pending?: boolean;
|
|
2487
2507
|
};
|
|
2488
2508
|
/**
|
|
2489
2509
|
* Where the focus ring was last drawn: the layer and order of its root, the rect grown by the
|
|
@@ -2613,7 +2633,10 @@ type TextState = {
|
|
|
2613
2633
|
* the element that hosts it; `fields` holds the text fields by entity. `hints` buffers the hints
|
|
2614
2634
|
* released since the last frame step; `scrolls` holds the scroll containers; `windowRenders`
|
|
2615
2635
|
* counts the re-renders of a windowed list its range made. `styled` and `written` count the style
|
|
2616
|
-
* passes and the write passes of the reconcile, for `UiCounters`.
|
|
2636
|
+
* passes and the write passes of the reconcile, for `UiCounters`. `hostsVersion` moves on when a
|
|
2637
|
+
* host came, went, became live or was patched, and when a view lost its `Parent` or its `Held`;
|
|
2638
|
+
* `hostsSeen` and `membershipSeen` are that version and the world's membership version at the
|
|
2639
|
+
* last full hosting step, which runs again only when one of them moved.
|
|
2617
2640
|
*/
|
|
2618
2641
|
type JsxState = {
|
|
2619
2642
|
components: Map<string, AnyComponentDefinition>;
|
|
@@ -2625,7 +2648,10 @@ type JsxState = {
|
|
|
2625
2648
|
exiting: Set<Entity>;
|
|
2626
2649
|
removing: Set<Entity>;
|
|
2627
2650
|
hosts: Set<Entity>;
|
|
2628
|
-
hosted: Map<Entity, Entity>;
|
|
2651
|
+
hosted: Map<Entity, Entity>;
|
|
2652
|
+
hostsVersion: number;
|
|
2653
|
+
hostsSeen: number;
|
|
2654
|
+
membershipSeen: number; /** The host elements that became live in this solve: the solve hosts their views in the same frame (spec 16 U2). */
|
|
2629
2655
|
risen: Set<Entity>; /** The views the full hosting step of this frame took back from their host; their removal lands at the flush. */
|
|
2630
2656
|
released: Set<Entity>; /** The cause the elements entered by the diff running now take: the root's for its first build, else `"change"`. */
|
|
2631
2657
|
building: MotionCause | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as Config$2,
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { H as TextKey, I as I18nApi, V as StringTable } from "./types-
|
|
4
|
-
import {
|
|
1
|
+
import { At as Orientation, Dr as PlayerStateProvider, E as Config$2, Jn as FeaturePlugin, Mr as SnapshotOf, Or as ProviderCall, Pn as Config$1, Sr as Json, Xn as AnyFlow, a as Config$3, ar as TypeTag, br as Config, d as Manifest, gr as FakeClock, k as PixiModule, kr as SaveDoc, mr as ClockSource, n as AssetsIo } from "./types-BHgJ1F6f.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-fpFKYm6E.mjs";
|
|
3
|
+
import { H as TextKey, I as I18nApi, V as StringTable } from "./types-Bm7DVtA_.mjs";
|
|
4
|
+
import { Ct as audioPlugin, bt as effectsPlugin, dt as platformPlugin, i as screen, pt as PlatformProvider, t as createApp } from "./index-w2uyRKkj.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as PixiSprite,
|
|
2
|
-
import { I as I18nApi, J as StylesState, S as TextApi, c as UiNode, i as Finding, j as InputApi, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-
|
|
1
|
+
import { A as PixiSprite, An as TrackSegment, Hr as Api$1, Mn as Api$2, Nt as FilterCache, O as PixiFilter, On as ReducedMotion, Ot as FilterSlot, Qr as Require, Rr as Events$5, Sr as Json, T as Api$4, Tn as NumericFields, Zr as Events$2, Zt as Api$3, an as ComponentHandle, ar as TypeTag, in as AnyComponentValue, j as PixiTexture, jt as Point, k as PixiModule, kn as TrackOptions, kt as FilterSlotInputs, ln as Entity, nn as AnyComponent, or as Descriptor, s as Events$1, sn as ComponentType, t as Api$5, v as Events$4, wn as MotionHandle, xn as Ease, xr as Events$3, yr as Api$6 } from "./types-BHgJ1F6f.mjs";
|
|
2
|
+
import { I as I18nApi, J as StylesState, S as TextApi, c as UiNode, i as Finding, j as InputApi, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-Bm7DVtA_.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -91,22 +91,15 @@ type Api = {
|
|
|
91
91
|
* One running track: the numeric fields of one component of one entity moving from the values
|
|
92
92
|
* read at the end of the delay to the exact target, straight or through keyframe segments. A
|
|
93
93
|
* track with repeats walks again from its first segment each time a run ends.
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```ts
|
|
97
|
-
* const track: Track = {
|
|
98
|
-
* id: 1, entity: 1_048_576, component: Transform, to: { x: 200 },
|
|
99
|
-
* keys: { x: "1048576:Transform:x" }, ms: 350, ease: "out", delayMs: 0, elapsed: 0,
|
|
100
|
-
* from: undefined, muted: () => new Set(), additive: false, driven: false, bornFrame: 4,
|
|
101
|
-
* ended: false, segments: undefined, repeatsLeft: 0, held: false, masked: new Set(), keep: false,
|
|
102
|
-
* reveals: "place"
|
|
103
|
-
* };
|
|
104
|
-
* ```
|
|
105
94
|
*/
|
|
106
95
|
type Track = {
|
|
107
96
|
readonly id: number;
|
|
108
97
|
readonly entity: Entity;
|
|
109
|
-
readonly component: AnyComponent;
|
|
98
|
+
readonly component: AnyComponent;
|
|
99
|
+
/**
|
|
100
|
+
* The target fields. Retarget deletes the fields a newer absolute track took over. A frame reads
|
|
101
|
+
* the slots (`names`, `targets`, `live`) instead.
|
|
102
|
+
*/
|
|
110
103
|
to: Record<string, number>;
|
|
111
104
|
/**
|
|
112
105
|
* The key of the owner, bases and offsets tables per field, built once when the track starts.
|
|
@@ -116,8 +109,30 @@ type Track = {
|
|
|
116
109
|
readonly ms: number;
|
|
117
110
|
readonly ease: Ease;
|
|
118
111
|
readonly delayMs: number;
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
/**
|
|
113
|
+
* `[0]`: the milliseconds the track has run, its delay included; `[1]`: the normalised time of
|
|
114
|
+
* the write that runs. Cells and not fields, so a frame writes them in place: a double stored in
|
|
115
|
+
* an object field is a new heap number.
|
|
116
|
+
*/
|
|
117
|
+
readonly clock: Float64Array; /** True once the start values are read, when the delay ends, never earlier. */
|
|
118
|
+
begun: boolean; /** The target fields in slot order: every field `to` held when the track started. */
|
|
119
|
+
readonly names: readonly string[]; /** The key of each slot: the strings of `keys`, by slot. */
|
|
120
|
+
readonly slotKeys: readonly string[]; /** The target of each slot. */
|
|
121
|
+
readonly targets: Float64Array; /** The start value of each slot, read when the delay ends. */
|
|
122
|
+
readonly starts: Float64Array; /** `1` while the track drives the slot, `0` once a newer absolute track took its field. */
|
|
123
|
+
readonly live: Uint8Array; /** `1` for a slot the frame that runs moved: a write of only some fields reads it. */
|
|
124
|
+
readonly moved: Uint8Array;
|
|
125
|
+
/**
|
|
126
|
+
* Per slot, the numbers of the write that runs: first what the slot contributes, then what the
|
|
127
|
+
* field reads, the base plus every offset. Kept here so no number crosses a call boxed.
|
|
128
|
+
*/
|
|
129
|
+
readonly values: Float64Array;
|
|
130
|
+
/**
|
|
131
|
+
* Per slot, the value this track last left in the field or found there, `NaN` while unknown: at
|
|
132
|
+
* the start and while another writer holds the field. A frame whose value moved off it writes
|
|
133
|
+
* without reading the field back.
|
|
134
|
+
*/
|
|
135
|
+
readonly seen: Float64Array;
|
|
121
136
|
readonly muted: () => ReadonlySet<string>;
|
|
122
137
|
readonly additive: boolean; /** True for a track a timeline step advances by hand; the frame step leaves it alone. */
|
|
123
138
|
readonly driven: boolean; /** The frame step the track was born in. That step does not advance it a second time. */
|
|
@@ -151,16 +166,16 @@ type Track = {
|
|
|
151
166
|
* that cannot (a tint, a fill colour). Computed once when the track is made.
|
|
152
167
|
*/
|
|
153
168
|
readonly reveals: "alpha" | "place" | "both" | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* The patch the track writes, one per track with every field of `to` in it: a frame fills it in
|
|
171
|
+
* place instead of building one. A field the frame leaves alone carries its stored value back.
|
|
172
|
+
* Rebuilt when the track loses a field.
|
|
173
|
+
*/
|
|
174
|
+
patch: Record<string, unknown>;
|
|
154
175
|
};
|
|
155
176
|
/**
|
|
156
177
|
* A motion handle that can also be advanced by hand: what the timeline cursor needs, so a track
|
|
157
178
|
* born inside a frame step still consumes the remainder of that step's delta.
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* const motion: StepMotion = { ...inert, advance: () => 0 };
|
|
162
|
-
* motion.advance(16); // 0: nothing is left over
|
|
163
|
-
* ```
|
|
164
179
|
*/
|
|
165
180
|
type StepMotion = MotionHandle & {
|
|
166
181
|
/**
|
|
@@ -624,8 +639,12 @@ type ExternalPlayer = {
|
|
|
624
639
|
type Cursor = {
|
|
625
640
|
readonly step: Step;
|
|
626
641
|
readonly children: readonly Cursor[]; /** Position in a `sequence`, and the last written key of a `frames` step. */
|
|
627
|
-
index: number;
|
|
628
|
-
|
|
642
|
+
index: number;
|
|
643
|
+
/**
|
|
644
|
+
* `[0]`: the consumed milliseconds of a `wait` or a `frames` step. A cell and not a field, so a
|
|
645
|
+
* frame writes it in place: a double stored in an object field is a new heap number.
|
|
646
|
+
*/
|
|
647
|
+
readonly clock: Float64Array;
|
|
629
648
|
motion: StepMotion | undefined;
|
|
630
649
|
started: boolean;
|
|
631
650
|
ended: boolean; /** The entity a running `frames` step holds against its `Frames` loop, until the step ends. */
|
|
@@ -720,6 +739,18 @@ type TimelineRuntime = {
|
|
|
720
739
|
*/
|
|
721
740
|
releaseFrames(entity: Entity): void;
|
|
722
741
|
};
|
|
742
|
+
/**
|
|
743
|
+
* What the cursor functions carry down the tree: the runtime, the animation id marks are
|
|
744
|
+
* reported under, the list of marks reached so far, the entities the timeline spawned, by id, and
|
|
745
|
+
* the entities its key targets named when it started.
|
|
746
|
+
*/
|
|
747
|
+
type CursorCtx = {
|
|
748
|
+
/** The runtime of the frame step that walks the tree now. */rt: TimelineRuntime; /** Swapped for the nested id while a `use` step walks its tree, and set back after. */
|
|
749
|
+
animation: string;
|
|
750
|
+
readonly marks: string[];
|
|
751
|
+
readonly spawned: Map<string, Entity>; /** The entities the key targets named when the timeline started, by target object. */
|
|
752
|
+
readonly targets: ReadonlyMap<Target, Entity>;
|
|
753
|
+
};
|
|
723
754
|
/**
|
|
724
755
|
* One running timeline: its cursor, the marks it reached, the entities it counts on, the entities
|
|
725
756
|
* its key targets named at its start, the entities it spawned and despawns at its end, and the
|
|
@@ -730,11 +761,12 @@ type RunningTimeline = {
|
|
|
730
761
|
readonly animation: string;
|
|
731
762
|
readonly cursor: Cursor;
|
|
732
763
|
readonly marks: string[];
|
|
733
|
-
readonly entities: readonly Entity[]; /** The entities its `{ projection, key }` targets named when it started, by target
|
|
734
|
-
readonly targets: ReadonlyMap<
|
|
764
|
+
readonly entities: readonly Entity[]; /** The entities its `{ projection, key }` targets named when it started, by target object. */
|
|
765
|
+
readonly targets: ReadonlyMap<Target, Entity>; /** The entities its `spawn` steps made, by spawn id. Despawned when the timeline ends. */
|
|
735
766
|
readonly spawned: Map<string, Entity>;
|
|
736
767
|
readonly resolve: () => void;
|
|
737
|
-
ended: boolean;
|
|
768
|
+
ended: boolean; /** The one cursor context of the timeline, made at its start and reused by every frame. */
|
|
769
|
+
readonly cctx: CursorCtx;
|
|
738
770
|
};
|
|
739
771
|
declare namespace types_d_exports$3 {
|
|
740
772
|
export { AnimApi, AnimCtx, AnimPlayerValue, AnimationDefinition, AnimationSpec, AnyAnimationDefinition, BuildTools, Config$3 as Config, Cursor, Deps$3 as Deps, ErasedFields, Events, ExternalPlayer, FrameLoop, FramesValue, FxStep, HapticDescriptor, HapticKind, KernelSlice$3 as KernelSlice, MarkListener, MotionKeyframe, PlayDescriptor, PlayHandle, Pose, RunningTimeline, SfxDescriptor, SlotRecord, SlotTags, SlotValue, SlotValues, State$3 as State, Step, StepMotion, Target, TimelineRuntime, Track };
|
|
@@ -1002,17 +1034,35 @@ type Config$3 = {
|
|
|
1002
1034
|
* offsets accumulator, the running timelines and the animation registry.
|
|
1003
1035
|
*/
|
|
1004
1036
|
type State$3 = {
|
|
1005
|
-
/** The one track table. Insertion order is advance order. */tracks: Map<number, Track>;
|
|
1037
|
+
/** The one track table. Insertion order is advance order. */tracks: Map<number, Track>;
|
|
1038
|
+
/**
|
|
1039
|
+
* The tracks of the table in start order, as a dense list the frame step walks by index. An ended
|
|
1040
|
+
* track stays in it until the next frame step drops it.
|
|
1041
|
+
*/
|
|
1042
|
+
trackList: Track[]; /** Ids of tracks and timelines. */
|
|
1006
1043
|
nextId: number; /** `"<entity>:<component>:<field>"` to the id of the absolute track that drives the field. */
|
|
1007
|
-
owner: Map<string, number>;
|
|
1008
|
-
|
|
1009
|
-
|
|
1044
|
+
owner: Map<string, number>;
|
|
1045
|
+
/**
|
|
1046
|
+
* Per field key, the delta each additive track contributes, in a one-number cell per track that
|
|
1047
|
+
* a frame writes in place.
|
|
1048
|
+
*/
|
|
1049
|
+
offsets: Map<string, Map<number, Float64Array>>;
|
|
1050
|
+
/**
|
|
1051
|
+
* Per field key, the value the offsets are added to, in a one-number cell a frame writes in
|
|
1052
|
+
* place. Dropped when no track drives the field.
|
|
1053
|
+
*/
|
|
1054
|
+
bases: Map<string, Float64Array>;
|
|
1010
1055
|
/**
|
|
1011
1056
|
* Per entity, its running additive tracks. `offsetsOf` of the driver reads it, so the cost of
|
|
1012
1057
|
* one answer is the loops of that entity and not every track of the game.
|
|
1013
1058
|
*/
|
|
1014
1059
|
additive: Map<Entity, Set<Track>>; /** The running timelines, by id. */
|
|
1015
|
-
timelines: Map<number, RunningTimeline>;
|
|
1060
|
+
timelines: Map<number, RunningTimeline>;
|
|
1061
|
+
/**
|
|
1062
|
+
* The timelines in start order, as a dense list the frame step walks by index. An ended timeline
|
|
1063
|
+
* stays in it until the next frame step drops it.
|
|
1064
|
+
*/
|
|
1065
|
+
timelineList: RunningTimeline[]; /** The `animations` of every feature, read in `onStart`. */
|
|
1016
1066
|
registry: Map<string, AnyAnimationDefinition>; /** `onMark` subscribers, in subscription order. */
|
|
1017
1067
|
markListeners: Set<MarkListener>; /** Counter of the frame steps. A track born in the running step is not advanced by it. */
|
|
1018
1068
|
frame: number; /** True while the track count is over `maxTracks`, so the warning is one per crossing. */
|
|
@@ -1702,29 +1752,34 @@ type FilterBody = {
|
|
|
1702
1752
|
} | {
|
|
1703
1753
|
readonly kind: "blur";
|
|
1704
1754
|
readonly filter: InstanceType<PixiModule["BlurFilter"]>; /** The fields the setters were last given; compared before a write. */
|
|
1705
|
-
readonly applied: Record<string, FilterField>;
|
|
1755
|
+
readonly applied: Record<string, FilterField>; /** The keys of `applied`, listed once: a compare walks them by index, with no `Object.keys` per frame. */
|
|
1756
|
+
readonly fields: readonly string[];
|
|
1706
1757
|
passes: number;
|
|
1707
1758
|
} | {
|
|
1708
1759
|
readonly kind: "colorMatrix";
|
|
1709
1760
|
readonly filter: InstanceType<PixiModule["ColorMatrixFilter"]>; /** The fields the setters were last given; compared before a write. */
|
|
1710
|
-
readonly applied: Record<string, FilterField>;
|
|
1761
|
+
readonly applied: Record<string, FilterField>; /** The keys of `applied`, listed once: a compare walks them by index, with no `Object.keys` per frame. */
|
|
1762
|
+
readonly fields: readonly string[];
|
|
1711
1763
|
passes: number;
|
|
1712
1764
|
} | {
|
|
1713
1765
|
readonly kind: "noise";
|
|
1714
1766
|
readonly filter: InstanceType<PixiModule["NoiseFilter"]>; /** The fields the setters were last given; compared before a write. */
|
|
1715
|
-
readonly applied: Record<string, FilterField>;
|
|
1767
|
+
readonly applied: Record<string, FilterField>; /** The keys of `applied`, listed once: a compare walks them by index, with no `Object.keys` per frame. */
|
|
1768
|
+
readonly fields: readonly string[];
|
|
1716
1769
|
passes: number;
|
|
1717
1770
|
} | {
|
|
1718
1771
|
readonly kind: "displacement";
|
|
1719
1772
|
readonly filter: InstanceType<PixiModule["DisplacementFilter"]>;
|
|
1720
1773
|
readonly sprite: PixiSprite; /** The fields the setters were last given; compared before a write. */
|
|
1721
|
-
readonly applied: Record<string, FilterField>; /** The
|
|
1774
|
+
readonly applied: Record<string, FilterField>; /** The keys of `applied`, listed once: a compare walks them by index, with no `Object.keys` per frame. */
|
|
1775
|
+
readonly fields: readonly string[]; /** The asset key the map sprite shows now. */
|
|
1722
1776
|
map: string;
|
|
1723
1777
|
passes: number;
|
|
1724
1778
|
} | {
|
|
1725
1779
|
readonly kind: "alpha";
|
|
1726
1780
|
readonly filter: InstanceType<PixiModule["AlphaFilter"]>; /** The fields the setters were last given; compared before a write. */
|
|
1727
|
-
readonly applied: Record<string, FilterField>;
|
|
1781
|
+
readonly applied: Record<string, FilterField>; /** The keys of `applied`, listed once: a compare walks them by index, with no `Object.keys` per frame. */
|
|
1782
|
+
readonly fields: readonly string[];
|
|
1728
1783
|
passes: number;
|
|
1729
1784
|
};
|
|
1730
1785
|
/**
|
|
@@ -1758,6 +1813,11 @@ type FilterInstance = FilterBody & {
|
|
|
1758
1813
|
readonly kindId: string; /** True for an instance that draws in place of a broken kind or instance (E5). */
|
|
1759
1814
|
readonly standIn: boolean; /** A stand-in built while this broken instance was drawing; the next sync puts it in its place. */
|
|
1760
1815
|
replacement: FilterInstance | undefined;
|
|
1816
|
+
/**
|
|
1817
|
+
* The entity of the view it draws on, set when the filter sync takes it in; 0 for a warm-up probe. A break inside a
|
|
1818
|
+
* render tells the renderer about this view (`renderer.invalidate`) before it switches the filter off.
|
|
1819
|
+
*/
|
|
1820
|
+
entity: Entity;
|
|
1761
1821
|
};
|
|
1762
1822
|
/**
|
|
1763
1823
|
* One of our bodies: a `Filter` over the assembled programs, the kind of every place of a chain and of a mark.
|
|
@@ -1815,21 +1875,48 @@ type CheckState = {
|
|
|
1815
1875
|
/**
|
|
1816
1876
|
* What the filter sync keeps for one entity: the kinds it carries, one instance per kind, the
|
|
1817
1877
|
* instances waiting to be destroyed after the next assignment, the slots last handed to
|
|
1818
|
-
* `renderer.sync.filters.set`, the core
|
|
1819
|
-
* instances of this frame in their sorted order (one array, reused every frame),
|
|
1820
|
-
* `renderer.invalidate` call a visible filter write of the frame makes
|
|
1878
|
+
* `renderer.sync.filters.set`, the run in which each core kind's component last changed, the
|
|
1879
|
+
* instances of this frame in their sorted order (one array, reused every frame), the one
|
|
1880
|
+
* `renderer.invalidate` call a visible filter write of the frame makes, and whether the next run
|
|
1881
|
+
* syncs it.
|
|
1821
1882
|
*/
|
|
1822
1883
|
type FilteredView = {
|
|
1884
|
+
/** The entity the record is kept for. */readonly entity: Entity;
|
|
1823
1885
|
readonly kinds: Set<string>;
|
|
1824
1886
|
readonly instances: Map<string, FilterInstance>;
|
|
1825
1887
|
readonly retired: FilterInstance[];
|
|
1826
1888
|
assigned: readonly FilterSlot[];
|
|
1827
|
-
|
|
1889
|
+
/**
|
|
1890
|
+
* Per kind `index`, the run of the filter sync in which its component was last seen changed; read only for a
|
|
1891
|
+
* Pixi-core kind, which is written only in such a run. A number per kind, so marking allocates nothing.
|
|
1892
|
+
*/
|
|
1893
|
+
readonly marks: number[];
|
|
1828
1894
|
readonly placed: FilterInstance[]; /** True once `renderer.invalidate` was called for this view in the current frame. */
|
|
1829
1895
|
signalled: boolean; /** Calls `renderer.invalidate(entity)` once per frame for this view, before the write; made once with the record. */
|
|
1830
1896
|
readonly signal: () => void; /** The area last handed to `renderer.sync.filters.area`, written in place (B4). */
|
|
1831
1897
|
readonly areaSent: AreaBox; /** The `enabled` switches of the placed instances when the area was last judged, one bit each in placed order. */
|
|
1832
1898
|
areaMask: number;
|
|
1899
|
+
/**
|
|
1900
|
+
* The next run of the filter sync brings the view up to date: a filter component of it changed, came or left, its
|
|
1901
|
+
* map was retired, a kind of it still waits for its instance, or a chain left places to destroy.
|
|
1902
|
+
*/
|
|
1903
|
+
dirty: boolean; /** Forgotten: out of `State.views`; the next run drops it from `State.viewList`. */
|
|
1904
|
+
gone: boolean;
|
|
1905
|
+
};
|
|
1906
|
+
/**
|
|
1907
|
+
* Where the filter sync stands between two runs. It syncs only the views marked dirty, and judges the full-screen
|
|
1908
|
+
* budget only when something it depends on moved.
|
|
1909
|
+
*/
|
|
1910
|
+
type FilterSyncState = {
|
|
1911
|
+
/** The current run, counted from 1: a core kind's change mark holds the run it was made in. */round: number;
|
|
1912
|
+
/**
|
|
1913
|
+
* Every view syncs at the next run: a debug switch turned a kind off or on, or a filter broke or ran its chains at a
|
|
1914
|
+
* new resolution inside a render, where the view it belongs to is not known.
|
|
1915
|
+
*/
|
|
1916
|
+
all: boolean; /** A view was marked dirty or forgotten since the last walk: the next run walks the dense list, otherwise it skips it. */
|
|
1917
|
+
pending: boolean; /** The viewport width the full-screen budget was last judged at; -1 before the first judgement. */
|
|
1918
|
+
width: number; /** The viewport height the full-screen budget was last judged at; -1 before the first judgement. */
|
|
1919
|
+
height: number;
|
|
1833
1920
|
};
|
|
1834
1921
|
//#endregion
|
|
1835
1922
|
//#region src/plugins/effects/particles/types.d.ts
|
|
@@ -1973,7 +2060,12 @@ type BakedEmitter = {
|
|
|
1973
2060
|
readonly config: ResolvedEmitterConfig; /** Scale per 1/64 of the life. */
|
|
1974
2061
|
readonly scaleTable: Float32Array; /** Alpha per 1/64 of the life, 0..1. */
|
|
1975
2062
|
readonly alphaTable: Float32Array; /** Tint per 1/64 of the life, packed as Pixi's `0xbbggrr`. */
|
|
1976
|
-
readonly tintTable: Uint32Array;
|
|
2063
|
+
readonly tintTable: Uint32Array;
|
|
2064
|
+
/**
|
|
2065
|
+
* The colour a particle is drawn with per 1/64 of the life, packed as Pixi's `0xaabbggrr`: the tint under the alpha
|
|
2066
|
+
* byte. Read straight from the table every frame: a number above the small integers handed back by a call is boxed.
|
|
2067
|
+
*/
|
|
2068
|
+
readonly colorTable: Uint32Array; /** Half side of the box no particle leaves, in reference units. */
|
|
1977
2069
|
readonly reach: number;
|
|
1978
2070
|
readonly textures: readonly PixiTexture[]; /** The texture source of the first texture: every texture of the effect samples it. */
|
|
1979
2071
|
readonly source: PixiTexture["source"] | undefined; /** The largest side of the textures, in pixels. */
|
|
@@ -2052,7 +2144,14 @@ type State$2 = {
|
|
|
2052
2144
|
ready: Set<string>; /** The filter kinds, built-ins first, then the filters of every feature. */
|
|
2053
2145
|
kinds: Map<string, FilterKind>; /** The shader check of every definition a kind can draw, in every build. */
|
|
2054
2146
|
checks: CheckState; /** Entity to the filters the sync keeps for it. */
|
|
2055
|
-
views: Map<Entity, FilteredView>;
|
|
2147
|
+
views: Map<Entity, FilteredView>;
|
|
2148
|
+
/**
|
|
2149
|
+
* The records of `views` in the order they were first seen: the dense list the filter sync walks by index. A
|
|
2150
|
+
* forgotten record stays, `gone`, until the next run drops it.
|
|
2151
|
+
*/
|
|
2152
|
+
viewList: FilteredView[]; /** The filter kinds in registration order, one per `index`: the change sets the filter sync reads, by index. */
|
|
2153
|
+
kindList: FilterKind[]; /** Where the filter sync stands between two runs. */
|
|
2154
|
+
filterSync: FilterSyncState; /** Keys of the one-shot warnings: `"emitter:fx.x"`, `"texture:board.cell"`, `"atlas:fx.x"`. */
|
|
2056
2155
|
warned: Set<string>; /** Whether each budget warning is in force, so a crossing warns once. */
|
|
2057
2156
|
over: {
|
|
2058
2157
|
particles: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Sr as Json, jr as Snapshot } from "./types-BHgJ1F6f.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-D6BrEwCf.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { j as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { a as InputOf, r as ControlApp } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Ir as Api$3, T as Api, Zt as Api$1, yr as Api$2 } from "./types-BHgJ1F6f.mjs";
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-fpFKYm6E.mjs";
|
|
3
|
+
import { j as InputApi } from "./types-Bm7DVtA_.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-D6BrEwCf.mjs";
|
|
5
|
+
import { a as InputOf, r as ControlApp } from "./types-jiWJhLPE.mjs";
|
|
6
|
+
import { t as commands } from "./commands-C_GccOFq.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/visual/types.d.ts
|
|
9
9
|
/** The base commands of the `/control` door, keyed by their short names. */
|
package/dist/visual.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-
|
|
1
|
+
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-BvkKJOSz.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/dist/visual.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as read, t as sources } from "./sources-
|
|
2
|
-
import { n as commands, t as run } from "./run-
|
|
1
|
+
import { n as read, t as sources } from "./sources-OvHvyeJS.mjs";
|
|
2
|
+
import { n as commands, t as run } from "./run-C07NXds7.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
|
5
5
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
@@ -161,7 +161,8 @@ const DEFINERS = [
|
|
|
161
161
|
"defineEmitter",
|
|
162
162
|
"defineTextStyles",
|
|
163
163
|
"defineStyle",
|
|
164
|
-
"defineComponent"
|
|
164
|
+
"defineComponent",
|
|
165
|
+
"system"
|
|
165
166
|
];
|
|
166
167
|
/**
|
|
167
168
|
* Whether a name is a definer whose calls make keys.
|
|
@@ -1859,6 +1860,11 @@ const ID_PREFIXES = {
|
|
|
1859
1860
|
defineEmitter: "emitter",
|
|
1860
1861
|
defineComponent: "component"
|
|
1861
1862
|
};
|
|
1863
|
+
/** The key prefix of each definer that takes its id as the `name` of its first-argument options. */
|
|
1864
|
+
const NAME_PREFIXES = {
|
|
1865
|
+
projection: "projection",
|
|
1866
|
+
system: "system"
|
|
1867
|
+
};
|
|
1862
1868
|
/**
|
|
1863
1869
|
* The text of a string literal or a template without holes.
|
|
1864
1870
|
*
|
|
@@ -2040,20 +2046,23 @@ function readIdCall(reading, call, definer, prefix) {
|
|
|
2040
2046
|
if (definer === "defineFlow") readTable(reading, call, id);
|
|
2041
2047
|
}
|
|
2042
2048
|
/**
|
|
2043
|
-
* Reads a projection: its key is its `name`, its line
|
|
2049
|
+
* Reads a definer named by its options, a projection or a system: its key is its `name`, its line
|
|
2050
|
+
* the `name` property.
|
|
2044
2051
|
*
|
|
2045
2052
|
* @param reading - The file being read.
|
|
2046
2053
|
* @param call - The call.
|
|
2054
|
+
* @param definer - The definer.
|
|
2055
|
+
* @param prefix - The key prefix.
|
|
2047
2056
|
*/
|
|
2048
|
-
function
|
|
2057
|
+
function readNameCall(reading, call, definer, prefix) {
|
|
2049
2058
|
const { typescript } = reading;
|
|
2050
2059
|
const spec = objectOf(typescript, call.arguments[0]);
|
|
2051
2060
|
const name = spec === void 0 ? void 0 : literalOf(typescript, propertyValue(typescript, spec, "name"));
|
|
2052
2061
|
if (name === void 0) {
|
|
2053
|
-
unresolve(reading,
|
|
2062
|
+
unresolve(reading, `${definer} name is not a string literal`);
|
|
2054
2063
|
return;
|
|
2055
2064
|
}
|
|
2056
|
-
define(reading, call,
|
|
2065
|
+
define(reading, call, `${prefix}:${name}`, name, { key: "name" });
|
|
2057
2066
|
}
|
|
2058
2067
|
/**
|
|
2059
2068
|
* Reads a text style table: every literal key is a key.
|
|
@@ -2174,8 +2183,9 @@ function readStyle(reading, call) {
|
|
|
2174
2183
|
*/
|
|
2175
2184
|
function readCall(reading, call, definer) {
|
|
2176
2185
|
const prefix = ID_PREFIXES[definer];
|
|
2186
|
+
const namePrefix = NAME_PREFIXES[definer];
|
|
2177
2187
|
if (prefix !== void 0) readIdCall(reading, call, definer, prefix);
|
|
2178
|
-
if (
|
|
2188
|
+
if (namePrefix !== void 0) readNameCall(reading, call, definer, namePrefix);
|
|
2179
2189
|
if (definer === "defineTextStyles") readTextStyles(reading, call);
|
|
2180
2190
|
if (definer === "defineStyle") readStyle(reading, call);
|
|
2181
2191
|
}
|