@moku-labs/game 0.15.4 → 0.15.5

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.
@@ -1,4 +1,4 @@
1
- import { m as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-VNoG7shY.mjs";
1
+ import { m as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-6inPYTzE.mjs";
2
2
 
3
3
  //#region src/app/page.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { Dr as PlayerStateProvider } from "../types-vjWgmPqS.mjs";
2
- import { mt as PlatformProvider } from "../index-Cv5r0M9Y.mjs";
3
- import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-VNoG7shY.mjs";
1
+ import { Dr as PlayerStateProvider } from "../types-DnttyLeu.mjs";
2
+ import { mt as PlatformProvider } from "../index-Bq_93oZv.mjs";
3
+ import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-6inPYTzE.mjs";
4
4
  import { Back, Haptics, KeepAwake, Lifecycle, Store } from "@moku-labs/system";
5
5
 
6
6
  //#region src/app/system.d.ts
package/dist/app.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { Sr as Json } from "./types-vjWgmPqS.mjs";
2
- import { V as StringTable } from "./types-B6YgPkY8.mjs";
3
- import { a as GameHandle, c as MemoryProvider, d as SaveKind, f as Scenario, g as SystemName, i as GameDefinition, l as PageAgent, n as GameApp, o as GamePluginConfigs, p as ScreenSeams, r as GameConfig, s as HeadlessSeams, v as WithGameState } from "./types-VNoG7shY.mjs";
1
+ import { Sr as Json } from "./types-DnttyLeu.mjs";
2
+ import { V as StringTable } from "./types-CWSMo70I.mjs";
3
+ import { a as GameHandle, c as MemoryProvider, d as SaveKind, f as Scenario, g as SystemName, i as GameDefinition, l as PageAgent, n as GameApp, o as GamePluginConfigs, p as ScreenSeams, r as GameConfig, s as HeadlessSeams, v as WithGameState } from "./types-6inPYTzE.mjs";
4
4
  import { AnyPluginInstance } from "@moku-labs/core";
5
5
 
6
6
  //#region src/app/define.d.ts
package/dist/app.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Ot as effectsPlugin, i as screen, m as flattenFeatures, q as platformPlugin, t as createApp, zt as audioPlugin } from "./src-tkKl-oCn.mjs";
1
+ import { Ot as effectsPlugin, i as screen, m as flattenFeatures, q as platformPlugin, t as createApp, zt as audioPlugin } from "./src-DnclBdeU.mjs";
2
2
  import { t as memory } from "./memory-CWlqhS7l.mjs";
3
3
  import { n as isFakeClock, t as fakeClock } from "./fake-6mazmHK3.mjs";
4
4
  //#region src/app/define.ts
package/dist/assets.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { d as Manifest } from "./types-vjWgmPqS.mjs";
1
+ import { d as Manifest } from "./types-DnttyLeu.mjs";
2
2
 
3
3
  //#region src/plugins/assets/scan/cli.d.ts
4
4
  /**
@@ -1,8 +1,8 @@
1
- import { Dt as DebugSwitches, I as Captured, Ir as Api, Jr as Time, Nr as StoreApi, S as ScenesApi, T as Api$1, Wr as FrameRate, Zn as Bookmark, Zt as Api$2, er as FlowState, jr as Snapshot } from "./types-vjWgmPqS.mjs";
2
- import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-CiTr21gu.mjs";
3
- import { j as InputApi } from "./types-B6YgPkY8.mjs";
4
- import { t as HeadlessApp } from "./headless-oykCMFBV.mjs";
5
- import { n as Command, r as ControlApp } from "./types-DY_wOvUF.mjs";
1
+ import { Dt as DebugSwitches, I as Captured, Ir as Api, Jr as Time, Nr as StoreApi, S as ScenesApi, T as Api$1, Wr as FrameRate, Zn as Bookmark, Zt as Api$2, er as FlowState, jr as Snapshot } from "./types-DnttyLeu.mjs";
2
+ import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-C2g2KYCN.mjs";
3
+ import { j as InputApi } from "./types-CWSMo70I.mjs";
4
+ import { t as HeadlessApp } from "./headless-DDkRwLnJ.mjs";
5
+ import { n as Command, r as ControlApp } from "./types-DFoxDq-g.mjs";
6
6
 
7
7
  //#region src/plugins/flow/doors/commands.d.ts
8
8
  /**
@@ -1,7 +1,7 @@
1
- import { t as HeadlessApp } from "./headless-oykCMFBV.mjs";
2
- import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-DY_wOvUF.mjs";
3
- import { t as commands } from "./commands-CvWBaoEi.mjs";
4
- import { t as defineCommand } from "./define-DSC-Q0yU.mjs";
1
+ import { t as HeadlessApp } from "./headless-DDkRwLnJ.mjs";
2
+ import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-DFoxDq-g.mjs";
3
+ import { t as commands } from "./commands-e_I5i8dK.mjs";
4
+ import { t as defineCommand } from "./define-CNctRrea.mjs";
5
5
 
6
6
  //#region src/plugins/flow/doors/dev.d.ts
7
7
  /**
@@ -1,5 +1,5 @@
1
- import { t as HeadlessApp } from "./headless-oykCMFBV.mjs";
2
- import { c as Source, n as Command, o as InputSchema } from "./types-DY_wOvUF.mjs";
1
+ import { t as HeadlessApp } from "./headless-DDkRwLnJ.mjs";
2
+ import { c as Source, n as Command, o as InputSchema } from "./types-DFoxDq-g.mjs";
3
3
 
4
4
  //#region src/plugins/flow/doors/define.d.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { Fr as RngState, Hr as Api, Mn as Api$1, Sr as Json, er as FlowState, fr as Answer, rr as RouteStep, tr as JournalEntry } from "./types-vjWgmPqS.mjs";
1
+ import { Fr as RngState, Hr as Api, Mn as Api$1, Sr as Json, er as FlowState, fr as Answer, rr as RouteStep, tr as JournalEntry } from "./types-DnttyLeu.mjs";
2
2
 
3
3
  //#region src/plugins/flow/headless.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
- import { $ as PassKind, Bn as TextStylesOf, Br as State$4, Bt as OverlayValue, C as State$7, Cr as Root, Dn as ProjectionSpec, E as Config$6, En as ProjectionMotion, Er as Patch, Fn as EmitterIdOf, Gr as RateChange, Gt as SpriteOptions, H as FrameRecord, Hn as defineFlow, Hr as Api$5, In as GameTypes, Ir as Api$3, It as HudPartValue, Jn as FeaturePlugin, Jt as TransformValue, Kr as State$8, Kt as SpriteValue, Ln as HudKeysOf, Lr as Config$4, Mn as Api$2, Mt as ViewportSize, N as State$6, Nn as BundlesOf, Nr as StoreApi, On as ReducedMotion, Pn as Config$3, Pr as RngApi, Qn as DefineNode, Qr as Require, Qt as Config$8, Rr as Events, Rt as NineSliceValue, S as ScenesApi, Sr as Json, T as Api$4, Tn as NumericFields, U as FrameRing, Ur as Config$7, Ut as ShapeValue, Xr as Config$9, Yn as FeatureTree, Yt as sprite, Zr as Events$1, Zt as Api$6, _ as DefineScene, _n as SystemFor, _r as State$2, a as Config$1, an as ComponentHandle, b as SceneDefinition, bn as DescriptionNode, br as Config$5, c as LoadBundles, cn as ComponentValue, cr as EffectOptions, en as State$9, f as State$1, fn as Mut, fr as Answer, g as AnySceneProjection, gn as SystemDefinition, hn as ResourceType, hr as Config$2, i as BundleSpec, ir as SceneIdOf, l as LoadReason, lr as GuideOptions, mn as QueryTerm, o as DefineBundles, or as Descriptor, p as Tier, pn as Narrowed, pr as Api$1, qn as FeatureDescription, qr as ThermalReading, r as BundleMap, sn as ComponentType, sr as Effect, t as Api, u as LoadResult, ur as Hint, vn as TagType, wr as State$5, x as SceneSpec, xn as Ease, y as LayerMap, zn as State$3, zr as PauseReason } from "./types-vjWgmPqS.mjs";
2
- import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$10, K as defineAnimation, L as FramesValue, M as OutlineValue, N as UniformDeclaration, O as FilterSpec, P as AnimApi, Q as play, R as MotionKeyframe, S as AlphaValue, T as DisplacementValue, U as SfxDescriptor, W as Step, _ as State$12, a as AudioApi, b as EmitterDefinition, c as MusicDescriptor, ct as OverlayApi, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, m as Config$12, n as State$13, r as UiApi, s as Config$11, t as Config$13, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-CiTr21gu.mjs";
3
- import { A as Config$15, B as State$14, C as TextBind, D as TextValue, E as TextStyles, F as Config$14, G as IsFlags, H as TextKey, I as I18nApi, K as ResolvedStyle, L as IntlKit, M as State$15, P as Argument, R as Message, S as TextApi, T as TextStyleInput, U as TypedTr, Y as WhenFlags, _ as BindOptions, b as Point, g as BindField, j as InputApi, k as defineComponent, m as IntrinsicElementsFor, p as defineTokens, q as Style, s as PopupComponent, v as Config$16, x as State$16, y as CountdownValue, z as Part } from "./types-B6YgPkY8.mjs";
1
+ import { $ as PassKind, Bn as TextStylesOf, Br as State$4, Bt as OverlayValue, C as State$7, Cr as Root, Dn as ProjectionSpec, E as Config$6, En as ProjectionMotion, Er as Patch, Fn as EmitterIdOf, Gr as RateChange, Gt as SpriteOptions, H as FrameRecord, Hn as defineFlow, Hr as Api$5, In as GameTypes, Ir as Api$3, It as HudPartValue, Jn as FeaturePlugin, Jt as TransformValue, Kr as State$8, Kt as SpriteValue, Ln as HudKeysOf, Lr as Config$4, Mn as Api$2, Mt as ViewportSize, N as State$6, Nn as BundlesOf, Nr as StoreApi, On as ReducedMotion, Pn as Config$3, Pr as RngApi, Qn as DefineNode, Qr as Require, Qt as Config$8, Rr as Events, Rt as NineSliceValue, S as ScenesApi, Sr as Json, T as Api$4, Tn as NumericFields, U as FrameRing, Ur as Config$7, Ut as ShapeValue, Xr as Config$9, Yn as FeatureTree, Yt as sprite, Zr as Events$1, Zt as Api$6, _ as DefineScene, _n as SystemFor, _r as State$2, a as Config$1, an as ComponentHandle, b as SceneDefinition, bn as DescriptionNode, br as Config$5, c as LoadBundles, cn as ComponentValue, cr as EffectOptions, en as State$9, f as State$1, fn as Mut, fr as Answer, g as AnySceneProjection, gn as SystemDefinition, hn as ResourceType, hr as Config$2, i as BundleSpec, ir as SceneIdOf, l as LoadReason, lr as GuideOptions, mn as QueryTerm, o as DefineBundles, or as Descriptor, p as Tier, pn as Narrowed, pr as Api$1, qn as FeatureDescription, qr as ThermalReading, r as BundleMap, sn as ComponentType, sr as Effect, t as Api, u as LoadResult, ur as Hint, vn as TagType, wr as State$5, x as SceneSpec, xn as Ease, y as LayerMap, zn as State$3, zr as PauseReason } from "./types-DnttyLeu.mjs";
2
+ import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$10, K as defineAnimation, L as FramesValue, M as OutlineValue, N as UniformDeclaration, O as FilterSpec, P as AnimApi, Q as play, R as MotionKeyframe, S as AlphaValue, T as DisplacementValue, U as SfxDescriptor, W as Step, _ as State$12, a as AudioApi, b as EmitterDefinition, c as MusicDescriptor, ct as OverlayApi, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, m as Config$12, n as State$13, r as UiApi, s as Config$11, t as Config$13, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-C2g2KYCN.mjs";
3
+ import { A as Config$15, B as State$14, C as TextBind, D as TextValue, E as TextStyles, F as Config$14, G as IsFlags, H as TextKey, I as I18nApi, K as ResolvedStyle, L as IntlKit, M as State$15, P as Argument, R as Message, S as TextApi, T as TextStyleInput, U as TypedTr, Y as WhenFlags, _ as BindOptions, b as Point, g as BindField, j as InputApi, k as defineComponent, m as IntrinsicElementsFor, p as defineTokens, q as Style, s as PopupComponent, v as Config$16, x as State$16, y as CountdownValue, z as Part } from "./types-CWSMo70I.mjs";
4
4
  import { Log } from "@moku-labs/common/browser";
5
5
  import { PluginCtx } from "@moku-labs/core";
6
6
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as PassKind, Ar as SaveUnreadableError, B as FrameReadResult, Bt as OverlayValue, Ct as SHADER_WHATS, D as MonitorConfig, Et as WarmDetail, F as types_d_exports$12, Ft as HudPart, G as MONITOR_SECTIONS, Gn as to, H as FrameRecord, Ht as Shape, It as HudPartValue, J as OverlayWhat, K as MonitorSections, Kn as type, L as MonitorCounts, Lt as NineSlice, M as PoolTrim, Pt as Display, Q as PROBLEM_RULES, St as ProblemRule, Tr as types_d_exports$10, Tt as ShaderWhat, U as FrameRing, Un as exit, V as FrameReadout, Vn as types_d_exports$6, Vr as types_d_exports$9, Vt as Parent, W as LongFrameEntry, Wn as slot, Wt as Sprite, X as PERF_GAP_BUCKETS, Xt as DEMAND_REASONS, Y as PERF_CAUSES, Yr as types_d_exports$15, Yt as sprite, Z as PERF_LOG_VERSION, _t as PerfStartupLine, at as PerfCounts, bn as DescriptionNode, bt as PoolTrimDetail, ct as PerfEventName, dt as PerfLogLine, et as PassRecord, ft as PerfLongFrameLine, gt as PerfSpikeLine, h as types_d_exports$1, ht as PerfSampleLine, it as PerfCollectorLine, lt as PerfGapLine, mt as PerfMeasured, nt as PerfChange, ot as PerfDisplay, pt as PerfMarkLine, q as OverlayEventDetail, qt as Transform, rt as PerfChangeEntry, st as PerfEventLine, tn as types_d_exports$17, tt as PerfCause, ut as PerfHeaderLine, vr as types_d_exports$3, vt as PerfTelemetryLine, w as types_d_exports$13, wt as ShaderEventDetail, xt as ProblemEventDetail, yt as PerfThermalLine, z as FrameColumns, zt as Overlay } from "./types-vjWgmPqS.mjs";
2
- import { $ as sequence, E as FilterArea, G as HAPTIC_KINDS, H as HapticKind, J as frames, K as defineAnimation, Q as play, V as types_d_exports, X as mark, Y as haptic, Z as parallel, at as tween, et as set, i as types_d_exports$16, it as stagger, lt as types_d_exports$4, nt as spawn, ot as use, p as types_d_exports$2, q as external, rt as spawned, st as wait, tt as sfx, v as types_d_exports$5 } from "./types-CiTr21gu.mjs";
3
- import { N as types_d_exports$8, O as types_d_exports$14, W as types_d_exports$7, _ as BindOptions, d as LocalWrite, f as popup, k as defineComponent, l as Box, p as defineTokens, u as DebugTrigger, w as TextFormat, y as CountdownValue } from "./types-B6YgPkY8.mjs";
4
- import { $ as tag, A as DropTarget, At as bind, B as Traceable, C as AnimPlayer, Ct as clockPlugin, D as defineBundles, Dt as projection, E as defineScene, Et as animPlugin, F as Pressable, G as Layer, H as PASS_KINDS, I as Pressed, J as Tree, K as Now, L as Swipeable, M as Hovered, Mt as label, N as Pointer, O as load, Ot as Countdown, P as PointerOver, Q as system, R as Tappable, S as defineMotion, St as debugPlugin, T as Frames, Tt as assetsPlugin, U as frameAt, V as Traced, W as Exiting, X as mut, Y as component, Z as resource, _ as defineStyle, _t as lifecyclePlugin, a as defineEmitter, at as flattenFeatures, b as messageDuration, bt as flowPlugin, c as Alpha, ct as timePlugin, d as Displacement, dt as rendererPlugin, et as defineEffect, f as Glow, ft as platformPlugin, g as resolve, gt as modelPlugin, h as music, ht as types_d_exports$11, i as screen, it as defineFeature, j as Held, jt as defineTextStyles, k as Draggable, kt as Text, l as Blur, lt as textPlugin, m as Outline, mt as PlatformProvider, n as createPlugin, nt as hint, o as Emitter, ot as worldPlugin, p as Noise, pt as BackResult, q as Order, r as defineGame, rt as schedule, s as defineFilter, st as uiPlugin, t as createApp, tt as guide, u as ColorMatrix, ut as scenesPlugin, v as tr, vt as inputPlugin, w as Animation, wt as audioPlugin, x as cubicBezier, xt as effectsPlugin, y as messageArgument, yt as i18nPlugin, z as Touchable } from "./index-Cv5r0M9Y.mjs";
1
+ import { $ as PassKind, Ar as SaveUnreadableError, B as FrameReadResult, Bt as OverlayValue, Ct as SHADER_WHATS, D as MonitorConfig, Et as WarmDetail, F as types_d_exports$12, Ft as HudPart, G as MONITOR_SECTIONS, Gn as to, H as FrameRecord, Ht as Shape, It as HudPartValue, J as OverlayWhat, K as MonitorSections, Kn as type, L as MonitorCounts, Lt as NineSlice, M as PoolTrim, Pt as Display, Q as PROBLEM_RULES, St as ProblemRule, Tr as types_d_exports$10, Tt as ShaderWhat, U as FrameRing, Un as exit, V as FrameReadout, Vn as types_d_exports$6, Vr as types_d_exports$9, Vt as Parent, W as LongFrameEntry, Wn as slot, Wt as Sprite, X as PERF_GAP_BUCKETS, Xt as DEMAND_REASONS, Y as PERF_CAUSES, Yr as types_d_exports$15, Yt as sprite, Z as PERF_LOG_VERSION, _t as PerfStartupLine, at as PerfCounts, bn as DescriptionNode, bt as PoolTrimDetail, ct as PerfEventName, dt as PerfLogLine, et as PassRecord, ft as PerfLongFrameLine, gt as PerfSpikeLine, h as types_d_exports$1, ht as PerfSampleLine, it as PerfCollectorLine, lt as PerfGapLine, mt as PerfMeasured, nt as PerfChange, ot as PerfDisplay, pt as PerfMarkLine, q as OverlayEventDetail, qt as Transform, rt as PerfChangeEntry, st as PerfEventLine, tn as types_d_exports$17, tt as PerfCause, ut as PerfHeaderLine, vr as types_d_exports$3, vt as PerfTelemetryLine, w as types_d_exports$13, wt as ShaderEventDetail, xt as ProblemEventDetail, yt as PerfThermalLine, z as FrameColumns, zt as Overlay } from "./types-DnttyLeu.mjs";
2
+ import { $ as sequence, E as FilterArea, G as HAPTIC_KINDS, H as HapticKind, J as frames, K as defineAnimation, Q as play, V as types_d_exports, X as mark, Y as haptic, Z as parallel, at as tween, et as set, i as types_d_exports$16, it as stagger, lt as types_d_exports$4, nt as spawn, ot as use, p as types_d_exports$2, q as external, rt as spawned, st as wait, tt as sfx, v as types_d_exports$5 } from "./types-C2g2KYCN.mjs";
3
+ import { N as types_d_exports$8, O as types_d_exports$14, W as types_d_exports$7, _ as BindOptions, d as LocalWrite, f as popup, k as defineComponent, l as Box, p as defineTokens, u as DebugTrigger, w as TextFormat, y as CountdownValue } from "./types-CWSMo70I.mjs";
4
+ import { $ as tag, A as DropTarget, At as bind, B as Traceable, C as AnimPlayer, Ct as clockPlugin, D as defineBundles, Dt as projection, E as defineScene, Et as animPlugin, F as Pressable, G as Layer, H as PASS_KINDS, I as Pressed, J as Tree, K as Now, L as Swipeable, M as Hovered, Mt as label, N as Pointer, O as load, Ot as Countdown, P as PointerOver, Q as system, R as Tappable, S as defineMotion, St as debugPlugin, T as Frames, Tt as assetsPlugin, U as frameAt, V as Traced, W as Exiting, X as mut, Y as component, Z as resource, _ as defineStyle, _t as lifecyclePlugin, a as defineEmitter, at as flattenFeatures, b as messageDuration, bt as flowPlugin, c as Alpha, ct as timePlugin, d as Displacement, dt as rendererPlugin, et as defineEffect, f as Glow, ft as platformPlugin, g as resolve, gt as modelPlugin, h as music, ht as types_d_exports$11, i as screen, it as defineFeature, j as Held, jt as defineTextStyles, k as Draggable, kt as Text, l as Blur, lt as textPlugin, m as Outline, mt as PlatformProvider, n as createPlugin, nt as hint, o as Emitter, ot as worldPlugin, p as Noise, pt as BackResult, q as Order, r as defineGame, rt as schedule, s as defineFilter, st as uiPlugin, t as createApp, tt as guide, u as ColorMatrix, ut as scenesPlugin, v as tr, vt as inputPlugin, w as Animation, wt as audioPlugin, x as cubicBezier, xt as effectsPlugin, y as messageArgument, yt as i18nPlugin, z as Touchable } from "./index-Bq_93oZv.mjs";
5
5
  export { Alpha, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, type BindOptions, Blur, Box, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, types_d_exports$6 as Flow, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_d_exports$13 as Scenes, type ShaderEventDetail, type ShaderWhat, Shape, Sprite, Swipeable, Tappable, Text, type TextFormat, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, type WarmDetail, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, 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, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as mark, $t as PROBLEM_RULES, A as types_exports$6, At as Alpha, B as Box, Bt as scenesPlugin, C as types_exports$13, Ct as Traceable, D as types_exports$9, Dt as messageDuration, E as types_exports$10, Et as messageArgument, F as types_exports$1, Ft as Noise, G as defineStyle, Gt as Frames, H as LocalWrite, Ht as animPlugin, I as types_exports, It as Outline, J as HAPTIC_KINDS, Jt as frameAt, K as textPlugin, Kt as rendererPlugin, L as uiPlugin, Lt as defineFilter, M as types_exports$4, Mt as ColorMatrix, N as types_exports$3, Nt as Displacement, O as types_exports$8, Ot as effectsPlugin, P as types_exports$2, Pt as Glow, Q as haptic, Qt as PERF_LOG_VERSION, R as resolve, Rt as debugPlugin, S as types_exports$14, St as Touchable, T as types_exports$11, Tt as i18nPlugin, U as popup, Ut as AnimPlayer, V as DebugTrigger, Vt as assetsPlugin, W as defineTokens, Wt as Animation, X as external, Xt as PERF_CAUSES, Y as defineAnimation, Yt as MONITOR_SECTIONS, Z as frames, Zt as PERF_GAP_BUCKETS, _ as defineBundles, _t as PointerOver, a as cubicBezier, an as exit, at as spawn, b as types_exports$16, bt as Swipeable, c as hint, cn as type, ct as tween, d as defineScene, dn as lifecyclePlugin, dt as inputPlugin, en as SHADER_WHATS, et as parallel, f as tr, fn as timePlugin, ft as Draggable, g as music, gt as Pointer, h as defineEmitter, ht as Hovered, i as screen, it as sfx, j as types_exports$5, jt as Blur, k as types_exports$7, kt as Emitter, l as schedule, ln as modelPlugin, lt as use, m as flattenFeatures, mt as Held, n as createPlugin, nn as worldPlugin, nt as sequence, o as defineEffect, on as slot, ot as spawned, p as defineFeature, pn as clockPlugin, pt as DropTarget, q as platformPlugin, qt as PASS_KINDS, r as defineGame, rn as flowPlugin, rt as set, s as guide, sn as to, st as stagger, t as createApp, tn as DEMAND_REASONS, tt as play, u as projection, un as SaveUnreadableError, ut as wait, v as load, vt as Pressable, w as types_exports$12, wt as Traced, x as types_exports$15, xt as Tappable, y as types_exports$17, yt as Pressed, z as defineMotion, zt as audioPlugin } from "./src-tkKl-oCn.mjs";
1
+ import { $ as mark, $t as PROBLEM_RULES, A as types_exports$6, At as Alpha, B as Box, Bt as scenesPlugin, C as types_exports$13, Ct as Traceable, D as types_exports$9, Dt as messageDuration, E as types_exports$10, Et as messageArgument, F as types_exports$1, Ft as Noise, G as defineStyle, Gt as Frames, H as LocalWrite, Ht as animPlugin, I as types_exports, It as Outline, J as HAPTIC_KINDS, Jt as frameAt, K as textPlugin, Kt as rendererPlugin, L as uiPlugin, Lt as defineFilter, M as types_exports$4, Mt as ColorMatrix, N as types_exports$3, Nt as Displacement, O as types_exports$8, Ot as effectsPlugin, P as types_exports$2, Pt as Glow, Q as haptic, Qt as PERF_LOG_VERSION, R as resolve, Rt as debugPlugin, S as types_exports$14, St as Touchable, T as types_exports$11, Tt as i18nPlugin, U as popup, Ut as AnimPlayer, V as DebugTrigger, Vt as assetsPlugin, W as defineTokens, Wt as Animation, X as external, Xt as PERF_CAUSES, Y as defineAnimation, Yt as MONITOR_SECTIONS, Z as frames, Zt as PERF_GAP_BUCKETS, _ as defineBundles, _t as PointerOver, a as cubicBezier, an as exit, at as spawn, b as types_exports$16, bt as Swipeable, c as hint, cn as type, ct as tween, d as defineScene, dn as lifecyclePlugin, dt as inputPlugin, en as SHADER_WHATS, et as parallel, f as tr, fn as timePlugin, ft as Draggable, g as music, gt as Pointer, h as defineEmitter, ht as Hovered, i as screen, it as sfx, j as types_exports$5, jt as Blur, k as types_exports$7, kt as Emitter, l as schedule, ln as modelPlugin, lt as use, m as flattenFeatures, mt as Held, n as createPlugin, nn as worldPlugin, nt as sequence, o as defineEffect, on as slot, ot as spawned, p as defineFeature, pn as clockPlugin, pt as DropTarget, q as platformPlugin, qt as PASS_KINDS, r as defineGame, rn as flowPlugin, rt as set, s as guide, sn as to, st as stagger, t as createApp, tn as DEMAND_REASONS, tt as play, u as projection, un as SaveUnreadableError, ut as wait, v as load, vt as Pressable, w as types_exports$12, wt as Traced, x as types_exports$15, xt as Tappable, y as types_exports$17, yt as Pressed, z as defineMotion, zt as audioPlugin } from "./src-DnclBdeU.mjs";
2
2
  import { A as Order, C as Sprite, D as Exiting, E as sprite, F as system, L as tag, M as component, N as mut, O as Layer, P as resource, S as Shape, _ as HudPart, c as Countdown, f as defineTextStyles, g as Display, j as Tree, k as Now, l as Text, p as label, u as bind, v as NineSlice, w as Transform, x as Parent, y as Overlay } from "./visual-2m4wJL_z.mjs";
3
3
  import { r as defineComponent } from "./flatten-BkXuscAV.mjs";
4
4
  export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, 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, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, 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, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
@@ -1,9 +1,9 @@
1
- import { $n as FlowGraph, $t as Explained, P as Under, R as RenderStats, Rn as Position, T as Api$2, Zt as Api$1, dn as FrameDiff, jr as Snapshot, m as Usage, on as ComponentSchema, t as Api$3, tr as JournalEntry, un as EntitySnapshot, yr as Api } from "./types-vjWgmPqS.mjs";
2
- import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-CiTr21gu.mjs";
3
- import { c as UiNode } from "./types-B6YgPkY8.mjs";
4
- import { t as HeadlessApp } from "./headless-oykCMFBV.mjs";
5
- import { a as InputOf, c as Source, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-DY_wOvUF.mjs";
6
- import { n as defineSource } from "./define-DSC-Q0yU.mjs";
1
+ import { $n as FlowGraph, $t as Explained, P as Under, R as RenderStats, Rn as Position, T as Api$2, Zt as Api$1, dn as FrameDiff, jr as Snapshot, m as Usage, on as ComponentSchema, t as Api$3, tr as JournalEntry, un as EntitySnapshot, yr as Api } from "./types-DnttyLeu.mjs";
2
+ import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-C2g2KYCN.mjs";
3
+ import { c as UiNode } from "./types-CWSMo70I.mjs";
4
+ import { t as HeadlessApp } from "./headless-DDkRwLnJ.mjs";
5
+ import { a as InputOf, c as Source, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-DFoxDq-g.mjs";
6
+ import { n as defineSource } from "./define-CNctRrea.mjs";
7
7
 
8
8
  //#region src/plugins/flow/doors/read.d.ts
9
9
  /**
@@ -1,2 +1,2 @@
1
- import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-BVVlgcMv.mjs";
1
+ import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-BGsDXKuO.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxDEV, jsxs };
@@ -1,2 +1,2 @@
1
- import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-BVVlgcMv.mjs";
1
+ import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-BGsDXKuO.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxs };
@@ -1,4 +1,4 @@
1
- import { a as JsxChild, h as UiIntrinsicElements, t as DescriptionNode } from "./types-B6YgPkY8.mjs";
1
+ import { a as JsxChild, h as UiIntrinsicElements, t as DescriptionNode } from "./types-CWSMo70I.mjs";
2
2
 
3
3
  //#region src/plugins/ui/jsx/runtime.d.ts
4
4
  /** What the compiler passes as props: the children plus whatever the tag declared. */
@@ -9719,6 +9719,44 @@ function collectView(pctx, spec, item) {
9719
9719
  return values;
9720
9720
  }
9721
9721
  /**
9722
+ * Tells whether a view is a screen root that draws at the place of its projection in a list: its
9723
+ * view described a node, so `collectView` gave it a `Tree` and the `Order` of that place. A view
9724
+ * that returned its own components keeps whatever `Order` it gave itself.
9725
+ *
9726
+ * @param pctx - Domain context of the projection module.
9727
+ * @param view - A live view of the projection.
9728
+ * @param order - The `Order` of the place the projection had.
9729
+ * @returns True when the view draws at that place.
9730
+ */
9731
+ function drawsAtPlace(pctx, view, order) {
9732
+ const { Order, Tree } = pctx.deps.components;
9733
+ const rest = view.rest.get(Order.componentName)?.value;
9734
+ return view.rest.has(Tree.componentName) && typeof rest === "object" && "value" in rest && rest.value === order;
9735
+ }
9736
+ /**
9737
+ * Keeps a mounted projection for the scene that comes, as a scene switch does for a projection
9738
+ * both scenes list: it stays mounted into the new layer list, and its screen roots take the
9739
+ * `Order` of their place in the new list, on the entity and in the rest pose, so the next node of
9740
+ * a root compares equal and writes none. Nothing else is touched: no view is spawned or
9741
+ * despawned, no motion is cut, no hook runs. A view on its way out keeps the order it leaves with.
9742
+ *
9743
+ * @param pctx - Domain context of the projection module.
9744
+ * @param mounted - The mounted projection the new list names again.
9745
+ * @param order - The `Order` of its place in the new list.
9746
+ */
9747
+ function placeMounted(pctx, mounted, order) {
9748
+ const previous = mounted.order;
9749
+ mounted.layers = pctx.ctx.state.projection.layers;
9750
+ if (previous === order) return;
9751
+ mounted.order = order;
9752
+ for (const view of mounted.live.values()) {
9753
+ if (!drawsAtPlace(pctx, view, previous)) continue;
9754
+ const value = pctx.deps.components.Order({ value: order });
9755
+ view.rest.set(value.type.componentName, value);
9756
+ writeValue(pctx, view.entity, value);
9757
+ }
9758
+ }
9759
+ /**
9722
9760
  * Writes the layer of a view.
9723
9761
  *
9724
9762
  * @param pctx - Domain context of the projection module.
@@ -11037,6 +11075,155 @@ function reconcile(pctx, options) {
11037
11075
  });
11038
11076
  }
11039
11077
  //#endregion
11078
+ //#region src/plugins/world/projection/mount.ts
11079
+ /**
11080
+ * Creates the empty view tables of a freshly mounted projection. These live in their own
11081
+ * non-exported functions because lint rule L5 refuses a collection built inside an exported
11082
+ * declaration.
11083
+ *
11084
+ * @param owner - Who owns the entities of this projection.
11085
+ * @param order - The `Order` its screen roots draw at.
11086
+ * @param layers - The layer list of the scene it is mounted into.
11087
+ * @returns A mounted projection with nothing in it yet.
11088
+ */
11089
+ function emptyMounted(owner, order, layers) {
11090
+ return {
11091
+ owner,
11092
+ live: /* @__PURE__ */ new Map(),
11093
+ queue: [],
11094
+ items: /* @__PURE__ */ new Map(),
11095
+ order,
11096
+ layers
11097
+ };
11098
+ }
11099
+ /**
11100
+ * Checks that every layer a projection names is declared by the scene.
11101
+ *
11102
+ * @param pctx - Domain context of the projection module.
11103
+ * @param spec - The projection spec.
11104
+ * @throws {Error} When `layer` or `lift` is not in the layer list.
11105
+ */
11106
+ function checkLayers(pctx, spec) {
11107
+ const declared = new Set(pctx.ctx.state.projection.layers.map((layer) => layer.name));
11108
+ for (const name of [spec.layer, spec.lift]) {
11109
+ if (name === void 0 || declared.has(name)) continue;
11110
+ throw new Error(`[game] Projection "${spec.name}" names layer "${name}", which the scene does not declare.\n Add it to the layers of the scene.`);
11111
+ }
11112
+ }
11113
+ /**
11114
+ * Tells whether two layer lists declare one layer alike: every field of its entry (`sort`,
11115
+ * `above`, whatever a layer declares) the same in both. The renderer keeps the container of a
11116
+ * layer that stays, but sorts a view again only when the view changes, so a view kept under
11117
+ * another rule would stand at its old place.
11118
+ *
11119
+ * @param before - The layer list the projection was mounted under.
11120
+ * @param after - The layer list of the coming scene.
11121
+ * @param name - The layer name.
11122
+ * @returns True when both lists hold the layer with the same fields.
11123
+ * @example
11124
+ * ```ts
11125
+ * sameLayer([{ name: "ui", sort: "none" }], [{ name: "ui", sort: "order" }], "ui"); // false
11126
+ * ```
11127
+ */
11128
+ function sameLayer(before, after, name) {
11129
+ const first = before.find((layer) => layer.name === name);
11130
+ const second = after.find((layer) => layer.name === name);
11131
+ if (first === void 0 || second === void 0) return false;
11132
+ const fields = Object.entries(first);
11133
+ return fields.length === Object.keys(second).length && fields.every(([field, value]) => Object.getOwnPropertyDescriptor(second, field)?.value === value);
11134
+ }
11135
+ /**
11136
+ * Tells whether a projection draws under the same rules in two layer lists: its `layer`, and its
11137
+ * `lift` when it has one, declared alike in both.
11138
+ *
11139
+ * @param before - The layer list the projection was mounted under.
11140
+ * @param after - The layer list of the coming scene.
11141
+ * @param spec - The projection spec.
11142
+ * @returns True when the projection can stay mounted.
11143
+ */
11144
+ function drawsAlike(before, after, spec) {
11145
+ return sameLayer(before, after, spec.layer) && (spec.lift === void 0 || sameLayer(before, after, spec.lift));
11146
+ }
11147
+ /**
11148
+ * Unmounts projections: every motion of their views is finished, and the live views and the
11149
+ * despawn queue are despawned in the same call. An unknown or unmounted name is skipped.
11150
+ *
11151
+ * @param pctx - Domain context of the projection module.
11152
+ * @param names - Names of the projections to unmount.
11153
+ */
11154
+ function unmountNames(pctx, names) {
11155
+ const state = pctx.ctx.state.projection;
11156
+ for (const name of names) {
11157
+ const mounted = state.mounted.get(name);
11158
+ if (mounted === void 0) continue;
11159
+ clearMounted(pctx, mounted);
11160
+ state.mounted.delete(name);
11161
+ }
11162
+ }
11163
+ /**
11164
+ * The first pass of a mount, which touches nothing: every name is checked, a projection mounted
11165
+ * into this scene already is reported and passed over, and the rest is sorted into the ones that
11166
+ * come and the ones a scene before mounted that have to go and come back.
11167
+ *
11168
+ * @param pctx - Domain context of the projection module.
11169
+ * @param names - Names of the projections to mount.
11170
+ * @returns The specs to mount and reconcile, and the names to unmount first.
11171
+ * @throws {Error} For an unknown name, or a `layer` or `lift` the scene does not declare.
11172
+ */
11173
+ function sortMount(pctx, names) {
11174
+ const state = pctx.ctx.state.projection;
11175
+ const fresh = [];
11176
+ const again = [];
11177
+ for (const name of names) {
11178
+ const spec = state.specs.get(name);
11179
+ if (spec === void 0) throw new Error(`[game] Projection "${name}" is not registered.\n Register it before a scene mounts it.`);
11180
+ const mounted = state.mounted.get(name);
11181
+ if (mounted?.layers === state.layers) {
11182
+ pctx.ctx.log.warn("world:already-mounted", { projection: name });
11183
+ continue;
11184
+ }
11185
+ checkLayers(pctx, spec);
11186
+ if (mounted !== void 0 && drawsAlike(mounted.layers, state.layers, spec)) continue;
11187
+ if (mounted !== void 0) again.push(name);
11188
+ fresh.push(spec);
11189
+ }
11190
+ return {
11191
+ fresh,
11192
+ again
11193
+ };
11194
+ }
11195
+ /**
11196
+ * Mounts the projections of a list under an owner. A new one is reconciled at once, direct. One
11197
+ * a scene before mounted stays when the current layer list declares its layers alike, and takes
11198
+ * its place in this list; one whose layer is declared otherwise is unmounted and mounted again.
11199
+ * One mounted into this scene already is reported and changes nothing. Nothing is mounted when
11200
+ * the call throws.
11201
+ *
11202
+ * @param pctx - Domain context of the projection module.
11203
+ * @param names - Names of the projections to mount.
11204
+ * @param owner - Who owns the entities of the new ones.
11205
+ * @throws {Error} For an unknown name, or a `layer` or `lift` the scene does not declare.
11206
+ */
11207
+ function mountNames(pctx, names, owner) {
11208
+ const state = pctx.ctx.state.projection;
11209
+ const { fresh, again } = sortMount(pctx, names);
11210
+ unmountNames(pctx, again);
11211
+ for (const name of names) {
11212
+ const order = names.indexOf(name) - names.length;
11213
+ const mounted = state.mounted.get(name);
11214
+ if (mounted === void 0) state.mounted.set(name, emptyMounted(owner, order, state.layers));
11215
+ else if (mounted.layers !== state.layers) placeMounted(pctx, mounted, order);
11216
+ }
11217
+ if (fresh.length === 0) return;
11218
+ reconcile(pctx, {
11219
+ names: fresh.map((spec) => spec.name),
11220
+ direct: true,
11221
+ force: true,
11222
+ converge: false,
11223
+ settle: false
11224
+ });
11225
+ }
11226
+ //#endregion
11040
11227
  //#region src/plugins/world/projection/api.ts
11041
11228
  /**
11042
11229
  * Tells whether a cause sets the picture instead of playing it.
@@ -11069,25 +11256,8 @@ function isConvergeCause(cause) {
11069
11256
  return cause === "load" || cause === "restore";
11070
11257
  }
11071
11258
  /**
11072
- * Creates the empty view tables of a freshly mounted projection. These live in their own
11073
- * non-exported functions because lint rule L5 refuses a collection built inside an exported
11074
- * declaration.
11075
- *
11076
- * @param owner - Who owns the entities of this projection.
11077
- * @param order - The `Order` its screen roots draw at.
11078
- * @returns A mounted projection with nothing in it yet.
11079
- */
11080
- function emptyMounted(owner, order) {
11081
- return {
11082
- owner,
11083
- live: /* @__PURE__ */ new Map(),
11084
- queue: [],
11085
- items: /* @__PURE__ */ new Map(),
11086
- order
11087
- };
11088
- }
11089
- /**
11090
- * Creates the empty mute table of one entity.
11259
+ * Creates the empty mute table of one entity. It lives in its own non-exported function because
11260
+ * lint rule L5 refuses a collection built inside an exported declaration.
11091
11261
  *
11092
11262
  * @returns An empty table of component name to owned fields.
11093
11263
  */
@@ -11173,20 +11343,6 @@ function noPeers() {
11173
11343
  };
11174
11344
  }
