@moku-labs/game 0.15.112 → 0.15.114
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-mgP-ol2w.d.mts → commands-CiHOKtJB.d.mts} +11 -6
- package/dist/control.d.mts +4 -4
- package/dist/control.mjs +1 -1
- package/dist/{define-B7E6DD4f.d.mts → define-OPEOQ5MS.d.mts} +2 -2
- package/dist/{headless-eJl_KLEh.d.mts → headless-C5kxf9oU.d.mts} +1 -1
- package/dist/{index-CzGEyY57.d.mts → index-DXUwkf7I.d.mts} +3 -3
- 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/{run-pCQlIaNP.mjs → run-CeZj5UAg.mjs} +35 -14
- package/dist/{runtime-DJpvipYo.d.mts → runtime-hro6J1Bi.d.mts} +1 -1
- package/dist/{src-ApGU_EAs.mjs → src-TKBQMWqI.mjs} +276 -179
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-CGc-KthB.d.mts → types-3QDrFkdS.d.mts} +1 -1
- package/dist/{types-DeHYUN0m.d.mts → types-BUR4LWSa.d.mts} +2 -1
- package/dist/{types-DMamvJT_.d.mts → types-CATC2vK8.d.mts} +2 -2
- package/dist/{types-DlMj_RaB.d.mts → types-Di4cy3n_.d.mts} +2 -2
- package/dist/{types-D2m1w484.d.mts → types-UKjkRtLZ.d.mts} +4 -4
- package/dist/{visual-B1fV6JIC.d.mts → visual-BLd_9BvB.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +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-BUR4LWSa.mjs";
|
|
2
|
+
import { Et as PlatformProvider } from "../index-DXUwkf7I.mjs";
|
|
3
|
+
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-UKjkRtLZ.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-BUR4LWSa.mjs";
|
|
2
|
+
import { J as StringTable } from "./types-3QDrFkdS.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-UKjkRtLZ.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-TKBQMWqI.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-BUR4LWSa.mjs";
|
|
2
|
+
import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-Di4cy3n_.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-3QDrFkdS.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-C5kxf9oU.mjs";
|
|
5
|
+
import { i as ControlApp, r as Command } from "./types-CATC2vK8.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/flow/doors/commands.d.ts
|
|
8
8
|
/**
|
|
@@ -88,7 +88,12 @@ declare const commands: Readonly<{
|
|
|
88
88
|
step: Command<{
|
|
89
89
|
readonly frames: "number";
|
|
90
90
|
readonly deltaMs: "number?";
|
|
91
|
-
}, Readonly<Time>,
|
|
91
|
+
}, Readonly<Time>, HeadlessApp & {
|
|
92
|
+
readonly log: import("@moku-labs/common/browser").LogApi;
|
|
93
|
+
} & {
|
|
94
|
+
readonly clock?: Api;
|
|
95
|
+
readonly lifecycle?: Api$1;
|
|
96
|
+
}>;
|
|
92
97
|
clock: Command<{
|
|
93
98
|
readonly advanceMs: "number";
|
|
94
99
|
}, {
|
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-C5kxf9oU.mjs";
|
|
2
|
+
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-CATC2vK8.mjs";
|
|
3
|
+
import { t as commands } from "./commands-CiHOKtJB.mjs";
|
|
4
|
+
import { t as defineCommand } from "./define-OPEOQ5MS.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
7
7
|
/**
|
package/dist/control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as controlRefused, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
|
|
2
2
|
import { c as defineCommand } from "./session-ClUqpGId.mjs";
|
|
3
|
-
import { n as commands, t as run } from "./run-
|
|
3
|
+
import { n as commands, t as run } from "./run-CeZj5UAg.mjs";
|
|
4
4
|
export { commands, controlReadOnly, controlRefused, defineCommand, run };
|
|
@@ -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-C5kxf9oU.mjs";
|
|
2
|
+
import { l as Source, r as Command, s as InputSchema } from "./types-CATC2vK8.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-BUR4LWSa.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-BUR4LWSa.mjs";
|
|
2
|
+
import { $ as SfxDescriptor, A as EmitterDefinition, B as GlowValue, C as FoldValue, D as ShineValue, E as RevealRoundValue, F as DisplacementValue, G as AnimPlayerValue, H as OutlineValue, J as MotionKeyframe, K as Config$11, L as FilterComponent, M as AlphaValue, N as BlurValue, O as VignetteValue, P as ColorMatrixValue, Q as HapticKind, R as FilterSpec, S as FlashValue, T as RevealLineValue, U as UniformDeclaration, V as NoiseValue, W as AnimApi, X as Target, Y as State$10, _ as State$12, a as AudioApi, b as BloomValue, c as MusicDescriptor, ct as play, d as State$11, et as Step, f as VolumesFor, h as EffectsApi, j as EmitterValue, k as EmitterConfig, l as MusicOptions, m as Config$13, n as State$13, nt as defineAnimation, q as FramesValue, r as UiApi, s as Config$12, t as Config$14, w as GradeValue, x as DissolveValue, y as AuraValue, yt as OverlayApi, z as FilterValueOf } from "./types-Di4cy3n_.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-3QDrFkdS.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
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-BUR4LWSa.mjs";
|
|
2
|
+
import { C as FoldValue, D as ShineValue, E as RevealRoundValue, I as FilterArea, O as VignetteValue, Q as HapticKind, S as FlashValue, T as RevealLineValue, Z as types_d_exports, _t as use, at as haptic, b as BloomValue, bt as types_d_exports$4, ct as play, dt as sfx, ft as spawn, gt as tween, ht as stopSfx, i as types_d_exports$16, it as frames, lt as sequence, mt as stagger, nt as defineAnimation, ot as mark, p as types_d_exports$2, pt as spawned, rt as external, st as parallel, tt as HAPTIC_KINDS, ut as set, v as types_d_exports$5, vt as wait, w as GradeValue, x as DissolveValue, y as AuraValue } from "./types-Di4cy3n_.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-3QDrFkdS.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-DXUwkf7I.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
|
|
1
|
+
import { $ as HAPTIC_KINDS, $t as PASS_KINDS, A as types_exports$17, At as Traced, B as types_exports$7, Bt as Glow, C as defineFeature, Ct as PointerOver, D as defineBundles, Dt as Tappable, E as music, Et as Swipeable, F as types_exports$12, Ft as Emitter, G as types_exports$2, Gt as audioPlugin, H as types_exports$5, Ht as Outline, I as types_exports$11, It as Alpha, J as uiPlugin, Jt as animPlugin, K as types_exports$1, Kt as scenesPlugin, L as types_exports$10, Lt as Blur, M as types_exports$15, Mt as messageArgument, N as types_exports$14, Nt as messageDuration, O as load, Ot as Touchable, P as types_exports$13, Pt as effectsPlugin, Q as platformPlugin, Qt as rendererPlugin, R as types_exports$9, Rt as ColorMatrix, S as tr, St as Pointer, T as defineEmitter, Tt as Pressed, U as types_exports$4, Ut as defineFilter, V as types_exports$6, Vt as Noise, W as types_exports$3, Wt as debugPlugin, X as defineMotion, Xt as Animation, Y as resolve, Yt as AnimPlayer, Z as textPlugin, Zt as Frames, _ as guide, _n as modelPlugin, _t as inputPlugin, a as Vignette, an as PROBLEM_RULES, at as parallel, b as projection, bn as lifecyclePlugin, bt as Held, c as RevealLine, cn as DEMAND_REASONS, ct as set, d as Flash, dt as spawned, en as frameAt, et as defineAnimation, f as Dissolve, fn as contribution, ft as stagger, g as defineEffect, gn as type, gt as wait, h as cubicBezier, hn as to, ht as use, i as screen, in as PERF_LOG_VERSION, it as mark, j as types_exports$16, jt as i18nPlugin, k as ready, kt as Traceable, l as Grade, ln as worldPlugin, lt as sfx, m as Aura, mn as slot, mt as tween, n as createPlugin, nn as PERF_CAUSES, nt as frames, o as Shine, on as SHADER_WHATS, ot as play, p as Bloom, pn as exit, pt as stopSfx, q as types_exports, qt as assetsPlugin, r as defineGame, rn as PERF_GAP_BUCKETS, rt as haptic, s as RevealRound, sn as CANVAS_RESTARTS, st as sequence, t as createApp, tn as MONITOR_SECTIONS, tt as external, u as Fold, un as flowPlugin, ut as spawn, v as hint, vn as SaveUnreadableError, vt as Draggable, w as flattenFeatures, wt as Pressable, x as defineScene, xn as timePlugin, xt as Hovered, y as schedule, yn as clockPlugin, yt as DropTarget, z as types_exports$8, zt as Displacement } from "./src-TKBQMWqI.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-CvFDvkA_.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-BUR4LWSa.mjs";
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-Di4cy3n_.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-3QDrFkdS.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-C5kxf9oU.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-CATC2vK8.mjs";
|
|
6
|
+
import { n as defineSource } from "./define-OPEOQ5MS.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-hro6J1Bi.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-hro6J1Bi.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
|
@@ -77,8 +77,9 @@ const muteCommand = defineCommand({
|
|
|
77
77
|
/**
|
|
78
78
|
* Moves the game clock forward by `advanceMs`: a moment the rules scheduled with `clock.scheduleAt`
|
|
79
79
|
* that is due now arrives as `elapsed`, through the graph. A visual test reaches a clock-armed
|
|
80
|
-
* moment with it while its fake clock stands.
|
|
81
|
-
*
|
|
80
|
+
* moment with it while its fake clock stands. While `game.pause` holds the clock stands, and this
|
|
81
|
+
* command and `game.step` are the only things that move it. Changes what the game sees, so the
|
|
82
|
+
* session is tainted and the command journaled. Answers the clock after the move.
|
|
82
83
|
*
|
|
83
84
|
* @throws {Error} `[game] The command game.clock needs clockPlugin.` when the app has no `clockPlugin`.
|
|
84
85
|
* @throws {RangeError} When `advanceMs` is 0 or negative.
|
|
@@ -246,13 +247,16 @@ const keyCommand = defineCommand({
|
|
|
246
247
|
* a bundler `define` of `false` drops it, and logs the `moku:dev` marker.
|
|
247
248
|
*/
|
|
248
249
|
/**
|
|
249
|
-
* Pauses the game with the pause reason `devtools`. Answers whether the game is paused.
|
|
250
|
+
* Pauses the game with the pause reason `devtools`. Answers whether the game is paused. The clock
|
|
251
|
+
* stands too: `clock.now()` moves only on `game.step` and `game.clock`, so a frame-stepped trace is
|
|
252
|
+
* the same on every run. Another pause reason, such as a hidden tab, keeps the clock on the device.
|
|
250
253
|
*
|
|
251
254
|
* @example
|
|
252
255
|
* ```ts
|
|
253
|
-
* // The editor's pause button: the world
|
|
256
|
+
* // The editor's pause button: the world and the clock stand, and `game.step` moves both.
|
|
254
257
|
* (await run(app, commands.pause)).value; // true
|
|
255
258
|
* app.lifecycle.reasons(); // ["devtools"]
|
|
259
|
+
* app.clock.now(); // 1000000, and still 1000000 two seconds later
|
|
256
260
|
* ```
|
|
257
261
|
*/
|
|
258
262
|
const pauseCommand = defineCommand({
|
|
@@ -269,7 +273,8 @@ const pauseCommand = defineCommand({
|
|
|
269
273
|
});
|
|
270
274
|
/**
|
|
271
275
|
* Takes the pause reason `devtools` back. Answers whether the game is still paused: another
|
|
272
|
-
* reason, such as a hidden tab, keeps its hold.
|
|
276
|
+
* reason, such as a hidden tab, keeps its hold. The clock goes on from where it stood, with the
|
|
277
|
+
* advances of `game.step` and `game.clock`: behind the device clock by the pause, never a jump.
|
|
273
278
|
*
|
|
274
279
|
* @example
|
|
275
280
|
* ```ts
|
|
@@ -882,11 +887,6 @@ const debugCommand = defineCommand({
|
|
|
882
887
|
});
|
|
883
888
|
//#endregion
|
|
884
889
|
//#region src/plugins/time/control.ts
|
|
885
|
-
/**
|
|
886
|
-
* @file time plugin — the time commands of the `/control` door: step frames by hand, set the
|
|
887
|
-
* time scale and force the frame rate. Dev and debug builds: every body starts with the inline agent guard of a cosmetic
|
|
888
|
-
* command, so a bundler `define` of `false` drops it, and logs the `moku:dev` marker.
|
|
889
|
-
*/
|
|
890
890
|
/** The length of one frame at 60 fps, the step a frame count takes by default. */
|
|
891
891
|
const FRAME_MS = 1e3 / 60;
|
|
892
892
|
/**
|
|
@@ -900,6 +900,17 @@ function checkFrames(frames) {
|
|
|
900
900
|
throw new Error(`[game] game.step takes a whole number of frames.\n Pass 0 or a positive whole number, not ${String(frames)}.`);
|
|
901
901
|
}
|
|
902
902
|
/**
|
|
903
|
+
* Picks the clock `game.step` moves with the frames: the clock stands while the game is paused for
|
|
904
|
+
* `devtools` (F169), so the step moves it; on a running clock the step leaves it alone.
|
|
905
|
+
*
|
|
906
|
+
* @param app - The app the command runs on.
|
|
907
|
+
* @returns The standing clock, or `undefined`.
|
|
908
|
+
*/
|
|
909
|
+
function standingClock(app) {
|
|
910
|
+
if (app.lifecycle?.reasons().includes("devtools") !== true) return void 0;
|
|
911
|
+
return app.clock;
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
903
914
|
* Refuses a time scale that is not a finite number of zero or more. `setScale` clamps silently;
|
|
904
915
|
* the command refuses, so an editor slider cannot pass `NaN`.
|
|
905
916
|
*
|
|
@@ -912,13 +923,19 @@ function checkScale(scale) {
|
|
|
912
923
|
}
|
|
913
924
|
/**
|
|
914
925
|
* Runs frames by hand, one `time.step` each, also while the game is paused, and answers the time
|
|
915
|
-
* after them. A frame lasts 1000/60 ms unless `deltaMs` says otherwise.
|
|
926
|
+
* after them. A frame lasts 1000/60 ms unless `deltaMs` says otherwise. While `game.pause` holds,
|
|
927
|
+
* the clock stands, and each frame moves it by `deltaMs` before the frame runs, so `clock.now()`
|
|
928
|
+
* and the frame time go on together and a moment the flow scheduled arrives on the frame that
|
|
929
|
+
* reaches it. Otherwise the clock follows the device and the step leaves it alone.
|
|
916
930
|
*
|
|
917
931
|
* @example
|
|
918
932
|
* ```ts
|
|
919
933
|
* // The editor paused the game on a merge; step three frames to watch the item land.
|
|
920
|
-
*
|
|
921
|
-
*
|
|
934
|
+
* await run(app, commands.pause);
|
|
935
|
+
* app.clock.now(); // 1000000
|
|
936
|
+
* const ran = await run(app, commands.step, { frames: 3, deltaMs: 20 });
|
|
937
|
+
* ran.value; // { delta: 20, elapsed: 60, scale: 1, frame: 3, idle: false }
|
|
938
|
+
* app.clock.now(); // 1000060
|
|
922
939
|
* ```
|
|
923
940
|
*/
|
|
924
941
|
const stepCommand = defineCommand({
|
|
@@ -933,7 +950,11 @@ const stepCommand = defineCommand({
|
|
|
933
950
|
frames
|
|
934
951
|
});
|
|
935
952
|
checkFrames(frames);
|
|
936
|
-
|
|
953
|
+
const clock = deltaMs > 0 ? standingClock(app) : void 0;
|
|
954
|
+
for (let frame = 0; frame < frames; frame += 1) {
|
|
955
|
+
clock?.advance(deltaMs);
|
|
956
|
+
app.time.step(deltaMs);
|
|
957
|
+
}
|
|
937
958
|
return app.time.snapshot();
|
|
938
959
|
}
|
|
939
960
|
});
|
|
@@ -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-3QDrFkdS.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. */
|
|
@@ -28,177 +28,6 @@ const createPlugin$1 = coreConfig.createPlugin;
|
|
|
28
28
|
*/
|
|
29
29
|
const createCore$1 = coreConfig.createCore;
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region src/plugins/clock/api.ts
|
|
32
|
-
/**
|
|
33
|
-
* @file clock plugin — API factory. Holds the monotonic rule, the single pending due moment and
|
|
34
|
-
* the `elapsed` listeners.
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Reads the source and raises the high-water mark. A source that goes back cannot move game time
|
|
38
|
-
* back, and a fractional reading is cut to whole milliseconds. The shift of `advance` is added.
|
|
39
|
-
*
|
|
40
|
-
* @param state - Clock state.
|
|
41
|
-
* @returns The highest moment ever returned, in epoch milliseconds.
|
|
42
|
-
*/
|
|
43
|
-
function readNow(state) {
|
|
44
|
-
const moment = Math.trunc(state.source.now() + state.shift);
|
|
45
|
-
if (moment > state.last) state.last = moment;
|
|
46
|
-
return state.last;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Drops the pending due moment and its timer, if there is one.
|
|
50
|
-
*
|
|
51
|
-
* @param state - Clock state.
|
|
52
|
-
*/
|
|
53
|
-
function cancelPending(state) {
|
|
54
|
-
if (state.handle !== void 0) state.source.clearTimer(state.handle);
|
|
55
|
-
state.handle = void 0;
|
|
56
|
-
state.dueAt = void 0;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Delivers one `elapsed` input to the listeners registered at this instant. The list is copied
|
|
60
|
-
* first, so a listener that unsubscribes during delivery does not hide its neighbour.
|
|
61
|
-
*
|
|
62
|
-
* @param state - Clock state.
|
|
63
|
-
*/
|
|
64
|
-
function deliverElapsed(state) {
|
|
65
|
-
const moment = readNow(state);
|
|
66
|
-
const listeners = [...state.listeners];
|
|
67
|
-
for (const listener of listeners) listener({ now: moment });
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Arms the single timer for a due moment. The delay is counted from the RAW source reading plus
|
|
71
|
-
* the shift of `advance`, not from trusted time: the source's timer runs on the device clock, so after the device clock was
|
|
72
|
-
* moved back the wait is longer than `moment - now()`. A moment further than the longest timer
|
|
73
|
-
* waits in steps: the timer fires early and `fireDue` arms it again.
|
|
74
|
-
*
|
|
75
|
-
* @param state - Clock state.
|
|
76
|
-
* @param moment - Due moment in epoch milliseconds.
|
|
77
|
-
*/
|
|
78
|
-
function arm(state, moment) {
|
|
79
|
-
const raw = Math.trunc(state.source.now() + state.shift);
|
|
80
|
-
const delayMs = Math.min(MAX_TIMER_MS, Math.max(0, moment - raw));
|
|
81
|
-
state.dueAt = moment;
|
|
82
|
-
state.handle = state.source.setTimer(() => fireDue(state), delayMs);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Runs when the timer fires. A timer that fired before trusted time reached the moment is armed
|
|
86
|
-
* again. Otherwise the due moment is forgotten first, then the listeners hear about it. The clock
|
|
87
|
-
* never reschedules a delivered moment by itself — the rules decide the next one.
|
|
88
|
-
*
|
|
89
|
-
* @param state - Clock state.
|
|
90
|
-
*/
|
|
91
|
-
function fireDue(state) {
|
|
92
|
-
const moment = state.dueAt;
|
|
93
|
-
state.handle = void 0;
|
|
94
|
-
if (moment !== void 0 && readNow(state) < moment) {
|
|
95
|
-
arm(state, moment);
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
state.dueAt = void 0;
|
|
99
|
-
deliverElapsed(state);
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Moves the clock forward by `ms`: the shift every reading adds grows, and the pending moment is
|
|
103
|
-
* delivered at once when it is due now, or armed again for the rest of its wait.
|
|
104
|
-
*
|
|
105
|
-
* @param state - Clock state.
|
|
106
|
-
* @param ms - Milliseconds forward.
|
|
107
|
-
* @returns The trusted moment after the move.
|
|
108
|
-
* @throws {RangeError} When `ms` is not a finite number above 0.
|
|
109
|
-
*/
|
|
110
|
-
function advanceBy$1(state, ms) {
|
|
111
|
-
if (!Number.isFinite(ms) || ms <= 0) throw new RangeError(`[game] clock.advance moves the clock forward, not by ${ms} ms.\n Pass a finite number of milliseconds above 0.`);
|
|
112
|
-
state.shift += ms;
|
|
113
|
-
const moment = state.dueAt;
|
|
114
|
-
const now = readNow(state);
|
|
115
|
-
if (moment === void 0) return now;
|
|
116
|
-
cancelPending(state);
|
|
117
|
-
if (now >= moment) deliverElapsed(state);
|
|
118
|
-
else arm(state, moment);
|
|
119
|
-
return now;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Removes one listener. A second removal of the same listener does nothing.
|
|
123
|
-
*
|
|
124
|
-
* @param state - Clock state.
|
|
125
|
-
* @param listener - The listener registered by `onElapsed`.
|
|
126
|
-
*/
|
|
127
|
-
function removeListener$1(state, listener) {
|
|
128
|
-
const index = state.listeners.indexOf(listener);
|
|
129
|
-
if (index === -1) return;
|
|
130
|
-
state.listeners.splice(index, 1);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Creates the clock API: a monotonic `now()`, the single pending due moment, the `elapsed`
|
|
134
|
-
* listeners and `poke` for resume from background.
|
|
135
|
-
*
|
|
136
|
-
* @param ctx - Domain context of the clock plugin.
|
|
137
|
-
* @returns The clock API exposed as `app.clock`.
|
|
138
|
-
*/
|
|
139
|
-
function createClockApi(ctx) {
|
|
140
|
-
return {
|
|
141
|
-
now: () => readNow(ctx.state),
|
|
142
|
-
scheduleAt: (moment) => {
|
|
143
|
-
cancelPending(ctx.state);
|
|
144
|
-
if (moment === void 0) return;
|
|
145
|
-
arm(ctx.state, moment);
|
|
146
|
-
},
|
|
147
|
-
onElapsed: (listener) => {
|
|
148
|
-
ctx.state.listeners.push(listener);
|
|
149
|
-
return () => removeListener$1(ctx.state, listener);
|
|
150
|
-
},
|
|
151
|
-
poke: () => {
|
|
152
|
-
deliverElapsed(ctx.state);
|
|
153
|
-
},
|
|
154
|
-
advance: (ms) => advanceBy$1(ctx.state, ms),
|
|
155
|
-
dueAt: () => ctx.state.dueAt,
|
|
156
|
-
pending: () => ctx.state.dueAt === void 0 ? 0 : 1,
|
|
157
|
-
listeners: () => ctx.state.listeners.length
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
//#endregion
|
|
161
|
-
//#region src/plugins/clock/state.ts
|
|
162
|
-
/**
|
|
163
|
-
* @file clock plugin — state factory.
|
|
164
|
-
*/
|
|
165
|
-
/**
|
|
166
|
-
* Creates the initial clock state: the configured source or the system source, no shift, no due
|
|
167
|
-
* moment, no timer handle, no listeners.
|
|
168
|
-
*
|
|
169
|
-
* @param ctx - Minimal context.
|
|
170
|
-
* @param ctx.config - Resolved plugin config.
|
|
171
|
-
* @returns A fresh clock state.
|
|
172
|
-
*/
|
|
173
|
-
function createClockState(ctx) {
|
|
174
|
-
return {
|
|
175
|
-
source: ctx.config.source ?? systemSource(),
|
|
176
|
-
last: 0,
|
|
177
|
-
shift: 0,
|
|
178
|
-
dueAt: void 0,
|
|
179
|
-
handle: void 0,
|
|
180
|
-
listeners: []
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Clock plugin: `app.clock.now()`, `app.clock.scheduleAt(moment)`, `app.clock.onElapsed(fn)`.
|
|
185
|
-
*
|
|
186
|
-
* @example
|
|
187
|
-
* ```ts
|
|
188
|
-
* // A game plugin that needs trusted time declares the dependency and asks for the API.
|
|
189
|
-
* const energyPlugin = createPlugin("energy", {
|
|
190
|
-
* depends: [clockPlugin],
|
|
191
|
-
* api: ctx => ({ fullAt: (missing: number) => ctx.require(clockPlugin).now() + missing * 60_000 })
|
|
192
|
-
* });
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
const clockPlugin = /*#__PURE__*/ createPlugin$1("clock", {
|
|
196
|
-
config: { source: void 0 },
|
|
197
|
-
createState: createClockState,
|
|
198
|
-
api: createClockApi,
|
|
199
|
-
onStop: ({ state }) => cancelPending(state)
|
|
200
|
-
});
|
|
201
|
-
//#endregion
|
|
202
31
|
//#region src/plugins/time/phases.ts
|
|
203
32
|
/**
|
|
204
33
|
* The six frame phases, in the exact order they run every frame.
|
|
@@ -2198,6 +2027,245 @@ const lifecyclePlugin = /*#__PURE__*/ createPlugin$1("lifecycle", {
|
|
|
2198
2027
|
api: createLifecycleApi
|
|
2199
2028
|
});
|
|
2200
2029
|
//#endregion
|
|
2030
|
+
//#region src/plugins/clock/api.ts
|
|
2031
|
+
/**
|
|
2032
|
+
* @file clock plugin — API factory. Holds the monotonic rule, the single pending due moment and
|
|
2033
|
+
* the `elapsed` listeners.
|
|
2034
|
+
*/
|
|
2035
|
+
/**
|
|
2036
|
+
* Reads the source plus the shift of `advance`, uncut. While the clock stands (F169) the source is
|
|
2037
|
+
* not read: the reading taken when it stopped stands in for it.
|
|
2038
|
+
*
|
|
2039
|
+
* @param state - Clock state.
|
|
2040
|
+
* @returns The raw moment, in epoch milliseconds.
|
|
2041
|
+
*/
|
|
2042
|
+
function rawNow(state) {
|
|
2043
|
+
return (state.frozenAt ?? state.source.now()) + state.shift;
|
|
2044
|
+
}
|
|
2045
|
+
/**
|
|
2046
|
+
* Reads the source and raises the high-water mark. A source that goes back cannot move game time
|
|
2047
|
+
* back, and a fractional reading is cut to whole milliseconds. The shift of `advance` is added.
|
|
2048
|
+
*
|
|
2049
|
+
* @param state - Clock state.
|
|
2050
|
+
* @returns The highest moment ever returned, in epoch milliseconds.
|
|
2051
|
+
*/
|
|
2052
|
+
function readNow(state) {
|
|
2053
|
+
const moment = Math.trunc(rawNow(state));
|
|
2054
|
+
if (moment > state.last) state.last = moment;
|
|
2055
|
+
return state.last;
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* Drops the pending due moment and its timer, if there is one.
|
|
2059
|
+
*
|
|
2060
|
+
* @param state - Clock state.
|
|
2061
|
+
*/
|
|
2062
|
+
function cancelPending(state) {
|
|
2063
|
+
if (state.handle !== void 0) state.source.clearTimer(state.handle);
|
|
2064
|
+
state.handle = void 0;
|
|
2065
|
+
state.dueAt = void 0;
|
|
2066
|
+
}
|
|
2067
|
+
/**
|
|
2068
|
+
* Delivers one `elapsed` input to the listeners registered at this instant. The list is copied
|
|
2069
|
+
* first, so a listener that unsubscribes during delivery does not hide its neighbour.
|
|
2070
|
+
*
|
|
2071
|
+
* @param state - Clock state.
|
|
2072
|
+
*/
|
|
2073
|
+
function deliverElapsed(state) {
|
|
2074
|
+
const moment = readNow(state);
|
|
2075
|
+
const listeners = [...state.listeners];
|
|
2076
|
+
for (const listener of listeners) listener({ now: moment });
|
|
2077
|
+
}
|
|
2078
|
+
/**
|
|
2079
|
+
* Arms the single timer for a due moment. The delay is counted from the RAW source reading plus
|
|
2080
|
+
* the shift of `advance`, not from trusted time: the source's timer runs on the device clock, so
|
|
2081
|
+
* after the device clock was moved back the wait is longer than `moment - now()`. A moment
|
|
2082
|
+
* further than the longest timer waits in steps: the timer fires early and `fireDue` arms it
|
|
2083
|
+
* again. A clock that stands keeps the moment and arms no timer: only `advance` reaches it, or the
|
|
2084
|
+
* timer armed when the clock goes on.
|
|
2085
|
+
*
|
|
2086
|
+
* @param state - Clock state.
|
|
2087
|
+
* @param moment - Due moment in epoch milliseconds.
|
|
2088
|
+
*/
|
|
2089
|
+
function arm(state, moment) {
|
|
2090
|
+
state.dueAt = moment;
|
|
2091
|
+
if (state.frozenAt !== void 0) return;
|
|
2092
|
+
const raw = Math.trunc(rawNow(state));
|
|
2093
|
+
const delayMs = Math.min(MAX_TIMER_MS, Math.max(0, moment - raw));
|
|
2094
|
+
state.handle = state.source.setTimer(() => fireDue(state), delayMs);
|
|
2095
|
+
}
|
|
2096
|
+
/**
|
|
2097
|
+
* Runs when the timer fires. A timer that fired before trusted time reached the moment is armed
|
|
2098
|
+
* again. Otherwise the due moment is forgotten first, then the listeners hear about it. The clock
|
|
2099
|
+
* never reschedules a delivered moment by itself — the rules decide the next one.
|
|
2100
|
+
*
|
|
2101
|
+
* @param state - Clock state.
|
|
2102
|
+
*/
|
|
2103
|
+
function fireDue(state) {
|
|
2104
|
+
const moment = state.dueAt;
|
|
2105
|
+
state.handle = void 0;
|
|
2106
|
+
if (moment !== void 0 && readNow(state) < moment) {
|
|
2107
|
+
arm(state, moment);
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
state.dueAt = void 0;
|
|
2111
|
+
deliverElapsed(state);
|
|
2112
|
+
}
|
|
2113
|
+
/**
|
|
2114
|
+
* Moves the clock forward by `ms`: the shift every reading adds grows, and the pending moment is
|
|
2115
|
+
* delivered at once when it is due now, or armed again for the rest of its wait.
|
|
2116
|
+
*
|
|
2117
|
+
* @param state - Clock state.
|
|
2118
|
+
* @param ms - Milliseconds forward.
|
|
2119
|
+
* @returns The trusted moment after the move.
|
|
2120
|
+
* @throws {RangeError} When `ms` is not a finite number above 0.
|
|
2121
|
+
*/
|
|
2122
|
+
function advanceBy$1(state, ms) {
|
|
2123
|
+
if (!Number.isFinite(ms) || ms <= 0) throw new RangeError(`[game] clock.advance moves the clock forward, not by ${ms} ms.\n Pass a finite number of milliseconds above 0.`);
|
|
2124
|
+
state.shift += ms;
|
|
2125
|
+
const moment = state.dueAt;
|
|
2126
|
+
const now = readNow(state);
|
|
2127
|
+
if (moment === void 0) return now;
|
|
2128
|
+
cancelPending(state);
|
|
2129
|
+
if (now >= moment) deliverElapsed(state);
|
|
2130
|
+
else arm(state, moment);
|
|
2131
|
+
return now;
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* Stops the clock (F169): `now()` stands at the moment it reads now, and the timer of the pending
|
|
2135
|
+
* moment is dropped, the moment kept. Only `advance` moves a standing clock. Stopping it twice
|
|
2136
|
+
* changes nothing.
|
|
2137
|
+
*
|
|
2138
|
+
* @param state - Clock state.
|
|
2139
|
+
*/
|
|
2140
|
+
function freezeClock(state) {
|
|
2141
|
+
if (state.frozenAt !== void 0) return;
|
|
2142
|
+
state.frozenAt = state.source.now();
|
|
2143
|
+
if (state.handle !== void 0) state.source.clearTimer(state.handle);
|
|
2144
|
+
state.handle = void 0;
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Lets a standing clock go on from where it stood: the span it stood is folded into the shift, so
|
|
2148
|
+
* it lags the source by that span and keeps every advance made meanwhile; it does not jump to the
|
|
2149
|
+
* source. The pending moment is armed again for the rest of its wait. A clock that runs is left
|
|
2150
|
+
* alone.
|
|
2151
|
+
*
|
|
2152
|
+
* @param state - Clock state.
|
|
2153
|
+
*/
|
|
2154
|
+
function thawClock(state) {
|
|
2155
|
+
if (state.frozenAt === void 0) return;
|
|
2156
|
+
state.shift += state.frozenAt - state.source.now();
|
|
2157
|
+
state.frozenAt = void 0;
|
|
2158
|
+
if (state.dueAt !== void 0) arm(state, state.dueAt);
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Removes one listener. A second removal of the same listener does nothing.
|
|
2162
|
+
*
|
|
2163
|
+
* @param state - Clock state.
|
|
2164
|
+
* @param listener - The listener registered by `onElapsed`.
|
|
2165
|
+
*/
|
|
2166
|
+
function removeListener$1(state, listener) {
|
|
2167
|
+
const index = state.listeners.indexOf(listener);
|
|
2168
|
+
if (index === -1) return;
|
|
2169
|
+
state.listeners.splice(index, 1);
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* Creates the clock API: a monotonic `now()`, the single pending due moment, the `elapsed`
|
|
2173
|
+
* listeners and `poke` for resume from background.
|
|
2174
|
+
*
|
|
2175
|
+
* @param ctx - Domain context of the clock plugin.
|
|
2176
|
+
* @returns The clock API exposed as `app.clock`.
|
|
2177
|
+
*/
|
|
2178
|
+
function createClockApi(ctx) {
|
|
2179
|
+
return {
|
|
2180
|
+
now: () => readNow(ctx.state),
|
|
2181
|
+
scheduleAt: (moment) => {
|
|
2182
|
+
cancelPending(ctx.state);
|
|
2183
|
+
if (moment === void 0) return;
|
|
2184
|
+
arm(ctx.state, moment);
|
|
2185
|
+
},
|
|
2186
|
+
onElapsed: (listener) => {
|
|
2187
|
+
ctx.state.listeners.push(listener);
|
|
2188
|
+
return () => removeListener$1(ctx.state, listener);
|
|
2189
|
+
},
|
|
2190
|
+
poke: () => {
|
|
2191
|
+
deliverElapsed(ctx.state);
|
|
2192
|
+
},
|
|
2193
|
+
advance: (ms) => advanceBy$1(ctx.state, ms),
|
|
2194
|
+
dueAt: () => ctx.state.dueAt,
|
|
2195
|
+
pending: () => ctx.state.dueAt === void 0 ? 0 : 1,
|
|
2196
|
+
listeners: () => ctx.state.listeners.length
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
//#endregion
|
|
2200
|
+
//#region src/plugins/clock/handlers.ts
|
|
2201
|
+
/**
|
|
2202
|
+
* Creates the hook handlers. On `lifecycle:changed` the clock stops when the stack holds
|
|
2203
|
+
* `devtools` and goes on when it no longer does; any other reason leaves it on the source. The
|
|
2204
|
+
* clock sits before flow among the plugins, so this hook runs first, at the change itself. The
|
|
2205
|
+
* order does not matter for the reading: going on again keeps the moment it stood at, so the
|
|
2206
|
+
* resume poke of flow reads the same `now` before or after it.
|
|
2207
|
+
*
|
|
2208
|
+
* @param ctx - Kernel context of the clock plugin.
|
|
2209
|
+
* @param ctx.state - Clock state.
|
|
2210
|
+
* @returns The one hook of the plugin.
|
|
2211
|
+
*/
|
|
2212
|
+
function createHandlers$9(ctx) {
|
|
2213
|
+
return {
|
|
2214
|
+
/**
|
|
2215
|
+
* Stops or lets go the clock after a change of the pause stack.
|
|
2216
|
+
*
|
|
2217
|
+
* @param payload - The stack after the change.
|
|
2218
|
+
*/
|
|
2219
|
+
"lifecycle:changed": (payload) => {
|
|
2220
|
+
if (payload.reasons.includes("devtools")) freezeClock(ctx.state);
|
|
2221
|
+
else thawClock(ctx.state);
|
|
2222
|
+
} };
|
|
2223
|
+
}
|
|
2224
|
+
//#endregion
|
|
2225
|
+
//#region src/plugins/clock/state.ts
|
|
2226
|
+
/**
|
|
2227
|
+
* @file clock plugin — state factory.
|
|
2228
|
+
*/
|
|
2229
|
+
/**
|
|
2230
|
+
* Creates the initial clock state: the configured source or the system source, no shift, a clock
|
|
2231
|
+
* that runs, no due moment, no timer handle, no listeners.
|
|
2232
|
+
*
|
|
2233
|
+
* @param ctx - Minimal context.
|
|
2234
|
+
* @param ctx.config - Resolved plugin config.
|
|
2235
|
+
* @returns A fresh clock state.
|
|
2236
|
+
*/
|
|
2237
|
+
function createClockState(ctx) {
|
|
2238
|
+
return {
|
|
2239
|
+
source: ctx.config.source ?? systemSource(),
|
|
2240
|
+
last: 0,
|
|
2241
|
+
shift: 0,
|
|
2242
|
+
frozenAt: void 0,
|
|
2243
|
+
dueAt: void 0,
|
|
2244
|
+
handle: void 0,
|
|
2245
|
+
listeners: []
|
|
2246
|
+
};
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* Clock plugin: `app.clock.now()`, `app.clock.scheduleAt(moment)`, `app.clock.onElapsed(fn)`.
|
|
2250
|
+
*
|
|
2251
|
+
* @example
|
|
2252
|
+
* ```ts
|
|
2253
|
+
* // A game plugin that needs trusted time declares the dependency and asks for the API.
|
|
2254
|
+
* const energyPlugin = createPlugin("energy", {
|
|
2255
|
+
* depends: [clockPlugin],
|
|
2256
|
+
* api: ctx => ({ fullAt: (missing: number) => ctx.require(clockPlugin).now() + missing * 60_000 })
|
|
2257
|
+
* });
|
|
2258
|
+
* ```
|
|
2259
|
+
*/
|
|
2260
|
+
const clockPlugin = /*#__PURE__*/ createPlugin$1("clock", {
|
|
2261
|
+
depends: [lifecyclePlugin],
|
|
2262
|
+
config: { source: void 0 },
|
|
2263
|
+
createState: createClockState,
|
|
2264
|
+
api: createClockApi,
|
|
2265
|
+
hooks: createHandlers$9,
|
|
2266
|
+
onStop: ({ state }) => cancelPending(state)
|
|
2267
|
+
});
|
|
2268
|
+
//#endregion
|
|
2201
2269
|
//#region src/plugins/model/rng/prng.ts
|
|
2202
2270
|
/**
|
|
2203
2271
|
* @file model/rng — generator step and seed hash. Both are part of the save format.
|
|
@@ -67377,6 +67445,16 @@ const LIVE_TYPES = concatTypes(VISUALS, INPUTS);
|
|
|
67377
67445
|
const NO_LOOK = Object.freeze({});
|
|
67378
67446
|
/** The owned fields of a type that gives none to a plugin: one list, never a new one. */
|
|
67379
67447
|
const NO_OWNED = [];
|
|
67448
|
+
/**
|
|
67449
|
+
* The fields of `Text` a write with no new content in the markup leaves alone: those the type gives
|
|
67450
|
+
* to `text` (the string it resolved), and the content and the style a game's system may have
|
|
67451
|
+
* written since (F167).
|
|
67452
|
+
*/
|
|
67453
|
+
const TEXT_KEPT = Object.freeze([
|
|
67454
|
+
...Text.owned,
|
|
67455
|
+
"content",
|
|
67456
|
+
"style"
|
|
67457
|
+
]);
|
|
67380
67458
|
/** The time of a reconcile a test steps by hand: no ms pass, so no scroll moves. */
|
|
67381
67459
|
const NO_TIME = Object.freeze({
|
|
67382
67460
|
delta: 0,
|
|
@@ -67885,6 +67963,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
67885
67963
|
let slotsVersion = -1;
|
|
67886
67964
|
let slotsRoots = -1;
|
|
67887
67965
|
let placedUnder;
|
|
67966
|
+
let textKept = false;
|
|
67888
67967
|
let rendered = 0;
|
|
67889
67968
|
const isAside = (entity) => ctx.deps.world.projection.isBuilding(entity);
|
|
67890
67969
|
let released = false;
|
|
@@ -68172,12 +68251,17 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68172
68251
|
* rect never resets it. The look is recorded as the rest of the visual before it is written, so
|
|
68173
68252
|
* the rest the world holds is always the one the element is drawn with (a restore brings it back
|
|
68174
68253
|
* to exactly that) and a `change` hook of the visual brings it home with `toRest`. The extras of
|
|
68175
|
-
* the `components` prop are diffed last. Every call is one write pass of `UiCounters`.
|
|
68254
|
+
* the `components` prop are diffed last. Every call is one write pass of `UiCounters`. A write
|
|
68255
|
+
* whose markup says the same `content`, `style` and `bind` as the last one (a moved rect, a restyle, a
|
|
68256
|
+
* render that changed another prop) leaves the entity's `Text.content` and `Text.style` alone, so
|
|
68257
|
+
* what a game's system wrote there stays (F167).
|
|
68176
68258
|
*
|
|
68177
68259
|
* @param element - The element that changed.
|
|
68260
|
+
* @param keepsText - Whether the markup's `content`, `style` and `bind` say what they said.
|
|
68178
68261
|
*/
|
|
68179
|
-
function writeLive(element) {
|
|
68262
|
+
function writeLive(element, keepsText) {
|
|
68180
68263
|
state.written += 1;
|
|
68264
|
+
textKept = keepsText;
|
|
68181
68265
|
writeOrder(element);
|
|
68182
68266
|
const visuals = visualOf$1(element);
|
|
68183
68267
|
const inputs = inputOf(element);
|
|
@@ -68221,7 +68305,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68221
68305
|
* @param type - Its component type.
|
|
68222
68306
|
*/
|
|
68223
68307
|
function writeOthers(element, value, type) {
|
|
68224
|
-
const others = otherFields(value,
|
|
68308
|
+
const others = otherFields(value, leftAlone(element, type, ecs.typeOf(type.componentName)?.owned ?? NO_OWNED));
|
|
68225
68309
|
if (others !== void 0) ecs.set(element.entity, asHandle(type), others);
|
|
68226
68310
|
}
|
|
68227
68311
|
/**
|
|
@@ -68238,6 +68322,18 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68238
68322
|
return ecs.get(entity, Tappable)?.point === true && !("point" in value.value);
|
|
68239
68323
|
}
|
|
68240
68324
|
/**
|
|
68325
|
+
* The fields a write of the current pass leaves alone: those of `fieldsLeftAlone`, and on the
|
|
68326
|
+
* `Text` of a write with no new content in the markup its content and style too.
|
|
68327
|
+
*
|
|
68328
|
+
* @param element - The live element.
|
|
68329
|
+
* @param type - The component type of the value.
|
|
68330
|
+
* @param owned - The fields its type gives to a plugin.
|
|
68331
|
+
* @returns The fields left alone: a list of the module, never a new one, for a kept text.
|
|
68332
|
+
*/
|
|
68333
|
+
function leftAlone(element, type, owned) {
|
|
68334
|
+
return type === Text && textKept ? TEXT_KEPT : fieldsLeftAlone(element, type, owned);
|
|
68335
|
+
}
|
|
68336
|
+
/**
|
|
68241
68337
|
* Writes one visual or input value onto a live element: added when the entity lacks it, else
|
|
68242
68338
|
* its fields patched, but never a tag or the state of a scroll, and never a field its type gives
|
|
68243
68339
|
* to a plugin. A `Tappable` that drops `point` is added again: it replaces the stored one whole.
|
|
@@ -68252,7 +68348,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68252
68348
|
}
|
|
68253
68349
|
if (value.value === true || SCROLL_STATE.has(value.type.componentName)) return;
|
|
68254
68350
|
const typeOwned = ecs.typeOf(value.type.componentName)?.owned ?? NO_OWNED;
|
|
68255
|
-
const owned =
|
|
68351
|
+
const owned = leftAlone(element, value.type, typeOwned);
|
|
68256
68352
|
ecs.set(element.entity, asHandle(value.type), livePatch(value.value, owned));
|
|
68257
68353
|
}
|
|
68258
68354
|
/**
|
|
@@ -68291,6 +68387,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68291
68387
|
resolved: !keepsStyle,
|
|
68292
68388
|
moved: !keepsStyle && modules.layout.affectsRect(element.style, style),
|
|
68293
68389
|
measures: !stands || !sameStyle || !sameContent,
|
|
68390
|
+
keepsText: sameStyle && sameContent && sameValue(previous.props.bind, node.props.bind),
|
|
68294
68391
|
unchanged: keepsStyle && sameContent && writesSame(previous, node)
|
|
68295
68392
|
};
|
|
68296
68393
|
}
|
|
@@ -68311,7 +68408,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68311
68408
|
root.needsSolve = true;
|
|
68312
68409
|
}
|
|
68313
68410
|
if (!element.live) return;
|
|
68314
|
-
writeLive(element);
|
|
68411
|
+
writeLive(element, change.keepsText);
|
|
68315
68412
|
if (!change.moved) modules.layout.repose(element, parentRect(element), false, hintOf(state, element));
|
|
68316
68413
|
}
|
|
68317
68414
|
/**
|
|
@@ -68680,7 +68777,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
68680
68777
|
let hooked = quiet;
|
|
68681
68778
|
if (element.moved) {
|
|
68682
68779
|
modules.layout.commit(element, parent);
|
|
68683
|
-
writeLive(element);
|
|
68780
|
+
writeLive(element, true);
|
|
68684
68781
|
if (!quiet) hooked = modules.layout.change(element, element.previous, hint);
|
|
68685
68782
|
}
|
|
68686
68783
|
modules.layout.repose(element, parent, hooked, hint);
|
|
@@ -69501,7 +69598,7 @@ function createReconciler(ctx, modules, fields) {
|
|
|
69501
69598
|
if (root !== void 0) root.needsSolve = true;
|
|
69502
69599
|
}
|
|
69503
69600
|
if (!element.live) return;
|
|
69504
|
-
writeLive(element);
|
|
69601
|
+
writeLive(element, true);
|
|
69505
69602
|
if (!moved) modules.layout.repose(element, parentRect(element), false);
|
|
69506
69603
|
}
|
|
69507
69604
|
/**
|
|
@@ -76749,4 +76846,4 @@ const screen = [
|
|
|
76749
76846
|
uiPlugin
|
|
76750
76847
|
];
|
|
76751
76848
|
//#endregion
|
|
76752
|
-
export { HAPTIC_KINDS as $, PASS_KINDS as $t, types_exports as A, Traced as At, types_exports$10 as B, Glow as Bt, defineFeature as C, PointerOver as Ct, defineBundles as D, Tappable as Dt, music as E, Swipeable as Et, types_exports$5 as F, Emitter as Ft, types_exports$15 as G, audioPlugin as Gt, types_exports$12 as H, Outline as Ht, types_exports$6 as I, Alpha as It, uiPlugin as J, animPlugin as Jt, types_exports$16 as K, scenesPlugin as Kt, types_exports$7 as L, Blur as Lt, types_exports$2 as M, messageArgument as Mt, types_exports$3 as N, messageDuration as Nt, load as O, Touchable as Ot, types_exports$4 as P, effectsPlugin as Pt, platformPlugin as Q, rendererPlugin as Qt, types_exports$8 as R, ColorMatrix as Rt, tr as S, Pointer as St, defineEmitter as T, Pressed as Tt, types_exports$13 as U, defineFilter as Ut, types_exports$11 as V, Noise as Vt, types_exports$14 as W, debugPlugin as Wt, defineMotion as X, Animation as Xt, resolve as Y, AnimPlayer as Yt, textPlugin as Z, Frames as Zt, guide as _, modelPlugin as _n, inputPlugin as _t, Vignette as a, PROBLEM_RULES as an, parallel as at, projection as b,
|
|
76849
|
+
export { HAPTIC_KINDS as $, PASS_KINDS as $t, types_exports as A, Traced as At, types_exports$10 as B, Glow as Bt, defineFeature as C, PointerOver as Ct, defineBundles as D, Tappable as Dt, music as E, Swipeable as Et, types_exports$5 as F, Emitter as Ft, types_exports$15 as G, audioPlugin as Gt, types_exports$12 as H, Outline as Ht, types_exports$6 as I, Alpha as It, uiPlugin as J, animPlugin as Jt, types_exports$16 as K, scenesPlugin as Kt, types_exports$7 as L, Blur as Lt, types_exports$2 as M, messageArgument as Mt, types_exports$3 as N, messageDuration as Nt, load as O, Touchable as Ot, types_exports$4 as P, effectsPlugin as Pt, platformPlugin as Q, rendererPlugin as Qt, types_exports$8 as R, ColorMatrix as Rt, tr as S, Pointer as St, defineEmitter as T, Pressed as Tt, types_exports$13 as U, defineFilter as Ut, types_exports$11 as V, Noise as Vt, types_exports$14 as W, debugPlugin as Wt, defineMotion as X, Animation as Xt, resolve as Y, AnimPlayer as Yt, textPlugin as Z, Frames as Zt, guide as _, modelPlugin as _n, inputPlugin as _t, Vignette as a, PROBLEM_RULES as an, parallel as at, projection as b, lifecyclePlugin as bn, Held as bt, RevealLine as c, DEMAND_REASONS as cn, set as ct, Flash as d, refuseStart as dn, spawned as dt, frameAt as en, defineAnimation as et, Dissolve as f, contribution as fn, stagger as ft, defineEffect as g, type as gn, wait as gt, cubicBezier as h, to as hn, use as ht, screen as i, PERF_LOG_VERSION as in, mark as it, types_exports$1 as j, i18nPlugin as jt, ready as k, Traceable as kt, Grade as l, worldPlugin as ln, sfx as lt, Aura as m, slot as mn, tween as mt, createPlugin as n, PERF_CAUSES as nn, frames as nt, Shine as o, SHADER_WHATS as on, play$1 as ot, Bloom as p, exit as pn, stopSfx as pt, types_exports$17 as q, assetsPlugin as qt, defineGame as r, PERF_GAP_BUCKETS as rn, haptic as rt, RevealRound as s, CANVAS_RESTARTS as sn, sequence as st, createApp as t, MONITOR_SECTIONS as tn, external as tt, Fold as u, flowPlugin as un, spawn as ut, hint as v, SaveUnreadableError as vn, Draggable as vt, flattenFeatures as w, Pressable as wt, defineScene as x, timePlugin as xn, Hovered as xt, schedule as y, clockPlugin as yn, DropTarget as yt, types_exports$9 as z, Displacement as zt };
|
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-BUR4LWSa.mjs";
|
|
2
|
+
import { t as createApp } from "./index-DXUwkf7I.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-UKjkRtLZ.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-C5kxf9oU.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-TKBQMWqI.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,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-BUR4LWSa.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";
|
|
@@ -1769,7 +1769,8 @@ type Config$5 = {
|
|
|
1769
1769
|
type State$5 = {
|
|
1770
1770
|
source: ClockSource;
|
|
1771
1771
|
last: number; /** Milliseconds `advance` moved the clock forward, added to every reading of the source. */
|
|
1772
|
-
shift: number;
|
|
1772
|
+
shift: number; /** The source reading taken when the clock stopped for the devtools pause (F169), else `undefined`. */
|
|
1773
|
+
frozenAt: number | undefined;
|
|
1773
1774
|
dueAt: number | undefined;
|
|
1774
1775
|
handle: unknown;
|
|
1775
1776
|
listeners: Array<(input: Elapsed) => void>;
|
|
@@ -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-BUR4LWSa.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-C5kxf9oU.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -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-BUR4LWSa.mjs";
|
|
2
|
+
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-3QDrFkdS.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $r as SnapshotOf, Fr as ClockSource, Hn as TypeTag, Jr as PlayerStateProvider, Lr as FakeClock, Nn as AnyFlow, Q as Config$2, Ur as Json, Vr as Config, Xr as SaveDoc, Yr as ProviderCall, a as Config$3, d as Manifest, gt as Orientation, hn as Config$1, jn as FeaturePlugin, n as AssetsIo, rt as PixiModule } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-
|
|
4
|
-
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-
|
|
1
|
+
import { $r as SnapshotOf, Fr as ClockSource, Hn as TypeTag, Jr as PlayerStateProvider, Lr as FakeClock, Nn as AnyFlow, Q as Config$2, Ur as Json, Vr as Config, Xr as SaveDoc, Yr as ProviderCall, a as Config$3, d as Manifest, gt as Orientation, hn as Config$1, jn as FeaturePlugin, n as AssetsIo, rt as PixiModule } from "./types-BUR4LWSa.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-Di4cy3n_.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-3QDrFkdS.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-DXUwkf7I.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -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-BUR4LWSa.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-Di4cy3n_.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-3QDrFkdS.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-C5kxf9oU.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-CATC2vK8.mjs";
|
|
6
|
+
import { t as commands } from "./commands-CiHOKtJB.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-BLd_9BvB.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/dist/visual.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
|
|
2
2
|
import { n as read, t as sources } from "./sources-WiVMRhXq.mjs";
|
|
3
|
-
import { n as commands, t as run } from "./run-
|
|
3
|
+
import { n as commands, t as run } from "./run-CeZj5UAg.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
|
6
6
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
package/llms.txt
CHANGED
|
@@ -703,7 +703,7 @@ A plugin that owns a resource stores it in its state and frees it in `onStop: ({
|
|
|
703
703
|
Two subpaths, neither on the root (V4). An editor, MCP tools and e2e scripts reach a running game through them; `docs/doors.md` in the engine repository has the full catalogue.
|
|
704
704
|
|
|
705
705
|
- `@moku-labs/game/inspect`: `read(app, source, input?)` reads once; `watch(app, source, input, fn)` reads on the `signals` phase when the source changes and returns the stop function; `defineSource`; the frozen catalogue `sources`; the types `Source`, `InputSchema`, `InputOf`. Every source only reads, so the door is safe in a production build. Keys of `sources`: `graph`, `position`, `history`, `tainted`, `cheats`, `model`, `entities`, `projections`, `ui`, `locate`, `render`, `sounds`, `audioMuted`, `effects`, `filters`, `assets`, `log`, `explain`, `diff`, `schema`, `at`; their ids are `game.<key>`. `filters` answers `{ kinds, off }` of `effects.diagnostics`. `locate` takes `{ key }` (a ui element) or `{ target }` (a view by projection key) and answers its box in CSS px, the numbers Playwright clicks. `at` takes `{ x, y }` in CSS px and lists the views under that point, topmost first. `explain` takes `{ entity }` and answers that entity in full, `undefined` for a stale id. `diff` takes `{ from, to }` frames and answers what changed per entity; it throws in a production build and for a frame outside the last 120. `schema` lists every component and tag type the world met, with the JSON kind of each field. `audioMuted` answers whether the master bus is muted. `sounds` throws `[game] The source game.sounds needs audioPlugin.`, `audioMuted` throws `[game] The source game.audioMuted needs audioPlugin.` and `effects` and `filters` throw `[game] The source game.effects needs effectsPlugin.` (`game.filters` for `filters`) when that plugin is not installed; the editor lists such a source as not installed.
|
|
706
|
-
- `@moku-labs/game/control`: `run(app, command, input?)` resolves `{ value, state }`, `state` being `{ path, frame, tainted }`; `defineCommand`; `controlRefused`; `controlReadOnly`; the frozen catalogue `commands`; the types `Command`, `ChoiceInput`, `Ran`, `ControlReadOnlyError`. Keys of `commands`: `answer`, `tap`, `drag`, `key`, `fill`, `scroll`, `walk`, `bookmark`, `restore`, `saveExport`, `saveImport`, `step`, `clock`, `pause`, `resume`, `capture`, `debug`, `reducedMotion`, `timeScale`, `frameRate`, `mute`, `trace`, `filter`. `run` checks the input against the command's schema first (F154): an unknown field, a required field left out and a value of another kind (a `number` must be finite) throw `[game] The command game.scroll got the field "dy", which it does not take.` with the fields it takes, and nothing runs. `clock` takes `{ advanceMs }` (cheat), calls `clock.advance(advanceMs)` and answers `{ now }`: a moment armed with `clock.scheduleAt` that is due arrives as `elapsed`; a visual test writes it as the step `{ clock: { advanceMs: 60_000 } }` to reach a clock-armed rest node (F157). `capture` resolves `{ png }`, and `{ png, legend }` with `legend: true`; `undefined` while the renderer is inert. `timeScale` takes `{ scale }`; 0 freezes game time while the frames keep running. `frameRate` takes `{ fps? }`, calls `time.setRate(fps ?? "auto")` and answers `time.rate()`. `mute` takes `{ muted }`, mutes the master bus and answers the flag. Without `audioPlugin` it throws `[game] The command game.mute needs audioPlugin.` `trace` takes `{ path }`, a list of views by projection key, and answers whether the gate took the answer. `scroll` takes `{ key, to }`, calls `ui.scroll(key, to)` and answers what it answers; a visual test writes it as the step `{ scroll: { key, to } }`. `filter` takes `{ kind, on }`, switches the filter kind through `effects.diagnostics` (cosmetic) and answers the off kinds; an unknown kind throws `[game] No filter kind "fx.nope".` naming the known ones; without `effectsPlugin` it throws `[game] The command game.filter needs effectsPlugin.`
|
|
706
|
+
- `@moku-labs/game/control`: `run(app, command, input?)` resolves `{ value, state }`, `state` being `{ path, frame, tainted }`; `defineCommand`; `controlRefused`; `controlReadOnly`; the frozen catalogue `commands`; the types `Command`, `ChoiceInput`, `Ran`, `ControlReadOnlyError`. Keys of `commands`: `answer`, `tap`, `drag`, `key`, `fill`, `scroll`, `walk`, `bookmark`, `restore`, `saveExport`, `saveImport`, `step`, `clock`, `pause`, `resume`, `capture`, `debug`, `reducedMotion`, `timeScale`, `frameRate`, `mute`, `trace`, `filter`. `run` checks the input against the command's schema first (F154): an unknown field, a required field left out and a value of another kind (a `number` must be finite) throw `[game] The command game.scroll got the field "dy", which it does not take.` with the fields it takes, and nothing runs. `clock` takes `{ advanceMs }` (cheat), calls `clock.advance(advanceMs)` and answers `{ now }`: a moment armed with `clock.scheduleAt` that is due arrives as `elapsed`; a visual test writes it as the step `{ clock: { advanceMs: 60_000 } }` to reach a clock-armed rest node (F157). While `pause` holds (`devtools`), `clock.now()` stands: only `step` (each frame moves it by `deltaMs` with the frame time) and `clock` move it, so a frame-stepped trace is deterministic; after `resume` it goes on from where it stood, behind the device clock by the pause, the advances kept. Another pause reason, such as `background`, keeps the clock on the device (F169). `capture` resolves `{ png }`, and `{ png, legend }` with `legend: true`; `undefined` while the renderer is inert. `timeScale` takes `{ scale }`; 0 freezes game time while the frames keep running. `frameRate` takes `{ fps? }`, calls `time.setRate(fps ?? "auto")` and answers `time.rate()`. `mute` takes `{ muted }`, mutes the master bus and answers the flag. Without `audioPlugin` it throws `[game] The command game.mute needs audioPlugin.` `trace` takes `{ path }`, a list of views by projection key, and answers whether the gate took the answer. `scroll` takes `{ key, to }`, calls `ui.scroll(key, to)` and answers what it answers; a visual test writes it as the step `{ scroll: { key, to } }`. `filter` takes `{ kind, on }`, switches the filter kind through `effects.diagnostics` (cosmetic) and answers the off kinds; an unknown kind throws `[game] No filter kind "fx.nope".` naming the known ones; without `effectsPlugin` it throws `[game] The command game.filter needs effectsPlugin.`
|
|
707
707
|
- Commands run in dev builds and debug builds. `__MOKU_GAME_DEV__ === true` (the dev page, a test's `vi.stubGlobal("__MOKU_GAME_DEV__", true)`) or `__MOKU_GAME_CONTROL__ === true` (`--debug`) runs every command; `__MOKU_GAME_AGENT__ === true` alone (`--debug=read`) runs the `read` and `cosmetic` ones and `run` refuses the others with `controlReadOnly(id)`, an error with `reason: "read-only"`: `[game] The command game.tap changes the game: this debug build runs read and cosmetic commands only.`; no flag: `run` throws `[game] Control commands run in dev builds only.` `moku-game build` defines the three flags `false`; a game without the shell uses a bundler `define` and should add `__MOKU_GAME_AGENT__: "false"` and `__MOKU_GAME_CONTROL__: "false"`. `saveExport` answers the committed `{ player, session, rng }` (read); `saveImport` takes `{ save }` of `saveExport`, restores it at the main flow's start and flushes the store (raw: not on a `--debug=read` page).
|
|
708
708
|
- A command's effect is `read`, `route`, `cosmetic`, `cheat` or `raw`. A `cheat` or `raw` command taints the session and is journaled; read it with `sources.tainted` and `sources.cheats`. Of the base commands `restore` and `saveImport` are `raw`; `capture` with `diff` writes the state too, so a `--debug=read` page refuses it. `bookmark` answers `flow.bookmark()` plus `scene`, the mounted scene; `restore` calls `scenes.expect(scene)` before `flow.restore`, so a bookmark at a popup restores the scene under it, also on a page that shows another scene. A bookmark taken while an effect that takes answers waits names the waiting transit node (`info/show` in the mini game) and carries `rest`; `restore` of it answers once that node's gate is open, with `pending.gate` in its value, and the popup shows on the next frame.
|
|
709
709
|
- A game's own: `defineSource({ id, title, input, changes, read })` with `changes` `"frame"`, `"commit"` or `"edge"`, and `defineCommand({ id, title, input, effect, run, overlay?, value?, choices?, choice? })`: `overlay: "toggle"` (input exactly `{ on: "boolean" }` and `value: app => boolean`, the switch's state; with `choices: readonly [string, ...string[]]`, each word once or `defineCommand` throws, the input is exactly `{ on: "boolean", choice: "string" | "string?" }` and `choice: app => string` answers the marked one, run with `{ on, choice }`) or `overlay: "button"` (no required input, no value) lists the command in the editor's overlay, which shows only such commands; any other combination is a type error. The id is camelCase words joined by dots, at least two: `dice.rolls`. An input schema maps field names to `"string"`, `"number"`, `"boolean"` or `"json"`; a trailing `?` makes one optional. A command body starts with `if (typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) throw controlRefused();`: it runs in dev and is refused on a debug page. A `.dev` command meant for a debug page writes the agent form for a read or cosmetic effect, `if ((typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) && (typeof __MOKU_GAME_AGENT__ === "undefined" || !__MOKU_GAME_AGENT__)) throw controlRefused();`, and the control form (`__MOKU_GAME_CONTROL__` in place of `__MOKU_GAME_AGENT__`) for the others. Keep them in `.dev` modules that only the dev page, a debug page and the tests import: the editor's dev page (`preparePage` with agents) and `moku-game build --debug` import every `**/*.dev.ts`, `moku-game build` none.
|