@moku-labs/game 0.15.47 → 0.15.49

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.
Files changed (33) hide show
  1. package/dist/app/page.d.mts +1 -1
  2. package/dist/app/page.mjs +1 -1
  3. package/dist/app/system.d.mts +3 -3
  4. package/dist/app.d.mts +3 -3
  5. package/dist/app.mjs +1 -1
  6. package/dist/assets.d.mts +1 -1
  7. package/dist/{commands-C2-V2uKy.d.mts → commands-iR813FBY.d.mts} +5 -5
  8. package/dist/control.d.mts +4 -4
  9. package/dist/{define-NGQXu7Qj.d.mts → define-Bi1cUDqV.d.mts} +2 -2
  10. package/dist/{headless-DcJCzBkz.d.mts → headless-DEvO-OYZ.d.mts} +1 -1
  11. package/dist/{index-DTsi9hds.d.mts → index-Uplq0kG1.d.mts} +3 -3
  12. package/dist/index.d.mts +5 -5
  13. package/dist/index.mjs +2 -2
  14. package/dist/inspect.d.mts +6 -6
  15. package/dist/inspect.mjs +1 -1
  16. package/dist/jsx-dev-runtime.d.mts +1 -1
  17. package/dist/jsx-runtime.d.mts +1 -1
  18. package/dist/{runtime--I74mwMY.d.mts → runtime-BnClKG8W.d.mts} +2 -2
  19. package/dist/{sources-MfRpM8sV.mjs → sources-Cjrzga6S.mjs} +1 -1
  20. package/dist/{src-CI77RUzT.mjs → src-D5fX75jk.mjs} +1373 -141
  21. package/dist/testing.d.mts +4 -4
  22. package/dist/testing.mjs +1 -1
  23. package/dist/{types-D4Q5MH_l.d.mts → types-65BDgeC1.d.mts} +32 -4
  24. package/dist/{types-RX1bYaqD.d.mts → types-AIu9QkEJ.d.mts} +2 -2
  25. package/dist/{types-dF8Qmn7P.d.mts → types-CP2LCpoj.d.mts} +4 -4
  26. package/dist/{types-Bc_re3rB.d.mts → types-D0uITVZD.d.mts} +15 -1
  27. package/dist/{types-CiSVMR89.d.mts → types-kKYSP3h-.d.mts} +108 -3
  28. package/dist/{visual-wSjsCu_W.d.mts → visual-BeJuimAt.d.mts} +6 -6
  29. package/dist/{visual-ClVRMUAi.mjs → visual-LFiLc3GH.mjs} +5 -2
  30. package/dist/visual.d.mts +1 -1
  31. package/dist/visual.mjs +1 -1
  32. package/llms.txt +2 -2
  33. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { Or as Json, Sr as FakeClock, _r as NodeFx, br as ClockSource, cr as NodeTable, er as FeaturePlugin, fr as Descriptor, gr as Hint, nr as AnyFlow } from "./types-Bc_re3rB.mjs";
2
- import { t as createApp } from "./index-DTsi9hds.mjs";
3
- import { b as saveOf, v as WithGameState, y as memory } from "./types-dF8Qmn7P.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-DcJCzBkz.mjs";
1
+ import { Cr as FakeClock, _r as Hint, kr as Json, lr as NodeTable, pr as Descriptor, rr as AnyFlow, tr as FeaturePlugin, vr as NodeFx, xr as ClockSource } from "./types-D0uITVZD.mjs";
2
+ import { t as createApp } from "./index-Uplq0kG1.mjs";
3
+ import { b as saveOf, v as WithGameState, y as memory } from "./types-CP2LCpoj.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-DEvO-OYZ.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 { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-CI77RUzT.mjs";
1
+ import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-D5fX75jk.mjs";
2
2
  import { n as saveOf, t as memory } from "./memory-CWlqhS7l.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-CCiUwvlp.mjs";
@@ -1,5 +1,5 @@
1
- import { $ as PixiModule, A as SyncApi, An as NumericFields, Dr as Events$3, En as Ease, Fn as TrackSegment, Jr as Api$1, Ln as Api$2, Nn as ReducedMotion, O as FilterSlot, Or as Json, Pn as TrackOptions, Q as PixiFilter, Tr as Api$6, Wr as Events$5, Y as Api$4, b as Events$4, dr as TypeTag, et as PixiSprite, fn as ComponentType, fr as Descriptor, ft as FilterCache, ii as Require, k as FilterSlotInputs, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$3, ri as Events$2, s as Events$1, sn as AnyComponent, t as Api$5, tt as PixiTexture, un as ComponentHandle, ut as Point } from "./types-Bc_re3rB.mjs";
2
- import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-CiSVMR89.mjs";
1
+ import { $ as PixiModule, A as SyncApi, An as MotionHandle, Dn as Ease, Er as Api$6, Fn as TrackOptions, Gr as Events$5, In as TrackSegment, O as FilterSlot, Or as Events$3, Pn as ReducedMotion, Q as PixiFilter, Rn as Api$2, Y as Api$4, Yr as Api$1, ai as Require, b as Events$4, et as PixiSprite, fn as ComponentType, fr as TypeTag, ft as FilterCache, ii as Events$2, jn as NumericFields, k as FilterSlotInputs, kr as Json, ln as AnyComponentValue, mn as Entity, nn as Api$3, pr as Descriptor, s as Events$1, sn as AnyComponent, t as Api$5, tt as PixiTexture, un as ComponentHandle, ut as Point, wn as AnchorTarget } from "./types-D0uITVZD.mjs";
2
+ import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-kKYSP3h-.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
  import { PluginCtx } from "@moku-labs/core";
5
5
 
@@ -2931,7 +2931,7 @@ type MusicRequest = {
2931
2931
  fadeMs: number;
2932
2932
  };
2933
2933
  declare namespace types_d_exports {
2934
- export { Config, Deps, ElementChange, ElementMotion, Finding, FocusRing, KernelSlice, State, TextInputLook, UiApi, UiCtx, UiNode };
2934
+ export { AnchorTarget, Config, Deps, ElementChange, ElementMotion, Finding, FocusRing, KernelSlice, State, TextInputLook, UiApi, UiCtx, UiNode };
2935
2935
  }
2936
2936
  /**
2937
2937
  * The look of the keyboard focus ring: a dashed ring with a solid halo under it, drawn around the
@@ -3063,7 +3063,7 @@ type UiCtx = KernelSlice & {
3063
3063
  /**
3064
3064
  * ui plugin API, `app.ui`. The screen is one more projection, so three members read it the way a
3065
3065
  * test reads the board: a snapshot, a key lookup and a list of findings; the fourth types into a
3066
- * text field, the fifth scrolls a `scroll`.
3066
+ * text field, the fifth scrolls a `scroll`, the sixth measures where a view or an element is drawn.
3067
3067
  *
3068
3068
  * @example
3069
3069
  * ```ts
@@ -3171,6 +3171,34 @@ type UiApi = {
3171
3171
  * ```
3172
3172
  */
3173
3173
  scroll(key: string, to: number): boolean;
