@moku-labs/game 0.15.105 → 0.15.107
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-DW0HRGor.d.mts → commands-DbfqO2Ux.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-DnQHkikh.d.mts → define-CLT2BTJ1.d.mts} +2 -2
- package/dist/{headless-DDAKncmX.d.mts → headless-JxtMwRQh.d.mts} +1 -1
- package/dist/{index-DuPTdMhJ.d.mts → index-DMegir4-.d.mts} +5 -4
- 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-RUEeOVCg.d.mts → runtime-Cp791TIi.d.mts} +1 -1
- package/dist/{src-DnqlJ1XY.mjs → src-BEW0gDir.mjs} +301 -68
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-CpoZ-UDH.d.mts → types-BZ1TWYOl.d.mts} +2 -2
- package/dist/{types-COMxJbej.d.mts → types-D7NamN-U.d.mts} +4 -4
- package/dist/{types-Ca0PmSri.d.mts → types-DC6Ifx57.d.mts} +2 -2
- package/dist/{types-KRAWEuUs.d.mts → types-DHD4RaXN.d.mts} +95 -18
- package/dist/{types-BFWYGikY.d.mts → types-Db2VOFFW.d.mts} +1 -1
- package/dist/{visual-pvIoUjpL.d.mts → visual-v4VYekoe.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-DHD4RaXN.mjs";
|
|
2
|
+
import { Et as PlatformProvider } from "../index-DMegir4-.mjs";
|
|
3
|
+
import { _ as SystemName, g as SystemModules, v as SystemShellFactory } from "../types-D7NamN-U.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-DHD4RaXN.mjs";
|
|
2
|
+
import { J as StringTable } from "./types-Db2VOFFW.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-D7NamN-U.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-BEW0gDir.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-DHD4RaXN.mjs";
|
|
2
|
+
import { W as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-BZ1TWYOl.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-Db2VOFFW.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-JxtMwRQh.mjs";
|
|
5
|
+
import { i as ControlApp, r as Command } from "./types-DC6Ifx57.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-JxtMwRQh.mjs";
|
|
2
|
+
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-DC6Ifx57.mjs";
|
|
3
|
+
import { t as commands } from "./commands-DbfqO2Ux.mjs";
|
|
4
|
+
import { t as defineCommand } from "./define-CLT2BTJ1.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-JxtMwRQh.mjs";
|
|
2
|
+
import { l as Source, r as Command, s as InputSchema } from "./types-DC6Ifx57.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-DHD4RaXN.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-DHD4RaXN.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-BZ1TWYOl.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-Db2VOFFW.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
|
@@ -126,7 +126,8 @@ declare function defineTextFormats(map: Readonly<Record<string, TextFormatFuncti
|
|
|
126
126
|
* Types a projection: keyed items of the model turned into entities. `Item` is inferred from the
|
|
127
127
|
* return of `from` and reaches `key`, `view` and every motion hook; `layer` and `lift` stay
|
|
128
128
|
* literal, so `defineScene` can check them against the layers of the scene. Each pair of
|
|
129
|
-
* `initialOnly` has its field names checked against its own component
|
|
129
|
+
* `initialOnly` has its field names checked against its own component, and its `when`, if any,
|
|
130
|
+
* takes the item.
|
|
130
131
|
*
|
|
131
132
|
* @param spec - Name, layer, optional lift layer, `from`, `key`, `view`, the motion hooks and
|
|
132
133
|
* the `initialOnly` fields.
|
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-DHD4RaXN.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-BZ1TWYOl.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-Db2VOFFW.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-DMegir4-.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-BEW0gDir.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-DHD4RaXN.mjs";
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-BZ1TWYOl.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-Db2VOFFW.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-JxtMwRQh.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-DC6Ifx57.mjs";
|
|
6
|
+
import { n as defineSource } from "./define-CLT2BTJ1.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-Cp791TIi.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-Cp791TIi.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-Db2VOFFW.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. */
|
|
@@ -10823,7 +10823,10 @@ function createViewRecord(entity, projection, key, item, rest, cause = "mount")
|
|
|
10823
10823
|
dropWhenStill: false,
|
|
10824
10824
|
loopOwed: false,
|
|
10825
10825
|
exiting: false,
|
|
10826
|
-
cause
|
|
10826
|
+
cause,
|
|
10827
|
+
seed: void 0,
|
|
10828
|
+
mask: 0,
|
|
10829
|
+
maskWarned: false
|
|
10827
10830
|
};
|
|
10828
10831
|
}
|
|
10829
10832
|
//#endregion
|
|
@@ -11575,6 +11578,8 @@ function routeHint(hints, projection, key) {
|
|
|
11575
11578
|
}
|
|
11576
11579
|
//#endregion
|
|
11577
11580
|
//#region src/plugins/world/projection/mutes.ts
|
|
11581
|
+
/** The most pairs with a `when` one spec may list: one bit each of a 32-bit mask. */
|
|
11582
|
+
const MOST_WHENS = 32;
|
|
11578
11583
|
/**
|
|
11579
11584
|
* Tells a table `mute()` made apart from a shared `initialOnly` seed, which is frozen.
|
|
11580
11585
|
*
|
|
@@ -11614,17 +11619,15 @@ function ownFields(stored) {
|
|
|
11614
11619
|
return isOwnFields(stored) ? stored : new Set(stored);
|
|
11615
11620
|
}
|
|
11616
11621
|
/**
|
|
11617
|
-
* The `initialOnly` fields of one component of a view, from the
|
|
11622
|
+
* The `initialOnly` fields of one component of a view, from the seed the view was born with.
|
|
11618
11623
|
*
|
|
11619
11624
|
* @param state - The projection branch of the plugin state.
|
|
11620
11625
|
* @param entity - The entity of the view.
|
|
11621
11626
|
* @param name - The component name.
|
|
11622
|
-
* @returns The seed set, or `undefined` for an entity that is no view
|
|
11627
|
+
* @returns The seed set, or `undefined` for an entity that is no view, or one no pair covers.
|
|
11623
11628
|
*/
|
|
11624
11629
|
function initialFieldsOf(state, entity, name) {
|
|
11625
|
-
|
|
11626
|
-
const spec = projection === void 0 ? void 0 : state.specs.get(projection);
|
|
11627
|
-
return spec === void 0 ? void 0 : state.initialOnly.get(spec)?.get(name);
|
|
11630
|
+
return state.byEntity.get(entity)?.seed?.get(name);
|
|
11628
11631
|
}
|
|
11629
11632
|
/**
|
|
11630
11633
|
* Deletes a released field set once it is empty, and the entity's table once no component is
|
|
@@ -11643,9 +11646,43 @@ function dropEmptyMute(mutes, entity, table, name, owned) {
|
|
|
11643
11646
|
if (table.size === 0) mutes.delete(entity);
|
|
11644
11647
|
}
|
|
11645
11648
|
/**
|
|
11649
|
+
* Counts one more live mute of each field in a field set a mute wrote.
|
|
11650
|
+
*
|
|
11651
|
+
* @param state - The projection branch of the plugin state.
|
|
11652
|
+
* @param owned - The field set the mute wrote.
|
|
11653
|
+
* @param fields - The fields it names.
|
|
11654
|
+
*/
|
|
11655
|
+
function holdFields(state, owned, fields) {
|
|
11656
|
+
let counts = state.muteCounts.get(owned);
|
|
11657
|
+
if (counts === void 0) {
|
|
11658
|
+
counts = /* @__PURE__ */ new Map();
|
|
11659
|
+
state.muteCounts.set(owned, counts);
|
|
11660
|
+
}
|
|
11661
|
+
for (const field of fields) counts.set(field, (counts.get(field) ?? 0) + 1);
|
|
11662
|
+
}
|
|
11663
|
+
/**
|
|
11664
|
+
* Counts one live mute of a field less.
|
|
11665
|
+
*
|
|
11666
|
+
* @param state - The projection branch of the plugin state.
|
|
11667
|
+
* @param owned - The field set the mute wrote.
|
|
11668
|
+
* @param field - The field.
|
|
11669
|
+
* @returns True when no live mute holds the field any more.
|
|
11670
|
+
*/
|
|
11671
|
+
function dropHold(state, owned, field) {
|
|
11672
|
+
const counts = state.muteCounts.get(owned);
|
|
11673
|
+
const left = (counts?.get(field) ?? 1) - 1;
|
|
11674
|
+
if (left > 0) {
|
|
11675
|
+
counts?.set(field, left);
|
|
11676
|
+
return false;
|
|
11677
|
+
}
|
|
11678
|
+
counts?.delete(field);
|
|
11679
|
+
return true;
|
|
11680
|
+
}
|
|
11681
|
+
/**
|
|
11646
11682
|
* Hands fields of one component of one entity to another writer, until the remover runs. A view
|
|
11647
|
-
* born with an `initialOnly` seed gets its own copy first.
|
|
11648
|
-
*
|
|
11683
|
+
* born with an `initialOnly` seed gets its own copy first. Mutes of one field nest: each counts,
|
|
11684
|
+
* and the field is handed back when the last of them is released. The remover keeps the fields of
|
|
11685
|
+
* the view's seed, asked when it runs: a mute made inside the spawn came before the view was known.
|
|
11649
11686
|
*
|
|
11650
11687
|
* @param state - The projection branch of the plugin state.
|
|
11651
11688
|
* @param entity - The entity.
|
|
@@ -11657,6 +11694,7 @@ function muteFields(state, entity, name, fields) {
|
|
|
11657
11694
|
const table = ownTable(state.mutes.get(entity));
|
|
11658
11695
|
const owned = ownFields(table.get(name));
|
|
11659
11696
|
for (const field of fields) owned.add(field);
|
|
11697
|
+
holdFields(state, owned, fields);
|
|
11660
11698
|
forgetJoined(state, owned);
|
|
11661
11699
|
table.set(name, owned);
|
|
11662
11700
|
state.mutes.set(entity, table);
|
|
@@ -11665,45 +11703,147 @@ function muteFields(state, entity, name, fields) {
|
|
|
11665
11703
|
if (released) return;
|
|
11666
11704
|
released = true;
|
|
11667
11705
|
const kept = initialFieldsOf(state, entity, name);
|
|
11668
|
-
for (const field of fields) if (kept?.has(field) !== true) owned.delete(field);
|
|
11706
|
+
for (const field of fields) if (dropHold(state, owned, field) && kept?.has(field) !== true) owned.delete(field);
|
|
11669
11707
|
forgetJoined(state, owned);
|
|
11670
11708
|
dropEmptyMute(state.mutes, entity, table, name, owned);
|
|
11671
11709
|
};
|
|
11672
11710
|
}
|
|
11673
11711
|
/**
|
|
11674
|
-
*
|
|
11675
|
-
* component named twice with both lists joined.
|
|
11712
|
+
* Checks one pair of a spec's `initialOnly` list.
|
|
11676
11713
|
*
|
|
11677
11714
|
* @param spec - The projection spec.
|
|
11678
|
-
* @param
|
|
11679
|
-
* @
|
|
11680
|
-
* @throws {Error} For a pair with no field.
|
|
11715
|
+
* @param pair - The pair.
|
|
11716
|
+
* @throws {Error} For a pair with no field, and for a third element that is no function.
|
|
11681
11717
|
*/
|
|
11682
|
-
function
|
|
11718
|
+
function checkPair(spec, pair) {
|
|
11719
|
+
const [component, fields, when] = pair;
|
|
11720
|
+
const name = component.componentName;
|
|
11721
|
+
if (fields.length === 0) throw new Error(`[game] Projection "${spec.name}" lists ${name} in initialOnly with no field.\n Name the fields only the birth of a view writes, or drop the pair.`);
|
|
11722
|
+
if (pair.length > 2 && typeof when !== "function") throw new Error(`[game] Projection "${spec.name}" lists ${name} in initialOnly with a "when" that is no function.\n Give a function of the item, or drop the third element.`);
|
|
11723
|
+
}
|
|
11724
|
+
/**
|
|
11725
|
+
* The indices of the pairs with a `when`, in order.
|
|
11726
|
+
*
|
|
11727
|
+
* @param spec - The projection spec.
|
|
11728
|
+
* @param pairs - Its checked `initialOnly` list.
|
|
11729
|
+
* @returns The indices.
|
|
11730
|
+
* @throws {Error} For more pairs with a `when` than a mask holds.
|
|
11731
|
+
*/
|
|
11732
|
+
function asksOf(spec, pairs) {
|
|
11733
|
+
const asks = [];
|
|
11734
|
+
for (const [index, pair] of pairs.entries()) if (pair[2] !== void 0) asks.push(index);
|
|
11735
|
+
if (asks.length > MOST_WHENS) throw new Error(`[game] Projection "${spec.name}" lists ${asks.length} initialOnly pairs with a "when".\n Join pairs that ask the same, to ${MOST_WHENS} at most.`);
|
|
11736
|
+
return asks;
|
|
11737
|
+
}
|
|
11738
|
+
/**
|
|
11739
|
+
* Builds the frozen seed of one answer mask: component name to its fields, from the pairs without
|
|
11740
|
+
* a `when` and the pairs whose bit is set, a component named twice with both lists joined.
|
|
11741
|
+
*
|
|
11742
|
+
* @param book - The seed book of the spec.
|
|
11743
|
+
* @param mask - The answers, bit i for the i-th pair with a `when`.
|
|
11744
|
+
* @returns The seed, or `undefined` when the mask covers no pair.
|
|
11745
|
+
*/
|
|
11746
|
+
function buildSeed(book, mask) {
|
|
11683
11747
|
const seed = /* @__PURE__ */ new Map();
|
|
11684
|
-
|
|
11748
|
+
let whenBit = 0;
|
|
11749
|
+
for (const [component, fields, when] of book.pairs) {
|
|
11750
|
+
if (when !== void 0) {
|
|
11751
|
+
const covered = (mask & 1 << whenBit) !== 0;
|
|
11752
|
+
whenBit += 1;
|
|
11753
|
+
if (!covered) continue;
|
|
11754
|
+
}
|
|
11685
11755
|
const name = component.componentName;
|
|
11686
|
-
if (fields.length === 0) throw new Error(`[game] Projection "${spec.name}" lists ${name} in initialOnly with no field.\n Name the fields only the birth of a view writes, or drop the pair.`);
|
|
11687
11756
|
seed.set(name, Object.freeze(/* @__PURE__ */ new Set([...seed.get(name) ?? [], ...fields])));
|
|
11688
11757
|
}
|
|
11689
|
-
return Object.freeze(seed);
|
|
11758
|
+
return seed.size === 0 ? void 0 : Object.freeze(seed);
|
|
11690
11759
|
}
|
|
11691
11760
|
/**
|
|
11692
|
-
*
|
|
11693
|
-
*
|
|
11694
|
-
*
|
|
11761
|
+
* The seed of one answer mask, built the first time a view is born with it, then the same table.
|
|
11762
|
+
*
|
|
11763
|
+
* @param book - The seed book of the spec.
|
|
11764
|
+
* @param mask - The answers.
|
|
11765
|
+
* @returns The shared seed, or `undefined` for a mask that covers no pair.
|
|
11766
|
+
*/
|
|
11767
|
+
function seedFor(book, mask) {
|
|
11768
|
+
if (book.seeds.has(mask)) return book.seeds.get(mask);
|
|
11769
|
+
const seed = buildSeed(book, mask);
|
|
11770
|
+
book.seeds.set(mask, seed);
|
|
11771
|
+
return seed;
|
|
11772
|
+
}
|
|
11773
|
+
/**
|
|
11774
|
+
* Creates the empty seed table of a book. It lives in its own non-exported function because lint
|
|
11775
|
+
* rule L5 refuses a collection built inside an exported declaration.
|
|
11776
|
+
*
|
|
11777
|
+
* @returns An empty table of mask to seed.
|
|
11778
|
+
*/
|
|
11779
|
+
function emptySeeds() {
|
|
11780
|
+
return /* @__PURE__ */ new Map();
|
|
11781
|
+
}
|
|
11782
|
+
/**
|
|
11783
|
+
* Checks the `initialOnly` list of a spec and makes its seed book, keeping nothing. A spec whose
|
|
11784
|
+
* pairs have no `when` gets the one seed of mask 0 now, as before.
|
|
11695
11785
|
*
|
|
11696
|
-
* @param state - The projection branch of the plugin state.
|
|
11697
11786
|
* @param spec - The spec `register` or `replace` stores.
|
|
11698
|
-
* @returns The
|
|
11699
|
-
* @throws {Error} For a pair with no field
|
|
11787
|
+
* @returns The book, or `undefined` for a spec without the option or with an empty list.
|
|
11788
|
+
* @throws {Error} For a pair with no field, a `when` that is no function, or too many `when`s.
|
|
11700
11789
|
*/
|
|
11701
|
-
function
|
|
11790
|
+
function checkBook(spec) {
|
|
11702
11791
|
const pairs = spec.initialOnly;
|
|
11703
11792
|
if (pairs === void 0 || pairs.length === 0) return void 0;
|
|
11704
|
-
const
|
|
11705
|
-
|
|
11706
|
-
|
|
11793
|
+
for (const pair of pairs) checkPair(spec, pair);
|
|
11794
|
+
const book = {
|
|
11795
|
+
pairs,
|
|
11796
|
+
asks: asksOf(spec, pairs),
|
|
11797
|
+
seeds: emptySeeds()
|
|
11798
|
+
};
|
|
11799
|
+
if (book.asks.length === 0) seedFor(book, 0);
|
|
11800
|
+
return book;
|
|
11801
|
+
}
|
|
11802
|
+
/**
|
|
11803
|
+
* Checks the `initialOnly` list of a spec and keeps its seed book: once per spec, since a name is
|
|
11804
|
+
* registered once and `replace` brings a new spec.
|
|
11805
|
+
*
|
|
11806
|
+
* @param state - The projection branch of the plugin state.
|
|
11807
|
+
* @param spec - The spec `register` stores.
|
|
11808
|
+
* @throws {Error} For a pair with no field, a `when` that is no function, or too many `when`s;
|
|
11809
|
+
* nothing is kept then.
|
|
11810
|
+
*/
|
|
11811
|
+
function learnSeed(state, spec) {
|
|
11812
|
+
const book = checkBook(spec);
|
|
11813
|
+
if (book !== void 0) state.initialOnly.set(spec, book);
|
|
11814
|
+
}
|
|
11815
|
+
/**
|
|
11816
|
+
* Asks the `when`s of a book on one item.
|
|
11817
|
+
*
|
|
11818
|
+
* @param book - The seed book of the spec, if it has one.
|
|
11819
|
+
* @param item - The item.
|
|
11820
|
+
* @returns The answers, bit i set when the i-th `when` answers true; 0 with no book or no `when`.
|
|
11821
|
+
* @throws {Error} What a `when` throws.
|
|
11822
|
+
*/
|
|
11823
|
+
function maskOfBook(book, item) {
|
|
11824
|
+
if (book === void 0) return 0;
|
|
11825
|
+
const { asks, pairs } = book;
|
|
11826
|
+
const count = asks.length;
|
|
11827
|
+
let mask = 0;
|
|
11828
|
+
for (let bit = 0; bit < count; bit += 1) {
|
|
11829
|
+
const when = pairs[asks[bit] ?? 0]?.[2];
|
|
11830
|
+
if (when?.(item) === true) mask |= 1 << bit;
|
|
11831
|
+
}
|
|
11832
|
+
return mask;
|
|
11833
|
+
}
|
|
11834
|
+
/**
|
|
11835
|
+
* The answers a view is born with: the `when`s of its projection asked on the item it is born
|
|
11836
|
+
* with. Asked before the spawn, so a `when` that throws spawns nothing, as a `view` that throws.
|
|
11837
|
+
*
|
|
11838
|
+
* @param state - The projection branch of the plugin state.
|
|
11839
|
+
* @param spec - The projection spec.
|
|
11840
|
+
* @param item - The item of the birth: the model item, or the warm item for a warm build.
|
|
11841
|
+
* @returns The mask; 0 for a spec without a `when`.
|
|
11842
|
+
* @throws {Error} What a `when` throws.
|
|
11843
|
+
*/
|
|
11844
|
+
function birthMask(state, spec, item) {
|
|
11845
|
+
if (spec.initialOnly === void 0) return 0;
|
|
11846
|
+
return maskOfBook(state.initialOnly.get(spec), item);
|
|
11707
11847
|
}
|
|
11708
11848
|
/**
|
|
11709
11849
|
* Joins a seed into a table of the entity's own, in place, so the remover of every mute that wrote
|
|
@@ -11728,26 +11868,58 @@ function joinSeed(state, table, seed) {
|
|
|
11728
11868
|
}
|
|
11729
11869
|
}
|
|
11730
11870
|
/**
|
|
11731
|
-
* Gives a view that was just born the seed of its
|
|
11732
|
-
* projection writes or compares those fields. The birth itself wrote them from `view`.
|
|
11733
|
-
* listener of its spawn muted already keeps its table, and the seed
|
|
11871
|
+
* Gives a view that was just born the seed of its answers (`view.mask`), so from now on nothing of
|
|
11872
|
+
* the projection writes or compares those fields. The birth itself wrote them from `view`. The
|
|
11873
|
+
* view keeps the seed. A view a listener of its spawn muted already keeps its table, and the seed
|
|
11874
|
+
* joins it.
|
|
11734
11875
|
*
|
|
11735
11876
|
* @param state - The projection branch of the plugin state.
|
|
11736
11877
|
* @param spec - The projection spec.
|
|
11737
|
-
* @param
|
|
11878
|
+
* @param view - The new view, its mask set.
|
|
11738
11879
|
*/
|
|
11739
|
-
function seedMutes(state, spec,
|
|
11880
|
+
function seedMutes(state, spec, view) {
|
|
11740
11881
|
if (spec.initialOnly === void 0) return;
|
|
11741
|
-
const
|
|
11882
|
+
const book = state.initialOnly.get(spec);
|
|
11883
|
+
const seed = book === void 0 ? void 0 : seedFor(book, view.mask);
|
|
11742
11884
|
if (seed === void 0) return;
|
|
11743
|
-
|
|
11885
|
+
view.seed = seed;
|
|
11886
|
+
const stored = state.mutes.get(view.entity);
|
|
11744
11887
|
if (stored === void 0) {
|
|
11745
|
-
state.mutes.set(entity, seed);
|
|
11888
|
+
state.mutes.set(view.entity, seed);
|
|
11746
11889
|
return;
|
|
11747
11890
|
}
|
|
11748
11891
|
const table = ownTable(stored);
|
|
11749
11892
|
joinSeed(state, table, seed);
|
|
11750
|
-
state.mutes.set(entity, table);
|
|
11893
|
+
state.mutes.set(view.entity, table);
|
|
11894
|
+
}
|
|
11895
|
+
/**
|
|
11896
|
+
* The dev check after a view took a new item: when the `when`s of its projection answer otherwise
|
|
11897
|
+
* on it than at the birth, `world:initial-only-changed` is warned, once per view. Nothing changes
|
|
11898
|
+
* in the view. A release build asks nothing: the guard is inline, so a `define` of `false` folds
|
|
11899
|
+
* it. A `when` that throws here warns nothing: the reconcile of a dev build stops nowhere a release
|
|
11900
|
+
* build goes on.
|
|
11901
|
+
*
|
|
11902
|
+
* @param pctx - Domain context of the projection module.
|
|
11903
|
+
* @param spec - The projection spec.
|
|
11904
|
+
* @param view - The view, its item the new one.
|
|
11905
|
+
*/
|
|
11906
|
+
function checkDrift(pctx, spec, view) {
|
|
11907
|
+
if (typeof __MOKU_GAME_DEV__ === "undefined" || !__MOKU_GAME_DEV__) return;
|
|
11908
|
+
if (view.maskWarned || spec.initialOnly === void 0) return;
|
|
11909
|
+
const book = pctx.ctx.state.projection.initialOnly.get(spec);
|
|
11910
|
+
if (book === void 0 || book.asks.length === 0) return;
|
|
11911
|
+
let mask;
|
|
11912
|
+
try {
|
|
11913
|
+
mask = maskOfBook(book, view.item);
|
|
11914
|
+
} catch {
|
|
11915
|
+
return;
|
|
11916
|
+
}
|
|
11917
|
+
if (mask === view.mask) return;
|
|
11918
|
+
view.maskWarned = true;
|
|
11919
|
+
pctx.ctx.log.warn("world:initial-only-changed", {
|
|
11920
|
+
projection: spec.name,
|
|
11921
|
+
key: view.key
|
|
11922
|
+
});
|
|
11751
11923
|
}
|
|
11752
11924
|
/**
|
|
11753
11925
|
* Moves a view with a table of its own from one seed to the next: a set of the old seed goes, the
|
|
@@ -11757,7 +11929,7 @@ function seedMutes(state, spec, entity) {
|
|
|
11757
11929
|
* @param state - The projection branch of the plugin state.
|
|
11758
11930
|
* @param entity - The entity of the view.
|
|
11759
11931
|
* @param stored - The table the view has now, if any.
|
|
11760
|
-
* @param from - The seed
|
|
11932
|
+
* @param from - The seed the view held, if any.
|
|
11761
11933
|
* @param to - The seed of the new spec, if any.
|
|
11762
11934
|
*/
|
|
11763
11935
|
function reseedOwn(state, entity, stored, from, to) {
|
|
@@ -11768,24 +11940,54 @@ function reseedOwn(state, entity, stored, from, to) {
|
|
|
11768
11940
|
else state.mutes.set(entity, table);
|
|
11769
11941
|
}
|
|
11770
11942
|
/**
|
|
11771
|
-
* Moves
|
|
11772
|
-
*
|
|
11773
|
-
*
|
|
11774
|
-
* joins it.
|
|
11943
|
+
* Moves one view from the seed it holds to a new one. A view that holds its seed, or none, takes
|
|
11944
|
+
* the new seed. A view a `mute()` gave its own table keeps it: the sets of the old seed in it go,
|
|
11945
|
+
* the new seed joins it.
|
|
11775
11946
|
*
|
|
11776
11947
|
* @param state - The projection branch of the plugin state.
|
|
11777
|
-
* @param
|
|
11778
|
-
* @param
|
|
11779
|
-
* @param to - The seed of the new spec, if any.
|
|
11948
|
+
* @param view - The view.
|
|
11949
|
+
* @param to - The new seed, if any.
|
|
11780
11950
|
*/
|
|
11781
|
-
function
|
|
11951
|
+
function reseedView(state, view, to) {
|
|
11952
|
+
const from = view.seed;
|
|
11953
|
+
view.seed = to;
|
|
11782
11954
|
if (from === to) return;
|
|
11783
|
-
|
|
11784
|
-
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11955
|
+
const stored = state.mutes.get(view.entity);
|
|
11956
|
+
if (stored !== from) reseedOwn(state, view.entity, stored, from, to);
|
|
11957
|
+
else if (to === void 0) state.mutes.delete(view.entity);
|
|
11958
|
+
else state.mutes.set(view.entity, to);
|
|
11959
|
+
}
|
|
11960
|
+
/**
|
|
11961
|
+
* The views of one projection, in the order of `byEntity`.
|
|
11962
|
+
*
|
|
11963
|
+
* @param state - The projection branch of the plugin state.
|
|
11964
|
+
* @param name - The projection name.
|
|
11965
|
+
* @returns A new list.
|
|
11966
|
+
*/
|
|
11967
|
+
function viewsOf(state, name) {
|
|
11968
|
+
const views = [];
|
|
11969
|
+
for (const view of state.byEntity.values()) if (view.projection === name) views.push(view);
|
|
11970
|
+
return views;
|
|
11971
|
+
}
|
|
11972
|
+
/**
|
|
11973
|
+
* Replaces the `initialOnly` of a registered projection: checks the new spec, asks its `when`s on
|
|
11974
|
+
* the item every view of the projection shows now, then keeps its seed book and moves each view
|
|
11975
|
+
* from the seed it holds to the seed of its new answers. Every mask is asked before anything
|
|
11976
|
+
* moves, so a `when` that throws leaves the state as it was.
|
|
11977
|
+
*
|
|
11978
|
+
* @param state - The projection branch of the plugin state.
|
|
11979
|
+
* @param spec - The new spec, not yet stored.
|
|
11980
|
+
* @throws {Error} For a spec `learnSeed` refuses, and what a `when` throws; nothing moves then.
|
|
11981
|
+
*/
|
|
11982
|
+
function replaceSeed(state, spec) {
|
|
11983
|
+
const book = checkBook(spec);
|
|
11984
|
+
const views = viewsOf(state, spec.name);
|
|
11985
|
+
const masks = views.map((view) => maskOfBook(book, view.item));
|
|
11986
|
+
if (book !== void 0) state.initialOnly.set(spec, book);
|
|
11987
|
+
for (const [index, view] of views.entries()) {
|
|
11988
|
+
const mask = masks[index] ?? 0;
|
|
11989
|
+
view.mask = mask;
|
|
11990
|
+
reseedView(state, view, book === void 0 ? void 0 : seedFor(book, mask));
|
|
11789
11991
|
}
|
|
11790
11992
|
}
|
|
11791
11993
|
//#endregion
|
|
@@ -12094,19 +12296,22 @@ function coolShown(state, name, view) {
|
|
|
12094
12296
|
/**
|
|
12095
12297
|
* Writes the difference between a view's rest pose and a new output of `view` straight onto its entity: added and
|
|
12096
12298
|
* changed components are written, removed ones taken off, no hook runs and no motion plays. The direct write of a
|
|
12097
|
-
* changed item, for a held view and for the one the open shows.
|
|
12299
|
+
* changed item, for a held view and for the one the open shows. The view takes the new item, so a dev build checks
|
|
12300
|
+
* the `initialOnly` answers of its birth against it (`checkDrift`).
|
|
12098
12301
|
*
|
|
12099
12302
|
* @param pctx - Domain context of the projection module.
|
|
12303
|
+
* @param spec - The projection spec.
|
|
12100
12304
|
* @param view - The view.
|
|
12101
12305
|
* @param next - The new output of `view(item)`, by component name.
|
|
12102
12306
|
* @param item - The item it was made from.
|
|
12103
12307
|
*/
|
|
12104
|
-
function writeDifference(pctx, view, next, item) {
|
|
12308
|
+
function writeDifference(pctx, spec, view, next, item) {
|
|
12105
12309
|
const { changed } = diffComponents(view.rest, next, pctx.deps.components.Tree.componentName);
|
|
12106
12310
|
for (const [name, value] of next) if (!view.rest.has(name)) writeValue(pctx, view.entity, value);
|
|
12107
12311
|
for (const [name, value] of view.rest) if (!next.has(name)) pctx.deps.ecs.remove(view.entity, value.type);
|
|
12108
12312
|
view.rest = next;
|
|
12109
12313
|
view.item = item;
|
|
12314
|
+
checkDrift(pctx, spec, view);
|
|
12110
12315
|
finishHandles(view);
|
|
12111
12316
|
writeRestNow(pctx, view, changed);
|
|
12112
12317
|
}
|
|
@@ -12204,6 +12409,22 @@ function viewOfItem(pctx, spec, item) {
|
|
|
12204
12409
|
}
|
|
12205
12410
|
}
|
|
12206
12411
|
/**
|
|
12412
|
+
* Asks the `initialOnly` `when`s of a spec on a warm item. A throw is logged as a projection that failed.
|
|
12413
|
+
*
|
|
12414
|
+
* @param pctx - Domain context of the projection module.
|
|
12415
|
+
* @param spec - The projection spec.
|
|
12416
|
+
* @param item - The warm item.
|
|
12417
|
+
* @returns The answer mask, or `undefined` when a `when` threw.
|
|
12418
|
+
*/
|
|
12419
|
+
function maskOfItem(pctx, spec, item) {
|
|
12420
|
+
try {
|
|
12421
|
+
return birthMask(pctx.ctx.state.projection, spec, item);
|
|
12422
|
+
} catch (error) {
|
|
12423
|
+
pctx.ctx.log.error("world:projection-failed", { projection: spec.name }, asError$2(error));
|
|
12424
|
+
return;
|
|
12425
|
+
}
|
|
12426
|
+
}
|
|
12427
|
+
/**
|
|
12207
12428
|
* Starts the work of a record: it becomes the record in work, `left()` counts the warm budget from the frame rate
|
|
12208
12429
|
* the loop runs at, and the loop is woken, so the building frames come at the full rate.
|
|
12209
12430
|
*
|
|
@@ -12221,7 +12442,7 @@ function startWork(pctx, record) {
|
|
|
12221
12442
|
* Spawns the held view of a warm item, as a scene build spawns a view: bare, flagged held, then its `Layer` and its
|
|
12222
12443
|
* view components, so an `onAdded` hook already asks `isBuilding` true, and with `"change"` as its cause, so its
|
|
12223
12444
|
* enter plays when it is shown. The record is in work from before the spawn: what ui marks in its hooks is the
|
|
12224
|
-
* record's. Nothing is spawned when `view` throws.
|
|
12445
|
+
* record's. The `initialOnly` `when`s are asked on the warm item. Nothing is spawned when `view` or a `when` throws.
|
|
12225
12446
|
*
|
|
12226
12447
|
* @param pctx - Domain context of the projection module.
|
|
12227
12448
|
* @param spec - The projection spec.
|
|
@@ -12233,12 +12454,15 @@ function startWork(pctx, record) {
|
|
|
12233
12454
|
function spawnWarm(pctx, spec, record, warm) {
|
|
12234
12455
|
const values = viewOfItem(pctx, spec, warm.item);
|
|
12235
12456
|
if (values === void 0) return;
|
|
12457
|
+
const mask = maskOfItem(pctx, spec, warm.item);
|
|
12458
|
+
if (mask === void 0) return;
|
|
12236
12459
|
const state = pctx.ctx.state.projection;
|
|
12237
12460
|
startWork(pctx, record);
|
|
12238
12461
|
const entity = spawnFlagged(pctx, spec, values, state.warmHeld);
|
|
12239
12462
|
const view = createViewRecord(entity, spec.name, warm.key, warm.item, values, "change");
|
|
12240
12463
|
record.entities.add(entity);
|
|
12241
|
-
|
|
12464
|
+
view.mask = mask;
|
|
12465
|
+
seedMutes(state, spec, view);
|
|
12242
12466
|
state.byEntity.set(entity, view);
|
|
12243
12467
|
record.view = view;
|
|
12244
12468
|
record.key = warm.key;
|
|
@@ -12267,7 +12491,7 @@ function refreshWarm(pctx, spec, record, warm) {
|
|
|
12267
12491
|
return true;
|
|
12268
12492
|
}
|
|
12269
12493
|
startWork(pctx, record);
|
|
12270
|
-
writeDifference(pctx, view, next, warm.item);
|
|
12494
|
+
writeDifference(pctx, spec, view, next, warm.item);
|
|
12271
12495
|
record.item = warm.item;
|
|
12272
12496
|
return true;
|
|
12273
12497
|
}
|
|
@@ -12456,6 +12680,7 @@ function playEnter$1(pctx, spec, view, entry) {
|
|
|
12456
12680
|
function enterEntry(pctx, spec, mounted, entry) {
|
|
12457
12681
|
const values = collectView(pctx, spec, entry.item);
|
|
12458
12682
|
const state = pctx.ctx.state.projection;
|
|
12683
|
+
const mask = birthMask(state, spec, entry.item);
|
|
12459
12684
|
const building = state.building;
|
|
12460
12685
|
let entity;
|
|
12461
12686
|
if (building?.mounted.get(spec.name) === mounted) entity = spawnFlagged(pctx, spec, values, building.entities);
|
|
@@ -12467,7 +12692,8 @@ function enterEntry(pctx, spec, mounted, entry) {
|
|
|
12467
12692
|
}, [layer, ...values.values()]);
|
|
12468
12693
|
}
|
|
12469
12694
|
const view = createViewRecord(entity, spec.name, entry.key, entry.item, values, entry.direct ? "mount" : "change");
|
|
12470
|
-
|
|
12695
|
+
view.mask = mask;
|
|
12696
|
+
seedMutes(state, spec, view);
|
|
12471
12697
|
mounted.live.set(entry.key, view);
|
|
12472
12698
|
state.byEntity.set(entity, view);
|
|
12473
12699
|
state.membershipVersion += 1;
|
|
@@ -12495,8 +12721,10 @@ function adoptEntry(pctx, spec, mounted, record, entry) {
|
|
|
12495
12721
|
const view = record.view;
|
|
12496
12722
|
const next = sameItem(record.item, entry.item) ? void 0 : collectView(pctx, spec, entry.item);
|
|
12497
12723
|
showHeld$1(pctx, mounted, record, entry.direct ? "mount" : "change");
|
|
12498
|
-
if (next === void 0)
|
|
12499
|
-
|
|
12724
|
+
if (next === void 0) {
|
|
12725
|
+
view.item = entry.item;
|
|
12726
|
+
checkDrift(pctx, spec, view);
|
|
12727
|
+
} else writeDifference(pctx, spec, view, next, entry.item);
|
|
12500
12728
|
playEnter$1(pctx, spec, view, entry);
|
|
12501
12729
|
}
|
|
12502
12730
|
/**
|
|
@@ -12529,12 +12757,14 @@ function changeEntry(pctx, spec, view, entry) {
|
|
|
12529
12757
|
const previous = view.item;
|
|
12530
12758
|
if (!entry.direct && !entry.force && added.length + changed.length + removed.length === 0) {
|
|
12531
12759
|
view.item = entry.item;
|
|
12760
|
+
checkDrift(pctx, spec, view);
|
|
12532
12761
|
return false;
|
|
12533
12762
|
}
|
|
12534
12763
|
for (const value of valuesOf(next, added)) writeValue(pctx, view.entity, value);
|
|
12535
12764
|
for (const value of valuesOf(view.rest, removed)) pctx.deps.ecs.remove(view.entity, value.type);
|
|
12536
12765
|
view.rest = next;
|
|
12537
12766
|
view.item = entry.item;
|
|
12767
|
+
checkDrift(pctx, spec, view);
|
|
12538
12768
|
if (entry.direct) {
|
|
12539
12769
|
finishHandles(view);
|
|
12540
12770
|
writeRestNow(pctx, view, [...next.keys()]);
|
|
@@ -12585,6 +12815,7 @@ function reviveEntry(pctx, spec, mounted, view, entry) {
|
|
|
12585
12815
|
for (const value of valuesOf(view.rest, removed)) pctx.deps.ecs.remove(view.entity, value.type);
|
|
12586
12816
|
view.rest = next;
|
|
12587
12817
|
view.item = entry.item;
|
|
12818
|
+
checkDrift(pctx, spec, view);
|
|
12588
12819
|
if (entry.direct) {
|
|
12589
12820
|
writeRestNow(pctx, view, [...next.keys()]);
|
|
12590
12821
|
entry.rewritten.push(view);
|
|
@@ -13552,14 +13783,11 @@ function createProjectionApi(ctx, deps) {
|
|
|
13552
13783
|
state.specs.set(spec.name, spec);
|
|
13553
13784
|
},
|
|
13554
13785
|
replace: (spec) => {
|
|
13555
|
-
|
|
13556
|
-
if (previous === void 0) throw new Error(`[game] Projection "${spec.name}" is not registered.\n Register it before replacing it.`);
|
|
13786
|
+
if (state.specs.get(spec.name) === void 0) throw new Error(`[game] Projection "${spec.name}" is not registered.\n Register it before replacing it.`);
|
|
13557
13787
|
const mounted = state.mounted.has(spec.name);
|
|
13558
13788
|
if (mounted) checkLayers(spec, state.layers);
|
|
13559
|
-
|
|
13560
|
-
const seed = learnSeed(state, spec);
|
|
13789
|
+
replaceSeed(state, spec);
|
|
13561
13790
|
state.specs.set(spec.name, spec);
|
|
13562
|
-
reseedViews(state, spec.name, from, seed);
|
|
13563
13791
|
if (!mounted) return;
|
|
13564
13792
|
if (spec.warm === void 0 && !state.held.has(spec.name)) forgetWarm(pctx, spec.name);
|
|
13565
13793
|
else ensureWarm(state, spec);
|
|
@@ -14081,6 +14309,7 @@ function createProjectionState() {
|
|
|
14081
14309
|
keys: emptyMap$9(),
|
|
14082
14310
|
keysByEntity: emptyMap$9(),
|
|
14083
14311
|
mutes: emptyMap$9(),
|
|
14312
|
+
muteCounts: emptyWeakMap$2(),
|
|
14084
14313
|
initialOnly: emptyWeakMap$2(),
|
|
14085
14314
|
ownedSets: emptyWeakMap$2(),
|
|
14086
14315
|
joinedMutes: emptyWeakMap$2(),
|
|
@@ -30033,7 +30262,8 @@ function resort(sctx, entity, view) {
|
|
|
30033
30262
|
/**
|
|
30034
30263
|
* Rebuilds the layer containers when `world.projection.layers()` handed out a new list. A name
|
|
30035
30264
|
* that stayed keeps its container, its hidden mask and every view in it; a name that left is
|
|
30036
|
-
* detached, and the views that still name it are reported.
|
|
30265
|
+
* detached, and the views that still name it are reported. A layer the loader of a scene being left holds above the
|
|
30266
|
+
* veil stays there.
|
|
30037
30267
|
*
|
|
30038
30268
|
* @param sctx - Domain context of the sync module.
|
|
30039
30269
|
* @returns True when the list was new and the containers were rebuilt.
|
|
@@ -30061,9 +30291,11 @@ function syncLayers(sctx) {
|
|
|
30061
30291
|
dropLeftLayers(sctx, next);
|
|
30062
30292
|
state.layers = next;
|
|
30063
30293
|
state.hudLayer = hudLayerIn(next);
|
|
30294
|
+
const held = state.leave.objects?.held;
|
|
30064
30295
|
for (const spec of list) {
|
|
30065
30296
|
const container = next.get(spec.name)?.container;
|
|
30066
|
-
if (container
|
|
30297
|
+
if (container === void 0) continue;
|
|
30298
|
+
if (!(held !== void 0 && container.parent === held)) root.addChild(container);
|
|
30067
30299
|
}
|
|
30068
30300
|
return true;
|
|
30069
30301
|
}
|
|
@@ -74983,7 +75215,8 @@ function scenesFor() {
|
|
|
74983
75215
|
* Types a projection: keyed items of the model turned into entities. `Item` is inferred from the
|
|
74984
75216
|
* return of `from` and reaches `key`, `view` and every motion hook; `layer` and `lift` stay
|
|
74985
75217
|
* literal, so `defineScene` can check them against the layers of the scene. Each pair of
|
|
74986
|
-
* `initialOnly` has its field names checked against its own component
|
|
75218
|
+
* `initialOnly` has its field names checked against its own component, and its `when`, if any,
|
|
75219
|
+
* takes the item.
|
|
74987
75220
|
*
|
|
74988
75221
|
* @param spec - Name, layer, optional lift layer, `from`, `key`, `view`, the motion hooks and
|
|
74989
75222
|
* the `initialOnly` fields.
|
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-DHD4RaXN.mjs";
|
|
2
|
+
import { t as createApp } from "./index-DMegir4-.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-D7NamN-U.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-JxtMwRQh.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-BEW0gDir.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FilterSlotQuad, Br as Api$6, Hn as TypeTag, Hr as Events$3, O as FilterSlot, Un as Descriptor, Ur as Json, Z as Api$4, Zn as AnchorTarget, _r as ComponentType, _t as Point, ai as Events$5, at as PixiTexture, b as Events$4, er as Ease, fr as AnyComponent, hr as ComponentHandle, ir as NumericFields, it as PixiSprite, j as SyncApi, k as FilterSlotInputs, kr as Api$3, li as Api$1, lr as TrackOptions, mr as AnyComponentValue, nt as PixiGpuProgram, ot as PixiUniformGroup, pn as Api$2, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$5, tt as PixiFilter, ur as TrackSegment, vi as Events$2, yi as Require, yr as Entity, yt as FilterCache } from "./types-
|
|
2
|
-
import { R as InputApi, T as TextApi, U as I18nApi, c as UiNode, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion, tt as StylesState } from "./types-
|
|
1
|
+
import { A as FilterSlotQuad, Br as Api$6, Hn as TypeTag, Hr as Events$3, O as FilterSlot, Un as Descriptor, Ur as Json, Z as Api$4, Zn as AnchorTarget, _r as ComponentType, _t as Point, ai as Events$5, at as PixiTexture, b as Events$4, er as Ease, fr as AnyComponent, hr as ComponentHandle, ir as NumericFields, it as PixiSprite, j as SyncApi, k as FilterSlotInputs, kr as Api$3, li as Api$1, lr as TrackOptions, mr as AnyComponentValue, nt as PixiGpuProgram, ot as PixiUniformGroup, pn as Api$2, rr as MotionHandle, rt as PixiModule, s as Events$1, sr as ReducedMotion, t as Api$5, tt as PixiFilter, ur as TrackSegment, vi as Events$2, yi as Require, yr as Entity, yt as FilterCache } from "./types-DHD4RaXN.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-Db2VOFFW.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-DHD4RaXN.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-BZ1TWYOl.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-Db2VOFFW.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-DMegir4-.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Qr as Snapshot, Ur as Json } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Qr as Snapshot, Ur as Json } from "./types-DHD4RaXN.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-JxtMwRQh.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -3746,28 +3746,51 @@ type AnyProjectionMotion = {
|
|
|
3746
3746
|
};
|
|
3747
3747
|
/**
|
|
3748
3748
|
* One pair of `ProjectionSpec.initialOnly`: a component and the fields of it that `view` gives a
|
|
3749
|
-
* view once, when it is born. The field names are checked against the component's own value.
|
|
3749
|
+
* view once, when it is born. The field names are checked against the component's own value. A
|
|
3750
|
+
* third element, `when`, covers only the views whose item answers true at their birth; `Item` is
|
|
3751
|
+
* the item `from` gives, so `when` reads its fields checked. The answer is fixed for the life of
|
|
3752
|
+
* the view. Without `when` the pair covers every view.
|
|
3750
3753
|
*
|
|
3751
3754
|
* @example
|
|
3752
3755
|
* ```ts
|
|
3756
|
+
* // The arc of every ring is the system's.
|
|
3753
3757
|
* const arc: InitialOnlyPair<ShapeValue> = [Shape, ["sweep"]];
|
|
3758
|
+
* // Only the hand of the stopwatch turns with the clock; its bolt keeps the rotation `view` gives.
|
|
3759
|
+
* type Part = { id: string; role: "bolt" | "restHand" };
|
|
3760
|
+
* const hand: InitialOnlyPair<TransformValue, Part> = [Transform, ["rotation"], part => part.role === "restHand"];
|
|
3761
|
+
* hand[2]?.({ id: "hand", role: "restHand" }); // true
|
|
3762
|
+
* hand[2]?.({ id: "bolt", role: "bolt" }); // false
|
|
3754
3763
|
* ```
|
|
3755
3764
|
*/
|
|
3756
|
-
type InitialOnlyPair<Value extends object> = readonly [ComponentHandle<Value>, readonly (keyof Value & string)[]];
|
|
3765
|
+
type InitialOnlyPair<Value extends object, Item = unknown> = readonly [ComponentHandle<Value>, readonly (keyof Value & string)[]] | readonly [ComponentHandle<Value>, readonly (keyof Value & string)[], (item: NoInfer<Item>) => boolean];
|
|
3757
3766
|
/**
|
|
3758
3767
|
* The `initialOnly` list of a projection: one pair for each value type of `Values`, each pair
|
|
3759
|
-
* checked against its own component
|
|
3760
|
-
* `[[Shape, ["swep"]]]`
|
|
3768
|
+
* checked against its own component, and each `when` typed with the item `Item` of `from`.
|
|
3769
|
+
* `projection()` infers `Values` from the list and `Item` from `from`, so `[[Shape, ["swep"]]]`
|
|
3770
|
+
* and a `when` that reads a field the item lacks are type errors.
|
|
3761
3771
|
*
|
|
3762
3772
|
* @example
|
|
3763
3773
|
* ```ts
|
|
3764
|
-
*
|
|
3774
|
+
* type Part = { id: string; role: "bolt" | "restHand" };
|
|
3775
|
+
* const fields: InitialOnly<[ShapeValue, TransformValue], Part> = [
|
|
3765
3776
|
* [Shape, ["sweep", "alpha"]],
|
|
3766
|
-
* [Transform, ["rotation"]]
|
|
3777
|
+
* [Transform, ["rotation"], part => part.role === "restHand"]
|
|
3767
3778
|
* ];
|
|
3768
3779
|
* ```
|
|
3769
3780
|
*/
|
|
3770
|
-
type InitialOnly<Values extends readonly object[]> = { readonly [Index in keyof Values]: InitialOnlyPair<Values[Index]> };
|
|
3781
|
+
type InitialOnly<Values extends readonly object[], Item = unknown> = { readonly [Index in keyof Values]: InitialOnlyPair<Values[Index], Item> };
|
|
3782
|
+
/**
|
|
3783
|
+
* The `when` of an `initialOnly` pair with the item type erased, as the world stores it. A method
|
|
3784
|
+
* signature, so a `when` typed for a game's item still reaches the erased spec.
|
|
3785
|
+
*/
|
|
3786
|
+
type AnyWhen = {
|
|
3787
|
+
bivariant(item: unknown): boolean;
|
|
3788
|
+
}["bivariant"];
|
|
3789
|
+
/**
|
|
3790
|
+
* One `initialOnly` pair of an erased spec: the component, its field names no longer tied to it,
|
|
3791
|
+
* and the `when` if any.
|
|
3792
|
+
*/
|
|
3793
|
+
type AnyInitialOnlyPair = readonly [ComponentHandle<object>, readonly string[], AnyWhen?];
|
|
3771
3794
|
/**
|
|
3772
3795
|
* A scene switch, as a plugin hands it to a projection with `projection.feed`: the scene left, the scene entered, and
|
|
3773
3796
|
* the share of the switch's bundles loaded, 0 to 1. The projection's `from` reads it as its third argument. `scenes`
|
|
@@ -3844,6 +3867,13 @@ type ProjectionSpec<Item, LayerName extends string, LiftName extends string, Pla
|
|
|
3844
3867
|
* rules of `mute()`, for every view of the projection and for its whole life. A `mute()` on the
|
|
3845
3868
|
* view adds to them, and its release keeps them. Left out, the projection writes every field.
|
|
3846
3869
|
*
|
|
3870
|
+
* A third element, `when(item)`, covers only some views: it is asked once, at the birth of a
|
|
3871
|
+
* view (for a view a warm window builds, on the warm item), and the answer holds for the life of
|
|
3872
|
+
* the view. A `when` that throws is a failed birth, `world:projection-failed`, as a `view` that
|
|
3873
|
+
* throws. A dev build warns `world:initial-only-changed` once per view when a later item would
|
|
3874
|
+
* answer otherwise; nothing changes in the view. `replace` asks the new spec's `when` on the item
|
|
3875
|
+
* each live view shows.
|
|
3876
|
+
*
|
|
3847
3877
|
* @example
|
|
3848
3878
|
* ```ts
|
|
3849
3879
|
* // The timer ring of a chest: born full, then the system `board.rings` draws its arc from `Now`.
|
|
@@ -3863,8 +3893,23 @@ type ProjectionSpec<Item, LayerName extends string, LiftName extends string, Pla
|
|
|
3863
3893
|
* });
|
|
3864
3894
|
* // The fade ends with the 0.42 the system wrote: no full ring, no `world:view-corrected`.
|
|
3865
3895
|
* ```
|
|
3896
|
+
* @example
|
|
3897
|
+
* ```ts
|
|
3898
|
+
* // The stopwatch: its bolt tweens home with the enter motion, its hand turns with `Now`.
|
|
3899
|
+
* export const stopwatch = projection({
|
|
3900
|
+
* name: "board.stopwatch",
|
|
3901
|
+
* layer: "marks",
|
|
3902
|
+
* from: (player: Player) => player.board.stopwatch.parts,
|
|
3903
|
+
* key: part => part.id,
|
|
3904
|
+
* view: part => [Transform({ x: part.x, y: part.y, rotation: part.rotation })],
|
|
3905
|
+
* motion: { enter: view => view.toRest(Transform, { ms: 300 }) },
|
|
3906
|
+
* initialOnly: [[Transform, ["rotation"], part => part.role === "restHand"]]
|
|
3907
|
+
* });
|
|
3908
|
+
* // The hand keeps the angle `board.hand` writes through the enter, a lift and the way home;
|
|
3909
|
+
* // the bolt still ends at its rest rotation.
|
|
3910
|
+
* ```
|
|
3866
3911
|
*/
|
|
3867
|
-
readonly initialOnly?: InitialOnly<Values>;
|
|
3912
|
+
readonly initialOnly?: InitialOnly<Values, Item>;
|
|
3868
3913
|
/**
|
|
3869
3914
|
* The item a closed window of this projection is kept built for, so it opens in the frame after the tap. While
|
|
3870
3915
|
* `from` does not show its key (`key(item)`, or the name of the projection without `key`), the engine builds its
|
|
@@ -3921,8 +3966,8 @@ type AnyProjectionSpec = {
|
|
|
3921
3966
|
from(player: Json, session: Json, sw: SceneSwitch | undefined): unknown;
|
|
3922
3967
|
key?(item: unknown): string;
|
|
3923
3968
|
view(item: unknown): ViewOutput;
|
|
3924
|
-
readonly motion?: AnyProjectionMotion; /** The `initialOnly` pairs, their field names no longer tied to the component. */
|
|
3925
|
-
readonly initialOnly?: readonly
|
|
3969
|
+
readonly motion?: AnyProjectionMotion; /** The `initialOnly` pairs, their field names no longer tied to the component, each with its `when` if any. */
|
|
3970
|
+
readonly initialOnly?: readonly AnyInitialOnlyPair[]; /** The item a closed window is kept built for, its type erased as `from`'s. */
|
|
3926
3971
|
warm?(player: Json, session: Json): unknown;
|
|
3927
3972
|
};
|
|
3928
3973
|
/**
|
|
@@ -3962,6 +4007,13 @@ type View$1 = {
|
|
|
3962
4007
|
loopOwed: boolean;
|
|
3963
4008
|
exiting: boolean; /** How the view came, then how it leaves. */
|
|
3964
4009
|
cause: MotionCause;
|
|
4010
|
+
/**
|
|
4011
|
+
* The `initialOnly` seed the view was born with, the table of its answers: what the release of a
|
|
4012
|
+
* `mute()` keeps. `undefined` for a view no pair covers. A `replace` moves it to the new spec's.
|
|
4013
|
+
*/
|
|
4014
|
+
seed: MuteTable | undefined; /** The answers of the `when`s at the birth (or the last `replace`): bit i for the i-th pair with a `when`. */
|
|
4015
|
+
mask: number; /** A dev build warned `world:initial-only-changed` for this view: it warns once. */
|
|
4016
|
+
maskWarned: boolean;
|
|
3965
4017
|
};
|
|
3966
4018
|
/**
|
|
3967
4019
|
* One mounted projection: its owner, the live views by key, the despawn queue, the items of the
|
|
@@ -4071,6 +4123,16 @@ type Dirty = {
|
|
|
4071
4123
|
* it, and `mute()` copies it before it adds a field.
|
|
4072
4124
|
*/
|
|
4073
4125
|
type MuteTable = ReadonlyMap<string, ReadonlySet<string>>;
|
|
4126
|
+
/**
|
|
4127
|
+
* The `initialOnly` of one spec, checked: its pairs, where the pairs with a `when` are, and the
|
|
4128
|
+
* frozen seed of every answer mask a view was born with so far. Views with the same answers share
|
|
4129
|
+
* one seed. A mask that covers no pair has `undefined`: no seed.
|
|
4130
|
+
*/
|
|
4131
|
+
type SeedBook = {
|
|
4132
|
+
/** The spec's `initialOnly` pairs, checked at `register` or `replace`: every one has a field, every `when` is a function. */readonly pairs: readonly AnyInitialOnlyPair[]; /** The indices in `pairs` of the pairs with a `when`, in order: the i-th is bit i of a mask. */
|
|
4133
|
+
readonly asks: readonly number[]; /** Answer mask to its frozen seed, filled the first time a view is born with that mask; `undefined` covers no pair. */
|
|
4134
|
+
readonly seeds: Map<number, MuteTable | undefined>;
|
|
4135
|
+
};
|
|
4074
4136
|
/**
|
|
4075
4137
|
* A mute's fields joined with a type's owned fields, and the owned set they were joined with.
|
|
4076
4138
|
*/
|
|
@@ -4106,8 +4168,13 @@ type ProjectionState = {
|
|
|
4106
4168
|
* the shared `initialOnly` seed a view of such a projection is born with. A view a listener of
|
|
4107
4169
|
* its spawn muted keeps that table, and the seed joins it.
|
|
4108
4170
|
*/
|
|
4109
|
-
mutes: Map<Entity, MuteTable>;
|
|
4110
|
-
|
|
4171
|
+
mutes: Map<Entity, MuteTable>;
|
|
4172
|
+
/**
|
|
4173
|
+
* How many live `mute()` calls hold each field, by the field set a mute wrote: a field leaves its set only when the
|
|
4174
|
+
* last of them is released, so mutes on one field nest.
|
|
4175
|
+
*/
|
|
4176
|
+
muteCounts: WeakMap<ReadonlySet<string>, Map<string, number>>; /** The `initialOnly` seed book of each registered spec that has the option, checked at `register` and `replace`. */
|
|
4177
|
+
initialOnly: WeakMap<AnyProjectionSpec, SeedBook>; /** The owned fields of each component type as a set, by the type's frozen `owned` list: made once. */
|
|
4111
4178
|
ownedSets: WeakMap<readonly string[], ReadonlySet<string>>; /** The muted and the owned fields joined, by the mute's field set: dropped when `mute()` or its release changes it. */
|
|
4112
4179
|
joinedMutes: WeakMap<ReadonlySet<string>, JoinedFields>; /** The `onConverged` listeners: the owners of elements, told after a restore or a load. */
|
|
4113
4180
|
converged: Array<() => void>;
|
|
@@ -4246,11 +4313,14 @@ type ProjectionApi = {
|
|
|
4246
4313
|
/**
|
|
4247
4314
|
* Swaps the stored spec of a registered projection. A mounted one has its layers checked against
|
|
4248
4315
|
* the current scene and runs the new `view` for every item on the next frame, directly. An
|
|
4249
|
-
* unmounted one is only stored; its next `mount` uses it.
|
|
4316
|
+
* unmounted one is only stored; its next `mount` uses it. The new spec's `initialOnly` `when`s
|
|
4317
|
+
* are asked on the item each live view shows now, before any view moves to the fields of its new
|
|
4318
|
+
* answers. Nothing changes when the call throws, also when a `when` throws.
|
|
4250
4319
|
*
|
|
4251
4320
|
* @param spec - The new projection, under the name it was registered with.
|
|
4252
|
-
* @throws {Error} When no projection of that name is registered,
|
|
4253
|
-
* `layer` or `lift` the scene does not declare
|
|
4321
|
+
* @throws {Error} When no projection of that name is registered, when a mounted one names a
|
|
4322
|
+
* `layer` or `lift` the scene does not declare, when its `initialOnly` is refused, or what a
|
|
4323
|
+
* `when` throws.
|
|
4254
4324
|
* @example
|
|
4255
4325
|
* ```ts
|
|
4256
4326
|
* // The dev hot swap in `ui`: the saved `view.ts` exports a new `boardItems`.
|
|
@@ -4421,9 +4491,9 @@ type ProjectionApi = {
|
|
|
4421
4491
|
*/
|
|
4422
4492
|
settle(entity: Entity): void;
|
|
4423
4493
|
/**
|
|
4424
|
-
* Hands a set of fields to another writer. Tracks never write them, also not on `finish()`.
|
|
4425
|
-
*
|
|
4426
|
-
* them.
|
|
4494
|
+
* Hands a set of fields to another writer. Tracks never write them, also not on `finish()`.
|
|
4495
|
+
* Mutes of one field nest: the field is handed back when the last of them is released. On a view
|
|
4496
|
+
* whose projection names `initialOnly` fields the mute adds to them, and the remover keeps them.
|
|
4427
4497
|
*
|
|
4428
4498
|
* @param entity - The entity of the view.
|
|
4429
4499
|
* @param component - The component whose fields are taken over.
|
|
@@ -4436,6 +4506,13 @@ type ProjectionApi = {
|
|
|
4436
4506
|
* const release = world.projection.mute(held, Transform, ["x", "y"]);
|
|
4437
4507
|
*
|
|
4438
4508
|
* release(); // the finger let go
|
|
4509
|
+
*
|
|
4510
|
+
* // A system turns the hand of a clock; a drag of that clock mutes the rotation too.
|
|
4511
|
+
* const turn = world.projection.mute(hand, Transform, ["rotation"]);
|
|
4512
|
+
* const drag = world.projection.mute(hand, Transform, ["x", "y", "rotation"]);
|
|
4513
|
+
*
|
|
4514
|
+
* drag(); // "rotation" stays muted: `turn` still holds it
|
|
4515
|
+
* turn(); // now tracks write it again
|
|
4439
4516
|
* ```
|
|
4440
4517
|
*/
|
|
4441
4518
|
mute(entity: Entity, component: ComponentType<object>, fields: readonly string[]): () => void;
|
|
@@ -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-DHD4RaXN.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Br as Api$2, Pr as Api$4, Z as Api, kr as Api$1, ri as Api$3 } from "./types-
|
|
2
|
-
import { W as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { R as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { i as ControlApp, o as InputOf } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { Br as Api$2, Pr as Api$4, Z as Api, kr as Api$1, ri as Api$3 } from "./types-DHD4RaXN.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-BZ1TWYOl.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-Db2VOFFW.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-JxtMwRQh.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-DC6Ifx57.mjs";
|
|
6
|
+
import { t as commands } from "./commands-DbfqO2Ux.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-v4VYekoe.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 };
|