@moku-labs/game 0.15.107 → 0.15.108

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 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-BEW0gDir.mjs";
1
+ import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-DDYGbUAQ.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 timePlugin, 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 clockPlugin, xt as Hovered, y as schedule, yn as lifecyclePlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-BEW0gDir.mjs";
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 timePlugin, 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 clockPlugin, xt as Hovered, y as schedule, yn as lifecyclePlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-DDYGbUAQ.mjs";
2
2
  import { $ as Parent, A as Countdown, F as defineTextFormats, I as defineTextStyles, J as Display, L as label, M as bind, S as popup, T as defineStyle, X as NineSlice, Y as HudPart, Z as Overlay, _ as LocalWrite, at as sprite, ct as Now, dt as component, et as Shape, ft as mut, gt as tag, h as DebugTrigger, j as Text, lt as Order, mt as system, nt as Transform, ot as Exiting, p as Box, pt as resource, st as Layer, tt as Sprite, ut as Tree, w as defineTokens, y as ScrollState } from "./visual-fyUJwUJf.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 };
@@ -39501,8 +39501,10 @@ function resolveTarget$1(actx, target, spawned) {
39501
39501
  * through the `Parent` chain by `rootPoseOf` of `renderer`. The rest pose is what the picture holds
39502
39502
  * whenever nothing animates the target; an entity nothing projects answers its current
39503
39503
  * `Transform`. Inside `build` no spawn step has run yet, so `at(spawned(id))` answers the identity
39504
- * pose and one warning. A target nothing resolves gives the identity pose and one
39505
- * warning, so a choreography over a screen that is not there plays on instead of throwing.
39504
+ * pose and one log entry. A target nothing resolves gives the identity pose and one log entry, so a
39505
+ * choreography over a screen that is not there plays on instead of throwing. The entry is a warning,
39506
+ * and in a dev build an error: a flight that starts in the screen's corner is a bug of the game
39507
+ * (F163).
39506
39508
  *
39507
39509
  * @param actx - Domain context of the anim plugin.
39508
39510
  * @param target - The projection key, the entity or the spawned id to read.
@@ -39514,7 +39516,10 @@ function restPoseOf(actx, target, spawned) {
39514
39516
  const { ecs, projection } = actx.deps.world;
39515
39517
  const own = entity === void 0 ? void 0 : projection.restOf(entity, Transform) ?? ecs.get(entity, Transform);
39516
39518
  if (entity === void 0 || own === void 0) {
39517
- actx.log.warn("anim:target-missing", typeof target === "number" ? { entity: target } : { ...target });
39519
+ const isDev = typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__;
39520
+ const data = typeof target === "number" ? { entity: target } : { ...target };
39521
+ if (isDev) actx.log.error("anim:target-missing", data);
39522
+ else actx.log.warn("anim:target-missing", data);
39518
39523
  return {
39519
39524
  x: 0,
39520
39525
  y: 0,
@@ -71046,6 +71051,24 @@ function namedSize(element, bind, source, width) {
71046
71051
  return answer === void 0 ? void 0 : source.measure(answer.text, answer.style, width);
71047
71052
  }
71048
71053
  /**
71054
+ * The size of a text with no bind: the content and the style its `Text` holds, so a write of a
71055
+ * system outside the projection is measured too (F162). Before the entity carries its `Text`, for
71056
+ * the first solve, the content and the style the markup wrote.
71057
+ *
71058
+ * @param element - The text element.
71059
+ * @param source - What it is measured through.
71060
+ * @param width - The width Yoga offers, or `undefined` when it bounds none.
71061
+ * @returns The size before it is rounded.
71062
+ */
71063
+ function contentSize(element, source, width) {
71064
+ const content = source.content(element.entity);
71065
+ if (content === void 0) {
71066
+ const written = contentOf$1(element);
71067
+ return source.measure(written.content, written.style, width);
71068
+ }
71069
+ return source.measure(content, source.style(element.entity) ?? styleKeyOf(element), width);
71070
+ }
71071
+ /**
71049
71072
  * The size a text measures to: a bound one by what it shows, any other by its content.
71050
71073
  *
71051
71074
  * @param element - The text element.
@@ -71055,10 +71078,7 @@ function namedSize(element, bind, source, width) {
71055
71078
  */
71056
71079
  function textSize(element, source, width) {
71057
71080
  const bind = bindOf(element);
71058
- if (bind === void 0) {
71059
- const { content, style } = contentOf$1(element);
71060
- return source.measure(content, style, width);
71061
- }
71081
+ if (bind === void 0) return contentSize(element, source, width);
71062
71082
  return (isTextFormat(bind.format) ? void 0 : namedSize(element, bind, source, width)) ?? source.measure(boundShown(element, bind, source), styleKeyOf(element), width);
71063
71083
  }
71064
71084
  /**
@@ -72113,8 +72133,9 @@ async function loadYogaModule() {
72113
72133
  //#endregion
72114
72134
  //#region src/plugins/ui/layout/api.ts
72115
72135
  /**
72116
- * What the text elements are measured through: `text.measure`, the string `text` resolved for an
72117
- * entity and its style, what a format of the game answers, and the duration words of `i18n`.
72136
+ * What the text elements are measured through: `text.measure`, the content of an entity's `Text`,
72137
+ * the string `text` resolved for it and its style, what a format of the game answers, and the
72138
+ * duration words of `i18n`.
72118
72139
  *
72119
72140
  * @param ctx - Domain context of the ui plugin.
72120
72141
  * @returns The source every measure function reads.
@@ -72122,6 +72143,7 @@ async function loadYogaModule() {
72122
72143
  function textSourceOf(ctx) {
72123
72144
  return {
72124
72145
  measure: (content, style, width) => ctx.deps.text.measure(content, style, width),
72146
+ content: (entity) => ctx.deps.world.ecs.get(entity, Text)?.content,
72125
72147
  resolved: (entity) => ctx.deps.world.ecs.get(entity, Text)?.resolved,
72126
72148
  style: (entity) => ctx.deps.world.ecs.get(entity, Text)?.style,
72127
72149
  formatted: (name, value) => ctx.deps.text.formatted(name, value),
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-BEW0gDir.mjs";
1
+ import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-DDYGbUAQ.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-CCiUwvlp.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.107",
3
+ "version": "0.15.108",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [