@moku-labs/game 0.15.93 → 0.15.95

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-DUco80gt.d.mts → commands-DcGoU3wp.d.mts} +5 -5
  8. package/dist/control.d.mts +4 -4
  9. package/dist/{define-C-EbeoLA.d.mts → define-CZ1_l9Hn.d.mts} +2 -2
  10. package/dist/{headless-Dasz6dgy.d.mts → headless-9UyUfvF5.d.mts} +1 -1
  11. package/dist/{index-vPc22SoP.d.mts → index-B8XphAxo.d.mts} +26 -7
  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-CW4HJWqC.d.mts → runtime-DsAz7KUU.d.mts} +1 -1
  19. package/dist/{sources-kL64Svgl.mjs → sources-DIl02J8z.mjs} +1 -1
  20. package/dist/{src-BBJh9Uxh.mjs → src-D-i4qig2.mjs} +180 -63
  21. package/dist/testing.d.mts +4 -4
  22. package/dist/testing.mjs +1 -1
  23. package/dist/{types-CNNxfAsF.d.mts → types-0QTB6RV7.d.mts} +4 -4
  24. package/dist/{types-Btqe51cJ.d.mts → types-B-n_yE-i.d.mts} +2 -2
  25. package/dist/{types-D1lRinVJ.d.mts → types-CenejHAB.d.mts} +33 -7
  26. package/dist/{types-BMUuyOcm.d.mts → types-D8tWWOCK.d.mts} +28 -7
  27. package/dist/{types-Cc7uKiHX.d.mts → types-Dhnc_iQk.d.mts} +7 -5
  28. package/dist/{visual-BMyWTUgm.d.mts → visual-B0ZwgkDL.d.mts} +6 -6
  29. package/dist/{visual-CULAJg6b.mjs → visual-Cl7Q7pO9.mjs} +4 -2
  30. package/dist/visual.d.mts +1 -1
  31. package/dist/visual.mjs +1 -1
  32. package/llms.txt +4 -3
  33. package/package.json +1 -1
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { r as systemSource, t as memory } from "./memory-CWlqhS7l.mjs";
3
3
  import { a as finishDrafts, i as enableDraftPatches, n as deepFreeze$1, o as openDrafts, r as dropDrafts } from "./drafts-BawpSaVp.mjs";
4
4
  import { _ as compact, c as collectFlows, d as findNode, f as framePath, g as slotNames, h as restlessCapOf, i as servePaused, l as describeGraph, m as isRestCheckpoint, n as captureFrame, o as epochOf, p as graphHash, r as serveCaptures, s as pageNow$1, t as cancelCaptures, v as pushEntry } from "./capture-BtS6_oWr.mjs";
5
- import { $ as Shape, A as Countdown, B as isLeaving, C as uiFor, D as isTextFormat, E as formatBound, G as rootPoseInto, H as parentOf$1, J as HudPart, K as rootPoseOf, L as readStyle, N as builtInStyles, O as unitOf, Q as Parent, R as textFor, U as poseUnder, V as localPoseOf, W as rootPointOf, X as Overlay, Y as NineSlice, Z as OverlayLevel, _ as LocalWrite, a as fieldsLeftAlone, at as Exiting, b as UI_OWNER, c as namesFormat, ct as Order, d as visualOf$1, et as Sprite, f as visualRectOf, ft as resource, g as Escapable, h as DebugTrigger, ht as tag, i as drawnRect, j as Text, k as wholeValue, l as restValueOf, lt as Tree, m as Covered, mt as systemsFor, n as CONTENT$1, nt as arcDefaults, o as fitScaleOf, ot as Layer, p as Box, pt as system, q as Display, r as bindOf, rt as componentsFor, s as livePatch, st as Now, tt as Transform, u as samePose, ut as component, v as Scroll, x as UiCounters, y as ScrollState, z as applyPose } from "./visual-CULAJg6b.mjs";
5
+ import { $ as Shape, A as Countdown, B as isLeaving, C as uiFor, D as isTextFormat, E as formatBound, G as rootPoseInto, H as parentOf$1, J as HudPart, K as rootPoseOf, L as readStyle, N as builtInStyles, O as unitOf, Q as Parent, R as textFor, U as poseUnder, V as localPoseOf, W as rootPointOf, X as Overlay, Y as NineSlice, Z as OverlayLevel, _ as LocalWrite, a as fieldsLeftAlone, at as Exiting, b as UI_OWNER, c as namesFormat, ct as Order, d as visualOf$1, et as Sprite, f as visualRectOf, ft as resource, g as Escapable, h as DebugTrigger, ht as tag, i as drawnRect, j as Text, k as wholeValue, l as restValueOf, lt as Tree, m as Covered, mt as systemsFor, n as CONTENT$1, nt as arcDefaults, o as fitScaleOf, ot as Layer, p as Box, pt as system, q as Display, r as bindOf, rt as componentsFor, s as livePatch, st as Now, tt as Transform, u as samePose, ut as component, v as Scroll, x as UiCounters, y as ScrollState, z as applyPose } from "./visual-Cl7Q7pO9.mjs";
6
6
  import { a as isDev } from "./dev-BNndV-hU.mjs";
7
7
  import { n as isComponentDefinition } from "./component-DGg5DqKK.mjs";
8
8
  import { n as flatten } from "./flatten-nUX9PpGo.mjs";
@@ -3169,19 +3169,24 @@ function beginGuide(state, signal) {
3169
3169
  }
3170
3170
  /**
3171
3171
  * Opens the gate for a descriptor that carries `answers` and resolves with the player's answer in
3172
- * both modes. In live mode the handler is called as well: it only shows the UI, the answer comes
3173
- * through the gate, so its failure is logged and does not block the node. Its signal ends with the
3174
- * answer — that is how the popup layer knows to unmount what it showed.
3172
+ * both modes, stamped with `at`: `clock.now()` read when the gate's answer arrives, not when the
3173
+ * gate opened. The spread keeps a payload-less answer without a `payload` key, and `at` replaces
3174
+ * one a caller put on the answer. In live mode the handler is called as well: it only shows the UI,
3175
+ * the answer comes through the gate, so its failure is logged and does not block the node. Its
3176
+ * signal ends with the answer — that is how the popup layer knows to unmount what it showed.
3175
3177
  *
3176
3178
  * @param ctx - Domain context of the flow plugin.
3177
3179
  * @param gate - Internal gate API.
3178
3180
  * @param descriptor - The awaited descriptor.
3179
3181
  * @param answers - Intents the gate accepts while the effect runs.
3180
3182
  * @param signal - The node's abort signal.
3181
- * @returns The answer the gate accepted.
3183
+ * @returns The answer the gate accepted, with the moment it arrived.
3182
3184
  */
3183
3185
  function openForAnswers(ctx, gate, descriptor, answers, signal) {
3184
- const answered = gate.open({ allowed: answers });
3186
+ const answered = gate.open({ allowed: answers }).then((answer) => ({
3187
+ ...answer,
3188
+ at: ctx.deps.clock.now()
3189
+ }));
3185
3190
  if (ctx.state.fx.mode !== "live") return answered;
3186
3191
  const shown = childOf(signal);
3187
3192
  invoke(ctx.state.fx, ctx.log, descriptor, shown.signal);
@@ -17944,6 +17949,16 @@ function setOrigins(slots, x, y) {
17944
17949
  }
17945
17950
  }
17946
17951
  /**
17952
+ * Tells whether a record's filters read where its picture is drawn on the canvas: a placed filter, or a body that reads
17953
+ * the screen. Such a record is never drawn scaled, owes its output to a move and steps as a placed one does.
17954
+ *
17955
+ * @param record - The record.
17956
+ * @returns True for a `"placed"` or a `"screen"` record.
17957
+ */
17958
+ function readsPlace(record) {
17959
+ return record.category !== "local";
17960
+ }
17961
+ /**
17947
17962
  * Stage 3, the filter output: the stand-in, carrying the record's filters, is rendered at `M3 = translate(Ps, Ps)`
17948
17963
  * into the output texture. A placed filter's origin gets the picture's canvas origin first, `O + Δ`; a local one
17949
17964
  * writes nothing.
@@ -17964,7 +17979,7 @@ function renderStage3(kctx, pixi, matrices, record, now) {
17964
17979
  const output = outputOf(kctx, pixi, record, now.r, now.P);
17965
17980
  const standIn = standInOf(pixi, record);
17966
17981
  const Ps = key[KEY.Ps] ?? 0;
17967
- if (record.category === "placed") setOrigins(record.slots, (key[KEY.X0] ?? 0) - Ps + now.tx - (key[KEY.tx] ?? 0), (key[KEY.Y0] ?? 0) - Ps + now.ty - (key[KEY.ty] ?? 0));
17982
+ if (readsPlace(record)) setOrigins(record.slots, (key[KEY.X0] ?? 0) - Ps + now.tx - (key[KEY.tx] ?? 0), (key[KEY.Y0] ?? 0) - Ps + now.ty - (key[KEY.ty] ?? 0));
17968
17983
  matrices.m3.set(1, 0, 0, 1, Ps, Ps);
17969
17984
  if (!kctx.host.renderTo(standIn, output, matrices.m3, true)) return false;
17970
17985
  key[KEY.r] = now.r;
@@ -19158,6 +19173,7 @@ const WHY = {
19158
19173
  off: 1,
19159
19174
  backdrop: 2,
19160
19175
  filterBlend: 3,
19176
+ cacheFalse: 4,
19161
19177
  hidden: 5,
19162
19178
  fadedOut: 6,
19163
19179
  topBlend: 7,
@@ -19400,16 +19416,16 @@ function drawnAnyway(kctx, node) {
19400
19416
  return node.renderable || kctx.sync.hiddenOnlyAmong(kctx.hidden, node, DRAWN_ANYWAY);
19401
19417
  }
19402
19418
  /**
19403
- * Tells whether an ancestor filters a placed record's view: a filter of its own or its kept picture. Live, the canvas
19404
- * position of a placed filter is then relative to that filter's texture.
19419
+ * Tells whether an ancestor filters a record's view whose filters read their place: a filter of its own or its kept
19420
+ * picture. Live, the canvas position of a placed filter is then relative to that filter's texture.
19405
19421
  *
19406
19422
  * @param kctx - The kept context.
19407
19423
  * @param record - The record.
19408
19424
  * @param node - The ancestor.
19409
- * @returns True when the record is placed and the ancestor filters it.
19425
+ * @returns True when the record reads its place and the ancestor filters it.
19410
19426
  */