3174
+ /**
3175
+ * Where a target is drawn, in screen reference units: the rect an `<anchor>` sits on. A ui
3176
+ * element's layout box, a nine-slice's panel, a shape's rectangle or a sprite's box, through its
3177
+ * root pose, so a fit, a slot, a scroll's offset and the motion of an ancestor move it; the
3178
+ * rotation is left out. A list gives the bounding rect of its shown targets. Not shown: the key
3179
+ * names no entity, or one leaving, built aside, of no area or drawn at alpha 0. Works in every
3180
+ * build and headless; every call answers a new object.
3181
+ *
3182
+ * @param target - A view or an element by projection and key, or a list of them.
3183
+ * @returns The rect, or `undefined` when no target is shown.
3184
+ * @example
3185
+ * ```ts
3186
+ * // The tutorial puts its hint beside the first seat of the board's order strip.
3187
+ * app.ui.rectOf({ projection: "board.strip", key: "seat0" }); // { x: 40, y: 1500, w: 116, h: 120 }
3188
+ * // The seat and the cell of the board fitted to 0.5: the rect around both.
3189
+ * app.ui.rectOf([
3190
+ * { projection: "board.strip", key: "seat0" },
3191
+ * { projection: "board.strip", key: "cell" }
3192
+ * ]); // { x: 40, y: 250, w: 680, h: 1370 }
3193
+ * app.ui.rectOf({ projection: "board.strip", key: "nowhere" }); // undefined
3194
+ * ```
3195
+ */
3196
+ rectOf(target: AnchorTarget | readonly AnchorTarget[]): Readonly<{
3197
+ x: number;
3198
+ y: number;
3199
+ w: number;
3200
+ h: number;
3201
+ }> | undefined;
3174
3202
  };
3175
3203
  //#endregion
3176
3204
  export { sequence as $, GlowValue as A, Target as B, BlurValue as C, FilterComponent as D, FilterArea as E, AnimPlayerValue as F, HAPTIC_KINDS as G, HapticKind as H, Config$3 as I, frames as J, defineAnimation as K, FramesValue as L, OutlineValue as M, UniformDeclaration as N, FilterSpec as O, AnimApi as P, play as Q, MotionKeyframe as R, AlphaValue as S, DisplacementValue as T, SfxDescriptor as U, types_d_exports$3 as V, Step as W, mark as X, haptic as Y, parallel as Z, State$2 as _, AudioApi as a, stopSfx as at, EmitterDefinition as b, MusicDescriptor as c, wait as ct, State$1 as d, set as et, VolumesFor as f, EffectsStats as g, EffectsApi as h, types_d_exports as i, stagger as it, NoiseValue as j, FilterValueOf as k, MusicOptions as l, OverlayApi as lt, Config$2 as m, State as n, spawn as nt, AudioContextLike as o, tween as ot, types_d_exports$1 as p, external as q, UiApi as r, spawned as rt, Config$1 as s, use as st, Config as t, sfx as tt, SoundEntry as u, types_d_exports$4 as ut, types_d_exports$2 as v, ColorMatrixValue as w, EmitterValue as x, EmitterConfig as y, State$3 as z };
@@ -1,5 +1,5 @@
1
- import { Lr as Snapshot, Or as Json } from "./types-Bc_re3rB.mjs";
2
- import { t as HeadlessApp } from "./headless-DcJCzBkz.mjs";
1
+ import { Rr as Snapshot, kr as Json } from "./types-D0uITVZD.mjs";
2
+ import { t as HeadlessApp } from "./headless-DEvO-OYZ.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts
@@ -1,7 +1,7 @@
1
- import { $ as PixiModule, Er as Config, Fr as SaveDoc, Nr as PlayerStateProvider, Or as Json, Pr as ProviderCall, Rr as SnapshotOf, Sr as FakeClock, X as Config$2, a as Config$3, br as ClockSource, d as Manifest, dr as TypeTag, er as FeaturePlugin, lt as Orientation, n as AssetsIo, nr as AnyFlow, zn as Config$1 } from "./types-Bc_re3rB.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-D4Q5MH_l.mjs";
3
- import { R as I18nApi, U as StringTable, W as TextKey } from "./types-CiSVMR89.mjs";
4
- import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-DTsi9hds.mjs";
1
+ import { $ as PixiModule, Bn as Config$1, Cr as FakeClock, Dr as Config, Fr as ProviderCall, Ir as SaveDoc, Pr as PlayerStateProvider, X as Config$2, a as Config$3, d as Manifest, fr as TypeTag, kr as Json, lt as Orientation, n as AssetsIo, rr as AnyFlow, tr as FeaturePlugin, xr as ClockSource, zr as SnapshotOf } from "./types-D0uITVZD.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-65BDgeC1.mjs";
3
+ import { R as I18nApi, U as StringTable, W as TextKey } from "./types-kKYSP3h-.mjs";
4
+ import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-Uplq0kG1.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -4647,6 +4647,20 @@ type ProjectionKey = {
4647
4647
  projection: string;
4648
4648
  key: string;
4649
4649
  };
4650
+ /**
4651
+ * What an `<anchor>` sits on and `app.ui.rectOf` measures: a view or a ui element by its
4652
+ * projection and key. A ui element is keyed under the projection of its root.
4653
+ *
4654
+ * @example
4655
+ * ```ts
4656
+ * // The first seat of the board's order strip, the tutorial's window sits on it.
4657
+ * const seat: AnchorTarget = { projection: "board.strip", key: "seat0" };
4658
+ * ```
4659
+ */
4660
+ type AnchorTarget = {
4661
+ projection: string;
4662
+ key: string;
4663
+ };
4650
4664
  /**
4651
4665
  * What the next reconcile has to do: why it runs, which roots changed and whether `view` is
4652
4666
  * forced for every item.
@@ -13507,4 +13521,4 @@ type BundleCompanion = {
13507
13521
  unload(bundle: string): void;
13508
13522
  };
13509
13523
  //#endregion
13510
- export { PixiModule as $, FeatureDescription as $n, ThermalReading as $r, ShaderWhat as $t, SyncApi as A, NumericFields as An, State$6 as Ar, PerfChange as At, ShapeValue as B, EmitterIdOf as Bn, RngApi as Br, PerfLongFrameLine as Bt, SceneSpec as C, TagType as Cn, State$5 as Cr, PERF_CAUSES as Ct, DebugSwitches as D, Motion as Dn, Events$5 as Dr, PassKind as Dt, types_d_exports$1 as E, Ease as En, Config$6 as Er, PROBLEM_RULES as Et, NineSliceValue as F, TrackSegment as Fn, SaveDoc as Fr, PerfEventLine as Ft, Transform as G, TextStylesOf as Gn, PauseReason as Gr, PerfStartupLine as Gt, SpriteBlend as H, HudKeysOf as Hn, Api$6 as Hr, PerfMeasured as Ht, Overlay as I, ViewHandle as In, SaveUnreadableError as Ir, PerfEventName as It, AdaptiveScale as J, defineFlow as Jn, Api$7 as Jr, PoolTrimDetail as Jt, TransformValue as K, types_d_exports$4 as Kn, State$7 as Kr, PerfTelemetryLine as Kt, OverlayValue as L, Api$3 as Ln, Snapshot as Lr, PerfGapLine as Lt, HudPart as M, ProjectionSpec as Mn, Patch as Mr, PerfCollectorLine as Mt, HudPartValue as N, ReducedMotion as Nn, PlayerStateProvider as Nr, PerfCounts as Nt, FilterSlot as O, MotionCause as On, Json as Or, PassRecord as Ot, NineSlice$1 as P, TrackOptions as Pn, ProviderCall as Pr, PerfDisplay as Pt, PixiFilter as Q, type as Qn, State$8 as Qr, ShaderEventDetail as Qt, Parent as R, BundlesOf as Rn, SnapshotOf as Rr, PerfHeaderLine as Rt, SceneDefinition as S, SystemFor as Sn, FakeClock as Sr, OverlayWhat as St, State$1 as T, DescriptionNode as Tn, Api$5 as Tr, PERF_LOG_VERSION as Tt, SpriteOptions as U, Position as Un, Config$7 as Ur, PerfSampleLine as Ut, Sprite as V, GameTypes as Vn, RngState as Vr, PerfMarkLine as Vt, SpriteValue as W, State$4 as Wn, Events$6 as Wr, PerfSpikeLine as Wt, Config$2 as X, slot as Xn, FrameRate as Xr, ProblemRule as Xt, Api$1 as Y, exit as Yn, Config$8 as Yr, ProblemEventDetail as Yt, MonitorConfig as Z, to as Zn, RateChange as Zr, SHADER_WHATS as Zt, AnySceneProjection as _, Mut as _n, NodeFx as _r, FrameRing as _t, Config as a, State$3 as an, FlowGraph as ar, types_d_exports$2 as at, Events$1 as b, ResourceType as bn, ClockSource as br, MonitorSections as bt, LoadBundles as c, AnyComponentType as cn, NodeTable as cr, RenderStats as ct, Manifest as d, ComponentSchema as dn, TypeTag as dr, ViewportSize as dt, Time as ei, WarmDetail as en, FeaturePlugin as er, PixiSprite as et, ReadyBundles as f, ComponentType as fn, Descriptor as fr, FilterCache as ft, types_d_exports as g, FrameDiff as gn, Hint as gr, FrameRecord as gt, Usage as h, EntitySnapshot as hn, GuideOptions as hr, FrameReadout as ht, BundleSpec as i, Require as ii, Explained as in, DefineNode as ir, Under as it, Display as j, ProjectionMotion as jn, types_d_exports$6 as jr, PerfChangeEntry as jt, FilterSlotInputs as k, MotionHandle as kn, Root as kr, PerfCause as kt, LoadReason as l, AnyComponentValue as ln, RouteStep as lr, Orientation as lt, Tier as m, Entity as mn, EffectOptions as mr, FrameReadResult as mt, AssetsIo as n, Config$9 as ni, Api$2 as nn, AnyFlow as nr, PoolTrim as nt, DefineBundles as o, types_d_exports$3 as on, FlowState as or, Captured as ot, State as p, ComponentValue as pn, Effect as pr, FrameColumns as pt, sprite as q, contribution as qn, types_d_exports$7 as qr, PerfThermalLine as qt, BundleMap as r, Events$8 as ri, Config$3 as rn, Bookmark as rr, State$2 as rt, Events as s, AnyComponent as sn, JournalEntry as sr, MonitorCounts as st, Api as t, types_d_exports$8 as ti, DEMAND_REASONS as tn, FeatureTree as tr, PixiTexture as tt, LoadResult as u, ComponentHandle as un, SceneIdOf as ur, Point as ut, Config$1 as v, Narrowed as vn, Answer as vr, LongFrameEntry as vt, ScenesApi as w, ChangeHook as wn, types_d_exports$5 as wr, PERF_GAP_BUCKETS as wt, LayerMap as x, SystemDefinition as xn, Config$5 as xr, OverlayEventDetail as xt, DefineScene as y, QueryTerm as yn, Api$4 as yr, MONITOR_SECTIONS as yt, Shape as z, Config$4 as zn, StoreApi as zr, PerfLogLine as zt };
13524
+ export { PixiModule as $, type as $n, State$8 as $r, ShaderWhat as $t, SyncApi as A, MotionHandle as An, Root as Ar, PerfChange as At, ShapeValue as B, Config$4 as Bn, StoreApi as Br, PerfLongFrameLine as Bt, SceneSpec as C, TagType as Cn, FakeClock as Cr, PERF_CAUSES as Ct, DebugSwitches as D, Ease as Dn, Config$6 as Dr, PassKind as Dt, types_d_exports$1 as E, DescriptionNode as En, Api$5 as Er, PROBLEM_RULES as Et, NineSliceValue as F, TrackOptions as Fn, ProviderCall as Fr, PerfEventLine as Ft, Transform as G, State$4 as Gn, Events$6 as Gr, PerfStartupLine as Gt, SpriteBlend as H, GameTypes as Hn, RngState as Hr, PerfMeasured as Ht, Overlay as I, TrackSegment as In, SaveDoc as Ir, PerfEventName as It, AdaptiveScale as J, contribution as Jn, types_d_exports$7 as Jr, PoolTrimDetail as Jt, TransformValue as K, TextStylesOf as Kn, PauseReason as Kr, PerfTelemetryLine as Kt, OverlayValue as L, ViewHandle as Ln, SaveUnreadableError as Lr, PerfGapLine as Lt, HudPart as M, ProjectionMotion as Mn, types_d_exports$6 as Mr, PerfCollectorLine as Mt, HudPartValue as N, ProjectionSpec as Nn, Patch as Nr, PerfCounts as Nt, FilterSlot as O, Motion as On, Events$5 as Or, PassRecord as Ot, NineSlice$1 as P, ReducedMotion as Pn, PlayerStateProvider as Pr, PerfDisplay as Pt, PixiFilter as Q, to as Qn, RateChange as Qr, ShaderEventDetail as Qt, Parent as R, Api$3 as Rn, Snapshot as Rr, PerfHeaderLine as Rt, SceneDefinition as S, SystemFor as Sn, Config$5 as Sr, OverlayWhat as St, State$1 as T, ChangeHook as Tn, types_d_exports$5 as Tr, PERF_LOG_VERSION as Tt, SpriteOptions as U, HudKeysOf as Un, Api$6 as Ur, PerfSampleLine as Ut, Sprite as V, EmitterIdOf as Vn, RngApi as Vr, PerfMarkLine as Vt, SpriteValue as W, Position as Wn, Config$7 as Wr, PerfSpikeLine as Wt, Config$2 as X, exit as Xn, Config$8 as Xr, ProblemRule as Xt, Api$1 as Y, defineFlow as Yn, Api$7 as Yr, ProblemEventDetail as Yt, MonitorConfig as Z, slot as Zn, FrameRate as Zr, SHADER_WHATS as Zt, AnySceneProjection as _, Mut as _n, Hint as _r, FrameRing as _t, Config as a, Require as ai, State$3 as an, DefineNode as ar, types_d_exports$2 as at, Events$1 as b, ResourceType as bn, Api$4 as br, MonitorSections as bt, LoadBundles as c, AnyComponentType as cn, JournalEntry as cr, RenderStats as ct, Manifest as d, ComponentSchema as dn, SceneIdOf as dr, ViewportSize as dt, ThermalReading as ei, WarmDetail as en, FeatureDescription as er, PixiSprite as et, ReadyBundles as f, ComponentType as fn, TypeTag as fr, FilterCache as ft, types_d_exports as g, FrameDiff as gn, GuideOptions as gr, FrameRecord as gt, Usage as h, EntitySnapshot as hn, EffectOptions as hr, FrameReadout as ht, BundleSpec as i, Events$8 as ii, Explained as in, Bookmark as ir, Under as it, Display as j, NumericFields as jn, State$6 as jr, PerfChangeEntry as jt, FilterSlotInputs as k, MotionCause as kn, Json as kr, PerfCause as kt, LoadReason as l, AnyComponentValue as ln, NodeTable as lr, Orientation as lt, Tier as m, Entity as mn, Effect as mr, FrameReadResult as mt, AssetsIo as n, types_d_exports$8 as ni, Api$2 as nn, FeatureTree as nr, PoolTrim as nt, DefineBundles as o, types_d_exports$3 as on, FlowGraph as or, Captured as ot, State as p, ComponentValue as pn, Descriptor as pr, FrameColumns as pt, sprite as q, types_d_exports$4 as qn, State$7 as qr, PerfThermalLine as qt, BundleMap as r, Config$9 as ri, Config$3 as rn, AnyFlow as rr, State$2 as rt, Events as s, AnyComponent as sn, FlowState as sr, MonitorCounts as st, Api as t, Time as ti, DEMAND_REASONS as tn, FeaturePlugin as tr, PixiTexture as tt, LoadResult as u, ComponentHandle as un, RouteStep as ur, Point as ut, Config$1 as v, Narrowed as vn, NodeFx as vr, LongFrameEntry as vt, ScenesApi as w, AnchorTarget as wn, State$5 as wr, PERF_GAP_BUCKETS as wt, LayerMap as x, SystemDefinition as xn, ClockSource as xr, OverlayEventDetail as xt, DefineScene as y, QueryTerm as yn, Answer as yr, MONITOR_SECTIONS as yt, Shape as z, BundlesOf as zn, SnapshotOf as zr, PerfLogLine as zt };
@@ -1,4 +1,4 @@
1
- import { An as NumericFields, Cn as TagType, Dn as Motion, En as Ease, In as ViewHandle, Jr as Api, K as TransformValue, Ln as Api$1, Nn as ReducedMotion, On as MotionCause, Or as Json, Y as Api$3, cn as AnyComponentType, dt as ViewportSize, fn as ComponentType, fr as Descriptor, gr as Hint, ii as Require, jn as ProjectionMotion, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, nn as Api$2, s as Events$1, sn as AnyComponent, t as Api$4, vr as Answer, wn as ChangeHook, yr as Api$5 } from "./types-Bc_re3rB.mjs";
1
+ import { An as MotionHandle, Cn as TagType, Dn as Ease, K as TransformValue, Ln as ViewHandle, Mn as ProjectionMotion, On as Motion, Pn as ReducedMotion, Rn as Api$1, Tn as ChangeHook, Y as Api$3, Yr as Api, _r as Hint, ai as Require, br as Api$5, cn as AnyComponentType, dt as ViewportSize, fn as ComponentType, jn as NumericFields, kn as MotionCause, kr as Json, ln as AnyComponentValue, mn as Entity, nn as Api$2, pr as Descriptor, s as Events$1, sn as AnyComponent, t as Api$4, wn as AnchorTarget, yr as Answer } from "./types-D0uITVZD.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";
@@ -2209,7 +2209,35 @@ type InputProps = CommonProps & {
2209
2209
  textStyle?: InputTextStyle;
2210
2210
  };
2211
2211
  /**
2212
- * The thirteen tags a screen is written with.
2212
+ * What an anchor sits on: one view or element by its projection and key, or a list of them, whose
2213
+ * shown ones it spans.
2214
+ */
2215
+ type AnchorTo = (AnchorTarget | readonly AnchorTarget[]) & Brand<"AnchorTo">;
2216
+ /** How far an anchor reaches past its targets on each side, in its root's units; 0 by default. */
2217
+ type AnchorPad = number & Brand<"AnchorPad">;
2218
+ /**
2219
+ * What an anchor takes: the common props, `to` and `pad`. Its rect is the drawn rect of its
2220
+ * targets, padded, in the frame they are laid out, and its children lay out inside it; its style
2221
+ * gives its look, and a `width`, `height` or `position` there is ignored (`ui:anchor-style`, dev
2222
+ * builds). While no target is shown it is not drawn and takes no tap. Its `change.Box` motion plays
2223
+ * only when its targets change: a new `to`, or keys that name other entities.
2224
+ *
2225
+ * @example
2226
+ * ```tsx
2227
+ * // The tutorial's window sits on the first seat of the board's order strip, 4 u outside it.
2228
+ * <anchor key="window" to={{ projection: "board.strip", key: "seat0" }} pad={4}>
2229
+ * <stack key="rim" style={{ nineSlice: "tutorial.rim", hollow: true, width: "100%", height: "100%" }} />
2230
+ * </anchor>;
2231
+ * // the seat is drawn at { x: 40, y: 1500, w: 116, h: 120 }
2232
+ * app.ui.rectOf({ projection: "tutorial", key: "window" }); // { x: 36, y: 1496, w: 124, h: 128 }
2233
+ * ```
2234
+ */
2235
+ type AnchorProps = CommonProps & {
2236
+ to: AnchorTo;
2237
+ pad?: AnchorPad;
2238
+ };
2239
+ /**
2240
+ * The fourteen tags a screen is written with.
2213
2241
  *
2214
2242
  * @example
2215
2243
  * ```ts
@@ -2230,6 +2258,7 @@ type UiIntrinsicElements = {
2230
2258
  button: ButtonTagProps;
2231
2259
  scroll: ScrollProps;
2232
2260
  input: InputProps;
2261
+ anchor: AnchorProps;
2233
2262
  };
2234
2263
  /**
2235
2264
  * The props of one tag with its `style` narrowed to the asset keys of one game, so a nine-slice
@@ -2847,6 +2876,11 @@ type Root = {
2847
2876
  * as their enters play next. Absent on every other root.
2848
2877
  */
2849
2878
  still?: true;
2879
+ /**
2880
+ * The solve of this root built aside waited for the next frame once, its frame's budget spent (F61): the next solve
2881
+ * runs whatever the budget. Deleted at the solve, never written as `undefined`.
2882
+ */
2883
+ solveWaited?: true;
2850
2884
  };
2851
2885
  /**
2852
2886
  * Where the focus ring was last drawn: the layer and order of its root, the rect grown by the
@@ -3032,7 +3066,78 @@ type JsxState = {
3032
3066
  * How many roots carry `aside`, as the last reconcile counted them: 0 while no scene is built
3033
3067
  * aside and no window is held warm.
3034
3068
  */
3035
- asideRoots: number;
3069
+ asideRoots: number; /** Every `<anchor>` from its enter to its despawn, with what the anchor pass keeps for it. */
3070
+ anchors: Map<Entity, Anchor>;
3071
+ };
3072
+ /**
3073
+ * What the anchor pass keeps for one `<anchor>` from frame to frame, every object written in place.
3074
+ * `node` is the description `to` and `pad` were last read from; `to` the targets read from it
3075
+ * (`undefined` for a prop that names none);
3076
+ * `retarget` is true from a render that gave another `to` until the anchor is next shown. `seen`
3077
+ * holds the entities the keys resolved to in this frame (0 for none, `count` of them), `shown` the
3078
+ * ones of the last frame the anchor was shown (`shownCount` of them). `screen` is the union of the
3079
+ * shown targets in screen reference units, `part` one target's rect, `next` the anchor's rect in
3080
+ * root coordinates and `pose` the root pose the resolver writes. `placed` turns true at the first
3081
+ * application of the anchor and its subtree; `hidden` is true while no target is shown; `missing`
3082
+ * counts the frames in a row a key resolved to no entity. `owed` is true while the
3083
+ * `Transform` waits for a motion to end before it takes the rest pose; `stale` while the world's
3084
+ * rest pose lags the element's; `boxes` while the `Box` of the anchor and its subtree lags their
3085
+ * rects, written once it stands. `held` lets go of the anchor's `x` and `y`, which a follow holds
3086
+ * from a loop until the anchor stands. While a motion that ends plays, `aim` is the position it lands on,
3087
+ * `track` the position it last wrote and `wrote` the position the pass wrote over it: the motion is
3088
+ * carried by how far the targets moved since it began.
3089
+ */
3090
+ type Anchor = {
3091
+ node: DescriptionNode | undefined;
3092
+ to: AnchorTarget | readonly AnchorTarget[] | undefined;
3093
+ retarget: boolean;
3094
+ seen: Entity[];
3095
+ shown: Entity[];
3096
+ count: number;
3097
+ shownCount: number;
3098
+ screen: {
3099
+ x: number;
3100
+ y: number;
3101
+ w: number;
3102
+ h: number;
3103
+ };
3104
+ part: {
3105
+ x: number;
3106
+ y: number;
3107
+ w: number;
3108
+ h: number;
3109
+ };
3110
+ next: {
3111
+ x: number;
3112
+ y: number;
3113
+ w: number;
3114
+ h: number;
3115
+ };
3116
+ pose: TransformValue;
3117
+ placed: boolean;
3118
+ hidden: boolean;
3119
+ missing: number;
3120
+ owed: boolean;
3121
+ stale: boolean;
3122
+ boxes: boolean;
3123
+ held: (() => void) | undefined;
3124
+ aim: {
3125
+ x: number;
3126
+ y: number;
3127
+ };
3128
+ track: {
3129
+ x: number;
3130
+ y: number;
3131
+ };
3132
+ wrote: {
3133
+ x: number;
3134
+ y: number;
3135
+ }; /** The one-time logs written for it: a missing target, its own child, an ignored style. */
3136
+ warned: {
3137
+ missing: boolean;
3138
+ own: boolean;
3139
+ style: boolean;
3140
+ };
3036
3141
  };
