@moku-labs/game 0.15.85 → 0.15.87
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/README.md +4 -3
- package/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +2 -2
- 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/cli.mjs +351 -83
- package/dist/{commands-DKjkHK5b.d.mts → commands-DxUF13zr.d.mts} +5 -5
- package/dist/{config-Cn1VZ-tx.mjs → config-BYx_7HL1.mjs} +24 -5
- package/dist/control.d.mts +12 -8
- package/dist/control.mjs +2 -2
- package/dist/{define-DcB9KOfh.d.mts → define-CMl6NcM4.d.mts} +27 -5
- package/dist/{headless-B8JIqsZk.d.mts → headless-DtDdn5gg.d.mts} +1 -1
- package/dist/{index-DTHVVLFB.d.mts → index-Bn0pFiae.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/inspect.mjs +2 -2
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{run-3QhrffgM.mjs → run-B5if0jxE.mjs} +1 -1
- package/dist/{runtime-B3CsJr_p.d.mts → runtime-DOvgFNLH.d.mts} +1 -1
- package/dist/{session-DuZfGZWk.mjs → session-D0AYRm5T.mjs} +39 -3
- package/dist/{sources-Djd8MjP9.mjs → sources-CyltHb9o.mjs} +1 -1
- package/dist/{src-D1J2QlGK.mjs → src-BFa-zMmW.mjs} +1132 -89
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-DsRV-ph1.d.mts → types-BpipkaVe.d.mts} +41 -11
- package/dist/{types-DJCC9CAp.d.mts → types-C5gLBKbm.d.mts} +16 -6
- package/dist/{types-DfHytzox.d.mts → types-CbVXXqPs.d.mts} +130 -16
- package/dist/{types-CPWi_CLI.d.mts → types-OBpR0u05.d.mts} +1 -1
- package/dist/{types-DhECCgeT.d.mts → types-OKAnpylW.d.mts} +15 -5
- package/dist/{visual-B76IxxTL.d.mts → visual-CMnWgCkh.d.mts} +6 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +2 -2
- package/llms.txt +6 -6
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { An as
|
|
2
|
-
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-
|
|
3
|
-
import { N as InputApi } from "./types-
|
|
4
|
-
import { t as HeadlessApp } from "./headless-
|
|
5
|
-
import {
|
|
1
|
+
import { An as Bookmark, D as DebugSwitches, Nn as FlowState, Qr as Api, Yr as StoreApi, Z as Api$1, oi as FrameRate, qr as Snapshot, ui as Time, ut as Captured, w as ScenesApi, wr as Api$2 } from "./types-CbVXXqPs.mjs";
|
|
2
|
+
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-C5gLBKbm.mjs";
|
|
3
|
+
import { N as InputApi } from "./types-OBpR0u05.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-DtDdn5gg.mjs";
|
|
5
|
+
import { i as ControlApp, r as Command } from "./types-BpipkaVe.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/flow/doors/commands.d.ts
|
|
8
8
|
/**
|
|
@@ -9,6 +9,8 @@ const ANDROID_SIGNING_FIELDS = [
|
|
|
9
9
|
"keystorePasswordEnv",
|
|
10
10
|
"keyAlias"
|
|
11
11
|
];
|
|
12
|
+
/** The last part of a test app's identifier. */
|
|
13
|
+
const TEST_APP_SUFFIX = ".dev";
|
|
12
14
|
/** An iOS version as native takes it: `26.0` or `26.0.1`. */
|
|
13
15
|
const IOS_VERSION = /^\d+\.\d+(\.\d+)?$/;
|
|
14
16
|
/**
|
|
@@ -124,13 +126,29 @@ function checkIos(ios) {
|
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
/**
|
|
129
|
+
* Throws for a `native.dev` that cannot name a test app.
|
|
130
|
+
*
|
|
131
|
+
* @param native - `native` of the config.
|
|
132
|
+
* @throws {Error} When the block has no `identifier`, or one that does not end in `.dev` or is
|
|
133
|
+
* `native.identifier` itself, or when `name` or `icon` is an empty string.
|
|
134
|
+
*/
|
|
135
|
+
function checkTestApp(native) {
|
|
136
|
+
const dev = native?.dev;
|
|
137
|
+
if (dev === void 0) return;
|
|
138
|
+
if (!isFilled(dev.identifier)) throw new Error("[game] config.native.dev has no identifier.\n Name one that ends in .dev.");
|
|
139
|
+
if (!dev.identifier.endsWith(".dev")) throw new Error(`[game] config.native.dev.identifier is "${dev.identifier}".\n Use one that ends in .dev.`);
|
|
140
|
+
if (dev.identifier === native?.identifier) throw new Error(`[game] config.native.dev.identifier is "${dev.identifier}", the same as native.identifier.\n The test app needs an id of its own.`);
|
|
141
|
+
if (dev.name === "") throw new Error("[game] config.native.dev.name is empty.\n Name the test app, or leave the field out.");
|
|
142
|
+
if (dev.icon === "") throw new Error("[game] config.native.dev.icon is empty.\n Name a 1024 px PNG, or leave the field out.");
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
127
145
|
* Throws for the first value of a config that TypeScript would have refused.
|
|
128
146
|
*
|
|
129
147
|
* @param config - The default export of `config.ts`.
|
|
130
148
|
* @throws {Error} When `save` is not a save kind, a `system` name is not wired, the title is empty,
|
|
131
149
|
* `debug.overlay` is not a start mode, `page.boot` has no image, `page.boot.fadeMs` is not a finite number of 0
|
|
132
|
-
* or more, `native.signing` is half filled, `native.ios.minimumVersion` is no iOS version,
|
|
133
|
-
* `native.ios.infoPlist` is no plist value.
|
|
150
|
+
* or more, `native.signing` is half filled, `native.ios.minimumVersion` is no iOS version, a value of
|
|
151
|
+
* `native.ios.infoPlist` is no plist value, or `native.dev` cannot name a test app.
|
|
134
152
|
*/
|
|
135
153
|
function checkConfig(config) {
|
|
136
154
|
if (config.save !== void 0 && !saveKinds().has(config.save)) throw new Error(`[game] config.save is "${config.save}".\n Use "memory", "local" or "store".`);
|
|
@@ -146,6 +164,7 @@ function checkConfig(config) {
|
|
|
146
164
|
if (fadeMs !== void 0 && !(Number.isFinite(fadeMs) && fadeMs >= 0)) throw new Error(`[game] config.page.boot.fadeMs is ${String(fadeMs)}.\n Use a number of milliseconds, 0 or more.`);
|
|
147
165
|
checkSigning(config.native?.signing);
|
|
148
166
|
checkIos(config.native?.ios);
|
|
167
|
+
checkTestApp(config.native);
|
|
149
168
|
}
|
|
150
169
|
/**
|
|
151
170
|
* Fills the defaults of `page.boot`: the width `"40vmin"`, the fade 300 ms.
|
|
@@ -174,8 +193,8 @@ function resolveBoot(boot) {
|
|
|
174
193
|
* @returns The config with every field set.
|
|
175
194
|
* @throws {Error} When `save` is not a save kind, a `system` name is not wired, the title is empty,
|
|
176
195
|
* `debug.overlay` is not a start mode, `page.boot` has no image, `page.boot.fadeMs` is not a finite number of 0
|
|
177
|
-
* or more, `native.signing` is half filled, `native.ios.minimumVersion` is no iOS version,
|
|
178
|
-
* `native.ios.infoPlist` is no plist value.
|
|
196
|
+
* or more, `native.signing` is half filled, `native.ios.minimumVersion` is no iOS version, a value of
|
|
197
|
+
* `native.ios.infoPlist` is no plist value, or `native.dev` cannot name a test app.
|
|
179
198
|
* @example
|
|
180
199
|
* ```ts
|
|
181
200
|
* resolveConfig({ page: { title: "T" } }).save; // "memory"
|
|
@@ -201,4 +220,4 @@ function resolveConfig(config) {
|
|
|
201
220
|
};
|
|
202
221
|
}
|
|
203
222
|
//#endregion
|
|
204
|
-
export { resolveConfig as t };
|
|
223
|
+
export { resolveConfig as n, TEST_APP_SUFFIX as t };
|
package/dist/control.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import {
|
|
3
|
-
import { t as commands } from "./commands-
|
|
4
|
-
import { t as defineCommand } from "./define-
|
|
1
|
+
import { t as HeadlessApp } from "./headless-DtDdn5gg.mjs";
|
|
2
|
+
import { a as InputArguments, c as Ran, n as ChoiceInput, r as Command, s as InputSchema, u as ToggleInput } from "./types-BpipkaVe.mjs";
|
|
3
|
+
import { t as commands } from "./commands-DxUF13zr.mjs";
|
|
4
|
+
import { t as defineCommand } from "./define-CMl6NcM4.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
7
7
|
/**
|
|
@@ -76,19 +76,23 @@ declare global {
|
|
|
76
76
|
var __MOKU_GAME_ENGINE__: string | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* Where the page agent of a debug build finds the editor: `host:port`, written by `--editor` (default
|
|
79
|
-
* `"127.0.0.1:47600"`).
|
|
80
|
-
*
|
|
79
|
+
* `"127.0.0.1:47600"`). Exactly `"off"` on the page of a test app (`native build --store --dev`): the agent opens no
|
|
80
|
+
* socket and the overlay works alone, a contract with `@moku-labs/editor` 0.10.19 and later. Any other string is an
|
|
81
|
+
* address. Undefined on the dev page, whose agent talks to the server that served it, and on a release build.
|
|
81
82
|
*
|
|
82
83
|
* @example
|
|
83
84
|
* ```ts
|
|
84
85
|
* // moku-game build --debug --editor 192.168.1.20:47600
|
|
85
86
|
* globalThis.__MOKU_GAME_EDITOR__; // "192.168.1.20:47600"
|
|
87
|
+
* // moku-game native build android --store --dev --build-number 13
|
|
88
|
+
* globalThis.__MOKU_GAME_EDITOR__; // "off"
|
|
86
89
|
* ```
|
|
87
90
|
*/
|
|
88
91
|
var __MOKU_GAME_EDITOR__: string | undefined;
|
|
89
92
|
/**
|
|
90
93
|
* The app id of a debug build, so the editor pairs a device stream with its project: `native.identifier` of
|
|
91
|
-
* `config.ts`, with `.debug` in the native debug app (`MOKU_NATIVE_PROFILE=debug`), which installs under that id
|
|
94
|
+
* `config.ts`, with `.debug` in the native debug app (`MOKU_NATIVE_PROFILE=debug`), which installs under that id, and
|
|
95
|
+
* `native.dev.identifier` in a test app (`MOKU_NATIVE_PROFILE=dev`).
|
|
92
96
|
* Undefined on a debug build of a game with no native section, on the dev page and on a release build.
|
|
93
97
|
*
|
|
94
98
|
* @example
|
|
@@ -197,4 +201,4 @@ declare function controlReadOnly(id: string): ControlReadOnlyError;
|
|
|
197
201
|
*/
|
|
198
202
|
declare function run<S extends InputSchema, O, App extends HeadlessApp>(app: App, command: Command<S, O, App>, ...input: InputArguments<S>): Promise<Ran<O>>;
|
|
199
203
|
//#endregion
|
|
200
|
-
export { type Command, type ControlReadOnlyError, type ControlRefusedError, type Ran, commands, controlReadOnly, controlRefused, defineCommand, run };
|
|
204
|
+
export { type ChoiceInput, type Command, type ControlReadOnlyError, type ControlRefusedError, type Ran, type ToggleInput, commands, controlReadOnly, controlRefused, defineCommand, run };
|
package/dist/control.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as controlRefused, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
|
|
2
|
-
import { s as defineCommand } from "./session-
|
|
3
|
-
import { n as commands, t as run } from "./run-
|
|
2
|
+
import { s as defineCommand } from "./session-D0AYRm5T.mjs";
|
|
3
|
+
import { n as commands, t as run } from "./run-B5if0jxE.mjs";
|
|
4
4
|
export { commands, controlReadOnly, controlRefused, defineCommand, run };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import {
|
|
1
|
+
import { t as HeadlessApp } from "./headless-DtDdn5gg.mjs";
|
|
2
|
+
import { l as Source, r as Command, s as InputSchema } from "./types-BpipkaVe.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/flow/doors/define.d.ts
|
|
5
5
|
/**
|
|
@@ -30,12 +30,14 @@ declare function defineSource<S extends InputSchema, O, App = HeadlessApp>(sourc
|
|
|
30
30
|
* control form for the others (see docs/doors.md), so a production build drops it. A game's
|
|
31
31
|
* `.dev` command with only the `__MOKU_GAME_DEV__` guard runs in dev and is refused on a debug
|
|
32
32
|
* page. `overlay` shows it in the editor's overlay: `"toggle"` with the input `{ on: "boolean" }`
|
|
33
|
-
* and a `value(app)` the switch is drawn from, `
|
|
34
|
-
* any other combination is
|
|
33
|
+
* and a `value(app)` the switch is drawn from, or with `choices` and a `choice(app)` too and
|
|
34
|
+
* `choice` in the input, `"button"` with no required input and no value; any other combination is
|
|
35
|
+
* a type error.
|
|
35
36
|
*
|
|
36
37
|
* @param command - The descriptor.
|
|
37
38
|
* @returns The same descriptor, frozen.
|
|
38
|
-
* @throws {Error} When the id is not a dotted name such as `"game.answer"
|
|
39
|
+
* @throws {Error} When the id is not a dotted name such as `"game.answer"`, or `choices` holds a
|
|
40
|
+
* word twice.
|
|
39
41
|
* @example
|
|
40
42
|
* ```ts
|
|
41
43
|
* // A game's .dev module: open the shop from anywhere, through the graph.
|
|
@@ -74,6 +76,26 @@ declare function defineSource<S extends InputSchema, O, App = HeadlessApp>(sourc
|
|
|
74
76
|
* });
|
|
75
77
|
* // The overlay draws a switch "Glow", on; a tap runs it with { on: false } and the next frame draws no glow.
|
|
76
78
|
* ```
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* // features/purchases/simulate.dev.ts — a tester on a phone picks how a purchase ends.
|
|
82
|
+
* export const simulate = defineCommand({
|
|
83
|
+
* id: "purchases.simulate",
|
|
84
|
+
* title: "Simulated purchases",
|
|
85
|
+
* input: { on: "boolean", choice: "string" },
|
|
86
|
+
* effect: "cheat",
|
|
87
|
+
* overlay: "toggle",
|
|
88
|
+
* choices: ["success", "failure", "delay"],
|
|
89
|
+
* value: (app: { readonly purchases: PurchasesApi }) => app.purchases.overridden(),
|
|
90
|
+
* choice: () => readSetting().mode, // the game's own .dev module remembers the pick
|
|
91
|
+
* run: (app, { on, choice }) => {
|
|
92
|
+
* // The control guard, then:
|
|
93
|
+
* writeSetting({ mode: choice });
|
|
94
|
+
* app.purchases.simulate(on ? choice : undefined);
|
|
95
|
+
* }
|
|
96
|
+
* });
|
|
97
|
+
* // The overlay draws a switch with the row success, failure, delay; a tap on failure runs { on: true, choice: "failure" }.
|
|
98
|
+
* ```
|
|
77
99
|
*/
|
|
78
100
|
declare function defineCommand<S extends InputSchema, O, App = HeadlessApp>(command: Command<S, O, App>): Command<S, O, App>;
|
|
79
101
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Gn as Answer, In as RouteStep, Nn as FlowState, Pn as JournalEntry, Rr as Json, Zr as RngState, ii as Api, un as Api$1 } from "./types-CbVXXqPs.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/flow/headless.d.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $n as
|
|
2
|
-
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$11, K as defineAnimation, L as FramesValue, M as OutlineValue, N as UniformDeclaration, O as FilterSpec, P as AnimApi, Q as play, R as MotionKeyframe, S as AlphaValue, T as DisplacementValue, U as SfxDescriptor, W as Step, _ as State$12, a as AudioApi, b as EmitterDefinition, c as MusicDescriptor, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, lt as OverlayApi, m as Config$13, n as State$13, r as UiApi, s as Config$12, t as Config$14, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-
|
|
3
|
-
import { B as Message, C as State$16, D as TextStyleInput, G as TypedTr, H as State$14, I as Argument, J as ResolvedStyle, L as Config$15, M as Config$16, N as InputApi, O as TextStyles, P as State$15, R as I18nApi, S as Point, T as TextBind, V as Part, W as TextKey, Y as Style, Z as WhenFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as defineComponent, k as TextValue, q as IsFlags, s as PopupComponent, v as BindField, w as TextApi, x as CountdownValue, y as BindOptions, z as IntlKit } from "./types-
|
|
1
|
+
import { $n as NumericFields, $r as Config$4, Bn as Effect, Br as State$5, C as SceneSpec, Cr as TagType, Ct as FrameRing, Dn as FeaturePlugin, Dr as State$9, En as FeatureDescription, F as HudPartValue, G as SpriteOptions, Gn as Answer, H as ShapeValue, Hn as GuideOptions, Hr as Patch, Ir as Config$5, J as TransformValue, Jn as DescriptionNode, K as SpriteValue, L as NineSliceValue, Ln as SceneIdOf, Nr as State$2, Nt as PassKind, On as FeatureTree, Q as Config$6, Qr as Api$3, Rr as Json, S as SceneDefinition, Sr as SystemFor, St as FrameRecord, T as State$7, Tr as Config$9, Un as Hint, Vn as EffectOptions, Xr as RngApi, Y as sprite, Yn as Ease, Yr as StoreApi, Z as Api$4, _ as AnySceneProjection, _n as State$3, _r as Mut, a as Config$1, ai as Config$8, br as ResourceType, c as LoadBundles, ci as State$8, dn as BundlesOf, ei as Events, er as ProjectionMotion, f as ReadyBundles, fi as Config$10, fn as Config$3, fr as ComponentType, hn as HudKeysOf, ht as ViewportSize, i as BundleSpec, ii as Api$5, jn as DefineNode, jr as Config$2, kr as Api$1, l as LoadReason, li as ThermalReading, m as Tier, mi as Require, mn as GameTypes, ni as State$4, nr as ReducedMotion, o as DefineBundles, p as State$1, pi as Events$1, pn as EmitterIdOf, pr as ComponentValue, r as BundleMap, si as RateChange, st as State$6, t as Api, ti as PauseReason, tr as ProjectionSpec, u as LoadResult, un as Api$2, ur as ComponentHandle, v as Config$7, vn as TextStylesOf, vr as Narrowed, w as ScenesApi, wr as Api$6, x as LayerMap, xn as defineFlow, xr as SystemDefinition, y as DefineScene, yr as QueryTerm, z as OverlayValue, zn as Descriptor, zr as Root } from "./types-CbVXXqPs.mjs";
|
|
2
|
+
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$11, K as defineAnimation, L as FramesValue, M as OutlineValue, N as UniformDeclaration, O as FilterSpec, P as AnimApi, Q as play, R as MotionKeyframe, S as AlphaValue, T as DisplacementValue, U as SfxDescriptor, W as Step, _ as State$12, a as AudioApi, b as EmitterDefinition, c as MusicDescriptor, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, lt as OverlayApi, m as Config$13, n as State$13, r as UiApi, s as Config$12, t as Config$14, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-C5gLBKbm.mjs";
|
|
3
|
+
import { B as Message, C as State$16, D as TextStyleInput, G as TypedTr, H as State$14, I as Argument, J as ResolvedStyle, L as Config$15, M as Config$16, N as InputApi, O as TextStyles, P as State$15, R as I18nApi, S as Point, T as TextBind, V as Part, W as TextKey, Y as Style, Z as WhenFlags, b as Config$17, g as IntrinsicElementsFor, h as defineTokens, j as defineComponent, k as TextValue, q as IsFlags, s as PopupComponent, v as BindField, w as TextApi, x as CountdownValue, y as BindOptions, z as IntlKit } from "./types-OBpR0u05.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 { $t as
|
|
2
|
-
import { $ as sequence, E as FilterArea, G as HAPTIC_KINDS, H as HapticKind, J as frames, K as defineAnimation, Q as play, V as types_d_exports, X as mark, Y as haptic, Z as parallel, at as stopSfx, ct as wait, et as set, i as types_d_exports$16, it as stagger, nt as spawn, ot as tween, p as types_d_exports$2, q as external, rt as spawned, st as use, tt as sfx, ut as types_d_exports$4, v as types_d_exports$5 } from "./types-
|
|
3
|
-
import { A as types_d_exports$14, E as TextFormat, F as types_d_exports$8, K as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as defineComponent, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-
|
|
4
|
-
import { $ as system, A as Draggable, At as Text, B as Touchable, C as AnimPlayer, Ct as debugPlugin, D as defineBundles, Dt as animPlugin, E as defineScene, Et as assetsPlugin, F as PointerOver, G as Exiting, H as Traced, I as Pressable, J as Order, K as Layer, L as Pressed, M as Held, Mt as defineTextStyles, N as Hovered, Nt as label, O as load, Ot as projection, P as Pointer, Q as resource, R as Swipeable, S as defineMotion, St as effectsPlugin, T as Frames, Tt as audioPlugin, U as PASS_KINDS, V as Traceable, W as frameAt, X as component, Y as Tree, Z as mut, _ as defineStyle, _t as modelPlugin, a as defineEmitter, at as defineFeature, b as messageDuration, bt as i18nPlugin, c as Alpha, ct as uiPlugin, d as Displacement, dt as scenesPlugin, et as tag, f as Glow, ft as rendererPlugin, g as resolve, gt as types_d_exports$11, h as music, ht as PlatformProvider, i as screen, it as schedule, j as DropTarget, jt as bind, k as ready, kt as Countdown, l as Blur, lt as timePlugin, m as Outline, mt as BackResult, n as createPlugin, nt as guide, o as Emitter, ot as flattenFeatures, p as Noise, pt as platformPlugin, q as Now, r as defineGame, rt as hint, s as defineFilter, st as worldPlugin, t as createApp, tt as defineEffect, u as ColorMatrix, ut as textPlugin, v as tr, vt as lifecyclePlugin, w as Animation, wt as clockPlugin, x as cubicBezier, xt as flowPlugin, y as messageArgument, yt as inputPlugin, z as Tappable } from "./index-
|
|
1
|
+
import { $ as MonitorConfig, $t as PerfThermalLine, At as PERF_GAP_BUCKETS, B as Parent, Bt as PerfDisplay, Cn as slot, Ct as FrameRing, Dt as OverlayEventDetail, E as types_d_exports$13, Et as MonitorSections, F as HudPartValue, Ft as PerfCause, Gt as PerfLogLine, Ht as PerfEventName, I as NineSlice, It as PerfChange, Jn as DescriptionNode, Jt as PerfMeasured, Kn as AnchorTarget, Kr as SaveUnreadableError, Kt as PerfLongFrameLine, Lt as PerfChangeEntry, M as WhyEntry, Mt as PROBLEM_RULES, N as Display, Nt as PassKind, Or as types_d_exports$17, Ot as OverlayWhat, P as HudPart, Pr as types_d_exports$3, Pt as PassRecord, Qt as PerfTelemetryLine, R as Overlay, Rt as PerfCollectorLine, Sn as exit, St as FrameRecord, Tn as type, Tt as MONITOR_SECTIONS, U as Sprite, Ut as PerfGapLine, V as Shape, Vr as types_d_exports$10, Vt as PerfEventLine, W as SpriteBlend, Wt as PerfHeaderLine, X as AdaptiveScale, Xt as PerfSpikeLine, Y as sprite, Yt as PerfSampleLine, Zt as PerfStartupLine, _t as RetakeWhy, an as ShaderWhat, bn as contribution, bt as FrameReadResult, cn as CanvasRestart, di as types_d_exports$15, dt as MonitorCounts, en as PoolTrimDetail, g as types_d_exports$1, in as ShaderEventDetail, jt as PERF_LOG_VERSION, kt as PERF_CAUSES, ln as DEMAND_REASONS, lt as types_d_exports$12, nn as ProblemRule, on as WarmDetail, ot as PoolTrim, q as Transform, qt as PerfMarkLine, ri as types_d_exports$9, rn as SHADER_WHATS, rr as SceneSwitch, sn as CANVAS_RESTARTS, tn as ProblemEventDetail, vt as WhyLive, wn as to, wt as LongFrameEntry, xt as FrameReadout, yn as types_d_exports$6, yt as FrameColumns, z as OverlayValue, zt as PerfCounts } from "./types-CbVXXqPs.mjs";
|
|
2
|
+
import { $ as sequence, E as FilterArea, G as HAPTIC_KINDS, H as HapticKind, J as frames, K as defineAnimation, Q as play, V as types_d_exports, X as mark, Y as haptic, Z as parallel, at as stopSfx, ct as wait, et as set, i as types_d_exports$16, it as stagger, nt as spawn, ot as tween, p as types_d_exports$2, q as external, rt as spawned, st as use, tt as sfx, ut as types_d_exports$4, v as types_d_exports$5 } from "./types-C5gLBKbm.mjs";
|
|
3
|
+
import { A as types_d_exports$14, E as TextFormat, F as types_d_exports$8, K as types_d_exports$7, d as DebugTrigger, f as LocalWrite, h as defineTokens, j as defineComponent, m as popup, p as ScrollState, u as Box, x as CountdownValue, y as BindOptions } from "./types-OBpR0u05.mjs";
|
|
4
|
+
import { $ as system, A as Draggable, At as Text, B as Touchable, C as AnimPlayer, Ct as debugPlugin, D as defineBundles, Dt as animPlugin, E as defineScene, Et as assetsPlugin, F as PointerOver, G as Exiting, H as Traced, I as Pressable, J as Order, K as Layer, L as Pressed, M as Held, Mt as defineTextStyles, N as Hovered, Nt as label, O as load, Ot as projection, P as Pointer, Q as resource, R as Swipeable, S as defineMotion, St as effectsPlugin, T as Frames, Tt as audioPlugin, U as PASS_KINDS, V as Traceable, W as frameAt, X as component, Y as Tree, Z as mut, _ as defineStyle, _t as modelPlugin, a as defineEmitter, at as defineFeature, b as messageDuration, bt as i18nPlugin, c as Alpha, ct as uiPlugin, d as Displacement, dt as scenesPlugin, et as tag, f as Glow, ft as rendererPlugin, g as resolve, gt as types_d_exports$11, h as music, ht as PlatformProvider, i as screen, it as schedule, j as DropTarget, jt as bind, k as ready, kt as Countdown, l as Blur, lt as timePlugin, m as Outline, mt as BackResult, n as createPlugin, nt as guide, o as Emitter, ot as flattenFeatures, p as Noise, pt as platformPlugin, q as Now, r as defineGame, rt as hint, s as defineFilter, st as worldPlugin, t as createApp, tt as defineEffect, u as ColorMatrix, ut as textPlugin, v as tr, vt as lifecyclePlugin, w as Animation, wt as clockPlugin, x as cubicBezier, xt as flowPlugin, y as messageArgument, yt as inputPlugin, z as Tappable } from "./index-Bn0pFiae.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, type BackResult, type BindOptions, 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, Draggable, DropTarget, types_d_exports$5 as Effects, Emitter, Exiting, type FilterArea, types_d_exports$6 as Flow, type FrameColumns, type FrameReadResult, type FrameReadout, type FrameRecord, type FrameRing, Frames, Glow, HAPTIC_KINDS, type HapticKind, Held, Hovered, HudPart, type HudPartValue, types_d_exports$7 as I18n, types_d_exports$8 as Input, Layer, types_d_exports$9 as Lifecycle, LocalWrite, type LongFrameEntry, MONITOR_SECTIONS, types_d_exports$10 as Model, type MonitorConfig, type MonitorCounts, type MonitorSections, NineSlice, Noise, Now, Order, Outline, Overlay, type OverlayEventDetail, type OverlayValue, type OverlayWhat, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, type PassKind, type PassRecord, type PerfCause, type PerfChange, type PerfChangeEntry, type PerfCollectorLine, type PerfCounts, type PerfDisplay, type PerfEventLine, type PerfEventName, type PerfGapLine, type PerfHeaderLine, type PerfLogLine, type PerfLongFrameLine, type PerfMarkLine, type PerfMeasured, type PerfSampleLine, type PerfSpikeLine, type PerfStartupLine, type PerfTelemetryLine, type PerfThermalLine, types_d_exports$11 as Platform, type PlatformProvider, Pointer, PointerOver, type PoolTrim, type PoolTrimDetail, Pressable, Pressed, type ProblemEventDetail, type ProblemRule, types_d_exports$12 as Renderer, type RetakeWhy, SHADER_WHATS, SaveUnreadableError, type SceneSwitch, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Sprite, type SpriteBlend, Swipeable, Tappable, Text, type TextFormat, types_d_exports$14 as TextTypes, types_d_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_d_exports$16 as Ui, type WarmDetail, 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, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as sfx, $t as worldPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as DEMAND_REASONS, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as CANVAS_RESTARTS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as to, at as use, b as types_exports$17, bt as Traced, c as hint, cn as SaveUnreadableError, ct as Draggable, d as defineScene, dn as clockPlugin, dt as Hovered, en as flowPlugin, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as slot, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as lifecyclePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as contribution, nt as stagger, o as defineEffect, on as type, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as exit, rt as stopSfx, s as guide, sn as modelPlugin, st as inputPlugin, t as createApp, tt as spawned, u as projection, un as timePlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-
|
|
1
|
+
import { $ as sfx, $t as worldPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as DEMAND_REASONS, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as CANVAS_RESTARTS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as to, at as use, b as types_exports$17, bt as Traced, c as hint, cn as SaveUnreadableError, ct as Draggable, d as defineScene, dn as clockPlugin, dt as Hovered, en as flowPlugin, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as slot, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as lifecyclePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as contribution, nt as stagger, o as defineEffect, on as type, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as exit, rt as stopSfx, s as guide, sn as modelPlugin, st as inputPlugin, t as createApp, tt as spawned, u as projection, un as timePlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-BFa-zMmW.mjs";
|
|
2
2
|
import { $ as Layer, B as Display, C as defineStyle, E as bind, G as Parent, H as NineSlice, J as Transform, K as Shape, O as defineTextStyles, Q as Exiting, S as defineTokens, T as Text, U as Overlay, V as HudPart, Z as sprite, _ as ScrollState, at as resource, b as popup, ct as tag, d as Box, et as Now, h as LocalWrite, it as mut, k as label, nt as Tree, ot as system, p as DebugTrigger, q as Sprite, rt as component, tt as Order, w as Countdown } from "./visual-B7TxMv1J.mjs";
|
|
3
3
|
import { t as defineComponent } from "./component-DGg5DqKK.mjs";
|
|
4
4
|
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
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
|
|
6
|
-
import { n as defineSource } from "./define-
|
|
1
|
+
import { Er as Explained, Fr as Api, Mn as FlowGraph, Pn as JournalEntry, Z as Api$2, ct as Under, dr as ComponentSchema, ft as RenderStats, gn as Position, gr as FrameDiff, h as Usage, hr as EntitySnapshot, qr as Snapshot, t as Api$3, wr as Api$1 } from "./types-CbVXXqPs.mjs";
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-C5gLBKbm.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-OBpR0u05.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-DtDdn5gg.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-BpipkaVe.mjs";
|
|
6
|
+
import { n as defineSource } from "./define-CMl6NcM4.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/flow/doors/read.d.ts
|
|
9
9
|
/**
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as defineSource } from "./session-
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
1
|
+
import { c as defineSource } from "./session-D0AYRm5T.mjs";
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-CyltHb9o.mjs";
|
|
3
3
|
import "./inspect-la_KkjCS.mjs";
|
|
4
4
|
export { defineSource, read, sources, watch };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-
|
|
1
|
+
import { a as jsxs, i as jsxDEV, n as JSX, r as jsx, t as Fragment } from "./runtime-DOvgFNLH.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-DOvgFNLH.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as sheetAlone, p as graphHash } from "./capture-BtS6_oWr.mjs";
|
|
2
2
|
import { a as isDev, i as isControl, n as controlRefused, o as notInstalled, r as isAgent, t as controlReadOnly } from "./dev-BNndV-hU.mjs";
|
|
3
3
|
import { n as reproBookmark } from "./headless-CCiUwvlp.mjs";
|
|
4
|
-
import { a as readTarget, i as isProjectionTarget, l as inputSchema, n as isTainted, o as inputOrEmpty, r as recordCheat, s as defineCommand } from "./session-
|
|
4
|
+
import { a as readTarget, i as isProjectionTarget, l as inputSchema, n as isTainted, o as inputOrEmpty, r as recordCheat, s as defineCommand } from "./session-D0AYRm5T.mjs";
|
|
5
5
|
//#region src/plugins/anim/control.ts
|
|
6
6
|
/**
|
|
7
7
|
* @file anim plugin — the anim command of the `/control` door: switch reduced motion. Dev and
|
|
@@ -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-OBpR0u05.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. */
|
|
@@ -13,6 +13,19 @@ function checkId(kind, id) {
|
|
|
13
13
|
throw new Error(`[game] The ${kind} id "${id}" is not a dotted name.\n Name it like "game.position": camelCase words joined by dots.`);
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
+
* Refuses a choice listed twice: the overlay would draw two rows of one name, and a tap on the
|
|
17
|
+
* second would run the first's.
|
|
18
|
+
*
|
|
19
|
+
* @param id - The id of the command, for the message.
|
|
20
|
+
* @param choices - The choices of the command, when it has some.
|
|
21
|
+
* @throws {Error} Naming the first choice that comes twice.
|
|
22
|
+
*/
|
|
23
|
+
function checkChoices(id, choices) {
|
|
24
|
+
const twice = choices?.find((choice, index) => choices.indexOf(choice) !== index);
|
|
25
|
+
if (twice === void 0) return;
|
|
26
|
+
throw new Error(`[game] The command ${id} lists the choice "${twice}" twice.\n Name each choice once.`);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
16
29
|
* Builds the input schema of a door without an object literal (F77). A literal such as
|
|
17
30
|
* `{ x: "number", y: "number" }` shares V8's hidden shape with the game's points and stores
|
|
18
31
|
* strings where they store numbers: V8 turns the fields of that shape tagged, and every fractional
|
|
@@ -63,12 +76,14 @@ function defineSource(source) {
|
|
|
63
76
|
* control form for the others (see docs/doors.md), so a production build drops it. A game's
|
|
64
77
|
* `.dev` command with only the `__MOKU_GAME_DEV__` guard runs in dev and is refused on a debug
|
|
65
78
|
* page. `overlay` shows it in the editor's overlay: `"toggle"` with the input `{ on: "boolean" }`
|
|
66
|
-
* and a `value(app)` the switch is drawn from, `
|
|
67
|
-
* any other combination is
|
|
79
|
+
* and a `value(app)` the switch is drawn from, or with `choices` and a `choice(app)` too and
|
|
80
|
+
* `choice` in the input, `"button"` with no required input and no value; any other combination is
|
|
81
|
+
* a type error.
|
|
68
82
|
*
|
|
69
83
|
* @param command - The descriptor.
|
|
70
84
|
* @returns The same descriptor, frozen.
|
|
71
|
-
* @throws {Error} When the id is not a dotted name such as `"game.answer"
|
|
85
|
+
* @throws {Error} When the id is not a dotted name such as `"game.answer"`, or `choices` holds a
|
|
86
|
+
* word twice.
|
|
72
87
|
* @example
|
|
73
88
|
* ```ts
|
|
74
89
|
* // A game's .dev module: open the shop from anywhere, through the graph.
|
|
@@ -107,9 +122,30 @@ function defineSource(source) {
|
|
|
107
122
|
* });
|
|
108
123
|
* // The overlay draws a switch "Glow", on; a tap runs it with { on: false } and the next frame draws no glow.
|
|
109
124
|
* ```
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* // features/purchases/simulate.dev.ts — a tester on a phone picks how a purchase ends.
|
|
128
|
+
* export const simulate = defineCommand({
|
|
129
|
+
* id: "purchases.simulate",
|
|
130
|
+
* title: "Simulated purchases",
|
|
131
|
+
* input: { on: "boolean", choice: "string" },
|
|
132
|
+
* effect: "cheat",
|
|
133
|
+
* overlay: "toggle",
|
|
134
|
+
* choices: ["success", "failure", "delay"],
|
|
135
|
+
* value: (app: { readonly purchases: PurchasesApi }) => app.purchases.overridden(),
|
|
136
|
+
* choice: () => readSetting().mode, // the game's own .dev module remembers the pick
|
|
137
|
+
* run: (app, { on, choice }) => {
|
|
138
|
+
* // The control guard, then:
|
|
139
|
+
* writeSetting({ mode: choice });
|
|
140
|
+
* app.purchases.simulate(on ? choice : undefined);
|
|
141
|
+
* }
|
|
142
|
+
* });
|
|
143
|
+
* // The overlay draws a switch with the row success, failure, delay; a tap on failure runs { on: true, choice: "failure" }.
|
|
144
|
+
* ```
|
|
110
145
|
*/
|
|
111
146
|
function defineCommand(command) {
|
|
112
147
|
checkId("command", command.id);
|
|
148
|
+
checkChoices(command.id, command.choices);
|
|
113
149
|
Object.freeze(command.input);
|
|
114
150
|
return Object.freeze(command);
|
|
115
151
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ as Layer, F as parentOf, H as NineSlice, K as Shape, d as Box, r as drawnRect, z as rootPoseOf } from "./visual-B7TxMv1J.mjs";
|
|
2
2
|
import { o as notInstalled } from "./dev-BNndV-hU.mjs";
|
|
3
|
-
import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-
|
|
3
|
+
import { a as readTarget, c as defineSource, l as inputSchema, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-D0AYRm5T.mjs";
|
|
4
4
|
//#region src/plugins/flow/doors/read.ts
|
|
5
5
|
/**
|
|
6
6
|
* @file flow/doors — `read` and `watch`, the `/inspect` side. Neither changes the game.
|