19411
19427
  function filtersPlaced(kctx, record, node) {
19412
- return record.category === "placed" && (holdsFilters(node) || kctx.state.byTop.get(node)?.mode === "kept");
19428
+ return readsPlace(record) && (holdsFilters(node) || kctx.state.byTop.get(node)?.mode === "kept");
19413
19429
  }
19414
19430
  /**
19415
19431
  * Tells whether an ancestor draws what is under it as a picture would: visible, untinted, blending normally, drawn (an
@@ -19454,8 +19470,8 @@ function ancestorsWhy(kctx, record, stage, stack) {
19454
19470
  }
19455
19471
  /**
19456
19472
  * Whether a record may be kept this frame (P4.1): the switch on, an enabled filter, filters that draw like a picture, a
19457
- * top and a visual that blend normally (the visual sits inside the wrapper of a kept bare view, D4), a top that is
19458
- * drawn, ancestors that draw it as a picture would.
19473
+ * body that reads the screen only on its quad, a top and a visual that blend normally (the visual sits inside the
19474
+ * wrapper of a kept bare view, D4), a top that is drawn, ancestors that draw it as a picture would.
19459
19475
  *
19460
19476
  * @param kctx - The kept context.
19461
19477
  * @param record - The record.
@@ -19468,6 +19484,7 @@ function eligible(kctx, record, view, stack) {
19468
19484
  if (!keepingOn(kctx) || stage === void 0 || stack.enabled === 0) return WHY.off;
19469
19485
  const filters = filtersWhy(record.slots);
19470
19486
  if (filters !== 0) return filters;
19487
+ if (record.category === "screen" && !shadeFits(kctx, record, stack)) return WHY.cacheFalse;
19471
19488
  const picture = pictureWhy(record.top, view);
19472
19489
  if (picture !== 0) return picture;
19473
19490
  if (!topDrawn(kctx.sync, view)) return WHY.hidden;
@@ -19976,9 +19993,20 @@ function renderStages(kctx, pixi, matrices, record, view, now) {
19976
19993
  return ok;
19977
19994
  }
19978
19995
  /**
19996
+ * Tells whether the record being stepped may be kept on its mesh alone: a placed view under a filter (`NOW.under`), where
19997
+ * a stage 3 picture would hold the wrong place, or a body that reads the screen, whose stage 3 would read the picture's
19998
+ * target. Its first take goes on the mesh, and it does not count its way there.
19999
+ *
20000
+ * @param record - The record.
20001
+ * @returns True when it may draw no other way.
20002
+ */
20003
+ function quadOnly(record) {
20004
+ return NOW.under || record.category === "screen";
20005
+ }
20006
+ /**
19979
20007
  * Settles what a take draws through, before its output: a stack that stopped fitting leaves before anything is drawn
19980
- * for it, and the frame draws a sprite of stage 3. Under a filter there is no sprite to draw, so a picture that rendered
19981
- * goes on the mesh; the sprite a mesh takes the place of may not exist yet.
20008
+ * for it, and the frame draws a sprite of stage 3. Under a filter, and for a body that reads the screen, there is no
20009
+ * sprite to draw, so a picture that rendered goes on the mesh; the sprite a mesh takes the place of may not exist yet.
19982
20010
  *
19983
20011
  * @param kctx - The kept context.
19984
20012
  * @param pixi - The module that draws.
@@ -19988,7 +20016,7 @@ function renderStages(kctx, pixi, matrices, record, view, now) {
19988
20016
  function meshForTake(kctx, pixi, record, ok) {
19989
20017
  if (record.shaded && !shadeFits(kctx, record, NOW)) leaveShade(record);
19990
20018
  const quad = enabledSlot(record.slots)?.quad;
19991
- if (!ok || !NOW.under || record.shaded || quad === void 0) return;
20019
+ if (!ok || !quadOnly(record) || record.shaded || quad === void 0) return;
19992
20020
  quadDrawing(pixi, record, record.s3 ?? pixi.Texture.EMPTY);
19993
20021
  enterShade(kctx, pixi, record, quad, NOW);
19994
20022
  }
@@ -20084,7 +20112,7 @@ function scaledQuad(key, Ps, inverse, local) {
20084
20112
  */
