@moku-labs/game 0.15.118 → 0.15.120
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 +10 -0
- package/dist/app/page.d.mts +1 -1
- package/dist/app/page.mjs +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-B16wtdhf.d.mts → commands-Cwxtb672.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-OPEOQ5MS.d.mts → define-BLFk9wyQ.d.mts} +2 -2
- package/dist/{headless-C5kxf9oU.d.mts → headless-DjvkUuv6.d.mts} +1 -1
- package/dist/{index-Fth_AFjs.d.mts → index-DSTbAOZZ.d.mts} +9 -7
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +2 -2
- package/dist/inspect.d.mts +6 -6
- package/dist/inspect.mjs +1 -1
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/{runtime-DylBqKWf.d.mts → runtime-Dl3k95wc.d.mts} +1 -1
- package/dist/{sources-WiVMRhXq.mjs → sources-CuG-Vma9.mjs} +1 -1
- package/dist/{src-CvM4Qhtr.mjs → src-CvDV2vqI.mjs} +185 -78
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-ktcMr5ce.d.mts → types-CKCNyjAI.d.mts} +4 -4
- package/dist/{types-CMFC7k5L.d.mts → types-DOsd3uSB.d.mts} +60 -14
- package/dist/{types-DIdCmTQx.d.mts → types-DmOnlY66.d.mts} +14 -8
- package/dist/{types-BUR4LWSa.d.mts → types-TmWmx6Ca.d.mts} +51 -6
- package/dist/{types-CATC2vK8.d.mts → types-ohTEXbrA.d.mts} +2 -2
- package/dist/{visual-m6n16q7E.d.mts → visual-DFxSs-Vp.d.mts} +6 -6
- package/dist/{visual-CvFDvkA_.mjs → visual-x0TPowBE.mjs} +187 -56
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +2 -2
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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 { Bn as NodeTable, Ir as ClockSource, Jn as Hint, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Wn as Descriptor, Wr as Json, Yn as NodeFx } from "./types-TmWmx6Ca.mjs";
|
|
2
|
+
import { t as createApp } from "./index-DSTbAOZZ.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-CKCNyjAI.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-DjvkUuv6.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-CvDV2vqI.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-DeD9wis6.mjs";
|
|
3
3
|
import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $
|
|
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 { $ as Config$2, Hr as Config, Ir as ClockSource, Mn as FeaturePlugin, Pn as AnyFlow, Rr as FakeClock, Un as TypeTag, Wr as Json, Xr as ProviderCall, Yr as PlayerStateProvider, Zr as SaveDoc, _t as Orientation, a as Config$3, d as Manifest, ei as SnapshotOf, gn as Config$1, it as PixiModule, n as AssetsIo } from "./types-TmWmx6Ca.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-DmOnlY66.mjs";
|
|
3
|
+
import { J as StringTable, U as I18nApi, Y as TextKey } from "./types-DOsd3uSB.mjs";
|
|
4
|
+
import { Et as PlatformProvider, It as audioPlugin, Nt as effectsPlugin, i as screen, t as createApp, wt as platformPlugin } from "./index-DSTbAOZZ.mjs";
|
|
5
5
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/model/store/providers/memory.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $n as ChangeHook, Ar as Api$2, D as AxisPose, Fr as Api$5, Jn as Hint, Q as Api$3, Qn as AnchorTarget, Wn as Descriptor, Wr as Json, Y as TransformValue, Zn as Answered, ar as NumericFields, bi as Require, br as Entity, cr as ReducedMotion, fr as ViewHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, kr as TagType, mn as Api$1, mr as AnyComponentType, nr as Motion, or as ProjectionMotion, pr as AnyComponent, rr as MotionCause, s as Events$1, t as Api$4, tr as Ease, tt as PixiContainer, ui as Api, vr as ComponentType, yt as ViewportSize } from "./types-TmWmx6Ca.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";
|
|
@@ -220,12 +220,20 @@ type Origin = "center" | "top" | "topLeft" | {
|
|
|
220
220
|
* const lift: TransformStyle = { offsetY: -6, scale: 1.05, origin: "center" };
|
|
221
221
|
* // The title plaque of a popup, tilted by 1.5 degrees around the middle of its top edge.
|
|
222
222
|
* const plaque: TransformStyle = { rotation: -0.026, origin: "top" };
|
|
223
|
+
* // A ribbon that unfurls from its left edge: it starts almost flat on X and a tween brings `scaleX` to 1.
|
|
224
|
+
* const ribbon: TransformStyle = { scaleX: 0.01, origin: "topLeft" };
|
|
223
225
|
* ```
|
|
224
226
|
*/
|
|
225
227
|
type TransformStyle = {
|
|
226
228
|
/** Moves the drawn element right, in reference units. */offsetX?: number; /** Moves the drawn element down, in reference units. */
|
|
227
229
|
offsetY?: number; /** Uniform scale around the origin. */
|
|
228
|
-
scale?: number;
|
|
230
|
+
scale?: number;
|
|
231
|
+
/**
|
|
232
|
+
* Width factor on top of `scale`, around the origin: the element is drawn `scale × scaleX` wide. Left out it is 1 and
|
|
233
|
+
* no key reaches the `Transform`. A `fit: "contain"` scale goes into `scale`, never into this.
|
|
234
|
+
*/
|
|
235
|
+
scaleX?: number; /** Height factor on top of `scale`, around the origin, the same way as `scaleX`. */
|
|
236
|
+
scaleY?: number; /** Turns the drawn element around the origin, in radians, clockwise; 0 by default. */
|
|
229
237
|
rotation?: number; /** The point the element scales and turns around; the centre by default. */
|
|
230
238
|
origin?: Origin;
|
|
231
239
|
};
|
|
@@ -289,13 +297,36 @@ type Style<Asset extends string = string> = BaseStyle<Asset> & {
|
|
|
289
297
|
is?: IsVariants<Asset>;
|
|
290
298
|
when?: WhenVariants<Asset>;
|
|
291
299
|
};
|
|
300
|
+
/**
|
|
301
|
+
* The style object of a `text` tag: a layout style whose base and `when` variants may name the
|
|
302
|
+
* text style key it draws and measures with, so one text takes the letters of the frame. The `is`
|
|
303
|
+
* variants carry no key: a press must not move the layout. A named format of a bound text still
|
|
304
|
+
* picks its own style; a style without `text` draws in `body`. `Key` is the game's text style key
|
|
305
|
+
* union: `uiFor` narrows `text` to it.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```tsx
|
|
309
|
+
* // The shop title: 19 on a 16:9 phone, 20.5 on a 20:9 one, one text node on both.
|
|
310
|
+
* <text key="title" content="Vitrine" style={{ text: "title.19", when: { tall: { text: "title.20.5" } } }} />;
|
|
311
|
+
* const title = app.ui.find("title");
|
|
312
|
+
* if (title !== undefined) app.world.ecs.get(title, Text)?.style; // "title.19" on 1080 x 1920, "title.20.5" on 1080 x 2400
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
type TextTagStyle<Asset extends string = string, Key extends string = string> = Omit<Style<Asset>, "when"> & {
|
|
316
|
+
text?: Key;
|
|
317
|
+
when?: { [Name in keyof WhenVariants<Asset>]?: BaseStyle<Asset> & {
|
|
318
|
+
text?: Key;
|
|
319
|
+
} };
|
|
320
|
+
};
|
|
292
321
|
/**
|
|
293
322
|
* What `resolve` answers with: the base vocabulary with every safe-area token replaced by a
|
|
294
|
-
* number and every variant already merged in
|
|
323
|
+
* number and every variant already merged in, and the text style key a text's style named.
|
|
324
|
+
* Frozen.
|
|
295
325
|
*
|
|
296
326
|
* @example
|
|
297
327
|
* ```ts
|
|
298
328
|
* const resolved: ResolvedStyle = { direction: "row", gap: 12, padding: 24 };
|
|
329
|
+
* const title: ResolvedStyle = { text: "title.20.5", width: 600 };
|
|
299
330
|
* ```
|
|
300
331
|
*/
|
|
301
332
|
type ResolvedStyle = Omit<BaseStyle, "padding" | "margin" | "left" | "top" | "right" | "bottom"> & {
|
|
@@ -314,7 +345,8 @@ type ResolvedStyle = Omit<BaseStyle, "padding" | "margin" | "left" | "top" | "ri
|
|
|
314
345
|
left?: number;
|
|
315
346
|
top?: number;
|
|
316
347
|
right?: number;
|
|
317
|
-
bottom?: number;
|
|
348
|
+
bottom?: number; /** The text style key of a text, when its style object names one. */
|
|
349
|
+
text?: string;
|
|
318
350
|
};
|
|
319
351
|
/**
|
|
320
352
|
* The viewport flags of a style: which `when` variants apply this frame.
|
|
@@ -2299,8 +2331,11 @@ type ButtonEscape = boolean & Brand<"ButtonEscape">;
|
|
|
2299
2331
|
type ButtonPoint = boolean & Brand<"ButtonPoint">;
|
|
2300
2332
|
/** What a text draws: a plain string, or a message of the game's string table. */
|
|
2301
2333
|
type TextContent = (string | Message) & Brand<"TextContent">;
|
|
2302
|
-
/**
|
|
2303
|
-
|
|
2334
|
+
/**
|
|
2335
|
+
* The text style key, or a layout style that may name the key in its base and its `when`
|
|
2336
|
+
* variants; one that names none draws in the built-in `body`.
|
|
2337
|
+
*/
|
|
2338
|
+
type TextStyleProp = (string | TextTagStyle) & Brand<"TextStyleProp">;
|
|
2304
2339
|
/** The asset key of an image. */
|
|
2305
2340
|
type ImageTexture = string & Brand<"ImageTexture">;
|
|
2306
2341
|
/** The asset key of an icon. */
|
|
@@ -2557,6 +2592,8 @@ type ButtonTagProps = CommonProps & {
|
|
|
2557
2592
|
* @example
|
|
2558
2593
|
* ```ts
|
|
2559
2594
|
* const props: TextTagProps = { content: "120", style: "digits" };
|
|
2595
|
+
* // The shop title: "title.19" on a short phone, "title.20.5" on a tall one.
|
|
2596
|
+
* const title: TextTagProps = { content: "Vitrine", style: { text: "title.19", when: { tall: { text: "title.20.5" } } } };
|
|
2560
2597
|
* // The coin counter: Counter is an extra component, the text shows Math.round of its value.
|
|
2561
2598
|
* const coins: TextTagProps = { bind: bind(Counter, "value"), components: [Counter({ value: 25 })] };
|
|
2562
2599
|
* ```
|
|
@@ -2751,8 +2788,8 @@ type Restyled<Properties, Asset extends string> = Properties extends unknown ? O
|
|
|
2751
2788
|
/**
|
|
2752
2789
|
* The same tags with the asset keys, text style keys and message keys of one game. `uiFor`
|
|
2753
2790
|
* carries it, so a game can name the type of its own intrinsics. The asset keys narrow `texture`,
|
|
2754
|
-
* `name` and the `nineSlice` of every style; the text style keys narrow the `style` of a text
|
|
2755
|
-
* and the `textStyle` of a field; the message keys narrow `content` and `placeholder`.
|
|
2791
|
+
* `name` and the `nineSlice` of every style; the text style keys narrow the `style` of a text,
|
|
2792
|
+
* the `text` of its style object and of each `when` variant, and the `textStyle` of a field; the message keys narrow `content` and `placeholder`.
|
|
2756
2793
|
*
|
|
2757
2794
|
* @example
|
|
2758
2795
|
* ```ts
|
|
@@ -2775,7 +2812,7 @@ type IntrinsicElementsFor<Asset extends string, TextStyleKey extends string, Str
|
|
|
2775
2812
|
text: Omit<CommonProps, "style"> & {
|
|
2776
2813
|
content?: string | Message<StringKey>;
|
|
2777
2814
|
bind?: TextBind;
|
|
2778
|
-
style?: TextStyleKey |
|
|
2815
|
+
style?: TextStyleKey | TextTagStyle<Asset, TextStyleKey>;
|
|
2779
2816
|
};
|
|
2780
2817
|
};
|
|
2781
2818
|
//#endregion
|
|
@@ -2970,7 +3007,7 @@ type Guide = {
|
|
|
2970
3007
|
screen: Rect; /** What the resolver writes on its way: one target's rect and its pose. */
|
|
2971
3008
|
scratch: {
|
|
2972
3009
|
part: Rect;
|
|
2973
|
-
pose:
|
|
3010
|
+
pose: AxisPose;
|
|
2974
3011
|
}; /** What `input` locks now: the window, every press, or nothing yet. */
|
|
2975
3012
|
locked: "window" | "all" | "none"; /** Whether a target was shown at the last placement. */
|
|
2976
3013
|
found: boolean;
|
|
@@ -3648,7 +3685,7 @@ type Anchor = {
|
|
|
3648
3685
|
w: number;
|
|
3649
3686
|
h: number;
|
|
3650
3687
|
};
|
|
3651
|
-
pose:
|
|
3688
|
+
pose: AxisPose;
|
|
3652
3689
|
placed: boolean;
|
|
3653
3690
|
hidden: boolean;
|
|
3654
3691
|
missing: number;
|
|
@@ -3719,8 +3756,10 @@ type UiNode = {
|
|
|
3719
3756
|
*/
|
|
3720
3757
|
content?: string;
|
|
3721
3758
|
/**
|
|
3722
|
-
* The text style key a `text`
|
|
3723
|
-
*
|
|
3759
|
+
* The text style key a `text` draws with: the key its style object took for this frame (the base
|
|
3760
|
+
* `text` or one a `when` variant set), else its `style` prop while that is a key; for a text bound
|
|
3761
|
+
* to a named format, the style that format answered. Absent on any other tag and on a text whose
|
|
3762
|
+
* style names none.
|
|
3724
3763
|
*
|
|
3725
3764
|
* @example
|
|
3726
3765
|
* ```ts
|
|
@@ -3728,6 +3767,13 @@ type UiNode = {
|
|
|
3728
3767
|
* const label = app.ui.tree().children.find(node => node.key === "homePlayLabel");
|
|
3729
3768
|
* label?.textStyle; // "ui.button"
|
|
3730
3769
|
* ```
|
|
3770
|
+
* @example
|
|
3771
|
+
* ```ts
|
|
3772
|
+
* // `<text key="title" style={{ text: "title.19", when: { tall: { text: "title.20.5" } } }} />`
|
|
3773
|
+
* // on a tall viewport (1080 x 2400), under the root row.
|
|
3774
|
+
* const title = app.ui.tree().children.find(node => node.key === "title");
|
|
3775
|
+
* title?.textStyle; // "title.20.5"
|
|
3776
|
+
* ```
|
|
3731
3777
|
*/
|
|
3732
3778
|
textStyle?: string;
|
|
3733
3779
|
value?: string;
|
|
@@ -3781,4 +3827,4 @@ type CommonProps = {
|
|
|
3781
3827
|
components?: ElementComponents;
|
|
3782
3828
|
};
|
|
3783
3829
|
//#endregion
|
|
3784
|
-
export { ResolvedStyle as $, TextFormats as A, types_d_exports$1 as B, Point as C, TextFormat as D, TextBind as E, types_d_exports as F, Message as G, Config$2 as H, defineComponent as I, StringTable as J, Part as K, Config$1 as L, TextStyleInput as M, TextStyles as N, TextFormatAnswer as O, TextValue as P, IsFlags as Q, InputApi as R, FormattedNumber as S, TextApi as T, I18nApi as U, Argument as V, IntlKit as W, TypedTr as X, TextKey as Y, types_d_exports$2 as Z, UiIntrinsicElements as _, JsxChild as a, Config as b, UiNode as c, DebugTrigger as d, Style as et, LocalWrite as f, IntrinsicElementsFor as g, defineTokens as h, Finding as i, TextRunStyle as j, TextFormatFunction as k, LayoutState as l, popup as m, ElementChange as n,
|
|
3830
|
+
export { ResolvedStyle as $, TextFormats as A, types_d_exports$1 as B, Point as C, TextFormat as D, TextBind as E, types_d_exports as F, Message as G, Config$2 as H, defineComponent as I, StringTable as J, Part as K, Config$1 as L, TextStyleInput as M, TextStyles as N, TextFormatAnswer as O, TextValue as P, IsFlags as Q, InputApi as R, FormattedNumber as S, TextApi as T, I18nApi as U, Argument as V, IntlKit as W, TypedTr as X, TextKey as Y, types_d_exports$2 as Z, UiIntrinsicElements as _, JsxChild as a, Config as b, UiNode as c, DebugTrigger as d, Style as et, LocalWrite as f, IntrinsicElementsFor as g, defineTokens as h, Finding as i, TextRunStyle as j, TextFormatFunction as k, LayoutState as l, popup as m, ElementChange as n, TextTagStyle as nt, JsxState as o, ScrollState as p, State$2 as q, ElementMotion as r, WhenFlags as rt, PopupComponent as s, DescriptionNode as t, StylesState as tt, Box as u, BindField as v, State as w, CountdownValue as x, BindOptions as y, State$1 as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as
|
|
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 FilterSlotInputs, Ar as Api$3, M as SyncApi, Q as Api$4, Qn as AnchorTarget, Un as TypeTag, Ur as Events$3, Vr as Api$6, Wn as Descriptor, Wr as Json, ar as NumericFields, at as PixiSprite, b as Events$4, bi as Require, br as Entity, bt as FilterCache, cr as ReducedMotion, dr as TrackSegment, gr as ComponentHandle, hr as AnyComponentValue, ir as MotionHandle, it as PixiModule, j as FilterSlotQuad, k as FilterSlot, mn as Api$2, nt as PixiFilter, oi as Events$5, ot as PixiTexture, pr as AnyComponent, rt as PixiGpuProgram, s as Events$1, st as PixiUniformGroup, t as Api$5, tr as Ease, ui as Api$1, ur as TrackOptions, vr as ComponentType, vt as Point, yi as Events$2 } from "./types-TmWmx6Ca.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-DOsd3uSB.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -875,7 +875,8 @@ type Target = {
|
|
|
875
875
|
};
|
|
876
876
|
/**
|
|
877
877
|
* The pose `at(target)` answers with: where the target rests in root (reference) space, its rest
|
|
878
|
-
* `Transform` composed through the `Parent` chain, or the identity pose when nothing is there.
|
|
878
|
+
* `Transform` composed through the `Parent` chain, or the identity pose when nothing is there. The per-axis factors
|
|
879
|
+
* of the target (`scaleX`, `scaleY`) are not carried: `at()` answers the uniform `scale` only.
|
|
879
880
|
*
|
|
880
881
|
* @example
|
|
881
882
|
* ```ts
|
|
@@ -1034,20 +1035,23 @@ type Events = {
|
|
|
1034
1035
|
/**
|
|
1035
1036
|
* One key of a keyframe track in `defineMotion`: where on the track it sits (`at`, 0..1 of
|
|
1036
1037
|
* `transition.ms`), the curve of the segment that ends on it (default `"inOut"`) and the pose.
|
|
1037
|
-
* `dx` and `dy` are offsets from the rest pose in reference units; `rotation` (radians), `scale
|
|
1038
|
-
* and `alpha` are absolute.
|
|
1038
|
+
* `dx` and `dy` are offsets from the rest pose in reference units; `rotation` (radians), `scale`,
|
|
1039
|
+
* `scaleX`, `scaleY` and `alpha` are absolute. `scaleX` and `scaleY` stretch one axis on top of `scale`; a view
|
|
1040
|
+
* that sets neither rests at 1. A field the key leaves out holds the previous key's value.
|
|
1039
1041
|
*
|
|
1040
1042
|
* An enter walk starts on the first key and ends on the rest pose at `at: 1`; an exit walk starts
|
|
1041
1043
|
* where the view is and ends on the last key, the pose the element leaves in.
|
|
1042
1044
|
*
|
|
1043
|
-
* In a loop (`loop: { track }`) every Transform field is an offset added to the rest pose: `dx`, `dy`, `rotation
|
|
1044
|
-
* and `
|
|
1045
|
-
* stands on its first key until that key's `at`, and its last key repeats its first one.
|
|
1045
|
+
* In a loop (`loop: { track }`) every Transform field is an offset added to the rest pose: `dx`, `dy`, `rotation`,
|
|
1046
|
+
* `scale`, `scaleX` and `scaleY` (`scale: 0.05` grows a scale-1 view to 1.05, `scaleX: 0.05` widens it alone). `alpha`
|
|
1047
|
+
* stays absolute. The loop stands on its first key until that key's `at`, and its last key repeats its first one.
|
|
1046
1048
|
*
|
|
1047
1049
|
* @example
|
|
1048
1050
|
* ```ts
|
|
1049
1051
|
* // A popup board at 42 % of its swing: 14 u below its rest, tilted 5°, slightly larger.
|
|
1050
1052
|
* const key: MotionKeyframe = { at: 0.42, ease: "out", Transform: { dy: 14, rotation: 0.087, scale: 1.04 } };
|
|
1053
|
+
* // A ribbon at 65 % of its unfurl: 8 % wider than its rest, as tall as it rests.
|
|
1054
|
+
* const unfurl: MotionKeyframe = { at: 0.65, Transform: { scaleX: 1.08 } };
|
|
1051
1055
|
* ```
|
|
1052
1056
|
*/
|
|
1053
1057
|
type MotionKeyframe = {
|
|
@@ -1058,6 +1062,8 @@ type MotionKeyframe = {
|
|
|
1058
1062
|
readonly dy?: number;
|
|
1059
1063
|
readonly rotation?: number;
|
|
1060
1064
|
readonly scale?: number;
|
|
1065
|
+
readonly scaleX?: number;
|
|
1066
|
+
readonly scaleY?: number;
|
|
1061
1067
|
};
|
|
1062
1068
|
readonly Shape?: {
|
|
1063
1069
|
readonly alpha?: number;
|
|
@@ -3473,14 +3473,16 @@ type MotionCause = "mount" | "change" | "discard";
|
|
|
3473
3473
|
*/
|
|
3474
3474
|
type ReducedMotion = "cut" | "keep";
|
|
3475
3475
|
/**
|
|
3476
|
-
* Only the numeric fields of a component value: what a tween can interpolate.
|
|
3476
|
+
* Only the numeric fields of a component value: what a tween can interpolate. An optional number counts too, and its
|
|
3477
|
+
* entry is a plain required `number`, so a tween names it with a number and never with `undefined`.
|
|
3477
3478
|
*
|
|
3478
3479
|
* @example
|
|
3479
3480
|
* ```ts
|
|
3480
3481
|
* type Numbers = NumericFields<{ x: number; texture: string }>; // { x: number }
|
|
3482
|
+
* type Stretch = NumericFields<{ x: number; scaleX?: number }>; // { x: number; scaleX: number }
|
|
3481
3483
|
* ```
|
|
3482
3484
|
*/
|
|
3483
|
-
type NumericFields<Value extends object> = { [Key in keyof Value as Value[Key] extends number ? Key : never]
|
|
3485
|
+
type NumericFields<Value extends object> = { [Key in keyof Value as Exclude<Value[Key], undefined> extends number ? Key : never]-?: Exclude<Value[Key], undefined> };
|
|
3484
3486
|
/**
|
|
3485
3487
|
* One keyframe segment of a track: the fraction of the track's `ms` it ends at (`0..1`), the
|
|
3486
3488
|
* curve it eases with (the track's `ease` when left out) and the numeric fields it reaches. A
|
|
@@ -10998,6 +11000,8 @@ type TeardownScope = {
|
|
|
10998
11000
|
* const value: TransformValue = {
|
|
10999
11001
|
* x: 640, y: 340, rotation: 0, scale: 1.1, pivot: { x: 100, y: 40 }
|
|
11000
11002
|
* };
|
|
11003
|
+
* // A ribbon title that unfurls: 1 % of its width, full height, around its centre.
|
|
11004
|
+
* const ribbon: TransformValue = { ...value, scale: 1, scaleX: 0.01, pivot: { x: 100, y: 40 } };
|
|
11001
11005
|
* ```
|
|
11002
11006
|
*/
|
|
11003
11007
|
type TransformValue = {
|
|
@@ -11005,6 +11009,31 @@ type TransformValue = {
|
|
|
11005
11009
|
y: number;
|
|
11006
11010
|
rotation: number;
|
|
11007
11011
|
scale: number;
|
|
11012
|
+
/**
|
|
11013
|
+
* A factor on `scale` along X alone: the view draws `scale × scaleX` wide. Absent by default and read as 1, so a view
|
|
11014
|
+
* that never sets it is stored, snapshotted and described exactly as before. A tween, a motion or `toRest` of it starts
|
|
11015
|
+
* from 1 while it is absent. A child under a parent that turns and stretches on one axis is not sheared: the factors
|
|
11016
|
+
* compose per axis, and the rotation adds.
|
|
11017
|
+
*
|
|
11018
|
+
* @example
|
|
11019
|
+
* ```ts
|
|
11020
|
+
* // The ribbon unfurls to its full width, 260 ms after the screen opened.
|
|
11021
|
+
* world.ecs.spawn(owner, [Layer({ name: "ui" }), Transform({ x: 540, y: 300, scaleX: 0.01, pivot: { x: 200, y: 40 } })]);
|
|
11022
|
+
* view.tween(Transform, { scaleX: 1 }, { ms: 260 }); // drawn 400 wide at the end, 80 high throughout
|
|
11023
|
+
* ```
|
|
11024
|
+
*/
|
|
11025
|
+
scaleX?: number;
|
|
11026
|
+
/**
|
|
11027
|
+
* A factor on `scale` along Y alone: the view draws `scale × scaleY` high. Absent by default and read as 1, like
|
|
11028
|
+
* `scaleX`.
|
|
11029
|
+
*
|
|
11030
|
+
* @example
|
|
11031
|
+
* ```ts
|
|
11032
|
+
* // A squash on landing: wider and shorter for a beat.
|
|
11033
|
+
* world.ecs.set(blob, Transform, { scaleX: 1.2, scaleY: 0.8 });
|
|
11034
|
+
* ```
|
|
11035
|
+
*/
|
|
11036
|
+
scaleY?: number;
|
|
11008
11037
|
pivot: Point;
|
|
11009
11038
|
};
|
|
11010
11039
|
/**
|
|
@@ -11290,8 +11319,8 @@ type OverlayLevelValue = {
|
|
|
11290
11319
|
landed: boolean;
|
|
11291
11320
|
};
|
|
11292
11321
|
/**
|
|
11293
|
-
* Where a view sits: reference units, radians, uniform scale, and the local point it
|
|
11294
|
-
* around.
|
|
11322
|
+
* Where a view sits: reference units, radians, uniform scale (with an optional factor per axis), and the local point it
|
|
11323
|
+
* turns around.
|
|
11295
11324
|
*/
|
|
11296
11325
|
declare const Transform: ComponentType<TransformValue>;
|
|
11297
11326
|
/**
|
|
@@ -11525,6 +11554,22 @@ type CoverFrame = {
|
|
|
11525
11554
|
texture: PixiTexture;
|
|
11526
11555
|
users: Set<Entity>;
|
|
11527
11556
|
};
|
|
11557
|
+
/**
|
|
11558
|
+
* The scratch pose of a hot loop: a `TransformValue` whose per-axis factors are always there. `rootPoseInto` writes both
|
|
11559
|
+
* on every call (1 when the entity has none), so a reused object never carries the factor of the entity before. A pose
|
|
11560
|
+
* that may reach the ECS stays a `TransformValue`, which carries a factor only when it is not 1.
|
|
11561
|
+
*
|
|
11562
|
+
* @example
|
|
11563
|
+
* ```ts
|
|
11564
|
+
* // A reader that asks every frame keeps one pose and passes it in again.
|
|
11565
|
+
* const pose: AxisPose = { x: 0, y: 0, rotation: 0, scale: 1, scaleX: 1, scaleY: 1, pivot: { x: 0, y: 0 } };
|
|
11566
|
+
* rootPoseInto(ctx.require(worldPlugin).ecs, host, pose); // pose.scaleX is 1 for a host without the field
|
|
11567
|
+
* ```
|
|
11568
|
+
*/
|
|
11569
|
+
type AxisPose = TransformValue & {
|
|
11570
|
+
scaleX: number;
|
|
11571
|
+
scaleY: number;
|
|
11572
|
+
};
|
|
11528
11573
|
/**
|
|
11529
11574
|
* One layer of the scene: its container, the sort rule its children follow, the reasons that hide the container
|
|
11530
11575
|
* (`hidden.ts`), and whether it is the scene's HUD layer (`above: "overlays"`).
|
|
@@ -13024,7 +13069,7 @@ type HitWalk = {
|
|
|
13024
13069
|
* handed to a call that is not inlined is boxed, once per view.
|
|
13025
13070
|
*/
|
|
13026
13071
|
alphas: Float64Array; /** The root pose of the entity whose box is tested, written in place. */
|
|
13027
|
-
pose:
|
|
13072
|
+
pose: AxisPose; /** The reference point brought into an entity's own space, written in place. */
|
|
13028
13073
|
local: Point; /** The reference x. */
|
|
13029
13074
|
x: number; /** The reference y. */
|
|
13030
13075
|
y: number; /** The filter of `hitTest`; `undefined` while `hitAll` collects. */
|
|
@@ -14828,4 +14873,4 @@ type BundleCompanion = {
|
|
|
14828
14873
|
unload(bundle: string): void;
|
|
14829
14874
|
};
|
|
14830
14875
|
//#endregion
|
|
14831
|
-
export {
|
|
14876
|
+
export { Config$2 as $, ChangeHook as $n, Snapshot as $r, PerfSampleLine as $t, FilterSlotInputs as A, type as An, Api$3 as Ar, MonitorSections as At, OverlayValue as B, NodeTable as Bn, types_d_exports$5 as Br, PerfChange as Bt, SceneSpec as C, TextStylesOf as Cn, Mut as Cr, FrameColumns as Ct, AxisPose as D, exit as Dn, SystemDefinition as Dr, FrameRing as Dt, types_d_exports$1 as E, defineFlow as En, ResourceType as Er, FrameRecord as Et, HudPart as F, Bookmark as Fn, Api$4 as Fr, PERF_LOG_VERSION as Ft, SpriteBlend as G, Effect as Gn, Root as Gr, PerfEventLine as Gt, Shape as H, SceneIdOf as Hn, Config$6 as Hr, PerfCollectorLine as Ht, HudPartValue as I, DefineNode as In, ClockSource as Ir, PROBLEM_RULES as It, Transform as J, Hint as Jn, Patch as Jr, PerfHeaderLine as Jt, SpriteOptions as K, EffectOptions as Kn, State$6 as Kr, PerfEventName as Kt, NineSlice$1 as L, FlowGraph as Ln, Config$5 as Lr, PassKind as Lt, SyncApi as M, FeaturePlugin as Mn, Explained as Mr, OverlayWhat as Mt, WhyEntry as N, FeatureTree as Nn, State$4 as Nr, PERF_CAUSES as Nt, DebugSwitches as O, slot as On, SystemFor as Or, LongFrameEntry as Ot, Display as P, AnyFlow as Pn, types_d_exports$4 as Pr, PERF_GAP_BUCKETS as Pt, Api$1 as Q, AnchorTarget as Qn, SaveUnreadableError as Qr, PerfMeasured as Qt, NineSliceValue as R, FlowState as Rn, FakeClock as Rr, PassRecord as Rt, SceneDefinition as S, TextFormatsOf as Sn, FrameDiff as Sr, WhyLive as St, State$1 as T, contribution as Tn, QueryTerm as Tr, FrameReadout as Tt, ShapeValue as U, TypeTag as Un, Events$5 as Ur, PerfCounts as Ut, Parent as V, RouteStep as Vn, Api$5 as Vr, PerfChangeEntry as Vt, Sprite as W, Descriptor as Wn, Json as Wr, PerfDisplay as Wt, sprite as X, Answer as Xn, ProviderCall as Xr, PerfLongFrameLine as Xt, TransformValue as Y, NodeFx as Yn, PlayerStateProvider as Yr, PerfLogLine as Yt, AdaptiveScale as Z, Answered as Zn, SaveDoc as Zr, PerfMarkLine as Zt, AnySceneProjection as _, types_d_exports$8 as _i, EmitterIdOf as _n, ComponentSchema as _r, Orientation as _t, Config as a, Config$7 as ai, ProblemEventDetail as an, NumericFields as ar, PixiSprite as at, Events$1 as b, Require as bi, Position as bn, Entity as br, FilterCache as bt, LoadBundles as c, State$7 as ci, ShaderEventDetail as cn, ReducedMotion as cr, PoolTrim as ct, Manifest as d, Config$8 as di, CANVAS_RESTARTS as dn, TrackSegment as dr, types_d_exports$2 as dt, SnapshotOf as ei, PerfSpikeLine as en, DescriptionNode as er, MonitorConfig as et, ReadyBundles as f, FrameRate as fi, CanvasRestart as fn, ViewHandle as fr, ShotsApi as ft, types_d_exports as g, Time as gi, Config$3 as gn, ComponentHandle as gr, RenderStats as gt, Usage as h, ThermalReading as hi, BundlesOf as hn, AnyComponentValue as hr, MonitorCounts as ht, BundleSpec as i, Api$6 as ii, PoolTrimDetail as in, MotionHandle as ir, PixiModule as it, FilterSlotQuad as j, FeatureDescription as jn, Config$4 as jr, OverlayEventDetail as jt, FilterSlot as k, to as kn, TagType as kr, MONITOR_SECTIONS as kt, LoadReason as l, types_d_exports$7 as li, ShaderWhat as ln, SceneSwitch as lr, State$2 as lt, Tier as m, State$8 as mi, Api$2 as mn, AnyComponentType as mr, Captured as mt, AssetsIo as n, RngApi as ni, PerfTelemetryLine as nn, Motion as nr, PixiFilter as nt, DefineBundles as o, Events$6 as oi, ProblemRule as on, ProjectionMotion as or, PixiTexture as ot, State as p, RateChange as pi, DEMAND_REASONS as pn, AnyComponent as pr, ShotsConfig as pt, SpriteValue as q, GuideOptions as qn, types_d_exports$6 as qr, PerfGapLine as qt, BundleMap as r, RngState as ri, PerfThermalLine as rn, MotionCause as rr, PixiGpuProgram as rt, Events as s, PauseReason as si, SHADER_WHATS as sn, ProjectionSpec as sr, PixiUniformGroup as st, Api as t, StoreApi as ti, PerfStartupLine as tn, Ease as tr, PixiContainer as tt, LoadResult as u, Api$7 as ui, WarmDetail as un, TrackOptions as ur, Under as ut, Config$1 as v, Config$9 as vi, GameTypes as vn, ComponentType as vr, Point as vt, ScenesApi as w, types_d_exports$3 as wn, Narrowed as wr, FrameReadResult as wt, LayerMap as x, State$3 as xn, EntitySnapshot as xr, RetakeWhy as xt, DefineScene as y, Events$8 as yi, HudKeysOf as yn, ComponentValue as yr, ViewportSize as yt, Overlay as z, JournalEntry as zn, State$5 as zr, PerfCause as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { $r as Snapshot, Wr as Json } from "./types-TmWmx6Ca.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-DjvkUuv6.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
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 { Ar as Api$1, Fr as Api$4, Q as Api, Vr as Api$2, ii as Api$3 } from "./types-TmWmx6Ca.mjs";
|
|
2
|
+
import { W as AnimApi, r as UiApi } from "./types-DmOnlY66.mjs";
|
|
3
|
+
import { R as InputApi } from "./types-DOsd3uSB.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-DjvkUuv6.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-ohTEXbrA.mjs";
|
|
6
|
+
import { t as commands } from "./commands-Cwxtb672.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. */
|