@almadar/ui 5.69.0 → 5.71.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 +2034 -1854
- package/dist/avl/index.d.cts +93 -56
- package/dist/avl/index.js +758 -578
- package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +2 -1
- package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +2 -1
- package/dist/components/avl/molecules/avl-behavior-compose-converter.d.ts +7 -5
- package/dist/components/avl/molecules/avl-behavior-compose-types.d.ts +41 -21
- package/dist/components/avl/molecules/avl-canvas-types.d.ts +10 -7
- package/dist/components/avl/molecules/avl-preview-converter.d.ts +5 -5
- package/dist/components/avl/molecules/avl-preview-types.d.ts +15 -4
- package/dist/components/avl/organisms/FlowCanvas.d.ts +2 -2
- package/dist/components/avl/organisms/avl-schema-parser.d.ts +18 -16
- package/dist/components/core/atoms/Button.d.ts +2 -0
- package/dist/components/core/atoms/ConditionalWrapper.d.ts +5 -4
- package/dist/components/core/molecules/Carousel.d.ts +2 -2
- package/dist/components/core/molecules/OrbitalVisualization.d.ts +4 -3
- package/dist/components/core/molecules/PageHeader.d.ts +3 -3
- package/dist/components/core/molecules/RepeatableFormSection.d.ts +4 -3
- package/dist/components/core/molecules/ViolationAlert.d.ts +2 -0
- package/dist/components/core/molecules/WizardContainer.d.ts +23 -22
- package/dist/components/core/organisms/CardGrid.d.ts +2 -2
- package/dist/components/core/organisms/CustomPattern.d.ts +3 -4
- package/dist/components/core/organisms/DataTable.d.ts +2 -2
- package/dist/components/core/organisms/DetailPanel.d.ts +1 -1
- package/dist/components/core/organisms/Form.d.ts +11 -11
- package/dist/components/core/organisms/List.d.ts +3 -5
- package/dist/components/core/organisms/StatCard.d.ts +2 -2
- package/dist/components/core/organisms/book/types.d.ts +1 -1
- package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +2 -1
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +2 -1
- package/dist/components/core/organisms/layout/DashboardGrid.d.ts +0 -2
- package/dist/components/core/organisms/types.d.ts +3 -2
- package/dist/components/game/atoms/ScoreDisplay.d.ts +3 -1
- package/dist/components/game/molecules/three/hooks/useSceneGraph.d.ts +2 -1
- package/dist/components/game/molecules/three/index.cjs +37 -24
- package/dist/components/game/molecules/three/index.js +37 -24
- package/dist/components/game/organisms/HolidayRunnerBoard.d.ts +19 -17
- package/dist/components/game/organisms/PinballBoard.d.ts +4 -4
- package/dist/components/game/organisms/RacingBoard.d.ts +25 -17
- package/dist/components/game/organisms/SpaceShmupBoard.d.ts +28 -11
- package/dist/components/game/organisms/boardEntity.d.ts +6 -6
- package/dist/components/game/organisms/puzzles/debugger/DebuggerBoard.d.ts +16 -2
- package/dist/components/game/organisms/puzzles/event-handler/puzzleObject.d.ts +21 -10
- package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +2 -1
- package/dist/components/index.cjs +1771 -1614
- package/dist/components/index.js +650 -493
- package/dist/docs/index.cjs +107 -104
- package/dist/docs/index.d.cts +2 -0
- package/dist/docs/index.js +38 -35
- package/dist/lib/getNestedValue.d.ts +2 -13
- package/dist/marketing/index.cjs +97 -98
- package/dist/marketing/index.d.cts +2 -0
- package/dist/marketing/index.js +54 -55
- package/dist/providers/index.cjs +1744 -1587
- package/dist/providers/index.js +635 -478
- package/dist/runtime/index.cjs +1802 -1645
- package/dist/runtime/index.js +641 -484
- package/package.json +1 -1
- package/themes/almadar-website.css +2 -2
- package/themes/almadar.css +2 -2
- package/themes/arctic.css +2 -2
- package/themes/kiosk.css +2 -2
- package/themes/lavender.css +3 -3
- package/themes/midnight.css +2 -2
- package/themes/neon.css +2 -2
- package/themes/notion-editorial.css +2 -2
- package/themes/sunset.css +2 -2
- package/themes/trait-wars.css +2 -2
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React90 from 'react';
|
|
2
|
+
import React90__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -403,7 +403,7 @@ var init_Box = __esm({
|
|
|
403
403
|
fixed: "fixed",
|
|
404
404
|
sticky: "sticky"
|
|
405
405
|
};
|
|
406
|
-
Box =
|
|
406
|
+
Box = React90__default.forwardRef(
|
|
407
407
|
({
|
|
408
408
|
padding,
|
|
409
409
|
paddingX,
|
|
@@ -468,7 +468,7 @@ var init_Box = __esm({
|
|
|
468
468
|
onPointerDown?.(e);
|
|
469
469
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
470
470
|
const isClickable = action || onClick;
|
|
471
|
-
return
|
|
471
|
+
return React90__default.createElement(
|
|
472
472
|
Component2,
|
|
473
473
|
{
|
|
474
474
|
ref,
|
|
@@ -564,7 +564,7 @@ function loadLib(key, importer) {
|
|
|
564
564
|
return p2;
|
|
565
565
|
}
|
|
566
566
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
567
|
-
const Lazy =
|
|
567
|
+
const Lazy = React90__default.lazy(async () => {
|
|
568
568
|
const lib = await loadLib(libKey, importer);
|
|
569
569
|
const Comp = pick(lib);
|
|
570
570
|
if (!Comp) {
|
|
@@ -574,7 +574,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
574
574
|
return { default: Comp };
|
|
575
575
|
});
|
|
576
576
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
577
|
-
|
|
577
|
+
React90__default.Suspense,
|
|
578
578
|
{
|
|
579
579
|
fallback: /* @__PURE__ */ jsx(
|
|
580
580
|
"span",
|
|
@@ -1242,9 +1242,10 @@ function resolveIcon(name) {
|
|
|
1242
1242
|
function doResolve(name) {
|
|
1243
1243
|
if (iconAliases[name]) return iconAliases[name];
|
|
1244
1244
|
const pascalName = kebabToPascal2(name);
|
|
1245
|
-
const
|
|
1245
|
+
const lucideMap = LucideIcons2;
|
|
1246
|
+
const directLookup = lucideMap[pascalName];
|
|
1246
1247
|
if (directLookup && typeof directLookup === "object") return directLookup;
|
|
1247
|
-
const asIs =
|
|
1248
|
+
const asIs = lucideMap[name];
|
|
1248
1249
|
if (asIs && typeof asIs === "object") return asIs;
|
|
1249
1250
|
return LucideIcons2.HelpCircle;
|
|
1250
1251
|
}
|
|
@@ -1300,7 +1301,7 @@ var init_Icon = __esm({
|
|
|
1300
1301
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1301
1302
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1302
1303
|
const family = useIconFamily();
|
|
1303
|
-
const RenderedComponent =
|
|
1304
|
+
const RenderedComponent = React90__default.useMemo(() => {
|
|
1304
1305
|
if (directIcon) return null;
|
|
1305
1306
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1306
1307
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1350,6 +1351,9 @@ var init_Icon = __esm({
|
|
|
1350
1351
|
Icon.displayName = "Icon";
|
|
1351
1352
|
}
|
|
1352
1353
|
});
|
|
1354
|
+
function isIconLike(v) {
|
|
1355
|
+
return typeof v.render === "function";
|
|
1356
|
+
}
|
|
1353
1357
|
function resolveIconProp(value, sizeClass) {
|
|
1354
1358
|
if (!value) return null;
|
|
1355
1359
|
if (typeof value === "string") {
|
|
@@ -1359,10 +1363,10 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1359
1363
|
const IconComp = value;
|
|
1360
1364
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1361
1365
|
}
|
|
1362
|
-
if (
|
|
1366
|
+
if (React90__default.isValidElement(value)) {
|
|
1363
1367
|
return value;
|
|
1364
1368
|
}
|
|
1365
|
-
if (typeof value === "object" && value !== null &&
|
|
1369
|
+
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
1366
1370
|
const IconComp = value;
|
|
1367
1371
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1368
1372
|
}
|
|
@@ -1435,7 +1439,7 @@ var init_Button = __esm({
|
|
|
1435
1439
|
md: "h-icon-default w-icon-default",
|
|
1436
1440
|
lg: "h-icon-default w-icon-default"
|
|
1437
1441
|
};
|
|
1438
|
-
Button =
|
|
1442
|
+
Button = React90__default.forwardRef(
|
|
1439
1443
|
({
|
|
1440
1444
|
className,
|
|
1441
1445
|
variant = "primary",
|
|
@@ -1451,6 +1455,7 @@ var init_Button = __esm({
|
|
|
1451
1455
|
label,
|
|
1452
1456
|
children,
|
|
1453
1457
|
onClick,
|
|
1458
|
+
"data-testid": dataTestId,
|
|
1454
1459
|
...props
|
|
1455
1460
|
}, ref) => {
|
|
1456
1461
|
const eventBus = useEventBus();
|
|
@@ -1483,7 +1488,7 @@ var init_Button = __esm({
|
|
|
1483
1488
|
),
|
|
1484
1489
|
onClick: handleClick,
|
|
1485
1490
|
...props,
|
|
1486
|
-
"data-testid":
|
|
1491
|
+
"data-testid": dataTestId ?? (action ? `action-${action}` : void 0),
|
|
1487
1492
|
children: [
|
|
1488
1493
|
isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
|
|
1489
1494
|
children || label,
|
|
@@ -1500,7 +1505,7 @@ var Dialog;
|
|
|
1500
1505
|
var init_Dialog = __esm({
|
|
1501
1506
|
"components/core/atoms/Dialog.tsx"() {
|
|
1502
1507
|
init_cn();
|
|
1503
|
-
Dialog =
|
|
1508
|
+
Dialog = React90__default.forwardRef(
|
|
1504
1509
|
({
|
|
1505
1510
|
role = "dialog",
|
|
1506
1511
|
"aria-modal": ariaModal = true,
|
|
@@ -1618,9 +1623,8 @@ var init_Typography = __esm({
|
|
|
1618
1623
|
}) => {
|
|
1619
1624
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1620
1625
|
const Component2 = as || defaultElements[variant];
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
Comp,
|
|
1626
|
+
return React90__default.createElement(
|
|
1627
|
+
Component2,
|
|
1624
1628
|
{
|
|
1625
1629
|
id,
|
|
1626
1630
|
className: cn(
|
|
@@ -1633,9 +1637,9 @@ var init_Typography = __esm({
|
|
|
1633
1637
|
overflow && overflowStyles2[overflow],
|
|
1634
1638
|
className
|
|
1635
1639
|
),
|
|
1636
|
-
style
|
|
1637
|
-
|
|
1638
|
-
|
|
1640
|
+
style
|
|
1641
|
+
},
|
|
1642
|
+
children ?? content
|
|
1639
1643
|
);
|
|
1640
1644
|
};
|
|
1641
1645
|
Typography.displayName = "Typography";
|
|
@@ -2114,7 +2118,7 @@ var init_Badge = __esm({
|
|
|
2114
2118
|
md: "px-2.5 py-1 text-sm",
|
|
2115
2119
|
lg: "px-3 py-1.5 text-base"
|
|
2116
2120
|
};
|
|
2117
|
-
Badge =
|
|
2121
|
+
Badge = React90__default.forwardRef(
|
|
2118
2122
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2119
2123
|
const iconSizes3 = {
|
|
2120
2124
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2450,7 +2454,7 @@ var init_SvgFlow = __esm({
|
|
|
2450
2454
|
width = 100,
|
|
2451
2455
|
height = 100
|
|
2452
2456
|
}) => {
|
|
2453
|
-
const markerId =
|
|
2457
|
+
const markerId = React90__default.useMemo(() => {
|
|
2454
2458
|
flowIdCounter += 1;
|
|
2455
2459
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2456
2460
|
}, []);
|
|
@@ -3043,7 +3047,7 @@ var init_SvgRing = __esm({
|
|
|
3043
3047
|
width = 100,
|
|
3044
3048
|
height = 100
|
|
3045
3049
|
}) => {
|
|
3046
|
-
const gradientId =
|
|
3050
|
+
const gradientId = React90__default.useMemo(() => {
|
|
3047
3051
|
ringIdCounter += 1;
|
|
3048
3052
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3049
3053
|
}, []);
|
|
@@ -3224,7 +3228,7 @@ var init_Input = __esm({
|
|
|
3224
3228
|
init_cn();
|
|
3225
3229
|
init_Icon();
|
|
3226
3230
|
init_useEventBus();
|
|
3227
|
-
Input =
|
|
3231
|
+
Input = React90__default.forwardRef(
|
|
3228
3232
|
({
|
|
3229
3233
|
className,
|
|
3230
3234
|
inputType,
|
|
@@ -3384,7 +3388,7 @@ var Label;
|
|
|
3384
3388
|
var init_Label = __esm({
|
|
3385
3389
|
"components/core/atoms/Label.tsx"() {
|
|
3386
3390
|
init_cn();
|
|
3387
|
-
Label =
|
|
3391
|
+
Label = React90__default.forwardRef(
|
|
3388
3392
|
({ className, required, children, ...props }, ref) => {
|
|
3389
3393
|
return /* @__PURE__ */ jsxs(
|
|
3390
3394
|
"label",
|
|
@@ -3411,7 +3415,7 @@ var init_Textarea = __esm({
|
|
|
3411
3415
|
"components/core/atoms/Textarea.tsx"() {
|
|
3412
3416
|
init_cn();
|
|
3413
3417
|
init_useEventBus();
|
|
3414
|
-
Textarea =
|
|
3418
|
+
Textarea = React90__default.forwardRef(
|
|
3415
3419
|
({ className, error, onChange, ...props }, ref) => {
|
|
3416
3420
|
const eventBus = useEventBus();
|
|
3417
3421
|
const handleChange = (e) => {
|
|
@@ -3650,7 +3654,7 @@ var init_Select = __esm({
|
|
|
3650
3654
|
init_cn();
|
|
3651
3655
|
init_Icon();
|
|
3652
3656
|
init_useEventBus();
|
|
3653
|
-
Select =
|
|
3657
|
+
Select = React90__default.forwardRef(
|
|
3654
3658
|
(props, _ref) => {
|
|
3655
3659
|
const { multiple, searchable, clearable } = props;
|
|
3656
3660
|
if (multiple || searchable || clearable) {
|
|
@@ -3667,7 +3671,7 @@ var init_Checkbox = __esm({
|
|
|
3667
3671
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3668
3672
|
init_cn();
|
|
3669
3673
|
init_useEventBus();
|
|
3670
|
-
Checkbox =
|
|
3674
|
+
Checkbox = React90__default.forwardRef(
|
|
3671
3675
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3672
3676
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3673
3677
|
const eventBus = useEventBus();
|
|
@@ -3721,7 +3725,7 @@ var init_Spinner = __esm({
|
|
|
3721
3725
|
md: "h-6 w-6",
|
|
3722
3726
|
lg: "h-8 w-8"
|
|
3723
3727
|
};
|
|
3724
|
-
Spinner =
|
|
3728
|
+
Spinner = React90__default.forwardRef(
|
|
3725
3729
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3726
3730
|
if (overlay) {
|
|
3727
3731
|
return /* @__PURE__ */ jsx(
|
|
@@ -3811,7 +3815,7 @@ var init_Card = __esm({
|
|
|
3811
3815
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3812
3816
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3813
3817
|
};
|
|
3814
|
-
Card =
|
|
3818
|
+
Card = React90__default.forwardRef(
|
|
3815
3819
|
({
|
|
3816
3820
|
className,
|
|
3817
3821
|
variant = "bordered",
|
|
@@ -3859,9 +3863,9 @@ var init_Card = __esm({
|
|
|
3859
3863
|
}
|
|
3860
3864
|
);
|
|
3861
3865
|
Card.displayName = "Card";
|
|
3862
|
-
CardHeader =
|
|
3866
|
+
CardHeader = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3863
3867
|
CardHeader.displayName = "CardHeader";
|
|
3864
|
-
CardTitle =
|
|
3868
|
+
CardTitle = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3865
3869
|
"h3",
|
|
3866
3870
|
{
|
|
3867
3871
|
ref,
|
|
@@ -3874,11 +3878,11 @@ var init_Card = __esm({
|
|
|
3874
3878
|
}
|
|
3875
3879
|
));
|
|
3876
3880
|
CardTitle.displayName = "CardTitle";
|
|
3877
|
-
CardContent =
|
|
3881
|
+
CardContent = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3878
3882
|
CardContent.displayName = "CardContent";
|
|
3879
3883
|
CardBody = CardContent;
|
|
3880
3884
|
CardBody.displayName = "CardBody";
|
|
3881
|
-
CardFooter =
|
|
3885
|
+
CardFooter = React90__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3882
3886
|
"div",
|
|
3883
3887
|
{
|
|
3884
3888
|
ref,
|
|
@@ -3933,7 +3937,7 @@ var init_FilterPill = __esm({
|
|
|
3933
3937
|
md: "w-3.5 h-3.5",
|
|
3934
3938
|
lg: "w-4 h-4"
|
|
3935
3939
|
};
|
|
3936
|
-
FilterPill =
|
|
3940
|
+
FilterPill = React90__default.forwardRef(
|
|
3937
3941
|
({
|
|
3938
3942
|
className,
|
|
3939
3943
|
variant = "default",
|
|
@@ -4062,8 +4066,8 @@ var init_Avatar = __esm({
|
|
|
4062
4066
|
actionPayload
|
|
4063
4067
|
}) => {
|
|
4064
4068
|
const eventBus = useEventBus();
|
|
4065
|
-
const [imgFailed, setImgFailed] =
|
|
4066
|
-
|
|
4069
|
+
const [imgFailed, setImgFailed] = React90__default.useState(false);
|
|
4070
|
+
React90__default.useEffect(() => {
|
|
4067
4071
|
setImgFailed(false);
|
|
4068
4072
|
}, [src]);
|
|
4069
4073
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4176,22 +4180,18 @@ var init_Center = __esm({
|
|
|
4176
4180
|
as: Component2 = "div"
|
|
4177
4181
|
}) => {
|
|
4178
4182
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
style: mergedStyle,
|
|
4192
|
-
children
|
|
4193
|
-
}
|
|
4194
|
-
);
|
|
4183
|
+
return React90__default.createElement(Component2, {
|
|
4184
|
+
className: cn(
|
|
4185
|
+
inline ? "inline-flex" : "flex",
|
|
4186
|
+
horizontal && "justify-center",
|
|
4187
|
+
vertical && "items-center",
|
|
4188
|
+
fullHeight && "h-full",
|
|
4189
|
+
fullWidth && "w-full",
|
|
4190
|
+
className
|
|
4191
|
+
),
|
|
4192
|
+
style: mergedStyle,
|
|
4193
|
+
children
|
|
4194
|
+
});
|
|
4195
4195
|
};
|
|
4196
4196
|
}
|
|
4197
4197
|
});
|
|
@@ -4448,7 +4448,7 @@ var init_Radio = __esm({
|
|
|
4448
4448
|
md: "w-2.5 h-2.5",
|
|
4449
4449
|
lg: "w-3 h-3"
|
|
4450
4450
|
};
|
|
4451
|
-
Radio =
|
|
4451
|
+
Radio = React90__default.forwardRef(
|
|
4452
4452
|
({
|
|
4453
4453
|
label,
|
|
4454
4454
|
helperText,
|
|
@@ -4465,12 +4465,12 @@ var init_Radio = __esm({
|
|
|
4465
4465
|
onChange,
|
|
4466
4466
|
...props
|
|
4467
4467
|
}, ref) => {
|
|
4468
|
-
const reactId =
|
|
4468
|
+
const reactId = React90__default.useId();
|
|
4469
4469
|
const baseId = id || `radio-${reactId}`;
|
|
4470
4470
|
const hasError = !!error;
|
|
4471
4471
|
const eventBus = useEventBus();
|
|
4472
|
-
const [selected, setSelected] =
|
|
4473
|
-
|
|
4472
|
+
const [selected, setSelected] = React90__default.useState(value);
|
|
4473
|
+
React90__default.useEffect(() => {
|
|
4474
4474
|
if (value !== void 0) setSelected(value);
|
|
4475
4475
|
}, [value]);
|
|
4476
4476
|
const pick = (next, e) => {
|
|
@@ -4652,7 +4652,7 @@ var init_Switch = __esm({
|
|
|
4652
4652
|
"components/core/atoms/Switch.tsx"() {
|
|
4653
4653
|
"use client";
|
|
4654
4654
|
init_cn();
|
|
4655
|
-
Switch =
|
|
4655
|
+
Switch = React90.forwardRef(
|
|
4656
4656
|
({
|
|
4657
4657
|
checked,
|
|
4658
4658
|
defaultChecked = false,
|
|
@@ -4663,10 +4663,10 @@ var init_Switch = __esm({
|
|
|
4663
4663
|
name,
|
|
4664
4664
|
className
|
|
4665
4665
|
}, ref) => {
|
|
4666
|
-
const [isChecked, setIsChecked] =
|
|
4666
|
+
const [isChecked, setIsChecked] = React90.useState(
|
|
4667
4667
|
checked !== void 0 ? checked : defaultChecked
|
|
4668
4668
|
);
|
|
4669
|
-
|
|
4669
|
+
React90.useEffect(() => {
|
|
4670
4670
|
if (checked !== void 0) {
|
|
4671
4671
|
setIsChecked(checked);
|
|
4672
4672
|
}
|
|
@@ -4825,9 +4825,8 @@ var init_Stack = __esm({
|
|
|
4825
4825
|
};
|
|
4826
4826
|
const isHorizontal = direction === "horizontal";
|
|
4827
4827
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
Comp,
|
|
4828
|
+
return React90__default.createElement(
|
|
4829
|
+
Component2,
|
|
4831
4830
|
{
|
|
4832
4831
|
className: cn(
|
|
4833
4832
|
"flex",
|
|
@@ -4843,9 +4842,9 @@ var init_Stack = __esm({
|
|
|
4843
4842
|
onClick: action || onClick ? handleClick : void 0,
|
|
4844
4843
|
onKeyDown,
|
|
4845
4844
|
role,
|
|
4846
|
-
tabIndex
|
|
4847
|
-
|
|
4848
|
-
|
|
4845
|
+
tabIndex
|
|
4846
|
+
},
|
|
4847
|
+
children
|
|
4849
4848
|
);
|
|
4850
4849
|
};
|
|
4851
4850
|
VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
|
|
@@ -5026,7 +5025,7 @@ var Aside;
|
|
|
5026
5025
|
var init_Aside = __esm({
|
|
5027
5026
|
"components/core/atoms/Aside.tsx"() {
|
|
5028
5027
|
init_cn();
|
|
5029
|
-
Aside =
|
|
5028
|
+
Aside = React90__default.forwardRef(
|
|
5030
5029
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5031
5030
|
);
|
|
5032
5031
|
Aside.displayName = "Aside";
|
|
@@ -5105,9 +5104,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5105
5104
|
className
|
|
5106
5105
|
}) => {
|
|
5107
5106
|
const { t } = useTranslate();
|
|
5108
|
-
const [isVisible, setIsVisible] =
|
|
5109
|
-
const timeoutRef =
|
|
5110
|
-
const triggerRef =
|
|
5107
|
+
const [isVisible, setIsVisible] = React90__default.useState(false);
|
|
5108
|
+
const timeoutRef = React90__default.useRef(null);
|
|
5109
|
+
const triggerRef = React90__default.useRef(null);
|
|
5111
5110
|
const handleMouseEnter = () => {
|
|
5112
5111
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5113
5112
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5118,7 +5117,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5118
5117
|
};
|
|
5119
5118
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5120
5119
|
const open = isVisible || revealed;
|
|
5121
|
-
|
|
5120
|
+
React90__default.useEffect(() => {
|
|
5122
5121
|
return () => {
|
|
5123
5122
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5124
5123
|
};
|
|
@@ -5330,7 +5329,7 @@ var init_StatusDot = __esm({
|
|
|
5330
5329
|
md: "w-2.5 h-2.5",
|
|
5331
5330
|
lg: "w-3 h-3"
|
|
5332
5331
|
};
|
|
5333
|
-
StatusDot =
|
|
5332
|
+
StatusDot = React90__default.forwardRef(
|
|
5334
5333
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5335
5334
|
return /* @__PURE__ */ jsx(
|
|
5336
5335
|
"span",
|
|
@@ -5384,7 +5383,7 @@ var init_TrendIndicator = __esm({
|
|
|
5384
5383
|
down: "trending-down",
|
|
5385
5384
|
flat: "arrow-right"
|
|
5386
5385
|
};
|
|
5387
|
-
TrendIndicator =
|
|
5386
|
+
TrendIndicator = React90__default.forwardRef(
|
|
5388
5387
|
({
|
|
5389
5388
|
className,
|
|
5390
5389
|
value,
|
|
@@ -5451,7 +5450,7 @@ var init_RangeSlider = __esm({
|
|
|
5451
5450
|
md: "w-4 h-4",
|
|
5452
5451
|
lg: "w-5 h-5"
|
|
5453
5452
|
};
|
|
5454
|
-
RangeSlider =
|
|
5453
|
+
RangeSlider = React90__default.forwardRef(
|
|
5455
5454
|
({
|
|
5456
5455
|
className,
|
|
5457
5456
|
min = 0,
|
|
@@ -5959,7 +5958,7 @@ var init_ContentSection = __esm({
|
|
|
5959
5958
|
md: "py-16",
|
|
5960
5959
|
lg: "py-24"
|
|
5961
5960
|
};
|
|
5962
|
-
ContentSection =
|
|
5961
|
+
ContentSection = React90__default.forwardRef(
|
|
5963
5962
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5964
5963
|
return /* @__PURE__ */ jsx(
|
|
5965
5964
|
Box,
|
|
@@ -6493,7 +6492,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6493
6492
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6494
6493
|
"none": {}
|
|
6495
6494
|
};
|
|
6496
|
-
AnimatedReveal =
|
|
6495
|
+
AnimatedReveal = React90__default.forwardRef(
|
|
6497
6496
|
({
|
|
6498
6497
|
trigger = "scroll",
|
|
6499
6498
|
animation = "fade-up",
|
|
@@ -6653,7 +6652,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6653
6652
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6654
6653
|
"use client";
|
|
6655
6654
|
init_cn();
|
|
6656
|
-
AnimatedGraphic =
|
|
6655
|
+
AnimatedGraphic = React90__default.forwardRef(
|
|
6657
6656
|
({
|
|
6658
6657
|
src,
|
|
6659
6658
|
svgContent,
|
|
@@ -6676,7 +6675,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6676
6675
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6677
6676
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6678
6677
|
const prevAnimateRef = useRef(animate);
|
|
6679
|
-
const setRef =
|
|
6678
|
+
const setRef = React90__default.useCallback(
|
|
6680
6679
|
(node) => {
|
|
6681
6680
|
containerRef.current = node;
|
|
6682
6681
|
if (typeof ref === "function") ref(node);
|
|
@@ -6893,18 +6892,18 @@ var init_HealthBar = __esm({
|
|
|
6893
6892
|
function ScoreDisplay({
|
|
6894
6893
|
assetUrl = DEFAULT_ASSET_URL,
|
|
6895
6894
|
value,
|
|
6895
|
+
score,
|
|
6896
6896
|
label,
|
|
6897
6897
|
icon,
|
|
6898
6898
|
size = "md",
|
|
6899
6899
|
className,
|
|
6900
6900
|
animated = true,
|
|
6901
|
-
locale = "en-US"
|
|
6902
|
-
...rest
|
|
6901
|
+
locale = "en-US"
|
|
6903
6902
|
}) {
|
|
6904
|
-
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof
|
|
6905
|
-
const [displayValue, setDisplayValue] =
|
|
6906
|
-
const [isAnimating, setIsAnimating] =
|
|
6907
|
-
|
|
6903
|
+
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
|
|
6904
|
+
const [displayValue, setDisplayValue] = React90.useState(resolvedValue);
|
|
6905
|
+
const [isAnimating, setIsAnimating] = React90.useState(false);
|
|
6906
|
+
React90.useEffect(() => {
|
|
6908
6907
|
if (!animated || displayValue === resolvedValue) {
|
|
6909
6908
|
setDisplayValue(resolvedValue);
|
|
6910
6909
|
return;
|
|
@@ -6987,9 +6986,9 @@ function ControlButton({
|
|
|
6987
6986
|
className
|
|
6988
6987
|
}) {
|
|
6989
6988
|
const eventBus = useEventBus();
|
|
6990
|
-
const [isPressed, setIsPressed] =
|
|
6989
|
+
const [isPressed, setIsPressed] = React90.useState(false);
|
|
6991
6990
|
const actualPressed = pressed ?? isPressed;
|
|
6992
|
-
const handlePointerDown =
|
|
6991
|
+
const handlePointerDown = React90.useCallback(
|
|
6993
6992
|
(e) => {
|
|
6994
6993
|
e.preventDefault();
|
|
6995
6994
|
if (disabled) return;
|
|
@@ -6999,7 +6998,7 @@ function ControlButton({
|
|
|
6999
6998
|
},
|
|
7000
6999
|
[disabled, pressEvent, eventBus, onPress]
|
|
7001
7000
|
);
|
|
7002
|
-
const handlePointerUp =
|
|
7001
|
+
const handlePointerUp = React90.useCallback(
|
|
7003
7002
|
(e) => {
|
|
7004
7003
|
e.preventDefault();
|
|
7005
7004
|
if (disabled) return;
|
|
@@ -7009,7 +7008,7 @@ function ControlButton({
|
|
|
7009
7008
|
},
|
|
7010
7009
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7011
7010
|
);
|
|
7012
|
-
const handlePointerLeave =
|
|
7011
|
+
const handlePointerLeave = React90.useCallback(
|
|
7013
7012
|
(e) => {
|
|
7014
7013
|
if (isPressed) {
|
|
7015
7014
|
setIsPressed(false);
|
|
@@ -7638,8 +7637,8 @@ function XPBar({
|
|
|
7638
7637
|
}) {
|
|
7639
7638
|
const sizes = sizeMap9[size];
|
|
7640
7639
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7641
|
-
const [fillWidth, setFillWidth] =
|
|
7642
|
-
|
|
7640
|
+
const [fillWidth, setFillWidth] = React90.useState(animated ? 0 : percentage);
|
|
7641
|
+
React90.useEffect(() => {
|
|
7643
7642
|
if (!animated) {
|
|
7644
7643
|
setFillWidth(percentage);
|
|
7645
7644
|
return;
|
|
@@ -8147,9 +8146,9 @@ function MiniMap({
|
|
|
8147
8146
|
viewportRect = DEFAULT_VIEWPORT,
|
|
8148
8147
|
className
|
|
8149
8148
|
}) {
|
|
8150
|
-
const canvasRef =
|
|
8151
|
-
const frameRef =
|
|
8152
|
-
|
|
8149
|
+
const canvasRef = React90.useRef(null);
|
|
8150
|
+
const frameRef = React90.useRef(0);
|
|
8151
|
+
React90.useEffect(() => {
|
|
8153
8152
|
const canvas = canvasRef.current;
|
|
8154
8153
|
if (!canvas) return;
|
|
8155
8154
|
const ctx = canvas.getContext("2d");
|
|
@@ -8338,7 +8337,7 @@ var init_ErrorBoundary = __esm({
|
|
|
8338
8337
|
}
|
|
8339
8338
|
);
|
|
8340
8339
|
};
|
|
8341
|
-
ErrorBoundary = class extends
|
|
8340
|
+
ErrorBoundary = class extends React90__default.Component {
|
|
8342
8341
|
constructor(props) {
|
|
8343
8342
|
super(props);
|
|
8344
8343
|
__publicField(this, "reset", () => {
|
|
@@ -9005,9 +9004,8 @@ var init_Container = __esm({
|
|
|
9005
9004
|
as: Component2 = "div"
|
|
9006
9005
|
}) => {
|
|
9007
9006
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
Comp,
|
|
9007
|
+
return React90__default.createElement(
|
|
9008
|
+
Component2,
|
|
9011
9009
|
{
|
|
9012
9010
|
className: cn(
|
|
9013
9011
|
"w-full",
|
|
@@ -9015,9 +9013,9 @@ var init_Container = __esm({
|
|
|
9015
9013
|
paddingStyles3[padding],
|
|
9016
9014
|
center && "mx-auto",
|
|
9017
9015
|
className
|
|
9018
|
-
)
|
|
9019
|
-
|
|
9020
|
-
|
|
9016
|
+
)
|
|
9017
|
+
},
|
|
9018
|
+
children
|
|
9021
9019
|
);
|
|
9022
9020
|
};
|
|
9023
9021
|
Container.displayName = "Container";
|
|
@@ -9729,8 +9727,8 @@ function ActionButtons({
|
|
|
9729
9727
|
disabled
|
|
9730
9728
|
}) {
|
|
9731
9729
|
const eventBus = useEventBus();
|
|
9732
|
-
const [activeButtons, setActiveButtons] =
|
|
9733
|
-
const handlePress =
|
|
9730
|
+
const [activeButtons, setActiveButtons] = React90.useState(/* @__PURE__ */ new Set());
|
|
9731
|
+
const handlePress = React90.useCallback(
|
|
9734
9732
|
(id) => {
|
|
9735
9733
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9736
9734
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9738,7 +9736,7 @@ function ActionButtons({
|
|
|
9738
9736
|
},
|
|
9739
9737
|
[actionEvent, eventBus, onAction]
|
|
9740
9738
|
);
|
|
9741
|
-
const handleRelease =
|
|
9739
|
+
const handleRelease = React90.useCallback(
|
|
9742
9740
|
(id) => {
|
|
9743
9741
|
setActiveButtons((prev) => {
|
|
9744
9742
|
const next = new Set(prev);
|
|
@@ -12225,9 +12223,37 @@ function BattleBoard({
|
|
|
12225
12223
|
className
|
|
12226
12224
|
}) {
|
|
12227
12225
|
const board = boardEntity(entity) ?? {};
|
|
12228
|
-
|
|
12226
|
+
function asFieldObj(v) {
|
|
12227
|
+
if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
|
|
12228
|
+
return v;
|
|
12229
|
+
}
|
|
12230
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles.flatMap((v) => {
|
|
12231
|
+
const o = asFieldObj(v);
|
|
12232
|
+
if (o === null || typeof o.x !== "number" || typeof o.y !== "number") return [];
|
|
12233
|
+
const tile = { x: o.x, y: o.y };
|
|
12234
|
+
if (typeof o.terrain === "string") tile.terrain = o.terrain;
|
|
12235
|
+
if (typeof o.terrainSprite === "string") tile.terrainSprite = o.terrainSprite;
|
|
12236
|
+
if (typeof o.passable === "boolean") tile.passable = o.passable;
|
|
12237
|
+
if (typeof o.movementCost === "number") tile.movementCost = o.movementCost;
|
|
12238
|
+
if (typeof o.elevation === "number") tile.elevation = o.elevation;
|
|
12239
|
+
if (typeof o.type === "string") tile.type = o.type;
|
|
12240
|
+
if (typeof o.tileType === "string") tile.tileType = o.tileType;
|
|
12241
|
+
if (typeof o.id === "string") tile.id = o.id;
|
|
12242
|
+
if (typeof o.modelUrl === "string") tile.modelUrl = o.modelUrl;
|
|
12243
|
+
return [tile];
|
|
12244
|
+
}) : []);
|
|
12229
12245
|
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
12230
|
-
const features = propFeatures ?? (Array.isArray(board.features) ? board.features
|
|
12246
|
+
const features = propFeatures ?? (Array.isArray(board.features) ? board.features.flatMap((v) => {
|
|
12247
|
+
const o = asFieldObj(v);
|
|
12248
|
+
if (o === null || typeof o.type !== "string" || typeof o.x !== "number" || typeof o.y !== "number") return [];
|
|
12249
|
+
const feat = { type: o.type, x: o.x, y: o.y };
|
|
12250
|
+
if (typeof o.id === "string") feat.id = o.id;
|
|
12251
|
+
if (typeof o.sprite === "string") feat.sprite = o.sprite;
|
|
12252
|
+
if (typeof o.color === "string") feat.color = o.color;
|
|
12253
|
+
if (typeof o.elevation === "number") feat.elevation = o.elevation;
|
|
12254
|
+
if (typeof o.assetUrl === "string") feat.assetUrl = o.assetUrl;
|
|
12255
|
+
return [feat];
|
|
12256
|
+
}) : []);
|
|
12231
12257
|
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
12232
12258
|
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
12233
12259
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
@@ -12326,7 +12352,12 @@ function BattleBoard({
|
|
|
12326
12352
|
return units.filter((u) => unitHealth(u) > 0).map((unit) => {
|
|
12327
12353
|
const id = str(unit.id);
|
|
12328
12354
|
const pos = movingPositions.get(id) ?? unitPosition(unit);
|
|
12329
|
-
const unitTraits = Array.isArray(unit.traits) ? unit.traits
|
|
12355
|
+
const unitTraits = Array.isArray(unit.traits) ? unit.traits.flatMap((v) => {
|
|
12356
|
+
const o = asFieldObj(v);
|
|
12357
|
+
if (o === null || typeof o.name !== "string" || typeof o.currentState !== "string" || !Array.isArray(o.states)) return [];
|
|
12358
|
+
const stateNames = Array.from(o.states).flatMap((s) => typeof s === "string" ? [s] : []);
|
|
12359
|
+
return [{ name: o.name, currentState: o.currentState, states: stateNames, cooldown: typeof o.cooldown === "number" ? o.cooldown : void 0 }];
|
|
12360
|
+
}) : void 0;
|
|
12330
12361
|
return {
|
|
12331
12362
|
id,
|
|
12332
12363
|
position: pos,
|
|
@@ -13322,9 +13353,9 @@ async function computeTraitLayout(data) {
|
|
|
13322
13353
|
y: n.y ?? 0,
|
|
13323
13354
|
width: n.width ?? 110,
|
|
13324
13355
|
height: n.height ?? STATE_H,
|
|
13325
|
-
isInitial: stateInfo?.isInitial,
|
|
13326
|
-
isTerminal: stateInfo?.isTerminal,
|
|
13327
|
-
role: getStateRole(name, stateInfo?.isInitial, stateInfo?.isTerminal, tc, maxTC),
|
|
13356
|
+
isInitial: stateInfo?.isInitial ?? void 0,
|
|
13357
|
+
isTerminal: stateInfo?.isTerminal ?? void 0,
|
|
13358
|
+
role: getStateRole(name, stateInfo?.isInitial ?? void 0, stateInfo?.isTerminal ?? void 0, tc, maxTC),
|
|
13328
13359
|
transitionCount: tc
|
|
13329
13360
|
};
|
|
13330
13361
|
});
|
|
@@ -13335,12 +13366,10 @@ async function computeTraitLayout(data) {
|
|
|
13335
13366
|
const sections = e.sections ?? [];
|
|
13336
13367
|
const points = [];
|
|
13337
13368
|
for (const section of sections) {
|
|
13338
|
-
const startPoint = section.startPoint;
|
|
13339
|
-
const endPoint = section.endPoint;
|
|
13340
13369
|
const bendPoints = section.bendPoints ?? [];
|
|
13341
|
-
points.push({ x: startPoint.x, y: startPoint.y });
|
|
13370
|
+
points.push({ x: section.startPoint.x, y: section.startPoint.y });
|
|
13342
13371
|
for (const bp of bendPoints) points.push({ x: bp.x, y: bp.y });
|
|
13343
|
-
points.push({ x: endPoint.x, y: endPoint.y });
|
|
13372
|
+
points.push({ x: section.endPoint.x, y: section.endPoint.y });
|
|
13344
13373
|
}
|
|
13345
13374
|
const isSelf = t.from === t.to;
|
|
13346
13375
|
const isBackward = !isSelf && (nodeXMap[t.to] ?? 0) <= (nodeXMap[t.from] ?? 0);
|
|
@@ -13938,7 +13967,7 @@ var init_CodeBlock = __esm({
|
|
|
13938
13967
|
};
|
|
13939
13968
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13940
13969
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13941
|
-
CodeBlock =
|
|
13970
|
+
CodeBlock = React90__default.memo(
|
|
13942
13971
|
({
|
|
13943
13972
|
code: rawCode,
|
|
13944
13973
|
language = "text",
|
|
@@ -14525,7 +14554,7 @@ var init_MarkdownContent = __esm({
|
|
|
14525
14554
|
init_Box();
|
|
14526
14555
|
init_CodeBlock();
|
|
14527
14556
|
init_cn();
|
|
14528
|
-
MarkdownContent =
|
|
14557
|
+
MarkdownContent = React90__default.memo(
|
|
14529
14558
|
({ content, direction = "ltr", className }) => {
|
|
14530
14559
|
const { t: _t } = useTranslate();
|
|
14531
14560
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -15894,7 +15923,7 @@ var init_StateMachineView = __esm({
|
|
|
15894
15923
|
style: { top: title ? 30 : 0 },
|
|
15895
15924
|
children: [
|
|
15896
15925
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15897
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15926
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React90__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15898
15927
|
StateNode,
|
|
15899
15928
|
{
|
|
15900
15929
|
state,
|
|
@@ -16713,12 +16742,13 @@ var init_ContentRenderer = __esm({
|
|
|
16713
16742
|
);
|
|
16714
16743
|
case "orbital": {
|
|
16715
16744
|
const parsed = segment.schema;
|
|
16745
|
+
const isFullSchema = (v) => Array.isArray(v.orbitals);
|
|
16716
16746
|
const inlineTrait = {
|
|
16717
16747
|
name: "inline",
|
|
16718
16748
|
scope: "instance",
|
|
16719
16749
|
stateMachine: parsed
|
|
16720
16750
|
};
|
|
16721
|
-
const schema =
|
|
16751
|
+
const schema = isFullSchema(parsed) ? parsed : {
|
|
16722
16752
|
name: "inline",
|
|
16723
16753
|
orbitals: [{
|
|
16724
16754
|
name: "inline",
|
|
@@ -17944,8 +17974,21 @@ function BuilderBoard({
|
|
|
17944
17974
|
const resolved = boardEntity(entity);
|
|
17945
17975
|
const [headerError, setHeaderError] = useState(false);
|
|
17946
17976
|
const [selectedComponent, setSelectedComponent] = useState(null);
|
|
17947
|
-
const components =
|
|
17948
|
-
|
|
17977
|
+
const components = rows(resolved?.components).map((r) => ({
|
|
17978
|
+
id: str(r.id),
|
|
17979
|
+
label: str(r.label),
|
|
17980
|
+
description: str(r.description) || void 0,
|
|
17981
|
+
iconEmoji: str(r.iconEmoji) || void 0,
|
|
17982
|
+
iconUrl: str(r.iconUrl) || void 0,
|
|
17983
|
+
category: str(r.category) || void 0
|
|
17984
|
+
}));
|
|
17985
|
+
const slots = rows(resolved?.slots).map((r) => ({
|
|
17986
|
+
id: str(r.id),
|
|
17987
|
+
label: str(r.label) || void 0,
|
|
17988
|
+
description: str(r.description) || void 0,
|
|
17989
|
+
requiredComponentId: str(r.requiredComponentId),
|
|
17990
|
+
placedComponentId: str(r.placedComponentId) || void 0
|
|
17991
|
+
}));
|
|
17949
17992
|
const placements = {};
|
|
17950
17993
|
for (const slot of slots) {
|
|
17951
17994
|
if (slot.placedComponentId) placements[slot.id] = slot.placedComponentId;
|
|
@@ -19849,7 +19892,7 @@ function CardHand({
|
|
|
19849
19892
|
className
|
|
19850
19893
|
}) {
|
|
19851
19894
|
const eventBus = useEventBus();
|
|
19852
|
-
const handleClick =
|
|
19895
|
+
const handleClick = React90.useCallback(
|
|
19853
19896
|
(card) => {
|
|
19854
19897
|
if (card.disabled) return;
|
|
19855
19898
|
onCardClick?.(card.id);
|
|
@@ -20596,14 +20639,15 @@ var init_CardGrid = __esm({
|
|
|
20596
20639
|
bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
|
|
20597
20640
|
const value = getNestedValue(itemData, field);
|
|
20598
20641
|
if (value === void 0 || value === null || value === "") return null;
|
|
20599
|
-
const
|
|
20642
|
+
const fieldValue = value;
|
|
20643
|
+
const boolVal = asBooleanValue(fieldValue);
|
|
20600
20644
|
if (boolVal !== null) {
|
|
20601
20645
|
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
|
|
20602
20646
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
|
|
20603
20647
|
boolVal ? /* @__PURE__ */ jsx(Badge, { variant: "success", children: t("common.yes") || "Yes" }) : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("common.no") || "No" })
|
|
20604
20648
|
] }, field);
|
|
20605
20649
|
}
|
|
20606
|
-
const displayValue = isDateField(field) ? formatDate(
|
|
20650
|
+
const displayValue = isDateField(field) ? formatDate(fieldValue) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
|
|
20607
20651
|
if (!displayValue) return null;
|
|
20608
20652
|
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
|
|
20609
20653
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
|
|
@@ -20988,9 +21032,9 @@ function CastleBoard({
|
|
|
20988
21032
|
const eventBus = useEventBus();
|
|
20989
21033
|
const { t } = useTranslate();
|
|
20990
21034
|
const resolved = boardEntity(entity);
|
|
20991
|
-
const tiles = propTiles ?? (
|
|
20992
|
-
const features = propFeatures ?? (
|
|
20993
|
-
const units = propUnits ?? (
|
|
21035
|
+
const tiles = propTiles ?? (resolved?.tiles ?? []);
|
|
21036
|
+
const features = propFeatures ?? (resolved?.features ?? []);
|
|
21037
|
+
const units = propUnits ?? (resolved?.units ?? []);
|
|
20994
21038
|
const assetManifest = propAssetManifest ?? resolved?.assetManifest;
|
|
20995
21039
|
const backgroundImage = resolved?.backgroundImage;
|
|
20996
21040
|
const gold = num(resolved?.gold);
|
|
@@ -22525,8 +22569,8 @@ function ClassifierBoard({
|
|
|
22525
22569
|
const { t } = useTranslate();
|
|
22526
22570
|
const resolved = boardEntity(entity);
|
|
22527
22571
|
const [headerError, setHeaderError] = useState(false);
|
|
22528
|
-
const items =
|
|
22529
|
-
const categories =
|
|
22572
|
+
const items = rows(resolved?.items);
|
|
22573
|
+
const categories = rows(resolved?.categories);
|
|
22530
22574
|
const result = str(resolved?.result);
|
|
22531
22575
|
const submitted = result === "win";
|
|
22532
22576
|
const attempts = num(resolved?.attempts);
|
|
@@ -23327,7 +23371,7 @@ function CraftingRecipe({
|
|
|
23327
23371
|
className
|
|
23328
23372
|
}) {
|
|
23329
23373
|
const eventBus = useEventBus();
|
|
23330
|
-
const handleCraft =
|
|
23374
|
+
const handleCraft = React90.useCallback(() => {
|
|
23331
23375
|
onCraft?.();
|
|
23332
23376
|
if (craftEvent) {
|
|
23333
23377
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -23344,7 +23388,7 @@ function CraftingRecipe({
|
|
|
23344
23388
|
children: [
|
|
23345
23389
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
23346
23390
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
23347
|
-
return /* @__PURE__ */ jsxs(
|
|
23391
|
+
return /* @__PURE__ */ jsxs(React90.Fragment, { children: [
|
|
23348
23392
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
23349
23393
|
ItemSlot,
|
|
23350
23394
|
{
|
|
@@ -23416,8 +23460,8 @@ function DPad({
|
|
|
23416
23460
|
}) {
|
|
23417
23461
|
const eventBus = useEventBus();
|
|
23418
23462
|
const sizes = sizeMap15[size];
|
|
23419
|
-
const [activeDirections, setActiveDirections] =
|
|
23420
|
-
const handlePress =
|
|
23463
|
+
const [activeDirections, setActiveDirections] = React90.useState(/* @__PURE__ */ new Set());
|
|
23464
|
+
const handlePress = React90.useCallback(
|
|
23421
23465
|
(direction) => {
|
|
23422
23466
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
23423
23467
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -23425,7 +23469,7 @@ function DPad({
|
|
|
23425
23469
|
},
|
|
23426
23470
|
[directionEvent, eventBus, onDirection]
|
|
23427
23471
|
);
|
|
23428
|
-
const handleRelease =
|
|
23472
|
+
const handleRelease = React90.useCallback(
|
|
23429
23473
|
(direction) => {
|
|
23430
23474
|
setActiveDirections((prev) => {
|
|
23431
23475
|
const next = new Set(prev);
|
|
@@ -24310,8 +24354,8 @@ var init_Menu = __esm({
|
|
|
24310
24354
|
"bottom-end": "bottom-start"
|
|
24311
24355
|
};
|
|
24312
24356
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
24313
|
-
const triggerChild =
|
|
24314
|
-
const triggerElement =
|
|
24357
|
+
const triggerChild = React90__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
24358
|
+
const triggerElement = React90__default.cloneElement(
|
|
24315
24359
|
triggerChild,
|
|
24316
24360
|
{
|
|
24317
24361
|
ref: triggerRef,
|
|
@@ -24406,14 +24450,14 @@ function useDataDnd(args) {
|
|
|
24406
24450
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
24407
24451
|
const enabled = isZone || Boolean(dndRoot);
|
|
24408
24452
|
const eventBus = useEventBus();
|
|
24409
|
-
const parentRoot =
|
|
24453
|
+
const parentRoot = React90__default.useContext(RootCtx);
|
|
24410
24454
|
const isRoot = enabled && parentRoot === null;
|
|
24411
|
-
const zoneId =
|
|
24455
|
+
const zoneId = React90__default.useId();
|
|
24412
24456
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24413
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
24414
|
-
const optimisticOrdersRef =
|
|
24457
|
+
const [optimisticOrders, setOptimisticOrders] = React90__default.useState(() => /* @__PURE__ */ new Map());
|
|
24458
|
+
const optimisticOrdersRef = React90__default.useRef(optimisticOrders);
|
|
24415
24459
|
optimisticOrdersRef.current = optimisticOrders;
|
|
24416
|
-
const clearOptimisticOrder =
|
|
24460
|
+
const clearOptimisticOrder = React90__default.useCallback((group) => {
|
|
24417
24461
|
setOptimisticOrders((prev) => {
|
|
24418
24462
|
if (!prev.has(group)) return prev;
|
|
24419
24463
|
const next = new Map(prev);
|
|
@@ -24436,17 +24480,20 @@ function useDataDnd(args) {
|
|
|
24436
24480
|
}
|
|
24437
24481
|
const itemIdsSignature = orderedItems.map((it, idx) => {
|
|
24438
24482
|
const raw = it[dndItemIdField];
|
|
24439
|
-
return String(raw
|
|
24483
|
+
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
24440
24484
|
}).join("|");
|
|
24441
|
-
const itemIds =
|
|
24485
|
+
const itemIds = React90__default.useMemo(
|
|
24442
24486
|
() => orderedItems.map((it, idx) => {
|
|
24443
24487
|
const raw = it[dndItemIdField];
|
|
24444
|
-
return raw
|
|
24488
|
+
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
24445
24489
|
}),
|
|
24446
24490
|
[itemIdsSignature]
|
|
24447
24491
|
);
|
|
24448
|
-
const itemsContentSig = items.map((it, idx) =>
|
|
24449
|
-
|
|
24492
|
+
const itemsContentSig = items.map((it, idx) => {
|
|
24493
|
+
const raw = it[dndItemIdField];
|
|
24494
|
+
return raw != null ? String(raw) : `__${idx}`;
|
|
24495
|
+
}).join("|");
|
|
24496
|
+
React90__default.useEffect(() => {
|
|
24450
24497
|
const root = isRoot ? null : parentRoot;
|
|
24451
24498
|
if (root) {
|
|
24452
24499
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -24454,20 +24501,20 @@ function useDataDnd(args) {
|
|
|
24454
24501
|
clearOptimisticOrder(ownGroup);
|
|
24455
24502
|
}
|
|
24456
24503
|
}, [itemsContentSig, ownGroup]);
|
|
24457
|
-
const zonesRef =
|
|
24458
|
-
const registerZone =
|
|
24504
|
+
const zonesRef = React90__default.useRef(/* @__PURE__ */ new Map());
|
|
24505
|
+
const registerZone = React90__default.useCallback((zoneId2, meta2) => {
|
|
24459
24506
|
zonesRef.current.set(zoneId2, meta2);
|
|
24460
24507
|
}, []);
|
|
24461
|
-
const unregisterZone =
|
|
24508
|
+
const unregisterZone = React90__default.useCallback((zoneId2) => {
|
|
24462
24509
|
zonesRef.current.delete(zoneId2);
|
|
24463
24510
|
}, []);
|
|
24464
|
-
const [activeDrag, setActiveDrag] =
|
|
24465
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
24466
|
-
const meta =
|
|
24511
|
+
const [activeDrag, setActiveDrag] = React90__default.useState(null);
|
|
24512
|
+
const [overZoneGroup, setOverZoneGroup] = React90__default.useState(null);
|
|
24513
|
+
const meta = React90__default.useMemo(
|
|
24467
24514
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
24468
24515
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
24469
24516
|
);
|
|
24470
|
-
|
|
24517
|
+
React90__default.useEffect(() => {
|
|
24471
24518
|
const target = isRoot ? null : parentRoot;
|
|
24472
24519
|
if (!target) {
|
|
24473
24520
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -24486,7 +24533,7 @@ function useDataDnd(args) {
|
|
|
24486
24533
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
24487
24534
|
const sensors = useAlmadarDndSensors(true);
|
|
24488
24535
|
const collisionDetection = almadarDndCollisionDetection;
|
|
24489
|
-
const findZoneByItem =
|
|
24536
|
+
const findZoneByItem = React90__default.useCallback(
|
|
24490
24537
|
(id) => {
|
|
24491
24538
|
for (const z of zonesRef.current.values()) {
|
|
24492
24539
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -24495,7 +24542,7 @@ function useDataDnd(args) {
|
|
|
24495
24542
|
},
|
|
24496
24543
|
[]
|
|
24497
24544
|
);
|
|
24498
|
-
|
|
24545
|
+
React90__default.useCallback(
|
|
24499
24546
|
(group) => {
|
|
24500
24547
|
for (const z of zonesRef.current.values()) {
|
|
24501
24548
|
if (z.group === group) return z;
|
|
@@ -24504,7 +24551,7 @@ function useDataDnd(args) {
|
|
|
24504
24551
|
},
|
|
24505
24552
|
[]
|
|
24506
24553
|
);
|
|
24507
|
-
const handleDragEnd =
|
|
24554
|
+
const handleDragEnd = React90__default.useCallback(
|
|
24508
24555
|
(event) => {
|
|
24509
24556
|
const { active, over } = event;
|
|
24510
24557
|
const activeIdStr = String(active.id);
|
|
@@ -24595,8 +24642,8 @@ function useDataDnd(args) {
|
|
|
24595
24642
|
},
|
|
24596
24643
|
[eventBus]
|
|
24597
24644
|
);
|
|
24598
|
-
const sortableData =
|
|
24599
|
-
const SortableItem =
|
|
24645
|
+
const sortableData = React90__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
24646
|
+
const SortableItem = React90__default.useCallback(
|
|
24600
24647
|
({ id, children }) => {
|
|
24601
24648
|
const {
|
|
24602
24649
|
attributes,
|
|
@@ -24636,7 +24683,7 @@ function useDataDnd(args) {
|
|
|
24636
24683
|
id: droppableId,
|
|
24637
24684
|
data: sortableData
|
|
24638
24685
|
});
|
|
24639
|
-
const ctx =
|
|
24686
|
+
const ctx = React90__default.useContext(RootCtx);
|
|
24640
24687
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
24641
24688
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
24642
24689
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -24651,7 +24698,7 @@ function useDataDnd(args) {
|
|
|
24651
24698
|
showForeignPlaceholder,
|
|
24652
24699
|
ctxAvailable: ctx != null
|
|
24653
24700
|
});
|
|
24654
|
-
|
|
24701
|
+
React90__default.useEffect(() => {
|
|
24655
24702
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
24656
24703
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
24657
24704
|
return /* @__PURE__ */ jsx(
|
|
@@ -24665,11 +24712,11 @@ function useDataDnd(args) {
|
|
|
24665
24712
|
}
|
|
24666
24713
|
);
|
|
24667
24714
|
};
|
|
24668
|
-
const rootContextValue =
|
|
24715
|
+
const rootContextValue = React90__default.useMemo(
|
|
24669
24716
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
24670
24717
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
24671
24718
|
);
|
|
24672
|
-
const handleDragStart =
|
|
24719
|
+
const handleDragStart = React90__default.useCallback((event) => {
|
|
24673
24720
|
const sourceZone = findZoneByItem(event.active.id);
|
|
24674
24721
|
const rect = event.active.rect.current.initial;
|
|
24675
24722
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -24688,7 +24735,7 @@ function useDataDnd(args) {
|
|
|
24688
24735
|
isRoot
|
|
24689
24736
|
});
|
|
24690
24737
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
24691
|
-
const handleDragOver =
|
|
24738
|
+
const handleDragOver = React90__default.useCallback((event) => {
|
|
24692
24739
|
const { active, over } = event;
|
|
24693
24740
|
const overData = over?.data?.current;
|
|
24694
24741
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -24758,7 +24805,7 @@ function useDataDnd(args) {
|
|
|
24758
24805
|
return next;
|
|
24759
24806
|
});
|
|
24760
24807
|
}, []);
|
|
24761
|
-
const handleDragCancel =
|
|
24808
|
+
const handleDragCancel = React90__default.useCallback((event) => {
|
|
24762
24809
|
setActiveDrag(null);
|
|
24763
24810
|
setOverZoneGroup(null);
|
|
24764
24811
|
dndLog.warn("dragCancel", {
|
|
@@ -24766,12 +24813,12 @@ function useDataDnd(args) {
|
|
|
24766
24813
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
24767
24814
|
});
|
|
24768
24815
|
}, []);
|
|
24769
|
-
const handleDragEndWithCleanup =
|
|
24816
|
+
const handleDragEndWithCleanup = React90__default.useCallback((event) => {
|
|
24770
24817
|
handleDragEnd(event);
|
|
24771
24818
|
setActiveDrag(null);
|
|
24772
24819
|
setOverZoneGroup(null);
|
|
24773
24820
|
}, [handleDragEnd]);
|
|
24774
|
-
const wrapContainer =
|
|
24821
|
+
const wrapContainer = React90__default.useCallback(
|
|
24775
24822
|
(children) => {
|
|
24776
24823
|
if (!enabled) return children;
|
|
24777
24824
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -24825,7 +24872,7 @@ var init_useDataDnd = __esm({
|
|
|
24825
24872
|
init_useAlmadarDndCollision();
|
|
24826
24873
|
init_Box();
|
|
24827
24874
|
dndLog = createLogger("almadar:ui:dnd");
|
|
24828
|
-
RootCtx =
|
|
24875
|
+
RootCtx = React90__default.createContext(null);
|
|
24829
24876
|
}
|
|
24830
24877
|
});
|
|
24831
24878
|
function renderIconInput(icon, props) {
|
|
@@ -24968,8 +25015,8 @@ function DataGrid({
|
|
|
24968
25015
|
const hasRenderProp = typeof children === "function";
|
|
24969
25016
|
useEffect(() => {
|
|
24970
25017
|
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
24971
|
-
const
|
|
24972
|
-
const isFnLambda =
|
|
25018
|
+
const schemaArr = Array.isArray(schemaRenderItem) ? schemaRenderItem : null;
|
|
25019
|
+
const isFnLambda = schemaArr !== null && schemaArr.length >= 3 && (schemaArr[0] === "fn" || schemaArr[0] === "lambda");
|
|
24973
25020
|
dataGridLog.warn("renderItem-unresolved", {
|
|
24974
25021
|
rowCount: data.length,
|
|
24975
25022
|
renderItemIsFnLambda: isFnLambda
|
|
@@ -25351,7 +25398,7 @@ function DataList({
|
|
|
25351
25398
|
}) {
|
|
25352
25399
|
const eventBus = useEventBus();
|
|
25353
25400
|
const { t } = useTranslate();
|
|
25354
|
-
const [visibleCount, setVisibleCount] =
|
|
25401
|
+
const [visibleCount, setVisibleCount] = React90__default.useState(pageSize || Infinity);
|
|
25355
25402
|
const fieldDefs = fields ?? columns ?? [];
|
|
25356
25403
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
25357
25404
|
const dnd = useDataDnd({
|
|
@@ -25370,21 +25417,20 @@ function DataList({
|
|
|
25370
25417
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
25371
25418
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
25372
25419
|
const hasRenderProp = typeof children === "function";
|
|
25373
|
-
|
|
25420
|
+
React90__default.useEffect(() => {
|
|
25374
25421
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
25375
25422
|
const childrenTypeOf = typeof children;
|
|
25376
25423
|
if (data.length > 0 && !hasRenderProp) {
|
|
25377
25424
|
const firstRow = data[0];
|
|
25378
25425
|
const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
|
|
25379
|
-
const
|
|
25380
|
-
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
25426
|
+
const isFnLambda = Array.isArray(schemaRenderItem) && schemaRenderItem.length >= 3 && (schemaRenderItem[0] === "fn" || schemaRenderItem[0] === "lambda");
|
|
25381
25427
|
dataListLog.warn("renderItem-unresolved", {
|
|
25382
25428
|
rowCount: data.length,
|
|
25383
25429
|
fieldsCount: fieldDefs.length,
|
|
25384
25430
|
renderItemTypeOf,
|
|
25385
|
-
renderItemIsArray: Array.isArray(
|
|
25431
|
+
renderItemIsArray: Array.isArray(schemaRenderItem),
|
|
25386
25432
|
renderItemIsFnLambda: isFnLambda,
|
|
25387
|
-
renderItemHead: Array.isArray(
|
|
25433
|
+
renderItemHead: Array.isArray(schemaRenderItem) ? String(schemaRenderItem[0]) : void 0,
|
|
25388
25434
|
childrenTypeOf,
|
|
25389
25435
|
sampleRowKeys: sampleKeys
|
|
25390
25436
|
});
|
|
@@ -25472,10 +25518,10 @@ function DataList({
|
|
|
25472
25518
|
const isCompact = variant === "compact";
|
|
25473
25519
|
const isMessage = variant === "message";
|
|
25474
25520
|
if (isMessage) {
|
|
25475
|
-
const items2 = data
|
|
25521
|
+
const items2 = [...data];
|
|
25476
25522
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
25477
25523
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
25478
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25524
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
25479
25525
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
25480
25526
|
group.items.map((itemData, index) => {
|
|
25481
25527
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -25521,7 +25567,7 @@ function DataList({
|
|
|
25521
25567
|
})
|
|
25522
25568
|
] }, gi)) });
|
|
25523
25569
|
}
|
|
25524
|
-
const items = data
|
|
25570
|
+
const items = [...data];
|
|
25525
25571
|
const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
|
|
25526
25572
|
const idFieldName = dndItemIdField ?? "id";
|
|
25527
25573
|
const renderItem = (itemData, index, isLast) => {
|
|
@@ -25616,7 +25662,7 @@ function DataList({
|
|
|
25616
25662
|
className
|
|
25617
25663
|
),
|
|
25618
25664
|
children: [
|
|
25619
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25665
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
25620
25666
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
25621
25667
|
group.items.map(
|
|
25622
25668
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26409,23 +26455,19 @@ var init_Flex = __esm({
|
|
|
26409
26455
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
26410
26456
|
}
|
|
26411
26457
|
}
|
|
26412
|
-
|
|
26413
|
-
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
|
|
26418
|
-
|
|
26419
|
-
|
|
26420
|
-
|
|
26421
|
-
|
|
26422
|
-
|
|
26423
|
-
|
|
26424
|
-
|
|
26425
|
-
style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
|
|
26426
|
-
children
|
|
26427
|
-
}
|
|
26428
|
-
);
|
|
26458
|
+
return React90__default.createElement(Component2, {
|
|
26459
|
+
className: cn(
|
|
26460
|
+
inline ? "inline-flex" : "flex",
|
|
26461
|
+
directionStyles[direction],
|
|
26462
|
+
wrapStyles[wrap],
|
|
26463
|
+
alignStyles3[align],
|
|
26464
|
+
justifyStyles2[justify],
|
|
26465
|
+
gapStyles6[gap],
|
|
26466
|
+
className
|
|
26467
|
+
),
|
|
26468
|
+
style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
|
|
26469
|
+
children
|
|
26470
|
+
});
|
|
26429
26471
|
};
|
|
26430
26472
|
Flex.displayName = "Flex";
|
|
26431
26473
|
}
|
|
@@ -26532,7 +26574,7 @@ var init_Grid = __esm({
|
|
|
26532
26574
|
as: Component2 = "div"
|
|
26533
26575
|
}) => {
|
|
26534
26576
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
26535
|
-
return
|
|
26577
|
+
return React90__default.createElement(
|
|
26536
26578
|
Component2,
|
|
26537
26579
|
{
|
|
26538
26580
|
className: cn(
|
|
@@ -26728,9 +26770,9 @@ var init_Popover = __esm({
|
|
|
26728
26770
|
onMouseLeave: handleClose,
|
|
26729
26771
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26730
26772
|
};
|
|
26731
|
-
const childElement =
|
|
26773
|
+
const childElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26732
26774
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26733
|
-
const triggerElement =
|
|
26775
|
+
const triggerElement = React90__default.cloneElement(
|
|
26734
26776
|
childElement,
|
|
26735
26777
|
{
|
|
26736
26778
|
ref: triggerRef,
|
|
@@ -27332,9 +27374,9 @@ var init_Tooltip = __esm({
|
|
|
27332
27374
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
27333
27375
|
};
|
|
27334
27376
|
}, []);
|
|
27335
|
-
const triggerElement =
|
|
27377
|
+
const triggerElement = React90__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27336
27378
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
27337
|
-
const trigger =
|
|
27379
|
+
const trigger = React90__default.cloneElement(triggerElement, {
|
|
27338
27380
|
ref: triggerRef,
|
|
27339
27381
|
onMouseEnter: handleMouseEnter,
|
|
27340
27382
|
onMouseLeave: handleMouseLeave,
|
|
@@ -27424,7 +27466,7 @@ var init_WizardProgress = __esm({
|
|
|
27424
27466
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
27425
27467
|
const isActive = index === currentStep;
|
|
27426
27468
|
const isCompleted = index < currentStep;
|
|
27427
|
-
return /* @__PURE__ */ jsxs(
|
|
27469
|
+
return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
27428
27470
|
/* @__PURE__ */ jsx(
|
|
27429
27471
|
"button",
|
|
27430
27472
|
{
|
|
@@ -27736,13 +27778,14 @@ var init_ViolationAlert = __esm({
|
|
|
27736
27778
|
onNavigateToField,
|
|
27737
27779
|
compact = false,
|
|
27738
27780
|
className,
|
|
27739
|
-
|
|
27781
|
+
message
|
|
27740
27782
|
}) => {
|
|
27741
27783
|
const { t } = useTranslate();
|
|
27784
|
+
const fallbackMessage = message ?? t("violationAlert.fallbackMessage");
|
|
27742
27785
|
const resolvedViolation = violation ?? {
|
|
27743
27786
|
law: "",
|
|
27744
27787
|
article: "",
|
|
27745
|
-
message:
|
|
27788
|
+
message: fallbackMessage,
|
|
27746
27789
|
actionType: "measure"
|
|
27747
27790
|
};
|
|
27748
27791
|
const effectiveSeverity = severity ?? (resolvedViolation.actionType === "measure" ? "warning" : "error");
|
|
@@ -28487,7 +28530,7 @@ function InventoryGrid({
|
|
|
28487
28530
|
const eventBus = useEventBus();
|
|
28488
28531
|
const slotCount = totalSlots ?? items.length;
|
|
28489
28532
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
28490
|
-
const handleSelect =
|
|
28533
|
+
const handleSelect = React90.useCallback(
|
|
28491
28534
|
(id) => {
|
|
28492
28535
|
onSelect?.(id);
|
|
28493
28536
|
if (selectEvent) {
|
|
@@ -28722,31 +28765,31 @@ function GameCanvas2D({
|
|
|
28722
28765
|
assetBaseUrl,
|
|
28723
28766
|
className
|
|
28724
28767
|
}) {
|
|
28725
|
-
const canvasRef =
|
|
28726
|
-
const rafRef =
|
|
28727
|
-
const frameRef =
|
|
28728
|
-
const lastTimeRef =
|
|
28729
|
-
const imageCache =
|
|
28768
|
+
const canvasRef = React90.useRef(null);
|
|
28769
|
+
const rafRef = React90.useRef(0);
|
|
28770
|
+
const frameRef = React90.useRef(0);
|
|
28771
|
+
const lastTimeRef = React90.useRef(0);
|
|
28772
|
+
const imageCache = React90.useRef(/* @__PURE__ */ new Map());
|
|
28730
28773
|
const emit = useEmitEvent();
|
|
28731
|
-
const onDrawRef =
|
|
28774
|
+
const onDrawRef = React90.useRef(onDraw);
|
|
28732
28775
|
onDrawRef.current = onDraw;
|
|
28733
|
-
const onTickRef =
|
|
28776
|
+
const onTickRef = React90.useRef(onTick);
|
|
28734
28777
|
onTickRef.current = onTick;
|
|
28735
|
-
const tickEventRef =
|
|
28778
|
+
const tickEventRef = React90.useRef(tickEvent);
|
|
28736
28779
|
tickEventRef.current = tickEvent;
|
|
28737
|
-
const drawEventRef =
|
|
28780
|
+
const drawEventRef = React90.useRef(drawEvent);
|
|
28738
28781
|
drawEventRef.current = drawEvent;
|
|
28739
|
-
const emitRef =
|
|
28782
|
+
const emitRef = React90.useRef(emit);
|
|
28740
28783
|
emitRef.current = emit;
|
|
28741
|
-
const assetBaseUrlRef =
|
|
28784
|
+
const assetBaseUrlRef = React90.useRef(assetBaseUrl);
|
|
28742
28785
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
28743
|
-
const backgroundImageRef =
|
|
28786
|
+
const backgroundImageRef = React90.useRef(backgroundImage);
|
|
28744
28787
|
backgroundImageRef.current = backgroundImage;
|
|
28745
|
-
const widthRef =
|
|
28788
|
+
const widthRef = React90.useRef(width);
|
|
28746
28789
|
widthRef.current = width;
|
|
28747
|
-
const heightRef =
|
|
28790
|
+
const heightRef = React90.useRef(height);
|
|
28748
28791
|
heightRef.current = height;
|
|
28749
|
-
const loadImage =
|
|
28792
|
+
const loadImage = React90.useCallback((url) => {
|
|
28750
28793
|
const base = assetBaseUrlRef.current;
|
|
28751
28794
|
if (!url.startsWith("http") && !base) return null;
|
|
28752
28795
|
const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
|
|
@@ -28760,7 +28803,7 @@ function GameCanvas2D({
|
|
|
28760
28803
|
}
|
|
28761
28804
|
return null;
|
|
28762
28805
|
}, []);
|
|
28763
|
-
|
|
28806
|
+
React90.useEffect(() => {
|
|
28764
28807
|
const canvas = canvasRef.current;
|
|
28765
28808
|
if (!canvas) return;
|
|
28766
28809
|
const ctx = canvas.getContext("2d");
|
|
@@ -29085,7 +29128,7 @@ function TurnPanel({
|
|
|
29085
29128
|
className
|
|
29086
29129
|
}) {
|
|
29087
29130
|
const eventBus = useEventBus();
|
|
29088
|
-
const handleAction =
|
|
29131
|
+
const handleAction = React90.useCallback(
|
|
29089
29132
|
(event) => {
|
|
29090
29133
|
if (event) {
|
|
29091
29134
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -29266,7 +29309,7 @@ function UnitCommandBar({
|
|
|
29266
29309
|
className
|
|
29267
29310
|
}) {
|
|
29268
29311
|
const eventBus = useEventBus();
|
|
29269
|
-
const handleCommand =
|
|
29312
|
+
const handleCommand = React90.useCallback(
|
|
29270
29313
|
(event) => {
|
|
29271
29314
|
if (event) {
|
|
29272
29315
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -29817,7 +29860,7 @@ function GameMenu({
|
|
|
29817
29860
|
} catch {
|
|
29818
29861
|
}
|
|
29819
29862
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29820
|
-
const handleOptionClick =
|
|
29863
|
+
const handleOptionClick = React90.useCallback(
|
|
29821
29864
|
(option) => {
|
|
29822
29865
|
if (option.event && eventBus) {
|
|
29823
29866
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -29936,7 +29979,7 @@ function GameOverScreen({
|
|
|
29936
29979
|
} catch {
|
|
29937
29980
|
}
|
|
29938
29981
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29939
|
-
const handleActionClick =
|
|
29982
|
+
const handleActionClick = React90.useCallback(
|
|
29940
29983
|
(action) => {
|
|
29941
29984
|
if (action.event && eventBus) {
|
|
29942
29985
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -30868,7 +30911,7 @@ var init_MapView = __esm({
|
|
|
30868
30911
|
shadowSize: [41, 41]
|
|
30869
30912
|
});
|
|
30870
30913
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30871
|
-
const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback126, useState: useState113 } =
|
|
30914
|
+
const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback126, useState: useState113 } = React90__default;
|
|
30872
30915
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30873
30916
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30874
30917
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -31704,6 +31747,15 @@ function renderIconInput3(icon, props) {
|
|
|
31704
31747
|
function columnLabel(col) {
|
|
31705
31748
|
return col.header ?? col.label ?? col.key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
31706
31749
|
}
|
|
31750
|
+
function asFieldValue(v) {
|
|
31751
|
+
if (v === void 0 || v === null) return v;
|
|
31752
|
+
const t = typeof v;
|
|
31753
|
+
if (t === "string" || t === "number" || t === "boolean") return v;
|
|
31754
|
+
if (v instanceof Date) return v;
|
|
31755
|
+
if (Array.isArray(v)) return v;
|
|
31756
|
+
if (t === "object") return v;
|
|
31757
|
+
return void 0;
|
|
31758
|
+
}
|
|
31707
31759
|
function statusVariant4(value) {
|
|
31708
31760
|
const v = value.toLowerCase();
|
|
31709
31761
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online", "ok"].includes(v)) return "success";
|
|
@@ -31774,8 +31826,8 @@ function TableView({
|
|
|
31774
31826
|
}) {
|
|
31775
31827
|
const eventBus = useEventBus();
|
|
31776
31828
|
const { t } = useTranslate();
|
|
31777
|
-
const [visibleCount, setVisibleCount] =
|
|
31778
|
-
const [localSelected, setLocalSelected] =
|
|
31829
|
+
const [visibleCount, setVisibleCount] = React90__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31830
|
+
const [localSelected, setLocalSelected] = React90__default.useState(/* @__PURE__ */ new Set());
|
|
31779
31831
|
const colDefs = columns ?? fields ?? [];
|
|
31780
31832
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31781
31833
|
const dnd = useDataDnd({
|
|
@@ -31920,7 +31972,7 @@ function TableView({
|
|
|
31920
31972
|
}
|
|
31921
31973
|
) }),
|
|
31922
31974
|
hasRenderProp ? /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(row, index) }) : colDefs.map((col) => {
|
|
31923
|
-
const raw = getNestedValue(row, col.field ?? col.key);
|
|
31975
|
+
const raw = asFieldValue(getNestedValue(row, col.field ?? col.key));
|
|
31924
31976
|
const cellBase = cn(
|
|
31925
31977
|
"flex items-center min-w-0",
|
|
31926
31978
|
alignClass[col.align ?? "left"],
|
|
@@ -31970,12 +32022,12 @@ function TableView({
|
|
|
31970
32022
|
]
|
|
31971
32023
|
}
|
|
31972
32024
|
);
|
|
31973
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
32025
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React90__default.Fragment, { children: rowInner }, id);
|
|
31974
32026
|
};
|
|
31975
|
-
const items =
|
|
32027
|
+
const items = Array.from(data);
|
|
31976
32028
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31977
32029
|
let runningIndex = 0;
|
|
31978
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32030
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
31979
32031
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31980
32032
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31981
32033
|
] }, gi)) });
|
|
@@ -33332,7 +33384,7 @@ var init_StepFlow = __esm({
|
|
|
33332
33384
|
className
|
|
33333
33385
|
}) => {
|
|
33334
33386
|
if (orientation === "vertical") {
|
|
33335
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
33387
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
33336
33388
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
33337
33389
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33338
33390
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -33343,7 +33395,7 @@ var init_StepFlow = __esm({
|
|
|
33343
33395
|
] })
|
|
33344
33396
|
] }) }, index)) });
|
|
33345
33397
|
}
|
|
33346
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
33398
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
33347
33399
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
33348
33400
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33349
33401
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -34328,7 +34380,7 @@ var init_LikertScale = __esm({
|
|
|
34328
34380
|
md: "text-base",
|
|
34329
34381
|
lg: "text-lg"
|
|
34330
34382
|
};
|
|
34331
|
-
LikertScale =
|
|
34383
|
+
LikertScale = React90__default.forwardRef(
|
|
34332
34384
|
({
|
|
34333
34385
|
question,
|
|
34334
34386
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -34340,7 +34392,7 @@ var init_LikertScale = __esm({
|
|
|
34340
34392
|
variant = "radios",
|
|
34341
34393
|
className
|
|
34342
34394
|
}, ref) => {
|
|
34343
|
-
const groupId =
|
|
34395
|
+
const groupId = React90__default.useId();
|
|
34344
34396
|
const eventBus = useEventBus();
|
|
34345
34397
|
const handleSelect = useCallback(
|
|
34346
34398
|
(next) => {
|
|
@@ -35235,11 +35287,11 @@ function nextBlockId(prefix = "blk") {
|
|
|
35235
35287
|
function normalizeBlocks(raw) {
|
|
35236
35288
|
if (!Array.isArray(raw) || raw.length === 0) return [createBlock("paragraph")];
|
|
35237
35289
|
return raw.map((row) => {
|
|
35238
|
-
const
|
|
35239
|
-
const rawType =
|
|
35290
|
+
const entity = row;
|
|
35291
|
+
const rawType = entity.type;
|
|
35240
35292
|
const type = typeof rawType === "string" && BLOCK_TYPES.has(rawType) ? rawType : "paragraph";
|
|
35241
|
-
const id = typeof
|
|
35242
|
-
return { ...
|
|
35293
|
+
const id = typeof entity.id === "string" && entity.id ? entity.id : nextBlockId(type);
|
|
35294
|
+
return { ...entity, id, type };
|
|
35243
35295
|
});
|
|
35244
35296
|
}
|
|
35245
35297
|
function createBlock(type) {
|
|
@@ -36622,7 +36674,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36622
36674
|
"aria-label": t("aria.breadcrumb"),
|
|
36623
36675
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36624
36676
|
const isLast = idx === items.length - 1;
|
|
36625
|
-
return /* @__PURE__ */ jsxs(
|
|
36677
|
+
return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
36626
36678
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36627
36679
|
Icon,
|
|
36628
36680
|
{
|
|
@@ -37490,8 +37542,8 @@ var init_MiniStateMachine = __esm({
|
|
|
37490
37542
|
states.map((s, i) => {
|
|
37491
37543
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
37492
37544
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37493
|
-
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
37494
|
-
return /* @__PURE__ */ jsxs(
|
|
37545
|
+
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37546
|
+
return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
37495
37547
|
/* @__PURE__ */ jsx(
|
|
37496
37548
|
AvlState,
|
|
37497
37549
|
{
|
|
@@ -37501,8 +37553,8 @@ var init_MiniStateMachine = __esm({
|
|
|
37501
37553
|
height: NODE_H,
|
|
37502
37554
|
name: "",
|
|
37503
37555
|
role,
|
|
37504
|
-
isInitial: s.isInitial,
|
|
37505
|
-
isTerminal: s.isTerminal
|
|
37556
|
+
isInitial: s.isInitial ?? void 0,
|
|
37557
|
+
isTerminal: s.isTerminal ?? void 0
|
|
37506
37558
|
}
|
|
37507
37559
|
),
|
|
37508
37560
|
i < states.length - 1 && /* @__PURE__ */ jsxs("g", { children: [
|
|
@@ -37695,7 +37747,7 @@ var init_PageHeader = __esm({
|
|
|
37695
37747
|
info: "bg-info/10 text-info"
|
|
37696
37748
|
};
|
|
37697
37749
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37698
|
-
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(
|
|
37750
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
37699
37751
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37700
37752
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37701
37753
|
"a",
|
|
@@ -38053,52 +38105,49 @@ var init_Section = __esm({
|
|
|
38053
38105
|
as: Component2 = "section"
|
|
38054
38106
|
}) => {
|
|
38055
38107
|
const hasHeader = title || description || action;
|
|
38056
|
-
|
|
38057
|
-
|
|
38058
|
-
Comp,
|
|
38108
|
+
return React90__default.createElement(
|
|
38109
|
+
Component2,
|
|
38059
38110
|
{
|
|
38060
38111
|
className: cn(
|
|
38061
38112
|
paddingStyles4[padding],
|
|
38062
38113
|
variantStyles9[variant],
|
|
38063
38114
|
className
|
|
38064
|
-
)
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38070
|
-
|
|
38071
|
-
|
|
38072
|
-
|
|
38073
|
-
|
|
38074
|
-
),
|
|
38075
|
-
children: [
|
|
38076
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
38077
|
-
title && /* @__PURE__ */ jsx(
|
|
38078
|
-
Typography,
|
|
38079
|
-
{
|
|
38080
|
-
variant: "h4",
|
|
38081
|
-
className: "text-foreground font-semibold",
|
|
38082
|
-
children: title
|
|
38083
|
-
}
|
|
38084
|
-
),
|
|
38085
|
-
description && /* @__PURE__ */ jsx(
|
|
38086
|
-
Typography,
|
|
38087
|
-
{
|
|
38088
|
-
variant: "body",
|
|
38089
|
-
color: "muted",
|
|
38090
|
-
className: "mt-1",
|
|
38091
|
-
children: description
|
|
38092
|
-
}
|
|
38093
|
-
)
|
|
38094
|
-
] }),
|
|
38095
|
-
action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
|
|
38096
|
-
]
|
|
38097
|
-
}
|
|
38115
|
+
)
|
|
38116
|
+
},
|
|
38117
|
+
hasHeader && /* @__PURE__ */ jsxs(
|
|
38118
|
+
Box,
|
|
38119
|
+
{
|
|
38120
|
+
className: cn(
|
|
38121
|
+
"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
|
|
38122
|
+
divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
|
|
38123
|
+
!divider && "mb-4",
|
|
38124
|
+
headerClassName
|
|
38098
38125
|
),
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
|
|
38126
|
+
children: [
|
|
38127
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
38128
|
+
title && /* @__PURE__ */ jsx(
|
|
38129
|
+
Typography,
|
|
38130
|
+
{
|
|
38131
|
+
variant: "h4",
|
|
38132
|
+
className: "text-foreground font-semibold",
|
|
38133
|
+
children: title
|
|
38134
|
+
}
|
|
38135
|
+
),
|
|
38136
|
+
description && /* @__PURE__ */ jsx(
|
|
38137
|
+
Typography,
|
|
38138
|
+
{
|
|
38139
|
+
variant: "body",
|
|
38140
|
+
color: "muted",
|
|
38141
|
+
className: "mt-1",
|
|
38142
|
+
children: description
|
|
38143
|
+
}
|
|
38144
|
+
)
|
|
38145
|
+
] }),
|
|
38146
|
+
action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
|
|
38147
|
+
]
|
|
38148
|
+
}
|
|
38149
|
+
),
|
|
38150
|
+
/* @__PURE__ */ jsx(Box, { className: contentClassName, children })
|
|
38102
38151
|
);
|
|
38103
38152
|
};
|
|
38104
38153
|
Section.displayName = "Section";
|
|
@@ -38424,7 +38473,7 @@ var init_WizardContainer = __esm({
|
|
|
38424
38473
|
const isCompleted = index < currentStep;
|
|
38425
38474
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
38426
38475
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
38427
|
-
return /* @__PURE__ */ jsxs(
|
|
38476
|
+
return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
38428
38477
|
/* @__PURE__ */ jsx(
|
|
38429
38478
|
Button,
|
|
38430
38479
|
{
|
|
@@ -40367,6 +40416,22 @@ var init_DataTable = __esm({
|
|
|
40367
40416
|
DataTable.displayName = "DataTable";
|
|
40368
40417
|
}
|
|
40369
40418
|
});
|
|
40419
|
+
function toDebuggerLine(v) {
|
|
40420
|
+
if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
|
|
40421
|
+
const id = v["id"];
|
|
40422
|
+
const content = v["content"];
|
|
40423
|
+
const isBug = v["isBug"];
|
|
40424
|
+
if (typeof id !== "string" || typeof content !== "string" || typeof isBug !== "boolean") return null;
|
|
40425
|
+
const isFlagged = v["isFlagged"];
|
|
40426
|
+
const explanation = v["explanation"];
|
|
40427
|
+
return {
|
|
40428
|
+
id,
|
|
40429
|
+
content,
|
|
40430
|
+
isBug,
|
|
40431
|
+
isFlagged: typeof isFlagged === "boolean" ? isFlagged : void 0,
|
|
40432
|
+
explanation: typeof explanation === "string" ? explanation : void 0
|
|
40433
|
+
};
|
|
40434
|
+
}
|
|
40370
40435
|
function DebuggerBoard({
|
|
40371
40436
|
entity,
|
|
40372
40437
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -40379,7 +40444,10 @@ function DebuggerBoard({
|
|
|
40379
40444
|
const { t } = useTranslate();
|
|
40380
40445
|
const resolved = boardEntity(entity);
|
|
40381
40446
|
const [headerError, setHeaderError] = useState(false);
|
|
40382
|
-
const lines = Array.isArray(resolved?.lines) ? resolved.lines
|
|
40447
|
+
const lines = Array.isArray(resolved?.lines) ? resolved.lines.flatMap((v) => {
|
|
40448
|
+
const l = toDebuggerLine(v);
|
|
40449
|
+
return l ? [l] : [];
|
|
40450
|
+
}) : [];
|
|
40383
40451
|
const result = str(resolved?.result) || "none";
|
|
40384
40452
|
const attempts = num(resolved?.attempts);
|
|
40385
40453
|
const submitted = result === "win";
|
|
@@ -40984,7 +41052,7 @@ var init_DetailPanel = __esm({
|
|
|
40984
41052
|
}
|
|
40985
41053
|
});
|
|
40986
41054
|
function extractTitle(children) {
|
|
40987
|
-
if (!
|
|
41055
|
+
if (!React90__default.isValidElement(children)) return void 0;
|
|
40988
41056
|
const props = children.props;
|
|
40989
41057
|
if (typeof props.title === "string") {
|
|
40990
41058
|
return props.title;
|
|
@@ -41039,7 +41107,7 @@ function LinearView({
|
|
|
41039
41107
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
41040
41108
|
const isDone = i < currentIdx;
|
|
41041
41109
|
const isCurrent = i === currentIdx;
|
|
41042
|
-
return /* @__PURE__ */ jsxs(
|
|
41110
|
+
return /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
41043
41111
|
i > 0 && /* @__PURE__ */ jsx(
|
|
41044
41112
|
Typography,
|
|
41045
41113
|
{
|
|
@@ -41861,12 +41929,12 @@ function evaluateFormExpression(expr, formCtx) {
|
|
|
41861
41929
|
return evaluate(expr, ctx);
|
|
41862
41930
|
}
|
|
41863
41931
|
function isOrbitalEntitySchema(value) {
|
|
41864
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
41932
|
+
if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
|
|
41865
41933
|
const fields = value.fields;
|
|
41866
41934
|
return Array.isArray(fields);
|
|
41867
41935
|
}
|
|
41868
41936
|
function isPlainEntityRow(value) {
|
|
41869
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
41937
|
+
if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
|
|
41870
41938
|
const fields = value.fields;
|
|
41871
41939
|
return !Array.isArray(fields);
|
|
41872
41940
|
}
|
|
@@ -42025,12 +42093,12 @@ var init_Form = __esm({
|
|
|
42025
42093
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42026
42094
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42027
42095
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42028
|
-
const normalizedInitialData =
|
|
42096
|
+
const normalizedInitialData = React90__default.useMemo(() => {
|
|
42029
42097
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42030
42098
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42031
42099
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42032
42100
|
}, [entity, initialData]);
|
|
42033
|
-
const entityDerivedFields =
|
|
42101
|
+
const entityDerivedFields = React90__default.useMemo(() => {
|
|
42034
42102
|
if (fields && fields.length > 0) return void 0;
|
|
42035
42103
|
if (!resolvedEntity) return void 0;
|
|
42036
42104
|
return resolvedEntity.fields.map(
|
|
@@ -42038,6 +42106,7 @@ var init_Form = __esm({
|
|
|
42038
42106
|
name: f3.name,
|
|
42039
42107
|
type: f3.type,
|
|
42040
42108
|
required: f3.required,
|
|
42109
|
+
// EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
|
|
42041
42110
|
defaultValue: f3.default,
|
|
42042
42111
|
// EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
|
|
42043
42112
|
values: "values" in f3 ? f3.values : void 0,
|
|
@@ -42050,16 +42119,16 @@ var init_Form = __esm({
|
|
|
42050
42119
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42051
42120
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42052
42121
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42053
|
-
const [formData, setFormData] =
|
|
42122
|
+
const [formData, setFormData] = React90__default.useState(
|
|
42054
42123
|
normalizedInitialData
|
|
42055
42124
|
);
|
|
42056
|
-
const [collapsedSections, setCollapsedSections] =
|
|
42125
|
+
const [collapsedSections, setCollapsedSections] = React90__default.useState(
|
|
42057
42126
|
/* @__PURE__ */ new Set()
|
|
42058
42127
|
);
|
|
42059
|
-
const [submitError, setSubmitError] =
|
|
42060
|
-
const formRef =
|
|
42128
|
+
const [submitError, setSubmitError] = React90__default.useState(null);
|
|
42129
|
+
const formRef = React90__default.useRef(null);
|
|
42061
42130
|
const formMode = props.mode;
|
|
42062
|
-
const mountedRef =
|
|
42131
|
+
const mountedRef = React90__default.useRef(false);
|
|
42063
42132
|
if (!mountedRef.current) {
|
|
42064
42133
|
mountedRef.current = true;
|
|
42065
42134
|
debug("forms", "mount", {
|
|
@@ -42072,7 +42141,7 @@ var init_Form = __esm({
|
|
|
42072
42141
|
});
|
|
42073
42142
|
}
|
|
42074
42143
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42075
|
-
const evalContext =
|
|
42144
|
+
const evalContext = React90__default.useMemo(
|
|
42076
42145
|
() => ({
|
|
42077
42146
|
formValues: formData,
|
|
42078
42147
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42081,7 +42150,7 @@ var init_Form = __esm({
|
|
|
42081
42150
|
}),
|
|
42082
42151
|
[formData, externalContext]
|
|
42083
42152
|
);
|
|
42084
|
-
|
|
42153
|
+
React90__default.useEffect(() => {
|
|
42085
42154
|
debug("forms", "initialData-sync", {
|
|
42086
42155
|
mode: formMode,
|
|
42087
42156
|
normalizedInitialData,
|
|
@@ -42092,7 +42161,7 @@ var init_Form = __esm({
|
|
|
42092
42161
|
setFormData(normalizedInitialData);
|
|
42093
42162
|
}
|
|
42094
42163
|
}, [normalizedInitialData]);
|
|
42095
|
-
const processCalculations =
|
|
42164
|
+
const processCalculations = React90__default.useCallback(
|
|
42096
42165
|
(changedFieldId, newFormData) => {
|
|
42097
42166
|
if (!hiddenCalculations.length) return;
|
|
42098
42167
|
const context = {
|
|
@@ -42117,7 +42186,7 @@ var init_Form = __esm({
|
|
|
42117
42186
|
},
|
|
42118
42187
|
[hiddenCalculations, externalContext, eventBus]
|
|
42119
42188
|
);
|
|
42120
|
-
const checkViolations =
|
|
42189
|
+
const checkViolations = React90__default.useCallback(
|
|
42121
42190
|
(changedFieldId, newFormData) => {
|
|
42122
42191
|
if (!violationTriggers.length) return;
|
|
42123
42192
|
const context = {
|
|
@@ -42155,7 +42224,7 @@ var init_Form = __esm({
|
|
|
42155
42224
|
processCalculations(name, newFormData);
|
|
42156
42225
|
checkViolations(name, newFormData);
|
|
42157
42226
|
};
|
|
42158
|
-
const isFieldVisible =
|
|
42227
|
+
const isFieldVisible = React90__default.useCallback(
|
|
42159
42228
|
(fieldName) => {
|
|
42160
42229
|
const condition = conditionalFields[fieldName];
|
|
42161
42230
|
if (!condition) return true;
|
|
@@ -42163,7 +42232,7 @@ var init_Form = __esm({
|
|
|
42163
42232
|
},
|
|
42164
42233
|
[conditionalFields, evalContext]
|
|
42165
42234
|
);
|
|
42166
|
-
const isSectionVisible =
|
|
42235
|
+
const isSectionVisible = React90__default.useCallback(
|
|
42167
42236
|
(section) => {
|
|
42168
42237
|
if (!section.condition) return true;
|
|
42169
42238
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42239,7 +42308,7 @@ var init_Form = __esm({
|
|
|
42239
42308
|
eventBus.emit(`UI:${onCancel}`);
|
|
42240
42309
|
}
|
|
42241
42310
|
};
|
|
42242
|
-
const renderField =
|
|
42311
|
+
const renderField = React90__default.useCallback(
|
|
42243
42312
|
(field) => {
|
|
42244
42313
|
const fieldName = field.name || field.field;
|
|
42245
42314
|
if (!fieldName) return null;
|
|
@@ -42260,7 +42329,7 @@ var init_Form = __esm({
|
|
|
42260
42329
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42261
42330
|
);
|
|
42262
42331
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42263
|
-
const normalizedFields =
|
|
42332
|
+
const normalizedFields = React90__default.useMemo(() => {
|
|
42264
42333
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42265
42334
|
return effectiveFields.map((field) => {
|
|
42266
42335
|
if (typeof field === "string") {
|
|
@@ -42270,6 +42339,7 @@ var init_Form = __esm({
|
|
|
42270
42339
|
name: field,
|
|
42271
42340
|
type: entityField.type,
|
|
42272
42341
|
required: entityField.required,
|
|
42342
|
+
// EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
|
|
42273
42343
|
defaultValue: entityField.default,
|
|
42274
42344
|
// EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
|
|
42275
42345
|
values: "values" in entityField ? entityField.values : void 0,
|
|
@@ -42283,7 +42353,7 @@ var init_Form = __esm({
|
|
|
42283
42353
|
return field;
|
|
42284
42354
|
});
|
|
42285
42355
|
}, [effectiveFields, resolvedEntity]);
|
|
42286
|
-
const schemaFields =
|
|
42356
|
+
const schemaFields = React90__default.useMemo(() => {
|
|
42287
42357
|
if (normalizedFields.length === 0) return null;
|
|
42288
42358
|
if (isDebugEnabled()) {
|
|
42289
42359
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42293,7 +42363,7 @@ var init_Form = __esm({
|
|
|
42293
42363
|
}
|
|
42294
42364
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42295
42365
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42296
|
-
const sectionElements =
|
|
42366
|
+
const sectionElements = React90__default.useMemo(() => {
|
|
42297
42367
|
if (!sections || sections.length === 0) return null;
|
|
42298
42368
|
return sections.map((section) => {
|
|
42299
42369
|
if (!isSectionVisible(section)) {
|
|
@@ -44549,6 +44619,14 @@ var init_GameBoard3D = __esm({
|
|
|
44549
44619
|
GameBoard3D.displayName = "GameBoard3D";
|
|
44550
44620
|
}
|
|
44551
44621
|
});
|
|
44622
|
+
function asDescriptor(v) {
|
|
44623
|
+
if (Array.isArray(v) || React90__default.isValidElement(v)) return null;
|
|
44624
|
+
const o = v;
|
|
44625
|
+
if (typeof o.type !== "string") return null;
|
|
44626
|
+
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
44627
|
+
const _id = typeof o._id === "string" ? o._id : void 0;
|
|
44628
|
+
return { type: o.type, props, _id };
|
|
44629
|
+
}
|
|
44552
44630
|
function getSlotContentRenderer2() {
|
|
44553
44631
|
if (_scr) return _scr;
|
|
44554
44632
|
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
@@ -44557,17 +44635,16 @@ function getSlotContentRenderer2() {
|
|
|
44557
44635
|
}
|
|
44558
44636
|
function resolveDescriptor(value, idPrefix) {
|
|
44559
44637
|
if (value === null || value === void 0) return value;
|
|
44560
|
-
if (
|
|
44638
|
+
if (React90__default.isValidElement(value)) return value;
|
|
44561
44639
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44562
44640
|
if (Array.isArray(value)) {
|
|
44563
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44641
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
44564
44642
|
}
|
|
44565
|
-
if (typeof value === "object") {
|
|
44566
|
-
const
|
|
44567
|
-
if (
|
|
44568
|
-
const
|
|
44569
|
-
const
|
|
44570
|
-
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
44643
|
+
if (typeof value === "object" && value !== null) {
|
|
44644
|
+
const desc = asDescriptor(value);
|
|
44645
|
+
if (desc !== null && getComponentForPattern(desc.type) !== null) {
|
|
44646
|
+
const resolvedProps = desc.props ?? {};
|
|
44647
|
+
const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
|
|
44571
44648
|
const SCR = getSlotContentRenderer2();
|
|
44572
44649
|
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
44573
44650
|
}
|
|
@@ -44661,16 +44738,19 @@ function getSlotContentRenderer3() {
|
|
|
44661
44738
|
}
|
|
44662
44739
|
function resolveDescriptor2(value, idPrefix) {
|
|
44663
44740
|
if (value === null || value === void 0) return value;
|
|
44664
|
-
if (
|
|
44741
|
+
if (React90__default.isValidElement(value)) return value;
|
|
44665
44742
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44666
44743
|
if (Array.isArray(value)) {
|
|
44667
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44744
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React90__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
44668
44745
|
}
|
|
44669
44746
|
if (typeof value === "object") {
|
|
44670
44747
|
const rec = value;
|
|
44671
44748
|
if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
|
|
44672
|
-
const
|
|
44673
|
-
const
|
|
44749
|
+
const type = rec.type;
|
|
44750
|
+
const _id = typeof rec._id === "string" ? rec._id : void 0;
|
|
44751
|
+
const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
|
|
44752
|
+
const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
|
|
44753
|
+
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
|
|
44674
44754
|
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
44675
44755
|
const SCR = getSlotContentRenderer3();
|
|
44676
44756
|
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
@@ -44998,35 +45078,44 @@ var init_HexStrategyBoard = __esm({
|
|
|
44998
45078
|
}
|
|
44999
45079
|
});
|
|
45000
45080
|
function HolidayRunnerBoard({
|
|
45001
|
-
|
|
45081
|
+
tiles,
|
|
45082
|
+
units,
|
|
45083
|
+
features,
|
|
45084
|
+
assetManifest,
|
|
45002
45085
|
assetBaseUrl,
|
|
45003
|
-
|
|
45004
|
-
|
|
45005
|
-
|
|
45086
|
+
scale = 0.45,
|
|
45087
|
+
showMinimap = false,
|
|
45088
|
+
enableCamera = true,
|
|
45089
|
+
tileClickEvent,
|
|
45090
|
+
unitClickEvent,
|
|
45006
45091
|
isLoading,
|
|
45007
45092
|
error,
|
|
45008
45093
|
className
|
|
45009
45094
|
}) {
|
|
45010
|
-
return /* @__PURE__ */
|
|
45011
|
-
|
|
45012
|
-
|
|
45013
|
-
|
|
45014
|
-
|
|
45015
|
-
|
|
45016
|
-
|
|
45017
|
-
|
|
45018
|
-
|
|
45019
|
-
|
|
45020
|
-
|
|
45021
|
-
|
|
45022
|
-
|
|
45023
|
-
|
|
45095
|
+
return /* @__PURE__ */ jsx("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
45096
|
+
IsometricCanvas_default,
|
|
45097
|
+
{
|
|
45098
|
+
tileLayout: "flat",
|
|
45099
|
+
tiles,
|
|
45100
|
+
units,
|
|
45101
|
+
features,
|
|
45102
|
+
assetManifest,
|
|
45103
|
+
assetBaseUrl,
|
|
45104
|
+
scale,
|
|
45105
|
+
showMinimap,
|
|
45106
|
+
enableCamera,
|
|
45107
|
+
tileClickEvent,
|
|
45108
|
+
unitClickEvent,
|
|
45109
|
+
isLoading,
|
|
45110
|
+
error
|
|
45111
|
+
}
|
|
45112
|
+
) });
|
|
45024
45113
|
}
|
|
45025
45114
|
var init_HolidayRunnerBoard = __esm({
|
|
45026
45115
|
"components/game/organisms/HolidayRunnerBoard.tsx"() {
|
|
45027
45116
|
"use client";
|
|
45028
45117
|
init_cn();
|
|
45029
|
-
|
|
45118
|
+
init_IsometricCanvas();
|
|
45030
45119
|
HolidayRunnerBoard.displayName = "HolidayRunnerBoard";
|
|
45031
45120
|
}
|
|
45032
45121
|
});
|
|
@@ -45365,7 +45454,7 @@ var init_List = __esm({
|
|
|
45365
45454
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
45366
45455
|
return [];
|
|
45367
45456
|
}, [entity]);
|
|
45368
|
-
const getItemActions =
|
|
45457
|
+
const getItemActions = React90__default.useCallback(
|
|
45369
45458
|
(item) => {
|
|
45370
45459
|
if (!itemActions) return [];
|
|
45371
45460
|
if (typeof itemActions === "function") {
|
|
@@ -45422,15 +45511,14 @@ var init_List = __esm({
|
|
|
45422
45511
|
};
|
|
45423
45512
|
if (effectiveFieldNames && effectiveFieldNames.length > 0) {
|
|
45424
45513
|
const firstField = effectiveFieldNames[0];
|
|
45425
|
-
|
|
45426
|
-
if (!normalizedItem.title && getNestedValue(itemRecord, firstField)) {
|
|
45514
|
+
if (!normalizedItem.title && getNestedValue(item, firstField)) {
|
|
45427
45515
|
normalizedItem.title = String(
|
|
45428
|
-
getNestedValue(
|
|
45516
|
+
getNestedValue(item, firstField)
|
|
45429
45517
|
);
|
|
45430
45518
|
}
|
|
45431
45519
|
normalizedItem._fields = effectiveFieldNames.reduce(
|
|
45432
45520
|
(acc, field) => {
|
|
45433
|
-
const value = getNestedValue(
|
|
45521
|
+
const value = getNestedValue(item, field);
|
|
45434
45522
|
if (value !== void 0 && value !== null) {
|
|
45435
45523
|
acc[field] = value;
|
|
45436
45524
|
}
|
|
@@ -45883,16 +45971,18 @@ var init_MediaGallery = __esm({
|
|
|
45883
45971
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
45884
45972
|
);
|
|
45885
45973
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45886
|
-
const items =
|
|
45974
|
+
const items = React90__default.useMemo(() => {
|
|
45887
45975
|
if (propItems) return propItems;
|
|
45888
45976
|
if (entityData.length === 0) return [];
|
|
45889
|
-
return entityData.map((record, idx) =>
|
|
45890
|
-
|
|
45891
|
-
|
|
45892
|
-
|
|
45893
|
-
|
|
45894
|
-
|
|
45895
|
-
|
|
45977
|
+
return entityData.map((record, idx) => {
|
|
45978
|
+
return {
|
|
45979
|
+
id: String(record.id ?? idx),
|
|
45980
|
+
src: String(record.src ?? ("url" in record ? record.url : "") ?? ("image" in record ? record.image : "") ?? ""),
|
|
45981
|
+
alt: record.alt ? String(record.alt) : void 0,
|
|
45982
|
+
thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
|
|
45983
|
+
caption: record.caption ? String(record.caption) : "title" in record ? String(record.title) : void 0
|
|
45984
|
+
};
|
|
45985
|
+
});
|
|
45896
45986
|
}, [propItems, entityData]);
|
|
45897
45987
|
if (isLoading) {
|
|
45898
45988
|
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
@@ -46086,7 +46176,7 @@ var init_MinigolfBoard = __esm({
|
|
|
46086
46176
|
}
|
|
46087
46177
|
});
|
|
46088
46178
|
function extractTitle2(children) {
|
|
46089
|
-
if (!
|
|
46179
|
+
if (!React90__default.isValidElement(children)) return void 0;
|
|
46090
46180
|
const props = children.props;
|
|
46091
46181
|
if (typeof props.title === "string") {
|
|
46092
46182
|
return props.title;
|
|
@@ -46152,8 +46242,16 @@ function NegotiatorBoard({
|
|
|
46152
46242
|
const lastPlayerAction = str(resolved?.lastPlayerAction);
|
|
46153
46243
|
const lastOpponentAction = str(resolved?.lastOpponentAction);
|
|
46154
46244
|
const lastPayoff = num(resolved?.lastPayoff);
|
|
46155
|
-
const actions = Array.isArray(resolved?.actions) ? resolved.actions
|
|
46156
|
-
|
|
46245
|
+
const actions = Array.isArray(resolved?.actions) ? resolved.actions.flatMap((item) => {
|
|
46246
|
+
if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.id === "string" && typeof item.label === "string")
|
|
46247
|
+
return [{ id: item.id, label: item.label, description: typeof item.description === "string" ? item.description : void 0 }];
|
|
46248
|
+
return [];
|
|
46249
|
+
}) : [];
|
|
46250
|
+
const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix.flatMap((item) => {
|
|
46251
|
+
if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.playerAction === "string" && typeof item.opponentAction === "string")
|
|
46252
|
+
return [{ playerAction: item.playerAction, opponentAction: item.opponentAction, playerPayoff: typeof item.playerPayoff === "number" ? item.playerPayoff : 0, opponentPayoff: typeof item.opponentPayoff === "number" ? item.opponentPayoff : 0 }];
|
|
46253
|
+
return [];
|
|
46254
|
+
}) : [];
|
|
46157
46255
|
const prevRoundRef = useRef(currentRound);
|
|
46158
46256
|
useEffect(() => {
|
|
46159
46257
|
if (currentRound > prevRoundRef.current && lastPlayerAction) {
|
|
@@ -46744,25 +46842,36 @@ var init_PricingPageTemplate = __esm({
|
|
|
46744
46842
|
}
|
|
46745
46843
|
});
|
|
46746
46844
|
function RacingBoard({
|
|
46747
|
-
|
|
46845
|
+
tiles,
|
|
46846
|
+
units,
|
|
46847
|
+
features,
|
|
46848
|
+
assetManifest,
|
|
46748
46849
|
assetBaseUrl,
|
|
46749
|
-
|
|
46750
|
-
|
|
46751
|
-
|
|
46752
|
-
|
|
46753
|
-
|
|
46850
|
+
scale = 0.45,
|
|
46851
|
+
showMinimap = true,
|
|
46852
|
+
enableCamera = true,
|
|
46853
|
+
tileClickEvent,
|
|
46854
|
+
unitClickEvent,
|
|
46855
|
+
isLoading,
|
|
46856
|
+
error,
|
|
46754
46857
|
className
|
|
46755
46858
|
}) {
|
|
46756
46859
|
return /* @__PURE__ */ jsx("div", { className: cn("racing-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
46757
|
-
|
|
46860
|
+
IsometricCanvas_default,
|
|
46758
46861
|
{
|
|
46759
|
-
|
|
46862
|
+
tileLayout: "flat",
|
|
46863
|
+
tiles,
|
|
46864
|
+
units,
|
|
46865
|
+
features,
|
|
46866
|
+
assetManifest,
|
|
46760
46867
|
assetBaseUrl,
|
|
46761
|
-
|
|
46762
|
-
|
|
46763
|
-
|
|
46764
|
-
|
|
46765
|
-
|
|
46868
|
+
scale,
|
|
46869
|
+
showMinimap,
|
|
46870
|
+
enableCamera,
|
|
46871
|
+
tileClickEvent,
|
|
46872
|
+
unitClickEvent,
|
|
46873
|
+
isLoading,
|
|
46874
|
+
error
|
|
46766
46875
|
}
|
|
46767
46876
|
) });
|
|
46768
46877
|
}
|
|
@@ -46770,7 +46879,7 @@ var init_RacingBoard = __esm({
|
|
|
46770
46879
|
"components/game/organisms/RacingBoard.tsx"() {
|
|
46771
46880
|
"use client";
|
|
46772
46881
|
init_cn();
|
|
46773
|
-
|
|
46882
|
+
init_IsometricCanvas();
|
|
46774
46883
|
RacingBoard.displayName = "RacingBoard";
|
|
46775
46884
|
}
|
|
46776
46885
|
});
|
|
@@ -47249,7 +47358,7 @@ var init_debugRegistry = __esm({
|
|
|
47249
47358
|
}
|
|
47250
47359
|
});
|
|
47251
47360
|
function useDebugData() {
|
|
47252
|
-
const [data, setData] =
|
|
47361
|
+
const [data, setData] = React90.useState(() => ({
|
|
47253
47362
|
traits: [],
|
|
47254
47363
|
ticks: [],
|
|
47255
47364
|
guards: [],
|
|
@@ -47263,7 +47372,7 @@ function useDebugData() {
|
|
|
47263
47372
|
},
|
|
47264
47373
|
lastUpdate: Date.now()
|
|
47265
47374
|
}));
|
|
47266
|
-
|
|
47375
|
+
React90.useEffect(() => {
|
|
47267
47376
|
const updateData = () => {
|
|
47268
47377
|
setData({
|
|
47269
47378
|
traits: getAllTraits(),
|
|
@@ -47372,12 +47481,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
47372
47481
|
return positions;
|
|
47373
47482
|
}
|
|
47374
47483
|
function WalkMinimap() {
|
|
47375
|
-
const [walkStep, setWalkStep] =
|
|
47376
|
-
const [traits2, setTraits] =
|
|
47377
|
-
const [coveredEdges, setCoveredEdges] =
|
|
47378
|
-
const [completedTraits, setCompletedTraits] =
|
|
47379
|
-
const prevTraitRef =
|
|
47380
|
-
|
|
47484
|
+
const [walkStep, setWalkStep] = React90.useState(null);
|
|
47485
|
+
const [traits2, setTraits] = React90.useState([]);
|
|
47486
|
+
const [coveredEdges, setCoveredEdges] = React90.useState([]);
|
|
47487
|
+
const [completedTraits, setCompletedTraits] = React90.useState(/* @__PURE__ */ new Set());
|
|
47488
|
+
const prevTraitRef = React90.useRef(null);
|
|
47489
|
+
React90.useEffect(() => {
|
|
47381
47490
|
const interval = setInterval(() => {
|
|
47382
47491
|
const w = window;
|
|
47383
47492
|
const step = w.__orbitalWalkStep;
|
|
@@ -47813,15 +47922,15 @@ var init_EntitiesTab = __esm({
|
|
|
47813
47922
|
});
|
|
47814
47923
|
function EventFlowTab({ events: events2 }) {
|
|
47815
47924
|
const { t } = useTranslate();
|
|
47816
|
-
const [filter, setFilter] =
|
|
47817
|
-
const containerRef =
|
|
47818
|
-
const [autoScroll, setAutoScroll] =
|
|
47819
|
-
|
|
47925
|
+
const [filter, setFilter] = React90.useState("all");
|
|
47926
|
+
const containerRef = React90.useRef(null);
|
|
47927
|
+
const [autoScroll, setAutoScroll] = React90.useState(true);
|
|
47928
|
+
React90.useEffect(() => {
|
|
47820
47929
|
if (autoScroll && containerRef.current) {
|
|
47821
47930
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
47822
47931
|
}
|
|
47823
47932
|
}, [events2.length, autoScroll]);
|
|
47824
|
-
const filteredEvents =
|
|
47933
|
+
const filteredEvents = React90.useMemo(() => {
|
|
47825
47934
|
if (filter === "all") return events2;
|
|
47826
47935
|
return events2.filter((e) => e.type === filter);
|
|
47827
47936
|
}, [events2, filter]);
|
|
@@ -47937,7 +48046,7 @@ var init_EventFlowTab = __esm({
|
|
|
47937
48046
|
});
|
|
47938
48047
|
function GuardsPanel({ guards }) {
|
|
47939
48048
|
const { t } = useTranslate();
|
|
47940
|
-
const [filter, setFilter] =
|
|
48049
|
+
const [filter, setFilter] = React90.useState("all");
|
|
47941
48050
|
if (guards.length === 0) {
|
|
47942
48051
|
return /* @__PURE__ */ jsx(
|
|
47943
48052
|
EmptyState,
|
|
@@ -47950,7 +48059,7 @@ function GuardsPanel({ guards }) {
|
|
|
47950
48059
|
}
|
|
47951
48060
|
const passedCount = guards.filter((g) => g.result).length;
|
|
47952
48061
|
const failedCount = guards.length - passedCount;
|
|
47953
|
-
const filteredGuards =
|
|
48062
|
+
const filteredGuards = React90.useMemo(() => {
|
|
47954
48063
|
if (filter === "all") return guards;
|
|
47955
48064
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
47956
48065
|
return guards.filter((g) => !g.result);
|
|
@@ -48113,10 +48222,10 @@ function EffectBadge({ effect }) {
|
|
|
48113
48222
|
}
|
|
48114
48223
|
function TransitionTimeline({ transitions }) {
|
|
48115
48224
|
const { t } = useTranslate();
|
|
48116
|
-
const containerRef =
|
|
48117
|
-
const [autoScroll, setAutoScroll] =
|
|
48118
|
-
const [expandedId, setExpandedId] =
|
|
48119
|
-
|
|
48225
|
+
const containerRef = React90.useRef(null);
|
|
48226
|
+
const [autoScroll, setAutoScroll] = React90.useState(true);
|
|
48227
|
+
const [expandedId, setExpandedId] = React90.useState(null);
|
|
48228
|
+
React90.useEffect(() => {
|
|
48120
48229
|
if (autoScroll && containerRef.current) {
|
|
48121
48230
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48122
48231
|
}
|
|
@@ -48322,18 +48431,18 @@ var init_ServerBridgeTab = __esm({
|
|
|
48322
48431
|
});
|
|
48323
48432
|
function extractPayloadFields(schema, eventName) {
|
|
48324
48433
|
if (!schema) return [];
|
|
48325
|
-
const
|
|
48326
|
-
|
|
48327
|
-
|
|
48328
|
-
|
|
48329
|
-
|
|
48330
|
-
const sm =
|
|
48434
|
+
for (const orbital of schema.orbitals) {
|
|
48435
|
+
const traitRefs = orbital.traits ?? [];
|
|
48436
|
+
for (const traitRef of traitRefs) {
|
|
48437
|
+
if (!isInlineTrait(traitRef)) continue;
|
|
48438
|
+
const inlineTrait = traitRef;
|
|
48439
|
+
const sm = inlineTrait.stateMachine;
|
|
48331
48440
|
if (!sm) continue;
|
|
48332
48441
|
const events2 = sm.events ?? [];
|
|
48333
48442
|
for (const evt of events2) {
|
|
48334
48443
|
if (evt.name !== eventName) continue;
|
|
48335
|
-
const
|
|
48336
|
-
return
|
|
48444
|
+
const payloadFields = evt.payloadSchema ?? [];
|
|
48445
|
+
return payloadFields.map((f3) => ({
|
|
48337
48446
|
name: f3.name,
|
|
48338
48447
|
type: f3.type ?? "string"
|
|
48339
48448
|
}));
|
|
@@ -48396,9 +48505,9 @@ function getAllEvents(traits2) {
|
|
|
48396
48505
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
48397
48506
|
const eventBus = useEventBus();
|
|
48398
48507
|
const { t } = useTranslate();
|
|
48399
|
-
const [log13, setLog] =
|
|
48400
|
-
const prevStatesRef =
|
|
48401
|
-
|
|
48508
|
+
const [log13, setLog] = React90.useState([]);
|
|
48509
|
+
const prevStatesRef = React90.useRef(/* @__PURE__ */ new Map());
|
|
48510
|
+
React90.useEffect(() => {
|
|
48402
48511
|
for (const trait of traits2) {
|
|
48403
48512
|
const prev = prevStatesRef.current.get(trait.id);
|
|
48404
48513
|
if (prev && prev !== trait.currentState) {
|
|
@@ -48567,10 +48676,10 @@ function VerifyModePanel({
|
|
|
48567
48676
|
localCount
|
|
48568
48677
|
}) {
|
|
48569
48678
|
const { t } = useTranslate();
|
|
48570
|
-
const [expanded, setExpanded] =
|
|
48571
|
-
const scrollRef =
|
|
48572
|
-
const prevCountRef =
|
|
48573
|
-
|
|
48679
|
+
const [expanded, setExpanded] = React90.useState(true);
|
|
48680
|
+
const scrollRef = React90.useRef(null);
|
|
48681
|
+
const prevCountRef = React90.useRef(0);
|
|
48682
|
+
React90.useEffect(() => {
|
|
48574
48683
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
48575
48684
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
48576
48685
|
}
|
|
@@ -48627,10 +48736,10 @@ function RuntimeDebugger({
|
|
|
48627
48736
|
schema
|
|
48628
48737
|
}) {
|
|
48629
48738
|
const { t } = useTranslate();
|
|
48630
|
-
const [isCollapsed, setIsCollapsed] =
|
|
48631
|
-
const [isVisible, setIsVisible] =
|
|
48739
|
+
const [isCollapsed, setIsCollapsed] = React90.useState(mode === "verify" ? true : defaultCollapsed);
|
|
48740
|
+
const [isVisible, setIsVisible] = React90.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
48632
48741
|
const debugData = useDebugData();
|
|
48633
|
-
|
|
48742
|
+
React90.useEffect(() => {
|
|
48634
48743
|
if (mode === "inline") return;
|
|
48635
48744
|
return onDebugToggle((enabled) => {
|
|
48636
48745
|
setIsVisible(enabled);
|
|
@@ -48639,7 +48748,7 @@ function RuntimeDebugger({
|
|
|
48639
48748
|
}
|
|
48640
48749
|
});
|
|
48641
48750
|
}, [mode]);
|
|
48642
|
-
|
|
48751
|
+
React90.useEffect(() => {
|
|
48643
48752
|
if (mode === "inline") return;
|
|
48644
48753
|
const handleKeyDown = (e) => {
|
|
48645
48754
|
if (e.key === "`" && isVisible) {
|
|
@@ -49199,7 +49308,7 @@ function SequenceBar({
|
|
|
49199
49308
|
onSlotRemove(index);
|
|
49200
49309
|
}, [onSlotRemove, playing]);
|
|
49201
49310
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
49202
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
49311
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React90__default.Fragment, { children: [
|
|
49203
49312
|
i > 0 && /* @__PURE__ */ jsx(
|
|
49204
49313
|
Typography,
|
|
49205
49314
|
{
|
|
@@ -49814,6 +49923,29 @@ var init_SimulationCanvas = __esm({
|
|
|
49814
49923
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
49815
49924
|
}
|
|
49816
49925
|
});
|
|
49926
|
+
function readSimulatorParameters(v) {
|
|
49927
|
+
if (!Array.isArray(v)) return [];
|
|
49928
|
+
const result = [];
|
|
49929
|
+
for (const item of v) {
|
|
49930
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item) && !(item instanceof Date)) {
|
|
49931
|
+
const param = item;
|
|
49932
|
+
if ("id" in item && "label" in item && "unit" in item && "min" in item && "max" in item && "step" in item) {
|
|
49933
|
+
result.push({
|
|
49934
|
+
id: str(param.id),
|
|
49935
|
+
label: str(param.label),
|
|
49936
|
+
unit: str(param.unit),
|
|
49937
|
+
min: num(param.min),
|
|
49938
|
+
max: num(param.max),
|
|
49939
|
+
step: num(param.step),
|
|
49940
|
+
initial: num(param.initial),
|
|
49941
|
+
correct: num(param.correct),
|
|
49942
|
+
tolerance: num(param.tolerance)
|
|
49943
|
+
});
|
|
49944
|
+
}
|
|
49945
|
+
}
|
|
49946
|
+
}
|
|
49947
|
+
return result;
|
|
49948
|
+
}
|
|
49817
49949
|
function SimulatorBoard({
|
|
49818
49950
|
entity,
|
|
49819
49951
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -49826,7 +49958,7 @@ function SimulatorBoard({
|
|
|
49826
49958
|
const { emit } = useEventBus();
|
|
49827
49959
|
const { t } = useTranslate();
|
|
49828
49960
|
const resolved = boardEntity(entity);
|
|
49829
|
-
const parameters =
|
|
49961
|
+
const parameters = readSimulatorParameters(resolved?.parameters);
|
|
49830
49962
|
const [headerError, setHeaderError] = useState(false);
|
|
49831
49963
|
if (!resolved) return null;
|
|
49832
49964
|
const paramA = num(resolved.paramA);
|
|
@@ -49853,8 +49985,14 @@ function SimulatorBoard({
|
|
|
49853
49985
|
const handlePlayAgain = () => {
|
|
49854
49986
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
49855
49987
|
};
|
|
49856
|
-
const
|
|
49857
|
-
|
|
49988
|
+
const themeBackground = (() => {
|
|
49989
|
+
const t2 = resolved.theme;
|
|
49990
|
+
if (typeof t2 === "object" && t2 !== null && !Array.isArray(t2) && !(t2 instanceof Date)) {
|
|
49991
|
+
const bg = t2.background;
|
|
49992
|
+
return str(bg);
|
|
49993
|
+
}
|
|
49994
|
+
return "";
|
|
49995
|
+
})();
|
|
49858
49996
|
const headerImage = str(resolved.headerImage);
|
|
49859
49997
|
const hint = str(resolved.hint);
|
|
49860
49998
|
const showHint = isComplete && !isWin && attempts >= 2 && Boolean(hint);
|
|
@@ -50003,35 +50141,44 @@ var init_SokobanBoard = __esm({
|
|
|
50003
50141
|
}
|
|
50004
50142
|
});
|
|
50005
50143
|
function SpaceShmupBoard({
|
|
50006
|
-
|
|
50144
|
+
tiles,
|
|
50145
|
+
units,
|
|
50146
|
+
features,
|
|
50147
|
+
assetManifest,
|
|
50007
50148
|
assetBaseUrl,
|
|
50008
|
-
|
|
50009
|
-
|
|
50010
|
-
|
|
50149
|
+
scale = 0.45,
|
|
50150
|
+
showMinimap = false,
|
|
50151
|
+
enableCamera = true,
|
|
50152
|
+
tileClickEvent,
|
|
50153
|
+
unitClickEvent,
|
|
50011
50154
|
isLoading,
|
|
50012
50155
|
error,
|
|
50013
50156
|
className
|
|
50014
50157
|
}) {
|
|
50015
|
-
return /* @__PURE__ */
|
|
50016
|
-
|
|
50017
|
-
|
|
50018
|
-
|
|
50019
|
-
|
|
50020
|
-
|
|
50021
|
-
|
|
50022
|
-
|
|
50023
|
-
|
|
50024
|
-
|
|
50025
|
-
|
|
50026
|
-
|
|
50027
|
-
|
|
50028
|
-
|
|
50158
|
+
return /* @__PURE__ */ jsx("div", { className: cn("space-shmup-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
50159
|
+
IsometricCanvas_default,
|
|
50160
|
+
{
|
|
50161
|
+
tileLayout: "flat",
|
|
50162
|
+
tiles,
|
|
50163
|
+
units,
|
|
50164
|
+
features,
|
|
50165
|
+
assetManifest,
|
|
50166
|
+
assetBaseUrl,
|
|
50167
|
+
scale,
|
|
50168
|
+
showMinimap,
|
|
50169
|
+
enableCamera,
|
|
50170
|
+
tileClickEvent,
|
|
50171
|
+
unitClickEvent,
|
|
50172
|
+
isLoading,
|
|
50173
|
+
error
|
|
50174
|
+
}
|
|
50175
|
+
) });
|
|
50029
50176
|
}
|
|
50030
50177
|
var init_SpaceShmupBoard = __esm({
|
|
50031
50178
|
"components/game/organisms/SpaceShmupBoard.tsx"() {
|
|
50032
50179
|
"use client";
|
|
50033
50180
|
init_cn();
|
|
50034
|
-
|
|
50181
|
+
init_IsometricCanvas();
|
|
50035
50182
|
SpaceShmupBoard.displayName = "SpaceShmupBoard";
|
|
50036
50183
|
}
|
|
50037
50184
|
});
|
|
@@ -50250,7 +50397,7 @@ var init_StatCard = __esm({
|
|
|
50250
50397
|
const labelToUse = propLabel ?? propTitle;
|
|
50251
50398
|
const eventBus = useEventBus();
|
|
50252
50399
|
const { t } = useTranslate();
|
|
50253
|
-
const handleActionClick =
|
|
50400
|
+
const handleActionClick = React90__default.useCallback(() => {
|
|
50254
50401
|
if (action?.event) {
|
|
50255
50402
|
eventBus.emit(`UI:${action.event}`, {});
|
|
50256
50403
|
}
|
|
@@ -50261,7 +50408,7 @@ var init_StatCard = __esm({
|
|
|
50261
50408
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
50262
50409
|
const isLoading = externalLoading ?? false;
|
|
50263
50410
|
const error = externalError;
|
|
50264
|
-
const computeMetricValue =
|
|
50411
|
+
const computeMetricValue = React90__default.useCallback(
|
|
50265
50412
|
(metric, items) => {
|
|
50266
50413
|
if (metric.value !== void 0) {
|
|
50267
50414
|
return metric.value;
|
|
@@ -50300,7 +50447,7 @@ var init_StatCard = __esm({
|
|
|
50300
50447
|
},
|
|
50301
50448
|
[]
|
|
50302
50449
|
);
|
|
50303
|
-
const schemaStats =
|
|
50450
|
+
const schemaStats = React90__default.useMemo(() => {
|
|
50304
50451
|
if (!metrics || metrics.length === 0) return null;
|
|
50305
50452
|
return metrics.map((metric) => ({
|
|
50306
50453
|
label: metric.label,
|
|
@@ -50308,7 +50455,7 @@ var init_StatCard = __esm({
|
|
|
50308
50455
|
format: metric.format
|
|
50309
50456
|
}));
|
|
50310
50457
|
}, [metrics, data, computeMetricValue]);
|
|
50311
|
-
const calculatedTrend =
|
|
50458
|
+
const calculatedTrend = React90__default.useMemo(() => {
|
|
50312
50459
|
if (manualTrend !== void 0) return manualTrend;
|
|
50313
50460
|
if (previousValue === void 0 || currentValue === void 0)
|
|
50314
50461
|
return void 0;
|
|
@@ -50651,8 +50798,25 @@ function StateArchitectBoard({
|
|
|
50651
50798
|
const initialState = str(resolved?.initialState);
|
|
50652
50799
|
const entityName = str(resolved?.entityName);
|
|
50653
50800
|
const availableEvents = Array.isArray(resolved?.availableEvents) ? resolved.availableEvents : [];
|
|
50654
|
-
const testCases = Array.isArray(resolved?.testCases) ? resolved.testCases : []
|
|
50655
|
-
|
|
50801
|
+
const testCases = (Array.isArray(resolved?.testCases) ? resolved.testCases : []).map((item) => {
|
|
50802
|
+
const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
|
|
50803
|
+
const eventsField = o["events"];
|
|
50804
|
+
return {
|
|
50805
|
+
events: Array.isArray(eventsField) ? eventsField : [],
|
|
50806
|
+
expectedState: str(o["expectedState"]),
|
|
50807
|
+
label: str(o["label"])
|
|
50808
|
+
};
|
|
50809
|
+
});
|
|
50810
|
+
const entityTransitions = (Array.isArray(resolved?.transitions) ? resolved.transitions : []).map((item) => {
|
|
50811
|
+
const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
|
|
50812
|
+
return {
|
|
50813
|
+
id: str(o["id"]),
|
|
50814
|
+
from: str(o["from"]),
|
|
50815
|
+
to: str(o["to"]),
|
|
50816
|
+
event: str(o["event"]),
|
|
50817
|
+
...o["guardHint"] ? { guardHint: str(o["guardHint"]) } : {}
|
|
50818
|
+
};
|
|
50819
|
+
});
|
|
50656
50820
|
const entityVariables = rows(resolved?.variables);
|
|
50657
50821
|
const transitions = entityTransitions;
|
|
50658
50822
|
const attempts = typeof resolved?.attempts === "number" ? resolved.attempts : 0;
|
|
@@ -51497,8 +51661,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51497
51661
|
] });
|
|
51498
51662
|
};
|
|
51499
51663
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
51500
|
-
const endRef =
|
|
51501
|
-
|
|
51664
|
+
const endRef = React90__default.useRef(null);
|
|
51665
|
+
React90__default.useEffect(() => {
|
|
51502
51666
|
if (!autoScroll) return;
|
|
51503
51667
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51504
51668
|
}, [activities.length, autoScroll]);
|
|
@@ -51592,7 +51756,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
51592
51756
|
};
|
|
51593
51757
|
SubagentRichCard = ({ subagent }) => {
|
|
51594
51758
|
const { t } = useTranslate();
|
|
51595
|
-
const activities =
|
|
51759
|
+
const activities = React90__default.useMemo(
|
|
51596
51760
|
() => subagentMessagesToActivities(subagent.messages),
|
|
51597
51761
|
[subagent.messages]
|
|
51598
51762
|
);
|
|
@@ -51669,8 +51833,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51669
51833
|
] });
|
|
51670
51834
|
};
|
|
51671
51835
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
51672
|
-
const endRef =
|
|
51673
|
-
|
|
51836
|
+
const endRef = React90__default.useRef(null);
|
|
51837
|
+
React90__default.useEffect(() => {
|
|
51674
51838
|
if (!autoScroll) return;
|
|
51675
51839
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51676
51840
|
}, [messages.length, autoScroll]);
|
|
@@ -52141,17 +52305,12 @@ var init_Timeline = __esm({
|
|
|
52141
52305
|
look = "vertical-spacious"
|
|
52142
52306
|
}) => {
|
|
52143
52307
|
const { t } = useTranslate();
|
|
52144
|
-
const entityData =
|
|
52145
|
-
const items =
|
|
52308
|
+
const entityData = entity ?? [];
|
|
52309
|
+
const items = React90__default.useMemo(() => {
|
|
52146
52310
|
if (propItems) return propItems;
|
|
52147
52311
|
if (entityData.length === 0) return [];
|
|
52148
52312
|
return entityData.map((record, idx) => {
|
|
52149
|
-
const
|
|
52150
|
-
if (typeof f3 === "string") return f3;
|
|
52151
|
-
if (f3 && typeof f3 === "object" && "name" in f3) return String(f3.name);
|
|
52152
|
-
return "";
|
|
52153
|
-
};
|
|
52154
|
-
const resolvedFields = fields?.map(resolveField) ?? [];
|
|
52313
|
+
const resolvedFields = fields ?? [];
|
|
52155
52314
|
const titleField = resolvedFields[0] || "title";
|
|
52156
52315
|
const descField = resolvedFields[1] || "description";
|
|
52157
52316
|
const dateField = resolvedFields.find(
|
|
@@ -52249,7 +52408,7 @@ var init_Timeline = __esm({
|
|
|
52249
52408
|
}
|
|
52250
52409
|
});
|
|
52251
52410
|
function extractToastProps(children) {
|
|
52252
|
-
if (!
|
|
52411
|
+
if (!React90__default.isValidElement(children)) {
|
|
52253
52412
|
if (typeof children === "string") {
|
|
52254
52413
|
return { message: children };
|
|
52255
52414
|
}
|
|
@@ -52287,7 +52446,7 @@ var init_ToastSlot = __esm({
|
|
|
52287
52446
|
eventBus.emit("UI:CLOSE");
|
|
52288
52447
|
};
|
|
52289
52448
|
if (!isVisible) return null;
|
|
52290
|
-
const isCustomContent =
|
|
52449
|
+
const isCustomContent = React90__default.isValidElement(children) && !message;
|
|
52291
52450
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
52292
52451
|
Toast,
|
|
52293
52452
|
{
|
|
@@ -53559,7 +53718,7 @@ function WorldMapBoard({
|
|
|
53559
53718
|
const resolved = boardEntity(entity);
|
|
53560
53719
|
const entityUnits = rows(resolved?.units);
|
|
53561
53720
|
const entityTiles = rows(resolved?.tiles);
|
|
53562
|
-
const features = propFeatures ?? (
|
|
53721
|
+
const features = propFeatures ?? rows(resolved?.features);
|
|
53563
53722
|
const selectedHeroId = resolved?.selectedHeroId ?? null;
|
|
53564
53723
|
const assetManifest = propAssetManifest ?? resolved?.assetManifest;
|
|
53565
53724
|
const backgroundImage = resolved?.backgroundImage;
|
|
@@ -53692,7 +53851,8 @@ function WorldMapBoard({
|
|
|
53692
53851
|
if (heroMoveEvent) {
|
|
53693
53852
|
eventBus.emit(`UI:${heroMoveEvent}`, { heroId, toX: x, toY: y });
|
|
53694
53853
|
}
|
|
53695
|
-
const
|
|
53854
|
+
const tileWithFeature = tile;
|
|
53855
|
+
const feature = tileWithFeature ? str(tileWithFeature.feature) : "";
|
|
53696
53856
|
if (feature && feature !== "none") {
|
|
53697
53857
|
const tileRow = tile;
|
|
53698
53858
|
onFeatureEnter?.(heroId, tileRow);
|
|
@@ -53903,7 +54063,7 @@ var init_WorldMapTemplate = __esm({
|
|
|
53903
54063
|
}
|
|
53904
54064
|
});
|
|
53905
54065
|
function lazyThree(name, loader) {
|
|
53906
|
-
const Lazy =
|
|
54066
|
+
const Lazy = React90__default.lazy(
|
|
53907
54067
|
() => loader().then((m) => {
|
|
53908
54068
|
const Resolved = m[name];
|
|
53909
54069
|
if (!Resolved) {
|
|
@@ -53915,13 +54075,13 @@ function lazyThree(name, loader) {
|
|
|
53915
54075
|
})
|
|
53916
54076
|
);
|
|
53917
54077
|
function ThreeWrapper(props) {
|
|
53918
|
-
return
|
|
54078
|
+
return React90__default.createElement(
|
|
53919
54079
|
ThreeBoundary,
|
|
53920
54080
|
{ name },
|
|
53921
|
-
|
|
53922
|
-
|
|
54081
|
+
React90__default.createElement(
|
|
54082
|
+
React90__default.Suspense,
|
|
53923
54083
|
{ fallback: null },
|
|
53924
|
-
|
|
54084
|
+
React90__default.createElement(Lazy, props)
|
|
53925
54085
|
)
|
|
53926
54086
|
);
|
|
53927
54087
|
}
|
|
@@ -54244,7 +54404,7 @@ var init_component_registry_generated = __esm({
|
|
|
54244
54404
|
init_WorldMapBoard();
|
|
54245
54405
|
init_WorldMapTemplate();
|
|
54246
54406
|
init_XPBar();
|
|
54247
|
-
ThreeBoundary = class extends
|
|
54407
|
+
ThreeBoundary = class extends React90__default.Component {
|
|
54248
54408
|
constructor() {
|
|
54249
54409
|
super(...arguments);
|
|
54250
54410
|
__publicField(this, "state", { failed: false });
|
|
@@ -54254,7 +54414,7 @@ var init_component_registry_generated = __esm({
|
|
|
54254
54414
|
}
|
|
54255
54415
|
render() {
|
|
54256
54416
|
if (this.state.failed) {
|
|
54257
|
-
return
|
|
54417
|
+
return React90__default.createElement(
|
|
54258
54418
|
"div",
|
|
54259
54419
|
{
|
|
54260
54420
|
"data-testid": "three-unavailable",
|
|
@@ -54620,7 +54780,7 @@ function SuspenseConfigProvider({
|
|
|
54620
54780
|
config,
|
|
54621
54781
|
children
|
|
54622
54782
|
}) {
|
|
54623
|
-
return
|
|
54783
|
+
return React90__default.createElement(
|
|
54624
54784
|
SuspenseConfigContext.Provider,
|
|
54625
54785
|
{ value: config },
|
|
54626
54786
|
children
|
|
@@ -54636,9 +54796,7 @@ function getComponentForPattern3(patternType) {
|
|
|
54636
54796
|
if (!mapping) {
|
|
54637
54797
|
return null;
|
|
54638
54798
|
}
|
|
54639
|
-
|
|
54640
|
-
if (!name) return null;
|
|
54641
|
-
return COMPONENT_REGISTRY[name] ?? null;
|
|
54799
|
+
return COMPONENT_REGISTRY[mapping] ?? null;
|
|
54642
54800
|
}
|
|
54643
54801
|
function enrichFormFields(fields, entityDef) {
|
|
54644
54802
|
const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
|
|
@@ -54650,7 +54808,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54650
54808
|
name: field,
|
|
54651
54809
|
label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
54652
54810
|
type: entityField.type,
|
|
54653
|
-
required: entityField.required
|
|
54811
|
+
required: entityField.required ?? false
|
|
54654
54812
|
};
|
|
54655
54813
|
if (entityField.values && entityField.values.length > 0) {
|
|
54656
54814
|
enriched.values = entityField.values;
|
|
@@ -54658,15 +54816,15 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54658
54816
|
enriched.values = entityField.enumValues;
|
|
54659
54817
|
}
|
|
54660
54818
|
if (entityField.relation) {
|
|
54661
|
-
enriched.relation = entityField.relation;
|
|
54819
|
+
enriched.relation = entityField.relation.entity;
|
|
54662
54820
|
}
|
|
54663
54821
|
return enriched;
|
|
54664
54822
|
}
|
|
54665
54823
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
54666
54824
|
}
|
|
54667
|
-
if (field && typeof field === "object" && !Array.isArray(field)) {
|
|
54825
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React90__default.isValidElement(field) && !(field instanceof Date)) {
|
|
54668
54826
|
const obj = field;
|
|
54669
|
-
const fieldName = obj.name
|
|
54827
|
+
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
54670
54828
|
if (!fieldName) return field;
|
|
54671
54829
|
if (obj.type || obj.inputType) return field;
|
|
54672
54830
|
const entityField = fieldMap.get(fieldName);
|
|
@@ -54683,7 +54841,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54683
54841
|
}
|
|
54684
54842
|
}
|
|
54685
54843
|
if (!obj.relation && entityField.relation) {
|
|
54686
|
-
enriched.relation = entityField.relation;
|
|
54844
|
+
enriched.relation = entityField.relation.entity;
|
|
54687
54845
|
}
|
|
54688
54846
|
return enriched;
|
|
54689
54847
|
}
|
|
@@ -55110,7 +55268,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
55110
55268
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
55111
55269
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
55112
55270
|
}
|
|
55113
|
-
return /* @__PURE__ */ jsx(
|
|
55271
|
+
return /* @__PURE__ */ jsx(React90__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
55114
55272
|
}
|
|
55115
55273
|
if (!child || typeof child !== "object") return null;
|
|
55116
55274
|
const childId = `${parentId}-${index}`;
|
|
@@ -55150,14 +55308,14 @@ function isPatternConfig(value) {
|
|
|
55150
55308
|
if (value === null || value === void 0) return false;
|
|
55151
55309
|
if (typeof value !== "object") return false;
|
|
55152
55310
|
if (Array.isArray(value)) return false;
|
|
55153
|
-
if (
|
|
55311
|
+
if (React90__default.isValidElement(value)) return false;
|
|
55154
55312
|
if (value instanceof Date) return false;
|
|
55155
55313
|
if (typeof value === "function") return false;
|
|
55156
55314
|
const record = value;
|
|
55157
55315
|
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
55158
55316
|
}
|
|
55159
55317
|
function isPlainConfigObject(value) {
|
|
55160
|
-
if (
|
|
55318
|
+
if (React90__default.isValidElement(value)) return false;
|
|
55161
55319
|
if (value instanceof Date) return false;
|
|
55162
55320
|
const proto = Object.getPrototypeOf(value);
|
|
55163
55321
|
return proto === Object.prototype || proto === null;
|
|
@@ -55283,7 +55441,7 @@ function SlotContentRenderer({
|
|
|
55283
55441
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
55284
55442
|
const slotVal = restProps[slotKey];
|
|
55285
55443
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
55286
|
-
if (
|
|
55444
|
+
if (React90__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
55287
55445
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
55288
55446
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
55289
55447
|
slotVal,
|
|
@@ -55328,19 +55486,18 @@ function SlotContentRenderer({
|
|
|
55328
55486
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
55329
55487
|
finalProps[k] = v;
|
|
55330
55488
|
}
|
|
55331
|
-
const
|
|
55332
|
-
|
|
55333
|
-
) ? finalProps.entity : null;
|
|
55489
|
+
const entityVal = finalProps.entity;
|
|
55490
|
+
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
55334
55491
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
55335
55492
|
const sample = resolvedItems[0];
|
|
55336
|
-
if (sample && typeof sample === "object") {
|
|
55493
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React90__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
55337
55494
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
55338
55495
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
55339
55496
|
}
|
|
55340
55497
|
}
|
|
55341
55498
|
const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
|
|
55342
|
-
if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
|
|
55343
|
-
finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
|
|
55499
|
+
if (isFormPattern && entityDef && Array.isArray(finalProps.fields) && finalProps.fields[0] !== "fn") {
|
|
55500
|
+
finalProps.fields = enrichFormFields([...finalProps.fields], entityDef);
|
|
55344
55501
|
}
|
|
55345
55502
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
55346
55503
|
return /* @__PURE__ */ jsx(
|