@moku-labs/game 0.15.8 → 0.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/page.d.mts +1 -1
- package/dist/app/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-DWyII1jn.d.mts → commands-5woFUxUr.d.mts} +5 -5
- package/dist/control.d.mts +4 -4
- package/dist/{define-Bebctfvs.d.mts → define-B8A5IoeS.d.mts} +2 -2
- package/dist/{headless-DobgwTKK.d.mts → headless-CrxofjLt.d.mts} +1 -1
- package/dist/{index-B3dfnsUZ.d.mts → index-DT9aYVGd.d.mts} +3 -3
- package/dist/index.d.mts +4 -4
- 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-gnMApclv.d.mts → runtime-BZQQPq56.d.mts} +1 -1
- package/dist/{sources-OvHvyeJS.mjs → sources-QCowxSpC.mjs} +1 -1
- package/dist/{src-DNVAJHwd.mjs → src-Cs1bP3v7.mjs} +139 -11
- package/dist/testing.d.mts +4 -4
- package/dist/testing.mjs +1 -1
- package/dist/{types-CYoGvBkh.d.mts → types-D8roM1u3.d.mts} +14 -4
- package/dist/{types-CPxx3NSG.d.mts → types-DDmfkONF.d.mts} +2 -2
- package/dist/{types-BcEtn9XV.d.mts → types-DK-IYk-s.d.mts} +4 -4
- package/dist/{types-Mj75CDO6.d.mts → types-YXykgTOp.d.mts} +2 -2
- package/dist/{types-C4D9UVgb.d.mts → types-i77Nrrv-.d.mts} +29 -16
- package/dist/{visual-CxQ4Iqd3.d.mts → visual-1doiBOD3.d.mts} +6 -6
- package/dist/{visual-2m4wJL_z.mjs → visual-CIUx49C0.mjs} +26 -6
- package/dist/visual.d.mts +1 -1
- package/dist/visual.mjs +1 -1
- package/llms.txt +4 -3
- package/package.json +1 -1
package/dist/app/page.d.mts
CHANGED
package/dist/app/page.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as systemSource, t as memory } from "../memory-CWlqhS7l.mjs";
|
|
2
2
|
import { t as applyTo } from "../drafts-BawpSaVp.mjs";
|
|
3
3
|
import { i as isControl } from "../dev-BNndV-hU.mjs";
|
|
4
|
-
import { n as read, r as watch, t as sources } from "../sources-
|
|
4
|
+
import { n as read, r as watch, t as sources } from "../sources-QCowxSpC.mjs";
|
|
5
5
|
import { t as resolveConfig } from "../config-B87aFTW-.mjs";
|
|
6
6
|
//#region src/app/save.ts
|
|
7
7
|
/**
|
package/dist/app/system.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Or as PlayerStateProvider } from "../types-
|
|
2
|
-
import { mt as PlatformProvider } from "../index-
|
|
3
|
-
import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-
|
|
1
|
+
import { Or as PlayerStateProvider } from "../types-i77Nrrv-.mjs";
|
|
2
|
+
import { mt as PlatformProvider } from "../index-DT9aYVGd.mjs";
|
|
3
|
+
import { _ as SystemShellFactory, g as SystemName, h as SystemModules } from "../types-DK-IYk-s.mjs";
|
|
4
4
|
import { Back, Haptics, KeepAwake, Lifecycle, Store } from "@moku-labs/system";
|
|
5
5
|
|
|
6
6
|
//#region src/app/system.d.ts
|
package/dist/app.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Cr as Json } from "./types-
|
|
2
|
-
import { H as StringTable } from "./types-
|
|
3
|
-
import { a as GameHandle, c as MemoryProvider, d as SaveKind, f as Scenario, g as SystemName, i as GameDefinition, l as PageAgent, n as GameApp, o as GamePluginConfigs, p as ScreenSeams, r as GameConfig, s as HeadlessSeams, v as WithGameState } from "./types-
|
|
1
|
+
import { Cr as Json } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { H as StringTable } from "./types-D8roM1u3.mjs";
|
|
3
|
+
import { a as GameHandle, c as MemoryProvider, d as SaveKind, f as Scenario, g as SystemName, i as GameDefinition, l as PageAgent, n as GameApp, o as GamePluginConfigs, p as ScreenSeams, r as GameConfig, s as HeadlessSeams, v as WithGameState } from "./types-DK-IYk-s.mjs";
|
|
4
4
|
import { AnyPluginInstance } from "@moku-labs/core";
|
|
5
5
|
|
|
6
6
|
//#region src/app/define.d.ts
|
package/dist/app.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bt as audioPlugin, J as platformPlugin, i as screen, kt as effectsPlugin, m as flattenFeatures, t as createApp } from "./src-
|
|
1
|
+
import { Bt as audioPlugin, J as platformPlugin, i as screen, kt as effectsPlugin, m as flattenFeatures, t as createApp } from "./src-Cs1bP3v7.mjs";
|
|
2
2
|
import { t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { n as isFakeClock, t as fakeClock } from "./fake-6mazmHK3.mjs";
|
|
4
4
|
//#region src/app/define.ts
|
package/dist/assets.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { E as Api$1, Gr as FrameRate, L as Captured, Lr as Api, Mr as Snapshot, Ot as DebugSwitches, Pr as StoreApi, Qn as Bookmark, Qt as Api$2, S as ScenesApi, Yr as Time, tr as FlowState } from "./types-
|
|
2
|
-
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-
|
|
3
|
-
import { M as InputApi } from "./types-
|
|
4
|
-
import { t as HeadlessApp } from "./headless-
|
|
5
|
-
import { n as Command, r as ControlApp } from "./types-
|
|
1
|
+
import { E as Api$1, Gr as FrameRate, L as Captured, Lr as Api, Mr as Snapshot, Ot as DebugSwitches, Pr as StoreApi, Qn as Bookmark, Qt as Api$2, S as ScenesApi, Yr as Time, tr as FlowState } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { P as AnimApi, a as AudioApi, h as EffectsApi, r as UiApi } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { M as InputApi } from "./types-D8roM1u3.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
|
|
5
|
+
import { n as Command, r as ControlApp } from "./types-YXykgTOp.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/flow/doors/commands.d.ts
|
|
8
8
|
/**
|
package/dist/control.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-
|
|
3
|
-
import { t as commands } from "./commands-
|
|
4
|
-
import { t as defineCommand } from "./define-
|
|
1
|
+
import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
|
|
2
|
+
import { i as InputArguments, n as Command, o as InputSchema, s as Ran } from "./types-YXykgTOp.mjs";
|
|
3
|
+
import { t as commands } from "./commands-5woFUxUr.mjs";
|
|
4
|
+
import { t as defineCommand } from "./define-B8A5IoeS.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/flow/doors/dev.d.ts
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as HeadlessApp } from "./headless-
|
|
2
|
-
import { c as Source, n as Command, o as InputSchema } from "./types-
|
|
1
|
+
import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
|
|
2
|
+
import { c as Source, n as Command, o as InputSchema } from "./types-YXykgTOp.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugins/flow/doors/define.d.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cr as Json, Ir as RngState, Nn as Api$1, Ur as Api, ir as RouteStep, nr as JournalEntry, pr as Answer, tr as FlowState } from "./types-
|
|
1
|
+
import { Cr as Json, Ir as RngState, Nn as Api$1, Ur as Api, ir as RouteStep, nr as JournalEntry, pr as Answer, tr as FlowState } from "./types-i77Nrrv-.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/flow/headless.d.ts
|
|
4
4
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $n as DefineNode, $r as Require, $t as Config$8, Bn as State$3, Br as PauseReason, C as State$7, Cr as Json, D as Config$6, Dn as ProjectionMotion, Dr as Patch, E as Api$4, En as NumericFields, Fn as Config$3, Fr as RngApi, In as EmitterIdOf, Jn as FeatureDescription, Jr as ThermalReading, Kr as RateChange, Kt as SpriteOptions, Ln as GameTypes, Lr as Api$3, Lt as HudPartValue, Nn as Api$2, Nt as ViewportSize, On as ProjectionSpec, P as State$6, Pn as BundlesOf, Pr as StoreApi, Qr as Events$1, Qt as Api$6, Rn as HudKeysOf, Rr as Config$4, S as ScenesApi, Sn as Ease, Tr as State$5, U as FrameRecord, Un as defineFlow, Ur as Api$5, Vn as TextStylesOf, Vr as State$4, Vt as OverlayValue, W as FrameRing, Wr as Config$7, Wt as ShapeValue, Xn as FeatureTree, Xt as sprite, Yn as FeaturePlugin, Yt as TransformValue, Zr as Config$9, _ as DefineScene, _n as SystemDefinition, a as Config$1, ar as SceneIdOf, b as SceneDefinition, c as LoadBundles, cn as ComponentType, cr as Effect, dr as Hint, et as PassKind, f as State$1, g as AnySceneProjection, gn as ResourceType, gr as Config$2, hn as QueryTerm, i as BundleSpec, kn as ReducedMotion, l as LoadReason, ln as ComponentValue, lr as EffectOptions, mn as Narrowed, mr as Api$1, o as DefineBundles, on as ComponentHandle, p as Tier, pn as Mut, pr as Answer, qr as State$8, qt as SpriteValue, r as BundleMap, sr as Descriptor, t as Api, tn as State$9, u as LoadResult, ur as GuideOptions, vn as SystemFor, vr as State$2, wr as Root, x as SceneSpec, xn as DescriptionNode, xr as Config$5, y as LayerMap, yn as TagType, zr as Events, zt as NineSliceValue } from "./types-
|
|
2
|
-
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$10, 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, ct as OverlayApi, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, m as Config$12, n as State$13, r as UiApi, s as Config$11, t as Config$13, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-
|
|
3
|
-
import { A as defineComponent, B as Part, C as TextApi, D as TextStyles, E as TextStyleInput, F as Argument, I as Config$14, J as Style, K as IsFlags, L as I18nApi, M as InputApi, N as State$15, O as TextValue, R as IntlKit, S as State$16, U as TextKey, V as State$14, W as TypedTr, X as WhenFlags, _ as BindField, b as CountdownValue, h as IntrinsicElementsFor, j as Config$15, m as defineTokens, q as ResolvedStyle, s as PopupComponent, v as BindOptions, w as TextBind, x as Point, y as Config$16, z as Message } from "./types-
|
|
1
|
+
import { $n as DefineNode, $r as Require, $t as Config$8, Bn as State$3, Br as PauseReason, C as State$7, Cr as Json, D as Config$6, Dn as ProjectionMotion, Dr as Patch, E as Api$4, En as NumericFields, Fn as Config$3, Fr as RngApi, In as EmitterIdOf, Jn as FeatureDescription, Jr as ThermalReading, Kr as RateChange, Kt as SpriteOptions, Ln as GameTypes, Lr as Api$3, Lt as HudPartValue, Nn as Api$2, Nt as ViewportSize, On as ProjectionSpec, P as State$6, Pn as BundlesOf, Pr as StoreApi, Qr as Events$1, Qt as Api$6, Rn as HudKeysOf, Rr as Config$4, S as ScenesApi, Sn as Ease, Tr as State$5, U as FrameRecord, Un as defineFlow, Ur as Api$5, Vn as TextStylesOf, Vr as State$4, Vt as OverlayValue, W as FrameRing, Wr as Config$7, Wt as ShapeValue, Xn as FeatureTree, Xt as sprite, Yn as FeaturePlugin, Yt as TransformValue, Zr as Config$9, _ as DefineScene, _n as SystemDefinition, a as Config$1, ar as SceneIdOf, b as SceneDefinition, c as LoadBundles, cn as ComponentType, cr as Effect, dr as Hint, et as PassKind, f as State$1, g as AnySceneProjection, gn as ResourceType, gr as Config$2, hn as QueryTerm, i as BundleSpec, kn as ReducedMotion, l as LoadReason, ln as ComponentValue, lr as EffectOptions, mn as Narrowed, mr as Api$1, o as DefineBundles, on as ComponentHandle, p as Tier, pn as Mut, pr as Answer, qr as State$8, qt as SpriteValue, r as BundleMap, sr as Descriptor, t as Api, tn as State$9, u as LoadResult, ur as GuideOptions, vn as SystemFor, vr as State$2, wr as Root, x as SceneSpec, xn as DescriptionNode, xr as Config$5, y as LayerMap, yn as TagType, zr as Events, zt as NineSliceValue } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { A as GlowValue, B as Target, C as BlurValue, D as FilterComponent, F as AnimPlayerValue, H as HapticKind, I as Config$10, 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, ct as OverlayApi, d as State$11, f as VolumesFor, h as EffectsApi, j as NoiseValue, k as FilterValueOf, l as MusicOptions, m as Config$12, n as State$13, r as UiApi, s as Config$11, t as Config$13, w as ColorMatrixValue, x as EmitterValue, y as EmitterConfig, z as State$10 } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { A as defineComponent, B as Part, C as TextApi, D as TextStyles, E as TextStyleInput, F as Argument, I as Config$14, J as Style, K as IsFlags, L as I18nApi, M as InputApi, N as State$15, O as TextValue, R as IntlKit, S as State$16, U as TextKey, V as State$14, W as TypedTr, X as WhenFlags, _ as BindField, b as CountdownValue, h as IntrinsicElementsFor, j as Config$15, m as defineTokens, q as ResolvedStyle, s as PopupComponent, v as BindOptions, w as TextBind, x as Point, y as Config$16, z as Message } from "./types-D8roM1u3.mjs";
|
|
4
4
|
import { Log } from "@moku-labs/common/browser";
|
|
5
5
|
import { PluginCtx } from "@moku-labs/core";
|
|
6
6
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as PROBLEM_RULES, B as FrameColumns, Bt as Overlay, Ct as ProblemRule, Dt as WarmDetail, Er as types_d_exports$10, Et as ShaderWhat, Ft as Display, G as LongFrameEntry, Gn as slot, Gt as Sprite, H as FrameReadout, Hn as types_d_exports$6, Hr as types_d_exports$9, Ht as Parent, I as types_d_exports$12, It as HudPart, J as OverlayEventDetail, Jt as Transform, K as MONITOR_SECTIONS, Kn as to, Lt as HudPartValue, N as PoolTrim, O as MonitorConfig, Q as PERF_LOG_VERSION, R as MonitorCounts, Rt as NineSlice, St as ProblemEventDetail, T as AdaptiveScale, Tt as ShaderEventDetail, U as FrameRecord, Ut as Shape, V as FrameReadResult, Vt as OverlayValue, W as FrameRing, Wn as exit, X as PERF_CAUSES, Xr as types_d_exports$15, Xt as sprite, Y as OverlayWhat, Z as PERF_GAP_BUCKETS, Zt as DEMAND_REASONS, _t as PerfSpikeLine, at as PerfCollectorLine, bt as PerfThermalLine, ct as PerfEventLine, dt as PerfHeaderLine, et as PassKind, ft as PerfLogLine, gt as PerfSampleLine, h as types_d_exports$1, ht as PerfMeasured, it as PerfChangeEntry, jr as SaveUnreadableError, lt as PerfEventName, mt as PerfMarkLine, nn as types_d_exports$17, nt as PerfCause, ot as PerfCounts, pt as PerfLongFrameLine, q as MonitorSections, qn as type, rt as PerfChange, st as PerfDisplay, tt as PassRecord, ut as PerfGapLine, vt as PerfStartupLine, w as types_d_exports$13, wt as SHADER_WHATS, xn as DescriptionNode, xt as PoolTrimDetail, yr as types_d_exports$3, yt as PerfTelemetryLine } from "./types-
|
|
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 tween, et as set, i as types_d_exports$16, it as stagger, lt as types_d_exports$4, nt as spawn, ot as use, p as types_d_exports$2, q as external, rt as spawned, st as wait, tt as sfx, v as types_d_exports$5 } from "./types-
|
|
3
|
-
import { A as defineComponent, G as types_d_exports$7, P as types_d_exports$8, T as TextFormat, b as CountdownValue, d as LocalWrite, f as ScrollState, k as types_d_exports$14, l as Box, m as defineTokens, p as popup, u as DebugTrigger, v as BindOptions } from "./types-
|
|
4
|
-
import { $ as tag, A as DropTarget, At as bind, B as Traceable, C as AnimPlayer, Ct as clockPlugin, D as defineBundles, Dt as projection, E as defineScene, Et as animPlugin, F as Pressable, G as Layer, H as PASS_KINDS, I as Pressed, J as Tree, K as Now, L as Swipeable, M as Hovered, Mt as label, N as Pointer, O as load, Ot as Countdown, P as PointerOver, Q as system, R as Tappable, S as defineMotion, St as debugPlugin, T as Frames, Tt as assetsPlugin, U as frameAt, V as Traced, W as Exiting, X as mut, Y as component, Z as resource, _ as defineStyle, _t as lifecyclePlugin, a as defineEmitter, at as flattenFeatures, b as messageDuration, bt as flowPlugin, c as Alpha, ct as timePlugin, d as Displacement, dt as rendererPlugin, et as defineEffect, f as Glow, ft as platformPlugin, g as resolve, gt as modelPlugin, h as music, ht as types_d_exports$11, i as screen, it as defineFeature, j as Held, jt as defineTextStyles, k as Draggable, kt as Text, l as Blur, lt as textPlugin, m as Outline, mt as PlatformProvider, n as createPlugin, nt as hint, o as Emitter, ot as worldPlugin, p as Noise, pt as BackResult, q as Order, r as defineGame, rt as schedule, s as defineFilter, st as uiPlugin, t as createApp, tt as guide, u as ColorMatrix, ut as scenesPlugin, v as tr, vt as inputPlugin, w as Animation, wt as audioPlugin, x as cubicBezier, xt as effectsPlugin, y as messageArgument, yt as i18nPlugin, z as Touchable } from "./index-
|
|
1
|
+
import { $ as PROBLEM_RULES, B as FrameColumns, Bt as Overlay, Ct as ProblemRule, Dt as WarmDetail, Er as types_d_exports$10, Et as ShaderWhat, Ft as Display, G as LongFrameEntry, Gn as slot, Gt as Sprite, H as FrameReadout, Hn as types_d_exports$6, Hr as types_d_exports$9, Ht as Parent, I as types_d_exports$12, It as HudPart, J as OverlayEventDetail, Jt as Transform, K as MONITOR_SECTIONS, Kn as to, Lt as HudPartValue, N as PoolTrim, O as MonitorConfig, Q as PERF_LOG_VERSION, R as MonitorCounts, Rt as NineSlice, St as ProblemEventDetail, T as AdaptiveScale, Tt as ShaderEventDetail, U as FrameRecord, Ut as Shape, V as FrameReadResult, Vt as OverlayValue, W as FrameRing, Wn as exit, X as PERF_CAUSES, Xr as types_d_exports$15, Xt as sprite, Y as OverlayWhat, Z as PERF_GAP_BUCKETS, Zt as DEMAND_REASONS, _t as PerfSpikeLine, at as PerfCollectorLine, bt as PerfThermalLine, ct as PerfEventLine, dt as PerfHeaderLine, et as PassKind, ft as PerfLogLine, gt as PerfSampleLine, h as types_d_exports$1, ht as PerfMeasured, it as PerfChangeEntry, jr as SaveUnreadableError, lt as PerfEventName, mt as PerfMarkLine, nn as types_d_exports$17, nt as PerfCause, ot as PerfCounts, pt as PerfLongFrameLine, q as MonitorSections, qn as type, rt as PerfChange, st as PerfDisplay, tt as PassRecord, ut as PerfGapLine, vt as PerfStartupLine, w as types_d_exports$13, wt as SHADER_WHATS, xn as DescriptionNode, xt as PoolTrimDetail, yr as types_d_exports$3, yt as PerfTelemetryLine } from "./types-i77Nrrv-.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 tween, et as set, i as types_d_exports$16, it as stagger, lt as types_d_exports$4, nt as spawn, ot as use, p as types_d_exports$2, q as external, rt as spawned, st as wait, tt as sfx, v as types_d_exports$5 } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { A as defineComponent, G as types_d_exports$7, P as types_d_exports$8, T as TextFormat, b as CountdownValue, d as LocalWrite, f as ScrollState, k as types_d_exports$14, l as Box, m as defineTokens, p as popup, u as DebugTrigger, v as BindOptions } from "./types-D8roM1u3.mjs";
|
|
4
|
+
import { $ as tag, A as DropTarget, At as bind, B as Traceable, C as AnimPlayer, Ct as clockPlugin, D as defineBundles, Dt as projection, E as defineScene, Et as animPlugin, F as Pressable, G as Layer, H as PASS_KINDS, I as Pressed, J as Tree, K as Now, L as Swipeable, M as Hovered, Mt as label, N as Pointer, O as load, Ot as Countdown, P as PointerOver, Q as system, R as Tappable, S as defineMotion, St as debugPlugin, T as Frames, Tt as assetsPlugin, U as frameAt, V as Traced, W as Exiting, X as mut, Y as component, Z as resource, _ as defineStyle, _t as lifecyclePlugin, a as defineEmitter, at as flattenFeatures, b as messageDuration, bt as flowPlugin, c as Alpha, ct as timePlugin, d as Displacement, dt as rendererPlugin, et as defineEffect, f as Glow, ft as platformPlugin, g as resolve, gt as modelPlugin, h as music, ht as types_d_exports$11, i as screen, it as defineFeature, j as Held, jt as defineTextStyles, k as Draggable, kt as Text, l as Blur, lt as textPlugin, m as Outline, mt as PlatformProvider, n as createPlugin, nt as hint, o as Emitter, ot as worldPlugin, p as Noise, pt as BackResult, q as Order, r as defineGame, rt as schedule, s as defineFilter, st as uiPlugin, t as createApp, tt as guide, u as ColorMatrix, ut as scenesPlugin, v as tr, vt as inputPlugin, w as Animation, wt as audioPlugin, x as cubicBezier, xt as effectsPlugin, y as messageArgument, yt as i18nPlugin, z as Touchable } from "./index-DT9aYVGd.mjs";
|
|
5
5
|
export { type AdaptiveScale, Alpha, 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, 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, SHADER_WHATS, SaveUnreadableError, types_d_exports$13 as Scenes, ScrollState, type ShaderEventDetail, type ShaderWhat, Shape, Sprite, 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, types_d_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, 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, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as haptic, $t as PERF_LOG_VERSION, A as types_exports$6, At as Emitter, B as Box, Bt as audioPlugin, C as types_exports$13, Ct as Touchable, D as types_exports$9, Dt as messageArgument, E as types_exports$10, Et as i18nPlugin, F as types_exports$1, Ft as Glow, G as defineTokens, Gt as Animation, H as LocalWrite, Ht as assetsPlugin, I as types_exports, It as Noise, J as platformPlugin, Jt as PASS_KINDS, K as defineStyle, Kt as Frames, L as uiPlugin, Lt as Outline, M as types_exports$4, Mt as Blur, N as types_exports$3, Nt as ColorMatrix, O as types_exports$8, Ot as messageDuration, P as types_exports$2, Pt as Displacement, Q as frames, Qt as PERF_GAP_BUCKETS, R as resolve, Rt as defineFilter, S as types_exports$14, St as Tappable, T as types_exports$11, Tt as Traced, U as ScrollState, Ut as animPlugin, V as DebugTrigger, Vt as scenesPlugin, W as popup, Wt as AnimPlayer, X as defineAnimation, Xt as MONITOR_SECTIONS, Y as HAPTIC_KINDS, Yt as frameAt, Z as external, Zt as PERF_CAUSES, _ as defineBundles, _t as Pointer, a as cubicBezier, at as sfx, b as types_exports$16, bt as Pressed, c as hint, cn as to, ct as stagger, d as defineScene, dn as SaveUnreadableError, dt as wait, en as PROBLEM_RULES, et as mark, f as tr, fn as lifecyclePlugin, ft as inputPlugin, g as music, gt as Hovered, h as defineEmitter, ht as Held, i as screen, in as flowPlugin, it as set, j as types_exports$5, jt as Alpha, k as types_exports$7, kt as effectsPlugin, l as schedule, ln as type, lt as tween, m as flattenFeatures, mn as clockPlugin, mt as DropTarget, n as createPlugin, nn as DEMAND_REASONS, nt as play, o as defineEffect, on as exit, ot as spawn, p as defineFeature, pn as timePlugin, pt as Draggable, q as textPlugin, qt as rendererPlugin, r as defineGame, rn as worldPlugin, rt as sequence, s as guide, sn as slot, st as spawned, t as createApp, tn as SHADER_WHATS, tt as parallel, u as projection, un as modelPlugin, ut as use, v as load, vt as PointerOver, w as types_exports$12, wt as Traceable, x as types_exports$15, xt as Swipeable, y as types_exports$17, yt as Pressable, z as defineMotion, zt as debugPlugin } from "./src-
|
|
2
|
-
import { A as
|
|
1
|
+
import { $ as haptic, $t as PERF_LOG_VERSION, A as types_exports$6, At as Emitter, B as Box, Bt as audioPlugin, C as types_exports$13, Ct as Touchable, D as types_exports$9, Dt as messageArgument, E as types_exports$10, Et as i18nPlugin, F as types_exports$1, Ft as Glow, G as defineTokens, Gt as Animation, H as LocalWrite, Ht as assetsPlugin, I as types_exports, It as Noise, J as platformPlugin, Jt as PASS_KINDS, K as defineStyle, Kt as Frames, L as uiPlugin, Lt as Outline, M as types_exports$4, Mt as Blur, N as types_exports$3, Nt as ColorMatrix, O as types_exports$8, Ot as messageDuration, P as types_exports$2, Pt as Displacement, Q as frames, Qt as PERF_GAP_BUCKETS, R as resolve, Rt as defineFilter, S as types_exports$14, St as Tappable, T as types_exports$11, Tt as Traced, U as ScrollState, Ut as animPlugin, V as DebugTrigger, Vt as scenesPlugin, W as popup, Wt as AnimPlayer, X as defineAnimation, Xt as MONITOR_SECTIONS, Y as HAPTIC_KINDS, Yt as frameAt, Z as external, Zt as PERF_CAUSES, _ as defineBundles, _t as Pointer, a as cubicBezier, at as sfx, b as types_exports$16, bt as Pressed, c as hint, cn as to, ct as stagger, d as defineScene, dn as SaveUnreadableError, dt as wait, en as PROBLEM_RULES, et as mark, f as tr, fn as lifecyclePlugin, ft as inputPlugin, g as music, gt as Hovered, h as defineEmitter, ht as Held, i as screen, in as flowPlugin, it as set, j as types_exports$5, jt as Alpha, k as types_exports$7, kt as effectsPlugin, l as schedule, ln as type, lt as tween, m as flattenFeatures, mn as clockPlugin, mt as DropTarget, n as createPlugin, nn as DEMAND_REASONS, nt as play, o as defineEffect, on as exit, ot as spawn, p as defineFeature, pn as timePlugin, pt as Draggable, q as textPlugin, qt as rendererPlugin, r as defineGame, rn as worldPlugin, rt as sequence, s as guide, sn as slot, st as spawned, t as createApp, tn as SHADER_WHATS, tt as parallel, u as projection, un as modelPlugin, ut as use, v as load, vt as PointerOver, w as types_exports$12, wt as Traceable, x as types_exports$15, xt as Swipeable, y as types_exports$17, yt as Pressable, z as defineMotion, zt as debugPlugin } from "./src-Cs1bP3v7.mjs";
|
|
2
|
+
import { A as Now, C as Sprite, D as sprite, F as resource, I as system, M as Tree, N as component, O as Exiting, P as mut, R as tag, S as Shape, _ as HudPart, c as Countdown, f as defineTextStyles, g as Display, j as Order, k as Layer, l as Text, p as label, u as bind, v as NineSlice, w as Transform, x as Parent, y as Overlay } from "./visual-CIUx49C0.mjs";
|
|
3
3
|
import { r as defineComponent } from "./flatten-BkXuscAV.mjs";
|
|
4
4
|
export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, 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, 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, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as Api$2, F as Under, Mr as Snapshot, Qt as Api$1, br as Api, dn as EntitySnapshot, en as Explained, er as FlowGraph, fn as FrameDiff, m as Usage, nr as JournalEntry, sn as ComponentSchema, t as Api$3, z as RenderStats, zn as Position } from "./types-
|
|
2
|
-
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-
|
|
3
|
-
import { c as UiNode } from "./types-
|
|
4
|
-
import { t as HeadlessApp } from "./headless-
|
|
5
|
-
import { a as InputOf, c as Source, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-
|
|
6
|
-
import { n as defineSource } from "./define-
|
|
1
|
+
import { E as Api$2, F as Under, Mr as Snapshot, Qt as Api$1, br as Api, dn as EntitySnapshot, en as Explained, er as FlowGraph, fn as FrameDiff, m as Usage, nr as JournalEntry, sn as ComponentSchema, t as Api$3, z as RenderStats, zn as Position } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { a as AudioApi, g as EffectsStats, h as EffectsApi, r as UiApi, u as SoundEntry } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { c as UiNode } from "./types-D8roM1u3.mjs";
|
|
4
|
+
import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
|
|
5
|
+
import { a as InputOf, c as Source, i as InputArguments, l as WatchApp, o as InputSchema, t as CheatEntry, u as WatchInput } from "./types-YXykgTOp.mjs";
|
|
6
|
+
import { n as defineSource } from "./define-B8A5IoeS.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
1
|
import { c as defineSource } from "./session-CeKgO2hy.mjs";
|
|
2
|
-
import { n as read, r as watch, t as sources } from "./sources-
|
|
2
|
+
import { n as read, r as watch, t as sources } from "./sources-QCowxSpC.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-BZQQPq56.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-BZQQPq56.mjs";
|
|
2
2
|
export { Fragment, type JSX, jsx, jsxs };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as JsxChild, g as UiIntrinsicElements, t as DescriptionNode } from "./types-
|
|
1
|
+
import { a as JsxChild, g as UiIntrinsicElements, t as DescriptionNode } from "./types-D8roM1u3.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. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as scaleByFits, k as Layer } from "./visual-CIUx49C0.mjs";
|
|
2
2
|
import { o as notInstalled } from "./dev-BNndV-hU.mjs";
|
|
3
3
|
import { a as readTarget, c as defineSource, n as isTainted, o as inputOrEmpty, t as cheatsOf } from "./session-CeKgO2hy.mjs";
|
|
4
4
|
//#region src/plugins/flow/doors/read.ts
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
|
2
2
|
import { r as systemSource, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { a as finishDrafts, i as enableDraftPatches, n as deepFreeze$1, o as openDrafts, r as dropDrafts } from "./drafts-BawpSaVp.mjs";
|
|
4
4
|
import { d as graphHash, f as isRestCheckpoint, h as pushEntry, i as servePaused, l as findNode, m as compact, n as captureFrame, o as collectFlows, p as slotNames, r as serveCaptures, s as describeGraph, t as cancelCaptures, u as framePath } from "./capture-D7XvoHdH.mjs";
|
|
5
|
-
import { A as
|
|
5
|
+
import { A as Now, C as Sprite, E as componentsFor, F as resource, I as system, L as systemsFor, M as Tree, N as component, O as Exiting, R as tag, S as Shape, T as arcDefaults, _ as HudPart, b as OverlayLevel, c as Countdown, d as builtInStyles, g as Display, h as textFor, i as samePose, j as Order, k as Layer, l as Text, m as readStyle, n as drawnRect, o as visualOf$1, r as fitScaleOf, s as visualRectOf, t as CONTENT$1, v as NineSlice, w as Transform, x as Parent, y as Overlay } from "./visual-CIUx49C0.mjs";
|
|
6
6
|
import { a as isDev } from "./dev-BNndV-hU.mjs";
|
|
7
7
|
import { i as isComponentDefinition, n as flatten, r as defineComponent } from "./flatten-BkXuscAV.mjs";
|
|
8
8
|
import { envPlugin, logPlugin } from "@moku-labs/common/browser";
|
|
@@ -25527,10 +25527,22 @@ function stopOverlays(state) {
|
|
|
25527
25527
|
}
|
|
25528
25528
|
//#endregion
|
|
25529
25529
|
//#region src/plugins/renderer/sync/shape-path.ts
|
|
25530
|
+
/**
|
|
25531
|
+
* @file renderer/sync — the path of a `Shape`: a rectangle, a rounded rectangle or a triangle,
|
|
25532
|
+
* its fill, and its stroke, solid or dashed, or an arc, a stroke alone. A dashed stroke walks the
|
|
25533
|
+
* outline (straight edges, and rounded corners sampled as arcs) and strokes one open line per dash.
|
|
25534
|
+
* An arc runs on the circle inscribed in its box, from 12 o'clock clockwise.
|
|
25535
|
+
*/
|
|
25530
25536
|
/** Chords per rounded corner of a dashed outline: under 0.3 u off the arc at a 48 u radius. */
|
|
25531
25537
|
const CORNER_SAMPLES = 8;
|
|
25532
25538
|
/** The gap between two dashes, as a fraction of the dash length. */
|
|
25533
25539
|
const GAP_RATIO = .5;
|
|
25540
|
+
/** Segments of a full ring: a ring of 28 u across strays under 0.03 u off its circle. */
|
|
25541
|
+
const RING_SEGMENTS = 48;
|
|
25542
|
+
/** The fewest segments of an arc that draws: a sliver still bends. */
|
|
25543
|
+
const ARC_MIN_SEGMENTS = 2;
|
|
25544
|
+
/** 12 o'clock, where an arc starts: Pixi's angles run clockwise from 3 o'clock. */
|
|
25545
|
+
const TWELVE = -Math.PI / 2;
|
|
25534
25546
|
/**
|
|
25535
25547
|
* The corner radius the rectangle is drawn with: Pixi clamps it to half the shorter side.
|
|
25536
25548
|
*
|
|
@@ -25715,8 +25727,9 @@ function dashesOf(outline, dash) {
|
|
|
25715
25727
|
}
|
|
25716
25728
|
/**
|
|
25717
25729
|
* Draws the path of a shape and fills it in a colour at the alpha given. At alpha 0 the path stays unfilled, so only
|
|
25718
|
-
* a stroke shows. A clip mask is drawn here too, never dashed
|
|
25719
|
-
* object's tint, so a colour change draws
|
|
25730
|
+
* a stroke shows. A clip mask is drawn here too, never dashed; the path of an arc here is its box, which is what it
|
|
25731
|
+
* clips its children to. A fill-only shape is drawn white and coloured by the object's tint, so a colour change draws
|
|
25732
|
+
* no path (spec 26 R2.1).
|
|
25720
25733
|
*
|
|
25721
25734
|
* @param object - The graphics to draw on.
|
|
25722
25735
|
* @param value - The shape value.
|
|
@@ -25726,7 +25739,7 @@ function dashesOf(outline, dash) {
|
|
|
25726
25739
|
function drawShapePath(object, value, fillAlpha, color = value.fill) {
|
|
25727
25740
|
object.clear();
|
|
25728
25741
|
if (value.kind === "triangle") object.moveTo(0, 0).lineTo(value.w, value.h / 2).lineTo(0, value.h).closePath();
|
|
25729
|
-
else if (value.radius > 0) object.roundRect(0, 0, value.w, value.h, value.radius);
|
|
25742
|
+
else if (value.kind === "rect" && value.radius > 0) object.roundRect(0, 0, value.w, value.h, value.radius);
|
|
25730
25743
|
else object.rect(0, 0, value.w, value.h);
|
|
25731
25744
|
if (fillAlpha <= 0) return;
|
|
25732
25745
|
object.fill(fillAlpha < 1 ? {
|
|
@@ -25759,6 +25772,102 @@ function strokeShape(object, value) {
|
|
|
25759
25772
|
}
|
|
25760
25773
|
object.stroke(style);
|
|
25761
25774
|
}
|
|
25775
|
+
/**
|
|
25776
|
+
* The share of the circle an arc sweeps, clamped to 0..1: anything not above 0, `NaN` too, is 0; a whole ring when
|
|
25777
|
+
* the value leaves it out.
|
|
25778
|
+
*
|
|
25779
|
+
* @param value - The shape value.
|
|
25780
|
+
* @returns The share.
|
|
25781
|
+
* @example
|
|
25782
|
+
* ```ts
|
|
25783
|
+
* sweepOf({ ...Shape.defaults, kind: "arc", sweep: 1.4 }); // 1
|
|
25784
|
+
* ```
|
|
25785
|
+
*/
|
|
25786
|
+
function sweepOf(value) {
|
|
25787
|
+
const sweep = value.sweep ?? arcDefaults.sweep;
|
|
25788
|
+
if (Number.isNaN(sweep) || sweep <= 0) return 0;
|
|
25789
|
+
return Math.min(sweep, 1);
|
|
25790
|
+
}
|
|
25791
|
+
/**
|
|
25792
|
+
* The radius of the circle an arc runs on: inscribed in the shorter side of its box, inside its stroke.
|
|
25793
|
+
*
|
|
25794
|
+
* @param value - The shape value.
|
|
25795
|
+
* @returns The radius in reference units; 0 or below when the stroke leaves no circle.
|
|
25796
|
+
* @example
|
|
25797
|
+
* ```ts
|
|
25798
|
+
* arcRadiusOf({ ...Shape.defaults, kind: "arc", w: 28, h: 40, strokeWidth: 2 }); // 13
|
|
25799
|
+
* ```
|
|
25800
|
+
*/
|
|
25801
|
+
function arcRadiusOf(value) {
|
|
25802
|
+
return (Math.min(value.w, value.h) - value.strokeWidth) / 2;
|
|
25803
|
+
}
|
|
25804
|
+
/**
|
|
25805
|
+
* Tells whether an arc draws nothing: no stroke width, no sweep, or no circle inside its stroke.
|
|
25806
|
+
*
|
|
25807
|
+
* @param value - The shape value, an arc.
|
|
25808
|
+
* @returns True for an arc whose `Graphics` would hold no instruction.
|
|
25809
|
+
* @example
|
|
25810
|
+
* ```ts
|
|
25811
|
+
* isEmptyArc({ ...Shape.defaults, kind: "arc", w: 28, h: 28, strokeWidth: 2, sweep: 0 }); // true
|
|
25812
|
+
* ```
|
|
25813
|
+
*/
|
|
25814
|
+
function isEmptyArc(value) {
|
|
25815
|
+
return value.strokeWidth <= 0 || sweepOf(value) <= 0 || arcRadiusOf(value) <= 0;
|
|
25816
|
+
}
|
|
25817
|
+
/**
|
|
25818
|
+
* Strokes an arc: from 12 o'clock clockwise over its share of the circle, in segments as many as its angle needs (48
|
|
25819
|
+
* for a ring, at least 2), ended by its `cap`. A full ring is closed and has no ends. Nothing for an empty arc. Drawn
|
|
25820
|
+
* only when the shape changed: never rebuilt per frame.
|
|
25821
|
+
*
|
|
25822
|
+
* @param object - The graphics, cleared.
|
|
25823
|
+
* @param value - The shape value, an arc.
|
|
25824
|
+
*/
|
|
25825
|
+
function strokeArc(object, value) {
|
|
25826
|
+
if (isEmptyArc(value)) return;
|
|
25827
|
+
const sweep = sweepOf(value);
|
|
25828
|
+
const radius = arcRadiusOf(value);
|
|
25829
|
+
const ring = sweep >= 1;
|
|
25830
|
+
const segments = Math.max(ARC_MIN_SEGMENTS, Math.ceil(sweep * RING_SEGMENTS));
|
|
25831
|
+
const step = sweep * 2 * Math.PI / segments;
|
|
25832
|
+
const centreX = value.w / 2;
|
|
25833
|
+
const centreY = value.h / 2;
|
|
25834
|
+
const last = ring ? segments - 1 : segments;
|
|
25835
|
+
object.moveTo(centreX, centreY - radius);
|
|
25836
|
+
for (let index = 1; index <= last; index += 1) {
|
|
25837
|
+
const angle = TWELVE + index * step;
|
|
25838
|
+
object.lineTo(centreX + radius * Math.cos(angle), centreY + radius * Math.sin(angle));
|
|
25839
|
+
}
|
|
25840
|
+
if (ring) {
|
|
25841
|
+
object.closePath();
|
|
25842
|
+
object.stroke({
|
|
25843
|
+
color: value.stroke,
|
|
25844
|
+
width: value.strokeWidth
|
|
25845
|
+
});
|
|
25846
|
+
return;
|
|
25847
|
+
}
|
|
25848
|
+
object.stroke({
|
|
25849
|
+
color: value.stroke,
|
|
25850
|
+
width: value.strokeWidth,
|
|
25851
|
+
cap: value.cap ?? arcDefaults.cap
|
|
25852
|
+
});
|
|
25853
|
+
}
|
|
25854
|
+
/**
|
|
25855
|
+
* Paints a shape on its graphics: an arc as its stroke alone, every other kind as its path, its fill in a colour at its
|
|
25856
|
+
* own fill alpha, and its stroke. The one call that draws a shape's visual.
|
|
25857
|
+
*
|
|
25858
|
+
* @param object - The graphics.
|
|
25859
|
+
* @param value - The shape value.
|
|
25860
|
+
* @param color - The colour of the fill: white for a tinted shape, the value's own otherwise.
|
|
25861
|
+
*/
|
|
25862
|
+
function paintShape(object, value, color) {
|
|
25863
|
+
if (value.kind === "arc") {
|
|
25864
|
+
object.clear();
|
|
25865
|
+
strokeArc(object, value);
|
|
25866
|
+
return;
|
|
25867
|
+
}
|
|
25868
|
+
drawShapePath(object, value, value.fillAlpha, color);
|
|
25869
|
+
strokeShape(object, value);
|
|
25870
|
+
}
|
|
25762
25871
|
//#endregion
|
|
25763
25872
|
//#region src/plugins/renderer/sync/sizing.ts
|
|
25764
25873
|
/**
|
|
@@ -26738,8 +26847,20 @@ function copyClip(drawn, value) {
|
|
|
26738
26847
|
return drawn;
|
|
26739
26848
|
}
|
|
26740
26849
|
/**
|
|
26850
|
+
* Tells whether an arc was drawn with this value already: only what its stroke is built from, its
|
|
26851
|
+
* box, its stroke, its share and its ends. A new fill, fill alpha, radius or dash builds nothing.
|
|
26852
|
+
*
|
|
26853
|
+
* @param drawn - What the graphics was last drawn with, an arc too.
|
|
26854
|
+
* @param value - The arc now.
|
|
26855
|
+
* @returns True when nothing has to be drawn.
|
|
26856
|
+
*/
|
|
26857
|
+
function sameArc(drawn, value) {
|
|
26858
|
+
return drawn.w === value.w && drawn.h === value.h && drawn.stroke === value.stroke && drawn.strokeWidth === value.strokeWidth && drawn.sweep === value.sweep && drawn.cap === value.cap;
|
|
26859
|
+
}
|
|
26860
|
+
/**
|
|
26741
26861
|
* Tells whether a shape's graphics was drawn with this value already: the path, the fill and the
|
|
26742
|
-
* stroke. Its alpha, its clip and the fill of a tinted shape (its tint)
|
|
26862
|
+
* stroke; for an arc only its stroke. Its alpha, its clip and the fill of a tinted shape (its tint)
|
|
26863
|
+
* are written apart.
|
|
26743
26864
|
*
|
|
26744
26865
|
* @param drawn - What the graphics was last drawn with.
|
|
26745
26866
|
* @param value - The shape value now.
|
|
@@ -26747,7 +26868,9 @@ function copyClip(drawn, value) {
|
|
|
26747
26868
|
* @returns True when nothing has to be drawn.
|
|
26748
26869
|
*/
|
|
26749
26870
|
function sameShape$1(drawn, value, tinted) {
|
|
26750
|
-
|
|
26871
|
+
if (drawn === void 0 || drawn.tinted !== tinted || drawn.kind !== value.kind) return false;
|
|
26872
|
+
if (value.kind === "arc") return sameArc(drawn, value);
|
|
26873
|
+
return (tinted || drawn.fill === value.fill) && drawn.w === value.w && drawn.h === value.h && drawn.fillAlpha === value.fillAlpha && drawn.radius === value.radius && drawn.stroke === value.stroke && drawn.strokeWidth === value.strokeWidth && drawn.dash === value.dash && drawn.sweep === value.sweep && drawn.cap === value.cap;
|
|
26751
26874
|
}
|
|
26752
26875
|
/**
|
|
26753
26876
|
* Keeps what a shape's graphics was drawn with, in the object it had, or in a new one the first
|
|
@@ -26760,7 +26883,7 @@ function sameShape$1(drawn, value, tinted) {
|
|
|
26760
26883
|
*/
|
|
26761
26884
|
function copyShape(drawn, value, tinted) {
|
|
26762
26885
|
if (drawn === void 0) {
|
|
26763
|
-
const { kind, w, h, fill, fillAlpha, radius, stroke, strokeWidth, dash } = value;
|
|
26886
|
+
const { kind, w, h, fill, fillAlpha, radius, stroke, strokeWidth, dash, sweep, cap } = value;
|
|
26764
26887
|
return {
|
|
26765
26888
|
tinted,
|
|
26766
26889
|
kind,
|
|
@@ -26771,7 +26894,9 @@ function copyShape(drawn, value, tinted) {
|
|
|
26771
26894
|
radius,
|
|
26772
26895
|
stroke,
|
|
26773
26896
|
strokeWidth,
|
|
26774
|
-
dash
|
|
26897
|
+
dash,
|
|
26898
|
+
sweep,
|
|
26899
|
+
cap
|
|
26775
26900
|
};
|
|
26776
26901
|
}
|
|
26777
26902
|
const copy = drawn;
|
|
@@ -26785,10 +26910,13 @@ function copyShape(drawn, value, tinted) {
|
|
|
26785
26910
|
copy.stroke = value.stroke;
|
|
26786
26911
|
copy.strokeWidth = value.strokeWidth;
|
|
26787
26912
|
copy.dash = value.dash;
|
|
26913
|
+
copy.sweep = value.sweep;
|
|
26914
|
+
copy.cap = value.cap;
|
|
26788
26915
|
return copy;
|
|
26789
26916
|
}
|
|
26790
26917
|
/**
|
|
26791
|
-
* Tells whether a shape draws nothing: no stroke, and no fill alpha or no area
|
|
26918
|
+
* Tells whether a shape draws nothing: no stroke, and no fill alpha or no area; an arc with no stroke, no sweep or no
|
|
26919
|
+
* circle inside its stroke. Pure.
|
|
26792
26920
|
*
|
|
26793
26921
|
* @param value - The shape value.
|
|
26794
26922
|
* @returns True for a shape whose `Graphics` would hold no instruction.
|
|
@@ -26798,6 +26926,7 @@ function copyShape(drawn, value, tinted) {
|
|
|
26798
26926
|
* ```
|
|
26799
26927
|
*/
|
|
26800
26928
|
function isEmptyShape(value) {
|
|
26929
|
+
if (value.kind === "arc") return isEmptyArc(value);
|
|
26801
26930
|
return value.strokeWidth <= 0 && (value.fillAlpha <= 0 || value.w <= 0 || value.h <= 0);
|
|
26802
26931
|
}
|
|
26803
26932
|
/**
|
|
@@ -26815,8 +26944,7 @@ function drawShape(sctx, entity, view, object, value) {
|
|
|
26815
26944
|
const tinted = value.strokeWidth <= 0;
|
|
26816
26945
|
if (!sameShape$1(view.drawn, value, tinted)) {
|
|
26817
26946
|
markView(sctx, entity);
|
|
26818
|
-
|
|
26819
|
-
strokeShape(object, value);
|
|
26947
|
+
paintShape(object, value, tinted ? WHITE$1 : value.fill);
|
|
26820
26948
|
sctx.ctx.state.sync.redraws += 1;
|
|
26821
26949
|
view.drawn = copyShape(view.drawn, value, tinted);
|
|
26822
26950
|
}
|
package/dist/testing.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Cr as Json, Yn as FeaturePlugin, Zn as AnyFlow, _r as FakeClock, dr as Hint, fr as NodeFx, hr as ClockSource, rr as NodeTable, sr as Descriptor } from "./types-
|
|
2
|
-
import { t as createApp } from "./index-
|
|
3
|
-
import { b as saveOf, v as WithGameState, y as memory } 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 { Cr as Json, Yn as FeaturePlugin, Zn as AnyFlow, _r as FakeClock, dr as Hint, fr as NodeFx, hr as ClockSource, rr as NodeTable, sr as Descriptor } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { t as createApp } from "./index-DT9aYVGd.mjs";
|
|
3
|
+
import { b as saveOf, v as WithGameState, y as memory } from "./types-DK-IYk-s.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-CrxofjLt.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 { an as refuseStart, ln as type, m as flattenFeatures, on as exit, t as createApp } from "./src-
|
|
1
|
+
import { an as refuseStart, ln as type, m as flattenFeatures, on as exit, t as createApp } from "./src-Cs1bP3v7.mjs";
|
|
2
2
|
import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
|
|
3
3
|
import { t as fakeClock } from "./fake-6mazmHK3.mjs";
|
|
4
4
|
import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-BA6ffzqD.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as Require, Cn as Motion, Cr as Json, Dn as ProjectionMotion, E as Api$3, En as NumericFields, Mn as ViewHandle, Nn as Api$1, Nt as ViewportSize, Qt as Api$2, Tn as MotionHandle, Ur as Api, Yt as TransformValue, an as AnyComponentValue, bn as ChangeHook, cn as ComponentType, dr as Hint, in as AnyComponentType, mr as Api$5, pr as Answer, rn as AnyComponent, s as Events$1, sr as Descriptor, t as Api$4, un as Entity, wn as MotionCause, yn as TagType } from "./types-
|
|
1
|
+
import { $r as Require, Cn as Motion, Cr as Json, Dn as ProjectionMotion, E as Api$3, En as NumericFields, Mn as ViewHandle, Nn as Api$1, Nt as ViewportSize, Qt as Api$2, Tn as MotionHandle, Ur as Api, Yt as TransformValue, an as AnyComponentValue, bn as ChangeHook, cn as ComponentType, dr as Hint, in as AnyComponentType, mr as Api$5, pr as Answer, rn as AnyComponent, s as Events$1, sr as Descriptor, t as Api$4, un as Entity, wn as MotionCause, yn as TagType } from "./types-i77Nrrv-.mjs";
|
|
2
2
|
import { Log } from "@moku-labs/common/browser";
|
|
3
3
|
import { PluginCtx } from "@moku-labs/core";
|
|
4
4
|
|
|
@@ -126,6 +126,8 @@ type PositionStyle = {
|
|
|
126
126
|
* // The play glyph of the Watch button, and a dashed ring around a slot.
|
|
127
127
|
* const play: VisualStyle = { shape: "triangle", fill: 0xfffbe8 };
|
|
128
128
|
* const slot: VisualStyle = { stroke: 0x3a2212, strokeWidth: 4, dash: 10, radius: 24 };
|
|
129
|
+
* // The slot timer: the time left as 42 % of a ring, from 12 o'clock clockwise, with round ends.
|
|
130
|
+
* const timer: VisualStyle = { shape: "arc", stroke: 0xc8a15a, strokeWidth: 2.2, sweep: 0.42, cap: "round" };
|
|
129
131
|
* ```
|
|
130
132
|
*/
|
|
131
133
|
type VisualStyle<Asset extends string = string> = {
|
|
@@ -136,11 +138,19 @@ type VisualStyle<Asset extends string = string> = {
|
|
|
136
138
|
alpha?: number;
|
|
137
139
|
/**
|
|
138
140
|
* The shape of the rectangle an element without a nine-slice is drawn with: `"rect"` (the
|
|
139
|
-
* default)
|
|
140
|
-
* element with `rotation` for another direction
|
|
141
|
+
* default), `"triangle"`, which fills the box pointing right and ignores `radius` (turn the
|
|
142
|
+
* element with `rotation` for another direction), or `"arc"`, a `stroke` of `strokeWidth` on the
|
|
143
|
+
* circle inscribed in the box (`min(width, height) − strokeWidth` across, centred) from 12 o'clock
|
|
144
|
+
* clockwise over `sweep` of it. An arc draws no `fill` and ignores `radius` and `dash`.
|
|
141
145
|
*/
|
|
142
|
-
shape?: "rect" | "triangle"; /** The dash length of the stroke in reference units, with gaps of half a dash; 0 is solid. */
|
|
146
|
+
shape?: "rect" | "triangle" | "arc"; /** The dash length of the stroke in reference units, with gaps of half a dash; 0 is solid. */
|
|
143
147
|
dash?: number;
|
|
148
|
+
/**
|
|
149
|
+
* The share of the circle an arc sweeps, from 0 to 1 (1 by default): 0 draws nothing, 1 a
|
|
150
|
+
* closed ring; a value outside is clamped. A new value in a render draws the arc again once.
|
|
151
|
+
*/
|
|
152
|
+
sweep?: number; /** How an open arc ends: `"round"` (the default) or `"butt"`, flat at its end. */
|
|
153
|
+
cap?: "round" | "butt";
|
|
144
154
|
/**
|
|
145
155
|
* The asset key of a nine-slice drawn at the rect instead of the rounded rectangle. Any tag
|
|
146
156
|
* but `image`, `icon` and `text` takes it; a clipping element (`scroll`, `overflow: "hidden"`)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $r as Require, A as PixiModule, An as TrackOptions, At as FilterSlotInputs, Cr as Json, E as Api$4, En as NumericFields, M as PixiTexture, Mt as Point, Nn as Api$2, Pt as FilterCache, Qr as Events$2, Qt as Api$3, Sn as Ease, Sr as Events$3, Tn as MotionHandle, Ur as Api$1, an as AnyComponentValue, br as Api$6, cn as ComponentType, j as PixiSprite, jn as TrackSegment, k as PixiFilter, kn as ReducedMotion, kt as FilterSlot, on as ComponentHandle, or as TypeTag, rn as AnyComponent, s as Events$1, sr as Descriptor, t as Api$5, un as Entity, v as Events$4, zr as Events$5 } from "./types-
|
|
2
|
-
import { C as TextApi, L as I18nApi, M as InputApi, Y as StylesState, c as UiNode, i as Finding, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-
|
|
1
|
+
import { $r as Require, A as PixiModule, An as TrackOptions, At as FilterSlotInputs, Cr as Json, E as Api$4, En as NumericFields, M as PixiTexture, Mt as Point, Nn as Api$2, Pt as FilterCache, Qr as Events$2, Qt as Api$3, Sn as Ease, Sr as Events$3, Tn as MotionHandle, Ur as Api$1, an as AnyComponentValue, br as Api$6, cn as ComponentType, j as PixiSprite, jn as TrackSegment, k as PixiFilter, kn as ReducedMotion, kt as FilterSlot, on as ComponentHandle, or as TypeTag, rn as AnyComponent, s as Events$1, sr as Descriptor, t as Api$5, un as Entity, v as Events$4, zr as Events$5 } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { C as TextApi, L as I18nApi, M as InputApi, Y as StylesState, c as UiNode, i as Finding, n as ElementChange, o as JsxState, r as ElementMotion } from "./types-D8roM1u3.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
import { PluginCtx } from "@moku-labs/core";
|
|
5
5
|
import { Node, Yoga } from "yoga-layout/load";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as PixiModule, Ar as SaveDoc, Cr as Json, D as Config$2, Fn as Config$1, Nr as SnapshotOf, Or as PlayerStateProvider, Yn as FeaturePlugin, Zn as AnyFlow, _r as FakeClock, a as Config$3, d as Manifest, hr as ClockSource, jt as Orientation, kr as ProviderCall, n as AssetsIo, or as TypeTag, xr as Config } from "./types-
|
|
2
|
-
import { o as AudioContextLike, s as Config$4 } from "./types-
|
|
3
|
-
import { H as StringTable, L as I18nApi, U as TextKey } from "./types-
|
|
4
|
-
import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-
|
|
1
|
+
import { A as PixiModule, Ar as SaveDoc, Cr as Json, D as Config$2, Fn as Config$1, Nr as SnapshotOf, Or as PlayerStateProvider, Yn as FeaturePlugin, Zn as AnyFlow, _r as FakeClock, a as Config$3, d as Manifest, hr as ClockSource, jt as Orientation, kr as ProviderCall, n as AssetsIo, or as TypeTag, xr as Config } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { o as AudioContextLike, s as Config$4 } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { H as StringTable, L as I18nApi, U as TextKey } from "./types-D8roM1u3.mjs";
|
|
4
|
+
import { ft as platformPlugin, i as screen, mt as PlatformProvider, t as createApp, wt as audioPlugin, xt as effectsPlugin } from "./index-DT9aYVGd.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 { Cr as Json, Mr as Snapshot } from "./types-
|
|
2
|
-
import { t as HeadlessApp } from "./headless-
|
|
1
|
+
import { Cr as Json, Mr as Snapshot } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { t as HeadlessApp } from "./headless-CrxofjLt.mjs";
|
|
3
3
|
import { Log } from "@moku-labs/common/browser";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/flow/doors/types.d.ts
|
|
@@ -6626,14 +6626,20 @@ type DisplayValue = {
|
|
|
6626
6626
|
object: unknown;
|
|
6627
6627
|
};
|
|
6628
6628
|
/**
|
|
6629
|
-
* A filled rounded rectangle or
|
|
6630
|
-
*
|
|
6631
|
-
*
|
|
6632
|
-
*
|
|
6633
|
-
*
|
|
6634
|
-
*
|
|
6635
|
-
*
|
|
6636
|
-
*
|
|
6629
|
+
* A filled rounded rectangle, a triangle or an arc, anchored at the top left of the `Transform`. `kind` picks the
|
|
6630
|
+
* outline: `"rect"` (the default), `"triangle"`, which fills its `w × h` box pointing right (rotate the element for
|
|
6631
|
+
* another direction) and ignores `radius`, or `"arc"`. `fillAlpha` is the alpha of the fill alone: 0 draws only the
|
|
6632
|
+
* stroke, a ring. `alpha` fades the whole shape and the entity's children: a disabled button at 0.6 draws its icon at
|
|
6633
|
+
* 0.6 too. `dash` is the dash length of the stroke in reference units, with gaps of half a dash; 0 strokes a solid
|
|
6634
|
+
* line. `clip` masks the children of the entity to the shape, always solid, which is how `ui` draws a scroll and an
|
|
6635
|
+
* overflow. The shape itself is never masked, so its stroke is drawn whole. An arc is a stroke on the circle inscribed
|
|
6636
|
+
* in the box: its diameter is `min(w, h) − strokeWidth`, centred, so the stroke stays inside the box. It starts at 12
|
|
6637
|
+
* o'clock and runs clockwise over `sweep` of the circle (0 to 1, clamped): 0 draws nothing, 1 a closed ring. `cap` ends
|
|
6638
|
+
* an open arc round or flat (`"butt"`). Both are optional: left out, `sweep` is 1 and `cap` is `"round"`
|
|
6639
|
+
* (`arcDefaults`). Only an arc reads them; a rectangle or a triangle ignores them. An arc draws only its stroke, in
|
|
6640
|
+
* `stroke`, `strokeWidth` and `alpha`: `fill`, `fillAlpha`, `radius` and `dash` are ignored, and `clip` masks the
|
|
6641
|
+
* children to its box. The path is built again only when a field it is drawn from changes: a still arc costs nothing a
|
|
6642
|
+
* frame, a new `fill` builds no arc again.
|
|
6637
6643
|
*
|
|
6638
6644
|
* @example
|
|
6639
6645
|
* ```ts
|
|
@@ -6649,10 +6655,12 @@ type DisplayValue = {
|
|
|
6649
6655
|
* // The play glyph of a watch button, and a dashed focus ring: 10 u dashes, 5 u gaps.
|
|
6650
6656
|
* const play: ShapeValue = { ...ring, kind: "triangle", w: 36, h: 40, fillAlpha: 1, strokeWidth: 0 };
|
|
6651
6657
|
* const focus: ShapeValue = { ...ring, w: 200, h: 80, stroke: 0x3a2212, strokeWidth: 4, dash: 10 };
|
|
6658
|
+
* // The time left on a slot's timer: 42 % of a ring 25.8 u across in a 28 u box, from 12 o'clock clockwise, round ends.
|
|
6659
|
+
* const timer: ShapeValue = { ...ring, kind: "arc", w: 28, h: 28, stroke: 0xc8a15a, strokeWidth: 2.2, sweep: 0.42 };
|
|
6652
6660
|
* ```
|
|
6653
6661
|
*/
|
|
6654
6662
|
type ShapeValue = {
|
|
6655
|
-
kind: "rect" | "triangle";
|
|
6663
|
+
kind: "rect" | "triangle" | "arc";
|
|
6656
6664
|
w: number;
|
|
6657
6665
|
h: number;
|
|
6658
6666
|
fill: number;
|
|
@@ -6662,7 +6670,9 @@ type ShapeValue = {
|
|
|
6662
6670
|
stroke: number;
|
|
6663
6671
|
strokeWidth: number;
|
|
6664
6672
|
dash: number;
|
|
6665
|
-
clip: boolean;
|
|
6673
|
+
clip: boolean; /** The share of the circle an arc sweeps, 0 to 1, from 12 o'clock clockwise; clamped. Only an arc reads it: 1 left out. */
|
|
6674
|
+
sweep?: number; /** How an open arc ends: `"round"` or `"butt"` (flat at its end). Only an arc reads it: `"round"` left out. */
|
|
6675
|
+
cap?: "round" | "butt";
|
|
6666
6676
|
};
|
|
6667
6677
|
/**
|
|
6668
6678
|
* What `sprite()` takes: the two things every visual needs, and the four that have defaults.
|
|
@@ -6762,9 +6772,10 @@ declare const Parent: ComponentType<{
|
|
|
6762
6772
|
*/
|
|
6763
6773
|
declare const Display: ComponentType<DisplayValue>;
|
|
6764
6774
|
/**
|
|
6765
|
-
* A filled rounded rectangle
|
|
6766
|
-
*
|
|
6767
|
-
* `clip: true` masks the children of the entity to the
|
|
6775
|
+
* A filled rounded rectangle, a right-pointing triangle or an arc (`kind: "arc"`, a stroke from 12 o'clock clockwise
|
|
6776
|
+
* over `sweep` of the circle in its box), drawn with Pixi `Graphics` and redrawn only when a field changed.
|
|
6777
|
+
* `fillAlpha: 0` draws only the stroke, `dash` above 0 dashes it. `clip: true` masks the children of the entity to the
|
|
6778
|
+
* shape.
|
|
6768
6779
|
*/
|
|
6769
6780
|
declare const Shape: ComponentType<ShapeValue>;
|
|
6770
6781
|
/**
|
|
@@ -7241,7 +7252,7 @@ type HitBox = {
|
|
|
7241
7252
|
*/
|
|
7242
7253
|
type DrawnShape = {
|
|
7243
7254
|
/** Drawn white, coloured by the object's tint (no stroke); false for a shape painted in its own colours. */tinted: boolean;
|
|
7244
|
-
kind: "
|
|
7255
|
+
kind: ShapeValue["kind"];
|
|
7245
7256
|
w: number;
|
|
7246
7257
|
h: number;
|
|
7247
7258
|
fill: number;
|
|
@@ -7249,14 +7260,16 @@ type DrawnShape = {
|
|
|
7249
7260
|
radius: number;
|
|
7250
7261
|
stroke: number;
|
|
7251
7262
|
strokeWidth: number;
|
|
7252
|
-
dash: number;
|
|
7263
|
+
dash: number; /** An arc's `sweep` as the value held it, `undefined` when left out. */
|
|
7264
|
+
sweep: number | undefined; /** An arc's `cap` as the value held it, `undefined` when left out. */
|
|
7265
|
+
cap: ShapeValue["cap"];
|
|
7253
7266
|
};
|
|
7254
7267
|
/**
|
|
7255
7268
|
* The fields of the clip rectangle last drawn into a view's mask: an equal value draws no mask again. Private to
|
|
7256
7269
|
* `sync`.
|
|
7257
7270
|
*/
|
|
7258
7271
|
type ClipDrawn = {
|
|
7259
|
-
kind: "
|
|
7272
|
+
kind: ShapeValue["kind"];
|
|
7260
7273
|
w: number;
|
|
7261
7274
|
h: number;
|
|
7262
7275
|
radius: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { E as Api, Lr as Api$3, Qt as Api$1, br as Api$2 } from "./types-
|
|
2
|
-
import { P as AnimApi, r as UiApi } from "./types-
|
|
3
|
-
import { M as InputApi } from "./types-
|
|
4
|
-
import { r as Repro } from "./headless-
|
|
5
|
-
import { a as InputOf, r as ControlApp } from "./types-
|
|
6
|
-
import { t as commands } from "./commands-
|
|
1
|
+
import { E as Api, Lr as Api$3, Qt as Api$1, br as Api$2 } from "./types-i77Nrrv-.mjs";
|
|
2
|
+
import { P as AnimApi, r as UiApi } from "./types-DDmfkONF.mjs";
|
|
3
|
+
import { M as InputApi } from "./types-D8roM1u3.mjs";
|
|
4
|
+
import { r as Repro } from "./headless-CrxofjLt.mjs";
|
|
5
|
+
import { a as InputOf, r as ControlApp } from "./types-YXykgTOp.mjs";
|
|
6
|
+
import { t as commands } from "./commands-5woFUxUr.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. */
|
|
@@ -195,6 +195,18 @@ const Now = /*#__PURE__*/ resource("Now", { now: 0 });
|
|
|
195
195
|
* part), the engine's own overlay level, and the `sprite()` bundle helper. Pure: no ctx, no state, no Pixi. Made with the `component()` helper of `world`, so nothing has
|
|
196
196
|
* to be registered.
|
|
197
197
|
*/
|
|
198
|
+
/**
|
|
199
|
+
* What an arc draws with when its `Shape` leaves `sweep` or `cap` out: the whole ring, round ends.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* arcDefaults.sweep; // 1
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
const arcDefaults = Object.freeze({
|
|
207
|
+
sweep: 1,
|
|
208
|
+
cap: "round"
|
|
209
|
+
});
|
|
198
210
|
const overlayDefaults = {
|
|
199
211
|
dim: 0,
|
|
200
212
|
dimColor: 0,
|
|
@@ -270,9 +282,10 @@ const Parent = /*#__PURE__*/ component("Parent", { entity: 0 });
|
|
|
270
282
|
*/
|
|
271
283
|
const Display = /*#__PURE__*/ component("Display", displayDefaults);
|
|
272
284
|
/**
|
|
273
|
-
* A filled rounded rectangle
|
|
274
|
-
*
|
|
275
|
-
* `clip: true` masks the children of the entity to the
|
|
285
|
+
* A filled rounded rectangle, a right-pointing triangle or an arc (`kind: "arc"`, a stroke from 12 o'clock clockwise
|
|
286
|
+
* over `sweep` of the circle in its box), drawn with Pixi `Graphics` and redrawn only when a field changed.
|
|
287
|
+
* `fillAlpha: 0` draws only the stroke, `dash` above 0 dashes it. `clip: true` masks the children of the entity to the
|
|
288
|
+
* shape.
|
|
276
289
|
*/
|
|
277
290
|
const Shape = /*#__PURE__*/ component("Shape", shapeDefaults);
|
|
278
291
|
/**
|
|
@@ -724,7 +737,8 @@ function contentOf(props) {
|
|
|
724
737
|
/**
|
|
725
738
|
* The visual component of an element: a sprite for an image or an icon, the text for a text, the
|
|
726
739
|
* nine-slice of its style (outlined when the style sets `debug`), or a rounded rectangle, a
|
|
727
|
-
* triangle with `shape: "triangle"`, its stroke dashed with `dash
|
|
740
|
+
* triangle with `shape: "triangle"`, its stroke dashed with `dash`, or an arc with `shape: "arc"`
|
|
741
|
+
* over the `sweep` of its style, ended by its `cap`. A clipping element (`scroll`,
|
|
728
742
|
* `overflow: "hidden"`) keeps the rectangle, which carries the clip; a text field's rectangle
|
|
729
743
|
* clips too, and a nine-slice field draws its slices and clips to them. A style with a stroke and
|
|
730
744
|
* no fill draws only the stroke, a ring. A container with no fill and no stroke gets a rectangle that draws
|
|
@@ -775,7 +789,7 @@ function visualOf(element) {
|
|
|
775
789
|
})];
|
|
776
790
|
const filled = style.fill !== void 0 || style.stroke !== void 0;
|
|
777
791
|
const invisible = isContainer(type) && !filled;
|
|
778
|
-
|
|
792
|
+
const shape = {
|
|
779
793
|
kind: style.shape ?? "rect",
|
|
780
794
|
w: rect.w,
|
|
781
795
|
h: rect.h,
|
|
@@ -787,6 +801,12 @@ function visualOf(element) {
|
|
|
787
801
|
strokeWidth: invisible ? 0 : style.strokeWidth ?? 0,
|
|
788
802
|
dash: style.dash ?? 0,
|
|
789
803
|
clip: clip || type === "input"
|
|
804
|
+
};
|
|
805
|
+
if (shape.kind !== "arc") return [Shape(shape)];
|
|
806
|
+
return [Shape({
|
|
807
|
+
...shape,
|
|
808
|
+
sweep: style.sweep ?? arcDefaults.sweep,
|
|
809
|
+
cap: style.cap ?? arcDefaults.cap
|
|
790
810
|
})];
|
|
791
811
|
}
|
|
792
812
|
/**
|
|
@@ -895,4 +915,4 @@ function drawnRect(pose, local) {
|
|
|
895
915
|
};
|
|
896
916
|
}
|
|
897
917
|
//#endregion
|
|
898
|
-
export {
|
|
918
|
+
export { Now as A, Sprite as C, sprite as D, componentsFor as E, resource as F, system as I, systemsFor as L, Tree as M, component as N, Exiting as O, mut as P, tag as R, Shape as S, arcDefaults as T, HudPart as _, scaleByFits as a, OverlayLevel as b, Countdown as c, builtInStyles as d, defineTextStyles as f, Display as g, textFor as h, samePose as i, Order as j, Layer as k, Text as l, readStyle as m, drawnRect as n, visualOf as o, label as p, fitScaleOf as r, visualRectOf as s, CONTENT as t, bind as u, NineSlice as v, Transform as w, Parent as x, Overlay as y };
|
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-1doiBOD3.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,4 +1,4 @@
|
|
|
1
|
-
import { n as read, t as sources } from "./sources-
|
|
1
|
+
import { n as read, t as sources } from "./sources-QCowxSpC.mjs";
|
|
2
2
|
import { n as commands, t as run } from "./run-BqYmcNo7.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createBrandConsole } from "@moku-labs/common/cli";
|
package/llms.txt
CHANGED
|
@@ -521,7 +521,8 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
521
521
|
|
|
522
522
|
`world`, `renderer`, `input`, `assets`, `scenes`. Each has a README at `src/plugins/<name>/README.md`; the root README lists their APIs, events and config. Rendering: WebGPU preferred, with Pixi's WebGL fallback.
|
|
523
523
|
- `app.scenes`: `current()` the mounted scene id, `expect(id)` the scene the next node without its own `scene` mounts, a rest node or a transit node in live mode (the restore door calls it; an unknown id throws). An `over` node takes it the same way, also over another mounted scene.
|
|
524
|
-
-
|
|
524
|
+
- `Shape({ kind, w, h, fill, fillAlpha, alpha, radius, stroke, strokeWidth, dash, clip, sweep?, cap? })` (`kind: "rect"`; `sweep` and `cap` are optional, `1` and `"round"` when left out; only an arc reads them; a rectangle or a triangle ignores them, also when an earlier arc left them on the `Shape`): a rounded rectangle, `kind: "triangle"` (fills its box pointing right) or `kind: "arc"`: a stroke on the circle inscribed in the box (`min(w, h) − strokeWidth` across, centred) from 12 o'clock clockwise over `sweep` (0..1, clamped; 0 draws nothing, 1 a closed ring), ended by `cap` (`"round" | "butt"`); an arc draws no fill and ignores `radius` and `dash`. The path is built again only when a field changes: a still arc costs nothing a frame. `Shape({ kind: "arc", w: 28, h: 28, stroke: 0xc8a15a, strokeWidth: 2.2, sweep: 0.42 })` is a slot timer's ring with 42 % left.
|
|
525
|
+
- Overlays: `Overlay({ dim, dimColor, cover, hud, fade })` on the root of an overlay (in `components`) keeps everything drawn before it as one picture, retaken in the frame anything in it changes, and with `cover: "opaque"` draws none of it once landed at alpha 1; the engine draws the dim (`dim × level`, right under the root); the level follows the root's own enter and exit motion, `fade` (250 ms) only when it has none; level and landing are read through `app.renderer.sync.debug.overlays()`. A `backdrop: true` filter inside the kept range runs no pass while the picture stands (its look is in the picture) and is drawn again in the frame the overlay is gone.
|
|
525
526
|
- HUD: a scene layer `{ above: "overlays" }` is the HUD layer, drawn above every overlay and never in a picture; a scene with a HUD layer and no `ui` gets `ui` right under it. Its roots never take the keyboard: Escape and the Back press reach the top sheet under it. `HudPart({ key })` tags a HUD view; an overlay's `hud` (`"all"`, `"none"` or keys) names the parts that stay shown, the others fade with its level and take no tap. Keys are typed by `defineGame<{ …, hud: "energy" | "gems" }>()`.
|
|
526
527
|
- Endless loops of views under an opaque or blurred overlay write nothing (`renderer.sync.loopsHeld(entity)`, the seam anim asks before an endless loop writes); their phase follows time.
|
|
527
528
|
- A scene names bundles on top of its `bundle` from the committed state: `defineScene("ward", { bundle: "episodes-kit", bundles: ({ session }) => [session.episode], layers: {}, projections: [wardRoom] })`. `bundles` is read each time a node enters the scene, and every way in (a live entry, a restore, the `safeNode` recovery) waits for all of them before the scene is mounted and the node's gate opens. The keys are `BundleKey`s of `generated/assets.ts`.
|
|
@@ -540,7 +541,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
540
541
|
- Overdraw heat map (dev and debug builds): `app.renderer.sync.debug.overdraw(true)` (or `game.debug { overdraw: true }`) draws every frame so a pixel's brightness counts the layers drawn there: 1/16 white a layer, white at sixteen. While on, every frame is drawn (also with `onDemand`), kept pictures draw live and filters are off; only the stage pass changes, the tree between frames stays the game's, and off draws the game again from the next frame. Texels a texture leaves transparent count nothing.
|
|
541
542
|
- `app.renderer.viewport.size()` answers one frozen object, replaced only when the frame changes (a resize, a rotation, new insets, a new scale): compare frames with `===`; a write into it throws a `TypeError`.
|
|
542
543
|
- `pluginConfigs.renderer.warm` (default `1`, 0 to 16) is the pipeline warm-up: while a game loads, each drawn frame first draws that many invisible probes (sprites, graphics, text, particles, every filter kind and stage `effects` registers, on the canvas and on a texture, with and without a clip), wiped by the stage pass, so no screen creates a GPU pipeline in the frame it opens in; `0` turns it off. `app.renderer.sync.filters.warm(filter)` warms a game's own filter (answers `true` once drawn). An agent build writes a `warm` event `{ draws }` when the queue empties.
|
|
543
|
-
- `defineFilter(id, { area: value => [x, y, width, height] })` declares the box, in the entity's own units, outside of which the filter draws nothing: Pixi renders and fills only that box (a lens over a full-screen cover fills its disc, not the screen). The view gets the union of its enabled filters' areas, none when an enabled filter declares none (`renderer.sync.filters.area(entity, area)`). Distance-field text uses device pixels for its edge: sharper at a resolution above 1.
|
|
544
|
+
- `defineFilter(id, { area: value => [x, y, width, height] })` declares the box, in the entity's own units, outside of which the filter draws nothing: Pixi renders and fills only that box (a lens over a full-screen cover fills its disc, not the screen). The view gets the union of its enabled filters' areas, none when an enabled filter declares none (`renderer.sync.filters.area(entity, area)`). The area also clips the view's own children: Pixi draws nothing of the view outside it, so a shadow or a badge that overhangs the box is cut; make the box hold them. Distance-field text uses device pixels for its edge: sharper at a resolution above 1.
|
|
544
545
|
- `pluginConfigs.renderer.poolTrim` (default `{ restMs: 1000, aboveMb: 16 }`) gives back the idle render targets Pixi's texture pool keeps, strictly between frames: after `restMs` of a still screen (`onDemand`), `restMs` after a scene change (each when the targets grew by `aboveMb` MiB), and on a pause (whatever grew); `false` keeps them. `stats().textureMbSplit.targets` shows the drop; an agent build writes a `pool-trim` event `{ reason, freedMb }`.
|
|
545
546
|
- `app.renderer.viewport.size().safeArea` is read from four CSS custom properties on the page, `--moku-safe-top`, `--moku-safe-right`, `--moku-safe-bottom`, `--moku-safe-left`, each falling back to `env(safe-area-inset-*, 0px)`. Any CSS length works (`max()`, `calc()`, `env()`); a negative one counts as 0. A change of a property or of the page's insets, and the window event `moku-native:insets`, is laid out at the next frame. There is no `setInsets`: set the properties, e.g. `:root { --moku-safe-top: max(env(safe-area-inset-top, 0px), 24px); }`.
|
|
546
547
|
|
|
@@ -549,7 +550,7 @@ The graph. Modules `runner`, `gate`, `inbox`, `fx`, `features`. Runner methods s
|
|
|
549
550
|
A screen is a projection whose `view` returns JSX. The game's `tsconfig.json` sets `"jsx": "react-jsx"` and `"jsxImportSource": "@moku-labs/game"`; screens are `.tsx` files. There is no DOM and no React.
|
|
550
551
|
|
|
551
552
|
- Tags: `screen`, `layer`, `row`, `column`, `stack`, `spacer`, `panel` (swallows taps), `image` (`texture`, `fit?: "contain" | "cover" | "fill"`), `icon` (`name`, `fit?`), `text` (`content: string | Message`, or `bind={bind(Counter, "value")}` with `components={[Counter({ value })]}`; formats `int`, `mm:ss`, `h:mm:ss`, `duration`; `Countdown({ until })` with `bind(Countdown, "left", { format: "mm:ss" })` counts down to a `clock` moment; `style` is a text style key), `button` (`intent` + `payload`, or `local`, never both), `scroll` (`axis?: "x" | "y"` (`"y"`), fixed at spawn, another one later warns `ui:scroll-axis-fixed`; children for a short list, laid out as a column on `y` and a row on `x`, or the windowed form `rows`, `rowHeight`, `overscan?` (5), `row: index => node`, on `y` only: `axis: "x"` with `rows` throws `[game] A windowed scroll moves on y only.`; row state belongs in the model, a row that leaves the window loses its local state; `snap?: number[]` stops in offsets, kept inside `0..max`: a release glides to the stop nearest `offset + v × 260` (v in units a ms) on `1 − (1 − p)³` over `min(620, 260 + distance × 1.1)` ms; without `snap` a release flings, `v ×= 0.998` a ms until under 0.02, 0 when the finger rested over 50 ms; `offset?: number` (0) where it stands from the start, drawn there in its first frame, a new value glides there, the same value does nothing; hard edges, nothing passes on to a parent scroll; a press on a child that leaves the tap slop along the scroll's axis goes to the scroll and the child answers nothing, a finger on a moving scroll only stops it; every number in `time.delta` ms, so a time scale applies; the public component `ScrollState { offset, max, moving }` on its entity, whole units `0..max`, written when it changes and once with `moving: false` when it stops, read by a system and by `game.explain`; `app.ui.scroll(key, to)` and the visual step `{ scroll: { key, to } }` set it at once), `input` (a text field; its text lives in the component's `local`, see the ui README). Common props: `key`, `style`, `state: { active?, disabled?, selected? }`, `motion`, `components` (extra component values for the element's entity, such as a filter: `components={[Glow({ strength: 2 })]}`, or `DebugTrigger()`: five taps within 3000 ms of wall time on that view call `app.debug.overlay.open()` on a page with the agent flag, nothing elsewhere; put it on a `button` naming nothing); containers take `hosts?: string[]` (projections drawn inside the element: world views hang under it from the slot's first frame; a JSX projection is laid out in the slot's content box). Children draw and are hit in markup order at equal `zIndex`; the roots of a scene draw in the order of its `projections` (the `ui` layer sorts by `Order`; `ui: { sort: "none" }` keeps insertion order). `defineMotion({ when: "change" })` plays its `enter` and `exit` only for a commit or a popup, never when its screen mounts or unmounts; declare a motion at module level (`ui:motion-rebuilt` names a loop rebuilt in a view). Style adds `nineSlice`, `tint`, `offsetX`, `offsetY`, `scale`, `origin`, `fit: "contain"`; state variants `is: { hover, pressed, disabled, active, selected, covered }`. `popup(Component, props, { over })` stacks a popup over a kept one.
|
|
552
|
-
- Style vocabulary (`defineStyle`, plain data): flow `direction`, `wrap`, `justify`, `align`, `alignSelf`, `gap`, `grow`, `shrink`; box `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `aspect`, `overflow`; position `position`, `left`, `top`, `right`, `bottom`, `reason`; visual `fill`, `stroke`, `strokeWidth`, `radius`, `alpha`; variants `is: { pressed?, disabled?, active?, selected? }` and `when: { portrait?, landscape?, tall?, wide? }`, each a partial style merged in when the flag holds. Lengths are reference units or `"safeArea.top" | "safeArea.right" | "safeArea.bottom" | "safeArea.left"`. No font size here: it comes from the text style.
|
|
553
|
+
- Style vocabulary (`defineStyle`, plain data): flow `direction`, `wrap`, `justify`, `align`, `alignSelf`, `gap`, `grow`, `shrink`; box `padding`, `margin`, `width`, `height`, `minWidth`, `minHeight`, `maxWidth`, `maxHeight`, `aspect`, `overflow`; position `position`, `left`, `top`, `right`, `bottom`, `reason`; visual `fill`, `stroke`, `strokeWidth`, `radius`, `alpha`, `shape: "rect" | "triangle" | "arc"` (`"rect"`; a triangle fills the box pointing right; an arc is only a `stroke` of `strokeWidth` on the circle inscribed in the box, `min(width, height) − strokeWidth` across, from 12 o'clock clockwise over `sweep`), `dash` (dash length of the stroke, gaps of half a dash; not on an arc), `sweep` (0..1, default 1, clamped; 0 draws nothing, 1 a closed ring), `cap: "round" | "butt"` (`"round"`; the ends of an open arc); variants `is: { pressed?, disabled?, active?, selected? }` and `when: { portrait?, landscape?, tall?, wide? }`, each a partial style merged in when the flag holds. Lengths are reference units or `"safeArea.top" | "safeArea.right" | "safeArea.bottom" | "safeArea.left"`. No font size here: it comes from the text style.
|
|
553
554
|
- `defineComponent(name, { local?, outcomes?, view(props, local) })`. A component with `outcomes` is a popup: `await fx(popup(Component, props))` opens the gate for its outcomes and resolves with `{ intent, payload }` of the pressed button. A button with `local` writes into the nearest component instance; it never reaches the graph.
|
|
554
555
|
- `tr(key, params?)` returns a frozen `Message` `{ key, params }`; no locale is read at the call site. Strings live in `strings/<locale>.json` of any feature or sub-feature, as ICU MessageFormat 1 (`{n, plural, one {# order} other {# orders}}`, `select`, `selectordinal`, `number`, `date`, `time`; no skeletons, no `currency`). `bun run assets:keys` compiles them. The keys of the top-level features and the layers go into `generated/strings.<locale>.ts`, which one feature registers; a sub-feature's keys start with `<name>.` (`ep01.title`) and go into `generated/strings.<name>.<locale>.ts`, which the sub-feature registers lazily, `strings: { en: () => import("@generated/strings.ep01.en"), ru: () => import("@generated/strings.ep01.ru") }`. With `assets` composed those modules load and unload with the bundle named like the sub-feature: every way the bundle comes (a node entry, a scene's `bundles`, `load`, a restore, the `safeNode`) brings its strings, a locale switch brings them in the new locale, and while the bundle is not loaded a key of it gives `⟦key⟧` and `has(key)` is false. A compiled module calls the root helpers `messageArgument(value, intl)` (an element stays an element part, a list goes through `Intl.ListFormat`, a number through `Intl.NumberFormat`, else text) and `messageDuration(ms)` (`95_000` gives `{ minutes: 1, seconds: 35 }`). `app.i18n`: `locale()`, `setLocale(locale)` (async, emits `i18n:locale-changed`), `format(message, locale?)` returns `Part[]`, `plain(message)` returns a string, `has(key)`, `isKey(value)`, `locales()`, `replace(locale, messages)` (dev hot swap of a generated strings file). Config: `locale: "en"`, `fallback: "en"`, `locales: {}`.
|
|
555
556
|
- Keys that come from data: `I18n.TextKey<Strings>` is the keys of the generated `Strings` without parameters (nothing new is generated). A data table types its keys `TextKey` or builds them with the kit's `key("board.hint.red")`; the kit's `tr` never takes a plain `string`. A key read back from a save is checked where the app is (an effect handler, app or page code, loading a save) with one `isKey(value)`: `defineGameApp({ ..., strings: type<Strings>() })` types the game's `app.i18n`, so a true `app.i18n.isKey(value)` narrows the value to `TextKey`; `ctx.require(i18nPlugin).isKey(value)` in a plugin narrows to `string`. `app.i18n.isKey(value)` answers true for a key of the loaded tables of the current locale or the fallback, and for the `<feature>.` prefix of a sub-feature whose strings are not loaded yet; a key that takes parameters answers true too.
|