@moku-labs/game 0.15.159 → 0.15.160
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.mjs +1 -1
- package/dist/{commands-ZNq6JvED.d.mts → commands-CLhKYlot.d.mts} +1 -1
- package/dist/control.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +1 -1
- package/dist/{src-B-zAh2a7.mjs → src-qeTzNTZA.mjs} +35 -5
- package/dist/testing.mjs +1 -1
- package/dist/{visual-C6hcm5UJ.d.mts → visual-D_4mmn1u.d.mts} +1 -1
- package/dist/visual.d.mts +1 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Xt as audioPlugin, i as screen, k as flattenFeatures, rt as platformPlugin, t as createApp, zt as effectsPlugin } from "./src-
|
|
1
|
+
import { Xt as audioPlugin, i as screen, k as flattenFeatures, rt as platformPlugin, t as createApp, zt as effectsPlugin } from "./src-qeTzNTZA.mjs";
|
|
2
2
|
import { t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
|
@@ -157,8 +157,8 @@ declare const commands: Readonly<{
|
|
|
157
157
|
readonly ui: Pick<UiApi, "fill">;
|
|
158
158
|
}>;
|
|
159
159
|
scroll: Command<{
|
|
160
|
-
readonly key: "string";
|
|
161
160
|
readonly to: "number";
|
|
161
|
+
readonly key: "string";
|
|
162
162
|
}, boolean, HeadlessApp & {
|
|
163
163
|
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
164
164
|
} & {
|
package/dist/control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HeadlessApp } from "./headless-DFkrIVO4.mjs";
|
|
2
2
|
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-CM7Ng3EN.mjs";
|
|
3
|
-
import { t as commands } from "./commands-
|
|
3
|
+
import { t as commands } from "./commands-CLhKYlot.mjs";
|
|
4
4
|
import { t as defineCommand } from "./define-3zxu6rIq.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as uiPlugin, $t as animPlugin, A as defineEmitter, At as Pressed, B as types_exports$12, Bt as Emitter, C as hint, Cn as SaveUnreadableError, Ct as Draggable, D as tr, Dt as Pointer, E as defineScene, En as timePlugin, Et as Hovered, F as types_exports$17, Ft as Traced, G as types_exports$7, Gt as Glow, H as types_exports$10, Ht as Blur, I as types_exports$16, It as i18nPlugin, J as types_exports$4, Jt as defineFilter, K as types_exports$6, Kt as Noise, L as types_exports$15, Lt as messageArgument, M as defineBundles, Mt as Tappable, N as load, Nt as Touchable, O as defineFeature, Ot as PointerOver, P as ready, Pt as Traceable, Q as types_exports, Qt as assetsPlugin, R as types_exports$14, Rt as messageDuration, S as guide, Sn as modelPlugin, St as inputPlugin, T as projection, Tn as lifecyclePlugin, Tt as Held, U as types_exports$9, Ut as ColorMatrix, V as types_exports$11, Vt as Alpha, W as types_exports$8, Wt as Displacement, X as types_exports$2, Xt as audioPlugin, Y as types_exports$3, Yt as debugPlugin, Z as types_exports$1, Zt as scenesPlugin, _ as Dissolve, _n as contribution, _t as stagger, a as Wave, an as frameAt, at as defineAnimation, b as cubicBezier, bn as to, bt as use, c as Shadow, cn as PERF_GAP_BUCKETS, ct as haptic, d as Pixelate, dn as SHADER_WHATS, dt as play, en as AnimPlayer, et as resolve, f as Mirror, fn as CANVAS_RESTARTS, ft as sequence, g as Flash, gt as spawned, h as Fold, hn as flowPlugin, ht as spawn, i as screen, in as PASS_KINDS, it as HAPTIC_KINDS, j as music, jt as Swipeable, k as flattenFeatures, kt as Pressable, l as RevealRound, ln as PERF_LOG_VERSION, lt as mark, m as Grade, mn as worldPlugin, mt as sfx, n as createPlugin, nn as Frames, nt as textPlugin, o as Vignette, on as MONITOR_SECTIONS, ot as external, p as GradientMap, pn as DEMAND_REASONS, pt as set, q as types_exports$5, qt as Outline, r as defineGame, rn as rendererPlugin, rt as platformPlugin, s as Shine, sn as PERF_CAUSES, st as frames, t as createApp, tn as Animation, tt as defineMotion, u as RevealLine, un as PROBLEM_RULES, ut as parallel, v as Bloom, vn as exit, vt as stopSfx, w as schedule, wn as clockPlugin, wt as DropTarget, x as defineEffect, xn as type, xt as wait, y as Aura, yn as slot, yt as tween, z as types_exports$13, zt as effectsPlugin } from "./src-
|
|
1
|
+
import { $ as uiPlugin, $t as animPlugin, A as defineEmitter, At as Pressed, B as types_exports$12, Bt as Emitter, C as hint, Cn as SaveUnreadableError, Ct as Draggable, D as tr, Dt as Pointer, E as defineScene, En as timePlugin, Et as Hovered, F as types_exports$17, Ft as Traced, G as types_exports$7, Gt as Glow, H as types_exports$10, Ht as Blur, I as types_exports$16, It as i18nPlugin, J as types_exports$4, Jt as defineFilter, K as types_exports$6, Kt as Noise, L as types_exports$15, Lt as messageArgument, M as defineBundles, Mt as Tappable, N as load, Nt as Touchable, O as defineFeature, Ot as PointerOver, P as ready, Pt as Traceable, Q as types_exports, Qt as assetsPlugin, R as types_exports$14, Rt as messageDuration, S as guide, Sn as modelPlugin, St as inputPlugin, T as projection, Tn as lifecyclePlugin, Tt as Held, U as types_exports$9, Ut as ColorMatrix, V as types_exports$11, Vt as Alpha, W as types_exports$8, Wt as Displacement, X as types_exports$2, Xt as audioPlugin, Y as types_exports$3, Yt as debugPlugin, Z as types_exports$1, Zt as scenesPlugin, _ as Dissolve, _n as contribution, _t as stagger, a as Wave, an as frameAt, at as defineAnimation, b as cubicBezier, bn as to, bt as use, c as Shadow, cn as PERF_GAP_BUCKETS, ct as haptic, d as Pixelate, dn as SHADER_WHATS, dt as play, en as AnimPlayer, et as resolve, f as Mirror, fn as CANVAS_RESTARTS, ft as sequence, g as Flash, gt as spawned, h as Fold, hn as flowPlugin, ht as spawn, i as screen, in as PASS_KINDS, it as HAPTIC_KINDS, j as music, jt as Swipeable, k as flattenFeatures, kt as Pressable, l as RevealRound, ln as PERF_LOG_VERSION, lt as mark, m as Grade, mn as worldPlugin, mt as sfx, n as createPlugin, nn as Frames, nt as textPlugin, o as Vignette, on as MONITOR_SECTIONS, ot as external, p as GradientMap, pn as DEMAND_REASONS, pt as set, q as types_exports$5, qt as Outline, r as defineGame, rn as rendererPlugin, rt as platformPlugin, s as Shine, sn as PERF_CAUSES, st as frames, t as createApp, tn as Animation, tt as defineMotion, u as RevealLine, un as PROBLEM_RULES, ut as parallel, v as Bloom, vn as exit, vt as stopSfx, w as schedule, wn as clockPlugin, wt as DropTarget, x as defineEffect, xn as type, xt as wait, y as Aura, yn as slot, yt as tween, z as types_exports$13, zt as effectsPlugin } from "./src-qeTzNTZA.mjs";
|
|
2
2
|
import { $ as Overlay, D as defineStyle, E as defineTokens, L as defineTextFormats, M as Countdown, N as Text, P as bind, Q as NineSlice, R as defineTextStyles, X as Display, Z as HudPart, _ as DebugTrigger, ct as Exiting, dt as Order, ft as Tree, gt as system, h as Box, ht as resource, it as Transform, lt as Layer, mt as mut, nt as Shape, pt as component, rt as Sprite, st as sprite, tt as Parent, ut as Now, vt as tag, w as popup, x as ScrollState, y as LocalWrite, z as label } from "./visual-x0TPowBE.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, Aura, Bloom, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Dissolve, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, Flash, types_exports$6 as Flow, Fold, Frames, Glow, Grade, GradientMap, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, Mirror, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, Pixelate, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, RevealLine, RevealRound, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shadow, Shape, Shine, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, Vignette, Wave, 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, defineTextFormats, 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.d.mts
CHANGED
|
@@ -10888,11 +10888,40 @@ function deepEquals(left, right) {
|
|
|
10888
10888
|
if (left === right) return true;
|
|
10889
10889
|
if (left === null || right === null) return false;
|
|
10890
10890
|
if (typeof left !== "object" || typeof right !== "object") return false;
|
|
10891
|
-
if (Array.isArray(left)) return Array.isArray(right) && left
|
|
10891
|
+
if (Array.isArray(left)) return Array.isArray(right) && sameEntries(left, right);
|
|
10892
10892
|
if (Array.isArray(right)) return false;
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10893
|
+
return sameFields$1(left, right);
|
|
10894
|
+
}
|
|
10895
|
+
/**
|
|
10896
|
+
* Compares two arrays entry by entry, with an index loop: no closure and no iterator.
|
|
10897
|
+
*
|
|
10898
|
+
* @param left - First array.
|
|
10899
|
+
* @param right - Second array.
|
|
10900
|
+
* @returns True when both have the same length and equal entries.
|
|
10901
|
+
*/
|
|
10902
|
+
function sameEntries(left, right) {
|
|
10903
|
+
if (left.length !== right.length) return false;
|
|
10904
|
+
for (let index = 0; index < left.length; index += 1) if (!deepEquals(left[index], right[index])) return false;
|
|
10905
|
+
return true;
|
|
10906
|
+
}
|
|
10907
|
+
/**
|
|
10908
|
+
* Compares the own fields of two objects: every field of `left` equals the same field of `right`,
|
|
10909
|
+
* and both have as many own fields. A `for…in` with an own check reads the keys without the array
|
|
10910
|
+
* `Object.keys` builds, so a compare allocates nothing; the result is the one `Object.keys` gave.
|
|
10911
|
+
*
|
|
10912
|
+
* @param left - First object.
|
|
10913
|
+
* @param right - Second object.
|
|
10914
|
+
* @returns True when both hold the same data.
|
|
10915
|
+
*/
|
|
10916
|
+
function sameFields$1(left, right) {
|
|
10917
|
+
let count = 0;
|
|
10918
|
+
for (const key in left) {
|
|
10919
|
+
if (!Object.hasOwn(left, key)) continue;
|
|
10920
|
+
count += 1;
|
|
10921
|
+
if (!deepEquals(left[key], right[key])) return false;
|
|
10922
|
+
}
|
|
10923
|
+
for (const key in right) if (Object.hasOwn(right, key)) count -= 1;
|
|
10924
|
+
return count === 0;
|
|
10896
10925
|
}
|
|
10897
10926
|
/**
|
|
10898
10927
|
* Reads the node a `Tree` value carries. A tag stores `true` and carries none.
|
|
@@ -13533,7 +13562,8 @@ function settleUnchanged(pctx, spec, view, entry) {
|
|
|
13533
13562
|
* @param counts - The counters of this reconcile.
|
|
13534
13563
|
*/
|
|
13535
13564
|
function applyLive(pctx, spec, mounted, live, entry, counts) {
|
|
13536
|
-
const same = !entry.force && live.item === entry.item;
|
|
13565
|
+
const same = !entry.force && (live.item === entry.item || !entry.direct && deepEquals(live.item, entry.item));
|
|
13566
|
+
if (same) live.item = entry.item;
|
|
13537
13567
|
const swap = same ? void 0 : swapFor(pctx, spec, live, entry.item);
|
|
13538
13568
|
if (swap !== void 0) {
|
|
13539
13569
|
if (swapEntry(pctx, spec, mounted, live, swap, entry)) counts.entered += 1;
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gn as refuseStart, k as flattenFeatures, t as createApp, vn as exit, xn as type } from "./src-
|
|
1
|
+
import { gn as refuseStart, k as flattenFeatures, t as createApp, vn as exit, xn as type } from "./src-qeTzNTZA.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-yi2XmYWC.mjs";
|
|
@@ -3,7 +3,7 @@ import { Y as AnimApi, r as UiApi } from "./types-D-vnlN3n.mjs";
|
|
|
3
3
|
import { R as InputApi } from "./types-Bl9jyah_.mjs";
|
|
4
4
|
import { r as Repro } from "./headless-DFkrIVO4.mjs";
|
|
5
5
|
import { i as ControlApp, o as InputOf } from "./types-CM7Ng3EN.mjs";
|
|
6
|
-
import { t as commands } from "./commands-
|
|
6
|
+
import { t as commands } from "./commands-CLhKYlot.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/visual/types.d.ts
|
|
9
9
|
/** The base commands of the `/control` door, keyed by their short names. */
|
package/dist/visual.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-
|
|
1
|
+
import { a as VisualApp, c as VisualRenderer, d as VisualStart, f as VisualStep, h as VisualTolerance, i as CheckpointResult, l as VisualReport, m as VisualTestResult, n as runVisualTests, o as VisualOptions, p as VisualTest, r as defineVisualTest, s as VisualPage, t as parseVisualArgv, u as VisualSetup } from "./visual-D_4mmn1u.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/llms.txt
CHANGED
|
@@ -576,6 +576,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
576
576
|
- `projection({ …, initialOnly: [[Shape, ["sweep"]]] })`: `view` gives those fields once, at the birth of a view; after that they belong to another writer (a system drawing a timer arc from `Now`), and no changed item, motion, end-of-motion check (`world:view-corrected`), rollback, `settle`, restore or load writes or compares them, as with `mute()` for every view's whole life. Field names are checked per component; a pair with no field throws at register. Absent, every field is the projection's.
|
|
577
577
|
- `projection({ …, warm: (player, session) => item })`: a warm window, since 0.15.47. `warm` returns one item of the type `from` gives, the window as it opens (its closed or default state); while `from` does not show that key, or shows it with another content (a gated window's dim, below), the world builds its view in idle frames (by root and by part, under two thirds of the frame interval, only in a live world on a drawing renderer, never while an owned motion runs but for a gated window's dim) and keeps it hidden: not drawn, not hit, `entityOf` answers nothing. When `from` shows the key, the open only shows the held view in the next frame: an item equal to the warm one writes nothing, another one writes only the difference; `enter` and `loop` play as for a new view. Example, a settings sheet: `projection({ name: "settings.sheet", layer: "ui", from: (player, session) => session.sheet?.kind === "settings" ? [settingsModel(player, session, tables)] : [], key: sheet => sheet.id, view: settingsView, warm: (player, session) => settingsModel(player, { ...session, sheet: { kind: "settings", page: "main" } }, tables) })`. Cost: the memory of the held view (A Memory Missing's album: about +2 MB of JS heap, textures unchanged); after each close the view goes cold and is built again in idle frames (the album: 41–58 frames of work, about a second, at 6× CPU); a commit that changes the warm item rebuilds it, so it suits windows whose item rarely changes (settings, a shop). A `warm` or a `view` that throws logs `world:projection-failed` and the window opens as before. World README, "Warm windows".
|
|
578
578
|
- A gated window (F202) keeps one key from its dim into its open (`from` shows the dim item, then the open one, while `ready` loads its pictures). Give it a `warm` that answers the open item while the dim shows (and nothing otherwise): the open view is built aside under the dim, also through the press tween of the tapped button (other warm windows wait for that motion to end), and the commit of the open item swaps the views in one frame: the dim view leaves at once (cause `"discard"`, no exit), the held one is shown with its `enter`, only the difference to the warm item written. A commit of the dim's content as a new object swaps nothing. While the dim shows, `entityOf` answers the dim's elements for keys both views have (the root, the scrim) and the open's after the swap. `ready` waits for the build too: it answers `false` while `world.projection.left()` is finite and posts once the build ended, at most 400 ms (game clock) after its bundles settled. World README, "A gated window".
|
|
579
|
+
- A play reconcile takes an item with the same content as the last one (equal as plain data, also as a new object) as unchanged: `view` does not run, a screen keeps its node and `ui` does not reconcile it (F230: a merge hands ~70 board items out as new objects). `view` is a projection of its item: a value it reads from elsewhere shows with the next changed item, a forced rerun or a locale. World README, "When an item did not change".
|
|
579
580
|
- `from(player, session, sw)`: the third argument is the switch another plugin last handed the projection with `projection.feed(name, sw)`, a `SceneSwitch` `{ from, to, progress }` (the scene left, the scene entered, `progress` 0 to 1), `undefined` for a projection never fed; a `from` with two parameters reads the state alone, as before. A loader reads it: `from: (_player, _session, sw: SceneSwitch | undefined) => ({ to: sw?.to ?? "", progress: sw?.progress ?? 0 })`. World README, "Feeding a projection".
|
|
580
581
|
- `app.input.lock.window(rect | null | undefined)`: the input lock `ui` sets for a guide (`Input.LockWindow` = `{ x, y, w, h }` in reference units, kept by reference and written in place); a press outside reaches no view and answers `flow.gate.state().blocked` or nothing, a drop or trace sample outside finds nothing; `null` locks everything, `undefined` lifts it. The doors `tap`, `press`, `drag`, `swipe`, `trace` are never locked.
|
|
581
582
|
- `input`: one followed pointer. A finger that has not started a gesture (pressed, inside the tap slop, no long press, no trace) gives way to the next finger that goes down, wherever it rests, and its press is cancelled; a finger that started a gesture keeps it. `Pointer.id` is the followed `pointerId` (`-1` at rest): a system that measures the finger's travel starts over when it changes.
|