@moku-labs/game 0.15.10 → 0.15.12
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.d.mts +1 -1
- package/dist/app/page.mjs +1 -1
- package/dist/app/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-DoMH0hnR.d.mts → commands-C3yVtCg1.d.mts} +5 -5
- package/dist/component-DGg5DqKK.mjs +44 -0
- package/dist/control.d.mts +4 -4
- package/dist/{define-B8A5IoeS.d.mts → define-DbxBzO-G.d.mts} +2 -2
- package/dist/{flatten-BkXuscAV.mjs → flatten-nUX9PpGo.mjs} +1 -44
- package/dist/{headless-CrxofjLt.d.mts → headless-DHtavbqk.d.mts} +1 -1
- package/dist/{index-PbX7OQIC.d.mts → index-CsTMiO0x.d.mts} +3 -3
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/inspect.d.mts +6 -7
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/{runtime-Bk_rHR3K.d.mts → runtime-Bxy2zoCG.d.mts} +1 -1
- package/dist/{runtime-CBZgWgzx.mjs → runtime-DnM9i73o.mjs} +2 -1
- package/dist/{sources-QCowxSpC.mjs → sources-Fbq_PFVH.mjs} +82 -35
- package/dist/{src-zXAFOqEc.mjs → src-FIcYaXro.mjs} +17 -452
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-B73p1XBn.d.mts → types-CpBnGqDU.d.mts} +3 -3
- package/dist/{types-i77Nrrv-.d.mts → types-CuEK0Vam.d.mts} +3733 -3719
- package/dist/{types-Dr5uC2fS.d.mts → types-CveBhKTs.d.mts} +4 -4
- package/dist/{types-DwktxRrt.d.mts → types-D5Pmo8BD.d.mts} +1 -1
- package/dist/{types-YXykgTOp.d.mts → types-_a6-ALzz.d.mts} +2 -2
- package/dist/{visual-CQnurNOj.d.mts → visual-B5Sypqal.d.mts} +6 -6
- package/dist/{visual-CIUx49C0.mjs → visual-CbGKzlj0.mjs} +450 -3
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.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 { d as graphHash, f as isRestCheckpoint, h as pushEntry, i as servePaused, l as findNode, m as compact, n as captureFrame, o as collectFlows, p as slotNames, r as serveCaptures, s as describeGraph, t as cancelCaptures, u as framePath } from "./capture-D7XvoHdH.mjs";
|
|
5
|
-
import { A as
|
|
5
|
+
import { $ as component, A as localPoseOf, B as OverlayLevel, C as builtInStyles, D as textFor, E as readStyle, F as rootPoseOf, G as arcDefaults, H as Shape, I as Display, J as Exiting, K as componentsFor, L as HudPart, M as poseUnder, N as rootPointOf, O as applyPose, P as rootPoseInto, Q as Tree, R as NineSlice, U as Sprite, V as Parent, W as Transform, X as Now, Y as Layer, Z as Order, _ as uiFor, a as visualOf$1, b as Countdown, c as Covered, d as LocalWrite, f as Scroll, h as UiCounters, i as samePose, it as tag, j as parentOf$1, k as isLeaving, l as DebugTrigger, m as UI_OWNER, n as drawnRect, nt as system, o as visualRectOf, p as ScrollState, r as fitScaleOf, rt as systemsFor, s as Box, t as CONTENT$1, tt as resource, u as Escapable, x as Text, z as Overlay } from "./visual-CbGKzlj0.mjs";
|
|
6
6
|
import { a as isDev } from "./dev-BNndV-hU.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { n as isComponentDefinition } from "./component-DGg5DqKK.mjs";
|
|
8
|
+
import { n as flatten } from "./flatten-nUX9PpGo.mjs";
|
|
8
9
|
import { envPlugin, logPlugin } from "@moku-labs/common/browser";
|
|
9
10
|
import { createCoreConfig } from "@moku-labs/core";
|
|
10
11
|
/**
|
|
@@ -24379,250 +24380,6 @@ function destroyPools(state) {
|
|
|
24379
24380
|
state.pooled = 0;
|
|
24380
24381
|
}
|
|
24381
24382
|
//#endregion
|
|
24382
|
-
//#region src/plugins/renderer/sync/pose.ts
|
|
24383
|
-
/**
|
|
24384
|
-
* @file renderer/sync — the pose helpers: where an entity really is, in root (reference) space,
|
|
24385
|
-
* and the local pose that puts it there under a parent. Pure component math over `world.ecs.get`,
|
|
24386
|
-
* the same math the renderer draws with: `position` is where the `pivot` lands, and the pivot is
|
|
24387
|
-
* the local point the view turns and scales around.
|
|
24388
|
-
*
|
|
24389
|
-
* Engine-internal, not a root export. `input`, `anim` and `ui` import `rootPoseOf` and
|
|
24390
|
-
* `localPoseOf` from this module path (`../renderer/sync/pose`) and never walk the `Parent` chain
|
|
24391
|
-
* themselves; a per-frame reader (`effects`' following emitters) writes the root pose into its own
|
|
24392
|
-
* object with `rootPoseInto`, which allocates nothing; `input` places a carried view under the last pose of a despawned held view with
|
|
24393
|
-
* `poseUnder`; `sync` places a box with `rootPointOf`. `input` places the drop lookup of an aimed
|
|
24394
|
-
* view with `applyPose`.
|
|
24395
|
-
*/
|
|
24396
|
-
/** How deep a parent chain is followed; deeper is treated as a loop. */
|
|
24397
|
-
const MAX_DEPTH$6 = 32;
|
|
24398
|
-
/**
|
|
24399
|
-
* The parent an entity moves with.
|
|
24400
|
-
*
|
|
24401
|
-
* @param ecs - The world read.
|
|
24402
|
-
* @param entity - The entity.
|
|
24403
|
-
* @returns The parent entity, or `0` when it has none or names itself.
|
|
24404
|
-
*/
|
|
24405
|
-
function parentOf$1(ecs, entity) {
|
|
24406
|
-
const parent = ecs.get(entity, Parent)?.entity ?? 0;
|
|
24407
|
-
return parent === entity ? 0 : parent;
|
|
24408
|
-
}
|
|
24409
|
-
/**
|
|
24410
|
-
* Tells whether an entity is on its way out: it or an ancestor of its `Parent` chain carries `Exiting` (a ui element
|
|
24411
|
-
* whose exit plays, a world view in its exit queue). Its despawn is coming; nothing else of the teardown is owed.
|
|
24412
|
-
*
|
|
24413
|
-
* @param ecs - The world read.
|
|
24414
|
-
* @param entity - The entity.
|
|
24415
|
-
* @returns True while it, or what it hangs under, leaves.
|
|
24416
|
-
*/
|
|
24417
|
-
function isLeaving(ecs, entity) {
|
|
24418
|
-
let current = entity;
|
|
24419
|
-
for (let depth = 0; depth < MAX_DEPTH$6 && current !== 0; depth += 1) {
|
|
24420
|
-
if (ecs.has(current, Exiting)) return true;
|
|
24421
|
-
current = parentOf$1(ecs, current);
|
|
24422
|
-
}
|
|
24423
|
-
return false;
|
|
24424
|
-
}
|
|
24425
|
-
/**
|
|
24426
|
-
* A fresh copy of a pose, so a caller may change what it got without touching the world.
|
|
24427
|
-
*
|
|
24428
|
-
* @param pose - The pose to copy.
|
|
24429
|
-
* @returns The same numbers in new objects.
|
|
24430
|
-
* @example
|
|
24431
|
-
* ```ts
|
|
24432
|
-
* copyPose({ x: 1, y: 2, rotation: 0, scale: 1, pivot: { x: 0, y: 0 } }).pivot.x; // 0
|
|
24433
|
-
* ```
|
|
24434
|
-
*/
|
|
24435
|
-
function copyPose(pose) {
|
|
24436
|
-
return {
|
|
24437
|
-
x: pose.x,
|
|
24438
|
-
y: pose.y,
|
|
24439
|
-
rotation: pose.rotation,
|
|
24440
|
-
scale: pose.scale,
|
|
24441
|
-
pivot: {
|
|
24442
|
-
x: pose.pivot.x,
|
|
24443
|
-
y: pose.pivot.y
|
|
24444
|
-
}
|
|
24445
|
-
};
|
|
24446
|
-
}
|
|
24447
|
-
/**
|
|
24448
|
-
* Moves a point out of the local space of a pose, into the space the pose sits in.
|
|
24449
|
-
*
|
|
24450
|
-
* @param pose - The pose whose local space the point is in.
|
|
24451
|
-
* @param point - The local point.
|
|
24452
|
-
* @returns The point one space higher.
|
|
24453
|
-
* @example
|
|
24454
|
-
* ```ts
|
|
24455
|
-
* applyPose({ x: 10, y: 0, rotation: 0, scale: 2, pivot: { x: 5, y: 0 } }, { x: 5, y: 1 });
|
|
24456
|
-
* // { x: 10, y: 2 }
|
|
24457
|
-
* ```
|
|
24458
|
-
*/
|
|
24459
|
-
function applyPose(pose, point) {
|
|
24460
|
-
const cos = Math.cos(pose.rotation);
|
|
24461
|
-
const sin = Math.sin(pose.rotation);
|
|
24462
|
-
const dx = point.x - pose.pivot.x;
|
|
24463
|
-
const dy = point.y - pose.pivot.y;
|
|
24464
|
-
return {
|
|
24465
|
-
x: pose.x + pose.scale * (dx * cos - dy * sin),
|
|
24466
|
-
y: pose.y + pose.scale * (dx * sin + dy * cos)
|
|
24467
|
-
};
|
|
24468
|
-
}
|
|
24469
|
-
/**
|
|
24470
|
-
* Places a local pose under a parent pose: the pose in the space the parent sits in. The step
|
|
24471
|
-
* `rootPoseOf` takes once per parent: the position through the parent's pivot, rotation, scale
|
|
24472
|
-
* and position, the rotations added and the scales multiplied.
|
|
24473
|
-
*
|
|
24474
|
-
* @param above - The parent pose.
|
|
24475
|
-
* @param local - The pose under it.
|
|
24476
|
-
* @returns The composed pose; it keeps the local pivot.
|
|
24477
|
-
* @example
|
|
24478
|
-
* ```ts
|
|
24479
|
-
* poseUnder(
|
|
24480
|
-
* { x: 400, y: 300, rotation: 0, scale: 2, pivot: { x: 0, y: 0 } },
|
|
24481
|
-
* { x: 0, y: 30, rotation: 0, scale: 1, pivot: { x: 0, y: 0 } }
|
|
24482
|
-
* ); // { x: 400, y: 360, rotation: 0, scale: 2, pivot: { x: 0, y: 0 } }
|
|
24483
|
-
* ```
|
|
24484
|
-
*/
|
|
24485
|
-
function poseUnder(above, local) {
|
|
24486
|
-
const landed = applyPose(above, local);
|
|
24487
|
-
return {
|
|
24488
|
-
x: landed.x,
|
|
24489
|
-
y: landed.y,
|
|
24490
|
-
rotation: local.rotation + above.rotation,
|
|
24491
|
-
scale: local.scale * above.scale,
|
|
24492
|
-
pivot: {
|
|
24493
|
-
x: local.pivot.x,
|
|
24494
|
-
y: local.pivot.y
|
|
24495
|
-
}
|
|
24496
|
-
};
|
|
24497
|
-
}
|
|
24498
|
-
/**
|
|
24499
|
-
* Where an entity really is, written into the caller's pose: its `Transform` composed through the `Parent` chain,
|
|
24500
|
-
* every pivot on the way applied, the numbers of `rootPoseOf` (the same steps in the same order). The answer keeps the
|
|
24501
|
-
* entity's own pivot. Allocates nothing: a reader that asks every frame passes the same object.
|
|
24502
|
-
*
|
|
24503
|
-
* @param ecs - The world read, `world.ecs`.
|
|
24504
|
-
* @param entity - The entity to place.
|
|
24505
|
-
* @param out - The pose to write, its `pivot` object included; it may be `own`.
|
|
24506
|
-
* @param own - A pose to use in place of the entity's own `Transform`, such as its rest pose.
|
|
24507
|
-
* @returns `out`, in root space. An entity without a `Transform` sits at the identity pose.
|
|
24508
|
-
* @example
|
|
24509
|
-
* ```ts
|
|
24510
|
-
* // `effects` follows a host every frame: the slot sits at (40, 60) scaled 0.5, the host at (100, 200) inside it.
|
|
24511
|
-
* const pose = { x: 0, y: 0, rotation: 0, scale: 1, pivot: { x: 0, y: 0 } };
|
|
24512
|
-
* rootPoseInto(ctx.require(worldPlugin).ecs, host, pose);
|
|
24513
|
-
* // pose is { x: 90, y: 160, rotation: 0, scale: 0.5, pivot: { x: 0, y: 0 } }
|
|
24514
|
-
* ```
|
|
24515
|
-
*/
|
|
24516
|
-
function rootPoseInto(ecs, entity, out, own) {
|
|
24517
|
-
const start = own ?? ecs.get(entity, Transform) ?? Transform.defaults;
|
|
24518
|
-
out.x = start.x;
|
|
24519
|
-
out.y = start.y;
|
|
24520
|
-
out.rotation = start.rotation;
|
|
24521
|
-
out.scale = start.scale;
|
|
24522
|
-
out.pivot.x = start.pivot.x;
|
|
24523
|
-
out.pivot.y = start.pivot.y;
|
|
24524
|
-
let current = entity;
|
|
24525
|
-
for (let depth = 0; depth < MAX_DEPTH$6; depth += 1) {
|
|
24526
|
-
const parent = parentOf$1(ecs, current);
|
|
24527
|
-
if (parent === 0) break;
|
|
24528
|
-
const above = ecs.get(parent, Transform) ?? Transform.defaults;
|
|
24529
|
-
const cos = Math.cos(above.rotation);
|
|
24530
|
-
const sin = Math.sin(above.rotation);
|
|
24531
|
-
const dx = out.x - above.pivot.x;
|
|
24532
|
-
const dy = out.y - above.pivot.y;
|
|
24533
|
-
out.x = above.x + above.scale * (dx * cos - dy * sin);
|
|
24534
|
-
out.y = above.y + above.scale * (dx * sin + dy * cos);
|
|
24535
|
-
out.rotation = out.rotation + above.rotation;
|
|
24536
|
-
out.scale = out.scale * above.scale;
|
|
24537
|
-
current = parent;
|
|
24538
|
-
}
|
|
24539
|
-
return out;
|
|
24540
|
-
}
|
|
24541
|
-
/**
|
|
24542
|
-
* Where an entity really is: its `Transform` composed through the `Parent` chain, every pivot on
|
|
24543
|
-
* the way applied. The answer keeps the entity's own pivot, so it can be written straight into the
|
|
24544
|
-
* `Transform` of an entity without a parent and the view does not move.
|
|
24545
|
-
*
|
|
24546
|
-
* @param ecs - The world read, `world.ecs`.
|
|
24547
|
-
* @param entity - The entity to place.
|
|
24548
|
-
* @param own - A pose to use in place of the entity's own `Transform`, such as its rest pose.
|
|
24549
|
-
* @returns The pose in root space, a fresh object. An entity without a `Transform` sits at the identity pose.
|
|
24550
|
-
* @example
|
|
24551
|
-
* ```ts
|
|
24552
|
-
* // `input` lifts a board cell out of its slot: the slot sits at (40, 60) scaled 0.5,
|
|
24553
|
-
* // the cell at (100, 200) inside it.
|
|
24554
|
-
* rootPoseOf(ctx.require(worldPlugin).ecs, cell);
|
|
24555
|
-
* // { x: 90, y: 160, rotation: 0, scale: 0.5, pivot: { x: 0, y: 0 } }
|
|
24556
|
-
* ```
|
|
24557
|
-
*/
|
|
24558
|
-
function rootPoseOf(ecs, entity, own) {
|
|
24559
|
-
return rootPoseInto(ecs, entity, {
|
|
24560
|
-
x: 0,
|
|
24561
|
-
y: 0,
|
|
24562
|
-
rotation: 0,
|
|
24563
|
-
scale: 1,
|
|
24564
|
-
pivot: {
|
|
24565
|
-
x: 0,
|
|
24566
|
-
y: 0
|
|
24567
|
-
}
|
|
24568
|
-
}, own);
|
|
24569
|
-
}
|
|
24570
|
-
/**
|
|
24571
|
-
* The inverse of `rootPoseOf`: the local pose under `parent` that puts an entity at a root pose.
|
|
24572
|
-
* The pivot is kept, as it is a local point of the entity itself.
|
|
24573
|
-
*
|
|
24574
|
-
* @param ecs - The world read, `world.ecs`.
|
|
24575
|
-
* @param parent - The entity to hang under; `0` for none, which answers the root pose itself.
|
|
24576
|
-
* @param root - The pose in root space.
|
|
24577
|
-
* @returns The local pose. A parent collapsed to scale 0 counts as scale 1, so the answer stays
|
|
24578
|
-
* finite.
|
|
24579
|
-
* @example
|
|
24580
|
-
* ```ts
|
|
24581
|
-
* // `input` drops the cell back into the slot at (40, 60) scaled 0.5, where the finger left it.
|
|
24582
|
-
* localPoseOf(ctx.require(worldPlugin).ecs, slot, {
|
|
24583
|
-
* x: 90, y: 160, rotation: 0, scale: 0.5, pivot: { x: 0, y: 0 }
|
|
24584
|
-
* });
|
|
24585
|
-
* // { x: 100, y: 200, rotation: 0, scale: 1, pivot: { x: 0, y: 0 } }
|
|
24586
|
-
* ```
|
|
24587
|
-
*/
|
|
24588
|
-
function localPoseOf(ecs, parent, root) {
|
|
24589
|
-
if (parent === 0) return copyPose(root);
|
|
24590
|
-
const above = rootPoseOf(ecs, parent);
|
|
24591
|
-
const scale = above.scale === 0 ? 1 : above.scale;
|
|
24592
|
-
const cos = Math.cos(-above.rotation);
|
|
24593
|
-
const sin = Math.sin(-above.rotation);
|
|
24594
|
-
const dx = root.x - above.x;
|
|
24595
|
-
const dy = root.y - above.y;
|
|
24596
|
-
return {
|
|
24597
|
-
x: above.pivot.x + (dx * cos - dy * sin) / scale,
|
|
24598
|
-
y: above.pivot.y + (dx * sin + dy * cos) / scale,
|
|
24599
|
-
rotation: root.rotation - above.rotation,
|
|
24600
|
-
scale: root.scale / scale,
|
|
24601
|
-
pivot: {
|
|
24602
|
-
x: root.pivot.x,
|
|
24603
|
-
y: root.pivot.y
|
|
24604
|
-
}
|
|
24605
|
-
};
|
|
24606
|
-
}
|
|
24607
|
-
/**
|
|
24608
|
-
* Where a local point of an entity lands in root (reference) space: the point posed through the
|
|
24609
|
-
* entity's own `Transform` and its whole `Parent` chain, the forward walk of the hit test's
|
|
24610
|
-
* `localPoseOf`. The scale is the real one, so a view collapsed to scale 0 lands on one point.
|
|
24611
|
-
*
|
|
24612
|
-
* @param ecs - The world read, `world.ecs`.
|
|
24613
|
-
* @param entity - The entity whose local space the point is in.
|
|
24614
|
-
* @param point - The local point.
|
|
24615
|
-
* @returns The point in root space, a fresh object.
|
|
24616
|
-
* @example
|
|
24617
|
-
* ```ts
|
|
24618
|
-
* // The corner of a 64 x 64 cell at (100, 200) inside a slot at (40, 60) scaled 0.5.
|
|
24619
|
-
* rootPointOf(ctx.require(worldPlugin).ecs, cell, { x: -32, y: -32 }); // { x: 74, y: 144 }
|
|
24620
|
-
* ```
|
|
24621
|
-
*/
|
|
24622
|
-
function rootPointOf(ecs, entity, point) {
|
|
24623
|
-
return applyPose(rootPoseOf(ecs, entity), point);
|
|
24624
|
-
}
|
|
24625
|
-
//#endregion
|
|
24626
24383
|
//#region src/plugins/renderer/sync/layers.ts
|
|
24627
24384
|
/**
|
|
24628
24385
|
* @file renderer/sync — the layers. `scenes` declares them through `world.projection.setLayers`;
|
|
@@ -25477,9 +25234,9 @@ function holdsLoops(state, range) {
|
|
|
25477
25234
|
}
|
|
25478
25235
|
/**
|
|
25479
25236
|
* Tells whether the endless loops of a view should write nothing (the overlay cases of `loopsHeld`, O9.2): its view
|
|
25480
|
-
* lies in a range an opaque overlay covers, or in a held picture of a
|
|
25481
|
-
* fallback draws live; the
|
|
25482
|
-
* frame.
|
|
25237
|
+
* lies in a range an opaque overlay covers, or in a held picture of a range that is blurred or whose owner has
|
|
25238
|
+
* `hold: true`, or in such a range the fallback draws live; all but the cover touch the range, so the held loops
|
|
25239
|
+
* write once at landing and at the first exit frame. Only the owner's `hold` counts: the range is the owner's.
|
|
25483
25240
|
*
|
|
25484
25241
|
* @param state - The sync state.
|
|
25485
25242
|
* @param entity - The entity a loop is about to write.
|
|
@@ -25493,7 +25250,8 @@ function rangeHolds(state, entity) {
|
|
|
25493
25250
|
if (view === void 0 || root === void 0) return false;
|
|
25494
25251
|
if (!inRange(range.set, view.wrapper ?? view.object, root)) return false;
|
|
25495
25252
|
if (range.reason === "cover") return true;
|
|
25496
|
-
|
|
25253
|
+
const ownerHolds = state.overlay.records.get(range.owner)?.value.hold === true;
|
|
25254
|
+
if (!range.blurred && !ownerHolds) return false;
|
|
25497
25255
|
range.touched = true;
|
|
25498
25256
|
return true;
|
|
25499
25257
|
}
|
|
@@ -28893,7 +28651,8 @@ function isKeyList(value) {
|
|
|
28893
28651
|
}
|
|
28894
28652
|
/**
|
|
28895
28653
|
* Copies the marker into the record's own value, clamped (O1): `dim` into [0, 1], `fade` to 0 or more, an unknown
|
|
28896
|
-
* `cover` as `"none"`, a `hud` that is not `"all"`, `"none"` or a key list as `"all"
|
|
28654
|
+
* `cover` as `"none"`, a `hud` that is not `"all"`, `"none"` or a key list as `"all"`, a `hold` that is no boolean as
|
|
28655
|
+
* `false`; one dev warning per field.
|
|
28897
28656
|
*
|
|
28898
28657
|
* @param sctx - Domain context of the sync module.
|
|
28899
28658
|
* @param entity - The marked entity.
|
|
@@ -28905,15 +28664,18 @@ function clampInto(sctx, entity, into, raw) {
|
|
|
28905
28664
|
const fade = Number.isFinite(raw.fade) ? Math.max(0, raw.fade) : 0;
|
|
28906
28665
|
const cover = raw.cover === "opaque" ? "opaque" : "none";
|
|
28907
28666
|
const hud = raw.hud === "all" || raw.hud === "none" || isKeyList(raw.hud) ? raw.hud : "all";
|
|
28667
|
+
const hold = raw.hold === true;
|
|
28908
28668
|
if (dim !== raw.dim) warnOnce$4(sctx, "renderer:overlay-value", entity, { field: "dim" });
|
|
28909
28669
|
if (fade !== raw.fade) warnOnce$4(sctx, "renderer:overlay-value", entity, { field: "fade" });
|
|
28910
28670
|
if (cover !== raw.cover) warnOnce$4(sctx, "renderer:overlay-value", entity, { field: "cover" });
|
|
28911
28671
|
if (hud !== raw.hud) warnOnce$4(sctx, "renderer:overlay-value", entity, { field: "hud" });
|
|
28672
|
+
if (hold !== raw.hold) warnOnce$4(sctx, "renderer:overlay-value", entity, { field: "hold" });
|
|
28912
28673
|
into.dim = dim;
|
|
28913
28674
|
into.dimColor = Number.isFinite(raw.dimColor) ? raw.dimColor : 0;
|
|
28914
28675
|
into.cover = cover;
|
|
28915
28676
|
into.hud = hud;
|
|
28916
28677
|
into.fade = fade;
|
|
28678
|
+
into.hold = hold;
|
|
28917
28679
|
}
|
|
28918
28680
|
/**
|
|
28919
28681
|
* The root of an entity's `Parent` chain, depth-bounded.
|
|
@@ -32181,13 +31943,14 @@ function localTargetOf(ecs, entity, component, to) {
|
|
|
32181
31943
|
const parent = parentOf$1(ecs, entity);
|
|
32182
31944
|
if (component !== asComponent(Transform) || parent === 0) return local;
|
|
32183
31945
|
const now = rootPoseOf(ecs, entity);
|
|
32184
|
-
const
|
|
31946
|
+
const root = {
|
|
32185
31947
|
x: to.x ?? now.x,
|
|
32186
31948
|
y: to.y ?? now.y,
|
|
32187
31949
|
rotation: to.rotation ?? now.rotation,
|
|
32188
31950
|
scale: to.scale ?? now.scale,
|
|
32189
31951
|
pivot: now.pivot
|
|
32190
|
-
}
|
|
31952
|
+
};
|
|
31953
|
+
const landed = localPoseOf(ecs, parent, root);
|
|
32191
31954
|
for (const field of POSE_FIELDS) if (to[field] !== void 0) local[field] = landed[field];
|
|
32192
31955
|
return local;
|
|
32193
31956
|
}
|
|
@@ -50449,204 +50212,6 @@ const textPlugin = /*#__PURE__*/ createPlugin$1("text", {
|
|
|
50449
50212
|
onStop: ({ state }) => stopText(state)
|
|
50450
50213
|
});
|
|
50451
50214
|
//#endregion
|
|
50452
|
-
//#region src/plugins/ui/styles/define.ts
|
|
50453
|
-
/**
|
|
50454
|
-
* Declares one style. The work is the type: a field outside the vocabulary, or a value outside
|
|
50455
|
-
* its union, is an error where the style is written, not where it is used.
|
|
50456
|
-
*
|
|
50457
|
-
* @param style - The style, with its `is` and `when` variants.
|
|
50458
|
-
* @returns The same object, frozen.
|
|
50459
|
-
* @example
|
|
50460
|
-
* ```ts
|
|
50461
|
-
* defineStyle({ direction: "row", gap: 12 }).gap; // 12
|
|
50462
|
-
* ```
|
|
50463
|
-
*/
|
|
50464
|
-
function defineStyle(style) {
|
|
50465
|
-
return Object.freeze(style);
|
|
50466
|
-
}
|
|
50467
|
-
//#endregion
|
|
50468
|
-
//#region src/plugins/ui/styles/tokens.ts
|
|
50469
|
-
/**
|
|
50470
|
-
* Declares the design tokens of a game: spaces, colours, radii and font keys, flat and plain.
|
|
50471
|
-
*
|
|
50472
|
-
* @param tokens - The four groups; every key inside them is the game's own.
|
|
50473
|
-
* @returns The same object, frozen.
|
|
50474
|
-
* @example
|
|
50475
|
-
* ```ts
|
|
50476
|
-
* defineTokens({ space: { md: 16 } }).space.md; // 16
|
|
50477
|
-
* ```
|
|
50478
|
-
*/
|
|
50479
|
-
function defineTokens(tokens) {
|
|
50480
|
-
return Object.freeze(tokens);
|
|
50481
|
-
}
|
|
50482
|
-
//#endregion
|
|
50483
|
-
//#region src/plugins/ui/components.ts
|
|
50484
|
-
/**
|
|
50485
|
-
* Who owns every entity `ui` spawns. The projection module checks it before it hands out a view
|
|
50486
|
-
* handle, so only `ui` may move a ui element.
|
|
50487
|
-
*/
|
|
50488
|
-
const UI_OWNER = {
|
|
50489
|
-
kind: "plugin",
|
|
50490
|
-
name: "ui"
|
|
50491
|
-
};
|
|
50492
|
-
/** Fresh defaults for the patch, so no two buttons share one object. */
|
|
50493
|
-
const localWriteDefaults = { patch: {} };
|
|
50494
|
-
/**
|
|
50495
|
-
* The rect of a ui element in root coordinates. Written by the solve, read by `tree()`, `lint()`
|
|
50496
|
-
* and the hit test of `guide`.
|
|
50497
|
-
*/
|
|
50498
|
-
const Box = /*#__PURE__*/ component("Box", {
|
|
50499
|
-
x: 0,
|
|
50500
|
-
y: 0,
|
|
50501
|
-
w: 0,
|
|
50502
|
-
h: 0
|
|
50503
|
-
});
|
|
50504
|
-
/**
|
|
50505
|
-
* On a button that writes local state instead of naming an intent. `input.onTap` reports the tap
|
|
50506
|
-
* and `ui` merges the patch into the nearest component instance.
|
|
50507
|
-
*/
|
|
50508
|
-
const LocalWrite = /*#__PURE__*/ component("LocalWrite", localWriteDefaults);
|
|
50509
|
-
/**
|
|
50510
|
-
* On a scroll container. Internal to `ui`: not exported from the package root.
|
|
50511
|
-
*/
|
|
50512
|
-
const Scroll = /*#__PURE__*/ component("Scroll", {
|
|
50513
|
-
axis: "y",
|
|
50514
|
-
offset: 0,
|
|
50515
|
-
min: 0
|
|
50516
|
-
});
|
|
50517
|
-
/**
|
|
50518
|
-
* On every scroll container: where it stands and whether it moves, for a game system and the
|
|
50519
|
-
* read door. `ui` writes it in a frame where the offset or `max` changed, and once more with
|
|
50520
|
-
* `moving: false` when it stops; a game reads it and never writes it.
|
|
50521
|
-
*
|
|
50522
|
-
* @example
|
|
50523
|
-
* ```ts
|
|
50524
|
-
* // A board system dims the events of the order strip while it rests on the orders.
|
|
50525
|
-
* export const stripMist = system({
|
|
50526
|
-
* name: "board.stripMist",
|
|
50527
|
-
* phase: "animate",
|
|
50528
|
-
* query: [ScrollState, OrderStrip],
|
|
50529
|
-
* run: entities => {
|
|
50530
|
-
* for (const [entity, scroll] of entities) {
|
|
50531
|
-
* // scroll: { offset: 318, max: 390, moving: false }
|
|
50532
|
-
* }
|
|
50533
|
-
* }
|
|
50534
|
-
* });
|
|
50535
|
-
* ```
|
|
50536
|
-
*/
|
|
50537
|
-
const ScrollState = /*#__PURE__*/ component("ScrollState", {
|
|
50538
|
-
offset: 0,
|
|
50539
|
-
max: 0,
|
|
50540
|
-
moving: false
|
|
50541
|
-
});
|
|
50542
|
-
/**
|
|
50543
|
-
* On the root entity of a popup kept beneath another popup (`popup(..., { over })`). Internal to
|
|
50544
|
-
* `ui`: not exported from the package root. Every element of that root resolves `is.covered`.
|
|
50545
|
-
*/
|
|
50546
|
-
const Covered = /*#__PURE__*/ tag("Covered");
|
|
50547
|
-
/**
|
|
50548
|
-
* On a button with the `escape` prop: the control the Escape key taps while its root is the top
|
|
50549
|
-
* one, meant for the close button or the backdrop of a dismissable popup. Internal to `ui`: the
|
|
50550
|
-
* game writes the prop, never the tag.
|
|
50551
|
-
*/
|
|
50552
|
-
const Escapable = /*#__PURE__*/ tag("Escapable");
|
|
50553
|
-
/**
|
|
50554
|
-
* On the view a player taps five times within three seconds to open the editor's overlay on a debug build: the
|
|
50555
|
-
* version line of the settings, usually. One helper on top of `app.debug.overlay.open()`; a game that wants another
|
|
50556
|
-
* gesture calls that itself. The view must take a press (a `button`, or any element with `Touchable`); a `button`
|
|
50557
|
-
* that names no intent is the plain choice. Without the agent flag the tag does nothing.
|
|
50558
|
-
*
|
|
50559
|
-
* @example
|
|
50560
|
-
* ```tsx
|
|
50561
|
-
* // The version line of the settings sheet. Five taps open the overlay of `moku-game build --debug` on the phone.
|
|
50562
|
-
* <button key="versionLine" style={versionLineStyle} components={[DebugTrigger()]}>
|
|
50563
|
-
* <text key="version" style="settings.version" content={tr("settings.version", { version: "1.4.0" })} />
|
|
50564
|
-
* </button>
|
|
50565
|
-
* ```
|
|
50566
|
-
*/
|
|
50567
|
-
const DebugTrigger = /*#__PURE__*/ tag("DebugTrigger");
|
|
50568
|
-
/**
|
|
50569
|
-
* The three Yoga counters, the reconcile count of the frame, the range re-renders of the windowed
|
|
50570
|
-
* lists, and the style and write passes of the reconcile. Written by the two systems of `ui`, read
|
|
50571
|
-
* by the acceptance tests. Not part of `app.ui`.
|
|
50572
|
-
*/
|
|
50573
|
-
const UiCounters = /*#__PURE__*/ resource("UiCounters", {
|
|
50574
|
-
solves: 0,
|
|
50575
|
-
nodes: 0,
|
|
50576
|
-
measured: 0,
|
|
50577
|
-
reconciles: 0,
|
|
50578
|
-
windowRenders: 0,
|
|
50579
|
-
styled: 0,
|
|
50580
|
-
written: 0
|
|
50581
|
-
});
|
|
50582
|
-
/**
|
|
50583
|
-
* Builds the effect a node awaits to show a popup. The gate opens for the outcomes of the
|
|
50584
|
-
* component, so the node resolves with the intent one of its buttons answered. `over` names the
|
|
50585
|
-
* component of a popup that stays mounted beneath this one, drawn covered, until this one is gone.
|
|
50586
|
-
*
|
|
50587
|
-
* @param component - A component declared with `outcomes`.
|
|
50588
|
-
* @param props - What its view is called with.
|
|
50589
|
-
* @param options - How the popup stands to the others.
|
|
50590
|
-
* @param options.over - The component name of the popup kept beneath this one.
|
|
50591
|
-
* @returns The descriptor `fx()` takes.
|
|
50592
|
-
* @example
|
|
50593
|
-
* ```ts
|
|
50594
|
-
* const Reward = defineComponent("Reward", {
|
|
50595
|
-
* outcomes: { claim: {} },
|
|
50596
|
-
* view: () => ({ type: "panel", props: {}, children: [] })
|
|
50597
|
-
* });
|
|
50598
|
-
* popup(Reward, { gold: 5 });
|
|
50599
|
-
* // { kind: "popup", payload: { component: "Reward", props: { gold: 5 } }, answers: ["claim"] }
|
|
50600
|
-
* await fx(popup(Reward, { gold: 5 })); // Answer<"claim">: { intent: "claim" }
|
|
50601
|
-
* ```
|
|
50602
|
-
* @example
|
|
50603
|
-
* ```ts
|
|
50604
|
-
* // The settings node asks before a reset; the settings stay beneath, covered.
|
|
50605
|
-
* const Confirm = defineComponent("Confirm", {
|
|
50606
|
-
* outcomes: { reset: {}, cancel: {} },
|
|
50607
|
-
* view: () => ({ type: "panel", props: {}, children: [] })
|
|
50608
|
-
* });
|
|
50609
|
-
* popup(Confirm, {}, { over: "Settings" });
|
|
50610
|
-
* // { kind: "popup", payload: { component: "Confirm", props: {}, over: "Settings" },
|
|
50611
|
-
* // answers: ["reset", "cancel"] }
|
|
50612
|
-
* ```
|
|
50613
|
-
*/
|
|
50614
|
-
function popup(component, props, options) {
|
|
50615
|
-
const over = options?.over;
|
|
50616
|
-
return {
|
|
50617
|
-
kind: "popup",
|
|
50618
|
-
payload: over === void 0 ? {
|
|
50619
|
-
component: component.name,
|
|
50620
|
-
props
|
|
50621
|
-
} : {
|
|
50622
|
-
component: component.name,
|
|
50623
|
-
props,
|
|
50624
|
-
over
|
|
50625
|
-
},
|
|
50626
|
-
answers: Object.keys(component.outcomes)
|
|
50627
|
-
};
|
|
50628
|
-
}
|
|
50629
|
-
/**
|
|
50630
|
-
* Binds the four ui helpers to one game. Type-only: the same four functions, plus the intrinsic
|
|
50631
|
-
* table this game's tags are checked against.
|
|
50632
|
-
*
|
|
50633
|
-
* @returns The helpers and the intrinsic type carrier.
|
|
50634
|
-
* @example
|
|
50635
|
-
* ```ts
|
|
50636
|
-
* const { defineStyle } = uiFor<"ui.coin", "digits", "hud.coins">();
|
|
50637
|
-
* defineStyle({ gap: 8 }).gap; // 8
|
|
50638
|
-
* ```
|
|
50639
|
-
*/
|
|
50640
|
-
function uiFor() {
|
|
50641
|
-
return {
|
|
50642
|
-
defineComponent,
|
|
50643
|
-
defineStyle,
|
|
50644
|
-
defineTokens,
|
|
50645
|
-
popup,
|
|
50646
|
-
intrinsics: {}
|
|
50647
|
-
};
|
|
50648
|
-
}
|
|
50649
|
-
//#endregion
|
|
50650
50215
|
//#region src/plugins/ui/jsx/field-layout.ts
|
|
50651
50216
|
/**
|
|
50652
50217
|
* The four edges of a resolved padding.
|
|
@@ -61344,4 +60909,4 @@ const screen = [
|
|
|
61344
60909
|
uiPlugin
|
|
61345
60910
|
];
|
|
61346
60911
|
//#endregion
|
|
61347
|
-
export {
|
|
60912
|
+
export { spawn as $, exit as $t, types_exports$11 as A, Outline as At, textPlugin as B, rendererPlugin as Bt, types_exports$4 as C, Emitter as Ct, types_exports$8 as D, Displacement as Dt, types_exports$7 as E, ColorMatrix as Et, types_exports$16 as F, assetsPlugin as Ft, frames as G, PERF_GAP_BUCKETS as Gt, HAPTIC_KINDS as H, frameAt as Ht, types_exports$17 as I, animPlugin as It, parallel as J, SHADER_WHATS as Jt, haptic as K, PERF_LOG_VERSION as Kt, uiPlugin as L, AnimPlayer as Lt, types_exports$13 as M, debugPlugin as Mt, types_exports$14 as N, audioPlugin as Nt, types_exports$9 as O, Glow as Ot, types_exports$15 as P, scenesPlugin as Pt, sfx as Q, refuseStart as Qt, resolve as R, Animation as Rt, types_exports$3 as S, effectsPlugin as St, types_exports$6 as T, Blur as Tt, defineAnimation as U, MONITOR_SECTIONS as Ut, platformPlugin as V, PASS_KINDS as Vt, external as W, PERF_CAUSES as Wt, sequence as X, worldPlugin as Xt, play$1 as Y, DEMAND_REASONS as Yt, set as Z, flowPlugin as Zt, defineBundles as _, Traceable as _t, cubicBezier as a, lifecyclePlugin as an, inputPlugin as at, types_exports$1 as b, messageArgument as bt, hint as c, Held as ct, defineScene as d, PointerOver as dt, slot as en, spawned as et, tr as f, Pressable as ft, music as g, Touchable as gt, defineEmitter as h, Tappable as ht, screen as i, SaveUnreadableError as in, wait as it, types_exports$12 as j, defineFilter as jt, types_exports$10 as k, Noise as kt, schedule as l, Hovered as lt, flattenFeatures as m, Swipeable as mt, createPlugin as n, type as nn, tween as nt, defineEffect as o, timePlugin as on, Draggable as ot, defineFeature as p, Pressed as pt, mark as q, PROBLEM_RULES as qt, defineGame as r, modelPlugin as rn, use as rt, guide as s, clockPlugin as sn, DropTarget as st, createApp as t, to as tn, stagger as tt, projection as u, Pointer as ut, load as v, Traced as vt, types_exports$5 as w, Alpha as wt, types_exports$2 as x, messageDuration as xt, types_exports as y, i18nPlugin as yt, defineMotion as z, Frames as zt };
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as saveOf, v as WithGameState, y as memory } from "./types-
|
|
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-
|
|
1
|
+
import { Qn as AnyFlow, Xn as FeaturePlugin, cr as Descriptor, fr as Hint, gr as ClockSource, ir as NodeTable, pr as NodeFx, vr as FakeClock, wr as Json } from "./types-CuEK0Vam.mjs";
|
|
2
|
+
import { t as createApp } from "./index-CsTMiO0x.mjs";
|
|
3
|
+
import { b as saveOf, v as WithGameState, y as memory } from "./types-CveBhKTs.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-DHtavbqk.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 {
|
|
1
|
+
import { $t as exit, Qt as refuseStart, m as flattenFeatures, nn as type, t as createApp } from "./src-FIcYaXro.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { t as fakeClock } from "./fake-6mazmHK3.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-BA6ffzqD.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as
|
|
2
|
-
import { C as TextApi, L as I18nApi, M as InputApi, Y as StylesState, c as UiNode, i as Finding, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-
|
|
1
|
+
import { $r as Events$2, $t as Api$3, An as ReducedMotion, Br as Events$5, Cn as Ease, Cr as Events$3, D as FilterSlotInputs, Dn as NumericFields, E as FilterSlot, En as MotionHandle, K as Api$4, Mn as TrackSegment, O as SyncApi, Pn as Api$2, Q as PixiTexture, Wr as Api$1, X as PixiModule, Y as PixiFilter, Z as PixiSprite, cr as Descriptor, dn as Entity, ei as Require, in as AnyComponent, jn as TrackOptions, ln as ComponentType, lt as FilterCache, on as AnyComponentValue, s as Events$1, sn as ComponentHandle, sr as TypeTag, st as Point, t as Api$5, v as Events$4, wr as Json, xr as Api$6 } from "./types-CuEK0Vam.mjs";
|
|
2
|
+
import { C as TextApi, L as I18nApi, M as InputApi, Y as StylesState, c as UiNode, i as Finding, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-D5Pmo8BD.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1093,7 +1093,7 @@ type State$3 = {
|
|
|
1093
1093
|
* nothing while its clock runs on (spec 22 O9), told what the loop reveals (spec 26 R1.7). `undefined` before the
|
|
1094
1094
|
* start and after the stop: nothing is held.
|
|
1095
1095
|
*/
|
|
1096
|
-
loopsHeld:
|
|
1096
|
+
loopsHeld: SyncApi["loopsHeld"] | undefined;
|
|
1097
1097
|
};
|
|
1098
1098
|
/**
|
|
1099
1099
|
* anim plugin API, `app.anim`: play a choreography, end everything, count what runs and listen
|