@moku-labs/game 0.15.95 → 0.15.98
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 +1 -1
- 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-DcGoU3wp.d.mts → commands-CnGF1AfS.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-CZ1_l9Hn.d.mts → define-hPbGjPAY.d.mts} +2 -2
- package/dist/{headless-9UyUfvF5.d.mts → headless-Co3SEFi5.d.mts} +1 -1
- package/dist/{index-B8XphAxo.d.mts → index-E62NqrO6.d.mts} +53 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +3 -3
- 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-DsAz7KUU.d.mts → runtime-B69fIYx_.d.mts} +1 -1
- package/dist/{sources-DIl02J8z.mjs → sources-Cqqz-0-b.mjs} +1 -1
- package/dist/{src-D-i4qig2.mjs → src-GFqUAdoU.mjs} +973 -162
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-B-n_yE-i.d.mts → types-BE6tcAFX.d.mts} +2 -2
- package/dist/{types-0QTB6RV7.d.mts → types-Ddezbux2.d.mts} +4 -4
- package/dist/{types-Dhnc_iQk.d.mts → types-DeybZgVT.d.mts} +71 -8
- package/dist/{types-D8tWWOCK.d.mts → types-L3E-YS4N.d.mts} +46 -3
- package/dist/{types-CenejHAB.d.mts → types-qCcSw8YI.d.mts} +48 -12
- package/dist/{visual-B0ZwgkDL.d.mts → visual-BziiITWm.d.mts} +6 -6
- package/dist/{visual-Cl7Q7pO9.mjs → visual-DhqD6W3v.mjs} +15 -5
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +6 -5
- package/package.json +1 -1
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } 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 { An as FeaturePlugin, Hn as Descriptor, Hr as Json, Ir as FakeClock, Kn as Hint, Mn as AnyFlow, Pr as ClockSource, Rn as NodeTable, qn as NodeFx } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { t as createApp } from "./index-E62NqrO6.mjs";
|
|
3
|
+
import { b as memory, x as saveOf, y as WithGameState } from "./types-Ddezbux2.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-Co3SEFi5.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 {
|
|
1
|
+
import { _ as flattenFeatures, in as refuseStart, ln as type, on as exit, t as createApp } from "./src-GFqUAdoU.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.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 { Hr as Json, Zr as Snapshot } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Hr as Json, Zr as Snapshot } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-Co3SEFi5.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { H as I18nApi, J as TextKey, q as StringTable } from "./types-
|
|
4
|
-
import {
|
|
1
|
+
import { An as FeaturePlugin, Br as Config, Hr as Json, Ir as FakeClock, Jr as ProviderCall, Mn as AnyFlow, Pr as ClockSource, Q as Config$2, Qr as SnapshotOf, Vn as TypeTag, Yr as SaveDoc, a as Config$3, d as Manifest, ht as Orientation, mn as Config$1, n as AssetsIo, nt as PixiModule, qr as PlayerStateProvider } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-DeybZgVT.mjs";
|
|
3
|
+
import { H as I18nApi, J as TextKey, q as StringTable } from "./types-L3E-YS4N.mjs";
|
|
4
|
+
import { Et as effectsPlugin, _t as platformPlugin, i as screen, kt as audioPlugin, t as createApp, yt as PlatformProvider } from "./index-E62NqrO6.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 { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-
|
|
2
|
-
import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-
|
|
1
|
+
import { $n as Ease, A as FilterSlotQuad, Hn as Descriptor, Hr as Json, O as FilterSlot, Or as Api$3, Vn as TypeTag, Vr as Events$3, Xn as AnchorTarget, Z as Api$4, _i as Events$2, at as PixiUniformGroup, b as Events$4, ci as Api$1, cr as TrackOptions, dr as AnyComponent, et as PixiFilter, fn as Api$2, gr as ComponentType, gt as Point, ii as Events$5, it as PixiTexture, j as SyncApi, k as FilterSlotInputs, lr as TrackSegment, mr as ComponentHandle, nr as MotionHandle, nt as PixiModule, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, rt as PixiSprite, s as Events$1, t as Api$5, tt as PixiGpuProgram, vi as Require, vr as Entity, vt as FilterCache, zr as Api$6 } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { H as I18nApi, L as InputApi, T as TextApi, c as UiNode, et as StylesState, i as Finding, l as LayoutState, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-L3E-YS4N.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
|
|
@@ -2241,8 +2241,64 @@ type EmitterInstance = {
|
|
|
2241
2241
|
readonly space: "world" | "local"; /** Pixi's particle class, from the module the renderer loaded. */
|
|
2242
2242
|
readonly particleClass: PixiModule["Particle"];
|
|
2243
2243
|
};
|
|
2244
|
+
//#endregion
|
|
2245
|
+
//#region src/plugins/effects/set/types.d.ts
|
|
2246
|
+
/**
|
|
2247
|
+
* @file effects/set — the values of the members of the engine's effect set: one field per uniform, then `enabled` and
|
|
2248
|
+
* `order`, which every filter component carries. A number field is tweenable; a colour is a `0xrrggbb` number, set,
|
|
2249
|
+
* not tweened.
|
|
2250
|
+
*/
|
|
2251
|
+
/**
|
|
2252
|
+
* `Flash`: the view washed with `color` by `amount`, 0 none, 1 all of it.
|
|
2253
|
+
*
|
|
2254
|
+
* @example
|
|
2255
|
+
* ```ts
|
|
2256
|
+
* const value: FlashValue = { amount: 1, color: 0xffd700, enabled: true, order: 0 };
|
|
2257
|
+
* ```
|
|
2258
|
+
*/
|
|
2259
|
+
type FlashValue = {
|
|
2260
|
+
amount: number;
|
|
2261
|
+
color: number;
|
|
2262
|
+
enabled: boolean;
|
|
2263
|
+
order: number;
|
|
2264
|
+
};
|
|
2265
|
+
/**
|
|
2266
|
+
* `Grade`: contrast, brightness and saturation of the view, each 1 for none (0..2), then a multiply by `tint`.
|
|
2267
|
+
*
|
|
2268
|
+
* @example
|
|
2269
|
+
* ```ts
|
|
2270
|
+
* const value: GradeValue = { brightness: 1, contrast: 1, saturation: 0, tint: 0xffffff, enabled: true, order: 0 };
|
|
2271
|
+
* ```
|
|
2272
|
+
*/
|
|
2273
|
+
type GradeValue = {
|
|
2274
|
+
brightness: number;
|
|
2275
|
+
contrast: number;
|
|
2276
|
+
saturation: number;
|
|
2277
|
+
tint: number;
|
|
2278
|
+
enabled: boolean;
|
|
2279
|
+
order: number;
|
|
2280
|
+
};
|
|
2281
|
+
/**
|
|
2282
|
+
* `Vignette`: the view darkened, or coloured, outside a disc around `x`, `y` (0..1 of the view) of `radius`, over a soft
|
|
2283
|
+
* edge `soft` wide, by `amount`.
|
|
2284
|
+
*
|
|
2285
|
+
* @example
|
|
2286
|
+
* ```ts
|
|
2287
|
+
* const value: VignetteValue = { x: 0.5, y: 0.5, radius: 0.3, soft: 0.4, color: 0x000000, amount: 1, enabled: true, order: 0 };
|
|
2288
|
+
* ```
|
|
2289
|
+
*/
|
|
2290
|
+
type VignetteValue = {
|
|
2291
|
+
x: number;
|
|
2292
|
+
y: number;
|
|
2293
|
+
radius: number;
|
|
2294
|
+
soft: number;
|
|
2295
|
+
color: number;
|
|
2296
|
+
amount: number;
|
|
2297
|
+
enabled: boolean;
|
|
2298
|
+
order: number;
|
|
2299
|
+
};
|
|
2244
2300
|
declare namespace types_d_exports$2 {
|
|
2245
|
-
export { AlphaValue, AssetsReplaced$1 as AssetsReplaced, BlurValue, BundleUnloaded$1 as BundleUnloaded, ColorMatrixValue, Config$2 as Config, CoreKind, Curve, Deps$2 as Deps, DisplacementValue, EffectsApi, EffectsCtx, EffectsDiagnostics, EffectsStats, EmitterConfig, EmitterDefinition, EmitterValue, FilterArea, FilterCache, FilterChainContext, FilterComponent, FilterDefinition, FilterInput, FilterInputDefinition, FilterSpec, FilterStage, FilterStep, FilterValueOf, GlowValue, HotSwap, KernelSlice$2 as KernelSlice, NoiseValue, OutlineValue, Range, ResolvedEmitterConfig, Shape, State$2 as State, UniformDeclaration, UniformSpec, UniformValue };
|
|
2301
|
+
export { AlphaValue, AssetsReplaced$1 as AssetsReplaced, BlurValue, BundleUnloaded$1 as BundleUnloaded, ColorMatrixValue, Config$2 as Config, CoreKind, Curve, Deps$2 as Deps, DisplacementValue, EffectsApi, EffectsCtx, EffectsDiagnostics, EffectsStats, EmitterConfig, EmitterDefinition, EmitterValue, FilterArea, FilterCache, FilterChainContext, FilterComponent, FilterDefinition, FilterInput, FilterInputDefinition, FilterSpec, FilterStage, FilterStep, FilterValueOf, FlashValue, GlowValue, GradeValue, HotSwap, KernelSlice$2 as KernelSlice, NoiseValue, OutlineValue, Range, ResolvedEmitterConfig, Shape, State$2 as State, UniformDeclaration, UniformSpec, UniformValue, VignetteValue };
|
|
2246
2302
|
}
|
|
2247
2303
|
/**
|
|
2248
2304
|
* effects plugin config. `maxParticles` here is the global warning line; the `maxParticles` of an
|
|
@@ -2647,7 +2703,11 @@ type Config$1 = {
|
|
|
2647
2703
|
* new sound with its id replaces it and names no `fadeMs`, or a stop names none.
|
|
2648
2704
|
*/
|
|
2649
2705
|
sfxFadeMs: number; /** Reads the player's choice from the committed player. `undefined`: the buses stay at `buses`. */
|
|
2650
|
-
volumes: Volumes | undefined;
|
|
2706
|
+
volumes: Volumes | undefined;
|
|
2707
|
+
/**
|
|
2708
|
+
* Context factory, the test seam. `undefined`: `new AudioContext()` when the global exists, otherwise headless.
|
|
2709
|
+
* On iOS the plugin calls it again after a return from the background, so each call returns a new context.
|
|
2710
|
+
*/
|
|
2651
2711
|
context: (() => AudioContextLike) | undefined; /** How many started sounds `journal()` keeps, newest last. `0` turns the journal off. */
|
|
2652
2712
|
journal: number; /** How music plays. `"stream"` needs MP3 or AAC: WebM Opus is silent through a media element in WebKit (bug 276813). Sounds always decode. */
|
|
2653
2713
|
music: MusicMode; /** Set on `navigator.audioSession.type` in `onStart`, before the context exists. No-op where the API is missing (every Chromium, Firefox). */
|
|
@@ -2742,7 +2802,9 @@ type State$1 = {
|
|
|
2742
2802
|
warnedVolumes: boolean;
|
|
2743
2803
|
music: MusicTrack | undefined; /** The latest switch still decoding; `undefined` once it started or a later request replaced it. */
|
|
2744
2804
|
musicPending: MusicSwitch | undefined; /** Removes the two window listeners of the unlock. */
|
|
2745
|
-
unlock: (() => void) | undefined; /**
|
|
2805
|
+
unlock: (() => void) | undefined; /** Cancels the renewal that waits after a return from the background: its timer and its two listeners. */
|
|
2806
|
+
renewal: (() => void) | undefined; /** The token of the renewal that runs; a stop or a newer renewal replaces it, and the old one makes nothing. */
|
|
2807
|
+
renewing: object | undefined; /** The removers of the three fx handlers. */
|
|
2746
2808
|
removers: Array<() => void>; /** The `navigator.audioSession` that took `config.session`; `stop` writes `"auto"` back to it. */
|
|
2747
2809
|
session: AudioSessionLike | undefined; /** Streamed tracks that fade out, each freed by its timer. */
|
|
2748
2810
|
retiring: Set<RetiringTrack>;
|
|
@@ -2830,8 +2892,9 @@ type AudioApi = {
|
|
|
2830
2892
|
* Tells whether the audio context runs. A shell that lets audio play with no gesture, such as a
|
|
2831
2893
|
* native webview with the requirement switched off, makes it true at start: at once when the
|
|
2832
2894
|
* context is created running, otherwise when the `resume()` of `onStart` fulfils. A browser
|
|
2833
|
-
* that wants a gesture keeps it false until the first
|
|
2834
|
-
* context
|
|
2895
|
+
* that wants a gesture keeps it false until the first touch or click on the page resumed the
|
|
2896
|
+
* context and it runs; on iOS that resume may stay pending until iOS gives the sound back. It is
|
|
2897
|
+
* false for the whole of a headless run, and for the moment an iOS renewal closes the old context.
|
|
2835
2898
|
*
|
|
2836
2899
|
* @returns True once the context is running.
|
|
2837
2900
|
* @example
|
|
@@ -3222,4 +3285,4 @@ type UiApi = {
|
|
|
3222
3285
|
}> | undefined;
|
|
3223
3286
|
};
|
|
3224
3287
|
//#endregion
|
|
3225
|
-
export {
|
|
3288
|
+
export { mark as $, FilterComponent as A, FramesValue as B, EmitterDefinition as C, ColorMatrixValue as D, BlurValue as E, OutlineValue as F, HapticKind as G, State$3 as H, UniformDeclaration as I, HAPTIC_KINDS as J, SfxDescriptor as K, AnimApi as L, FilterValueOf as M, GlowValue as N, DisplacementValue as O, NoiseValue as P, haptic as Q, AnimPlayerValue as R, EmitterConfig as S, AlphaValue as T, Target as U, MotionKeyframe as V, types_d_exports$3 as W, external as X, defineAnimation as Y, frames as Z, State$2 as _, AudioApi as a, spawn as at, GradeValue as b, MusicDescriptor as c, stopSfx as ct, State$1 as d, wait as dt, parallel as et, VolumesFor as f, OverlayApi as ft, EffectsStats as g, EffectsApi as h, types_d_exports as i, sfx as it, FilterSpec as j, FilterArea as k, MusicOptions as l, tween as lt, Config$2 as m, State as n, sequence as nt, AudioContextLike as o, spawned as ot, types_d_exports$1 as p, types_d_exports$4 as pt, Step as q, UiApi as r, set as rt, Config$1 as s, stagger as st, Config as t, play as tt, SoundEntry as u, use as ut, types_d_exports$2 as v, EmitterValue as w, VignetteValue as x, FlashValue as y, Config$3 as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-
|
|
1
|
+
import { $n as Ease, Dr as TagType, Hn as Descriptor, Hr as Json, J as TransformValue, Kn as Hint, Nr as Api$5, Or as Api$2, Xn as AnchorTarget, Yn as Answered, Z as Api$3, Zn as ChangeHook, _t as ViewportSize, ci as Api, dr as AnyComponent, er as Motion, fn as Api$1, fr as AnyComponentType, gr as ComponentType, ir as ProjectionMotion, nr as MotionHandle, or as ReducedMotion, pr as AnyComponentValue, rr as NumericFields, s as Events$1, t as Api$4, tr as MotionCause, ur as ViewHandle, vi as Require, vr as Entity } from "./types-qCcSw8YI.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";
|
|
@@ -1713,11 +1713,31 @@ type TextStyleInput = {
|
|
|
1713
1713
|
* ```
|
|
1714
1714
|
*/
|
|
1715
1715
|
lineHeight?: number;
|
|
1716
|
+
/**
|
|
1717
|
+
* Evens the lines of a wrapped block, like CSS `text-wrap: balance`: a block that wraps to 2 to 6
|
|
1718
|
+
* lines is laid out at the narrowest width that keeps its number of lines, so its last line is
|
|
1719
|
+
* no lone word. `wrap` keeps the width, `balance` says how it is used; no line is wider than the
|
|
1720
|
+
* wrap. One line, no wrap, more than 6 lines or a word wider than the wrap: the greedy lines.
|
|
1721
|
+
* `measure`, the `ui` layout and the drawn label share the answer. False when left out.
|
|
1722
|
+
*
|
|
1723
|
+
* @example
|
|
1724
|
+
* ```ts
|
|
1725
|
+
* // The hint under the order board: greedy, its second line was «один.» alone.
|
|
1726
|
+
* defineTextStyles({
|
|
1727
|
+
* "shop.hint": { font: "ui.font-body", size: 32, fill: 0x3b2a1a, wrap: 800, balance: true }
|
|
1728
|
+
* });
|
|
1729
|
+
*
|
|
1730
|
+
* app.text.measure("Здесь то, что ждут ваши заказы. Возьмите один.", "shop.hint");
|
|
1731
|
+
* // { width: 441.6, height: 76.8 } on the 0.6 em fallback: «Здесь то, что ждут ваши» /
|
|
1732
|
+
* // «заказы. Возьмите один.». Without balance the width is its first line, 40 glyphs × 19.2.
|
|
1733
|
+
* ```
|
|
1734
|
+
*/
|
|
1735
|
+
balance?: boolean;
|
|
1716
1736
|
};
|
|
1717
1737
|
/**
|
|
1718
1738
|
* One style as the plugin stores it: every field filled, `bold` and `italic` only when the game
|
|
1719
1739
|
* shipped those MSDF fonts, `shadow` only when the style has one, `lineHeight` only when the style
|
|
1720
|
-
* names its line (`undefined` is the font's line).
|
|
1740
|
+
* names its line (`undefined` is the font's line), and `balance` only on a style that balances.
|
|
1721
1741
|
*
|
|
1722
1742
|
* @example
|
|
1723
1743
|
* ```ts
|
|
@@ -1742,6 +1762,7 @@ type TextStyle = {
|
|
|
1742
1762
|
digits: boolean;
|
|
1743
1763
|
shadow: TextShadow | undefined;
|
|
1744
1764
|
lineHeight: number | undefined;
|
|
1765
|
+
balance?: true;
|
|
1745
1766
|
};
|
|
1746
1767
|
/**
|
|
1747
1768
|
* What `defineTextStyles` returns and a feature registers under its `textStyles` key. Structural
|
|
@@ -2170,6 +2191,24 @@ type ScrollSnap = readonly number[] & Brand<"ScrollSnap">;
|
|
|
2170
2191
|
* ```
|
|
2171
2192
|
*/
|
|
2172
2193
|
type ScrollOffset = number & Brand<"ScrollOffset">;
|
|
2194
|
+
/**
|
|
2195
|
+
* Whether a new `offset` prop of this render stands there at once instead of gliding: in the same
|
|
2196
|
+
* solve as the content's new rects, so content that moved inside the track and an offset that moves
|
|
2197
|
+
* by as much keep what the player sees in place. A running fling or glide stops and `ScrollState`
|
|
2198
|
+
* says `moving: false`. A scroll the finger holds only remembers the prop; left out or false, a new
|
|
2199
|
+
* prop glides. A `snap` release always glides.
|
|
2200
|
+
*
|
|
2201
|
+
* @example
|
|
2202
|
+
* ```tsx
|
|
2203
|
+
* // The order strip opens on 0. A first tile of 82 u comes in at the start of the track: the
|
|
2204
|
+
* // track and the offset shift 82 in one render, and the cards stay where they were drawn.
|
|
2205
|
+
* <scroll key="strip" axis="x" offset={82} jump style={{ width: 306, height: 120 }}>
|
|
2206
|
+
* <row key="track" style={{ width: 778, height: 120 }} />
|
|
2207
|
+
* </scroll>;
|
|
2208
|
+
* // the frame of that render: ScrollState { offset: 82, max: 472, moving: false }
|
|
2209
|
+
* ```
|
|
2210
|
+
*/
|
|
2211
|
+
type ScrollJump = boolean & Brand<"ScrollJump">;
|
|
2173
2212
|
/** How many rows a windowed scroll has. */
|
|
2174
2213
|
type ScrollRows = number & Brand<"ScrollRows">;
|
|
2175
2214
|
/** The height of every row, in reference units; above 0. */
|
|
@@ -2348,13 +2387,16 @@ type ScrollWindowForm = {
|
|
|
2348
2387
|
/**
|
|
2349
2388
|
* What a scroll container takes: children for a short list, or `rows`, `rowHeight` and `row` for
|
|
2350
2389
|
* a long one, whose rows exist only in the window; the `axis` it moves on, the `snap` stops a
|
|
2351
|
-
* release glides to,
|
|
2390
|
+
* release glides to, the `offset` it stands at, and whether a new `offset` stands there at once
|
|
2391
|
+
* (`jump`).
|
|
2352
2392
|
*
|
|
2353
2393
|
* @example
|
|
2354
2394
|
* ```ts
|
|
2355
2395
|
* const props: ScrollProps = { axis: "y" };
|
|
2356
2396
|
* // The order strip: sideways, three stops, opened on the orders.
|
|
2357
2397
|
* const strip: ScrollProps = { axis: "x", snap: [0, 318, 390], offset: 318 };
|
|
2398
|
+
* // A first tile of 82 u came in at the start of the track: the strip stands on 82 at once.
|
|
2399
|
+
* const shifted: ScrollProps = { axis: "x", offset: 82, jump: true };
|
|
2358
2400
|
* // 1000 orders of 120 u in a 1600 u list: rows 0 to 18 exist at offset 0.
|
|
2359
2401
|
* const orders: ScrollProps = {
|
|
2360
2402
|
* style: { height: 1600 },
|
|
@@ -2368,6 +2410,7 @@ type ScrollProps = CommonProps & {
|
|
|
2368
2410
|
axis?: ScrollAxis;
|
|
2369
2411
|
snap?: ScrollSnap;
|
|
2370
2412
|
offset?: ScrollOffset;
|
|
2413
|
+
jump?: ScrollJump;
|
|
2371
2414
|
} & (ScrollChildForm | ScrollWindowForm);
|
|
2372
2415
|
/**
|
|
2373
2416
|
* What a text field takes. `local` is required: every keystroke writes that field of the local
|
|
@@ -10323,7 +10323,7 @@ type ShotsInternal = {
|
|
|
10323
10323
|
forget(): void;
|
|
10324
10324
|
};
|
|
10325
10325
|
declare namespace types_d_exports$2 {
|
|
10326
|
-
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FilterSlotQuad, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGpuProgram, PixiGraphics, PixiMatrix, PixiMesh, PixiMeshGeometry, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderTexture, PixiShader, PixiSprite, PixiTexture, PixiTextureSource, PixiUniformGroup, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, ShotPipes, ShotsApi, ShotsConfig, ShotsInternal, ShotsModule, ShotsState, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
|
|
10326
|
+
export { AdaptiveScale, Api$1 as Api, AspectRange, BitmapFontData, CanvasRestart, CaptureOptions, Captured, Config$2 as Config, CountingClasses, CoverFrame, CreateTextureOptions$1 as CreateTextureOptions, DebugApi, DebugSwitches, DemandFrame, DemandModule, DemandReason, DemandState, Deps$2 as Deps, DisplayAdapter, DisplayEntry, DisplaysApi, DrawCounter, Events$2 as Events, FilterCache, FilterSlot, FilterSlotInputs, FilterSlotQuad, FiltersApi, FontsApi, FrameColumns, FrameReadResult, FrameReadout, FrameRecord, FrameRing, HitBox, HostApi, HostInternal, HostModule, HostState, HudPartValue, KeptInternal, KeptModule, KeptRange, KeptState, KeptStats, KernelSlice$2 as KernelSlice, LayerEntry, LeaveApi, LeaveCover, LeaveLoader, LeaveLook, LegendEntry, LongFrameEntry, Modules, MonitorApi, MonitorConfig, MonitorCounts, MonitorDeps, MonitorInternal, MonitorModule, MonitorSections, MonitorState, NineBorders$1 as NineBorders, Orientation, OverlayEventDetail, OverlayLevelValue, OverlayMode, OverlayPhase, OverlayReport, OverlayValue, OverlayWhat, PassKind, PassRecord, PerfCause, PerfChange, PerfChangeEntry, PerfCollectorLine, PerfCounts, PerfDisplay, PerfEventLine, PerfEventName, PerfGapLine, PerfHeaderLine, PerfLogLine, PerfLongFrameLine, PerfMarkLine, PerfMeasured, PerfMonitorApi, PerfSampleLine, PerfSpikeLine, PerfStartupLine, PerfTelemetryLine, PerfThermalLine, PictureRect, PixiApplication, PixiBitmapFont, PixiBounds, PixiContainer, PixiFilter, PixiFilterManager, PixiGpuProgram, PixiGraphics, PixiMatrix, PixiMesh, PixiMeshGeometry, PixiModule, PixiNineSliceSprite, PixiRectangle, PixiRenderLayer, PixiRenderTexture, PixiShader, PixiSprite, PixiTexture, PixiTextureSource, PixiUniformGroup, Point, PoolTrim, PoolTrimDetail, ProblemEventDetail, ProblemRule, Rect, RenderStats, RendererCtx, RendererKind, RetakeWhy, SafeArea, ShaderEventDetail, ShaderWhat, ShotPipes, ShotsApi, ShotsConfig, ShotsInternal, ShotsModule, ShotsState, SliceFrame, State$2 as State, SyncApi, SyncCounts, SyncInternal, SyncModule, SyncState, TeardownScope, TextureProvider, TextureUsage, TexturesApi, Under, View, ViewKind, ViewportApi, ViewportInternal, ViewportModule, ViewportSize, ViewportState, WarmDetail, WhyEntry, WhyLive };
|
|
10327
10327
|
}
|
|
10328
10328
|
/**
|
|
10329
10329
|
* The part of Pixi the engine uses: the classes `sync` builds views from (a `Rectangle` frames the
|
|
@@ -10338,7 +10338,8 @@ declare namespace types_d_exports$2 {
|
|
|
10338
10338
|
* and the batcher pipe it subclasses, and the WGSL and GLSL shader pieces of the batch's SDF shader, and the WebGPU
|
|
10339
10339
|
* render target system with its adaptor, the pipeline system and the stencil system the lazy canvas pass of `host`
|
|
10340
10340
|
* subclasses or registers again (`host/render-pass.ts`), and the mesh and its geometry the rim-only nine-slice of
|
|
10341
|
-
* `sync` is drawn with (`sync/hollow.ts`)
|
|
10341
|
+
* `sync` is drawn with (`sync/hollow.ts`), and the render layer an overlay with `hud: "under"` draws the HUD layer in,
|
|
10342
|
+
* under its dim (`sync/overlay-look.ts`). The module object
|
|
10342
10343
|
* never arrives through a static import: `config.loadPixi()` returns it, so a game without a screen carries no
|
|
10343
10344
|
* Pixi in its bundle.
|
|
10344
10345
|
*
|
|
@@ -10354,7 +10355,7 @@ declare namespace types_d_exports$2 {
|
|
|
10354
10355
|
* pixi.defaultFilterVert.startsWith("in vec2 aPosition;"); // true
|
|
10355
10356
|
* ```
|
|
10356
10357
|
*/
|
|
10357
|
-
type PixiModule = Pick<typeof import("pixi.js"), "AlphaFilter" | "Application" | "Batcher" | "BatcherPipe" | "BitmapFont" | "BitmapText" | "BitmapTextPipe" | "BlurFilter" | "Bounds" | "Buffer" | "BufferUsage" | "Cache" | "ColorMatrixFilter" | "Container" | "DefaultBatcher" | "DisplacementFilter" | "ExtensionType" | "Filter" | "FilterSystem" | "Geometry" | "GlProgram" | "GlTextureSystem" | "GpuBatchAdaptor" | "GpuEncoderSystem" | "GpuGraphicsAdaptor" | "GpuProgram" | "GpuRenderTargetAdaptor" | "GpuRenderTargetSystem" | "GpuStencilSystem" | "GpuTextureSystem" | "Graphics" | "Matrix" | "Mesh" | "MeshGeometry" | "NineSliceSprite" | "NoiseFilter" | "Particle" | "ParticleContainer" | "PipelineSystem" | "Rectangle" | "RenderGroupPipe" | "RenderTexture" | "Shader" | "Sprite" | "Texture" | "TexturePool" | "UniformGroup" | "bitmapFontTextParser" | "bitmapFontXMLStringParser" | "colorBit" | "colorBitGl" | "compileHighShaderGlProgram" | "compileHighShaderGpuProgram" | "defaultFilterVert" | "extensions" | "generateTextureBatchBit" | "generateTextureBatchBitGl" | "getBatchSamplersUniformGroup" | "mSDFBit" | "mSDFBitGl" | "roundPixelsBit" | "roundPixelsBitGl">;
|
|
10358
|
+
type PixiModule = Pick<typeof import("pixi.js"), "AlphaFilter" | "Application" | "Batcher" | "BatcherPipe" | "BitmapFont" | "BitmapText" | "BitmapTextPipe" | "BlurFilter" | "Bounds" | "Buffer" | "BufferUsage" | "Cache" | "ColorMatrixFilter" | "Container" | "DefaultBatcher" | "DisplacementFilter" | "ExtensionType" | "Filter" | "FilterSystem" | "Geometry" | "GlProgram" | "GlTextureSystem" | "GpuBatchAdaptor" | "GpuEncoderSystem" | "GpuGraphicsAdaptor" | "GpuProgram" | "GpuRenderTargetAdaptor" | "GpuRenderTargetSystem" | "GpuStencilSystem" | "GpuTextureSystem" | "Graphics" | "Matrix" | "Mesh" | "MeshGeometry" | "NineSliceSprite" | "NoiseFilter" | "Particle" | "ParticleContainer" | "PipelineSystem" | "Rectangle" | "RenderGroupPipe" | "RenderLayer" | "RenderTexture" | "Shader" | "Sprite" | "Texture" | "TexturePool" | "UniformGroup" | "bitmapFontTextParser" | "bitmapFontXMLStringParser" | "colorBit" | "colorBitGl" | "compileHighShaderGlProgram" | "compileHighShaderGpuProgram" | "defaultFilterVert" | "extensions" | "generateTextureBatchBit" | "generateTextureBatchBitGl" | "getBatchSamplersUniformGroup" | "mSDFBit" | "mSDFBitGl" | "roundPixelsBit" | "roundPixelsBitGl">;
|
|
10358
10359
|
/**
|
|
10359
10360
|
* One Pixi application: renderer, canvas and stage.
|
|
10360
10361
|
*/
|
|
@@ -10372,6 +10373,10 @@ type PixiBounds = InstanceType<PixiModule["Bounds"]>;
|
|
|
10372
10373
|
* A Pixi sprite.
|
|
10373
10374
|
*/
|
|
10374
10375
|
type PixiSprite = InstanceType<PixiModule["Sprite"]>;
|
|
10376
|
+
/**
|
|
10377
|
+
* A Pixi render layer: it draws the containers attached to it at its own place in the tree, their parents unchanged.
|
|
10378
|
+
*/
|
|
10379
|
+
type PixiRenderLayer = InstanceType<PixiModule["RenderLayer"]>;
|
|
10375
10380
|
/**
|
|
10376
10381
|
* A Pixi nine-slice sprite.
|
|
10377
10382
|
*/
|
|
@@ -11098,13 +11103,22 @@ type SpriteOptions = {
|
|
|
11098
11103
|
* const shop: OverlayValue = {
|
|
11099
11104
|
* dim: 0.56, dimColor: 0x1b1430, cover: "none", hud: ["energy", "gems"], fade: 270, hold: true
|
|
11100
11105
|
* };
|
|
11106
|
+
* // The pyramid choice: the board and the whole HUD dim to 82 % together under it.
|
|
11107
|
+
* const pyramid: OverlayValue = {
|
|
11108
|
+
* dim: 0.82, dimColor: 0x1e161a, cover: "none", hud: "under", fade: 250, hold: false
|
|
11109
|
+
* };
|
|
11101
11110
|
* ```
|
|
11102
11111
|
*/
|
|
11103
11112
|
type OverlayValue = {
|
|
11104
11113
|
/** How dark the dim is at full level, 0 to 1; 0 draws no dim. */dim: number; /** The colour of the dim, 0xRRGGBB. */
|
|
11105
11114
|
dimColor: number; /** `"opaque"`: the overlay covers the whole screen once it has landed at alpha 1, so nothing under it is drawn. */
|
|
11106
|
-
cover: "none" | "opaque";
|
|
11107
|
-
|
|
11115
|
+
cover: "none" | "opaque";
|
|
11116
|
+
/**
|
|
11117
|
+
* The HUD parts that stay shown above the dim: every part, none, or the parts with these keys. `"under"`: the whole
|
|
11118
|
+
* HUD layer is drawn under this overlay's dim, dimmed with the rest, every part kept, and it takes no tap while it is
|
|
11119
|
+
* there; with a dim of 0 it is `"all"`.
|
|
11120
|
+
*/
|
|
11121
|
+
hud: "all" | "none" | "under" | readonly string[];
|
|
11108
11122
|
/**
|
|
11109
11123
|
* Milliseconds the dim and the HUD parts take to come and go when the root plays no enter or exit motion; a root
|
|
11110
11124
|
* with a motion is followed for its own length. 0 follows at once.
|
|
@@ -11180,8 +11194,9 @@ declare const Shape: ComponentType<ShapeValue>;
|
|
|
11180
11194
|
* Marks the view an overlay is drawn from. Everything drawn before the root of that view is kept as one picture while
|
|
11181
11195
|
* the overlay is there, and drawn again in the same frame anything in it changes; `cover: "opaque"` draws nothing
|
|
11182
11196
|
* under it while it is fully shown. The engine draws its dim and fades the HUD parts it does not keep, with the root's
|
|
11183
|
-
* own enter and exit motion (`fade` when it has none)
|
|
11184
|
-
* while it stands, so a dimmed sheet over a sharp scene
|
|
11197
|
+
* own enter and exit motion (`fade` when it has none); `hud: "under"` draws the whole HUD under the dim instead.
|
|
11198
|
+
* `hold: true` holds the endless loops of what lies under it while it stands, so a dimmed sheet over a sharp scene
|
|
11199
|
+
* draws no frame at rest.
|
|
11185
11200
|
*
|
|
11186
11201
|
* @example
|
|
11187
11202
|
* ```tsx
|
|
@@ -11189,6 +11204,8 @@ declare const Shape: ComponentType<ShapeValue>;
|
|
|
11189
11204
|
* <panel key="caseSheet" motion={sheetFade} components={[Overlay({ cover: "opaque" })]} />
|
|
11190
11205
|
* // The shop: the ward dims to 56 % and its glints rest while the shop stands; the energy and the gems stay shown.
|
|
11191
11206
|
* <stack key="shopDimLayer" components={[Overlay({ dim: 0.56, hold: true, hud: ["energy", "gems"] })]} />
|
|
11207
|
+
* // The pyramid choice: the ward and the whole HUD dim to 82 % under it, and the HUD takes no tap until it leaves.
|
|
11208
|
+
* <stack key="pyramidChoice" components={[Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })]} />
|
|
11192
11209
|
* ```
|
|
11193
11210
|
*/
|
|
11194
11211
|
declare const Overlay: ComponentType<OverlayValue>;
|
|
@@ -12751,7 +12768,12 @@ type OverlayRecord = {
|
|
|
12751
12768
|
phase: OverlayPhase; /** The phase it turned to this frame: `"shown"` at landing, `"exiting"` at the first exit frame. */
|
|
12752
12769
|
turned: OverlayPhase | undefined;
|
|
12753
12770
|
mode: OverlayMode; /** The engine's dim, made when `dim` is above 0. */
|
|
12754
|
-
dim: PixiSprite | undefined;
|
|
12771
|
+
dim: PixiSprite | undefined;
|
|
12772
|
+
/**
|
|
12773
|
+
* The render layer right under the dim that draws the HUD layer there while this overlay holds it: made once, with
|
|
12774
|
+
* the dim, for `hud: "under"`, and destroyed with the record, a restore or new layers.
|
|
12775
|
+
*/
|
|
12776
|
+
under: PixiRenderLayer | undefined; /** The dim was sized for the canvas at least once. */
|
|
12755
12777
|
sized: boolean; /** Seen by the step this frame; a record not seen is dropped. */
|
|
12756
12778
|
seen: boolean; /** The event to log once the step has decided the modes: `"open"`, `"landed"` or `"leave"`. */
|
|
12757
12779
|
news: OverlayEventDetail["what"] | undefined;
|
|
@@ -12766,7 +12788,7 @@ type ActiveRange = {
|
|
|
12766
12788
|
reason: HiddenReason | undefined; /** Bottom first: lower layer containers, then roots and engine objects of the owner's layer. */
|
|
12767
12789
|
readonly entries: PixiContainer[]; /** What the range picture hides for its render: layers above, the owner and above. */
|
|
12768
12790
|
readonly others: PixiContainer[]; /** The entries, for the membership walk. */
|
|
12769
|
-
set: Set<PixiContainer>; /** The node the picture stands before: the owner's dim, or its root. */
|
|
12791
|
+
set: Set<PixiContainer>; /** The node the picture stands before: the owner's HUD render layer, its dim, or its root. */
|
|
12770
12792
|
before: PixiContainer | undefined; /** A picture holds the range (freeze only). */
|
|
12771
12793
|
kept: boolean; /** The last take was refused; tried again when the owner or the entries change. */
|
|
12772
12794
|
refused: boolean;
|
|
@@ -12782,6 +12804,16 @@ type ActiveRange = {
|
|
|
12782
12804
|
calm: number; /** Drawn live because it changed in every frame. */
|
|
12783
12805
|
fallback: boolean;
|
|
12784
12806
|
};
|
|
12807
|
+
/**
|
|
12808
|
+
* What changed for the range since the last frame, written in place by the overlay step for the freeze rules: one
|
|
12809
|
+
* object for the life of the state, so a frame makes none. Private to the renderer.
|
|
12810
|
+
*/
|
|
12811
|
+
type RangeStep = {
|
|
12812
|
+
/** The owner is new, or changed between cover and freeze. */fresh: boolean; /** The entries differ from the last frame. */
|
|
12813
|
+
entriesChanged: boolean; /** The others differ from the last frame. */
|
|
12814
|
+
othersChanged: boolean; /** The whole-frame reasons of this decision. */
|
|
12815
|
+
wholes: ReadonlySet<DemandReason>;
|
|
12816
|
+
};
|
|
12785
12817
|
/**
|
|
12786
12818
|
* The overlay step's state, `ctx.state.sync.overlay`. Collections and arrays are reused: a frame allocates nothing.
|
|
12787
12819
|
* Private to the renderer.
|
|
@@ -12792,15 +12824,19 @@ type OverlayState = {
|
|
|
12792
12824
|
records: Map<Entity, OverlayRecord>; /** The records bottom first, reused. */
|
|
12793
12825
|
order: OverlayRecord[]; /** The range of the owner, or `undefined` with none. */
|
|
12794
12826
|
active: ActiveRange | undefined; /** The range object, made once and reused. */
|
|
12795
|
-
range: ActiveRange | undefined; /** Top objects of the HUD parts that take no tap
|
|
12796
|
-
offTops: Set<PixiContainer>; /** `
|
|
12827
|
+
range: ActiveRange | undefined; /** Top objects of the HUD parts that take no tap; a HUD layer held under a veil is skipped by the hit test through `held`. */
|
|
12828
|
+
offTops: Set<PixiContainer>; /** The HUD layer container attached to `heldBy`; `undefined` while it draws in its own place, above the overlays. */
|
|
12829
|
+
held: PixiContainer | undefined; /** The render layer of the overlay that holds the HUD under its dim (`hud: "under"`), or none. */
|
|
12830
|
+
heldBy: PixiRenderLayer | undefined; /** `"<code>:<entity>"` of the warnings logged once. */
|
|
12797
12831
|
warned: Set<string>; /** The `overlay` event lines of an agent build, until the frame hands them to the monitor. */
|
|
12798
12832
|
events: OverlayEventDetail[]; /** Scratch: the entries and others wanted this frame, and the set of the entries. */
|
|
12799
12833
|
wantEntries: PixiContainer[];
|
|
12800
12834
|
wantOthers: PixiContainer[];
|
|
12801
12835
|
wantSet: Set<PixiContainer>; /** Entities whose reason the step itself flipped this frame: their marks are no change of the range's pixels. */
|
|
12802
12836
|
flipped: Set<Entity>; /** Scratch of the tap set. */
|
|
12803
|
-
nextOff: Set<PixiContainer>; /**
|
|
12837
|
+
nextOff: Set<PixiContainer>; /** Scratch: the tops of the parts faded this frame, written in place; the tap set is built from it on a change. */
|
|
12838
|
+
offList: PixiContainer[]; /** Scratch of the freeze rules: what changed for the range this frame. */
|
|
12839
|
+
step: RangeStep; /** A view left its place in the held range since the last step (it moved, or its view went). */
|
|
12804
12840
|
left: boolean; /** Scratch of the cover test of `blurred`: made on first use from the Pixi module the renderer loaded. */
|
|
12805
12841
|
bounds: PixiBounds | undefined;
|
|
12806
12842
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { L 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 { Nr as Api$4, Or as Api$1, Z as Api, ni as Api$3, zr as Api$2 } from "./types-qCcSw8YI.mjs";
|
|
2
|
+
import { L as AnimApi, r as UiApi } from "./types-DeybZgVT.mjs";
|
|
3
|
+
import { L as InputApi } from "./types-L3E-YS4N.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-Co3SEFi5.mjs";
|
|
5
|
+
import { i as ControlApp, o as InputOf } from "./types-BE6tcAFX.mjs";
|
|
6
|
+
import { t as commands } from "./commands-CnGF1AfS.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. */
|
|
@@ -296,8 +296,9 @@ const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
|
|
|
296
296
|
* Marks the view an overlay is drawn from. Everything drawn before the root of that view is kept as one picture while
|
|
297
297
|
* the overlay is there, and drawn again in the same frame anything in it changes; `cover: "opaque"` draws nothing
|
|
298
298
|
* under it while it is fully shown. The engine draws its dim and fades the HUD parts it does not keep, with the root's
|
|
299
|
-
* own enter and exit motion (`fade` when it has none)
|
|
300
|
-
* while it stands, so a dimmed sheet over a sharp scene
|
|
299
|
+
* own enter and exit motion (`fade` when it has none); `hud: "under"` draws the whole HUD under the dim instead.
|
|
300
|
+
* `hold: true` holds the endless loops of what lies under it while it stands, so a dimmed sheet over a sharp scene
|
|
301
|
+
* draws no frame at rest.
|
|
301
302
|
*
|
|
302
303
|
* @example
|
|
303
304
|
* ```tsx
|
|
@@ -305,6 +306,8 @@ const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
|
|
|
305
306
|
* <panel key="caseSheet" motion={sheetFade} components={[Overlay({ cover: "opaque" })]} />
|
|
306
307
|
* // The shop: the ward dims to 56 % and its glints rest while the shop stands; the energy and the gems stay shown.
|
|
307
308
|
* <stack key="shopDimLayer" components={[Overlay({ dim: 0.56, hold: true, hud: ["energy", "gems"] })]} />
|
|
309
|
+
* // The pyramid choice: the ward and the whole HUD dim to 82 % under it, and the HUD takes no tap until it leaves.
|
|
310
|
+
* <stack key="pyramidChoice" components={[Overlay({ dim: 0.82, dimColor: 0x1e161a, hud: "under" })]} />
|
|
308
311
|
* ```
|
|
309
312
|
*/
|
|
310
313
|
const Overlay = /*#__PURE__*/ component("Overlay", overlayDefaults);
|
|
@@ -760,19 +763,22 @@ function isLineHeight(lineHeight) {
|
|
|
760
763
|
}
|
|
761
764
|
/**
|
|
762
765
|
* Fills the defaults of one style and refuses a wrap that is not a width, `"box"` or `"none"`,
|
|
763
|
-
*
|
|
766
|
+
* a line height that is not a number above zero, and a balance that is not true or false. The
|
|
767
|
+
* stored style carries `balance` only when it balances.
|
|
764
768
|
*
|
|
765
769
|
* @param name - The style name, for the error.
|
|
766
770
|
* @param input - What the game wrote.
|
|
767
771
|
* @returns The style with every field filled.
|
|
768
772
|
* @throws {Error} When `wrap` is a number that is not greater than zero, or another word.
|
|
769
773
|
* @throws {Error} When `lineHeight` is not a finite number greater than zero.
|
|
774
|
+
* @throws {Error} When `balance` is neither left out nor a boolean.
|
|
770
775
|
*/
|
|
771
776
|
function normalizeStyle(name, input) {
|
|
772
777
|
const wrap = input.wrap ?? "none";
|
|
773
778
|
if (!isWrap(wrap)) throw new Error(`[game] Text style "${name}" has wrap ${wrap}.\n Use a width in reference px, "box" or "none".`);
|
|
774
779
|
if (!isLineHeight(input.lineHeight)) throw new Error(`[game] Text style "${name}" has lineHeight ${input.lineHeight}.\n Use a multiple of size above 0, such as 1.2.`);
|
|
775
|
-
|
|
780
|
+
if (input.balance !== void 0 && typeof input.balance !== "boolean") throw new Error(`[game] Text style "${name}" has balance ${String(input.balance)}.\n Use true or false.`);
|
|
781
|
+
const style = {
|
|
776
782
|
font: input.font,
|
|
777
783
|
bold: input.bold,
|
|
778
784
|
italic: input.italic,
|
|
@@ -787,6 +793,8 @@ function normalizeStyle(name, input) {
|
|
|
787
793
|
shadow: shadowOf(input.shadow),
|
|
788
794
|
lineHeight: input.lineHeight
|
|
789
795
|
};
|
|
796
|
+
if (input.balance === true) style.balance = true;
|
|
797
|
+
return style;
|
|
790
798
|
}
|
|
791
799
|
/**
|
|
792
800
|
* Declares the text styles of a feature. The result goes under the `textStyles` key of the
|
|
@@ -796,6 +804,7 @@ function normalizeStyle(name, input) {
|
|
|
796
804
|
* @returns The registration a feature carries.
|
|
797
805
|
* @throws {Error} When a style names a wrap that is not a width, `"box"` or `"none"`.
|
|
798
806
|
* @throws {Error} When a style names a lineHeight that is not a number above 0.
|
|
807
|
+
* @throws {Error} When a style names a balance that is not true or false.
|
|
799
808
|
* @example
|
|
800
809
|
* ```ts
|
|
801
810
|
* defineTextStyles({ "hud.digits": { font: "ui.font-digits", size: 40, fill: 0xffe082 } });
|
|
@@ -880,7 +889,8 @@ function readStyle(name, value) {
|
|
|
880
889
|
wrap: value.wrap,
|
|
881
890
|
digits: value.digits,
|
|
882
891
|
shadow: readShadow(value.shadow),
|
|
883
|
-
lineHeight: value.lineHeight
|
|
892
|
+
lineHeight: value.lineHeight,
|
|
893
|
+
balance: value.balance
|
|
884
894
|
};
|
|
885
895
|
return normalizeStyle(name, {
|
|
886
896
|
...input,
|
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-BziiITWm.mjs";
|
|
2
2
|
export { type CheckpointResult, type VisualApp, type VisualOptions, type VisualPage, type VisualRenderer, type VisualReport, type VisualSetup, type VisualStart, type VisualStep, type VisualTest, type VisualTestResult, type VisualTolerance, defineVisualTest, parseVisualArgv, runVisualTests };
|
package/dist/visual.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as VISUAL_CLOCK } from "./fake-hnJcJeYf.mjs";
|
|
2
|
-
import { n as read, t as sources } from "./sources-
|
|
2
|
+
import { n as read, t as sources } from "./sources-Cqqz-0-b.mjs";
|
|
3
3
|
import { n as commands, t as run } from "./run-B5if0jxE.mjs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createBrandConsole } from "@moku-labs/common/cli";
|