@almadar/ui 6.1.0 → 6.3.0
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/avl/index.cjs +27 -7
- package/dist/avl/index.d.cts +3 -3
- package/dist/avl/index.d.ts +3 -3
- package/dist/avl/index.js +27 -7
- package/dist/{avl-schema-parser-C6Yz2MuW.d.cts → avl-schema-parser-Bt4NzAam.d.cts} +3 -3
- package/dist/{avl-schema-parser-BKbH_SFt.d.ts → avl-schema-parser-dvJKXn-o.d.ts} +3 -3
- package/dist/components/index.cjs +27 -7
- package/dist/components/index.d.cts +31 -27
- package/dist/components/index.d.ts +31 -27
- package/dist/components/index.js +27 -7
- package/dist/lib/drawable/three/index.cjs +4 -3
- package/dist/lib/drawable/three/index.d.cts +2 -2
- package/dist/lib/drawable/three/index.d.ts +2 -2
- package/dist/lib/drawable/three/index.js +4 -3
- package/dist/providers/index.cjs +27 -7
- package/dist/providers/index.js +27 -7
- package/dist/runtime/index.cjs +27 -7
- package/dist/runtime/index.js +27 -7
- package/package.json +5 -5
package/dist/avl/index.cjs
CHANGED
|
@@ -7142,9 +7142,16 @@ var init_Input = __esm({
|
|
|
7142
7142
|
}
|
|
7143
7143
|
};
|
|
7144
7144
|
const handleKeyDown = (e) => {
|
|
7145
|
-
if (action
|
|
7146
|
-
|
|
7145
|
+
if (!action || e.key !== "Enter") return;
|
|
7146
|
+
const raw = e.currentTarget.value;
|
|
7147
|
+
if (type === "number") {
|
|
7148
|
+
if (raw.trim() === "") return;
|
|
7149
|
+
const numeric = Number(raw);
|
|
7150
|
+
if (Number.isNaN(numeric)) return;
|
|
7151
|
+
eventBus.emit(`UI:${action}`, { value: numeric });
|
|
7152
|
+
return;
|
|
7147
7153
|
}
|
|
7154
|
+
eventBus.emit(`UI:${action}`, { value: raw });
|
|
7148
7155
|
};
|
|
7149
7156
|
const wrapField = (field, fullWidth = true) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: fullWidth ? "w-full" : "w-fit", children: [
|
|
7150
7157
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
|
|
@@ -7327,6 +7334,7 @@ function NativeSelect({
|
|
|
7327
7334
|
error,
|
|
7328
7335
|
onChange,
|
|
7329
7336
|
onValueChange,
|
|
7337
|
+
action,
|
|
7330
7338
|
value,
|
|
7331
7339
|
...props
|
|
7332
7340
|
}) {
|
|
@@ -7338,6 +7346,9 @@ function NativeSelect({
|
|
|
7338
7346
|
onChange?.(e);
|
|
7339
7347
|
}
|
|
7340
7348
|
dispatchValueChange(onValueChange, eventBus, e.target.value);
|
|
7349
|
+
if (action) {
|
|
7350
|
+
eventBus.emit(`UI:${action}`, { value: e.target.value });
|
|
7351
|
+
}
|
|
7341
7352
|
};
|
|
7342
7353
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
7343
7354
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -7373,6 +7384,7 @@ function RichSelect({
|
|
|
7373
7384
|
error,
|
|
7374
7385
|
onChange,
|
|
7375
7386
|
onValueChange,
|
|
7387
|
+
action,
|
|
7376
7388
|
value,
|
|
7377
7389
|
multiple,
|
|
7378
7390
|
searchable,
|
|
@@ -7398,6 +7410,9 @@ function RichSelect({
|
|
|
7398
7410
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7399
7411
|
}
|
|
7400
7412
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
7413
|
+
if (action) {
|
|
7414
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
7415
|
+
}
|
|
7401
7416
|
};
|
|
7402
7417
|
const clear = (e) => {
|
|
7403
7418
|
e.stopPropagation();
|
|
@@ -7406,6 +7421,9 @@ function RichSelect({
|
|
|
7406
7421
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7407
7422
|
}
|
|
7408
7423
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
7424
|
+
if (action) {
|
|
7425
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
7426
|
+
}
|
|
7409
7427
|
};
|
|
7410
7428
|
React94.useEffect(() => {
|
|
7411
7429
|
const handler = (e) => {
|
|
@@ -13613,7 +13631,7 @@ function proceduralShapes(view, pos, fade, progress) {
|
|
|
13613
13631
|
}
|
|
13614
13632
|
}
|
|
13615
13633
|
}
|
|
13616
|
-
function expandFxItem(view, node, epochNowMs, dim) {
|
|
13634
|
+
function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
13617
13635
|
if (view.space === "screen") return [];
|
|
13618
13636
|
const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
|
|
13619
13637
|
const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
|
|
@@ -13649,24 +13667,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
|
|
|
13649
13667
|
out.push(...proceduralShapes(view, pos, fade, progress));
|
|
13650
13668
|
}
|
|
13651
13669
|
if (view.message) {
|
|
13670
|
+
const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
|
|
13652
13671
|
const text = {
|
|
13653
13672
|
type: "draw-text",
|
|
13654
13673
|
text: view.message,
|
|
13655
13674
|
position: pos,
|
|
13656
13675
|
offsetY: -(0.15 + 0.55 * progress),
|
|
13657
13676
|
color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
|
|
13658
|
-
opacity: fade
|
|
13677
|
+
opacity: fade,
|
|
13678
|
+
...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
|
|
13659
13679
|
};
|
|
13660
13680
|
out.push(text);
|
|
13661
13681
|
}
|
|
13662
13682
|
return out;
|
|
13663
13683
|
}
|
|
13664
|
-
function expandFxLayer(node, epochNowMs, dim) {
|
|
13684
|
+
function expandFxLayer(node, epochNowMs, dim, projector) {
|
|
13665
13685
|
if (!Array.isArray(node.items)) return [];
|
|
13666
13686
|
const out = [];
|
|
13667
13687
|
for (const item of node.items) {
|
|
13668
13688
|
if (!item || typeof item.id !== "string") continue;
|
|
13669
|
-
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
|
|
13689
|
+
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
|
|
13670
13690
|
}
|
|
13671
13691
|
return out;
|
|
13672
13692
|
}
|
|
@@ -13733,7 +13753,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
13733
13753
|
break;
|
|
13734
13754
|
case "draw-fx-layer": {
|
|
13735
13755
|
const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
|
|
13736
|
-
for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
|
|
13756
|
+
for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
|
|
13737
13757
|
break;
|
|
13738
13758
|
}
|
|
13739
13759
|
}
|
package/dist/avl/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { JsonObject,
|
|
3
|
+
import { JsonObject, SExpr, OrbitalSchema, Expression, UISlot, EntityData, EditFocus, EventPayload, ThemeDefinition } from '@almadar/core';
|
|
4
4
|
import { Node, Edge, NodeProps, EdgeProps } from '@xyflow/react';
|
|
5
5
|
import { AnyPatternConfig } from '@almadar/core/patterns';
|
|
6
6
|
import { useDraggable } from '@dnd-kit/core';
|
|
@@ -457,7 +457,7 @@ declare function curveControlPoint(x1: number, y1: number, x2: number, y2: numbe
|
|
|
457
457
|
|
|
458
458
|
interface SerializedEffect extends JsonObject {
|
|
459
459
|
type: string;
|
|
460
|
-
args:
|
|
460
|
+
args: SExpr[];
|
|
461
461
|
}
|
|
462
462
|
interface ApplicationOrbitalData {
|
|
463
463
|
name: string;
|
|
@@ -526,7 +526,7 @@ interface TraitTransitionInfo extends JsonObject {
|
|
|
526
526
|
from: string;
|
|
527
527
|
to: string;
|
|
528
528
|
event: string;
|
|
529
|
-
guard:
|
|
529
|
+
guard: SExpr | null;
|
|
530
530
|
effects: SerializedEffect[];
|
|
531
531
|
index: number;
|
|
532
532
|
}
|
package/dist/avl/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import { JsonObject,
|
|
3
|
+
import { JsonObject, SExpr, OrbitalSchema, Expression, UISlot, EntityData, EditFocus, EventPayload, ThemeDefinition } from '@almadar/core';
|
|
4
4
|
import { Node, Edge, NodeProps, EdgeProps } from '@xyflow/react';
|
|
5
5
|
import { AnyPatternConfig } from '@almadar/core/patterns';
|
|
6
6
|
import { useDraggable } from '@dnd-kit/core';
|
|
@@ -457,7 +457,7 @@ declare function curveControlPoint(x1: number, y1: number, x2: number, y2: numbe
|
|
|
457
457
|
|
|
458
458
|
interface SerializedEffect extends JsonObject {
|
|
459
459
|
type: string;
|
|
460
|
-
args:
|
|
460
|
+
args: SExpr[];
|
|
461
461
|
}
|
|
462
462
|
interface ApplicationOrbitalData {
|
|
463
463
|
name: string;
|
|
@@ -526,7 +526,7 @@ interface TraitTransitionInfo extends JsonObject {
|
|
|
526
526
|
from: string;
|
|
527
527
|
to: string;
|
|
528
528
|
event: string;
|
|
529
|
-
guard:
|
|
529
|
+
guard: SExpr | null;
|
|
530
530
|
effects: SerializedEffect[];
|
|
531
531
|
index: number;
|
|
532
532
|
}
|
package/dist/avl/index.js
CHANGED
|
@@ -7066,9 +7066,16 @@ var init_Input = __esm({
|
|
|
7066
7066
|
}
|
|
7067
7067
|
};
|
|
7068
7068
|
const handleKeyDown = (e) => {
|
|
7069
|
-
if (action
|
|
7070
|
-
|
|
7069
|
+
if (!action || e.key !== "Enter") return;
|
|
7070
|
+
const raw = e.currentTarget.value;
|
|
7071
|
+
if (type === "number") {
|
|
7072
|
+
if (raw.trim() === "") return;
|
|
7073
|
+
const numeric = Number(raw);
|
|
7074
|
+
if (Number.isNaN(numeric)) return;
|
|
7075
|
+
eventBus.emit(`UI:${action}`, { value: numeric });
|
|
7076
|
+
return;
|
|
7071
7077
|
}
|
|
7078
|
+
eventBus.emit(`UI:${action}`, { value: raw });
|
|
7072
7079
|
};
|
|
7073
7080
|
const wrapField = (field, fullWidth = true) => /* @__PURE__ */ jsxs("div", { className: fullWidth ? "w-full" : "w-fit", children: [
|
|
7074
7081
|
label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
|
|
@@ -7251,6 +7258,7 @@ function NativeSelect({
|
|
|
7251
7258
|
error,
|
|
7252
7259
|
onChange,
|
|
7253
7260
|
onValueChange,
|
|
7261
|
+
action,
|
|
7254
7262
|
value,
|
|
7255
7263
|
...props
|
|
7256
7264
|
}) {
|
|
@@ -7262,6 +7270,9 @@ function NativeSelect({
|
|
|
7262
7270
|
onChange?.(e);
|
|
7263
7271
|
}
|
|
7264
7272
|
dispatchValueChange(onValueChange, eventBus, e.target.value);
|
|
7273
|
+
if (action) {
|
|
7274
|
+
eventBus.emit(`UI:${action}`, { value: e.target.value });
|
|
7275
|
+
}
|
|
7265
7276
|
};
|
|
7266
7277
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
7267
7278
|
/* @__PURE__ */ jsxs(
|
|
@@ -7297,6 +7308,7 @@ function RichSelect({
|
|
|
7297
7308
|
error,
|
|
7298
7309
|
onChange,
|
|
7299
7310
|
onValueChange,
|
|
7311
|
+
action,
|
|
7300
7312
|
value,
|
|
7301
7313
|
multiple,
|
|
7302
7314
|
searchable,
|
|
@@ -7322,6 +7334,9 @@ function RichSelect({
|
|
|
7322
7334
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7323
7335
|
}
|
|
7324
7336
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
7337
|
+
if (action) {
|
|
7338
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
7339
|
+
}
|
|
7325
7340
|
};
|
|
7326
7341
|
const clear = (e) => {
|
|
7327
7342
|
e.stopPropagation();
|
|
@@ -7330,6 +7345,9 @@ function RichSelect({
|
|
|
7330
7345
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
7331
7346
|
}
|
|
7332
7347
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
7348
|
+
if (action) {
|
|
7349
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
7350
|
+
}
|
|
7333
7351
|
};
|
|
7334
7352
|
useEffect(() => {
|
|
7335
7353
|
const handler = (e) => {
|
|
@@ -13537,7 +13555,7 @@ function proceduralShapes(view, pos, fade, progress) {
|
|
|
13537
13555
|
}
|
|
13538
13556
|
}
|
|
13539
13557
|
}
|
|
13540
|
-
function expandFxItem(view, node, epochNowMs, dim) {
|
|
13558
|
+
function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
13541
13559
|
if (view.space === "screen") return [];
|
|
13542
13560
|
const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
|
|
13543
13561
|
const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
|
|
@@ -13573,24 +13591,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
|
|
|
13573
13591
|
out.push(...proceduralShapes(view, pos, fade, progress));
|
|
13574
13592
|
}
|
|
13575
13593
|
if (view.message) {
|
|
13594
|
+
const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
|
|
13576
13595
|
const text = {
|
|
13577
13596
|
type: "draw-text",
|
|
13578
13597
|
text: view.message,
|
|
13579
13598
|
position: pos,
|
|
13580
13599
|
offsetY: -(0.15 + 0.55 * progress),
|
|
13581
13600
|
color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
|
|
13582
|
-
opacity: fade
|
|
13601
|
+
opacity: fade,
|
|
13602
|
+
...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
|
|
13583
13603
|
};
|
|
13584
13604
|
out.push(text);
|
|
13585
13605
|
}
|
|
13586
13606
|
return out;
|
|
13587
13607
|
}
|
|
13588
|
-
function expandFxLayer(node, epochNowMs, dim) {
|
|
13608
|
+
function expandFxLayer(node, epochNowMs, dim, projector) {
|
|
13589
13609
|
if (!Array.isArray(node.items)) return [];
|
|
13590
13610
|
const out = [];
|
|
13591
13611
|
for (const item of node.items) {
|
|
13592
13612
|
if (!item || typeof item.id !== "string") continue;
|
|
13593
|
-
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
|
|
13613
|
+
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
|
|
13594
13614
|
}
|
|
13595
13615
|
return out;
|
|
13596
13616
|
}
|
|
@@ -13657,7 +13677,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
13657
13677
|
break;
|
|
13658
13678
|
case "draw-fx-layer": {
|
|
13659
13679
|
const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
|
|
13660
|
-
for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
|
|
13680
|
+
for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
|
|
13661
13681
|
break;
|
|
13662
13682
|
}
|
|
13663
13683
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject,
|
|
1
|
+
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject, SExpr } from '@almadar/core';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { D as DrawableNode } from './paintDispatch-D3R8NNmV.cjs';
|
|
@@ -541,7 +541,7 @@ declare const Canvas3DHost: React__default.ForwardRefExoticComponent<Canvas3DHos
|
|
|
541
541
|
|
|
542
542
|
interface SerializedEffect extends JsonObject {
|
|
543
543
|
type: string;
|
|
544
|
-
args:
|
|
544
|
+
args: SExpr[];
|
|
545
545
|
}
|
|
546
546
|
interface ApplicationOrbitalData {
|
|
547
547
|
name: string;
|
|
@@ -610,7 +610,7 @@ interface TraitTransitionInfo extends JsonObject {
|
|
|
610
610
|
from: string;
|
|
611
611
|
to: string;
|
|
612
612
|
event: string;
|
|
613
|
-
guard:
|
|
613
|
+
guard: SExpr | null;
|
|
614
614
|
effects: SerializedEffect[];
|
|
615
615
|
index: number;
|
|
616
616
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject,
|
|
1
|
+
import { AnimationName, Asset, ScenePos, EventEmit, JsonObject, SExpr } from '@almadar/core';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
import { D as DrawableNode } from './paintDispatch-B5ObLnUv.js';
|
|
@@ -541,7 +541,7 @@ declare const Canvas3DHost: React__default.ForwardRefExoticComponent<Canvas3DHos
|
|
|
541
541
|
|
|
542
542
|
interface SerializedEffect extends JsonObject {
|
|
543
543
|
type: string;
|
|
544
|
-
args:
|
|
544
|
+
args: SExpr[];
|
|
545
545
|
}
|
|
546
546
|
interface ApplicationOrbitalData {
|
|
547
547
|
name: string;
|
|
@@ -610,7 +610,7 @@ interface TraitTransitionInfo extends JsonObject {
|
|
|
610
610
|
from: string;
|
|
611
611
|
to: string;
|
|
612
612
|
event: string;
|
|
613
|
-
guard:
|
|
613
|
+
guard: SExpr | null;
|
|
614
614
|
effects: SerializedEffect[];
|
|
615
615
|
index: number;
|
|
616
616
|
}
|
|
@@ -1977,9 +1977,16 @@ var init_Input = __esm({
|
|
|
1977
1977
|
}
|
|
1978
1978
|
};
|
|
1979
1979
|
const handleKeyDown = (e) => {
|
|
1980
|
-
if (action
|
|
1981
|
-
|
|
1980
|
+
if (!action || e.key !== "Enter") return;
|
|
1981
|
+
const raw = e.currentTarget.value;
|
|
1982
|
+
if (type === "number") {
|
|
1983
|
+
if (raw.trim() === "") return;
|
|
1984
|
+
const numeric = Number(raw);
|
|
1985
|
+
if (Number.isNaN(numeric)) return;
|
|
1986
|
+
eventBus.emit(`UI:${action}`, { value: numeric });
|
|
1987
|
+
return;
|
|
1982
1988
|
}
|
|
1989
|
+
eventBus.emit(`UI:${action}`, { value: raw });
|
|
1983
1990
|
};
|
|
1984
1991
|
const wrapField = (field, fullWidth = true) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: fullWidth ? "w-full" : "w-fit", children: [
|
|
1985
1992
|
label && /* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-foreground mb-1", children: label }),
|
|
@@ -2162,6 +2169,7 @@ function NativeSelect({
|
|
|
2162
2169
|
error,
|
|
2163
2170
|
onChange,
|
|
2164
2171
|
onValueChange,
|
|
2172
|
+
action,
|
|
2165
2173
|
value,
|
|
2166
2174
|
...props
|
|
2167
2175
|
}) {
|
|
@@ -2173,6 +2181,9 @@ function NativeSelect({
|
|
|
2173
2181
|
onChange?.(e);
|
|
2174
2182
|
}
|
|
2175
2183
|
dispatchValueChange(onValueChange, eventBus, e.target.value);
|
|
2184
|
+
if (action) {
|
|
2185
|
+
eventBus.emit(`UI:${action}`, { value: e.target.value });
|
|
2186
|
+
}
|
|
2176
2187
|
};
|
|
2177
2188
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2178
2189
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2208,6 +2219,7 @@ function RichSelect({
|
|
|
2208
2219
|
error,
|
|
2209
2220
|
onChange,
|
|
2210
2221
|
onValueChange,
|
|
2222
|
+
action,
|
|
2211
2223
|
value,
|
|
2212
2224
|
multiple,
|
|
2213
2225
|
searchable,
|
|
@@ -2233,6 +2245,9 @@ function RichSelect({
|
|
|
2233
2245
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2234
2246
|
}
|
|
2235
2247
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
2248
|
+
if (action) {
|
|
2249
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
2250
|
+
}
|
|
2236
2251
|
};
|
|
2237
2252
|
const clear = (e) => {
|
|
2238
2253
|
e.stopPropagation();
|
|
@@ -2241,6 +2256,9 @@ function RichSelect({
|
|
|
2241
2256
|
eventBus.emit(`UI:${onChange}`, { value: next });
|
|
2242
2257
|
}
|
|
2243
2258
|
dispatchValueChange(onValueChange, eventBus, next);
|
|
2259
|
+
if (action) {
|
|
2260
|
+
eventBus.emit(`UI:${action}`, { value: next });
|
|
2261
|
+
}
|
|
2244
2262
|
};
|
|
2245
2263
|
React77.useEffect(() => {
|
|
2246
2264
|
const handler = (e) => {
|
|
@@ -9678,7 +9696,7 @@ function proceduralShapes(view, pos, fade, progress) {
|
|
|
9678
9696
|
}
|
|
9679
9697
|
}
|
|
9680
9698
|
}
|
|
9681
|
-
function expandFxItem(view, node, epochNowMs, dim) {
|
|
9699
|
+
function expandFxItem(view, node, epochNowMs, dim, projector) {
|
|
9682
9700
|
if (view.space === "screen") return [];
|
|
9683
9701
|
const tickMs = node.tickMs ?? DEFAULT_TICK_MS;
|
|
9684
9702
|
const { ageMs, progress, fade } = fxLifecycle(view, epochNowMs, tickMs);
|
|
@@ -9714,24 +9732,26 @@ function expandFxItem(view, node, epochNowMs, dim) {
|
|
|
9714
9732
|
out.push(...proceduralShapes(view, pos, fade, progress));
|
|
9715
9733
|
}
|
|
9716
9734
|
if (view.message) {
|
|
9735
|
+
const pxSize = projector && view.size !== void 0 ? Math.max(10, Math.round(view.size * projector.tileWidth)) : void 0;
|
|
9717
9736
|
const text = {
|
|
9718
9737
|
type: "draw-text",
|
|
9719
9738
|
text: view.message,
|
|
9720
9739
|
position: pos,
|
|
9721
9740
|
offsetY: -(0.15 + 0.55 * progress),
|
|
9722
9741
|
color: view.color ?? node.textColor ?? DEFAULT_TEXT_COLOR,
|
|
9723
|
-
opacity: fade
|
|
9742
|
+
opacity: fade,
|
|
9743
|
+
...pxSize ? { font: `bold ${pxSize}px system-ui, sans-serif` } : {}
|
|
9724
9744
|
};
|
|
9725
9745
|
out.push(text);
|
|
9726
9746
|
}
|
|
9727
9747
|
return out;
|
|
9728
9748
|
}
|
|
9729
|
-
function expandFxLayer(node, epochNowMs, dim) {
|
|
9749
|
+
function expandFxLayer(node, epochNowMs, dim, projector) {
|
|
9730
9750
|
if (!Array.isArray(node.items)) return [];
|
|
9731
9751
|
const out = [];
|
|
9732
9752
|
for (const item of node.items) {
|
|
9733
9753
|
if (!item || typeof item.id !== "string") continue;
|
|
9734
|
-
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim));
|
|
9754
|
+
out.push(...expandFxItem(resolveFxView(item, node.presets), node, epochNowMs, dim, projector));
|
|
9735
9755
|
}
|
|
9736
9756
|
return out;
|
|
9737
9757
|
}
|
|
@@ -9798,7 +9818,7 @@ function paintDrawable(painter, node, dctx) {
|
|
|
9798
9818
|
break;
|
|
9799
9819
|
case "draw-fx-layer": {
|
|
9800
9820
|
const epochNow = dctx.time > 0 && typeof performance !== "undefined" ? performance.timeOrigin + dctx.time : 0;
|
|
9801
|
-
for (const child of expandFxLayer(node, epochNow, "2d")) paintDrawable(painter, child, dctx);
|
|
9821
|
+
for (const child of expandFxLayer(node, epochNow, "2d", dctx.projector)) paintDrawable(painter, child, dctx);
|
|
9802
9822
|
break;
|
|
9803
9823
|
}
|
|
9804
9824
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { ReactNode, ErrorInfo } from 'react';
|
|
3
|
-
import { Asset, EventKey, EventPayload, EventEmit, AssetUrl,
|
|
3
|
+
import { Asset, EventKey, EventPayload, EventEmit, AssetUrl, FieldValue, EntityRow, EntityRole, AnimationName, SpriteDirection, AnimationDef, ScenePos, Camera, EntityWith, TraitConfigValue, JsonValue, AssetCatalog, JsonObject, EventPayloadValue, DeclaredTraitConfig, TraitConfig, ControlValue, OrbitalSchema, Trait, OrbitalEntity, FormSubmitPayload, UISlot, EditFocus, TraceSubagent, TraceActivity, TraceChatMessage } from '@almadar/core';
|
|
4
4
|
export { AnimationDef, AnimationName, BusEvent, BusEventListener, BusEventSource, BusEventListener as EventListener, SpriteDirection, UISlot, Unsubscribe } from '@almadar/core';
|
|
5
5
|
import { LucideIcon } from 'lucide-react';
|
|
6
6
|
import { C as ColorToken, U as UiError, P as Point, L as LinkAction, I as ImageSource } from '../types-B3nHgnMG.cjs';
|
|
7
7
|
export { R as Rect } from '../types-B3nHgnMG.cjs';
|
|
8
8
|
import { SExpr } from '@almadar/evaluator';
|
|
9
|
-
import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, g as SpriteFrameDims, R as ResolvedFrame, h as CanvasLighting, i as CanvasPost, a as IsometricUnit, j as CameraState, k as FieldInfo, l as OrbitalTraitInfo, m as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-
|
|
10
|
-
export { B as BoardTile, G as GameAction, n as GamePhase, o as GameState, p as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, q as UnitTrait, r as calculateAttackTargets, s as calculateValidMoves, t as createInitialGameState } from '../avl-schema-parser-
|
|
9
|
+
import { U as UnitAnimationState, F as FacingDirection, S as SpriteSheetUrls, g as SpriteFrameDims, R as ResolvedFrame, h as CanvasLighting, i as CanvasPost, a as IsometricUnit, j as CameraState, k as FieldInfo, l as OrbitalTraitInfo, m as OrbitalPageInfo, T as TraitLevelData, E as ExternalLink } from '../avl-schema-parser-Bt4NzAam.cjs';
|
|
10
|
+
export { B as BoardTile, G as GameAction, n as GamePhase, o as GameState, p as GameUnit, b as IsometricFeature, I as IsometricTile, P as Position, q as UnitTrait, r as calculateAttackTargets, s as calculateValidMoves, t as createInitialGameState } from '../avl-schema-parser-Bt4NzAam.cjs';
|
|
11
11
|
import { D as DrawableNode, P as Projector, F as FxOverlayItem, M as MeshShapeKind, a as MeshMaterial, b as DrawGroupProps, c as DrawTextProps, d as DrawMeshProps } from '../paintDispatch-D3R8NNmV.cjs';
|
|
12
12
|
export { e as FxOverlayKind } from '../paintDispatch-D3R8NNmV.cjs';
|
|
13
13
|
export { A as AudioManifest, G as GameAudioContext, a as GameAudioContextValue, e as GameAudioControls, b as GameAudioProvider, c as GameAudioProviderProps, S as SoundEntry, U as UseGameAudioOptions, f as useGameAudio, u as useGameAudioContext } from '../GameAudioProvider-CQAdPreB.cjs';
|
|
@@ -314,9 +314,11 @@ interface InputProps extends Omit<React__default.InputHTMLAttributes<HTMLInputEl
|
|
|
314
314
|
value?: string | number;
|
|
315
315
|
/** Whether input is disabled */
|
|
316
316
|
disabled?: boolean;
|
|
317
|
-
/** Declarative event name for trait dispatch
|
|
317
|
+
/** Declarative event name for trait dispatch.
|
|
318
|
+
* @payloadTypeWhen value inputType=number->number
|
|
319
|
+
*/
|
|
318
320
|
action?: EventEmit<{
|
|
319
|
-
value: string;
|
|
321
|
+
value: string | number;
|
|
320
322
|
}>;
|
|
321
323
|
/**
|
|
322
324
|
* Input type — selects the field's data mode. Use 'password' for masked
|
|
@@ -406,8 +408,10 @@ interface SelectProps extends Omit<React__default.SelectHTMLAttributes<HTMLSelec
|
|
|
406
408
|
placeholder?: string;
|
|
407
409
|
/** Current value (string for single, string[] for multiple) */
|
|
408
410
|
value?: string | string[];
|
|
409
|
-
/** Declarative event name for trait dispatch */
|
|
410
|
-
action?:
|
|
411
|
+
/** Declarative event name for trait dispatch — emits `{ value }` on selection commit (same gestures as `onChange`). */
|
|
412
|
+
action?: EventEmit<{
|
|
413
|
+
value: string | string[];
|
|
414
|
+
}>;
|
|
411
415
|
/** Error message */
|
|
412
416
|
error?: string;
|
|
413
417
|
/** Allow selecting multiple values — activates the rich dropdown. */
|
|
@@ -1360,10 +1364,10 @@ declare const Aside: React__default.ForwardRefExoticComponent<AsideProps & React
|
|
|
1360
1364
|
* Context for conditional evaluation
|
|
1361
1365
|
*/
|
|
1362
1366
|
type ConditionalContext = {
|
|
1363
|
-
formValues:
|
|
1364
|
-
globalVariables:
|
|
1365
|
-
localVariables?:
|
|
1366
|
-
entity?:
|
|
1367
|
+
formValues: Record<string, FieldValue>;
|
|
1368
|
+
globalVariables: Record<string, FieldValue>;
|
|
1369
|
+
localVariables?: Record<string, FieldValue>;
|
|
1370
|
+
entity?: Record<string, FieldValue>;
|
|
1367
1371
|
};
|
|
1368
1372
|
interface ConditionalWrapperProps {
|
|
1369
1373
|
/** The S-expression condition to evaluate */
|
|
@@ -10031,38 +10035,38 @@ interface WizardField {
|
|
|
10031
10035
|
label: string;
|
|
10032
10036
|
isDefault?: boolean;
|
|
10033
10037
|
}>;
|
|
10034
|
-
defaultValue?:
|
|
10035
|
-
condition?:
|
|
10038
|
+
defaultValue?: ControlValue;
|
|
10039
|
+
condition?: SExpr;
|
|
10036
10040
|
placeholder?: string;
|
|
10037
10041
|
entityField?: string;
|
|
10038
10042
|
minLength?: number;
|
|
10039
10043
|
maxLength?: number;
|
|
10040
|
-
dataSource?:
|
|
10044
|
+
dataSource?: Record<string, FieldValue>;
|
|
10041
10045
|
displayFields?: string[];
|
|
10042
|
-
searchConfig?:
|
|
10046
|
+
searchConfig?: Record<string, FieldValue>;
|
|
10043
10047
|
hiddenCalculations?: Array<{
|
|
10044
10048
|
variable: string;
|
|
10045
10049
|
expression: string;
|
|
10046
10050
|
scope?: string;
|
|
10047
10051
|
}>;
|
|
10048
|
-
signatureConfig?:
|
|
10049
|
-
displayTemplate?:
|
|
10050
|
-
lawReference?:
|
|
10052
|
+
signatureConfig?: Record<string, FieldValue>;
|
|
10053
|
+
displayTemplate?: Record<string, FieldValue>;
|
|
10054
|
+
lawReference?: Record<string, FieldValue>;
|
|
10051
10055
|
contextMenu?: string[];
|
|
10052
|
-
calculated?:
|
|
10056
|
+
calculated?: Record<string, FieldValue>;
|
|
10053
10057
|
readOnly?: boolean;
|
|
10054
|
-
minDate?:
|
|
10058
|
+
minDate?: string;
|
|
10055
10059
|
stats?: Array<{
|
|
10056
10060
|
label: string;
|
|
10057
|
-
value:
|
|
10061
|
+
value: ControlValue;
|
|
10058
10062
|
icon?: string;
|
|
10059
10063
|
}>;
|
|
10060
10064
|
items?: Array<{
|
|
10061
10065
|
id: string;
|
|
10062
10066
|
label: string;
|
|
10063
|
-
autoCheck?:
|
|
10067
|
+
autoCheck?: boolean;
|
|
10064
10068
|
}>;
|
|
10065
|
-
[key: string]: JsonValue | undefined;
|
|
10069
|
+
[key: string]: JsonValue | SExpr | ControlValue | Record<string, FieldValue> | undefined;
|
|
10066
10070
|
}
|
|
10067
10071
|
/** Section within a wizard step */
|
|
10068
10072
|
interface WizardSection {
|
|
@@ -10071,7 +10075,7 @@ interface WizardSection {
|
|
|
10071
10075
|
description?: string;
|
|
10072
10076
|
fields?: WizardField[];
|
|
10073
10077
|
subsections?: WizardSection[];
|
|
10074
|
-
condition?:
|
|
10078
|
+
condition?: SExpr;
|
|
10075
10079
|
repeatable?: boolean;
|
|
10076
10080
|
minItems?: number;
|
|
10077
10081
|
addButtonLabel?: string;
|
|
@@ -10080,9 +10084,9 @@ interface WizardSection {
|
|
|
10080
10084
|
expression: string;
|
|
10081
10085
|
scope?: string;
|
|
10082
10086
|
}>;
|
|
10083
|
-
dataSource?:
|
|
10087
|
+
dataSource?: Record<string, FieldValue>;
|
|
10084
10088
|
readOnly?: boolean;
|
|
10085
|
-
[key: string]: JsonValue | WizardField[] | WizardSection[] | undefined;
|
|
10089
|
+
[key: string]: JsonValue | SExpr | Record<string, FieldValue> | WizardField[] | WizardSection[] | undefined;
|
|
10086
10090
|
}
|
|
10087
10091
|
/** Entity mapping configuration */
|
|
10088
10092
|
interface WizardEntityMapping {
|
|
@@ -10094,7 +10098,7 @@ interface WizardEntityMapping {
|
|
|
10094
10098
|
}
|
|
10095
10099
|
/** Validation rule for wizard steps */
|
|
10096
10100
|
interface WizardValidationRule {
|
|
10097
|
-
condition:
|
|
10101
|
+
condition: SExpr;
|
|
10098
10102
|
message: string;
|
|
10099
10103
|
}
|
|
10100
10104
|
/** Law reference for compliance */
|