@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/components/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React84 from 'react';
|
|
3
|
+
import React84__default, { useContext, useMemo, useRef, useEffect, useCallback, useState, Suspense, lazy, createContext, useLayoutEffect, useId, forwardRef, useImperativeHandle, useSyncExternalStore, Component } from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
@@ -234,7 +234,7 @@ var init_SvgFlow = __esm({
|
|
|
234
234
|
width = 100,
|
|
235
235
|
height = 100
|
|
236
236
|
}) => {
|
|
237
|
-
const markerId =
|
|
237
|
+
const markerId = React84__default.useMemo(() => {
|
|
238
238
|
flowIdCounter += 1;
|
|
239
239
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
240
240
|
}, []);
|
|
@@ -827,7 +827,7 @@ var init_SvgRing = __esm({
|
|
|
827
827
|
width = 100,
|
|
828
828
|
height = 100
|
|
829
829
|
}) => {
|
|
830
|
-
const gradientId =
|
|
830
|
+
const gradientId = React84__default.useMemo(() => {
|
|
831
831
|
ringIdCounter += 1;
|
|
832
832
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
833
833
|
}, []);
|
|
@@ -1239,7 +1239,7 @@ function loadLib(key, importer) {
|
|
|
1239
1239
|
return p2;
|
|
1240
1240
|
}
|
|
1241
1241
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1242
|
-
const Lazy =
|
|
1242
|
+
const Lazy = React84__default.lazy(async () => {
|
|
1243
1243
|
const lib = await loadLib(libKey, importer);
|
|
1244
1244
|
const Comp = pick(lib);
|
|
1245
1245
|
if (!Comp) {
|
|
@@ -1249,7 +1249,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1249
1249
|
return { default: Comp };
|
|
1250
1250
|
});
|
|
1251
1251
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
1252
|
-
|
|
1252
|
+
React84__default.Suspense,
|
|
1253
1253
|
{
|
|
1254
1254
|
fallback: /* @__PURE__ */ jsx(
|
|
1255
1255
|
"span",
|
|
@@ -1917,9 +1917,10 @@ function resolveIcon(name) {
|
|
|
1917
1917
|
function doResolve(name) {
|
|
1918
1918
|
if (iconAliases[name]) return iconAliases[name];
|
|
1919
1919
|
const pascalName = kebabToPascal2(name);
|
|
1920
|
-
const
|
|
1920
|
+
const lucideMap = LucideIcons2;
|
|
1921
|
+
const directLookup = lucideMap[pascalName];
|
|
1921
1922
|
if (directLookup && typeof directLookup === "object") return directLookup;
|
|
1922
|
-
const asIs =
|
|
1923
|
+
const asIs = lucideMap[name];
|
|
1923
1924
|
if (asIs && typeof asIs === "object") return asIs;
|
|
1924
1925
|
return LucideIcons2.HelpCircle;
|
|
1925
1926
|
}
|
|
@@ -1975,7 +1976,7 @@ var init_Icon = __esm({
|
|
|
1975
1976
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1976
1977
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1977
1978
|
const family = useIconFamily();
|
|
1978
|
-
const RenderedComponent =
|
|
1979
|
+
const RenderedComponent = React84__default.useMemo(() => {
|
|
1979
1980
|
if (directIcon) return null;
|
|
1980
1981
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1981
1982
|
}, [directIcon, effectiveName, family]);
|
|
@@ -2025,6 +2026,9 @@ var init_Icon = __esm({
|
|
|
2025
2026
|
Icon.displayName = "Icon";
|
|
2026
2027
|
}
|
|
2027
2028
|
});
|
|
2029
|
+
function isIconLike(v) {
|
|
2030
|
+
return typeof v.render === "function";
|
|
2031
|
+
}
|
|
2028
2032
|
function resolveIconProp(value, sizeClass) {
|
|
2029
2033
|
if (!value) return null;
|
|
2030
2034
|
if (typeof value === "string") {
|
|
@@ -2034,10 +2038,10 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2034
2038
|
const IconComp = value;
|
|
2035
2039
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2036
2040
|
}
|
|
2037
|
-
if (
|
|
2041
|
+
if (React84__default.isValidElement(value)) {
|
|
2038
2042
|
return value;
|
|
2039
2043
|
}
|
|
2040
|
-
if (typeof value === "object" && value !== null &&
|
|
2044
|
+
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
2041
2045
|
const IconComp = value;
|
|
2042
2046
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2043
2047
|
}
|
|
@@ -2110,7 +2114,7 @@ var init_Button = __esm({
|
|
|
2110
2114
|
md: "h-icon-default w-icon-default",
|
|
2111
2115
|
lg: "h-icon-default w-icon-default"
|
|
2112
2116
|
};
|
|
2113
|
-
Button =
|
|
2117
|
+
Button = React84__default.forwardRef(
|
|
2114
2118
|
({
|
|
2115
2119
|
className,
|
|
2116
2120
|
variant = "primary",
|
|
@@ -2126,6 +2130,7 @@ var init_Button = __esm({
|
|
|
2126
2130
|
label,
|
|
2127
2131
|
children,
|
|
2128
2132
|
onClick,
|
|
2133
|
+
"data-testid": dataTestId,
|
|
2129
2134
|
...props
|
|
2130
2135
|
}, ref) => {
|
|
2131
2136
|
const eventBus = useEventBus();
|
|
@@ -2158,7 +2163,7 @@ var init_Button = __esm({
|
|
|
2158
2163
|
),
|
|
2159
2164
|
onClick: handleClick,
|
|
2160
2165
|
...props,
|
|
2161
|
-
"data-testid":
|
|
2166
|
+
"data-testid": dataTestId ?? (action ? `action-${action}` : void 0),
|
|
2162
2167
|
children: [
|
|
2163
2168
|
isLoading ? /* @__PURE__ */ jsx(Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
|
|
2164
2169
|
children || label,
|
|
@@ -2177,7 +2182,7 @@ var init_Input = __esm({
|
|
|
2177
2182
|
init_cn();
|
|
2178
2183
|
init_Icon();
|
|
2179
2184
|
init_useEventBus();
|
|
2180
|
-
Input =
|
|
2185
|
+
Input = React84__default.forwardRef(
|
|
2181
2186
|
({
|
|
2182
2187
|
className,
|
|
2183
2188
|
inputType,
|
|
@@ -2337,7 +2342,7 @@ var Label;
|
|
|
2337
2342
|
var init_Label = __esm({
|
|
2338
2343
|
"components/core/atoms/Label.tsx"() {
|
|
2339
2344
|
init_cn();
|
|
2340
|
-
Label =
|
|
2345
|
+
Label = React84__default.forwardRef(
|
|
2341
2346
|
({ className, required, children, ...props }, ref) => {
|
|
2342
2347
|
return /* @__PURE__ */ jsxs(
|
|
2343
2348
|
"label",
|
|
@@ -2364,7 +2369,7 @@ var init_Textarea = __esm({
|
|
|
2364
2369
|
"components/core/atoms/Textarea.tsx"() {
|
|
2365
2370
|
init_cn();
|
|
2366
2371
|
init_useEventBus();
|
|
2367
|
-
Textarea =
|
|
2372
|
+
Textarea = React84__default.forwardRef(
|
|
2368
2373
|
({ className, error, onChange, ...props }, ref) => {
|
|
2369
2374
|
const eventBus = useEventBus();
|
|
2370
2375
|
const handleChange = (e) => {
|
|
@@ -2603,7 +2608,7 @@ var init_Select = __esm({
|
|
|
2603
2608
|
init_cn();
|
|
2604
2609
|
init_Icon();
|
|
2605
2610
|
init_useEventBus();
|
|
2606
|
-
Select =
|
|
2611
|
+
Select = React84__default.forwardRef(
|
|
2607
2612
|
(props, _ref) => {
|
|
2608
2613
|
const { multiple, searchable, clearable } = props;
|
|
2609
2614
|
if (multiple || searchable || clearable) {
|
|
@@ -2620,7 +2625,7 @@ var init_Checkbox = __esm({
|
|
|
2620
2625
|
"components/core/atoms/Checkbox.tsx"() {
|
|
2621
2626
|
init_cn();
|
|
2622
2627
|
init_useEventBus();
|
|
2623
|
-
Checkbox =
|
|
2628
|
+
Checkbox = React84__default.forwardRef(
|
|
2624
2629
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
2625
2630
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
2626
2631
|
const eventBus = useEventBus();
|
|
@@ -2674,7 +2679,7 @@ var init_Spinner = __esm({
|
|
|
2674
2679
|
md: "h-6 w-6",
|
|
2675
2680
|
lg: "h-8 w-8"
|
|
2676
2681
|
};
|
|
2677
|
-
Spinner =
|
|
2682
|
+
Spinner = React84__default.forwardRef(
|
|
2678
2683
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
2679
2684
|
if (overlay) {
|
|
2680
2685
|
return /* @__PURE__ */ jsx(
|
|
@@ -2764,7 +2769,7 @@ var init_Card = __esm({
|
|
|
2764
2769
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
2765
2770
|
"tile-image-first": "p-0 overflow-hidden"
|
|
2766
2771
|
};
|
|
2767
|
-
Card =
|
|
2772
|
+
Card = React84__default.forwardRef(
|
|
2768
2773
|
({
|
|
2769
2774
|
className,
|
|
2770
2775
|
variant = "bordered",
|
|
@@ -2812,9 +2817,9 @@ var init_Card = __esm({
|
|
|
2812
2817
|
}
|
|
2813
2818
|
);
|
|
2814
2819
|
Card.displayName = "Card";
|
|
2815
|
-
CardHeader =
|
|
2820
|
+
CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2816
2821
|
CardHeader.displayName = "CardHeader";
|
|
2817
|
-
CardTitle =
|
|
2822
|
+
CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2818
2823
|
"h3",
|
|
2819
2824
|
{
|
|
2820
2825
|
ref,
|
|
@@ -2827,11 +2832,11 @@ var init_Card = __esm({
|
|
|
2827
2832
|
}
|
|
2828
2833
|
));
|
|
2829
2834
|
CardTitle.displayName = "CardTitle";
|
|
2830
|
-
CardContent =
|
|
2835
|
+
CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2831
2836
|
CardContent.displayName = "CardContent";
|
|
2832
2837
|
CardBody = CardContent;
|
|
2833
2838
|
CardBody.displayName = "CardBody";
|
|
2834
|
-
CardFooter =
|
|
2839
|
+
CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2835
2840
|
"div",
|
|
2836
2841
|
{
|
|
2837
2842
|
ref,
|
|
@@ -2884,7 +2889,7 @@ var init_Badge = __esm({
|
|
|
2884
2889
|
md: "px-2.5 py-1 text-sm",
|
|
2885
2890
|
lg: "px-3 py-1.5 text-base"
|
|
2886
2891
|
};
|
|
2887
|
-
Badge =
|
|
2892
|
+
Badge = React84__default.forwardRef(
|
|
2888
2893
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2889
2894
|
const iconSizes3 = {
|
|
2890
2895
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2977,7 +2982,7 @@ var init_FilterPill = __esm({
|
|
|
2977
2982
|
md: "w-3.5 h-3.5",
|
|
2978
2983
|
lg: "w-4 h-4"
|
|
2979
2984
|
};
|
|
2980
|
-
FilterPill =
|
|
2985
|
+
FilterPill = React84__default.forwardRef(
|
|
2981
2986
|
({
|
|
2982
2987
|
className,
|
|
2983
2988
|
variant = "default",
|
|
@@ -3106,8 +3111,8 @@ var init_Avatar = __esm({
|
|
|
3106
3111
|
actionPayload
|
|
3107
3112
|
}) => {
|
|
3108
3113
|
const eventBus = useEventBus();
|
|
3109
|
-
const [imgFailed, setImgFailed] =
|
|
3110
|
-
|
|
3114
|
+
const [imgFailed, setImgFailed] = React84__default.useState(false);
|
|
3115
|
+
React84__default.useEffect(() => {
|
|
3111
3116
|
setImgFailed(false);
|
|
3112
3117
|
}, [src]);
|
|
3113
3118
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -3359,7 +3364,7 @@ var init_Box = __esm({
|
|
|
3359
3364
|
fixed: "fixed",
|
|
3360
3365
|
sticky: "sticky"
|
|
3361
3366
|
};
|
|
3362
|
-
Box =
|
|
3367
|
+
Box = React84__default.forwardRef(
|
|
3363
3368
|
({
|
|
3364
3369
|
padding,
|
|
3365
3370
|
paddingX,
|
|
@@ -3424,7 +3429,7 @@ var init_Box = __esm({
|
|
|
3424
3429
|
onPointerDown?.(e);
|
|
3425
3430
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3426
3431
|
const isClickable = action || onClick;
|
|
3427
|
-
return
|
|
3432
|
+
return React84__default.createElement(
|
|
3428
3433
|
Component2,
|
|
3429
3434
|
{
|
|
3430
3435
|
ref,
|
|
@@ -3478,22 +3483,18 @@ var init_Center = __esm({
|
|
|
3478
3483
|
as: Component2 = "div"
|
|
3479
3484
|
}) => {
|
|
3480
3485
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
style: mergedStyle,
|
|
3494
|
-
children
|
|
3495
|
-
}
|
|
3496
|
-
);
|
|
3486
|
+
return React84__default.createElement(Component2, {
|
|
3487
|
+
className: cn(
|
|
3488
|
+
inline ? "inline-flex" : "flex",
|
|
3489
|
+
horizontal && "justify-center",
|
|
3490
|
+
vertical && "items-center",
|
|
3491
|
+
fullHeight && "h-full",
|
|
3492
|
+
fullWidth && "w-full",
|
|
3493
|
+
className
|
|
3494
|
+
),
|
|
3495
|
+
style: mergedStyle,
|
|
3496
|
+
children
|
|
3497
|
+
});
|
|
3497
3498
|
};
|
|
3498
3499
|
}
|
|
3499
3500
|
});
|
|
@@ -3750,7 +3751,7 @@ var init_Radio = __esm({
|
|
|
3750
3751
|
md: "w-2.5 h-2.5",
|
|
3751
3752
|
lg: "w-3 h-3"
|
|
3752
3753
|
};
|
|
3753
|
-
Radio =
|
|
3754
|
+
Radio = React84__default.forwardRef(
|
|
3754
3755
|
({
|
|
3755
3756
|
label,
|
|
3756
3757
|
helperText,
|
|
@@ -3767,12 +3768,12 @@ var init_Radio = __esm({
|
|
|
3767
3768
|
onChange,
|
|
3768
3769
|
...props
|
|
3769
3770
|
}, ref) => {
|
|
3770
|
-
const reactId =
|
|
3771
|
+
const reactId = React84__default.useId();
|
|
3771
3772
|
const baseId = id || `radio-${reactId}`;
|
|
3772
3773
|
const hasError = !!error;
|
|
3773
3774
|
const eventBus = useEventBus();
|
|
3774
|
-
const [selected, setSelected] =
|
|
3775
|
-
|
|
3775
|
+
const [selected, setSelected] = React84__default.useState(value);
|
|
3776
|
+
React84__default.useEffect(() => {
|
|
3776
3777
|
if (value !== void 0) setSelected(value);
|
|
3777
3778
|
}, [value]);
|
|
3778
3779
|
const pick = (next, e) => {
|
|
@@ -3954,7 +3955,7 @@ var init_Switch = __esm({
|
|
|
3954
3955
|
"components/core/atoms/Switch.tsx"() {
|
|
3955
3956
|
"use client";
|
|
3956
3957
|
init_cn();
|
|
3957
|
-
Switch =
|
|
3958
|
+
Switch = React84.forwardRef(
|
|
3958
3959
|
({
|
|
3959
3960
|
checked,
|
|
3960
3961
|
defaultChecked = false,
|
|
@@ -3965,10 +3966,10 @@ var init_Switch = __esm({
|
|
|
3965
3966
|
name,
|
|
3966
3967
|
className
|
|
3967
3968
|
}, ref) => {
|
|
3968
|
-
const [isChecked, setIsChecked] =
|
|
3969
|
+
const [isChecked, setIsChecked] = React84.useState(
|
|
3969
3970
|
checked !== void 0 ? checked : defaultChecked
|
|
3970
3971
|
);
|
|
3971
|
-
|
|
3972
|
+
React84.useEffect(() => {
|
|
3972
3973
|
if (checked !== void 0) {
|
|
3973
3974
|
setIsChecked(checked);
|
|
3974
3975
|
}
|
|
@@ -4127,9 +4128,8 @@ var init_Stack = __esm({
|
|
|
4127
4128
|
};
|
|
4128
4129
|
const isHorizontal = direction === "horizontal";
|
|
4129
4130
|
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";
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
Comp,
|
|
4131
|
+
return React84__default.createElement(
|
|
4132
|
+
Component2,
|
|
4133
4133
|
{
|
|
4134
4134
|
className: cn(
|
|
4135
4135
|
"flex",
|
|
@@ -4145,9 +4145,9 @@ var init_Stack = __esm({
|
|
|
4145
4145
|
onClick: action || onClick ? handleClick : void 0,
|
|
4146
4146
|
onKeyDown,
|
|
4147
4147
|
role,
|
|
4148
|
-
tabIndex
|
|
4149
|
-
|
|
4150
|
-
|
|
4148
|
+
tabIndex
|
|
4149
|
+
},
|
|
4150
|
+
children
|
|
4151
4151
|
);
|
|
4152
4152
|
};
|
|
4153
4153
|
VStack = (props) => /* @__PURE__ */ jsx(Stack, { direction: "vertical", ...props });
|
|
@@ -4324,9 +4324,8 @@ var init_Typography = __esm({
|
|
|
4324
4324
|
}) => {
|
|
4325
4325
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
4326
4326
|
const Component2 = as || defaultElements[variant];
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
Comp,
|
|
4327
|
+
return React84__default.createElement(
|
|
4328
|
+
Component2,
|
|
4330
4329
|
{
|
|
4331
4330
|
id,
|
|
4332
4331
|
className: cn(
|
|
@@ -4339,9 +4338,9 @@ var init_Typography = __esm({
|
|
|
4339
4338
|
overflow && overflowStyles2[overflow],
|
|
4340
4339
|
className
|
|
4341
4340
|
),
|
|
4342
|
-
style
|
|
4343
|
-
|
|
4344
|
-
|
|
4341
|
+
style
|
|
4342
|
+
},
|
|
4343
|
+
children ?? content
|
|
4345
4344
|
);
|
|
4346
4345
|
};
|
|
4347
4346
|
Typography.displayName = "Typography";
|
|
@@ -4625,7 +4624,7 @@ var Dialog;
|
|
|
4625
4624
|
var init_Dialog = __esm({
|
|
4626
4625
|
"components/core/atoms/Dialog.tsx"() {
|
|
4627
4626
|
init_cn();
|
|
4628
|
-
Dialog =
|
|
4627
|
+
Dialog = React84__default.forwardRef(
|
|
4629
4628
|
({
|
|
4630
4629
|
role = "dialog",
|
|
4631
4630
|
"aria-modal": ariaModal = true,
|
|
@@ -4651,7 +4650,7 @@ var Aside;
|
|
|
4651
4650
|
var init_Aside = __esm({
|
|
4652
4651
|
"components/core/atoms/Aside.tsx"() {
|
|
4653
4652
|
init_cn();
|
|
4654
|
-
Aside =
|
|
4653
|
+
Aside = React84__default.forwardRef(
|
|
4655
4654
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4656
4655
|
);
|
|
4657
4656
|
Aside.displayName = "Aside";
|
|
@@ -4730,9 +4729,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4730
4729
|
className
|
|
4731
4730
|
}) => {
|
|
4732
4731
|
const { t } = useTranslate();
|
|
4733
|
-
const [isVisible, setIsVisible] =
|
|
4734
|
-
const timeoutRef =
|
|
4735
|
-
const triggerRef =
|
|
4732
|
+
const [isVisible, setIsVisible] = React84__default.useState(false);
|
|
4733
|
+
const timeoutRef = React84__default.useRef(null);
|
|
4734
|
+
const triggerRef = React84__default.useRef(null);
|
|
4736
4735
|
const handleMouseEnter = () => {
|
|
4737
4736
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4738
4737
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4743,7 +4742,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4743
4742
|
};
|
|
4744
4743
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
4745
4744
|
const open = isVisible || revealed;
|
|
4746
|
-
|
|
4745
|
+
React84__default.useEffect(() => {
|
|
4747
4746
|
return () => {
|
|
4748
4747
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4749
4748
|
};
|
|
@@ -4955,7 +4954,7 @@ var init_StatusDot = __esm({
|
|
|
4955
4954
|
md: "w-2.5 h-2.5",
|
|
4956
4955
|
lg: "w-3 h-3"
|
|
4957
4956
|
};
|
|
4958
|
-
StatusDot =
|
|
4957
|
+
StatusDot = React84__default.forwardRef(
|
|
4959
4958
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4960
4959
|
return /* @__PURE__ */ jsx(
|
|
4961
4960
|
"span",
|
|
@@ -5009,7 +5008,7 @@ var init_TrendIndicator = __esm({
|
|
|
5009
5008
|
down: "trending-down",
|
|
5010
5009
|
flat: "arrow-right"
|
|
5011
5010
|
};
|
|
5012
|
-
TrendIndicator =
|
|
5011
|
+
TrendIndicator = React84__default.forwardRef(
|
|
5013
5012
|
({
|
|
5014
5013
|
className,
|
|
5015
5014
|
value,
|
|
@@ -5076,7 +5075,7 @@ var init_RangeSlider = __esm({
|
|
|
5076
5075
|
md: "w-4 h-4",
|
|
5077
5076
|
lg: "w-5 h-5"
|
|
5078
5077
|
};
|
|
5079
|
-
RangeSlider =
|
|
5078
|
+
RangeSlider = React84__default.forwardRef(
|
|
5080
5079
|
({
|
|
5081
5080
|
className,
|
|
5082
5081
|
min = 0,
|
|
@@ -5672,7 +5671,7 @@ var init_ContentSection = __esm({
|
|
|
5672
5671
|
md: "py-16",
|
|
5673
5672
|
lg: "py-24"
|
|
5674
5673
|
};
|
|
5675
|
-
ContentSection =
|
|
5674
|
+
ContentSection = React84__default.forwardRef(
|
|
5676
5675
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5677
5676
|
return /* @__PURE__ */ jsx(
|
|
5678
5677
|
Box,
|
|
@@ -6206,7 +6205,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6206
6205
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6207
6206
|
"none": {}
|
|
6208
6207
|
};
|
|
6209
|
-
AnimatedReveal =
|
|
6208
|
+
AnimatedReveal = React84__default.forwardRef(
|
|
6210
6209
|
({
|
|
6211
6210
|
trigger = "scroll",
|
|
6212
6211
|
animation = "fade-up",
|
|
@@ -6366,7 +6365,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6366
6365
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6367
6366
|
"use client";
|
|
6368
6367
|
init_cn();
|
|
6369
|
-
AnimatedGraphic =
|
|
6368
|
+
AnimatedGraphic = React84__default.forwardRef(
|
|
6370
6369
|
({
|
|
6371
6370
|
src,
|
|
6372
6371
|
svgContent,
|
|
@@ -6389,7 +6388,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6389
6388
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6390
6389
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6391
6390
|
const prevAnimateRef = useRef(animate);
|
|
6392
|
-
const setRef =
|
|
6391
|
+
const setRef = React84__default.useCallback(
|
|
6393
6392
|
(node) => {
|
|
6394
6393
|
containerRef.current = node;
|
|
6395
6394
|
if (typeof ref === "function") ref(node);
|
|
@@ -7071,7 +7070,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7071
7070
|
}
|
|
7072
7071
|
);
|
|
7073
7072
|
};
|
|
7074
|
-
ErrorBoundary = class extends
|
|
7073
|
+
ErrorBoundary = class extends React84__default.Component {
|
|
7075
7074
|
constructor(props) {
|
|
7076
7075
|
super(props);
|
|
7077
7076
|
__publicField(this, "reset", () => {
|
|
@@ -7369,9 +7368,8 @@ var init_Container = __esm({
|
|
|
7369
7368
|
as: Component2 = "div"
|
|
7370
7369
|
}) => {
|
|
7371
7370
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
Comp,
|
|
7371
|
+
return React84__default.createElement(
|
|
7372
|
+
Component2,
|
|
7375
7373
|
{
|
|
7376
7374
|
className: cn(
|
|
7377
7375
|
"w-full",
|
|
@@ -7379,9 +7377,9 @@ var init_Container = __esm({
|
|
|
7379
7377
|
paddingStyles3[padding],
|
|
7380
7378
|
center && "mx-auto",
|
|
7381
7379
|
className
|
|
7382
|
-
)
|
|
7383
|
-
|
|
7384
|
-
|
|
7380
|
+
)
|
|
7381
|
+
},
|
|
7382
|
+
children
|
|
7385
7383
|
);
|
|
7386
7384
|
};
|
|
7387
7385
|
Container.displayName = "Container";
|
|
@@ -8191,9 +8189,9 @@ function ControlButton({
|
|
|
8191
8189
|
className
|
|
8192
8190
|
}) {
|
|
8193
8191
|
const eventBus = useEventBus();
|
|
8194
|
-
const [isPressed, setIsPressed] =
|
|
8192
|
+
const [isPressed, setIsPressed] = React84.useState(false);
|
|
8195
8193
|
const actualPressed = pressed ?? isPressed;
|
|
8196
|
-
const handlePointerDown =
|
|
8194
|
+
const handlePointerDown = React84.useCallback(
|
|
8197
8195
|
(e) => {
|
|
8198
8196
|
e.preventDefault();
|
|
8199
8197
|
if (disabled) return;
|
|
@@ -8203,7 +8201,7 @@ function ControlButton({
|
|
|
8203
8201
|
},
|
|
8204
8202
|
[disabled, pressEvent, eventBus, onPress]
|
|
8205
8203
|
);
|
|
8206
|
-
const handlePointerUp =
|
|
8204
|
+
const handlePointerUp = React84.useCallback(
|
|
8207
8205
|
(e) => {
|
|
8208
8206
|
e.preventDefault();
|
|
8209
8207
|
if (disabled) return;
|
|
@@ -8213,7 +8211,7 @@ function ControlButton({
|
|
|
8213
8211
|
},
|
|
8214
8212
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8215
8213
|
);
|
|
8216
|
-
const handlePointerLeave =
|
|
8214
|
+
const handlePointerLeave = React84.useCallback(
|
|
8217
8215
|
(e) => {
|
|
8218
8216
|
if (isPressed) {
|
|
8219
8217
|
setIsPressed(false);
|
|
@@ -8301,8 +8299,8 @@ function ActionButtons({
|
|
|
8301
8299
|
disabled
|
|
8302
8300
|
}) {
|
|
8303
8301
|
const eventBus = useEventBus();
|
|
8304
|
-
const [activeButtons, setActiveButtons] =
|
|
8305
|
-
const handlePress =
|
|
8302
|
+
const [activeButtons, setActiveButtons] = React84.useState(/* @__PURE__ */ new Set());
|
|
8303
|
+
const handlePress = React84.useCallback(
|
|
8306
8304
|
(id) => {
|
|
8307
8305
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
8308
8306
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8310,7 +8308,7 @@ function ActionButtons({
|
|
|
8310
8308
|
},
|
|
8311
8309
|
[actionEvent, eventBus, onAction]
|
|
8312
8310
|
);
|
|
8313
|
-
const handleRelease =
|
|
8311
|
+
const handleRelease = React84.useCallback(
|
|
8314
8312
|
(id) => {
|
|
8315
8313
|
setActiveButtons((prev) => {
|
|
8316
8314
|
const next = new Set(prev);
|
|
@@ -10835,9 +10833,37 @@ function BattleBoard({
|
|
|
10835
10833
|
className
|
|
10836
10834
|
}) {
|
|
10837
10835
|
const board = boardEntity(entity) ?? {};
|
|
10838
|
-
|
|
10836
|
+
function asFieldObj(v) {
|
|
10837
|
+
if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
|
|
10838
|
+
return v;
|
|
10839
|
+
}
|
|
10840
|
+
const rawTiles = propTiles ?? (Array.isArray(board.tiles) ? board.tiles.flatMap((v) => {
|
|
10841
|
+
const o = asFieldObj(v);
|
|
10842
|
+
if (o === null || typeof o.x !== "number" || typeof o.y !== "number") return [];
|
|
10843
|
+
const tile = { x: o.x, y: o.y };
|
|
10844
|
+
if (typeof o.terrain === "string") tile.terrain = o.terrain;
|
|
10845
|
+
if (typeof o.terrainSprite === "string") tile.terrainSprite = o.terrainSprite;
|
|
10846
|
+
if (typeof o.passable === "boolean") tile.passable = o.passable;
|
|
10847
|
+
if (typeof o.movementCost === "number") tile.movementCost = o.movementCost;
|
|
10848
|
+
if (typeof o.elevation === "number") tile.elevation = o.elevation;
|
|
10849
|
+
if (typeof o.type === "string") tile.type = o.type;
|
|
10850
|
+
if (typeof o.tileType === "string") tile.tileType = o.tileType;
|
|
10851
|
+
if (typeof o.id === "string") tile.id = o.id;
|
|
10852
|
+
if (typeof o.modelUrl === "string") tile.modelUrl = o.modelUrl;
|
|
10853
|
+
return [tile];
|
|
10854
|
+
}) : []);
|
|
10839
10855
|
const tiles = rawTiles.length === 0 ? DEFAULT_BATTLE_TILES : rawTiles;
|
|
10840
|
-
const features = propFeatures ?? (Array.isArray(board.features) ? board.features
|
|
10856
|
+
const features = propFeatures ?? (Array.isArray(board.features) ? board.features.flatMap((v) => {
|
|
10857
|
+
const o = asFieldObj(v);
|
|
10858
|
+
if (o === null || typeof o.type !== "string" || typeof o.x !== "number" || typeof o.y !== "number") return [];
|
|
10859
|
+
const feat = { type: o.type, x: o.x, y: o.y };
|
|
10860
|
+
if (typeof o.id === "string") feat.id = o.id;
|
|
10861
|
+
if (typeof o.sprite === "string") feat.sprite = o.sprite;
|
|
10862
|
+
if (typeof o.color === "string") feat.color = o.color;
|
|
10863
|
+
if (typeof o.elevation === "number") feat.elevation = o.elevation;
|
|
10864
|
+
if (typeof o.assetUrl === "string") feat.assetUrl = o.assetUrl;
|
|
10865
|
+
return [feat];
|
|
10866
|
+
}) : []);
|
|
10841
10867
|
const boardWidth = num(board.gridWidth ?? board.boardWidth, BATTLE_GRID_W);
|
|
10842
10868
|
const boardHeight = num(board.gridHeight ?? board.boardHeight, BATTLE_GRID_H);
|
|
10843
10869
|
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
@@ -10936,7 +10962,12 @@ function BattleBoard({
|
|
|
10936
10962
|
return units.filter((u) => unitHealth(u) > 0).map((unit) => {
|
|
10937
10963
|
const id = str(unit.id);
|
|
10938
10964
|
const pos = movingPositions.get(id) ?? unitPosition(unit);
|
|
10939
|
-
const unitTraits = Array.isArray(unit.traits) ? unit.traits
|
|
10965
|
+
const unitTraits = Array.isArray(unit.traits) ? unit.traits.flatMap((v) => {
|
|
10966
|
+
const o = asFieldObj(v);
|
|
10967
|
+
if (o === null || typeof o.name !== "string" || typeof o.currentState !== "string" || !Array.isArray(o.states)) return [];
|
|
10968
|
+
const stateNames = Array.from(o.states).flatMap((s) => typeof s === "string" ? [s] : []);
|
|
10969
|
+
return [{ name: o.name, currentState: o.currentState, states: stateNames, cooldown: typeof o.cooldown === "number" ? o.cooldown : void 0 }];
|
|
10970
|
+
}) : void 0;
|
|
10940
10971
|
return {
|
|
10941
10972
|
id,
|
|
10942
10973
|
position: pos,
|
|
@@ -11932,9 +11963,9 @@ async function computeTraitLayout(data) {
|
|
|
11932
11963
|
y: n.y ?? 0,
|
|
11933
11964
|
width: n.width ?? 110,
|
|
11934
11965
|
height: n.height ?? STATE_H,
|
|
11935
|
-
isInitial: stateInfo?.isInitial,
|
|
11936
|
-
isTerminal: stateInfo?.isTerminal,
|
|
11937
|
-
role: getStateRole(name, stateInfo?.isInitial, stateInfo?.isTerminal, tc, maxTC),
|
|
11966
|
+
isInitial: stateInfo?.isInitial ?? void 0,
|
|
11967
|
+
isTerminal: stateInfo?.isTerminal ?? void 0,
|
|
11968
|
+
role: getStateRole(name, stateInfo?.isInitial ?? void 0, stateInfo?.isTerminal ?? void 0, tc, maxTC),
|
|
11938
11969
|
transitionCount: tc
|
|
11939
11970
|
};
|
|
11940
11971
|
});
|
|
@@ -11945,12 +11976,10 @@ async function computeTraitLayout(data) {
|
|
|
11945
11976
|
const sections = e.sections ?? [];
|
|
11946
11977
|
const points = [];
|
|
11947
11978
|
for (const section of sections) {
|
|
11948
|
-
const startPoint = section.startPoint;
|
|
11949
|
-
const endPoint = section.endPoint;
|
|
11950
11979
|
const bendPoints = section.bendPoints ?? [];
|
|
11951
|
-
points.push({ x: startPoint.x, y: startPoint.y });
|
|
11980
|
+
points.push({ x: section.startPoint.x, y: section.startPoint.y });
|
|
11952
11981
|
for (const bp of bendPoints) points.push({ x: bp.x, y: bp.y });
|
|
11953
|
-
points.push({ x: endPoint.x, y: endPoint.y });
|
|
11982
|
+
points.push({ x: section.endPoint.x, y: section.endPoint.y });
|
|
11954
11983
|
}
|
|
11955
11984
|
const isSelf = t.from === t.to;
|
|
11956
11985
|
const isBackward = !isSelf && (nodeXMap[t.to] ?? 0) <= (nodeXMap[t.from] ?? 0);
|
|
@@ -12548,7 +12577,7 @@ var init_CodeBlock = __esm({
|
|
|
12548
12577
|
};
|
|
12549
12578
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
12550
12579
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
12551
|
-
CodeBlock =
|
|
12580
|
+
CodeBlock = React84__default.memo(
|
|
12552
12581
|
({
|
|
12553
12582
|
code: rawCode,
|
|
12554
12583
|
language = "text",
|
|
@@ -13135,7 +13164,7 @@ var init_MarkdownContent = __esm({
|
|
|
13135
13164
|
init_Box();
|
|
13136
13165
|
init_CodeBlock();
|
|
13137
13166
|
init_cn();
|
|
13138
|
-
MarkdownContent =
|
|
13167
|
+
MarkdownContent = React84__default.memo(
|
|
13139
13168
|
({ content, direction = "ltr", className }) => {
|
|
13140
13169
|
const { t: _t } = useTranslate();
|
|
13141
13170
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -14504,7 +14533,7 @@ var init_StateMachineView = __esm({
|
|
|
14504
14533
|
style: { top: title ? 30 : 0 },
|
|
14505
14534
|
children: [
|
|
14506
14535
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
14507
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
14536
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
14508
14537
|
StateNode,
|
|
14509
14538
|
{
|
|
14510
14539
|
state,
|
|
@@ -15323,12 +15352,13 @@ var init_ContentRenderer = __esm({
|
|
|
15323
15352
|
);
|
|
15324
15353
|
case "orbital": {
|
|
15325
15354
|
const parsed = segment.schema;
|
|
15355
|
+
const isFullSchema = (v) => Array.isArray(v.orbitals);
|
|
15326
15356
|
const inlineTrait = {
|
|
15327
15357
|
name: "inline",
|
|
15328
15358
|
scope: "instance",
|
|
15329
15359
|
stateMachine: parsed
|
|
15330
15360
|
};
|
|
15331
|
-
const schema =
|
|
15361
|
+
const schema = isFullSchema(parsed) ? parsed : {
|
|
15332
15362
|
name: "inline",
|
|
15333
15363
|
orbitals: [{
|
|
15334
15364
|
name: "inline",
|
|
@@ -16554,8 +16584,21 @@ function BuilderBoard({
|
|
|
16554
16584
|
const resolved = boardEntity(entity);
|
|
16555
16585
|
const [headerError, setHeaderError] = useState(false);
|
|
16556
16586
|
const [selectedComponent, setSelectedComponent] = useState(null);
|
|
16557
|
-
const components =
|
|
16558
|
-
|
|
16587
|
+
const components = rows(resolved?.components).map((r) => ({
|
|
16588
|
+
id: str(r.id),
|
|
16589
|
+
label: str(r.label),
|
|
16590
|
+
description: str(r.description) || void 0,
|
|
16591
|
+
iconEmoji: str(r.iconEmoji) || void 0,
|
|
16592
|
+
iconUrl: str(r.iconUrl) || void 0,
|
|
16593
|
+
category: str(r.category) || void 0
|
|
16594
|
+
}));
|
|
16595
|
+
const slots = rows(resolved?.slots).map((r) => ({
|
|
16596
|
+
id: str(r.id),
|
|
16597
|
+
label: str(r.label) || void 0,
|
|
16598
|
+
description: str(r.description) || void 0,
|
|
16599
|
+
requiredComponentId: str(r.requiredComponentId),
|
|
16600
|
+
placedComponentId: str(r.placedComponentId) || void 0
|
|
16601
|
+
}));
|
|
16559
16602
|
const placements = {};
|
|
16560
16603
|
for (const slot of slots) {
|
|
16561
16604
|
if (slot.placedComponentId) placements[slot.id] = slot.placedComponentId;
|
|
@@ -18459,7 +18502,7 @@ function CardHand({
|
|
|
18459
18502
|
className
|
|
18460
18503
|
}) {
|
|
18461
18504
|
const eventBus = useEventBus();
|
|
18462
|
-
const handleClick =
|
|
18505
|
+
const handleClick = React84.useCallback(
|
|
18463
18506
|
(card) => {
|
|
18464
18507
|
if (card.disabled) return;
|
|
18465
18508
|
onCardClick?.(card.id);
|
|
@@ -19206,14 +19249,15 @@ var init_CardGrid = __esm({
|
|
|
19206
19249
|
bodyFields.length > 0 && /* @__PURE__ */ jsx(Box, { className: "px-4 py-3 flex-1", children: /* @__PURE__ */ jsx(VStack, { gap: "xs", children: bodyFields.map((field) => {
|
|
19207
19250
|
const value = getNestedValue(itemData, field);
|
|
19208
19251
|
if (value === void 0 || value === null || value === "") return null;
|
|
19209
|
-
const
|
|
19252
|
+
const fieldValue = value;
|
|
19253
|
+
const boolVal = asBooleanValue(fieldValue);
|
|
19210
19254
|
if (boolVal !== null) {
|
|
19211
19255
|
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
|
|
19212
19256
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
|
|
19213
19257
|
boolVal ? /* @__PURE__ */ jsx(Badge, { variant: "success", children: t("common.yes") || "Yes" }) : /* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("common.no") || "No" })
|
|
19214
19258
|
] }, field);
|
|
19215
19259
|
}
|
|
19216
|
-
const displayValue = isDateField(field) ? formatDate(
|
|
19260
|
+
const displayValue = isDateField(field) ? formatDate(fieldValue) : STATUS_FIELDS.has(field.toLowerCase()) ? void 0 : String(value);
|
|
19217
19261
|
if (!displayValue) return null;
|
|
19218
19262
|
return /* @__PURE__ */ jsxs(HStack, { gap: "sm", className: "justify-between", children: [
|
|
19219
19263
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: fieldLabel(field) }),
|
|
@@ -19598,9 +19642,9 @@ function CastleBoard({
|
|
|
19598
19642
|
const eventBus = useEventBus();
|
|
19599
19643
|
const { t } = useTranslate();
|
|
19600
19644
|
const resolved = boardEntity(entity);
|
|
19601
|
-
const tiles = propTiles ?? (
|
|
19602
|
-
const features = propFeatures ?? (
|
|
19603
|
-
const units = propUnits ?? (
|
|
19645
|
+
const tiles = propTiles ?? (resolved?.tiles ?? []);
|
|
19646
|
+
const features = propFeatures ?? (resolved?.features ?? []);
|
|
19647
|
+
const units = propUnits ?? (resolved?.units ?? []);
|
|
19604
19648
|
const assetManifest = propAssetManifest ?? resolved?.assetManifest;
|
|
19605
19649
|
const backgroundImage = resolved?.backgroundImage;
|
|
19606
19650
|
const gold = num(resolved?.gold);
|
|
@@ -21201,8 +21245,8 @@ function ClassifierBoard({
|
|
|
21201
21245
|
const { t } = useTranslate();
|
|
21202
21246
|
const resolved = boardEntity(entity);
|
|
21203
21247
|
const [headerError, setHeaderError] = useState(false);
|
|
21204
|
-
const items =
|
|
21205
|
-
const categories =
|
|
21248
|
+
const items = rows(resolved?.items);
|
|
21249
|
+
const categories = rows(resolved?.categories);
|
|
21206
21250
|
const result = str(resolved?.result);
|
|
21207
21251
|
const submitted = result === "win";
|
|
21208
21252
|
const attempts = num(resolved?.attempts);
|
|
@@ -22167,7 +22211,7 @@ function CraftingRecipe({
|
|
|
22167
22211
|
className
|
|
22168
22212
|
}) {
|
|
22169
22213
|
const eventBus = useEventBus();
|
|
22170
|
-
const handleCraft =
|
|
22214
|
+
const handleCraft = React84.useCallback(() => {
|
|
22171
22215
|
onCraft?.();
|
|
22172
22216
|
if (craftEvent) {
|
|
22173
22217
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -22184,7 +22228,7 @@ function CraftingRecipe({
|
|
|
22184
22228
|
children: [
|
|
22185
22229
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
22186
22230
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
22187
|
-
return /* @__PURE__ */ jsxs(
|
|
22231
|
+
return /* @__PURE__ */ jsxs(React84.Fragment, { children: [
|
|
22188
22232
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
22189
22233
|
ItemSlot,
|
|
22190
22234
|
{
|
|
@@ -22256,8 +22300,8 @@ function DPad({
|
|
|
22256
22300
|
}) {
|
|
22257
22301
|
const eventBus = useEventBus();
|
|
22258
22302
|
const sizes = sizeMap6[size];
|
|
22259
|
-
const [activeDirections, setActiveDirections] =
|
|
22260
|
-
const handlePress =
|
|
22303
|
+
const [activeDirections, setActiveDirections] = React84.useState(/* @__PURE__ */ new Set());
|
|
22304
|
+
const handlePress = React84.useCallback(
|
|
22261
22305
|
(direction) => {
|
|
22262
22306
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
22263
22307
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -22265,7 +22309,7 @@ function DPad({
|
|
|
22265
22309
|
},
|
|
22266
22310
|
[directionEvent, eventBus, onDirection]
|
|
22267
22311
|
);
|
|
22268
|
-
const handleRelease =
|
|
22312
|
+
const handleRelease = React84.useCallback(
|
|
22269
22313
|
(direction) => {
|
|
22270
22314
|
setActiveDirections((prev) => {
|
|
22271
22315
|
const next = new Set(prev);
|
|
@@ -23214,8 +23258,8 @@ var init_Menu = __esm({
|
|
|
23214
23258
|
"bottom-end": "bottom-start"
|
|
23215
23259
|
};
|
|
23216
23260
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
23217
|
-
const triggerChild =
|
|
23218
|
-
const triggerElement =
|
|
23261
|
+
const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
23262
|
+
const triggerElement = React84__default.cloneElement(
|
|
23219
23263
|
triggerChild,
|
|
23220
23264
|
{
|
|
23221
23265
|
ref: triggerRef,
|
|
@@ -23310,14 +23354,14 @@ function useDataDnd(args) {
|
|
|
23310
23354
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23311
23355
|
const enabled = isZone || Boolean(dndRoot);
|
|
23312
23356
|
const eventBus = useEventBus();
|
|
23313
|
-
const parentRoot =
|
|
23357
|
+
const parentRoot = React84__default.useContext(RootCtx);
|
|
23314
23358
|
const isRoot = enabled && parentRoot === null;
|
|
23315
|
-
const zoneId =
|
|
23359
|
+
const zoneId = React84__default.useId();
|
|
23316
23360
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23317
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23318
|
-
const optimisticOrdersRef =
|
|
23361
|
+
const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
|
|
23362
|
+
const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
|
|
23319
23363
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23320
|
-
const clearOptimisticOrder =
|
|
23364
|
+
const clearOptimisticOrder = React84__default.useCallback((group) => {
|
|
23321
23365
|
setOptimisticOrders((prev) => {
|
|
23322
23366
|
if (!prev.has(group)) return prev;
|
|
23323
23367
|
const next = new Map(prev);
|
|
@@ -23340,17 +23384,20 @@ function useDataDnd(args) {
|
|
|
23340
23384
|
}
|
|
23341
23385
|
const itemIdsSignature = orderedItems.map((it, idx) => {
|
|
23342
23386
|
const raw = it[dndItemIdField];
|
|
23343
|
-
return String(raw
|
|
23387
|
+
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
23344
23388
|
}).join("|");
|
|
23345
|
-
const itemIds =
|
|
23389
|
+
const itemIds = React84__default.useMemo(
|
|
23346
23390
|
() => orderedItems.map((it, idx) => {
|
|
23347
23391
|
const raw = it[dndItemIdField];
|
|
23348
|
-
return raw
|
|
23392
|
+
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
23349
23393
|
}),
|
|
23350
23394
|
[itemIdsSignature]
|
|
23351
23395
|
);
|
|
23352
|
-
const itemsContentSig = items.map((it, idx) =>
|
|
23353
|
-
|
|
23396
|
+
const itemsContentSig = items.map((it, idx) => {
|
|
23397
|
+
const raw = it[dndItemIdField];
|
|
23398
|
+
return raw != null ? String(raw) : `__${idx}`;
|
|
23399
|
+
}).join("|");
|
|
23400
|
+
React84__default.useEffect(() => {
|
|
23354
23401
|
const root = isRoot ? null : parentRoot;
|
|
23355
23402
|
if (root) {
|
|
23356
23403
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23358,20 +23405,20 @@ function useDataDnd(args) {
|
|
|
23358
23405
|
clearOptimisticOrder(ownGroup);
|
|
23359
23406
|
}
|
|
23360
23407
|
}, [itemsContentSig, ownGroup]);
|
|
23361
|
-
const zonesRef =
|
|
23362
|
-
const registerZone =
|
|
23408
|
+
const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
|
|
23409
|
+
const registerZone = React84__default.useCallback((zoneId2, meta2) => {
|
|
23363
23410
|
zonesRef.current.set(zoneId2, meta2);
|
|
23364
23411
|
}, []);
|
|
23365
|
-
const unregisterZone =
|
|
23412
|
+
const unregisterZone = React84__default.useCallback((zoneId2) => {
|
|
23366
23413
|
zonesRef.current.delete(zoneId2);
|
|
23367
23414
|
}, []);
|
|
23368
|
-
const [activeDrag, setActiveDrag] =
|
|
23369
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23370
|
-
const meta =
|
|
23415
|
+
const [activeDrag, setActiveDrag] = React84__default.useState(null);
|
|
23416
|
+
const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
|
|
23417
|
+
const meta = React84__default.useMemo(
|
|
23371
23418
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23372
23419
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23373
23420
|
);
|
|
23374
|
-
|
|
23421
|
+
React84__default.useEffect(() => {
|
|
23375
23422
|
const target = isRoot ? null : parentRoot;
|
|
23376
23423
|
if (!target) {
|
|
23377
23424
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23390,7 +23437,7 @@ function useDataDnd(args) {
|
|
|
23390
23437
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23391
23438
|
const sensors = useAlmadarDndSensors(true);
|
|
23392
23439
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23393
|
-
const findZoneByItem =
|
|
23440
|
+
const findZoneByItem = React84__default.useCallback(
|
|
23394
23441
|
(id) => {
|
|
23395
23442
|
for (const z of zonesRef.current.values()) {
|
|
23396
23443
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23399,7 +23446,7 @@ function useDataDnd(args) {
|
|
|
23399
23446
|
},
|
|
23400
23447
|
[]
|
|
23401
23448
|
);
|
|
23402
|
-
|
|
23449
|
+
React84__default.useCallback(
|
|
23403
23450
|
(group) => {
|
|
23404
23451
|
for (const z of zonesRef.current.values()) {
|
|
23405
23452
|
if (z.group === group) return z;
|
|
@@ -23408,7 +23455,7 @@ function useDataDnd(args) {
|
|
|
23408
23455
|
},
|
|
23409
23456
|
[]
|
|
23410
23457
|
);
|
|
23411
|
-
const handleDragEnd =
|
|
23458
|
+
const handleDragEnd = React84__default.useCallback(
|
|
23412
23459
|
(event) => {
|
|
23413
23460
|
const { active, over } = event;
|
|
23414
23461
|
const activeIdStr = String(active.id);
|
|
@@ -23499,8 +23546,8 @@ function useDataDnd(args) {
|
|
|
23499
23546
|
},
|
|
23500
23547
|
[eventBus]
|
|
23501
23548
|
);
|
|
23502
|
-
const sortableData =
|
|
23503
|
-
const SortableItem =
|
|
23549
|
+
const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23550
|
+
const SortableItem = React84__default.useCallback(
|
|
23504
23551
|
({ id, children }) => {
|
|
23505
23552
|
const {
|
|
23506
23553
|
attributes,
|
|
@@ -23540,7 +23587,7 @@ function useDataDnd(args) {
|
|
|
23540
23587
|
id: droppableId,
|
|
23541
23588
|
data: sortableData
|
|
23542
23589
|
});
|
|
23543
|
-
const ctx =
|
|
23590
|
+
const ctx = React84__default.useContext(RootCtx);
|
|
23544
23591
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23545
23592
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23546
23593
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23555,7 +23602,7 @@ function useDataDnd(args) {
|
|
|
23555
23602
|
showForeignPlaceholder,
|
|
23556
23603
|
ctxAvailable: ctx != null
|
|
23557
23604
|
});
|
|
23558
|
-
|
|
23605
|
+
React84__default.useEffect(() => {
|
|
23559
23606
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23560
23607
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23561
23608
|
return /* @__PURE__ */ jsx(
|
|
@@ -23569,11 +23616,11 @@ function useDataDnd(args) {
|
|
|
23569
23616
|
}
|
|
23570
23617
|
);
|
|
23571
23618
|
};
|
|
23572
|
-
const rootContextValue =
|
|
23619
|
+
const rootContextValue = React84__default.useMemo(
|
|
23573
23620
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23574
23621
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23575
23622
|
);
|
|
23576
|
-
const handleDragStart =
|
|
23623
|
+
const handleDragStart = React84__default.useCallback((event) => {
|
|
23577
23624
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23578
23625
|
const rect = event.active.rect.current.initial;
|
|
23579
23626
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23592,7 +23639,7 @@ function useDataDnd(args) {
|
|
|
23592
23639
|
isRoot
|
|
23593
23640
|
});
|
|
23594
23641
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23595
|
-
const handleDragOver =
|
|
23642
|
+
const handleDragOver = React84__default.useCallback((event) => {
|
|
23596
23643
|
const { active, over } = event;
|
|
23597
23644
|
const overData = over?.data?.current;
|
|
23598
23645
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23662,7 +23709,7 @@ function useDataDnd(args) {
|
|
|
23662
23709
|
return next;
|
|
23663
23710
|
});
|
|
23664
23711
|
}, []);
|
|
23665
|
-
const handleDragCancel =
|
|
23712
|
+
const handleDragCancel = React84__default.useCallback((event) => {
|
|
23666
23713
|
setActiveDrag(null);
|
|
23667
23714
|
setOverZoneGroup(null);
|
|
23668
23715
|
dndLog.warn("dragCancel", {
|
|
@@ -23670,12 +23717,12 @@ function useDataDnd(args) {
|
|
|
23670
23717
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23671
23718
|
});
|
|
23672
23719
|
}, []);
|
|
23673
|
-
const handleDragEndWithCleanup =
|
|
23720
|
+
const handleDragEndWithCleanup = React84__default.useCallback((event) => {
|
|
23674
23721
|
handleDragEnd(event);
|
|
23675
23722
|
setActiveDrag(null);
|
|
23676
23723
|
setOverZoneGroup(null);
|
|
23677
23724
|
}, [handleDragEnd]);
|
|
23678
|
-
const wrapContainer =
|
|
23725
|
+
const wrapContainer = React84__default.useCallback(
|
|
23679
23726
|
(children) => {
|
|
23680
23727
|
if (!enabled) return children;
|
|
23681
23728
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23729,7 +23776,7 @@ var init_useDataDnd = __esm({
|
|
|
23729
23776
|
init_useAlmadarDndCollision();
|
|
23730
23777
|
init_Box();
|
|
23731
23778
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23732
|
-
RootCtx =
|
|
23779
|
+
RootCtx = React84__default.createContext(null);
|
|
23733
23780
|
}
|
|
23734
23781
|
});
|
|
23735
23782
|
function renderIconInput(icon, props) {
|
|
@@ -23872,8 +23919,8 @@ function DataGrid({
|
|
|
23872
23919
|
const hasRenderProp = typeof children === "function";
|
|
23873
23920
|
useEffect(() => {
|
|
23874
23921
|
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
23875
|
-
const
|
|
23876
|
-
const isFnLambda =
|
|
23922
|
+
const schemaArr = Array.isArray(schemaRenderItem) ? schemaRenderItem : null;
|
|
23923
|
+
const isFnLambda = schemaArr !== null && schemaArr.length >= 3 && (schemaArr[0] === "fn" || schemaArr[0] === "lambda");
|
|
23877
23924
|
dataGridLog.warn("renderItem-unresolved", {
|
|
23878
23925
|
rowCount: data.length,
|
|
23879
23926
|
renderItemIsFnLambda: isFnLambda
|
|
@@ -24255,7 +24302,7 @@ function DataList({
|
|
|
24255
24302
|
}) {
|
|
24256
24303
|
const eventBus = useEventBus();
|
|
24257
24304
|
const { t } = useTranslate();
|
|
24258
|
-
const [visibleCount, setVisibleCount] =
|
|
24305
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
|
|
24259
24306
|
const fieldDefs = fields ?? columns ?? [];
|
|
24260
24307
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
24261
24308
|
const dnd = useDataDnd({
|
|
@@ -24274,21 +24321,20 @@ function DataList({
|
|
|
24274
24321
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24275
24322
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24276
24323
|
const hasRenderProp = typeof children === "function";
|
|
24277
|
-
|
|
24324
|
+
React84__default.useEffect(() => {
|
|
24278
24325
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24279
24326
|
const childrenTypeOf = typeof children;
|
|
24280
24327
|
if (data.length > 0 && !hasRenderProp) {
|
|
24281
24328
|
const firstRow = data[0];
|
|
24282
24329
|
const sampleKeys = firstRow ? Object.keys(firstRow).slice(0, 6) : [];
|
|
24283
|
-
const
|
|
24284
|
-
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
24330
|
+
const isFnLambda = Array.isArray(schemaRenderItem) && schemaRenderItem.length >= 3 && (schemaRenderItem[0] === "fn" || schemaRenderItem[0] === "lambda");
|
|
24285
24331
|
dataListLog.warn("renderItem-unresolved", {
|
|
24286
24332
|
rowCount: data.length,
|
|
24287
24333
|
fieldsCount: fieldDefs.length,
|
|
24288
24334
|
renderItemTypeOf,
|
|
24289
|
-
renderItemIsArray: Array.isArray(
|
|
24335
|
+
renderItemIsArray: Array.isArray(schemaRenderItem),
|
|
24290
24336
|
renderItemIsFnLambda: isFnLambda,
|
|
24291
|
-
renderItemHead: Array.isArray(
|
|
24337
|
+
renderItemHead: Array.isArray(schemaRenderItem) ? String(schemaRenderItem[0]) : void 0,
|
|
24292
24338
|
childrenTypeOf,
|
|
24293
24339
|
sampleRowKeys: sampleKeys
|
|
24294
24340
|
});
|
|
@@ -24376,10 +24422,10 @@ function DataList({
|
|
|
24376
24422
|
const isCompact = variant === "compact";
|
|
24377
24423
|
const isMessage = variant === "message";
|
|
24378
24424
|
if (isMessage) {
|
|
24379
|
-
const items2 = data
|
|
24425
|
+
const items2 = [...data];
|
|
24380
24426
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24381
24427
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24382
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24428
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
24383
24429
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24384
24430
|
group.items.map((itemData, index) => {
|
|
24385
24431
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24425,7 +24471,7 @@ function DataList({
|
|
|
24425
24471
|
})
|
|
24426
24472
|
] }, gi)) });
|
|
24427
24473
|
}
|
|
24428
|
-
const items = data
|
|
24474
|
+
const items = [...data];
|
|
24429
24475
|
const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
|
|
24430
24476
|
const idFieldName = dndItemIdField ?? "id";
|
|
24431
24477
|
const renderItem = (itemData, index, isLast) => {
|
|
@@ -24520,7 +24566,7 @@ function DataList({
|
|
|
24520
24566
|
className
|
|
24521
24567
|
),
|
|
24522
24568
|
children: [
|
|
24523
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24569
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
24524
24570
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24525
24571
|
group.items.map(
|
|
24526
24572
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -24627,8 +24673,8 @@ function ScalarControl({
|
|
|
24627
24673
|
}
|
|
24628
24674
|
const numeric = typeof value === "number";
|
|
24629
24675
|
const initial = value === null ? "" : String(value);
|
|
24630
|
-
const [draft, setDraft] =
|
|
24631
|
-
|
|
24676
|
+
const [draft, setDraft] = React84__default.useState(initial);
|
|
24677
|
+
React84__default.useEffect(() => setDraft(initial), [initial]);
|
|
24632
24678
|
const commit = () => {
|
|
24633
24679
|
if (numeric) {
|
|
24634
24680
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -24696,8 +24742,8 @@ function Row({
|
|
|
24696
24742
|
onRemove,
|
|
24697
24743
|
readonly
|
|
24698
24744
|
}) {
|
|
24699
|
-
const [keyDraft, setKeyDraft] =
|
|
24700
|
-
|
|
24745
|
+
const [keyDraft, setKeyDraft] = React84__default.useState(rowKey);
|
|
24746
|
+
React84__default.useEffect(() => setKeyDraft(rowKey), [rowKey]);
|
|
24701
24747
|
const container = isObj(value) || isArr(value);
|
|
24702
24748
|
return /* @__PURE__ */ jsxs(VStack, { gap: "none", className: "group w-max min-w-full", children: [
|
|
24703
24749
|
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", className: "py-0.5 w-max", children: [
|
|
@@ -24740,7 +24786,7 @@ function ContainerNode({
|
|
|
24740
24786
|
depth,
|
|
24741
24787
|
readonly
|
|
24742
24788
|
}) {
|
|
24743
|
-
const [open, setOpen] =
|
|
24789
|
+
const [open, setOpen] = React84__default.useState(depth < 2);
|
|
24744
24790
|
const array = isArr(value);
|
|
24745
24791
|
const entries = array ? value.map((v, i) => [String(i), v]) : Object.entries(value);
|
|
24746
24792
|
const setObjValue = (key, next) => {
|
|
@@ -24882,7 +24928,7 @@ var init_FormSection = __esm({
|
|
|
24882
24928
|
columns = 1,
|
|
24883
24929
|
className
|
|
24884
24930
|
}) => {
|
|
24885
|
-
const [collapsed, setCollapsed] =
|
|
24931
|
+
const [collapsed, setCollapsed] = React84__default.useState(defaultCollapsed);
|
|
24886
24932
|
const { t } = useTranslate();
|
|
24887
24933
|
const eventBus = useEventBus();
|
|
24888
24934
|
const gridClass = {
|
|
@@ -24890,7 +24936,7 @@ var init_FormSection = __esm({
|
|
|
24890
24936
|
2: "grid-cols-1 md:grid-cols-2",
|
|
24891
24937
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
24892
24938
|
}[columns];
|
|
24893
|
-
|
|
24939
|
+
React84__default.useCallback(() => {
|
|
24894
24940
|
if (collapsible) {
|
|
24895
24941
|
setCollapsed((prev) => !prev);
|
|
24896
24942
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -25298,8 +25344,8 @@ function TextLikeControl({
|
|
|
25298
25344
|
onCommit
|
|
25299
25345
|
}) {
|
|
25300
25346
|
const initial = value === void 0 || value === null ? "" : String(value);
|
|
25301
|
-
const [draft, setDraft] =
|
|
25302
|
-
|
|
25347
|
+
const [draft, setDraft] = React84__default.useState(initial);
|
|
25348
|
+
React84__default.useEffect(() => setDraft(initial), [initial]);
|
|
25303
25349
|
const commit = () => {
|
|
25304
25350
|
if (numeric) {
|
|
25305
25351
|
const n = draft.trim() === "" ? 0 : Number(draft);
|
|
@@ -25465,14 +25511,14 @@ var init_NodeSlotEditor = __esm({
|
|
|
25465
25511
|
isObj2 = (v) => v !== null && v !== void 0 && typeof v === "object" && !Array.isArray(v);
|
|
25466
25512
|
NodeSlotEditor = ({ value, onChange, className }) => {
|
|
25467
25513
|
const { type, props, wasArray } = normalize(value);
|
|
25468
|
-
const patterns =
|
|
25514
|
+
const patterns = React84__default.useMemo(() => {
|
|
25469
25515
|
try {
|
|
25470
25516
|
return [...getKnownPatterns()].sort();
|
|
25471
25517
|
} catch {
|
|
25472
25518
|
return [];
|
|
25473
25519
|
}
|
|
25474
25520
|
}, []);
|
|
25475
|
-
const options =
|
|
25521
|
+
const options = React84__default.useMemo(
|
|
25476
25522
|
() => [{ value: "", label: "\u2014 none \u2014" }, ...patterns.map((p2) => ({ value: p2, label: p2 }))],
|
|
25477
25523
|
[patterns]
|
|
25478
25524
|
);
|
|
@@ -25484,7 +25530,7 @@ var init_NodeSlotEditor = __esm({
|
|
|
25484
25530
|
const pattern = { type: nextType, ...nextProps };
|
|
25485
25531
|
onChange(wasArray || value === void 0 ? [pattern] : pattern);
|
|
25486
25532
|
};
|
|
25487
|
-
const schemaEntries =
|
|
25533
|
+
const schemaEntries = React84__default.useMemo(() => {
|
|
25488
25534
|
if (!type) return [];
|
|
25489
25535
|
const def = getPatternDefinition(type);
|
|
25490
25536
|
if (!def?.propsSchema) return [];
|
|
@@ -26255,23 +26301,19 @@ var init_Flex = __esm({
|
|
|
26255
26301
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
26256
26302
|
}
|
|
26257
26303
|
}
|
|
26258
|
-
|
|
26259
|
-
|
|
26260
|
-
|
|
26261
|
-
|
|
26262
|
-
|
|
26263
|
-
|
|
26264
|
-
|
|
26265
|
-
|
|
26266
|
-
|
|
26267
|
-
|
|
26268
|
-
|
|
26269
|
-
|
|
26270
|
-
|
|
26271
|
-
style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
|
|
26272
|
-
children
|
|
26273
|
-
}
|
|
26274
|
-
);
|
|
26304
|
+
return React84__default.createElement(Component2, {
|
|
26305
|
+
className: cn(
|
|
26306
|
+
inline ? "inline-flex" : "flex",
|
|
26307
|
+
directionStyles[direction],
|
|
26308
|
+
wrapStyles[wrap],
|
|
26309
|
+
alignStyles3[align],
|
|
26310
|
+
justifyStyles2[justify],
|
|
26311
|
+
gapStyles6[gap],
|
|
26312
|
+
className
|
|
26313
|
+
),
|
|
26314
|
+
style: Object.keys(flexStyle).length > 0 ? flexStyle : void 0,
|
|
26315
|
+
children
|
|
26316
|
+
});
|
|
26275
26317
|
};
|
|
26276
26318
|
Flex.displayName = "Flex";
|
|
26277
26319
|
}
|
|
@@ -26378,7 +26420,7 @@ var init_Grid = __esm({
|
|
|
26378
26420
|
as: Component2 = "div"
|
|
26379
26421
|
}) => {
|
|
26380
26422
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
26381
|
-
return
|
|
26423
|
+
return React84__default.createElement(
|
|
26382
26424
|
Component2,
|
|
26383
26425
|
{
|
|
26384
26426
|
className: cn(
|
|
@@ -26574,9 +26616,9 @@ var init_Popover = __esm({
|
|
|
26574
26616
|
onMouseLeave: handleClose,
|
|
26575
26617
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26576
26618
|
};
|
|
26577
|
-
const childElement =
|
|
26619
|
+
const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26578
26620
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26579
|
-
const triggerElement =
|
|
26621
|
+
const triggerElement = React84__default.cloneElement(
|
|
26580
26622
|
childElement,
|
|
26581
26623
|
{
|
|
26582
26624
|
ref: triggerRef,
|
|
@@ -27428,9 +27470,9 @@ var init_Tooltip = __esm({
|
|
|
27428
27470
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
27429
27471
|
};
|
|
27430
27472
|
}, []);
|
|
27431
|
-
const triggerElement =
|
|
27473
|
+
const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27432
27474
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
27433
|
-
const trigger =
|
|
27475
|
+
const trigger = React84__default.cloneElement(triggerElement, {
|
|
27434
27476
|
ref: triggerRef,
|
|
27435
27477
|
onMouseEnter: handleMouseEnter,
|
|
27436
27478
|
onMouseLeave: handleMouseLeave,
|
|
@@ -27520,7 +27562,7 @@ var init_WizardProgress = __esm({
|
|
|
27520
27562
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
27521
27563
|
const isActive = index === currentStep;
|
|
27522
27564
|
const isCompleted = index < currentStep;
|
|
27523
|
-
return /* @__PURE__ */ jsxs(
|
|
27565
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
27524
27566
|
/* @__PURE__ */ jsx(
|
|
27525
27567
|
"button",
|
|
27526
27568
|
{
|
|
@@ -27832,13 +27874,14 @@ var init_ViolationAlert = __esm({
|
|
|
27832
27874
|
onNavigateToField,
|
|
27833
27875
|
compact = false,
|
|
27834
27876
|
className,
|
|
27835
|
-
|
|
27877
|
+
message
|
|
27836
27878
|
}) => {
|
|
27837
27879
|
const { t } = useTranslate();
|
|
27880
|
+
const fallbackMessage = message ?? t("violationAlert.fallbackMessage");
|
|
27838
27881
|
const resolvedViolation = violation ?? {
|
|
27839
27882
|
law: "",
|
|
27840
27883
|
article: "",
|
|
27841
|
-
message:
|
|
27884
|
+
message: fallbackMessage,
|
|
27842
27885
|
actionType: "measure"
|
|
27843
27886
|
};
|
|
27844
27887
|
const effectiveSeverity = severity ?? (resolvedViolation.actionType === "measure" ? "warning" : "error");
|
|
@@ -28556,18 +28599,18 @@ var init_HealthBar = __esm({
|
|
|
28556
28599
|
function ScoreDisplay({
|
|
28557
28600
|
assetUrl = DEFAULT_ASSET_URL6,
|
|
28558
28601
|
value,
|
|
28602
|
+
score,
|
|
28559
28603
|
label,
|
|
28560
28604
|
icon,
|
|
28561
28605
|
size = "md",
|
|
28562
28606
|
className,
|
|
28563
28607
|
animated = true,
|
|
28564
|
-
locale = "en-US"
|
|
28565
|
-
...rest
|
|
28608
|
+
locale = "en-US"
|
|
28566
28609
|
}) {
|
|
28567
|
-
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof
|
|
28568
|
-
const [displayValue, setDisplayValue] =
|
|
28569
|
-
const [isAnimating, setIsAnimating] =
|
|
28570
|
-
|
|
28610
|
+
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
|
|
28611
|
+
const [displayValue, setDisplayValue] = React84.useState(resolvedValue);
|
|
28612
|
+
const [isAnimating, setIsAnimating] = React84.useState(false);
|
|
28613
|
+
React84.useEffect(() => {
|
|
28571
28614
|
if (!animated || displayValue === resolvedValue) {
|
|
28572
28615
|
setDisplayValue(resolvedValue);
|
|
28573
28616
|
return;
|
|
@@ -28737,7 +28780,7 @@ function InventoryGrid({
|
|
|
28737
28780
|
const eventBus = useEventBus();
|
|
28738
28781
|
const slotCount = totalSlots ?? items.length;
|
|
28739
28782
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
28740
|
-
const handleSelect =
|
|
28783
|
+
const handleSelect = React84.useCallback(
|
|
28741
28784
|
(id) => {
|
|
28742
28785
|
onSelect?.(id);
|
|
28743
28786
|
if (selectEvent) {
|
|
@@ -29054,31 +29097,31 @@ function GameCanvas2D({
|
|
|
29054
29097
|
assetBaseUrl,
|
|
29055
29098
|
className
|
|
29056
29099
|
}) {
|
|
29057
|
-
const canvasRef =
|
|
29058
|
-
const rafRef =
|
|
29059
|
-
const frameRef =
|
|
29060
|
-
const lastTimeRef =
|
|
29061
|
-
const imageCache =
|
|
29100
|
+
const canvasRef = React84.useRef(null);
|
|
29101
|
+
const rafRef = React84.useRef(0);
|
|
29102
|
+
const frameRef = React84.useRef(0);
|
|
29103
|
+
const lastTimeRef = React84.useRef(0);
|
|
29104
|
+
const imageCache = React84.useRef(/* @__PURE__ */ new Map());
|
|
29062
29105
|
const emit = useEmitEvent();
|
|
29063
|
-
const onDrawRef =
|
|
29106
|
+
const onDrawRef = React84.useRef(onDraw);
|
|
29064
29107
|
onDrawRef.current = onDraw;
|
|
29065
|
-
const onTickRef =
|
|
29108
|
+
const onTickRef = React84.useRef(onTick);
|
|
29066
29109
|
onTickRef.current = onTick;
|
|
29067
|
-
const tickEventRef =
|
|
29110
|
+
const tickEventRef = React84.useRef(tickEvent);
|
|
29068
29111
|
tickEventRef.current = tickEvent;
|
|
29069
|
-
const drawEventRef =
|
|
29112
|
+
const drawEventRef = React84.useRef(drawEvent);
|
|
29070
29113
|
drawEventRef.current = drawEvent;
|
|
29071
|
-
const emitRef =
|
|
29114
|
+
const emitRef = React84.useRef(emit);
|
|
29072
29115
|
emitRef.current = emit;
|
|
29073
|
-
const assetBaseUrlRef =
|
|
29116
|
+
const assetBaseUrlRef = React84.useRef(assetBaseUrl);
|
|
29074
29117
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
29075
|
-
const backgroundImageRef =
|
|
29118
|
+
const backgroundImageRef = React84.useRef(backgroundImage);
|
|
29076
29119
|
backgroundImageRef.current = backgroundImage;
|
|
29077
|
-
const widthRef =
|
|
29120
|
+
const widthRef = React84.useRef(width);
|
|
29078
29121
|
widthRef.current = width;
|
|
29079
|
-
const heightRef =
|
|
29122
|
+
const heightRef = React84.useRef(height);
|
|
29080
29123
|
heightRef.current = height;
|
|
29081
|
-
const loadImage =
|
|
29124
|
+
const loadImage = React84.useCallback((url) => {
|
|
29082
29125
|
const base = assetBaseUrlRef.current;
|
|
29083
29126
|
if (!url.startsWith("http") && !base) return null;
|
|
29084
29127
|
const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
|
|
@@ -29092,7 +29135,7 @@ function GameCanvas2D({
|
|
|
29092
29135
|
}
|
|
29093
29136
|
return null;
|
|
29094
29137
|
}, []);
|
|
29095
|
-
|
|
29138
|
+
React84.useEffect(() => {
|
|
29096
29139
|
const canvas = canvasRef.current;
|
|
29097
29140
|
if (!canvas) return;
|
|
29098
29141
|
const ctx = canvas.getContext("2d");
|
|
@@ -29481,7 +29524,7 @@ function TurnPanel({
|
|
|
29481
29524
|
className
|
|
29482
29525
|
}) {
|
|
29483
29526
|
const eventBus = useEventBus();
|
|
29484
|
-
const handleAction =
|
|
29527
|
+
const handleAction = React84.useCallback(
|
|
29485
29528
|
(event) => {
|
|
29486
29529
|
if (event) {
|
|
29487
29530
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -29662,7 +29705,7 @@ function UnitCommandBar({
|
|
|
29662
29705
|
className
|
|
29663
29706
|
}) {
|
|
29664
29707
|
const eventBus = useEventBus();
|
|
29665
|
-
const handleCommand =
|
|
29708
|
+
const handleCommand = React84.useCallback(
|
|
29666
29709
|
(event) => {
|
|
29667
29710
|
if (event) {
|
|
29668
29711
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -30213,7 +30256,7 @@ function GameMenu({
|
|
|
30213
30256
|
} catch {
|
|
30214
30257
|
}
|
|
30215
30258
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
30216
|
-
const handleOptionClick =
|
|
30259
|
+
const handleOptionClick = React84.useCallback(
|
|
30217
30260
|
(option) => {
|
|
30218
30261
|
if (option.event && eventBus) {
|
|
30219
30262
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -30332,7 +30375,7 @@ function GameOverScreen({
|
|
|
30332
30375
|
} catch {
|
|
30333
30376
|
}
|
|
30334
30377
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
30335
|
-
const handleActionClick =
|
|
30378
|
+
const handleActionClick = React84.useCallback(
|
|
30336
30379
|
(action) => {
|
|
30337
30380
|
if (action.event && eventBus) {
|
|
30338
30381
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -31287,7 +31330,7 @@ var init_MapView = __esm({
|
|
|
31287
31330
|
shadowSize: [41, 41]
|
|
31288
31331
|
});
|
|
31289
31332
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
31290
|
-
const { useEffect: useEffect84, useRef: useRef83, useCallback: useCallback128, useState: useState114 } =
|
|
31333
|
+
const { useEffect: useEffect84, useRef: useRef83, useCallback: useCallback128, useState: useState114 } = React84__default;
|
|
31291
31334
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
31292
31335
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
31293
31336
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -32123,6 +32166,15 @@ function renderIconInput3(icon, props) {
|
|
|
32123
32166
|
function columnLabel(col) {
|
|
32124
32167
|
return col.header ?? col.label ?? col.key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
32125
32168
|
}
|
|
32169
|
+
function asFieldValue(v) {
|
|
32170
|
+
if (v === void 0 || v === null) return v;
|
|
32171
|
+
const t = typeof v;
|
|
32172
|
+
if (t === "string" || t === "number" || t === "boolean") return v;
|
|
32173
|
+
if (v instanceof Date) return v;
|
|
32174
|
+
if (Array.isArray(v)) return v;
|
|
32175
|
+
if (t === "object") return v;
|
|
32176
|
+
return void 0;
|
|
32177
|
+
}
|
|
32126
32178
|
function statusVariant4(value) {
|
|
32127
32179
|
const v = value.toLowerCase();
|
|
32128
32180
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online", "ok"].includes(v)) return "success";
|
|
@@ -32193,8 +32245,8 @@ function TableView({
|
|
|
32193
32245
|
}) {
|
|
32194
32246
|
const eventBus = useEventBus();
|
|
32195
32247
|
const { t } = useTranslate();
|
|
32196
|
-
const [visibleCount, setVisibleCount] =
|
|
32197
|
-
const [localSelected, setLocalSelected] =
|
|
32248
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
32249
|
+
const [localSelected, setLocalSelected] = React84__default.useState(/* @__PURE__ */ new Set());
|
|
32198
32250
|
const colDefs = columns ?? fields ?? [];
|
|
32199
32251
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32200
32252
|
const dnd = useDataDnd({
|
|
@@ -32339,7 +32391,7 @@ function TableView({
|
|
|
32339
32391
|
}
|
|
32340
32392
|
) }),
|
|
32341
32393
|
hasRenderProp ? /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(row, index) }) : colDefs.map((col) => {
|
|
32342
|
-
const raw = getNestedValue(row, col.field ?? col.key);
|
|
32394
|
+
const raw = asFieldValue(getNestedValue(row, col.field ?? col.key));
|
|
32343
32395
|
const cellBase = cn(
|
|
32344
32396
|
"flex items-center min-w-0",
|
|
32345
32397
|
alignClass[col.align ?? "left"],
|
|
@@ -32389,12 +32441,12 @@ function TableView({
|
|
|
32389
32441
|
]
|
|
32390
32442
|
}
|
|
32391
32443
|
);
|
|
32392
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
32444
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React84__default.Fragment, { children: rowInner }, id);
|
|
32393
32445
|
};
|
|
32394
|
-
const items =
|
|
32446
|
+
const items = Array.from(data);
|
|
32395
32447
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
32396
32448
|
let runningIndex = 0;
|
|
32397
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32449
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
32398
32450
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
32399
32451
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
32400
32452
|
] }, gi)) });
|
|
@@ -33751,7 +33803,7 @@ var init_StepFlow = __esm({
|
|
|
33751
33803
|
className
|
|
33752
33804
|
}) => {
|
|
33753
33805
|
if (orientation === "vertical") {
|
|
33754
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
33806
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
33755
33807
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
33756
33808
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33757
33809
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -33762,7 +33814,7 @@ var init_StepFlow = __esm({
|
|
|
33762
33814
|
] })
|
|
33763
33815
|
] }) }, index)) });
|
|
33764
33816
|
}
|
|
33765
|
-
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(
|
|
33817
|
+
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(React84__default.Fragment, { children: [
|
|
33766
33818
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
33767
33819
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33768
33820
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -34747,7 +34799,7 @@ var init_LikertScale = __esm({
|
|
|
34747
34799
|
md: "text-base",
|
|
34748
34800
|
lg: "text-lg"
|
|
34749
34801
|
};
|
|
34750
|
-
LikertScale =
|
|
34802
|
+
LikertScale = React84__default.forwardRef(
|
|
34751
34803
|
({
|
|
34752
34804
|
question,
|
|
34753
34805
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -34759,7 +34811,7 @@ var init_LikertScale = __esm({
|
|
|
34759
34811
|
variant = "radios",
|
|
34760
34812
|
className
|
|
34761
34813
|
}, ref) => {
|
|
34762
|
-
const groupId =
|
|
34814
|
+
const groupId = React84__default.useId();
|
|
34763
34815
|
const eventBus = useEventBus();
|
|
34764
34816
|
const handleSelect = useCallback(
|
|
34765
34817
|
(next) => {
|
|
@@ -35654,11 +35706,11 @@ function nextBlockId(prefix = "blk") {
|
|
|
35654
35706
|
function normalizeBlocks(raw) {
|
|
35655
35707
|
if (!Array.isArray(raw) || raw.length === 0) return [createBlock("paragraph")];
|
|
35656
35708
|
return raw.map((row) => {
|
|
35657
|
-
const
|
|
35658
|
-
const rawType =
|
|
35709
|
+
const entity = row;
|
|
35710
|
+
const rawType = entity.type;
|
|
35659
35711
|
const type = typeof rawType === "string" && BLOCK_TYPES.has(rawType) ? rawType : "paragraph";
|
|
35660
|
-
const id = typeof
|
|
35661
|
-
return { ...
|
|
35712
|
+
const id = typeof entity.id === "string" && entity.id ? entity.id : nextBlockId(type);
|
|
35713
|
+
return { ...entity, id, type };
|
|
35662
35714
|
});
|
|
35663
35715
|
}
|
|
35664
35716
|
function createBlock(type) {
|
|
@@ -37041,7 +37093,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
37041
37093
|
"aria-label": t("aria.breadcrumb"),
|
|
37042
37094
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
37043
37095
|
const isLast = idx === items.length - 1;
|
|
37044
|
-
return /* @__PURE__ */ jsxs(
|
|
37096
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
37045
37097
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
37046
37098
|
Icon,
|
|
37047
37099
|
{
|
|
@@ -37909,8 +37961,8 @@ var init_MiniStateMachine = __esm({
|
|
|
37909
37961
|
states.map((s, i) => {
|
|
37910
37962
|
const x = 2 + i * (NODE_W + GAP2 + ARROW_W + GAP2);
|
|
37911
37963
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37912
|
-
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
37913
|
-
return /* @__PURE__ */ jsxs(
|
|
37964
|
+
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37965
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
37914
37966
|
/* @__PURE__ */ jsx(
|
|
37915
37967
|
AvlState,
|
|
37916
37968
|
{
|
|
@@ -37920,8 +37972,8 @@ var init_MiniStateMachine = __esm({
|
|
|
37920
37972
|
height: NODE_H,
|
|
37921
37973
|
name: "",
|
|
37922
37974
|
role,
|
|
37923
|
-
isInitial: s.isInitial,
|
|
37924
|
-
isTerminal: s.isTerminal
|
|
37975
|
+
isInitial: s.isInitial ?? void 0,
|
|
37976
|
+
isTerminal: s.isTerminal ?? void 0
|
|
37925
37977
|
}
|
|
37926
37978
|
),
|
|
37927
37979
|
i < states.length - 1 && /* @__PURE__ */ jsxs("g", { children: [
|
|
@@ -38114,7 +38166,7 @@ var init_PageHeader = __esm({
|
|
|
38114
38166
|
info: "bg-info/10 text-info"
|
|
38115
38167
|
};
|
|
38116
38168
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
38117
|
-
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(
|
|
38169
|
+
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(React84__default.Fragment, { children: [
|
|
38118
38170
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
38119
38171
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
38120
38172
|
"a",
|
|
@@ -38472,52 +38524,49 @@ var init_Section = __esm({
|
|
|
38472
38524
|
as: Component2 = "section"
|
|
38473
38525
|
}) => {
|
|
38474
38526
|
const hasHeader = title || description || action;
|
|
38475
|
-
|
|
38476
|
-
|
|
38477
|
-
Comp,
|
|
38527
|
+
return React84__default.createElement(
|
|
38528
|
+
Component2,
|
|
38478
38529
|
{
|
|
38479
38530
|
className: cn(
|
|
38480
38531
|
paddingStyles4[padding],
|
|
38481
38532
|
variantStyles8[variant],
|
|
38482
38533
|
className
|
|
38483
|
-
)
|
|
38484
|
-
|
|
38485
|
-
|
|
38486
|
-
|
|
38487
|
-
|
|
38488
|
-
|
|
38489
|
-
|
|
38490
|
-
|
|
38491
|
-
|
|
38492
|
-
|
|
38493
|
-
),
|
|
38494
|
-
children: [
|
|
38495
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
38496
|
-
title && /* @__PURE__ */ jsx(
|
|
38497
|
-
Typography,
|
|
38498
|
-
{
|
|
38499
|
-
variant: "h4",
|
|
38500
|
-
className: "text-foreground font-semibold",
|
|
38501
|
-
children: title
|
|
38502
|
-
}
|
|
38503
|
-
),
|
|
38504
|
-
description && /* @__PURE__ */ jsx(
|
|
38505
|
-
Typography,
|
|
38506
|
-
{
|
|
38507
|
-
variant: "body",
|
|
38508
|
-
color: "muted",
|
|
38509
|
-
className: "mt-1",
|
|
38510
|
-
children: description
|
|
38511
|
-
}
|
|
38512
|
-
)
|
|
38513
|
-
] }),
|
|
38514
|
-
action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
|
|
38515
|
-
]
|
|
38516
|
-
}
|
|
38534
|
+
)
|
|
38535
|
+
},
|
|
38536
|
+
hasHeader && /* @__PURE__ */ jsxs(
|
|
38537
|
+
Box,
|
|
38538
|
+
{
|
|
38539
|
+
className: cn(
|
|
38540
|
+
"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2 sm:gap-4",
|
|
38541
|
+
divider && "pb-4 mb-4 border-b-[length:var(--border-width)] border-border",
|
|
38542
|
+
!divider && "mb-4",
|
|
38543
|
+
headerClassName
|
|
38517
38544
|
),
|
|
38518
|
-
|
|
38519
|
-
|
|
38520
|
-
|
|
38545
|
+
children: [
|
|
38546
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
38547
|
+
title && /* @__PURE__ */ jsx(
|
|
38548
|
+
Typography,
|
|
38549
|
+
{
|
|
38550
|
+
variant: "h4",
|
|
38551
|
+
className: "text-foreground font-semibold",
|
|
38552
|
+
children: title
|
|
38553
|
+
}
|
|
38554
|
+
),
|
|
38555
|
+
description && /* @__PURE__ */ jsx(
|
|
38556
|
+
Typography,
|
|
38557
|
+
{
|
|
38558
|
+
variant: "body",
|
|
38559
|
+
color: "muted",
|
|
38560
|
+
className: "mt-1",
|
|
38561
|
+
children: description
|
|
38562
|
+
}
|
|
38563
|
+
)
|
|
38564
|
+
] }),
|
|
38565
|
+
action && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 flex items-center gap-2", children: action })
|
|
38566
|
+
]
|
|
38567
|
+
}
|
|
38568
|
+
),
|
|
38569
|
+
/* @__PURE__ */ jsx(Box, { className: contentClassName, children })
|
|
38521
38570
|
);
|
|
38522
38571
|
};
|
|
38523
38572
|
Section.displayName = "Section";
|
|
@@ -38843,7 +38892,7 @@ var init_WizardContainer = __esm({
|
|
|
38843
38892
|
const isCompleted = index < currentStep;
|
|
38844
38893
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
38845
38894
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
38846
|
-
return /* @__PURE__ */ jsxs(
|
|
38895
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
38847
38896
|
/* @__PURE__ */ jsx(
|
|
38848
38897
|
Button,
|
|
38849
38898
|
{
|
|
@@ -40998,6 +41047,22 @@ var init_DataTable = __esm({
|
|
|
40998
41047
|
DataTable.displayName = "DataTable";
|
|
40999
41048
|
}
|
|
41000
41049
|
});
|
|
41050
|
+
function toDebuggerLine(v) {
|
|
41051
|
+
if (v === null || typeof v !== "object" || Array.isArray(v) || v instanceof Date) return null;
|
|
41052
|
+
const id = v["id"];
|
|
41053
|
+
const content = v["content"];
|
|
41054
|
+
const isBug = v["isBug"];
|
|
41055
|
+
if (typeof id !== "string" || typeof content !== "string" || typeof isBug !== "boolean") return null;
|
|
41056
|
+
const isFlagged = v["isFlagged"];
|
|
41057
|
+
const explanation = v["explanation"];
|
|
41058
|
+
return {
|
|
41059
|
+
id,
|
|
41060
|
+
content,
|
|
41061
|
+
isBug,
|
|
41062
|
+
isFlagged: typeof isFlagged === "boolean" ? isFlagged : void 0,
|
|
41063
|
+
explanation: typeof explanation === "string" ? explanation : void 0
|
|
41064
|
+
};
|
|
41065
|
+
}
|
|
41001
41066
|
function DebuggerBoard({
|
|
41002
41067
|
entity,
|
|
41003
41068
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -41010,7 +41075,10 @@ function DebuggerBoard({
|
|
|
41010
41075
|
const { t } = useTranslate();
|
|
41011
41076
|
const resolved = boardEntity(entity);
|
|
41012
41077
|
const [headerError, setHeaderError] = useState(false);
|
|
41013
|
-
const lines = Array.isArray(resolved?.lines) ? resolved.lines
|
|
41078
|
+
const lines = Array.isArray(resolved?.lines) ? resolved.lines.flatMap((v) => {
|
|
41079
|
+
const l = toDebuggerLine(v);
|
|
41080
|
+
return l ? [l] : [];
|
|
41081
|
+
}) : [];
|
|
41014
41082
|
const result = str(resolved?.result) || "none";
|
|
41015
41083
|
const attempts = num(resolved?.attempts);
|
|
41016
41084
|
const submitted = result === "win";
|
|
@@ -41653,7 +41721,7 @@ var init_DialogueBubble = __esm({
|
|
|
41653
41721
|
}
|
|
41654
41722
|
});
|
|
41655
41723
|
function extractTitle(children) {
|
|
41656
|
-
if (!
|
|
41724
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
41657
41725
|
const props = children.props;
|
|
41658
41726
|
if (typeof props.title === "string") {
|
|
41659
41727
|
return props.title;
|
|
@@ -41778,7 +41846,7 @@ function LinearView({
|
|
|
41778
41846
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
41779
41847
|
const isDone = i < currentIdx;
|
|
41780
41848
|
const isCurrent = i === currentIdx;
|
|
41781
|
-
return /* @__PURE__ */ jsxs(
|
|
41849
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
41782
41850
|
i > 0 && /* @__PURE__ */ jsx(
|
|
41783
41851
|
Typography,
|
|
41784
41852
|
{
|
|
@@ -42600,12 +42668,12 @@ function evaluateFormExpression(expr, formCtx) {
|
|
|
42600
42668
|
return evaluate(expr, ctx);
|
|
42601
42669
|
}
|
|
42602
42670
|
function isOrbitalEntitySchema(value) {
|
|
42603
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
42671
|
+
if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
|
|
42604
42672
|
const fields = value.fields;
|
|
42605
42673
|
return Array.isArray(fields);
|
|
42606
42674
|
}
|
|
42607
42675
|
function isPlainEntityRow(value) {
|
|
42608
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
42676
|
+
if (value === null || value === void 0 || typeof value !== "object" || Array.isArray(value)) return false;
|
|
42609
42677
|
const fields = value.fields;
|
|
42610
42678
|
return !Array.isArray(fields);
|
|
42611
42679
|
}
|
|
@@ -42764,12 +42832,12 @@ var init_Form = __esm({
|
|
|
42764
42832
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42765
42833
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42766
42834
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42767
|
-
const normalizedInitialData =
|
|
42835
|
+
const normalizedInitialData = React84__default.useMemo(() => {
|
|
42768
42836
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42769
42837
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42770
42838
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42771
42839
|
}, [entity, initialData]);
|
|
42772
|
-
const entityDerivedFields =
|
|
42840
|
+
const entityDerivedFields = React84__default.useMemo(() => {
|
|
42773
42841
|
if (fields && fields.length > 0) return void 0;
|
|
42774
42842
|
if (!resolvedEntity) return void 0;
|
|
42775
42843
|
return resolvedEntity.fields.map(
|
|
@@ -42777,6 +42845,7 @@ var init_Form = __esm({
|
|
|
42777
42845
|
name: f3.name,
|
|
42778
42846
|
type: f3.type,
|
|
42779
42847
|
required: f3.required,
|
|
42848
|
+
// EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
|
|
42780
42849
|
defaultValue: f3.default,
|
|
42781
42850
|
// EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
|
|
42782
42851
|
values: "values" in f3 ? f3.values : void 0,
|
|
@@ -42789,16 +42858,16 @@ var init_Form = __esm({
|
|
|
42789
42858
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42790
42859
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42791
42860
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42792
|
-
const [formData, setFormData] =
|
|
42861
|
+
const [formData, setFormData] = React84__default.useState(
|
|
42793
42862
|
normalizedInitialData
|
|
42794
42863
|
);
|
|
42795
|
-
const [collapsedSections, setCollapsedSections] =
|
|
42864
|
+
const [collapsedSections, setCollapsedSections] = React84__default.useState(
|
|
42796
42865
|
/* @__PURE__ */ new Set()
|
|
42797
42866
|
);
|
|
42798
|
-
const [submitError, setSubmitError] =
|
|
42799
|
-
const formRef =
|
|
42867
|
+
const [submitError, setSubmitError] = React84__default.useState(null);
|
|
42868
|
+
const formRef = React84__default.useRef(null);
|
|
42800
42869
|
const formMode = props.mode;
|
|
42801
|
-
const mountedRef =
|
|
42870
|
+
const mountedRef = React84__default.useRef(false);
|
|
42802
42871
|
if (!mountedRef.current) {
|
|
42803
42872
|
mountedRef.current = true;
|
|
42804
42873
|
debug("forms", "mount", {
|
|
@@ -42811,7 +42880,7 @@ var init_Form = __esm({
|
|
|
42811
42880
|
});
|
|
42812
42881
|
}
|
|
42813
42882
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42814
|
-
const evalContext =
|
|
42883
|
+
const evalContext = React84__default.useMemo(
|
|
42815
42884
|
() => ({
|
|
42816
42885
|
formValues: formData,
|
|
42817
42886
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42820,7 +42889,7 @@ var init_Form = __esm({
|
|
|
42820
42889
|
}),
|
|
42821
42890
|
[formData, externalContext]
|
|
42822
42891
|
);
|
|
42823
|
-
|
|
42892
|
+
React84__default.useEffect(() => {
|
|
42824
42893
|
debug("forms", "initialData-sync", {
|
|
42825
42894
|
mode: formMode,
|
|
42826
42895
|
normalizedInitialData,
|
|
@@ -42831,7 +42900,7 @@ var init_Form = __esm({
|
|
|
42831
42900
|
setFormData(normalizedInitialData);
|
|
42832
42901
|
}
|
|
42833
42902
|
}, [normalizedInitialData]);
|
|
42834
|
-
const processCalculations =
|
|
42903
|
+
const processCalculations = React84__default.useCallback(
|
|
42835
42904
|
(changedFieldId, newFormData) => {
|
|
42836
42905
|
if (!hiddenCalculations.length) return;
|
|
42837
42906
|
const context = {
|
|
@@ -42856,7 +42925,7 @@ var init_Form = __esm({
|
|
|
42856
42925
|
},
|
|
42857
42926
|
[hiddenCalculations, externalContext, eventBus]
|
|
42858
42927
|
);
|
|
42859
|
-
const checkViolations =
|
|
42928
|
+
const checkViolations = React84__default.useCallback(
|
|
42860
42929
|
(changedFieldId, newFormData) => {
|
|
42861
42930
|
if (!violationTriggers.length) return;
|
|
42862
42931
|
const context = {
|
|
@@ -42894,7 +42963,7 @@ var init_Form = __esm({
|
|
|
42894
42963
|
processCalculations(name, newFormData);
|
|
42895
42964
|
checkViolations(name, newFormData);
|
|
42896
42965
|
};
|
|
42897
|
-
const isFieldVisible =
|
|
42966
|
+
const isFieldVisible = React84__default.useCallback(
|
|
42898
42967
|
(fieldName) => {
|
|
42899
42968
|
const condition = conditionalFields[fieldName];
|
|
42900
42969
|
if (!condition) return true;
|
|
@@ -42902,7 +42971,7 @@ var init_Form = __esm({
|
|
|
42902
42971
|
},
|
|
42903
42972
|
[conditionalFields, evalContext]
|
|
42904
42973
|
);
|
|
42905
|
-
const isSectionVisible =
|
|
42974
|
+
const isSectionVisible = React84__default.useCallback(
|
|
42906
42975
|
(section) => {
|
|
42907
42976
|
if (!section.condition) return true;
|
|
42908
42977
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42978,7 +43047,7 @@ var init_Form = __esm({
|
|
|
42978
43047
|
eventBus.emit(`UI:${onCancel}`);
|
|
42979
43048
|
}
|
|
42980
43049
|
};
|
|
42981
|
-
const renderField =
|
|
43050
|
+
const renderField = React84__default.useCallback(
|
|
42982
43051
|
(field) => {
|
|
42983
43052
|
const fieldName = field.name || field.field;
|
|
42984
43053
|
if (!fieldName) return null;
|
|
@@ -42999,7 +43068,7 @@ var init_Form = __esm({
|
|
|
42999
43068
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
43000
43069
|
);
|
|
43001
43070
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
43002
|
-
const normalizedFields =
|
|
43071
|
+
const normalizedFields = React84__default.useMemo(() => {
|
|
43003
43072
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
43004
43073
|
return effectiveFields.map((field) => {
|
|
43005
43074
|
if (typeof field === "string") {
|
|
@@ -43009,6 +43078,7 @@ var init_Form = __esm({
|
|
|
43009
43078
|
name: field,
|
|
43010
43079
|
type: entityField.type,
|
|
43011
43080
|
required: entityField.required,
|
|
43081
|
+
// EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
|
|
43012
43082
|
defaultValue: entityField.default,
|
|
43013
43083
|
// EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
|
|
43014
43084
|
values: "values" in entityField ? entityField.values : void 0,
|
|
@@ -43022,7 +43092,7 @@ var init_Form = __esm({
|
|
|
43022
43092
|
return field;
|
|
43023
43093
|
});
|
|
43024
43094
|
}, [effectiveFields, resolvedEntity]);
|
|
43025
|
-
const schemaFields =
|
|
43095
|
+
const schemaFields = React84__default.useMemo(() => {
|
|
43026
43096
|
if (normalizedFields.length === 0) return null;
|
|
43027
43097
|
if (isDebugEnabled()) {
|
|
43028
43098
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -43032,7 +43102,7 @@ var init_Form = __esm({
|
|
|
43032
43102
|
}
|
|
43033
43103
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
43034
43104
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
43035
|
-
const sectionElements =
|
|
43105
|
+
const sectionElements = React84__default.useMemo(() => {
|
|
43036
43106
|
if (!sections || sections.length === 0) return null;
|
|
43037
43107
|
return sections.map((section) => {
|
|
43038
43108
|
if (!isSectionVisible(section)) {
|
|
@@ -45295,6 +45365,14 @@ var init_GameBoard3D = __esm({
|
|
|
45295
45365
|
GameBoard3D.displayName = "GameBoard3D";
|
|
45296
45366
|
}
|
|
45297
45367
|
});
|
|
45368
|
+
function asDescriptor(v) {
|
|
45369
|
+
if (Array.isArray(v) || React84__default.isValidElement(v)) return null;
|
|
45370
|
+
const o = v;
|
|
45371
|
+
if (typeof o.type !== "string") return null;
|
|
45372
|
+
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
45373
|
+
const _id = typeof o._id === "string" ? o._id : void 0;
|
|
45374
|
+
return { type: o.type, props, _id };
|
|
45375
|
+
}
|
|
45298
45376
|
function getSlotContentRenderer() {
|
|
45299
45377
|
if (_scr) return _scr;
|
|
45300
45378
|
const mod = (init_UISlotRenderer(), __toCommonJS(UISlotRenderer_exports));
|
|
@@ -45303,17 +45381,16 @@ function getSlotContentRenderer() {
|
|
|
45303
45381
|
}
|
|
45304
45382
|
function resolveDescriptor(value, idPrefix) {
|
|
45305
45383
|
if (value === null || value === void 0) return value;
|
|
45306
|
-
if (
|
|
45384
|
+
if (React84__default.isValidElement(value)) return value;
|
|
45307
45385
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
45308
45386
|
if (Array.isArray(value)) {
|
|
45309
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
45387
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
45310
45388
|
}
|
|
45311
|
-
if (typeof value === "object") {
|
|
45312
|
-
const
|
|
45313
|
-
if (
|
|
45314
|
-
const
|
|
45315
|
-
const
|
|
45316
|
-
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
45389
|
+
if (typeof value === "object" && value !== null) {
|
|
45390
|
+
const desc = asDescriptor(value);
|
|
45391
|
+
if (desc !== null && getComponentForPattern(desc.type) !== null) {
|
|
45392
|
+
const resolvedProps = desc.props ?? {};
|
|
45393
|
+
const content = { id: desc._id ?? idPrefix, pattern: desc.type, props: resolvedProps, priority: 0 };
|
|
45317
45394
|
const SCR = getSlotContentRenderer();
|
|
45318
45395
|
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
45319
45396
|
}
|
|
@@ -45407,16 +45484,19 @@ function getSlotContentRenderer2() {
|
|
|
45407
45484
|
}
|
|
45408
45485
|
function resolveDescriptor2(value, idPrefix) {
|
|
45409
45486
|
if (value === null || value === void 0) return value;
|
|
45410
|
-
if (
|
|
45487
|
+
if (React84__default.isValidElement(value)) return value;
|
|
45411
45488
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
45412
45489
|
if (Array.isArray(value)) {
|
|
45413
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
45490
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
45414
45491
|
}
|
|
45415
45492
|
if (typeof value === "object") {
|
|
45416
45493
|
const rec = value;
|
|
45417
45494
|
if (typeof rec.type === "string" && getComponentForPattern(rec.type) !== null) {
|
|
45418
|
-
const
|
|
45419
|
-
const
|
|
45495
|
+
const type = rec.type;
|
|
45496
|
+
const _id = typeof rec._id === "string" ? rec._id : void 0;
|
|
45497
|
+
const nestedProps = rec.props !== void 0 && typeof rec.props === "object" && !Array.isArray(rec.props) && rec.props !== null ? rec.props : void 0;
|
|
45498
|
+
const { type: _t, props: _p, _id: _d, ...flatRest } = rec;
|
|
45499
|
+
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatRest;
|
|
45420
45500
|
const content = { id: _id ?? idPrefix, pattern: type, props: resolvedProps, priority: 0 };
|
|
45421
45501
|
const SCR = getSlotContentRenderer2();
|
|
45422
45502
|
return /* @__PURE__ */ jsx(SCR, { content, onDismiss: () => void 0 });
|
|
@@ -45744,35 +45824,44 @@ var init_HexStrategyBoard = __esm({
|
|
|
45744
45824
|
}
|
|
45745
45825
|
});
|
|
45746
45826
|
function HolidayRunnerBoard({
|
|
45747
|
-
|
|
45827
|
+
tiles,
|
|
45828
|
+
units,
|
|
45829
|
+
features,
|
|
45830
|
+
assetManifest,
|
|
45748
45831
|
assetBaseUrl,
|
|
45749
|
-
|
|
45750
|
-
|
|
45751
|
-
|
|
45832
|
+
scale = 0.45,
|
|
45833
|
+
showMinimap = false,
|
|
45834
|
+
enableCamera = true,
|
|
45835
|
+
tileClickEvent,
|
|
45836
|
+
unitClickEvent,
|
|
45752
45837
|
isLoading,
|
|
45753
45838
|
error,
|
|
45754
45839
|
className
|
|
45755
45840
|
}) {
|
|
45756
|
-
return /* @__PURE__ */
|
|
45757
|
-
|
|
45758
|
-
|
|
45759
|
-
|
|
45760
|
-
|
|
45761
|
-
|
|
45762
|
-
|
|
45763
|
-
|
|
45764
|
-
|
|
45765
|
-
|
|
45766
|
-
|
|
45767
|
-
|
|
45768
|
-
|
|
45769
|
-
|
|
45841
|
+
return /* @__PURE__ */ jsx("div", { className: cn("holiday-runner-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
45842
|
+
IsometricCanvas_default,
|
|
45843
|
+
{
|
|
45844
|
+
tileLayout: "flat",
|
|
45845
|
+
tiles,
|
|
45846
|
+
units,
|
|
45847
|
+
features,
|
|
45848
|
+
assetManifest,
|
|
45849
|
+
assetBaseUrl,
|
|
45850
|
+
scale,
|
|
45851
|
+
showMinimap,
|
|
45852
|
+
enableCamera,
|
|
45853
|
+
tileClickEvent,
|
|
45854
|
+
unitClickEvent,
|
|
45855
|
+
isLoading,
|
|
45856
|
+
error
|
|
45857
|
+
}
|
|
45858
|
+
) });
|
|
45770
45859
|
}
|
|
45771
45860
|
var init_HolidayRunnerBoard = __esm({
|
|
45772
45861
|
"components/game/organisms/HolidayRunnerBoard.tsx"() {
|
|
45773
45862
|
"use client";
|
|
45774
45863
|
init_cn();
|
|
45775
|
-
|
|
45864
|
+
init_IsometricCanvas();
|
|
45776
45865
|
HolidayRunnerBoard.displayName = "HolidayRunnerBoard";
|
|
45777
45866
|
}
|
|
45778
45867
|
});
|
|
@@ -46111,7 +46200,7 @@ var init_List = __esm({
|
|
|
46111
46200
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
46112
46201
|
return [];
|
|
46113
46202
|
}, [entity]);
|
|
46114
|
-
const getItemActions =
|
|
46203
|
+
const getItemActions = React84__default.useCallback(
|
|
46115
46204
|
(item) => {
|
|
46116
46205
|
if (!itemActions) return [];
|
|
46117
46206
|
if (typeof itemActions === "function") {
|
|
@@ -46168,15 +46257,14 @@ var init_List = __esm({
|
|
|
46168
46257
|
};
|
|
46169
46258
|
if (effectiveFieldNames && effectiveFieldNames.length > 0) {
|
|
46170
46259
|
const firstField = effectiveFieldNames[0];
|
|
46171
|
-
|
|
46172
|
-
if (!normalizedItem.title && getNestedValue(itemRecord, firstField)) {
|
|
46260
|
+
if (!normalizedItem.title && getNestedValue(item, firstField)) {
|
|
46173
46261
|
normalizedItem.title = String(
|
|
46174
|
-
getNestedValue(
|
|
46262
|
+
getNestedValue(item, firstField)
|
|
46175
46263
|
);
|
|
46176
46264
|
}
|
|
46177
46265
|
normalizedItem._fields = effectiveFieldNames.reduce(
|
|
46178
46266
|
(acc, field) => {
|
|
46179
|
-
const value = getNestedValue(
|
|
46267
|
+
const value = getNestedValue(item, field);
|
|
46180
46268
|
if (value !== void 0 && value !== null) {
|
|
46181
46269
|
acc[field] = value;
|
|
46182
46270
|
}
|
|
@@ -46629,16 +46717,18 @@ var init_MediaGallery = __esm({
|
|
|
46629
46717
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
46630
46718
|
);
|
|
46631
46719
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
46632
|
-
const items =
|
|
46720
|
+
const items = React84__default.useMemo(() => {
|
|
46633
46721
|
if (propItems) return propItems;
|
|
46634
46722
|
if (entityData.length === 0) return [];
|
|
46635
|
-
return entityData.map((record, idx) =>
|
|
46636
|
-
|
|
46637
|
-
|
|
46638
|
-
|
|
46639
|
-
|
|
46640
|
-
|
|
46641
|
-
|
|
46723
|
+
return entityData.map((record, idx) => {
|
|
46724
|
+
return {
|
|
46725
|
+
id: String(record.id ?? idx),
|
|
46726
|
+
src: String(record.src ?? ("url" in record ? record.url : "") ?? ("image" in record ? record.image : "") ?? ""),
|
|
46727
|
+
alt: record.alt ? String(record.alt) : void 0,
|
|
46728
|
+
thumbnail: record.thumbnail ? String(record.thumbnail) : void 0,
|
|
46729
|
+
caption: record.caption ? String(record.caption) : "title" in record ? String(record.title) : void 0
|
|
46730
|
+
};
|
|
46731
|
+
});
|
|
46642
46732
|
}, [propItems, entityData]);
|
|
46643
46733
|
if (isLoading) {
|
|
46644
46734
|
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
@@ -46799,9 +46889,9 @@ function MiniMap({
|
|
|
46799
46889
|
viewportRect = DEFAULT_VIEWPORT,
|
|
46800
46890
|
className
|
|
46801
46891
|
}) {
|
|
46802
|
-
const canvasRef =
|
|
46803
|
-
const frameRef =
|
|
46804
|
-
|
|
46892
|
+
const canvasRef = React84.useRef(null);
|
|
46893
|
+
const frameRef = React84.useRef(0);
|
|
46894
|
+
React84.useEffect(() => {
|
|
46805
46895
|
const canvas = canvasRef.current;
|
|
46806
46896
|
if (!canvas) return;
|
|
46807
46897
|
const ctx = canvas.getContext("2d");
|
|
@@ -46940,7 +47030,7 @@ var init_MinigolfBoard = __esm({
|
|
|
46940
47030
|
}
|
|
46941
47031
|
});
|
|
46942
47032
|
function extractTitle2(children) {
|
|
46943
|
-
if (!
|
|
47033
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
46944
47034
|
const props = children.props;
|
|
46945
47035
|
if (typeof props.title === "string") {
|
|
46946
47036
|
return props.title;
|
|
@@ -47006,8 +47096,16 @@ function NegotiatorBoard({
|
|
|
47006
47096
|
const lastPlayerAction = str(resolved?.lastPlayerAction);
|
|
47007
47097
|
const lastOpponentAction = str(resolved?.lastOpponentAction);
|
|
47008
47098
|
const lastPayoff = num(resolved?.lastPayoff);
|
|
47009
|
-
const actions = Array.isArray(resolved?.actions) ? resolved.actions
|
|
47010
|
-
|
|
47099
|
+
const actions = Array.isArray(resolved?.actions) ? resolved.actions.flatMap((item) => {
|
|
47100
|
+
if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.id === "string" && typeof item.label === "string")
|
|
47101
|
+
return [{ id: item.id, label: item.label, description: typeof item.description === "string" ? item.description : void 0 }];
|
|
47102
|
+
return [];
|
|
47103
|
+
}) : [];
|
|
47104
|
+
const payoffMatrix = Array.isArray(resolved?.payoffMatrix) ? resolved.payoffMatrix.flatMap((item) => {
|
|
47105
|
+
if (item !== null && typeof item === "object" && !Array.isArray(item) && !(item instanceof Date) && typeof item.playerAction === "string" && typeof item.opponentAction === "string")
|
|
47106
|
+
return [{ playerAction: item.playerAction, opponentAction: item.opponentAction, playerPayoff: typeof item.playerPayoff === "number" ? item.playerPayoff : 0, opponentPayoff: typeof item.opponentPayoff === "number" ? item.opponentPayoff : 0 }];
|
|
47107
|
+
return [];
|
|
47108
|
+
}) : [];
|
|
47011
47109
|
const prevRoundRef = useRef(currentRound);
|
|
47012
47110
|
useEffect(() => {
|
|
47013
47111
|
if (currentRound > prevRoundRef.current && lastPlayerAction) {
|
|
@@ -47598,25 +47696,36 @@ var init_PricingPageTemplate = __esm({
|
|
|
47598
47696
|
}
|
|
47599
47697
|
});
|
|
47600
47698
|
function RacingBoard({
|
|
47601
|
-
|
|
47699
|
+
tiles,
|
|
47700
|
+
units,
|
|
47701
|
+
features,
|
|
47702
|
+
assetManifest,
|
|
47602
47703
|
assetBaseUrl,
|
|
47603
|
-
|
|
47604
|
-
|
|
47605
|
-
|
|
47606
|
-
|
|
47607
|
-
|
|
47704
|
+
scale = 0.45,
|
|
47705
|
+
showMinimap = true,
|
|
47706
|
+
enableCamera = true,
|
|
47707
|
+
tileClickEvent,
|
|
47708
|
+
unitClickEvent,
|
|
47709
|
+
isLoading,
|
|
47710
|
+
error,
|
|
47608
47711
|
className
|
|
47609
47712
|
}) {
|
|
47610
47713
|
return /* @__PURE__ */ jsx("div", { className: cn("racing-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
47611
|
-
|
|
47714
|
+
IsometricCanvas_default,
|
|
47612
47715
|
{
|
|
47613
|
-
|
|
47716
|
+
tileLayout: "flat",
|
|
47717
|
+
tiles,
|
|
47718
|
+
units,
|
|
47719
|
+
features,
|
|
47720
|
+
assetManifest,
|
|
47614
47721
|
assetBaseUrl,
|
|
47615
|
-
|
|
47616
|
-
|
|
47617
|
-
|
|
47618
|
-
|
|
47619
|
-
|
|
47722
|
+
scale,
|
|
47723
|
+
showMinimap,
|
|
47724
|
+
enableCamera,
|
|
47725
|
+
tileClickEvent,
|
|
47726
|
+
unitClickEvent,
|
|
47727
|
+
isLoading,
|
|
47728
|
+
error
|
|
47620
47729
|
}
|
|
47621
47730
|
) });
|
|
47622
47731
|
}
|
|
@@ -47624,7 +47733,7 @@ var init_RacingBoard = __esm({
|
|
|
47624
47733
|
"components/game/organisms/RacingBoard.tsx"() {
|
|
47625
47734
|
"use client";
|
|
47626
47735
|
init_cn();
|
|
47627
|
-
|
|
47736
|
+
init_IsometricCanvas();
|
|
47628
47737
|
RacingBoard.displayName = "RacingBoard";
|
|
47629
47738
|
}
|
|
47630
47739
|
});
|
|
@@ -48169,7 +48278,7 @@ var init_debugRegistry = __esm({
|
|
|
48169
48278
|
}
|
|
48170
48279
|
});
|
|
48171
48280
|
function useDebugData() {
|
|
48172
|
-
const [data, setData] =
|
|
48281
|
+
const [data, setData] = React84.useState(() => ({
|
|
48173
48282
|
traits: [],
|
|
48174
48283
|
ticks: [],
|
|
48175
48284
|
guards: [],
|
|
@@ -48183,7 +48292,7 @@ function useDebugData() {
|
|
|
48183
48292
|
},
|
|
48184
48293
|
lastUpdate: Date.now()
|
|
48185
48294
|
}));
|
|
48186
|
-
|
|
48295
|
+
React84.useEffect(() => {
|
|
48187
48296
|
const updateData = () => {
|
|
48188
48297
|
setData({
|
|
48189
48298
|
traits: getAllTraits(),
|
|
@@ -48292,12 +48401,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
48292
48401
|
return positions;
|
|
48293
48402
|
}
|
|
48294
48403
|
function WalkMinimap() {
|
|
48295
|
-
const [walkStep, setWalkStep] =
|
|
48296
|
-
const [traits2, setTraits] =
|
|
48297
|
-
const [coveredEdges, setCoveredEdges] =
|
|
48298
|
-
const [completedTraits, setCompletedTraits] =
|
|
48299
|
-
const prevTraitRef =
|
|
48300
|
-
|
|
48404
|
+
const [walkStep, setWalkStep] = React84.useState(null);
|
|
48405
|
+
const [traits2, setTraits] = React84.useState([]);
|
|
48406
|
+
const [coveredEdges, setCoveredEdges] = React84.useState([]);
|
|
48407
|
+
const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
|
|
48408
|
+
const prevTraitRef = React84.useRef(null);
|
|
48409
|
+
React84.useEffect(() => {
|
|
48301
48410
|
const interval = setInterval(() => {
|
|
48302
48411
|
const w = window;
|
|
48303
48412
|
const step = w.__orbitalWalkStep;
|
|
@@ -48733,15 +48842,15 @@ var init_EntitiesTab = __esm({
|
|
|
48733
48842
|
});
|
|
48734
48843
|
function EventFlowTab({ events: events2 }) {
|
|
48735
48844
|
const { t } = useTranslate();
|
|
48736
|
-
const [filter, setFilter] =
|
|
48737
|
-
const containerRef =
|
|
48738
|
-
const [autoScroll, setAutoScroll] =
|
|
48739
|
-
|
|
48845
|
+
const [filter, setFilter] = React84.useState("all");
|
|
48846
|
+
const containerRef = React84.useRef(null);
|
|
48847
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
48848
|
+
React84.useEffect(() => {
|
|
48740
48849
|
if (autoScroll && containerRef.current) {
|
|
48741
48850
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48742
48851
|
}
|
|
48743
48852
|
}, [events2.length, autoScroll]);
|
|
48744
|
-
const filteredEvents =
|
|
48853
|
+
const filteredEvents = React84.useMemo(() => {
|
|
48745
48854
|
if (filter === "all") return events2;
|
|
48746
48855
|
return events2.filter((e) => e.type === filter);
|
|
48747
48856
|
}, [events2, filter]);
|
|
@@ -48857,7 +48966,7 @@ var init_EventFlowTab = __esm({
|
|
|
48857
48966
|
});
|
|
48858
48967
|
function GuardsPanel({ guards }) {
|
|
48859
48968
|
const { t } = useTranslate();
|
|
48860
|
-
const [filter, setFilter] =
|
|
48969
|
+
const [filter, setFilter] = React84.useState("all");
|
|
48861
48970
|
if (guards.length === 0) {
|
|
48862
48971
|
return /* @__PURE__ */ jsx(
|
|
48863
48972
|
EmptyState,
|
|
@@ -48870,7 +48979,7 @@ function GuardsPanel({ guards }) {
|
|
|
48870
48979
|
}
|
|
48871
48980
|
const passedCount = guards.filter((g) => g.result).length;
|
|
48872
48981
|
const failedCount = guards.length - passedCount;
|
|
48873
|
-
const filteredGuards =
|
|
48982
|
+
const filteredGuards = React84.useMemo(() => {
|
|
48874
48983
|
if (filter === "all") return guards;
|
|
48875
48984
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
48876
48985
|
return guards.filter((g) => !g.result);
|
|
@@ -49033,10 +49142,10 @@ function EffectBadge({ effect }) {
|
|
|
49033
49142
|
}
|
|
49034
49143
|
function TransitionTimeline({ transitions }) {
|
|
49035
49144
|
const { t } = useTranslate();
|
|
49036
|
-
const containerRef =
|
|
49037
|
-
const [autoScroll, setAutoScroll] =
|
|
49038
|
-
const [expandedId, setExpandedId] =
|
|
49039
|
-
|
|
49145
|
+
const containerRef = React84.useRef(null);
|
|
49146
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
49147
|
+
const [expandedId, setExpandedId] = React84.useState(null);
|
|
49148
|
+
React84.useEffect(() => {
|
|
49040
49149
|
if (autoScroll && containerRef.current) {
|
|
49041
49150
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
49042
49151
|
}
|
|
@@ -49242,18 +49351,18 @@ var init_ServerBridgeTab = __esm({
|
|
|
49242
49351
|
});
|
|
49243
49352
|
function extractPayloadFields(schema, eventName) {
|
|
49244
49353
|
if (!schema) return [];
|
|
49245
|
-
const
|
|
49246
|
-
|
|
49247
|
-
|
|
49248
|
-
|
|
49249
|
-
|
|
49250
|
-
const sm =
|
|
49354
|
+
for (const orbital of schema.orbitals) {
|
|
49355
|
+
const traitRefs = orbital.traits ?? [];
|
|
49356
|
+
for (const traitRef of traitRefs) {
|
|
49357
|
+
if (!isInlineTrait(traitRef)) continue;
|
|
49358
|
+
const inlineTrait = traitRef;
|
|
49359
|
+
const sm = inlineTrait.stateMachine;
|
|
49251
49360
|
if (!sm) continue;
|
|
49252
49361
|
const events2 = sm.events ?? [];
|
|
49253
49362
|
for (const evt of events2) {
|
|
49254
49363
|
if (evt.name !== eventName) continue;
|
|
49255
|
-
const
|
|
49256
|
-
return
|
|
49364
|
+
const payloadFields = evt.payloadSchema ?? [];
|
|
49365
|
+
return payloadFields.map((f3) => ({
|
|
49257
49366
|
name: f3.name,
|
|
49258
49367
|
type: f3.type ?? "string"
|
|
49259
49368
|
}));
|
|
@@ -49316,9 +49425,9 @@ function getAllEvents(traits2) {
|
|
|
49316
49425
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
49317
49426
|
const eventBus = useEventBus();
|
|
49318
49427
|
const { t } = useTranslate();
|
|
49319
|
-
const [log10, setLog] =
|
|
49320
|
-
const prevStatesRef =
|
|
49321
|
-
|
|
49428
|
+
const [log10, setLog] = React84.useState([]);
|
|
49429
|
+
const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
|
|
49430
|
+
React84.useEffect(() => {
|
|
49322
49431
|
for (const trait of traits2) {
|
|
49323
49432
|
const prev = prevStatesRef.current.get(trait.id);
|
|
49324
49433
|
if (prev && prev !== trait.currentState) {
|
|
@@ -49487,10 +49596,10 @@ function VerifyModePanel({
|
|
|
49487
49596
|
localCount
|
|
49488
49597
|
}) {
|
|
49489
49598
|
const { t } = useTranslate();
|
|
49490
|
-
const [expanded, setExpanded] =
|
|
49491
|
-
const scrollRef =
|
|
49492
|
-
const prevCountRef =
|
|
49493
|
-
|
|
49599
|
+
const [expanded, setExpanded] = React84.useState(true);
|
|
49600
|
+
const scrollRef = React84.useRef(null);
|
|
49601
|
+
const prevCountRef = React84.useRef(0);
|
|
49602
|
+
React84.useEffect(() => {
|
|
49494
49603
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
49495
49604
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
49496
49605
|
}
|
|
@@ -49547,10 +49656,10 @@ function RuntimeDebugger({
|
|
|
49547
49656
|
schema
|
|
49548
49657
|
}) {
|
|
49549
49658
|
const { t } = useTranslate();
|
|
49550
|
-
const [isCollapsed, setIsCollapsed] =
|
|
49551
|
-
const [isVisible, setIsVisible] =
|
|
49659
|
+
const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
|
|
49660
|
+
const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
49552
49661
|
const debugData = useDebugData();
|
|
49553
|
-
|
|
49662
|
+
React84.useEffect(() => {
|
|
49554
49663
|
if (mode === "inline") return;
|
|
49555
49664
|
return onDebugToggle((enabled) => {
|
|
49556
49665
|
setIsVisible(enabled);
|
|
@@ -49559,7 +49668,7 @@ function RuntimeDebugger({
|
|
|
49559
49668
|
}
|
|
49560
49669
|
});
|
|
49561
49670
|
}, [mode]);
|
|
49562
|
-
|
|
49671
|
+
React84.useEffect(() => {
|
|
49563
49672
|
if (mode === "inline") return;
|
|
49564
49673
|
const handleKeyDown = (e) => {
|
|
49565
49674
|
if (e.key === "`" && isVisible) {
|
|
@@ -50119,7 +50228,7 @@ function SequenceBar({
|
|
|
50119
50228
|
onSlotRemove(index);
|
|
50120
50229
|
}, [onSlotRemove, playing]);
|
|
50121
50230
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
50122
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
50231
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
50123
50232
|
i > 0 && /* @__PURE__ */ jsx(
|
|
50124
50233
|
Typography,
|
|
50125
50234
|
{
|
|
@@ -50734,6 +50843,29 @@ var init_SimulationCanvas = __esm({
|
|
|
50734
50843
|
SimulationCanvas.displayName = "SimulationCanvas";
|
|
50735
50844
|
}
|
|
50736
50845
|
});
|
|
50846
|
+
function readSimulatorParameters(v) {
|
|
50847
|
+
if (!Array.isArray(v)) return [];
|
|
50848
|
+
const result = [];
|
|
50849
|
+
for (const item of v) {
|
|
50850
|
+
if (typeof item === "object" && item !== null && !Array.isArray(item) && !(item instanceof Date)) {
|
|
50851
|
+
const param = item;
|
|
50852
|
+
if ("id" in item && "label" in item && "unit" in item && "min" in item && "max" in item && "step" in item) {
|
|
50853
|
+
result.push({
|
|
50854
|
+
id: str(param.id),
|
|
50855
|
+
label: str(param.label),
|
|
50856
|
+
unit: str(param.unit),
|
|
50857
|
+
min: num(param.min),
|
|
50858
|
+
max: num(param.max),
|
|
50859
|
+
step: num(param.step),
|
|
50860
|
+
initial: num(param.initial),
|
|
50861
|
+
correct: num(param.correct),
|
|
50862
|
+
tolerance: num(param.tolerance)
|
|
50863
|
+
});
|
|
50864
|
+
}
|
|
50865
|
+
}
|
|
50866
|
+
}
|
|
50867
|
+
return result;
|
|
50868
|
+
}
|
|
50737
50869
|
function SimulatorBoard({
|
|
50738
50870
|
entity,
|
|
50739
50871
|
completeEvent = "PUZZLE_COMPLETE",
|
|
@@ -50746,7 +50878,7 @@ function SimulatorBoard({
|
|
|
50746
50878
|
const { emit } = useEventBus();
|
|
50747
50879
|
const { t } = useTranslate();
|
|
50748
50880
|
const resolved = boardEntity(entity);
|
|
50749
|
-
const parameters =
|
|
50881
|
+
const parameters = readSimulatorParameters(resolved?.parameters);
|
|
50750
50882
|
const [headerError, setHeaderError] = useState(false);
|
|
50751
50883
|
if (!resolved) return null;
|
|
50752
50884
|
const paramA = num(resolved.paramA);
|
|
@@ -50773,8 +50905,14 @@ function SimulatorBoard({
|
|
|
50773
50905
|
const handlePlayAgain = () => {
|
|
50774
50906
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
50775
50907
|
};
|
|
50776
|
-
const
|
|
50777
|
-
|
|
50908
|
+
const themeBackground = (() => {
|
|
50909
|
+
const t2 = resolved.theme;
|
|
50910
|
+
if (typeof t2 === "object" && t2 !== null && !Array.isArray(t2) && !(t2 instanceof Date)) {
|
|
50911
|
+
const bg = t2.background;
|
|
50912
|
+
return str(bg);
|
|
50913
|
+
}
|
|
50914
|
+
return "";
|
|
50915
|
+
})();
|
|
50778
50916
|
const headerImage = str(resolved.headerImage);
|
|
50779
50917
|
const hint = str(resolved.hint);
|
|
50780
50918
|
const showHint = isComplete && !isWin && attempts >= 2 && Boolean(hint);
|
|
@@ -50923,35 +51061,44 @@ var init_SokobanBoard = __esm({
|
|
|
50923
51061
|
}
|
|
50924
51062
|
});
|
|
50925
51063
|
function SpaceShmupBoard({
|
|
50926
|
-
|
|
51064
|
+
tiles,
|
|
51065
|
+
units,
|
|
51066
|
+
features,
|
|
51067
|
+
assetManifest,
|
|
50927
51068
|
assetBaseUrl,
|
|
50928
|
-
|
|
50929
|
-
|
|
50930
|
-
|
|
51069
|
+
scale = 0.45,
|
|
51070
|
+
showMinimap = false,
|
|
51071
|
+
enableCamera = true,
|
|
51072
|
+
tileClickEvent,
|
|
51073
|
+
unitClickEvent,
|
|
50931
51074
|
isLoading,
|
|
50932
51075
|
error,
|
|
50933
51076
|
className
|
|
50934
51077
|
}) {
|
|
50935
|
-
return /* @__PURE__ */
|
|
50936
|
-
|
|
50937
|
-
|
|
50938
|
-
|
|
50939
|
-
|
|
50940
|
-
|
|
50941
|
-
|
|
50942
|
-
|
|
50943
|
-
|
|
50944
|
-
|
|
50945
|
-
|
|
50946
|
-
|
|
50947
|
-
|
|
50948
|
-
|
|
51078
|
+
return /* @__PURE__ */ jsx("div", { className: cn("space-shmup-board relative w-full h-full", className), children: /* @__PURE__ */ jsx(
|
|
51079
|
+
IsometricCanvas_default,
|
|
51080
|
+
{
|
|
51081
|
+
tileLayout: "flat",
|
|
51082
|
+
tiles,
|
|
51083
|
+
units,
|
|
51084
|
+
features,
|
|
51085
|
+
assetManifest,
|
|
51086
|
+
assetBaseUrl,
|
|
51087
|
+
scale,
|
|
51088
|
+
showMinimap,
|
|
51089
|
+
enableCamera,
|
|
51090
|
+
tileClickEvent,
|
|
51091
|
+
unitClickEvent,
|
|
51092
|
+
isLoading,
|
|
51093
|
+
error
|
|
51094
|
+
}
|
|
51095
|
+
) });
|
|
50949
51096
|
}
|
|
50950
51097
|
var init_SpaceShmupBoard = __esm({
|
|
50951
51098
|
"components/game/organisms/SpaceShmupBoard.tsx"() {
|
|
50952
51099
|
"use client";
|
|
50953
51100
|
init_cn();
|
|
50954
|
-
|
|
51101
|
+
init_IsometricCanvas();
|
|
50955
51102
|
SpaceShmupBoard.displayName = "SpaceShmupBoard";
|
|
50956
51103
|
}
|
|
50957
51104
|
});
|
|
@@ -51277,7 +51424,7 @@ var init_StatCard = __esm({
|
|
|
51277
51424
|
const labelToUse = propLabel ?? propTitle;
|
|
51278
51425
|
const eventBus = useEventBus();
|
|
51279
51426
|
const { t } = useTranslate();
|
|
51280
|
-
const handleActionClick =
|
|
51427
|
+
const handleActionClick = React84__default.useCallback(() => {
|
|
51281
51428
|
if (action?.event) {
|
|
51282
51429
|
eventBus.emit(`UI:${action.event}`, {});
|
|
51283
51430
|
}
|
|
@@ -51288,7 +51435,7 @@ var init_StatCard = __esm({
|
|
|
51288
51435
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
51289
51436
|
const isLoading = externalLoading ?? false;
|
|
51290
51437
|
const error = externalError;
|
|
51291
|
-
const computeMetricValue =
|
|
51438
|
+
const computeMetricValue = React84__default.useCallback(
|
|
51292
51439
|
(metric, items) => {
|
|
51293
51440
|
if (metric.value !== void 0) {
|
|
51294
51441
|
return metric.value;
|
|
@@ -51327,7 +51474,7 @@ var init_StatCard = __esm({
|
|
|
51327
51474
|
},
|
|
51328
51475
|
[]
|
|
51329
51476
|
);
|
|
51330
|
-
const schemaStats =
|
|
51477
|
+
const schemaStats = React84__default.useMemo(() => {
|
|
51331
51478
|
if (!metrics || metrics.length === 0) return null;
|
|
51332
51479
|
return metrics.map((metric) => ({
|
|
51333
51480
|
label: metric.label,
|
|
@@ -51335,7 +51482,7 @@ var init_StatCard = __esm({
|
|
|
51335
51482
|
format: metric.format
|
|
51336
51483
|
}));
|
|
51337
51484
|
}, [metrics, data, computeMetricValue]);
|
|
51338
|
-
const calculatedTrend =
|
|
51485
|
+
const calculatedTrend = React84__default.useMemo(() => {
|
|
51339
51486
|
if (manualTrend !== void 0) return manualTrend;
|
|
51340
51487
|
if (previousValue === void 0 || currentValue2 === void 0)
|
|
51341
51488
|
return void 0;
|
|
@@ -51678,8 +51825,25 @@ function StateArchitectBoard({
|
|
|
51678
51825
|
const initialState = str(resolved?.initialState);
|
|
51679
51826
|
const entityName = str(resolved?.entityName);
|
|
51680
51827
|
const availableEvents = Array.isArray(resolved?.availableEvents) ? resolved.availableEvents : [];
|
|
51681
|
-
const testCases = Array.isArray(resolved?.testCases) ? resolved.testCases : []
|
|
51682
|
-
|
|
51828
|
+
const testCases = (Array.isArray(resolved?.testCases) ? resolved.testCases : []).map((item) => {
|
|
51829
|
+
const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
|
|
51830
|
+
const eventsField = o["events"];
|
|
51831
|
+
return {
|
|
51832
|
+
events: Array.isArray(eventsField) ? eventsField : [],
|
|
51833
|
+
expectedState: str(o["expectedState"]),
|
|
51834
|
+
label: str(o["label"])
|
|
51835
|
+
};
|
|
51836
|
+
});
|
|
51837
|
+
const entityTransitions = (Array.isArray(resolved?.transitions) ? resolved.transitions : []).map((item) => {
|
|
51838
|
+
const o = typeof item === "object" && item !== null && !Array.isArray(item) ? item : {};
|
|
51839
|
+
return {
|
|
51840
|
+
id: str(o["id"]),
|
|
51841
|
+
from: str(o["from"]),
|
|
51842
|
+
to: str(o["to"]),
|
|
51843
|
+
event: str(o["event"]),
|
|
51844
|
+
...o["guardHint"] ? { guardHint: str(o["guardHint"]) } : {}
|
|
51845
|
+
};
|
|
51846
|
+
});
|
|
51683
51847
|
const entityVariables = rows(resolved?.variables);
|
|
51684
51848
|
const transitions = entityTransitions;
|
|
51685
51849
|
const attempts = typeof resolved?.attempts === "number" ? resolved.attempts : 0;
|
|
@@ -52608,8 +52772,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
52608
52772
|
] });
|
|
52609
52773
|
};
|
|
52610
52774
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
52611
|
-
const endRef =
|
|
52612
|
-
|
|
52775
|
+
const endRef = React84__default.useRef(null);
|
|
52776
|
+
React84__default.useEffect(() => {
|
|
52613
52777
|
if (!autoScroll) return;
|
|
52614
52778
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
52615
52779
|
}, [activities.length, autoScroll]);
|
|
@@ -52703,7 +52867,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
52703
52867
|
};
|
|
52704
52868
|
SubagentRichCard = ({ subagent }) => {
|
|
52705
52869
|
const { t } = useTranslate();
|
|
52706
|
-
const activities =
|
|
52870
|
+
const activities = React84__default.useMemo(
|
|
52707
52871
|
() => subagentMessagesToActivities(subagent.messages),
|
|
52708
52872
|
[subagent.messages]
|
|
52709
52873
|
);
|
|
@@ -52780,8 +52944,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
52780
52944
|
] });
|
|
52781
52945
|
};
|
|
52782
52946
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
52783
|
-
const endRef =
|
|
52784
|
-
|
|
52947
|
+
const endRef = React84__default.useRef(null);
|
|
52948
|
+
React84__default.useEffect(() => {
|
|
52785
52949
|
if (!autoScroll) return;
|
|
52786
52950
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
52787
52951
|
}, [messages.length, autoScroll]);
|
|
@@ -53252,17 +53416,12 @@ var init_Timeline = __esm({
|
|
|
53252
53416
|
look = "vertical-spacious"
|
|
53253
53417
|
}) => {
|
|
53254
53418
|
const { t } = useTranslate();
|
|
53255
|
-
const entityData =
|
|
53256
|
-
const items =
|
|
53419
|
+
const entityData = entity ?? [];
|
|
53420
|
+
const items = React84__default.useMemo(() => {
|
|
53257
53421
|
if (propItems) return propItems;
|
|
53258
53422
|
if (entityData.length === 0) return [];
|
|
53259
53423
|
return entityData.map((record, idx) => {
|
|
53260
|
-
const
|
|
53261
|
-
if (typeof f3 === "string") return f3;
|
|
53262
|
-
if (f3 && typeof f3 === "object" && "name" in f3) return String(f3.name);
|
|
53263
|
-
return "";
|
|
53264
|
-
};
|
|
53265
|
-
const resolvedFields = fields?.map(resolveField) ?? [];
|
|
53424
|
+
const resolvedFields = fields ?? [];
|
|
53266
53425
|
const titleField = resolvedFields[0] || "title";
|
|
53267
53426
|
const descField = resolvedFields[1] || "description";
|
|
53268
53427
|
const dateField = resolvedFields.find(
|
|
@@ -53410,7 +53569,7 @@ var init_TimerDisplay = __esm({
|
|
|
53410
53569
|
}
|
|
53411
53570
|
});
|
|
53412
53571
|
function extractToastProps(children) {
|
|
53413
|
-
if (!
|
|
53572
|
+
if (!React84__default.isValidElement(children)) {
|
|
53414
53573
|
if (typeof children === "string") {
|
|
53415
53574
|
return { message: children };
|
|
53416
53575
|
}
|
|
@@ -53448,7 +53607,7 @@ var init_ToastSlot = __esm({
|
|
|
53448
53607
|
eventBus.emit("UI:CLOSE");
|
|
53449
53608
|
};
|
|
53450
53609
|
if (!isVisible) return null;
|
|
53451
|
-
const isCustomContent =
|
|
53610
|
+
const isCustomContent = React84__default.isValidElement(children) && !message;
|
|
53452
53611
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
53453
53612
|
Toast,
|
|
53454
53613
|
{
|
|
@@ -54720,7 +54879,7 @@ function WorldMapBoard({
|
|
|
54720
54879
|
const resolved = boardEntity(entity);
|
|
54721
54880
|
const entityUnits = rows(resolved?.units);
|
|
54722
54881
|
const entityTiles = rows(resolved?.tiles);
|
|
54723
|
-
const features = propFeatures ?? (
|
|
54882
|
+
const features = propFeatures ?? rows(resolved?.features);
|
|
54724
54883
|
const selectedHeroId = resolved?.selectedHeroId ?? null;
|
|
54725
54884
|
const assetManifest = propAssetManifest ?? resolved?.assetManifest;
|
|
54726
54885
|
const backgroundImage = resolved?.backgroundImage;
|
|
@@ -54853,7 +55012,8 @@ function WorldMapBoard({
|
|
|
54853
55012
|
if (heroMoveEvent) {
|
|
54854
55013
|
eventBus.emit(`UI:${heroMoveEvent}`, { heroId, toX: x, toY: y });
|
|
54855
55014
|
}
|
|
54856
|
-
const
|
|
55015
|
+
const tileWithFeature = tile;
|
|
55016
|
+
const feature = tileWithFeature ? str(tileWithFeature.feature) : "";
|
|
54857
55017
|
if (feature && feature !== "none") {
|
|
54858
55018
|
const tileRow = tile;
|
|
54859
55019
|
onFeatureEnter?.(heroId, tileRow);
|
|
@@ -55074,8 +55234,8 @@ function XPBar({
|
|
|
55074
55234
|
}) {
|
|
55075
55235
|
const sizes = sizeMap18[size];
|
|
55076
55236
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
55077
|
-
const [fillWidth, setFillWidth] =
|
|
55078
|
-
|
|
55237
|
+
const [fillWidth, setFillWidth] = React84.useState(animated ? 0 : percentage);
|
|
55238
|
+
React84.useEffect(() => {
|
|
55079
55239
|
if (!animated) {
|
|
55080
55240
|
setFillWidth(percentage);
|
|
55081
55241
|
return;
|
|
@@ -55148,7 +55308,7 @@ var init_XPBar = __esm({
|
|
|
55148
55308
|
}
|
|
55149
55309
|
});
|
|
55150
55310
|
function lazyThree(name, loader) {
|
|
55151
|
-
const Lazy =
|
|
55311
|
+
const Lazy = React84__default.lazy(
|
|
55152
55312
|
() => loader().then((m) => {
|
|
55153
55313
|
const Resolved = m[name];
|
|
55154
55314
|
if (!Resolved) {
|
|
@@ -55160,13 +55320,13 @@ function lazyThree(name, loader) {
|
|
|
55160
55320
|
})
|
|
55161
55321
|
);
|
|
55162
55322
|
function ThreeWrapper(props) {
|
|
55163
|
-
return
|
|
55323
|
+
return React84__default.createElement(
|
|
55164
55324
|
ThreeBoundary,
|
|
55165
55325
|
{ name },
|
|
55166
|
-
|
|
55167
|
-
|
|
55326
|
+
React84__default.createElement(
|
|
55327
|
+
React84__default.Suspense,
|
|
55168
55328
|
{ fallback: null },
|
|
55169
|
-
|
|
55329
|
+
React84__default.createElement(Lazy, props)
|
|
55170
55330
|
)
|
|
55171
55331
|
);
|
|
55172
55332
|
}
|
|
@@ -55489,7 +55649,7 @@ var init_component_registry_generated = __esm({
|
|
|
55489
55649
|
init_WorldMapBoard();
|
|
55490
55650
|
init_WorldMapTemplate();
|
|
55491
55651
|
init_XPBar();
|
|
55492
|
-
ThreeBoundary = class extends
|
|
55652
|
+
ThreeBoundary = class extends React84__default.Component {
|
|
55493
55653
|
constructor() {
|
|
55494
55654
|
super(...arguments);
|
|
55495
55655
|
__publicField(this, "state", { failed: false });
|
|
@@ -55499,7 +55659,7 @@ var init_component_registry_generated = __esm({
|
|
|
55499
55659
|
}
|
|
55500
55660
|
render() {
|
|
55501
55661
|
if (this.state.failed) {
|
|
55502
|
-
return
|
|
55662
|
+
return React84__default.createElement(
|
|
55503
55663
|
"div",
|
|
55504
55664
|
{
|
|
55505
55665
|
"data-testid": "three-unavailable",
|
|
@@ -55865,7 +56025,7 @@ function SuspenseConfigProvider({
|
|
|
55865
56025
|
config,
|
|
55866
56026
|
children
|
|
55867
56027
|
}) {
|
|
55868
|
-
return
|
|
56028
|
+
return React84__default.createElement(
|
|
55869
56029
|
SuspenseConfigContext.Provider,
|
|
55870
56030
|
{ value: config },
|
|
55871
56031
|
children
|
|
@@ -55881,9 +56041,7 @@ function getComponentForPattern3(patternType) {
|
|
|
55881
56041
|
if (!mapping) {
|
|
55882
56042
|
return null;
|
|
55883
56043
|
}
|
|
55884
|
-
|
|
55885
|
-
if (!name) return null;
|
|
55886
|
-
return COMPONENT_REGISTRY[name] ?? null;
|
|
56044
|
+
return COMPONENT_REGISTRY[mapping] ?? null;
|
|
55887
56045
|
}
|
|
55888
56046
|
function enrichFormFields(fields, entityDef) {
|
|
55889
56047
|
const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
|
|
@@ -55895,7 +56053,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
55895
56053
|
name: field,
|
|
55896
56054
|
label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()),
|
|
55897
56055
|
type: entityField.type,
|
|
55898
|
-
required: entityField.required
|
|
56056
|
+
required: entityField.required ?? false
|
|
55899
56057
|
};
|
|
55900
56058
|
if (entityField.values && entityField.values.length > 0) {
|
|
55901
56059
|
enriched.values = entityField.values;
|
|
@@ -55903,15 +56061,15 @@ function enrichFormFields(fields, entityDef) {
|
|
|
55903
56061
|
enriched.values = entityField.enumValues;
|
|
55904
56062
|
}
|
|
55905
56063
|
if (entityField.relation) {
|
|
55906
|
-
enriched.relation = entityField.relation;
|
|
56064
|
+
enriched.relation = entityField.relation.entity;
|
|
55907
56065
|
}
|
|
55908
56066
|
return enriched;
|
|
55909
56067
|
}
|
|
55910
56068
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
55911
56069
|
}
|
|
55912
|
-
if (field && typeof field === "object" && !Array.isArray(field)) {
|
|
56070
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React84__default.isValidElement(field) && !(field instanceof Date)) {
|
|
55913
56071
|
const obj = field;
|
|
55914
|
-
const fieldName = obj.name
|
|
56072
|
+
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
55915
56073
|
if (!fieldName) return field;
|
|
55916
56074
|
if (obj.type || obj.inputType) return field;
|
|
55917
56075
|
const entityField = fieldMap.get(fieldName);
|
|
@@ -55928,7 +56086,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
55928
56086
|
}
|
|
55929
56087
|
}
|
|
55930
56088
|
if (!obj.relation && entityField.relation) {
|
|
55931
|
-
enriched.relation = entityField.relation;
|
|
56089
|
+
enriched.relation = entityField.relation.entity;
|
|
55932
56090
|
}
|
|
55933
56091
|
return enriched;
|
|
55934
56092
|
}
|
|
@@ -56355,7 +56513,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
56355
56513
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
56356
56514
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
56357
56515
|
}
|
|
56358
|
-
return /* @__PURE__ */ jsx(
|
|
56516
|
+
return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
56359
56517
|
}
|
|
56360
56518
|
if (!child || typeof child !== "object") return null;
|
|
56361
56519
|
const childId = `${parentId}-${index}`;
|
|
@@ -56395,14 +56553,14 @@ function isPatternConfig(value) {
|
|
|
56395
56553
|
if (value === null || value === void 0) return false;
|
|
56396
56554
|
if (typeof value !== "object") return false;
|
|
56397
56555
|
if (Array.isArray(value)) return false;
|
|
56398
|
-
if (
|
|
56556
|
+
if (React84__default.isValidElement(value)) return false;
|
|
56399
56557
|
if (value instanceof Date) return false;
|
|
56400
56558
|
if (typeof value === "function") return false;
|
|
56401
56559
|
const record = value;
|
|
56402
56560
|
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
56403
56561
|
}
|
|
56404
56562
|
function isPlainConfigObject(value) {
|
|
56405
|
-
if (
|
|
56563
|
+
if (React84__default.isValidElement(value)) return false;
|
|
56406
56564
|
if (value instanceof Date) return false;
|
|
56407
56565
|
const proto = Object.getPrototypeOf(value);
|
|
56408
56566
|
return proto === Object.prototype || proto === null;
|
|
@@ -56528,7 +56686,7 @@ function SlotContentRenderer({
|
|
|
56528
56686
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
56529
56687
|
const slotVal = restProps[slotKey];
|
|
56530
56688
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
56531
|
-
if (
|
|
56689
|
+
if (React84__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
56532
56690
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
56533
56691
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
56534
56692
|
slotVal,
|
|
@@ -56573,19 +56731,18 @@ function SlotContentRenderer({
|
|
|
56573
56731
|
for (const [k, v] of Object.entries(nodeSlotOverrides)) {
|
|
56574
56732
|
finalProps[k] = v;
|
|
56575
56733
|
}
|
|
56576
|
-
const
|
|
56577
|
-
|
|
56578
|
-
) ? finalProps.entity : null;
|
|
56734
|
+
const entityVal = finalProps.entity;
|
|
56735
|
+
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
56579
56736
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
56580
56737
|
const sample = resolvedItems[0];
|
|
56581
|
-
if (sample && typeof sample === "object") {
|
|
56738
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React84__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
56582
56739
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
56583
56740
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
56584
56741
|
}
|
|
56585
56742
|
}
|
|
56586
56743
|
const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
|
|
56587
|
-
if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
|
|
56588
|
-
finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
|
|
56744
|
+
if (isFormPattern && entityDef && Array.isArray(finalProps.fields) && finalProps.fields[0] !== "fn") {
|
|
56745
|
+
finalProps.fields = enrichFormFields([...finalProps.fields], entityDef);
|
|
56589
56746
|
}
|
|
56590
56747
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
56591
56748
|
return /* @__PURE__ */ jsx(
|
|
@@ -57847,15 +58004,15 @@ function NotifyListener() {
|
|
|
57847
58004
|
}, []);
|
|
57848
58005
|
useEffect(() => {
|
|
57849
58006
|
const unsubscribe = eventBus.on("UI:NOTIFY", (event) => {
|
|
57850
|
-
const payload = event.payload
|
|
57851
|
-
const message = typeof payload.message === "string" ? payload.message : "Notification";
|
|
58007
|
+
const payload = event.payload;
|
|
58008
|
+
const message = payload && typeof payload.message === "string" ? payload.message : "Notification";
|
|
57852
58009
|
const severityMap = {
|
|
57853
58010
|
success: "success",
|
|
57854
58011
|
error: "error",
|
|
57855
58012
|
warning: "warning",
|
|
57856
58013
|
info: "info"
|
|
57857
58014
|
};
|
|
57858
|
-
const variant = severityMap[String(payload.severity)]
|
|
58015
|
+
const variant = payload && String(payload.severity) in severityMap ? severityMap[String(payload.severity)] : "info";
|
|
57859
58016
|
const id = ++nextId;
|
|
57860
58017
|
setItems((prev) => {
|
|
57861
58018
|
const last = prev[prev.length - 1];
|