@almadar/ui 2.43.0 → 2.46.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 +1986 -1330
- package/dist/avl/index.d.cts +196 -3
- package/dist/avl/index.d.ts +3 -0
- package/dist/avl/index.js +966 -313
- package/dist/components/index.cjs +402 -115
- package/dist/components/index.js +402 -115
- package/dist/components/molecules/avl/BehaviorComposeNode.d.ts +13 -0
- package/dist/components/molecules/avl/avl-behavior-compose-converter.d.ts +53 -0
- package/dist/components/molecules/avl/avl-behavior-compose-types.d.ts +100 -0
- package/dist/components/molecules/avl/avl-preview-converter.d.ts +3 -1
- package/dist/components/molecules/avl/avl-preview-types.d.ts +8 -0
- package/dist/components/molecules/avl/index.d.ts +3 -0
- package/dist/components/molecules/avl/wire-validation.d.ts +30 -0
- package/dist/components/organisms/avl/FlowCanvas.d.ts +19 -0
- package/dist/components/organisms/debug/WalkMinimap.d.ts +17 -0
- package/dist/providers/index.cjs +165 -164
- package/dist/providers/index.js +41 -40
- package/dist/runtime/EntitySchemaContext.d.ts +5 -0
- package/dist/runtime/index.cjs +402 -115
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +402 -116
- package/package.json +1 -1
package/dist/runtime/index.cjs
CHANGED
|
@@ -779,6 +779,9 @@ function useEntityDefinition(entityName) {
|
|
|
779
779
|
const { entities } = useEntitySchema();
|
|
780
780
|
return entities.get(entityName);
|
|
781
781
|
}
|
|
782
|
+
function useEntitySchemaOptional() {
|
|
783
|
+
return React117.useContext(EntitySchemaContext);
|
|
784
|
+
}
|
|
782
785
|
|
|
783
786
|
// lib/traitRegistry.ts
|
|
784
787
|
var traits = /* @__PURE__ */ new Map();
|
|
@@ -5580,9 +5583,9 @@ var shapeMap = {
|
|
|
5580
5583
|
square: "rounded-md"
|
|
5581
5584
|
};
|
|
5582
5585
|
var variantMap = {
|
|
5583
|
-
primary: "bg-blue-600 text-
|
|
5584
|
-
secondary: "bg-
|
|
5585
|
-
ghost: "bg-transparent text-
|
|
5586
|
+
primary: "bg-blue-600 text-[var(--color-foreground)] border-blue-400 hover:bg-blue-500",
|
|
5587
|
+
secondary: "bg-[var(--color-surface,#374151)] text-[var(--color-foreground)] border-gray-500 hover:bg-gray-600",
|
|
5588
|
+
ghost: "bg-transparent text-[var(--color-foreground)] border-white/30 hover:bg-white/10"
|
|
5586
5589
|
};
|
|
5587
5590
|
function ControlButton({
|
|
5588
5591
|
label,
|
|
@@ -5811,11 +5814,11 @@ function TimerDisplay({
|
|
|
5811
5814
|
{
|
|
5812
5815
|
className: cn(
|
|
5813
5816
|
"inline-flex items-center justify-center rounded-lg",
|
|
5814
|
-
"bg-
|
|
5817
|
+
"bg-[var(--color-card)]/80 border border-gray-600 font-mono font-bold tabular-nums",
|
|
5815
5818
|
sizeMap4[size],
|
|
5816
5819
|
running && "border-green-500/50",
|
|
5817
5820
|
isLow && "text-red-400 border-red-500/50 animate-pulse",
|
|
5818
|
-
!isLow && "text-
|
|
5821
|
+
!isLow && "text-[var(--color-foreground)]",
|
|
5819
5822
|
className
|
|
5820
5823
|
),
|
|
5821
5824
|
children: formatTime(seconds, format)
|
|
@@ -5843,7 +5846,7 @@ function ResourceCounter({
|
|
|
5843
5846
|
{
|
|
5844
5847
|
className: cn(
|
|
5845
5848
|
"inline-flex items-center rounded-md",
|
|
5846
|
-
"bg-
|
|
5849
|
+
"bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
|
|
5847
5850
|
sizes.wrapper,
|
|
5848
5851
|
className
|
|
5849
5852
|
),
|
|
@@ -5902,9 +5905,9 @@ function ItemSlot({
|
|
|
5902
5905
|
title: label,
|
|
5903
5906
|
className: cn(
|
|
5904
5907
|
"relative flex items-center justify-center rounded-lg border-2",
|
|
5905
|
-
"bg-
|
|
5908
|
+
"bg-[var(--color-card)]/80 transition-all duration-150",
|
|
5906
5909
|
sizeMap6[size],
|
|
5907
|
-
empty ? "border-gray-700 bg-
|
|
5910
|
+
empty ? "border-gray-700 bg-[var(--color-card)]/50" : rarityBorderMap[rarity],
|
|
5908
5911
|
!empty && rarityGlowMap[rarity],
|
|
5909
5912
|
selected && "ring-2 ring-white ring-offset-1 ring-offset-gray-900",
|
|
5910
5913
|
isClickable && !empty && "hover:brightness-125 cursor-pointer",
|
|
@@ -5920,7 +5923,7 @@ function ItemSlot({
|
|
|
5920
5923
|
className: cn(
|
|
5921
5924
|
"absolute -bottom-1 -right-1 flex items-center justify-center",
|
|
5922
5925
|
"min-w-[18px] h-[18px] rounded-full px-1",
|
|
5923
|
-
"bg-
|
|
5926
|
+
"bg-[var(--color-surface,#374151)] border border-gray-500 text-[10px] font-bold text-[var(--color-foreground)]"
|
|
5924
5927
|
),
|
|
5925
5928
|
children: quantity
|
|
5926
5929
|
}
|
|
@@ -5949,7 +5952,7 @@ function TurnIndicator({
|
|
|
5949
5952
|
{
|
|
5950
5953
|
className: cn(
|
|
5951
5954
|
"inline-flex items-center rounded-lg",
|
|
5952
|
-
"bg-
|
|
5955
|
+
"bg-[var(--color-card)]/80 border border-gray-600 font-medium text-[var(--color-foreground)]",
|
|
5953
5956
|
sizes.wrapper,
|
|
5954
5957
|
className
|
|
5955
5958
|
),
|
|
@@ -5985,7 +5988,7 @@ function getComboIntensity(combo) {
|
|
|
5985
5988
|
if (combo >= 10) return "text-red-400 animate-pulse";
|
|
5986
5989
|
if (combo >= 7) return "text-orange-400";
|
|
5987
5990
|
if (combo >= 4) return "text-yellow-400";
|
|
5988
|
-
return "text-
|
|
5991
|
+
return "text-[var(--color-foreground)]";
|
|
5989
5992
|
}
|
|
5990
5993
|
function getComboScale(combo) {
|
|
5991
5994
|
if (combo >= 10) return "scale-110";
|
|
@@ -6006,7 +6009,7 @@ function ComboCounter({
|
|
|
6006
6009
|
{
|
|
6007
6010
|
className: cn(
|
|
6008
6011
|
"inline-flex flex-col items-center justify-center",
|
|
6009
|
-
"rounded-xl bg-
|
|
6012
|
+
"rounded-xl bg-[var(--color-card)]/80 border border-gray-600 px-3 py-1.5",
|
|
6010
6013
|
"transition-transform duration-200",
|
|
6011
6014
|
getComboScale(combo),
|
|
6012
6015
|
className
|
|
@@ -6207,7 +6210,7 @@ function StatusEffect({
|
|
|
6207
6210
|
"span",
|
|
6208
6211
|
{
|
|
6209
6212
|
className: cn(
|
|
6210
|
-
"absolute flex items-center justify-center rounded-full bg-
|
|
6213
|
+
"absolute flex items-center justify-center rounded-full bg-[var(--color-card)] text-[var(--color-foreground)] font-bold leading-none",
|
|
6211
6214
|
sizes.badge
|
|
6212
6215
|
),
|
|
6213
6216
|
children: stacks
|
|
@@ -6286,7 +6289,7 @@ function DialogueBubble({
|
|
|
6286
6289
|
) }),
|
|
6287
6290
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
6288
6291
|
speaker && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-yellow-400", children: speaker }),
|
|
6289
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-
|
|
6292
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[var(--color-foreground)] leading-relaxed", children: text })
|
|
6290
6293
|
] })
|
|
6291
6294
|
]
|
|
6292
6295
|
}
|
|
@@ -6310,7 +6313,7 @@ function ChoiceButton({
|
|
|
6310
6313
|
className: cn(
|
|
6311
6314
|
"w-full text-left px-4 py-2.5 rounded-md border transition-all duration-150",
|
|
6312
6315
|
"flex items-center gap-2",
|
|
6313
|
-
selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-
|
|
6316
|
+
selected ? "bg-yellow-500/20 border-yellow-400 text-yellow-300" : "bg-white/5 border-white/10 text-[var(--color-foreground)] hover:bg-white/10 hover:border-white/30",
|
|
6314
6317
|
disabled && "opacity-40 cursor-not-allowed hover:bg-white/5 hover:border-white/10",
|
|
6315
6318
|
className
|
|
6316
6319
|
),
|
|
@@ -6366,7 +6369,7 @@ function ActionButton({
|
|
|
6366
6369
|
disabled: isDisabled,
|
|
6367
6370
|
onClick,
|
|
6368
6371
|
className: cn(
|
|
6369
|
-
"relative inline-flex items-center gap-1.5 rounded-md border font-medium text-
|
|
6372
|
+
"relative inline-flex items-center gap-1.5 rounded-md border font-medium text-[var(--color-foreground)] overflow-hidden transition-colors duration-150",
|
|
6370
6373
|
sizes.button,
|
|
6371
6374
|
variantStyles7[variant],
|
|
6372
6375
|
isDisabled && "opacity-60 cursor-not-allowed",
|
|
@@ -8319,11 +8322,11 @@ var AuthLayout = ({
|
|
|
8319
8322
|
children: [
|
|
8320
8323
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute inset-0 bg-gradient-to-br from-primary-600/90 to-primary-800/90" }),
|
|
8321
8324
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "relative z-10", children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Link, { to: "/", className: "flex items-center gap-3", children: [
|
|
8322
|
-
logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-10 h-10 bg-
|
|
8325
|
+
logo || /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-xl flex items-center justify-center backdrop-blur", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8323
8326
|
Typography,
|
|
8324
8327
|
{
|
|
8325
8328
|
variant: "body1",
|
|
8326
|
-
className: "text-
|
|
8329
|
+
className: "text-[var(--color-foreground)] font-bold text-lg",
|
|
8327
8330
|
children: appName.charAt(0).toUpperCase()
|
|
8328
8331
|
}
|
|
8329
8332
|
) }),
|
|
@@ -8331,7 +8334,7 @@ var AuthLayout = ({
|
|
|
8331
8334
|
Typography,
|
|
8332
8335
|
{
|
|
8333
8336
|
variant: "body1",
|
|
8334
|
-
className: "text-2xl font-bold text-
|
|
8337
|
+
className: "text-2xl font-bold text-[var(--color-foreground)]",
|
|
8335
8338
|
children: appName
|
|
8336
8339
|
}
|
|
8337
8340
|
)
|
|
@@ -8341,7 +8344,7 @@ var AuthLayout = ({
|
|
|
8341
8344
|
Typography,
|
|
8342
8345
|
{
|
|
8343
8346
|
variant: "h1",
|
|
8344
|
-
className: "text-4xl font-bold text-
|
|
8347
|
+
className: "text-4xl font-bold text-[var(--color-foreground)] leading-tight",
|
|
8345
8348
|
children: [
|
|
8346
8349
|
"Welcome to ",
|
|
8347
8350
|
appName
|
|
@@ -8352,27 +8355,27 @@ var AuthLayout = ({
|
|
|
8352
8355
|
Typography,
|
|
8353
8356
|
{
|
|
8354
8357
|
variant: "body1",
|
|
8355
|
-
className: "text-lg text-
|
|
8358
|
+
className: "text-lg text-[var(--color-foreground)]/80 max-w-md",
|
|
8356
8359
|
children: "Sign in to access your dashboard and manage your account."
|
|
8357
8360
|
}
|
|
8358
8361
|
),
|
|
8359
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "mt-12 p-6 bg-
|
|
8362
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "mt-12 p-6 bg-[var(--color-card)]/10 rounded-xl backdrop-blur", children: [
|
|
8360
8363
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8361
8364
|
Typography,
|
|
8362
8365
|
{
|
|
8363
8366
|
variant: "body1",
|
|
8364
|
-
className: "text-
|
|
8367
|
+
className: "text-[var(--color-foreground)]/90 italic",
|
|
8365
8368
|
children: '"This platform has transformed how we work. Highly recommended!"'
|
|
8366
8369
|
}
|
|
8367
8370
|
),
|
|
8368
8371
|
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "mt-4", gap: "sm", align: "center", children: [
|
|
8369
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-10 h-10 bg-
|
|
8372
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-10 h-10 bg-[var(--color-card)]/20 rounded-full" }),
|
|
8370
8373
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", children: [
|
|
8371
8374
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8372
8375
|
Typography,
|
|
8373
8376
|
{
|
|
8374
8377
|
variant: "body1",
|
|
8375
|
-
className: "text-
|
|
8378
|
+
className: "text-[var(--color-foreground)] font-medium",
|
|
8376
8379
|
children: "Jane Doe"
|
|
8377
8380
|
}
|
|
8378
8381
|
),
|
|
@@ -8380,7 +8383,7 @@ var AuthLayout = ({
|
|
|
8380
8383
|
Typography,
|
|
8381
8384
|
{
|
|
8382
8385
|
variant: "body1",
|
|
8383
|
-
className: "text-
|
|
8386
|
+
className: "text-[var(--color-foreground)]/60 text-sm",
|
|
8384
8387
|
children: "CEO, Example Co."
|
|
8385
8388
|
}
|
|
8386
8389
|
)
|
|
@@ -8388,8 +8391,8 @@ var AuthLayout = ({
|
|
|
8388
8391
|
] })
|
|
8389
8392
|
] })
|
|
8390
8393
|
] }) }),
|
|
8391
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-
|
|
8392
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-
|
|
8394
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute -bottom-32 -right-32 w-96 h-96 bg-[var(--color-card)]/5 rounded-full" }),
|
|
8395
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "absolute -top-16 -right-16 w-64 h-64 bg-[var(--color-card)]/5 rounded-full" })
|
|
8393
8396
|
]
|
|
8394
8397
|
}
|
|
8395
8398
|
),
|
|
@@ -8406,7 +8409,7 @@ var AuthLayout = ({
|
|
|
8406
8409
|
Typography,
|
|
8407
8410
|
{
|
|
8408
8411
|
variant: "body1",
|
|
8409
|
-
className: "text-
|
|
8412
|
+
className: "text-[var(--color-foreground)] font-bold text-xl",
|
|
8410
8413
|
children: appName.charAt(0).toUpperCase()
|
|
8411
8414
|
}
|
|
8412
8415
|
) }),
|
|
@@ -9277,7 +9280,7 @@ function IsometricCanvas({
|
|
|
9277
9280
|
className: cn("relative w-full overflow-hidden rounded-lg", className),
|
|
9278
9281
|
style: { height: viewportSize.height },
|
|
9279
9282
|
"data-testid": "game-canvas-empty",
|
|
9280
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center justify-center h-full bg-
|
|
9283
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center justify-center h-full bg-[var(--color-card)] rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
|
|
9281
9284
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "map", size: "xl" }),
|
|
9282
9285
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", className: "text-slate-400", children: t("canvas.emptyMessage") || "No map data loaded" })
|
|
9283
9286
|
] }) })
|
|
@@ -9862,7 +9865,7 @@ var MarkdownContent = React117__namespace.default.memo(
|
|
|
9862
9865
|
"th",
|
|
9863
9866
|
{
|
|
9864
9867
|
...props,
|
|
9865
|
-
className: "border border-gray-300 dark:border-gray-600 bg-
|
|
9868
|
+
className: "border border-gray-300 dark:border-gray-600 bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
9866
9869
|
children
|
|
9867
9870
|
}
|
|
9868
9871
|
);
|
|
@@ -10140,7 +10143,7 @@ var CodeBlock = React117__namespace.default.memo(
|
|
|
10140
10143
|
{
|
|
10141
10144
|
justify: "between",
|
|
10142
10145
|
align: "center",
|
|
10143
|
-
className: "px-3 py-2 bg-
|
|
10146
|
+
className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
|
|
10144
10147
|
children: [
|
|
10145
10148
|
showLanguageBadge && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: language }),
|
|
10146
10149
|
showCopyButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19396,7 +19399,7 @@ var sizeMap17 = {
|
|
|
19396
19399
|
lg: "text-base px-4 py-2"
|
|
19397
19400
|
};
|
|
19398
19401
|
var variantMap2 = {
|
|
19399
|
-
default: "bg-
|
|
19402
|
+
default: "bg-[var(--color-card)]/80 border-gray-700",
|
|
19400
19403
|
primary: "bg-blue-900/80 border-blue-700",
|
|
19401
19404
|
success: "bg-green-900/80 border-green-700",
|
|
19402
19405
|
warning: "bg-yellow-900/80 border-yellow-700",
|
|
@@ -19457,7 +19460,7 @@ function StatBadge({
|
|
|
19457
19460
|
animated: true
|
|
19458
19461
|
}
|
|
19459
19462
|
),
|
|
19460
|
-
format === "text" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-
|
|
19463
|
+
format === "text" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-bold text-[var(--color-foreground)]", children: value })
|
|
19461
19464
|
]
|
|
19462
19465
|
}
|
|
19463
19466
|
);
|
|
@@ -19730,7 +19733,7 @@ function HealthPanel({
|
|
|
19730
19733
|
Box,
|
|
19731
19734
|
{
|
|
19732
19735
|
className: cn(
|
|
19733
|
-
"rounded-lg bg-
|
|
19736
|
+
"rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm",
|
|
19734
19737
|
sizes.padding,
|
|
19735
19738
|
className
|
|
19736
19739
|
),
|
|
@@ -19832,7 +19835,7 @@ function ScoreBoard({
|
|
|
19832
19835
|
Card,
|
|
19833
19836
|
{
|
|
19834
19837
|
className: cn(
|
|
19835
|
-
"bg-
|
|
19838
|
+
"bg-[var(--color-card)]/90 border-gray-700 backdrop-blur-sm",
|
|
19836
19839
|
className
|
|
19837
19840
|
),
|
|
19838
19841
|
children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: "p-3", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
|
|
@@ -19931,7 +19934,7 @@ function TurnPanel({
|
|
|
19931
19934
|
Box,
|
|
19932
19935
|
{
|
|
19933
19936
|
className: cn(
|
|
19934
|
-
"flex items-center gap-3 rounded-lg bg-
|
|
19937
|
+
"flex items-center gap-3 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-2",
|
|
19935
19938
|
className
|
|
19936
19939
|
),
|
|
19937
19940
|
children: [
|
|
@@ -19978,7 +19981,7 @@ function EnemyPlate({
|
|
|
19978
19981
|
Box,
|
|
19979
19982
|
{
|
|
19980
19983
|
className: cn(
|
|
19981
|
-
"inline-flex flex-col gap-1 rounded-lg bg-
|
|
19984
|
+
"inline-flex flex-col gap-1 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-3 py-1.5",
|
|
19982
19985
|
"min-w-[120px]",
|
|
19983
19986
|
className
|
|
19984
19987
|
),
|
|
@@ -19989,7 +19992,7 @@ function EnemyPlate({
|
|
|
19989
19992
|
{
|
|
19990
19993
|
variant: "caption",
|
|
19991
19994
|
weight: "bold",
|
|
19992
|
-
className: "text-
|
|
19995
|
+
className: "text-[var(--color-foreground)] truncate",
|
|
19993
19996
|
children: name
|
|
19994
19997
|
}
|
|
19995
19998
|
),
|
|
@@ -20056,7 +20059,7 @@ function UnitCommandBar({
|
|
|
20056
20059
|
Box,
|
|
20057
20060
|
{
|
|
20058
20061
|
className: cn(
|
|
20059
|
-
"flex items-center gap-1.5 rounded-lg bg-
|
|
20062
|
+
"flex items-center gap-1.5 rounded-lg bg-[var(--color-card)]/90 border border-gray-700 backdrop-blur-sm px-2 py-1.5",
|
|
20060
20063
|
className
|
|
20061
20064
|
),
|
|
20062
20065
|
children: commands.map((command, i) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex flex-col items-center gap-0.5", children: [
|
|
@@ -20283,7 +20286,7 @@ function DialogueBox({
|
|
|
20283
20286
|
tabIndex: 0,
|
|
20284
20287
|
role: "dialog",
|
|
20285
20288
|
"aria-label": "Dialogue",
|
|
20286
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-4 my-4 bg-
|
|
20289
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-4 my-4 bg-[var(--color-card)] bg-opacity-95 border-2 border-gray-600 rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex", children: [
|
|
20287
20290
|
dialogue.portrait && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 p-4 border-r border-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
20288
20291
|
"img",
|
|
20289
20292
|
{
|
|
@@ -20295,7 +20298,7 @@ function DialogueBox({
|
|
|
20295
20298
|
) }),
|
|
20296
20299
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 p-4", children: [
|
|
20297
20300
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-yellow-400 font-bold mb-2", children: dialogue.speaker }),
|
|
20298
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-
|
|
20301
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[var(--color-foreground)] text-lg leading-relaxed min-h-[60px]", children: [
|
|
20299
20302
|
displayedText,
|
|
20300
20303
|
isTyping && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-pulse", children: "\u258C" })
|
|
20301
20304
|
] }),
|
|
@@ -20305,8 +20308,8 @@ function DialogueBox({
|
|
|
20305
20308
|
type: "button",
|
|
20306
20309
|
className: cn(
|
|
20307
20310
|
"block w-full text-left px-4 py-2 rounded transition-colors",
|
|
20308
|
-
"hover:bg-
|
|
20309
|
-
selectedChoice === index ? "bg-
|
|
20311
|
+
"hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-yellow-400",
|
|
20312
|
+
selectedChoice === index ? "bg-[var(--color-surface,#374151)] text-yellow-400" : "bg-[var(--color-card)] text-[var(--color-foreground)]"
|
|
20310
20313
|
),
|
|
20311
20314
|
onClick: (e) => {
|
|
20312
20315
|
e.stopPropagation();
|
|
@@ -20419,7 +20422,7 @@ function InventoryPanel({
|
|
|
20419
20422
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20420
20423
|
"div",
|
|
20421
20424
|
{
|
|
20422
|
-
className: "grid gap-1 bg-
|
|
20425
|
+
className: "grid gap-1 bg-[var(--color-card)] p-2 rounded-lg border border-gray-700",
|
|
20423
20426
|
style: {
|
|
20424
20427
|
gridTemplateColumns: `repeat(${safeColumns}, ${slotSize}px)`,
|
|
20425
20428
|
gridTemplateRows: `repeat(${rows}, ${slotSize}px)`
|
|
@@ -20430,9 +20433,9 @@ function InventoryPanel({
|
|
|
20430
20433
|
type: "button",
|
|
20431
20434
|
className: cn(
|
|
20432
20435
|
"relative flex items-center justify-center",
|
|
20433
|
-
"bg-
|
|
20434
|
-
"hover:bg-
|
|
20435
|
-
selectedSlot === index ? "border-yellow-400 bg-
|
|
20436
|
+
"bg-[var(--color-card)] border rounded transition-colors",
|
|
20437
|
+
"hover:bg-[var(--color-surface,#374151)] focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
20438
|
+
selectedSlot === index ? "border-yellow-400 bg-[var(--color-surface,#374151)]" : "border-gray-600"
|
|
20436
20439
|
),
|
|
20437
20440
|
style: { width: slotSize, height: slotSize },
|
|
20438
20441
|
onClick: () => handleSlotClick(index),
|
|
@@ -20462,14 +20465,14 @@ function InventoryPanel({
|
|
|
20462
20465
|
showTooltips && hoveredItem && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20463
20466
|
"div",
|
|
20464
20467
|
{
|
|
20465
|
-
className: "fixed z-50 bg-
|
|
20468
|
+
className: "fixed z-50 bg-[var(--color-card)] border border-gray-600 rounded-lg p-2 shadow-lg pointer-events-none",
|
|
20466
20469
|
style: {
|
|
20467
20470
|
left: tooltipPosition.x,
|
|
20468
20471
|
top: tooltipPosition.y,
|
|
20469
20472
|
maxWidth: 200
|
|
20470
20473
|
},
|
|
20471
20474
|
children: [
|
|
20472
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-
|
|
20475
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-[var(--color-foreground)]", children: hoveredItem.name || hoveredItem.type }),
|
|
20473
20476
|
hoveredItem.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-400 mt-1", children: hoveredItem.description }),
|
|
20474
20477
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs text-gray-500 mt-1", children: [
|
|
20475
20478
|
"Quantity: ",
|
|
@@ -20481,9 +20484,9 @@ function InventoryPanel({
|
|
|
20481
20484
|
] });
|
|
20482
20485
|
}
|
|
20483
20486
|
var variantMap3 = {
|
|
20484
|
-
primary: "bg-
|
|
20485
|
-
secondary: "bg-
|
|
20486
|
-
ghost: "bg-transparent hover:bg-white/10 text-
|
|
20487
|
+
primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400 shadow-lg shadow-blue-500/25",
|
|
20488
|
+
secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
|
|
20489
|
+
ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
|
|
20487
20490
|
};
|
|
20488
20491
|
function GameMenu({
|
|
20489
20492
|
title,
|
|
@@ -20540,7 +20543,7 @@ function GameMenu({
|
|
|
20540
20543
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20541
20544
|
"h1",
|
|
20542
20545
|
{
|
|
20543
|
-
className: "text-5xl md:text-7xl font-bold text-
|
|
20546
|
+
className: "text-5xl md:text-7xl font-bold text-[var(--color-foreground)] tracking-tight",
|
|
20544
20547
|
style: {
|
|
20545
20548
|
textShadow: "0 4px 12px rgba(0,0,0,0.5)"
|
|
20546
20549
|
},
|
|
@@ -20596,9 +20599,9 @@ var variantColors = {
|
|
|
20596
20599
|
}
|
|
20597
20600
|
};
|
|
20598
20601
|
var buttonVariants = {
|
|
20599
|
-
primary: "bg-
|
|
20600
|
-
secondary: "bg-
|
|
20601
|
-
ghost: "bg-transparent hover:bg-white/10 text-
|
|
20602
|
+
primary: "bg-[var(--color-primary)] hover:bg-blue-500 text-[var(--color-primary-foreground)] border-blue-400",
|
|
20603
|
+
secondary: "bg-[var(--color-surface,#374151)] hover:bg-gray-600 text-[var(--color-foreground)] border-gray-500",
|
|
20604
|
+
ghost: "bg-transparent hover:bg-white/10 text-[var(--color-foreground)] border-white/20"
|
|
20602
20605
|
};
|
|
20603
20606
|
function formatTime3(ms) {
|
|
20604
20607
|
const seconds = Math.floor(ms / 1e3);
|
|
@@ -20679,7 +20682,7 @@ function GameOverScreen({
|
|
|
20679
20682
|
}
|
|
20680
20683
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
20681
20684
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-400 text-sm mb-1", children: stat.label }),
|
|
20682
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-
|
|
20685
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[var(--color-foreground)] text-2xl font-bold flex items-center justify-center gap-2", children: [
|
|
20683
20686
|
stat.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { children: stat.icon }),
|
|
20684
20687
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tabular-nums", children: displayValue })
|
|
20685
20688
|
] })
|
|
@@ -21850,7 +21853,7 @@ var Lightbox = ({
|
|
|
21850
21853
|
className: cn(
|
|
21851
21854
|
"absolute top-4 right-4 z-10",
|
|
21852
21855
|
"p-2 rounded-full",
|
|
21853
|
-
"text-
|
|
21856
|
+
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
21854
21857
|
"hover:bg-opacity-70 transition-opacity",
|
|
21855
21858
|
"focus:outline-none focus:ring-2 focus:ring-white"
|
|
21856
21859
|
),
|
|
@@ -21869,7 +21872,7 @@ var Lightbox = ({
|
|
|
21869
21872
|
className: cn(
|
|
21870
21873
|
"absolute left-4 z-10",
|
|
21871
21874
|
"p-2 rounded-full",
|
|
21872
|
-
"text-
|
|
21875
|
+
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
21873
21876
|
"hover:bg-opacity-70 transition-opacity",
|
|
21874
21877
|
"focus:outline-none focus:ring-2 focus:ring-white"
|
|
21875
21878
|
),
|
|
@@ -21906,7 +21909,7 @@ var Lightbox = ({
|
|
|
21906
21909
|
className: cn(
|
|
21907
21910
|
"absolute right-4 z-10",
|
|
21908
21911
|
"p-2 rounded-full",
|
|
21909
|
-
"text-
|
|
21912
|
+
"text-[var(--color-foreground)] bg-[var(--color-card)]",
|
|
21910
21913
|
"hover:bg-opacity-70 transition-opacity",
|
|
21911
21914
|
"focus:outline-none focus:ring-2 focus:ring-white"
|
|
21912
21915
|
),
|
|
@@ -21915,12 +21918,12 @@ var Lightbox = ({
|
|
|
21915
21918
|
}
|
|
21916
21919
|
),
|
|
21917
21920
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute bottom-4 left-0 right-0 text-center", children: [
|
|
21918
|
-
showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-
|
|
21921
|
+
showCounter && safeImages.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[var(--color-foreground)] text-sm mb-1", children: [
|
|
21919
21922
|
index + 1,
|
|
21920
21923
|
" of ",
|
|
21921
21924
|
safeImages.length
|
|
21922
21925
|
] }),
|
|
21923
|
-
currentImage?.caption && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-
|
|
21926
|
+
currentImage?.caption && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[var(--color-foreground)] text-sm opacity-80 px-8", children: currentImage.caption })
|
|
21924
21927
|
] })
|
|
21925
21928
|
]
|
|
21926
21929
|
}
|
|
@@ -27495,6 +27498,254 @@ function onDebugToggle(listener) {
|
|
|
27495
27498
|
listeners5.add(listener);
|
|
27496
27499
|
return () => listeners5.delete(listener);
|
|
27497
27500
|
}
|
|
27501
|
+
function layoutGraph(states, transitions, initialState, width, height) {
|
|
27502
|
+
if (states.length === 0) return [];
|
|
27503
|
+
const layers = /* @__PURE__ */ new Map();
|
|
27504
|
+
const queue = [initialState];
|
|
27505
|
+
layers.set(initialState, 0);
|
|
27506
|
+
while (queue.length > 0) {
|
|
27507
|
+
const current = queue.shift();
|
|
27508
|
+
const layer = layers.get(current);
|
|
27509
|
+
for (const tr of transitions) {
|
|
27510
|
+
if (tr.from === current && !layers.has(tr.to)) {
|
|
27511
|
+
layers.set(tr.to, layer + 1);
|
|
27512
|
+
queue.push(tr.to);
|
|
27513
|
+
}
|
|
27514
|
+
}
|
|
27515
|
+
}
|
|
27516
|
+
for (const s of states) {
|
|
27517
|
+
if (!layers.has(s)) layers.set(s, layers.size > 0 ? Math.max(...layers.values()) + 1 : 0);
|
|
27518
|
+
}
|
|
27519
|
+
const layerGroups = /* @__PURE__ */ new Map();
|
|
27520
|
+
for (const [state, layer] of layers) {
|
|
27521
|
+
const group = layerGroups.get(layer) ?? [];
|
|
27522
|
+
group.push(state);
|
|
27523
|
+
layerGroups.set(layer, group);
|
|
27524
|
+
}
|
|
27525
|
+
const maxLayer = Math.max(...layerGroups.keys(), 0);
|
|
27526
|
+
const padX = 24;
|
|
27527
|
+
const padY = 20;
|
|
27528
|
+
const usableW = width - padX * 2;
|
|
27529
|
+
const usableH = height - padY * 2;
|
|
27530
|
+
const positions = [];
|
|
27531
|
+
for (const [layer, group] of layerGroups) {
|
|
27532
|
+
const y = maxLayer === 0 ? usableH / 2 + padY : padY + layer / maxLayer * usableH;
|
|
27533
|
+
for (let i = 0; i < group.length; i++) {
|
|
27534
|
+
const x = group.length === 1 ? width / 2 : padX + i / (group.length - 1) * usableW;
|
|
27535
|
+
positions.push({ x, y, state: group[i] });
|
|
27536
|
+
}
|
|
27537
|
+
}
|
|
27538
|
+
return positions;
|
|
27539
|
+
}
|
|
27540
|
+
function WalkMinimap() {
|
|
27541
|
+
const [walkStep, setWalkStep] = React117__namespace.useState(null);
|
|
27542
|
+
const [traits2, setTraits] = React117__namespace.useState([]);
|
|
27543
|
+
const [coveredEdges, setCoveredEdges] = React117__namespace.useState([]);
|
|
27544
|
+
const [completedTraits, setCompletedTraits] = React117__namespace.useState(/* @__PURE__ */ new Set());
|
|
27545
|
+
const prevTraitRef = React117__namespace.useRef(null);
|
|
27546
|
+
React117__namespace.useEffect(() => {
|
|
27547
|
+
const interval = setInterval(() => {
|
|
27548
|
+
const w = window;
|
|
27549
|
+
const step = w.__orbitalWalkStep;
|
|
27550
|
+
const traitConfigs = w.__orbitalWalkTraits;
|
|
27551
|
+
const edges = w.__orbitalCoveredEdges;
|
|
27552
|
+
if (step) setWalkStep(step);
|
|
27553
|
+
if (traitConfigs) setTraits(traitConfigs);
|
|
27554
|
+
if (edges) setCoveredEdges(edges);
|
|
27555
|
+
if (step && prevTraitRef.current && prevTraitRef.current !== step.traitName) {
|
|
27556
|
+
setCompletedTraits((prev) => new Set(prev).add(prevTraitRef.current));
|
|
27557
|
+
}
|
|
27558
|
+
if (step) prevTraitRef.current = step.traitName;
|
|
27559
|
+
}, 250);
|
|
27560
|
+
return () => clearInterval(interval);
|
|
27561
|
+
}, []);
|
|
27562
|
+
if (!walkStep || traits2.length === 0) return null;
|
|
27563
|
+
const activeTrait = traits2.find((t) => t.name === walkStep.traitName);
|
|
27564
|
+
const engineCount = coveredEdges.filter((e) => e.phase === "engine").length;
|
|
27565
|
+
const domCount = coveredEdges.filter((e) => e.phase === "dom").length;
|
|
27566
|
+
const totalTransitions = traits2.reduce((sum, t) => sum + t.transitions.length, 0);
|
|
27567
|
+
const activeEdgeKeys = new Set(
|
|
27568
|
+
coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => `${e.from}+${e.event}->${e.to}`)
|
|
27569
|
+
);
|
|
27570
|
+
const activeEdgePhases = new Map(
|
|
27571
|
+
coveredEdges.filter((e) => e.trait === walkStep.traitName).map((e) => [`${e.from}+${e.event}->${e.to}`, e.phase])
|
|
27572
|
+
);
|
|
27573
|
+
const currentEdgeKey = `${walkStep.from}+${walkStep.event}->${walkStep.to}`;
|
|
27574
|
+
const graphW = 260;
|
|
27575
|
+
const graphH = 120;
|
|
27576
|
+
const nodeR = 10;
|
|
27577
|
+
const positions = activeTrait ? layoutGraph(activeTrait.states, activeTrait.transitions, activeTrait.initialState, graphW, graphH) : [];
|
|
27578
|
+
const posMap = new Map(positions.map((p2) => [p2.state, p2]));
|
|
27579
|
+
const visitedStates = new Set(
|
|
27580
|
+
coveredEdges.filter((e) => e.trait === walkStep.traitName).flatMap((e) => [e.from, e.to])
|
|
27581
|
+
);
|
|
27582
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", className: "w-64 flex-shrink-0 border-l border-border bg-[var(--color-card)] overflow-hidden", children: [
|
|
27583
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-2 py-1.5 border-b border-border overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-nowrap", children: traits2.map((t) => {
|
|
27584
|
+
const isDone = completedTraits.has(t.name);
|
|
27585
|
+
const isActive = t.name === walkStep.traitName;
|
|
27586
|
+
const variant = isDone ? "success" : isActive ? "info" : "neutral";
|
|
27587
|
+
const shortName = t.name.replace(/^[A-Z][a-z]+/, "");
|
|
27588
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
27589
|
+
Badge,
|
|
27590
|
+
{
|
|
27591
|
+
variant,
|
|
27592
|
+
size: "sm",
|
|
27593
|
+
className: `flex-shrink-0 text-[9px] ${isActive ? "ring-1 ring-cyan-400" : ""}`,
|
|
27594
|
+
children: [
|
|
27595
|
+
isDone ? "\u2713" : isActive ? "\u25CF" : "\u25CB",
|
|
27596
|
+
" ",
|
|
27597
|
+
shortName || t.name
|
|
27598
|
+
]
|
|
27599
|
+
},
|
|
27600
|
+
t.name
|
|
27601
|
+
);
|
|
27602
|
+
}) }) }),
|
|
27603
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 flex items-center justify-center px-1 py-1", children: activeTrait && /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: graphW, height: graphH, viewBox: `0 0 ${graphW} ${graphH}`, children: [
|
|
27604
|
+
/* @__PURE__ */ jsxRuntime.jsxs("defs", { children: [
|
|
27605
|
+
/* @__PURE__ */ jsxRuntime.jsx("marker", { id: "mm-arrow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#888" }) }),
|
|
27606
|
+
/* @__PURE__ */ jsxRuntime.jsx("marker", { id: "mm-arrow-green", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#22c55e" }) }),
|
|
27607
|
+
/* @__PURE__ */ jsxRuntime.jsx("marker", { id: "mm-arrow-cyan", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#06b6d4" }) }),
|
|
27608
|
+
/* @__PURE__ */ jsxRuntime.jsx("marker", { id: "mm-arrow-yellow", markerWidth: "6", markerHeight: "4", refX: "6", refY: "2", orient: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L6,2 L0,4", fill: "#eab308" }) })
|
|
27609
|
+
] }),
|
|
27610
|
+
activeTrait.transitions.map((tr, i) => {
|
|
27611
|
+
const fromPos = posMap.get(tr.from);
|
|
27612
|
+
const toPos = posMap.get(tr.to);
|
|
27613
|
+
if (!fromPos || !toPos) return null;
|
|
27614
|
+
const key = `${tr.from}+${tr.event}->${tr.to}`;
|
|
27615
|
+
const isCurrent = key === currentEdgeKey && !walkStep.isRepositioning;
|
|
27616
|
+
const isCovered = activeEdgeKeys.has(key);
|
|
27617
|
+
const phase = activeEdgePhases.get(key);
|
|
27618
|
+
let stroke = "#555";
|
|
27619
|
+
let markerEnd = "url(#mm-arrow)";
|
|
27620
|
+
let strokeWidth = 1;
|
|
27621
|
+
let opacity = 0.4;
|
|
27622
|
+
if (isCurrent) {
|
|
27623
|
+
stroke = "#eab308";
|
|
27624
|
+
markerEnd = "url(#mm-arrow-yellow)";
|
|
27625
|
+
strokeWidth = 2.5;
|
|
27626
|
+
opacity = 1;
|
|
27627
|
+
} else if (isCovered && phase === "dom") {
|
|
27628
|
+
stroke = "#06b6d4";
|
|
27629
|
+
markerEnd = "url(#mm-arrow-cyan)";
|
|
27630
|
+
strokeWidth = 1.5;
|
|
27631
|
+
opacity = 0.9;
|
|
27632
|
+
} else if (isCovered) {
|
|
27633
|
+
stroke = "#22c55e";
|
|
27634
|
+
markerEnd = "url(#mm-arrow-green)";
|
|
27635
|
+
strokeWidth = 1.5;
|
|
27636
|
+
opacity = 0.9;
|
|
27637
|
+
}
|
|
27638
|
+
if (tr.from === tr.to) {
|
|
27639
|
+
const cx = fromPos.x;
|
|
27640
|
+
const cy = fromPos.y - nodeR - 8;
|
|
27641
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
27642
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27643
|
+
"path",
|
|
27644
|
+
{
|
|
27645
|
+
d: `M${cx - 5},${fromPos.y - nodeR} C${cx - 18},${cy - 14} ${cx + 18},${cy - 14} ${cx + 5},${fromPos.y - nodeR}`,
|
|
27646
|
+
fill: "none",
|
|
27647
|
+
stroke,
|
|
27648
|
+
strokeWidth,
|
|
27649
|
+
opacity,
|
|
27650
|
+
markerEnd
|
|
27651
|
+
}
|
|
27652
|
+
),
|
|
27653
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy - 12, textAnchor: "middle", fontSize: "7", fill: stroke, opacity, children: tr.event.length > 10 ? tr.event.slice(0, 8) + ".." : tr.event })
|
|
27654
|
+
] }, `e-${i}`);
|
|
27655
|
+
}
|
|
27656
|
+
const dx = toPos.x - fromPos.x;
|
|
27657
|
+
const dy = toPos.y - fromPos.y;
|
|
27658
|
+
const len = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
27659
|
+
const nx = -dy / len;
|
|
27660
|
+
const ny = dx / len;
|
|
27661
|
+
const hasReverse = activeTrait.transitions.some(
|
|
27662
|
+
(t2) => t2.from === tr.to && t2.to === tr.from
|
|
27663
|
+
);
|
|
27664
|
+
const offset = hasReverse ? 4 : 0;
|
|
27665
|
+
const x1 = fromPos.x + dx / len * nodeR + nx * offset;
|
|
27666
|
+
const y1 = fromPos.y + dy / len * nodeR + ny * offset;
|
|
27667
|
+
const x2 = toPos.x - dx / len * (nodeR + 6) + nx * offset;
|
|
27668
|
+
const y2 = toPos.y - dy / len * (nodeR + 6) + ny * offset;
|
|
27669
|
+
const mx = (x1 + x2) / 2 + nx * 8;
|
|
27670
|
+
const my = (y1 + y2) / 2 + ny * 8;
|
|
27671
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
27672
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27673
|
+
"line",
|
|
27674
|
+
{
|
|
27675
|
+
x1,
|
|
27676
|
+
y1,
|
|
27677
|
+
x2,
|
|
27678
|
+
y2,
|
|
27679
|
+
stroke,
|
|
27680
|
+
strokeWidth,
|
|
27681
|
+
opacity,
|
|
27682
|
+
markerEnd,
|
|
27683
|
+
children: isCurrent && /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "opacity", values: "1;0.4;1", dur: "0.8s", repeatCount: "indefinite" })
|
|
27684
|
+
}
|
|
27685
|
+
),
|
|
27686
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: mx, y: my, textAnchor: "middle", fontSize: "7", fill: stroke, opacity: Math.min(opacity + 0.2, 1), children: tr.event.length > 12 ? tr.event.slice(0, 10) + ".." : tr.event })
|
|
27687
|
+
] }, `e-${i}`);
|
|
27688
|
+
}),
|
|
27689
|
+
positions.map((pos) => {
|
|
27690
|
+
const isCurrentState = pos.state === walkStep.from || pos.state === walkStep.to;
|
|
27691
|
+
const isVisited = visitedStates.has(pos.state);
|
|
27692
|
+
const isInitial = pos.state === activeTrait.initialState;
|
|
27693
|
+
let fill = "#333";
|
|
27694
|
+
let strokeColor = "#555";
|
|
27695
|
+
let sw = 1;
|
|
27696
|
+
if (isCurrentState) {
|
|
27697
|
+
fill = "#1e40af";
|
|
27698
|
+
strokeColor = "#3b82f6";
|
|
27699
|
+
sw = 2;
|
|
27700
|
+
} else if (isVisited) {
|
|
27701
|
+
fill = "#166534";
|
|
27702
|
+
strokeColor = "#22c55e";
|
|
27703
|
+
sw = 1.5;
|
|
27704
|
+
}
|
|
27705
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
27706
|
+
isInitial && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: pos.x, cy: pos.y, r: nodeR + 3, fill: "none", stroke: "#3b82f6", strokeWidth: 1, opacity: 0.4 }),
|
|
27707
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27708
|
+
"circle",
|
|
27709
|
+
{
|
|
27710
|
+
cx: pos.x,
|
|
27711
|
+
cy: pos.y,
|
|
27712
|
+
r: nodeR,
|
|
27713
|
+
fill,
|
|
27714
|
+
stroke: strokeColor,
|
|
27715
|
+
strokeWidth: sw,
|
|
27716
|
+
children: isCurrentState && /* @__PURE__ */ jsxRuntime.jsx("animate", { attributeName: "r", values: `${nodeR};${nodeR + 2};${nodeR}`, dur: "1s", repeatCount: "indefinite" })
|
|
27717
|
+
}
|
|
27718
|
+
),
|
|
27719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27720
|
+
"text",
|
|
27721
|
+
{
|
|
27722
|
+
x: pos.x,
|
|
27723
|
+
y: pos.y + nodeR + 10,
|
|
27724
|
+
textAnchor: "middle",
|
|
27725
|
+
fontSize: "8",
|
|
27726
|
+
fill: "#aaa",
|
|
27727
|
+
children: pos.state.length > 10 ? pos.state.slice(0, 8) + ".." : pos.state
|
|
27728
|
+
}
|
|
27729
|
+
)
|
|
27730
|
+
] }, pos.state);
|
|
27731
|
+
})
|
|
27732
|
+
] }) }),
|
|
27733
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-2 py-1 border-t border-border", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "items-center justify-between", children: [
|
|
27734
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-green-500", children: [
|
|
27735
|
+
"Engine: ",
|
|
27736
|
+
engineCount,
|
|
27737
|
+
"/",
|
|
27738
|
+
totalTransitions
|
|
27739
|
+
] }),
|
|
27740
|
+
domCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "caption", className: "text-[10px] font-mono text-cyan-500", children: [
|
|
27741
|
+
"DOM: ",
|
|
27742
|
+
domCount
|
|
27743
|
+
] }),
|
|
27744
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: walkStep.phase === "engine" ? "info" : "warning", size: "sm", className: "text-[9px]", children: walkStep.phase === "engine" ? "Engine" : "DOM" })
|
|
27745
|
+
] }) })
|
|
27746
|
+
] });
|
|
27747
|
+
}
|
|
27748
|
+
WalkMinimap.displayName = "WalkMinimap";
|
|
27498
27749
|
function TraitsTab({ traits: traits2 }) {
|
|
27499
27750
|
if (traits2.length === 0) {
|
|
27500
27751
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -28318,25 +28569,25 @@ function EventDispatcherTab({ traits: traits2, schema }) {
|
|
|
28318
28569
|
EventDispatcherTab.displayName = "EventDispatcherTab";
|
|
28319
28570
|
function ServerResponseRow({ sr }) {
|
|
28320
28571
|
const entityEntries = Object.entries(sr.dataEntities);
|
|
28321
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-purple-
|
|
28572
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-[10px] font-mono", children: [
|
|
28322
28573
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
28323
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: sr.success ? "text-green-400" : "text-red-400", children: [
|
|
28574
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: sr.success ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400", children: [
|
|
28324
28575
|
sr.success ? "\u2713" : "\u2717",
|
|
28325
28576
|
" server"
|
|
28326
28577
|
] }),
|
|
28327
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-300", children: sr.orbitalName }),
|
|
28328
|
-
sr.clientEffects > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-purple-
|
|
28578
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-600 dark:text-purple-300", children: sr.orbitalName }),
|
|
28579
|
+
sr.clientEffects > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-purple-500/15 text-purple-600 dark:text-purple-300", children: [
|
|
28329
28580
|
sr.clientEffects,
|
|
28330
28581
|
" clientEffect",
|
|
28331
28582
|
sr.clientEffects !== 1 ? "s" : ""
|
|
28332
28583
|
] }),
|
|
28333
|
-
sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-blue-
|
|
28584
|
+
sr.emittedEvents.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-blue-500/15 text-blue-300", children: [
|
|
28334
28585
|
"emit: ",
|
|
28335
28586
|
sr.emittedEvents.join(", ")
|
|
28336
28587
|
] }),
|
|
28337
|
-
sr.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-red-
|
|
28588
|
+
sr.error && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-1 rounded bg-red-500/15 text-red-600 dark:text-red-400 truncate max-w-[300px]", children: sr.error })
|
|
28338
28589
|
] }),
|
|
28339
|
-
entityEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-
|
|
28590
|
+
entityEntries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 mt-0.5", children: entityEntries.map(([name, count]) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 rounded bg-[var(--color-card)] text-foreground", children: [
|
|
28340
28591
|
name,
|
|
28341
28592
|
": ",
|
|
28342
28593
|
count,
|
|
@@ -28349,24 +28600,24 @@ function TransitionRow({ trace }) {
|
|
|
28349
28600
|
const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
|
|
28350
28601
|
const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
|
|
28351
28602
|
if (isServerEntry && trace.serverResponse) {
|
|
28352
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-0.5 border-b border-
|
|
28603
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
|
|
28353
28604
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
|
|
28354
28605
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 bg-purple-500" }),
|
|
28355
28606
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "warning", size: "sm", className: "flex-shrink-0", children: trace.event }),
|
|
28356
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400 flex-shrink-0", children: "server response" })
|
|
28607
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-600 dark:text-purple-400 flex-shrink-0", children: "server response" })
|
|
28357
28608
|
] }),
|
|
28358
28609
|
/* @__PURE__ */ jsxRuntime.jsx(ServerResponseRow, { sr: trace.serverResponse })
|
|
28359
28610
|
] });
|
|
28360
28611
|
}
|
|
28361
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-0.5 border-b border-
|
|
28612
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-0.5 border-b border-border last:border-0", children: [
|
|
28362
28613
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-xs font-mono", children: [
|
|
28363
28614
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
28364
28615
|
"mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0",
|
|
28365
28616
|
hasFailedEffects ? "bg-red-500" : "bg-green-500"
|
|
28366
28617
|
) }),
|
|
28367
28618
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "info", size: "sm", className: "flex-shrink-0", children: trace.event }),
|
|
28368
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
28369
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-
|
|
28619
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground flex-shrink-0", children: trace.traitName }),
|
|
28620
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-foreground/70 flex-shrink-0", children: [
|
|
28370
28621
|
trace.from,
|
|
28371
28622
|
" ",
|
|
28372
28623
|
"\u2192",
|
|
@@ -28376,12 +28627,12 @@ function TransitionRow({ trace }) {
|
|
|
28376
28627
|
] }),
|
|
28377
28628
|
trace.effects.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 ml-6 mt-0.5", children: trace.effects.map((eff, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn(
|
|
28378
28629
|
"px-1 rounded text-[10px]",
|
|
28379
|
-
eff.status === "executed" ? "bg-green-
|
|
28630
|
+
eff.status === "executed" ? "bg-green-500/15 text-green-600 dark:text-green-400" : eff.status === "failed" ? "bg-red-500/15 text-red-600 dark:text-red-400" : "bg-yellow-500/15 text-yellow-600 dark:text-yellow-400"
|
|
28380
28631
|
), children: [
|
|
28381
28632
|
eff.status === "executed" ? "\u2713" : eff.status === "failed" ? "\u2717" : "-",
|
|
28382
28633
|
" ",
|
|
28383
28634
|
eff.type,
|
|
28384
|
-
eff.args.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
28635
|
+
eff.args.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground/50 ml-0.5", children: JSON.stringify(eff.args).slice(0, 40) })
|
|
28385
28636
|
] }, i)) }),
|
|
28386
28637
|
trace.serverResponse && /* @__PURE__ */ jsxRuntime.jsx(ServerResponseRow, { sr: trace.serverResponse })
|
|
28387
28638
|
] });
|
|
@@ -28396,15 +28647,6 @@ function VerifyModePanel({
|
|
|
28396
28647
|
}) {
|
|
28397
28648
|
const scrollRef = React117__namespace.useRef(null);
|
|
28398
28649
|
const prevCountRef = React117__namespace.useRef(0);
|
|
28399
|
-
const [walkStep, setWalkStep] = React117__namespace.useState(null);
|
|
28400
|
-
React117__namespace.useEffect(() => {
|
|
28401
|
-
const interval = setInterval(() => {
|
|
28402
|
-
const w = window;
|
|
28403
|
-
const step = w.__orbitalWalkStep;
|
|
28404
|
-
if (step) setWalkStep(step);
|
|
28405
|
-
}, 300);
|
|
28406
|
-
return () => clearInterval(interval);
|
|
28407
|
-
}, []);
|
|
28408
28650
|
React117__namespace.useEffect(() => {
|
|
28409
28651
|
if (transitions.length > prevCountRef.current && scrollRef.current) {
|
|
28410
28652
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
@@ -28417,49 +28659,28 @@ function VerifyModePanel({
|
|
|
28417
28659
|
{
|
|
28418
28660
|
className: cn(
|
|
28419
28661
|
"runtime-debugger runtime-debugger--verify",
|
|
28420
|
-
"flex flex-col bg-
|
|
28662
|
+
"flex flex-col bg-[var(--color-card)] text-[var(--color-foreground)] border-t-2 border-cyan-500",
|
|
28421
28663
|
hudBottom ? "" : "fixed bottom-0 left-0 right-0",
|
|
28422
28664
|
className
|
|
28423
28665
|
),
|
|
28424
28666
|
"data-testid": "debugger-verify",
|
|
28425
28667
|
style: { height: "25vh", zIndex: hudBottom ? void 0 : 40 },
|
|
28426
28668
|
children: [
|
|
28427
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-
|
|
28669
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-border flex-shrink-0", children: [
|
|
28428
28670
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? `${failedChecks} fail` : "OK" }),
|
|
28429
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-
|
|
28671
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-foreground/70", children: [
|
|
28430
28672
|
localCount,
|
|
28431
28673
|
" local"
|
|
28432
28674
|
] }),
|
|
28433
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-purple-400", children: [
|
|
28675
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-purple-600 dark:text-purple-400", children: [
|
|
28434
28676
|
serverCount,
|
|
28435
28677
|
" server"
|
|
28436
28678
|
] }),
|
|
28437
|
-
traitStates && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-cyan-400 truncate max-w-[400px]", children: traitStates })
|
|
28679
|
+
traitStates && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-cyan-600 dark:text-cyan-400 truncate max-w-[400px]", children: traitStates })
|
|
28438
28680
|
] }),
|
|
28439
28681
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
28440
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-
|
|
28441
|
-
|
|
28442
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-cyan-400 font-bold mb-1", children: [
|
|
28443
|
-
"Walk Step ",
|
|
28444
|
-
walkStep.stepIndex,
|
|
28445
|
-
"/",
|
|
28446
|
-
walkStep.stepTotal
|
|
28447
|
-
] }),
|
|
28448
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-300 mb-1", children: walkStep.traitName }),
|
|
28449
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
28450
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-yellow-300", children: walkStep.from }),
|
|
28451
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "--" }),
|
|
28452
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-green-300", children: walkStep.event }),
|
|
28453
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "-->" }),
|
|
28454
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-yellow-300", children: walkStep.to })
|
|
28455
|
-
] }),
|
|
28456
|
-
walkStep.guardCase && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: walkStep.guardCase === "pass" ? "text-green-400" : "text-red-400", children: [
|
|
28457
|
-
"guard: ",
|
|
28458
|
-
walkStep.guardCase
|
|
28459
|
-
] }),
|
|
28460
|
-
walkStep.isRepositioning && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500 italic", children: "repositioning" }),
|
|
28461
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: walkStep.accepted ? "text-green-400 mt-1" : "text-red-400 mt-1", children: walkStep.accepted ? "\u2713 accepted" : "\u2717 rejected" })
|
|
28462
|
-
] })
|
|
28682
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground/50 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsxRuntime.jsx(TransitionRow, { trace }, trace.id)) }) }) }),
|
|
28683
|
+
/* @__PURE__ */ jsxRuntime.jsx(WalkMinimap, {})
|
|
28463
28684
|
] })
|
|
28464
28685
|
]
|
|
28465
28686
|
}
|
|
@@ -28684,7 +28905,7 @@ function RuntimeDebugger({
|
|
|
28684
28905
|
className: "runtime-debugger__tabs"
|
|
28685
28906
|
}
|
|
28686
28907
|
) }),
|
|
28687
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-
|
|
28908
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "runtime-debugger__footer", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-foreground/50", children: "Press ` to toggle | window.__orbitalVerification for automation" }) })
|
|
28688
28909
|
] })
|
|
28689
28910
|
}
|
|
28690
28911
|
);
|
|
@@ -32262,6 +32483,62 @@ function getComponentForPattern(patternType) {
|
|
|
32262
32483
|
if (!name) return null;
|
|
32263
32484
|
return COMPONENT_REGISTRY[name] ?? null;
|
|
32264
32485
|
}
|
|
32486
|
+
var FORM_PATTERNS = /* @__PURE__ */ new Set([
|
|
32487
|
+
"form",
|
|
32488
|
+
"form-section",
|
|
32489
|
+
"inline-edit-form",
|
|
32490
|
+
"wizard-step"
|
|
32491
|
+
]);
|
|
32492
|
+
function enrichFormFields(fields, entityDef) {
|
|
32493
|
+
const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
|
|
32494
|
+
return fields.map((field) => {
|
|
32495
|
+
if (typeof field === "string") {
|
|
32496
|
+
const entityField = fieldMap.get(field);
|
|
32497
|
+
if (entityField) {
|
|
32498
|
+
const enriched = {
|
|
32499
|
+
name: field,
|
|
32500
|
+
label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
32501
|
+
type: entityField.type,
|
|
32502
|
+
required: entityField.required
|
|
32503
|
+
};
|
|
32504
|
+
if (entityField.values && entityField.values.length > 0) {
|
|
32505
|
+
enriched.values = entityField.values;
|
|
32506
|
+
} else if (entityField.enumValues && entityField.enumValues.length > 0) {
|
|
32507
|
+
enriched.values = entityField.enumValues;
|
|
32508
|
+
}
|
|
32509
|
+
if (entityField.relation) {
|
|
32510
|
+
enriched.relation = entityField.relation;
|
|
32511
|
+
}
|
|
32512
|
+
return enriched;
|
|
32513
|
+
}
|
|
32514
|
+
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
32515
|
+
}
|
|
32516
|
+
if (field && typeof field === "object" && !Array.isArray(field)) {
|
|
32517
|
+
const obj = field;
|
|
32518
|
+
const fieldName = obj.name ?? obj.field;
|
|
32519
|
+
if (!fieldName) return field;
|
|
32520
|
+
if (obj.type || obj.inputType) return field;
|
|
32521
|
+
const entityField = fieldMap.get(fieldName);
|
|
32522
|
+
if (!entityField) return field;
|
|
32523
|
+
const enriched = { ...obj, type: entityField.type };
|
|
32524
|
+
if (entityField.required && !("required" in obj)) {
|
|
32525
|
+
enriched.required = true;
|
|
32526
|
+
}
|
|
32527
|
+
if (!obj.values && !obj.options) {
|
|
32528
|
+
if (entityField.values && entityField.values.length > 0) {
|
|
32529
|
+
enriched.values = entityField.values;
|
|
32530
|
+
} else if (entityField.enumValues && entityField.enumValues.length > 0) {
|
|
32531
|
+
enriched.values = entityField.enumValues;
|
|
32532
|
+
}
|
|
32533
|
+
}
|
|
32534
|
+
if (!obj.relation && entityField.relation) {
|
|
32535
|
+
enriched.relation = entityField.relation;
|
|
32536
|
+
}
|
|
32537
|
+
return enriched;
|
|
32538
|
+
}
|
|
32539
|
+
return field;
|
|
32540
|
+
});
|
|
32541
|
+
}
|
|
32265
32542
|
var PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
32266
32543
|
"stack",
|
|
32267
32544
|
"vstack",
|
|
@@ -32695,6 +32972,8 @@ function SlotContentRenderer({
|
|
|
32695
32972
|
const entityProp = content.props.entity;
|
|
32696
32973
|
const entityType = typeof entityProp === "string" ? entityProp : "";
|
|
32697
32974
|
const storeData = useEntityRef(entityType);
|
|
32975
|
+
const schemaCtx = useEntitySchemaOptional();
|
|
32976
|
+
const entityDef = entityType && schemaCtx ? schemaCtx.entities.get(entityType) : void 0;
|
|
32698
32977
|
const PatternComponent = getComponentForPattern(content.pattern);
|
|
32699
32978
|
if (PatternComponent) {
|
|
32700
32979
|
const childrenConfig = content.props.children;
|
|
@@ -32716,6 +32995,13 @@ function SlotContentRenderer({
|
|
|
32716
32995
|
} else {
|
|
32717
32996
|
finalProps = renderedProps;
|
|
32718
32997
|
}
|
|
32998
|
+
const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
|
|
32999
|
+
if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
|
|
33000
|
+
finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
|
|
33001
|
+
if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
|
|
33002
|
+
finalProps.initialData = storeData[0];
|
|
33003
|
+
}
|
|
33004
|
+
}
|
|
32719
33005
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
32720
33006
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
32721
33007
|
Box,
|
|
@@ -33367,6 +33653,7 @@ exports.clearSchemaCache = clearSchemaCache;
|
|
|
33367
33653
|
exports.createClientEffectHandlers = createClientEffectHandlers;
|
|
33368
33654
|
exports.useEntityDefinition = useEntityDefinition;
|
|
33369
33655
|
exports.useEntitySchema = useEntitySchema;
|
|
33656
|
+
exports.useEntitySchemaOptional = useEntitySchemaOptional;
|
|
33370
33657
|
exports.useResolvedSchema = useResolvedSchema;
|
|
33371
33658
|
exports.useServerBridge = useServerBridge;
|
|
33372
33659
|
exports.useSlotContent = useSlotContent;
|