20085
20113
  function scalable(record, stepped) {
20086
20114
  const { key } = record;
20087
- if (record.dirtyS1 || record.cut || record.category === "placed" || !stepped && key[KEY.rs] !== NOW.rs) return false;
20115
+ if (record.dirtyS1 || record.cut || readsPlace(record) || !stepped && key[KEY.rs] !== NOW.rs) return false;
20088
20116
  const taken = Math.abs((key[KEY.a] ?? 1) * (key[KEY.d] ?? 1) - (key[KEY.b] ?? 0) * (key[KEY.c] ?? 0));
20089
20117
  const now = Math.abs(NOW.a * NOW.d - NOW.b * NOW.c);
20090
20118
  const limit = 4;
@@ -20236,14 +20264,14 @@ function wrapBare(kctx, record, view) {
20236
20264
  /**
20237
20265
  * Tells whether a move of a live record's linear part or stack resolution resets its still frames (F113): a zoom or a
20238
20266
  * turn of an ancestor does not, the picture is taken at it and drawn scaled (F67). It does for a new stack resolution,
20239
- * a `"placed"` record (never drawn scaled), a calm one (a picture that churned waits for real rest) and one cut to the
20240
- * canvas at its last take or refusal (never drawn scaled either).
20267
+ * a record that reads its place, `"placed"` or `"screen"` (never drawn scaled), a calm one (a picture that churned
20268
+ * waits for real rest) and one cut to the canvas at its last take or refusal (never drawn scaled either).
20241
20269
  *
20242
20270
  * @param record - The record, live, whose linear part or stack resolution moved since the last frame.
20243
20271
  * @returns True when the move resets its still frames.
20244
20272
  */
20245
20273
  function linearResets(record) {
20246
- return record.key[KEY.seenRs] !== NOW.rs || record.category === "placed" || record.calm || record.cut;
20274
+ return record.key[KEY.seenRs] !== NOW.rs || readsPlace(record) || record.calm || record.cut;
20247
20275
  }
20248
20276
  /**
20249
20277
  * The still frames a live record waits before it is taken: eight after churning, none for a stack drawn direct (its
@@ -20369,7 +20397,8 @@ function retakeOrGoLive(kctx, pixi, matrices, record, view, why) {
20369
20397
  /**
20370
20398
  * A stage-1 change of a kept record (P4.3): retaken, or after three in a row drawn live and calm, so it stands still
20371
20399
  * for eight frames before the next take. Under a filter it is always retaken: live, a body that reads its place reads
20372
- * another one, and a glow would jump; only a refused take or an eviction goes live there.
20400
+ * another one, and a glow would jump; only a refused take or an eviction goes live there. A body that reads the screen
20401
+ * churns as any record does: live, it reads the same canvas.
20373
20402
  *
20374
20403
  * @param kctx - The kept context.
20375
20404
  * @param pixi - The module that draws.
@@ -20400,7 +20429,7 @@ function churn(kctx, pixi, matrices, record, view, why) {
20400
20429
  function retakeWhy(record, stepped) {
20401
20430
  if (!stepped && record.key[KEY.rs] !== NOW.rs) return RETAKE.resolution;
20402
20431
  if (record.dirtyS1) return RETAKE.mark;
20403
- return record.cut || record.category === "placed" ? RETAKE.placedMove : RETAKE.scaleLimit;
20432
+ return record.cut || readsPlace(record) ? RETAKE.placedMove : RETAKE.scaleLimit;
20404
20433
  }
20405
20434
  /**
20406
20435
  * What a refresh of a kept record owes itself to, read before the render writes its keys. Under `hold` the resolution
@@ -20459,14 +20488,14 @@ function canvasChanged(kctx, key) {
20459
20488
  /**
20460
20489
  * Tells whether a step of the renderer resolution passed over a kept picture (F126): drawn at another resolution than
20461
20490
  * the canvas, with a stack that followed the canvas there: a resolution of its own, or `"inherit"`. A picture cut to the
20462
- * canvas or placed, a filter that wrote its own resolution and a mixed stack whose fixed resolution the step crossed
20463
- * are no step: their change is read as a change of the stack.
20491
+ * canvas or one that reads its place, a filter that wrote its own resolution and a mixed stack whose fixed resolution
20492
+ * the step crossed are no step: their change is read as a change of the stack.
20464
20493
  *
20465
20494
  * @param record - The record, kept.
20466
20495
  * @returns True when the picture was stepped over.
20467
20496
  */
20468
20497
  function resolutionStepped(record) {
20469
- if (record.cut || record.category === "placed") return false;
20498
+ if (record.cut || readsPlace(record)) return false;
20470
20499
  const { key } = record;
20471
20500
  const drawn = drawnResolution(key, record.direct);
20472
20501
  if (drawn === NOW.r) return false;
@@ -20612,7 +20641,7 @@ function outputOwed(record, hold) {
20612
20641
  const { key } = record;
20613
20642
  const resolutionOwed = !hold && NOW.r !== key[KEY.r];
20614
20643
  const paddingOwed = hold && record.direct ? NOW.P !== 0 : NOW.P !== key[KEY.P];
20615
- const placedMoved = record.category === "placed" && (NOW.tx !== key[KEY.s3Tx] || NOW.ty !== key[KEY.s3Ty]);
20644
+ const placedMoved = readsPlace(record) && (NOW.tx !== key[KEY.s3Tx] || NOW.ty !== key[KEY.s3Ty]);
20616
20645
  return record.dirtyS3 || resolutionOwed || paddingOwed || placedMoved;
20617
20646
  }
20618
20647
  /**
@@ -20664,7 +20693,7 @@ function refreshOutput(kctx, pixi, matrices, record, view, hold) {
20664
20693
  const fits = shadeFits(kctx, record, NOW);
20665
20694
  const unfit = record.shaded && !fits;
20666
20695
  if (unfit) leaveShade(record);
20667
- const unplaced = unfit || NOW.under && !record.shaded;
20696
+ const unplaced = unfit || quadOnly(record) && !record.shaded;
20668
20697
  const owed = Math.max(stagesOwed(record, hold), unplaced ? OWED.output : OWED.none);
20669
20698
  if (owed === OWED.none) return leaveAtRest(kctx, pixi, matrices, record, view, hold);
20670
20699
  const chain = owed === OWED.chain;
@@ -20722,8 +20751,8 @@ function redrawShade(kctx, pixi, matrices, record) {
20722
20751
  /**
20723
20752
  * Counts an output owed by a record on its sprite, and puts the record on its mesh when it is due: stage 3 alone was owed
20724
20753
  * more than `QUAD_AFTER` times without a gap of `CALM_AFTER` frames, and it fits. The gap rule, not a reset on a quiet
20725
- * frame: a tween that writes every second frame reaches the mode. Under a filter nothing is counted: it may draw no other
20726
- * way. A shaded record counts nothing.
20754
+ * frame: a tween that writes every second frame reaches the mode. Under a filter and for a body that reads the screen
20755
+ * nothing is counted: it may draw no other way. A shaded record counts nothing.
20727
20756
  *
20728
20757
  * @param kctx - The kept context.
20729
20758
  * @param pixi - The module that draws.
@@ -20738,25 +20767,28 @@ function enterShadeWhenDue(kctx, pixi, record, owed, fits) {
20738
20767
  record.outputRuns = frame - record.outputAt > 8 ? 1 : record.outputRuns + 1;
20739
20768
  record.outputAt = frame;
20740
20769
  const quad = enabledSlot(record.slots)?.quad;
20741
- if (!(NOW.under || owed === OWED.output && record.outputRuns > 2) || !fits || quad === void 0) return false;
20770
+ if (!(quadOnly(record) || owed === OWED.output && record.outputRuns > 2) || !fits || quad === void 0) return false;
20742
20771
  return enterShade(kctx, pixi, record, quad, NOW);
20743
20772
  }
20744
20773
  /**
20745
- * Tells whether a shaded record went `QUAD_CALM` drawn frames without a change: it is due to leave.
20774
+ * Tells whether a shaded record went `QUAD_CALM` drawn frames without a change: it is due to leave. A body that reads the
20775
+ * screen never is: it is kept on its mesh alone, so a calm frame does not step it.
20746
20776
  *
20747
20777
  * @param state - The kept state.
20748
20778
  * @param record - The record.
20749
20779
  * @returns True when it is.
20750
20780
  */
20751
20781
  function shadedCalm(state, record) {
20752
- return record.shaded && state.frame - record.shadedAt >= 30;
20782
+ const rested = state.frame - record.shadedAt >= 30;
20783
+ return record.shaded && record.category !== "screen" && rested;
20753
20784
  }
20754
20785
  /**
20755
20786
  * A shaded record that owes nothing and stood `QUAD_CALM` frames goes back to its sprite (F126 stage 2): a resting mesh
20756
20787
  * runs the whole body every frame. Under `limitLeft`, shared with the refining and the settle, it stays shaded in a frame
20757
20788
  * the limit is spent. It counts as a refresh. The pixels do not change, so the pass marks nothing above; a stack whose
20758
20789
  * resolution moved under a held step is taken whole, as `refresh` takes it, and that does change them. Under a filter
20759
- * it stays: its clock starts over, so a calm frame leaves it alone until it comes round again.
20790
+ * it stays: its clock starts over, so a calm frame leaves it alone until it comes round again. A body that reads the
20791
+ * screen is never due (`shadedCalm`).
20760
20792
  *
20761
20793
  * @param kctx - The kept context.
20762
20794
  * @param pixi - The module that draws.
@@ -21127,9 +21159,9 @@ function passOffOrigin(kctx, pixi, node, filters) {
21127
21159
  return passStart(tx + box.x0, resolution, padding, clipped) !== 0 || passStart(ty + box.y0, resolution, padding, clipped) !== 0;
21128
21160
  }
21129
21161
  /**
21130
- * Tells whether a shaded placed record hangs under a filter whose pass starts off the canvas origin. Live, its body
21131
- * reads a place relative to that pass's texture; on the mesh it reads the canvas (spec 23 P8.3). The two differ by that
21132
- * origin by design, not by a stale picture. Only the closest filter counts: Pixi offsets by that one alone. Read with
21162
+ * Tells whether a shaded record that reads its place hangs under a filter whose pass starts off the canvas origin. Live,
21163
+ * its body reads a place relative to that pass's texture; on the mesh it reads the canvas (spec 23 P8.3). The two differ
21164
+ * by that origin by design, not by a stale picture. Only the closest filter counts: Pixi offsets by that one alone. Read with
21133
21165
  * every picture live: a kept ancestor's filters are back on its top, and the views are back in the tree.
21134
21166
  *
21135
21167
  * @param kctx - The kept context.
@@ -21138,7 +21170,7 @@ function passOffOrigin(kctx, pixi, node, filters) {
21138
21170
  */
21139
21171
  function placeDiffers(kctx, record) {
21140
21172
  const pixi = kctx.host.pixi();
21141
- if (!record.shaded || record.category !== "placed" || pixi === void 0) return false;
21173
+ if (!record.shaded || !readsPlace(record) || pixi === void 0) return false;
21142
21174
  for (let node = record.top.parent; node !== null; node = node.parent) {
21143
21175
  const filters = node.filters?.filter((filter) => filter.enabled) ?? [];
21144
21176
  if (filters.length > 0) return passOffOrigin(kctx, pixi, node, filters);
@@ -21399,20 +21431,23 @@ function whyReport(kctx) {
21399
21431
  /** What `why()` answers in every build but an agent build. */
21400
21432
  const NO_WHY = Object.freeze([]);
21401
21433
  /**
21402
- * The category a slot list lets the cache keep it under: the worst of its slots, `undefined` for an empty list, a
21403
- * `"screen"` slot or a slot that names none (a game's own slot is drawn live).
21434
+ * The category a slot list lets the cache keep it under: the worst of its slots, `undefined` for an empty list, a slot
21435
+ * that names none (a game's own slot is drawn live) or a `"screen"` slot without a quad. A body that reads the screen is
21436
+ * kept only while it runs on its quad (F126 stage 2).
21404
21437
  *
21405
21438
  * @param slots - The slots.
21406
- * @returns `"local"`, `"placed"`, or `undefined` when no record is kept.
21439
+ * @returns `"local"`, `"placed"`, `"screen"`, or `undefined` when no record is kept.
21407
21440
  */
21408
21441
  function categoryOf(slots) {
21409
21442
  if (slots.length === 0) return void 0;
21410
- let placed = false;
21443
+ let worst = "local";
21411
21444
  for (const slot of slots) {
21412
- if (slot.cache === void 0 || slot.cache === "screen") return void 0;
21413
- if (slot.cache === "placed") placed = true;
21445
+ const drawnLive = slot.cache === "screen" && slot.quad === void 0;
21446
+ if (slot.cache === void 0 || drawnLive) return void 0;
21447
+ if (slot.cache === "screen") worst = "screen";
21448
+ else if (slot.cache === "placed" && worst === "local") worst = "placed";
21414
21449
  }
21415
- return placed ? "placed" : "local";
21450
+ return worst;
21416
21451
  }
21417
21452
  /**
21418
21453
  * The depth of a node under the stage: its count of parents.
@@ -54393,6 +54428,22 @@ function intentDefaults() {
54393
54428
  };
54394
54429
  }
54395
54430
  /**
54431
+ * Fresh defaults for `Tappable`: an intent and a payload, and no `point` key, so a view that does
54432
+ * not ask for the press point stores and serialises as before.
54433
+ *
54434
+ * @returns An empty intent and an empty payload.
54435
+ * @example
54436
+ * ```ts
54437
+ * tapDefaults(); // { intent: "", payload: {} }
54438
+ * ```
54439
+ */
54440
+ function tapDefaults() {
54441
+ return {
54442
+ intent: "",
54443
+ payload: {}
54444
+ };
54445
+ }
54446
+ /**
54396
54447
  * Fresh defaults for the one component that carries a payload without an intent.
54397
54448
  *
54398
54449
  * @returns An empty payload and nothing carried along.
@@ -54416,9 +54467,10 @@ const pointerDefaults = {
54416
54467
  id: -1
54417
54468
  };
54418
54469
  /**
54419
- * A tap on this view answers `{ intent, payload }`.
54470
+ * A tap on this view answers `{ intent, payload }`. With `point: true` a finger tap adds the
54471
+ * press point, in the view's own units, to the payload under `point`.
54420
54472
  */
54421
- const Tappable = /*#__PURE__*/ component("Tappable", intentDefaults());
54473
+ const Tappable = /*#__PURE__*/ component("Tappable", tapDefaults());
54422
54474
  /**
54423
54475
  * A long press on this view answers `{ intent, payload }`.
54424
54476
  */
@@ -54559,21 +54611,37 @@ function asRecord(payload) {
54559
54611
  return payload;
54560
54612
  }
54561
54613
  /**
54562
- * Builds the answer of a tap or of a long press: the component's own intent and payload.
54614
+ * Builds the answer of a tap or of a long press: the component's own intent and payload. A
54615
+ * `Tappable` with `point: true` given a point adds it to the payload under `point`, which wins a
54616
+ * payload key of that name; a payload that is not an object becomes `{}` first. Without the flag
54617
+ * or without a point the answer carries the payload as it is: no copy, no `point` key.
54563
54618
  *
54564
54619
  * @param gesture - The `Tappable` or `Pressable` value of the view.
54620
+ * @param point - The press point in the view's own units; only a flagged view reads it.
54565
54621
  * @returns The answer to hand to the gate.
54566
54622
  * @example
54567
54623
  * ```ts
54568
54624
  * tapAnswer({ intent: "found", payload: { id: "lamp" } });
54569
54625
  * // { intent: "found", payload: { id: "lamp" } }
54626
+ * tapAnswer({ intent: "kitTap", payload: { kit: "k1" }, point: true }, { x: 10, y: 60 });
54627
+ * // { intent: "kitTap", payload: { kit: "k1", point: { x: 10, y: 60 } } }
54570
54628
  * ```
54571
54629
  */
54572
- function tapAnswer(gesture) {
54573
- return {
54630
+ function tapAnswer(gesture, point) {
54631
+ if (gesture.point !== true || point === void 0) return {
54574
54632
  intent: gesture.intent,
54575
54633
  payload: gesture.payload
54576
54634
  };
54635
+ return {
54636
+ intent: gesture.intent,
54637
+ payload: {
54638
+ ...asRecord(gesture.payload),
54639
+ point: {
54640
+ x: point.x,
54641
+ y: point.y
54642
+ }
54643
+ }
54644
+ };
54577
54645
  }
54578
54646
  /**
54579
54647
  * Builds the answer of a drop: the drop TARGET names the intent, and its payload wins a key the
@@ -56044,6 +56112,30 @@ function onMove(ctx, point) {
56044
56112
  ctx.state.phase = "dragging";
56045
56113
  }
56046
56114
  /**
56115
+ * The press-down point in the view's own units, the units of its hit box, brought through its
56116
+ * `Transform` and `Parent` chain as the trace hit test does. Only a `Tappable` with `point: true`
56117
+ * asks for it, so a view without the flag allocates nothing here.
56118
+ *
56119
+ * @param ctx - Domain context of the input plugin.
56120
+ * @param entity - The tapped view.
56121
+ * @param tappable - Its `Tappable` value.
56122
+ * @returns The local press point, or `undefined` for a view that does not ask for it.
56123
+ */
56124
+ function pressPointOf(ctx, entity, tappable) {
56125
+ if (tappable.point !== true) return void 0;
56126
+ const { start } = ctx.state;
56127
+ return localPoseOf(ctx.deps.world.ecs, entity, {
56128
+ x: start.x,
56129
+ y: start.y,
56130
+ rotation: 0,
56131
+ scale: 1,
56132
+ pivot: {
56133
+ x: 0,
56134
+ y: 0
56135
+ }
56136
+ });
56137
+ }
56138
+ /**
56047
56139
  * Answers the release of a press: a tap when the finger stayed inside the slop, a swipe when it
56048
56140
  * went far enough and fast enough. Neither: nothing happened, and nothing has to be undone. Every
56049
56141
  * release inside the slop runs the `onTap` listeners first, so a view that carries only
@@ -56062,7 +56154,7 @@ function answerRelease(ctx, entity, point) {
56062
56154
  notifyTap(ctx, entity);
56063
56155
  const tappable = ecs.get(entity, Tappable);
56064
56156
  if (tappable !== void 0) {
56065
- submit(ctx, entity, tapAnswer(tappable));
56157
+ submit(ctx, entity, tapAnswer(tappable, pressPointOf(ctx, entity, tappable)));
56066
56158
  return;
56067
56159
  }
56068
56160
  if (!ecs.has(entity, Transform)) lostPress(ctx, "view-gone");
@@ -56588,13 +56680,15 @@ function answerIntent(ctx, target, component) {
56588
56680
  /**
56589
56681
  * Taps a view the way the finger does: the `onTap` listeners run first, then the `Tappable` is
56590
56682
  * answered. A view that carries only `Touchable` reaches the listeners and answers nothing, which
56591
- * is what a ui button with local state does, so it is not reported as a mistake.
56683
+ * is what a ui button with local state does, so it is not reported as a mistake. A given point is
56684
+ * already in the view's own units and reaches the answer as it is, on a view that asks for it.
56592
56685
  *
56593
56686
  * @param ctx - Domain context of the input plugin.
56594
56687
  * @param target - What the caller pointed at.
56688
+ * @param point - The press point in the view's own units, or `undefined`.
56595
56689
  * @returns What `flow.gate.answer` returned.
56596
56690
  */
56597
- function answerTap(ctx, target) {
56691
+ function answerTap(ctx, target, point) {
56598
56692
  const entity = resolveTarget(ctx, target);
56599
56693
  if (entity === void 0) {
56600
56694
  ctx.log.warn("input: target has no Tappable", { target });
@@ -56606,7 +56700,7 @@ function answerTap(ctx, target) {
56606
56700
  if (!ctx.deps.world.ecs.has(entity, Touchable)) ctx.log.warn("input: target has no Tappable", { target });
56607
56701
  return false;
56608
56702
  }
56609
- return submit(ctx, entity, tapAnswer(tappable));
56703
+ return submit(ctx, entity, tapAnswer(tappable, point));
56610
56704
  }
56611
56705
  /**
56612
56706
  * Answers a drop: the source brings the payload, the destination names the intent.
@@ -56672,7 +56766,7 @@ function answerTrace(ctx, path) {
56672
56766
  function createInputApi(ctx) {
56673
56767
  const inputCtx = withDeps$2(ctx);
56674
56768
  return {
56675
- tap: (target) => answerTap(inputCtx, target),
56769
+ tap: (target, point) => answerTap(inputCtx, target, point),
56676
56770
  press: (target) => answerIntent(inputCtx, target, Pressable),
56677
56771
  drag: (from, to) => answerDrop(inputCtx, from, to),
56678
56772
  swipe: (target, direction) => answerSwipe(inputCtx, target, direction),
@@ -65454,8 +65548,8 @@ const CONTENT_ROW_STYLE = Object.freeze({
65454
65548
  });
65455
65549
  /**
65456
65550
  * The props, besides `style`, `state` and `content`, that a live element is written from: `bind`,
65457
- * `texture`, `name` and `fit` reach its visual, `intent`, `payload`, `local` and `escape` its
65458
- * input, `components` its extras and `motion` its hooks. Every other prop is read from the node
65551
+ * `texture`, `name` and `fit` reach its visual, `intent`, `payload`, `point`, `local` and `escape`
65552
+ * its input, `components` its extras and `motion` its hooks. Every other prop is read from the node
65459
65553
  * where it is used, at every patch: `hosts`, the props of a windowed scroll, the props of a text
65460
65554
  * field, and the children.
65461
65555
  */
@@ -65468,6 +65562,7 @@ const WRITTEN = [
65468
65562
  "motion",
65469
65563
  "intent",
65470
65564
  "payload",
65565
+ "point",
65471
65566
  "local",
65472
65567
  "escape"
65473
65568
  ];
@@ -65598,7 +65693,9 @@ function checkTag(node) {
65598
65693
  }
65599
65694
  /**
65600
65695
  * What a button that answers carries: `Tappable` with its intent, or `Touchable` and
65601
- * `LocalWrite` with its patch, or `Touchable` alone when it names neither.
65696
+ * `LocalWrite` with its patch, or `Touchable` alone when it names neither. `point={true}` beside
65697
+ * the intent writes `point: true` into `Tappable`; any other value writes no `point` key, never
65698
+ * `false` or `undefined`, so a button without it stores and serialises as before.
65602
65699
  *
65603
65700
  * @param node - The node of the button.
65604
65701
  * @returns The component values.
@@ -65606,10 +65703,17 @@ function checkTag(node) {
65606
65703
  function answerOf(node) {
65607
65704
  const intent = node.props.intent;
65608
65705
  const local = node.props.local;
65609
- if (typeof intent === "string") return [Tappable({
65610
- intent,
65611
- payload: node.props.payload ?? {}
65612
- })];
65706
+ if (typeof intent === "string") {
65707
+ const payload = node.props.payload ?? {};
65708
+ return [node.props.point === true ? Tappable({
65709
+ intent,
65710
+ payload,
65711
+ point: true
65712
+ }) : Tappable({
65713
+ intent,
65714
+ payload
65715
+ })];
65716
+ }
65613
65717
  if (typeof local === "object" && local !== null) return [Touchable(), LocalWrite({ patch: local })];
65614
65718
  return [Touchable()];
65615
65719
  }
@@ -66237,15 +66341,28 @@ function createReconciler(ctx, modules, fields) {
66237
66341
  if (others !== void 0) ecs.set(element.entity, asHandle(type), others);
66238
66342
  }
66239
66343
  /**
66344
+ * Tells whether a value is the `Tappable` of a button that stopped asking for its press point
66345
+ * while the entity still carries `point: true`. A patch keeps the fields it leaves out, so that
66346
+ * value replaces the stored one whole.
66347
+ *
66348
+ * @param entity - The element's entity.
66349
+ * @param value - The value of this render.
66350
+ * @returns True when the stored `Tappable` has the flag and the new one has not.
66351
+ */
66352
+ function dropsPoint(entity, value) {
66353
+ if (value.type !== Tappable || value.value === true) return false;
66354
+ return ecs.get(entity, Tappable)?.point === true && !("point" in value.value);
66355
+ }
66356
+ /**
66240
66357
  * Writes one visual or input value onto a live element: added when the entity lacks it, else
66241
66358
  * its fields patched, but never a tag or the state of a scroll, and never a field its type gives
66242
- * to a plugin.
66359
+ * to a plugin. A `Tappable` that drops `point` is added again: it replaces the stored one whole.
66243
66360
  *
66244
66361
  * @param element - The live element.
66245
66362
  * @param value - The value of this render.
66246
66363
  */
66247
66364
  function writeValue(element, value) {
66248
- if (!ecs.has(element.entity, value.type)) {
66365
+ if (!ecs.has(element.entity, value.type) || dropsPoint(element.entity, value)) {
66249
66366
  ecs.add(element.entity, value);
66250
66367
  return;
66251
66368
  }
@@ -1,7 +1,7 @@
1
- import { An as FeaturePlugin, Fr as FakeClock, Hn as Descriptor, Kn as Hint, Mn as AnyFlow, Nr as ClockSource, Rn as NodeTable, Vr as Json, qn as NodeFx } from "./types-D1lRinVJ.mjs";
2
- import { t as createApp } from "./index-vPc22SoP.mjs";
3
- import { b as memory, x as saveOf, y as WithGameState } from "./types-CNNxfAsF.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-Dasz6dgy.mjs";
1
+ import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-CenejHAB.mjs";
2
+ import { t as createApp } from "./index-B8XphAxo.mjs";
3
+ import { b as memory, x as saveOf, y as WithGameState } from "./types-0QTB6RV7.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-9UyUfvF5.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 { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-BBJh9Uxh.mjs";
1
+ import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-D-i4qig2.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,7 +1,7 @@
1
- import { An as FeaturePlugin, Fr as FakeClock, Jr as SaveDoc, Kr as PlayerStateProvider, Mn as AnyFlow, Nr as ClockSource, Q as Config$2, Vn as TypeTag, Vr as Json, Zr as SnapshotOf, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as ProviderCall, zr as Config } from "./types-D1lRinVJ.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-Cc7uKiHX.mjs";
3
- import { H as I18nApi, J as TextKey, q as StringTable } from "./types-BMUuyOcm.mjs";
4
- import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-vPc22SoP.mjs";
1
+ import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-CenejHAB.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-Dhnc_iQk.mjs";
3
+ import { H as I18nApi, J as TextKey, q as StringTable } from "./types-D8tWWOCK.mjs";
4
+ import { Ct as effectsPlugin, Et as audioPlugin, gt as PlatformProvider, i as screen, mt as platformPlugin, t as createApp } from "./index-B8XphAxo.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 { Vr as Json, Xr as Snapshot } from "./types-D1lRinVJ.mjs";
2
- import { t as HeadlessApp } from "./headless-Dasz6dgy.mjs";
1
+ import { Hr as Json, Zr as Snapshot } from "./types-CenejHAB.mjs";
2
+ import { t as HeadlessApp } from "./headless-9UyUfvF5.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts