@moku-labs/game 0.15.108 → 0.15.110
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-DXmYGU9K.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-DXfmFIXE.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-Bj9GScaM.d.mts} +1 -1
- package/dist/{src-DDYGbUAQ.mjs → src-Ds7uujI_.mjs} +325 -202
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-D7NamN-U.d.mts → types-CDRqK30U.d.mts} +4 -4
- package/dist/{types-Db2VOFFW.d.mts → types-CbKMZ8dC.d.mts} +9 -3
- 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-BZ1TWYOl.d.mts → types-YXGnDllJ.d.mts} +2 -2
- package/dist/{visual-v4VYekoe.d.mts → visual-ZUf6Iq9v.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-DXfmFIXE.mjs";
|
|
3
|
+
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-CDRqK30U.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-CbKMZ8dC.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-CDRqK30U.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-Ds7uujI_.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-YXGnDllJ.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-CbKMZ8dC.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-DXmYGU9K.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-YXGnDllJ.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-CbKMZ8dC.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-YXGnDllJ.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-CbKMZ8dC.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-DXfmFIXE.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-Ds7uujI_.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-YXGnDllJ.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-CbKMZ8dC.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-Bj9GScaM.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-Bj9GScaM.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-CbKMZ8dC.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. */
|
|
@@ -45018,6 +45018,192 @@ function dropBuild(build) {
|
|
|
45018
45018
|
build.resolve();
|
|
45019
45019
|
}
|
|
45020
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
|
|
45021
45207
|
//#region src/plugins/scenes/loader.ts
|
|
45022
45208
|
/**
|
|
45023
45209
|
* Does nothing: the remover of a fade before its frame callback is registered.
|
|
@@ -45465,6 +45651,35 @@ function leaveOf(config, scene) {
|
|
|
45465
45651
|
};
|
|
45466
45652
|
}
|
|
45467
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
|
+
/**
|
|
45468
45683
|
* The loader projection a scene leaves with: the one its `leave` over `config.leave` names, when the loader is on.
|
|
45469
45684
|
*
|
|
45470
45685
|
* @param config - `config.leave`.
|
|
@@ -45552,7 +45767,9 @@ function stampHold(ctx, leaving, loader) {
|
|
|
45552
45767
|
* decides, and the scene being entered sets the veil's colour and alpha (`enter.cover`). A loader projection is fed
|
|
45553
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
|
|
45554
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
|
|
45555
|
-
* 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.
|
|
45556
45773
|
*
|
|
45557
45774
|
* @param ctx - Domain context of the plugin.
|
|
45558
45775
|
* @param scene - The scene being switched to.
|
|
@@ -45562,8 +45779,14 @@ function stampHold(ctx, leaving, loader) {
|
|
|
45562
45779
|
function startLeave(ctx, scene, run) {
|
|
45563
45780
|
const from = leftScene(ctx, run);
|
|
45564
45781
|
if (from === void 0) return void 0;
|
|
45565
|
-
const leave = leaveOf(ctx.config.leave, from.
|
|
45566
|
-
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
|
+
}
|
|
45567
45790
|
const cover = enteredCover(leave.cover, scene.enter?.cover);
|
|
45568
45791
|
const listening = new AbortController();
|
|
45569
45792
|
const leaving = {
|
|
@@ -45602,6 +45825,19 @@ function ownLeave(ctx, run) {
|
|
|
45602
45825
|
return leaving?.signal === run.signal ? leaving : void 0;
|
|
45603
45826
|
}
|
|
45604
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
|
+
/**
|
|
45605
45841
|
* The look the `begin` stage of this node started for the scene the `scene` stage switches to. One it started for
|
|
45606
45842
|
* another scene (the expected scene changed between the two stages) is dropped: its loader was resolved against that
|
|
45607
45843
|
* scene, so the switch shows its own.
|
|
@@ -45626,6 +45862,7 @@ function leaveFor(ctx, run, target) {
|
|
|
45626
45862
|
*/
|
|
45627
45863
|
function dropLeftOver(ctx, run) {
|
|
45628
45864
|
const leaving = ctx.state.leaving;
|
|
45865
|
+
delete ctx.state.declined;
|
|
45629
45866
|
if (leaving !== void 0 && leaving.signal !== run.signal) endLeave(ctx, leaving, "drop");
|
|
45630
45867
|
}
|
|
45631
45868
|
/**
|
|
@@ -45661,6 +45898,7 @@ function endLeave(ctx, leaving, how) {
|
|
|
45661
45898
|
* @param state - The plugin state.
|
|
45662
45899
|
*/
|
|
45663
45900
|
function forgetLeave(state) {
|
|
45901
|
+
delete state.declined;
|
|
45664
45902
|
const leaving = state.leaving;
|
|
45665
45903
|
if (leaving === void 0) return;
|
|
45666
45904
|
leaving.done = true;
|
|
@@ -45668,192 +45906,6 @@ function forgetLeave(state) {
|
|
|
45668
45906
|
delete state.leaving;
|
|
45669
45907
|
}
|
|
45670
45908
|
//#endregion
|
|
45671
|
-
//#region src/plugins/scenes/leave-check.ts
|
|
45672
|
-
/** The largest colour, `0xffffff`. */
|
|
45673
|
-
const MAX_COLOR = 16777215;
|
|
45674
|
-
/**
|
|
45675
|
-
* Tells whether a value is a finite number of at least 0: a duration.
|
|
45676
|
-
*
|
|
45677
|
-
* @param value - The value.
|
|
45678
|
-
* @returns True for a finite number `>= 0`.
|
|
45679
|
-
* @example
|
|
45680
|
-
* ```ts
|
|
45681
|
-
* isDuration(-1); // false
|
|
45682
|
-
* ```
|
|
45683
|
-
*/
|
|
45684
|
-
function isDuration(value) {
|
|
45685
|
-
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
45686
|
-
}
|
|
45687
|
-
/**
|
|
45688
|
-
* Tells whether a value is an alpha: a number from 0 to 1.
|
|
45689
|
-
*
|
|
45690
|
-
* @param value - The value.
|
|
45691
|
-
* @returns True for a number in `[0, 1]`.
|
|
45692
|
-
* @example
|
|
45693
|
-
* ```ts
|
|
45694
|
-
* isAlpha(1.2); // false
|
|
45695
|
-
* ```
|
|
45696
|
-
*/
|
|
45697
|
-
function isAlpha(value) {
|
|
45698
|
-
return typeof value === "number" && value >= 0 && value <= 1;
|
|
45699
|
-
}
|
|
45700
|
-
/**
|
|
45701
|
-
* Tells whether a value is a colour `0xRRGGBB`: a whole number from 0 to `0xffffff`.
|
|
45702
|
-
*
|
|
45703
|
-
* @param value - The value.
|
|
45704
|
-
* @returns True for a colour.
|
|
45705
|
-
* @example
|
|
45706
|
-
* ```ts
|
|
45707
|
-
* isColor(0x0b1020); // true
|
|
45708
|
-
* ```
|
|
45709
|
-
*/
|
|
45710
|
-
function isColor$1(value) {
|
|
45711
|
-
return Number.isInteger(value) && typeof value === "number" && value >= 0 && value <= MAX_COLOR;
|
|
45712
|
-
}
|
|
45713
|
-
/**
|
|
45714
|
-
* Tells whether a value is a name: a string that is not empty.
|
|
45715
|
-
*
|
|
45716
|
-
* @param value - The value.
|
|
45717
|
-
* @returns True for a string with at least one character.
|
|
45718
|
-
* @example
|
|
45719
|
-
* ```ts
|
|
45720
|
-
* isName(""); // false
|
|
45721
|
-
* ```
|
|
45722
|
-
*/
|
|
45723
|
-
function isName(value) {
|
|
45724
|
-
return typeof value === "string" && value.length > 0;
|
|
45725
|
-
}
|
|
45726
|
-
/**
|
|
45727
|
-
* Tells whether a value is a plain object a field can be read from.
|
|
45728
|
-
*
|
|
45729
|
-
* @param value - The value.
|
|
45730
|
-
* @returns True for an object that is no array and not `null`.
|
|
45731
|
-
* @example
|
|
45732
|
-
* ```ts
|
|
45733
|
-
* isRecord([]); // false
|
|
45734
|
-
* ```
|
|
45735
|
-
*/
|
|
45736
|
-
function isRecord$2(value) {
|
|
45737
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45738
|
-
}
|
|
45739
|
-
/** The colour of a veil. */
|
|
45740
|
-
const COLOR_RULE = {
|
|
45741
|
-
ok: isColor$1,
|
|
45742
|
-
hint: "a colour from 0x000000 to 0xffffff"
|
|
45743
|
-
};
|
|
45744
|
-
/** The alpha of a veil. */
|
|
45745
|
-
const ALPHA_RULE = {
|
|
45746
|
-
ok: isAlpha,
|
|
45747
|
-
hint: "the alpha the veil fades in to, a number from 0 to 1"
|
|
45748
|
-
};
|
|
45749
|
-
/** The fields of a veil. */
|
|
45750
|
-
const COVER_RULES = Object.freeze({
|
|
45751
|
-
color: COLOR_RULE,
|
|
45752
|
-
alpha: ALPHA_RULE,
|
|
45753
|
-
inMs: {
|
|
45754
|
-
ok: isDuration,
|
|
45755
|
-
hint: "the milliseconds of the fade-in, 0 or more"
|
|
45756
|
-
},
|
|
45757
|
-
outMs: {
|
|
45758
|
-
ok: isDuration,
|
|
45759
|
-
hint: "the milliseconds of the fade-out, 0 or more"
|
|
45760
|
-
}
|
|
45761
|
-
});
|
|
45762
|
-
/** The fields of the veil a scene being entered sets: its look, never its times. */
|
|
45763
|
-
const ENTER_COVER_RULES = Object.freeze({
|
|
45764
|
-
color: COLOR_RULE,
|
|
45765
|
-
alpha: ALPHA_RULE
|
|
45766
|
-
});
|
|
45767
|
-
/** The fields of a loader. */
|
|
45768
|
-
const LOADER_RULES = Object.freeze({
|
|
45769
|
-
afterMs: {
|
|
45770
|
-
ok: isDuration,
|
|
45771
|
-
hint: "the milliseconds the loader waits for, 0 or more"
|
|
45772
|
-
},
|
|
45773
|
-
holdMs: {
|
|
45774
|
-
ok: isDuration,
|
|
45775
|
-
hint: "the milliseconds the swap waits for, 0 or more"
|
|
45776
|
-
},
|
|
45777
|
-
texture: {
|
|
45778
|
-
ok: isName,
|
|
45779
|
-
hint: "an asset key such as \"ui.loader.ring\""
|
|
45780
|
-
},
|
|
45781
|
-
projection: {
|
|
45782
|
-
ok: isName,
|
|
45783
|
-
hint: "the name of a registered projection such as \"loading\""
|
|
45784
|
-
}
|
|
45785
|
-
});
|
|
45786
|
-
/**
|
|
45787
|
-
* Builds the error of a field of the wrong shape.
|
|
45788
|
-
*
|
|
45789
|
-
* @param where - Where the part was written.
|
|
45790
|
-
* @param value - What the field holds.
|
|
45791
|
-
* @param hint - What to give instead.
|
|
45792
|
-
* @returns The error, in the engine's two-line format.
|
|
45793
|
-
* @example
|
|
45794
|
-
* ```ts
|
|
45795
|
-
* wrong("scenes.leave.cover.alpha", 2, "a number from 0 to 1").message;
|
|
45796
|
-
* // '[game] scenes.leave.cover.alpha is 2.\n Give a number from 0 to 1.'
|
|
45797
|
-
* ```
|
|
45798
|
-
*/
|
|
45799
|
-
function wrong(where, value, hint) {
|
|
45800
|
-
return /* @__PURE__ */ new Error(`[game] ${where} is ${String(value)}.\n Give ${hint}.`);
|
|
45801
|
-
}
|
|
45802
|
-
/**
|
|
45803
|
-
* Checks one part of a `leave`: nothing, `false`, or an object whose every field it knows has the right shape.
|
|
45804
|
-
*
|
|
45805
|
-
* @param where - Where the part was written, `scenes.leave.cover`.
|
|
45806
|
-
* @param part - What the part holds.
|
|
45807
|
-
* @param rules - The fields of the part.
|
|
45808
|
-
* @throws {Error} For a part that is neither `false` nor an object, and for the first field of the wrong shape.
|
|
45809
|
-
*/
|
|
45810
|
-
function checkPart(where, part, rules) {
|
|
45811
|
-
if (part === void 0 || part === false) return;
|
|
45812
|
-
if (!isRecord$2(part)) throw wrong(where, part, "an object of its fields, or false");
|
|
45813
|
-
for (const [field, rule] of Object.entries(rules)) {
|
|
45814
|
-
const value = part[field];
|
|
45815
|
-
if (value !== void 0 && !rule.ok(value)) throw wrong(`${where}.${field}`, value, rule.hint);
|
|
45816
|
-
}
|
|
45817
|
-
}
|
|
45818
|
-
/**
|
|
45819
|
-
* Checks a `leave` a game wrote: nothing, `false`, or an object whose `cover` and `loader` are each nothing, `false`
|
|
45820
|
-
* 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
|
|
45821
|
-
* empty.
|
|
45822
|
-
*
|
|
45823
|
-
* @param where - Where it was written, for the message: `scenes.leave`, or `Scene "board": leave`.
|
|
45824
|
-
* @param leave - What was written.
|
|
45825
|
-
* @throws {Error} For the first part or field of the wrong shape.
|
|
45826
|
-
* @example
|
|
45827
|
-
* ```ts
|
|
45828
|
-
* checkLeave("scenes.leave", { cover: { alpha: 2 } });
|
|
45829
|
-
* // throws '[game] scenes.leave.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45830
|
-
* ```
|
|
45831
|
-
*/
|
|
45832
|
-
function checkLeave(where, leave) {
|
|
45833
|
-
if (leave === void 0 || leave === false) return;
|
|
45834
|
-
if (!isRecord$2(leave)) throw wrong(where, leave, "{ cover, loader } or false");
|
|
45835
|
-
checkPart(`${where}.cover`, leave.cover, COVER_RULES);
|
|
45836
|
-
checkPart(`${where}.loader`, leave.loader, LOADER_RULES);
|
|
45837
|
-
}
|
|
45838
|
-
/**
|
|
45839
|
-
* Checks a scene's `enter`: nothing, or an object whose `cover` is nothing or an object of a colour and an alpha from 0
|
|
45840
|
-
* to 1, by the rules of `leave.cover`.
|
|
45841
|
-
*
|
|
45842
|
-
* @param where - Where it was written, for the message: `Scene "night": enter`.
|
|
45843
|
-
* @param enter - What was written.
|
|
45844
|
-
* @throws {Error} For an `enter` that is no object, and for the first field of the wrong shape.
|
|
45845
|
-
* @example
|
|
45846
|
-
* ```ts
|
|
45847
|
-
* checkEnter('Scene "night": enter', { cover: { alpha: 2 } });
|
|
45848
|
-
* // throws '[game] Scene "night": enter.cover.alpha is 2.\n Give the alpha the veil fades in to, a number from 0 to 1.'
|
|
45849
|
-
* ```
|
|
45850
|
-
*/
|
|
45851
|
-
function checkEnter(where, enter) {
|
|
45852
|
-
if (enter === void 0) return;
|
|
45853
|
-
if (!isRecord$2(enter)) throw wrong(where, enter, "{ cover }");
|
|
45854
|
-
checkPart(`${where}.cover`, enter.cover, ENTER_COVER_RULES);
|
|
45855
|
-
}
|
|
45856
|
-
//#endregion
|
|
45857
45909
|
//#region src/plugins/scenes/switch.ts
|
|
45858
45910
|
/**
|
|
45859
45911
|
* A promise that resolves when the node was aborted. Already aborted resolves at once.
|
|
@@ -46072,7 +46124,7 @@ async function loadAndStand(ctx, scene, named, run) {
|
|
|
46072
46124
|
* @param run - The runner's mode and signal.
|
|
46073
46125
|
*/
|
|
46074
46126
|
function standLoader(ctx, scene, run) {
|
|
46075
|
-
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);
|
|
46076
46128
|
}
|
|
46077
46129
|
/**
|
|
46078
46130
|
* Holds the loader of the scene that still stands after a switch that ended without its swap: the drop unmounted the
|
|
@@ -46109,7 +46161,7 @@ async function switchTo(ctx, target, run) {
|
|
|
46109
46161
|
let leaving = leaveFor(ctx, run, scene.id);
|
|
46110
46162
|
try {
|
|
46111
46163
|
const named = namedBundles(scene, committedState(ctx));
|
|
46112
|
-
leaving
|
|
46164
|
+
if (leaving === void 0 && !leaveDeclined(ctx, run, scene.id)) leaving = startLeave(ctx, scene, run);
|
|
46113
46165
|
await loadAndStand(ctx, scene, named, run);
|
|
46114
46166
|
} catch (error) {
|
|
46115
46167
|
endLeave(ctx, leaving, "drop");
|
|
@@ -56198,9 +56250,24 @@ function clearHover(ctx) {
|
|
|
56198
56250
|
ctx.state.hovered = void 0;
|
|
56199
56251
|
}
|
|
56200
56252
|
/**
|
|
56253
|
+
* The layer the top of a view's parent chain is drawn in.
|
|
56254
|
+
*
|
|
56255
|
+
* @param ctx - Domain context of the input plugin.
|
|
56256
|
+
* @param entity - A view that hangs under a parent.
|
|
56257
|
+
* @returns The layer name of its root, or `undefined` when the root names none.
|
|
56258
|
+
*/
|
|
56259
|
+
function rootLayerOf(ctx, entity) {
|
|
56260
|
+
const { ecs } = ctx.deps.world;
|
|
56261
|
+
let top = entity;
|
|
56262
|
+
for (let parent = parentOf$1(ecs, top); parent !== 0; parent = parentOf$1(ecs, top)) top = parent;
|
|
56263
|
+
return ecs.get(top, Layer)?.name;
|
|
56264
|
+
}
|
|
56265
|
+
/**
|
|
56201
56266
|
* Takes a parented view out of its parent for the drag. The parent is remembered, the root pose
|
|
56202
56267
|
* is written into the `Transform` and the `Parent` goes, so the finger moves the view 1:1 and
|
|
56203
|
-
* `lift` reaches the lift layer. A view with no
|
|
56268
|
+
* `lift` reaches the lift layer. A view with no `Layer` of its own, a child element of a JSX
|
|
56269
|
+
* tree, is drawn in its root's layer while it is carried (F165). A view with no parent, or no
|
|
56270
|
+
* `Transform` to take the pose, stays.
|
|
56204
56271
|
*
|
|
56205
56272
|
* @param ctx - Domain context of the input plugin.
|
|
56206
56273
|
* @param entity - The view the finger picked up.
|
|
@@ -56211,26 +56278,32 @@ function unparent$1(ctx, entity) {
|
|
|
56211
56278
|
const parent = parentOf$1(ecs, entity);
|
|
56212
56279
|
if (parent === 0 || !ecs.has(entity, Transform)) return false;
|
|
56213
56280
|
const root = rootPoseOf(ecs, entity);
|
|
56281
|
+
const layer = ecs.has(entity, Layer) ? void 0 : rootLayerOf(ctx, entity);
|
|
56214
56282
|
ctx.state.parent = parent;
|
|
56215
56283
|
ecs.remove(entity, Parent);
|
|
56216
56284
|
ecs.set(entity, Transform, root);
|
|
56285
|
+
ctx.state.layered = layer !== void 0;
|
|
56286
|
+
if (layer !== void 0) ecs.add(entity, Layer({ name: layer }));
|
|
56217
56287
|
return true;
|
|
56218
56288
|
}
|
|
56219
56289
|
/**
|
|
56220
56290
|
* Hangs a view that left its parent for the drag back under it, at the local pose that keeps it
|
|
56221
|
-
* where the finger left it, so the motion home starts under the finger.
|
|
56222
|
-
*
|
|
56223
|
-
*
|
|
56291
|
+
* where the finger left it, so the motion home starts under the finger. The `Layer` the drag
|
|
56292
|
+
* gave it goes with it: under its parent it is drawn where its parent is. A parent with no
|
|
56293
|
+
* `Transform` left the world meanwhile: the view keeps its root pose and that layer. A view that
|
|
56294
|
+
* is gone is forgotten.
|
|
56224
56295
|
*
|
|
56225
56296
|
* @param ctx - Domain context of the input plugin.
|
|
56226
56297
|
* @param entity - The view that was carried.
|
|
56227
56298
|
*/
|
|
56228
56299
|
function reparent(ctx, entity) {
|
|
56229
|
-
const { parent } = ctx.state;
|
|
56300
|
+
const { parent, layered } = ctx.state;
|
|
56230
56301
|
const { ecs } = ctx.deps.world;
|
|
56231
56302
|
ctx.state.parent = void 0;
|
|
56303
|
+
ctx.state.layered = false;
|
|
56232
56304
|
if (parent === void 0 || !ecs.has(entity, Transform) || !ecs.has(parent, Transform)) return;
|
|
56233
56305
|
const local = localPoseOf(ecs, parent, rootPoseOf(ecs, entity));
|
|
56306
|
+
if (layered) ecs.remove(entity, Layer);
|
|
56234
56307
|
ecs.add(entity, Parent({ entity: parent }));
|
|
56235
56308
|
ecs.set(entity, Transform, local);
|
|
56236
56309
|
}
|
|
@@ -57501,6 +57574,7 @@ function createInputState(_ctx) {
|
|
|
57501
57574
|
hovered: void 0,
|
|
57502
57575
|
pointerOver: void 0,
|
|
57503
57576
|
parent: void 0,
|
|
57577
|
+
layered: false,
|
|
57504
57578
|
restScale: void 0,
|
|
57505
57579
|
heldPose: void 0,
|
|
57506
57580
|
unmute: void 0,
|
|
@@ -57631,6 +57705,7 @@ function stopInput(state) {
|
|
|
57631
57705
|
state.hovered = void 0;
|
|
57632
57706
|
state.pointerOver = void 0;
|
|
57633
57707
|
state.parent = void 0;
|
|
57708
|
+
state.layered = false;
|
|
57634
57709
|
state.restScale = void 0;
|
|
57635
57710
|
state.heldPose = void 0;
|
|
57636
57711
|
state.wake = void 0;
|
|
@@ -69396,12 +69471,24 @@ function createReconciler(ctx, modules, fields) {
|
|
|
69396
69471
|
writeLive(element);
|
|
69397
69472
|
if (!moved) modules.layout.repose(element, parentRect(element), false);
|
|
69398
69473
|
}
|
|
69474
|
+
/**
|
|
69475
|
+
* Sends an element home when a drag let it go: its `Held` went. An element that plays its exit,
|
|
69476
|
+
* or has not spawned, keeps its motions (F166).
|
|
69477
|
+
*
|
|
69478
|
+
* @param entity - The entity that lost `Held`.
|
|
69479
|
+
*/
|
|
69480
|
+
function dropped(entity) {
|
|
69481
|
+
const element = state.elements.get(entity);
|
|
69482
|
+
if (element === void 0 || !element.live || state.exiting.has(entity)) return;
|
|
69483
|
+
modules.layout.settleHome(element);
|
|
69484
|
+
}
|
|
69399
69485
|
return {
|
|
69400
69486
|
reconcile,
|
|
69401
69487
|
solve,
|
|
69402
69488
|
mountRoot,
|
|
69403
69489
|
unmountRoot,
|
|
69404
69490
|
markPointer,
|
|
69491
|
+
dropped,
|
|
69405
69492
|
queueEnter,
|
|
69406
69493
|
playEntered,
|
|
69407
69494
|
sweep,
|
|
@@ -69562,6 +69649,7 @@ function createJsxApi(ctx, modules) {
|
|
|
69562
69649
|
releaseHosted: () => releaseHosted(ctx, state),
|
|
69563
69650
|
applyTap: (entity) => applyTap(ctx, entity),
|
|
69564
69651
|
markPointer: frame.markPointer,
|
|
69652
|
+
dropped: frame.dropped,
|
|
69565
69653
|
queueEnter: frame.queueEnter,
|
|
69566
69654
|
playEntered: frame.playEntered,
|
|
69567
69655
|
converged: frame.converged,
|
|
@@ -70270,6 +70358,28 @@ function repose(ctx, element, parent, hooked, hint) {
|
|
|
70270
70358
|
}
|
|
70271
70359
|
handleOf(ctx, element)?.toRest(Transform, { ms: 0 });
|
|
70272
70360
|
}
|
|
70361
|
+
/** The components a drag leaves off their rest: the finger writes only the `Transform`. */
|
|
70362
|
+
const DROPPED = ["Transform"];
|
|
70363
|
+
/**
|
|
70364
|
+
* Brings an element a drag let go home to its rest pose, as `world.projection.settle` does for a
|
|
70365
|
+
* world view (F166): its `settle` hook with the components that stand off their rest, else a
|
|
70366
|
+
* `toRest` of the `Transform` over the world's `settleMs`. An element at rest plays nothing.
|
|
70367
|
+
*
|
|
70368
|
+
* @param ctx - Domain context of the ui plugin.
|
|
70369
|
+
* @param element - The element whose `Held` went.
|
|
70370
|
+
*/
|
|
70371
|
+
function settleHome(ctx, element) {
|
|
70372
|
+
const { ecs, projection } = ctx.deps.world;
|
|
70373
|
+
const rest = projection.restOf(element.entity, Transform);
|
|
70374
|
+
const now = ecs.get(element.entity, Transform);
|
|
70375
|
+
if (rest === void 0 || now === void 0 || samePose(now, rest)) return;
|
|
70376
|
+
const hook = element.motion?.settle;
|
|
70377
|
+
if (hook !== void 0) {
|
|
70378
|
+
play(ctx, element, (view) => hook(view, DROPPED));
|
|
70379
|
+
return;
|
|
70380
|
+
}
|
|
70381
|
+
play(ctx, element, (view) => view.toRest(Transform));
|
|
70382
|
+
}
|
|
70273
70383
|
/**
|
|
70274
70384
|
* Moves the rest `Transform` of a root element up by the keyboard lift, or back to its own rest
|
|
70275
70385
|
* with 0, through a 0 ms rest track: the repose of a new rect, so a loop re-bases on the lifted
|
|
@@ -72223,6 +72333,7 @@ function createLayoutApi(ctx) {
|
|
|
72223
72333
|
changeExtra: (element, name, values, hint) => playExtraChange(ctx, element, name, values, hint),
|
|
72224
72334
|
repose: (element, parent, hooked, hint) => repose(ctx, element, parent, hooked, hint),
|
|
72225
72335
|
lift: (element, units) => liftRest(ctx, element, units),
|
|
72336
|
+
settleHome: (element) => settleHome(ctx, element),
|
|
72226
72337
|
exit: (element, cause, span, stands) => beginExit(ctx, state, element, cause, span, stands),
|
|
72227
72338
|
playTrack: (element, hook) => {
|
|
72228
72339
|
play(ctx, element, hook);
|
|
@@ -73622,7 +73733,8 @@ function drawsViews(ctx) {
|
|
|
73622
73733
|
/**
|
|
73623
73734
|
* Opens the four systems of phase `layout`, the system `ui.enter` of phase `sync`, the seven world
|
|
73624
73735
|
* hooks of `Tree`, `Box`, `Pressed` and `PointerOver`, the two that tell the hosting step a view
|
|
73625
|
-
* lost its `Parent` or its `Held` (a view freed so may hang under its host again), the
|
|
73736
|
+
* lost its `Parent` or its `Held` (a view freed so may hang under its host again), the one that
|
|
73737
|
+
* sends a ui element home when a drag lets it go (its `Held` went, F166), the listener
|
|
73626
73738
|
* that asks for every root to be built again after a restore or a load, the two effect handlers,
|
|
73627
73739
|
* the hint listener that buffers every released hint for the `change` hooks of the next frame
|
|
73628
73740
|
* step, the three tap listeners (the `LocalWrite` patch, the pointer tap that clears the keyboard
|
|
@@ -73675,7 +73787,7 @@ function openRegistrations(ctx, jsx, layout) {
|
|
|
73675
73787
|
})), ecs.onAdded(Tree, (entity) => {
|
|
73676
73788
|
const place = projection.keyOf(entity);
|
|
73677
73789
|
jsx.mountRoot(entity, place?.projection ?? "ui", ecs.get(entity, Layer)?.name ?? "ui");
|
|
73678
|
-
}), ecs.onRemoved(Tree, (entity) => jsx.unmountRoot(entity)), ecs.onAdded(Box, (entity) => jsx.queueEnter(entity)), projection.onConverged(jsx.converged), ecs.onAdded(Pressed, (entity) => jsx.markPointer(entity, "pressed", true)), ecs.onRemoved(Pressed, (entity) => jsx.markPointer(entity, "pressed", false)), ecs.onAdded(PointerOver, (entity) => jsx.markPointer(entity, "hover", true)), ecs.onRemoved(PointerOver, (entity) => jsx.markPointer(entity, "hover", false)), ecs.onRemoved(Parent, () => hostsMoved(ctx.state.jsx)), ecs.onRemoved(Held, () => hostsMoved(ctx.state.jsx)), ctx.deps.flow.fx.handle("popup", layout.popupHandler(jsx)), ctx.deps.flow.fx.handle("guide", layout.guideHandler()), ctx.deps.flow.fx.onHint((hint) => {
|
|
73790
|
+
}), ecs.onRemoved(Tree, (entity) => jsx.unmountRoot(entity)), ecs.onAdded(Box, (entity) => jsx.queueEnter(entity)), projection.onConverged(jsx.converged), ecs.onAdded(Pressed, (entity) => jsx.markPointer(entity, "pressed", true)), ecs.onRemoved(Pressed, (entity) => jsx.markPointer(entity, "pressed", false)), ecs.onAdded(PointerOver, (entity) => jsx.markPointer(entity, "hover", true)), ecs.onRemoved(PointerOver, (entity) => jsx.markPointer(entity, "hover", false)), ecs.onRemoved(Parent, () => hostsMoved(ctx.state.jsx)), ecs.onRemoved(Held, () => hostsMoved(ctx.state.jsx)), ecs.onRemoved(Held, (entity) => jsx.dropped(entity)), ctx.deps.flow.fx.handle("popup", layout.popupHandler(jsx)), ctx.deps.flow.fx.handle("guide", layout.guideHandler()), ctx.deps.flow.fx.onHint((hint) => {
|
|
73679
73791
|
ctx.state.jsx.hints.push(hint);
|
|
73680
73792
|
}), ctx.deps.input.onTap(jsx.applyTap), ctx.deps.input.onTap(() => jsx.blur()), ctx.deps.input.onTap(jsx.tapped), ctx.deps.input.onPointer(guardPointer(ctx, jsx.pointer)), ctx.deps.input.onKey(jsx.key), ctx.deps.input.controls.add(LocalWrite), () => jsx.releaseHosted(), () => ecs.despawnOwnedBy(UI_OWNER));
|
|
73681
73793
|
if (drawsViews(ctx)) ctx.state.layout.cleanups.push(projection.onBuild(jsx.asideBuilt));
|
|
@@ -75145,15 +75257,16 @@ function namesOf(id, layers, projections) {
|
|
|
75145
75257
|
* `lift` is not among them does not compile — and throws here for a caller without types.
|
|
75146
75258
|
* `bundles` names bundles that depend on the committed state: the scene is mounted once those
|
|
75147
75259
|
* are in too. `leave` is what a live switch shows over the scene when it is left, merged over the
|
|
75148
|
-
* config's: `false` shows nothing
|
|
75260
|
+
* config's: `false` shows nothing; a function of the switch is called once per switch with `{ from, to }` and kept as it
|
|
75261
|
+
* is. `enter` sets the colour and the alpha of the veil of every live switch to the scene.
|
|
75149
75262
|
*
|
|
75150
75263
|
* @param id - Id of the scene. A node names it with `defineNode({ scene: id })`.
|
|
75151
75264
|
* @param scene - The bundle, the optional bundles of state, the layers, the projections, the
|
|
75152
75265
|
* optional music key, the optional `leave` and the optional `enter`.
|
|
75153
75266
|
* @returns The scene as frozen data, ready for the `scenes` key of a feature.
|
|
75154
75267
|
* @throws {Error} For an integer-like layer name, for a `layer` or `lift` that is not declared, for two HUD layers,
|
|
75155
|
-
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` or an `enter` of the
|
|
75156
|
-
* shape.
|
|
75268
|
+
* an `above` other than `"overlays"`, a `ui` declared after the HUD layer, and a `leave` value or an `enter` of the
|
|
75269
|
+
* wrong shape (the result of a `leave` function is checked at the switch and logged).
|
|
75157
75270
|
* @example
|
|
75158
75271
|
* ```ts
|
|
75159
75272
|
* // features/board/view/scene.ts of a game.
|
|
@@ -75194,12 +75307,22 @@ function namesOf(id, layers, projections) {
|
|
|
75194
75307
|
* projections: [],
|
|
75195
75308
|
* enter: { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
75196
75309
|
* }).enter; // { cover: { color: 0x0b1020, alpha: 0.7 } }
|
|
75310
|
+
*
|
|
75311
|
+
* // The memory dissolves into the ward under the veil alone; every other exit keeps the config's loader.
|
|
75312
|
+
* const memory = defineScene("memory", {
|
|
75313
|
+
* bundle: "memory",
|
|
75314
|
+
* layers: { room: {} },
|
|
75315
|
+
* projections: [],
|
|
75316
|
+
* leave: sw => (sw.to === "ward" ? { loader: false } : undefined)
|
|
75317
|
+
* });
|
|
75318
|
+
* typeof memory.leave; // "function", called with { from: "memory", to: "ward" } at the switch,
|
|
75319
|
+
* // and with { from: "memory", to: "memory" } when the memory stands live
|
|
75197
75320
|
* ```
|
|
75198
75321
|
*/
|
|
75199
75322
|
function defineScene(id, scene) {
|
|
75200
75323
|
const layers = layersOf(id, scene.layers);
|
|
75201
75324
|
const projections = scene.projections;
|
|
75202
|
-
checkLeave(`Scene "${id}": leave`, scene.leave);
|
|
75325
|
+
if (typeof scene.leave !== "function") checkLeave(`Scene "${id}": leave`, scene.leave);
|
|
75203
75326
|
checkEnter(`Scene "${id}": enter`, scene.enter);
|
|
75204
75327
|
return Object.freeze({
|
|
75205
75328
|
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-DXfmFIXE.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-CDRqK30U.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-Ds7uujI_.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,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-YXGnDllJ.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-CbKMZ8dC.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-DXfmFIXE.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -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";
|
|
@@ -1071,7 +1071,12 @@ type State$1 = {
|
|
|
1071
1071
|
pressedMs: number; /** The drop target that carries `Hovered` during a drag. */
|
|
1072
1072
|
hovered: Entity | undefined; /** The view that carries `PointerOver`: a press would take it, and a mouse or a pen is over it. */
|
|
1073
1073
|
pointerOver: Entity | undefined; /** The `Parent` the held view had at the grab. It is hung back under it on the release. */
|
|
1074
|
-
parent: Entity | undefined;
|
|
1074
|
+
parent: Entity | undefined;
|
|
1075
|
+
/**
|
|
1076
|
+
* Whether the drag gave the held view the `Layer` of its root, because the view had none of its
|
|
1077
|
+
* own (a child element of a JSX tree): it is taken off again when the view hangs back (F165).
|
|
1078
|
+
*/
|
|
1079
|
+
layered: boolean; /** The rest scale of the held view in root space: the base of `heldScale`, set back on drop. */
|
|
1075
1080
|
restScale: number | undefined;
|
|
1076
1081
|
/**
|
|
1077
1082
|
* The root pose of the held view, written at the grab and at every move. A carried view is
|
|
@@ -2976,7 +2981,8 @@ type ElementChange<Value> = (view: ViewHandle<unknown>, previous: Value, next: V
|
|
|
2976
2981
|
* component of the `components` prop (its values before and after). A hook for any other
|
|
2977
2982
|
* component name is accepted, so every `defineMotion` result fits; `ui` never plays it, and a dev
|
|
2978
2983
|
* build names it once (`ui:change-never-plays`). Every hook gets the hint routed to the element's
|
|
2979
|
-
* key in that frame step.
|
|
2984
|
+
* key in that frame step. `settle` plays when a drag lets a `Draggable` element go, with
|
|
2985
|
+
* `["Transform"]`; without it the element takes its rest `Transform` over the world's `settleMs`.
|
|
2980
2986
|
*
|
|
2981
2987
|
* @example
|
|
2982
2988
|
* ```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,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-CbKMZ8dC.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
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-YXGnDllJ.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-CbKMZ8dC.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-DXmYGU9K.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-ZUf6Iq9v.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 };
|