11175
11345
  /**
11176
- * Checks that every layer a projection names is declared by the scene.
11177
- *
11178
- * @param pctx - Domain context of the projection module.
11179
- * @param spec - The projection spec.
11180
- * @throws {Error} When `layer` or `lift` is not in the layer list.
11181
- */
11182
- function checkLayers(pctx, spec) {
11183
- const declared = new Set(pctx.ctx.state.projection.layers.map((layer) => layer.name));
11184
- for (const name of [spec.layer, spec.lift]) {
11185
- if (name === void 0 || declared.has(name)) continue;
11186
- throw new Error(`[game] Projection "${spec.name}" names layer "${name}", which the scene does not declare.\n Add it to the layers of the scene.`);
11187
- }
11188
- }
11189
- /**
11190
11346
  * Creates the projection module: the public API `scenes`, `input` and `i18n` call, plus the
11191
11347
  * methods the plugin root drives from the frame and the `model:committed` hook.
11192
11348
  *
@@ -11251,33 +11407,10 @@ function createProjectionApi(ctx, deps) {
11251
11407
  },
11252
11408
  layers: () => state.layers,
11253
11409
  mount: (names, owner) => {
11254
- const fresh = [];
11255
- for (const name of names) {
11256
- const spec = state.specs.get(name);
11257
- if (spec === void 0) throw new Error(`[game] Projection "${name}" is not registered.\n Register it before a scene mounts it.`);
11258
- if (state.mounted.has(name)) {
11259
- ctx.log.warn("world:already-mounted", { projection: name });
11260
- continue;
11261
- }
11262
- checkLayers(pctx, spec);
11263
- fresh.push(spec);
11264
- }
11265
- for (const spec of fresh) state.mounted.set(spec.name, emptyMounted(owner, names.indexOf(spec.name) - names.length));
11266
- if (fresh.length > 0) reconcile(pctx, {
11267
- names: fresh.map((spec) => spec.name),
11268
- direct: true,
11269
- force: true,
11270
- converge: false,
11271
- settle: false
11272
- });
11410
+ mountNames(pctx, names, owner);
11273
11411
  },
11274
11412
  unmount: (names) => {
11275
- for (const name of names) {
11276
- const mounted = state.mounted.get(name);
11277
- if (mounted === void 0) continue;
11278
- clearMounted(pctx, mounted);
11279
- state.mounted.delete(name);
11280
- }
11413
+ unmountNames(pctx, names);
11281
11414
  },
11282
11415
  restOf: (entity, component) => {
11283
11416
  const stored = (state.byEntity.get(entity)?.rest ?? state.rests.get(entity))?.get(component.componentName);
@@ -32094,14 +32227,14 @@ function cancelTracksOf(actx, entity) {
32094
32227
  //#endregion
32095
32228
  //#region src/plugins/anim/tween/driver.ts
32096
32229
  /** The empty field set of every track nobody muted: one frozen set, shared, read every frame. */