3037
3142
  /**
3038
3143
  * One node of the snapshot `tree()` answers with. `rect` is natural: under a `fit` ancestor it
@@ -1,9 +1,9 @@
1
- import { Hr as Api$3, Tr as Api$2, Y as Api, nn as Api$1, yr as Api$4 } from "./types-Bc_re3rB.mjs";
2
- import { P as AnimApi, r as UiApi } from "./types-D4Q5MH_l.mjs";
3
- import { N as InputApi } from "./types-CiSVMR89.mjs";
4
- import { r as Repro } from "./headless-DcJCzBkz.mjs";
5
- import { a as InputOf, r as ControlApp } from "./types-RX1bYaqD.mjs";
6
- import { t as commands } from "./commands-C2-V2uKy.mjs";
1
+ import { Er as Api$2, Ur as Api$3, Y as Api, br as Api$4, nn as Api$1 } from "./types-D0uITVZD.mjs";
2
+ import { P as AnimApi, r as UiApi } from "./types-65BDgeC1.mjs";
3
+ import { N as InputApi } from "./types-kKYSP3h-.mjs";
4
+ import { r as Repro } from "./headless-DEvO-OYZ.mjs";
5
+ import { a as InputOf, r as ControlApp } from "./types-AIu9QkEJ.mjs";
6
+ import { t as commands } from "./commands-iR813FBY.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. */
@@ -1135,6 +1135,8 @@ function uiFor() {
1135
1135
  */
1136
1136
  /** The tag of the one child a scroll container holds: everything inside it moves as one. */
1137
1137
  const CONTENT = "content";
1138
+ /** The tag whose rect is where its targets are drawn: the anchor pass places it, not the solve. */
1139
+ const ANCHOR = "anchor";
1138
1140
  /** The three ways a sized sprite fills its box, as the `fit` prop of `image` and `icon` names them. */
1139
1141
  const FITS = [
1140
1142
  "contain",
@@ -1145,7 +1147,7 @@ const FITS = [
1145
1147
  * Tells whether a tag draws nothing of its own, so its `Shape` is invisible unless its style fills.
1146
1148
  *
1147
1149
  * @param type - The intrinsic tag.
1148
- * @returns True for the six container tags and the content of a scroll.
1150
+ * @returns True for the seven container tags and the content of a scroll.
1149
1151
  * @example
1150
1152
  * ```ts
1151
1153
  * isContainer("row"); // true
@@ -1159,6 +1161,7 @@ function isContainer(type) {
1159
1161
  "column",
1160
1162
  "stack",
1161
1163
  "spacer",
1164
+ ANCHOR,
1162
1165
  CONTENT
1163
1166
  ].includes(type);
1164
1167
  }
@@ -1441,4 +1444,4 @@ function drawnRect(pose, local) {
1441
1444
  };
1442
1445
  }
1443
1446
  //#endregion
1444
- export { component as $, localPoseOf as A, OverlayLevel as B, builtInStyles as C, textFor as D, readStyle as E, rootPoseOf as F, arcDefaults as G, Shape as H, Display as I, Exiting as J, componentsFor as K, HudPart as L, poseUnder as M, rootPointOf as N, applyPose as O, rootPoseInto as P, Tree as Q, NineSlice as R, bind as S, label as T, Sprite as U, Parent as V, Transform as W, Now as X, Layer as Y, Order as Z, uiFor as _, visualOf as a, Countdown as b, Covered as c, LocalWrite as d, mut as et, Scroll as f, popup as g, UiCounters as h, samePose as i, tag as it, parentOf as j, isLeaving as k, DebugTrigger as l, UI_OWNER as m, drawnRect as n, system as nt, visualRectOf as o, ScrollState as p, sprite as q, fitScaleOf as r, systemsFor as rt, Box as s, CONTENT as t, resource as tt, Escapable as u, defineTokens as v, defineTextStyles as w, Text as x, defineStyle as y, Overlay as z };
1447
+ export { Tree as $, isLeaving as A, Overlay as B, bind as C, readStyle as D, label as E, rootPoseInto as F, Transform as G, Parent as H, rootPoseOf as I, sprite as J, arcDefaults as K, Display as L, parentOf as M, poseUnder as N, textFor as O, rootPointOf as P, Order as Q, HudPart as R, Text as S, defineTextStyles as T, Shape as U, OverlayLevel as V, Sprite as W, Layer as X, Exiting as Y, Now as Z, popup as _, samePose as a, tag as at, defineStyle as b, Box as c, Escapable as d, component as et, LocalWrite as f, UiCounters as g, UI_OWNER as h, fitScaleOf as i, systemsFor as it, localPoseOf as j, applyPose as k, Covered as l, ScrollState as m, CONTENT as n, resource as nt, visualOf as o, Scroll as p, componentsFor as q, drawnRect as r, system as rt, visualRectOf as s, ANCHOR as t, mut as tt, DebugTrigger as u, uiFor as v, builtInStyles as w, Countdown as x, defineTokens as y, NineSlice as z };
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-wSjsCu_W.mjs";
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-BeJuimAt.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
1
  import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
2
- import { n as read, t as sources } from "./sources-MfRpM8sV.mjs";
2
+ import { n as read, t as sources } from "./sources-Cjrzga6S.mjs";
3
3
  import { n as commands, t as run } from "./run-8s7kh2QD.mjs";
4
4
  import path from "node:path";
5
5
  import { createBrandConsole } from "@moku-labs/common/cli";
package/llms.txt CHANGED
@@ -561,7 +561,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
561
561
 
562
562
  A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` sets `"jsx": "react-jsx"` and `"jsxImportSource": "@moku-labs/game"`; screens are `.tsx` files. There is no DOM and no React.
563
563
 
564
- - Tags: `screen`, `layer`, `row`, `column`, `stack`, `spacer`, `panel` (swallows taps), `image` (`texture`, `fit?: "contain" | "cover" | "fill"`), `icon` (`name`, `fit?`), `text` (`content: string | Message`, or `bind={bind(Counter, "value")}` with `components={[Counter({ value })]}`; formats `int`, `mm:ss`, `h:mm:ss`, `duration`; `Countdown({ until })` with `bind(Countdown, "left", { format: "mm:ss" })` counts down to a `clock` moment; `style` is a text style key), `button` (`intent` + `payload`, or `local`, never both), `scroll` (`axis?: "x" | "y"` (`"y"`), fixed at spawn, another one later warns `ui:scroll-axis-fixed`; children for a short list, laid out as a column on `y` and a row on `x`, or the windowed form `rows`, `rowHeight`, `overscan?` (5), `row: index => node`, on `y` only: `axis: "x"` with `rows` throws `[game] A windowed scroll moves on y only.`; row state belongs in the model, a row that leaves the window loses its local state; `snap?: number[]` stops in offsets, kept inside `0..max`: a release glides to the stop nearest `offset + v × 260` (v in units a ms) on `1 − (1 − p)³` over `min(620, 260 + distance × 1.1)` ms; without `snap` a release flings, `v ×= 0.998` a ms until under 0.02, 0 when the finger rested over 50 ms; `offset?: number` (0) where it stands from the start, drawn there in its first frame, a new value glides there, the same value does nothing; hard edges, nothing passes on to a parent scroll; a press on a child that leaves the tap slop along the scroll's axis goes to the scroll and the child answers nothing, a finger on a moving scroll only stops it; every number in `time.delta` ms, so a time scale applies; the public component `ScrollState { offset, max, moving }` on its entity, whole units `0..max`, written when it changes and once with `moving: false` when it stops, read by a system and by `game.explain`; `app.ui.scroll(key, to)` and the visual step `{ scroll: { key, to } }` set it at once), `input` (a text field; its text lives in the component's `local`, see the ui README). Common props: `key`, `style`, `state: { active?, disabled?, selected? }`, `motion`, `components` (extra component values for the element's entity, such as a filter: `components={[Glow({ strength: 2 })]}`, or `DebugTrigger()`: five taps within 3000 ms of wall time on that view call `app.debug.overlay.open()` on a page with the agent flag, nothing elsewhere; put it on a `button` naming nothing); containers take `hosts?: string[]` (projections drawn inside the element: world views hang under it from the slot's first frame; a JSX projection is laid out in the slot's content box). Children draw and are hit in markup order at equal `zIndex`; the roots of a scene draw in the order of its `projections` (the `ui` layer sorts by `Order`; `ui: { sort: "none" }` keeps insertion order). `defineMotion({ when: "change" })` plays its `enter` and `exit` only for a commit or a popup, never when its screen mounts or unmounts; declare a motion at module level (`ui:motion-rebuilt` names a loop rebuilt in a view). `motion.change` plays `Box` (the rects), `Transform` (the rest poses), the visual the element is drawn with (`Shape`, `Sprite`, `NineSlice`, `Text`, when a render or a restyle moves a number of it: `sweep`, `alpha`, `w`; a returned motion brings the numbers home from where they stand and the other fields land at once; the last motion of that name is cancelled first) and each extra of `components`, each as `(view, previous, next, hint)`; a dev build names any other `change` hook once, `ui:change-never-plays` `{ key, name }`. An element a render replaces (a root whose view returns another key or tag, a child of another key or tag) plays its exit with `"change"`, everything under it plays its own, and it leaves `find` at once, so the new element takes the keys they share. Style adds `nineSlice`, `tint`, `offsetX`, `offsetY`, `scale`, `origin`, `fit: "contain"`; state variants `is: { hover, pressed, disabled, active, selected, covered }`. `popup(Component, props, { over })` stacks a popup over a kept one.
564
+ - Tags: `screen`, `layer`, `row`, `column`, `stack`, `spacer`, `panel` (swallows taps), `image` (`texture`, `fit?: "contain" | "cover" | "fill"`), `icon` (`name`, `fit?`), `text` (`content: string | Message`, or `bind={bind(Counter, "value")}` with `components={[Counter({ value })]}`; formats `int`, `mm:ss`, `h:mm:ss`, `duration`; `Countdown({ until })` with `bind(Countdown, "left", { format: "mm:ss" })` counts down to a `clock` moment; `style` is a text style key), `button` (`intent` + `payload`, or `local`, never both), `scroll` (`axis?: "x" | "y"` (`"y"`), fixed at spawn, another one later warns `ui:scroll-axis-fixed`; children for a short list, laid out as a column on `y` and a row on `x`, or the windowed form `rows`, `rowHeight`, `overscan?` (5), `row: index => node`, on `y` only: `axis: "x"` with `rows` throws `[game] A windowed scroll moves on y only.`; row state belongs in the model, a row that leaves the window loses its local state; `snap?: number[]` stops in offsets, kept inside `0..max`: a release glides to the stop nearest `offset + v × 260` (v in units a ms) on `1 − (1 − p)³` over `min(620, 260 + distance × 1.1)` ms; without `snap` a release flings, `v ×= 0.998` a ms until under 0.02, 0 when the finger rested over 50 ms; `offset?: number` (0) where it stands from the start, drawn there in its first frame, a new value glides there, the same value does nothing; hard edges, nothing passes on to a parent scroll; a press on a child that leaves the tap slop along the scroll's axis goes to the scroll and the child answers nothing, a finger on a moving scroll only stops it; every number in `time.delta` ms, so a time scale applies; the public component `ScrollState { offset, max, moving }` on its entity, whole units `0..max`, written when it changes and once with `moving: false` when it stops, read by a system and by `game.explain`; `app.ui.scroll(key, to)` and the visual step `{ scroll: { key, to } }` set it at once), `input` (a text field; its text lives in the component's `local`, see the ui README), `anchor` (`to: AnchorTarget | AnchorTarget[]`, `AnchorTarget` = `{ projection, key }`, a ui element keyed under its root's projection; `pad?: number` (0) outward in its root's units: its rect is where its targets are drawn, the union of the shown ones, in the frame they are laid out, scrolled or moved, through fits, slots and ancestor motion, rotation left out; children lay out inside it; a `width`/`height`/`position` in its style is ignored (`ui:anchor-style`, dev); with no target shown it is drawn at alpha 0 and takes no tap, stays, and comes back with its target; `ui:anchor-target-missing` `{ key, to }` once (dev) after a key named nothing two frames in a row; a target inside the anchor is refused, `[game] An anchor cannot point at its own child "key".`; its `change.Box` motion plays only when its targets change (a new `to`, a key naming another entity), never on a follow, and a glide that runs is carried so it lands on the moving target; 0 B a frame still or following: `<anchor key="window" to={{ projection: "board.strip", key: "seat0" }} pad={4} motion={glide}>`). Common props: `key`, `style`, `state: { active?, disabled?, selected? }`, `motion`, `components` (extra component values for the element's entity, such as a filter: `components={[Glow({ strength: 2 })]}`, or `DebugTrigger()`: five taps within 3000 ms of wall time on that view call `app.debug.overlay.open()` on a page with the agent flag, nothing elsewhere; put it on a `button` naming nothing); containers take `hosts?: string[]` (projections drawn inside the element: world views hang under it from the slot's first frame; a JSX projection is laid out in the slot's content box). Children draw and are hit in markup order at equal `zIndex`; the roots of a scene draw in the order of its `projections` (the `ui` layer sorts by `Order`; `ui: { sort: "none" }` keeps insertion order). `defineMotion({ when: "change" })` plays its `enter` and `exit` only for a commit or a popup, never when its screen mounts or unmounts; declare a motion at module level (`ui:motion-rebuilt` names a loop rebuilt in a view). `motion.change` plays `Box` (the rects), `Transform` (the rest poses), the visual the element is drawn with (`Shape`, `Sprite`, `NineSlice`, `Text`, when a render or a restyle moves a number of it: `sweep`, `alpha`, `w`; a returned motion brings the numbers home from where they stand and the other fields land at once; the last motion of that name is cancelled first) and each extra of `components`, each as `(view, previous, next, hint)`; a dev build names any other `change` hook once, `ui:change-never-plays` `{ key, name }`. An element a render replaces (a root whose view returns another key or tag, a child of another key or tag) plays its exit with `"change"`, everything under it plays its own, and it leaves `find` at once, so the new element takes the keys they share. Style adds `nineSlice`, `tint`, `offsetX`, `offsetY`, `scale`, `origin`, `fit: "contain"`; state variants `is: { hover, pressed, disabled, active, selected, covered }`. `popup(Component, props, { over })` stacks a popup over a kept one.
565
565
  - Style vocabulary (`defineStyle`, plain data): flow `direction`, `wrap`, `justify`, `align`, `alignSelf`, `gap`, `grow`, `shrink`; box `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `aspect`, `overflow`; position `position`, `left`, `top`, `right`, `bottom`, `reason`; visual `fill`, `stroke`, `strokeWidth`, `radius`, `alpha`, `shape: "rect" | "triangle" | "arc"` (`"rect"`; a triangle fills the box pointing right; an arc is only a `stroke` of `strokeWidth` on the circle inscribed in the box, `min(width, height) − strokeWidth` across, from 12 o'clock clockwise over `sweep`), `dash` (dash length of the stroke, gaps of half a dash; not on an arc), `sweep` (0..1, default 1, clamped; 0 draws nothing, 1 a closed ring), `cap: "round" | "butt"` (`"round"`; the ends of an open arc); variants `is: { pressed?, disabled?, active?, selected? }` and `when: { portrait?, landscape?, tall?, wide? }`, each a partial style merged in when the flag holds. Lengths are reference units or `"safeArea.top" | "safeArea.right" | "safeArea.bottom" | "safeArea.left"`. No font size here: it comes from the text style.
566
566
  - `defineComponent(name, { local?, outcomes?, view(props, local) })`. A component with `outcomes` is a popup: `await fx(popup(Component, props))` opens the gate for its outcomes and resolves with `{ intent, payload }` of the pressed button. A button with `local` writes into the nearest component instance; it never reaches the graph.
567
567
  - `tr(key, params?)` returns a frozen `Message` `{ key, params }`; no locale is read at the call site. Strings live in `strings/<locale>.json` of any feature or sub-feature, as ICU MessageFormat 1 (`{n, plural, one {# order} other {# orders}}`, `select`, `selectordinal`, `number`, `date`, `time`; no skeletons, no `currency`). `bun run assets:keys` compiles them. The keys of the top-level features and the layers go into `generated/strings.<locale>.ts`, which one feature registers; a sub-feature's keys start with `<name>.` (`ep01.title`) and go into `generated/strings.<name>.<locale>.ts`, which the sub-feature registers lazily, `strings: { en: () => import("@generated/strings.ep01.en"), ru: () => import("@generated/strings.ep01.ru") }`. With `assets` composed those modules load and unload with the bundle named like the sub-feature: every way the bundle comes (a node entry, a scene's `bundles`, `load`, a restore, the `safeNode`) brings its strings, a locale switch brings them in the new locale, and while the bundle is not loaded a key of it gives `⟦key⟧` and `has(key)` is false. A compiled module calls the root helpers `messageArgument(value, intl)` (an element stays an element part, a list goes through `Intl.ListFormat`, a number through `Intl.NumberFormat`, else text) and `messageDuration(ms)` (`95_000` gives `{ minutes: 1, seconds: 35 }`). `app.i18n`: `locale()`, `setLocale(locale)` (async, emits `i18n:locale-changed`), `format(message, locale?)` returns `Part[]`, `plain(message)` returns a string, `has(key)`, `isKey(value)`, `locales()`, `replace(locale, messages)` (dev hot swap of a generated strings file). Config: `locale: "en"`, `fallback: "en"`, `locales: {}`.
@@ -570,7 +570,7 @@ A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` se
570
570
  - Animation is data: `defineAnimation(id, { slots: { name: type<Anim.Target>() }, build: (slots, { at }) => Step })`. Steps: `sequence(...)`, `parallel(...)`, `stagger(items, ms, item => Step)`, `tween(target, Component, to, { ms, ease?, delayMs?, additive?, space?, reduced? })`, `set(target, Component, patch)`, `wait(ms)`, `mark(name)`, `frames(target, { keys, fps, loop? })`, `sfx(key, { bus? })`, `haptic(kind)`, `use(animation, slots, tools?)`, `spawn` (a temporary entity, flying coins, that the timeline despawns when it ends; see the anim README). `Frames({ keys, fps, loop, playing })` is a component that walks a sprite through its textures for the entity's whole life. A target is `{ projection, key }` or an entity. A timeline resolves each `{ projection, key }` target once, when it starts: every step writes the view that held the key then, also after a commit removed it and while its exit plays, until it despawns; a view spawned again under the same key is not followed, and a key nothing held at the start is looked up at its step. `reduced: "keep"` (on a `tween` step, `transition` and `loop` of `defineMotion`, `TweenOptions`, `RestOptions`) plays a track as written under reduced motion, a fade for one; the default `"cut"` lands it at once or holds a loop on its first key. A node plays it with `await fx(play(animation, slots))`; in fast mode it finishes at once. `defineMotion({ states, transition?, on: { enter?, exit?, change? }, when? })` builds the enter, exit and change hooks for a projection or the `motion` prop of a tag; `when: "change"` plays enter and exit only for a commit, so an element that comes or goes with its screen stands at rest and leaves without a motion (default `"always"`). Events `anim:mark` `{ animation, mark }` and `anim:finished` `{ animation }`. `app.anim.replace(definition)` is the dev hot swap: the next `play` builds the new tree. A system cannot `require` a plugin, so it plays through the resource `AnimPlayer`: `res(AnimPlayer).play(animation, slots)` returns the same handle as `app.anim.play`, and the registered animation of `animation.id` wins, so a hot swap reaches the system. Play on a change, never every frame; from phase `input` the tree moves in `animate` of the same frame. Before `anim` starts it throws `[game] AnimPlayer is not ready: anim has not started.` Config `maxTracks: 2000`.
571
571
  - A `tween` step takes `segments` and `repeat` as `ViewHandle.tween` does: `tween(chest, Transform, { y: 0, scale: 0 }, { ms: 2400, additive: true, repeat: "forever", segments: [{ at: 0.08, ease: "out", to: { y: -14, scale: 0.06 } }, { at: 1, to: { y: 0, scale: 0 } }] })`. Segments walk over `ms` on one clock, `to` is where the last one ends, an additive walk names offsets; a number counts the extra runs. A definition error throws for empty segments, an `at` outside 0..1 or out of order, a last segment before 1, a bad repeat, and a `sequence` step after one that never ends. A forever step ends only by cancel or finish (a finish and a fast world land it on its start pose), does not play under reduced motion `"cut"`, writes nothing while its view is unseen, and lets the clock idle; a system plays it once through `AnimPlayer` and keeps the handle.
572
572
  - Audio is opt-in: `plugins: [...screen, audioPlugin]`. `fx(sfx("orders.complete"))` resolves when the sound started. `await fx(music("board.theme"))` cross-fades; `music(null)` fades out; a scene's `music` key switches the track on `scenes:changed`. Buses `master`, `music`, `sfx`. Volumes come from the committed player: config `volumes: player => (player as Player).settings.audio`, applied on every `model:committed`. `app.audio`: `setVolume(bus, value)`, `volume(bus)`, `mute(bus, on)`, `muted(bus)`, `unlocked()`, `journal()` (the last started sounds, empty unless config `journal` is above 0). Config: `buses: { master: 1, music: 0.6, sfx: 1 }`, `musicFadeMs: 600`, `volumes`, `context`, `journal: 0`, `music: "decode" | "stream"` default `"decode"` (gapless buffer; `"stream"` is an `<audio>` element, less memory, a gap at every loop), `session: "ambient" | "playback" | "auto"` default `"ambient"` (iOS only: ambient mixes with other apps and obeys the silent switch). The context is asked to run at start: where the shell lets audio play (a native webview with the gesture requirement off) `unlocked()` is true with no touch; a browser that wants a gesture unlocks on the first `pointerdown` or `touchend`. Without `audio` every `sfx` and `music` effect resolves `undefined` at once, so the same node runs in a game with no sound. Named sounds: `sfx(key, { bus?, id?, fadeMs? })` with an `id` plays through its own gain, and the next sound with the same `id` fades the old one out over `fadeMs`, else config `sfxFadeMs` (default `120`, real milliseconds); `fx.start(stopSfx(id, { fadeMs? }))` and `app.audio.stop(id, { fadeMs? })` fade it out and end it (`fadeMs: 0` cuts it); an `id` nothing plays under changes nothing, and a sound of that `id` still decoding never starts. Without `id` an `sfx` plays to its end as before.
573
- - `app.ui`: `tree()` the live screen as plain data (a text node carries `content`, the words it draws after `tr()` and `bind`; a text field carries `value`), `find(key)` the entity of a keyed element, `fill(key, value)` types into the text field with that `key`, `scroll(key, to)` puts the `scroll` with that `key` at `to` from its start at once, inside `0..max`, its fling or glide stopped (`false` and `ui:scroll-without-scroll` for no live `scroll`, `false` and `ui:scroll-before-solve` for a `scroll` its first solve has not placed yet), `lint()` tap targets under `tapTargetPt` (default `44`), text that overflows in some locale, absolute elements without `reason`. Config: `tapTargetPt: 44`, `breakpoints: { tall: 2, wide: 1.5 }`. `ui` emits only the dev global event `ui:hot-swap`, see "Hot swap".
573
+ - `app.ui`: `tree()` the live screen as plain data (a text node carries `content`, the words it draws after `tr()` and `bind`; a text field carries `value`), `find(key)` the entity of a keyed element, `fill(key, value)` types into the text field with that `key`, `scroll(key, to)` puts the `scroll` with that `key` at `to` from its start at once, inside `0..max`, its fling or glide stopped (`false` and `ui:scroll-without-scroll` for no live `scroll`, `false` and `ui:scroll-before-solve` for a `scroll` its first solve has not placed yet), `rectOf(target)` where an `AnchorTarget` (or the shown ones of a list) is drawn, in screen reference units, the rect an `<anchor>` sits on, `undefined` when none is shown, any build, a new object per call (`app.ui.rectOf({ projection: "board.strip", key: "seat0" })` → `{ x: 40, y: 1500, w: 116, h: 120 }`), `lint()` tap targets under `tapTargetPt` (default `44`), text that overflows in some locale, absolute elements without `reason`. Config: `tapTargetPt: 44`, `breakpoints: { tall: 2, wide: 1.5 }`. `ui` emits only the dev global event `ui:hot-swap`, see "Hot swap".
574
574
 
575
575
  ```tsx
576
576
  // features/hud/view.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.47",
3
+ "version": "0.15.49",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [