@moku-labs/game 0.15.58 → 0.15.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/page.mjs +1 -1
- package/dist/app.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/inspect.mjs +1 -1
- package/dist/{sources-Bp9xmX3f.mjs → sources-Djd8MjP9.mjs} +1 -1
- package/dist/{src-CJtaTza4.mjs → src-B3cwICTC.mjs} +65 -76
- package/dist/testing.mjs +1 -1
- package/dist/{visual-ciZa6Rza.mjs → visual-B7TxMv1J.mjs} +93 -5
- package/dist/visual.mjs +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
package/dist/app/page.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { r as systemSource, t as memory } from "../memory-CWlqhS7l.mjs";
|
|
|
2
2
|
import { t as applyTo } from "../drafts-BawpSaVp.mjs";
|
|
3
3
|
import { i as isControl } from "../dev-BNndV-hU.mjs";
|
|
4
4
|
import { n as fakeClock, t as VISUAL_CLOCK } from "../fake-hnJcJeYf.mjs";
|
|
5
|
-
import { n as read, r as watch, t as sources } from "../sources-
|
|
5
|
+
import { n as read, r as watch, t as sources } from "../sources-Djd8MjP9.mjs";
|
|
6
6
|
import { t as resolveConfig } from "../config-HpC-p8Ow.mjs";
|
|
7
7
|
//#region src/app/boot.ts
|
|
8
8
|
/** How long after the fade the timer removes a picture whose transition never ended, ms. */
|
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-
|
|
1
|
+
import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-B3cwICTC.mjs";
|
|
2
2
|
import { t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as sfx, $t as flowPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as worldPlugin, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as sfx, $t as flowPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as worldPlugin, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-B3cwICTC.mjs";
|
|
2
|
+
import { $ as Layer, B as Display, C as defineStyle, E as bind, G as Parent, H as NineSlice, J as Transform, K as Shape, O as defineTextStyles, Q as Exiting, S as defineTokens, T as Text, U as Overlay, V as HudPart, Z as sprite, _ as ScrollState, at as resource, b as popup, ct as tag, d as Box, et as Now, h as LocalWrite, it as mut, k as label, nt as Tree, ot as system, p as DebugTrigger, q as Sprite, rt as component, tt as Order, w as Countdown } from "./visual-B7TxMv1J.mjs";
|
|
3
3
|
import { t as defineComponent } from "./component-DGg5DqKK.mjs";
|
|
4
4
|
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as defineSource } from "./session-DuZfGZWk.mjs";
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-Djd8MjP9.mjs";
|
|
3
3
|
import "./inspect-la_KkjCS.mjs";
|
|
4
4
|
export { defineSource, read, sources, watch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as Layer, F as parentOf, H as NineSlice, K as Shape, d as Box, r as drawnRect, z as rootPoseOf } from "./visual-B7TxMv1J.mjs";
|
|
2
2
|
import { o as notInstalled } from "./dev-BNndV-hU.mjs";
|
|
3
3
|
import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-DuZfGZWk.mjs";
|
|
4
4
|
//#region src/plugins/flow/doors/read.ts
|
|
@@ -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
|
|
5
|
+
import { $ as Layer, A as readStyle, B as Display, D as builtInStyles, F as parentOf$1, G as Parent, H as NineSlice, I as poseUnder, J as Transform, K as Shape, L as rootPointOf, M as applyPose, N as isLeaving, P as localPoseOf, Q as Exiting, R as rootPoseInto, T as Text, U as Overlay, V as HudPart, W as OverlayLevel, X as componentsFor, Y as arcDefaults, _ as ScrollState, a as fitScaleOf, at as resource, c as samePose, ct as tag, d as Box, et as Now, f as Covered, g as Scroll, h as LocalWrite, i as fieldsLeftAlone, j as textFor, l as visualOf$1, m as Escapable, n as CONTENT$1, nt as Tree, o as livePatch, ot as system, p as DebugTrigger, q as Sprite, r as drawnRect, rt as component, s as restValueOf, st as systemsFor, tt as Order, u as visualRectOf, v as UI_OWNER, w as Countdown, x as uiFor, y as UiCounters, z as rootPoseOf } from "./visual-B7TxMv1J.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";
|
|
@@ -18395,13 +18395,16 @@ function topDrawn(sync, view) {
|
|
|
18395
18395
|
return !(hiddenBy(view, "empty") && view.wrapper === void 0);
|
|
18396
18396
|
}
|
|
18397
18397
|
/**
|
|
18398
|
-
* Tells whether an ancestor draws what is under it
|
|
18398
|
+
* Tells whether an ancestor draws what is under it as a picture would: visible, untinted, blending normally. Its alpha
|
|
18399
|
+
* is not read (F113): the quad hangs in the top's parent and Pixi multiplies it by the ancestors' alpha, while stage 1
|
|
18400
|
+
* renders the top as a root without them. A fading ancestor so draws the picture at `A·F(x)`, live draws `F(A·x)`: the
|
|
18401
|
+
* same for an alpha-linear filter, the whole picture faded for one that is not.
|
|
18399
18402
|
*
|
|
18400
18403
|
* @param node - The ancestor.
|
|
18401
18404
|
* @returns True when it does.
|
|
18402
18405
|
*/
|
|
18403
18406
|
function drawsPlain(node) {
|
|
18404
|
-
return node.visible && node.
|
|
18407
|
+
return node.visible && node.tint === WHITE$2 && plainBlend(node.blendMode);
|
|
18405
18408
|
}
|
|
18406
18409
|
/**
|
|
18407
18410
|
* Tells whether an ancestor is drawn: renderable, or hidden only by an overlay's range or a kept ancestor's picture,
|
|
@@ -18427,8 +18430,8 @@ function filtersPlaced(kctx, record, node) {
|
|
|
18427
18430
|
return record.category === "placed" && (holdsFilters(node) || kctx.state.byTop.get(node)?.mode === "kept");
|
|
18428
18431
|
}
|
|
18429
18432
|
/**
|
|
18430
|
-
* Tells whether every ancestor up to the stage draws the view as a picture would: visible,
|
|
18431
|
-
* normally, drawn (an overlay's range and a kept ancestor's picture count), and for a placed filter without a filter
|
|
18433
|
+
* Tells whether every ancestor up to the stage draws the view as a picture would: visible, untinted (its alpha is not
|
|
18434
|
+
* read, F113), blending normally, drawn (an overlay's range and a kept ancestor's picture count), and for a placed filter without a filter
|
|
18432
18435
|
* above it (its canvas position would not be the canvas pixel live).
|
|
18433
18436
|
*
|
|
18434
18437
|
* @param kctx - The kept context.
|
|
@@ -18763,7 +18766,8 @@ function writeTakeKeys(record, now, box) {
|
|
|
18763
18766
|
* Takes or retakes the picture of a record: stages 1, 2 (when its first filter has inputs) and 3, at the phase of this
|
|
18764
18767
|
* frame. The bounds are cut to the filter area of the top when it holds one (F43). Refused, and the view drawn live,
|
|
18765
18768
|
* for a `Display` in the subtree without `onDemand`, a node under the top that blends otherwise (F68, warned once per
|
|
18766
|
-
* top), empty bounds, a picture over 4096 device pixels,
|
|
18769
|
+
* top), empty bounds, a picture over 4096 device pixels, a picture cut to the canvas while its linear part moves (it
|
|
18770
|
+
* is never drawn scaled, F113), or a budget that has no room (P6.3, warned once).
|
|
18767
18771
|
*
|
|
18768
18772
|
* @param kctx - The kept context.
|
|
18769
18773
|
* @param pixi - The module that draws.
|
|
@@ -18771,9 +18775,10 @@ function writeTakeKeys(record, now, box) {
|
|
|
18771
18775
|
* @param record - The record.
|
|
18772
18776
|
* @param view - Its view.
|
|
18773
18777
|
* @param now - This frame's numbers.
|
|
18778
|
+
* @param turned - True when the linear part moved since the last frame: a first take under a zoom.
|
|
18774
18779
|
* @returns True when every stage rendered.
|
|
18775
18780
|
*/
|
|
18776
|
-
function takePicture(kctx, pixi, matrices, record, view, now) {
|
|
18781
|
+
function takePicture(kctx, pixi, matrices, record, view, now, turned = false) {
|
|
18777
18782
|
const { top } = record;
|
|
18778
18783
|
if (!kctx.ctx.config.onDemand && holdsDisplay(kctx, top)) return false;
|
|
18779
18784
|
if (blendedBelow(kctx, record)) return false;
|
|
@@ -18789,6 +18794,11 @@ function takePicture(kctx, pixi, matrices, record, view, now) {
|
|
|
18789
18794
|
const across = cutSpan(now.tx + box.x0, now.tx + box.x1, width, Ps);
|
|
18790
18795
|
const down = cutSpan(now.ty + box.y0, now.ty + box.y1, height, Ps);
|
|
18791
18796
|
if (isEmptySpan(across) || isEmptySpan(down)) return false;
|
|
18797
|
+
const cut = across.start > now.tx + box.x0 || across.end < now.tx + box.x1 || down.start > now.ty + box.y0 || down.end < now.ty + box.y1;
|
|
18798
|
+
if (cut && turned) {
|
|
18799
|
+
record.cut = true;
|
|
18800
|
+
return false;
|
|
18801
|
+
}
|
|
18792
18802
|
const x = gridSpan(across.start, across.end, now.rs);
|
|
18793
18803
|
const y = gridSpan(down.start, down.end, now.rs);
|
|
18794
18804
|
const w1 = x.texels / now.rs;
|
|
@@ -18805,9 +18815,7 @@ function takePicture(kctx, pixi, matrices, record, view, now) {
|
|
|
18805
18815
|
return false;
|
|
18806
18816
|
}
|
|
18807
18817
|
record.refused = 0;
|
|
18808
|
-
|
|
18809
|
-
const cutDown = down.start > now.ty + box.y0 || down.end < now.ty + box.y1;
|
|
18810
|
-
record.cut = cutAcross || cutDown;
|
|
18818
|
+
record.cut = cut;
|
|
18811
18819
|
record.key[KEY.sw] = width;
|
|
18812
18820
|
record.key[KEY.sh] = height;
|
|
18813
18821
|
writeTakeKeys(record, now, {
|
|
@@ -19115,9 +19123,21 @@ function wrapBare(kctx, record, view) {
|
|
|
19115
19123
|
writeSeen(record, NOW);
|
|
19116
19124
|
}
|
|
19117
19125
|
/**
|
|
19118
|
-
*
|
|
19119
|
-
*
|
|
19120
|
-
*
|
|
19126
|
+
* Tells whether a move of a live record's linear part or stack resolution resets its still frames (F113): a zoom or a
|
|
19127
|
+
* turn of an ancestor does not, the picture is taken at it and drawn scaled (F67). It does for a new stack resolution,
|
|
19128
|
+
* a `"placed"` record (never drawn scaled), a calm one (a picture that churned waits for real rest) and one cut to the
|
|
19129
|
+
* canvas at its last take or refusal (never drawn scaled either).
|
|
19130
|
+
*
|
|
19131
|
+
* @param record - The record, live, whose linear part or stack resolution moved since the last frame.
|
|
19132
|
+
* @returns True when the move resets its still frames.
|
|
19133
|
+
*/
|
|
19134
|
+
function linearResets(record) {
|
|
19135
|
+
return record.key[KEY.seenRs] !== NOW.rs || record.category === "placed" || record.calm || record.cut;
|
|
19136
|
+
}
|
|
19137
|
+
/**
|
|
19138
|
+
* A live record's frame (P4.2): still frames are counted, and a zoom or turn of an ancestor counts as still (F113); at
|
|
19139
|
+
* two (eight after churning) the record is taken, a bare view in a wrapper of its own (D4). A record with a node under
|
|
19140
|
+
* its top that blends otherwise stays live, before any wrap (F68).
|
|
19121
19141
|
*
|
|
19122
19142
|
* @param kctx - The kept context.
|
|
19123
19143
|
* @param pixi - The module that draws.
|
|
@@ -19127,14 +19147,15 @@ function wrapBare(kctx, record, view) {
|
|
|
19127
19147
|
*/
|
|
19128
19148
|
function stepLive(kctx, pixi, matrices, record, view) {
|
|
19129
19149
|
const { state } = kctx;
|
|
19130
|
-
const
|
|
19150
|
+
const turned = linearDiffers(record.key, NOW, KEY.seenA, KEY.seenRs);
|
|
19151
|
+
const changed = record.dirtyS1 || turned && linearResets(record);
|
|
19131
19152
|
writeSeen(record, NOW);
|
|
19132
19153
|
record.still = changed ? 0 : record.still + 1;
|
|
19133
19154
|
if (record.still < (record.calm ? 8 : 2)) return;
|
|
19134
19155
|
if (record.refused > 0 && state.bytes + record.refused - record.bytes > state.budget) return;
|
|
19135
19156
|
if (blendedBelow(kctx, record)) return;
|
|
19136
19157
|
wrapBare(kctx, record, view);
|
|
19137
|
-
if (takePicture(kctx, pixi, matrices, record, view, NOW)) toKept(kctx, record, view);
|
|
19158
|
+
if (takePicture(kctx, pixi, matrices, record, view, NOW, turned)) toKept(kctx, record, view);
|
|
19138
19159
|
else record.still = 0;
|
|
19139
19160
|
}
|
|
19140
19161
|
/**
|
|
@@ -19446,6 +19467,17 @@ function offGrid(kctx, record) {
|
|
|
19446
19467
|
return world.a !== key[KEY.a] || world.b !== key[KEY.b] || world.c !== key[KEY.c] || world.d !== key[KEY.d] || !onGrid(world.tx - (key[KEY.tx] ?? 0), rs, r) || !onGrid(world.ty - (key[KEY.ty] ?? 0), rs, r);
|
|
19447
19468
|
}
|
|
19448
19469
|
/**
|
|
19470
|
+
* Tells whether a kept record hangs under a translucent ancestor (F113): its quad draws `A·F(x)` where live draws
|
|
19471
|
+
* `F(A·x)`, which differ by design for a filter that is not alpha-linear, not by a stale picture.
|
|
19472
|
+
*
|
|
19473
|
+
* @param record - The record, kept.
|
|
19474
|
+
* @returns True when an ancestor's alpha is under 1.
|
|
19475
|
+
*/
|
|
19476
|
+
function fadedAbove(record) {
|
|
19477
|
+
for (let node = record.top.parent; node !== null; node = node.parent) if (node.alpha < 1) return true;
|
|
19478
|
+
return false;
|
|
19479
|
+
}
|
|
19480
|
+
/**
|
|
19449
19481
|
* Tells whether the padded picture of a kept record reaches past the canvas edge, where Pixi clips the live filter.
|
|
19450
19482
|
*
|
|
19451
19483
|
* @param record - The record, kept.
|
|
@@ -19534,7 +19566,8 @@ function logStale(kctx, pixels, records, ranges) {
|
|
|
19534
19566
|
}
|
|
19535
19567
|
/**
|
|
19536
19568
|
* The pixel leg after a drawn frame: the picture as drawn against the same frame with every picture live. Frames in
|
|
19537
|
-
* which a picture moves off its grid are skipped and counted; at rest
|
|
19569
|
+
* which a picture moves off its grid or hangs under a translucent ancestor (F113) are skipped and counted; at rest
|
|
19570
|
+
* under opaque ancestors every picture is compared.
|
|
19538
19571
|
*
|
|
19539
19572
|
* @param kctx - The kept context.
|
|
19540
19573
|
* @param bypass - Draws every kept record live (true) or as its picture again (false).
|
|
@@ -19545,7 +19578,7 @@ function verifyPictures(kctx, bypass, recover) {
|
|
|
19545
19578
|
const records = shownRecords(kctx);
|
|
19546
19579
|
const ranges = [...state.ranges.values()].filter((range) => range.sprite !== void 0);
|
|
19547
19580
|
if (records.length === 0 && ranges.length === 0) return;
|
|
19548
|
-
if (records.some((record) => offGrid(kctx, record))) {
|
|
19581
|
+
if (records.some((record) => offGrid(kctx, record) || fadedAbove(record))) {
|
|
19549
19582
|
state.verifySkipped += 1;
|
|
19550
19583
|
return;
|
|
19551
19584
|
}
|
|
@@ -60316,46 +60349,10 @@ function defineMotion(spec) {
|
|
|
60316
60349
|
//#endregion
|
|
60317
60350
|
//#region src/plugins/ui/jsx/extras.ts
|
|
60318
60351
|
/**
|
|
60319
|
-
* The patch a live element writes into one of its components: every field but the ones the
|
|
60320
|
-
* component type gives to a plugin. That plugin keeps such a field for the life of the entity, so
|
|
60321
|
-
* a re-render never puts it back to its default: a label keeps the string `text` resolved for it.
|
|
60322
|
-
*
|
|
60323
|
-
* @param value - The component value the element carries now.
|
|
60324
|
-
* @param owned - The fields the component type gives to a plugin.
|
|
60325
|
-
* @returns The fields to write.
|
|
60326
|
-
* @example
|
|
60327
|
-
* ```ts
|
|
60328
|
-
* livePatch({ content: "Play", resolved: "" }, ["resolved"]); // { content: "Play" }
|
|
60329
|
-
* ```
|
|
60330
|
-
*/
|
|
60331
|
-
function livePatch(value, owned) {
|
|
60332
|
-
if (owned.length === 0) return value;
|
|
60333
|
-
return Object.fromEntries(Object.entries(value).filter(([field]) => !owned.includes(field)));
|
|
60334
|
-
}
|
|
60335
|
-
/**
|
|
60336
|
-
* The rest pose recorded for an extra component: the value of this render, but the fields the
|
|
60337
|
-
* component type gives to a plugin stay as the entity carries them, so a render never resets them.
|
|
60338
|
-
*
|
|
60339
|
-
* @param current - The value the entity carries now; none before the component is added.
|
|
60340
|
-
* @param value - The value of this render.
|
|
60341
|
-
* @param owned - The fields the component type gives to a plugin.
|
|
60342
|
-
* @returns The rest value.
|
|
60343
|
-
* @example
|
|
60344
|
-
* ```ts
|
|
60345
|
-
* restValueOf({ until: 2000, left: 42 }, { until: 5000, left: 0 }, ["left"]); // { until: 5000, left: 42 }
|
|
60346
|
-
* ```
|
|
60347
|
-
*/
|
|
60348
|
-
function restValueOf(current, value, owned) {
|
|
60349
|
-
if (current === void 0 || owned.length === 0) return value;
|
|
60350
|
-
return {
|
|
60351
|
-
...current,
|
|
60352
|
-
...livePatch(value, owned)
|
|
60353
|
-
};
|
|
60354
|
-
}
|
|
60355
|
-
/**
|
|
60356
60352
|
* Records the rest pose of one extra component with a value, so a `change` hook can bring it
|
|
60357
|
-
* home with `view.toRest`; a tag has no rest. The fields the type gives to a plugin
|
|
60358
|
-
*
|
|
60353
|
+
* home with `view.toRest`; a tag has no rest. The fields the type gives to a plugin, and the size
|
|
60354
|
+
* a game's own system gives a self-sized image (F111), stay as the entity carries them. The
|
|
60355
|
+
* visual of a live element is recorded the same way each time its look is written or it moves.
|
|
60359
60356
|
*
|
|
60360
60357
|
* @param ctx - Domain context of the ui plugin.
|
|
60361
60358
|
* @param element - The element that carries the component.
|
|
@@ -60364,7 +60361,9 @@ function restValueOf(current, value, owned) {
|
|
|
60364
60361
|
function recordRest(ctx, element, value) {
|
|
60365
60362
|
if (value.value === true) return;
|
|
60366
60363
|
const type = value.type;
|
|
60367
|
-
const
|
|
60364
|
+
const owned = fieldsLeftAlone(element, type, type.owned);
|
|
60365
|
+
const current = owned.length === 0 ? void 0 : ctx.deps.world.ecs.get(element.entity, type);
|
|
60366
|
+
const rest = restValueOf(current, value.value, owned);
|
|
60368
60367
|
ctx.deps.world.projection.setRest(element.entity, type, rest);
|
|
60369
60368
|
}
|
|
60370
60369
|
/**
|
|
@@ -62737,7 +62736,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
62737
62736
|
* @param type - Its component type.
|
|
62738
62737
|
*/
|
|
62739
62738
|
function writeOthers(element, value, type) {
|
|
62740
|
-
const others = otherFields(value, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED);
|
|
62739
|
+
const others = otherFields(value, fieldsLeftAlone(element, type, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED));
|
|
62741
62740
|
if (others !== void 0) ecs.set(element.entity, asHandle(type), others);
|
|
62742
62741
|
}
|
|
62743
62742
|
/**
|
|
@@ -62754,7 +62753,8 @@ function createReconciler(ctx, modules, fields) {
|
|
|
62754
62753
|
return;
|
|
62755
62754
|
}
|
|
62756
62755
|
if (value.value === true || SCROLL_STATE.has(value.type.componentName)) return;
|
|
62757
|
-
const
|
|
62756
|
+
const typeOwned = ecs.typeOf(value.type.componentName)?.owned ?? NO_OWNED;
|
|
62757
|
+
const owned = fieldsLeftAlone(element, value.type, typeOwned);
|
|
62758
62758
|
ecs.set(element.entity, asHandle(value.type), livePatch(value.value, owned));
|
|
62759
62759
|
}
|
|
62760
62760
|
/**
|
|
@@ -64433,21 +64433,6 @@ function restTransform(rect, parent, style = {}, fit = 1) {
|
|
|
64433
64433
|
};
|
|
64434
64434
|
}
|
|
64435
64435
|
/**
|
|
64436
|
-
* The rest value of the visual that is actually on the element: the same value the entity is
|
|
64437
|
-
* drawn with, so a motion returns to exactly that.
|
|
64438
|
-
*
|
|
64439
|
-
* @param element - The element whose rect is known.
|
|
64440
|
-
* @returns The component and the value to record, or `undefined` for an element with no visual.
|
|
64441
|
-
*/
|
|
64442
|
-
function restVisual(element) {
|
|
64443
|
-
const [visual] = visualOf$1(element);
|
|
64444
|
-
if (visual === void 0 || visual.value === true) return void 0;
|
|
64445
|
-
return {
|
|
64446
|
-
component: visual.type,
|
|
64447
|
-
value: visual.value
|
|
64448
|
-
};
|
|
64449
|
-
}
|
|
64450
|
-
/**
|
|
64451
64436
|
* Records the rest pose of one element before a hook runs: the transform from `Box` and the
|
|
64452
64437
|
* style, and the visual the element is actually drawn with. The content of a scroll records no
|
|
64453
64438
|
* rest `Transform`: the scroll step owns its pose, and the world brings an element back to every
|
|
@@ -64460,8 +64445,12 @@ function restVisual(element) {
|
|
|
64460
64445
|
function writeRest(ctx, element, parent) {
|
|
64461
64446
|
const projection = ctx.deps.world.projection;
|
|
64462
64447
|
if (element.type !== "content") projection.setRest(element.entity, Transform, restTransform(element.rect, parent, element.style, element.fit));
|
|
64463
|
-
const visual =
|
|
64464
|
-
if (visual
|
|
64448
|
+
const [visual] = visualOf$1(element);
|
|
64449
|
+
if (visual === void 0 || visual.value === true) return;
|
|
64450
|
+
const type = visual.type;
|
|
64451
|
+
const left = fieldsLeftAlone(element, type, type.owned);
|
|
64452
|
+
const current = left.length === 0 ? void 0 : ctx.deps.world.ecs.get(element.entity, type);
|
|
64453
|
+
projection.setRest(element.entity, type, restValueOf(current, visual.value, left));
|
|
64465
64454
|
}
|
|
64466
64455
|
/**
|
|
64467
64456
|
* Tells whether an element waits for the swap of a scene `world` builds aside (spec 31), or for the
|
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-
|
|
1
|
+
import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-B3cwICTC.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";
|
|
@@ -1280,6 +1280,25 @@ function boxOf(element) {
|
|
|
1280
1280
|
return element.boxed === true ? { box: 0 } : {};
|
|
1281
1281
|
}
|
|
1282
1282
|
/**
|
|
1283
|
+
* Tells whether a style states the width of its element: a width, or both side edges of an absolute element.
|
|
1284
|
+
*
|
|
1285
|
+
* @param style - The resolved style.
|
|
1286
|
+
* @returns True when it does.
|
|
1287
|
+
*/
|
|
1288
|
+
function statesWidth(style) {
|
|
1289
|
+
return style.width !== void 0 || style.position === "absolute" && style.left !== void 0 && style.right !== void 0;
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Tells whether a style states the height of its element: a height, or both top and bottom edges of an absolute
|
|
1293
|
+
* element.
|
|
1294
|
+
*
|
|
1295
|
+
* @param style - The resolved style.
|
|
1296
|
+
* @returns True when it does.
|
|
1297
|
+
*/
|
|
1298
|
+
function statesHeight(style) {
|
|
1299
|
+
return style.height !== void 0 || style.position === "absolute" && style.top !== void 0 && style.bottom !== void 0;
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1283
1302
|
* Whether the layout sized an image to nothing: an axis whose size its style states (a width or a
|
|
1284
1303
|
* height, or both edges of an absolute element) came out at 0. An image whose style states no size
|
|
1285
1304
|
* is 0 by 0 too, and draws as its `Sprite` says: at its texture's size, or at the size a game's own
|
|
@@ -1290,10 +1309,79 @@ function boxOf(element) {
|
|
|
1290
1309
|
* @returns True when it draws nothing.
|
|
1291
1310
|
*/
|
|
1292
1311
|
function sizedToNothing(style, rect) {
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1312
|
+
return statesWidth(style) && rect.w <= 0 || statesHeight(style) && rect.h <= 0;
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* The patch a live element writes into one of its components: every field but the ones the
|
|
1316
|
+
* component type gives to a plugin. That plugin keeps such a field for the life of the entity, so
|
|
1317
|
+
* a re-render never puts it back to its default: a label keeps the string `text` resolved for it.
|
|
1318
|
+
*
|
|
1319
|
+
* @param value - The component value the element carries now.
|
|
1320
|
+
* @param owned - The fields the component type gives to a plugin.
|
|
1321
|
+
* @returns The fields to write.
|
|
1322
|
+
* @example
|
|
1323
|
+
* ```ts
|
|
1324
|
+
* livePatch({ content: "Play", resolved: "" }, ["resolved"]); // { content: "Play" }
|
|
1325
|
+
* ```
|
|
1326
|
+
*/
|
|
1327
|
+
function livePatch(value, owned) {
|
|
1328
|
+
if (owned.length === 0) return value;
|
|
1329
|
+
return Object.fromEntries(Object.entries(value).filter(([field]) => !owned.includes(field)));
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* The rest pose recorded for an extra component: the value of this render, but the fields the
|
|
1333
|
+
* component type gives to a plugin stay as the entity carries them, so a render never resets them.
|
|
1334
|
+
*
|
|
1335
|
+
* @param current - The value the entity carries now; none before the component is added.
|
|
1336
|
+
* @param value - The value of this render.
|
|
1337
|
+
* @param owned - The fields the component type gives to a plugin.
|
|
1338
|
+
* @returns The rest value.
|
|
1339
|
+
* @example
|
|
1340
|
+
* ```ts
|
|
1341
|
+
* restValueOf({ until: 2000, left: 42 }, { until: 5000, left: 0 }, ["left"]); // { until: 5000, left: 42 }
|
|
1342
|
+
* ```
|
|
1343
|
+
*/
|
|
1344
|
+
function restValueOf(current, value, owned) {
|
|
1345
|
+
if (current === void 0 || owned.length === 0) return value;
|
|
1346
|
+
return {
|
|
1347
|
+
...current,
|
|
1348
|
+
...livePatch(value, owned)
|
|
1349
|
+
};
|
|
1350
|
+
}
|
|
1351
|
+
/** The sizes of a sprite ui leaves alone, by axis: one list each, never a new one. */
|
|
1352
|
+
const LEFT_NONE = [];
|
|
1353
|
+
const LEFT_WIDTH = ["width"];
|
|
1354
|
+
const LEFT_HEIGHT = ["height"];
|
|
1355
|
+
const LEFT_BOTH = ["width", "height"];
|
|
1356
|
+
/**
|
|
1357
|
+
* The list of sizes left alone for the axes that are.
|
|
1358
|
+
*
|
|
1359
|
+
* @param width - The width is left alone.
|
|
1360
|
+
* @param height - The height is left alone.
|
|
1361
|
+
* @returns One of the four lists.
|
|
1362
|
+
*/
|
|
1363
|
+
function leftSizes(width, height) {
|
|
1364
|
+
if (width && height) return LEFT_BOTH;
|
|
1365
|
+
if (width) return LEFT_WIDTH;
|
|
1366
|
+
return height ? LEFT_HEIGHT : LEFT_NONE;
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* The fields of a value ui does not write onto a live element, or record as its rest: those its component type gives
|
|
1370
|
+
* to a plugin and, for the `Sprite` of an image or an icon, the size on an axis its style does not state and the layout
|
|
1371
|
+
* left at 0. A game's own system sizes such a sprite; written again by ui (a new viewport, a covered root, a restore)
|
|
1372
|
+
* it went back to 0 by 0, drawn at its texture's size (F111). On a first add the size is 0 anyway, the texture's.
|
|
1373
|
+
*
|
|
1374
|
+
* @param element - The element.
|
|
1375
|
+
* @param type - The component type of the value.
|
|
1376
|
+
* @param owned - The fields its type gives to a plugin.
|
|
1377
|
+
* @returns The fields left alone.
|
|
1378
|
+
*/
|
|
1379
|
+
function fieldsLeftAlone(element, type, owned) {
|
|
1380
|
+
const { style, rect } = element;
|
|
1381
|
+
if (!(element.type === "image" || element.type === "icon") || type !== Sprite) return owned;
|
|
1382
|
+
const sizes = leftSizes(rect.w <= 0 && !statesWidth(style), rect.h <= 0 && !statesHeight(style));
|
|
1383
|
+
if (owned.length === 0) return sizes;
|
|
1384
|
+
return sizes.length === 0 ? owned : [...owned, ...sizes];
|
|
1297
1385
|
}
|
|
1298
1386
|
/**
|
|
1299
1387
|
* The visual component of an element: a sprite for an image or an icon (at alpha 0 while its style
|
|
@@ -1487,4 +1575,4 @@ function drawnRect(pose, local) {
|
|
|
1487
1575
|
};
|
|
1488
1576
|
}
|
|
1489
1577
|
//#endregion
|
|
1490
|
-
export {
|
|
1578
|
+
export { Layer as $, readStyle as A, Display as B, defineStyle as C, builtInStyles as D, bind as E, parentOf as F, Parent as G, NineSlice as H, poseUnder as I, Transform as J, Shape as K, rootPointOf as L, applyPose as M, isLeaving as N, defineTextStyles as O, localPoseOf as P, Exiting as Q, rootPoseInto as R, defineTokens as S, Text as T, Overlay as U, HudPart as V, OverlayLevel as W, componentsFor as X, arcDefaults as Y, sprite as Z, ScrollState as _, fitScaleOf as a, resource as at, popup as b, samePose as c, tag as ct, Box as d, Now as et, Covered as f, Scroll as g, LocalWrite as h, fieldsLeftAlone as i, mut as it, textFor as j, label as k, visualOf as l, Escapable as m, CONTENT as n, Tree as nt, livePatch as o, system as ot, DebugTrigger as p, Sprite as q, drawnRect as r, component as rt, restValueOf as s, systemsFor as st, ANCHOR as t, Order as tt, visualRectOf as u, UI_OWNER as v, Countdown as w, uiFor as x, UiCounters as y, rootPoseOf as z };
|
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-
|
|
2
|
+
import { n as read, t as sources } from "./sources-Djd8MjP9.mjs";
|
|
3
3
|
import { n as commands, t as run } from "./run-3QhrffgM.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
package/llms.txt
CHANGED
|
@@ -599,7 +599,7 @@ A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` se
|
|
|
599
599
|
- 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`.
|
|
600
600
|
- 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.
|
|
601
601
|
- 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.
|
|
602
|
-
- `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, a target of no area shown at its point (`{ x, y, w: 0, h: 0 }`; an `<anchor>` on it stands there at size 0, takes no tap, its children lay out and hit as usual; an inward `pad` past half the target leaves it at size 0 on the centre), `undefined` when none is shown (an `image` whose style states a size, `width`/`height` or both edges of an absolute one, laid out at 0 draws nothing and counts as not shown; one whose style states no size keeps its alpha and draws as its `Sprite` says), 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".
|
|
602
|
+
- `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, a target of no area shown at its point (`{ x, y, w: 0, h: 0 }`; an `<anchor>` on it stands there at size 0, takes no tap, its children lay out and hit as usual; an inward `pad` past half the target leaves it at size 0 on the centre), `undefined` when none is shown (an `image` whose style states a size, `width`/`height` or both edges of an absolute one, laid out at 0 draws nothing and counts as not shown; one whose style states no size keeps its alpha and draws as its `Sprite` says, ui never writing the size a game's system gives it), 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".
|
|
603
603
|
|
|
604
604
|
```tsx
|
|
605
605
|
// features/hud/view.tsx
|