32097
- const NO_FIELDS = Object.freeze(/* @__PURE__ */ new Set());
32230
+ const NO_FIELDS$1 = Object.freeze(/* @__PURE__ */ new Set());
32098
32231
  /**
32099
32232
  * The muted fields of a timeline step's track: none.
32100
32233
  *
32101
32234
  * @returns The shared empty set; a frame builds no set.
32102
32235
  */
32103
32236
  function noFields() {
32104
- return NO_FIELDS;
32237
+ return NO_FIELDS$1;
32105
32238
  }
32106
32239
  /**
32107
32240
  * Creates the tween engine `world` runs `ViewHandle.tween`, `toRest` and `all` on. Installed with
@@ -35732,9 +35865,22 @@ function overTargetOf(ctx, node, run) {
35732
35865
  return takePending(ctx);
35733
35866
  }
35734
35867
  /**
35735
- * Builds the scene in one synchronous block: the layers, then the projections of the old scene
35736
- * out, then the ones of the new scene in, the new scene to the world's systems, then the list the
35737
- * scene names to `assets`, then the frame loop out of its idle cap, and only then the event.
35868
+ * The projections of the scene that leaves which the scene that comes does not list. A projection
35869
+ * both list stays mounted: the layers of a projection are the ones its spec names, and both scenes
35870
+ * declare them, so its views stay in the same layer containers.
35871
+ *
35872
+ * @param previous - The scene that leaves.
35873
+ * @param scene - The scene that comes.
35874
+ * @returns The names to unmount, in the order the leaving scene lists them.
35875
+ */
35876
+ function leavingOf(previous, scene) {
35877
+ return previous.projections.filter((name) => !scene.projections.includes(name));
35878
+ }
35879
+ /**
35880
+ * Builds the scene in one synchronous block: the layers, then the projections only the old scene
35881
+ * lists out, then the list of the new scene in (a projection both list stays and takes its new
35882
+ * place), the new scene to the world's systems, then the list the scene names to `assets`, then
35883
+ * the frame loop out of its idle cap, and only then the event.
35738
35884
  *
35739
35885
  * @param ctx - Domain context of the plugin.
35740
35886
  * @param scene - The scene whose bundles are there.
@@ -35746,7 +35892,7 @@ function apply(ctx, scene, named) {
35746
35892
  const from = state.current;
35747
35893
  const previous = from === void 0 ? void 0 : state.scenes.get(from);
35748
35894
  projection.setLayers(scene.layers);
35749
- if (previous !== void 0) projection.unmount(previous.projections);
35895
+ if (previous !== void 0) projection.unmount(leavingOf(previous, scene));
35750
35896
  projection.mount(scene.projections, state.owner);
35751
35897
  state.current = scene.id;
35752
35898
  ctx.deps.world.ecs.setScene(scene.id);
@@ -47773,20 +47919,68 @@ function resolveContent(ctx, entity, text) {
47773
47919
  return resolved;
47774
47920
  }
47775
47921
  /**
47776
- * The one system of the plugin: phase `layout`, before the two of `ui`, over every label. Every
47777
- * label is visited every frame: `ui` writes `Text` after this system and change sets clear in
47778
- * phase `signals`, so `changed(Text)` cannot tell which moved. The locale is read once per run,
47779
- * the clock at most once and only when a countdown label asks.
47922
+ * The frame the system and the step after the layout flush share, made once per plugin.
47780
47923
  *
47781
47924
  * @param ctx - Domain context of the text plugin.
47782
- * @returns The system definition `world.ecs.system` takes.
47925
+ * @returns A frame with no locale and no moment read yet.
47783
47926
  */
