@moku-labs/game 0.15.137 → 0.15.139
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/index.mjs +1 -1
- package/dist/{src-DFi6z9ru.mjs → src-BmQSICE2.mjs} +40 -11
- package/dist/testing.mjs +1 -1
- package/llms.txt +1 -0
- package/package.json +1 -1
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-
|
|
1
|
+
import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-BmQSICE2.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
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-
|
|
1
|
+
import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-BmQSICE2.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, 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, RevealLine, RevealRound, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, 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, 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 };
|
|
@@ -3232,7 +3232,7 @@ function enqueue$2(state, work) {
|
|
|
3232
3232
|
* @param signal - The node's abort signal.
|
|
3233
3233
|
* @returns The controller of the child signal.
|
|
3234
3234
|
*/
|
|
3235
|
-
function childOf(signal) {
|
|
3235
|
+
function childOf$1(signal) {
|
|
3236
3236
|
const child = new AbortController();
|
|
3237
3237
|
if (signal.aborted) {
|
|
3238
3238
|
child.abort(signal.reason);
|
|
@@ -3255,7 +3255,7 @@ function childOf(signal) {
|
|
|
3255
3255
|
* @returns The signal the guide handler is called with.
|
|
3256
3256
|
*/
|
|
3257
3257
|
function beginGuide(state, signal) {
|
|
3258
|
-
const child = childOf(signal);
|
|
3258
|
+
const child = childOf$1(signal);
|
|
3259
3259
|
state.guides.push(child);
|
|
3260
3260
|
child.signal.addEventListener("abort", () => {
|
|
3261
3261
|
const index = state.guides.indexOf(child);
|
|
@@ -3284,7 +3284,7 @@ function openForAnswers(ctx, gate, descriptor, answers, signal) {
|
|
|
3284
3284
|
at: ctx.deps.clock.now()
|
|
3285
3285
|
}));
|
|
3286
3286
|
if (ctx.state.fx.mode !== "live") return answered;
|
|
3287
|
-
const shown = childOf(signal);
|
|
3287
|
+
const shown = childOf$1(signal);
|
|
3288
3288
|
invoke(ctx.state.fx, ctx.log, descriptor, shown.signal);
|
|
3289
3289
|
return answered.finally(() => {
|
|
3290
3290
|
shown.abort();
|
|
@@ -16877,13 +16877,17 @@ function createSdfTextPipe(pixi) {
|
|
|
16877
16877
|
class SdfTextPipe extends pixi.BitmapTextPipe {
|
|
16878
16878
|
static extension = pixi.BitmapTextPipe.extension;
|
|
16879
16879
|
/**
|
|
16880
|
-
* Makes a text's proxy graphics as Pixi does, batchable at any length, with the edge of its glyphs.
|
|
16880
|
+
* Makes a text's proxy graphics as Pixi does, batchable at any length, with the edge of its glyphs. Pixi lays the
|
|
16881
|
+
* glyphs out here and again in the first `addRenderable`, which finds the text's update flag still set from its
|
|
16882
|
+
* construction: the layout made here is the text as it stands, so the flag is cleared, and a text changed later
|
|
16883
|
+
* sets it again (F195: the second layout was half the glyph work of every window's first draw).
|
|
16881
16884
|
*
|
|
16882
16885
|
* @param text - The text.
|
|
16883
16886
|
* @returns The proxy.
|
|
16884
16887
|
*/
|
|
16885
16888
|
initGpuText(text) {
|
|
16886
16889
|
const proxy = super.initGpuText(text);
|
|
16890
|
+
text._didTextUpdate = false;
|
|
16887
16891
|
const glyphs = {
|
|
16888
16892
|
perScale: NaN,
|
|
16889
16893
|
family: void 0,
|
|
@@ -34250,28 +34254,53 @@ function displayObjectOf(sctx, entity) {
|
|
|
34250
34254
|
* child whose `Parent` names another entity, or none, by now: it moved in the same frame (a hosted view a restore
|
|
34251
34255
|
* hung under the rebuilt host, F44), and the later steps of this pass hang it where it belongs.
|
|
34252
34256
|
*
|
|
34257
|
+
* The children are read from the host itself, front first: a detach takes the child at the read position out, so the
|
|
34258
|
+
* next one moves into it, and Pixi's `removeChild` finds it near the front. A scan of every view per parent that left
|
|
34259
|
+
* made the close of a window quadratic in its views (F195: 12–15 ms of the album's close frame on the A26). An object
|
|
34260
|
+
* of the host that tops no view (a dim, a mask, a picture's quad) is not a child, and is passed over.
|
|
34261
|
+
*
|
|
34253
34262
|
* @param sctx - Domain context of the sync module.
|
|
34254
34263
|
* @param entity - The parent entity.
|
|
34255
34264
|
* @param host - The container its children hang in.
|
|
34256
34265
|
*/
|
|
34257
34266
|
function detachChildren(sctx, entity, host) {
|
|
34258
34267
|
const state = sctx.ctx.state.sync;
|
|
34259
|
-
const
|
|
34260
|
-
|
|
34261
|
-
|
|
34262
|
-
|
|
34263
|
-
|
|
34268
|
+
const children = host.children;
|
|
34269
|
+
let orphans;
|
|
34270
|
+
let at = 0;
|
|
34271
|
+
while (at < children.length) {
|
|
34272
|
+
const child = childOf(state, children[at]);
|
|
34273
|
+
if (child === void 0 || child === entity) {
|
|
34274
|
+
at += 1;
|
|
34275
|
+
continue;
|
|
34276
|
+
}
|
|
34277
|
+
const object = children[at];
|
|
34278
|
+
if (object === void 0) break;
|
|
34264
34279
|
markView(sctx, child);
|
|
34265
34280
|
detach$1(object);
|
|
34266
34281
|
state.orphans.add(child);
|
|
34267
|
-
if (isLostOrphan(sctx, child, entity))
|
|
34282
|
+
if (isLostOrphan(sctx, child, entity)) {
|
|
34283
|
+
orphans ??= [];
|
|
34284
|
+
orphans.push(child);
|
|
34285
|
+
}
|
|
34268
34286
|
}
|
|
34269
|
-
if (orphans
|
|
34287
|
+
if (orphans !== void 0) sctx.ctx.log.warn("renderer: parent left before its children", {
|
|
34270
34288
|
parent: entity,
|
|
34271
34289
|
orphans
|
|
34272
34290
|
});
|
|
34273
34291
|
}
|
|
34274
34292
|
/**
|
|
34293
|
+
* The entity whose view an object of a host tops, through the top-to-view and the object-to-entity tables.
|
|
34294
|
+
*
|
|
34295
|
+
* @param state - The sync branch of the plugin state.
|
|
34296
|
+
* @param object - An object hanging in a host.
|
|
34297
|
+
* @returns The entity, or `undefined` for an object that tops no view.
|
|
34298
|
+
*/
|
|
34299
|
+
function childOf(state, object) {
|
|
34300
|
+
const view = object === void 0 ? void 0 : state.viewOfTop.get(object);
|
|
34301
|
+
return view === void 0 ? void 0 : state.entityOf.get(view.object);
|
|
34302
|
+
}
|
|
34303
|
+
/**
|
|
34275
34304
|
* Tells whether a child of a parent that left is an orphan worth a warning: it does not go in this pass, it plays no
|
|
34276
34305
|
* exit, and its `Parent` still names the parent that left.
|
|
34277
34306
|
*
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-
|
|
1
|
+
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-BmQSICE2.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-BuXptVI_.mjs";
|
package/llms.txt
CHANGED
|
@@ -572,6 +572,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
572
572
|
- Motion hooks are told why they play: `enter(view, item, hint, cause)` and `exit(view, item, hint, cause)` get `World.MotionCause`, `"mount"` (the view comes or goes with its screen: a mount, an unmount, a load, a restore, a paused or fast world) or `"change"` (a commit). A world projection plays them only for `"change"`; `ui` plays them for both. `app.world.projection.causeOf(entity)` answers how a view came or how it is leaving, also in a removal hook of its despawn, until the next frame.
|
|
573
573
|
- `app.world.projection.replace(spec)` swaps the spec of a registered projection; a mounted one runs its new `view` on the next frame. An unknown name throws. The caller is the dev hot swap.
|
|
574
574
|
- `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.
|
|
575
|
+
- `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, 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) 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".
|
|
575
576
|
- `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".
|
|
576
577
|
- `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.
|
|
577
578
|
- `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.
|