@moku-labs/game 0.15.112 → 0.15.113

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-ApGU_EAs.mjs";
1
+ import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-DPnGp6uQ.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-ApGU_EAs.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-DPnGp6uQ.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-CvFDvkA_.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 };
@@ -67377,6 +67377,16 @@ const LIVE_TYPES = concatTypes(VISUALS, INPUTS);
67377
67377
  const NO_LOOK = Object.freeze({});
67378
67378
  /** The owned fields of a type that gives none to a plugin: one list, never a new one. */
67379
67379
  const NO_OWNED = [];
67380
+ /**
67381
+ * The fields of `Text` a write with no new content in the markup leaves alone: those the type gives
67382
+ * to `text` (the string it resolved), and the content and the style a game's system may have
67383
+ * written since (F167).
67384
+ */
67385
+ const TEXT_KEPT = Object.freeze([
67386
+ ...Text.owned,
67387
+ "content",
67388
+ "style"
67389
+ ]);
67380
67390
  /** The time of a reconcile a test steps by hand: no ms pass, so no scroll moves. */
67381
67391
  const NO_TIME = Object.freeze({
67382
67392
  delta: 0,
@@ -67885,6 +67895,7 @@ function createReconciler(ctx, modules, fields) {
67885
67895
  let slotsVersion = -1;
67886
67896
  let slotsRoots = -1;
67887
67897
  let placedUnder;
67898
+ let textKept = false;
67888
67899
  let rendered = 0;
67889
67900
  const isAside = (entity) => ctx.deps.world.projection.isBuilding(entity);
67890
67901
  let released = false;
@@ -68172,12 +68183,17 @@ function createReconciler(ctx, modules, fields) {
68172
68183
  * rect never resets it. The look is recorded as the rest of the visual before it is written, so
68173
68184
  * the rest the world holds is always the one the element is drawn with (a restore brings it back
68174
68185
  * to exactly that) and a `change` hook of the visual brings it home with `toRest`. The extras of
68175
- * the `components` prop are diffed last. Every call is one write pass of `UiCounters`.
68186
+ * the `components` prop are diffed last. Every call is one write pass of `UiCounters`. A write
68187
+ * whose markup says the same `content`, `style` and `bind` as the last one (a moved rect, a restyle, a
68188
+ * render that changed another prop) leaves the entity's `Text.content` and `Text.style` alone, so
68189
+ * what a game's system wrote there stays (F167).
68176
68190
  *
68177
68191
  * @param element - The element that changed.
68192
+ * @param keepsText - Whether the markup's `content`, `style` and `bind` say what they said.
68178
68193
  */
68179
- function writeLive(element) {
68194
+ function writeLive(element, keepsText) {
68180
68195
  state.written += 1;
68196
+ textKept = keepsText;
68181
68197
  writeOrder(element);
68182
68198
  const visuals = visualOf$1(element);
68183
68199
  const inputs = inputOf(element);
@@ -68221,7 +68237,7 @@ function createReconciler(ctx, modules, fields) {
68221
68237
  * @param type - Its component type.
68222
68238
  */
68223
68239
  function writeOthers(element, value, type) {
68224
- const others = otherFields(value, fieldsLeftAlone(element, type, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED));
68240
+ const others = otherFields(value, leftAlone(element, type, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED));
68225
68241
  if (others !== void 0) ecs.set(element.entity, asHandle(type), others);
68226
68242
  }
68227
68243
  /**
@@ -68238,6 +68254,18 @@ function createReconciler(ctx, modules, fields) {
68238
68254
  return ecs.get(entity, Tappable)?.point === true && !("point" in value.value);
68239
68255
  }
68240
68256
  /**
68257
+ * The fields a write of the current pass leaves alone: those of `fieldsLeftAlone`, and on the
68258
+ * `Text` of a write with no new content in the markup its content and style too.
68259
+ *
68260
+ * @param element - The live element.
68261
+ * @param type - The component type of the value.
68262
+ * @param owned - The fields its type gives to a plugin.
68263
+ * @returns The fields left alone: a list of the module, never a new one, for a kept text.
68264
+ */
68265
+ function leftAlone(element, type, owned) {
68266
+ return type === Text && textKept ? TEXT_KEPT : fieldsLeftAlone(element, type, owned);
68267
+ }
68268
+ /**
68241
68269
  * Writes one visual or input value onto a live element: added when the entity lacks it, else
68242
68270
  * its fields patched, but never a tag or the state of a scroll, and never a field its type gives
68243
68271
  * to a plugin. A `Tappable` that drops `point` is added again: it replaces the stored one whole.
@@ -68252,7 +68280,7 @@ function createReconciler(ctx, modules, fields) {
68252
68280
  }
68253
68281
  if (value.value === true || SCROLL_STATE.has(value.type.componentName)) return;
68254
68282
  const typeOwned = ecs.typeOf(value.type.componentName)?.owned ?? NO_OWNED;
68255
- const owned = fieldsLeftAlone(element, value.type, typeOwned);
68283
+ const owned = leftAlone(element, value.type, typeOwned);
68256
68284
  ecs.set(element.entity, asHandle(value.type), livePatch(value.value, owned));
68257
68285
  }
68258
68286
  /**
@@ -68291,6 +68319,7 @@ function createReconciler(ctx, modules, fields) {
68291
68319
  resolved: !keepsStyle,
68292
68320
  moved: !keepsStyle && modules.layout.affectsRect(element.style, style),
68293
68321
  measures: !stands || !sameStyle || !sameContent,
68322
+ keepsText: sameStyle && sameContent && sameValue(previous.props.bind, node.props.bind),
68294
68323
  unchanged: keepsStyle && sameContent && writesSame(previous, node)
68295
68324
  };
68296
68325
  }
@@ -68311,7 +68340,7 @@ function createReconciler(ctx, modules, fields) {
68311
68340
  root.needsSolve = true;
68312
68341
  }
68313
68342
  if (!element.live) return;
68314
- writeLive(element);
68343
+ writeLive(element, change.keepsText);
68315
68344
  if (!change.moved) modules.layout.repose(element, parentRect(element), false, hintOf(state, element));
68316
68345
  }
68317
68346
  /**
@@ -68680,7 +68709,7 @@ function createReconciler(ctx, modules, fields) {
68680
68709
  let hooked = quiet;
68681
68710
  if (element.moved) {
68682
68711
  modules.layout.commit(element, parent);
68683
- writeLive(element);
68712
+ writeLive(element, true);
68684
68713
  if (!quiet) hooked = modules.layout.change(element, element.previous, hint);
68685
68714
  }
68686
68715
  modules.layout.repose(element, parent, hooked, hint);
@@ -69501,7 +69530,7 @@ function createReconciler(ctx, modules, fields) {
69501
69530
  if (root !== void 0) root.needsSolve = true;
69502
69531
  }
69503
69532
  if (!element.live) return;
69504
- writeLive(element);
69533
+ writeLive(element, true);
69505
69534
  if (!moved) modules.layout.repose(element, parentRect(element), false);
69506
69535
  }
69507
69536
  /**
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-ApGU_EAs.mjs";
1
+ import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-DPnGp6uQ.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.112",
3
+ "version": "0.15.113",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [