@moku-labs/game 0.15.118 → 0.15.119

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 { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-ktcMr5ce.mjs";
1
+ import { h as StartedPage, r as GameConfig, t as AnyGameApp, u as PageOptions } from "../types-XygtsVg3.mjs";
2
2
 
3
3
  //#region src/app/page.d.ts
4
4
  /**
package/dist/app/page.mjs CHANGED
@@ -2,7 +2,7 @@ import { i as systemSource, t as memory } from "../memory-DeD9wis6.mjs";
2
2
  import { t as applyTo } from "../drafts-BawpSaVp.mjs";
3
3
  import { i as isControl } from "../dev-BNndV-hU.mjs";
4
4
  import { n as fakeClock, t as VISUAL_CLOCK } from "../fake-hnJcJeYf.mjs";
5
- import { n as read, r as watch, t as sources } from "../sources-WiVMRhXq.mjs";
5
+ import { n as read, r as watch, t as sources } from "../sources-CdWn7B5r.mjs";
6
6
  import { n as resolveConfig } from "../config-DVqciSkP.mjs";
7
7
  //#region src/app/boot.ts
8
8
  /** How long after the fade the timer removes a picture whose transition never ended, ms. */
@@ -1,6 +1,6 @@
1
1
  import { Jr as PlayerStateProvider } from "../types-BUR4LWSa.mjs";
2
- import { Et as PlatformProvider } from "../index-Fth_AFjs.mjs";
3
- import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-ktcMr5ce.mjs";
2
+ import { Et as PlatformProvider } from "../index-CKF3qS2-.mjs";
3
+ import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-XygtsVg3.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
1
  import { Ur as Json } from "./types-BUR4LWSa.mjs";
2
- import { J as StringTable } from "./types-CMFC7k5L.mjs";
3
- import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-ktcMr5ce.mjs";
2
+ import { J as StringTable } from "./types-BHEOjYV3.mjs";
3
+ import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-XygtsVg3.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 { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-CvM4Qhtr.mjs";
1
+ import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-_nn6V6aX.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
@@ -1,6 +1,6 @@
1
1
  import { D as DebugSwitches, Ln as FlowState, Pn as Bookmark, Pr as Api, Qr as Snapshot, Z as Api$2, di as FrameRate, ei as StoreApi, hi as Time, kr as Api$3, pt as Captured, ri as Api$1, w as ScenesApi } from "./types-BUR4LWSa.mjs";
2
- import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-DIdCmTQx.mjs";
3
- import { R as InputApi } from "./types-CMFC7k5L.mjs";
2
+ import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-cEAJaK0D.mjs";
3
+ import { R as InputApi } from "./types-BHEOjYV3.mjs";
4
4
  import { t as HeadlessApp } from "./headless-C5kxf9oU.mjs";
5
5
  import { i as ControlApp, r as Command } from "./types-CATC2vK8.mjs";
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { t as HeadlessApp } from "./headless-C5kxf9oU.mjs";
2
2
  import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-CATC2vK8.mjs";
3
- import { t as commands } from "./commands-B16wtdhf.mjs";
3
+ import { t as commands } from "./commands-CzT9eYnf.mjs";
4
4
  import { t as defineCommand } from "./define-OPEOQ5MS.mjs";
5
5
 
6
6
  //#region src/plugins/flow/doors/dev.d.ts
@@ -1,6 +1,6 @@
1
1
  import { $n as DescriptionNode, An as FeatureDescription, Ar as Config$9, C as SceneSpec, Cr as Narrowed, Dr as SystemFor, Er as SystemDefinition, Et as FrameRing, F as HudPartValue, Fn as DefineNode, G as SpriteOptions, Gn as EffectOptions, Gr as State$5, H as ShapeValue, Ir as Config$2, It as PassKind, J as TransformValue, K as SpriteValue, Kn as GuideOptions, L as NineSliceValue, Mn as FeatureTree, Mr as State$9, Or as TagType, Pr as Api$1, Q as Config$6, Rr as State$2, S as SceneDefinition, Sn as TextStylesOf, Sr as Mut, T as State$7, Tn as defineFlow, Tr as ResourceType, Tt as FrameRecord, Un as Descriptor, Ur as Json, Vn as SceneIdOf, Vr as Config$5, Wn as Effect, Wr as Root, Xn as Answered, Y as sprite, Z as Api$4, _ as AnySceneProjection, _i as Config$10, _n as GameTypes, _r as ComponentType, a as Config$1, ai as Events, ar as ProjectionMotion, bn as State$3, c as LoadBundles, ct as State$6, ei as StoreApi, er as Ease, f as ReadyBundles, fi as RateChange, gn as EmitterIdOf, hn as Config$3, hr as ComponentHandle, i as BundleSpec, ii as Config$4, ir as NumericFields, jn as FeaturePlugin, kr as Api$6, l as LoadReason, li as Api$5, m as Tier, mi as ThermalReading, mn as BundlesOf, o as DefineBundles, oi as PauseReason, or as ProjectionSpec, p as State$1, pi as State$8, pn as Api$2, qn as Hint, qr as Patch, r as BundleMap, ri as Api$3, si as State$4, sr as ReducedMotion, t as Api, ti as RngApi, u as LoadResult, ui as Config$8, v as Config$7, vi as Events$1, vn as HudKeysOf, vr as ComponentValue, vt as ViewportSize, w as ScenesApi, wr as QueryTerm, x as LayerMap, xn as TextFormatsOf, y as DefineScene, yi as Require, z as OverlayValue } from "./types-BUR4LWSa.mjs";
2
- import { $ as SfxDescriptor, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, Q as HapticKind, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, c as MusicDescriptor, ct as play, d as State$11, et as Step, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, m as Config$13, n as State$13, nt as defineAnimation, q as FramesValue, r as UiApi, s as Config$12, t as Config$14, w as GradeValue, x as DissolveValue, y as AuraValue, yt as OverlayApi, z as FilterValueOf } from "./types-DIdCmTQx.mjs";
3
- import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as WhenFlags, q as State$14, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-CMFC7k5L.mjs";
2
+ import { $ as SfxDescriptor, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, Q as HapticKind, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, c as MusicDescriptor, ct as play, d as State$11, et as Step, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, m as Config$13, n as State$13, nt as defineAnimation, q as FramesValue, r as UiApi, s as Config$12, t as Config$14, w as GradeValue, x as DissolveValue, y as AuraValue, yt as OverlayApi, z as FilterValueOf } from "./types-cEAJaK0D.mjs";
3
+ import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as TextTagStyle, q as State$14, rt as WhenFlags, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-BHEOjYV3.mjs";
4
4
  import { Log } from "@moku-labs/common/browser";
5
5
  import { PluginCtx } from "@moku-labs/core";
6
6
 
@@ -1584,14 +1584,16 @@ declare function tr(key: string, params?: Record<string, Argument>): Message;
1584
1584
  * Declares one style. The work is the type: a field outside the vocabulary, or a value outside
1585
1585
  * its union, is an error where the style is written, not where it is used.
1586
1586
  *
1587
- * @param style - The style, with its `is` and `when` variants.
1587
+ * @param style - The style, with its `is` and `when` variants; the style of a text may name its
1588
+ * text style key, in its base and in its `when` variants.
1588
1589
  * @returns The same object, frozen.
1589
1590
  * @example
1590
1591
  * ```ts
1591
1592
  * defineStyle({ direction: "row", gap: 12 }).gap; // 12
1593
+ * defineStyle({ text: "title.19", when: { tall: { text: "title.20.5" } } }).when.tall.text; // "title.20.5"
1592
1594
  * ```
1593
1595
  */
1594
- declare function defineStyle<const Given extends Style>(style: Given): Readonly<Given>;
1596
+ declare function defineStyle<const Given extends Style | TextTagStyle>(style: Given): Readonly<Given>;
1595
1597
  //#endregion
1596
1598
  //#region src/plugins/ui/styles/resolve.d.ts
1597
1599
  /**
@@ -1627,7 +1629,7 @@ type StyleFlags = WhenFlags & IsFlags;
1627
1629
  * ).gap; // 4
1628
1630
  * ```
1629
1631
  */
1630
- declare function resolve(style: Style | undefined, flags: StyleFlags, viewport: ViewportSize): ResolvedStyle;
1632
+ declare function resolve(style: Style | TextTagStyle | undefined, flags: StyleFlags, viewport: ViewportSize): ResolvedStyle;
1631
1633
  //#endregion
1632
1634
  //#region src/plugins/audio/descriptors.d.ts
1633
1635
  /**
@@ -2137,7 +2139,7 @@ declare function defineGame<Types extends GameTypes>(): {
2137
2139
  music: MusicDescriptor<Types["assets"]>;
2138
2140
  volumes: VolumesFor<Types["player"]>;
2139
2141
  defineComponent: typeof defineComponent;
2140
- defineStyle: <const Given extends Style<Types["assets"]>>(style: Given) => Readonly<Given>;
2142
+ defineStyle: <const Given extends Style<Types["assets"]> | TextTagStyle<Types["assets"], TextStylesOf<Types>>>(style: Given) => Readonly<Given>;
2141
2143
  defineTokens: typeof defineTokens;
2142
2144
  popup: <Properties extends object, Local extends object, Outcomes extends Record<string, unknown>>(component: PopupComponent<Properties, Local, Outcomes>, props: Properties, options?: {
2143
2145
  over?: string;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { $ as MonitorConfig, $n as DescriptionNode, $t as PerfSpikeLine, At as OverlayEventDetail, B as Parent, Bt as PerfChangeEntry, Cn as types_d_exports$6, Ct as FrameReadResult, Dn as slot, Dt as LongFrameEntry, E as types_d_exports$13, En as exit, Et as FrameRing, F as HudPartValue, Ft as PROBLEM_RULES, Gt as PerfEventName, Ht as PerfCounts, I as NineSlice, It as PassKind, Jt as PerfLogLine, Kr as types_d_exports$10, Kt as PerfGapLine, Lt as PassRecord, M as WhyEntry, Mt as PERF_CAUSES, N as Display, Nr as types_d_exports$17, Nt as PERF_GAP_BUCKETS, On as to, Ot as MONITOR_SECTIONS, P as HudPart, Pt as PERF_LOG_VERSION, Qt as PerfSampleLine, R as Overlay, Rt as PerfCause, St as FrameColumns, Tt as FrameRecord, U as Sprite, Ut as PerfDisplay, V as Shape, Vt as PerfCollectorLine, W as SpriteBlend, Wt as PerfEventLine, X as AdaptiveScale, Xt as PerfMarkLine, Y as sprite, Yt as PerfLongFrameLine, Zn as AnchorTarget, Zr as SaveUnreadableError, Zt as PerfMeasured, an as ProblemRule, bt as RetakeWhy, ci as types_d_exports$9, cn as ShaderWhat, cr as SceneSwitch, dn as CanvasRestart, dt as ShotsApi, en as PerfStartupLine, fn as DEMAND_REASONS, ft as ShotsConfig, g as types_d_exports$1, gi as types_d_exports$15, in as ProblemEventDetail, jt as OverlayWhat, kn as type, kt as MonitorSections, ln as WarmDetail, mt as MonitorCounts, nn as PerfThermalLine, on as SHADER_WHATS, q as Transform, qt as PerfHeaderLine, rn as PoolTrimDetail, sn as ShaderEventDetail, st as PoolTrim, tn as PerfTelemetryLine, un as CANVAS_RESTARTS, ut as types_d_exports$12, wn as contribution, wt as FrameReadout, xt as WhyLive, z as OverlayValue, zr as types_d_exports$3, zt as PerfChange } from "./types-BUR4LWSa.mjs";
2
- import { C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as HapticKind, S as FlashValue, T as RevealLineValue, Z as types_d_exports, _t as use, at as haptic, b as BloomValue, bt as types_d_exports$4, ct as play, dt as sfx, ft as spawn, gt as tween, ht as stopSfx, i as types_d_exports$16, it as frames, lt as sequence, mt as stagger, nt as defineAnimation, ot as mark, p as types_d_exports$2, pt as spawned, rt as external, st as parallel, tt as HAPTIC_KINDS, ut as set, v as types_d_exports$5, vt as wait, w as GradeValue, x as DissolveValue, y as AuraValue } from "./types-DIdCmTQx.mjs";
3
- import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-CMFC7k5L.mjs";
4
- import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-Fth_AFjs.mjs";
5
- export { type AdaptiveScale, Alpha, type AnchorTarget, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, Aura, type AuraValue, type BackResult, type BindOptions, Bloom, type BloomValue, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Dissolve, type DissolveValue, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, Flash, type FlashValue, types_d_exports$6 as Flow, Fold, type FoldValue, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, Grade, type GradeValue, 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, type RetakeWhy, RevealLine, type RevealLineValue, RevealRound, type RevealRoundValue, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Shine, type ShineValue, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, type TextRunStyle, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, Vignette, type VignetteValue, type WarmDetail, type WhyEntry, type WhyLive, types_d_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 };
2
+ import { C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as HapticKind, S as FlashValue, T as RevealLineValue, Z as types_d_exports, _t as use, at as haptic, b as BloomValue, bt as types_d_exports$4, ct as play, dt as sfx, ft as spawn, gt as tween, ht as stopSfx, i as types_d_exports$16, it as frames, lt as sequence, mt as stagger, nt as defineAnimation, ot as mark, p as types_d_exports$2, pt as spawned, rt as external, st as parallel, tt as HAPTIC_KINDS, ut as set, v as types_d_exports$5, vt as wait, w as GradeValue, x as DissolveValue, y as AuraValue } from "./types-cEAJaK0D.mjs";
3
+ import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, nt as TextTagStyle, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-BHEOjYV3.mjs";
4
+ import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-CKF3qS2-.mjs";
5
+ export { type AdaptiveScale, Alpha, type AnchorTarget, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, Aura, type AuraValue, type BackResult, type BindOptions, Bloom, type BloomValue, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Dissolve, type DissolveValue, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, Flash, type FlashValue, types_d_exports$6 as Flow, Fold, type FoldValue, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, Grade, type GradeValue, 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, type RetakeWhy, RevealLine, type RevealLineValue, RevealRound, type RevealRoundValue, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Shine, type ShineValue, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, type TextRunStyle, type TextTagStyle, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, Vignette, type VignetteValue, type WarmDetail, type WhyEntry, type WhyLive, types_d_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 };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-CvM4Qhtr.mjs";
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";
1
+ import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-_nn6V6aX.mjs";
2
+ import { $ as Overlay, D as defineStyle, E as defineTokens, L as defineTextFormats, M as Countdown, N as Text, P as bind, Q as NineSlice, R as defineTextStyles, X as Display, Z as HudPart, _ as DebugTrigger, ct as Exiting, dt as Order, ft as Tree, gt as system, h as Box, ht as resource, it as Transform, lt as Layer, mt as mut, nt as Shape, pt as component, rt as Sprite, st as sprite, tt as Parent, ut as Now, vt as tag, w as popup, x as ScrollState, y as LocalWrite, z as label } from "./visual-CYq-xUqz.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 };
@@ -1,6 +1,6 @@
1
1
  import { Br as Api, In as FlowGraph, Qr as Snapshot, Rn as JournalEntry, Z as Api$2, br as EntitySnapshot, gr as ComponentSchema, h as Usage, ht as RenderStats, jr as Explained, kr as Api$1, lt as Under, t as Api$3, xr as FrameDiff, yn as Position } from "./types-BUR4LWSa.mjs";
2
- import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-DIdCmTQx.mjs";
3
- import { c as UiNode } from "./types-CMFC7k5L.mjs";
2
+ import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-cEAJaK0D.mjs";
3
+ import { c as UiNode } from "./types-BHEOjYV3.mjs";
4
4
  import { t as HeadlessApp } from "./headless-C5kxf9oU.mjs";
5
5
  import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-CATC2vK8.mjs";
6
6
  import { n as defineSource } from "./define-OPEOQ5MS.mjs";
package/dist/inspect.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  import { l as defineSource } from "./session-ClUqpGId.mjs";
2
- import { n as read, r as watch, t as sources } from "./sources-WiVMRhXq.mjs";
2
+ import { n as read, r as watch, t as sources } from "./sources-CdWn7B5r.mjs";
3
3
  import "./inspect-la_KkjCS.mjs";
4
4
  export { defineSource, read, sources, watch };
@@ -1,2 +1,2 @@
1
- import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-DylBqKWf.mjs";
1
+ import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-BbZtyfgH.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-DylBqKWf.mjs";
1
+ import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-BbZtyfgH.mjs";
2
2
  export { Fragment, type JSX, jsx, jsxs };
@@ -1,4 +1,4 @@
1
- import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-CMFC7k5L.mjs";
1
+ import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-BHEOjYV3.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. */
@@ -1,4 +1,4 @@
1
- import { U as parentOf, X as NineSlice, et as Shape, i as drawnRect, p as Box, q as rootPoseOf, st as Layer } from "./visual-CvFDvkA_.mjs";
1
+ import { G as parentOf, Q as NineSlice, Y as rootPoseOf, h as Box, i as drawnRect, lt as Layer, nt as Shape } from "./visual-CYq-xUqz.mjs";
2
2
  import { o as notInstalled } from "./dev-BNndV-hU.mjs";
3
3
  import { a as readTarget, l as defineSource, n as isTainted, s as inputOrEmpty, t as cheatsOf, u as inputSchema } from "./session-ClUqpGId.mjs";
4
4
  //#region src/plugins/flow/doors/read.ts
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { i as systemSource, r as MAX_TIMER_MS, t as memory } from "./memory-DeD9wis6.mjs";
3
3
  import { a as finishDrafts, i as enableDraftPatches, n as deepFreeze$1, o as openDrafts, r as dropDrafts } from "./drafts-BawpSaVp.mjs";
4
4
  import { _ as compact, c as collectFlows, d as findNode, f as framePath, g as slotNames, h as restlessCapOf, i as servePaused, l as describeGraph, m as isRestCheckpoint, n as captureFrame, o as epochOf, p as graphHash, r as serveCaptures, s as pageNow$1, t as cancelCaptures, v as pushEntry } from "./capture-BtS6_oWr.mjs";
5
- import { $ as Parent, A as Countdown, B as applyPose, C as uiFor, D as isTextFormat, E as formatBound, G as rootPointOf, H as localPoseOf, J as Display, K as rootPoseInto, N as boldLookOf, O as unitOf, P as builtInStyles, Q as OverlayLevel, R as readStyle, U as parentOf$1, V as isLeaving, W as poseUnder, X as NineSlice, Y as HudPart, Z as Overlay, _ as LocalWrite, a as fieldsLeftAlone, b as UI_OWNER, c as namesFormat, ct as Now, d as visualOf$1, dt as component, et as Shape, f as visualRectOf, g as Escapable, gt as tag, h as DebugTrigger, ht as systemsFor, i as drawnRect, it as componentsFor, j as Text, k as wholeValue, l as restValueOf, lt as Order, m as Covered, mt as system, n as CONTENT$1, nt as Transform, o as fitScaleOf, ot as Exiting, p as Box, pt as resource, q as rootPoseOf, r as bindOf, rt as arcDefaults, s as livePatch, st as Layer, tt as Sprite, u as samePose, ut as Tree, v as Scroll, x as UiCounters, y as ScrollState, z as textFor } from "./visual-CvFDvkA_.mjs";
5
+ import { $ as Overlay, A as unitOf, B as readStyle, C as UiCounters, F as boldLookOf, G as parentOf$1, H as applyPose, I as builtInStyles, J as rootPoseInto, K as poseUnder, M as Countdown, N as Text, O as formatBound, Q as NineSlice, S as UI_OWNER, T as uiFor, U as isLeaving, V as textFor, W as localPoseOf, X as Display, Y as rootPoseOf, Z as HudPart, _ as DebugTrigger, _t as systemsFor, a as fieldsLeftAlone, at as arcDefaults, b as Scroll, c as namedKeyOf, ct as Exiting, d as samePose, dt as Order, et as OverlayLevel, f as visualOf$1, ft as Tree, g as Covered, gt as system, h as Box, ht as resource, i as drawnRect, it as Transform, j as wholeValue, k as isTextFormat, l as namesFormat, lt as Layer, m as writtenKeyOf, n as CONTENT$1, nt as Shape, o as fitScaleOf, ot as componentsFor, p as visualRectOf, pt as component, q as rootPointOf, r as bindOf, rt as Sprite, s as livePatch, tt as Parent, u as restValueOf, ut as Now, v as Escapable, vt as tag, x as ScrollState, y as LocalWrite } from "./visual-CYq-xUqz.mjs";
6
6
  import { a as isDev$1 } from "./dev-BNndV-hU.mjs";
7
7
  import { n as isComponentDefinition } from "./component-DGg5DqKK.mjs";
8
8
  import { n as flatten } from "./flatten-nUX9PpGo.mjs";
@@ -64399,19 +64399,18 @@ function contentOf$2(element, resolvedOf) {
64399
64399
  }
64400
64400
  /**
64401
64401
  * The text style key of a text element: the style a format of the game answered, for a text whose
64402
- * bind names one; else the `style` prop while that is a key.
64402
+ * bind names one; else the key its style object took for this frame (F182); else the `style` prop
64403
+ * while that is a key.
64403
64404
  *
64404
64405
  * @param element - The element to read.
64405
64406
  * @param shownStyleOf - Reads `Text.style` of an entity; none for a tree read without a world.
64406
- * @returns The key, or `undefined` for any other element and for a text with a `Style` object or
64407
- * no style.
64407
+ * @returns The key, or `undefined` for any other element and for a text whose style names none.
64408
64408
  */
64409
64409
  function textStyleOf(element, shownStyleOf) {
64410
64410
  if (element.type !== "text") return void 0;
64411
64411
  const shown = namesFormat(element) ? shownStyleOf?.(element.entity) : void 0;
64412
64412
  if (shown !== void 0) return shown;
64413
- const style = element.node.props.style;
64414
- return typeof style === "string" ? style : void 0;
64413
+ return namedKeyOf(element.style, element.node.props.style);
64415
64414
  }
64416
64415
  /**
64417
64416
  * Turns one element and its subtree into snapshot nodes. The rect is natural; a fitted element
@@ -64945,8 +64944,9 @@ function formatIfLoaded(ctx, message, locale) {
64945
64944
  }
64946
64945
  }
64947
64946
  /**
64948
- * Measures a text in every loaded locale and reports the widest one that does not fit. A lazy
64949
- * locale the player has not picked yet cannot be measured, so it is skipped.
64947
+ * Measures a text in every loaded locale, in the key its markup names for this frame, and reports
64948
+ * the widest one that does not fit. A lazy locale the player has not picked yet cannot be
64949
+ * measured, so it is skipped.
64950
64950
  *
64951
64951
  * @param ctx - Domain context of the ui plugin.
64952
64952
  * @param element - The text element.
@@ -64955,7 +64955,7 @@ function formatIfLoaded(ctx, message, locale) {
64955
64955
  function textOverflow(ctx, element) {
64956
64956
  if (element.type !== "text") return void 0;
64957
64957
  const content = element.node.props.content;
64958
- const style = typeof element.node.props.style === "string" ? element.node.props.style : "body";
64958
+ const style = writtenKeyOf(element);
64959
64959
  if (typeof content !== "object" || content === null) return void 0;
64960
64960
  for (const locale of ctx.deps.i18n.locales()) {
64961
64961
  const parts = formatIfLoaded(ctx, content, locale);
@@ -67530,6 +67530,12 @@ const TEXT_KEPT = Object.freeze([
67530
67530
  "content",
67531
67531
  "style"
67532
67532
  ]);
67533
+ /**
67534
+ * The fields of `Text` a write leaves alone when the markup says what it said but its style names
67535
+ * another text style key for this frame (F182): the style is written, the content a game's system
67536
+ * may have written stays (F167).
67537
+ */
67538
+ const TEXT_CONTENT_KEPT = Object.freeze([...Text.owned, "content"]);
67533
67539
  /** The time of a reconcile a test steps by hand: no ms pass, so no scroll moves. */
67534
67540
  const NO_TIME = Object.freeze({
67535
67541
  delta: 0,
@@ -68045,6 +68051,7 @@ function createReconciler(ctx, modules, fields) {
68045
68051
  let slotsRoots = -1;
68046
68052
  let placedUnder;
68047
68053
  let textKept = false;
68054
+ let keyKept = true;
68048
68055
  let rendered = 0;
68049
68056
  const isAside = (entity) => ctx.deps.world.projection.isBuilding(entity);
68050
68057
  let released = false;
@@ -68339,10 +68346,13 @@ function createReconciler(ctx, modules, fields) {
68339
68346
  *
68340
68347
  * @param element - The element that changed.
68341
68348
  * @param keepsText - Whether the markup's `content`, `style` and `bind` say what they said.
68349
+ * @param keepsKey - Whether the text style key of this frame is the one before; a new one is
68350
+ * written into `Text.style` even when the markup says the same (F182).
68342
68351
  */
68343
- function writeLive(element, keepsText) {
68352
+ function writeLive(element, keepsText, keepsKey = true) {
68344
68353
  state.written += 1;
68345
68354
  textKept = keepsText;
68355
+ keyKept = keepsKey;
68346
68356
  writeOrder(element);
68347
68357
  const visuals = visualOf$1(element);
68348
68358
  const inputs = inputOf(element);
@@ -68404,7 +68414,8 @@ function createReconciler(ctx, modules, fields) {
68404
68414
  }
68405
68415
  /**
68406
68416
  * The fields a write of the current pass leaves alone: those of `fieldsLeftAlone`, and on the
68407
- * `Text` of a write with no new content in the markup its content and style too.
68417
+ * `Text` of a write with no new content in the markup its content, and its style too unless the
68418
+ * frame names another key for it (a style a named format answers always stays).
68408
68419
  *
68409
68420
  * @param element - The live element.
68410
68421
  * @param type - The component type of the value.
@@ -68412,7 +68423,8 @@ function createReconciler(ctx, modules, fields) {
68412
68423
  * @returns The fields left alone: a list of the module, never a new one, for a kept text.
68413
68424
  */
68414
68425
  function leftAlone(element, type, owned) {
68415
- return type === Text && textKept ? TEXT_KEPT : fieldsLeftAlone(element, type, owned);
68426
+ if (type !== Text || !textKept) return fieldsLeftAlone(element, type, owned);
68427
+ return keyKept || namesFormat(element) ? TEXT_KEPT : TEXT_CONTENT_KEPT;
68416
68428
  }
68417
68429
  /**
68418
68430
  * Writes one visual or input value onto a live element: added when the entity lacks it, else
@@ -68461,6 +68473,7 @@ function createReconciler(ctx, modules, fields) {
68461
68473
  const keepsStyle = stands && sameStyle && sameValue(element.is, is);
68462
68474
  const style = keepsStyle ? element.style : styleFor(parent, node, is);
68463
68475
  const sameContent = sameValue(previous.props.content, node.props.content);
68476
+ const keepsKey = namedKeyOf(element.style, previous.props.style) === namedKeyOf(style, node.props.style);
68464
68477
  return {
68465
68478
  is,
68466
68479
  style,
@@ -68469,6 +68482,7 @@ function createReconciler(ctx, modules, fields) {
68469
68482
  moved: !keepsStyle && modules.layout.affectsRect(element.style, style),
68470
68483
  measures: !stands || !sameStyle || !sameContent,
68471
68484
  keepsText: sameStyle && sameContent && sameValue(previous.props.bind, node.props.bind),
68485
+ keepsKey,
68472
68486
  unchanged: keepsStyle && sameContent && writesSame(previous, node)
68473
68487
  };
68474
68488
  }
@@ -68489,7 +68503,7 @@ function createReconciler(ctx, modules, fields) {
68489
68503
  root.needsSolve = true;
68490
68504
  }
68491
68505
  if (!element.live) return;
68492
- writeLive(element, change.keepsText);
68506
+ writeLive(element, change.keepsText, change.keepsKey);
68493
68507
  if (!change.moved) modules.layout.repose(element, parentRect(element), false, hintOf(state, element));
68494
68508
  }
68495
68509
  /**
@@ -71230,8 +71244,8 @@ function guardPointer(ctx, door) {
71230
71244
  }
71231
71245
  //#endregion
71232
71246
  //#region src/plugins/ui/layout/measure.ts
71233
- /** What a text is drawn in when its `style` prop is a layout style instead of a style key. */
71234
- const DEFAULT_TEXT_STYLE = "body";
71247
+ /** The text style an icon without a size is squared on. */
71248
+ const ICON_LINE_STYLE = "body";
71235
71249
  /** The glyph an icon is sized from: one line of the text style it sits in. */
71236
71250
  const LINE_SAMPLE = "M";
71237
71251
  /** Below this a measured length counts as whole: the tolerance Yoga's own rounding uses. */
@@ -71243,7 +71257,7 @@ const WHOLE_EPSILON = 1e-4;
71243
71257
  * @returns The height of that line, as `text` measures it now.
71244
71258
  */
71245
71259
  function lineOf(source) {
71246
- return source.measure(LINE_SAMPLE, DEFAULT_TEXT_STYLE).height;
71260
+ return source.measure(LINE_SAMPLE, ICON_LINE_STYLE).height;
71247
71261
  }
71248
71262
  /**
71249
71263
  * Tells whether the line the icons are squared on moved since an icon was last measured: the
@@ -71291,24 +71305,15 @@ function needsMeasure(element) {
71291
71305
  return typeof element.style.width !== "number" || typeof element.style.height !== "number";
71292
71306
  }
71293
71307
  /**
71294
- * Reads the style key of a text or an icon out of its props.
71295
- *
71296
- * @param element - The element.
71297
- * @returns The key `text.measure` takes.
71298
- */
71299
- function styleKeyOf(element) {
71300
- const { style } = element.node.props;
71301
- return typeof style === "string" ? style : DEFAULT_TEXT_STYLE;
71302
- }
71303
- /**
71304
- * Reads what a text draws out of its props.
71308
+ * Reads what a text draws out of its markup: the content of its props, and the key its style of
71309
+ * this frame names (`writtenKeyOf`).
71305
71310
  *
71306
71311
  * @param element - The text element.
71307
71312
  * @returns The content and the style key `text.measure` takes.
71308
71313
  */
71309
71314
  function contentOf$1(element) {
71310
71315
  const { content } = element.node.props;
71311
- const styleKey = styleKeyOf(element);
71316
+ const styleKey = writtenKeyOf(element);
71312
71317
  if (typeof content === "string") return {
71313
71318
  content,
71314
71319
  style: styleKey
@@ -71367,7 +71372,7 @@ function boundShown(element, bind, source) {
71367
71372
  */
71368
71373
  function namedSize(element, bind, source, width) {
71369
71374
  const resolved = source.resolved(element.entity);
71370
- if (resolved !== void 0) return source.measure(resolved, source.style(element.entity) ?? styleKeyOf(element), width);
71375
+ if (resolved !== void 0) return source.measure(resolved, source.style(element.entity) ?? writtenKeyOf(element), width);
71371
71376
  const value = listedValueOf(element, bind);
71372
71377
  const answer = value === void 0 ? void 0 : source.formatted(bind.format, value);
71373
71378
  return answer === void 0 ? void 0 : source.measure(answer.text, answer.style, width);
@@ -71388,7 +71393,7 @@ function contentSize(element, source, width) {
71388
71393
  const written = contentOf$1(element);
71389
71394
  return source.measure(written.content, written.style, width);
71390
71395
  }
71391
- return source.measure(content, source.style(element.entity) ?? styleKeyOf(element), width);
71396
+ return source.measure(content, source.style(element.entity) ?? writtenKeyOf(element), width);
71392
71397
  }
71393
71398
  /**
71394
71399
  * The size a text measures to: a bound one by what it shows, any other by its content.
@@ -71401,7 +71406,7 @@ function contentSize(element, source, width) {
71401
71406
  function textSize(element, source, width) {
71402
71407
  const bind = bindOf(element);
71403
71408
  if (bind === void 0) return contentSize(element, source, width);
71404
- return (isTextFormat(bind.format) ? void 0 : namedSize(element, bind, source, width)) ?? source.measure(boundShown(element, bind, source), styleKeyOf(element), width);
71409
+ return (isTextFormat(bind.format) ? void 0 : namedSize(element, bind, source, width)) ?? source.measure(boundShown(element, bind, source), writtenKeyOf(element), width);
71405
71410
  }
71406
71411
  /**
71407
71412
  * The size a text or an icon takes before Yoga clamps it: an icon is square on one line of its
@@ -71416,7 +71421,7 @@ function textSize(element, source, width) {
71416
71421
  * @returns The width and the height, in whole units.
71417
71422
  */
71418
71423
  function naturalSize(element, source, width) {
71419
- const size = element.type === "icon" ? squareOf(source.measure(LINE_SAMPLE, styleKeyOf(element))) : textSize(element, source, width);
71424
+ const size = element.type === "icon" ? squareOf(source.measure(LINE_SAMPLE, writtenKeyOf(element))) : textSize(element, source, width);
71420
71425
  return {
71421
71426
  width: Math.ceil(size.width - WHOLE_EPSILON),
71422
71427
  height: Math.ceil(size.height - WHOLE_EPSILON)
@@ -74273,10 +74278,13 @@ function edgesOf(edges, safeArea) {
74273
74278
  *
74274
74279
  * @param into - The style built so far.
74275
74280
  * @param variant - The variant to lay over it.
74281
+ * @param keepsText - Whether a `text` field of the variant is merged in. An `is` variant never
74282
+ * moves the text style key: a press must not change the letters, so a plain object that carries
74283
+ * one there is ignored.
74276
74284
  */
74277
- function merge(into, variant) {
74285
+ function merge(into, variant, keepsText = true) {
74278
74286
  if (variant === void 0) return;
74279
- for (const [field, value] of Object.entries(variant)) if (value !== void 0) into[field] = value;
74287
+ for (const [field, value] of Object.entries(variant)) if (value !== void 0 && (keepsText || field !== "text")) into[field] = value;
74280
74288
  }
74281
74289
  /**
74282
74290
  * Replaces every safe-area token of a merged style with the number of this viewport.
@@ -74333,7 +74341,7 @@ function resolve(style, flags, viewport) {
74333
74341
  for (const name of IS_ORDER) {
74334
74342
  const pointer = name === "hover" || name === "pressed";
74335
74343
  if (!flags[name] || flags.disabled && pointer) continue;
74336
- merge(merged, is?.[name]);
74344
+ merge(merged, is?.[name], false);
74337
74345
  }
74338
74346
  }
74339
74347
  return Object.freeze(withSafeArea(merged, viewport));
@@ -1,6 +1,6 @@
1
1
  import { Fr as ClockSource, Jn as NodeFx, Lr as FakeClock, Nn as AnyFlow, Un as Descriptor, Ur as Json, jn as FeaturePlugin, qn as Hint, zn as NodeTable } from "./types-BUR4LWSa.mjs";
2
- import { t as createApp } from "./index-Fth_AFjs.mjs";
3
- import { b as memory, x as saveOf, y as WithGameState } from "./types-ktcMr5ce.mjs";
2
+ import { t as createApp } from "./index-CKF3qS2-.mjs";
3
+ import { b as memory, x as saveOf, y as WithGameState } from "./types-XygtsVg3.mjs";
4
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-C5kxf9oU.mjs";
5
5
  import { AnyPluginInstance } from "@moku-labs/core";
6
6
 
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-CvM4Qhtr.mjs";
1
+ import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-_nn6V6aX.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";
@@ -289,13 +289,36 @@ type Style<Asset extends string = string> = BaseStyle<Asset> & {
289
289
  is?: IsVariants<Asset>;
290
290
  when?: WhenVariants<Asset>;
291
291
  };
292
+ /**
293
+ * The style object of a `text` tag: a layout style whose base and `when` variants may name the
294
+ * text style key it draws and measures with, so one text takes the letters of the frame. The `is`
295
+ * variants carry no key: a press must not move the layout. A named format of a bound text still
296
+ * picks its own style; a style without `text` draws in `body`. `Key` is the game's text style key
297
+ * union: `uiFor` narrows `text` to it.
298
+ *
299
+ * @example
300
+ * ```tsx
301
+ * // The shop title: 19 on a 16:9 phone, 20.5 on a 20:9 one, one text node on both.
302
+ * <text key="title" content="Vitrine" style={{ text: "title.19", when: { tall: { text: "title.20.5" } } }} />;
303
+ * const title = app.ui.find("title");
304
+ * if (title !== undefined) app.world.ecs.get(title, Text)?.style; // "title.19" on 1080 x 1920, "title.20.5" on 1080 x 2400
305
+ * ```
306
+ */
307
+ type TextTagStyle<Asset extends string = string, Key extends string = string> = Omit<Style<Asset>, "when"> & {
308
+ text?: Key;
309
+ when?: { [Name in keyof WhenVariants<Asset>]?: BaseStyle<Asset> & {
310
+ text?: Key;
311
+ } };
312
+ };
292
313
  /**
293
314
  * What `resolve` answers with: the base vocabulary with every safe-area token replaced by a
294
- * number and every variant already merged in. Frozen.
315
+ * number and every variant already merged in, and the text style key a text's style named.
316
+ * Frozen.
295
317
  *
296
318
  * @example
297
319
  * ```ts
298
320
  * const resolved: ResolvedStyle = { direction: "row", gap: 12, padding: 24 };
321
+ * const title: ResolvedStyle = { text: "title.20.5", width: 600 };
299
322
  * ```
300
323
  */
301
324
  type ResolvedStyle = Omit<BaseStyle, "padding" | "margin" | "left" | "top" | "right" | "bottom"> & {
@@ -314,7 +337,8 @@ type ResolvedStyle = Omit<BaseStyle, "padding" | "margin" | "left" | "top" | "ri
314
337
  left?: number;
315
338
  top?: number;
316
339
  right?: number;
317
- bottom?: number;
340
+ bottom?: number; /** The text style key of a text, when its style object names one. */
341
+ text?: string;
318
342
  };
319
343
  /**
320
344
  * The viewport flags of a style: which `when` variants apply this frame.
@@ -2299,8 +2323,11 @@ type ButtonEscape = boolean & Brand<"ButtonEscape">;
2299
2323
  type ButtonPoint = boolean & Brand<"ButtonPoint">;
2300
2324
  /** What a text draws: a plain string, or a message of the game's string table. */
2301
2325
  type TextContent = (string | Message) & Brand<"TextContent">;
2302
- /** The text style key, or a layout style when the built-in `body` is meant. */
2303
- type TextStyleProp = (string | Style) & Brand<"TextStyleProp">;
2326
+ /**
2327
+ * The text style key, or a layout style that may name the key in its base and its `when`
2328
+ * variants; one that names none draws in the built-in `body`.
2329
+ */
2330
+ type TextStyleProp = (string | TextTagStyle) & Brand<"TextStyleProp">;
2304
2331
  /** The asset key of an image. */
2305
2332
  type ImageTexture = string & Brand<"ImageTexture">;
2306
2333
  /** The asset key of an icon. */
@@ -2557,6 +2584,8 @@ type ButtonTagProps = CommonProps & {
2557
2584
  * @example
2558
2585
  * ```ts
2559
2586
  * const props: TextTagProps = { content: "120", style: "digits" };
2587
+ * // The shop title: "title.19" on a short phone, "title.20.5" on a tall one.
2588
+ * const title: TextTagProps = { content: "Vitrine", style: { text: "title.19", when: { tall: { text: "title.20.5" } } } };
2560
2589
  * // The coin counter: Counter is an extra component, the text shows Math.round of its value.
2561
2590
  * const coins: TextTagProps = { bind: bind(Counter, "value"), components: [Counter({ value: 25 })] };
2562
2591
  * ```
@@ -2751,8 +2780,8 @@ type Restyled<Properties, Asset extends string> = Properties extends unknown ? O
2751
2780
  /**
2752
2781
  * The same tags with the asset keys, text style keys and message keys of one game. `uiFor`
2753
2782
  * carries it, so a game can name the type of its own intrinsics. The asset keys narrow `texture`,
2754
- * `name` and the `nineSlice` of every style; the text style keys narrow the `style` of a text
2755
- * and the `textStyle` of a field; the message keys narrow `content` and `placeholder`.
2783
+ * `name` and the `nineSlice` of every style; the text style keys narrow the `style` of a text,
2784
+ * the `text` of its style object and of each `when` variant, and the `textStyle` of a field; the message keys narrow `content` and `placeholder`.
2756
2785
  *
2757
2786
  * @example
2758
2787
  * ```ts
@@ -2775,7 +2804,7 @@ type IntrinsicElementsFor<Asset extends string, TextStyleKey extends string, Str
2775
2804
  text: Omit<CommonProps, "style"> & {
2776
2805
  content?: string | Message<StringKey>;
2777
2806
  bind?: TextBind;
2778
- style?: TextStyleKey | Style<Asset>;
2807
+ style?: TextStyleKey | TextTagStyle<Asset, TextStyleKey>;
2779
2808
  };
2780
2809
  };
2781
2810
  //#endregion
@@ -3719,8 +3748,10 @@ type UiNode = {
3719
3748
  */
3720
3749
  content?: string;
3721
3750
  /**
3722
- * The text style key a `text` was given: its `style` prop while that is a key. Absent when the
3723
- * style is a `Style` object, when there is none, and on any other tag.
3751
+ * The text style key a `text` draws with: the key its style object took for this frame (the base
3752
+ * `text` or one a `when` variant set), else its `style` prop while that is a key; for a text bound
3753
+ * to a named format, the style that format answered. Absent on any other tag and on a text whose
3754
+ * style names none.
3724
3755
  *
3725
3756
  * @example
3726
3757
  * ```ts
@@ -3728,6 +3759,13 @@ type UiNode = {
3728
3759
  * const label = app.ui.tree().children.find(node => node.key === "homePlayLabel");
3729
3760
  * label?.textStyle; // "ui.button"
3730
3761
  * ```
3762
+ * @example
3763
+ * ```ts
3764
+ * // `<text key="title" style={{ text: "title.19", when: { tall: { text: "title.20.5" } } }} />`
3765
+ * // on a tall viewport (1080 x 2400), under the root row.
3766
+ * const title = app.ui.tree().children.find(node => node.key === "title");
3767
+ * title?.textStyle; // "title.20.5"
3768
+ * ```
3731
3769
  */
3732
3770
  textStyle?: string;
3733
3771
  value?: string;
@@ -3781,4 +3819,4 @@ type CommonProps = {
3781
3819
  components?: ElementComponents;
3782
3820
  };
3783
3821
  //#endregion
3784
- export { ResolvedStyle as $, TextFormats as A, types_d_exports$1 as B, Point as C, TextFormat as D, TextBind as E, types_d_exports as F, Message as G, Config$2 as H, defineComponent as I, StringTable as J, Part as K, Config$1 as L, TextStyleInput as M, TextStyles as N, TextFormatAnswer as O, TextValue as P, IsFlags as Q, InputApi as R, FormattedNumber as S, TextApi as T, I18nApi as U, Argument as V, IntlKit as W, TypedTr as X, TextKey as Y, types_d_exports$2 as Z, UiIntrinsicElements as _, JsxChild as a, Config as b, UiNode as c, DebugTrigger as d, Style as et, LocalWrite as f, IntrinsicElementsFor as g, defineTokens as h, Finding as i, TextRunStyle as j, TextFormatFunction as k, LayoutState as l, popup as m, ElementChange as n, WhenFlags as nt, JsxState as o, ScrollState as p, State$2 as q, ElementMotion as r, PopupComponent as s, DescriptionNode as t, StylesState as tt, Box as u, BindField as v, State as w, CountdownValue as x, BindOptions as y, State$1 as z };
3822
+ export { ResolvedStyle as $, TextFormats as A, types_d_exports$1 as B, Point as C, TextFormat as D, TextBind as E, types_d_exports as F, Message as G, Config$2 as H, defineComponent as I, StringTable as J, Part as K, Config$1 as L, TextStyleInput as M, TextStyles as N, TextFormatAnswer as O, TextValue as P, IsFlags as Q, InputApi as R, FormattedNumber as S, TextApi as T, I18nApi as U, Argument as V, IntlKit as W, TypedTr as X, TextKey as Y, types_d_exports$2 as Z, UiIntrinsicElements as _, JsxChild as a, Config as b, UiNode as c, DebugTrigger as d, Style as et, LocalWrite as f, IntrinsicElementsFor as g, defineTokens as h, Finding as i, TextRunStyle as j, TextFormatFunction as k, LayoutState as l, popup as m, ElementChange as n, TextTagStyle as nt, JsxState as o, ScrollState as p, State$2 as q, ElementMotion as r, WhenFlags as rt, PopupComponent as s, DescriptionNode as t, StylesState as tt, Box as u, BindField as v, State as w, CountdownValue as x, BindOptions as y, State$1 as z };
@@ -1,7 +1,7 @@
1
1
  import { $r as SnapshotOf, Fr as ClockSource, Hn as TypeTag, Jr as PlayerStateProvider, Lr as FakeClock, Nn as AnyFlow, Q as Config$2, Ur as Json, Vr as Config, Xr as SaveDoc, Yr as ProviderCall, a as Config$3, d as Manifest, gt as Orientation, hn as Config$1, jn as FeaturePlugin, n as AssetsIo, rt as PixiModule } from "./types-BUR4LWSa.mjs";
2
- import { o as AudioContextLike, s as Config$4 } from "./types-DIdCmTQx.mjs";
3
- import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-CMFC7k5L.mjs";
4
- import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-Fth_AFjs.mjs";
2
+ import { o as AudioContextLike, s as Config$4 } from "./types-cEAJaK0D.mjs";
3
+ import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-BHEOjYV3.mjs";
4
+ import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-CKF3qS2-.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
1
  import { A as FilterSlotQuad, Br as Api$6, Hn as TypeTag, Hr as Events$3, O as FilterSlot, Un as Descriptor, Ur as Json, Z as Api$4, Zn as AnchorTarget, _r as ComponentType, _t as Point, ai as Events$5, at as PixiTexture, b as Events$4, er as Ease, fr as AnyComponent, hr as ComponentHandle, ir as NumericFields, it as PixiSprite, j as SyncApi, k as FilterSlotInputs, kr as Api$3, li as Api$1, lr as TrackOptions, mr as AnyComponentValue, nt as PixiGpuProgram, ot as PixiUniformGroup, pn as Api$2, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$5, tt as PixiFilter, ur as TrackSegment, vi as Events$2, yi as Require, yr as Entity, yt as FilterCache } from "./types-BUR4LWSa.mjs";
2
- import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-CMFC7k5L.mjs";
2
+ import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-BHEOjYV3.mjs";
3
3
  import { Log } from "@moku-labs/common/browser";
4
4
  import { PluginCtx } from "@moku-labs/core";
5
5
 
@@ -1,9 +1,9 @@
1
1
  import { Br as Api$2, Pr as Api$4, Z as Api, kr as Api$1, ri as Api$3 } from "./types-BUR4LWSa.mjs";
2
- import { W as AnimApi, r as UiApi } from "./types-DIdCmTQx.mjs";
3
- import { R as InputApi } from "./types-CMFC7k5L.mjs";
2
+ import { W as AnimApi, r as UiApi } from "./types-cEAJaK0D.mjs";
3
+ import { R as InputApi } from "./types-BHEOjYV3.mjs";
4
4
  import { r as Repro } from "./headless-C5kxf9oU.mjs";
5
5
  import { i as ControlApp, o as InputOf } from "./types-CATC2vK8.mjs";
6
- import { t as commands } from "./commands-B16wtdhf.mjs";
6
+ import { t as commands } from "./commands-CzT9eYnf.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. */
@@ -1253,11 +1253,13 @@ function formatBound(value, format, duration) {
1253
1253
  * Declares one style. The work is the type: a field outside the vocabulary, or a value outside
1254
1254
  * its union, is an error where the style is written, not where it is used.
1255
1255
  *
1256
- * @param style - The style, with its `is` and `when` variants.
1256
+ * @param style - The style, with its `is` and `when` variants; the style of a text may name its
1257
+ * text style key, in its base and in its `when` variants.
1257
1258
  * @returns The same object, frozen.
1258
1259
  * @example
1259
1260
  * ```ts
1260
1261
  * defineStyle({ direction: "row", gap: 12 }).gap; // 12
1262
+ * defineStyle({ text: "title.19", when: { tall: { text: "title.20.5" } } }).when.tall.text; // "title.20.5"
1261
1263
  * ```
1262
1264
  */
1263
1265
  function defineStyle(style) {
@@ -1465,6 +1467,36 @@ const FITS = [
1465
1467
  "cover",
1466
1468
  "fill"
1467
1469
  ];
1470
+ /** What a text is drawn in when its markup names no text style key. */
1471
+ const DEFAULT_TEXT_STYLE = "body";
1472
+ /**
1473
+ * The text style key the markup of a text names (F182): the key its resolved style took from its
1474
+ * base or from a `when` variant of this frame, else its `style` prop while that is a key. A
1475
+ * property read and a type check: nothing is built.
1476
+ *
1477
+ * @param style - The resolved style of the text.
1478
+ * @param property - Its `style` prop.
1479
+ * @returns The key, or `undefined` when the markup names none.
1480
+ * @example
1481
+ * ```ts
1482
+ * namedKeyOf({ text: "title.20.5" }, "title.19"); // "title.20.5"
1483
+ * ```
1484
+ */
1485
+ function namedKeyOf(style, property) {
1486
+ if (typeof style.text === "string") return style.text;
1487
+ return typeof property === "string" ? property : void 0;
1488
+ }
1489
+ /**
1490
+ * The text style key a text's markup writes into `Text.style` and is measured with until the
1491
+ * entity carries its `Text`: the key it names, else `body`. One reader for the measure, the
1492
+ * `Text` write and `lint()`; a format of a game still answers its own style where it does.
1493
+ *
1494
+ * @param element - The text, its style of this frame resolved.
1495
+ * @returns The key.
1496
+ */
1497
+ function writtenKeyOf(element) {
1498
+ return namedKeyOf(element.style, element.node.props.style) ?? DEFAULT_TEXT_STYLE;
1499
+ }
1468
1500
  /**
1469
1501
  * Tells whether a tag draws nothing of its own, so its `Shape` is invisible unless its style fills.
1470
1502
  *
@@ -1711,7 +1743,7 @@ function fieldsLeftAlone(element, type, owned) {
1711
1743
  /**
1712
1744
  * The visual component of an element: a sprite for an image or an icon (at alpha 0 while its style
1713
1745
  * states a size the layout makes 0: the renderer draws a sprite of width 0 at its texture's size,
1714
- * so the size alone cannot say "nothing"), the text for a text (with
1746
+ * so the size alone cannot say "nothing"), the text for a text (in the key of `writtenKeyOf`, with
1715
1747
  * its laid-out width as the box a `"box"` style wraps at), the nine-slice of its style (outlined
1716
1748
  * when the style sets `debug`, its rim alone when it sets `hollow`; the sprite and the nine-slice
1717
1749
  * blended by the style's `blend`), or a rounded rectangle, a triangle with `shape: "triangle"`, its
@@ -1747,19 +1779,16 @@ function visualOf(element) {
1747
1779
  ...blendOf(element, style.blend)
1748
1780
  })];
1749
1781
  }
1750
- if (type === "text") {
1751
- const styleKey = typeof node.props.style === "string" ? node.props.style : "body";
1752
- return [Text({
1753
- content: contentOf(node.props),
1754
- style: styleKey,
1755
- bind: node.props.bind,
1756
- anchor: {
1757
- x: 0,
1758
- y: 0
1759
- },
1760
- ...boxOf(element)
1761
- })];
1762
- }
1782
+ if (type === "text") return [Text({
1783
+ content: contentOf(node.props),
1784
+ style: writtenKeyOf(element),
1785
+ bind: node.props.bind,
1786
+ anchor: {
1787
+ x: 0,
1788
+ y: 0
1789
+ },
1790
+ ...boxOf(element)
1791
+ })];
1763
1792
  const clip = type === "scroll" || style.overflow === "hidden";
1764
1793
  if (style.nineSlice !== void 0 && !clip) return [NineSlice({
1765
1794
  texture: style.nineSlice,
@@ -1900,4 +1929,4 @@ function drawnRect(pose, local) {
1900
1929
  };
1901
1930
  }
1902
1931
  //#endregion
1903
- export { Parent as $, Countdown as A, applyPose as B, uiFor as C, isTextFormat as D, formatBound as E, defineTextFormats as F, rootPointOf as G, localPoseOf as H, defineTextStyles as I, Display as J, rootPoseInto as K, label as L, bind as M, boldLookOf as N, unitOf as O, builtInStyles as P, OverlayLevel as Q, readStyle as R, popup as S, defineStyle as T, parentOf as U, isLeaving as V, poseUnder as W, NineSlice as X, HudPart as Y, Overlay as Z, LocalWrite as _, fieldsLeftAlone as a, sprite as at, UI_OWNER as b, namesFormat as c, Now as ct, visualOf as d, component as dt, Shape as et, visualRectOf as f, mut as ft, Escapable as g, tag as gt, DebugTrigger as h, systemsFor as ht, drawnRect as i, componentsFor as it, Text as j, wholeValue as k, restValueOf as l, Order as lt, Covered as m, system as mt, CONTENT as n, Transform as nt, fitScaleOf as o, Exiting as ot, Box as p, resource as pt, rootPoseOf as q, bindOf as r, arcDefaults as rt, livePatch as s, Layer as st, ANCHOR as t, Sprite as tt, samePose as u, Tree as ut, Scroll as v, defineTokens as w, UiCounters as x, ScrollState as y, textFor as z };
1932
+ export { Overlay as $, unitOf as A, readStyle as B, UiCounters as C, defineStyle as D, defineTokens as E, boldLookOf as F, parentOf as G, applyPose as H, builtInStyles as I, rootPoseInto as J, poseUnder as K, defineTextFormats as L, Countdown as M, Text as N, formatBound as O, bind as P, NineSlice as Q, defineTextStyles as R, UI_OWNER as S, uiFor as T, isLeaving as U, textFor as V, localPoseOf as W, Display as X, rootPoseOf as Y, HudPart as Z, DebugTrigger as _, systemsFor as _t, fieldsLeftAlone as a, arcDefaults as at, Scroll as b, namedKeyOf as c, Exiting as ct, samePose as d, Order as dt, OverlayLevel as et, visualOf as f, Tree as ft, Covered as g, system as gt, Box as h, resource as ht, drawnRect as i, Transform as it, wholeValue as j, isTextFormat as k, namesFormat as l, Layer as lt, writtenKeyOf as m, mut as mt, CONTENT as n, Shape as nt, fitScaleOf as o, componentsFor as ot, visualRectOf as p, component as pt, rootPointOf as q, bindOf as r, Sprite as rt, livePatch as s, sprite as st, ANCHOR as t, Parent as tt, restValueOf as u, Now as ut, Escapable as v, tag as vt, popup as w, ScrollState as x, LocalWrite as y, label as z };
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-m6n16q7E.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-CVHirfkU.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/dist/visual.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
2
- import { n as read, t as sources } from "./sources-WiVMRhXq.mjs";
2
+ import { n as read, t as sources } from "./sources-CdWn7B5r.mjs";
3
3
  import { n as commands, t as run } from "./run-CeZj5UAg.mjs";
4
4
  import path from "node:path";
5
5
  import { createBrandConsole } from "@moku-labs/common/cli";
package/llms.txt CHANGED
@@ -27,7 +27,7 @@ Root exports:
27
27
  - Class: `SaveUnreadableError`.
28
28
  - Plugin instances: `timePlugin`, `lifecyclePlugin`, `modelPlugin`, `clockPlugin`, `flowPlugin`, `worldPlugin`, `rendererPlugin`, `inputPlugin`, `assetsPlugin`, `scenesPlugin`, `animPlugin`, `i18nPlugin`, `textPlugin`, `uiPlugin`, `audioPlugin`, `effectsPlugin`, `platformPlugin`; the list `screen` = `world`, `renderer`, `input`, `assets`, `scenes`, `anim`, `i18n`, `text`, `ui`. `effects`, `audio` and `platform` are opt-in: `plugins: [...screen, effectsPlugin, audioPlugin, platformPlugin]`, `platform` last.
29
29
  - Screen helpers from the root: `component`, `tag`, `resource`, `mut`, `system`, `projection`, `Layer`, `Order`, `Exiting`, `Tree`, `Now`, `Transform`, `Sprite`, `NineSlice`, `Shape`, `Parent`, `Display`, `Overlay`, `HudPart`, `sprite`, `Tappable`, `Pressable`, `Draggable`, `DropTarget`, `Swipeable`, `Traceable`, `Touchable`, `Held`, `Hovered`, `PointerOver`, `Pressed`, `Pointer`, `Traced`, `defineBundles`, `load`, `defineScene`.
30
- - Interface helpers from the root (V3): `defineAnimation`, `sequence`, `parallel`, `stagger`, `tween`, `set`, `wait`, `mark`, `frames`, `sfx`, `haptic`, `use`, `spawn`, `spawned`, `play`, `external`, `defineMotion`, `Animation`, `Frames`, the resource `AnimPlayer`; `tr`, `messageArgument`, `messageDuration`; `Text`, `label`, `defineTextStyles`, `defineTextFormats`, `bind`, `Countdown` and the types `BindOptions`, `CountdownValue`, `TextFormat`, `TextFormats`, `TextFormatAnswer`, `TextFormatFunction`, `FormattedNumber`; `defineComponent`, `popup`, `defineStyle`, `defineTokens`, `resolve`, `Box`, `LocalWrite`, `DebugTrigger`, `ScrollState`; `music`. Also `stopSfx(id, { fadeMs? })` (ends a named sound, see audio) and `cubicBezier(x1, y1, x2, y2)` (a CSS-style easing curve for `tween`'s `ease`).
30
+ - Interface helpers from the root (V3): `defineAnimation`, `sequence`, `parallel`, `stagger`, `tween`, `set`, `wait`, `mark`, `frames`, `sfx`, `haptic`, `use`, `spawn`, `spawned`, `play`, `external`, `defineMotion`, `Animation`, `Frames`, the resource `AnimPlayer`; `tr`, `messageArgument`, `messageDuration`; `Text`, `label`, `defineTextStyles`, `defineTextFormats`, `bind`, `Countdown` and the types `BindOptions`, `CountdownValue`, `TextFormat`, `TextFormats`, `TextFormatAnswer`, `TextFormatFunction`, `FormattedNumber`; `defineComponent`, `popup`, `defineStyle` and the type `TextTagStyle`, `defineTokens`, `resolve`, `Box`, `LocalWrite`, `DebugTrigger`, `ScrollState`; `music`. Also `stopSfx(id, { fadeMs? })` (ends a named sound, see audio) and `cubicBezier(x1, y1, x2, y2)` (a CSS-style easing curve for `tween`'s `ease`).
31
31
  - Effects helpers from the root (V5): `defineEmitter`, `Emitter`, `defineFilter`, `Glow`, `Outline`, `Blur`, `ColorMatrix`, `Noise`, `Displacement`, `Alpha`; the effect set `Flash`, `Grade`, `Vignette`, `RevealLine`, `RevealRound`, `Dissolve`, `Shine`, `Aura`, `Fold`, `Bloom` and their value types `FlashValue`, `GradeValue`, `VignetteValue`, `RevealLineValue`, `RevealRoundValue`, `DissolveValue`, `ShineValue`, `AuraValue`, `FoldValue`, `BloomValue`.
32
32
  - Platform from the root (V6): the types `PlatformProvider`, `BackResult`, `HapticKind` and the frozen list `HAPTIC_KINDS`.
33
33
  - `defineGame<Types>()` returns, typed by the game's `player`, `session`, `assets`, `bundles`, `scenes`, `strings`, `textStyles` and `textFormats`: `defineNode`, `defineFlow`, `defineFeature`, `projection`, `sprite`, `Sprite`, `NineSlice`, `defineBundles`, `load`, `defineScene`, `defineAnimation`, `frames`, `sfx`, `play`, `tr`, `label`, `bind`, `defineTextStyles`, `defineTextFormats`, `defineComponent`, `defineStyle`, `defineTokens`, `popup`, `music`, `Frames`, `defineEmitter`, `Emitter`, `Displacement`, and `system` (its `ctx.snapshot` typed by `player` and `session`), `volumes` (the `audio` config's reader of the typed player), `key` (string keys from data, below). `Types` is `{ player; session; assets: string; bundles?: string; scenes?: string; strings: Record<string, unknown>; textStyles?: string; textFormats?: string; emitters?: string }`.
@@ -595,7 +595,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
595
595
  A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` sets `"jsx": "react-jsx"` and `"jsxImportSource": "@moku-labs/game"`; screens are `.tsx` files. There is no DOM and no React.
596
596
 
597
597
  - Tags: `screen`, `layer`, `row`, `column`, `stack`, `spacer`, `panel` (swallows taps), `image` (`texture`, `fit?: "contain" | "cover" | "fill"`), `icon` (`name`, `fit?`), `text` (`content: string | Message`, or `bind={bind(Counter, "value")}` with `components={[Counter({ value })]}`; formats `int`, `mm:ss`, `h:mm:ss`, `duration`; `Countdown({ until })` with `bind(Countdown, "left", { format: "mm:ss" })` counts down to a `clock` moment; `style` is a text style key), `button` (`intent` + `payload`, or `local`, never both; `point` beside `intent` adds `payload.point: { x, y }` of a finger tap, the press-down point in the button's own units, (0, 0) its top-left corner, absent for keyboard taps: `<button intent="kitTap" point />`), `scroll` (`axis?: "x" | "y"` (`"y"`), fixed at spawn, another one later warns `ui:scroll-axis-fixed`; children for a short list, laid out as a column on `y` and a row on `x`, or the windowed form `rows`, `rowHeight`, `overscan?` (5), `row: index => node`, on `y` only: `axis: "x"` with `rows` throws `[game] A windowed scroll moves on y only.`; row state belongs in the model, a row that leaves the window loses its local state; `snap?: number[]` stops in offsets, kept inside `0..max`: a release glides to the stop nearest `offset + v × 260` (v in units a ms) on `1 − (1 − p)³` over `min(620, 260 + distance × 1.1)` ms; without `snap` a release flings, `v ×= 0.998` a ms until under 0.02, 0 when the finger rested over 50 ms; `offset?: number` (0) where it stands from the start, drawn there in its first frame, a new value glides there, the same value does nothing; `jump?: boolean` makes a new `offset` value of that render stand there at once, in the same solve as the content's new rects (track and offset shifted 82 together keep the cards in place), its fling or glide stopped, `moving: false`; a held scroll only remembers it; left out, a new value glides; hard edges, nothing passes on to a parent scroll; a press on a child that leaves the tap slop along the scroll's axis goes to the scroll and the child answers nothing, a finger on a moving scroll only stops it; every number in `time.delta` ms, so a time scale applies; the public component `ScrollState { offset, max, moving }` on its entity, whole units `0..max`, written when it changes and once with `moving: false` when it stops, read by a system and by `game.explain`; `app.ui.scroll(key, to)` and the visual step `{ scroll: { key, to } }` set it at once), `input` (a text field; its text lives in the component's `local`, see the ui README), `anchor` (`to: AnchorTarget | AnchorTarget[]`, `AnchorTarget` = `{ projection, key }`, a ui element keyed under its root's projection; `pad?: number` (0) outward in its root's units: its rect is where its targets are drawn, the union of the shown ones, in the frame they are laid out, scrolled or moved, through fits, slots and ancestor motion, rotation left out; children lay out inside it; a `width`/`height`/`position` in its style is ignored (`ui:anchor-style`, dev); with no target shown it is drawn at alpha 0 and takes no tap, stays, and comes back with its target; `ui:anchor-target-missing` `{ key, to }` once (dev) after a key named nothing two frames in a row; a target inside the anchor is refused, `[game] An anchor cannot point at its own child "key".`; its `change.Box` motion plays only when its targets change (a new `to`, a key naming another entity), never on a follow, and a glide that runs is carried so it lands on the moving target; 0 B a frame still or following: `<anchor key="window" to={{ projection: "board.strip", key: "seat0" }} pad={4} motion={glide}>`). Common props: `key`, `style`, `state: { active?, disabled?, selected? }`, `motion`, `components` (extra component values for the element's entity, such as a filter: `components={[Glow({ strength: 2 })]}`, or `DebugTrigger()`: five taps within 3000 ms of wall time on that view call `app.debug.overlay.open()` on a page with the agent flag, nothing elsewhere; put it on a `button` naming nothing); containers take `hosts?: string[]` (projections drawn inside the element: world views hang under it from the slot's first frame; a JSX projection is laid out in the slot's content box). Children draw and are hit in markup order at equal `zIndex`; the roots of a scene draw in the order of its `projections` (the `ui` layer sorts by `Order`; `ui: { sort: "none" }` keeps insertion order). `defineMotion({ when: "change" })` plays its `enter` and `exit` only for a commit or a popup, never when its screen mounts or unmounts; declare a motion at module level (`ui:motion-rebuilt` names a loop rebuilt in a view). `motion.change` plays `Box` (the rects), `Transform` (the rest poses), the visual the element is drawn with (`Shape`, `Sprite`, `NineSlice`, `Text`, when a render or a restyle moves a number of it: `sweep`, `alpha`, `w`; a returned motion brings the numbers home from where they stand and the other fields land at once; the last motion of that name is cancelled first) and each extra of `components`, each as `(view, previous, next, hint)`; a dev build names any other `change` hook once, `ui:change-never-plays` `{ key, name }`. An element a render replaces (a root whose view returns another key or tag, a child of another key or tag) plays its exit with `"change"`, everything under it plays its own, and it leaves `find` at once, so the new element takes the keys they share. Style adds `nineSlice`, `tint`, `offsetX`, `offsetY`, `scale`, `origin`, `fit: "contain"`; state variants `is: { hover, pressed, disabled, active, selected, covered }`. `popup(Component, props, { over })` stacks a popup over a kept one.
598
- - Style vocabulary (`defineStyle`, plain data): flow `direction`, `wrap`, `justify`, `align`, `alignSelf`, `gap`, `grow`, `shrink`; box `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `aspect`, `overflow`; position `position`, `left`, `top`, `right`, `bottom`, `reason`; visual `fill`, `stroke`, `strokeWidth`, `radius`, `alpha`, `shape: "rect" | "triangle" | "arc"` (`"rect"`; a triangle fills the box pointing right; an arc is only a `stroke` of `strokeWidth` on the circle inscribed in the box, `min(width, height) − strokeWidth` across, from 12 o'clock clockwise over `sweep`), `dash` (dash length of the stroke, gaps of half a dash; not on an arc), `sweep` (0..1, default 1, clamped; 0 draws nothing, 1 a closed ring), `cap: "round" | "butt"` (`"round"`; the ends of an open arc); variants `is: { pressed?, disabled?, active?, selected? }` and `when: { portrait?, landscape?, tall?, wide? }`, each a partial style merged in when the flag holds. Lengths are reference units or `"safeArea.top" | "safeArea.right" | "safeArea.bottom" | "safeArea.left"`. No font size here: it comes from the text style.
598
+ - Style vocabulary (`defineStyle`, plain data): flow `direction`, `wrap`, `justify`, `align`, `alignSelf`, `gap`, `grow`, `shrink`; box `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `aspect`, `overflow`; position `position`, `left`, `top`, `right`, `bottom`, `reason`; visual `fill`, `stroke`, `strokeWidth`, `radius`, `alpha`, `shape: "rect" | "triangle" | "arc"` (`"rect"`; a triangle fills the box pointing right; an arc is only a `stroke` of `strokeWidth` on the circle inscribed in the box, `min(width, height) − strokeWidth` across, from 12 o'clock clockwise over `sweep`), `dash` (dash length of the stroke, gaps of half a dash; not on an arc), `sweep` (0..1, default 1, clamped; 0 draws nothing, 1 a closed ring), `cap: "round" | "butt"` (`"round"`; the ends of an open arc); variants `is: { pressed?, disabled?, active?, selected? }` and `when: { portrait?, landscape?, tall?, wide? }`, each a partial style merged in when the flag holds. Lengths are reference units or `"safeArea.top" | "safeArea.right" | "safeArea.bottom" | "safeArea.left"`. No font size here: it comes from the text style. A `<text>` style object (type `TextTagStyle`) also takes `text: "<text style key>"`, in its base and in `when` (not `is`): `style={{ text: "title.19", when: { tall: { text: "title.20.5" } } }}` draws one text with the key of the frame (F182).
599
599
  - `defineComponent(name, { local?, outcomes?, view(props, local) })`. A component with `outcomes` is a popup: `await fx(popup(Component, props))` opens the gate for its outcomes and resolves with `{ intent, payload, at }` of the pressed button, `at` the clock moment of the answer. A button with `local` writes into the nearest component instance; it never reaches the graph.
600
600
  - `tr(key, params?)` returns a frozen `Message` `{ key, params }`; no locale is read at the call site. Strings live in `strings/<locale>.json` of any feature or sub-feature, as ICU MessageFormat 1 (`{n, plural, one {# order} other {# orders}}`, `select`, `selectordinal`, `number`, `date`, `time`; no skeletons, no `currency`). `bun run assets:keys` compiles them. The keys of the top-level features and the layers go into `generated/strings.<locale>.ts`, which one feature registers; a sub-feature's keys start with `<name>.` (`ep01.title`) and go into `generated/strings.<name>.<locale>.ts`, which the sub-feature registers lazily, `strings: { en: () => import("@generated/strings.ep01.en"), ru: () => import("@generated/strings.ep01.ru") }`. With `assets` composed those modules load and unload with the bundle named like the sub-feature: every way the bundle comes (a node entry, a scene's `bundles`, `load`, a restore, the `safeNode`) brings its strings, a locale switch brings them in the new locale, and while the bundle is not loaded a key of it gives `⟦key⟧` and `has(key)` is false. A compiled module calls the root helpers `messageArgument(value, intl)` (an element stays an element part, a list goes through `Intl.ListFormat`, a number through `Intl.NumberFormat`, else text) and `messageDuration(ms)` (`95_000` gives `{ minutes: 1, seconds: 35 }`). `app.i18n`: `locale()`, `setLocale(locale)` (async, emits `i18n:locale-changed`), `format(message, locale?)` returns `Part[]`, `plain(message)` returns a string, `has(key)`, `isKey(value)`, `locales()`, `replace(locale, messages)` (dev hot swap of a generated strings file). Config: `locale: "en"`, `fallback: "en"`, `locales: {}`.
601
601
  - Keys that come from data: `I18n.TextKey<Strings>` is the keys of the generated `Strings` without parameters (nothing new is generated). A data table types its keys `TextKey` or builds them with the kit's `key("board.hint.red")`; the kit's `tr` never takes a plain `string`. A key read back from a save is checked where the app is (an effect handler, app or page code, loading a save) with one `isKey(value)`: `defineGameApp({ ..., strings: type<Strings>() })` types the game's `app.i18n`, so a true `app.i18n.isKey(value)` narrows the value to `TextKey`; `ctx.require(i18nPlugin).isKey(value)` in a plugin narrows to `string`. `app.i18n.isKey(value)` answers true for a key of the loaded tables of the current locale or the fallback, and for the `<feature>.` prefix of a sub-feature whose strings are not loaded yet; a key that takes parameters answers true too.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.118",
3
+ "version": "0.15.119",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [