@moku-labs/game 0.15.53 → 0.15.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +1 -1
- package/dist/app/system.d.mts +2 -2
- package/dist/app.d.mts +2 -2
- package/dist/app.mjs +1 -1
- package/dist/{commands-4FGZndLY.d.mts → commands-C7qVsYsu.d.mts} +2 -2
- package/dist/control.d.mts +1 -1
- package/dist/{index-Bu1D4fG7.d.mts → index-BgJZZmqB.d.mts} +5 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +2 -2
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-f6MX_-hz.d.mts → runtime-DAid26Eo.d.mts} +1 -1
- package/dist/{sources-Cjrzga6S.mjs → sources-Bk4QhYpG.mjs} +1 -1
- package/dist/{src-D5eKqI16.mjs → src-qjGkfTKl.mjs} +51 -15
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +1 -1
- package/dist/{types-DKSQ5lXh.d.mts → types-CGofZbu2.d.mts} +26 -5
- package/dist/{types-DZ395Ojc.d.mts → types-Dj8OQDCY.d.mts} +3 -3
- package/dist/{types-CS-taLiS.d.mts → types-VWk999Gp.d.mts} +9 -4
- package/dist/{visual-LFiLc3GH.mjs → visual-BF_mPec2.mjs} +45 -18
- package/dist/{visual-CnGMkSF-.d.mts → visual-CugfNrMB.d.mts} +3 -3
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +2 -2
- package/package.json +2 -2
package/dist/app/page.d.mts
CHANGED
package/dist/app/page.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { r as systemSource, t as memory } from "../memory-CWlqhS7l.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-
|
|
5
|
+
import { n as read, r as watch, t as sources } from "../sources-Bk4QhYpG.mjs";
|
|
6
6
|
import { t as resolveConfig } from "../config-B87aFTW-.mjs";
|
|
7
7
|
//#region src/app/save.ts
|
|
8
8
|
/**
|
package/dist/app/system.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pr as PlayerStateProvider } from "../types-D9YSrw2Z.mjs";
|
|
2
|
-
import { ht as PlatformProvider } from "../index-
|
|
3
|
-
import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-
|
|
2
|
+
import { ht as PlatformProvider } from "../index-BgJZZmqB.mjs";
|
|
3
|
+
import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-Dj8OQDCY.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 { kr as Json } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { U as StringTable } from "./types-
|
|
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-
|
|
2
|
+
import { U as StringTable } from "./types-CGofZbu2.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-Dj8OQDCY.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 { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-
|
|
1
|
+
import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-qjGkfTKl.mjs";
|
|
2
2
|
import { t as memory } from "./memory-CWlqhS7l.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 { Br as StoreApi, D as DebugSwitches, Rr as Snapshot, Sn as Bookmark, Tn as FlowState, Ur as Api, Y as Api$1, Zr as FrameRate, hr as Api$2, ot as Captured, ti as Time, w as ScenesApi } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-
|
|
3
|
-
import { N as InputApi } from "./types-
|
|
2
|
+
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-CGofZbu2.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-C4YDmZv1.mjs";
|
|
5
5
|
import { n as Command, r as ControlApp } from "./types-BdwZpZce.mjs";
|
|
6
6
|
|
package/dist/control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HeadlessApp } from "./headless-C4YDmZv1.mjs";
|
|
2
2
|
import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-BdwZpZce.mjs";
|
|
3
|
-
import { t as commands } from "./commands-
|
|
3
|
+
import { t as commands } from "./commands-C7qVsYsu.mjs";
|
|
4
4
|
import { t as defineCommand } from "./define-BeFMCdMd.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $r as State$8, Ar as Root, B as ShapeValue, Bn as DescriptionNode, Br as StoreApi, C as SceneSpec, Cn as DefineNode, Dr as Config$5, Dt as PassKind, F as NineSliceValue, Fn as Hint, Gn as NumericFields, Gr as Events, Jn as ReducedMotion, K as TransformValue, Kn as ProjectionMotion, Kr as PauseReason, L as OverlayValue, Ln as Answer, Mn as Effect, N as HudPartValue, Nn as EffectOptions, Nr as Patch, Pn as GuideOptions, Qr as RateChange, S as SceneDefinition, Sr as Config$2, T as State$7, U as SpriteOptions, Ur as Api$3, Vn as Ease, Vr as RngApi, W as SpriteValue, Wr as Config$4, X as Config$6, Xr as Config$8, Y as Api$4, Yr as Api$5, _ as AnySceneProjection, _t as FrameRing, a as Config$1, ai as Require, an as EmitterIdOf, bn as FeatureTree, br as Api$1, c as LoadBundles, cr as Mut, dr as ResourceType, dt as ViewportSize, ei as ThermalReading, f as ReadyBundles, fr as SystemDefinition, gr as Config$9, gt as FrameRecord, hr as Api$6, i as BundleSpec, ii as Events$1, in as Config$3, ir as ComponentValue, jn as Descriptor, jr as State$5, kn as SceneIdOf, kr as Json, l as LoadReason, ln as State$3, lr as Narrowed, m as Tier, mr as TagType, nn as Api$2, o as DefineBundles, on as GameTypes, p as State$1, pn as defineFlow, pr as SystemFor, q as sprite, qn as ProjectionSpec, qr as State$4, r as BundleMap, ri as Config$10, rn as BundlesOf, rr as ComponentType, rt as State$6, sn as HudKeysOf, t as Api, tr as ComponentHandle, u as LoadResult, un as TextStylesOf, ur as QueryTerm, v as Config$7, vn as FeatureDescription, vr as State$9, w as ScenesApi, wr as State$2, x as LayerMap, y as DefineScene, yn as FeaturePlugin } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$11, 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, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, lt as OverlayApi, m as Config$13, n as State$13, r as UiApi, s as Config$12, t as Config$14, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-
|
|
3
|
-
import { B as Message, C as State$16, D as TextStyleInput, G as TypedTr, H as State$14, I as Argument, J as ResolvedStyle, L as Config$15, M as Config$16, N as InputApi, O as TextStyles, P as State$15, R as I18nApi, S as Point, T as TextBind, V as Part, W as TextKey, Y as Style, Z as WhenFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as defineComponent, k as TextValue, q as IsFlags, s as PopupComponent, v as BindField, w as TextApi, x as CountdownValue, y as BindOptions, z as IntlKit } from "./types-
|
|
2
|
+
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$11, 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, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, lt as OverlayApi, m as Config$13, n as State$13, r as UiApi, s as Config$12, t as Config$14, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { B as Message, C as State$16, D as TextStyleInput, G as TypedTr, H as State$14, I as Argument, J as ResolvedStyle, L as Config$15, M as Config$16, N as InputApi, O as TextStyles, P as State$15, R as I18nApi, S as Point, T as TextBind, V as Part, W as TextKey, Y as Style, Z as WhenFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as defineComponent, k as TextValue, q as IsFlags, s as PopupComponent, v as BindField, w as TextApi, x as CountdownValue, y as BindOptions, z as IntlKit } from "./types-CGofZbu2.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
|
@@ -88,12 +88,14 @@ declare function label(options: LabelOptions): [ComponentValue<TextValue>, Compo
|
|
|
88
88
|
* @param map - Style name to what that style looks like.
|
|
89
89
|
* @returns The registration a feature carries.
|
|
90
90
|
* @throws {Error} When a style names a wrap that is not a width, `"box"` or `"none"`.
|
|
91
|
+
* @throws {Error} When a style names a lineHeight that is not a number above 0.
|
|
91
92
|
* @example
|
|
92
93
|
* ```ts
|
|
93
94
|
* defineTextStyles({ "hud.digits": { font: "ui.font-digits", size: 40, fill: 0xffe082 } });
|
|
94
95
|
* // { kind: "textStyles", map: { "hud.digits": { font: "ui.font-digits", bold: undefined,
|
|
95
96
|
* // italic: undefined, size: 40, fill: 0xffe082, stroke: 0x000000, strokeWidth: 0,
|
|
96
|
-
* // letterSpacing: 0, align: "left", wrap: "none", digits: false, shadow: undefined
|
|
97
|
+
* // letterSpacing: 0, align: "left", wrap: "none", digits: false, shadow: undefined,
|
|
98
|
+
* // lineHeight: undefined } } }
|
|
97
99
|
* ```
|
|
98
100
|
*/
|
|
99
101
|
declare function defineTextStyles(map: Record<string, TextStyleInput>): TextStyles;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $t as ShaderWhat, At as PerfChange, Bn as DescriptionNode, Bt as PerfLongFrameLine, Ct as PERF_CAUSES, Dt as PassKind, E as types_d_exports$13, Et as PROBLEM_RULES, Ft as PerfEventLine, G as Transform, Gt as PerfStartupLine, H as SpriteBlend, Ht as PerfMeasured, I as Overlay, It as PerfEventName, J as AdaptiveScale, Jr as types_d_exports$9, Jt as PoolTrimDetail, Kt as PerfTelemetryLine, L as OverlayValue, Lr as SaveUnreadableError, Lt as PerfGapLine, M as HudPart, Mr as types_d_exports$10, Mt as PerfCollectorLine, N as HudPartValue, Nt as PerfCounts, Ot as PassRecord, P as NineSlice, Pt as PerfDisplay, Qt as ShaderEventDetail, R as Parent, Rn as AnchorTarget, Rt as PerfHeaderLine, St as OverlayWhat, Tr as types_d_exports$3, Tt as PERF_LOG_VERSION, Ut as PerfSampleLine, V as Sprite, Vt as PerfMarkLine, Wt as PerfSpikeLine, Xt as ProblemRule, Yt as ProblemEventDetail, Z as MonitorConfig, Zt as SHADER_WHATS, _n as type, _t as FrameRing, at as types_d_exports$12, bt as MonitorSections, dn as types_d_exports$6, en as WarmDetail, fn as contribution, g as types_d_exports$1, gn as to, gt as FrameRecord, hn as slot, ht as FrameReadout, j as Display, jt as PerfChangeEntry, kt as PerfCause, mn as exit, mt as FrameReadResult, ni as types_d_exports$15, nt as PoolTrim, pt as FrameColumns, q as sprite, qt as PerfThermalLine, st as MonitorCounts, tn as DEMAND_REASONS, vt as LongFrameEntry, wt as PERF_GAP_BUCKETS, xt as OverlayEventDetail, yr as types_d_exports$17, yt as MONITOR_SECTIONS, z as Shape, zt as PerfLogLine } from "./types-D9YSrw2Z.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 stopSfx, ct as wait, et as set, i as types_d_exports$16, it as stagger, nt as spawn, ot as tween, p as types_d_exports$2, q as external, rt as spawned, st as use, tt as sfx, ut as types_d_exports$4, v as types_d_exports$5 } from "./types-
|
|
3
|
-
import { A as types_d_exports$14, E as TextFormat, F as types_d_exports$8, K as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as defineComponent, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-
|
|
4
|
-
import { $ as system, A as Draggable, At as Text, B as Touchable, C as AnimPlayer, Ct as debugPlugin, D as defineBundles, Dt as animPlugin, E as defineScene, Et as assetsPlugin, F as PointerOver, G as Exiting, H as Traced, I as Pressable, J as Order, K as Layer, L as Pressed, M as Held, Mt as defineTextStyles, N as Hovered, Nt as label, O as load, Ot as projection, P as Pointer, Q as resource, R as Swipeable, S as defineMotion, St as effectsPlugin, T as Frames, Tt as audioPlugin, U as PASS_KINDS, V as Traceable, W as frameAt, X as component, Y as Tree, Z as mut, _ as defineStyle, _t as modelPlugin, a as defineEmitter, at as defineFeature, b as messageDuration, bt as i18nPlugin, c as Alpha, ct as uiPlugin, d as Displacement, dt as scenesPlugin, et as tag, f as Glow, ft as rendererPlugin, g as resolve, gt as types_d_exports$11, h as music, ht as PlatformProvider, i as screen, it as schedule, j as DropTarget, jt as bind, k as ready, kt as Countdown, l as Blur, lt as timePlugin, m as Outline, mt as BackResult, n as createPlugin, nt as guide, o as Emitter, ot as flattenFeatures, p as Noise, pt as platformPlugin, q as Now, r as defineGame, rt as hint, s as defineFilter, st as worldPlugin, t as createApp, tt as defineEffect, u as ColorMatrix, ut as textPlugin, v as tr, vt as lifecyclePlugin, w as Animation, wt as clockPlugin, x as cubicBezier, xt as flowPlugin, y as messageArgument, yt as inputPlugin, z as Tappable } from "./index-
|
|
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 stopSfx, ct as wait, et as set, i as types_d_exports$16, it as stagger, nt as spawn, ot as tween, p as types_d_exports$2, q as external, rt as spawned, st as use, tt as sfx, ut as types_d_exports$4, v as types_d_exports$5 } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { A as types_d_exports$14, E as TextFormat, F as types_d_exports$8, K as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as defineComponent, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-CGofZbu2.mjs";
|
|
4
|
+
import { $ as system, A as Draggable, At as Text, B as Touchable, C as AnimPlayer, Ct as debugPlugin, D as defineBundles, Dt as animPlugin, E as defineScene, Et as assetsPlugin, F as PointerOver, G as Exiting, H as Traced, I as Pressable, J as Order, K as Layer, L as Pressed, M as Held, Mt as defineTextStyles, N as Hovered, Nt as label, O as load, Ot as projection, P as Pointer, Q as resource, R as Swipeable, S as defineMotion, St as effectsPlugin, T as Frames, Tt as audioPlugin, U as PASS_KINDS, V as Traceable, W as frameAt, X as component, Y as Tree, Z as mut, _ as defineStyle, _t as modelPlugin, a as defineEmitter, at as defineFeature, b as messageDuration, bt as i18nPlugin, c as Alpha, ct as uiPlugin, d as Displacement, dt as scenesPlugin, et as tag, f as Glow, ft as rendererPlugin, g as resolve, gt as types_d_exports$11, h as music, ht as PlatformProvider, i as screen, it as schedule, j as DropTarget, jt as bind, k as ready, kt as Countdown, l as Blur, lt as timePlugin, m as Outline, mt as BackResult, n as createPlugin, nt as guide, o as Emitter, ot as flattenFeatures, p as Noise, pt as platformPlugin, q as Now, r as defineGame, rt as hint, s as defineFilter, st as worldPlugin, t as createApp, tt as defineEffect, u as ColorMatrix, ut as textPlugin, v as tr, vt as lifecyclePlugin, w as Animation, wt as clockPlugin, x as cubicBezier, xt as flowPlugin, y as messageArgument, yt as inputPlugin, z as Tappable } from "./index-BgJZZmqB.mjs";
|
|
5
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, 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, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Sprite, type SpriteBlend, 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, contribution, 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, 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 sfx, $t as flowPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as worldPlugin, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-
|
|
2
|
-
import { $ as Tree, B as Overlay, C as bind, E as label, G as Transform, H as Parent, J as sprite, L as Display, Q as Order, R as HudPart, S as Text, T as defineTextStyles, U as Shape, W as Sprite, X as Layer, Y as Exiting, Z as Now, _ as popup, at as tag, b as defineStyle, c as Box, et as component, f as LocalWrite, m as ScrollState, nt as resource, rt as system, tt as mut, u as DebugTrigger, x as Countdown, y as defineTokens, z as NineSlice } from "./visual-
|
|
1
|
+
import { $ as sfx, $t as flowPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as worldPlugin, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-qjGkfTKl.mjs";
|
|
2
|
+
import { $ as Tree, B as Overlay, C as bind, E as label, G as Transform, H as Parent, J as sprite, L as Display, Q as Order, R as HudPart, S as Text, T as defineTextStyles, U as Shape, W as Sprite, X as Layer, Y as Exiting, Z as Now, _ as popup, at as tag, b as defineStyle, c as Box, et as component, f as LocalWrite, m as ScrollState, nt as resource, rt as system, tt as mut, u as DebugTrigger, x as Countdown, y as defineTokens, z as NineSlice } from "./visual-BF_mPec2.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, 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, ScrollState, 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, contribution, 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, 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/inspect.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { En as JournalEntry, Er as Api, Rr as Snapshot, Y as Api$2, _r as Explained, cn as Position, ct as RenderStats, h as Usage, hr as Api$1, it as Under, nr as ComponentSchema, or as EntitySnapshot, sr as FrameDiff, t as Api$3, wn as FlowGraph } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-
|
|
3
|
-
import { c as UiNode } from "./types-
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-CGofZbu2.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-C4YDmZv1.mjs";
|
|
5
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-BdwZpZce.mjs";
|
|
6
6
|
import { n as defineSource } from "./define-BeFMCdMd.mjs";
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as defineSource } from "./session-DuZfGZWk.mjs";
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-Bk4QhYpG.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-
|
|
1
|
+
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-DAid26Eo.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxDEV, jsxs };
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { a as jsxs, n as JSX, r as jsx, t as Fragment } from "./runtime-DAid26Eo.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-
|
|
1
|
+
import { _ as UiIntrinsicElements, a as JsxChild, t as DescriptionNode } from "./types-CGofZbu2.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 { I as rootPoseOf, M as parentOf, U as Shape, X as Layer, c as Box, r as drawnRect, z as NineSlice } from "./visual-
|
|
1
|
+
import { I as rootPoseOf, M as parentOf, U as Shape, X as Layer, c as Box, r as drawnRect, z as NineSlice } from "./visual-BF_mPec2.mjs";
|
|
2
2
|
import { o as notInstalled } from "./dev-BNndV-hU.mjs";
|
|
3
3
|
import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-DuZfGZWk.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 { r as systemSource, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { a as finishDrafts, i as enableDraftPatches, n as deepFreeze$1, o as openDrafts, r as dropDrafts } from "./drafts-BawpSaVp.mjs";
|
|
4
4
|
import { _ 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 Tree, A as isLeaving, B as Overlay, D as readStyle, F as rootPoseInto, G as Transform, H as Parent, I as rootPoseOf, K as arcDefaults, L as Display, M as parentOf$1, N as poseUnder, O as textFor, P as rootPointOf, Q as Order, R as HudPart, S as Text, U as Shape, V as OverlayLevel, W as Sprite, X as Layer, Y as Exiting, Z as Now, a as samePose, at as tag, c as Box, d as Escapable, et as component, f as LocalWrite, g as UiCounters, h as UI_OWNER, i as fitScaleOf, it as systemsFor, j as localPoseOf, k as applyPose, l as Covered, m as ScrollState, n as CONTENT$1, nt as resource, o as visualOf$1, p as Scroll, q as componentsFor, r as drawnRect, rt as system, s as visualRectOf, u as DebugTrigger, v as uiFor, w as builtInStyles, x as Countdown, z as NineSlice } from "./visual-
|
|
5
|
+
import { $ as Tree, A as isLeaving, B as Overlay, D as readStyle, F as rootPoseInto, G as Transform, H as Parent, I as rootPoseOf, K as arcDefaults, L as Display, M as parentOf$1, N as poseUnder, O as textFor, P as rootPointOf, Q as Order, R as HudPart, S as Text, U as Shape, V as OverlayLevel, W as Sprite, X as Layer, Y as Exiting, Z as Now, a as samePose, at as tag, c as Box, d as Escapable, et as component, f as LocalWrite, g as UiCounters, h as UI_OWNER, i as fitScaleOf, it as systemsFor, j as localPoseOf, k as applyPose, l as Covered, m as ScrollState, n as CONTENT$1, nt as resource, o as visualOf$1, p as Scroll, q as componentsFor, r as drawnRect, rt as system, s as visualRectOf, u as DebugTrigger, v as uiFor, w as builtInStyles, x as Countdown, z as NineSlice } from "./visual-BF_mPec2.mjs";
|
|
6
6
|
import { a as isDev } 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";
|
|
@@ -53494,7 +53494,8 @@ function fontOfRun(style, run) {
|
|
|
53494
53494
|
return style.font;
|
|
53495
53495
|
}
|
|
53496
53496
|
/**
|
|
53497
|
-
* The height of one line of a style
|
|
53497
|
+
* The height of one line of a style: `lineHeight × size` when the style names its line, else the
|
|
53498
|
+
* line of its own font.
|
|
53498
53499
|
*
|
|
53499
53500
|
* @param style - The style of the label.
|
|
53500
53501
|
* @param tables - The advance tables that are loaded.
|
|
@@ -53505,6 +53506,21 @@ function fontOfRun(style, run) {
|
|
|
53505
53506
|
* ```
|
|
53506
53507
|
*/
|
|
53507
53508
|
function lineHeightOf(style, tables) {
|
|
53509
|
+
return style.lineHeight === void 0 ? fontLineOf(style, tables) : style.lineHeight * style.size;
|
|
53510
|
+
}
|
|
53511
|
+
/**
|
|
53512
|
+
* The height of one line of a style's own font, whatever line the style names: what the glyphs
|
|
53513
|
+
* are drawn into, so the gap to `lineHeightOf` is the leading.
|
|
53514
|
+
*
|
|
53515
|
+
* @param style - The style of the label.
|
|
53516
|
+
* @param tables - The advance tables that are loaded.
|
|
53517
|
+
* @returns The font's line height in reference pixels.
|
|
53518
|
+
* @example
|
|
53519
|
+
* ```ts
|
|
53520
|
+
* fontLineOf({ ...bodyStyle, lineHeight: 1.5 }, new Map()); // 38.4: the font's 1.2 em, not 48
|
|
53521
|
+
* ```
|
|
53522
|
+
*/
|
|
53523
|
+
function fontLineOf(style, tables) {
|
|
53508
53524
|
const table = tables.get(style.font);
|
|
53509
53525
|
return table === void 0 ? FALLBACK_LINE * style.size : table.lineHeight * (style.size / table.size);
|
|
53510
53526
|
}
|
|
@@ -55166,7 +55182,8 @@ function labelOf(ctx, value) {
|
|
|
55166
55182
|
}
|
|
55167
55183
|
/**
|
|
55168
55184
|
* Calls `visit` with every run of a laid-out block and where it starts, anchored by the
|
|
55169
|
-
* component, line after line.
|
|
55185
|
+
* component, line after line. A run of glyphs starts half the leading lower, so the glyphs sit in
|
|
55186
|
+
* the middle of a line taller or shorter than the font's; an icon starts on the line it fills.
|
|
55170
55187
|
*
|
|
55171
55188
|
* @param ctx - Domain context of the text plugin.
|
|
55172
55189
|
* @param label - The style and the laid-out block.
|
|
@@ -55176,6 +55193,7 @@ function labelOf(ctx, value) {
|
|
|
55176
55193
|
function eachRun(ctx, label, anchor, visit) {
|
|
55177
55194
|
const { style, layout } = label;
|
|
55178
55195
|
const height = lineHeightOf(style, ctx.state.tables);
|
|
55196
|
+
const leading = (height - fontLineOf(style, ctx.state.tables)) / 2;
|
|
55179
55197
|
const options = { warn: warnFor(ctx) };
|
|
55180
55198
|
const left = -anchor.x * layout.width;
|
|
55181
55199
|
let y = -anchor.y * layout.height;
|
|
@@ -55184,7 +55202,7 @@ function eachRun(ctx, label, anchor, visit) {
|
|
|
55184
55202
|
for (const run of line.runs) {
|
|
55185
55203
|
visit(run, {
|
|
55186
55204
|
x,
|
|
55187
|
-
y
|
|
55205
|
+
y: run.kind === "text" ? y + leading : y
|
|
55188
55206
|
});
|
|
55189
55207
|
x += measureRun(run, style, ctx.state.tables, options);
|
|
55190
55208
|
}
|
|
@@ -55859,16 +55877,21 @@ function toRoot(pose, out) {
|
|
|
55859
55877
|
}
|
|
55860
55878
|
/**
|
|
55861
55879
|
* Writes the box of an entity in its own units, by what it draws: the layout box of a ui element,
|
|
55862
|
-
* the panel of a nine-slice, the rectangle of a shape, the anchor box of a sprite.
|
|
55880
|
+
* the panel of a nine-slice, the rectangle of a shape, the anchor box of a sprite. A ui element not
|
|
55881
|
+
* applied yet (an anchor waiting for its first target, and everything under it) draws nothing: it
|
|
55882
|
+
* has no box. A sprite whose component says 0 or less on an axis is drawn at its texture's size
|
|
55883
|
+
* there, a size the resolver does not know: it has no box.
|
|
55863
55884
|
*
|
|
55864
55885
|
* @param reader - What the resolver reads.
|
|
55865
55886
|
* @param entity - The entity.
|
|
55866
55887
|
* @param out - The rect written, its `x` and `y` at 0 when the call starts.
|
|
55867
|
-
* @returns False for an entity that draws none of them
|
|
55888
|
+
* @returns False for an entity that draws none of them, a ui element not applied yet, and a sprite
|
|
55889
|
+
* of no width or height.
|
|
55868
55890
|
*/
|
|
55869
55891
|
function ownBoxInto(reader, entity, out) {
|
|
55870
55892
|
const element = reader.elements.get(entity);
|
|
55871
55893
|
if (element !== void 0) {
|
|
55894
|
+
if (!element.live) return false;
|
|
55872
55895
|
out.w = element.rect.w;
|
|
55873
55896
|
out.h = element.rect.h;
|
|
55874
55897
|
return true;
|
|
@@ -55886,7 +55909,7 @@ function ownBoxInto(reader, entity, out) {
|
|
|
55886
55909
|
return true;
|
|
55887
55910
|
}
|
|
55888
55911
|
const sprite = reader.ecs.get(entity, Sprite);
|
|
55889
|
-
if (sprite === void 0) return false;
|
|
55912
|
+
if (sprite === void 0 || sprite.width <= 0 || sprite.height <= 0) return false;
|
|
55890
55913
|
out.w = sprite.width;
|
|
55891
55914
|
out.h = sprite.height;
|
|
55892
55915
|
out.x = -sprite.anchor.x * sprite.width;
|
|
@@ -55910,9 +55933,11 @@ function localBoxInto(reader, entity, pose, out) {
|
|
|
55910
55933
|
return true;
|
|
55911
55934
|
}
|
|
55912
55935
|
/**
|
|
55913
|
-
* Writes where an entity is drawn, in screen reference units, when it is shown.
|
|
55914
|
-
*
|
|
55915
|
-
*
|
|
55936
|
+
* Writes where an entity is drawn, in screen reference units, when it is shown. A box of no area is
|
|
55937
|
+
* shown at its point: a width or a height of 0. Not shown: the entity belongs to a scene built
|
|
55938
|
+
* aside, it or something it is drawn under is leaving, the alphas on its way up multiply to 0.01 or
|
|
55939
|
+
* less, its root pose is at scale 0 or less (it pops in from scale 0, or hangs under a collapsed
|
|
55940
|
+
* parent), it draws no box, or the box is turned inside out (a size below 0).
|
|
55916
55941
|
*
|
|
55917
55942
|
* @param reader - What the resolver reads.
|
|
55918
55943
|
* @param entity - The entity of the target.
|
|
@@ -55922,8 +55947,9 @@ function localBoxInto(reader, entity, pose, out) {
|
|
|
55922
55947
|
*/
|
|
55923
55948
|
function drawnInto(reader, entity, out, pose) {
|
|
55924
55949
|
if (building(reader, entity) || !visible(reader, entity)) return false;
|
|
55925
|
-
if (!drawnPoseInto(reader, entity, pose) ||
|
|
55926
|
-
|
|
55950
|
+
if (!drawnPoseInto(reader, entity, pose) || pose.scale <= 0) return false;
|
|
55951
|
+
if (!localBoxInto(reader, entity, pose, out)) return false;
|
|
55952
|
+
return out.w >= 0 && out.h >= 0;
|
|
55927
55953
|
}
|
|
55928
55954
|
/**
|
|
55929
55955
|
* Grows a rect to hold another one.
|
|
@@ -55986,7 +56012,8 @@ function targetsInto(reader, to, out, scratch) {
|
|
|
55986
56012
|
*
|
|
55987
56013
|
* @param ctx - Domain context of the ui plugin.
|
|
55988
56014
|
* @param to - One target or a list of them.
|
|
55989
|
-
* @returns The rect in screen reference units,
|
|
56015
|
+
* @returns The rect in screen reference units, `{ x, y, w: 0, h: 0 }` for a target of no area, or
|
|
56016
|
+
* `undefined` when no target is shown.
|
|
55990
56017
|
*/
|
|
55991
56018
|
function rectOfTargets(ctx, to) {
|
|
55992
56019
|
const out = {
|
|
@@ -66238,7 +66265,8 @@ function createAnchorPass(ctx, jsx) {
|
|
|
66238
66265
|
/**
|
|
66239
66266
|
* Maps the union of the targets into the root coordinates of the anchor: through the root pose of
|
|
66240
66267
|
* the entity it is drawn under (its parent, or the slot of its root), then by its parent's rect,
|
|
66241
|
-
* then padded outward.
|
|
66268
|
+
* then padded outward. A size an inward pad turns below 0 stops at 0, about the centre of the
|
|
66269
|
+
* targets: the anchor stands on that point.
|
|
66242
66270
|
*
|
|
66243
66271
|
* @param element - The anchor.
|
|
66244
66272
|
* @param anchor - Its record: `screen` is read, `next` written.
|
|
@@ -66264,7 +66292,15 @@ function createAnchorPass(ctx, jsx) {
|
|
|
66264
66292
|
next.y = pose.pivot.y + (screen.y - pose.y) / scale + (parent?.rect.y ?? 0) - pad;
|
|
66265
66293
|
next.w = screen.w / scale + 2 * pad;
|
|
66266
66294
|
next.h = screen.h / scale + 2 * pad;
|
|
66267
|
-
|
|
66295
|
+
if (next.w < 0) {
|
|
66296
|
+
next.x += next.w / 2;
|
|
66297
|
+
next.w = 0;
|
|
66298
|
+
}
|
|
66299
|
+
if (next.h < 0) {
|
|
66300
|
+
next.y += next.h / 2;
|
|
66301
|
+
next.h = 0;
|
|
66302
|
+
}
|
|
66303
|
+
return true;
|
|
66268
66304
|
}
|
|
66269
66305
|
/**
|
|
66270
66306
|
* Writes the alpha of the anchor's visual, which fades its subtree with it: 0 hides the anchor the
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cr as FakeClock, Dn as NodeTable, Fn as Hint, In as NodeFx, jn as Descriptor, kr as Json, xn as AnyFlow, xr as ClockSource, yn as FeaturePlugin } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as saveOf, v as WithGameState, y as memory } from "./types-
|
|
2
|
+
import { t as createApp } from "./index-BgJZZmqB.mjs";
|
|
3
|
+
import { b as saveOf, v as WithGameState, y as memory } from "./types-Dj8OQDCY.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-C4YDmZv1.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-
|
|
1
|
+
import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-qjGkfTKl.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.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";
|
|
@@ -1618,17 +1618,32 @@ type TextStyleInput = {
|
|
|
1618
1618
|
dy: number;
|
|
1619
1619
|
alpha?: number;
|
|
1620
1620
|
};
|
|
1621
|
+
/**
|
|
1622
|
+
* The line as a multiple of `size`, like a unitless CSS `line-height`: every line of a label is
|
|
1623
|
+
* `lineHeight × size` reference px high, and its glyphs sit in the middle of it. An inline icon
|
|
1624
|
+
* fills the line. Left out, the line is the font's own. Not a number above 0 is refused.
|
|
1625
|
+
*
|
|
1626
|
+
* @example
|
|
1627
|
+
* ```ts
|
|
1628
|
+
* // A plate caption: 14 px glyphs on 17.92 px lines.
|
|
1629
|
+
* defineTextStyles({ plate: { font: "text-medium", size: 14, fill: 0x3b2a1a, lineHeight: 1.28 } });
|
|
1630
|
+
*
|
|
1631
|
+
* app.text.measure("Old\nmill\nroad", "plate").height; // 53.76: three lines of 1.28 × 14
|
|
1632
|
+
* ```
|
|
1633
|
+
*/
|
|
1634
|
+
lineHeight?: number;
|
|
1621
1635
|
};
|
|
1622
1636
|
/**
|
|
1623
1637
|
* One style as the plugin stores it: every field filled, `bold` and `italic` only when the game
|
|
1624
|
-
* shipped those MSDF fonts, `shadow` only when the style has one
|
|
1638
|
+
* shipped those MSDF fonts, `shadow` only when the style has one, `lineHeight` only when the style
|
|
1639
|
+
* names its line (`undefined` is the font's line).
|
|
1625
1640
|
*
|
|
1626
1641
|
* @example
|
|
1627
1642
|
* ```ts
|
|
1628
1643
|
* const style: TextStyle = {
|
|
1629
1644
|
* font: "ui.font-body", bold: undefined, italic: undefined, size: 32, fill: 0xffffff,
|
|
1630
1645
|
* stroke: 0x000000, strokeWidth: 0, letterSpacing: 0, align: "left", wrap: "none",
|
|
1631
|
-
* digits: false, shadow: undefined
|
|
1646
|
+
* digits: false, shadow: undefined, lineHeight: undefined
|
|
1632
1647
|
* };
|
|
1633
1648
|
* ```
|
|
1634
1649
|
*/
|
|
@@ -1645,6 +1660,7 @@ type TextStyle = {
|
|
|
1645
1660
|
wrap: TextWrap;
|
|
1646
1661
|
digits: boolean;
|
|
1647
1662
|
shadow: TextShadow | undefined;
|
|
1663
|
+
lineHeight: number | undefined;
|
|
1648
1664
|
};
|
|
1649
1665
|
/**
|
|
1650
1666
|
* What `defineTextStyles` returns and a feature registers under its `textStyles` key. Structural
|
|
@@ -2262,14 +2278,19 @@ type InputProps = CommonProps & {
|
|
|
2262
2278
|
* shown ones it spans.
|
|
2263
2279
|
*/
|
|
2264
2280
|
type AnchorTo = (AnchorTarget | readonly AnchorTarget[]) & Brand<"AnchorTo">;
|
|
2265
|
-
/**
|
|
2281
|
+
/**
|
|
2282
|
+
* How far an anchor reaches past its targets on each side, in its root's units; 0 by default. A
|
|
2283
|
+
* value below 0 pulls it inward; past half the targets the size stops at 0, at their centre.
|
|
2284
|
+
*/
|
|
2266
2285
|
type AnchorPad = number & Brand<"AnchorPad">;
|
|
2267
2286
|
/**
|
|
2268
2287
|
* What an anchor takes: the common props, `to` and `pad`. Its rect is the drawn rect of its
|
|
2269
2288
|
* targets, padded, in the frame they are laid out, and its children lay out inside it; its style
|
|
2270
2289
|
* gives its look, and a `width`, `height` or `position` there is ignored (`ui:anchor-style`, dev
|
|
2271
|
-
* builds). While no target is shown it is not drawn and takes no tap.
|
|
2272
|
-
*
|
|
2290
|
+
* builds). While no target is shown it is not drawn and takes no tap. On a target of no area it
|
|
2291
|
+
* stands at the point at size 0: it takes no tap itself, and its children overflow it and take
|
|
2292
|
+
* theirs. Its `change.Box` motion plays only when its targets change: a new `to`, or keys that name
|
|
2293
|
+
* other entities, a point included.
|
|
2273
2294
|
*
|
|
2274
2295
|
* @example
|
|
2275
2296
|
* ```tsx
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as PixiModule, An as TypeTag, Cr as FakeClock, Dr as Config, Fr as ProviderCall, Ir as SaveDoc, Pr as PlayerStateProvider, X as Config$2, a as Config$3, d as Manifest, in as Config$1, kr as Json, lt as Orientation, n as AssetsIo, xn as AnyFlow, xr as ClockSource, yn as FeaturePlugin, zr as SnapshotOf } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { R as I18nApi, U as StringTable, W as TextKey } from "./types-
|
|
4
|
-
import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { R as I18nApi, U as StringTable, W as TextKey } from "./types-CGofZbu2.mjs";
|
|
4
|
+
import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-BgJZZmqB.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 { $ as PixiModule, A as SyncApi, An as TypeTag, Er as Api$6, Gn as NumericFields, Gr as Events$5, Jn as ReducedMotion, O as FilterSlot, Or as Events$3, Q as PixiFilter, Qn as AnyComponent, Rn as AnchorTarget, Vn as Ease, Wn as MotionHandle, Xn as TrackSegment, Y as Api$4, Yn as TrackOptions, Yr as Api$1, ai as Require, ar as Entity, b as Events$4, er as AnyComponentValue, et as PixiSprite, ft as FilterCache, hr as Api$3, ii as Events$2, jn as Descriptor, k as FilterSlotInputs, kr as Json, nn as Api$2, rr as ComponentType, s as Events$1, t as Api$5, tr as ComponentHandle, tt as PixiTexture, ut as Point } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-
|
|
2
|
+
import { N as InputApi, R as I18nApi, X as StylesState, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, w as TextApi } from "./types-CGofZbu2.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -3175,9 +3175,12 @@ type UiApi = {
|
|
|
3175
3175
|
* Where a target is drawn, in screen reference units: the rect an `<anchor>` sits on. A ui
|
|
3176
3176
|
* element's layout box, a nine-slice's panel, a shape's rectangle or a sprite's box, through its
|
|
3177
3177
|
* root pose, so a fit, a slot, a scroll's offset and the motion of an ancestor move it; the
|
|
3178
|
-
* rotation is left out. A list gives the bounding rect of its shown targets.
|
|
3179
|
-
*
|
|
3180
|
-
*
|
|
3178
|
+
* rotation is left out. A list gives the bounding rect of its shown targets. A target of no area
|
|
3179
|
+
* (an empty element, a width or a height of 0) answers its point, `{ x, y, w: 0, h: 0 }`. Not
|
|
3180
|
+
* shown: the key names no entity, or one leaving, built aside or drawn at alpha 0 (an image laid
|
|
3181
|
+
* out at no size is drawn at alpha 0), or a world sprite of no width or height, which the
|
|
3182
|
+
* renderer draws at its texture's size. Works in every build and headless; every call answers a
|
|
3183
|
+
* new object.
|
|
3181
3184
|
*
|
|
3182
3185
|
* @param target - A view or an element by projection and key, or a list of them.
|
|
3183
3186
|
* @returns The rect, or `undefined` when no target is shown.
|
|
@@ -3191,6 +3194,8 @@ type UiApi = {
|
|
|
3191
3194
|
* { projection: "board.strip", key: "cell" }
|
|
3192
3195
|
* ]); // { x: 40, y: 250, w: 680, h: 1370 }
|
|
3193
3196
|
* app.ui.rectOf({ projection: "board.strip", key: "nowhere" }); // undefined
|
|
3197
|
+
* // An empty element of no area, the spot a card lands on: its point.
|
|
3198
|
+
* app.ui.rectOf({ projection: "point.board", key: "dot" }); // { x: 300, y: 400, w: 0, h: 0 }
|
|
3194
3199
|
* ```
|
|
3195
3200
|
*/
|
|
3196
3201
|
rectOf(target: AnchorTarget | readonly AnchorTarget[]): Readonly<{
|
|
@@ -743,16 +743,34 @@ function isWrap(wrap) {
|
|
|
743
743
|
return typeof wrap === "number" ? wrap > 0 : wrap === "box" || wrap === "none";
|
|
744
744
|
}
|
|
745
745
|
/**
|
|
746
|
-
*
|
|
746
|
+
* Tells whether a line height is one a style can carry: left out, or a finite number above zero.
|
|
747
|
+
* A style read back from a feature may carry anything, so the type is checked as well.
|
|
748
|
+
*
|
|
749
|
+
* @param lineHeight - The line height a style names, as it was stored.
|
|
750
|
+
* @returns False for a number that is not finite and above zero, and for anything else.
|
|
751
|
+
* @example
|
|
752
|
+
* ```ts
|
|
753
|
+
* isLineHeight(1.28); // true
|
|
754
|
+
* ```
|
|
755
|
+
*/
|
|
756
|
+
function isLineHeight(lineHeight) {
|
|
757
|
+
if (lineHeight === void 0) return true;
|
|
758
|
+
return typeof lineHeight === "number" && Number.isFinite(lineHeight) && lineHeight > 0;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* Fills the defaults of one style and refuses a wrap that is not a width, `"box"` or `"none"`,
|
|
762
|
+
* and a line height that is not a number above zero.
|
|
747
763
|
*
|
|
748
764
|
* @param name - The style name, for the error.
|
|
749
765
|
* @param input - What the game wrote.
|
|
750
766
|
* @returns The style with every field filled.
|
|
751
767
|
* @throws {Error} When `wrap` is a number that is not greater than zero, or another word.
|
|
768
|
+
* @throws {Error} When `lineHeight` is not a finite number greater than zero.
|
|
752
769
|
*/
|
|
753
770
|
function normalizeStyle(name, input) {
|
|
754
771
|
const wrap = input.wrap ?? "none";
|
|
755
772
|
if (!isWrap(wrap)) throw new Error(`[game] Text style "${name}" has wrap ${wrap}.\n Use a width in reference px, "box" or "none".`);
|
|
773
|
+
if (!isLineHeight(input.lineHeight)) throw new Error(`[game] Text style "${name}" has lineHeight ${input.lineHeight}.\n Use a multiple of size above 0, such as 1.2.`);
|
|
756
774
|
return {
|
|
757
775
|
font: input.font,
|
|
758
776
|
bold: input.bold,
|
|
@@ -765,7 +783,8 @@ function normalizeStyle(name, input) {
|
|
|
765
783
|
align: input.align ?? "left",
|
|
766
784
|
wrap,
|
|
767
785
|
digits: input.digits ?? false,
|
|
768
|
-
shadow: shadowOf(input.shadow)
|
|
786
|
+
shadow: shadowOf(input.shadow),
|
|
787
|
+
lineHeight: input.lineHeight
|
|
769
788
|
};
|
|
770
789
|
}
|
|
771
790
|
/**
|
|
@@ -775,12 +794,14 @@ function normalizeStyle(name, input) {
|
|
|
775
794
|
* @param map - Style name to what that style looks like.
|
|
776
795
|
* @returns The registration a feature carries.
|
|
777
796
|
* @throws {Error} When a style names a wrap that is not a width, `"box"` or `"none"`.
|
|
797
|
+
* @throws {Error} When a style names a lineHeight that is not a number above 0.
|
|
778
798
|
* @example
|
|
779
799
|
* ```ts
|
|
780
800
|
* defineTextStyles({ "hud.digits": { font: "ui.font-digits", size: 40, fill: 0xffe082 } });
|
|
781
801
|
* // { kind: "textStyles", map: { "hud.digits": { font: "ui.font-digits", bold: undefined,
|
|
782
802
|
* // italic: undefined, size: 40, fill: 0xffe082, stroke: 0x000000, strokeWidth: 0,
|
|
783
|
-
* // letterSpacing: 0, align: "left", wrap: "none", digits: false, shadow: undefined
|
|
803
|
+
* // letterSpacing: 0, align: "left", wrap: "none", digits: false, shadow: undefined,
|
|
804
|
+
* // lineHeight: undefined } } }
|
|
784
805
|
* ```
|
|
785
806
|
*/
|
|
786
807
|
function defineTextStyles(map) {
|
|
@@ -834,7 +855,8 @@ function readStyle(name, value) {
|
|
|
834
855
|
align: value.align,
|
|
835
856
|
wrap: value.wrap,
|
|
836
857
|
digits: value.digits,
|
|
837
|
-
shadow: readShadow(value.shadow)
|
|
858
|
+
shadow: readShadow(value.shadow),
|
|
859
|
+
lineHeight: value.lineHeight
|
|
838
860
|
};
|
|
839
861
|
return normalizeStyle(name, {
|
|
840
862
|
...input,
|
|
@@ -1258,7 +1280,9 @@ function boxOf(element) {
|
|
|
1258
1280
|
return element.boxed === true ? { box: 0 } : {};
|
|
1259
1281
|
}
|
|
1260
1282
|
/**
|
|
1261
|
-
* The visual component of an element: a sprite for an image or an icon
|
|
1283
|
+
* The visual component of an element: a sprite for an image or an icon (at alpha 0 while laid out
|
|
1284
|
+
* with no width or no height: the renderer draws a sprite of width 0 at its texture's size, so the
|
|
1285
|
+
* size alone cannot say "nothing"), the text for a text (with
|
|
1262
1286
|
* its laid-out width as the box a `"box"` style wraps at), the nine-slice of its style (outlined
|
|
1263
1287
|
* when the style sets `debug`, its rim alone when it sets `hollow`; the sprite and the nine-slice
|
|
1264
1288
|
* blended by the style's `blend`), or a rounded rectangle, a triangle with `shape: "triangle"`, its
|
|
@@ -1278,19 +1302,22 @@ function visualOf(element) {
|
|
|
1278
1302
|
const { style, type, node, rect } = element;
|
|
1279
1303
|
const alpha = style.alpha ?? 1;
|
|
1280
1304
|
const tint = style.tint ?? Sprite.defaults.tint;
|
|
1281
|
-
if (type === "image" || type === "icon")
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1305
|
+
if (type === "image" || type === "icon") {
|
|
1306
|
+
const hasArea = rect.w > 0 && rect.h > 0;
|
|
1307
|
+
return [Sprite({
|
|
1308
|
+
texture: textureOf(node.props),
|
|
1309
|
+
tint,
|
|
1310
|
+
alpha: hasArea ? alpha : 0,
|
|
1311
|
+
anchor: {
|
|
1312
|
+
x: 0,
|
|
1313
|
+
y: 0
|
|
1314
|
+
},
|
|
1315
|
+
width: rect.w,
|
|
1316
|
+
height: rect.h,
|
|
1317
|
+
fit: spriteFitOf(node.props),
|
|
1318
|
+
...blendOf(element, style.blend)
|
|
1319
|
+
})];
|
|
1320
|
+
}
|
|
1294
1321
|
if (type === "text") {
|
|
1295
1322
|
const styleKey = typeof node.props.style === "string" ? node.props.style : "body";
|
|
1296
1323
|
return [Text({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Er as Api$2, Ur as Api$3, Y as Api, br as Api$4, hr as Api$1 } from "./types-D9YSrw2Z.mjs";
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { N as InputApi } from "./types-
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-VWk999Gp.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-CGofZbu2.mjs";
|
|
4
4
|
import { r as Repro } from "./headless-C4YDmZv1.mjs";
|
|
5
5
|
import { a as InputOf, r as ControlApp } from "./types-BdwZpZce.mjs";
|
|
6
|
-
import { t as commands } from "./commands-
|
|
6
|
+
import { t as commands } from "./commands-C7qVsYsu.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-
|
|
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-CugfNrMB.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-
|
|
2
|
+
import { n as read, t as sources } from "./sources-Bk4QhYpG.mjs";
|
|
3
3
|
import { n as commands, t as run } from "./run-3QhrffgM.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
package/llms.txt
CHANGED
|
@@ -594,11 +594,11 @@ A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` se
|
|
|
594
594
|
- `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 }` of the pressed button. A button with `local` writes into the nearest component instance; it never reaches the graph.
|
|
595
595
|
- `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: {}`.
|
|
596
596
|
- 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.
|
|
597
|
-
- Text: `Text` component, `label({ text, style, at, anchor? })` for board text in a projection view, `defineTextStyles({ "hud.digits": { font, size, fill, bold?, italic?, stroke?, strokeWidth?, letterSpacing?, align?, wrap? (a width, "none" or "box": wrap at the laid-out width of its ui element), digits? } })` under the feature's `textStyles` key. Tags inside a string: `<b>`, `<i>`, `<color=#rrggbb>`, `<icon=key>`, `\<`, `\n`. Built-in styles `body` and `digits` from config `fonts: { body: "ui.font-body", digits: "ui.font-digits" }`. `app.text.measure(content, style, width?)` gives the same numbers in a browser and in Bun. `app.text.replaceStyles(styles)` is the dev hot swap of a saved `defineTextStyles` value.
|
|
597
|
+
- Text: `Text` component, `label({ text, style, at, anchor? })` for board text in a projection view, `defineTextStyles({ "hud.digits": { font, size, fill, bold?, italic?, stroke?, strokeWidth?, letterSpacing?, align?, wrap? (a width, "none" or "box": wrap at the laid-out width of its ui element), digits?, lineHeight? (the line as a multiple of size above 0, such as 1.28; glyphs sit in the middle of the line; absent: the font's own line) } })` under the feature's `textStyles` key. Tags inside a string: `<b>`, `<i>`, `<color=#rrggbb>`, `<icon=key>`, `\<`, `\n`. Built-in styles `body` and `digits` from config `fonts: { body: "ui.font-body", digits: "ui.font-digits" }`. `app.text.measure(content, style, width?)` gives the same numbers in a browser and in Bun. `app.text.replaceStyles(styles)` is the dev hot swap of a saved `defineTextStyles` value.
|
|
598
598
|
- Animation is data: `defineAnimation(id, { slots: { name: type<Anim.Target>() }, build: (slots, { at }) => Step })`. Steps: `sequence(...)`, `parallel(...)`, `stagger(items, ms, item => Step)`, `tween(target, Component, to, { ms, ease?, delayMs?, additive?, space?, reduced? })`, `set(target, Component, patch)`, `wait(ms)`, `mark(name)`, `frames(target, { keys, fps, loop? })`, `sfx(key, { bus? })`, `haptic(kind)`, `use(animation, slots, tools?)`, `spawn` (a temporary entity, flying coins, that the timeline despawns when it ends; see the anim README). `Frames({ keys, fps, loop, playing })` is a component that walks a sprite through its textures for the entity's whole life. A target is `{ projection, key }` or an entity. A timeline resolves each `{ projection, key }` target once, when it starts: every step writes the view that held the key then, also after a commit removed it and while its exit plays, until it despawns; a view spawned again under the same key is not followed, and a key nothing held at the start is looked up at its step. `reduced: "keep"` (on a `tween` step, `transition` and `loop` of `defineMotion`, `TweenOptions`, `RestOptions`) plays a track as written under reduced motion, a fade for one; the default `"cut"` lands it at once or holds a loop on its first key. A node plays it with `await fx(play(animation, slots))`; in fast mode it finishes at once. `defineMotion({ states, transition?, on: { enter?, exit?, change? }, when? })` builds the enter, exit and change hooks for a projection or the `motion` prop of a tag; `when: "change"` plays enter and exit only for a commit, so an element that comes or goes with its screen stands at rest and leaves without a motion (default `"always"`). Events `anim:mark` `{ animation, mark }` and `anim:finished` `{ animation }`. `app.anim.replace(definition)` is the dev hot swap: the next `play` builds the new tree. A system cannot `require` a plugin, so it plays through the resource `AnimPlayer`: `res(AnimPlayer).play(animation, slots)` returns the same handle as `app.anim.play`, and the registered animation of `animation.id` wins, so a hot swap reaches the system. Play on a change, never every frame; from phase `input` the tree moves in `animate` of the same frame. Before `anim` starts it throws `[game] AnimPlayer is not ready: anim has not started.` Config `maxTracks: 2000`.
|
|
599
599
|
- A `tween` step takes `segments` and `repeat` as `ViewHandle.tween` does: `tween(chest, Transform, { y: 0, scale: 0 }, { ms: 2400, additive: true, repeat: "forever", segments: [{ at: 0.08, ease: "out", to: { y: -14, scale: 0.06 } }, { at: 1, to: { y: 0, scale: 0 } }] })`. Segments walk over `ms` on one clock, `to` is where the last one ends, an additive walk names offsets; a number counts the extra runs. A definition error throws for empty segments, an `at` outside 0..1 or out of order, a last segment before 1, a bad repeat, and a `sequence` step after one that never ends. A forever step ends only by cancel or finish (a finish and a fast world land it on its start pose), does not play under reduced motion `"cut"`, writes nothing while its view is unseen, and lets the clock idle; a system plays it once through `AnimPlayer` and keeps the handle.
|
|
600
600
|
- Audio is opt-in: `plugins: [...screen, audioPlugin]`. `fx(sfx("orders.complete"))` resolves when the sound started. `await fx(music("board.theme"))` cross-fades; `music(null)` fades out; a scene's `music` key switches the track on `scenes:changed`. Buses `master`, `music`, `sfx`. Volumes come from the committed player: config `volumes: player => (player as Player).settings.audio`, applied on every `model:committed`. `app.audio`: `setVolume(bus, value)`, `volume(bus)`, `mute(bus, on)`, `muted(bus)`, `unlocked()`, `journal()` (the last started sounds, empty unless config `journal` is above 0). Config: `buses: { master: 1, music: 0.6, sfx: 1 }`, `musicFadeMs: 600`, `volumes`, `context`, `journal: 0`, `music: "decode" | "stream"` default `"decode"` (gapless buffer; `"stream"` is an `<audio>` element, less memory, a gap at every loop), `session: "ambient" | "playback" | "auto"` default `"ambient"` (iOS only: ambient mixes with other apps and obeys the silent switch). The context is asked to run at start: where the shell lets audio play (a native webview with the gesture requirement off) `unlocked()` is true with no touch; a browser that wants a gesture unlocks on the first `pointerdown` or `touchend`. Without `audio` every `sfx` and `music` effect resolves `undefined` at once, so the same node runs in a game with no sound. Named sounds: `sfx(key, { bus?, id?, fadeMs? })` with an `id` plays through its own gain, and the next sound with the same `id` fades the old one out over `fadeMs`, else config `sfxFadeMs` (default `120`, real milliseconds); `fx.start(stopSfx(id, { fadeMs? }))` and `app.audio.stop(id, { fadeMs? })` fade it out and end it (`fadeMs: 0` cuts it); an `id` nothing plays under changes nothing, and a sound of that `id` still decoding never starts. Without `id` an `sfx` plays to its end as before.
|
|
601
|
-
- `app.ui`: `tree()` the live screen as plain data (a text node carries `content`, the words it draws after `tr()` and `bind`; a text field carries `value`), `find(key)` the entity of a keyed element, `fill(key, value)` types into the text field with that `key`, `scroll(key, to)` puts the `scroll` with that `key` at `to` from its start at once, inside `0..max`, its fling or glide stopped (`false` and `ui:scroll-without-scroll` for no live `scroll`, `false` and `ui:scroll-before-solve` for a `scroll` its first solve has not placed yet), `rectOf(target)` where an `AnchorTarget` (or the shown ones of a list) is drawn, in screen reference units, the rect an `<anchor>` sits on, `undefined` when none is shown, any build, a new object per call (`app.ui.rectOf({ projection: "board.strip", key: "seat0" })` → `{ x: 40, y: 1500, w: 116, h: 120 }`), `lint()` tap targets under `tapTargetPt` (default `44`), text that overflows in some locale, absolute elements without `reason`. Config: `tapTargetPt: 44`, `breakpoints: { tall: 2, wide: 1.5 }`. `ui` emits only the dev global event `ui:hot-swap`, see "Hot swap".
|
|
601
|
+
- `app.ui`: `tree()` the live screen as plain data (a text node carries `content`, the words it draws after `tr()` and `bind`; a text field carries `value`), `find(key)` the entity of a keyed element, `fill(key, value)` types into the text field with that `key`, `scroll(key, to)` puts the `scroll` with that `key` at `to` from its start at once, inside `0..max`, its fling or glide stopped (`false` and `ui:scroll-without-scroll` for no live `scroll`, `false` and `ui:scroll-before-solve` for a `scroll` its first solve has not placed yet), `rectOf(target)` where an `AnchorTarget` (or the shown ones of a list) is drawn, in screen reference units, the rect an `<anchor>` sits on, a target of no area shown at its point (`{ x, y, w: 0, h: 0 }`; an `<anchor>` on it stands there at size 0, takes no tap, its children lay out and hit as usual; an inward `pad` past half the target leaves it at size 0 on the centre), `undefined` when none is shown (an `image` laid out at no size draws nothing and counts as not shown), any build, a new object per call (`app.ui.rectOf({ projection: "board.strip", key: "seat0" })` → `{ x: 40, y: 1500, w: 116, h: 120 }`), `lint()` tap targets under `tapTargetPt` (default `44`), text that overflows in some locale, absolute elements without `reason`. Config: `tapTargetPt: 44`, `breakpoints: { tall: 2, wide: 1.5 }`. `ui` emits only the dev global event `ui:hot-swap`, see "Hot swap".
|
|
602
602
|
|
|
603
603
|
```tsx
|
|
604
604
|
// features/hud/view.tsx
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moku-labs/game",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.54",
|
|
4
4
|
"description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"@moku-labs/ci": "1.5.7",
|
|
163
163
|
"@moku-labs/common": "0.3.10",
|
|
164
164
|
"@moku-labs/core": "1.7.6",
|
|
165
|
-
"@moku-labs/native": "0.3.
|
|
165
|
+
"@moku-labs/native": "0.3.10",
|
|
166
166
|
"@moku-labs/system": "0.3.7",
|
|
167
167
|
"@types/bun": "1.4.2",
|
|
168
168
|
"@vitest/coverage-istanbul": "4.0.18",
|