@almadar/ui 5.23.0 → 5.24.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 +1432 -1361
- package/dist/avl/index.js +366 -295
- package/dist/components/core/molecules/AssetPicker.d.ts +21 -0
- package/dist/components/core/molecules/CodeViewer.d.ts +3 -2
- package/dist/components/core/molecules/DocCodeBlock.d.ts +2 -1
- package/dist/components/core/molecules/GridPicker.d.ts +44 -0
- package/dist/components/core/molecules/IconPicker.d.ts +18 -0
- package/dist/components/core/molecules/PropertyInspector.d.ts +3 -1
- package/dist/components/core/molecules/RichBlockEditor.d.ts +7 -0
- package/dist/components/core/molecules/index.d.ts +4 -1
- package/dist/components/core/molecules/markdown/CodeBlock.d.ts +15 -1
- package/dist/components/core/molecules/markdown/index.d.ts +1 -1
- package/dist/components/index.cjs +1576 -1184
- package/dist/components/index.js +675 -283
- package/dist/docs/index.d.cts +20 -1
- package/dist/marketing/index.cjs +8 -5
- package/dist/marketing/index.js +8 -5
- package/dist/providers/index.cjs +1257 -1186
- package/dist/providers/index.js +342 -271
- package/dist/runtime/index.cjs +1297 -1226
- package/dist/runtime/index.js +346 -275
- package/package.json +2 -2
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React86 from 'react';
|
|
2
|
+
import React86__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -393,7 +393,7 @@ var init_Box = __esm({
|
|
|
393
393
|
fixed: "fixed",
|
|
394
394
|
sticky: "sticky"
|
|
395
395
|
};
|
|
396
|
-
Box =
|
|
396
|
+
Box = React86__default.forwardRef(
|
|
397
397
|
({
|
|
398
398
|
padding,
|
|
399
399
|
paddingX,
|
|
@@ -443,7 +443,7 @@ var init_Box = __esm({
|
|
|
443
443
|
onMouseLeave?.(e);
|
|
444
444
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
445
445
|
const isClickable = action || onClick;
|
|
446
|
-
return
|
|
446
|
+
return React86__default.createElement(
|
|
447
447
|
Component,
|
|
448
448
|
{
|
|
449
449
|
ref,
|
|
@@ -1226,7 +1226,7 @@ var init_Icon = __esm({
|
|
|
1226
1226
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1227
1227
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1228
1228
|
const family = useIconFamily();
|
|
1229
|
-
const RenderedComponent =
|
|
1229
|
+
const RenderedComponent = React86__default.useMemo(() => {
|
|
1230
1230
|
if (directIcon) return null;
|
|
1231
1231
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1232
1232
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1284,7 +1284,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1284
1284
|
const IconComp = value;
|
|
1285
1285
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1286
1286
|
}
|
|
1287
|
-
if (
|
|
1287
|
+
if (React86__default.isValidElement(value)) {
|
|
1288
1288
|
return value;
|
|
1289
1289
|
}
|
|
1290
1290
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1360,7 +1360,7 @@ var init_Button = __esm({
|
|
|
1360
1360
|
md: "h-icon-default w-icon-default",
|
|
1361
1361
|
lg: "h-icon-default w-icon-default"
|
|
1362
1362
|
};
|
|
1363
|
-
Button =
|
|
1363
|
+
Button = React86__default.forwardRef(
|
|
1364
1364
|
({
|
|
1365
1365
|
className,
|
|
1366
1366
|
variant = "primary",
|
|
@@ -1425,7 +1425,7 @@ var Dialog;
|
|
|
1425
1425
|
var init_Dialog = __esm({
|
|
1426
1426
|
"components/core/atoms/Dialog.tsx"() {
|
|
1427
1427
|
init_cn();
|
|
1428
|
-
Dialog =
|
|
1428
|
+
Dialog = React86__default.forwardRef(
|
|
1429
1429
|
({
|
|
1430
1430
|
role = "dialog",
|
|
1431
1431
|
"aria-modal": ariaModal = true,
|
|
@@ -1950,7 +1950,7 @@ var init_Drawer = __esm({
|
|
|
1950
1950
|
};
|
|
1951
1951
|
const widthClass = width in sizeWidths ? sizeWidths[width] : "";
|
|
1952
1952
|
const widthStyle = width in sizeWidths ? void 0 : { width };
|
|
1953
|
-
const
|
|
1953
|
+
const positionClasses = position === "right" ? "right-0 border-l" : "left-0 border-r";
|
|
1954
1954
|
const animationClasses2 = position === "right" ? "animate-slide-in-right" : "animate-slide-in-left";
|
|
1955
1955
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1956
1956
|
/* @__PURE__ */ jsx(
|
|
@@ -1971,7 +1971,7 @@ var init_Drawer = __esm({
|
|
|
1971
1971
|
className: cn(
|
|
1972
1972
|
"fixed top-0 bottom-0 z-50",
|
|
1973
1973
|
"flex flex-col max-h-screen",
|
|
1974
|
-
|
|
1974
|
+
positionClasses,
|
|
1975
1975
|
widthClass,
|
|
1976
1976
|
animationClasses2,
|
|
1977
1977
|
className
|
|
@@ -2089,7 +2089,7 @@ var init_Badge = __esm({
|
|
|
2089
2089
|
md: "px-2.5 py-1 text-sm",
|
|
2090
2090
|
lg: "px-3 py-1.5 text-base"
|
|
2091
2091
|
};
|
|
2092
|
-
Badge =
|
|
2092
|
+
Badge = React86__default.forwardRef(
|
|
2093
2093
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2094
2094
|
const iconSizes3 = {
|
|
2095
2095
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2405,7 +2405,7 @@ var init_SvgFlow = __esm({
|
|
|
2405
2405
|
opacity = 1,
|
|
2406
2406
|
className
|
|
2407
2407
|
}) => {
|
|
2408
|
-
const markerId =
|
|
2408
|
+
const markerId = React86__default.useMemo(() => {
|
|
2409
2409
|
flowIdCounter += 1;
|
|
2410
2410
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2411
2411
|
}, []);
|
|
@@ -2948,7 +2948,7 @@ var init_SvgRing = __esm({
|
|
|
2948
2948
|
className,
|
|
2949
2949
|
label
|
|
2950
2950
|
}) => {
|
|
2951
|
-
const gradientId =
|
|
2951
|
+
const gradientId = React86__default.useMemo(() => {
|
|
2952
2952
|
ringIdCounter += 1;
|
|
2953
2953
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2954
2954
|
}, []);
|
|
@@ -3110,7 +3110,7 @@ var init_Input = __esm({
|
|
|
3110
3110
|
"components/core/atoms/Input.tsx"() {
|
|
3111
3111
|
init_cn();
|
|
3112
3112
|
init_Icon();
|
|
3113
|
-
Input =
|
|
3113
|
+
Input = React86__default.forwardRef(
|
|
3114
3114
|
({
|
|
3115
3115
|
className,
|
|
3116
3116
|
inputType,
|
|
@@ -3231,7 +3231,7 @@ var Label;
|
|
|
3231
3231
|
var init_Label = __esm({
|
|
3232
3232
|
"components/core/atoms/Label.tsx"() {
|
|
3233
3233
|
init_cn();
|
|
3234
|
-
Label =
|
|
3234
|
+
Label = React86__default.forwardRef(
|
|
3235
3235
|
({ className, required, children, ...props }, ref) => {
|
|
3236
3236
|
return /* @__PURE__ */ jsxs(
|
|
3237
3237
|
"label",
|
|
@@ -3257,7 +3257,7 @@ var Textarea;
|
|
|
3257
3257
|
var init_Textarea = __esm({
|
|
3258
3258
|
"components/core/atoms/Textarea.tsx"() {
|
|
3259
3259
|
init_cn();
|
|
3260
|
-
Textarea =
|
|
3260
|
+
Textarea = React86__default.forwardRef(
|
|
3261
3261
|
({ className, error, ...props }, ref) => {
|
|
3262
3262
|
return /* @__PURE__ */ jsx(
|
|
3263
3263
|
"textarea",
|
|
@@ -3287,7 +3287,7 @@ var init_Select = __esm({
|
|
|
3287
3287
|
"components/core/atoms/Select.tsx"() {
|
|
3288
3288
|
init_cn();
|
|
3289
3289
|
init_Icon();
|
|
3290
|
-
Select =
|
|
3290
|
+
Select = React86__default.forwardRef(
|
|
3291
3291
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3292
3292
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3293
3293
|
/* @__PURE__ */ jsxs(
|
|
@@ -3329,7 +3329,7 @@ var Checkbox;
|
|
|
3329
3329
|
var init_Checkbox = __esm({
|
|
3330
3330
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3331
3331
|
init_cn();
|
|
3332
|
-
Checkbox =
|
|
3332
|
+
Checkbox = React86__default.forwardRef(
|
|
3333
3333
|
({ className, label, id, ...props }, ref) => {
|
|
3334
3334
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3335
3335
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3420,7 +3420,7 @@ var init_Card = __esm({
|
|
|
3420
3420
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3421
3421
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3422
3422
|
};
|
|
3423
|
-
Card =
|
|
3423
|
+
Card = React86__default.forwardRef(
|
|
3424
3424
|
({
|
|
3425
3425
|
className,
|
|
3426
3426
|
variant = "bordered",
|
|
@@ -3458,9 +3458,9 @@ var init_Card = __esm({
|
|
|
3458
3458
|
}
|
|
3459
3459
|
);
|
|
3460
3460
|
Card.displayName = "Card";
|
|
3461
|
-
CardHeader =
|
|
3461
|
+
CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3462
3462
|
CardHeader.displayName = "CardHeader";
|
|
3463
|
-
CardTitle =
|
|
3463
|
+
CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3464
3464
|
"h3",
|
|
3465
3465
|
{
|
|
3466
3466
|
ref,
|
|
@@ -3473,11 +3473,11 @@ var init_Card = __esm({
|
|
|
3473
3473
|
}
|
|
3474
3474
|
));
|
|
3475
3475
|
CardTitle.displayName = "CardTitle";
|
|
3476
|
-
CardContent =
|
|
3476
|
+
CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3477
3477
|
CardContent.displayName = "CardContent";
|
|
3478
3478
|
CardBody = CardContent;
|
|
3479
3479
|
CardBody.displayName = "CardBody";
|
|
3480
|
-
CardFooter =
|
|
3480
|
+
CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3481
3481
|
"div",
|
|
3482
3482
|
{
|
|
3483
3483
|
ref,
|
|
@@ -3532,7 +3532,7 @@ var init_FilterPill = __esm({
|
|
|
3532
3532
|
md: "w-3.5 h-3.5",
|
|
3533
3533
|
lg: "w-4 h-4"
|
|
3534
3534
|
};
|
|
3535
|
-
FilterPill =
|
|
3535
|
+
FilterPill = React86__default.forwardRef(
|
|
3536
3536
|
({
|
|
3537
3537
|
className,
|
|
3538
3538
|
variant = "default",
|
|
@@ -3609,7 +3609,7 @@ var init_Spinner = __esm({
|
|
|
3609
3609
|
md: "h-6 w-6",
|
|
3610
3610
|
lg: "h-8 w-8"
|
|
3611
3611
|
};
|
|
3612
|
-
Spinner =
|
|
3612
|
+
Spinner = React86__default.forwardRef(
|
|
3613
3613
|
({ className, size = "md", ...props }, ref) => {
|
|
3614
3614
|
return /* @__PURE__ */ jsx(
|
|
3615
3615
|
"div",
|
|
@@ -3688,11 +3688,15 @@ var init_Avatar = __esm({
|
|
|
3688
3688
|
actionPayload
|
|
3689
3689
|
}) => {
|
|
3690
3690
|
const eventBus = useEventBus();
|
|
3691
|
+
const [imgFailed, setImgFailed] = React86__default.useState(false);
|
|
3692
|
+
React86__default.useEffect(() => {
|
|
3693
|
+
setImgFailed(false);
|
|
3694
|
+
}, [src]);
|
|
3691
3695
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
3692
3696
|
const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
|
|
3693
|
-
const hasImage = !!src;
|
|
3694
|
-
const hasInitials = !!initials;
|
|
3697
|
+
const hasImage = !!src && !imgFailed;
|
|
3695
3698
|
const hasIcon = !!IconComponent;
|
|
3699
|
+
const hasInitials = !!initials && !(hasIcon && !providedInitials);
|
|
3696
3700
|
const getInitialsBackground = () => "bg-primary text-primary-foreground";
|
|
3697
3701
|
const isClickable = action || onClick;
|
|
3698
3702
|
const handleClick = () => {
|
|
@@ -3722,9 +3726,8 @@ var init_Avatar = __esm({
|
|
|
3722
3726
|
src,
|
|
3723
3727
|
alt: alt || "Avatar",
|
|
3724
3728
|
className: "w-full h-full object-cover",
|
|
3725
|
-
onError: (
|
|
3726
|
-
|
|
3727
|
-
target.style.display = "none";
|
|
3729
|
+
onError: () => {
|
|
3730
|
+
setImgFailed(true);
|
|
3728
3731
|
}
|
|
3729
3732
|
}
|
|
3730
3733
|
) : hasInitials ? /* @__PURE__ */ jsx(
|
|
@@ -4071,7 +4074,7 @@ var init_Radio = __esm({
|
|
|
4071
4074
|
md: "w-2.5 h-2.5",
|
|
4072
4075
|
lg: "w-3 h-3"
|
|
4073
4076
|
};
|
|
4074
|
-
Radio =
|
|
4077
|
+
Radio = React86__default.forwardRef(
|
|
4075
4078
|
({
|
|
4076
4079
|
label,
|
|
4077
4080
|
helperText,
|
|
@@ -4088,12 +4091,12 @@ var init_Radio = __esm({
|
|
|
4088
4091
|
onChange,
|
|
4089
4092
|
...props
|
|
4090
4093
|
}, ref) => {
|
|
4091
|
-
const reactId =
|
|
4094
|
+
const reactId = React86__default.useId();
|
|
4092
4095
|
const baseId = id || `radio-${reactId}`;
|
|
4093
4096
|
const hasError = !!error;
|
|
4094
4097
|
const eventBus = useEventBus();
|
|
4095
|
-
const [selected, setSelected] =
|
|
4096
|
-
|
|
4098
|
+
const [selected, setSelected] = React86__default.useState(value);
|
|
4099
|
+
React86__default.useEffect(() => {
|
|
4097
4100
|
if (value !== void 0) setSelected(value);
|
|
4098
4101
|
}, [value]);
|
|
4099
4102
|
const pick = (next, e) => {
|
|
@@ -4275,7 +4278,7 @@ var init_Switch = __esm({
|
|
|
4275
4278
|
"components/core/atoms/Switch.tsx"() {
|
|
4276
4279
|
"use client";
|
|
4277
4280
|
init_cn();
|
|
4278
|
-
Switch =
|
|
4281
|
+
Switch = React86.forwardRef(
|
|
4279
4282
|
({
|
|
4280
4283
|
checked,
|
|
4281
4284
|
defaultChecked = false,
|
|
@@ -4286,10 +4289,10 @@ var init_Switch = __esm({
|
|
|
4286
4289
|
name,
|
|
4287
4290
|
className
|
|
4288
4291
|
}, ref) => {
|
|
4289
|
-
const [isChecked, setIsChecked] =
|
|
4292
|
+
const [isChecked, setIsChecked] = React86.useState(
|
|
4290
4293
|
checked !== void 0 ? checked : defaultChecked
|
|
4291
4294
|
);
|
|
4292
|
-
|
|
4295
|
+
React86.useEffect(() => {
|
|
4293
4296
|
if (checked !== void 0) {
|
|
4294
4297
|
setIsChecked(checked);
|
|
4295
4298
|
}
|
|
@@ -4820,7 +4823,7 @@ var Aside;
|
|
|
4820
4823
|
var init_Aside = __esm({
|
|
4821
4824
|
"components/core/atoms/Aside.tsx"() {
|
|
4822
4825
|
init_cn();
|
|
4823
|
-
Aside =
|
|
4826
|
+
Aside = React86__default.forwardRef(
|
|
4824
4827
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4825
4828
|
);
|
|
4826
4829
|
Aside.displayName = "Aside";
|
|
@@ -4898,8 +4901,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4898
4901
|
className
|
|
4899
4902
|
}) => {
|
|
4900
4903
|
const { t } = useTranslate();
|
|
4901
|
-
const [isVisible, setIsVisible] =
|
|
4902
|
-
const timeoutRef =
|
|
4904
|
+
const [isVisible, setIsVisible] = React86__default.useState(false);
|
|
4905
|
+
const timeoutRef = React86__default.useRef(null);
|
|
4903
4906
|
const handleMouseEnter = () => {
|
|
4904
4907
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4905
4908
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4908,7 +4911,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4908
4911
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4909
4912
|
setIsVisible(false);
|
|
4910
4913
|
};
|
|
4911
|
-
|
|
4914
|
+
React86__default.useEffect(() => {
|
|
4912
4915
|
return () => {
|
|
4913
4916
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4914
4917
|
};
|
|
@@ -5118,7 +5121,7 @@ var init_StatusDot = __esm({
|
|
|
5118
5121
|
md: "w-2.5 h-2.5",
|
|
5119
5122
|
lg: "w-3 h-3"
|
|
5120
5123
|
};
|
|
5121
|
-
StatusDot =
|
|
5124
|
+
StatusDot = React86__default.forwardRef(
|
|
5122
5125
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5123
5126
|
return /* @__PURE__ */ jsx(
|
|
5124
5127
|
"span",
|
|
@@ -5172,7 +5175,7 @@ var init_TrendIndicator = __esm({
|
|
|
5172
5175
|
down: "trending-down",
|
|
5173
5176
|
flat: "arrow-right"
|
|
5174
5177
|
};
|
|
5175
|
-
TrendIndicator =
|
|
5178
|
+
TrendIndicator = React86__default.forwardRef(
|
|
5176
5179
|
({
|
|
5177
5180
|
className,
|
|
5178
5181
|
value,
|
|
@@ -5239,7 +5242,7 @@ var init_RangeSlider = __esm({
|
|
|
5239
5242
|
md: "w-4 h-4",
|
|
5240
5243
|
lg: "w-5 h-5"
|
|
5241
5244
|
};
|
|
5242
|
-
RangeSlider =
|
|
5245
|
+
RangeSlider = React86__default.forwardRef(
|
|
5243
5246
|
({
|
|
5244
5247
|
className,
|
|
5245
5248
|
min = 0,
|
|
@@ -5747,7 +5750,7 @@ var init_ContentSection = __esm({
|
|
|
5747
5750
|
md: "py-16",
|
|
5748
5751
|
lg: "py-24"
|
|
5749
5752
|
};
|
|
5750
|
-
ContentSection =
|
|
5753
|
+
ContentSection = React86__default.forwardRef(
|
|
5751
5754
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5752
5755
|
return /* @__PURE__ */ jsx(
|
|
5753
5756
|
Box,
|
|
@@ -6281,7 +6284,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6281
6284
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6282
6285
|
"none": {}
|
|
6283
6286
|
};
|
|
6284
|
-
AnimatedReveal =
|
|
6287
|
+
AnimatedReveal = React86__default.forwardRef(
|
|
6285
6288
|
({
|
|
6286
6289
|
trigger = "scroll",
|
|
6287
6290
|
animation = "fade-up",
|
|
@@ -6441,7 +6444,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6441
6444
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6442
6445
|
"use client";
|
|
6443
6446
|
init_cn();
|
|
6444
|
-
AnimatedGraphic =
|
|
6447
|
+
AnimatedGraphic = React86__default.forwardRef(
|
|
6445
6448
|
({
|
|
6446
6449
|
src,
|
|
6447
6450
|
svgContent,
|
|
@@ -6464,7 +6467,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6464
6467
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6465
6468
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6466
6469
|
const prevAnimateRef = useRef(animate);
|
|
6467
|
-
const setRef =
|
|
6470
|
+
const setRef = React86__default.useCallback(
|
|
6468
6471
|
(node) => {
|
|
6469
6472
|
containerRef.current = node;
|
|
6470
6473
|
if (typeof ref === "function") ref(node);
|
|
@@ -6689,9 +6692,9 @@ function ScoreDisplay({
|
|
|
6689
6692
|
...rest
|
|
6690
6693
|
}) {
|
|
6691
6694
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
6692
|
-
const [displayValue, setDisplayValue] =
|
|
6693
|
-
const [isAnimating, setIsAnimating] =
|
|
6694
|
-
|
|
6695
|
+
const [displayValue, setDisplayValue] = React86.useState(resolvedValue);
|
|
6696
|
+
const [isAnimating, setIsAnimating] = React86.useState(false);
|
|
6697
|
+
React86.useEffect(() => {
|
|
6695
6698
|
if (!animated || displayValue === resolvedValue) {
|
|
6696
6699
|
setDisplayValue(resolvedValue);
|
|
6697
6700
|
return;
|
|
@@ -6761,9 +6764,9 @@ function ControlButton({
|
|
|
6761
6764
|
className
|
|
6762
6765
|
}) {
|
|
6763
6766
|
const eventBus = useEventBus();
|
|
6764
|
-
const [isPressed, setIsPressed] =
|
|
6767
|
+
const [isPressed, setIsPressed] = React86.useState(false);
|
|
6765
6768
|
const actualPressed = pressed ?? isPressed;
|
|
6766
|
-
const handlePointerDown =
|
|
6769
|
+
const handlePointerDown = React86.useCallback(
|
|
6767
6770
|
(e) => {
|
|
6768
6771
|
e.preventDefault();
|
|
6769
6772
|
if (disabled) return;
|
|
@@ -6773,7 +6776,7 @@ function ControlButton({
|
|
|
6773
6776
|
},
|
|
6774
6777
|
[disabled, pressEvent, eventBus, onPress]
|
|
6775
6778
|
);
|
|
6776
|
-
const handlePointerUp =
|
|
6779
|
+
const handlePointerUp = React86.useCallback(
|
|
6777
6780
|
(e) => {
|
|
6778
6781
|
e.preventDefault();
|
|
6779
6782
|
if (disabled) return;
|
|
@@ -6783,7 +6786,7 @@ function ControlButton({
|
|
|
6783
6786
|
},
|
|
6784
6787
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
6785
6788
|
);
|
|
6786
|
-
const handlePointerLeave =
|
|
6789
|
+
const handlePointerLeave = React86.useCallback(
|
|
6787
6790
|
(e) => {
|
|
6788
6791
|
if (isPressed) {
|
|
6789
6792
|
setIsPressed(false);
|
|
@@ -7272,13 +7275,22 @@ function XPBar({
|
|
|
7272
7275
|
}) {
|
|
7273
7276
|
const sizes = sizeMap9[size];
|
|
7274
7277
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7278
|
+
const [fillWidth, setFillWidth] = React86.useState(animated ? 0 : percentage);
|
|
7279
|
+
React86.useEffect(() => {
|
|
7280
|
+
if (!animated) {
|
|
7281
|
+
setFillWidth(percentage);
|
|
7282
|
+
return;
|
|
7283
|
+
}
|
|
7284
|
+
const frame = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7285
|
+
return () => cancelAnimationFrame(frame);
|
|
7286
|
+
}, [animated, percentage]);
|
|
7275
7287
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7276
7288
|
level != null && /* @__PURE__ */ jsxs(
|
|
7277
7289
|
"span",
|
|
7278
7290
|
{
|
|
7279
7291
|
className: cn(
|
|
7280
7292
|
"flex-shrink-0 rounded-interactive font-bold",
|
|
7281
|
-
"bg-accent text-foreground border border-accent",
|
|
7293
|
+
"bg-accent text-accent-foreground border border-accent",
|
|
7282
7294
|
sizes.badge
|
|
7283
7295
|
),
|
|
7284
7296
|
children: [
|
|
@@ -7303,7 +7315,7 @@ function XPBar({
|
|
|
7303
7315
|
"bg-gradient-to-r from-accent to-info",
|
|
7304
7316
|
animated && "transition-all duration-500 ease-out"
|
|
7305
7317
|
),
|
|
7306
|
-
style: { width: `${
|
|
7318
|
+
style: { width: `${fillWidth}%` }
|
|
7307
7319
|
}
|
|
7308
7320
|
)
|
|
7309
7321
|
}
|
|
@@ -7320,6 +7332,7 @@ function XPBar({
|
|
|
7320
7332
|
var sizeMap9;
|
|
7321
7333
|
var init_XPBar = __esm({
|
|
7322
7334
|
"components/game/atoms/XPBar.tsx"() {
|
|
7335
|
+
"use client";
|
|
7323
7336
|
init_cn();
|
|
7324
7337
|
sizeMap9 = {
|
|
7325
7338
|
sm: { bar: "h-2", text: "text-xs", badge: "text-xs px-1.5 py-0.5" },
|
|
@@ -7689,9 +7702,9 @@ function MiniMap({
|
|
|
7689
7702
|
viewportRect,
|
|
7690
7703
|
className
|
|
7691
7704
|
}) {
|
|
7692
|
-
const canvasRef =
|
|
7693
|
-
const frameRef =
|
|
7694
|
-
|
|
7705
|
+
const canvasRef = React86.useRef(null);
|
|
7706
|
+
const frameRef = React86.useRef(0);
|
|
7707
|
+
React86.useEffect(() => {
|
|
7695
7708
|
const canvas = canvasRef.current;
|
|
7696
7709
|
if (!canvas) return;
|
|
7697
7710
|
const ctx = canvas.getContext("2d");
|
|
@@ -7865,7 +7878,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7865
7878
|
}
|
|
7866
7879
|
);
|
|
7867
7880
|
};
|
|
7868
|
-
ErrorBoundary = class extends
|
|
7881
|
+
ErrorBoundary = class extends React86__default.Component {
|
|
7869
7882
|
constructor(props) {
|
|
7870
7883
|
super(props);
|
|
7871
7884
|
__publicField(this, "reset", () => {
|
|
@@ -8865,18 +8878,42 @@ var init_Alert = __esm({
|
|
|
8865
8878
|
Alert.displayName = "Alert";
|
|
8866
8879
|
}
|
|
8867
8880
|
});
|
|
8868
|
-
|
|
8881
|
+
function computeTooltipStyle(position, triggerRect) {
|
|
8882
|
+
switch (position) {
|
|
8883
|
+
case "bottom":
|
|
8884
|
+
return {
|
|
8885
|
+
left: triggerRect.left + triggerRect.width / 2,
|
|
8886
|
+
top: triggerRect.bottom + TRIGGER_GAP,
|
|
8887
|
+
transform: "translateX(-50%)"
|
|
8888
|
+
};
|
|
8889
|
+
case "left":
|
|
8890
|
+
return {
|
|
8891
|
+
left: triggerRect.left - TRIGGER_GAP,
|
|
8892
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
8893
|
+
transform: "translate(-100%, -50%)"
|
|
8894
|
+
};
|
|
8895
|
+
case "right":
|
|
8896
|
+
return {
|
|
8897
|
+
left: triggerRect.right + TRIGGER_GAP,
|
|
8898
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
8899
|
+
transform: "translateY(-50%)"
|
|
8900
|
+
};
|
|
8901
|
+
case "top":
|
|
8902
|
+
default:
|
|
8903
|
+
return {
|
|
8904
|
+
left: triggerRect.left + triggerRect.width / 2,
|
|
8905
|
+
top: triggerRect.top - TRIGGER_GAP,
|
|
8906
|
+
transform: "translate(-50%, -100%)"
|
|
8907
|
+
};
|
|
8908
|
+
}
|
|
8909
|
+
}
|
|
8910
|
+
var TRIGGER_GAP, arrowClasses, Tooltip;
|
|
8869
8911
|
var init_Tooltip = __esm({
|
|
8870
8912
|
"components/core/molecules/Tooltip.tsx"() {
|
|
8871
8913
|
"use client";
|
|
8872
8914
|
init_Typography();
|
|
8873
8915
|
init_cn();
|
|
8874
|
-
|
|
8875
|
-
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
8876
|
-
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
8877
|
-
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
8878
|
-
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
8879
|
-
};
|
|
8916
|
+
TRIGGER_GAP = 8;
|
|
8880
8917
|
arrowClasses = {
|
|
8881
8918
|
top: "top-full left-1/2 -translate-x-1/2 border-t-primary border-l-transparent border-r-transparent border-b-transparent",
|
|
8882
8919
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-primary border-l-transparent border-r-transparent border-t-transparent",
|
|
@@ -8931,8 +8968,8 @@ var init_Tooltip = __esm({
|
|
|
8931
8968
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
8932
8969
|
};
|
|
8933
8970
|
}, []);
|
|
8934
|
-
const triggerElement =
|
|
8935
|
-
const trigger =
|
|
8971
|
+
const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
8972
|
+
const trigger = React86__default.cloneElement(triggerElement, {
|
|
8936
8973
|
ref: triggerRef,
|
|
8937
8974
|
onMouseEnter: handleMouseEnter,
|
|
8938
8975
|
onMouseLeave: handleMouseLeave,
|
|
@@ -8950,14 +8987,9 @@ var init_Tooltip = __esm({
|
|
|
8950
8987
|
"text-sm pointer-events-none",
|
|
8951
8988
|
"break-words whitespace-normal",
|
|
8952
8989
|
"h-auto min-h-fit",
|
|
8953
|
-
positionClasses[position],
|
|
8954
8990
|
className
|
|
8955
8991
|
),
|
|
8956
|
-
style:
|
|
8957
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
8958
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2,
|
|
8959
|
-
transform: position === "top" || position === "bottom" ? "translateX(-50%)" : position === "left" || position === "right" ? "translateY(-50%)" : "none"
|
|
8960
|
-
},
|
|
8992
|
+
style: computeTooltipStyle(position, triggerRect),
|
|
8961
8993
|
role: "tooltip",
|
|
8962
8994
|
children: [
|
|
8963
8995
|
/* @__PURE__ */ jsx("div", { className: "w-full break-words whitespace-normal h-auto", children: typeof content === "string" ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-primary-foreground break-words whitespace-normal", children: content }) : /* @__PURE__ */ jsx("div", { className: "break-words whitespace-normal", children: content }) }),
|
|
@@ -8984,8 +9016,9 @@ var init_Tooltip = __esm({
|
|
|
8984
9016
|
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
8985
9017
|
if (position === "left" || position === "right") {
|
|
8986
9018
|
return {
|
|
8987
|
-
left:
|
|
8988
|
-
top: triggerRect.top + triggerRect.height / 2
|
|
9019
|
+
left: position === "left" ? triggerRect.left - popoverWidth - TRIGGER_GAP2 : triggerRect.right + TRIGGER_GAP2,
|
|
9020
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
9021
|
+
transform: "translateY(-50%)"
|
|
8989
9022
|
};
|
|
8990
9023
|
}
|
|
8991
9024
|
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
@@ -8997,21 +9030,16 @@ function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
|
8997
9030
|
);
|
|
8998
9031
|
return {
|
|
8999
9032
|
left: clamped,
|
|
9000
|
-
top:
|
|
9033
|
+
top: position === "top" ? triggerRect.top - TRIGGER_GAP2 : triggerRect.bottom + TRIGGER_GAP2,
|
|
9034
|
+
transform: position === "top" ? "translateY(-100%)" : void 0
|
|
9001
9035
|
};
|
|
9002
9036
|
}
|
|
9003
|
-
var
|
|
9037
|
+
var arrowClasses2, VIEWPORT_EDGE_PADDING, TRIGGER_GAP2, Popover;
|
|
9004
9038
|
var init_Popover = __esm({
|
|
9005
9039
|
"components/core/molecules/Popover.tsx"() {
|
|
9006
9040
|
"use client";
|
|
9007
9041
|
init_Typography();
|
|
9008
9042
|
init_cn();
|
|
9009
|
-
positionClasses2 = {
|
|
9010
|
-
top: "mb-2",
|
|
9011
|
-
bottom: "mt-2",
|
|
9012
|
-
left: "mr-2 -translate-y-1/2",
|
|
9013
|
-
right: "ml-2 -translate-y-1/2"
|
|
9014
|
-
};
|
|
9015
9043
|
arrowClasses2 = {
|
|
9016
9044
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
9017
9045
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-white border-l-transparent border-r-transparent border-t-transparent",
|
|
@@ -9019,6 +9047,7 @@ var init_Popover = __esm({
|
|
|
9019
9047
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
9020
9048
|
};
|
|
9021
9049
|
VIEWPORT_EDGE_PADDING = 8;
|
|
9050
|
+
TRIGGER_GAP2 = 8;
|
|
9022
9051
|
Popover = ({
|
|
9023
9052
|
content,
|
|
9024
9053
|
children,
|
|
@@ -9087,8 +9116,8 @@ var init_Popover = __esm({
|
|
|
9087
9116
|
onMouseEnter: handleOpen,
|
|
9088
9117
|
onMouseLeave: handleClose
|
|
9089
9118
|
};
|
|
9090
|
-
const childElement =
|
|
9091
|
-
const triggerElement =
|
|
9119
|
+
const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9120
|
+
const triggerElement = React86__default.cloneElement(
|
|
9092
9121
|
childElement,
|
|
9093
9122
|
{
|
|
9094
9123
|
ref: triggerRef,
|
|
@@ -9102,7 +9131,6 @@ var init_Popover = __esm({
|
|
|
9102
9131
|
className: cn(
|
|
9103
9132
|
"fixed z-50 p-4",
|
|
9104
9133
|
"bg-card border-2 border-border shadow-elevation-popover",
|
|
9105
|
-
positionClasses2[position],
|
|
9106
9134
|
className
|
|
9107
9135
|
),
|
|
9108
9136
|
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
@@ -9192,7 +9220,7 @@ var init_Menu = __esm({
|
|
|
9192
9220
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9193
9221
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9194
9222
|
}, [isOpen]);
|
|
9195
|
-
const
|
|
9223
|
+
const positionClasses = {
|
|
9196
9224
|
"top-left": "bottom-full left-0 mb-2",
|
|
9197
9225
|
"top-right": "bottom-full right-0 mb-2",
|
|
9198
9226
|
"bottom-left": "top-full left-0 mt-2",
|
|
@@ -9215,8 +9243,8 @@ var init_Menu = __esm({
|
|
|
9215
9243
|
};
|
|
9216
9244
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9217
9245
|
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9218
|
-
const triggerChild =
|
|
9219
|
-
const triggerElement =
|
|
9246
|
+
const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9247
|
+
const triggerElement = React86__default.cloneElement(
|
|
9220
9248
|
triggerChild,
|
|
9221
9249
|
{
|
|
9222
9250
|
ref: triggerRef,
|
|
@@ -9300,7 +9328,7 @@ var init_Menu = __esm({
|
|
|
9300
9328
|
className: cn(
|
|
9301
9329
|
"absolute z-50",
|
|
9302
9330
|
menuContainerStyles,
|
|
9303
|
-
|
|
9331
|
+
positionClasses[effectivePosition],
|
|
9304
9332
|
className
|
|
9305
9333
|
),
|
|
9306
9334
|
style: {
|
|
@@ -9476,7 +9504,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9476
9504
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9477
9505
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9478
9506
|
}, [isExpanded, actions]);
|
|
9479
|
-
const
|
|
9507
|
+
const positionClasses = {
|
|
9480
9508
|
"bottom-right": "bottom-6 right-6",
|
|
9481
9509
|
"bottom-left": "bottom-6 left-6",
|
|
9482
9510
|
"bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
|
|
@@ -9485,7 +9513,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9485
9513
|
"top-center": "top-6 left-1/2 -translate-x-1/2"
|
|
9486
9514
|
};
|
|
9487
9515
|
if (resolvedAction && (!actions || actions.length === 0)) {
|
|
9488
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50",
|
|
9516
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position], className), children: /* @__PURE__ */ jsx(
|
|
9489
9517
|
Button,
|
|
9490
9518
|
{
|
|
9491
9519
|
variant: resolvedAction.variant || "primary",
|
|
@@ -9513,7 +9541,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9513
9541
|
ref: fabRef,
|
|
9514
9542
|
className: cn(
|
|
9515
9543
|
"fixed z-50 flex flex-col items-end gap-3",
|
|
9516
|
-
|
|
9544
|
+
positionClasses[position],
|
|
9517
9545
|
position.includes("left") && "items-start",
|
|
9518
9546
|
className
|
|
9519
9547
|
),
|
|
@@ -9623,13 +9651,13 @@ var init_MapView = __esm({
|
|
|
9623
9651
|
shadowSize: [41, 41]
|
|
9624
9652
|
});
|
|
9625
9653
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
9626
|
-
const { useEffect:
|
|
9654
|
+
const { useEffect: useEffect72, useRef: useRef66, useCallback: useCallback114, useState: useState104 } = React86__default;
|
|
9627
9655
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
9628
9656
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
9629
9657
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
9630
9658
|
const map = useMap();
|
|
9631
9659
|
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
9632
|
-
|
|
9660
|
+
useEffect72(() => {
|
|
9633
9661
|
const prev = prevRef.current;
|
|
9634
9662
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
9635
9663
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -9640,7 +9668,7 @@ var init_MapView = __esm({
|
|
|
9640
9668
|
}
|
|
9641
9669
|
function MapClickHandler({ onMapClick }) {
|
|
9642
9670
|
const map = useMap();
|
|
9643
|
-
|
|
9671
|
+
useEffect72(() => {
|
|
9644
9672
|
if (!onMapClick) return;
|
|
9645
9673
|
const handler = (e) => {
|
|
9646
9674
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -9668,7 +9696,7 @@ var init_MapView = __esm({
|
|
|
9668
9696
|
showAttribution = true
|
|
9669
9697
|
}) {
|
|
9670
9698
|
const eventBus = useEventBus3();
|
|
9671
|
-
const [clickedPosition, setClickedPosition] =
|
|
9699
|
+
const [clickedPosition, setClickedPosition] = useState104(null);
|
|
9672
9700
|
const handleMapClick = useCallback114((lat, lng) => {
|
|
9673
9701
|
if (showClickedPin) {
|
|
9674
9702
|
setClickedPosition({ lat, lng });
|
|
@@ -9687,7 +9715,7 @@ var init_MapView = __esm({
|
|
|
9687
9715
|
return /* @__PURE__ */ jsx(
|
|
9688
9716
|
Box,
|
|
9689
9717
|
{
|
|
9690
|
-
className: cn("relative w-full overflow-hidden rounded-lg", className),
|
|
9718
|
+
className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
|
|
9691
9719
|
style: { height },
|
|
9692
9720
|
"data-testid": "map-view",
|
|
9693
9721
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -9869,7 +9897,7 @@ function InputPattern({
|
|
|
9869
9897
|
fieldName
|
|
9870
9898
|
}) {
|
|
9871
9899
|
const { emit } = useEventBus();
|
|
9872
|
-
const [localValue, setLocalValue] =
|
|
9900
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
9873
9901
|
const handleChange = (e) => {
|
|
9874
9902
|
setLocalValue(e.target.value);
|
|
9875
9903
|
if (onChange) {
|
|
@@ -9907,7 +9935,7 @@ function TextareaPattern({
|
|
|
9907
9935
|
fieldName
|
|
9908
9936
|
}) {
|
|
9909
9937
|
const { emit } = useEventBus();
|
|
9910
|
-
const [localValue, setLocalValue] =
|
|
9938
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
9911
9939
|
const handleChange = (e) => {
|
|
9912
9940
|
setLocalValue(e.target.value);
|
|
9913
9941
|
if (onChange) {
|
|
@@ -9939,7 +9967,7 @@ function SelectPattern({
|
|
|
9939
9967
|
fieldName
|
|
9940
9968
|
}) {
|
|
9941
9969
|
const { emit } = useEventBus();
|
|
9942
|
-
const [localValue, setLocalValue] =
|
|
9970
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
9943
9971
|
const handleChange = (e) => {
|
|
9944
9972
|
setLocalValue(e.target.value);
|
|
9945
9973
|
if (onChange) {
|
|
@@ -9968,7 +9996,7 @@ function CheckboxPattern({
|
|
|
9968
9996
|
className
|
|
9969
9997
|
}) {
|
|
9970
9998
|
const { emit } = useEventBus();
|
|
9971
|
-
const [localChecked, setLocalChecked] =
|
|
9999
|
+
const [localChecked, setLocalChecked] = React86__default.useState(checked);
|
|
9972
10000
|
const handleChange = (e) => {
|
|
9973
10001
|
setLocalChecked(e.target.checked);
|
|
9974
10002
|
if (onChange) {
|
|
@@ -10199,8 +10227,8 @@ function ActionButtons({
|
|
|
10199
10227
|
disabled
|
|
10200
10228
|
}) {
|
|
10201
10229
|
const eventBus = useEventBus();
|
|
10202
|
-
const [activeButtons, setActiveButtons] =
|
|
10203
|
-
const handlePress =
|
|
10230
|
+
const [activeButtons, setActiveButtons] = React86.useState(/* @__PURE__ */ new Set());
|
|
10231
|
+
const handlePress = React86.useCallback(
|
|
10204
10232
|
(id) => {
|
|
10205
10233
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
10206
10234
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10208,7 +10236,7 @@ function ActionButtons({
|
|
|
10208
10236
|
},
|
|
10209
10237
|
[actionEvent, eventBus, onAction]
|
|
10210
10238
|
);
|
|
10211
|
-
const handleRelease =
|
|
10239
|
+
const handleRelease = React86.useCallback(
|
|
10212
10240
|
(id) => {
|
|
10213
10241
|
setActiveButtons((prev) => {
|
|
10214
10242
|
const next = new Set(prev);
|
|
@@ -13235,7 +13263,10 @@ function computeFoldRegions(code) {
|
|
|
13235
13263
|
}
|
|
13236
13264
|
return regions.sort((a, b) => a.start - b.start);
|
|
13237
13265
|
}
|
|
13238
|
-
|
|
13266
|
+
function toCodeLanguage(value) {
|
|
13267
|
+
return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
|
|
13268
|
+
}
|
|
13269
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13239
13270
|
var init_CodeBlock = __esm({
|
|
13240
13271
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13241
13272
|
init_Box();
|
|
@@ -13313,9 +13344,40 @@ var init_CodeBlock = __esm({
|
|
|
13313
13344
|
};
|
|
13314
13345
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
13315
13346
|
log7 = createLogger("almadar:ui:markdown-code");
|
|
13347
|
+
CODE_LANGUAGES = [
|
|
13348
|
+
"text",
|
|
13349
|
+
"json",
|
|
13350
|
+
"javascript",
|
|
13351
|
+
"js",
|
|
13352
|
+
"typescript",
|
|
13353
|
+
"ts",
|
|
13354
|
+
"jsx",
|
|
13355
|
+
"tsx",
|
|
13356
|
+
"css",
|
|
13357
|
+
"markdown",
|
|
13358
|
+
"md",
|
|
13359
|
+
"bash",
|
|
13360
|
+
"shell",
|
|
13361
|
+
"sh",
|
|
13362
|
+
"yaml",
|
|
13363
|
+
"yml",
|
|
13364
|
+
"rust",
|
|
13365
|
+
"python",
|
|
13366
|
+
"py",
|
|
13367
|
+
"sql",
|
|
13368
|
+
"diff",
|
|
13369
|
+
"toml",
|
|
13370
|
+
"go",
|
|
13371
|
+
"graphql",
|
|
13372
|
+
"html",
|
|
13373
|
+
"xml",
|
|
13374
|
+
"orb",
|
|
13375
|
+
"lolo"
|
|
13376
|
+
];
|
|
13377
|
+
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
13316
13378
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13317
13379
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13318
|
-
CodeBlock =
|
|
13380
|
+
CodeBlock = React86__default.memo(
|
|
13319
13381
|
({
|
|
13320
13382
|
code: rawCode,
|
|
13321
13383
|
language = "text",
|
|
@@ -13752,7 +13814,7 @@ var init_MarkdownContent = __esm({
|
|
|
13752
13814
|
init_Box();
|
|
13753
13815
|
init_CodeBlock();
|
|
13754
13816
|
init_cn();
|
|
13755
|
-
MarkdownContent =
|
|
13817
|
+
MarkdownContent = React86__default.memo(
|
|
13756
13818
|
({ content, direction, className }) => {
|
|
13757
13819
|
const { t: _t } = useTranslate();
|
|
13758
13820
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -13802,7 +13864,7 @@ var init_MarkdownContent = __esm({
|
|
|
13802
13864
|
CodeBlock,
|
|
13803
13865
|
{
|
|
13804
13866
|
code,
|
|
13805
|
-
language: match[1],
|
|
13867
|
+
language: toCodeLanguage(match[1]),
|
|
13806
13868
|
maxHeight: "60vh"
|
|
13807
13869
|
}
|
|
13808
13870
|
);
|
|
@@ -14848,7 +14910,7 @@ var init_StateMachineView = __esm({
|
|
|
14848
14910
|
style: { top: title ? 30 : 0 },
|
|
14849
14911
|
children: [
|
|
14850
14912
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
14851
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
14913
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
14852
14914
|
StateNode,
|
|
14853
14915
|
{
|
|
14854
14916
|
state,
|
|
@@ -15661,7 +15723,7 @@ var init_ContentRenderer = __esm({
|
|
|
15661
15723
|
CodeBlock,
|
|
15662
15724
|
{
|
|
15663
15725
|
code: segment.content,
|
|
15664
|
-
language: segment.language
|
|
15726
|
+
language: toCodeLanguage(segment.language)
|
|
15665
15727
|
},
|
|
15666
15728
|
key
|
|
15667
15729
|
);
|
|
@@ -15686,7 +15748,7 @@ var init_ContentRenderer = __esm({
|
|
|
15686
15748
|
CodeBlock,
|
|
15687
15749
|
{
|
|
15688
15750
|
code: segment.content,
|
|
15689
|
-
language: segment.language
|
|
15751
|
+
language: toCodeLanguage(segment.language)
|
|
15690
15752
|
}
|
|
15691
15753
|
),
|
|
15692
15754
|
/* @__PURE__ */ jsx(ScaledDiagram, { children: /* @__PURE__ */ jsx(
|
|
@@ -16453,7 +16515,7 @@ var init_Grid = __esm({
|
|
|
16453
16515
|
as: Component = "div"
|
|
16454
16516
|
}) => {
|
|
16455
16517
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
16456
|
-
return
|
|
16518
|
+
return React86__default.createElement(
|
|
16457
16519
|
Component,
|
|
16458
16520
|
{
|
|
16459
16521
|
className: cn(
|
|
@@ -21813,7 +21875,7 @@ function CraftingRecipe({
|
|
|
21813
21875
|
className
|
|
21814
21876
|
}) {
|
|
21815
21877
|
const eventBus = useEventBus();
|
|
21816
|
-
const handleCraft =
|
|
21878
|
+
const handleCraft = React86.useCallback(() => {
|
|
21817
21879
|
onCraft?.();
|
|
21818
21880
|
if (craftEvent) {
|
|
21819
21881
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -21830,7 +21892,7 @@ function CraftingRecipe({
|
|
|
21830
21892
|
children: [
|
|
21831
21893
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
21832
21894
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
21833
|
-
return /* @__PURE__ */ jsxs(
|
|
21895
|
+
return /* @__PURE__ */ jsxs(React86.Fragment, { children: [
|
|
21834
21896
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
21835
21897
|
ItemSlot,
|
|
21836
21898
|
{
|
|
@@ -21893,8 +21955,8 @@ function DPad({
|
|
|
21893
21955
|
}) {
|
|
21894
21956
|
const eventBus = useEventBus();
|
|
21895
21957
|
const sizes = sizeMap15[size];
|
|
21896
|
-
const [activeDirections, setActiveDirections] =
|
|
21897
|
-
const handlePress =
|
|
21958
|
+
const [activeDirections, setActiveDirections] = React86.useState(/* @__PURE__ */ new Set());
|
|
21959
|
+
const handlePress = React86.useCallback(
|
|
21898
21960
|
(direction) => {
|
|
21899
21961
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
21900
21962
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -21902,7 +21964,7 @@ function DPad({
|
|
|
21902
21964
|
},
|
|
21903
21965
|
[directionEvent, eventBus, onDirection]
|
|
21904
21966
|
);
|
|
21905
|
-
const handleRelease =
|
|
21967
|
+
const handleRelease = React86.useCallback(
|
|
21906
21968
|
(direction) => {
|
|
21907
21969
|
setActiveDirections((prev) => {
|
|
21908
21970
|
const next = new Set(prev);
|
|
@@ -22588,14 +22650,14 @@ function useDataDnd(args) {
|
|
|
22588
22650
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22589
22651
|
const enabled = isZone || Boolean(dndRoot);
|
|
22590
22652
|
const eventBus = useEventBus();
|
|
22591
|
-
const parentRoot =
|
|
22653
|
+
const parentRoot = React86__default.useContext(RootCtx);
|
|
22592
22654
|
const isRoot = enabled && parentRoot === null;
|
|
22593
|
-
const zoneId =
|
|
22655
|
+
const zoneId = React86__default.useId();
|
|
22594
22656
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22595
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22596
|
-
const optimisticOrdersRef =
|
|
22657
|
+
const [optimisticOrders, setOptimisticOrders] = React86__default.useState(() => /* @__PURE__ */ new Map());
|
|
22658
|
+
const optimisticOrdersRef = React86__default.useRef(optimisticOrders);
|
|
22597
22659
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22598
|
-
const clearOptimisticOrder =
|
|
22660
|
+
const clearOptimisticOrder = React86__default.useCallback((group) => {
|
|
22599
22661
|
setOptimisticOrders((prev) => {
|
|
22600
22662
|
if (!prev.has(group)) return prev;
|
|
22601
22663
|
const next = new Map(prev);
|
|
@@ -22620,7 +22682,7 @@ function useDataDnd(args) {
|
|
|
22620
22682
|
const raw = it[dndItemIdField];
|
|
22621
22683
|
return String(raw ?? `__idx_${idx}`);
|
|
22622
22684
|
}).join("|");
|
|
22623
|
-
const itemIds =
|
|
22685
|
+
const itemIds = React86__default.useMemo(
|
|
22624
22686
|
() => orderedItems.map((it, idx) => {
|
|
22625
22687
|
const raw = it[dndItemIdField];
|
|
22626
22688
|
return raw ?? `__idx_${idx}`;
|
|
@@ -22628,7 +22690,7 @@ function useDataDnd(args) {
|
|
|
22628
22690
|
[itemIdsSignature]
|
|
22629
22691
|
);
|
|
22630
22692
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
22631
|
-
|
|
22693
|
+
React86__default.useEffect(() => {
|
|
22632
22694
|
const root = isRoot ? null : parentRoot;
|
|
22633
22695
|
if (root) {
|
|
22634
22696
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22636,20 +22698,20 @@ function useDataDnd(args) {
|
|
|
22636
22698
|
clearOptimisticOrder(ownGroup);
|
|
22637
22699
|
}
|
|
22638
22700
|
}, [itemsContentSig, ownGroup]);
|
|
22639
|
-
const zonesRef =
|
|
22640
|
-
const registerZone =
|
|
22701
|
+
const zonesRef = React86__default.useRef(/* @__PURE__ */ new Map());
|
|
22702
|
+
const registerZone = React86__default.useCallback((zoneId2, meta2) => {
|
|
22641
22703
|
zonesRef.current.set(zoneId2, meta2);
|
|
22642
22704
|
}, []);
|
|
22643
|
-
const unregisterZone =
|
|
22705
|
+
const unregisterZone = React86__default.useCallback((zoneId2) => {
|
|
22644
22706
|
zonesRef.current.delete(zoneId2);
|
|
22645
22707
|
}, []);
|
|
22646
|
-
const [activeDrag, setActiveDrag] =
|
|
22647
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22648
|
-
const meta =
|
|
22708
|
+
const [activeDrag, setActiveDrag] = React86__default.useState(null);
|
|
22709
|
+
const [overZoneGroup, setOverZoneGroup] = React86__default.useState(null);
|
|
22710
|
+
const meta = React86__default.useMemo(
|
|
22649
22711
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22650
22712
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22651
22713
|
);
|
|
22652
|
-
|
|
22714
|
+
React86__default.useEffect(() => {
|
|
22653
22715
|
const target = isRoot ? null : parentRoot;
|
|
22654
22716
|
if (!target) {
|
|
22655
22717
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22668,7 +22730,7 @@ function useDataDnd(args) {
|
|
|
22668
22730
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22669
22731
|
const sensors = useAlmadarDndSensors(true);
|
|
22670
22732
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22671
|
-
const findZoneByItem =
|
|
22733
|
+
const findZoneByItem = React86__default.useCallback(
|
|
22672
22734
|
(id) => {
|
|
22673
22735
|
for (const z of zonesRef.current.values()) {
|
|
22674
22736
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22677,7 +22739,7 @@ function useDataDnd(args) {
|
|
|
22677
22739
|
},
|
|
22678
22740
|
[]
|
|
22679
22741
|
);
|
|
22680
|
-
|
|
22742
|
+
React86__default.useCallback(
|
|
22681
22743
|
(group) => {
|
|
22682
22744
|
for (const z of zonesRef.current.values()) {
|
|
22683
22745
|
if (z.group === group) return z;
|
|
@@ -22686,7 +22748,7 @@ function useDataDnd(args) {
|
|
|
22686
22748
|
},
|
|
22687
22749
|
[]
|
|
22688
22750
|
);
|
|
22689
|
-
const handleDragEnd =
|
|
22751
|
+
const handleDragEnd = React86__default.useCallback(
|
|
22690
22752
|
(event) => {
|
|
22691
22753
|
const { active, over } = event;
|
|
22692
22754
|
const activeIdStr = String(active.id);
|
|
@@ -22777,8 +22839,8 @@ function useDataDnd(args) {
|
|
|
22777
22839
|
},
|
|
22778
22840
|
[eventBus]
|
|
22779
22841
|
);
|
|
22780
|
-
const sortableData =
|
|
22781
|
-
const SortableItem =
|
|
22842
|
+
const sortableData = React86__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22843
|
+
const SortableItem = React86__default.useCallback(
|
|
22782
22844
|
({ id, children }) => {
|
|
22783
22845
|
const {
|
|
22784
22846
|
attributes,
|
|
@@ -22818,7 +22880,7 @@ function useDataDnd(args) {
|
|
|
22818
22880
|
id: droppableId,
|
|
22819
22881
|
data: sortableData
|
|
22820
22882
|
});
|
|
22821
|
-
const ctx =
|
|
22883
|
+
const ctx = React86__default.useContext(RootCtx);
|
|
22822
22884
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22823
22885
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22824
22886
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22833,7 +22895,7 @@ function useDataDnd(args) {
|
|
|
22833
22895
|
showForeignPlaceholder,
|
|
22834
22896
|
ctxAvailable: ctx != null
|
|
22835
22897
|
});
|
|
22836
|
-
|
|
22898
|
+
React86__default.useEffect(() => {
|
|
22837
22899
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22838
22900
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22839
22901
|
return /* @__PURE__ */ jsx(
|
|
@@ -22847,11 +22909,11 @@ function useDataDnd(args) {
|
|
|
22847
22909
|
}
|
|
22848
22910
|
);
|
|
22849
22911
|
};
|
|
22850
|
-
const rootContextValue =
|
|
22912
|
+
const rootContextValue = React86__default.useMemo(
|
|
22851
22913
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22852
22914
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22853
22915
|
);
|
|
22854
|
-
const handleDragStart =
|
|
22916
|
+
const handleDragStart = React86__default.useCallback((event) => {
|
|
22855
22917
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22856
22918
|
const rect = event.active.rect.current.initial;
|
|
22857
22919
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22870,7 +22932,7 @@ function useDataDnd(args) {
|
|
|
22870
22932
|
isRoot
|
|
22871
22933
|
});
|
|
22872
22934
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22873
|
-
const handleDragOver =
|
|
22935
|
+
const handleDragOver = React86__default.useCallback((event) => {
|
|
22874
22936
|
const { active, over } = event;
|
|
22875
22937
|
const overData = over?.data?.current;
|
|
22876
22938
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -22940,7 +23002,7 @@ function useDataDnd(args) {
|
|
|
22940
23002
|
return next;
|
|
22941
23003
|
});
|
|
22942
23004
|
}, []);
|
|
22943
|
-
const handleDragCancel =
|
|
23005
|
+
const handleDragCancel = React86__default.useCallback((event) => {
|
|
22944
23006
|
setActiveDrag(null);
|
|
22945
23007
|
setOverZoneGroup(null);
|
|
22946
23008
|
dndLog.warn("dragCancel", {
|
|
@@ -22948,12 +23010,12 @@ function useDataDnd(args) {
|
|
|
22948
23010
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
22949
23011
|
});
|
|
22950
23012
|
}, []);
|
|
22951
|
-
const handleDragEndWithCleanup =
|
|
23013
|
+
const handleDragEndWithCleanup = React86__default.useCallback((event) => {
|
|
22952
23014
|
handleDragEnd(event);
|
|
22953
23015
|
setActiveDrag(null);
|
|
22954
23016
|
setOverZoneGroup(null);
|
|
22955
23017
|
}, [handleDragEnd]);
|
|
22956
|
-
const wrapContainer =
|
|
23018
|
+
const wrapContainer = React86__default.useCallback(
|
|
22957
23019
|
(children) => {
|
|
22958
23020
|
if (!enabled) return children;
|
|
22959
23021
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23007,7 +23069,7 @@ var init_useDataDnd = __esm({
|
|
|
23007
23069
|
init_useAlmadarDndCollision();
|
|
23008
23070
|
init_Box();
|
|
23009
23071
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23010
|
-
RootCtx =
|
|
23072
|
+
RootCtx = React86__default.createContext(null);
|
|
23011
23073
|
}
|
|
23012
23074
|
});
|
|
23013
23075
|
function fieldLabel2(key) {
|
|
@@ -23527,7 +23589,7 @@ function DataList({
|
|
|
23527
23589
|
}) {
|
|
23528
23590
|
const eventBus = useEventBus();
|
|
23529
23591
|
const { t } = useTranslate();
|
|
23530
|
-
const [visibleCount, setVisibleCount] =
|
|
23592
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
|
|
23531
23593
|
const fieldDefs = fields ?? columns ?? [];
|
|
23532
23594
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23533
23595
|
const dnd = useDataDnd({
|
|
@@ -23546,7 +23608,7 @@ function DataList({
|
|
|
23546
23608
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23547
23609
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23548
23610
|
const hasRenderProp = typeof children === "function";
|
|
23549
|
-
|
|
23611
|
+
React86__default.useEffect(() => {
|
|
23550
23612
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23551
23613
|
const childrenTypeOf = typeof children;
|
|
23552
23614
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23651,7 +23713,7 @@ function DataList({
|
|
|
23651
23713
|
const items2 = data.map((item) => item);
|
|
23652
23714
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
23653
23715
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
23654
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23716
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
23655
23717
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23656
23718
|
group.items.map((itemData, index) => {
|
|
23657
23719
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -23799,7 +23861,7 @@ function DataList({
|
|
|
23799
23861
|
className
|
|
23800
23862
|
),
|
|
23801
23863
|
children: [
|
|
23802
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23864
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
23803
23865
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23804
23866
|
group.items.map(
|
|
23805
23867
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -25173,7 +25235,7 @@ var init_WizardProgress = __esm({
|
|
|
25173
25235
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25174
25236
|
const isActive = index === currentStep;
|
|
25175
25237
|
const isCompleted = index < currentStep;
|
|
25176
|
-
return /* @__PURE__ */ jsxs(
|
|
25238
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
25177
25239
|
/* @__PURE__ */ jsx(
|
|
25178
25240
|
"button",
|
|
25179
25241
|
{
|
|
@@ -25690,7 +25752,7 @@ var init_FormSectionHeader = __esm({
|
|
|
25690
25752
|
Box,
|
|
25691
25753
|
{
|
|
25692
25754
|
className: cn(
|
|
25693
|
-
"px-4 py-3 bg-muted rounded-t-lg",
|
|
25755
|
+
"px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
|
|
25694
25756
|
isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
25695
25757
|
className
|
|
25696
25758
|
),
|
|
@@ -25702,7 +25764,7 @@ var init_FormSectionHeader = __esm({
|
|
|
25702
25764
|
{
|
|
25703
25765
|
name: icon,
|
|
25704
25766
|
size: "md",
|
|
25705
|
-
className: "text-
|
|
25767
|
+
className: "text-primary"
|
|
25706
25768
|
}
|
|
25707
25769
|
),
|
|
25708
25770
|
statusIcon && /* @__PURE__ */ jsx(
|
|
@@ -25713,8 +25775,8 @@ var init_FormSectionHeader = __esm({
|
|
|
25713
25775
|
className: hasErrors ? "text-error" : "text-success"
|
|
25714
25776
|
}
|
|
25715
25777
|
),
|
|
25716
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
25717
|
-
/* @__PURE__ */ jsx(Typography, { variant: "
|
|
25778
|
+
/* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
|
|
25779
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
|
|
25718
25780
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
|
|
25719
25781
|
] })
|
|
25720
25782
|
] }),
|
|
@@ -26228,7 +26290,7 @@ function InventoryGrid({
|
|
|
26228
26290
|
const eventBus = useEventBus();
|
|
26229
26291
|
const slotCount = totalSlots ?? items.length;
|
|
26230
26292
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
26231
|
-
const handleSelect =
|
|
26293
|
+
const handleSelect = React86.useCallback(
|
|
26232
26294
|
(id) => {
|
|
26233
26295
|
onSelect?.(id);
|
|
26234
26296
|
if (selectEvent) {
|
|
@@ -26445,31 +26507,31 @@ function GameCanvas2D({
|
|
|
26445
26507
|
assetBaseUrl = "",
|
|
26446
26508
|
className
|
|
26447
26509
|
}) {
|
|
26448
|
-
const canvasRef =
|
|
26449
|
-
const rafRef =
|
|
26450
|
-
const frameRef =
|
|
26451
|
-
const lastTimeRef =
|
|
26452
|
-
const imageCache =
|
|
26510
|
+
const canvasRef = React86.useRef(null);
|
|
26511
|
+
const rafRef = React86.useRef(0);
|
|
26512
|
+
const frameRef = React86.useRef(0);
|
|
26513
|
+
const lastTimeRef = React86.useRef(0);
|
|
26514
|
+
const imageCache = React86.useRef(/* @__PURE__ */ new Map());
|
|
26453
26515
|
const emit = useEmitEvent();
|
|
26454
|
-
const onDrawRef =
|
|
26516
|
+
const onDrawRef = React86.useRef(onDraw);
|
|
26455
26517
|
onDrawRef.current = onDraw;
|
|
26456
|
-
const onTickRef =
|
|
26518
|
+
const onTickRef = React86.useRef(onTick);
|
|
26457
26519
|
onTickRef.current = onTick;
|
|
26458
|
-
const tickEventRef =
|
|
26520
|
+
const tickEventRef = React86.useRef(tickEvent);
|
|
26459
26521
|
tickEventRef.current = tickEvent;
|
|
26460
|
-
const drawEventRef =
|
|
26522
|
+
const drawEventRef = React86.useRef(drawEvent);
|
|
26461
26523
|
drawEventRef.current = drawEvent;
|
|
26462
|
-
const emitRef =
|
|
26524
|
+
const emitRef = React86.useRef(emit);
|
|
26463
26525
|
emitRef.current = emit;
|
|
26464
|
-
const assetBaseUrlRef =
|
|
26526
|
+
const assetBaseUrlRef = React86.useRef(assetBaseUrl);
|
|
26465
26527
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
26466
|
-
const backgroundImageRef =
|
|
26528
|
+
const backgroundImageRef = React86.useRef(backgroundImage);
|
|
26467
26529
|
backgroundImageRef.current = backgroundImage;
|
|
26468
|
-
const widthRef =
|
|
26530
|
+
const widthRef = React86.useRef(width);
|
|
26469
26531
|
widthRef.current = width;
|
|
26470
|
-
const heightRef =
|
|
26532
|
+
const heightRef = React86.useRef(height);
|
|
26471
26533
|
heightRef.current = height;
|
|
26472
|
-
const loadImage =
|
|
26534
|
+
const loadImage = React86.useCallback((url) => {
|
|
26473
26535
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
26474
26536
|
const cached = imageCache.current.get(fullUrl);
|
|
26475
26537
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -26481,7 +26543,7 @@ function GameCanvas2D({
|
|
|
26481
26543
|
}
|
|
26482
26544
|
return null;
|
|
26483
26545
|
}, []);
|
|
26484
|
-
|
|
26546
|
+
React86.useEffect(() => {
|
|
26485
26547
|
const canvas = canvasRef.current;
|
|
26486
26548
|
if (!canvas) return;
|
|
26487
26549
|
const ctx = canvas.getContext("2d");
|
|
@@ -26784,7 +26846,7 @@ function TurnPanel({
|
|
|
26784
26846
|
className
|
|
26785
26847
|
}) {
|
|
26786
26848
|
const eventBus = useEventBus();
|
|
26787
|
-
const handleAction =
|
|
26849
|
+
const handleAction = React86.useCallback(
|
|
26788
26850
|
(event) => {
|
|
26789
26851
|
if (event) {
|
|
26790
26852
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -26930,7 +26992,7 @@ function UnitCommandBar({
|
|
|
26930
26992
|
className
|
|
26931
26993
|
}) {
|
|
26932
26994
|
const eventBus = useEventBus();
|
|
26933
|
-
const handleCommand =
|
|
26995
|
+
const handleCommand = React86.useCallback(
|
|
26934
26996
|
(event) => {
|
|
26935
26997
|
if (event) {
|
|
26936
26998
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -27415,7 +27477,7 @@ function GameMenu({
|
|
|
27415
27477
|
} catch {
|
|
27416
27478
|
}
|
|
27417
27479
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27418
|
-
const handleOptionClick =
|
|
27480
|
+
const handleOptionClick = React86.useCallback(
|
|
27419
27481
|
(option) => {
|
|
27420
27482
|
if (option.event && eventBus) {
|
|
27421
27483
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27529,7 +27591,7 @@ function GameOverScreen({
|
|
|
27529
27591
|
} catch {
|
|
27530
27592
|
}
|
|
27531
27593
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27532
|
-
const handleActionClick =
|
|
27594
|
+
const handleActionClick = React86.useCallback(
|
|
27533
27595
|
(action) => {
|
|
27534
27596
|
if (action.event && eventBus) {
|
|
27535
27597
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28523,7 +28585,7 @@ var init_StarRating = __esm({
|
|
|
28523
28585
|
name: "star",
|
|
28524
28586
|
className: cn(
|
|
28525
28587
|
styles.star,
|
|
28526
|
-
"text-muted",
|
|
28588
|
+
"text-muted-foreground",
|
|
28527
28589
|
"transition-colors duration-100"
|
|
28528
28590
|
),
|
|
28529
28591
|
strokeWidth: 1.5
|
|
@@ -29006,8 +29068,8 @@ function TableView({
|
|
|
29006
29068
|
}) {
|
|
29007
29069
|
const eventBus = useEventBus();
|
|
29008
29070
|
const { t } = useTranslate();
|
|
29009
|
-
const [visibleCount, setVisibleCount] =
|
|
29010
|
-
const [localSelected, setLocalSelected] =
|
|
29071
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29072
|
+
const [localSelected, setLocalSelected] = React86__default.useState(/* @__PURE__ */ new Set());
|
|
29011
29073
|
const colDefs = columns ?? fields ?? [];
|
|
29012
29074
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29013
29075
|
const dnd = useDataDnd({
|
|
@@ -29202,12 +29264,12 @@ function TableView({
|
|
|
29202
29264
|
]
|
|
29203
29265
|
}
|
|
29204
29266
|
);
|
|
29205
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29267
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React86__default.Fragment, { children: rowInner }, id);
|
|
29206
29268
|
};
|
|
29207
29269
|
const items = data.map((row) => row);
|
|
29208
29270
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29209
29271
|
let runningIndex = 0;
|
|
29210
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29272
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
29211
29273
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29212
29274
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29213
29275
|
] }, gi)) });
|
|
@@ -30559,7 +30621,7 @@ var init_StepFlow = __esm({
|
|
|
30559
30621
|
className
|
|
30560
30622
|
}) => {
|
|
30561
30623
|
if (orientation === "vertical") {
|
|
30562
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30624
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30563
30625
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30564
30626
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30565
30627
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30570,7 +30632,7 @@ var init_StepFlow = __esm({
|
|
|
30570
30632
|
] })
|
|
30571
30633
|
] }) }, index)) });
|
|
30572
30634
|
}
|
|
30573
|
-
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(
|
|
30635
|
+
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(React86__default.Fragment, { children: [
|
|
30574
30636
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30575
30637
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30576
30638
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31546,7 +31608,7 @@ var init_LikertScale = __esm({
|
|
|
31546
31608
|
md: "text-base",
|
|
31547
31609
|
lg: "text-lg"
|
|
31548
31610
|
};
|
|
31549
|
-
LikertScale =
|
|
31611
|
+
LikertScale = React86__default.forwardRef(
|
|
31550
31612
|
({
|
|
31551
31613
|
question,
|
|
31552
31614
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31558,7 +31620,7 @@ var init_LikertScale = __esm({
|
|
|
31558
31620
|
variant = "radios",
|
|
31559
31621
|
className
|
|
31560
31622
|
}, ref) => {
|
|
31561
|
-
const groupId =
|
|
31623
|
+
const groupId = React86__default.useId();
|
|
31562
31624
|
const eventBus = useEventBus();
|
|
31563
31625
|
const handleSelect = useCallback(
|
|
31564
31626
|
(next) => {
|
|
@@ -32703,6 +32765,7 @@ function Editable({
|
|
|
32703
32765
|
function BlockRow({
|
|
32704
32766
|
block,
|
|
32705
32767
|
readOnly,
|
|
32768
|
+
showAffordances,
|
|
32706
32769
|
placeholder,
|
|
32707
32770
|
onUpdate,
|
|
32708
32771
|
onDelete,
|
|
@@ -32921,7 +32984,7 @@ function BlockRow({
|
|
|
32921
32984
|
onValueChange: (next) => setChildContent(child.id, next)
|
|
32922
32985
|
}
|
|
32923
32986
|
),
|
|
32924
|
-
!readOnly && /* @__PURE__ */ jsx(
|
|
32987
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(
|
|
32925
32988
|
Button,
|
|
32926
32989
|
{
|
|
32927
32990
|
type: "button",
|
|
@@ -32936,7 +32999,7 @@ function BlockRow({
|
|
|
32936
32999
|
}
|
|
32937
33000
|
)
|
|
32938
33001
|
] }, child.id)),
|
|
32939
|
-
!readOnly && /* @__PURE__ */ jsx(Box, { as: "li", className: "list-none pl-0", children: /* @__PURE__ */ jsxs(
|
|
33002
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { as: "li", className: "list-none pl-0", children: /* @__PURE__ */ jsxs(
|
|
32940
33003
|
Button,
|
|
32941
33004
|
{
|
|
32942
33005
|
type: "button",
|
|
@@ -32983,7 +33046,7 @@ function BlockRow({
|
|
|
32983
33046
|
"data-block-id": block.id,
|
|
32984
33047
|
"data-block-type": block.type,
|
|
32985
33048
|
children: [
|
|
32986
|
-
!readOnly && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
|
|
33049
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
|
|
32987
33050
|
/* @__PURE__ */ jsx(
|
|
32988
33051
|
Button,
|
|
32989
33052
|
{
|
|
@@ -33082,6 +33145,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33082
33145
|
changeEvent,
|
|
33083
33146
|
readOnly = false,
|
|
33084
33147
|
placeholder,
|
|
33148
|
+
enableBlocks = false,
|
|
33085
33149
|
showToolbar = true,
|
|
33086
33150
|
className
|
|
33087
33151
|
}) => {
|
|
@@ -33153,7 +33217,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33153
33217
|
padding: "none",
|
|
33154
33218
|
className: cn("flex flex-col", className),
|
|
33155
33219
|
children: [
|
|
33156
|
-
showToolbar && !readOnly && /* @__PURE__ */ jsx(
|
|
33220
|
+
enableBlocks && showToolbar && !readOnly && /* @__PURE__ */ jsx(
|
|
33157
33221
|
Box,
|
|
33158
33222
|
{
|
|
33159
33223
|
role: "toolbar",
|
|
@@ -33189,6 +33253,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33189
33253
|
{
|
|
33190
33254
|
block,
|
|
33191
33255
|
readOnly,
|
|
33256
|
+
showAffordances: enableBlocks,
|
|
33192
33257
|
placeholder,
|
|
33193
33258
|
onUpdate: (updater) => handleUpdate(block.id, updater),
|
|
33194
33259
|
onDelete: () => handleDelete(block.id),
|
|
@@ -33863,7 +33928,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33863
33928
|
"aria-label": t("aria.breadcrumb"),
|
|
33864
33929
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33865
33930
|
const isLast = idx === items.length - 1;
|
|
33866
|
-
return /* @__PURE__ */ jsxs(
|
|
33931
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
33867
33932
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33868
33933
|
Icon,
|
|
33869
33934
|
{
|
|
@@ -34827,7 +34892,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34827
34892
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34828
34893
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34829
34894
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
34830
|
-
return /* @__PURE__ */ jsxs(
|
|
34895
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
34831
34896
|
/* @__PURE__ */ jsx(
|
|
34832
34897
|
AvlState,
|
|
34833
34898
|
{
|
|
@@ -35031,7 +35096,7 @@ var init_PageHeader = __esm({
|
|
|
35031
35096
|
info: "bg-info/10 text-info"
|
|
35032
35097
|
};
|
|
35033
35098
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35034
|
-
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(
|
|
35099
|
+
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(React86__default.Fragment, { children: [
|
|
35035
35100
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35036
35101
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35037
35102
|
"a",
|
|
@@ -35768,7 +35833,7 @@ var init_WizardContainer = __esm({
|
|
|
35768
35833
|
const isCompleted = index < currentStep;
|
|
35769
35834
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35770
35835
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35771
|
-
return /* @__PURE__ */ jsxs(
|
|
35836
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
35772
35837
|
/* @__PURE__ */ jsx(
|
|
35773
35838
|
Button,
|
|
35774
35839
|
{
|
|
@@ -38053,7 +38118,7 @@ var init_DetailPanel = __esm({
|
|
|
38053
38118
|
}
|
|
38054
38119
|
});
|
|
38055
38120
|
function extractTitle(children) {
|
|
38056
|
-
if (!
|
|
38121
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
38057
38122
|
const props = children.props;
|
|
38058
38123
|
if (typeof props.title === "string") {
|
|
38059
38124
|
return props.title;
|
|
@@ -38108,7 +38173,7 @@ function LinearView({
|
|
|
38108
38173
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
38109
38174
|
const isDone = i < currentIdx;
|
|
38110
38175
|
const isCurrent = i === currentIdx;
|
|
38111
|
-
return /* @__PURE__ */ jsxs(
|
|
38176
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
38112
38177
|
i > 0 && /* @__PURE__ */ jsx(
|
|
38113
38178
|
Typography,
|
|
38114
38179
|
{
|
|
@@ -39066,12 +39131,12 @@ var init_Form = __esm({
|
|
|
39066
39131
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39067
39132
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39068
39133
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39069
|
-
const normalizedInitialData =
|
|
39134
|
+
const normalizedInitialData = React86__default.useMemo(() => {
|
|
39070
39135
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39071
39136
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39072
39137
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39073
39138
|
}, [entity, initialData]);
|
|
39074
|
-
const entityDerivedFields =
|
|
39139
|
+
const entityDerivedFields = React86__default.useMemo(() => {
|
|
39075
39140
|
if (fields && fields.length > 0) return void 0;
|
|
39076
39141
|
if (!resolvedEntity) return void 0;
|
|
39077
39142
|
return resolvedEntity.fields.map(
|
|
@@ -39091,16 +39156,16 @@ var init_Form = __esm({
|
|
|
39091
39156
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39092
39157
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39093
39158
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39094
|
-
const [formData, setFormData] =
|
|
39159
|
+
const [formData, setFormData] = React86__default.useState(
|
|
39095
39160
|
normalizedInitialData
|
|
39096
39161
|
);
|
|
39097
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39162
|
+
const [collapsedSections, setCollapsedSections] = React86__default.useState(
|
|
39098
39163
|
/* @__PURE__ */ new Set()
|
|
39099
39164
|
);
|
|
39100
|
-
const [submitError, setSubmitError] =
|
|
39101
|
-
const formRef =
|
|
39165
|
+
const [submitError, setSubmitError] = React86__default.useState(null);
|
|
39166
|
+
const formRef = React86__default.useRef(null);
|
|
39102
39167
|
const formMode = props.mode;
|
|
39103
|
-
const mountedRef =
|
|
39168
|
+
const mountedRef = React86__default.useRef(false);
|
|
39104
39169
|
if (!mountedRef.current) {
|
|
39105
39170
|
mountedRef.current = true;
|
|
39106
39171
|
debug("forms", "mount", {
|
|
@@ -39113,7 +39178,7 @@ var init_Form = __esm({
|
|
|
39113
39178
|
});
|
|
39114
39179
|
}
|
|
39115
39180
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39116
|
-
const evalContext =
|
|
39181
|
+
const evalContext = React86__default.useMemo(
|
|
39117
39182
|
() => ({
|
|
39118
39183
|
formValues: formData,
|
|
39119
39184
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39122,7 +39187,7 @@ var init_Form = __esm({
|
|
|
39122
39187
|
}),
|
|
39123
39188
|
[formData, externalContext]
|
|
39124
39189
|
);
|
|
39125
|
-
|
|
39190
|
+
React86__default.useEffect(() => {
|
|
39126
39191
|
debug("forms", "initialData-sync", {
|
|
39127
39192
|
mode: formMode,
|
|
39128
39193
|
normalizedInitialData,
|
|
@@ -39133,7 +39198,7 @@ var init_Form = __esm({
|
|
|
39133
39198
|
setFormData(normalizedInitialData);
|
|
39134
39199
|
}
|
|
39135
39200
|
}, [normalizedInitialData]);
|
|
39136
|
-
const processCalculations =
|
|
39201
|
+
const processCalculations = React86__default.useCallback(
|
|
39137
39202
|
(changedFieldId, newFormData) => {
|
|
39138
39203
|
if (!hiddenCalculations.length) return;
|
|
39139
39204
|
const context = {
|
|
@@ -39158,7 +39223,7 @@ var init_Form = __esm({
|
|
|
39158
39223
|
},
|
|
39159
39224
|
[hiddenCalculations, externalContext, eventBus]
|
|
39160
39225
|
);
|
|
39161
|
-
const checkViolations =
|
|
39226
|
+
const checkViolations = React86__default.useCallback(
|
|
39162
39227
|
(changedFieldId, newFormData) => {
|
|
39163
39228
|
if (!violationTriggers.length) return;
|
|
39164
39229
|
const context = {
|
|
@@ -39196,7 +39261,7 @@ var init_Form = __esm({
|
|
|
39196
39261
|
processCalculations(name, newFormData);
|
|
39197
39262
|
checkViolations(name, newFormData);
|
|
39198
39263
|
};
|
|
39199
|
-
const isFieldVisible =
|
|
39264
|
+
const isFieldVisible = React86__default.useCallback(
|
|
39200
39265
|
(fieldName) => {
|
|
39201
39266
|
const condition = conditionalFields[fieldName];
|
|
39202
39267
|
if (!condition) return true;
|
|
@@ -39204,7 +39269,7 @@ var init_Form = __esm({
|
|
|
39204
39269
|
},
|
|
39205
39270
|
[conditionalFields, evalContext]
|
|
39206
39271
|
);
|
|
39207
|
-
const isSectionVisible =
|
|
39272
|
+
const isSectionVisible = React86__default.useCallback(
|
|
39208
39273
|
(section) => {
|
|
39209
39274
|
if (!section.condition) return true;
|
|
39210
39275
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39280,7 +39345,7 @@ var init_Form = __esm({
|
|
|
39280
39345
|
eventBus.emit(`UI:${onCancel}`);
|
|
39281
39346
|
}
|
|
39282
39347
|
};
|
|
39283
|
-
const renderField =
|
|
39348
|
+
const renderField = React86__default.useCallback(
|
|
39284
39349
|
(field) => {
|
|
39285
39350
|
const fieldName = field.name || field.field;
|
|
39286
39351
|
if (!fieldName) return null;
|
|
@@ -39301,7 +39366,7 @@ var init_Form = __esm({
|
|
|
39301
39366
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39302
39367
|
);
|
|
39303
39368
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39304
|
-
const normalizedFields =
|
|
39369
|
+
const normalizedFields = React86__default.useMemo(() => {
|
|
39305
39370
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39306
39371
|
return effectiveFields.map((field) => {
|
|
39307
39372
|
if (typeof field === "string") {
|
|
@@ -39324,7 +39389,7 @@ var init_Form = __esm({
|
|
|
39324
39389
|
return field;
|
|
39325
39390
|
});
|
|
39326
39391
|
}, [effectiveFields, resolvedEntity]);
|
|
39327
|
-
const schemaFields =
|
|
39392
|
+
const schemaFields = React86__default.useMemo(() => {
|
|
39328
39393
|
if (normalizedFields.length === 0) return null;
|
|
39329
39394
|
if (isDebugEnabled()) {
|
|
39330
39395
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39334,7 +39399,7 @@ var init_Form = __esm({
|
|
|
39334
39399
|
}
|
|
39335
39400
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39336
39401
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39337
|
-
const sectionElements =
|
|
39402
|
+
const sectionElements = React86__default.useMemo(() => {
|
|
39338
39403
|
if (!sections || sections.length === 0) return null;
|
|
39339
39404
|
return sections.map((section) => {
|
|
39340
39405
|
if (!isSectionVisible(section)) {
|
|
@@ -40609,7 +40674,7 @@ var init_List = __esm({
|
|
|
40609
40674
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
40610
40675
|
return [];
|
|
40611
40676
|
}, [entity]);
|
|
40612
|
-
const getItemActions =
|
|
40677
|
+
const getItemActions = React86__default.useCallback(
|
|
40613
40678
|
(item) => {
|
|
40614
40679
|
if (!itemActions) return [];
|
|
40615
40680
|
if (typeof itemActions === "function") {
|
|
@@ -41085,7 +41150,7 @@ var init_MediaGallery = __esm({
|
|
|
41085
41150
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41086
41151
|
);
|
|
41087
41152
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41088
|
-
const items =
|
|
41153
|
+
const items = React86__default.useMemo(() => {
|
|
41089
41154
|
if (propItems) return propItems;
|
|
41090
41155
|
if (entityData.length === 0) return [];
|
|
41091
41156
|
return entityData.map((record, idx) => ({
|
|
@@ -41246,7 +41311,7 @@ var init_MediaGallery = __esm({
|
|
|
41246
41311
|
}
|
|
41247
41312
|
});
|
|
41248
41313
|
function extractTitle2(children) {
|
|
41249
|
-
if (!
|
|
41314
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
41250
41315
|
const props = children.props;
|
|
41251
41316
|
if (typeof props.title === "string") {
|
|
41252
41317
|
return props.title;
|
|
@@ -41677,7 +41742,7 @@ var init_debugRegistry = __esm({
|
|
|
41677
41742
|
}
|
|
41678
41743
|
});
|
|
41679
41744
|
function useDebugData() {
|
|
41680
|
-
const [data, setData] =
|
|
41745
|
+
const [data, setData] = React86.useState(() => ({
|
|
41681
41746
|
traits: [],
|
|
41682
41747
|
ticks: [],
|
|
41683
41748
|
guards: [],
|
|
@@ -41691,7 +41756,7 @@ function useDebugData() {
|
|
|
41691
41756
|
},
|
|
41692
41757
|
lastUpdate: Date.now()
|
|
41693
41758
|
}));
|
|
41694
|
-
|
|
41759
|
+
React86.useEffect(() => {
|
|
41695
41760
|
const updateData = () => {
|
|
41696
41761
|
setData({
|
|
41697
41762
|
traits: getAllTraits(),
|
|
@@ -41800,12 +41865,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
41800
41865
|
return positions;
|
|
41801
41866
|
}
|
|
41802
41867
|
function WalkMinimap() {
|
|
41803
|
-
const [walkStep, setWalkStep] =
|
|
41804
|
-
const [traits2, setTraits] =
|
|
41805
|
-
const [coveredEdges, setCoveredEdges] =
|
|
41806
|
-
const [completedTraits, setCompletedTraits] =
|
|
41807
|
-
const prevTraitRef =
|
|
41808
|
-
|
|
41868
|
+
const [walkStep, setWalkStep] = React86.useState(null);
|
|
41869
|
+
const [traits2, setTraits] = React86.useState([]);
|
|
41870
|
+
const [coveredEdges, setCoveredEdges] = React86.useState([]);
|
|
41871
|
+
const [completedTraits, setCompletedTraits] = React86.useState(/* @__PURE__ */ new Set());
|
|
41872
|
+
const prevTraitRef = React86.useRef(null);
|
|
41873
|
+
React86.useEffect(() => {
|
|
41809
41874
|
const interval = setInterval(() => {
|
|
41810
41875
|
const w = window;
|
|
41811
41876
|
const step = w.__orbitalWalkStep;
|
|
@@ -42241,15 +42306,15 @@ var init_EntitiesTab = __esm({
|
|
|
42241
42306
|
});
|
|
42242
42307
|
function EventFlowTab({ events: events2 }) {
|
|
42243
42308
|
const { t } = useTranslate();
|
|
42244
|
-
const [filter, setFilter] =
|
|
42245
|
-
const containerRef =
|
|
42246
|
-
const [autoScroll, setAutoScroll] =
|
|
42247
|
-
|
|
42309
|
+
const [filter, setFilter] = React86.useState("all");
|
|
42310
|
+
const containerRef = React86.useRef(null);
|
|
42311
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
42312
|
+
React86.useEffect(() => {
|
|
42248
42313
|
if (autoScroll && containerRef.current) {
|
|
42249
42314
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42250
42315
|
}
|
|
42251
42316
|
}, [events2.length, autoScroll]);
|
|
42252
|
-
const filteredEvents =
|
|
42317
|
+
const filteredEvents = React86.useMemo(() => {
|
|
42253
42318
|
if (filter === "all") return events2;
|
|
42254
42319
|
return events2.filter((e) => e.type === filter);
|
|
42255
42320
|
}, [events2, filter]);
|
|
@@ -42365,7 +42430,7 @@ var init_EventFlowTab = __esm({
|
|
|
42365
42430
|
});
|
|
42366
42431
|
function GuardsPanel({ guards }) {
|
|
42367
42432
|
const { t } = useTranslate();
|
|
42368
|
-
const [filter, setFilter] =
|
|
42433
|
+
const [filter, setFilter] = React86.useState("all");
|
|
42369
42434
|
if (guards.length === 0) {
|
|
42370
42435
|
return /* @__PURE__ */ jsx(
|
|
42371
42436
|
EmptyState,
|
|
@@ -42378,7 +42443,7 @@ function GuardsPanel({ guards }) {
|
|
|
42378
42443
|
}
|
|
42379
42444
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42380
42445
|
const failedCount = guards.length - passedCount;
|
|
42381
|
-
const filteredGuards =
|
|
42446
|
+
const filteredGuards = React86.useMemo(() => {
|
|
42382
42447
|
if (filter === "all") return guards;
|
|
42383
42448
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42384
42449
|
return guards.filter((g) => !g.result);
|
|
@@ -42541,10 +42606,10 @@ function EffectBadge({ effect }) {
|
|
|
42541
42606
|
}
|
|
42542
42607
|
function TransitionTimeline({ transitions }) {
|
|
42543
42608
|
const { t } = useTranslate();
|
|
42544
|
-
const containerRef =
|
|
42545
|
-
const [autoScroll, setAutoScroll] =
|
|
42546
|
-
const [expandedId, setExpandedId] =
|
|
42547
|
-
|
|
42609
|
+
const containerRef = React86.useRef(null);
|
|
42610
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
42611
|
+
const [expandedId, setExpandedId] = React86.useState(null);
|
|
42612
|
+
React86.useEffect(() => {
|
|
42548
42613
|
if (autoScroll && containerRef.current) {
|
|
42549
42614
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42550
42615
|
}
|
|
@@ -42824,9 +42889,9 @@ function getAllEvents(traits2) {
|
|
|
42824
42889
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
42825
42890
|
const eventBus = useEventBus();
|
|
42826
42891
|
const { t } = useTranslate();
|
|
42827
|
-
const [log12, setLog] =
|
|
42828
|
-
const prevStatesRef =
|
|
42829
|
-
|
|
42892
|
+
const [log12, setLog] = React86.useState([]);
|
|
42893
|
+
const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
42894
|
+
React86.useEffect(() => {
|
|
42830
42895
|
for (const trait of traits2) {
|
|
42831
42896
|
const prev = prevStatesRef.current.get(trait.id);
|
|
42832
42897
|
if (prev && prev !== trait.currentState) {
|
|
@@ -42995,10 +43060,10 @@ function VerifyModePanel({
|
|
|
42995
43060
|
localCount
|
|
42996
43061
|
}) {
|
|
42997
43062
|
const { t } = useTranslate();
|
|
42998
|
-
const [expanded, setExpanded] =
|
|
42999
|
-
const scrollRef =
|
|
43000
|
-
const prevCountRef =
|
|
43001
|
-
|
|
43063
|
+
const [expanded, setExpanded] = React86.useState(true);
|
|
43064
|
+
const scrollRef = React86.useRef(null);
|
|
43065
|
+
const prevCountRef = React86.useRef(0);
|
|
43066
|
+
React86.useEffect(() => {
|
|
43002
43067
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43003
43068
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43004
43069
|
}
|
|
@@ -43055,10 +43120,10 @@ function RuntimeDebugger({
|
|
|
43055
43120
|
schema
|
|
43056
43121
|
}) {
|
|
43057
43122
|
const { t } = useTranslate();
|
|
43058
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43059
|
-
const [isVisible, setIsVisible] =
|
|
43123
|
+
const [isCollapsed, setIsCollapsed] = React86.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43124
|
+
const [isVisible, setIsVisible] = React86.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43060
43125
|
const debugData = useDebugData();
|
|
43061
|
-
|
|
43126
|
+
React86.useEffect(() => {
|
|
43062
43127
|
if (mode === "inline") return;
|
|
43063
43128
|
return onDebugToggle((enabled) => {
|
|
43064
43129
|
setIsVisible(enabled);
|
|
@@ -43067,7 +43132,7 @@ function RuntimeDebugger({
|
|
|
43067
43132
|
}
|
|
43068
43133
|
});
|
|
43069
43134
|
}, [mode]);
|
|
43070
|
-
|
|
43135
|
+
React86.useEffect(() => {
|
|
43071
43136
|
if (mode === "inline") return;
|
|
43072
43137
|
const handleKeyDown = (e) => {
|
|
43073
43138
|
if (e.key === "`" && isVisible) {
|
|
@@ -43082,7 +43147,7 @@ function RuntimeDebugger({
|
|
|
43082
43147
|
if (!isVisible) {
|
|
43083
43148
|
return null;
|
|
43084
43149
|
}
|
|
43085
|
-
const
|
|
43150
|
+
const positionClasses = {
|
|
43086
43151
|
"bottom-right": "bottom-4 right-4",
|
|
43087
43152
|
"bottom-left": "bottom-4 left-4",
|
|
43088
43153
|
"top-right": "top-4 right-4",
|
|
@@ -43211,7 +43276,7 @@ function RuntimeDebugger({
|
|
|
43211
43276
|
className: cn(
|
|
43212
43277
|
"runtime-debugger",
|
|
43213
43278
|
"fixed",
|
|
43214
|
-
|
|
43279
|
+
positionClasses[position],
|
|
43215
43280
|
isCollapsed ? "runtime-debugger--collapsed" : "runtime-debugger--expanded",
|
|
43216
43281
|
className
|
|
43217
43282
|
),
|
|
@@ -43516,7 +43581,7 @@ function SequenceBar({
|
|
|
43516
43581
|
onSlotRemove(index);
|
|
43517
43582
|
}, [onSlotRemove, playing]);
|
|
43518
43583
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
43519
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
43584
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
43520
43585
|
i > 0 && /* @__PURE__ */ jsx(
|
|
43521
43586
|
Typography,
|
|
43522
43587
|
{
|
|
@@ -44495,7 +44560,7 @@ var init_StatCard = __esm({
|
|
|
44495
44560
|
const labelToUse = propLabel ?? propTitle;
|
|
44496
44561
|
const eventBus = useEventBus();
|
|
44497
44562
|
const { t } = useTranslate();
|
|
44498
|
-
const handleActionClick =
|
|
44563
|
+
const handleActionClick = React86__default.useCallback(() => {
|
|
44499
44564
|
if (action?.event) {
|
|
44500
44565
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44501
44566
|
}
|
|
@@ -44506,7 +44571,7 @@ var init_StatCard = __esm({
|
|
|
44506
44571
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44507
44572
|
const isLoading = externalLoading ?? false;
|
|
44508
44573
|
const error = externalError;
|
|
44509
|
-
const computeMetricValue =
|
|
44574
|
+
const computeMetricValue = React86__default.useCallback(
|
|
44510
44575
|
(metric, items) => {
|
|
44511
44576
|
if (metric.value !== void 0) {
|
|
44512
44577
|
return metric.value;
|
|
@@ -44545,7 +44610,7 @@ var init_StatCard = __esm({
|
|
|
44545
44610
|
},
|
|
44546
44611
|
[]
|
|
44547
44612
|
);
|
|
44548
|
-
const schemaStats =
|
|
44613
|
+
const schemaStats = React86__default.useMemo(() => {
|
|
44549
44614
|
if (!metrics || metrics.length === 0) return null;
|
|
44550
44615
|
return metrics.map((metric) => ({
|
|
44551
44616
|
label: metric.label,
|
|
@@ -44553,7 +44618,7 @@ var init_StatCard = __esm({
|
|
|
44553
44618
|
format: metric.format
|
|
44554
44619
|
}));
|
|
44555
44620
|
}, [metrics, data, computeMetricValue]);
|
|
44556
|
-
const calculatedTrend =
|
|
44621
|
+
const calculatedTrend = React86__default.useMemo(() => {
|
|
44557
44622
|
if (manualTrend !== void 0) return manualTrend;
|
|
44558
44623
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44559
44624
|
return void 0;
|
|
@@ -45487,7 +45552,7 @@ var init_Timeline = __esm({
|
|
|
45487
45552
|
}) => {
|
|
45488
45553
|
const { t } = useTranslate();
|
|
45489
45554
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45490
|
-
const items =
|
|
45555
|
+
const items = React86__default.useMemo(() => {
|
|
45491
45556
|
if (propItems) return propItems;
|
|
45492
45557
|
if (entityData.length === 0) return [];
|
|
45493
45558
|
return entityData.map((record, idx) => {
|
|
@@ -45594,7 +45659,7 @@ var init_Timeline = __esm({
|
|
|
45594
45659
|
}
|
|
45595
45660
|
});
|
|
45596
45661
|
function extractToastProps(children) {
|
|
45597
|
-
if (!
|
|
45662
|
+
if (!React86__default.isValidElement(children)) {
|
|
45598
45663
|
if (typeof children === "string") {
|
|
45599
45664
|
return { message: children };
|
|
45600
45665
|
}
|
|
@@ -45632,7 +45697,7 @@ var init_ToastSlot = __esm({
|
|
|
45632
45697
|
eventBus.emit("UI:CLOSE");
|
|
45633
45698
|
};
|
|
45634
45699
|
if (!isVisible) return null;
|
|
45635
|
-
const isCustomContent =
|
|
45700
|
+
const isCustomContent = React86__default.isValidElement(children) && !message;
|
|
45636
45701
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45637
45702
|
Toast,
|
|
45638
45703
|
{
|
|
@@ -46142,12 +46207,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
46142
46207
|
}
|
|
46143
46208
|
});
|
|
46144
46209
|
function lazyThree(name, loader) {
|
|
46145
|
-
const Lazy =
|
|
46210
|
+
const Lazy = React86__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46146
46211
|
function ThreeWrapper(props) {
|
|
46147
|
-
return
|
|
46148
|
-
|
|
46212
|
+
return React86__default.createElement(
|
|
46213
|
+
React86__default.Suspense,
|
|
46149
46214
|
{ fallback: null },
|
|
46150
|
-
|
|
46215
|
+
React86__default.createElement(Lazy, props)
|
|
46151
46216
|
);
|
|
46152
46217
|
}
|
|
46153
46218
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -46763,7 +46828,7 @@ function SuspenseConfigProvider({
|
|
|
46763
46828
|
config,
|
|
46764
46829
|
children
|
|
46765
46830
|
}) {
|
|
46766
|
-
return
|
|
46831
|
+
return React86__default.createElement(
|
|
46767
46832
|
SuspenseConfigContext.Provider,
|
|
46768
46833
|
{ value: config },
|
|
46769
46834
|
children
|
|
@@ -46838,6 +46903,9 @@ function renderContainedPortal(t, slot, content, onDismiss) {
|
|
|
46838
46903
|
const slotId = `slot-${slot}`;
|
|
46839
46904
|
switch (slot) {
|
|
46840
46905
|
case "modal":
|
|
46906
|
+
if (SELF_OVERLAY_PATTERNS.has(content.pattern)) {
|
|
46907
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "contents", children: slotContent });
|
|
46908
|
+
}
|
|
46841
46909
|
return /* @__PURE__ */ jsx(
|
|
46842
46910
|
Box,
|
|
46843
46911
|
{
|
|
@@ -47099,8 +47167,8 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
47099
47167
|
const slotId = `slot-${slot}`;
|
|
47100
47168
|
let wrapper;
|
|
47101
47169
|
switch (slot) {
|
|
47102
|
-
case "modal":
|
|
47103
|
-
|
|
47170
|
+
case "modal": {
|
|
47171
|
+
const innerContent = /* @__PURE__ */ jsx(
|
|
47104
47172
|
Box,
|
|
47105
47173
|
{
|
|
47106
47174
|
id: slotId,
|
|
@@ -47109,8 +47177,10 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
47109
47177
|
"data-source-trait": sourceTrait,
|
|
47110
47178
|
children
|
|
47111
47179
|
}
|
|
47112
|
-
)
|
|
47180
|
+
);
|
|
47181
|
+
wrapper = pattern !== void 0 && SELF_OVERLAY_PATTERNS.has(pattern) ? innerContent : /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: innerContent });
|
|
47113
47182
|
break;
|
|
47183
|
+
}
|
|
47114
47184
|
case "drawer":
|
|
47115
47185
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
47116
47186
|
Box,
|
|
@@ -47168,7 +47238,7 @@ function SlotPortal({
|
|
|
47168
47238
|
let wrapper;
|
|
47169
47239
|
switch (slot) {
|
|
47170
47240
|
case "modal":
|
|
47171
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
47241
|
+
wrapper = SELF_OVERLAY_PATTERNS.has(content.pattern) ? /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent }) : /* @__PURE__ */ jsx(
|
|
47172
47242
|
Modal,
|
|
47173
47243
|
{
|
|
47174
47244
|
isOpen: true,
|
|
@@ -47248,7 +47318,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47248
47318
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47249
47319
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47250
47320
|
}
|
|
47251
|
-
return /* @__PURE__ */ jsx(
|
|
47321
|
+
return /* @__PURE__ */ jsx(React86__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47252
47322
|
}
|
|
47253
47323
|
if (!child || typeof child !== "object") return null;
|
|
47254
47324
|
const childId = `${parentId}-${index}`;
|
|
@@ -47288,14 +47358,14 @@ function isPatternConfig(value) {
|
|
|
47288
47358
|
if (value === null || value === void 0) return false;
|
|
47289
47359
|
if (typeof value !== "object") return false;
|
|
47290
47360
|
if (Array.isArray(value)) return false;
|
|
47291
|
-
if (
|
|
47361
|
+
if (React86__default.isValidElement(value)) return false;
|
|
47292
47362
|
if (value instanceof Date) return false;
|
|
47293
47363
|
if (typeof value === "function") return false;
|
|
47294
47364
|
const record = value;
|
|
47295
47365
|
return "type" in record && typeof record.type === "string";
|
|
47296
47366
|
}
|
|
47297
47367
|
function isPlainConfigObject(value) {
|
|
47298
|
-
if (
|
|
47368
|
+
if (React86__default.isValidElement(value)) return false;
|
|
47299
47369
|
if (value instanceof Date) return false;
|
|
47300
47370
|
const proto = Object.getPrototypeOf(value);
|
|
47301
47371
|
return proto === Object.prototype || proto === null;
|
|
@@ -47548,7 +47618,7 @@ function UISlotRenderer({
|
|
|
47548
47618
|
}
|
|
47549
47619
|
return wrapped;
|
|
47550
47620
|
}
|
|
47551
|
-
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
47621
|
+
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, SELF_OVERLAY_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
47552
47622
|
var init_UISlotRenderer = __esm({
|
|
47553
47623
|
"components/core/organisms/UISlotRenderer.tsx"() {
|
|
47554
47624
|
"use client";
|
|
@@ -47584,6 +47654,7 @@ var init_UISlotRenderer = __esm({
|
|
|
47584
47654
|
"inline-edit-form",
|
|
47585
47655
|
"wizard-step"
|
|
47586
47656
|
]);
|
|
47657
|
+
SELF_OVERLAY_PATTERNS = /* @__PURE__ */ new Set(["modal", "confirm-dialog"]);
|
|
47587
47658
|
PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
47588
47659
|
"stack",
|
|
47589
47660
|
"vstack",
|
|
@@ -47704,7 +47775,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
47704
47775
|
if (Array.isArray(body)) {
|
|
47705
47776
|
return body.map((b) => recur(b));
|
|
47706
47777
|
}
|
|
47707
|
-
if (body !== null && typeof body === "object" && !
|
|
47778
|
+
if (body !== null && typeof body === "object" && !React86__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
47708
47779
|
const out = {};
|
|
47709
47780
|
for (const [k, v] of Object.entries(body)) {
|
|
47710
47781
|
out[k] = recur(v);
|
|
@@ -47723,7 +47794,7 @@ function getSlotContentRenderer2() {
|
|
|
47723
47794
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
47724
47795
|
return (item, index) => {
|
|
47725
47796
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
47726
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
47797
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React86__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
47727
47798
|
return null;
|
|
47728
47799
|
}
|
|
47729
47800
|
const record = resolvedBody;
|
|
@@ -47742,7 +47813,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
47742
47813
|
props: childProps,
|
|
47743
47814
|
priority: 0
|
|
47744
47815
|
};
|
|
47745
|
-
return
|
|
47816
|
+
return React86__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
47746
47817
|
};
|
|
47747
47818
|
}
|
|
47748
47819
|
function convertNode(node, callerKey) {
|
|
@@ -47761,7 +47832,7 @@ function convertNode(node, callerKey) {
|
|
|
47761
47832
|
});
|
|
47762
47833
|
return anyChanged ? mapped : node;
|
|
47763
47834
|
}
|
|
47764
|
-
if (typeof node === "object" && !
|
|
47835
|
+
if (typeof node === "object" && !React86__default.isValidElement(node) && !(node instanceof Date)) {
|
|
47765
47836
|
return convertObjectProps(node);
|
|
47766
47837
|
}
|
|
47767
47838
|
return node;
|