@moku-labs/game 0.15.32 → 0.15.33
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-C8N_rpwt.d.mts → commands-C1gTg70a.d.mts} +8 -8
- package/dist/control.d.mts +1 -1
- package/dist/control.mjs +1 -1
- package/dist/{index-DMeqKGSu.d.mts → index-ChuOBsZB.d.mts} +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +4 -4
- 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/{run-BnriyKUu.mjs → run-G4m1APMv.mjs} +3 -12
- package/dist/{runtime-HwTBjkIL.d.mts → runtime-CgJuBIYZ.d.mts} +1 -1
- package/dist/{sources-DM5Zcl4o.mjs → sources-MfRpM8sV.mjs} +2 -5
- package/dist/{src-5qdNjLKN.mjs → src-D5Nyvdhu.mjs} +388 -36
- package/dist/testing.d.mts +2 -2
- package/dist/testing.mjs +1 -1
- package/dist/{types-DHamyZq1.d.mts → types-BqfwZ_lM.d.mts} +1 -1
- package/dist/{types-DmU_qlvA.d.mts → types-CF6CJ55K.d.mts} +3 -3
- package/dist/{types-BAp9HdR4.d.mts → types-DGHVGP5i.d.mts} +33 -25
- package/dist/{visual-DEo5Hndx.d.mts → visual-C2HHHs46.d.mts} +3 -3
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +2 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
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-MfRpM8sV.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 { Mr as PlayerStateProvider } from "../types-D27I4Q7b.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-ChuOBsZB.mjs";
|
|
3
|
+
import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-CF6CJ55K.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 { Dr as Json } from "./types-D27I4Q7b.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-DGHVGP5i.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-CF6CJ55K.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-D5Nyvdhu.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 { $r as Time, D as DebugSwitches, Ir as Snapshot, Rr as StoreApi, Vr as Api, Y as Api$1, Yr as FrameRate, ar as FlowState, nn as Api$2, nr as Bookmark, ot as Captured, w as ScenesApi } from "./types-D27I4Q7b.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-BqfwZ_lM.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-DGHVGP5i.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-f31cEZ7f.mjs";
|
|
5
5
|
import { n as Command, r as ControlApp } from "./types-CgE5L_7f.mjs";
|
|
6
6
|
|
|
@@ -23,8 +23,8 @@ declare const commands: Readonly<{
|
|
|
23
23
|
readonly payload: "json?";
|
|
24
24
|
}, boolean, ControlApp>;
|
|
25
25
|
tap: Command<{
|
|
26
|
-
key: "string?";
|
|
27
|
-
target: "json?";
|
|
26
|
+
readonly key: "string?";
|
|
27
|
+
readonly target: "json?";
|
|
28
28
|
}, boolean, HeadlessApp & {
|
|
29
29
|
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
30
30
|
} & {
|
|
@@ -129,16 +129,16 @@ declare const commands: Readonly<{
|
|
|
129
129
|
readonly anim: AnimApi;
|
|
130
130
|
}>;
|
|
131
131
|
fill: Command<{
|
|
132
|
-
key: "string";
|
|
133
|
-
value: "string";
|
|
132
|
+
readonly key: "string";
|
|
133
|
+
readonly value: "string";
|
|
134
134
|
}, boolean, HeadlessApp & {
|
|
135
135
|
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
136
136
|
} & {
|
|
137
137
|
readonly ui: Pick<UiApi, "fill">;
|
|
138
138
|
}>;
|
|
139
139
|
scroll: Command<{
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
readonly to: "number";
|
|
141
|
+
readonly key: "string";
|
|
142
142
|
}, boolean, HeadlessApp & {
|
|
143
143
|
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
144
144
|
} & {
|
package/dist/control.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as HeadlessApp } from "./headless-f31cEZ7f.mjs";
|
|
2
2
|
import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-CgE5L_7f.mjs";
|
|
3
|
-
import { t as commands } from "./commands-
|
|
3
|
+
import { t as commands } from "./commands-C1gTg70a.mjs";
|
|
4
4
|
import { t as defineCommand } from "./define-CE1uxbe9.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
package/dist/control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as controlRefused, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
|
|
2
2
|
import { s as defineCommand } from "./session-DuZfGZWk.mjs";
|
|
3
|
-
import { n as commands, t as run } from "./run-
|
|
3
|
+
import { n as commands, t as run } from "./run-G4m1APMv.mjs";
|
|
4
4
|
export { commands, controlReadOnly, controlRefused, defineCommand, run };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $n as FeaturePlugin, An as NumericFields, B as ShapeValue, Bn as EmitterIdOf, C as SceneSpec, Cn as TagType, Dr as Json, Dt as PassKind, En as Ease, F as NineSliceValue, Gn as TextStylesOf, Gr as State$4, Hn as HudKeysOf, Hr as Config$4, Jr as Config$8, K as TransformValue, L as OverlayValue, Ln as Api$2, Mn as ProjectionSpec, N as HudPartValue, Nn as ReducedMotion, Or as Root, Qn as FeatureDescription, Qr as ThermalReading, Rn as BundlesOf, Rr as StoreApi, S as SceneDefinition, Sn as SystemFor, Sr as State$2, T as State$7, Tn as DescriptionNode, Tr as Config$5, U as SpriteOptions, Ur as Events, Vn as GameTypes, Vr as Api$3, W as SpriteValue, Wn as State$3, Wr as PauseReason, X as Config$6, Xr as RateChange, Y as Api$4, Zr as State$8, _ as AnySceneProjection, _n as Mut, _r as Answer, _t as FrameRing, a as Config$1, an as State$9, bn as ResourceType, br as Config$2, c as LoadBundles, dr as Descriptor, dt as ViewportSize, er as FeatureTree, f as ReadyBundles, fn as ComponentType, fr as Effect, gt as FrameRecord, hr as Hint, i as BundleSpec, jn as ProjectionMotion, jr as Patch, kr as State$5, l as LoadReason, lr as SceneIdOf, m as Tier, mr as GuideOptions, ni as Events$1, nn as Api$6, o as DefineBundles, p as State$1, pn as ComponentValue, pr as EffectOptions, q as sprite, qn as defineFlow, qr as Api$5, r as BundleMap, ri as Require, rn as Config$9, rr as DefineNode, rt as State$6, t as Api, ti as Config$10, u as LoadResult, un as ComponentHandle, v as Config$7, vn as Narrowed, vr as Api$1, w as ScenesApi, x as LayerMap, xn as SystemDefinition, y as DefineScene, yn as QueryTerm, zn as Config$3, zr as RngApi } from "./types-D27I4Q7b.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-BqfwZ_lM.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-DGHVGP5i.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $t as ShaderWhat, Ar as types_d_exports$10, At as PerfChange, Bt as PerfLongFrameLine, Cr as types_d_exports$3, Ct as PERF_CAUSES, Dt as PassKind, E as types_d_exports$13, Et as PROBLEM_RULES, Fr as SaveUnreadableError, Ft as PerfEventLine, G as Transform, Gt as PerfStartupLine, H as SpriteBlend, Ht as PerfMeasured, I as Overlay, It as PerfEventName, J as AdaptiveScale, Jn as exit, Jt as PoolTrimDetail, Kn as types_d_exports$6, Kr as types_d_exports$9, Kt as PerfTelemetryLine, L as OverlayValue, Lt as PerfGapLine, M as HudPart, Mt as PerfCollectorLine, N as HudPartValue, Nt as PerfCounts, Ot as PassRecord, P as NineSlice, Pt as PerfDisplay, Qt as ShaderEventDetail, R as Parent, Rt as PerfHeaderLine, St as OverlayWhat, Tn as DescriptionNode, Tt as PERF_LOG_VERSION, Ut as PerfSampleLine, V as Sprite, Vt as PerfMarkLine, Wt as PerfSpikeLine, Xn as to, Xt as ProblemRule, Yn as slot, Yt as ProblemEventDetail, Z as MonitorConfig, Zn as type, Zt as SHADER_WHATS, _t as FrameRing, at as types_d_exports$12, bt as MonitorSections, ei as types_d_exports$15, en as WarmDetail, g as types_d_exports$1, gt as FrameRecord, ht as FrameReadout, j as Display, jt as PerfChangeEntry, kt as PerfCause, mt as FrameReadResult, nt as PoolTrim, on as types_d_exports$17, 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, yt as MONITOR_SECTIONS, z as Shape, zt as PerfLogLine } from "./types-D27I4Q7b.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-BqfwZ_lM.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-DGHVGP5i.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-ChuOBsZB.mjs";
|
|
5
5
|
export { type AdaptiveScale, Alpha, types_d_exports as Anim, AnimPlayer, Animation, types_d_exports$1 as Assets, types_d_exports$2 as Audio, type BackResult, type BindOptions, Blur, Box, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, types_d_exports$6 as Flow, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_d_exports$13 as Scenes, 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, 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 modelPlugin, at as use, b as types_exports$17, bt as Traced, c as hint, cn as timePlugin, 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 type, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as clockPlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as slot, nt as stagger, o as defineEffect, on as SaveUnreadableError, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as to, rt as stopSfx, s as guide, sn as lifecyclePlugin, st as inputPlugin, t as createApp, tn as exit, tt as spawned, u as projection, 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-
|
|
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 modelPlugin, at as use, b as types_exports$17, bt as Traced, c as hint, cn as timePlugin, 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 type, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as clockPlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as slot, nt as stagger, o as defineEffect, on as SaveUnreadableError, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as to, rt as stopSfx, s as guide, sn as lifecyclePlugin, st as inputPlugin, t as createApp, tn as exit, tt as spawned, u as projection, 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-D5Nyvdhu.mjs";
|
|
2
2
|
import { $ as component, H as Shape, I as Display, J as Exiting, L as HudPart, Q as Tree, R as NineSlice, S as bind, T as label, U as Sprite, V as Parent, W as Transform, X as Now, Y as Layer, Z as Order, b as Countdown, d as LocalWrite, et as mut, g as popup, it as tag, l as DebugTrigger, nt as system, p as ScrollState, q as sprite, s as Box, tt as resource, v as defineTokens, w as defineTextStyles, x as Text, y as defineStyle, z as Overlay } from "./visual-ClVRMUAi.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, 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 { Ir as Snapshot, Un as Position, Y as Api$2, ct as RenderStats, dn as ComponentSchema, gn as FrameDiff, h as Usage, hn as EntitySnapshot, in as Explained, ir as FlowGraph, it as Under, nn as Api$1, or as JournalEntry, t as Api$3, wr as Api } from "./types-D27I4Q7b.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-BqfwZ_lM.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-DGHVGP5i.mjs";
|
|
4
4
|
import { t as HeadlessApp } from "./headless-f31cEZ7f.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-CgE5L_7f.mjs";
|
|
6
6
|
import { n as defineSource } from "./define-CE1uxbe9.mjs";
|
|
@@ -76,8 +76,8 @@ declare const sources: Readonly<{
|
|
|
76
76
|
readonly ui: UiApi;
|
|
77
77
|
}>;
|
|
78
78
|
locate: Source<{
|
|
79
|
-
key: "string?";
|
|
80
|
-
target: "json?";
|
|
79
|
+
readonly key: "string?";
|
|
80
|
+
readonly target: "json?";
|
|
81
81
|
}, {
|
|
82
82
|
x: number;
|
|
83
83
|
y: number;
|
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-MfRpM8sV.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-CgJuBIYZ.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-CgJuBIYZ.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
|
@@ -987,10 +987,7 @@ function elementOf(ui, key) {
|
|
|
987
987
|
const tapCommand = defineCommand({
|
|
988
988
|
id: "game.tap",
|
|
989
989
|
title: "Tap",
|
|
990
|
-
input:
|
|
991
|
-
key: "string?",
|
|
992
|
-
target: "json?"
|
|
993
|
-
},
|
|
990
|
+
input: inputSchema(["key", "string?"], ["target", "json?"]),
|
|
994
991
|
effect: "route",
|
|
995
992
|
run: (app, { key, target }) => {
|
|
996
993
|
if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
|
|
@@ -1018,10 +1015,7 @@ const tapCommand = defineCommand({
|
|
|
1018
1015
|
const fillCommand = defineCommand({
|
|
1019
1016
|
id: "game.fill",
|
|
1020
1017
|
title: "Fill",
|
|
1021
|
-
input:
|
|
1022
|
-
key: "string",
|
|
1023
|
-
value: "string"
|
|
1024
|
-
},
|
|
1018
|
+
input: inputSchema(["key", "string"], ["value", "string"]),
|
|
1025
1019
|
effect: "route",
|
|
1026
1020
|
run: (app, { key, value }) => {
|
|
1027
1021
|
if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
|
|
@@ -1048,10 +1042,7 @@ const fillCommand = defineCommand({
|
|
|
1048
1042
|
const scrollCommand = defineCommand({
|
|
1049
1043
|
id: "game.scroll",
|
|
1050
1044
|
title: "Scroll",
|
|
1051
|
-
input:
|
|
1052
|
-
key: "string",
|
|
1053
|
-
to: "number"
|
|
1054
|
-
},
|
|
1045
|
+
input: inputSchema(["key", "string"], ["to", "number"]),
|
|
1055
1046
|
effect: "route",
|
|
1056
1047
|
run: (app, { key, to }) => {
|
|
1057
1048
|
if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_CONTROL__ === "undefined" || !__MOKU_GAME_CONTROL__)) throw controlRefused();
|
|
@@ -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-DGHVGP5i.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. */
|
|
@@ -446,7 +446,7 @@ function locateTarget(app, target) {
|
|
|
446
446
|
const uiSource = defineSource({
|
|
447
447
|
id: "game.ui",
|
|
448
448
|
title: "UI tree",
|
|
449
|
-
input:
|
|
449
|
+
input: inputSchema(),
|
|
450
450
|
changes: "frame",
|
|
451
451
|
read: (app) => app.ui.tree()
|
|
452
452
|
});
|
|
@@ -469,10 +469,7 @@ const uiSource = defineSource({
|
|
|
469
469
|
const locateSource = defineSource({
|
|
470
470
|
id: "game.locate",
|
|
471
471
|
title: "Locate",
|
|
472
|
-
input:
|
|
473
|
-
key: "string?",
|
|
474
|
-
target: "json?"
|
|
475
|
-
},
|
|
472
|
+
input: inputSchema(["key", "string?"], ["target", "json?"]),
|
|
476
473
|
changes: "frame",
|
|
477
474
|
read: (app, { key, target }) => {
|
|
478
475
|
if (key !== void 0 && target === void 0) return locateKey(app, key);
|
|
@@ -27678,7 +27678,7 @@ function writeBlend(sctx, entity, object, blend) {
|
|
|
27678
27678
|
* @param texture - The texture to draw, or `undefined` to keep the one it has.
|
|
27679
27679
|
* @param tint - The tint.
|
|
27680
27680
|
*/
|
|
27681
|
-
function writeLook(sctx, entity, object, texture, tint) {
|
|
27681
|
+
function writeLook$1(sctx, entity, object, texture, tint) {
|
|
27682
27682
|
if (texture !== void 0 && object.texture !== texture) {
|
|
27683
27683
|
markView(sctx, entity);
|
|
27684
27684
|
object.texture = texture;
|
|
@@ -27701,7 +27701,7 @@ function writeLook(sctx, entity, object, texture, tint) {
|
|
|
27701
27701
|
*/
|
|
27702
27702
|
function drawPlaceholder(sctx, entity, object, view, value, texture) {
|
|
27703
27703
|
const box = boxInto(LAYOUT.box, PLACEHOLDER_BOX, value);
|
|
27704
|
-
writeLook(sctx, entity, object, texture, PLACEHOLDER_TINT);
|
|
27704
|
+
writeLook$1(sctx, entity, object, texture, PLACEHOLDER_TINT);
|
|
27705
27705
|
writePoint(sctx, entity, object.anchor, value.anchor.x, value.anchor.y);
|
|
27706
27706
|
view.drawScale.x = box.width;
|
|
27707
27707
|
view.drawScale.y = box.height;
|
|
@@ -27842,10 +27842,10 @@ function writeSprite(sctx, entity, view) {
|
|
|
27842
27842
|
const layout = layoutSpriteInto(LAYOUT, texture, value);
|
|
27843
27843
|
if (layout.cover) {
|
|
27844
27844
|
const cover = coverTexture(sctx, entity, value.texture, texture, layout.box, layout.crop);
|
|
27845
|
-
writeLook(sctx, entity, object, cover.texture, value.tint);
|
|
27845
|
+
writeLook$1(sctx, entity, object, cover.texture, value.tint);
|
|
27846
27846
|
showCover(sctx, entity, view, cover.frameKey);
|
|
27847
27847
|
} else {
|
|
27848
|
-
writeLook(sctx, entity, object, texture, value.tint);
|
|
27848
|
+
writeLook$1(sctx, entity, object, texture, value.tint);
|
|
27849
27849
|
showCover(sctx, entity, view, "");
|
|
27850
27850
|
}
|
|
27851
27851
|
writePoint(sctx, entity, object.anchor, layout.anchor.x, layout.anchor.y);
|
|
@@ -56667,6 +56667,243 @@ function forgetInstances(state, identity) {
|
|
|
56667
56667
|
for (const key of state.instances.keys()) if (key === identity || key.startsWith(`${identity}|`)) state.instances.delete(key);
|
|
56668
56668
|
}
|
|
56669
56669
|
//#endregion
|
|
56670
|
+
//#region src/plugins/ui/jsx/look.ts
|
|
56671
|
+
/**
|
|
56672
|
+
* What moved, from whether the numbers and the other fields of a look did.
|
|
56673
|
+
*
|
|
56674
|
+
* @param numbers - A numeric field moved.
|
|
56675
|
+
* @param others - Another field moved.
|
|
56676
|
+
* @returns What moved.
|
|
56677
|
+
* @example
|
|
56678
|
+
* ```ts
|
|
56679
|
+
* moveOf(true, false); // "numbers"
|
|
56680
|
+
* ```
|
|
56681
|
+
*/
|
|
56682
|
+
function moveOf(numbers, others) {
|
|
56683
|
+
if (numbers) return others ? "both" : "numbers";
|
|
56684
|
+
return others ? "others" : "none";
|
|
56685
|
+
}
|
|
56686
|
+
/**
|
|
56687
|
+
* Writes the visual of a live element whose `change` hook of that visual may play (F85). The look
|
|
56688
|
+
* of this render is compared with the one the element was last written with: the same look writes
|
|
56689
|
+
* nothing, so a running motion of the hook survives a render that changes nothing of it; other
|
|
56690
|
+
* fields alone are written at once; a look whose numbers moved plays the hook with the look before
|
|
56691
|
+
* and this one. When the hook returns a motion the track brings the numbers home and the other
|
|
56692
|
+
* fields are written only when they moved too; with none the look is written whole. ui's part of
|
|
56693
|
+
* a numbers-only change allocates nothing (`__tests__/perf/look-write.perf.ts`).
|
|
56694
|
+
*
|
|
56695
|
+
* @param writer - The reconciler's side: the pass, the values, the play and the writes.
|
|
56696
|
+
* @param element - The live element; its `lookPass` and `lookFrom` note a play of this pass.
|
|
56697
|
+
* @param value - The visual of this render.
|
|
56698
|
+
* @param previous - The look the element was last written with.
|
|
56699
|
+
* @param next - The fields of the visual of this render.
|
|
56700
|
+
*/
|
|
56701
|
+
function writeLook(writer, element, value, previous, next) {
|
|
56702
|
+
const moved = lookMoved(value.type, previous, next);
|
|
56703
|
+
if (moved === "none") return;
|
|
56704
|
+
if (moved === "others") {
|
|
56705
|
+
writer.others(element, value.type, next);
|
|
56706
|
+
return;
|
|
56707
|
+
}
|
|
56708
|
+
const from = element.lookPass === writer.pass && element.lookFrom !== void 0 ? element.lookFrom : previous;
|
|
56709
|
+
writer.values.previous = from;
|
|
56710
|
+
writer.values.next = next;
|
|
56711
|
+
if (!writer.play(element, value.type.componentName, writer.values)) {
|
|
56712
|
+
writer.whole(element, value);
|
|
56713
|
+
return;
|
|
56714
|
+
}
|
|
56715
|
+
element.lookPass = writer.pass;
|
|
56716
|
+
element.lookFrom = from;
|
|
56717
|
+
if (moved === "both") writer.others(element, value.type, next);
|
|
56718
|
+
}
|
|
56719
|
+
/**
|
|
56720
|
+
* Compares the value of a visual a live element was last written with and the value of this
|
|
56721
|
+
* render: whether its numeric fields moved, its other fields, both or none. Every
|
|
56722
|
+
* visual has its own comparator that reads its fields by name, so each read site meets one shape
|
|
56723
|
+
* of value and a fractional number is compared unboxed: per write of an element with a `change`
|
|
56724
|
+
* hook of its visual, 0 B (`__tests__/perf/look-moved.perf.ts`). A field the new value leaves out
|
|
56725
|
+
* stays on the entity, as a patch leaves it. A type that is none of the four visuals is reported
|
|
56726
|
+
* as `"numbers"`: its hook decides.
|
|
56727
|
+
*
|
|
56728
|
+
* @param type - The component type of the visual.
|
|
56729
|
+
* @param previous - The value the element was last written with.
|
|
56730
|
+
* @param next - The value of this render.
|
|
56731
|
+
* @returns What moved.
|
|
56732
|
+
* @example
|
|
56733
|
+
* ```ts
|
|
56734
|
+
* lookMoved(Shape, Shape({ kind: "arc", sweep: 0.25 }).value, Shape({ kind: "arc", sweep: 0.5 }).value); // "numbers"
|
|
56735
|
+
* ```
|
|
56736
|
+
*/
|
|
56737
|
+
function lookMoved(type, previous, next) {
|
|
56738
|
+
if (type === Shape) return shapeMoved(previous, next);
|
|
56739
|
+
if (type === Sprite) return spriteMoved(previous, next);
|
|
56740
|
+
if (type === NineSlice) return nineSliceMoved(previous, next);
|
|
56741
|
+
if (type === Text) return textMoved(previous, next);
|
|
56742
|
+
return "numbers";
|
|
56743
|
+
}
|
|
56744
|
+
/**
|
|
56745
|
+
* What moved in a `Shape`: its sizes, colours, alphas, radius, stroke and dash are numbers, and
|
|
56746
|
+
* the sweep of two arcs; its kind, its clip and the ends of two arcs are not. Only an arc carries
|
|
56747
|
+
* `sweep` and `cap`, so they are read between two arcs alone.
|
|
56748
|
+
*
|
|
56749
|
+
* @param before - The look last written.
|
|
56750
|
+
* @param after - The look of this render.
|
|
56751
|
+
* @returns What moved.
|
|
56752
|
+
* @example
|
|
56753
|
+
* ```ts
|
|
56754
|
+
* shapeMoved(Shape({ kind: "arc", sweep: 0.2, cap: "round" }).value, Shape({ kind: "arc", sweep: 0.2, cap: "butt" }).value); // "others"
|
|
56755
|
+
* ```
|
|
56756
|
+
*/
|
|
56757
|
+
function shapeMoved(before, after) {
|
|
56758
|
+
const numbers = before.w !== after.w || before.h !== after.h || before.fill !== after.fill || before.fillAlpha !== after.fillAlpha || before.alpha !== after.alpha || before.radius !== after.radius || before.stroke !== after.stroke || before.strokeWidth !== after.strokeWidth || before.dash !== after.dash;
|
|
56759
|
+
const arcs = before.kind === "arc" && after.kind === "arc";
|
|
56760
|
+
const others = before.kind !== after.kind || before.clip !== after.clip || arcs && before.cap !== after.cap;
|
|
56761
|
+
return moveOf(numbers || arcs && before.sweep !== after.sweep, others);
|
|
56762
|
+
}
|
|
56763
|
+
/**
|
|
56764
|
+
* What moved in a `Sprite`: its tint, alpha and size are numbers; its texture, fit, anchor and
|
|
56765
|
+
* blend are not.
|
|
56766
|
+
*
|
|
56767
|
+
* @param before - The look last written.
|
|
56768
|
+
* @param after - The look of this render.
|
|
56769
|
+
* @returns What moved.
|
|
56770
|
+
* @example
|
|
56771
|
+
* ```ts
|
|
56772
|
+
* spriteMoved(Sprite({ texture: "ui.coin", width: 40 }).value, Sprite({ texture: "ui.coin", width: 80 }).value); // "numbers"
|
|
56773
|
+
* ```
|
|
56774
|
+
*/
|
|
56775
|
+
function spriteMoved(before, after) {
|
|
56776
|
+
return moveOf(before.tint !== after.tint || before.alpha !== after.alpha || before.width !== after.width || before.height !== after.height, before.texture !== after.texture || before.fit !== after.fit || before.anchor.x !== after.anchor.x || before.anchor.y !== after.anchor.y || after.blend !== void 0 && before.blend !== after.blend);
|
|
56777
|
+
}
|
|
56778
|
+
/**
|
|
56779
|
+
* What moved in a `NineSlice`: its size, alpha and tint are numbers; its texture, outline, clip,
|
|
56780
|
+
* rim and blend are not.
|
|
56781
|
+
*
|
|
56782
|
+
* @param before - The look last written.
|
|
56783
|
+
* @param after - The look of this render.
|
|
56784
|
+
* @returns What moved.
|
|
56785
|
+
* @example
|
|
56786
|
+
* ```ts
|
|
56787
|
+
* nineSliceMoved(NineSlice({ texture: "ui.panel" }).value, NineSlice({ texture: "ui.panel", hollow: true }).value); // "others"
|
|
56788
|
+
* ```
|
|
56789
|
+
*/
|
|
56790
|
+
function nineSliceMoved(before, after) {
|
|
56791
|
+
return moveOf(before.width !== after.width || before.height !== after.height || before.alpha !== after.alpha || before.tint !== after.tint, before.texture !== after.texture || before.debug !== after.debug || before.clip !== after.clip || after.hollow !== void 0 && before.hollow !== after.hollow || after.blend !== void 0 && before.blend !== after.blend);
|
|
56792
|
+
}
|
|
56793
|
+
/**
|
|
56794
|
+
* What moved in a `Text`: its alpha and the box of two texts that wrap at one are numbers; its
|
|
56795
|
+
* content, style, bind and anchor are not. A message or a bind written anew compares by what it
|
|
56796
|
+
* says. `resolved` is the text plugin's and never compared.
|
|
56797
|
+
*
|
|
56798
|
+
* @param before - The look last written.
|
|
56799
|
+
* @param after - The look of this render.
|
|
56800
|
+
* @returns What moved.
|
|
56801
|
+
* @example
|
|
56802
|
+
* ```ts
|
|
56803
|
+
* textMoved(Text({ content: "Play" }).value, Text({ content: "Play", alpha: 0.5 }).value); // "numbers"
|
|
56804
|
+
* ```
|
|
56805
|
+
*/
|
|
56806
|
+
function textMoved(before, after) {
|
|
56807
|
+
const boxes = "box" in before && "box" in after;
|
|
56808
|
+
return moveOf(before.alpha !== after.alpha || boxes && before.box !== after.box, !boxes && "box" in after || before.style !== after.style || before.anchor.x !== after.anchor.x || before.anchor.y !== after.anchor.y || before.content !== after.content && !sameMessage(before.content, after.content) || before.bind !== after.bind && !sameBind(before.bind, after.bind));
|
|
56809
|
+
}
|
|
56810
|
+
/**
|
|
56811
|
+
* Tells whether two contents of a text say the same: two messages of one key with the same
|
|
56812
|
+
* arguments, each compared by identity. Two strings are the same only when they are equal.
|
|
56813
|
+
*
|
|
56814
|
+
* @param before - The content last written.
|
|
56815
|
+
* @param after - The content of this render.
|
|
56816
|
+
* @returns True when the text says the same.
|
|
56817
|
+
* @example
|
|
56818
|
+
* ```ts
|
|
56819
|
+
* sameMessage({ key: "hud.coins", params: { n: 5 } }, { key: "hud.coins", params: { n: 5 } }); // true
|
|
56820
|
+
* ```
|
|
56821
|
+
*/
|
|
56822
|
+
function sameMessage(before, after) {
|
|
56823
|
+
if (typeof before === "string" || typeof after === "string") return before === after;
|
|
56824
|
+
return before.key === after.key && sameArguments(before.params, after.params);
|
|
56825
|
+
}
|
|
56826
|
+
/**
|
|
56827
|
+
* Tells whether the arguments of two messages hold the same values under the same names: a
|
|
56828
|
+
* `for…in` over each, every value compared by identity.
|
|
56829
|
+
*
|
|
56830
|
+
* @param before - The arguments last written.
|
|
56831
|
+
* @param after - The arguments of this render.
|
|
56832
|
+
* @returns True when both hold the same.
|
|
56833
|
+
* @example
|
|
56834
|
+
* ```ts
|
|
56835
|
+
* sameArguments({ n: 5 }, { n: 6 }); // false
|
|
56836
|
+
* ```
|
|
56837
|
+
*/
|
|
56838
|
+
function sameArguments(before, after) {
|
|
56839
|
+
if (before === after) return true;
|
|
56840
|
+
if (before === void 0 || after === void 0) return false;
|
|
56841
|
+
for (const name in after) if (!(name in before) || before[name] !== after[name]) return false;
|
|
56842
|
+
for (const name in before) if (!(name in after)) return false;
|
|
56843
|
+
return true;
|
|
56844
|
+
}
|
|
56845
|
+
/**
|
|
56846
|
+
* Tells whether two binds of a text show the same field of the same component in one format.
|
|
56847
|
+
*
|
|
56848
|
+
* @param before - The bind last written.
|
|
56849
|
+
* @param after - The bind of this render.
|
|
56850
|
+
* @returns True when both show the same.
|
|
56851
|
+
* @example
|
|
56852
|
+
* ```ts
|
|
56853
|
+
* sameBind({ component: "Counter", field: "value", format: "int" }, { component: "Counter", field: "value", format: "mm:ss" }); // false
|
|
56854
|
+
* ```
|
|
56855
|
+
*/
|
|
56856
|
+
function sameBind(before, after) {
|
|
56857
|
+
if (before === void 0 || after === void 0) return before === after;
|
|
56858
|
+
return before.component === after.component && before.field === after.field && before.format === after.format;
|
|
56859
|
+
}
|
|
56860
|
+
/**
|
|
56861
|
+
* The fields of a visual a render writes directly while its `change` hook brings the numbers
|
|
56862
|
+
* home: every field that is no number, without the ones the component type gives to a plugin.
|
|
56863
|
+
*
|
|
56864
|
+
* @param value - The value of this render.
|
|
56865
|
+
* @param owned - The fields the component type gives to a plugin.
|
|
56866
|
+
* @returns The patch, or `undefined` when every field is a number.
|
|
56867
|
+
* @example
|
|
56868
|
+
* ```ts
|
|
56869
|
+
* otherFields({ kind: "arc", w: 32, sweep: 0.5, cap: "butt" }, []); // { kind: "arc", cap: "butt" }
|
|
56870
|
+
* ```
|
|
56871
|
+
*/
|
|
56872
|
+
function otherFields(value, owned) {
|
|
56873
|
+
let patch;
|
|
56874
|
+
for (const [field, entry] of Object.entries(value)) {
|
|
56875
|
+
if (typeof entry === "number" || owned.includes(field)) continue;
|
|
56876
|
+
patch ??= {};
|
|
56877
|
+
patch[field] = entry;
|
|
56878
|
+
}
|
|
56879
|
+
return patch;
|
|
56880
|
+
}
|
|
56881
|
+
/**
|
|
56882
|
+
* Names, once per element and hook name, every `change` hook of an element `ui` never plays: not
|
|
56883
|
+
* `Box`, not `Transform`, not the visual it is drawn with, not an extra of its `components` prop.
|
|
56884
|
+
* Read when the element mounts and when its `motion` prop changes, against what it carries then.
|
|
56885
|
+
* Its effect is the log and the note: each such hook is logged at warn as `ui:change-never-plays`
|
|
56886
|
+
* `{ key, name }` and noted in the element's `warned`, which keeps it from being named again.
|
|
56887
|
+
*
|
|
56888
|
+
* @param ctx - Domain context of the ui plugin.
|
|
56889
|
+
* @param element - The live element, its visual and its extras written.
|
|
56890
|
+
*/
|
|
56891
|
+
function warnIdleChanges(ctx, element) {
|
|
56892
|
+
const change = element.motion?.change;
|
|
56893
|
+
if (change === void 0) return;
|
|
56894
|
+
const visual = element.look?.type.componentName;
|
|
56895
|
+
for (const name of Object.keys(change)) {
|
|
56896
|
+
const plays = name === "Box" || name === "Transform" || name === visual || element.extras.has(name);
|
|
56897
|
+
const once = `change-never-plays:${name}`;
|
|
56898
|
+
if (plays || element.warned.has(once)) continue;
|
|
56899
|
+
element.warned.add(once);
|
|
56900
|
+
ctx.log.warn("ui:change-never-plays", {
|
|
56901
|
+
key: element.key ?? element.identity,
|
|
56902
|
+
name
|
|
56903
|
+
});
|
|
56904
|
+
}
|
|
56905
|
+
}
|
|
56906
|
+
//#endregion
|
|
56670
56907
|
//#region src/plugins/ui/jsx/order.ts
|
|
56671
56908
|
/**
|
|
56672
56909
|
* @file ui — the draw order of a child element among its siblings: a composite `Order` below its `zIndex` step.
|
|
@@ -57259,6 +57496,8 @@ function concatTypes(...lists) {
|
|
|
57259
57496
|
}
|
|
57260
57497
|
/** Every type a live element may carry and drop again: the visuals, then the inputs. */
|
|
57261
57498
|
const LIVE_TYPES = concatTypes(VISUALS, INPUTS);
|
|
57499
|
+
/** What the values of a look write hold before the first play: no look. */
|
|
57500
|
+
const NO_LOOK = Object.freeze({});
|
|
57262
57501
|
/** The owned fields of a type that gives none to a plugin: one list, never a new one. */
|
|
57263
57502
|
const NO_OWNED = [];
|
|
57264
57503
|
/** The time of a reconcile a test steps by hand: no ms pass, so no scroll moves. */
|
|
@@ -57686,6 +57925,16 @@ function entitySet(entities) {
|
|
|
57686
57925
|
return new Set(entities);
|
|
57687
57926
|
}
|
|
57688
57927
|
/**
|
|
57928
|
+
* Collects the identities of the children of one render. Its own function, because lint rule L5
|
|
57929
|
+
* refuses a collection built inside an exported declaration.
|
|
57930
|
+
*
|
|
57931
|
+
* @param identities - The identities, in markup order.
|
|
57932
|
+
* @returns The identities as a set.
|
|
57933
|
+
*/
|
|
57934
|
+
function identitySet(identities) {
|
|
57935
|
+
return new Set(identities);
|
|
57936
|
+
}
|
|
57937
|
+
/**
|
|
57689
57938
|
* Tells whether an element whose `Box` just came arrives with an enter: new, and not a row a
|
|
57690
57939
|
* range change scrolled in.
|
|
57691
57940
|
*
|
|
@@ -57731,6 +57980,16 @@ function createReconciler(ctx, modules, fields) {
|
|
|
57731
57980
|
let rendered = 0;
|
|
57732
57981
|
const isAside = (entity) => ctx.deps.world.projection.isBuilding(entity);
|
|
57733
57982
|
let released = false;
|
|
57983
|
+
const lookWriter = {
|
|
57984
|
+
pass: 0,
|
|
57985
|
+
values: {
|
|
57986
|
+
previous: NO_LOOK,
|
|
57987
|
+
next: NO_LOOK
|
|
57988
|
+
},
|
|
57989
|
+
play: (element, name, values) => modules.layout.changeExtra(element, name, values, hintOf(state, element)),
|
|
57990
|
+
whole: (element, value) => writeValue(element, value),
|
|
57991
|
+
others: (element, type, next) => writeOthers(element, next, type)
|
|
57992
|
+
};
|
|
57734
57993
|
/**
|
|
57735
57994
|
* Registers the key of an element under its root, so `entityOf` and `find` answer for it. A key
|
|
57736
57995
|
* `ui` gave a node of its own, a spacer's, is never registered.
|
|
@@ -57822,7 +58081,8 @@ function createReconciler(ctx, modules, fields) {
|
|
|
57822
58081
|
extraHandles: handleMap(),
|
|
57823
58082
|
warnedOwned: nameSet(),
|
|
57824
58083
|
warned: nameSet(),
|
|
57825
|
-
scrolledIn: range.isMoving()
|
|
58084
|
+
scrolledIn: range.isMoving(),
|
|
58085
|
+
look: void 0
|
|
57826
58086
|
};
|
|
57827
58087
|
state.styled += 1;
|
|
57828
58088
|
state.elements.set(entity, element);
|
|
@@ -57976,12 +58236,13 @@ function createReconciler(ctx, modules, fields) {
|
|
|
57976
58236
|
/**
|
|
57977
58237
|
* Writes the visual and input components of a live element again. A visual or an input the
|
|
57978
58238
|
* element no longer carries is removed, so a variant can trade the rectangle for a nine-slice and
|
|
57979
|
-
* back, and a button that became disabled stops answering the gate
|
|
57980
|
-
*
|
|
57981
|
-
*
|
|
57982
|
-
*
|
|
57983
|
-
*
|
|
57984
|
-
*
|
|
58239
|
+
* back, and a button that became disabled stops answering the gate; a visual traded away takes
|
|
58240
|
+
* the motion of its `change` hook with it. `Scroll`, `Scrollable` and `ScrollState` are only ever
|
|
58241
|
+
* added: where a scroll stands belongs to the finger and the scroll step, and a new look or a new
|
|
58242
|
+
* rect never resets it. The look is recorded as the rest of the visual before it is written, so
|
|
58243
|
+
* the rest the world holds is always the one the element is drawn with (a restore brings it back
|
|
58244
|
+
* to exactly that) and a `change` hook of the visual brings it home with `toRest`. The extras of
|
|
58245
|
+
* the `components` prop are diffed last. Every call is one write pass of `UiCounters`.
|
|
57985
58246
|
*
|
|
57986
58247
|
* @param element - The element that changed.
|
|
57987
58248
|
*/
|
|
@@ -57990,13 +58251,50 @@ function createReconciler(ctx, modules, fields) {
|
|
|
57990
58251
|
writeOrder(element);
|
|
57991
58252
|
const visuals = visualOf$1(element);
|
|
57992
58253
|
const inputs = inputOf(element);
|
|
57993
|
-
for (const type of LIVE_TYPES) if (!carries(visuals, type) && !carries(inputs, type) && ecs.has(element.entity, type))
|
|
57994
|
-
|
|
57995
|
-
|
|
58254
|
+
for (const type of LIVE_TYPES) if (!carries(visuals, type) && !carries(inputs, type) && ecs.has(element.entity, type)) {
|
|
58255
|
+
cancelExtra(element, type.componentName);
|
|
58256
|
+
ecs.remove(element.entity, type);
|
|
58257
|
+
}
|
|
57996
58258
|
for (const value of visuals) recordRest(ctx, element, value);
|
|
58259
|
+
for (const value of visuals) writeVisual(element, value);
|
|
58260
|
+
for (const value of inputs) writeValue(element, value);
|
|
57997
58261
|
writeExtras(element);
|
|
57998
58262
|
}
|
|
57999
58263
|
/**
|
|
58264
|
+
* Writes the visual of a live element. Without a `change` hook of its name, or for a visual
|
|
58265
|
+
* traded in, it is written like every other value. With one, the look decides what is written
|
|
58266
|
+
* (`writeLook`, F85): nothing for the same look, the other fields alone, or the hook's play, after
|
|
58267
|
+
* which the track brings the numbers home; an element held for the swap of a scene build plays
|
|
58268
|
+
* none and is written whole.
|
|
58269
|
+
*
|
|
58270
|
+
* @param element - The live element.
|
|
58271
|
+
* @param value - The visual of this render.
|
|
58272
|
+
*/
|
|
58273
|
+
function writeVisual(element, value) {
|
|
58274
|
+
const look = element.look;
|
|
58275
|
+
element.look = value;
|
|
58276
|
+
const isHooked = element.motion?.change?.[value.type.componentName] !== void 0;
|
|
58277
|
+
const previous = look === void 0 || look.type !== value.type ? true : look.value;
|
|
58278
|
+
const next = value.value;
|
|
58279
|
+
if (!isHooked || previous === true || next === true || !ecs.has(element.entity, value.type)) {
|
|
58280
|
+
writeValue(element, value);
|
|
58281
|
+
return;
|
|
58282
|
+
}
|
|
58283
|
+
writeLook(lookWriter, element, value, previous, next);
|
|
58284
|
+
}
|
|
58285
|
+
/**
|
|
58286
|
+
* Writes the fields of a visual that are no number, while a `change` hook brings the numbers
|
|
58287
|
+
* home, never a field its type gives to a plugin.
|
|
58288
|
+
*
|
|
58289
|
+
* @param element - The live element.
|
|
58290
|
+
* @param value - The fields of the visual of this render.
|
|
58291
|
+
* @param type - Its component type.
|
|
58292
|
+
*/
|
|
58293
|
+
function writeOthers(element, value, type) {
|
|
58294
|
+
const others = otherFields(value, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED);
|
|
58295
|
+
if (others !== void 0) ecs.set(element.entity, asHandle(type), others);
|
|
58296
|
+
}
|
|
58297
|
+
/**
|
|
58000
58298
|
* Writes one visual or input value onto a live element: added when the entity lacks it, else
|
|
58001
58299
|
* its fields patched, but never a tag or the state of a scroll, and never a field its type gives
|
|
58002
58300
|
* to a plugin.
|
|
@@ -58092,6 +58390,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58092
58390
|
const change = compare(root, element, node);
|
|
58093
58391
|
const motion = node.props.motion;
|
|
58094
58392
|
const loopChanged = !sameLoop(element.motion?.loop, motion?.loop);
|
|
58393
|
+
const motionChanged = motion !== element.motion;
|
|
58095
58394
|
if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__) countRebuild(element, element.motion?.loop, motion?.loop);
|
|
58096
58395
|
if (!change.unchanged) delete element.basis;
|
|
58097
58396
|
element.node = node;
|
|
@@ -58109,6 +58408,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58109
58408
|
rowHeight: change.rowHeight
|
|
58110
58409
|
};
|
|
58111
58410
|
}
|
|
58411
|
+
if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__ && motionChanged && element.live) warnIdleChanges(ctx, element);
|
|
58112
58412
|
diffChildren(root, element, childrenOf(node, range.slotsFor(element), element.scroll?.axis), instance);
|
|
58113
58413
|
}
|
|
58114
58414
|
/**
|
|
@@ -58167,18 +58467,20 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58167
58467
|
};
|
|
58168
58468
|
}
|
|
58169
58469
|
/**
|
|
58170
|
-
* Places one node: enter, patch, or exit and enter when the
|
|
58470
|
+
* Places one node: enter, patch, or exit and enter when the element at its identity is another
|
|
58471
|
+
* one now: a component whose view returned another tag or another key. The old element leaves
|
|
58472
|
+
* first, with its exit, so the new one takes the keys they share; the component itself stays and
|
|
58473
|
+
* keeps its local state.
|
|
58171
58474
|
*
|
|
58172
58475
|
* @param root - The root being reconciled.
|
|
58173
58476
|
* @param parent - The parent element, or nothing.
|
|
58174
58477
|
* @param node - The node the markup wrote.
|
|
58175
58478
|
* @param index - Its position among its siblings.
|
|
58176
|
-
* @param
|
|
58479
|
+
* @param identity - Its identity: `identityOf` the parent, the node and the index.
|
|
58177
58480
|
* @param instance - The identity of the nearest component instance.
|
|
58178
58481
|
* @returns The entity of the element, or `undefined` when a component view threw.
|
|
58179
58482
|
*/
|
|
58180
|
-
function diffNode(root, parent, node, index,
|
|
58181
|
-
const identity = identityOf(parentIdentity, node, index);
|
|
58483
|
+
function diffNode(root, parent, node, index, identity, instance) {
|
|
58182
58484
|
const expanded = expand(node, identity);
|
|
58183
58485
|
const view = expanded.node;
|
|
58184
58486
|
const owner = expanded.instance ?? instance;
|
|
@@ -58186,15 +58488,29 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58186
58488
|
if (effective === void 0) return state.byIdentity.get(identity);
|
|
58187
58489
|
const existing = state.byIdentity.get(identity);
|
|
58188
58490
|
const element = existing === void 0 ? void 0 : state.elements.get(existing);
|
|
58189
|
-
if (element !== void 0 && element.type === effective.type) {
|
|
58491
|
+
if (element !== void 0 && element.type === effective.type && element.key === effective.key) {
|
|
58190
58492
|
patch(root, element, effective, owner);
|
|
58191
58493
|
return element.entity;
|
|
58192
58494
|
}
|
|
58193
|
-
if (element !== void 0)
|
|
58495
|
+
if (element !== void 0) replaceElement(element, identity);
|
|
58194
58496
|
return enter(root, parent, effective, identity, owner, index);
|
|
58195
58497
|
}
|
|
58196
58498
|
/**
|
|
58197
|
-
*
|
|
58499
|
+
* Exits the element a component's view returned before, at the component's own identity. The
|
|
58500
|
+
* instances under it are forgotten with it; the component's own instance stays: the local state
|
|
58501
|
+
* belongs to the component, which is still there.
|
|
58502
|
+
*
|
|
58503
|
+
* @param element - The element the view returned before.
|
|
58504
|
+
* @param identity - The identity of the component node.
|
|
58505
|
+
*/
|
|
58506
|
+
function replaceElement(element, identity) {
|
|
58507
|
+
const own = state.instances.get(identity);
|
|
58508
|
+
exitElement(element, "change");
|
|
58509
|
+
if (own !== void 0) state.instances.set(identity, own);
|
|
58510
|
+
}
|
|
58511
|
+
/**
|
|
58512
|
+
* Diffs the children of one element and re-places them once when the list changed. The old
|
|
58513
|
+
* children the render leaves out start their exit before any new child enters.
|
|
58198
58514
|
*
|
|
58199
58515
|
* @param root - The root being reconciled.
|
|
58200
58516
|
* @param parent - The element whose children are diffed.
|
|
@@ -58202,19 +58518,18 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58202
58518
|
* @param instance - The identity of the nearest component instance.
|
|
58203
58519
|
*/
|
|
58204
58520
|
function diffChildren(root, parent, nodes, instance) {
|
|
58521
|
+
const identities = nodes.map((node, index) => identityOf(parent.identity, node, index));
|
|
58522
|
+
leaveOut(parent, identities);
|
|
58205
58523
|
const next = [];
|
|
58206
58524
|
for (const [index, node] of nodes.entries()) {
|
|
58207
|
-
const entity = diffNode(root, parent, node, index, parent.identity, instance);
|
|
58525
|
+
const entity = diffNode(root, parent, node, index, identities[index] ?? identityOf(parent.identity, node, index), instance);
|
|
58208
58526
|
if (entity !== void 0) next.push(entity);
|
|
58209
58527
|
}
|
|
58210
58528
|
const kept = entitySet(next);
|
|
58211
|
-
const dropsRows = range.dropsRowsOf(parent);
|
|
58212
58529
|
for (const old of parent.children) {
|
|
58213
|
-
if (kept.has(old)) continue;
|
|
58530
|
+
if (kept.has(old) || state.exiting.has(old)) continue;
|
|
58214
58531
|
const element = state.elements.get(old);
|
|
58215
|
-
if (element
|
|
58216
|
-
if (dropsRows) range.dropRow(element);
|
|
58217
|
-
else exitElement(element, "change");
|
|
58532
|
+
if (element !== void 0) removeChild(parent, element);
|
|
58218
58533
|
}
|
|
58219
58534
|
const same = next.length === parent.children.length && next.every((entity, index) => parent.children[index] === entity);
|
|
58220
58535
|
parent.children = next;
|
|
@@ -58224,6 +58539,33 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58224
58539
|
root.needsSolve = true;
|
|
58225
58540
|
}
|
|
58226
58541
|
/**
|
|
58542
|
+
* Takes out every old child of an element whose identity no node of this render has: its exit
|
|
58543
|
+
* starts, and everything under it plays its own, before a new child enters.
|
|
58544
|
+
*
|
|
58545
|
+
* @param parent - The element whose children are diffed.
|
|
58546
|
+
* @param identities - The identities of the children of this render, in markup order.
|
|
58547
|
+
*/
|
|
58548
|
+
function leaveOut(parent, identities) {
|
|
58549
|
+
let listed;
|
|
58550
|
+
for (const [index, old] of parent.children.entries()) {
|
|
58551
|
+
const element = state.elements.get(old);
|
|
58552
|
+
if (element === void 0 || identities[index] === element.identity) continue;
|
|
58553
|
+
listed ??= identitySet(identities);
|
|
58554
|
+
if (!listed.has(element.identity)) removeChild(parent, element);
|
|
58555
|
+
}
|
|
58556
|
+
}
|
|
58557
|
+
/**
|
|
58558
|
+
* Removes one child a render left out: its exit starts. A row that a range change took out of a
|
|
58559
|
+
* windowed scroll is not removed: it is dropped at once, with no exit motion.
|
|
58560
|
+
*
|
|
58561
|
+
* @param parent - The element whose children are diffed.
|
|
58562
|
+
* @param element - The child that leaves.
|
|
58563
|
+
*/
|
|
58564
|
+
function removeChild(parent, element) {
|
|
58565
|
+
if (range.dropsRowsOf(parent)) range.dropRow(element);
|
|
58566
|
+
else exitElement(element, "change");
|
|
58567
|
+
}
|
|
58568
|
+
/**
|
|
58227
58569
|
* Starts the exit of an element and of everything under it. An element of a root built aside was
|
|
58228
58570
|
* never seen: it goes at once, with no exit (spec 31).
|
|
58229
58571
|
*
|
|
@@ -58412,8 +58754,12 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58412
58754
|
warnOwned(element);
|
|
58413
58755
|
for (const value of element.extras.values()) recordRest(ctx, element, value);
|
|
58414
58756
|
if (overlayOf(element) !== void 0) ecs.add(element.entity, OverlayLevel());
|
|
58415
|
-
for (const value of componentsOf(element, root))
|
|
58757
|
+
for (const value of componentsOf(element, root)) {
|
|
58758
|
+
ecs.add(element.entity, value);
|
|
58759
|
+
if (VISUALS.includes(value.type)) element.look = value;
|
|
58760
|
+
}
|
|
58416
58761
|
element.live = true;
|
|
58762
|
+
if (typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__) warnIdleChanges(ctx, element);
|
|
58417
58763
|
if (state.hosts.has(element.entity)) state.risen.add(element.entity);
|
|
58418
58764
|
}
|
|
58419
58765
|
/**
|
|
@@ -58777,14 +59123,17 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58777
59123
|
/**
|
|
58778
59124
|
* Reconciles one root from the node its `Tree` carries. Its first build reads how the root came,
|
|
58779
59125
|
* from the world's view record, which exists by now; the elements entered by this diff take that
|
|
58780
|
-
* cause, and the elements of any later diff take `"change"` (spec 16 U4).
|
|
59126
|
+
* cause, and the elements of any later diff take `"change"` (spec 16 U4). A tree whose top has
|
|
59127
|
+
* another identity, another key or tag, replaces the root element: the old one exits first.
|
|
58781
59128
|
*
|
|
58782
59129
|
* @param root - The root to reconcile.
|
|
58783
59130
|
*/
|
|
58784
59131
|
function reconcileRoot(root) {
|
|
58785
|
-
const identity = String(root.entity);
|
|
59132
|
+
const identity = identityOf(String(root.entity), root.tree, 0);
|
|
58786
59133
|
const first = root.element === void 0;
|
|
58787
59134
|
if (first) root.cause ??= ctx.deps.world.projection.causeOf(root.entity) ?? "change";
|
|
59135
|
+
const previous = root.element === void 0 ? void 0 : lookup(root.element);
|
|
59136
|
+
if (previous !== void 0 && previous.identity !== identity) exitElement(previous, "change");
|
|
58788
59137
|
state.building = first ? root.cause : "change";
|
|
58789
59138
|
try {
|
|
58790
59139
|
root.element = diffNode(root, void 0, root.tree, 0, identity);
|
|
@@ -58932,6 +59281,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
58932
59281
|
function reconcile(time = NO_TIME) {
|
|
58933
59282
|
sweep();
|
|
58934
59283
|
state.reconciles += 1;
|
|
59284
|
+
lookWriter.pass += 1;
|
|
58935
59285
|
settleAside();
|
|
58936
59286
|
if (state.remount) remountRoots();
|
|
58937
59287
|
reorderRoots();
|
|
@@ -59103,6 +59453,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
59103
59453
|
const element = state.elements.get(entity);
|
|
59104
59454
|
if (element === void 0) return;
|
|
59105
59455
|
element.is[flag] = on;
|
|
59456
|
+
lookWriter.pass += 1;
|
|
59106
59457
|
const style = styleFor(parentOf(element), element.node, element.is);
|
|
59107
59458
|
const root = state.roots.get(element.root);
|
|
59108
59459
|
const moved = modules.layout.affectsRect(element.style, style);
|
|
@@ -59888,14 +60239,15 @@ function noteEndless(element, motion) {
|
|
|
59888
60239
|
element.endless.add(motion);
|
|
59889
60240
|
}
|
|
59890
60241
|
/**
|
|
59891
|
-
* Plays the `change` hook of one extra component whose fields changed
|
|
59892
|
-
* of that name started is cancelled first, so its
|
|
59893
|
-
* starts from there; the new motion is kept with the
|
|
59894
|
-
* An element held for the swap of a scene build plays
|
|
60242
|
+
* Plays the `change` hook of one extra component whose fields changed, or of the visual whose
|
|
60243
|
+
* numbers moved (F85). The motion the last change of that name started is cancelled first, so its
|
|
60244
|
+
* value stays where it is and the new motion starts from there; the new motion is kept with the
|
|
60245
|
+
* element's handles, so an exit waits for it. An element held for the swap of a scene build plays
|
|
60246
|
+
* none: the caller writes the fields.
|
|
59895
60247
|
*
|
|
59896
60248
|
* @param ctx - Domain context of the ui plugin.
|
|
59897
|
-
* @param element - The element that carries the
|
|
59898
|
-
* @param name - The component name of the extra.
|
|
60249
|
+
* @param element - The element that carries the component.
|
|
60250
|
+
* @param name - The component name of the extra or the visual.
|
|
59899
60251
|
* @param values - The value of the last render and of this one.
|
|
59900
60252
|
* @param values.previous - The value of the last render.
|
|
59901
60253
|
* @param values.next - The value of this render.
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $n as FeaturePlugin, Dr as Json, dr as Descriptor, gr as NodeFx, hr as Hint, sr as NodeTable, tr as AnyFlow, xr as FakeClock, yr as ClockSource } from "./types-D27I4Q7b.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-ChuOBsZB.mjs";
|
|
3
|
+
import { b as saveOf, v as WithGameState, y as memory } from "./types-CF6CJ55K.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-f31cEZ7f.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { en as refuseStart, in as type, m as flattenFeatures, t as createApp, tn as exit } from "./src-
|
|
1
|
+
import { en as refuseStart, in as type, m as flattenFeatures, t as createApp, tn as exit } from "./src-D5Nyvdhu.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-Bxxl_mQX.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $ as PixiModule, A as SyncApi, An as NumericFields, Dr as Json, En as Ease, Er as Events$3, Fn as TrackSegment, Ln as Api$2, Nn as ReducedMotion, O as FilterSlot, Pn as TrackOptions, Q as PixiFilter, Ur as Events$5, Y as Api$4, b as Events$4, dr as Descriptor, et as PixiSprite, fn as ComponentType, ft as FilterCache, k as FilterSlotInputs, kn as MotionHandle, ln as AnyComponentValue, mn as Entity, ni as Events$2, nn as Api$3, qr as Api$1, ri as Require, s as Events$1, sn as AnyComponent, t as Api$5, tt as PixiTexture, un as ComponentHandle, ur as TypeTag, ut as Point, wr as Api$6 } from "./types-D27I4Q7b.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-DGHVGP5i.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { $ as PixiModule, $n as FeaturePlugin, Dr as Json, Lr as SnapshotOf, Mr as PlayerStateProvider, Nr as ProviderCall, Pr as SaveDoc, Tr as Config, X as Config$2, a as Config$3, d as Manifest, lt as Orientation, n as AssetsIo, tr as AnyFlow, ur as TypeTag, xr as FakeClock, yr as ClockSource, zn as Config$1 } from "./types-D27I4Q7b.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-BqfwZ_lM.mjs";
|
|
3
|
+
import { R as I18nApi, U as StringTable, W as TextKey } from "./types-DGHVGP5i.mjs";
|
|
4
|
+
import { St as effectsPlugin, Tt as audioPlugin, ht as PlatformProvider, i as screen, pt as platformPlugin, t as createApp } from "./index-ChuOBsZB.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -2502,9 +2502,12 @@ type ElementChange<Value> = (view: ViewHandle<unknown>, previous: Value, next: V
|
|
|
2502
2502
|
/**
|
|
2503
2503
|
* The motion hooks of one element: the hook triple of `world.projection`, which `defineMotion`
|
|
2504
2504
|
* of `anim` returns. `ui` plays the `change` hooks of `Box` (the rects), of `Transform` (the rest
|
|
2505
|
-
* poses)
|
|
2506
|
-
*
|
|
2507
|
-
*
|
|
2505
|
+
* poses), of the visual the element is drawn with (`Shape`, `Sprite`, `NineSlice` or `Text`: its
|
|
2506
|
+
* values before and after, when a render or a restyle moves a number of it) and of every extra
|
|
2507
|
+
* component of the `components` prop (its values before and after). A hook for any other
|
|
2508
|
+
* component name is accepted, so every `defineMotion` result fits; `ui` never plays it, and a dev
|
|
2509
|
+
* build names it once (`ui:change-never-plays`). Every hook gets the hint routed to the element's
|
|
2510
|
+
* key in that frame step.
|
|
2508
2511
|
*
|
|
2509
2512
|
* @example
|
|
2510
2513
|
* ```ts
|
|
@@ -2648,27 +2651,29 @@ type StyleBasis = {
|
|
|
2648
2651
|
};
|
|
2649
2652
|
/**
|
|
2650
2653
|
* One live element: the entity, the Yoga node, the resolved style and the place in the tree.
|
|
2651
|
-
* `rect` is natural: under a `fit` ancestor it is the rect before that ancestor's scale. `fit`
|
|
2652
|
-
*
|
|
2653
|
-
*
|
|
2654
|
-
*
|
|
2655
|
-
*
|
|
2656
|
-
* `change` hook of each of them returned; `warnedOwned` the names of the
|
|
2657
|
-
* element owns that were already logged. A windowed scroll carries its
|
|
2658
|
-
* warnings of its props in `warned`; `scrolledIn` marks an element a
|
|
2659
|
-
* scroll created: it plays no `enter` hook. A scroll carries its
|
|
2660
|
-
* `
|
|
2661
|
-
*
|
|
2662
|
-
*
|
|
2663
|
-
*
|
|
2664
|
-
*
|
|
2665
|
-
*
|
|
2666
|
-
*
|
|
2667
|
-
*
|
|
2668
|
-
* the
|
|
2669
|
-
*
|
|
2670
|
-
*
|
|
2671
|
-
*
|
|
2654
|
+
* `rect` is natural: under a `fit` ancestor it is the rect before that ancestor's scale. `fit` is
|
|
2655
|
+
* the element's own fit scale (1 without `fit: "contain"`), and `rest` the rest `Transform` last
|
|
2656
|
+
* written for it. `loop` is the motion of the running `loop` hook, kept apart from `handles`: it
|
|
2657
|
+
* never ends, so the exit sweep must not wait for it. `extras` holds the values of the
|
|
2658
|
+
* `components` prop added last time, by component name; `extraHandles` the motion the last
|
|
2659
|
+
* `change` hook of each of them and of the visual returned; `warnedOwned` the names of the
|
|
2660
|
+
* `components` values the element owns that were already logged. A windowed scroll carries its
|
|
2661
|
+
* `window` and the one-time warnings of its props in `warned`; `scrolledIn` marks an element a
|
|
2662
|
+
* range change of a windowed scroll created: it plays no `enter` hook. A scroll carries its
|
|
2663
|
+
* `scroll` motion from its enter. A text or an icon that sizes itself keeps in `measuredSize` what
|
|
2664
|
+
* its measure function last answered, before Yoga's clamp: a bound text whose new string measures
|
|
2665
|
+
* the same asks for no solve. `measuredWidth` is the width Yoga offered that call when the text
|
|
2666
|
+
* wrapped at it (only a `"box"` style does), `undefined` otherwise: such a text is measured again
|
|
2667
|
+
* at its laid-out width and gets a `Text.box`, any other gets none. `basis` is what `style` was
|
|
2668
|
+
* resolved on, set once the style is on the layout node and the components are written; an
|
|
2669
|
+
* element without one is patched in full at its next patch. `index` is its place among the
|
|
2670
|
+
* element children of its parent at the last diff (0 for a root element): with its `zIndex` it
|
|
2671
|
+
* gives the child its `Order`. `cause` is why the element appeared: `"mount"` when it came with
|
|
2672
|
+
* the first build of its root and the root came by a mount, `"change"` otherwise; its `enter` hook
|
|
2673
|
+
* is told. `rebuilds` counts the patches in a row that brought a loop of another reference that is
|
|
2674
|
+
* not really another loop: a dev build names the element once it reaches three. `endless` holds
|
|
2675
|
+
* the motions a hook returned after it started a track that repeats forever: they never end, so
|
|
2676
|
+
* no exit waits for them (F42).
|
|
2672
2677
|
*/
|
|
2673
2678
|
type Element = {
|
|
2674
2679
|
entity: Entity;
|
|
@@ -2724,7 +2729,10 @@ type Element = {
|
|
|
2724
2729
|
blended?: boolean;
|
|
2725
2730
|
basis?: StyleBasis; /** The motions of its hooks that started a `repeat: "forever"` track; made with the first one. */
|
|
2726
2731
|
endless?: Set<MotionHandle>; /** What its enter hook did at the `Box`, until `ui.enter` keeps the play or plays it again (F49). */
|
|
2727
|
-
posed?: PosedEnter | undefined;
|
|
2732
|
+
posed?: PosedEnter | undefined; /** The value of its visual last written: what a `change` hook of the visual gets as the value before (F85). */
|
|
2733
|
+
look?: AnyComponentValue | undefined; /** The write pass in which a `change` hook of its visual last returned a motion. */
|
|
2734
|
+
lookPass?: number | undefined; /** The value of its visual before that pass: a second write in the pass plays the hook from it. */
|
|
2735
|
+
lookFrom?: object | undefined;
|
|
2728
2736
|
};
|
|
2729
2737
|
/**
|
|
2730
2738
|
* One `set` of an enter hook: the fields it wrote, and the values they had before. A hook may write any component of
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Vr as Api$3, Y as Api, nn as Api$1, vr as Api$4, wr as Api$2 } from "./types-D27I4Q7b.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-BqfwZ_lM.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-DGHVGP5i.mjs";
|
|
4
4
|
import { r as Repro } from "./headless-f31cEZ7f.mjs";
|
|
5
5
|
import { a as InputOf, r as ControlApp } from "./types-CgE5L_7f.mjs";
|
|
6
|
-
import { t as commands } from "./commands-
|
|
6
|
+
import { t as commands } from "./commands-C1gTg70a.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-C2HHHs46.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,6 +1,6 @@
|
|
|
1
1
|
import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
|
|
2
|
-
import { n as read, t as sources } from "./sources-
|
|
3
|
-
import { n as commands, t as run } from "./run-
|
|
2
|
+
import { n as read, t as sources } from "./sources-MfRpM8sV.mjs";
|
|
3
|
+
import { n as commands, t as run } from "./run-G4m1APMv.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
|
6
6
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
package/llms.txt
CHANGED
|
@@ -550,7 +550,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
550
550
|
|
|
551
551
|
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.
|
|
552
552
|
|
|
553
|
-
- 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), `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; 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). 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). 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.
|
|
553
|
+
- 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), `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; 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). 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.
|
|
554
554
|
- 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.
|
|
555
555
|
- `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.
|
|
556
556
|
- `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: {}`.
|