47784
- function createTextSystem(ctx) {
47785
- const frame = {
47927
+ function createTextFrame(ctx) {
47928
+ return {
47786
47929
  now: NaN,
47787
47930
  locale: "",
47788
47931
  duration: (ms) => ctx.deps.i18n.duration(ms)
47789
47932
  };
47933
+ }
47934
+ /**
47935
+ * Empties a list of labels in place: popped, so it keeps its store for the next batch.
47936
+ *
47937
+ * @param labels - The list.
47938
+ */
47939
+ function forgetAdded(labels) {
47940
+ while (labels.length > 0) labels.pop();
47941
+ }
47942
+ /** A patch with no field: the write marks `Text` changed and changes nothing. Frozen, so no caller fills it. */
47943
+ const NO_FIELDS = Object.freeze({});
47944
+ /**
47945
+ * Writes `Text` once more, with no field, for the labels the step after the last layout flush
47946
+ * resolved. `ui` measured them in its solve, before they were resolved, and the change of that
47947
+ * frame is gone; this one reaches its remeasure in the same layout phase, so a label whose string
47948
+ * measures otherwise than what `ui` measured gets its size. A label whose `Text` left is skipped.
47949
+ *
47950
+ * @param ctx - Domain context of the text plugin.
47951
+ */
47952
+ function writeOnceMore(ctx) {
47953
+ const ecs = ctx.deps.world.ecs;
47954
+ for (const entity of ctx.state.rewrite) if (ecs.get(entity, Text) !== void 0) ecs.set(entity, Text, NO_FIELDS);
47955
+ forgetAdded(ctx.state.rewrite);
47956
+ }
47957
+ /**
47958
+ * Notes a label whose `Text` came, as the world's `onAdded` hook calls it: it is marked for the
47959
+ * next layout phase, and while the world is live it is listed for the step after the layout
47960
+ * flush. In another mode no layout phase runs and the list would only grow: the label waits for
47961
+ * the next live run of the system, which resolves every marked label.
47962
+ *
47963
+ * @param ctx - Domain context of the text plugin.
47964
+ * @param entity - The entity that got a `Text`.
47965
+ */
47966
+ function noteAdded(ctx, entity) {
47967
+ ctx.state.dirty.add(entity);
47968
+ if (ctx.deps.world.ecs.mode() === "live") ctx.state.added.push(entity);
47969
+ }
47970
+ /**
47971
+ * The one system of the plugin: phase `layout`, before the two of `ui`, over every label. Every
47972
+ * label is visited every frame: `ui` writes `Text` after this system and change sets clear in
47973
+ * phase `signals`, so `changed(Text)` cannot tell which moved. The locale is read once per run,
47974
+ * the clock at most once and only when a countdown label asks. The labels that came before the run
47975
+ * are in its walk, so the list of the labels that came starts again empty: the step after the
47976
+ * layout flush takes only the ones the flush brings. The labels that step resolved last get their
47977
+ * `Text` written once more first, so `ui` measures the string they show.
47978
+ *
47979
+ * @param ctx - Domain context of the text plugin.
47980
+ * @param frame - What the runs share with the step after the layout flush.
47981
+ * @returns The system definition `world.ecs.system` takes.
47982
+ */
47983
+ function createTextSystem(ctx, frame) {
47790
47984
  return system({
47791
47985
  name: TEXT_SYSTEM_NAME,
47792
47986
  phase: "layout",
@@ -47794,11 +47988,42 @@ function createTextSystem(ctx) {
47794
47988
  run: (entities) => {
47795
47989
  frame.now = NaN;
47796
47990
  frame.locale = ctx.deps.i18n.locale();
47991
+ forgetAdded(ctx.state.added);
47992
+ if (ctx.state.rewrite.length > 0) writeOnceMore(ctx);
47797
47993
  for (const row of entities) stepText(ctx, row[0], row[1], frame);
47798
47994
  }
47799
47995
  });
47800
47996
  }
47801
47997
  /**
47998
+ * Resolves the labels whose `Text` came after the layout system ran. `ui` adds a label in its
47999
+ * solve, and the flush at the end of phase `layout` attaches it with the rest of its batch, a bound
48000
+ * component included; this runs right after that flush and before phase `sync`, so the renderer
48001
+ * builds the label with its string, and lists it, so the next system run writes its `Text` once
48002
+ * more for the remeasure of `ui`. A label whose content changed is not among them: it resolves in
48003
+ * the next layout phase, as before. While the world is not live its layout phase did not run: the
48004
+ * list is dropped, and the labels, marked, wait for the next live run, as every label does.
48005
+ *
48006
+ * @param ctx - Domain context of the text plugin.
48007
+ * @param frame - What the system's runs share.
48008
+ */
48009
+ function resolveAdded(ctx, frame) {
48010
+ const added = ctx.state.added;
48011
+ if (added.length === 0) return;
48012
+ if (ctx.deps.world.ecs.mode() !== "live") {
48013
+ added.length = 0;
48014
+ return;
48015
+ }
48016
+ frame.now = NaN;
48017
+ frame.locale = ctx.deps.i18n.locale();
48018
+ for (const entity of added) {
48019
+ const text = ctx.deps.world.ecs.get(entity, Text);
48020
+ if (text === void 0) continue;
48021
+ stepText(ctx, entity, text, frame);
48022
+ ctx.state.rewrite.push(entity);
48023
+ }
48024
+ forgetAdded(added);
48025
+ }
48026
+ /**
47802
48027
  * Marks labels for the next layout phase: every one of them, or only the ones `keep` names. A
47803
48028
  * locale change names the labels whose content is a message; a dev hot swap names the labels
47804
48029
  * drawn with a replaced font or icon.
@@ -48544,9 +48769,12 @@ function replaceStyles(ctx, styles) {
48544
48769
  ctx.deps.time.wake();
48545
48770
  }
48546
48771
  /**
48547
- * Opens what the plugin owns: the style table, the font keys, the layout system, the two world
48548
- * hooks of `Text` and the display adapter. The fonts of a bundle that is already loaded are read
48549
- * at once, because the boot bundle lands before this runs.
48772
+ * Opens what the plugin owns: the style table, the font keys, the layout system, the step after
48773
+ * the layout flush, the two world hooks of `Text` and the display adapter. The step is a frame
48774
+ * callback of phase `layout`: `world` registered its own in its `onStart`, which runs before this
48775
+ * one (`text` depends on `world`), so the step runs after the world's layout phase and its flush,
48776
+ * and before phase `sync`. The fonts of a bundle that is already loaded are read at once, because
48777
+ * the boot bundle lands before this runs.
48550
48778
  *
48551
48779
  * @param ctx - Kernel context of the text plugin.
48552
48780
  * @throws {Error} When two features define the same style name.
@@ -48554,18 +48782,18 @@ function replaceStyles(ctx, styles) {
48554
48782
  function startText(ctx) {
48555
48783
  const tctx = withDeps$1(ctx);
48556
48784
  const ecs = tctx.deps.world.ecs;
48785
+ const frame = createTextFrame(tctx);
48557
48786
  buildStyles(tctx);
48558
48787
  collectFonts(tctx);
48559
- tctx.state.removers.push(ecs.system(createTextSystem(tctx)), ecs.onAdded(Text, (entity) => {
48560
- tctx.state.dirty.add(entity);
48561
- }), ecs.onRemoved(Text, (entity) => {
48788
+ tctx.state.removers.push(ecs.system(createTextSystem(tctx, frame)), tctx.deps.time.onFrame("layout", () => resolveAdded(tctx, frame)), ecs.onAdded(Text, (entity) => noteAdded(tctx, entity)), ecs.onRemoved(Text, (entity) => {
48562
48789
  forgetText(tctx.state, entity);
48563
48790
  }), tctx.deps.renderer.sync.displays.provide(Text, createTextAdapter(tctx)));
48564
48791
  installFonts(tctx);
48565
48792
  }
48566
48793
  /**
48567
- * Closes what the plugin opened: the system, the two world hooks and the adapter. The Pixi
48568
- * objects the adapter built are the renderer's, and it frees them in its own teardown.
48794
+ * Closes what the plugin opened: the system, the step after the layout flush, the two world hooks
48795
+ * and the adapter. The Pixi objects the adapter built are the renderer's, and it frees them in its
48796
+ * own teardown.
48569
48797
  *
48570
48798
  * @param state - The plugin state, the only thing a teardown context carries.
48571
48799
  */
@@ -48582,6 +48810,8 @@ function stopText(state) {
48582
48810
  state.measured.clear();
48583
48811
  state.cache.clear();
48584
48812
  state.dirty.clear();
48813
+ state.added.length = 0;
48814
+ state.rewrite.length = 0;
48585
48815
  state.warned.clear();
48586
48816
  }
48587
48817
  //#endregion
@@ -48731,6 +48961,8 @@ function createTextState$1() {
48731
48961
  cache: emptyMap$2(),
48732
48962
  drawn: emptyWeakMap(),
48733
48963
  dirty: emptySet$1(),
48964
+ added: [],
48965
+ rewrite: [],
48734
48966
  generation: 0,
48735
48967
  warned: emptySet$1(),
48736
48968
  removers: []
@@ -53462,6 +53694,7 @@ function createReconciler(ctx, modules, fields) {
53462
53694
  };
53463
53695
  let slotsVersion = -1;
53464
53696
  let slotsRoots = -1;
53697
+ let placedUnder;
53465
53698
  /**
53466
53699
  * Registers the key of an element under its root, so `entityOf` and `find` answer for it. A key
53467
53700
  * `ui` gave a node of its own, a spacer's, is never registered.
@@ -54452,6 +54685,18 @@ function createReconciler(ctx, modules, fields) {
54452
54685
  if (element?.live === true && root.slot === void 0) ecs.set(element.entity, Order, { value: order });
54453
54686
  }
54454
54687
  /**
54688
+ * Gives every root the order its entity holds once a new scene stands: a scene that keeps a
54689
+ * projection both scenes list places it again (F23), and its tree stands, so no root is dirty.
54690
+ * The world places it only under a new layer list, so the walk runs once per new list, in the
54691
+ * first layout phase that runs after it, also when the switch came while the world was paused.
54692
+ */
54693
+ function reorderRoots() {
54694
+ const layers = ctx.deps.world.projection.layers();
54695
+ if (layers === placedUnder) return;
54696
+ placedUnder = layers;
54697
+ for (const root of state.roots.values()) if (!state.removing.has(root.entity)) refreshRootOrder(root);
54698
+ }
54699
+ /**
54455
54700
  * Reconciles one dirty root: reads its current tree and projection name, then diffs it. The root
54456
54701
  * stays dirty while the layout engine is not loaded, and a failure is logged for this root only.
54457
54702
  *
@@ -54473,14 +54718,15 @@ function createReconciler(ctx, modules, fields) {
54473
54718
  }
54474
54719
  /**
54475
54720
  * The first of the two systems of phase `layout`: the sweep, the roots a restore asked to build
54476
- * again, the popups that may leave, the pull of the text being typed, the scroll offsets and the
54477
- * windowed ranges, the bound texts that show a string of another size, the viewport, the dirty
54478
- * roots and the hosted views.
54721
+ * again, the roots a scene placed again, the popups that may leave, the pull of the text being
54722
+ * typed, the scroll offsets and the windowed ranges, the bound texts that show a string of
54723
+ * another size, the viewport, the dirty roots and the hosted views.
54479
54724
  */
54480
54725
  function reconcile() {
54481
54726
  sweep();
54482
54727
  state.reconciles += 1;
54483
54728
  if (state.remount) remountRoots();
54729
+ reorderRoots();
54484
54730
  settlePopups(ctx, state, unmountRoot);
54485
54731
  fields.pull();
54486
54732
  const containers = scrollContainers();
@@ -1,7 +1,7 @@
1
- import { Jn as FeaturePlugin, Sr as Json, Xn as AnyFlow, dr as NodeFx, gr as FakeClock, mr as ClockSource, nr as NodeTable, or as Descriptor, ur as Hint } from "./types-vjWgmPqS.mjs";
2
- import { t as createApp } from "./index-Cv5r0M9Y.mjs";
3
- import { b as saveOf, v as WithGameState, y as memory } from "./types-VNoG7shY.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-oykCMFBV.mjs";
1
+ import { Jn as FeaturePlugin, Sr as Json, Xn as AnyFlow, dr as NodeFx, gr as FakeClock, mr as ClockSource, nr as NodeTable, or as Descriptor, ur as Hint } from "./types-DnttyLeu.mjs";
2
+ import { t as createApp } from "./index-Bq_93oZv.mjs";
3
+ import { b as saveOf, v as WithGameState, y as memory } from "./types-6inPYTzE.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-DDkRwLnJ.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 { an as exit, cn as type, in as refuseStart, m as flattenFeatures, t as createApp } from "./src-tkKl-oCn.mjs";
1
+ import { an as exit, cn as type, in as refuseStart, m as flattenFeatures, t as createApp } from "./src-DnclBdeU.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,7 +1,7 @@
1
- import { At as Orientation, Dr as PlayerStateProvider, E as Config$2, Jn as FeaturePlugin, Mr as SnapshotOf, Or as ProviderCall, Pn as Config$1, Sr as Json, Xn as AnyFlow, a as Config$3, ar as TypeTag, br as Config, d as Manifest, gr as FakeClock, k as PixiModule, kr as SaveDoc, mr as ClockSource, n as AssetsIo } from "./types-vjWgmPqS.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-CiTr21gu.mjs";
3
- import { H as TextKey, I as I18nApi, V as StringTable } from "./types-B6YgPkY8.mjs";
4
- import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-Cv5r0M9Y.mjs";
1
+ import { At as Orientation, Dr as PlayerStateProvider, E as Config$2, Jn as FeaturePlugin, Mr as SnapshotOf, Or as ProviderCall, Pn as Config$1, Sr as Json, Xn as AnyFlow, a as Config$3, ar as TypeTag, br as Config, d as Manifest, gr as FakeClock, k as PixiModule, kr as SaveDoc, mr as ClockSource, n as AssetsIo } from "./types-DnttyLeu.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-C2g2KYCN.mjs";
3
+ import { H as TextKey, I as I18nApi, V as StringTable } from "./types-CWSMo70I.mjs";
4
+ import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-Bq_93oZv.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
7
7
  //#region src/plugins/model/store/providers/memory.d.ts
@@ -1,5 +1,5 @@
1
- import { A as PixiSprite, An as TrackSegment, Hr as Api$1, Mn as Api$2, Nt as FilterCache, O as PixiFilter, On as ReducedMotion, Ot as FilterSlot, Qr as Require, Rr as Events$5, Sr as Json, T as Api$4, Tn as NumericFields, Zr as Events$2, Zt as Api$3, an as ComponentHandle, ar as TypeTag, in as AnyComponentValue, j as PixiTexture, jt as Point, k as PixiModule, kn as TrackOptions, kt as FilterSlotInputs, ln as Entity, nn as AnyComponent, or as Descriptor, s as Events$1, sn as ComponentType, t as Api$5, v as Events$4, wn as MotionHandle, xn as Ease, xr as Events$3, yr as Api$6 } from "./types-vjWgmPqS.mjs";
2
- import { I as I18nApi, J as StylesState, S as TextApi, c as UiNode, i as Finding, j as InputApi, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-B6YgPkY8.mjs";
1
+ import { A as PixiSprite, An as TrackSegment, Hr as Api$1, Mn as Api$2, Nt as FilterCache, O as PixiFilter, On as ReducedMotion, Ot as FilterSlot, Qr as Require, Rr as Events$5, Sr as Json, T as Api$4, Tn as NumericFields, Zr as Events$2, Zt as Api$3, an as ComponentHandle, ar as TypeTag, in as AnyComponentValue, j as PixiTexture, jt as Point, k as PixiModule, kn as TrackOptions, kt as FilterSlotInputs, ln as Entity, nn as AnyComponent, or as Descriptor, s as Events$1, sn as ComponentType, t as Api$5, v as Events$4, wn as MotionHandle, xn as Ease, xr as Events$3, yr as Api$6 } from "./types-DnttyLeu.mjs";
2
+ import { I as I18nApi, J as StylesState, S as TextApi, c as UiNode, i as Finding, j as InputApi, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-CWSMo70I.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";
@@ -1,4 +1,4 @@
1
- import { Cn as MotionCause, En as ProjectionMotion, Hr as Api, Jt as TransformValue, Mn as Api$1, Mt as ViewportSize, Qr as Require, Sn as Motion, Sr as Json, T as Api$3, Tn as NumericFields, Zt as Api$2, fr as Answer, in as AnyComponentValue, jn as ViewHandle, ln as Entity, nn as AnyComponent, or as Descriptor, pr as Api$5, rn as AnyComponentType, s as Events$1, sn as ComponentType, t as Api$4, ur as Hint, vn as TagType, wn as MotionHandle, yn as ChangeHook } from "./types-vjWgmPqS.mjs";
1
+ import { Cn as MotionCause, En as ProjectionMotion, Hr as Api, Jt as TransformValue, Mn as Api$1, Mt as ViewportSize, Qr as Require, Sn as Motion, Sr as Json, T as Api$3, Tn as NumericFields, Zt as Api$2, fr as Answer, in as AnyComponentValue, jn as ViewHandle, ln as Entity, nn as AnyComponent, or as Descriptor, pr as Api$5, rn as AnyComponentType, s as Events$1, sn as ComponentType, t as Api$4, ur as Hint, vn as TagType, wn as MotionHandle, yn as ChangeHook } from "./types-DnttyLeu.mjs";
2
2
  import { Log } from "@moku-labs/common/browser";
3
3
  import { PluginCtx } from "@moku-labs/core";
4
4
 
@@ -1694,12 +1694,23 @@ type State = {
1694
1694
  cache: Map<string, TextLayout>; /** What every live label container was last filled from, by container. */
1695
1695
  drawn: WeakMap<object, DrawnLabel>; /** Entities to re-resolve in the next layout phase. */
1696
1696
  dirty: Set<Entity>;
1697
+ /**
1698
+ * The labels whose `Text` came while the world was live since the layout system last ran. The
1699
+ * flush of phase `layout` brings the ones `ui` adds in its solve, and they are resolved right
1700
+ * after it.
1701
+ */
1702
+ added: Entity[];
1703
+ /**
1704
+ * The labels the step after the last layout flush resolved. The next system run writes their
1705
+ * `Text` once more, so `ui` measures the string they show.
1706
+ */
1707
+ rewrite: Entity[];
1697
1708
  /**
1698
1709
  * Counts the dev hot swaps that replaced a font or an inline icon of a live label. A label
1699
1710
  * container drawn under an older count is built again on its next update.
1700
1711
  */
1701
1712
  generation: number; /** Warning keys already written, so a style, a tag, a glyph or a font warns once. */
1702
- warned: Set<string>; /** The system, the two world hooks and the display adapter. */
1713
+ warned: Set<string>; /** The system, the step after the layout flush, the two world hooks and the display adapter. */
1703
1714
  removers: Array<() => void>;
1704
1715
  };
1705
1716
  /**
@@ -1,5 +1,5 @@
1
- import { Sr as Json, jr as Snapshot } from "./types-vjWgmPqS.mjs";
2
- import { t as HeadlessApp } from "./headless-oykCMFBV.mjs";
1
+ import { Sr as Json, jr as Snapshot } from "./types-DnttyLeu.mjs";
2
+ import { t as HeadlessApp } from "./headless-DDkRwLnJ.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
 
5
5
  //#region src/plugins/flow/doors/types.d.ts
@@ -4299,8 +4299,8 @@ type View$1 = {
4299
4299
  cause: MotionCause;
4300
4300
  };
4301
4301
  /**
4302
- * One mounted projection: its owner, the live views by key, the despawn queue and the items of
4303
- * the last reconcile.
4302
+ * One mounted projection: its owner, the live views by key, the despawn queue, the items of the
4303
+ * last reconcile, its place in the list of its scene and the layer list of that scene.
4304
4304
  *
4305
4305
  * @example
4306
4306
  * ```ts
@@ -4309,7 +4309,8 @@ type View$1 = {
4309
4309
  * live: new Map(),
4310
4310
  * queue: [],
4311
4311
  * items: new Map(),
4312
- * order: -1
4312
+ * order: -1,
4313
+ * layers: Object.freeze([{ name: "items", sort: "y" }])
4313
4314
  * };
4314
4315
  * ```
4315
4316
  */
@@ -4323,6 +4324,11 @@ type Mounted = {
4323
4324
  * minus the length of that list (the roots of one scene take −n … −1, in list order).
4324
4325
  */
4325
4326
  order: number;
4327
+ /**
4328
+ * The layer list (`setLayers`) of the scene the projection was mounted into or kept by last, compared by
4329
+ * identity: a `mount` under the same list is a second mount of one scene, a `mount` under a new one keeps it.
4330
+ */
4331
+ layers: ReadonlyArray<LayerSpec>;
4326
4332
  };
4327
4333
  /**
4328
4334
  * One track the projection started on the driver. The world keeps the component name and the
@@ -4496,17 +4502,30 @@ type ProjectionApi = {
4496
4502
  layers(): ReadonlyArray<LayerSpec>;
4497
4503
  /**
4498
4504
  * Marks projections mounted under an owner and reconciles them at once, direct: a scene brings
4499
- * its own transition. Nothing is mounted when the call throws.
4505
+ * its own transition. A screen root draws at the `Order` of its place in the list, −n … −1. A
4506
+ * projection a scene before mounted (under another layer list, `setLayers`) stays mounted when
4507
+ * the new list declares its `layer` and `lift` alike: its views keep their entities and their
4508
+ * motions, no hook runs, and its screen roots take the `Order` of their place in this list. One
4509
+ * whose layer the new list declares otherwise is unmounted and mounted again. One mounted under
4510
+ * the current layer list already is a second mount of one scene: it warns
4511
+ * `world:already-mounted` and changes nothing. Nothing is mounted when the call throws.
4500
4512
  *
4501
4513
  * @param names - Names of the projections to mount.
4502
4514
  * @param owner - Who owns the entities of these projections.
4503
4515
  * @throws {Error} For an unknown name, or a `layer` or `lift` the scene does not declare.
4504
4516
  * @example
4505
4517
  * ```ts
4506
- * // `scenes` mounts the projections of the board scene it just switched to.
4518
+ * // `scenes` mounts the board scene it just switched to: its HUD screen is listed last, at -1.
4507
4519
  * const world = ctx.require(worldPlugin);
4508
- * world.projection.mount(["board.cells", "board.items"], { kind: "plugin", name: "scenes" });
4520
+ * world.projection.mount(["board.items", "hud"], { kind: "plugin", name: "scenes" });
4509
4521
  * world.projection.entityOf("board.items", "i7"); // 1048576, the picture is already there
4522
+ *
4523
+ * // The shop lists the HUD too and declares `ui` alike: the shop's layers, the board's items
4524
+ * // out, the shop's list in.
4525
+ * world.projection.setLayers([{ name: "ui", sort: "order" }]);
4526
+ * world.projection.unmount(["board.items"]);
4527
+ * world.projection.mount(["hud", "shop.shelf"], { kind: "plugin", name: "scenes" });
4528
+ * world.ecs.get(world.projection.entityOf("hud", "hud") ?? 0, Order)?.value; // -2: the same entity, first of two
4510
4529
  * ```
4511
4530
  */
4512
4531
  mount(names: readonly string[], owner: Owner): void;
@@ -1,9 +1,9 @@
1
- import { Ir as Api$3, T as Api, Zt as Api$1, yr as Api$2 } from "./types-vjWgmPqS.mjs";
2
- import { P as AnimApi, r as UiApi } from "./types-CiTr21gu.mjs";
3
- import { j as InputApi } from "./types-B6YgPkY8.mjs";
4
- import { r as Repro } from "./headless-oykCMFBV.mjs";
5
- import { a as InputOf, r as ControlApp } from "./types-DY_wOvUF.mjs";
6
- import { t as commands } from "./commands-CvWBaoEi.mjs";
1
+ import { Ir as Api$3, T as Api, Zt as Api$1, yr as Api$2 } from "./types-DnttyLeu.mjs";
2
+ import { P as AnimApi, r as UiApi } from "./types-C2g2KYCN.mjs";
3
+ import { j as InputApi } from "./types-CWSMo70I.mjs";
4
+ import { r as Repro } from "./headless-DDkRwLnJ.mjs";
5
+ import { a as InputOf, r as ControlApp } from "./types-DFoxDq-g.mjs";
6
+ import { t as commands } from "./commands-e_I5i8dK.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-B8ve4Qll.mjs";
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-DalSHy9z.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.4",
3
+ "version": "0.15.5",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [