@moku-labs/game 0.15.107 → 0.15.109
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/system.d.mts +3 -3
- package/dist/app.d.mts +3 -3
- package/dist/app.mjs +1 -1
- package/dist/assets.d.mts +1 -1
- package/dist/{commands-DbfqO2Ux.d.mts → commands-FwzJ1me5.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-CLT2BTJ1.d.mts → define-DcYgxjey.d.mts} +2 -2
- package/dist/{headless-JxtMwRQh.d.mts → headless-BXfMlWv9.d.mts} +1 -1
- package/dist/{index-DMegir4-.d.mts → index-BgkCfDXF.d.mts} +17 -6
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +1 -1
- package/dist/inspect.d.mts +6 -6
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-Cp791TIi.d.mts → runtime-Dsgpuq_b.d.mts} +1 -1
- package/dist/{src-BEW0gDir.mjs → src-BK1vO-iC.mjs} +289 -204
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-BZ1TWYOl.d.mts → types-Bd3kGWhm.d.mts} +2 -2
- package/dist/{types-D7NamN-U.d.mts → types-BtZnTOC1.d.mts} +4 -4
- package/dist/{types-DC6Ifx57.d.mts → types-D1OK3UVk.d.mts} +2 -2
- package/dist/{types-DHD4RaXN.d.mts → types-DIJDyd0v.d.mts} +56 -7
- package/dist/{types-Db2VOFFW.d.mts → types-DwZio7SW.d.mts} +1 -1
- package/dist/{visual-v4VYekoe.d.mts → visual-B2c4NRo0.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/package.json +1 -1
package/dist/app/page.d.mts
CHANGED
package/dist/app/system.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Jr as PlayerStateProvider } from "../types-
|
|
2
|
-
import { Et as PlatformProvider } from "../index-
|
|
3
|
-
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-
|
|
1
|
+
import { Jr as PlayerStateProvider } from "../types-DIJDyd0v.mjs";
|
|
2
|
+
import { Et as PlatformProvider } from "../index-BgkCfDXF.mjs";
|
|
3
|
+
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-BtZnTOC1.mjs";
|
|
4
4
|
import { Back, Haptics, KeepAwake, Lifecycle, Store } from "@moku-labs/system";
|
|
5
5
|
|
|
6
6
|
//#region src/app/system.d.ts
|
package/dist/app.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ur as Json } from "./types-
|
|
2
|
-
import { J as StringTable } from "./types-
|
|
3
|
-
import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-
|
|
1
|
+
import { Ur as Json } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { J as StringTable } from "./types-DwZio7SW.mjs";
|
|
3
|
+
import { _ as SystemName, a as GameHandle, c as MemoryProvider, d as PlistValue, f as SaveKind, i as GameDefinition, l as PageAgent, m as ScreenSeams, n as GameApp, o as GamePluginConfigs, p as Scenario, r as GameConfig, s as HeadlessSeams, y as WithGameState } from "./types-BtZnTOC1.mjs";
|
|
4
4
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
5
5
|
|
|
6
6
|
//#region src/app/define.d.ts
|
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-
|
|
1
|
+
import { Gt as audioPlugin, Pt as effectsPlugin, Q as platformPlugin, i as screen, t as createApp, w as flattenFeatures } from "./src-BK1vO-iC.mjs";
|
|
2
2
|
import { t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
package/dist/assets.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as DebugSwitches, Ln as FlowState, Pn as Bookmark, Pr as Api, Qr as Snapshot, Z as Api$2, di as FrameRate, ei as StoreApi, hi as Time, kr as Api$3, pt as Captured, ri as Api$1, w as ScenesApi } from "./types-
|
|
2
|
-
import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-
|
|
3
|
-
import { R as InputApi } from "./types-
|
|
4
|
-
import { t as HeadlessApp } from "./headless-
|
|
5
|
-
import { i as ControlApp, r as Command } from "./types-
|
|
1
|
+
import { D as DebugSwitches, Ln as FlowState, Pn as Bookmark, Pr as Api, Qr as Snapshot, Z as Api$2, di as FrameRate, ei as StoreApi, hi as Time, kr as Api$3, pt as Captured, ri as Api$1, w as ScenesApi } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-DwZio7SW.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
5
|
+
import { i as ControlApp, r as Command } from "./types-D1OK3UVk.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/flow/doors/commands.d.ts
|
|
8
8
|
/**
|
package/dist/control.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-
|
|
3
|
-
import { t as commands } from "./commands-
|
|
4
|
-
import { t as defineCommand } from "./define-
|
|
1
|
+
import { t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
2
|
+
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-D1OK3UVk.mjs";
|
|
3
|
+
import { t as commands } from "./commands-FwzJ1me5.mjs";
|
|
4
|
+
import { t as defineCommand } from "./define-DcYgxjey.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import { l as Source, r as Command, s as InputSchema } from "./types-
|
|
1
|
+
import { t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
2
|
+
import { l as Source, r as Command, s as InputSchema } from "./types-D1OK3UVk.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/flow/doors/define.d.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bn as RouteStep, Ln as FlowState, Rn as JournalEntry, Ur as Json, Yn as Answer, li as Api, ni as RngState, pn as Api$1 } from "./types-
|
|
1
|
+
import { Bn as RouteStep, Ln as FlowState, Rn as JournalEntry, Ur as Json, Yn as Answer, li as Api, ni as RngState, pn as Api$1 } from "./types-DIJDyd0v.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/flow/headless.d.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $n as DescriptionNode, An as FeatureDescription, Ar as Config$9, C as SceneSpec, Cr as Narrowed, Dr as SystemFor, Er as SystemDefinition, Et as FrameRing, F as HudPartValue, Fn as DefineNode, G as SpriteOptions, Gn as EffectOptions, Gr as State$5, H as ShapeValue, Ir as Config$2, It as PassKind, J as TransformValue, K as SpriteValue, Kn as GuideOptions, L as NineSliceValue, Mn as FeatureTree, Mr as State$9, Or as TagType, Pr as Api$1, Q as Config$6, Rr as State$2, S as SceneDefinition, Sn as TextStylesOf, Sr as Mut, T as State$7, Tn as defineFlow, Tr as ResourceType, Tt as FrameRecord, Un as Descriptor, Ur as Json, Vn as SceneIdOf, Vr as Config$5, Wn as Effect, Wr as Root, Xn as Answered, Y as sprite, Z as Api$4, _ as AnySceneProjection, _i as Config$10, _n as GameTypes, _r as ComponentType, a as Config$1, ai as Events, ar as ProjectionMotion, bn as State$3, c as LoadBundles, ct as State$6, ei as StoreApi, er as Ease, f as ReadyBundles, fi as RateChange, gn as EmitterIdOf, hn as Config$3, hr as ComponentHandle, i as BundleSpec, ii as Config$4, ir as NumericFields, jn as FeaturePlugin, kr as Api$6, l as LoadReason, li as Api$5, m as Tier, mi as ThermalReading, mn as BundlesOf, o as DefineBundles, oi as PauseReason, or as ProjectionSpec, p as State$1, pi as State$8, pn as Api$2, qn as Hint, qr as Patch, r as BundleMap, ri as Api$3, si as State$4, sr as ReducedMotion, t as Api, ti as RngApi, u as LoadResult, ui as Config$8, v as Config$7, vi as Events$1, vn as HudKeysOf, vr as ComponentValue, vt as ViewportSize, w as ScenesApi, wr as QueryTerm, x as LayerMap, xn as TextFormatsOf, y as DefineScene, yi as Require, z as OverlayValue } from "./types-
|
|
2
|
-
import { $ as SfxDescriptor, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, Q as HapticKind, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, c as MusicDescriptor, ct as play, d as State$11, et as Step, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, m as Config$13, n as State$13, nt as defineAnimation, q as FramesValue, r as UiApi, s as Config$12, t as Config$14, w as GradeValue, x as DissolveValue, y as AuraValue, yt as OverlayApi, z as FilterValueOf } from "./types-
|
|
3
|
-
import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as WhenFlags, q as State$14, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-
|
|
1
|
+
import { $n as DescriptionNode, An as FeatureDescription, Ar as Config$9, C as SceneSpec, Cr as Narrowed, Dr as SystemFor, Er as SystemDefinition, Et as FrameRing, F as HudPartValue, Fn as DefineNode, G as SpriteOptions, Gn as EffectOptions, Gr as State$5, H as ShapeValue, Ir as Config$2, It as PassKind, J as TransformValue, K as SpriteValue, Kn as GuideOptions, L as NineSliceValue, Mn as FeatureTree, Mr as State$9, Or as TagType, Pr as Api$1, Q as Config$6, Rr as State$2, S as SceneDefinition, Sn as TextStylesOf, Sr as Mut, T as State$7, Tn as defineFlow, Tr as ResourceType, Tt as FrameRecord, Un as Descriptor, Ur as Json, Vn as SceneIdOf, Vr as Config$5, Wn as Effect, Wr as Root, Xn as Answered, Y as sprite, Z as Api$4, _ as AnySceneProjection, _i as Config$10, _n as GameTypes, _r as ComponentType, a as Config$1, ai as Events, ar as ProjectionMotion, bn as State$3, c as LoadBundles, ct as State$6, ei as StoreApi, er as Ease, f as ReadyBundles, fi as RateChange, gn as EmitterIdOf, hn as Config$3, hr as ComponentHandle, i as BundleSpec, ii as Config$4, ir as NumericFields, jn as FeaturePlugin, kr as Api$6, l as LoadReason, li as Api$5, m as Tier, mi as ThermalReading, mn as BundlesOf, o as DefineBundles, oi as PauseReason, or as ProjectionSpec, p as State$1, pi as State$8, pn as Api$2, qn as Hint, qr as Patch, r as BundleMap, ri as Api$3, si as State$4, sr as ReducedMotion, t as Api, ti as RngApi, u as LoadResult, ui as Config$8, v as Config$7, vi as Events$1, vn as HudKeysOf, vr as ComponentValue, vt as ViewportSize, w as ScenesApi, wr as QueryTerm, x as LayerMap, xn as TextFormatsOf, y as DefineScene, yi as Require, z as OverlayValue } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { $ as SfxDescriptor, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, Q as HapticKind, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, c as MusicDescriptor, ct as play, d as State$11, et as Step, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, m as Config$13, n as State$13, nt as defineAnimation, q as FramesValue, r as UiApi, s as Config$12, t as Config$14, w as GradeValue, x as DissolveValue, y as AuraValue, yt as OverlayApi, z as FilterValueOf } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { $ as ResolvedStyle, A as TextFormats, C as Point, E as TextBind, G as Message, H as Config$15, I as defineComponent, K as Part, L as Config$16, M as TextStyleInput, N as TextStyles, P as TextValue, Q as IsFlags, R as InputApi, T as TextApi, U as I18nApi, V as Argument, W as IntlKit, X as TypedTr, Y as TextKey, b as Config$17, et as Style, g as IntrinsicElementsFor, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, nt as WhenFlags, q as State$14, s as PopupComponent, v as BindField, w as State$16, x as CountdownValue, y as BindOptions, z as State$15 } from "./types-DwZio7SW.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
|
@@ -1256,15 +1256,16 @@ declare function ready(bundle: string | readonly string[]): Descriptor<boolean |
|
|
|
1256
1256
|
* `lift` is not among them does not compile — and throws here for a caller without types.
|
|
1257
1257
|
* `bundles` names bundles that depend on the committed state: the scene is mounted once those
|
|
1258
1258
|
* are in too. `leave` is what a live switch shows over the scene when it is left, merged over the
|
|
1259
|
-
* config's: `false` shows nothing
|
|
1259
|
+
* config's: `false` shows nothing; a function of the switch is called once per switch with `{ from, to }` and kept as it
|
|
1260
|
+
* is. `enter` sets the colour and the alpha of the veil of every live switch to the scene.
|
|
1260
1261
|
*
|
|
1261
1262
|
* @param id - Id of the scene. A node names it with `defineNode({ scene: id })`.
|
|
1262
1263
|
* @param scene - The bundle, the optional bundles of state, the layers, the projections, the
|
|
1263
1264
|
* optional music key, the optional `leave` and the optional `enter`.
|
|
1264
1265
|
* @returns The scene as frozen data, ready for the `scenes` key of a feature.
|
|
1265
1266
|
* @throws {Error} For an integer-like layer name, for a `layer` or `lift` that is not declared, for two HUD layers,
|
|
1266
|
-
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` or an `enter` of the
|
|
1267
|
-
* shape.
|
|
1267
|
+
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` value or an `enter` of the
|
|
1268
|
+
* wrong shape (the result of a `leave` function is checked at the switch and logged).
|
|
1268
1269
|
* @example
|
|
1269
1270
|
* ```ts
|
|
1270
1271
|
* // features/board/view/scene.ts of a game.
|
|
@@ -1305,6 +1306,16 @@ declare function ready(bundle: string | readonly string[]): Descriptor<boolean |
|
|
|
1305
1306
|
* projections: [],
|
|
1306
1307
|
* enter: { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
1307
1308
|
* }).enter; // { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
1309
|
+
*
|
|
1310
|
+
* // The memory dissolves into the ward under the veil alone; every other exit keeps the config's loader.
|
|
1311
|
+
* const memory = defineScene("memory", {
|
|
1312
|
+
* bundle: "memory",
|
|
1313
|
+
* layers: { room: {} },
|
|
1314
|
+
* projections: [],
|
|
1315
|
+
* leave: sw => (sw.to === "ward" ? { loader: false } : undefined)
|
|
1316
|
+
* });
|
|
1317
|
+
* typeof memory.leave; // "function", called with { from: "memory", to: "ward" } at the switch,
|
|
1318
|
+
* // and with { from: "memory", to: "memory" } when the memory stands live
|
|
1308
1319
|
* ```
|
|
1309
1320
|
*/
|
|
1310
1321
|
declare function defineScene<Layers extends LayerMap, const Projections extends readonly AnySceneProjection[], Player extends Json = Json, Session extends Json = Json>(id: string, scene: SceneSpec<Layers, Projections, string, string, Player, Session>): SceneDefinition;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as MonitorConfig, $n as DescriptionNode, $t as PerfSpikeLine, At as OverlayEventDetail, B as Parent, Bt as PerfChangeEntry, Cn as types_d_exports$6, Ct as FrameReadResult, Dn as slot, Dt as LongFrameEntry, E as types_d_exports$13, En as exit, Et as FrameRing, F as HudPartValue, Ft as PROBLEM_RULES, Gt as PerfEventName, Ht as PerfCounts, I as NineSlice, It as PassKind, Jt as PerfLogLine, Kr as types_d_exports$10, Kt as PerfGapLine, Lt as PassRecord, M as WhyEntry, Mt as PERF_CAUSES, N as Display, Nr as types_d_exports$17, Nt as PERF_GAP_BUCKETS, On as to, Ot as MONITOR_SECTIONS, P as HudPart, Pt as PERF_LOG_VERSION, Qt as PerfSampleLine, R as Overlay, Rt as PerfCause, St as FrameColumns, Tt as FrameRecord, U as Sprite, Ut as PerfDisplay, V as Shape, Vt as PerfCollectorLine, W as SpriteBlend, Wt as PerfEventLine, X as AdaptiveScale, Xt as PerfMarkLine, Y as sprite, Yt as PerfLongFrameLine, Zn as AnchorTarget, Zr as SaveUnreadableError, Zt as PerfMeasured, an as ProblemRule, bt as RetakeWhy, ci as types_d_exports$9, cn as ShaderWhat, cr as SceneSwitch, dn as CanvasRestart, dt as ShotsApi, en as PerfStartupLine, fn as DEMAND_REASONS, ft as ShotsConfig, g as types_d_exports$1, gi as types_d_exports$15, in as ProblemEventDetail, jt as OverlayWhat, kn as type, kt as MonitorSections, ln as WarmDetail, mt as MonitorCounts, nn as PerfThermalLine, on as SHADER_WHATS, q as Transform, qt as PerfHeaderLine, rn as PoolTrimDetail, sn as ShaderEventDetail, st as PoolTrim, tn as PerfTelemetryLine, un as CANVAS_RESTARTS, ut as types_d_exports$12, wn as contribution, wt as FrameReadout, xt as WhyLive, z as OverlayValue, zr as types_d_exports$3, zt as PerfChange } from "./types-
|
|
2
|
-
import { C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as HapticKind, S as FlashValue, T as RevealLineValue, Z as types_d_exports, _t as use, at as haptic, b as BloomValue, bt as types_d_exports$4, ct as play, dt as sfx, ft as spawn, gt as tween, ht as stopSfx, i as types_d_exports$16, it as frames, lt as sequence, mt as stagger, nt as defineAnimation, ot as mark, p as types_d_exports$2, pt as spawned, rt as external, st as parallel, tt as HAPTIC_KINDS, ut as set, v as types_d_exports$5, vt as wait, w as GradeValue, x as DissolveValue, y as AuraValue } from "./types-
|
|
3
|
-
import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-
|
|
4
|
-
import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-
|
|
1
|
+
import { $ as MonitorConfig, $n as DescriptionNode, $t as PerfSpikeLine, At as OverlayEventDetail, B as Parent, Bt as PerfChangeEntry, Cn as types_d_exports$6, Ct as FrameReadResult, Dn as slot, Dt as LongFrameEntry, E as types_d_exports$13, En as exit, Et as FrameRing, F as HudPartValue, Ft as PROBLEM_RULES, Gt as PerfEventName, Ht as PerfCounts, I as NineSlice, It as PassKind, Jt as PerfLogLine, Kr as types_d_exports$10, Kt as PerfGapLine, Lt as PassRecord, M as WhyEntry, Mt as PERF_CAUSES, N as Display, Nr as types_d_exports$17, Nt as PERF_GAP_BUCKETS, On as to, Ot as MONITOR_SECTIONS, P as HudPart, Pt as PERF_LOG_VERSION, Qt as PerfSampleLine, R as Overlay, Rt as PerfCause, St as FrameColumns, Tt as FrameRecord, U as Sprite, Ut as PerfDisplay, V as Shape, Vt as PerfCollectorLine, W as SpriteBlend, Wt as PerfEventLine, X as AdaptiveScale, Xt as PerfMarkLine, Y as sprite, Yt as PerfLongFrameLine, Zn as AnchorTarget, Zr as SaveUnreadableError, Zt as PerfMeasured, an as ProblemRule, bt as RetakeWhy, ci as types_d_exports$9, cn as ShaderWhat, cr as SceneSwitch, dn as CanvasRestart, dt as ShotsApi, en as PerfStartupLine, fn as DEMAND_REASONS, ft as ShotsConfig, g as types_d_exports$1, gi as types_d_exports$15, in as ProblemEventDetail, jt as OverlayWhat, kn as type, kt as MonitorSections, ln as WarmDetail, mt as MonitorCounts, nn as PerfThermalLine, on as SHADER_WHATS, q as Transform, qt as PerfHeaderLine, rn as PoolTrimDetail, sn as ShaderEventDetail, st as PoolTrim, tn as PerfTelemetryLine, un as CANVAS_RESTARTS, ut as types_d_exports$12, wn as contribution, wt as FrameReadout, xt as WhyLive, z as OverlayValue, zr as types_d_exports$3, zt as PerfChange } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as HapticKind, S as FlashValue, T as RevealLineValue, Z as types_d_exports, _t as use, at as haptic, b as BloomValue, bt as types_d_exports$4, ct as play, dt as sfx, ft as spawn, gt as tween, ht as stopSfx, i as types_d_exports$16, it as frames, lt as sequence, mt as stagger, nt as defineAnimation, ot as mark, p as types_d_exports$2, pt as spawned, rt as external, st as parallel, tt as HAPTIC_KINDS, ut as set, v as types_d_exports$5, vt as wait, w as GradeValue, x as DissolveValue, y as AuraValue } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { A as TextFormats, B as types_d_exports$8, D as TextFormat, F as types_d_exports$14, I as defineComponent, O as TextFormatAnswer, S as FormattedNumber, Z as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as TextRunStyle, k as TextFormatFunction, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-DwZio7SW.mjs";
|
|
4
|
+
import { $ as Traced, A as messageDuration, At as inputPlugin, B as Draggable, Bt as Countdown, C as Noise, Ct as rendererPlugin, D as defineStyle, Dt as types_d_exports$11, E as resolve, Et as PlatformProvider, F as Frames, Ft as clockPlugin, G as PointerOver, Gt as label, H as Held, Ht as bind, I as defineScene, It as audioPlugin, J as Swipeable, K as Pressable, L as defineBundles, Lt as assetsPlugin, M as defineMotion, Mt as flowPlugin, N as AnimPlayer, Nt as effectsPlugin, O as tr, Ot as modelPlugin, P as Animation, Pt as debugPlugin, Q as Traceable, R as load, Rt as animPlugin, S as Glow, St as scenesPlugin, T as music, Tt as BackResult, U as Hovered, Ut as defineTextFormats, V as DropTarget, Vt as Text, W as Pointer, Wt as defineTextStyles, X as Tappable, Y as TapValue, Z as Touchable, _ as defineFilter, _t as flattenFeatures, a as defineEmitter, at as Order, b as ColorMatrix, bt as timePlugin, c as Shine, ct as mut, d as Grade, dt as tag, et as PASS_KINDS, f as Fold, ft as defineEffect, g as Aura, gt as defineFeature, h as Bloom, ht as schedule, i as screen, it as Now, j as cubicBezier, jt as i18nPlugin, k as messageArgument, kt as lifecyclePlugin, l as RevealRound, lt as resource, m as Dissolve, mt as hint, n as createPlugin, nt as Exiting, o as Emitter, ot as Tree, p as Flash, pt as guide, q as Pressed, r as defineGame, rt as Layer, s as Vignette, st as component, t as createApp, tt as frameAt, u as RevealLine, ut as system, v as Alpha, vt as worldPlugin, w as Outline, wt as platformPlugin, x as Displacement, xt as textPlugin, y as Blur, yt as uiPlugin, z as ready, zt as projection } from "./index-BgkCfDXF.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, Aura, type AuraValue, type BackResult, type BindOptions, Bloom, type BloomValue, Blur, Box, CANVAS_RESTARTS, type CanvasRestart, types_d_exports$3 as Clock, ColorMatrix, Countdown, type CountdownValue, DEMAND_REASONS, types_d_exports$4 as Debug, DebugTrigger, type DescriptionNode, Displacement, Display, Dissolve, type DissolveValue, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, Flash, type FlashValue, types_d_exports$6 as Flow, Fold, type FoldValue, type FormattedNumber, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, Grade, type GradeValue, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, type RetakeWhy, RevealLine, type RevealLineValue, RevealRound, type RevealRoundValue, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Shine, type ShineValue, type ShotsApi, type ShotsConfig, Sprite, type SpriteBlend, Swipeable, type TapValue, Tappable, Text, type TextFormat, type TextFormatAnswer, type TextFormatFunction, type TextFormats, type TextRunStyle, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, Vignette, type VignetteValue, type WarmDetail, type WhyEntry, type WhyLive, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as timePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as clockPlugin, xt as Hovered, y as schedule, yn as lifecyclePlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-
|
|
1
|
+
import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as timePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as clockPlugin, xt as Hovered, y as schedule, yn as lifecyclePlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-BK1vO-iC.mjs";
|
|
2
2
|
import { $ as Parent, A as Countdown, F as defineTextFormats, I as defineTextStyles, J as Display, L as label, M as bind, S as popup, T as defineStyle, X as NineSlice, Y as HudPart, Z as Overlay, _ as LocalWrite, at as sprite, ct as Now, dt as component, et as Shape, ft as mut, gt as tag, h as DebugTrigger, j as Text, lt as Order, mt as system, nt as Transform, ot as Exiting, p as Box, pt as resource, st as Layer, tt as Sprite, ut as Tree, w as defineTokens, y as ScrollState } from "./visual-fyUJwUJf.mjs";
|
|
3
3
|
import { t as defineComponent } from "./component-DGg5DqKK.mjs";
|
|
4
4
|
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Aura, Bloom, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Dissolve, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, Flash, types_exports$6 as Flow, Fold, Frames, Glow, Grade, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, RevealLine, RevealRound, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Shine, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, Vignette, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextFormats, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Br as Api, In as FlowGraph, Qr as Snapshot, Rn as JournalEntry, Z as Api$2, br as EntitySnapshot, gr as ComponentSchema, h as Usage, ht as RenderStats, jr as Explained, kr as Api$1, lt as Under, t as Api$3, xr as FrameDiff, yn as Position } from "./types-
|
|
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-
|
|
4
|
-
import { t as HeadlessApp } from "./headless-
|
|
5
|
-
import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-
|
|
6
|
-
import { n as defineSource } from "./define-
|
|
1
|
+
import { Br as Api, In as FlowGraph, Qr as Snapshot, Rn as JournalEntry, Z as Api$2, br as EntitySnapshot, gr as ComponentSchema, h as Usage, ht as RenderStats, jr as Explained, kr as Api$1, lt as Under, t as Api$3, xr as FrameDiff, yn as Position } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-DwZio7SW.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
5
|
+
import { a as InputArguments, d as WatchApp, f as WatchInput, l as Source, o as InputOf, s as InputSchema, t as CheatEntry } from "./types-D1OK3UVk.mjs";
|
|
6
|
+
import { n as defineSource } from "./define-DcYgxjey.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/flow/doors/read.d.ts
|
|
9
9
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-Dsgpuq_b.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-Dsgpuq_b.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-DwZio7SW.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. */
|
|
@@ -39501,8 +39501,10 @@ function resolveTarget$1(actx, target, spawned) {
|
|
|
39501
39501
|
* through the `Parent` chain by `rootPoseOf` of `renderer`. The rest pose is what the picture holds
|
|
39502
39502
|
* whenever nothing animates the target; an entity nothing projects answers its current
|
|
39503
39503
|
* `Transform`. Inside `build` no spawn step has run yet, so `at(spawned(id))` answers the identity
|
|
39504
|
-
* pose and one
|
|
39505
|
-
*
|
|
39504
|
+
* pose and one log entry. A target nothing resolves gives the identity pose and one log entry, so a
|
|
39505
|
+
* choreography over a screen that is not there plays on instead of throwing. The entry is a warning,
|
|
39506
|
+
* and in a dev build an error: a flight that starts in the screen's corner is a bug of the game
|
|
39507
|
+
* (F163).
|
|
39506
39508
|
*
|
|
39507
39509
|
* @param actx - Domain context of the anim plugin.
|
|
39508
39510
|
* @param target - The projection key, the entity or the spawned id to read.
|
|
@@ -39514,7 +39516,10 @@ function restPoseOf(actx, target, spawned) {
|
|
|
39514
39516
|
const { ecs, projection } = actx.deps.world;
|
|
39515
39517
|
const own = entity === void 0 ? void 0 : projection.restOf(entity, Transform) ?? ecs.get(entity, Transform);
|
|
39516
39518
|
if (entity === void 0 || own === void 0) {
|
|
39517
|
-
|
|
39519
|
+
const isDev = typeof __MOKU_GAME_DEV__ !== "undefined" && __MOKU_GAME_DEV__;
|
|
39520
|
+
const data = typeof target === "number" ? { entity: target } : { ...target };
|
|
39521
|
+
if (isDev) actx.log.error("anim:target-missing", data);
|
|
39522
|
+
else actx.log.warn("anim:target-missing", data);
|
|
39518
39523
|
return {
|
|
39519
39524
|
x: 0,
|
|
39520
39525
|
y: 0,
|
|
@@ -45013,6 +45018,192 @@ function dropBuild(build) {
|
|
|
45013
45018
|
build.resolve();
|
|
45014
45019
|
}
|
|
45015
45020
|
//#endregion
|
|
45021
|
+
//#region src/plugins/scenes/leave-check.ts
|
|
45022
|
+
/** The largest colour, `0xffffff`. */
|
|
45023
|
+
const MAX_COLOR = 16777215;
|
|
45024
|
+
/**
|
|
45025
|
+
* Tells whether a value is a finite number of at least 0: a duration.
|
|
45026
|
+
*
|
|
45027
|
+
* @param value - The value.
|
|
45028
|
+
* @returns True for a finite number `>= 0`.
|
|
45029
|
+
* @example
|
|
45030
|
+
* ```ts
|
|
45031
|
+
* isDuration(-1); // false
|
|
45032
|
+
* ```
|
|
45033
|
+
*/
|
|
45034
|
+
function isDuration(value) {
|
|
45035
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
45036
|
+
}
|
|
45037
|
+
/**
|
|
45038
|
+
* Tells whether a value is an alpha: a number from 0 to 1.
|
|
45039
|
+
*
|
|
45040
|
+
* @param value - The value.
|
|
45041
|
+
* @returns True for a number in `[0, 1]`.
|
|
45042
|
+
* @example
|
|
45043
|
+
* ```ts
|
|
45044
|
+
* isAlpha(1.2); // false
|
|
45045
|
+
* ```
|
|
45046
|
+
*/
|
|
45047
|
+
function isAlpha(value) {
|
|
45048
|
+
return typeof value === "number" && value >= 0 && value <= 1;
|
|
45049
|
+
}
|
|
45050
|
+
/**
|
|
45051
|
+
* Tells whether a value is a colour `0xRRGGBB`: a whole number from 0 to `0xffffff`.
|
|
45052
|
+
*
|
|
45053
|
+
* @param value - The value.
|
|
45054
|
+
* @returns True for a colour.
|
|
45055
|
+
* @example
|
|
45056
|
+
* ```ts
|
|
45057
|
+
* isColor(0x0b1020); // true
|
|
45058
|
+
* ```
|
|
45059
|
+
*/
|
|
45060
|
+
function isColor$1(value) {
|
|
45061
|
+
return Number.isInteger(value) && typeof value === "number" && value >= 0 && value <= MAX_COLOR;
|
|
45062
|
+
}
|
|
45063
|
+
/**
|
|
45064
|
+
* Tells whether a value is a name: a string that is not empty.
|
|
45065
|
+
*
|
|
45066
|
+
* @param value - The value.
|
|
45067
|
+
* @returns True for a string with at least one character.
|
|
45068
|
+
* @example
|
|
45069
|
+
* ```ts
|
|
45070
|
+
* isName(""); // false
|
|
45071
|
+
* ```
|
|
45072
|
+
*/
|
|
45073
|
+
function isName(value) {
|
|
45074
|
+
return typeof value === "string" && value.length > 0;
|
|
45075
|
+
}
|
|
45076
|
+
/**
|
|
45077
|
+
* Tells whether a value is a plain object a field can be read from.
|
|
45078
|
+
*
|
|
45079
|
+
* @param value - The value.
|
|
45080
|
+
* @returns True for an object that is no array and not `null`.
|
|
45081
|
+
* @example
|
|
45082
|
+
* ```ts
|
|
45083
|
+
* isRecord([]); // false
|
|
45084
|
+
* ```
|
|
45085
|
+
*/
|
|
45086
|
+
function isRecord$2(value) {
|
|
45087
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45088
|
+
}
|
|
45089
|
+
/** The colour of a veil. */
|
|
45090
|
+
const COLOR_RULE = {
|
|
45091
|
+
ok: isColor$1,
|
|
45092
|
+
hint: "a colour from 0x000000 to 0xffffff"
|
|
45093
|
+
};
|
|
45094
|
+
/** The alpha of a veil. */
|
|
45095
|
+
const ALPHA_RULE = {
|
|
45096
|
+
ok: isAlpha,
|
|
45097
|
+
hint: "the alpha the veil fades in to, a number from 0 to 1"
|
|
45098
|
+
};
|
|
45099
|
+
/** The fields of a veil. */
|
|
45100
|
+
const COVER_RULES = Object.freeze({
|
|
45101
|
+
color: COLOR_RULE,
|
|
45102
|
+
alpha: ALPHA_RULE,
|
|
45103
|
+
inMs: {
|
|
45104
|
+
ok: isDuration,
|
|
45105
|
+
hint: "the milliseconds of the fade-in, 0 or more"
|
|
45106
|
+
},
|
|
45107
|
+
outMs: {
|
|
45108
|
+
ok: isDuration,
|
|
45109
|
+
hint: "the milliseconds of the fade-out, 0 or more"
|
|
45110
|
+
}
|
|
45111
|
+
});
|
|
45112
|
+
/** The fields of the veil a scene being entered sets: its look, never its times. */
|
|
45113
|
+
const ENTER_COVER_RULES = Object.freeze({
|
|
45114
|
+
color: COLOR_RULE,
|
|
45115
|
+
alpha: ALPHA_RULE
|
|
45116
|
+
});
|
|
45117
|
+
/** The fields of a loader. */
|
|
45118
|
+
const LOADER_RULES = Object.freeze({
|
|
45119
|
+
afterMs: {
|
|
45120
|
+
ok: isDuration,
|
|
45121
|
+
hint: "the milliseconds the loader waits for, 0 or more"
|
|
45122
|
+
},
|
|
45123
|
+
holdMs: {
|
|
45124
|
+
ok: isDuration,
|
|
45125
|
+
hint: "the milliseconds the swap waits for, 0 or more"
|
|
45126
|
+
},
|
|
45127
|
+
texture: {
|
|
45128
|
+
ok: isName,
|
|
45129
|
+
hint: "an asset key such as \"ui.loader.ring\""
|
|
45130
|
+
},
|
|
45131
|
+
projection: {
|
|
45132
|
+
ok: isName,
|
|
45133
|
+
hint: "the name of a registered projection such as \"loading\""
|
|
45134
|
+
}
|
|
45135
|
+
});
|
|
45136
|
+
/**
|
|
45137
|
+
* Builds the error of a field of the wrong shape.
|
|
45138
|
+
*
|
|
45139
|
+
* @param where - Where the part was written.
|
|
45140
|
+
* @param value - What the field holds.
|
|
45141
|
+
* @param hint - What to give instead.
|
|
45142
|
+
* @returns The error, in the engine's two-line format.
|
|
45143
|
+
* @example
|
|
45144
|
+
* ```ts
|
|
45145
|
+
* wrong("scenes.leave.cover.alpha", 2, "a number from 0 to 1").message;
|
|
45146
|
+
* // '[game] scenes.leave.cover.alpha is 2.\n Give a number from 0 to 1.'
|
|
45147
|
+
* ```
|
|
45148
|
+
*/
|
|
45149
|
+
function wrong(where, value, hint) {
|
|
45150
|
+
return /* @__PURE__ */ new Error(`[game] ${where} is ${String(value)}.\n Give ${hint}.`);
|
|
45151
|
+
}
|
|
45152
|
+
/**
|
|
45153
|
+
* Checks one part of a `leave`: nothing, `false`, or an object whose every field it knows has the right shape.
|
|
45154
|
+
*
|
|
45155
|
+
* @param where - Where the part was written, `scenes.leave.cover`.
|
|
45156
|
+
* @param part - What the part holds.
|
|
45157
|
+
* @param rules - The fields of the part.
|
|
45158
|
+
* @throws {Error} For a part that is neither `false` nor an object, and for the first field of the wrong shape.
|
|
45159
|
+
*/
|
|
45160
|
+
function checkPart(where, part, rules) {
|
|
45161
|
+
if (part === void 0 || part === false) return;
|
|
45162
|
+
if (!isRecord$2(part)) throw wrong(where, part, "an object of its fields, or false");
|
|
45163
|
+
for (const [field, rule] of Object.entries(rules)) {
|
|
45164
|
+
const value = part[field];
|
|
45165
|
+
if (value !== void 0 && !rule.ok(value)) throw wrong(`${where}.${field}`, value, rule.hint);
|
|
45166
|
+
}
|
|
45167
|
+
}
|
|
45168
|
+
/**
|
|
45169
|
+
* Checks a `leave` a game wrote: nothing, `false`, or an object whose `cover` and `loader` are each nothing, `false`
|
|
45170
|
+
* or an object of the right fields: a colour, an alpha from 0 to 1, durations of 0 or more, and names that are not
|
|
45171
|
+
* empty.
|
|
45172
|
+
*
|
|
45173
|
+
* @param where - Where it was written, for the message: `scenes.leave`, or `Scene "board": leave`.
|
|
45174
|
+
* @param leave - What was written.
|
|
45175
|
+
* @throws {Error} For the first part or field of the wrong shape.
|
|
45176
|
+
* @example
|
|
45177
|
+
* ```ts
|
|
45178
|
+
* checkLeave("scenes.leave", { cover: { alpha: 2 } });
|
|
45179
|
+
* // throws '[game] scenes.leave.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45180
|
+
* ```
|
|
45181
|
+
*/
|
|
45182
|
+
function checkLeave(where, leave) {
|
|
45183
|
+
if (leave === void 0 || leave === false) return;
|
|
45184
|
+
if (!isRecord$2(leave)) throw wrong(where, leave, "{ cover, loader } or false");
|
|
45185
|
+
checkPart(`${where}.cover`, leave.cover, COVER_RULES);
|
|
45186
|
+
checkPart(`${where}.loader`, leave.loader, LOADER_RULES);
|
|
45187
|
+
}
|
|
45188
|
+
/**
|
|
45189
|
+
* Checks a scene's `enter`: nothing, or an object whose `cover` is nothing or an object of a colour and an alpha from 0
|
|
45190
|
+
* to 1, by the rules of `leave.cover`.
|
|
45191
|
+
*
|
|
45192
|
+
* @param where - Where it was written, for the message: `Scene "night": enter`.
|
|
45193
|
+
* @param enter - What was written.
|
|
45194
|
+
* @throws {Error} For an `enter` that is no object, and for the first field of the wrong shape.
|
|
45195
|
+
* @example
|
|
45196
|
+
* ```ts
|
|
45197
|
+
* checkEnter('Scene "night": enter', { cover: { alpha: 2 } });
|
|
45198
|
+
* // throws '[game] Scene "night": enter.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45199
|
+
* ```
|
|
45200
|
+
*/
|
|
45201
|
+
function checkEnter(where, enter) {
|
|
45202
|
+
if (enter === void 0) return;
|
|
45203
|
+
if (!isRecord$2(enter)) throw wrong(where, enter, "{ cover }");
|
|
45204
|
+
checkPart(`${where}.cover`, enter.cover, ENTER_COVER_RULES);
|
|
45205
|
+
}
|
|
45206
|
+
//#endregion
|
|
45016
45207
|
//#region src/plugins/scenes/loader.ts
|
|
45017
45208
|
/**
|
|
45018
45209
|
* Does nothing: the remover of a fade before its frame callback is registered.
|
|
@@ -45460,6 +45651,35 @@ function leaveOf(config, scene) {
|
|
|
45460
45651
|
};
|
|
45461
45652
|
}
|
|
45462
45653
|
/**
|
|
45654
|
+
* The `leave` of a scene for one switch: a value as it is; a function called with a new frozen `{ from, to }`, its
|
|
45655
|
+
* result checked like a value the scene wrote. A function that throws, or a result of the wrong shape, is logged and
|
|
45656
|
+
* the scene is read as having written nothing (the config's look shows): a game's function never ends a switch.
|
|
45657
|
+
*
|
|
45658
|
+
* @param ctx - Domain context of the plugin.
|
|
45659
|
+
* @param scene - The scene being left.
|
|
45660
|
+
* @param to - The scene being switched to; the scene itself while it stands and holds its loader.
|
|
45661
|
+
* @returns What the scene writes for this switch, or `undefined`.
|
|
45662
|
+
*/
|
|
45663
|
+
function sceneLeaveOf(ctx, scene, to) {
|
|
45664
|
+
const leave = scene.leave;
|
|
45665
|
+
if (typeof leave !== "function") return leave;
|
|
45666
|
+
try {
|
|
45667
|
+
const result = leave(Object.freeze({
|
|
45668
|
+
from: scene.id,
|
|
45669
|
+
to
|
|
45670
|
+
}));
|
|
45671
|
+
checkLeave(`Scene "${scene.id}": leave`, result);
|
|
45672
|
+
return result;
|
|
45673
|
+
} catch (error) {
|
|
45674
|
+
ctx.log.error("scenes:leave-failed", {
|
|
45675
|
+
scene: scene.id,
|
|
45676
|
+
to,
|
|
45677
|
+
error
|
|
45678
|
+
});
|
|
45679
|
+
return;
|
|
45680
|
+
}
|
|
45681
|
+
}
|
|
45682
|
+
/**
|
|
45463
45683
|
* The loader projection a scene leaves with: the one its `leave` over `config.leave` names, when the loader is on.
|
|
45464
45684
|
*
|
|
45465
45685
|
* @param config - `config.leave`.
|
|
@@ -45547,7 +45767,9 @@ function stampHold(ctx, leaving, loader) {
|
|
|
45547
45767
|
* decides, and the scene being entered sets the veil's colour and alpha (`enter.cover`). A loader projection is fed
|
|
45548
45768
|
* the switch from now on, and shown or mounted only once its loader is due. A loader with a floor stamps it here, on the
|
|
45549
45769
|
* look's clock and frame counter: the swap of `build.ts` waits for it. An abort of the node drops both at once, from its
|
|
45550
|
-
* listener. The look keeps the node's signal, so the `scene` stage of the same node takes it over.
|
|
45770
|
+
* listener. The look keeps the node's signal, so the `scene` stage of the same node takes it over. A switch that shows
|
|
45771
|
+
* no look is recorded as declined for that signal and scene (`leaveDeclined`), so the stage after `begin` does not ask
|
|
45772
|
+
* the scene's `leave` function again.
|
|
45551
45773
|
*
|
|
45552
45774
|
* @param ctx - Domain context of the plugin.
|
|
45553
45775
|
* @param scene - The scene being switched to.
|
|
@@ -45557,8 +45779,14 @@ function stampHold(ctx, leaving, loader) {
|
|
|
45557
45779
|
function startLeave(ctx, scene, run) {
|
|
45558
45780
|
const from = leftScene(ctx, run);
|
|
45559
45781
|
if (from === void 0) return void 0;
|
|
45560
|
-
const leave = leaveOf(ctx.config.leave, from.
|
|
45561
|
-
if (leave === void 0)
|
|
45782
|
+
const leave = leaveOf(ctx.config.leave, sceneLeaveOf(ctx, from, scene.id));
|
|
45783
|
+
if (leave === void 0) {
|
|
45784
|
+
ctx.state.declined = {
|
|
45785
|
+
signal: run.signal,
|
|
45786
|
+
to: scene.id
|
|
45787
|
+
};
|
|
45788
|
+
return;
|
|
45789
|
+
}
|
|
45562
45790
|
const cover = enteredCover(leave.cover, scene.enter?.cover);
|
|
45563
45791
|
const listening = new AbortController();
|
|
45564
45792
|
const leaving = {
|
|
@@ -45597,6 +45825,19 @@ function ownLeave(ctx, run) {
|
|
|
45597
45825
|
return leaving?.signal === run.signal ? leaving : void 0;
|
|
45598
45826
|
}
|
|
45599
45827
|
/**
|
|
45828
|
+
* Tells whether the `begin` stage of this node already found that the switch to the target shows no look. A target that
|
|
45829
|
+
* changed between the two stages is not declined: its own switch is asked once.
|
|
45830
|
+
*
|
|
45831
|
+
* @param ctx - Domain context of the plugin.
|
|
45832
|
+
* @param run - The runner's mode and signal of the node.
|
|
45833
|
+
* @param target - The scene the switch mounts.
|
|
45834
|
+
* @returns True when `begin` started no look for this node and this scene.
|
|
45835
|
+
*/
|
|
45836
|
+
function leaveDeclined(ctx, run, target) {
|
|
45837
|
+
const declined = ctx.state.declined;
|
|
45838
|
+
return declined?.signal === run.signal && declined.to === target;
|
|
45839
|
+
}
|
|
45840
|
+
/**
|
|
45600
45841
|
* The look the `begin` stage of this node started for the scene the `scene` stage switches to. One it started for
|
|
45601
45842
|
* another scene (the expected scene changed between the two stages) is dropped: its loader was resolved against that
|
|
45602
45843
|
* scene, so the switch shows its own.
|
|
@@ -45621,6 +45862,7 @@ function leaveFor(ctx, run, target) {
|
|
|
45621
45862
|
*/
|
|
45622
45863
|
function dropLeftOver(ctx, run) {
|
|
45623
45864
|
const leaving = ctx.state.leaving;
|
|
45865
|
+
delete ctx.state.declined;
|
|
45624
45866
|
if (leaving !== void 0 && leaving.signal !== run.signal) endLeave(ctx, leaving, "drop");
|
|
45625
45867
|
}
|
|
45626
45868
|
/**
|
|
@@ -45656,6 +45898,7 @@ function endLeave(ctx, leaving, how) {
|
|
|
45656
45898
|
* @param state - The plugin state.
|
|
45657
45899
|
*/
|
|
45658
45900
|
function forgetLeave(state) {
|
|
45901
|
+
delete state.declined;
|
|
45659
45902
|
const leaving = state.leaving;
|
|
45660
45903
|
if (leaving === void 0) return;
|
|
45661
45904
|
leaving.done = true;
|
|
@@ -45663,192 +45906,6 @@ function forgetLeave(state) {
|
|
|
45663
45906
|
delete state.leaving;
|
|
45664
45907
|
}
|
|
45665
45908
|
//#endregion
|
|
45666
|
-
//#region src/plugins/scenes/leave-check.ts
|
|
45667
|
-
/** The largest colour, `0xffffff`. */
|
|
45668
|
-
const MAX_COLOR = 16777215;
|
|
45669
|
-
/**
|
|
45670
|
-
* Tells whether a value is a finite number of at least 0: a duration.
|
|
45671
|
-
*
|
|
45672
|
-
* @param value - The value.
|
|
45673
|
-
* @returns True for a finite number `>= 0`.
|
|
45674
|
-
* @example
|
|
45675
|
-
* ```ts
|
|
45676
|
-
* isDuration(-1); // false
|
|
45677
|
-
* ```
|
|
45678
|
-
*/
|
|
45679
|
-
function isDuration(value) {
|
|
45680
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
45681
|
-
}
|
|
45682
|
-
/**
|
|
45683
|
-
* Tells whether a value is an alpha: a number from 0 to 1.
|
|
45684
|
-
*
|
|
45685
|
-
* @param value - The value.
|
|
45686
|
-
* @returns True for a number in `[0, 1]`.
|
|
45687
|
-
* @example
|
|
45688
|
-
* ```ts
|
|
45689
|
-
* isAlpha(1.2); // false
|
|
45690
|
-
* ```
|
|
45691
|
-
*/
|
|
45692
|
-
function isAlpha(value) {
|
|
45693
|
-
return typeof value === "number" && value >= 0 && value <= 1;
|
|
45694
|
-
}
|
|
45695
|
-
/**
|
|
45696
|
-
* Tells whether a value is a colour `0xRRGGBB`: a whole number from 0 to `0xffffff`.
|
|
45697
|
-
*
|
|
45698
|
-
* @param value - The value.
|
|
45699
|
-
* @returns True for a colour.
|
|
45700
|
-
* @example
|
|
45701
|
-
* ```ts
|
|
45702
|
-
* isColor(0x0b1020); // true
|
|
45703
|
-
* ```
|
|
45704
|
-
*/
|
|
45705
|
-
function isColor$1(value) {
|
|
45706
|
-
return Number.isInteger(value) && typeof value === "number" && value >= 0 && value <= MAX_COLOR;
|
|
45707
|
-
}
|
|
45708
|
-
/**
|
|
45709
|
-
* Tells whether a value is a name: a string that is not empty.
|
|
45710
|
-
*
|
|
45711
|
-
* @param value - The value.
|
|
45712
|
-
* @returns True for a string with at least one character.
|
|
45713
|
-
* @example
|
|
45714
|
-
* ```ts
|
|
45715
|
-
* isName(""); // false
|
|
45716
|
-
* ```
|
|
45717
|
-
*/
|
|
45718
|
-
function isName(value) {
|
|
45719
|
-
return typeof value === "string" && value.length > 0;
|
|
45720
|
-
}
|
|
45721
|
-
/**
|
|
45722
|
-
* Tells whether a value is a plain object a field can be read from.
|
|
45723
|
-
*
|
|
45724
|
-
* @param value - The value.
|
|
45725
|
-
* @returns True for an object that is no array and not `null`.
|
|
45726
|
-
* @example
|
|
45727
|
-
* ```ts
|
|
45728
|
-
* isRecord([]); // false
|
|
45729
|
-
* ```
|
|
45730
|
-
*/
|
|
45731
|
-
function isRecord$2(value) {
|
|
45732
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45733
|
-
}
|
|
45734
|
-
/** The colour of a veil. */
|
|
45735
|
-
const COLOR_RULE = {
|
|
45736
|
-
ok: isColor$1,
|
|
45737
|
-
hint: "a colour from 0x000000 to 0xffffff"
|
|
45738
|
-
};
|
|
45739
|
-
/** The alpha of a veil. */
|
|
45740
|
-
const ALPHA_RULE = {
|
|
45741
|
-
ok: isAlpha,
|
|
45742
|
-
hint: "the alpha the veil fades in to, a number from 0 to 1"
|
|
45743
|
-
};
|
|
45744
|
-
/** The fields of a veil. */
|
|
45745
|
-
const COVER_RULES = Object.freeze({
|
|
45746
|
-
color: COLOR_RULE,
|
|
45747
|
-
alpha: ALPHA_RULE,
|
|
45748
|
-
inMs: {
|
|
45749
|
-
ok: isDuration,
|
|
45750
|
-
hint: "the milliseconds of the fade-in, 0 or more"
|
|
45751
|
-
},
|
|
45752
|
-
outMs: {
|
|
45753
|
-
ok: isDuration,
|
|
45754
|
-
hint: "the milliseconds of the fade-out, 0 or more"
|
|
45755
|
-
}
|
|
45756
|
-
});
|
|
45757
|
-
/** The fields of the veil a scene being entered sets: its look, never its times. */
|
|
45758
|
-
const ENTER_COVER_RULES = Object.freeze({
|
|
45759
|
-
color: COLOR_RULE,
|
|
45760
|
-
alpha: ALPHA_RULE
|
|
45761
|
-
});
|
|
45762
|
-
/** The fields of a loader. */
|
|
45763
|
-
const LOADER_RULES = Object.freeze({
|
|
45764
|
-
afterMs: {
|
|
45765
|
-
ok: isDuration,
|
|
45766
|
-
hint: "the milliseconds the loader waits for, 0 or more"
|
|
45767
|
-
},
|
|
45768
|
-
holdMs: {
|
|
45769
|
-
ok: isDuration,
|
|
45770
|
-
hint: "the milliseconds the swap waits for, 0 or more"
|
|
45771
|
-
},
|
|
45772
|
-
texture: {
|
|
45773
|
-
ok: isName,
|
|
45774
|
-
hint: "an asset key such as \"ui.loader.ring\""
|
|
45775
|
-
},
|
|
45776
|
-
projection: {
|
|
45777
|
-
ok: isName,
|
|
45778
|
-
hint: "the name of a registered projection such as \"loading\""
|
|
45779
|
-
}
|
|
45780
|
-
});
|
|
45781
|
-
/**
|
|
45782
|
-
* Builds the error of a field of the wrong shape.
|
|
45783
|
-
*
|
|
45784
|
-
* @param where - Where the part was written.
|
|
45785
|
-
* @param value - What the field holds.
|
|
45786
|
-
* @param hint - What to give instead.
|
|
45787
|
-
* @returns The error, in the engine's two-line format.
|
|
45788
|
-
* @example
|
|
45789
|
-
* ```ts
|
|
45790
|
-
* wrong("scenes.leave.cover.alpha", 2, "a number from 0 to 1").message;
|
|
45791
|
-
* // '[game] scenes.leave.cover.alpha is 2.\n Give a number from 0 to 1.'
|
|
45792
|
-
* ```
|
|
45793
|
-
*/
|
|
45794
|
-
function wrong(where, value, hint) {
|
|
45795
|
-
return /* @__PURE__ */ new Error(`[game] ${where} is ${String(value)}.\n Give ${hint}.`);
|
|
45796
|
-
}
|
|
45797
|
-
/**
|
|
45798
|
-
* Checks one part of a `leave`: nothing, `false`, or an object whose every field it knows has the right shape.
|
|
45799
|
-
*
|
|
45800
|
-
* @param where - Where the part was written, `scenes.leave.cover`.
|
|
45801
|
-
* @param part - What the part holds.
|
|
45802
|
-
* @param rules - The fields of the part.
|
|
45803
|
-
* @throws {Error} For a part that is neither `false` nor an object, and for the first field of the wrong shape.
|
|
45804
|
-
*/
|
|
45805
|
-
function checkPart(where, part, rules) {
|
|
45806
|
-
if (part === void 0 || part === false) return;
|
|
45807
|
-
if (!isRecord$2(part)) throw wrong(where, part, "an object of its fields, or false");
|
|
45808
|
-
for (const [field, rule] of Object.entries(rules)) {
|
|
45809
|
-
const value = part[field];
|
|
45810
|
-
if (value !== void 0 && !rule.ok(value)) throw wrong(`${where}.${field}`, value, rule.hint);
|
|
45811
|
-
}
|
|
45812
|
-
}
|
|
45813
|
-
/**
|
|
45814
|
-
* Checks a `leave` a game wrote: nothing, `false`, or an object whose `cover` and `loader` are each nothing, `false`
|
|
45815
|
-
* or an object of the right fields: a colour, an alpha from 0 to 1, durations of 0 or more, and names that are not
|
|
45816
|
-
* empty.
|
|
45817
|
-
*
|
|
45818
|
-
* @param where - Where it was written, for the message: `scenes.leave`, or `Scene "board": leave`.
|
|
45819
|
-
* @param leave - What was written.
|
|
45820
|
-
* @throws {Error} For the first part or field of the wrong shape.
|
|
45821
|
-
* @example
|
|
45822
|
-
* ```ts
|
|
45823
|
-
* checkLeave("scenes.leave", { cover: { alpha: 2 } });
|
|
45824
|
-
* // throws '[game] scenes.leave.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45825
|
-
* ```
|
|
45826
|
-
*/
|
|
45827
|
-
function checkLeave(where, leave) {
|
|
45828
|
-
if (leave === void 0 || leave === false) return;
|
|
45829
|
-
if (!isRecord$2(leave)) throw wrong(where, leave, "{ cover, loader } or false");
|
|
45830
|
-
checkPart(`${where}.cover`, leave.cover, COVER_RULES);
|
|
45831
|
-
checkPart(`${where}.loader`, leave.loader, LOADER_RULES);
|
|
45832
|
-
}
|
|
45833
|
-
/**
|
|
45834
|
-
* Checks a scene's `enter`: nothing, or an object whose `cover` is nothing or an object of a colour and an alpha from 0
|
|
45835
|
-
* to 1, by the rules of `leave.cover`.
|
|
45836
|
-
*
|
|
45837
|
-
* @param where - Where it was written, for the message: `Scene "night": enter`.
|
|
45838
|
-
* @param enter - What was written.
|
|
45839
|
-
* @throws {Error} For an `enter` that is no object, and for the first field of the wrong shape.
|
|
45840
|
-
* @example
|
|
45841
|
-
* ```ts
|
|
45842
|
-
* checkEnter('Scene "night": enter', { cover: { alpha: 2 } });
|
|
45843
|
-
* // throws '[game] Scene "night": enter.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45844
|
-
* ```
|
|
45845
|
-
*/
|
|
45846
|
-
function checkEnter(where, enter) {
|
|
45847
|
-
if (enter === void 0) return;
|
|
45848
|
-
if (!isRecord$2(enter)) throw wrong(where, enter, "{ cover }");
|
|
45849
|
-
checkPart(`${where}.cover`, enter.cover, ENTER_COVER_RULES);
|
|
45850
|
-
}
|
|
45851
|
-
//#endregion
|
|
45852
45909
|
//#region src/plugins/scenes/switch.ts
|
|
45853
45910
|
/**
|
|
45854
45911
|
* A promise that resolves when the node was aborted. Already aborted resolves at once.
|
|
@@ -46067,7 +46124,7 @@ async function loadAndStand(ctx, scene, named, run) {
|
|
|
46067
46124
|
* @param run - The runner's mode and signal.
|
|
46068
46125
|
*/
|
|
46069
46126
|
function standLoader(ctx, scene, run) {
|
|
46070
|
-
holdLoader(ctx, scene, buildsAside(ctx, run) ? loaderProjectionOf(ctx.config.leave, scene.
|
|
46127
|
+
holdLoader(ctx, scene, buildsAside(ctx, run) ? loaderProjectionOf(ctx.config.leave, sceneLeaveOf(ctx, scene, scene.id)) : void 0);
|
|
46071
46128
|
}
|
|
46072
46129
|
/**
|
|
46073
46130
|
* Holds the loader of the scene that still stands after a switch that ended without its swap: the drop unmounted the
|
|
@@ -46104,7 +46161,7 @@ async function switchTo(ctx, target, run) {
|
|
|
46104
46161
|
let leaving = leaveFor(ctx, run, scene.id);
|
|
46105
46162
|
try {
|
|
46106
46163
|
const named = namedBundles(scene, committedState(ctx));
|
|
46107
|
-
leaving
|
|
46164
|
+
if (leaving === void 0 && !leaveDeclined(ctx, run, scene.id)) leaving = startLeave(ctx, scene, run);
|
|
46108
46165
|
await loadAndStand(ctx, scene, named, run);
|
|
46109
46166
|
} catch (error) {
|
|
46110
46167
|
endLeave(ctx, leaving, "drop");
|
|
@@ -71046,6 +71103,24 @@ function namedSize(element, bind, source, width) {
|
|
|
71046
71103
|
return answer === void 0 ? void 0 : source.measure(answer.text, answer.style, width);
|
|
71047
71104
|
}
|
|
71048
71105
|
/**
|
|
71106
|
+
* The size of a text with no bind: the content and the style its `Text` holds, so a write of a
|
|
71107
|
+
* system outside the projection is measured too (F162). Before the entity carries its `Text`, for
|
|
71108
|
+
* the first solve, the content and the style the markup wrote.
|
|
71109
|
+
*
|
|
71110
|
+
* @param element - The text element.
|
|
71111
|
+
* @param source - What it is measured through.
|
|
71112
|
+
* @param width - The width Yoga offers, or `undefined` when it bounds none.
|
|
71113
|
+
* @returns The size before it is rounded.
|
|
71114
|
+
*/
|
|
71115
|
+
function contentSize(element, source, width) {
|
|
71116
|
+
const content = source.content(element.entity);
|
|
71117
|
+
if (content === void 0) {
|
|
71118
|
+
const written = contentOf$1(element);
|
|
71119
|
+
return source.measure(written.content, written.style, width);
|
|
71120
|
+
}
|
|
71121
|
+
return source.measure(content, source.style(element.entity) ?? styleKeyOf(element), width);
|
|
71122
|
+
}
|
|
71123
|
+
/**
|
|
71049
71124
|
* The size a text measures to: a bound one by what it shows, any other by its content.
|
|
71050
71125
|
*
|
|
71051
71126
|
* @param element - The text element.
|
|
@@ -71055,10 +71130,7 @@ function namedSize(element, bind, source, width) {
|
|
|
71055
71130
|
*/
|
|
71056
71131
|
function textSize(element, source, width) {
|
|
71057
71132
|
const bind = bindOf(element);
|
|
71058
|
-
if (bind === void 0)
|
|
71059
|
-
const { content, style } = contentOf$1(element);
|
|
71060
|
-
return source.measure(content, style, width);
|
|
71061
|
-
}
|
|
71133
|
+
if (bind === void 0) return contentSize(element, source, width);
|
|
71062
71134
|
return (isTextFormat(bind.format) ? void 0 : namedSize(element, bind, source, width)) ?? source.measure(boundShown(element, bind, source), styleKeyOf(element), width);
|
|
71063
71135
|
}
|
|
71064
71136
|
/**
|
|
@@ -72113,8 +72185,9 @@ async function loadYogaModule() {
|
|
|
72113
72185
|
//#endregion
|
|
72114
72186
|
//#region src/plugins/ui/layout/api.ts
|
|
72115
72187
|
/**
|
|
72116
|
-
* What the text elements are measured through: `text.measure`, the
|
|
72117
|
-
*
|
|
72188
|
+
* What the text elements are measured through: `text.measure`, the content of an entity's `Text`,
|
|
72189
|
+
* the string `text` resolved for it and its style, what a format of the game answers, and the
|
|
72190
|
+
* duration words of `i18n`.
|
|
72118
72191
|
*
|
|
72119
72192
|
* @param ctx - Domain context of the ui plugin.
|
|
72120
72193
|
* @returns The source every measure function reads.
|
|
@@ -72122,6 +72195,7 @@ async function loadYogaModule() {
|
|
|
72122
72195
|
function textSourceOf(ctx) {
|
|
72123
72196
|
return {
|
|
72124
72197
|
measure: (content, style, width) => ctx.deps.text.measure(content, style, width),
|
|
72198
|
+
content: (entity) => ctx.deps.world.ecs.get(entity, Text)?.content,
|
|
72125
72199
|
resolved: (entity) => ctx.deps.world.ecs.get(entity, Text)?.resolved,
|
|
72126
72200
|
style: (entity) => ctx.deps.world.ecs.get(entity, Text)?.style,
|
|
72127
72201
|
formatted: (name, value) => ctx.deps.text.formatted(name, value),
|
|
@@ -75123,15 +75197,16 @@ function namesOf(id, layers, projections) {
|
|
|
75123
75197
|
* `lift` is not among them does not compile — and throws here for a caller without types.
|
|
75124
75198
|
* `bundles` names bundles that depend on the committed state: the scene is mounted once those
|
|
75125
75199
|
* are in too. `leave` is what a live switch shows over the scene when it is left, merged over the
|
|
75126
|
-
* config's: `false` shows nothing
|
|
75200
|
+
* config's: `false` shows nothing; a function of the switch is called once per switch with `{ from, to }` and kept as it
|
|
75201
|
+
* is. `enter` sets the colour and the alpha of the veil of every live switch to the scene.
|
|
75127
75202
|
*
|
|
75128
75203
|
* @param id - Id of the scene. A node names it with `defineNode({ scene: id })`.
|
|
75129
75204
|
* @param scene - The bundle, the optional bundles of state, the layers, the projections, the
|
|
75130
75205
|
* optional music key, the optional `leave` and the optional `enter`.
|
|
75131
75206
|
* @returns The scene as frozen data, ready for the `scenes` key of a feature.
|
|
75132
75207
|
* @throws {Error} For an integer-like layer name, for a `layer` or `lift` that is not declared, for two HUD layers,
|
|
75133
|
-
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` or an `enter` of the
|
|
75134
|
-
* shape.
|
|
75208
|
+
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` value or an `enter` of the
|
|
75209
|
+
* wrong shape (the result of a `leave` function is checked at the switch and logged).
|
|
75135
75210
|
* @example
|
|
75136
75211
|
* ```ts
|
|
75137
75212
|
* // features/board/view/scene.ts of a game.
|
|
@@ -75172,12 +75247,22 @@ function namesOf(id, layers, projections) {
|
|
|
75172
75247
|
* projections: [],
|
|
75173
75248
|
* enter: { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
75174
75249
|
* }).enter; // { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
75250
|
+
*
|
|
75251
|
+
* // The memory dissolves into the ward under the veil alone; every other exit keeps the config's loader.
|
|
75252
|
+
* const memory = defineScene("memory", {
|
|
75253
|
+
* bundle: "memory",
|
|
75254
|
+
* layers: { room: {} },
|
|
75255
|
+
* projections: [],
|
|
75256
|
+
* leave: sw => (sw.to === "ward" ? { loader: false } : undefined)
|
|
75257
|
+
* });
|
|
75258
|
+
* typeof memory.leave; // "function", called with { from: "memory", to: "ward" } at the switch,
|
|
75259
|
+
* // and with { from: "memory", to: "memory" } when the memory stands live
|
|
75175
75260
|
* ```
|
|
75176
75261
|
*/
|
|
75177
75262
|
function defineScene(id, scene) {
|
|
75178
75263
|
const layers = layersOf(id, scene.layers);
|
|
75179
75264
|
const projections = scene.projections;
|
|
75180
|
-
checkLeave(`Scene "${id}": leave`, scene.leave);
|
|
75265
|
+
if (typeof scene.leave !== "function") checkLeave(`Scene "${id}": leave`, scene.leave);
|
|
75181
75266
|
checkEnter(`Scene "${id}": enter`, scene.enter);
|
|
75182
75267
|
return Object.freeze({
|
|
75183
75268
|
id,
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Fr as ClockSource, Jn as NodeFx, Lr as FakeClock, Nn as AnyFlow, Un as Descriptor, Ur as Json, jn as FeaturePlugin, qn as Hint, zn as NodeTable } from "./types-
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as memory, x as saveOf, y as WithGameState } from "./types-
|
|
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-
|
|
1
|
+
import { Fr as ClockSource, Jn as NodeFx, Lr as FakeClock, Nn as AnyFlow, Un as Descriptor, Ur as Json, jn as FeaturePlugin, qn as Hint, zn as NodeTable } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { t as createApp } from "./index-BgkCfDXF.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-BtZnTOC1.mjs";
|
|
4
|
+
import { a as createHeadless, i as ReproResult, n as HeadlessGame, o as runRepro, r as Repro, s as stepFrames, t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/clock/fake.d.ts
|
package/dist/testing.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-
|
|
1
|
+
import { dn as refuseStart, gn as type, pn as exit, t as createApp, w as flattenFeatures } from "./src-BK1vO-iC.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FilterSlotQuad, Br as Api$6, Hn as TypeTag, Hr as Events$3, O as FilterSlot, Un as Descriptor, Ur as Json, Z as Api$4, Zn as AnchorTarget, _r as ComponentType, _t as Point, ai as Events$5, at as PixiTexture, b as Events$4, er as Ease, fr as AnyComponent, hr as ComponentHandle, ir as NumericFields, it as PixiSprite, j as SyncApi, k as FilterSlotInputs, kr as Api$3, li as Api$1, lr as TrackOptions, mr as AnyComponentValue, nt as PixiGpuProgram, ot as PixiUniformGroup, pn as Api$2, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$5, tt as PixiFilter, ur as TrackSegment, vi as Events$2, yi as Require, yr as Entity, yt as FilterCache } from "./types-
|
|
2
|
-
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-
|
|
1
|
+
import { A as FilterSlotQuad, Br as Api$6, Hn as TypeTag, Hr as Events$3, O as FilterSlot, Un as Descriptor, Ur as Json, Z as Api$4, Zn as AnchorTarget, _r as ComponentType, _t as Point, ai as Events$5, at as PixiTexture, b as Events$4, er as Ease, fr as AnyComponent, hr as ComponentHandle, ir as NumericFields, it as PixiSprite, j as SyncApi, k as FilterSlotInputs, kr as Api$3, li as Api$1, lr as TrackOptions, mr as AnyComponentValue, nt as PixiGpuProgram, ot as PixiUniformGroup, pn as Api$2, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$5, tt as PixiFilter, ur as TrackSegment, vi as Events$2, yi as Require, yr as Entity, yt as FilterCache } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-DwZio7SW.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
|
-
import { $r as SnapshotOf, Fr as ClockSource, Hn as TypeTag, Jr as PlayerStateProvider, Lr as FakeClock, Nn as AnyFlow, Q as Config$2, Ur as Json, Vr as Config, Xr as SaveDoc, Yr as ProviderCall, a as Config$3, d as Manifest, gt as Orientation, hn as Config$1, jn as FeaturePlugin, n as AssetsIo, rt as PixiModule } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-
|
|
4
|
-
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-
|
|
1
|
+
import { $r as SnapshotOf, Fr as ClockSource, Hn as TypeTag, Jr as PlayerStateProvider, Lr as FakeClock, Nn as AnyFlow, Q as Config$2, Ur as Json, Vr as Config, Xr as SaveDoc, Yr as ProviderCall, a as Config$3, d as Manifest, gt as Orientation, hn as Config$1, jn as FeaturePlugin, n as AssetsIo, rt as PixiModule } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-DwZio7SW.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-BgkCfDXF.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Qr as Snapshot, Ur as Json } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Qr as Snapshot, Ur as Json } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-BXfMlWv9.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -13141,7 +13141,7 @@ type PassCount = {
|
|
|
13141
13141
|
enabled: boolean[];
|
|
13142
13142
|
};
|
|
13143
13143
|
declare namespace types_d_exports$1 {
|
|
13144
|
-
export { AnySceneProjection, BundleProgress, BundleShare, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, FadingLoader, FullCover, FullLeave, FullLoader, HeldLoader, KernelSlice$1 as KernelSlice, LayerMap, Leaving, LoaderFeed, RunContext, SceneBuild, SceneCover, SceneDefinition, SceneEnter, SceneLayer, SceneLeave, SceneLoader, SceneOwner, SceneProjection, SceneSpec, SceneState, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
13144
|
+
export { AnySceneProjection, BundleProgress, BundleShare, CheckedProjections, Config$1 as Config, DefineScene, Deps$1 as Deps, Events$1 as Events, FadingLoader, FullCover, FullLeave, FullLoader, HeldLoader, KernelSlice$1 as KernelSlice, LayerMap, LeaveSwitch, Leaving, LoaderFeed, RunContext, SceneBuild, SceneCover, SceneDefinition, SceneEnter, SceneLayer, SceneLeave, SceneLoader, SceneOwner, SceneProjection, SceneSpec, SceneState, ScenesApi, ScenesCtx, SortRule, State$1 as State, UiLayer };
|
|
13145
13145
|
}
|
|
13146
13146
|
/**
|
|
13147
13147
|
* How a layer orders what is drawn in it. The scene's name for the rule `world` stores.
|
|
@@ -13300,7 +13300,8 @@ type SceneLoader<Asset extends string = string> = {
|
|
|
13300
13300
|
* `leave` is merged field by field over `config.leave`, which is merged over the engine's default (`{ cover: { color:
|
|
13301
13301
|
* 0x000000, alpha: 0.45, inMs: 50, outMs: 150 }, loader: { afterMs: 400 } }`). `false` turns a part or the whole off;
|
|
13302
13302
|
* a part written over `false` starts from the engine's default. The scene being entered may set the veil's `color` and
|
|
13303
|
-
* `alpha` on top (`enter.cover`). Fast mode, a headless app and the first scene of a run show nothing.
|
|
13303
|
+
* `alpha` on top (`enter.cover`). Fast mode, a headless app and the first scene of a run show nothing. A scene may
|
|
13304
|
+
* also write a function of the switch that gives one (`SceneSpec.leave`).
|
|
13304
13305
|
*
|
|
13305
13306
|
* @example
|
|
13306
13307
|
* ```ts
|
|
@@ -13315,6 +13316,22 @@ type SceneLeave<Asset extends string = string> = {
|
|
|
13315
13316
|
cover?: SceneCover | false;
|
|
13316
13317
|
loader?: SceneLoader<Asset> | false;
|
|
13317
13318
|
} | false;
|
|
13319
|
+
/**
|
|
13320
|
+
* The switch a `leave` function is asked about: the ids of the scene being left and of the scene being switched to. A
|
|
13321
|
+
* new frozen object for every call. When a scene stands live (for the loader it holds, F103) `to` is the scene itself.
|
|
13322
|
+
*
|
|
13323
|
+
* @example
|
|
13324
|
+
* ```ts
|
|
13325
|
+
* // The memory dissolving into the ward is asked with { from: "memory", to: "ward" }; every other exit keeps the config's look.
|
|
13326
|
+
* const leave = (sw: LeaveSwitch): SceneLeave | undefined => (sw.to === "ward" ? { loader: false } : undefined);
|
|
13327
|
+
* leave({ from: "memory", to: "ward" }); // { loader: false }
|
|
13328
|
+
* leave({ from: "memory", to: "board" }); // undefined
|
|
13329
|
+
* ```
|
|
13330
|
+
*/
|
|
13331
|
+
type LeaveSwitch = {
|
|
13332
|
+
readonly from: string;
|
|
13333
|
+
readonly to: string;
|
|
13334
|
+
};
|
|
13318
13335
|
/**
|
|
13319
13336
|
* What a live switch to this scene shows over the scene being left: the veil takes this scene's `color` and `alpha`,
|
|
13320
13337
|
* each over what the scene being left resolved (its `leave` over `config.leave` over the engine's). Only the look of
|
|
@@ -13362,8 +13379,25 @@ type SceneSpec<Layers extends LayerMap, Projections extends readonly AnyScenePro
|
|
|
13362
13379
|
bundles?(state: SceneState<Player, Session>): readonly Bundle[];
|
|
13363
13380
|
layers: Layers;
|
|
13364
13381
|
projections: Projections & NoInfer<CheckedProjections<SceneLayer<Layers>, Projections>>;
|
|
13365
|
-
music?: Asset;
|
|
13366
|
-
|
|
13382
|
+
music?: Asset;
|
|
13383
|
+
/**
|
|
13384
|
+
* What a live switch shows over this scene when it is left: merged field by field over `config.leave`. A function is
|
|
13385
|
+
* called once per switch that shows a look, when the look starts, with the scene itself as `from`, and once more
|
|
13386
|
+
* when the scene stands live (for the loader it holds), with `to` the scene itself; `undefined` means the scene wrote nothing.
|
|
13387
|
+
* A throw or a result of the wrong shape is logged (`scenes:leave-failed`) and the config's look is shown.
|
|
13388
|
+
*
|
|
13389
|
+
* @example
|
|
13390
|
+
* ```ts
|
|
13391
|
+
* // The memory dissolves into the ward under the veil alone; every other exit keeps the config's loader.
|
|
13392
|
+
* defineScene("memory", {
|
|
13393
|
+
* bundle: "memory",
|
|
13394
|
+
* layers: {},
|
|
13395
|
+
* projections: [],
|
|
13396
|
+
* leave: sw => (sw.to === "ward" ? { loader: false } : undefined)
|
|
13397
|
+
* });
|
|
13398
|
+
* ```
|
|
13399
|
+
*/
|
|
13400
|
+
leave?: SceneLeave<Asset> | ((sw: LeaveSwitch) => SceneLeave<Asset> | undefined); /** What a live switch to this scene shows: the `color` and `alpha` of the veil over the scene being left. */
|
|
13367
13401
|
enter?: SceneEnter;
|
|
13368
13402
|
};
|
|
13369
13403
|
/**
|
|
@@ -13378,7 +13412,8 @@ type SceneSpec<Layers extends LayerMap, Projections extends readonly AnyScenePro
|
|
|
13378
13412
|
*/
|
|
13379
13413
|
type DefineScene<Asset extends string, Bundle extends string, Player extends Json = Json, Session extends Json = Json> = <Layers extends LayerMap, const Projections extends readonly AnySceneProjection[]>(id: string, scene: SceneSpec<Layers, Projections, Asset, Bundle, Player, Session>) => SceneDefinition;
|
|
13380
13414
|
/**
|
|
13381
|
-
* A scene as `defineScene` returns it:
|
|
13415
|
+
* A scene as `defineScene` returns it: frozen data, ready for the `scenes` key of a feature. It is plain data except
|
|
13416
|
+
* for a `leave` the scene wrote as a function of the switch, which is kept as it is.
|
|
13382
13417
|
*
|
|
13383
13418
|
* @example
|
|
13384
13419
|
* ```ts
|
|
@@ -13399,8 +13434,12 @@ type SceneDefinition = {
|
|
|
13399
13434
|
* @param state - The committed `player` and `session`, frozen.
|
|
13400
13435
|
* @returns The bundle names the scene needs on top of `bundle`.
|
|
13401
13436
|
*/
|
|
13402
|
-
bundles?(state: SceneState): readonly string[];
|
|
13403
|
-
|
|
13437
|
+
bundles?(state: SceneState): readonly string[];
|
|
13438
|
+
/**
|
|
13439
|
+
* What `defineScene` was given as `leave`: a value, or the function of the switch as it was written (the scene is
|
|
13440
|
+
* plain data only while this is a value); absent when the scene takes the config's.
|
|
13441
|
+
*/
|
|
13442
|
+
readonly leave?: SceneLeave | ((sw: LeaveSwitch) => SceneLeave | undefined); /** What `defineScene` was given as `enter`; absent when the scene being left decides the veil alone. */
|
|
13404
13443
|
readonly enter?: SceneEnter;
|
|
13405
13444
|
};
|
|
13406
13445
|
/**
|
|
@@ -13526,6 +13565,16 @@ type State$1 = {
|
|
|
13526
13565
|
* one. Absent otherwise: deleted, never written as `undefined`.
|
|
13527
13566
|
*/
|
|
13528
13567
|
leaving?: Leaving;
|
|
13568
|
+
/**
|
|
13569
|
+
* The switch the `begin` stage of a node saw and found to show no look (a `leave` that resolved to nothing): the
|
|
13570
|
+
* node's signal and the scene it switches to. The `scene` stage of the same node reads it instead of asking the
|
|
13571
|
+
* scene's `leave` function a second time. Replaced by the next such switch, and dropped at the next node and at a
|
|
13572
|
+
* stop. Absent otherwise: deleted, never written as `undefined`.
|
|
13573
|
+
*/
|
|
13574
|
+
declined?: {
|
|
13575
|
+
readonly signal: AbortSignal;
|
|
13576
|
+
readonly to: string;
|
|
13577
|
+
};
|
|
13529
13578
|
/**
|
|
13530
13579
|
* The leave loader projection scenes holds for the next switch of the scene that stands (F103): `world` keeps it
|
|
13531
13580
|
* built and hidden, and the loader's `due` only shows it. Absent while it holds none: deleted, never written as
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as TransformValue, Or as TagType, Pr as Api$5, Qn as ChangeHook, Un as Descriptor, Ur as Json, Xn as Answered, Z as Api$3, Zn as AnchorTarget, _r as ComponentType, ar as ProjectionMotion, dr as ViewHandle, er as Ease, et as PixiContainer, fr as AnyComponent, ir as NumericFields, kr as Api$2, li as Api, mr as AnyComponentValue, nr as MotionCause, pn as Api$1, pr as AnyComponentType, qn as Hint, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$4, tr as Motion, vt as ViewportSize, yi as Require, yr as Entity } from "./types-
|
|
1
|
+
import { J as TransformValue, Or as TagType, Pr as Api$5, Qn as ChangeHook, Un as Descriptor, Ur as Json, Xn as Answered, Z as Api$3, Zn as AnchorTarget, _r as ComponentType, ar as ProjectionMotion, dr as ViewHandle, er as Ease, et as PixiContainer, fr as AnyComponent, ir as NumericFields, kr as Api$2, li as Api, mr as AnyComponentValue, nr as MotionCause, pn as Api$1, pr as AnyComponentType, qn as Hint, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$4, tr as Motion, vt as ViewportSize, yi as Require, yr as Entity } from "./types-DIJDyd0v.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Br as Api$2, Pr as Api$4, Z as Api, kr as Api$1, ri as Api$3 } from "./types-
|
|
2
|
-
import { W as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { R as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { i as ControlApp, o as InputOf } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Br as Api$2, Pr as Api$4, Z as Api, kr as Api$1, ri as Api$3 } from "./types-DIJDyd0v.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-Bd3kGWhm.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-DwZio7SW.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-BXfMlWv9.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-D1OK3UVk.mjs";
|
|
6
|
+
import { t as commands } from "./commands-FwzJ1me5.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-B2c4NRo0.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 };
|