@moku-labs/game 0.15.9 → 0.15.11

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-5woFUxUr.d.mts → commands-C3yVtCg1.d.mts} +5 -5
  8. package/dist/control.d.mts +4 -4
  9. package/dist/{define-B8A5IoeS.d.mts → define-DbxBzO-G.d.mts} +2 -2
  10. package/dist/{headless-CrxofjLt.d.mts → headless-DHtavbqk.d.mts} +1 -1
  11. package/dist/{index-DT9aYVGd.d.mts → index-CsTMiO0x.d.mts} +3 -3
  12. package/dist/index.d.mts +4 -4
  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-BZQQPq56.d.mts → runtime-Bxy2zoCG.d.mts} +1 -1
  19. package/dist/{sources-QCowxSpC.mjs → sources-CJgUypyC.mjs} +1 -1
  20. package/dist/{src-Cs1bP3v7.mjs → src-0m2mjRDI.mjs} +231 -55
  21. package/dist/testing.d.mts +4 -4
  22. package/dist/testing.mjs +1 -1
  23. package/dist/{types-DDmfkONF.d.mts → types-CpBnGqDU.d.mts} +3 -3
  24. package/dist/{types-i77Nrrv-.d.mts → types-CuEK0Vam.d.mts} +3733 -3719
  25. package/dist/{types-DK-IYk-s.d.mts → types-CveBhKTs.d.mts} +4 -4
  26. package/dist/{types-D8roM1u3.d.mts → types-D5Pmo8BD.d.mts} +5 -3
  27. package/dist/{types-YXykgTOp.d.mts → types-_a6-ALzz.d.mts} +2 -2
  28. package/dist/{visual-1doiBOD3.d.mts → visual-B5Sypqal.d.mts} +6 -6
  29. package/dist/{visual-CIUx49C0.mjs → visual-Dwfy9wDb.mjs} +6 -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 { A as PixiModule, Ar as SaveDoc, Cr as Json, D as Config$2, Fn as Config$1, Nr as SnapshotOf, Or as PlayerStateProvider, Yn as FeaturePlugin, Zn as AnyFlow, _r as FakeClock, a as Config$3, d as Manifest, hr as ClockSource, jt as Orientation, kr as ProviderCall, n as AssetsIo, or as TypeTag, xr as Config } from "./types-i77Nrrv-.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-DDmfkONF.mjs";
3
- import { H as StringTable, L as I18nApi, U as TextKey } from "./types-D8roM1u3.mjs";
4
- import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-DT9aYVGd.mjs";
1
+ import { Ar as ProviderCall, In as Config$1, Pr as SnapshotOf, Qn as AnyFlow, Sr as Config, X as PixiModule, Xn as FeaturePlugin, a as Config$3, d as Manifest, gr as ClockSource, jr as SaveDoc, kr as PlayerStateProvider, n as AssetsIo, ot as Orientation, q as Config$2, sr as TypeTag, vr as FakeClock, wr as Json } from "./types-CuEK0Vam.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-CpBnGqDU.mjs";
3
+ import { H as StringTable, L as I18nApi, U as TextKey } from "./types-D5Pmo8BD.mjs";
4
+ import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-CsTMiO0x.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -1,4 +1,4 @@
1
- import { $r as Require, Cn as Motion, Cr as Json, Dn as ProjectionMotion, E as Api$3, En as NumericFields, Mn as ViewHandle, Nn as Api$1, Nt as ViewportSize, Qt as Api$2, Tn as MotionHandle, Ur as Api, Yt as TransformValue, an as AnyComponentValue, bn as ChangeHook, cn as ComponentType, dr as Hint, in as AnyComponentType, mr as Api$5, pr as Answer, rn as AnyComponent, s as Events$1, sr as Descriptor, t as Api$4, un as Entity, wn as MotionCause, yn as TagType } from "./types-i77Nrrv-.mjs";
1
+ import { $t as Api$2, Dn as NumericFields, En as MotionHandle, K as Api$3, Nn as ViewHandle, On as ProjectionMotion, Pn as Api$1, Tn as MotionCause, U as TransformValue, Wr as Api, an as AnyComponentType, bn as TagType, cr as Descriptor, ct as ViewportSize, dn as Entity, ei as Require, fr as Hint, hr as Api$5, in as AnyComponent, ln as ComponentType, mr as Answer, on as AnyComponentValue, s as Events$1, t as Api$4, wn as Motion, wr as Json, xn as ChangeHook } from "./types-CuEK0Vam.mjs";
2
2
  import { Log } from "@moku-labs/common/browser";
