@moku-labs/game 0.15.149 → 0.15.151
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/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/{commands-Rk3il_Pn.d.mts → commands-DXSaq2AP.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-CXfxHIZS.d.mts → define-DoJN_Ctu.d.mts} +2 -2
- package/dist/{headless-CayFBKSj.d.mts → headless-CO19o31k.d.mts} +1 -1
- package/dist/{index-DP9hZTrk.d.mts → index-Dgwheaoi.d.mts} +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +6 -6
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-CaKaJAak.d.mts → runtime-CX1RTfCg.d.mts} +1 -1
- package/dist/{src-6rmoFaD5.mjs → src-CpV819p3.mjs} +514 -72
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-BbHpVeAD.d.mts → types-BaarAgv8.d.mts} +1 -1
- package/dist/{types-fkR2U4dd.d.mts → types-BpmdVJso.d.mts} +2 -2
- package/dist/{types-Cy2IGCQU.d.mts → types-C2-KGQGt.d.mts} +4 -4
- package/dist/{types-BMhuZtOK.d.mts → types-CbSTnp8T.d.mts} +2 -2
- package/dist/{types-DFmiN69h.d.mts → types-VJcIdmHU.d.mts} +69 -19
- package/dist/{visual-CrXEquz3.d.mts → visual-Dw4QXpgC.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/llms.txt +3 -2
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as memory, x as saveOf, y as WithGameState } from "./types-
|
|
4
|
-
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-VJcIdmHU.mjs";
|
|
2
|
+
import { t as createApp } from "./index-Dgwheaoi.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-C2-KGQGt.mjs";
|
|
4
|
+
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-CO19o31k.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/clock/fake.d.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-
|
|
1
|
+
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-CpV819p3.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-yi2XmYWC.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-
|
|
1
|
+
import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-VJcIdmHU.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-
|
|
2
|
-
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-
|
|
1
|
+
import { A as FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-VJcIdmHU.mjs";
|
|
2
|
+
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-BaarAgv8.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-
|
|
4
|
-
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-
|
|
1
|
+
import { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-VJcIdmHU.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-BpmdVJso.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-BaarAgv8.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-Dgwheaoi.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 { $r as Snapshot, Wr as Json } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { $r as Snapshot, Wr as Json } from "./types-VJcIdmHU.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-CO19o31k.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -3930,17 +3930,22 @@ type ProjectionSpec<Item, LayerName extends string, LiftName extends string, Pla
|
|
|
3930
3930
|
readonly initialOnly?: InitialOnly<Values, Item>;
|
|
3931
3931
|
/**
|
|
3932
3932
|
* The item a closed window of this projection is kept built for, so it opens in the frame after the tap. While
|
|
3933
|
-
* `from` does not show its key (`key(item)`, or the name of the projection without `key`),
|
|
3934
|
-
* view aside in the idle time of frames, one step a frame, and holds it hidden: never
|
|
3935
|
-
* does not answer for it. After a commit it reads `warm` again: the same content
|
|
3936
|
-
* writes the difference into the held view, another key builds it again. When `from`
|
|
3937
|
-
* is shown at once: the same entity, only what differs from the warm item is written
|
|
3938
|
-
* `enter` and `loop` hooks play as for a new view. A close plays the exit as before; the
|
|
3939
|
-
* in idle frames. Only on a drawing renderer and a live world (a pause or a fast walk drops
|
|
3940
|
-
* built again after it), and not in the frames of a motion that owns its fields (a loop and
|
|
3941
|
-
* forever do not count); a `warm` or a `view` that throws is logged as
|
|
3942
|
-
* until the next commit. The cost is the memory of the held view.
|
|
3943
|
-
*
|
|
3933
|
+
* `from` does not show its key (`key(item)`, or the name of the projection without `key`), or shows it with another
|
|
3934
|
+
* content, the engine builds its view aside in the idle time of frames, one step a frame, and holds it hidden: never
|
|
3935
|
+
* drawn, never hit, `entityOf` does not answer for it. After a commit it reads `warm` again: the same content
|
|
3936
|
+
* changes nothing, the same key writes the difference into the held view, another key builds it again. When `from`
|
|
3937
|
+
* shows that key the held view is shown at once: the same entity, only what differs from the warm item is written
|
|
3938
|
+
* (no `change` hook), and the `enter` and `loop` hooks play as for a new view. A close plays the exit as before; the
|
|
3939
|
+
* view is then built again in idle frames. Only on a drawing renderer and a live world (a pause or a fast walk drops
|
|
3940
|
+
* the view in work, to be built again after it), and not in the frames of a motion that owns its fields (a loop and
|
|
3941
|
+
* a motion that repeats forever do not count); a `warm` or a `view` that throws is logged as
|
|
3942
|
+
* `world:projection-failed` and nothing is held until the next commit. The cost is the memory of the held view.
|
|
3943
|
+
*
|
|
3944
|
+
* A gated window (F202) keeps one key from its dim into its open: `from` shows the dim item first, then the open
|
|
3945
|
+
* one. A `warm` that answers the open item while the dim shows has it built under the dim, also through the press
|
|
3946
|
+
* motion of the tapped button; the commit of the open item swaps the views in one frame (the dim view leaves with
|
|
3947
|
+
* the cause `"discard"` and no exit, the held one is shown as above), and a `ready` of the open waits for the build.
|
|
3948
|
+
* A commit of the dim's content as a new object swaps nothing. Left out, nothing is warmed.
|
|
3944
3949
|
*
|
|
3945
3950
|
* @param player - The `player` root of the committed state.
|
|
3946
3951
|
* @param session - The `session` root of the committed state.
|
|
@@ -4231,6 +4236,17 @@ type ProjectionState = {
|
|
|
4231
4236
|
*/
|
|
4232
4237
|
warmHeld: Set<Entity>; /** The record whose held view is being built now; absent when none is, never written as `undefined`. */
|
|
4233
4238
|
warmActive?: WarmRecord;
|
|
4239
|
+
/**
|
|
4240
|
+
* The keys an element of a held view registered while a live element of its projection holds the same key, by
|
|
4241
|
+
* projection, then key (F202: the open view of a gated window built under its dim). The live element keeps the key
|
|
4242
|
+
* in `keys` until the show of the record, which moves these over; a drop of the record forgets them.
|
|
4243
|
+
*/
|
|
4244
|
+
heldKeys: Map<string, Map<string, Entity>>;
|
|
4245
|
+
/**
|
|
4246
|
+
* The entity `adopt` was last handed while no build and no warm record was in work: an element ui made for a root
|
|
4247
|
+
* held warm, read by the `registerKey` that follows its spawn. `-1` for none.
|
|
4248
|
+
*/
|
|
4249
|
+
warmLoose: Entity;
|
|
4234
4250
|
/**
|
|
4235
4251
|
* The warm step may find work: a record went cold, or a commit came since the step last found none. A frame at rest
|
|
4236
4252
|
* reads it and `warmActive` and returns.
|
|
@@ -4285,6 +4301,22 @@ type WarmRecord = {
|
|
|
4285
4301
|
* Kept when `warm`, `from` or `view` threw, so a throw is logged once per commit and not every frame.
|
|
4286
4302
|
*/
|
|
4287
4303
|
seen?: Snapshot;
|
|
4304
|
+
/**
|
|
4305
|
+
* The record holds the next view of a key `from` shows live with another content (F202: the open view of a gated
|
|
4306
|
+
* window, built under its dim): it is stepped and polled also while a motion that owns its fields runs.
|
|
4307
|
+
*/
|
|
4308
|
+
next: boolean;
|
|
4309
|
+
/**
|
|
4310
|
+
* The step read the record under a motion that owns its fields and passed it over: it is stepped from `pending`,
|
|
4311
|
+
* without a second read, in the first step with no such motion.
|
|
4312
|
+
*/
|
|
4313
|
+
waiting: boolean; /** The read a waiting record is stepped from; absent for a read that gave no item. */
|
|
4314
|
+
pending?: WarmRead;
|
|
4315
|
+
};
|
|
4316
|
+
/** What the warm step read for a record: the item and its key. */
|
|
4317
|
+
type WarmRead = {
|
|
4318
|
+
item: unknown;
|
|
4319
|
+
key: string;
|
|
4288
4320
|
};
|
|
4289
4321
|
/**
|
|
4290
4322
|
* The build of the next scene aside (spec 31): its projections mounted into a table of their own, so a name never has
|
|
@@ -4743,10 +4775,13 @@ type ProjectionApi = {
|
|
|
4743
4775
|
* Gives an entity a projection and key of its own, so `entityOf` and `keyOf` answer for it next
|
|
4744
4776
|
* to the live views. That is how an element becomes a target for `anim`, `input` and `guide`.
|
|
4745
4777
|
* A key whose entity is gone is dropped in the next live frame, also when the remover was never
|
|
4746
|
-
* called. An element registered while the projection's warm window
|
|
4747
|
-
*
|
|
4748
|
-
*
|
|
4749
|
-
*
|
|
4778
|
+
* called. An element registered while the projection's warm window holds a view not shown belongs
|
|
4779
|
+
* to the held root (a row its list ranged in after it was built) when the projection shows no
|
|
4780
|
+
* live view, or when `adopt` was handed it since its spawn (ui adopts every element of a held
|
|
4781
|
+
* root): it is held with the window, `isBuilding` answers true and `entityOf` nothing until the
|
|
4782
|
+
* open. An element of a live view of the projection answers. While a live element holds the same
|
|
4783
|
+
* key, the held element waits: `entityOf` answers the live one until the held view is shown in
|
|
4784
|
+
* its place, then the held one (F202, the open view of a gated window built under its dim).
|
|
4750
4785
|
*
|
|
4751
4786
|
* @param projection - Name the element is addressed under.
|
|
4752
4787
|
* @param key - Key the element is addressed under.
|
|
@@ -4765,6 +4800,11 @@ type ProjectionApi = {
|
|
|
4765
4800
|
* // A row the shop's list ranges in while the shop is closed and held warm.
|
|
4766
4801
|
* world.projection.registerKey("shop.sheet", "w15", row);
|
|
4767
4802
|
* world.projection.entityOf("shop.sheet", "w15"); // undefined until the shop opens
|
|
4803
|
+
*
|
|
4804
|
+
* // The vitrine dims; its open view, built under the dim, has a scrim keyed as the dim's.
|
|
4805
|
+
* world.projection.adopt(openScrim);
|
|
4806
|
+
* world.projection.registerKey("vitrine", "scrim", openScrim);
|
|
4807
|
+
* world.projection.entityOf("vitrine", "scrim"); // dimScrim, until the open swaps the views
|
|
4768
4808
|
* ```
|
|
4769
4809
|
*/
|
|
4770
4810
|
registerKey(projection: string, key: string, entity: Entity): () => void;
|
|
@@ -4914,7 +4954,7 @@ type ProjectionApi = {
|
|
|
4914
4954
|
/**
|
|
4915
4955
|
* Whether an entity is built aside or held warm: a view the running build spawned, the view a warm window holds
|
|
4916
4956
|
* hidden (`warm` of a projection), an entity `adopt` marked for either, or an element registered with `registerKey`
|
|
4917
|
-
* for a
|
|
4957
|
+
* for the root a warm window holds. Such an entity is not drawn, not hit and not found until it is shown. A view is flagged before the `onAdded` hooks of its components, so a hook can ask.
|
|
4918
4958
|
* Two set lookups; false after the commit of the build and once `from` shows the warm view. Allocates nothing.
|
|
4919
4959
|
*
|
|
4920
4960
|
* @param entity - The entity to ask about.
|
|
@@ -4953,8 +4993,9 @@ type ProjectionApi = {
|
|
|
4953
4993
|
/**
|
|
4954
4994
|
* Marks an entity another plugin spawned for a root built aside or held warm, so `isBuilding` answers for the whole
|
|
4955
4995
|
* tree and a discard despawns it with the rest. It joins the running scene build, else the warm window being built
|
|
4956
|
-
* now
|
|
4957
|
-
*
|
|
4996
|
+
* now. When neither runs it marks nothing, but a `registerKey` of the same entity that follows holds it with the
|
|
4997
|
+
* window its projection holds (a row of a held root's list, ranged in after the window was built). The commit of
|
|
4998
|
+
* the build, and the open of the window, clear the mark with every other.
|
|
4958
4999
|
*
|
|
4959
5000
|
* @param entity - The entity to mark.
|
|
4960
5001
|
* @example
|
|
@@ -14758,7 +14799,7 @@ type State = {
|
|
|
14758
14799
|
warned: Set<string>;
|
|
14759
14800
|
/**
|
|
14760
14801
|
* `onEnter`, the `load` and `ready` handlers, the texture provider, the start and the end of an exit in `world`,
|
|
14761
|
-
* and the
|
|
14802
|
+
* and the systems `assets.leave` and `assets.ready` of phase `sync`.
|
|
14762
14803
|
*/
|
|
14763
14804
|
removers: Array<() => void>; /** The `files` map of the stamp the dev hot swap applied last. `undefined` until the first swap. */
|
|
14764
14805
|
stamps: Readonly<Record<string, string>> | undefined; /** The running dev hot swap. The next one waits for it, so two swaps never overlap. */
|
|
@@ -14788,6 +14829,15 @@ type State = {
|
|
|
14788
14829
|
*/
|
|
14789
14830
|
readyFailed: Set<string>; /** One running or finished warm per bundle, joined by a second `warm`; dropped when the bundle unloads (F60). */
|
|
14790
14831
|
warmed: Map<string, WarmEntry>;
|
|
14832
|
+
/**
|
|
14833
|
+
* Where a `ready` stands on a warm view in work (F202, the open view of a gated window built under its dim):
|
|
14834
|
+
* `"none"`, `"warm"` while a `ready` answered `false` waits for the build to post, or `"waived"` after the cap
|
|
14835
|
+
* posted with the build still in work, so a re-ask goes on, until the build ends. The system `assets.ready` reads it
|
|
14836
|
+
* each frame.
|
|
14837
|
+
*/
|
|
14838
|
+
readyWait: "none" | "warm" | "waived"; /** The game clock (`Time.elapsed`) of the first frame the `"warm"` wait was seen, the start of its cap; -1 before. */
|
|
14839
|
+
readySince: number; /** The number of the ask (`readyAsk`) whose post the `"warm"` wait holds; its post goes through `settleAsk` (F204). */
|
|
14840
|
+
readyWarmAsk: number;
|
|
14791
14841
|
};
|
|
14792
14842
|
/**
|
|
14793
14843
|
* What `usage()` reports about one loaded bundle.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-
|
|
2
|
-
import { W as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { R as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { i as ControlApp, o as InputOf } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-VJcIdmHU.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-BpmdVJso.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-BaarAgv8.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-CO19o31k.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-CbSTnp8T.mjs";
|
|
6
|
+
import { t as commands } from "./commands-DXSaq2AP.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-Dw4QXpgC.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/llms.txt
CHANGED
|
@@ -566,14 +566,15 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
566
566
|
- Endless loops of views under an opaque or blurred overlay write nothing (`renderer.sync.loopsHeld(entity)`, the seam anim asks before an endless loop writes); their phase follows time.
|
|
567
567
|
- Scene switch look: from the start of a live switch (before its bundles and textures are awaited) the renderer draws a veil over the scene being left, above every layer, and, when the switch is not done `afterMs` after its start, a loader above it until the swap; then the veil fades out over the new scene. Config `scenes.leave` (default `{ cover: { color: 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`) and a scene's `leave` (`defineScene("ward", { ..., leave: false })`) are merged field by field (the scene being left decides; `false` turns a part or the whole off); the loader is the engine's white ring, `loader: { texture: "ui.loader.ring" }` a game texture turning, or `loader: { projection: "loading" }` a projection in a layer of its own the scene declares (no other projection of the scene may draw there), kept built and hidden while the scene stands and shown once the loader is due; `scenes` feeds that loader the switch (`projection.feed`), so its `from(player, session, sw)` reads a `SceneSwitch`: `{ from: "ward", to: "ward", progress: 0 }` while the ward stands, then `{ from: "ward", to: "board", progress }`, the share of the board's bundles loaded (from `assets:bundle-progress`; a bundle loaded at the start or once the scene stage has its loads counts whole), 0 to 1 in steps of 0.01, the last exactly 1; `loader: { holdMs: 260 }` (default 0) is a floor on the swap: the next scene builds at once and the old one stays until 260 ms after the switch start (on the clock or in game time, whichever passes first, so a visual test's stepped frames pass it while its fake clock stands, F156) and one drawn frame of the look, so a switch slower than it gets nothing added; an abort or a throw drops both at once; fast walks, a world that is not live, headless apps and the first scene show nothing and hold nothing. The scene being entered sets the veil's colour and alpha: `defineScene("night", { ..., enter: { cover: { color: 0x0b1020, alpha: 0.7 } } })` wins over what the scene being left resolved, field by field; `inMs`/`outMs` stay the left scene's and a veil turned off stays off. Types `SceneLeave`, `SceneCover`, `SceneLoader`, `SceneEnter` (`Scenes`).
|
|
568
568
|
- A scene names bundles on top of its `bundle` from the committed state: `defineScene("ward", { bundle: "episodes-kit", bundles: ({ session }) => [session.episode], layers: {}, projections: [wardRoom] })`. `bundles` is read each time a node enters the scene, and every way in (a live entry, a restore, the `safeNode` recovery) waits for all of them before the scene is mounted and the node's gate opens. The keys are `BundleKey`s of `generated/assets.ts`.
|
|
569
|
-
- `app.assets`: `load(bundle)`, `warm(bundle)` (loads it if needed, then puts its textures and atlas pages on the GPU through `renderer.sync.textures.upload`, `renderer.uploads` a drawn frame; joins a running or finished warm; an unload forgets it; resolves also when the renderer could not upload; headless at once), `unload(bundle)`, `isLoaded(bundle)`, `has(bundle)` (the manifest carries it, loaded or not), `texture(key)`, `font(key)`, `audio(key)`, `usage()`. Per bundle in a feature's `assets.ts`: `defineBundles({ ep01: { tier: "feature", release: "leave", mipmaps: ["items/**"] } })`. `release: "leave"` also unloads the bundle, with reason `"leave"`, at the next rest once nothing holds it: not pinned by the node entered, not named by the mounted scene, no node of its feature on the stack; a bundle the outgoing scene named leaves one rest later. The default `"budget"` leaves only under the texture budget. `mipmaps` (`true` or globs relative to `assets/`) uploads the textures with their full chain; such a texture stays loose in a pack. A sub-feature with resources gets its own bundles, named like its folder, with `dir` and `parent` in the manifest; a code-only one has none. The effect `ready(bundle | bundles)` (root export, also from `defineGame`) lets a node rest on a load and stay answerable: its handler (fast mode too) answers `true` headless, throws for an unknown bundle, answers `true` when every bundle is loaded and warmed or its last warm failed (`ctx.log.warn("assets:ready-failed", { bundle, error })`, cleared by a later successful load), otherwise starts `warm` for what is missing, answers `false` and posts `{ type: "ready" }` into `flow.inbox` once all of it settled. Recipe: a rest node `inbox: ["elapsed", "ready"]` with outcomes `ready` and `back`, and a transit node `if ((await fx(ready(list))) === false) return out.wait();`. `companions.add({ load(bundle), unload(bundle) })` adds what loads and unloads with every bundle; `i18n` adds the strings of a sub-feature that way, only when `assets` is composed. Events `assets:bundle-loaded`, `assets:bundle-progress`, `assets:bundle-unloaded` (`reason: "budget" | "request" | "leave"`), `assets:replaced` (dev). Config: `manifest`, `textureBudgetMb: 192`, `preloadDepth: 2`, `baseUrl`, `io`.
|
|
569
|
+
- `app.assets`: `load(bundle)`, `warm(bundle)` (loads it if needed, then puts its textures and atlas pages on the GPU through `renderer.sync.textures.upload`, `renderer.uploads` a drawn frame; joins a running or finished warm; an unload forgets it; resolves also when the renderer could not upload; headless at once), `unload(bundle)`, `isLoaded(bundle)`, `has(bundle)` (the manifest carries it, loaded or not), `texture(key)`, `font(key)`, `audio(key)`, `usage()`. Per bundle in a feature's `assets.ts`: `defineBundles({ ep01: { tier: "feature", release: "leave", mipmaps: ["items/**"] } })`. `release: "leave"` also unloads the bundle, with reason `"leave"`, at the next rest once nothing holds it: not pinned by the node entered, not named by the mounted scene, no node of its feature on the stack; a bundle the outgoing scene named leaves one rest later. The default `"budget"` leaves only under the texture budget. `mipmaps` (`true` or globs relative to `assets/`) uploads the textures with their full chain; such a texture stays loose in a pack. A sub-feature with resources gets its own bundles, named like its folder, with `dir` and `parent` in the manifest; a code-only one has none. The effect `ready(bundle | bundles)` (root export, also from `defineGame`) lets a node rest on a load and stay answerable: its handler (fast mode too) answers `true` headless, throws for an unknown bundle, answers `true` when every bundle is loaded and warmed or its last warm failed (`ctx.log.warn("assets:ready-failed", { bundle, error })`, cleared by a later successful load), otherwise starts `warm` for what is missing, answers `false` and posts `{ type: "ready" }` into `flow.inbox` once all of it settled; in live mode it also answers `false` while a warm view is in work (`world.projection.left()` finite) and posts once that build ended, at most 400 ms (game clock) after the bundles settled (F202). Recipe: a rest node `inbox: ["elapsed", "ready"]` with outcomes `ready` and `back`, and a transit node `if ((await fx(ready(list))) === false) return out.wait();`. `companions.add({ load(bundle), unload(bundle) })` adds what loads and unloads with every bundle; `i18n` adds the strings of a sub-feature that way, only when `assets` is composed. Events `assets:bundle-loaded`, `assets:bundle-progress`, `assets:bundle-unloaded` (`reason: "budget" | "request" | "leave"`), `assets:replaced` (dev). Config: `manifest`, `textureBudgetMb: 192`, `preloadDepth: 2`, `baseUrl`, `io`.
|
|
570
570
|
- `resource(name, defaults)` clones plain JSON defaults into every world. `resource(name, () => value)` calls the factory once per world on first read, so the value may hold a `Map` or a function: `const Looks = resource("boardLooks", () => ({ shown: new Map<World.Entity, { look: string }>() }))`. A system keeps its own state there; `snapshot()` leaves a value that is not JSON out.
|
|
571
571
|
- `Now` is the engine resource of the frame's moment: `world` writes `clock.now()` into it at start and first thing in every frame, headless too, so every system of a frame reads one moment: `const { now } = res(Now)`; a fake clock makes it exact. A system that shows time writes its component only when its picture changes. `snapshot().resources` holds `Now: { now }`. Reserved resource names: `Now`, `Pointer`, `AnimPlayer`, `UiCounters`; a game resource of one of them throws `[game] world: the resource name "Now" is the engine's (the frame's moment).`
|
|
572
572
|
- When a system runs: before each run the world checks it. A system with a `query` is skipped while a term of its query has no entity (the smallest store among the terms is empty): no walk, no `mut()` mark, no timing. A system without a query always runs. `system({ ..., scenes: ["board"] })` runs only while one of those scenes is mounted or leaving: `scenes` calls `app.world.ecs.setScene(id)` at every switch, and the scene before leaves until nothing carries `Exiting` (the elements of its JSX views played their exit; the next scene's entities already stand then, so a `scenes` system writes only its own scene's entities). A dev build throws at start for a name in `scenes` no feature declares: `[game] System "board.idle" runs on the scene "bord", which no feature declares.` `ctx.resumed` is true on the first run after a skip (a cache or a remembered cue starts over then). The same for every system, the engine's included; 0 B a frame. A run with no rows does not happen any more: work a system did besides its rows (a hover, a drop or a press that ends, a resource reset, something that outlives its entities) goes to a system with `query: []` and `scenes`, reading its rows with `world.query()`. From 0.15.3: delete `systemsRun` from every feature (the type refuses it), rewrite the systems that work outside their rows, add `scenes` only to a system whose entities stand on every screen; `ecs.hold` and `ecs.isActive` are gone (a test asks `app.scenes.current()` or whether the system ran). World README, "When a system runs".
|
|
573
573
|
- Motion hooks are told why they play: `enter(view, item, hint, cause)` and `exit(view, item, hint, cause)` get `World.MotionCause`, `"mount"` (the view comes or goes with its screen: a mount, an unmount, a load, a restore, a paused or fast world) or `"change"` (a commit). A world projection plays them only for `"change"`; `ui` plays them for both. `app.world.projection.causeOf(entity)` answers how a view came or how it is leaving, also in a removal hook of its despawn, until the next frame.
|
|
574
574
|
- `app.world.projection.replace(spec)` swaps the spec of a registered projection; a mounted one runs its new `view` on the next frame. An unknown name throws. The caller is the dev hot swap.
|
|
575
575
|
- `projection({ …, initialOnly: [[Shape, ["sweep"]]] })`: `view` gives those fields once, at the birth of a view; after that they belong to another writer (a system drawing a timer arc from `Now`), and no changed item, motion, end-of-motion check (`world:view-corrected`), rollback, `settle`, restore or load writes or compares them, as with `mute()` for every view's whole life. Field names are checked per component; a pair with no field throws at register. Absent, every field is the projection's.
|
|
576
|
-
- `projection({ …, warm: (player, session) => item })`: a warm window, since 0.15.47. `warm` returns one item of the type `from` gives, the window as it opens (its closed or default state); while `from` does not show that key, the world builds its view in idle frames (by root and by part, under two thirds of the frame interval, only in a live world on a drawing renderer, never while an owned motion runs) and keeps it hidden: not drawn, not hit, `entityOf` answers nothing. When `from` shows the key, the open only shows the held view in the next frame: an item equal to the warm one writes nothing, another one writes only the difference; `enter` and `loop` play as for a new view. Example, a settings sheet: `projection({ name: "settings.sheet", layer: "ui", from: (player, session) => session.sheet?.kind === "settings" ? [settingsModel(player, session, tables)] : [], key: sheet => sheet.id, view: settingsView, warm: (player, session) => settingsModel(player, { ...session, sheet: { kind: "settings", page: "main" } }, tables) })`. Cost: the memory of the held view (A Memory Missing's album: about +2 MB of JS heap, textures unchanged); after each close the view goes cold and is built again in idle frames (the album: 41–58 frames of work, about a second, at 6× CPU); a commit that changes the warm item rebuilds it, so it suits windows whose item rarely changes (settings, a shop). A `warm` or a `view` that throws logs `world:projection-failed` and the window opens as before. World README, "Warm windows".
|
|
576
|
+
- `projection({ …, warm: (player, session) => item })`: a warm window, since 0.15.47. `warm` returns one item of the type `from` gives, the window as it opens (its closed or default state); while `from` does not show that key, or shows it with another content (a gated window's dim, below), the world builds its view in idle frames (by root and by part, under two thirds of the frame interval, only in a live world on a drawing renderer, never while an owned motion runs but for a gated window's dim) and keeps it hidden: not drawn, not hit, `entityOf` answers nothing. When `from` shows the key, the open only shows the held view in the next frame: an item equal to the warm one writes nothing, another one writes only the difference; `enter` and `loop` play as for a new view. Example, a settings sheet: `projection({ name: "settings.sheet", layer: "ui", from: (player, session) => session.sheet?.kind === "settings" ? [settingsModel(player, session, tables)] : [], key: sheet => sheet.id, view: settingsView, warm: (player, session) => settingsModel(player, { ...session, sheet: { kind: "settings", page: "main" } }, tables) })`. Cost: the memory of the held view (A Memory Missing's album: about +2 MB of JS heap, textures unchanged); after each close the view goes cold and is built again in idle frames (the album: 41–58 frames of work, about a second, at 6× CPU); a commit that changes the warm item rebuilds it, so it suits windows whose item rarely changes (settings, a shop). A `warm` or a `view` that throws logs `world:projection-failed` and the window opens as before. World README, "Warm windows".
|
|
577
|
+
- A gated window (F202) keeps one key from its dim into its open (`from` shows the dim item, then the open one, while `ready` loads its pictures). Give it a `warm` that answers the open item while the dim shows (and nothing otherwise): the open view is built aside under the dim, also through the press tween of the tapped button (other warm windows wait for that motion to end), and the commit of the open item swaps the views in one frame: the dim view leaves at once (cause `"discard"`, no exit), the held one is shown with its `enter`, only the difference to the warm item written. A commit of the dim's content as a new object swaps nothing. While the dim shows, `entityOf` answers the dim's elements for keys both views have (the root, the scrim) and the open's after the swap. `ready` waits for the build too: it answers `false` while `world.projection.left()` is finite and posts once the build ended, at most 400 ms (game clock) after its bundles settled. World README, "A gated window".
|
|
577
578
|
- `from(player, session, sw)`: the third argument is the switch another plugin last handed the projection with `projection.feed(name, sw)`, a `SceneSwitch` `{ from, to, progress }` (the scene left, the scene entered, `progress` 0 to 1), `undefined` for a projection never fed; a `from` with two parameters reads the state alone, as before. A loader reads it: `from: (_player, _session, sw: SceneSwitch | undefined) => ({ to: sw?.to ?? "", progress: sw?.progress ?? 0 })`. World README, "Feeding a projection".
|
|
578
579
|
- `app.input.lock.window(rect | null | undefined)`: the input lock `ui` sets for a guide (`Input.LockWindow` = `{ x, y, w, h }` in reference units, kept by reference and written in place); a press outside reaches no view and answers `flow.gate.state().blocked` or nothing, a drop or trace sample outside finds nothing; `null` locks everything, `undefined` lifts it. The doors `tap`, `press`, `drag`, `swipe`, `trace` are never locked.
|
|
579
580
|
- `input`: one followed pointer. A finger that has not started a gesture (pressed, inside the tap slop, no long press, no trace) gives way to the next finger that goes down, wherever it rests, and its press is cancelled; a finger that started a gesture keeps it. `Pointer.id` is the followed `pointerId` (`-1` at rest): a system that measures the finger's travel starts over when it changes.
|