3
3
  import { PluginCtx } from "@moku-labs/core";
4
4
 
@@ -2541,7 +2541,8 @@ type StyleBasis = {
2541
2541
  * `cause` is why the element appeared: `"mount"` when it came with the first build of its root and
2542
2542
  * the root came by a mount, `"change"` otherwise; its `enter` hook is told. `rebuilds` counts the
2543
2543
  * patches in a row that brought a loop of another reference that is not really another loop: a
2544
- * dev build names the element once it reaches three.
2544
+ * dev build names the element once it reaches three. `endless` holds the motions a hook returned
2545
+ * after it started a track that repeats forever: they never end, so no exit waits for them (F42).
2545
2546
  */
2546
2547
  type Element = {
2547
2548
  entity: Entity;
@@ -2591,7 +2592,8 @@ type Element = {
2591
2592
  width: number;
2592
2593
  height: number;
2593
2594
  };
2594
- basis?: StyleBasis;
2595
+ basis?: StyleBasis; /** The motions of its hooks that started a `repeat: "forever"` track; made with the first one. */
2596
+ endless?: Set<MotionHandle>;
2595
2597
  };
2596
2598
  /**
2597
2599
  * The popup side of a root: the handler that shows it now and the root it was opened over.
@@ -1,5 +1,5 @@
1
- import { Cr as Json, Mr as Snapshot } from "./types-i77Nrrv-.mjs";
2
- import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
1
+ import { Nr as Snapshot, wr as Json } from "./types-CuEK0Vam.mjs";
2
+ import { t as HeadlessApp } from "./headless-DHtavbqk.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts
@@ -1,9 +1,9 @@
1
- import { E as Api, Lr as Api$3, Qt as Api$1, br as Api$2 } from "./types-i77Nrrv-.mjs";
2
- import { P as AnimApi, r as UiApi } from "./types-DDmfkONF.mjs";
3
- import { M as InputApi } from "./types-D8roM1u3.mjs";
4
- import { r as Repro } from "./headless-CrxofjLt.mjs";
5
- import { a as InputOf, r as ControlApp } from "./types-YXykgTOp.mjs";
6
- import { t as commands } from "./commands-5woFUxUr.mjs";
1
+ import { $t as Api$1, K as Api, Rr as Api$3, xr as Api$2 } from "./types-CuEK0Vam.mjs";
2
+ import { P as AnimApi, r as UiApi } from "./types-CpBnGqDU.mjs";
3
+ import { M as InputApi } from "./types-D5Pmo8BD.mjs";
4
+ import { r as Repro } from "./headless-DHtavbqk.mjs";
5
+ import { a as InputOf, r as ControlApp } from "./types-_a6-ALzz.mjs";
6
+ import { t as commands } from "./commands-C3yVtCg1.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. */
@@ -212,7 +212,8 @@ const overlayDefaults = {
212
212
  dimColor: 0,
213
213
  cover: "none",
214
214
  hud: "all",
215
- fade: 250
215
+ fade: 250,
216
+ hold: false
216
217
  };
217
218
  const displayDefaults = { object: void 0 };
218
219
  const shapeDefaults = {
@@ -292,12 +293,15 @@ const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
292
293
  * Marks the view an overlay is drawn from. Everything drawn before the root of that view is kept as one picture while
293
294
  * the overlay is there, and drawn again in the same frame anything in it changes; `cover: "opaque"` draws nothing
294
295
  * under it while it is fully shown. The engine draws its dim and fades the HUD parts it does not keep, with the root's
295
- * own enter and exit motion (`fade` when it has none).
296
+ * own enter and exit motion (`fade` when it has none). `hold: true` holds the endless loops of what lies under it
297
+ * while it stands, so a dimmed sheet over a sharp scene draws no frame at rest.
296
298
  *
297
299
  * @example
298
300
  * ```tsx
299
301
  * // The case file: opaque once it has faded in, the ward under it is not drawn until it starts to leave.
300
302
  * <panel key="caseSheet" motion={sheetFade} components={[Overlay({ cover: "opaque" })]} />
303
+ * // The shop: the ward dims to 56 % and its glints rest while the shop stands; the energy and the gems stay shown.
304
+ * <stack key="shopDimLayer" components={[Overlay({ dim: 0.56, hold: true, hud: ["energy", "gems"] })]} />
301
305
  * ```
302
306
  */
303
307
  const Overlay = /*#__PURE__*/ component("Overlay", overlayDefaults);
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-1doiBOD3.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-B5Sypqal.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,4 +1,4 @@
1
- import { n as read, t as sources } from "./sources-QCowxSpC.mjs";
1
+ import { n as read, t as sources } from "./sources-CJgUypyC.mjs";
2
2
  import { n as commands, t as run } from "./run-BqYmcNo7.mjs";
3
3
  import path from "node:path";
4
4
  import { createBrandConsole } from "@moku-labs/common/cli";
package/llms.txt CHANGED
@@ -522,7 +522,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
522
522
  `world`, `renderer`, `input`, `assets`, `scenes`. Each has a README at `src/plugins/<name>/README.md`; the root README lists their APIs, events and config. Rendering: WebGPU preferred, with Pixi's WebGL fallback.
523
523
  - `app.scenes`: `current()` the mounted scene id, `expect(id)` the scene the next node without its own `scene` mounts, a rest node or a transit node in live mode (the restore door calls it; an unknown id throws). An `over` node takes it the same way, also over another mounted scene.
524
524
  - `Shape({ kind, w, h, fill, fillAlpha, alpha, radius, stroke, strokeWidth, dash, clip, sweep?, cap? })` (`kind: "rect"`; `sweep` and `cap` are optional, `1` and `"round"` when left out; only an arc reads them; a rectangle or a triangle ignores them, also when an earlier arc left them on the `Shape`): a rounded rectangle, `kind: "triangle"` (fills its box pointing right) or `kind: "arc"`: a stroke on the circle inscribed in the box (`min(w, h) − strokeWidth` across, centred) from 12 o'clock clockwise over `sweep` (0..1, clamped; 0 draws nothing, 1 a closed ring), ended by `cap` (`"round" | "butt"`); an arc draws no fill and ignores `radius` and `dash`. The path is built again only when a field changes: a still arc costs nothing a frame. `Shape({ kind: "arc", w: 28, h: 28, stroke: 0xc8a15a, strokeWidth: 2.2, sweep: 0.42 })` is a slot timer's ring with 42 % left.
525
- - Overlays: `Overlay({ dim, dimColor, cover, hud, fade })` on the root of an overlay (in `components`) keeps everything drawn before it as one picture, retaken in the frame anything in it changes, and with `cover: "opaque"` draws none of it once landed at alpha 1; the engine draws the dim (`dim × level`, right under the root); the level follows the root's own enter and exit motion, `fade` (250 ms) only when it has none; level and landing are read through `app.renderer.sync.debug.overlays()`. A `backdrop: true` filter inside the kept range runs no pass while the picture stands (its look is in the picture) and is drawn again in the frame the overlay is gone.
525
+ - Overlays: `Overlay({ dim, dimColor, cover, hud, fade, hold })` on the root of an overlay (in `components`) keeps everything drawn before it as one picture, retaken in the frame anything in it changes, and with `cover: "opaque"` draws none of it once landed at alpha 1; `hold: true` (default `false`) holds the endless loops under it while it stands, as under a cover or a blurred picture (their phase follows time), so a dimmed sheet over a sharp scene draws no frame at rest; the engine draws the dim (`dim × level`, right under the root); the level follows the root's own enter and exit motion, `fade` (250 ms) only when it has none; level and landing are read through `app.renderer.sync.debug.overlays()`. A `backdrop: true` filter inside the kept range runs no pass while the picture stands (its look is in the picture) and is drawn again in the frame the overlay is gone.
526
526
  - HUD: a scene layer `{ above: "overlays" }` is the HUD layer, drawn above every overlay and never in a picture; a scene with a HUD layer and no `ui` gets `ui` right under it. Its roots never take the keyboard: Escape and the Back press reach the top sheet under it. `HudPart({ key })` tags a HUD view; an overlay's `hud` (`"all"`, `"none"` or keys) names the parts that stay shown, the others fade with its level and take no tap. Keys are typed by `defineGame<{ …, hud: "energy" | "gems" }>()`.
527
527
  - 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.
528
528
  - 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`.
@@ -541,7 +541,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
541
541
  - Overdraw heat map (dev and debug builds): `app.renderer.sync.debug.overdraw(true)` (or `game.debug { overdraw: true }`) draws every frame so a pixel's brightness counts the layers drawn there: 1/16 white a layer, white at sixteen. While on, every frame is drawn (also with `onDemand`), kept pictures draw live and filters are off; only the stage pass changes, the tree between frames stays the game's, and off draws the game again from the next frame. Texels a texture leaves transparent count nothing.
542
542
  - `app.renderer.viewport.size()` answers one frozen object, replaced only when the frame changes (a resize, a rotation, new insets, a new scale): compare frames with `===`; a write into it throws a `TypeError`.
543
543
  - `pluginConfigs.renderer.warm` (default `1`, 0 to 16) is the pipeline warm-up: while a game loads, each drawn frame first draws that many invisible probes (sprites, graphics, text, particles, every filter kind and stage `effects` registers, on the canvas and on a texture, with and without a clip), wiped by the stage pass, so no screen creates a GPU pipeline in the frame it opens in; `0` turns it off. `app.renderer.sync.filters.warm(filter)` warms a game's own filter (answers `true` once drawn). An agent build writes a `warm` event `{ draws }` when the queue empties.
544
- - `defineFilter(id, { area: value => [x, y, width, height] })` declares the box, in the entity's own units, outside of which the filter draws nothing: Pixi renders and fills only that box (a lens over a full-screen cover fills its disc, not the screen). The view gets the union of its enabled filters' areas, none when an enabled filter declares none (`renderer.sync.filters.area(entity, area)`). The area also clips the view's own children: Pixi draws nothing of the view outside it, so a shadow or a badge that overhangs the box is cut; make the box hold them. Distance-field text uses device pixels for its edge: sharper at a resolution above 1.
544
+ - `defineFilter(id, { area: value => [x, y, width, height] })` declares the box, in the entity's own units, outside of which the filter draws nothing: Pixi renders and fills only that box (a lens over a full-screen cover fills its disc, not the screen). The view gets the union of its enabled filters' areas, none when an enabled filter declares none (`renderer.sync.filters.area(entity, area)`). The area also clips the view's own children: Pixi draws nothing of the view outside it, so a shadow or a badge that overhangs the box is cut; make the box hold them. The full-screen filter budget and the kept-picture budget count a view with an area by that area, not by its box. Distance-field text uses device pixels for its edge: sharper at a resolution above 1.
545
545
  - `pluginConfigs.renderer.poolTrim` (default `{ restMs: 1000, aboveMb: 16 }`) gives back the idle render targets Pixi's texture pool keeps, strictly between frames: after `restMs` of a still screen (`onDemand`), `restMs` after a scene change (each when the targets grew by `aboveMb` MiB), and on a pause (whatever grew); `false` keeps them. `stats().textureMbSplit.targets` shows the drop; an agent build writes a `pool-trim` event `{ reason, freedMb }`.
546
546
  - `app.renderer.viewport.size().safeArea` is read from four CSS custom properties on the page, `--moku-safe-top`, `--moku-safe-right`, `--moku-safe-bottom`, `--moku-safe-left`, each falling back to `env(safe-area-inset-*, 0px)`. Any CSS length works (`max()`, `calc()`, `env()`); a negative one counts as 0. A change of a property or of the page's insets, and the window event `moku-native:insets`, is laid out at the next frame. There is no `setInsets`: set the properties, e.g. `:root { --moku-safe-top: max(env(safe-area-inset-top, 0px), 24px); }`.
547
547
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.9",
3
+ "version": "0.15.11",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [