@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/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React87 from 'react';
|
|
2
|
+
import React87__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
@@ -657,7 +657,7 @@ var init_Box = __esm({
|
|
|
657
657
|
fixed: "fixed",
|
|
658
658
|
sticky: "sticky"
|
|
659
659
|
};
|
|
660
|
-
Box =
|
|
660
|
+
Box = React87__default.forwardRef(
|
|
661
661
|
({
|
|
662
662
|
padding,
|
|
663
663
|
paddingX,
|
|
@@ -707,7 +707,7 @@ var init_Box = __esm({
|
|
|
707
707
|
onMouseLeave?.(e);
|
|
708
708
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
709
709
|
const isClickable = action || onClick;
|
|
710
|
-
return
|
|
710
|
+
return React87__default.createElement(
|
|
711
711
|
Component,
|
|
712
712
|
{
|
|
713
713
|
ref,
|
|
@@ -1490,7 +1490,7 @@ var init_Icon = __esm({
|
|
|
1490
1490
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1491
1491
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1492
1492
|
const family = useIconFamily();
|
|
1493
|
-
const RenderedComponent =
|
|
1493
|
+
const RenderedComponent = React87__default.useMemo(() => {
|
|
1494
1494
|
if (directIcon) return null;
|
|
1495
1495
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1496
1496
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1548,7 +1548,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1548
1548
|
const IconComp = value;
|
|
1549
1549
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1550
1550
|
}
|
|
1551
|
-
if (
|
|
1551
|
+
if (React87__default.isValidElement(value)) {
|
|
1552
1552
|
return value;
|
|
1553
1553
|
}
|
|
1554
1554
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1624,7 +1624,7 @@ var init_Button = __esm({
|
|
|
1624
1624
|
md: "h-icon-default w-icon-default",
|
|
1625
1625
|
lg: "h-icon-default w-icon-default"
|
|
1626
1626
|
};
|
|
1627
|
-
Button =
|
|
1627
|
+
Button = React87__default.forwardRef(
|
|
1628
1628
|
({
|
|
1629
1629
|
className,
|
|
1630
1630
|
variant = "primary",
|
|
@@ -1689,7 +1689,7 @@ var Dialog;
|
|
|
1689
1689
|
var init_Dialog = __esm({
|
|
1690
1690
|
"components/core/atoms/Dialog.tsx"() {
|
|
1691
1691
|
init_cn();
|
|
1692
|
-
Dialog =
|
|
1692
|
+
Dialog = React87__default.forwardRef(
|
|
1693
1693
|
({
|
|
1694
1694
|
role = "dialog",
|
|
1695
1695
|
"aria-modal": ariaModal = true,
|
|
@@ -2214,7 +2214,7 @@ var init_Drawer = __esm({
|
|
|
2214
2214
|
};
|
|
2215
2215
|
const widthClass = width in sizeWidths ? sizeWidths[width] : "";
|
|
2216
2216
|
const widthStyle = width in sizeWidths ? void 0 : { width };
|
|
2217
|
-
const
|
|
2217
|
+
const positionClasses = position === "right" ? "right-0 border-l" : "left-0 border-r";
|
|
2218
2218
|
const animationClasses2 = position === "right" ? "animate-slide-in-right" : "animate-slide-in-left";
|
|
2219
2219
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2220
2220
|
/* @__PURE__ */ jsx(
|
|
@@ -2235,7 +2235,7 @@ var init_Drawer = __esm({
|
|
|
2235
2235
|
className: cn(
|
|
2236
2236
|
"fixed top-0 bottom-0 z-50",
|
|
2237
2237
|
"flex flex-col max-h-screen",
|
|
2238
|
-
|
|
2238
|
+
positionClasses,
|
|
2239
2239
|
widthClass,
|
|
2240
2240
|
animationClasses2,
|
|
2241
2241
|
className
|
|
@@ -2353,7 +2353,7 @@ var init_Badge = __esm({
|
|
|
2353
2353
|
md: "px-2.5 py-1 text-sm",
|
|
2354
2354
|
lg: "px-3 py-1.5 text-base"
|
|
2355
2355
|
};
|
|
2356
|
-
Badge =
|
|
2356
|
+
Badge = React87__default.forwardRef(
|
|
2357
2357
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2358
2358
|
const iconSizes3 = {
|
|
2359
2359
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2669,7 +2669,7 @@ var init_SvgFlow = __esm({
|
|
|
2669
2669
|
opacity = 1,
|
|
2670
2670
|
className
|
|
2671
2671
|
}) => {
|
|
2672
|
-
const markerId =
|
|
2672
|
+
const markerId = React87__default.useMemo(() => {
|
|
2673
2673
|
flowIdCounter += 1;
|
|
2674
2674
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2675
2675
|
}, []);
|
|
@@ -3212,7 +3212,7 @@ var init_SvgRing = __esm({
|
|
|
3212
3212
|
className,
|
|
3213
3213
|
label
|
|
3214
3214
|
}) => {
|
|
3215
|
-
const gradientId =
|
|
3215
|
+
const gradientId = React87__default.useMemo(() => {
|
|
3216
3216
|
ringIdCounter += 1;
|
|
3217
3217
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3218
3218
|
}, []);
|
|
@@ -3374,7 +3374,7 @@ var init_Input = __esm({
|
|
|
3374
3374
|
"components/core/atoms/Input.tsx"() {
|
|
3375
3375
|
init_cn();
|
|
3376
3376
|
init_Icon();
|
|
3377
|
-
Input =
|
|
3377
|
+
Input = React87__default.forwardRef(
|
|
3378
3378
|
({
|
|
3379
3379
|
className,
|
|
3380
3380
|
inputType,
|
|
@@ -3495,7 +3495,7 @@ var Label;
|
|
|
3495
3495
|
var init_Label = __esm({
|
|
3496
3496
|
"components/core/atoms/Label.tsx"() {
|
|
3497
3497
|
init_cn();
|
|
3498
|
-
Label =
|
|
3498
|
+
Label = React87__default.forwardRef(
|
|
3499
3499
|
({ className, required, children, ...props }, ref) => {
|
|
3500
3500
|
return /* @__PURE__ */ jsxs(
|
|
3501
3501
|
"label",
|
|
@@ -3521,7 +3521,7 @@ var Textarea;
|
|
|
3521
3521
|
var init_Textarea = __esm({
|
|
3522
3522
|
"components/core/atoms/Textarea.tsx"() {
|
|
3523
3523
|
init_cn();
|
|
3524
|
-
Textarea =
|
|
3524
|
+
Textarea = React87__default.forwardRef(
|
|
3525
3525
|
({ className, error, ...props }, ref) => {
|
|
3526
3526
|
return /* @__PURE__ */ jsx(
|
|
3527
3527
|
"textarea",
|
|
@@ -3551,7 +3551,7 @@ var init_Select = __esm({
|
|
|
3551
3551
|
"components/core/atoms/Select.tsx"() {
|
|
3552
3552
|
init_cn();
|
|
3553
3553
|
init_Icon();
|
|
3554
|
-
Select =
|
|
3554
|
+
Select = React87__default.forwardRef(
|
|
3555
3555
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3556
3556
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3557
3557
|
/* @__PURE__ */ jsxs(
|
|
@@ -3593,7 +3593,7 @@ var Checkbox;
|
|
|
3593
3593
|
var init_Checkbox = __esm({
|
|
3594
3594
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3595
3595
|
init_cn();
|
|
3596
|
-
Checkbox =
|
|
3596
|
+
Checkbox = React87__default.forwardRef(
|
|
3597
3597
|
({ className, label, id, ...props }, ref) => {
|
|
3598
3598
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3599
3599
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3684,7 +3684,7 @@ var init_Card = __esm({
|
|
|
3684
3684
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3685
3685
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3686
3686
|
};
|
|
3687
|
-
Card =
|
|
3687
|
+
Card = React87__default.forwardRef(
|
|
3688
3688
|
({
|
|
3689
3689
|
className,
|
|
3690
3690
|
variant = "bordered",
|
|
@@ -3722,9 +3722,9 @@ var init_Card = __esm({
|
|
|
3722
3722
|
}
|
|
3723
3723
|
);
|
|
3724
3724
|
Card.displayName = "Card";
|
|
3725
|
-
CardHeader =
|
|
3725
|
+
CardHeader = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3726
3726
|
CardHeader.displayName = "CardHeader";
|
|
3727
|
-
CardTitle =
|
|
3727
|
+
CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3728
3728
|
"h3",
|
|
3729
3729
|
{
|
|
3730
3730
|
ref,
|
|
@@ -3737,11 +3737,11 @@ var init_Card = __esm({
|
|
|
3737
3737
|
}
|
|
3738
3738
|
));
|
|
3739
3739
|
CardTitle.displayName = "CardTitle";
|
|
3740
|
-
CardContent =
|
|
3740
|
+
CardContent = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3741
3741
|
CardContent.displayName = "CardContent";
|
|
3742
3742
|
CardBody = CardContent;
|
|
3743
3743
|
CardBody.displayName = "CardBody";
|
|
3744
|
-
CardFooter =
|
|
3744
|
+
CardFooter = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3745
3745
|
"div",
|
|
3746
3746
|
{
|
|
3747
3747
|
ref,
|
|
@@ -3796,7 +3796,7 @@ var init_FilterPill = __esm({
|
|
|
3796
3796
|
md: "w-3.5 h-3.5",
|
|
3797
3797
|
lg: "w-4 h-4"
|
|
3798
3798
|
};
|
|
3799
|
-
FilterPill =
|
|
3799
|
+
FilterPill = React87__default.forwardRef(
|
|
3800
3800
|
({
|
|
3801
3801
|
className,
|
|
3802
3802
|
variant = "default",
|
|
@@ -3873,7 +3873,7 @@ var init_Spinner = __esm({
|
|
|
3873
3873
|
md: "h-6 w-6",
|
|
3874
3874
|
lg: "h-8 w-8"
|
|
3875
3875
|
};
|
|
3876
|
-
Spinner =
|
|
3876
|
+
Spinner = React87__default.forwardRef(
|
|
3877
3877
|
({ className, size = "md", ...props }, ref) => {
|
|
3878
3878
|
return /* @__PURE__ */ jsx(
|
|
3879
3879
|
"div",
|
|
@@ -3952,11 +3952,15 @@ var init_Avatar = __esm({
|
|
|
3952
3952
|
actionPayload
|
|
3953
3953
|
}) => {
|
|
3954
3954
|
const eventBus = useEventBus();
|
|
3955
|
+
const [imgFailed, setImgFailed] = React87__default.useState(false);
|
|
3956
|
+
React87__default.useEffect(() => {
|
|
3957
|
+
setImgFailed(false);
|
|
3958
|
+
}, [src]);
|
|
3955
3959
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
3956
3960
|
const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
|
|
3957
|
-
const hasImage = !!src;
|
|
3958
|
-
const hasInitials = !!initials;
|
|
3961
|
+
const hasImage = !!src && !imgFailed;
|
|
3959
3962
|
const hasIcon = !!IconComponent;
|
|
3963
|
+
const hasInitials = !!initials && !(hasIcon && !providedInitials);
|
|
3960
3964
|
const getInitialsBackground = () => "bg-primary text-primary-foreground";
|
|
3961
3965
|
const isClickable = action || onClick;
|
|
3962
3966
|
const handleClick = () => {
|
|
@@ -3986,9 +3990,8 @@ var init_Avatar = __esm({
|
|
|
3986
3990
|
src,
|
|
3987
3991
|
alt: alt || "Avatar",
|
|
3988
3992
|
className: "w-full h-full object-cover",
|
|
3989
|
-
onError: (
|
|
3990
|
-
|
|
3991
|
-
target.style.display = "none";
|
|
3993
|
+
onError: () => {
|
|
3994
|
+
setImgFailed(true);
|
|
3992
3995
|
}
|
|
3993
3996
|
}
|
|
3994
3997
|
) : hasInitials ? /* @__PURE__ */ jsx(
|
|
@@ -4335,7 +4338,7 @@ var init_Radio = __esm({
|
|
|
4335
4338
|
md: "w-2.5 h-2.5",
|
|
4336
4339
|
lg: "w-3 h-3"
|
|
4337
4340
|
};
|
|
4338
|
-
Radio =
|
|
4341
|
+
Radio = React87__default.forwardRef(
|
|
4339
4342
|
({
|
|
4340
4343
|
label,
|
|
4341
4344
|
helperText,
|
|
@@ -4352,12 +4355,12 @@ var init_Radio = __esm({
|
|
|
4352
4355
|
onChange,
|
|
4353
4356
|
...props
|
|
4354
4357
|
}, ref) => {
|
|
4355
|
-
const reactId =
|
|
4358
|
+
const reactId = React87__default.useId();
|
|
4356
4359
|
const baseId = id || `radio-${reactId}`;
|
|
4357
4360
|
const hasError = !!error;
|
|
4358
4361
|
const eventBus = useEventBus();
|
|
4359
|
-
const [selected, setSelected] =
|
|
4360
|
-
|
|
4362
|
+
const [selected, setSelected] = React87__default.useState(value);
|
|
4363
|
+
React87__default.useEffect(() => {
|
|
4361
4364
|
if (value !== void 0) setSelected(value);
|
|
4362
4365
|
}, [value]);
|
|
4363
4366
|
const pick = (next, e) => {
|
|
@@ -4539,7 +4542,7 @@ var init_Switch = __esm({
|
|
|
4539
4542
|
"components/core/atoms/Switch.tsx"() {
|
|
4540
4543
|
"use client";
|
|
4541
4544
|
init_cn();
|
|
4542
|
-
Switch =
|
|
4545
|
+
Switch = React87.forwardRef(
|
|
4543
4546
|
({
|
|
4544
4547
|
checked,
|
|
4545
4548
|
defaultChecked = false,
|
|
@@ -4550,10 +4553,10 @@ var init_Switch = __esm({
|
|
|
4550
4553
|
name,
|
|
4551
4554
|
className
|
|
4552
4555
|
}, ref) => {
|
|
4553
|
-
const [isChecked, setIsChecked] =
|
|
4556
|
+
const [isChecked, setIsChecked] = React87.useState(
|
|
4554
4557
|
checked !== void 0 ? checked : defaultChecked
|
|
4555
4558
|
);
|
|
4556
|
-
|
|
4559
|
+
React87.useEffect(() => {
|
|
4557
4560
|
if (checked !== void 0) {
|
|
4558
4561
|
setIsChecked(checked);
|
|
4559
4562
|
}
|
|
@@ -4909,7 +4912,7 @@ var Aside;
|
|
|
4909
4912
|
var init_Aside = __esm({
|
|
4910
4913
|
"components/core/atoms/Aside.tsx"() {
|
|
4911
4914
|
init_cn();
|
|
4912
|
-
Aside =
|
|
4915
|
+
Aside = React87__default.forwardRef(
|
|
4913
4916
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4914
4917
|
);
|
|
4915
4918
|
Aside.displayName = "Aside";
|
|
@@ -4987,8 +4990,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4987
4990
|
className
|
|
4988
4991
|
}) => {
|
|
4989
4992
|
const { t } = useTranslate();
|
|
4990
|
-
const [isVisible, setIsVisible] =
|
|
4991
|
-
const timeoutRef =
|
|
4993
|
+
const [isVisible, setIsVisible] = React87__default.useState(false);
|
|
4994
|
+
const timeoutRef = React87__default.useRef(null);
|
|
4992
4995
|
const handleMouseEnter = () => {
|
|
4993
4996
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4994
4997
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4997,7 +5000,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4997
5000
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4998
5001
|
setIsVisible(false);
|
|
4999
5002
|
};
|
|
5000
|
-
|
|
5003
|
+
React87__default.useEffect(() => {
|
|
5001
5004
|
return () => {
|
|
5002
5005
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5003
5006
|
};
|
|
@@ -5207,7 +5210,7 @@ var init_StatusDot = __esm({
|
|
|
5207
5210
|
md: "w-2.5 h-2.5",
|
|
5208
5211
|
lg: "w-3 h-3"
|
|
5209
5212
|
};
|
|
5210
|
-
StatusDot =
|
|
5213
|
+
StatusDot = React87__default.forwardRef(
|
|
5211
5214
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5212
5215
|
return /* @__PURE__ */ jsx(
|
|
5213
5216
|
"span",
|
|
@@ -5261,7 +5264,7 @@ var init_TrendIndicator = __esm({
|
|
|
5261
5264
|
down: "trending-down",
|
|
5262
5265
|
flat: "arrow-right"
|
|
5263
5266
|
};
|
|
5264
|
-
TrendIndicator =
|
|
5267
|
+
TrendIndicator = React87__default.forwardRef(
|
|
5265
5268
|
({
|
|
5266
5269
|
className,
|
|
5267
5270
|
value,
|
|
@@ -5328,7 +5331,7 @@ var init_RangeSlider = __esm({
|
|
|
5328
5331
|
md: "w-4 h-4",
|
|
5329
5332
|
lg: "w-5 h-5"
|
|
5330
5333
|
};
|
|
5331
|
-
RangeSlider =
|
|
5334
|
+
RangeSlider = React87__default.forwardRef(
|
|
5332
5335
|
({
|
|
5333
5336
|
className,
|
|
5334
5337
|
min = 0,
|
|
@@ -5836,7 +5839,7 @@ var init_ContentSection = __esm({
|
|
|
5836
5839
|
md: "py-16",
|
|
5837
5840
|
lg: "py-24"
|
|
5838
5841
|
};
|
|
5839
|
-
ContentSection =
|
|
5842
|
+
ContentSection = React87__default.forwardRef(
|
|
5840
5843
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5841
5844
|
return /* @__PURE__ */ jsx(
|
|
5842
5845
|
Box,
|
|
@@ -6370,7 +6373,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6370
6373
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6371
6374
|
"none": {}
|
|
6372
6375
|
};
|
|
6373
|
-
AnimatedReveal =
|
|
6376
|
+
AnimatedReveal = React87__default.forwardRef(
|
|
6374
6377
|
({
|
|
6375
6378
|
trigger = "scroll",
|
|
6376
6379
|
animation = "fade-up",
|
|
@@ -6530,7 +6533,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6530
6533
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6531
6534
|
"use client";
|
|
6532
6535
|
init_cn();
|
|
6533
|
-
AnimatedGraphic =
|
|
6536
|
+
AnimatedGraphic = React87__default.forwardRef(
|
|
6534
6537
|
({
|
|
6535
6538
|
src,
|
|
6536
6539
|
svgContent,
|
|
@@ -6553,7 +6556,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6553
6556
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6554
6557
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6555
6558
|
const prevAnimateRef = useRef(animate);
|
|
6556
|
-
const setRef =
|
|
6559
|
+
const setRef = React87__default.useCallback(
|
|
6557
6560
|
(node) => {
|
|
6558
6561
|
containerRef.current = node;
|
|
6559
6562
|
if (typeof ref === "function") ref(node);
|
|
@@ -6778,9 +6781,9 @@ function ScoreDisplay({
|
|
|
6778
6781
|
...rest
|
|
6779
6782
|
}) {
|
|
6780
6783
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
6781
|
-
const [displayValue, setDisplayValue] =
|
|
6782
|
-
const [isAnimating, setIsAnimating] =
|
|
6783
|
-
|
|
6784
|
+
const [displayValue, setDisplayValue] = React87.useState(resolvedValue);
|
|
6785
|
+
const [isAnimating, setIsAnimating] = React87.useState(false);
|
|
6786
|
+
React87.useEffect(() => {
|
|
6784
6787
|
if (!animated || displayValue === resolvedValue) {
|
|
6785
6788
|
setDisplayValue(resolvedValue);
|
|
6786
6789
|
return;
|
|
@@ -6850,9 +6853,9 @@ function ControlButton({
|
|
|
6850
6853
|
className
|
|
6851
6854
|
}) {
|
|
6852
6855
|
const eventBus = useEventBus();
|
|
6853
|
-
const [isPressed, setIsPressed] =
|
|
6856
|
+
const [isPressed, setIsPressed] = React87.useState(false);
|
|
6854
6857
|
const actualPressed = pressed ?? isPressed;
|
|
6855
|
-
const handlePointerDown =
|
|
6858
|
+
const handlePointerDown = React87.useCallback(
|
|
6856
6859
|
(e) => {
|
|
6857
6860
|
e.preventDefault();
|
|
6858
6861
|
if (disabled) return;
|
|
@@ -6862,7 +6865,7 @@ function ControlButton({
|
|
|
6862
6865
|
},
|
|
6863
6866
|
[disabled, pressEvent, eventBus, onPress]
|
|
6864
6867
|
);
|
|
6865
|
-
const handlePointerUp =
|
|
6868
|
+
const handlePointerUp = React87.useCallback(
|
|
6866
6869
|
(e) => {
|
|
6867
6870
|
e.preventDefault();
|
|
6868
6871
|
if (disabled) return;
|
|
@@ -6872,7 +6875,7 @@ function ControlButton({
|
|
|
6872
6875
|
},
|
|
6873
6876
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
6874
6877
|
);
|
|
6875
|
-
const handlePointerLeave =
|
|
6878
|
+
const handlePointerLeave = React87.useCallback(
|
|
6876
6879
|
(e) => {
|
|
6877
6880
|
if (isPressed) {
|
|
6878
6881
|
setIsPressed(false);
|
|
@@ -7361,13 +7364,22 @@ function XPBar({
|
|
|
7361
7364
|
}) {
|
|
7362
7365
|
const sizes = sizeMap9[size];
|
|
7363
7366
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7367
|
+
const [fillWidth, setFillWidth] = React87.useState(animated ? 0 : percentage);
|
|
7368
|
+
React87.useEffect(() => {
|
|
7369
|
+
if (!animated) {
|
|
7370
|
+
setFillWidth(percentage);
|
|
7371
|
+
return;
|
|
7372
|
+
}
|
|
7373
|
+
const frame = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7374
|
+
return () => cancelAnimationFrame(frame);
|
|
7375
|
+
}, [animated, percentage]);
|
|
7364
7376
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7365
7377
|
level != null && /* @__PURE__ */ jsxs(
|
|
7366
7378
|
"span",
|
|
7367
7379
|
{
|
|
7368
7380
|
className: cn(
|
|
7369
7381
|
"flex-shrink-0 rounded-interactive font-bold",
|
|
7370
|
-
"bg-accent text-foreground border border-accent",
|
|
7382
|
+
"bg-accent text-accent-foreground border border-accent",
|
|
7371
7383
|
sizes.badge
|
|
7372
7384
|
),
|
|
7373
7385
|
children: [
|
|
@@ -7392,7 +7404,7 @@ function XPBar({
|
|
|
7392
7404
|
"bg-gradient-to-r from-accent to-info",
|
|
7393
7405
|
animated && "transition-all duration-500 ease-out"
|
|
7394
7406
|
),
|
|
7395
|
-
style: { width: `${
|
|
7407
|
+
style: { width: `${fillWidth}%` }
|
|
7396
7408
|
}
|
|
7397
7409
|
)
|
|
7398
7410
|
}
|
|
@@ -7409,6 +7421,7 @@ function XPBar({
|
|
|
7409
7421
|
var sizeMap9;
|
|
7410
7422
|
var init_XPBar = __esm({
|
|
7411
7423
|
"components/game/atoms/XPBar.tsx"() {
|
|
7424
|
+
"use client";
|
|
7412
7425
|
init_cn();
|
|
7413
7426
|
sizeMap9 = {
|
|
7414
7427
|
sm: { bar: "h-2", text: "text-xs", badge: "text-xs px-1.5 py-0.5" },
|
|
@@ -7778,9 +7791,9 @@ function MiniMap({
|
|
|
7778
7791
|
viewportRect,
|
|
7779
7792
|
className
|
|
7780
7793
|
}) {
|
|
7781
|
-
const canvasRef =
|
|
7782
|
-
const frameRef =
|
|
7783
|
-
|
|
7794
|
+
const canvasRef = React87.useRef(null);
|
|
7795
|
+
const frameRef = React87.useRef(0);
|
|
7796
|
+
React87.useEffect(() => {
|
|
7784
7797
|
const canvas = canvasRef.current;
|
|
7785
7798
|
if (!canvas) return;
|
|
7786
7799
|
const ctx = canvas.getContext("2d");
|
|
@@ -7954,7 +7967,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7954
7967
|
}
|
|
7955
7968
|
);
|
|
7956
7969
|
};
|
|
7957
|
-
ErrorBoundary = class extends
|
|
7970
|
+
ErrorBoundary = class extends React87__default.Component {
|
|
7958
7971
|
constructor(props) {
|
|
7959
7972
|
super(props);
|
|
7960
7973
|
__publicField(this, "reset", () => {
|
|
@@ -9310,18 +9323,42 @@ var init_Alert = __esm({
|
|
|
9310
9323
|
Alert.displayName = "Alert";
|
|
9311
9324
|
}
|
|
9312
9325
|
});
|
|
9313
|
-
|
|
9326
|
+
function computeTooltipStyle(position, triggerRect) {
|
|
9327
|
+
switch (position) {
|
|
9328
|
+
case "bottom":
|
|
9329
|
+
return {
|
|
9330
|
+
left: triggerRect.left + triggerRect.width / 2,
|
|
9331
|
+
top: triggerRect.bottom + TRIGGER_GAP,
|
|
9332
|
+
transform: "translateX(-50%)"
|
|
9333
|
+
};
|
|
9334
|
+
case "left":
|
|
9335
|
+
return {
|
|
9336
|
+
left: triggerRect.left - TRIGGER_GAP,
|
|
9337
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
9338
|
+
transform: "translate(-100%, -50%)"
|
|
9339
|
+
};
|
|
9340
|
+
case "right":
|
|
9341
|
+
return {
|
|
9342
|
+
left: triggerRect.right + TRIGGER_GAP,
|
|
9343
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
9344
|
+
transform: "translateY(-50%)"
|
|
9345
|
+
};
|
|
9346
|
+
case "top":
|
|
9347
|
+
default:
|
|
9348
|
+
return {
|
|
9349
|
+
left: triggerRect.left + triggerRect.width / 2,
|
|
9350
|
+
top: triggerRect.top - TRIGGER_GAP,
|
|
9351
|
+
transform: "translate(-50%, -100%)"
|
|
9352
|
+
};
|
|
9353
|
+
}
|
|
9354
|
+
}
|
|
9355
|
+
var TRIGGER_GAP, arrowClasses, Tooltip;
|
|
9314
9356
|
var init_Tooltip = __esm({
|
|
9315
9357
|
"components/core/molecules/Tooltip.tsx"() {
|
|
9316
9358
|
"use client";
|
|
9317
9359
|
init_Typography();
|
|
9318
9360
|
init_cn();
|
|
9319
|
-
|
|
9320
|
-
top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
|
|
9321
|
-
bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
|
|
9322
|
-
left: "right-full top-1/2 -translate-y-1/2 mr-2",
|
|
9323
|
-
right: "left-full top-1/2 -translate-y-1/2 ml-2"
|
|
9324
|
-
};
|
|
9361
|
+
TRIGGER_GAP = 8;
|
|
9325
9362
|
arrowClasses = {
|
|
9326
9363
|
top: "top-full left-1/2 -translate-x-1/2 border-t-primary border-l-transparent border-r-transparent border-b-transparent",
|
|
9327
9364
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-primary border-l-transparent border-r-transparent border-t-transparent",
|
|
@@ -9376,8 +9413,8 @@ var init_Tooltip = __esm({
|
|
|
9376
9413
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
9377
9414
|
};
|
|
9378
9415
|
}, []);
|
|
9379
|
-
const triggerElement =
|
|
9380
|
-
const trigger =
|
|
9416
|
+
const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9417
|
+
const trigger = React87__default.cloneElement(triggerElement, {
|
|
9381
9418
|
ref: triggerRef,
|
|
9382
9419
|
onMouseEnter: handleMouseEnter,
|
|
9383
9420
|
onMouseLeave: handleMouseLeave,
|
|
@@ -9395,14 +9432,9 @@ var init_Tooltip = __esm({
|
|
|
9395
9432
|
"text-sm pointer-events-none",
|
|
9396
9433
|
"break-words whitespace-normal",
|
|
9397
9434
|
"h-auto min-h-fit",
|
|
9398
|
-
positionClasses[position],
|
|
9399
9435
|
className
|
|
9400
9436
|
),
|
|
9401
|
-
style:
|
|
9402
|
-
left: position === "left" || position === "right" ? triggerRect.left + (position === "left" ? 0 : triggerRect.width) : triggerRect.left + triggerRect.width / 2,
|
|
9403
|
-
top: position === "top" || position === "bottom" ? triggerRect.top + (position === "top" ? 0 : triggerRect.height) : triggerRect.top + triggerRect.height / 2,
|
|
9404
|
-
transform: position === "top" || position === "bottom" ? "translateX(-50%)" : position === "left" || position === "right" ? "translateY(-50%)" : "none"
|
|
9405
|
-
},
|
|
9437
|
+
style: computeTooltipStyle(position, triggerRect),
|
|
9406
9438
|
role: "tooltip",
|
|
9407
9439
|
children: [
|
|
9408
9440
|
/* @__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 }) }),
|
|
@@ -9429,8 +9461,9 @@ var init_Tooltip = __esm({
|
|
|
9429
9461
|
function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
9430
9462
|
if (position === "left" || position === "right") {
|
|
9431
9463
|
return {
|
|
9432
|
-
left:
|
|
9433
|
-
top: triggerRect.top + triggerRect.height / 2
|
|
9464
|
+
left: position === "left" ? triggerRect.left - popoverWidth - TRIGGER_GAP2 : triggerRect.right + TRIGGER_GAP2,
|
|
9465
|
+
top: triggerRect.top + triggerRect.height / 2,
|
|
9466
|
+
transform: "translateY(-50%)"
|
|
9434
9467
|
};
|
|
9435
9468
|
}
|
|
9436
9469
|
const viewportWidth = typeof window !== "undefined" ? window.innerWidth : 1024;
|
|
@@ -9442,21 +9475,16 @@ function computePopoverStyle(position, triggerRect, popoverWidth) {
|
|
|
9442
9475
|
);
|
|
9443
9476
|
return {
|
|
9444
9477
|
left: clamped,
|
|
9445
|
-
top:
|
|
9478
|
+
top: position === "top" ? triggerRect.top - TRIGGER_GAP2 : triggerRect.bottom + TRIGGER_GAP2,
|
|
9479
|
+
transform: position === "top" ? "translateY(-100%)" : void 0
|
|
9446
9480
|
};
|
|
9447
9481
|
}
|
|
9448
|
-
var
|
|
9482
|
+
var arrowClasses2, VIEWPORT_EDGE_PADDING, TRIGGER_GAP2, Popover;
|
|
9449
9483
|
var init_Popover = __esm({
|
|
9450
9484
|
"components/core/molecules/Popover.tsx"() {
|
|
9451
9485
|
"use client";
|
|
9452
9486
|
init_Typography();
|
|
9453
9487
|
init_cn();
|
|
9454
|
-
positionClasses2 = {
|
|
9455
|
-
top: "mb-2",
|
|
9456
|
-
bottom: "mt-2",
|
|
9457
|
-
left: "mr-2 -translate-y-1/2",
|
|
9458
|
-
right: "ml-2 -translate-y-1/2"
|
|
9459
|
-
};
|
|
9460
9488
|
arrowClasses2 = {
|
|
9461
9489
|
top: "top-full left-1/2 -translate-x-1/2 border-t-white border-l-transparent border-r-transparent border-b-transparent",
|
|
9462
9490
|
bottom: "bottom-full left-1/2 -translate-x-1/2 border-b-white border-l-transparent border-r-transparent border-t-transparent",
|
|
@@ -9464,6 +9492,7 @@ var init_Popover = __esm({
|
|
|
9464
9492
|
right: "right-full top-1/2 -translate-y-1/2 border-r-white border-t-transparent border-b-transparent border-l-transparent"
|
|
9465
9493
|
};
|
|
9466
9494
|
VIEWPORT_EDGE_PADDING = 8;
|
|
9495
|
+
TRIGGER_GAP2 = 8;
|
|
9467
9496
|
Popover = ({
|
|
9468
9497
|
content,
|
|
9469
9498
|
children,
|
|
@@ -9532,8 +9561,8 @@ var init_Popover = __esm({
|
|
|
9532
9561
|
onMouseEnter: handleOpen,
|
|
9533
9562
|
onMouseLeave: handleClose
|
|
9534
9563
|
};
|
|
9535
|
-
const childElement =
|
|
9536
|
-
const triggerElement =
|
|
9564
|
+
const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9565
|
+
const triggerElement = React87__default.cloneElement(
|
|
9537
9566
|
childElement,
|
|
9538
9567
|
{
|
|
9539
9568
|
ref: triggerRef,
|
|
@@ -9547,7 +9576,6 @@ var init_Popover = __esm({
|
|
|
9547
9576
|
className: cn(
|
|
9548
9577
|
"fixed z-50 p-4",
|
|
9549
9578
|
"bg-card border-2 border-border shadow-elevation-popover",
|
|
9550
|
-
positionClasses2[position],
|
|
9551
9579
|
className
|
|
9552
9580
|
),
|
|
9553
9581
|
style: computePopoverStyle(position, triggerRect, popoverWidth),
|
|
@@ -9637,7 +9665,7 @@ var init_Menu = __esm({
|
|
|
9637
9665
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9638
9666
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9639
9667
|
}, [isOpen]);
|
|
9640
|
-
const
|
|
9668
|
+
const positionClasses = {
|
|
9641
9669
|
"top-left": "bottom-full left-0 mb-2",
|
|
9642
9670
|
"top-right": "bottom-full right-0 mb-2",
|
|
9643
9671
|
"bottom-left": "top-full left-0 mt-2",
|
|
@@ -9660,8 +9688,8 @@ var init_Menu = __esm({
|
|
|
9660
9688
|
};
|
|
9661
9689
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9662
9690
|
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9663
|
-
const triggerChild =
|
|
9664
|
-
const triggerElement =
|
|
9691
|
+
const triggerChild = React87__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9692
|
+
const triggerElement = React87__default.cloneElement(
|
|
9665
9693
|
triggerChild,
|
|
9666
9694
|
{
|
|
9667
9695
|
ref: triggerRef,
|
|
@@ -9745,7 +9773,7 @@ var init_Menu = __esm({
|
|
|
9745
9773
|
className: cn(
|
|
9746
9774
|
"absolute z-50",
|
|
9747
9775
|
menuContainerStyles,
|
|
9748
|
-
|
|
9776
|
+
positionClasses[effectivePosition],
|
|
9749
9777
|
className
|
|
9750
9778
|
),
|
|
9751
9779
|
style: {
|
|
@@ -9921,7 +9949,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9921
9949
|
document.addEventListener("mousedown", handleClickOutside);
|
|
9922
9950
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
9923
9951
|
}, [isExpanded, actions]);
|
|
9924
|
-
const
|
|
9952
|
+
const positionClasses = {
|
|
9925
9953
|
"bottom-right": "bottom-6 right-6",
|
|
9926
9954
|
"bottom-left": "bottom-6 left-6",
|
|
9927
9955
|
"bottom-center": "bottom-6 left-1/2 -translate-x-1/2",
|
|
@@ -9930,7 +9958,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9930
9958
|
"top-center": "top-6 left-1/2 -translate-x-1/2"
|
|
9931
9959
|
};
|
|
9932
9960
|
if (resolvedAction && (!actions || actions.length === 0)) {
|
|
9933
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50",
|
|
9961
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("fixed z-50", positionClasses[position], className), children: /* @__PURE__ */ jsx(
|
|
9934
9962
|
Button,
|
|
9935
9963
|
{
|
|
9936
9964
|
variant: resolvedAction.variant || "primary",
|
|
@@ -9958,7 +9986,7 @@ var init_FloatingActionButton = __esm({
|
|
|
9958
9986
|
ref: fabRef,
|
|
9959
9987
|
className: cn(
|
|
9960
9988
|
"fixed z-50 flex flex-col items-end gap-3",
|
|
9961
|
-
|
|
9989
|
+
positionClasses[position],
|
|
9962
9990
|
position.includes("left") && "items-start",
|
|
9963
9991
|
className
|
|
9964
9992
|
),
|
|
@@ -10068,13 +10096,13 @@ var init_MapView = __esm({
|
|
|
10068
10096
|
shadowSize: [41, 41]
|
|
10069
10097
|
});
|
|
10070
10098
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
10071
|
-
const { useEffect:
|
|
10099
|
+
const { useEffect: useEffect71, useRef: useRef66, useCallback: useCallback114, useState: useState101 } = React87__default;
|
|
10072
10100
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
10073
10101
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
10074
10102
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
10075
10103
|
const map = useMap();
|
|
10076
10104
|
const prevRef = useRef66({ centerLat, centerLng, zoom });
|
|
10077
|
-
|
|
10105
|
+
useEffect71(() => {
|
|
10078
10106
|
const prev = prevRef.current;
|
|
10079
10107
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
10080
10108
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -10085,7 +10113,7 @@ var init_MapView = __esm({
|
|
|
10085
10113
|
}
|
|
10086
10114
|
function MapClickHandler({ onMapClick }) {
|
|
10087
10115
|
const map = useMap();
|
|
10088
|
-
|
|
10116
|
+
useEffect71(() => {
|
|
10089
10117
|
if (!onMapClick) return;
|
|
10090
10118
|
const handler = (e) => {
|
|
10091
10119
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -10113,7 +10141,7 @@ var init_MapView = __esm({
|
|
|
10113
10141
|
showAttribution = true
|
|
10114
10142
|
}) {
|
|
10115
10143
|
const eventBus = useEventBus2();
|
|
10116
|
-
const [clickedPosition, setClickedPosition] =
|
|
10144
|
+
const [clickedPosition, setClickedPosition] = useState101(null);
|
|
10117
10145
|
const handleMapClick = useCallback114((lat, lng) => {
|
|
10118
10146
|
if (showClickedPin) {
|
|
10119
10147
|
setClickedPosition({ lat, lng });
|
|
@@ -10132,7 +10160,7 @@ var init_MapView = __esm({
|
|
|
10132
10160
|
return /* @__PURE__ */ jsx(
|
|
10133
10161
|
Box,
|
|
10134
10162
|
{
|
|
10135
|
-
className: cn("relative w-full overflow-hidden rounded-lg", className),
|
|
10163
|
+
className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
|
|
10136
10164
|
style: { height },
|
|
10137
10165
|
"data-testid": "map-view",
|
|
10138
10166
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -10314,7 +10342,7 @@ function InputPattern({
|
|
|
10314
10342
|
fieldName
|
|
10315
10343
|
}) {
|
|
10316
10344
|
const { emit } = useEventBus();
|
|
10317
|
-
const [localValue, setLocalValue] =
|
|
10345
|
+
const [localValue, setLocalValue] = React87__default.useState(value);
|
|
10318
10346
|
const handleChange = (e) => {
|
|
10319
10347
|
setLocalValue(e.target.value);
|
|
10320
10348
|
if (onChange) {
|
|
@@ -10352,7 +10380,7 @@ function TextareaPattern({
|
|
|
10352
10380
|
fieldName
|
|
10353
10381
|
}) {
|
|
10354
10382
|
const { emit } = useEventBus();
|
|
10355
|
-
const [localValue, setLocalValue] =
|
|
10383
|
+
const [localValue, setLocalValue] = React87__default.useState(value);
|
|
10356
10384
|
const handleChange = (e) => {
|
|
10357
10385
|
setLocalValue(e.target.value);
|
|
10358
10386
|
if (onChange) {
|
|
@@ -10384,7 +10412,7 @@ function SelectPattern({
|
|
|
10384
10412
|
fieldName
|
|
10385
10413
|
}) {
|
|
10386
10414
|
const { emit } = useEventBus();
|
|
10387
|
-
const [localValue, setLocalValue] =
|
|
10415
|
+
const [localValue, setLocalValue] = React87__default.useState(value);
|
|
10388
10416
|
const handleChange = (e) => {
|
|
10389
10417
|
setLocalValue(e.target.value);
|
|
10390
10418
|
if (onChange) {
|
|
@@ -10413,7 +10441,7 @@ function CheckboxPattern({
|
|
|
10413
10441
|
className
|
|
10414
10442
|
}) {
|
|
10415
10443
|
const { emit } = useEventBus();
|
|
10416
|
-
const [localChecked, setLocalChecked] =
|
|
10444
|
+
const [localChecked, setLocalChecked] = React87__default.useState(checked);
|
|
10417
10445
|
const handleChange = (e) => {
|
|
10418
10446
|
setLocalChecked(e.target.checked);
|
|
10419
10447
|
if (onChange) {
|
|
@@ -10644,8 +10672,8 @@ function ActionButtons({
|
|
|
10644
10672
|
disabled
|
|
10645
10673
|
}) {
|
|
10646
10674
|
const eventBus = useEventBus();
|
|
10647
|
-
const [activeButtons, setActiveButtons] =
|
|
10648
|
-
const handlePress =
|
|
10675
|
+
const [activeButtons, setActiveButtons] = React87.useState(/* @__PURE__ */ new Set());
|
|
10676
|
+
const handlePress = React87.useCallback(
|
|
10649
10677
|
(id) => {
|
|
10650
10678
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
10651
10679
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10653,7 +10681,7 @@ function ActionButtons({
|
|
|
10653
10681
|
},
|
|
10654
10682
|
[actionEvent, eventBus, onAction]
|
|
10655
10683
|
);
|
|
10656
|
-
const handleRelease =
|
|
10684
|
+
const handleRelease = React87.useCallback(
|
|
10657
10685
|
(id) => {
|
|
10658
10686
|
setActiveButtons((prev) => {
|
|
10659
10687
|
const next = new Set(prev);
|
|
@@ -13668,7 +13696,10 @@ function computeFoldRegions(code) {
|
|
|
13668
13696
|
}
|
|
13669
13697
|
return regions.sort((a, b) => a.start - b.start);
|
|
13670
13698
|
}
|
|
13671
|
-
|
|
13699
|
+
function toCodeLanguage(value) {
|
|
13700
|
+
return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
|
|
13701
|
+
}
|
|
13702
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log8, CODE_LANGUAGES, CODE_LANGUAGE_SET, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13672
13703
|
var init_CodeBlock = __esm({
|
|
13673
13704
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13674
13705
|
init_Box();
|
|
@@ -13746,9 +13777,40 @@ var init_CodeBlock = __esm({
|
|
|
13746
13777
|
};
|
|
13747
13778
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
13748
13779
|
log8 = createLogger("almadar:ui:markdown-code");
|
|
13780
|
+
CODE_LANGUAGES = [
|
|
13781
|
+
"text",
|
|
13782
|
+
"json",
|
|
13783
|
+
"javascript",
|
|
13784
|
+
"js",
|
|
13785
|
+
"typescript",
|
|
13786
|
+
"ts",
|
|
13787
|
+
"jsx",
|
|
13788
|
+
"tsx",
|
|
13789
|
+
"css",
|
|
13790
|
+
"markdown",
|
|
13791
|
+
"md",
|
|
13792
|
+
"bash",
|
|
13793
|
+
"shell",
|
|
13794
|
+
"sh",
|
|
13795
|
+
"yaml",
|
|
13796
|
+
"yml",
|
|
13797
|
+
"rust",
|
|
13798
|
+
"python",
|
|
13799
|
+
"py",
|
|
13800
|
+
"sql",
|
|
13801
|
+
"diff",
|
|
13802
|
+
"toml",
|
|
13803
|
+
"go",
|
|
13804
|
+
"graphql",
|
|
13805
|
+
"html",
|
|
13806
|
+
"xml",
|
|
13807
|
+
"orb",
|
|
13808
|
+
"lolo"
|
|
13809
|
+
];
|
|
13810
|
+
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
13749
13811
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13750
13812
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13751
|
-
CodeBlock =
|
|
13813
|
+
CodeBlock = React87__default.memo(
|
|
13752
13814
|
({
|
|
13753
13815
|
code: rawCode,
|
|
13754
13816
|
language = "text",
|
|
@@ -14185,7 +14247,7 @@ var init_MarkdownContent = __esm({
|
|
|
14185
14247
|
init_Box();
|
|
14186
14248
|
init_CodeBlock();
|
|
14187
14249
|
init_cn();
|
|
14188
|
-
MarkdownContent =
|
|
14250
|
+
MarkdownContent = React87__default.memo(
|
|
14189
14251
|
({ content, direction, className }) => {
|
|
14190
14252
|
const { t: _t } = useTranslate();
|
|
14191
14253
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -14235,7 +14297,7 @@ var init_MarkdownContent = __esm({
|
|
|
14235
14297
|
CodeBlock,
|
|
14236
14298
|
{
|
|
14237
14299
|
code,
|
|
14238
|
-
language: match[1],
|
|
14300
|
+
language: toCodeLanguage(match[1]),
|
|
14239
14301
|
maxHeight: "60vh"
|
|
14240
14302
|
}
|
|
14241
14303
|
);
|
|
@@ -15281,7 +15343,7 @@ var init_StateMachineView = __esm({
|
|
|
15281
15343
|
style: { top: title ? 30 : 0 },
|
|
15282
15344
|
children: [
|
|
15283
15345
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15284
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15346
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15285
15347
|
StateNode,
|
|
15286
15348
|
{
|
|
15287
15349
|
state,
|
|
@@ -16094,7 +16156,7 @@ var init_ContentRenderer = __esm({
|
|
|
16094
16156
|
CodeBlock,
|
|
16095
16157
|
{
|
|
16096
16158
|
code: segment.content,
|
|
16097
|
-
language: segment.language
|
|
16159
|
+
language: toCodeLanguage(segment.language)
|
|
16098
16160
|
},
|
|
16099
16161
|
key
|
|
16100
16162
|
);
|
|
@@ -16119,7 +16181,7 @@ var init_ContentRenderer = __esm({
|
|
|
16119
16181
|
CodeBlock,
|
|
16120
16182
|
{
|
|
16121
16183
|
code: segment.content,
|
|
16122
|
-
language: segment.language
|
|
16184
|
+
language: toCodeLanguage(segment.language)
|
|
16123
16185
|
}
|
|
16124
16186
|
),
|
|
16125
16187
|
/* @__PURE__ */ jsx(ScaledDiagram, { children: /* @__PURE__ */ jsx(
|
|
@@ -16886,7 +16948,7 @@ var init_Grid = __esm({
|
|
|
16886
16948
|
as: Component = "div"
|
|
16887
16949
|
}) => {
|
|
16888
16950
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
16889
|
-
return
|
|
16951
|
+
return React87__default.createElement(
|
|
16890
16952
|
Component,
|
|
16891
16953
|
{
|
|
16892
16954
|
className: cn(
|
|
@@ -22246,7 +22308,7 @@ function CraftingRecipe({
|
|
|
22246
22308
|
className
|
|
22247
22309
|
}) {
|
|
22248
22310
|
const eventBus = useEventBus();
|
|
22249
|
-
const handleCraft =
|
|
22311
|
+
const handleCraft = React87.useCallback(() => {
|
|
22250
22312
|
onCraft?.();
|
|
22251
22313
|
if (craftEvent) {
|
|
22252
22314
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -22263,7 +22325,7 @@ function CraftingRecipe({
|
|
|
22263
22325
|
children: [
|
|
22264
22326
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
22265
22327
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
22266
|
-
return /* @__PURE__ */ jsxs(
|
|
22328
|
+
return /* @__PURE__ */ jsxs(React87.Fragment, { children: [
|
|
22267
22329
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
22268
22330
|
ItemSlot,
|
|
22269
22331
|
{
|
|
@@ -22326,8 +22388,8 @@ function DPad({
|
|
|
22326
22388
|
}) {
|
|
22327
22389
|
const eventBus = useEventBus();
|
|
22328
22390
|
const sizes = sizeMap15[size];
|
|
22329
|
-
const [activeDirections, setActiveDirections] =
|
|
22330
|
-
const handlePress =
|
|
22391
|
+
const [activeDirections, setActiveDirections] = React87.useState(/* @__PURE__ */ new Set());
|
|
22392
|
+
const handlePress = React87.useCallback(
|
|
22331
22393
|
(direction) => {
|
|
22332
22394
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
22333
22395
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -22335,7 +22397,7 @@ function DPad({
|
|
|
22335
22397
|
},
|
|
22336
22398
|
[directionEvent, eventBus, onDirection]
|
|
22337
22399
|
);
|
|
22338
|
-
const handleRelease =
|
|
22400
|
+
const handleRelease = React87.useCallback(
|
|
22339
22401
|
(direction) => {
|
|
22340
22402
|
setActiveDirections((prev) => {
|
|
22341
22403
|
const next = new Set(prev);
|
|
@@ -23021,14 +23083,14 @@ function useDataDnd(args) {
|
|
|
23021
23083
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23022
23084
|
const enabled = isZone || Boolean(dndRoot);
|
|
23023
23085
|
const eventBus = useEventBus();
|
|
23024
|
-
const parentRoot =
|
|
23086
|
+
const parentRoot = React87__default.useContext(RootCtx);
|
|
23025
23087
|
const isRoot = enabled && parentRoot === null;
|
|
23026
|
-
const zoneId =
|
|
23088
|
+
const zoneId = React87__default.useId();
|
|
23027
23089
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23028
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23029
|
-
const optimisticOrdersRef =
|
|
23090
|
+
const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
|
|
23091
|
+
const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
|
|
23030
23092
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23031
|
-
const clearOptimisticOrder =
|
|
23093
|
+
const clearOptimisticOrder = React87__default.useCallback((group) => {
|
|
23032
23094
|
setOptimisticOrders((prev) => {
|
|
23033
23095
|
if (!prev.has(group)) return prev;
|
|
23034
23096
|
const next = new Map(prev);
|
|
@@ -23053,7 +23115,7 @@ function useDataDnd(args) {
|
|
|
23053
23115
|
const raw = it[dndItemIdField];
|
|
23054
23116
|
return String(raw ?? `__idx_${idx}`);
|
|
23055
23117
|
}).join("|");
|
|
23056
|
-
const itemIds =
|
|
23118
|
+
const itemIds = React87__default.useMemo(
|
|
23057
23119
|
() => orderedItems.map((it, idx) => {
|
|
23058
23120
|
const raw = it[dndItemIdField];
|
|
23059
23121
|
return raw ?? `__idx_${idx}`;
|
|
@@ -23061,7 +23123,7 @@ function useDataDnd(args) {
|
|
|
23061
23123
|
[itemIdsSignature]
|
|
23062
23124
|
);
|
|
23063
23125
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
23064
|
-
|
|
23126
|
+
React87__default.useEffect(() => {
|
|
23065
23127
|
const root = isRoot ? null : parentRoot;
|
|
23066
23128
|
if (root) {
|
|
23067
23129
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23069,20 +23131,20 @@ function useDataDnd(args) {
|
|
|
23069
23131
|
clearOptimisticOrder(ownGroup);
|
|
23070
23132
|
}
|
|
23071
23133
|
}, [itemsContentSig, ownGroup]);
|
|
23072
|
-
const zonesRef =
|
|
23073
|
-
const registerZone =
|
|
23134
|
+
const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
|
|
23135
|
+
const registerZone = React87__default.useCallback((zoneId2, meta2) => {
|
|
23074
23136
|
zonesRef.current.set(zoneId2, meta2);
|
|
23075
23137
|
}, []);
|
|
23076
|
-
const unregisterZone =
|
|
23138
|
+
const unregisterZone = React87__default.useCallback((zoneId2) => {
|
|
23077
23139
|
zonesRef.current.delete(zoneId2);
|
|
23078
23140
|
}, []);
|
|
23079
|
-
const [activeDrag, setActiveDrag] =
|
|
23080
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23081
|
-
const meta =
|
|
23141
|
+
const [activeDrag, setActiveDrag] = React87__default.useState(null);
|
|
23142
|
+
const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
|
|
23143
|
+
const meta = React87__default.useMemo(
|
|
23082
23144
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23083
23145
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23084
23146
|
);
|
|
23085
|
-
|
|
23147
|
+
React87__default.useEffect(() => {
|
|
23086
23148
|
const target = isRoot ? null : parentRoot;
|
|
23087
23149
|
if (!target) {
|
|
23088
23150
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23101,7 +23163,7 @@ function useDataDnd(args) {
|
|
|
23101
23163
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23102
23164
|
const sensors = useAlmadarDndSensors(true);
|
|
23103
23165
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23104
|
-
const findZoneByItem =
|
|
23166
|
+
const findZoneByItem = React87__default.useCallback(
|
|
23105
23167
|
(id) => {
|
|
23106
23168
|
for (const z of zonesRef.current.values()) {
|
|
23107
23169
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23110,7 +23172,7 @@ function useDataDnd(args) {
|
|
|
23110
23172
|
},
|
|
23111
23173
|
[]
|
|
23112
23174
|
);
|
|
23113
|
-
|
|
23175
|
+
React87__default.useCallback(
|
|
23114
23176
|
(group) => {
|
|
23115
23177
|
for (const z of zonesRef.current.values()) {
|
|
23116
23178
|
if (z.group === group) return z;
|
|
@@ -23119,7 +23181,7 @@ function useDataDnd(args) {
|
|
|
23119
23181
|
},
|
|
23120
23182
|
[]
|
|
23121
23183
|
);
|
|
23122
|
-
const handleDragEnd =
|
|
23184
|
+
const handleDragEnd = React87__default.useCallback(
|
|
23123
23185
|
(event) => {
|
|
23124
23186
|
const { active, over } = event;
|
|
23125
23187
|
const activeIdStr = String(active.id);
|
|
@@ -23210,8 +23272,8 @@ function useDataDnd(args) {
|
|
|
23210
23272
|
},
|
|
23211
23273
|
[eventBus]
|
|
23212
23274
|
);
|
|
23213
|
-
const sortableData =
|
|
23214
|
-
const SortableItem =
|
|
23275
|
+
const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23276
|
+
const SortableItem = React87__default.useCallback(
|
|
23215
23277
|
({ id, children }) => {
|
|
23216
23278
|
const {
|
|
23217
23279
|
attributes,
|
|
@@ -23251,7 +23313,7 @@ function useDataDnd(args) {
|
|
|
23251
23313
|
id: droppableId,
|
|
23252
23314
|
data: sortableData
|
|
23253
23315
|
});
|
|
23254
|
-
const ctx =
|
|
23316
|
+
const ctx = React87__default.useContext(RootCtx);
|
|
23255
23317
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23256
23318
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23257
23319
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23266,7 +23328,7 @@ function useDataDnd(args) {
|
|
|
23266
23328
|
showForeignPlaceholder,
|
|
23267
23329
|
ctxAvailable: ctx != null
|
|
23268
23330
|
});
|
|
23269
|
-
|
|
23331
|
+
React87__default.useEffect(() => {
|
|
23270
23332
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23271
23333
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23272
23334
|
return /* @__PURE__ */ jsx(
|
|
@@ -23280,11 +23342,11 @@ function useDataDnd(args) {
|
|
|
23280
23342
|
}
|
|
23281
23343
|
);
|
|
23282
23344
|
};
|
|
23283
|
-
const rootContextValue =
|
|
23345
|
+
const rootContextValue = React87__default.useMemo(
|
|
23284
23346
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23285
23347
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23286
23348
|
);
|
|
23287
|
-
const handleDragStart =
|
|
23349
|
+
const handleDragStart = React87__default.useCallback((event) => {
|
|
23288
23350
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23289
23351
|
const rect = event.active.rect.current.initial;
|
|
23290
23352
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23303,7 +23365,7 @@ function useDataDnd(args) {
|
|
|
23303
23365
|
isRoot
|
|
23304
23366
|
});
|
|
23305
23367
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23306
|
-
const handleDragOver =
|
|
23368
|
+
const handleDragOver = React87__default.useCallback((event) => {
|
|
23307
23369
|
const { active, over } = event;
|
|
23308
23370
|
const overData = over?.data?.current;
|
|
23309
23371
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23373,7 +23435,7 @@ function useDataDnd(args) {
|
|
|
23373
23435
|
return next;
|
|
23374
23436
|
});
|
|
23375
23437
|
}, []);
|
|
23376
|
-
const handleDragCancel =
|
|
23438
|
+
const handleDragCancel = React87__default.useCallback((event) => {
|
|
23377
23439
|
setActiveDrag(null);
|
|
23378
23440
|
setOverZoneGroup(null);
|
|
23379
23441
|
dndLog.warn("dragCancel", {
|
|
@@ -23381,12 +23443,12 @@ function useDataDnd(args) {
|
|
|
23381
23443
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23382
23444
|
});
|
|
23383
23445
|
}, []);
|
|
23384
|
-
const handleDragEndWithCleanup =
|
|
23446
|
+
const handleDragEndWithCleanup = React87__default.useCallback((event) => {
|
|
23385
23447
|
handleDragEnd(event);
|
|
23386
23448
|
setActiveDrag(null);
|
|
23387
23449
|
setOverZoneGroup(null);
|
|
23388
23450
|
}, [handleDragEnd]);
|
|
23389
|
-
const wrapContainer =
|
|
23451
|
+
const wrapContainer = React87__default.useCallback(
|
|
23390
23452
|
(children) => {
|
|
23391
23453
|
if (!enabled) return children;
|
|
23392
23454
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23440,7 +23502,7 @@ var init_useDataDnd = __esm({
|
|
|
23440
23502
|
init_useAlmadarDndCollision();
|
|
23441
23503
|
init_Box();
|
|
23442
23504
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23443
|
-
RootCtx =
|
|
23505
|
+
RootCtx = React87__default.createContext(null);
|
|
23444
23506
|
}
|
|
23445
23507
|
});
|
|
23446
23508
|
function fieldLabel2(key) {
|
|
@@ -23960,7 +24022,7 @@ function DataList({
|
|
|
23960
24022
|
}) {
|
|
23961
24023
|
const eventBus = useEventBus();
|
|
23962
24024
|
const { t } = useTranslate();
|
|
23963
|
-
const [visibleCount, setVisibleCount] =
|
|
24025
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
|
|
23964
24026
|
const fieldDefs = fields ?? columns ?? [];
|
|
23965
24027
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23966
24028
|
const dnd = useDataDnd({
|
|
@@ -23979,7 +24041,7 @@ function DataList({
|
|
|
23979
24041
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23980
24042
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23981
24043
|
const hasRenderProp = typeof children === "function";
|
|
23982
|
-
|
|
24044
|
+
React87__default.useEffect(() => {
|
|
23983
24045
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23984
24046
|
const childrenTypeOf = typeof children;
|
|
23985
24047
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24084,7 +24146,7 @@ function DataList({
|
|
|
24084
24146
|
const items2 = data.map((item) => item);
|
|
24085
24147
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24086
24148
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24087
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24149
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
24088
24150
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24089
24151
|
group.items.map((itemData, index) => {
|
|
24090
24152
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24232,7 +24294,7 @@ function DataList({
|
|
|
24232
24294
|
className
|
|
24233
24295
|
),
|
|
24234
24296
|
children: [
|
|
24235
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24297
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
24236
24298
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24237
24299
|
group.items.map(
|
|
24238
24300
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -25606,7 +25668,7 @@ var init_WizardProgress = __esm({
|
|
|
25606
25668
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25607
25669
|
const isActive = index === currentStep;
|
|
25608
25670
|
const isCompleted = index < currentStep;
|
|
25609
|
-
return /* @__PURE__ */ jsxs(
|
|
25671
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
25610
25672
|
/* @__PURE__ */ jsx(
|
|
25611
25673
|
"button",
|
|
25612
25674
|
{
|
|
@@ -26123,7 +26185,7 @@ var init_FormSectionHeader = __esm({
|
|
|
26123
26185
|
Box,
|
|
26124
26186
|
{
|
|
26125
26187
|
className: cn(
|
|
26126
|
-
"px-4 py-3 bg-muted rounded-t-lg",
|
|
26188
|
+
"px-4 py-3 bg-muted rounded-t-lg border-b-2 border-border border-l-4 border-l-primary",
|
|
26127
26189
|
isClickable && "cursor-pointer hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
26128
26190
|
className
|
|
26129
26191
|
),
|
|
@@ -26135,7 +26197,7 @@ var init_FormSectionHeader = __esm({
|
|
|
26135
26197
|
{
|
|
26136
26198
|
name: icon,
|
|
26137
26199
|
size: "md",
|
|
26138
|
-
className: "text-
|
|
26200
|
+
className: "text-primary"
|
|
26139
26201
|
}
|
|
26140
26202
|
),
|
|
26141
26203
|
statusIcon && /* @__PURE__ */ jsx(
|
|
@@ -26146,8 +26208,8 @@ var init_FormSectionHeader = __esm({
|
|
|
26146
26208
|
className: hasErrors ? "text-error" : "text-success"
|
|
26147
26209
|
}
|
|
26148
26210
|
),
|
|
26149
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
26150
|
-
/* @__PURE__ */ jsx(Typography, { variant: "
|
|
26211
|
+
/* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
|
|
26212
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
|
|
26151
26213
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
|
|
26152
26214
|
] })
|
|
26153
26215
|
] }),
|
|
@@ -26661,7 +26723,7 @@ function InventoryGrid({
|
|
|
26661
26723
|
const eventBus = useEventBus();
|
|
26662
26724
|
const slotCount = totalSlots ?? items.length;
|
|
26663
26725
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
26664
|
-
const handleSelect =
|
|
26726
|
+
const handleSelect = React87.useCallback(
|
|
26665
26727
|
(id) => {
|
|
26666
26728
|
onSelect?.(id);
|
|
26667
26729
|
if (selectEvent) {
|
|
@@ -26878,31 +26940,31 @@ function GameCanvas2D({
|
|
|
26878
26940
|
assetBaseUrl = "",
|
|
26879
26941
|
className
|
|
26880
26942
|
}) {
|
|
26881
|
-
const canvasRef =
|
|
26882
|
-
const rafRef =
|
|
26883
|
-
const frameRef =
|
|
26884
|
-
const lastTimeRef =
|
|
26885
|
-
const imageCache =
|
|
26943
|
+
const canvasRef = React87.useRef(null);
|
|
26944
|
+
const rafRef = React87.useRef(0);
|
|
26945
|
+
const frameRef = React87.useRef(0);
|
|
26946
|
+
const lastTimeRef = React87.useRef(0);
|
|
26947
|
+
const imageCache = React87.useRef(/* @__PURE__ */ new Map());
|
|
26886
26948
|
const emit = useEmitEvent();
|
|
26887
|
-
const onDrawRef =
|
|
26949
|
+
const onDrawRef = React87.useRef(onDraw);
|
|
26888
26950
|
onDrawRef.current = onDraw;
|
|
26889
|
-
const onTickRef =
|
|
26951
|
+
const onTickRef = React87.useRef(onTick);
|
|
26890
26952
|
onTickRef.current = onTick;
|
|
26891
|
-
const tickEventRef =
|
|
26953
|
+
const tickEventRef = React87.useRef(tickEvent);
|
|
26892
26954
|
tickEventRef.current = tickEvent;
|
|
26893
|
-
const drawEventRef =
|
|
26955
|
+
const drawEventRef = React87.useRef(drawEvent);
|
|
26894
26956
|
drawEventRef.current = drawEvent;
|
|
26895
|
-
const emitRef =
|
|
26957
|
+
const emitRef = React87.useRef(emit);
|
|
26896
26958
|
emitRef.current = emit;
|
|
26897
|
-
const assetBaseUrlRef =
|
|
26959
|
+
const assetBaseUrlRef = React87.useRef(assetBaseUrl);
|
|
26898
26960
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
26899
|
-
const backgroundImageRef =
|
|
26961
|
+
const backgroundImageRef = React87.useRef(backgroundImage);
|
|
26900
26962
|
backgroundImageRef.current = backgroundImage;
|
|
26901
|
-
const widthRef =
|
|
26963
|
+
const widthRef = React87.useRef(width);
|
|
26902
26964
|
widthRef.current = width;
|
|
26903
|
-
const heightRef =
|
|
26965
|
+
const heightRef = React87.useRef(height);
|
|
26904
26966
|
heightRef.current = height;
|
|
26905
|
-
const loadImage =
|
|
26967
|
+
const loadImage = React87.useCallback((url) => {
|
|
26906
26968
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
26907
26969
|
const cached = imageCache.current.get(fullUrl);
|
|
26908
26970
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -26914,7 +26976,7 @@ function GameCanvas2D({
|
|
|
26914
26976
|
}
|
|
26915
26977
|
return null;
|
|
26916
26978
|
}, []);
|
|
26917
|
-
|
|
26979
|
+
React87.useEffect(() => {
|
|
26918
26980
|
const canvas = canvasRef.current;
|
|
26919
26981
|
if (!canvas) return;
|
|
26920
26982
|
const ctx = canvas.getContext("2d");
|
|
@@ -27217,7 +27279,7 @@ function TurnPanel({
|
|
|
27217
27279
|
className
|
|
27218
27280
|
}) {
|
|
27219
27281
|
const eventBus = useEventBus();
|
|
27220
|
-
const handleAction =
|
|
27282
|
+
const handleAction = React87.useCallback(
|
|
27221
27283
|
(event) => {
|
|
27222
27284
|
if (event) {
|
|
27223
27285
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -27363,7 +27425,7 @@ function UnitCommandBar({
|
|
|
27363
27425
|
className
|
|
27364
27426
|
}) {
|
|
27365
27427
|
const eventBus = useEventBus();
|
|
27366
|
-
const handleCommand =
|
|
27428
|
+
const handleCommand = React87.useCallback(
|
|
27367
27429
|
(event) => {
|
|
27368
27430
|
if (event) {
|
|
27369
27431
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -27848,7 +27910,7 @@ function GameMenu({
|
|
|
27848
27910
|
} catch {
|
|
27849
27911
|
}
|
|
27850
27912
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27851
|
-
const handleOptionClick =
|
|
27913
|
+
const handleOptionClick = React87.useCallback(
|
|
27852
27914
|
(option) => {
|
|
27853
27915
|
if (option.event && eventBus) {
|
|
27854
27916
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27962,7 +28024,7 @@ function GameOverScreen({
|
|
|
27962
28024
|
} catch {
|
|
27963
28025
|
}
|
|
27964
28026
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27965
|
-
const handleActionClick =
|
|
28027
|
+
const handleActionClick = React87.useCallback(
|
|
27966
28028
|
(action) => {
|
|
27967
28029
|
if (action.event && eventBus) {
|
|
27968
28030
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28956,7 +29018,7 @@ var init_StarRating = __esm({
|
|
|
28956
29018
|
name: "star",
|
|
28957
29019
|
className: cn(
|
|
28958
29020
|
styles.star,
|
|
28959
|
-
"text-muted",
|
|
29021
|
+
"text-muted-foreground",
|
|
28960
29022
|
"transition-colors duration-100"
|
|
28961
29023
|
),
|
|
28962
29024
|
strokeWidth: 1.5
|
|
@@ -29439,8 +29501,8 @@ function TableView({
|
|
|
29439
29501
|
}) {
|
|
29440
29502
|
const eventBus = useEventBus();
|
|
29441
29503
|
const { t } = useTranslate();
|
|
29442
|
-
const [visibleCount, setVisibleCount] =
|
|
29443
|
-
const [localSelected, setLocalSelected] =
|
|
29504
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29505
|
+
const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
|
|
29444
29506
|
const colDefs = columns ?? fields ?? [];
|
|
29445
29507
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29446
29508
|
const dnd = useDataDnd({
|
|
@@ -29635,12 +29697,12 @@ function TableView({
|
|
|
29635
29697
|
]
|
|
29636
29698
|
}
|
|
29637
29699
|
);
|
|
29638
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29700
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
|
|
29639
29701
|
};
|
|
29640
29702
|
const items = data.map((row) => row);
|
|
29641
29703
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29642
29704
|
let runningIndex = 0;
|
|
29643
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29705
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
29644
29706
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29645
29707
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29646
29708
|
] }, gi)) });
|
|
@@ -30992,7 +31054,7 @@ var init_StepFlow = __esm({
|
|
|
30992
31054
|
className
|
|
30993
31055
|
}) => {
|
|
30994
31056
|
if (orientation === "vertical") {
|
|
30995
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
31057
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30996
31058
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30997
31059
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30998
31060
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31003,7 +31065,7 @@ var init_StepFlow = __esm({
|
|
|
31003
31065
|
] })
|
|
31004
31066
|
] }) }, index)) });
|
|
31005
31067
|
}
|
|
31006
|
-
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(
|
|
31068
|
+
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(React87__default.Fragment, { children: [
|
|
31007
31069
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31008
31070
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31009
31071
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31979,7 +32041,7 @@ var init_LikertScale = __esm({
|
|
|
31979
32041
|
md: "text-base",
|
|
31980
32042
|
lg: "text-lg"
|
|
31981
32043
|
};
|
|
31982
|
-
LikertScale =
|
|
32044
|
+
LikertScale = React87__default.forwardRef(
|
|
31983
32045
|
({
|
|
31984
32046
|
question,
|
|
31985
32047
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31991,7 +32053,7 @@ var init_LikertScale = __esm({
|
|
|
31991
32053
|
variant = "radios",
|
|
31992
32054
|
className
|
|
31993
32055
|
}, ref) => {
|
|
31994
|
-
const groupId =
|
|
32056
|
+
const groupId = React87__default.useId();
|
|
31995
32057
|
const eventBus = useEventBus();
|
|
31996
32058
|
const handleSelect = useCallback(
|
|
31997
32059
|
(next) => {
|
|
@@ -33136,6 +33198,7 @@ function Editable({
|
|
|
33136
33198
|
function BlockRow({
|
|
33137
33199
|
block,
|
|
33138
33200
|
readOnly,
|
|
33201
|
+
showAffordances,
|
|
33139
33202
|
placeholder,
|
|
33140
33203
|
onUpdate,
|
|
33141
33204
|
onDelete,
|
|
@@ -33354,7 +33417,7 @@ function BlockRow({
|
|
|
33354
33417
|
onValueChange: (next) => setChildContent(child.id, next)
|
|
33355
33418
|
}
|
|
33356
33419
|
),
|
|
33357
|
-
!readOnly && /* @__PURE__ */ jsx(
|
|
33420
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(
|
|
33358
33421
|
Button,
|
|
33359
33422
|
{
|
|
33360
33423
|
type: "button",
|
|
@@ -33369,7 +33432,7 @@ function BlockRow({
|
|
|
33369
33432
|
}
|
|
33370
33433
|
)
|
|
33371
33434
|
] }, child.id)),
|
|
33372
|
-
!readOnly && /* @__PURE__ */ jsx(Box, { as: "li", className: "list-none pl-0", children: /* @__PURE__ */ jsxs(
|
|
33435
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { as: "li", className: "list-none pl-0", children: /* @__PURE__ */ jsxs(
|
|
33373
33436
|
Button,
|
|
33374
33437
|
{
|
|
33375
33438
|
type: "button",
|
|
@@ -33416,7 +33479,7 @@ function BlockRow({
|
|
|
33416
33479
|
"data-block-id": block.id,
|
|
33417
33480
|
"data-block-type": block.type,
|
|
33418
33481
|
children: [
|
|
33419
|
-
!readOnly && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
|
|
33482
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsxs(Box, { className: "flex w-12 shrink-0 items-center gap-0.5 pt-1", children: [
|
|
33420
33483
|
/* @__PURE__ */ jsx(
|
|
33421
33484
|
Button,
|
|
33422
33485
|
{
|
|
@@ -33515,6 +33578,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33515
33578
|
changeEvent,
|
|
33516
33579
|
readOnly = false,
|
|
33517
33580
|
placeholder,
|
|
33581
|
+
enableBlocks = false,
|
|
33518
33582
|
showToolbar = true,
|
|
33519
33583
|
className
|
|
33520
33584
|
}) => {
|
|
@@ -33586,7 +33650,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33586
33650
|
padding: "none",
|
|
33587
33651
|
className: cn("flex flex-col", className),
|
|
33588
33652
|
children: [
|
|
33589
|
-
showToolbar && !readOnly && /* @__PURE__ */ jsx(
|
|
33653
|
+
enableBlocks && showToolbar && !readOnly && /* @__PURE__ */ jsx(
|
|
33590
33654
|
Box,
|
|
33591
33655
|
{
|
|
33592
33656
|
role: "toolbar",
|
|
@@ -33622,6 +33686,7 @@ var init_RichBlockEditor = __esm({
|
|
|
33622
33686
|
{
|
|
33623
33687
|
block,
|
|
33624
33688
|
readOnly,
|
|
33689
|
+
showAffordances: enableBlocks,
|
|
33625
33690
|
placeholder,
|
|
33626
33691
|
onUpdate: (updater) => handleUpdate(block.id, updater),
|
|
33627
33692
|
onDelete: () => handleDelete(block.id),
|
|
@@ -34296,7 +34361,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34296
34361
|
"aria-label": t("aria.breadcrumb"),
|
|
34297
34362
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34298
34363
|
const isLast = idx === items.length - 1;
|
|
34299
|
-
return /* @__PURE__ */ jsxs(
|
|
34364
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
34300
34365
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34301
34366
|
Icon,
|
|
34302
34367
|
{
|
|
@@ -35260,7 +35325,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35260
35325
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
35261
35326
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35262
35327
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
35263
|
-
return /* @__PURE__ */ jsxs(
|
|
35328
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
35264
35329
|
/* @__PURE__ */ jsx(
|
|
35265
35330
|
AvlState,
|
|
35266
35331
|
{
|
|
@@ -35464,7 +35529,7 @@ var init_PageHeader = __esm({
|
|
|
35464
35529
|
info: "bg-info/10 text-info"
|
|
35465
35530
|
};
|
|
35466
35531
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35467
|
-
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(
|
|
35532
|
+
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(React87__default.Fragment, { children: [
|
|
35468
35533
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35469
35534
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35470
35535
|
"a",
|
|
@@ -36201,7 +36266,7 @@ var init_WizardContainer = __esm({
|
|
|
36201
36266
|
const isCompleted = index < currentStep;
|
|
36202
36267
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36203
36268
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36204
|
-
return /* @__PURE__ */ jsxs(
|
|
36269
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
36205
36270
|
/* @__PURE__ */ jsx(
|
|
36206
36271
|
Button,
|
|
36207
36272
|
{
|
|
@@ -38486,7 +38551,7 @@ var init_DetailPanel = __esm({
|
|
|
38486
38551
|
}
|
|
38487
38552
|
});
|
|
38488
38553
|
function extractTitle(children) {
|
|
38489
|
-
if (!
|
|
38554
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
38490
38555
|
const props = children.props;
|
|
38491
38556
|
if (typeof props.title === "string") {
|
|
38492
38557
|
return props.title;
|
|
@@ -38541,7 +38606,7 @@ function LinearView({
|
|
|
38541
38606
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
38542
38607
|
const isDone = i < currentIdx;
|
|
38543
38608
|
const isCurrent = i === currentIdx;
|
|
38544
|
-
return /* @__PURE__ */ jsxs(
|
|
38609
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
38545
38610
|
i > 0 && /* @__PURE__ */ jsx(
|
|
38546
38611
|
Typography,
|
|
38547
38612
|
{
|
|
@@ -39499,12 +39564,12 @@ var init_Form = __esm({
|
|
|
39499
39564
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39500
39565
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39501
39566
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39502
|
-
const normalizedInitialData =
|
|
39567
|
+
const normalizedInitialData = React87__default.useMemo(() => {
|
|
39503
39568
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39504
39569
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39505
39570
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39506
39571
|
}, [entity, initialData]);
|
|
39507
|
-
const entityDerivedFields =
|
|
39572
|
+
const entityDerivedFields = React87__default.useMemo(() => {
|
|
39508
39573
|
if (fields && fields.length > 0) return void 0;
|
|
39509
39574
|
if (!resolvedEntity) return void 0;
|
|
39510
39575
|
return resolvedEntity.fields.map(
|
|
@@ -39524,16 +39589,16 @@ var init_Form = __esm({
|
|
|
39524
39589
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39525
39590
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39526
39591
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39527
|
-
const [formData, setFormData] =
|
|
39592
|
+
const [formData, setFormData] = React87__default.useState(
|
|
39528
39593
|
normalizedInitialData
|
|
39529
39594
|
);
|
|
39530
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39595
|
+
const [collapsedSections, setCollapsedSections] = React87__default.useState(
|
|
39531
39596
|
/* @__PURE__ */ new Set()
|
|
39532
39597
|
);
|
|
39533
|
-
const [submitError, setSubmitError] =
|
|
39534
|
-
const formRef =
|
|
39598
|
+
const [submitError, setSubmitError] = React87__default.useState(null);
|
|
39599
|
+
const formRef = React87__default.useRef(null);
|
|
39535
39600
|
const formMode = props.mode;
|
|
39536
|
-
const mountedRef =
|
|
39601
|
+
const mountedRef = React87__default.useRef(false);
|
|
39537
39602
|
if (!mountedRef.current) {
|
|
39538
39603
|
mountedRef.current = true;
|
|
39539
39604
|
debug("forms", "mount", {
|
|
@@ -39546,7 +39611,7 @@ var init_Form = __esm({
|
|
|
39546
39611
|
});
|
|
39547
39612
|
}
|
|
39548
39613
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39549
|
-
const evalContext =
|
|
39614
|
+
const evalContext = React87__default.useMemo(
|
|
39550
39615
|
() => ({
|
|
39551
39616
|
formValues: formData,
|
|
39552
39617
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39555,7 +39620,7 @@ var init_Form = __esm({
|
|
|
39555
39620
|
}),
|
|
39556
39621
|
[formData, externalContext]
|
|
39557
39622
|
);
|
|
39558
|
-
|
|
39623
|
+
React87__default.useEffect(() => {
|
|
39559
39624
|
debug("forms", "initialData-sync", {
|
|
39560
39625
|
mode: formMode,
|
|
39561
39626
|
normalizedInitialData,
|
|
@@ -39566,7 +39631,7 @@ var init_Form = __esm({
|
|
|
39566
39631
|
setFormData(normalizedInitialData);
|
|
39567
39632
|
}
|
|
39568
39633
|
}, [normalizedInitialData]);
|
|
39569
|
-
const processCalculations =
|
|
39634
|
+
const processCalculations = React87__default.useCallback(
|
|
39570
39635
|
(changedFieldId, newFormData) => {
|
|
39571
39636
|
if (!hiddenCalculations.length) return;
|
|
39572
39637
|
const context = {
|
|
@@ -39591,7 +39656,7 @@ var init_Form = __esm({
|
|
|
39591
39656
|
},
|
|
39592
39657
|
[hiddenCalculations, externalContext, eventBus]
|
|
39593
39658
|
);
|
|
39594
|
-
const checkViolations =
|
|
39659
|
+
const checkViolations = React87__default.useCallback(
|
|
39595
39660
|
(changedFieldId, newFormData) => {
|
|
39596
39661
|
if (!violationTriggers.length) return;
|
|
39597
39662
|
const context = {
|
|
@@ -39629,7 +39694,7 @@ var init_Form = __esm({
|
|
|
39629
39694
|
processCalculations(name, newFormData);
|
|
39630
39695
|
checkViolations(name, newFormData);
|
|
39631
39696
|
};
|
|
39632
|
-
const isFieldVisible =
|
|
39697
|
+
const isFieldVisible = React87__default.useCallback(
|
|
39633
39698
|
(fieldName) => {
|
|
39634
39699
|
const condition = conditionalFields[fieldName];
|
|
39635
39700
|
if (!condition) return true;
|
|
@@ -39637,7 +39702,7 @@ var init_Form = __esm({
|
|
|
39637
39702
|
},
|
|
39638
39703
|
[conditionalFields, evalContext]
|
|
39639
39704
|
);
|
|
39640
|
-
const isSectionVisible =
|
|
39705
|
+
const isSectionVisible = React87__default.useCallback(
|
|
39641
39706
|
(section) => {
|
|
39642
39707
|
if (!section.condition) return true;
|
|
39643
39708
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39713,7 +39778,7 @@ var init_Form = __esm({
|
|
|
39713
39778
|
eventBus.emit(`UI:${onCancel}`);
|
|
39714
39779
|
}
|
|
39715
39780
|
};
|
|
39716
|
-
const renderField =
|
|
39781
|
+
const renderField = React87__default.useCallback(
|
|
39717
39782
|
(field) => {
|
|
39718
39783
|
const fieldName = field.name || field.field;
|
|
39719
39784
|
if (!fieldName) return null;
|
|
@@ -39734,7 +39799,7 @@ var init_Form = __esm({
|
|
|
39734
39799
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39735
39800
|
);
|
|
39736
39801
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39737
|
-
const normalizedFields =
|
|
39802
|
+
const normalizedFields = React87__default.useMemo(() => {
|
|
39738
39803
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39739
39804
|
return effectiveFields.map((field) => {
|
|
39740
39805
|
if (typeof field === "string") {
|
|
@@ -39757,7 +39822,7 @@ var init_Form = __esm({
|
|
|
39757
39822
|
return field;
|
|
39758
39823
|
});
|
|
39759
39824
|
}, [effectiveFields, resolvedEntity]);
|
|
39760
|
-
const schemaFields =
|
|
39825
|
+
const schemaFields = React87__default.useMemo(() => {
|
|
39761
39826
|
if (normalizedFields.length === 0) return null;
|
|
39762
39827
|
if (isDebugEnabled()) {
|
|
39763
39828
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39767,7 +39832,7 @@ var init_Form = __esm({
|
|
|
39767
39832
|
}
|
|
39768
39833
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39769
39834
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39770
|
-
const sectionElements =
|
|
39835
|
+
const sectionElements = React87__default.useMemo(() => {
|
|
39771
39836
|
if (!sections || sections.length === 0) return null;
|
|
39772
39837
|
return sections.map((section) => {
|
|
39773
39838
|
if (!isSectionVisible(section)) {
|
|
@@ -41042,7 +41107,7 @@ var init_List = __esm({
|
|
|
41042
41107
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41043
41108
|
return [];
|
|
41044
41109
|
}, [entity]);
|
|
41045
|
-
const getItemActions =
|
|
41110
|
+
const getItemActions = React87__default.useCallback(
|
|
41046
41111
|
(item) => {
|
|
41047
41112
|
if (!itemActions) return [];
|
|
41048
41113
|
if (typeof itemActions === "function") {
|
|
@@ -41518,7 +41583,7 @@ var init_MediaGallery = __esm({
|
|
|
41518
41583
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41519
41584
|
);
|
|
41520
41585
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41521
|
-
const items =
|
|
41586
|
+
const items = React87__default.useMemo(() => {
|
|
41522
41587
|
if (propItems) return propItems;
|
|
41523
41588
|
if (entityData.length === 0) return [];
|
|
41524
41589
|
return entityData.map((record, idx) => ({
|
|
@@ -41679,7 +41744,7 @@ var init_MediaGallery = __esm({
|
|
|
41679
41744
|
}
|
|
41680
41745
|
});
|
|
41681
41746
|
function extractTitle2(children) {
|
|
41682
|
-
if (!
|
|
41747
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
41683
41748
|
const props = children.props;
|
|
41684
41749
|
if (typeof props.title === "string") {
|
|
41685
41750
|
return props.title;
|
|
@@ -42091,7 +42156,7 @@ var init_debugRegistry = __esm({
|
|
|
42091
42156
|
}
|
|
42092
42157
|
});
|
|
42093
42158
|
function useDebugData() {
|
|
42094
|
-
const [data, setData] =
|
|
42159
|
+
const [data, setData] = React87.useState(() => ({
|
|
42095
42160
|
traits: [],
|
|
42096
42161
|
ticks: [],
|
|
42097
42162
|
guards: [],
|
|
@@ -42105,7 +42170,7 @@ function useDebugData() {
|
|
|
42105
42170
|
},
|
|
42106
42171
|
lastUpdate: Date.now()
|
|
42107
42172
|
}));
|
|
42108
|
-
|
|
42173
|
+
React87.useEffect(() => {
|
|
42109
42174
|
const updateData = () => {
|
|
42110
42175
|
setData({
|
|
42111
42176
|
traits: getAllTraits(),
|
|
@@ -42214,12 +42279,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42214
42279
|
return positions;
|
|
42215
42280
|
}
|
|
42216
42281
|
function WalkMinimap() {
|
|
42217
|
-
const [walkStep, setWalkStep] =
|
|
42218
|
-
const [traits2, setTraits] =
|
|
42219
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42220
|
-
const [completedTraits, setCompletedTraits] =
|
|
42221
|
-
const prevTraitRef =
|
|
42222
|
-
|
|
42282
|
+
const [walkStep, setWalkStep] = React87.useState(null);
|
|
42283
|
+
const [traits2, setTraits] = React87.useState([]);
|
|
42284
|
+
const [coveredEdges, setCoveredEdges] = React87.useState([]);
|
|
42285
|
+
const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
|
|
42286
|
+
const prevTraitRef = React87.useRef(null);
|
|
42287
|
+
React87.useEffect(() => {
|
|
42223
42288
|
const interval = setInterval(() => {
|
|
42224
42289
|
const w = window;
|
|
42225
42290
|
const step = w.__orbitalWalkStep;
|
|
@@ -42655,15 +42720,15 @@ var init_EntitiesTab = __esm({
|
|
|
42655
42720
|
});
|
|
42656
42721
|
function EventFlowTab({ events: events2 }) {
|
|
42657
42722
|
const { t } = useTranslate();
|
|
42658
|
-
const [filter, setFilter] =
|
|
42659
|
-
const containerRef =
|
|
42660
|
-
const [autoScroll, setAutoScroll] =
|
|
42661
|
-
|
|
42723
|
+
const [filter, setFilter] = React87.useState("all");
|
|
42724
|
+
const containerRef = React87.useRef(null);
|
|
42725
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
42726
|
+
React87.useEffect(() => {
|
|
42662
42727
|
if (autoScroll && containerRef.current) {
|
|
42663
42728
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42664
42729
|
}
|
|
42665
42730
|
}, [events2.length, autoScroll]);
|
|
42666
|
-
const filteredEvents =
|
|
42731
|
+
const filteredEvents = React87.useMemo(() => {
|
|
42667
42732
|
if (filter === "all") return events2;
|
|
42668
42733
|
return events2.filter((e) => e.type === filter);
|
|
42669
42734
|
}, [events2, filter]);
|
|
@@ -42779,7 +42844,7 @@ var init_EventFlowTab = __esm({
|
|
|
42779
42844
|
});
|
|
42780
42845
|
function GuardsPanel({ guards }) {
|
|
42781
42846
|
const { t } = useTranslate();
|
|
42782
|
-
const [filter, setFilter] =
|
|
42847
|
+
const [filter, setFilter] = React87.useState("all");
|
|
42783
42848
|
if (guards.length === 0) {
|
|
42784
42849
|
return /* @__PURE__ */ jsx(
|
|
42785
42850
|
EmptyState,
|
|
@@ -42792,7 +42857,7 @@ function GuardsPanel({ guards }) {
|
|
|
42792
42857
|
}
|
|
42793
42858
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42794
42859
|
const failedCount = guards.length - passedCount;
|
|
42795
|
-
const filteredGuards =
|
|
42860
|
+
const filteredGuards = React87.useMemo(() => {
|
|
42796
42861
|
if (filter === "all") return guards;
|
|
42797
42862
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42798
42863
|
return guards.filter((g) => !g.result);
|
|
@@ -42955,10 +43020,10 @@ function EffectBadge({ effect }) {
|
|
|
42955
43020
|
}
|
|
42956
43021
|
function TransitionTimeline({ transitions }) {
|
|
42957
43022
|
const { t } = useTranslate();
|
|
42958
|
-
const containerRef =
|
|
42959
|
-
const [autoScroll, setAutoScroll] =
|
|
42960
|
-
const [expandedId, setExpandedId] =
|
|
42961
|
-
|
|
43023
|
+
const containerRef = React87.useRef(null);
|
|
43024
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
43025
|
+
const [expandedId, setExpandedId] = React87.useState(null);
|
|
43026
|
+
React87.useEffect(() => {
|
|
42962
43027
|
if (autoScroll && containerRef.current) {
|
|
42963
43028
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42964
43029
|
}
|
|
@@ -43238,9 +43303,9 @@ function getAllEvents(traits2) {
|
|
|
43238
43303
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43239
43304
|
const eventBus = useEventBus();
|
|
43240
43305
|
const { t } = useTranslate();
|
|
43241
|
-
const [log12, setLog] =
|
|
43242
|
-
const prevStatesRef =
|
|
43243
|
-
|
|
43306
|
+
const [log12, setLog] = React87.useState([]);
|
|
43307
|
+
const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
|
|
43308
|
+
React87.useEffect(() => {
|
|
43244
43309
|
for (const trait of traits2) {
|
|
43245
43310
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43246
43311
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43409,10 +43474,10 @@ function VerifyModePanel({
|
|
|
43409
43474
|
localCount
|
|
43410
43475
|
}) {
|
|
43411
43476
|
const { t } = useTranslate();
|
|
43412
|
-
const [expanded, setExpanded] =
|
|
43413
|
-
const scrollRef =
|
|
43414
|
-
const prevCountRef =
|
|
43415
|
-
|
|
43477
|
+
const [expanded, setExpanded] = React87.useState(true);
|
|
43478
|
+
const scrollRef = React87.useRef(null);
|
|
43479
|
+
const prevCountRef = React87.useRef(0);
|
|
43480
|
+
React87.useEffect(() => {
|
|
43416
43481
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43417
43482
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43418
43483
|
}
|
|
@@ -43469,10 +43534,10 @@ function RuntimeDebugger({
|
|
|
43469
43534
|
schema
|
|
43470
43535
|
}) {
|
|
43471
43536
|
const { t } = useTranslate();
|
|
43472
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43473
|
-
const [isVisible, setIsVisible] =
|
|
43537
|
+
const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43538
|
+
const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43474
43539
|
const debugData = useDebugData();
|
|
43475
|
-
|
|
43540
|
+
React87.useEffect(() => {
|
|
43476
43541
|
if (mode === "inline") return;
|
|
43477
43542
|
return onDebugToggle((enabled) => {
|
|
43478
43543
|
setIsVisible(enabled);
|
|
@@ -43481,7 +43546,7 @@ function RuntimeDebugger({
|
|
|
43481
43546
|
}
|
|
43482
43547
|
});
|
|
43483
43548
|
}, [mode]);
|
|
43484
|
-
|
|
43549
|
+
React87.useEffect(() => {
|
|
43485
43550
|
if (mode === "inline") return;
|
|
43486
43551
|
const handleKeyDown = (e) => {
|
|
43487
43552
|
if (e.key === "`" && isVisible) {
|
|
@@ -43496,7 +43561,7 @@ function RuntimeDebugger({
|
|
|
43496
43561
|
if (!isVisible) {
|
|
43497
43562
|
return null;
|
|
43498
43563
|
}
|
|
43499
|
-
const
|
|
43564
|
+
const positionClasses = {
|
|
43500
43565
|
"bottom-right": "bottom-4 right-4",
|
|
43501
43566
|
"bottom-left": "bottom-4 left-4",
|
|
43502
43567
|
"top-right": "top-4 right-4",
|
|
@@ -43625,7 +43690,7 @@ function RuntimeDebugger({
|
|
|
43625
43690
|
className: cn(
|
|
43626
43691
|
"runtime-debugger",
|
|
43627
43692
|
"fixed",
|
|
43628
|
-
|
|
43693
|
+
positionClasses[position],
|
|
43629
43694
|
isCollapsed ? "runtime-debugger--collapsed" : "runtime-debugger--expanded",
|
|
43630
43695
|
className
|
|
43631
43696
|
),
|
|
@@ -43930,7 +43995,7 @@ function SequenceBar({
|
|
|
43930
43995
|
onSlotRemove(index);
|
|
43931
43996
|
}, [onSlotRemove, playing]);
|
|
43932
43997
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
43933
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
43998
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
43934
43999
|
i > 0 && /* @__PURE__ */ jsx(
|
|
43935
44000
|
Typography,
|
|
43936
44001
|
{
|
|
@@ -44909,7 +44974,7 @@ var init_StatCard = __esm({
|
|
|
44909
44974
|
const labelToUse = propLabel ?? propTitle;
|
|
44910
44975
|
const eventBus = useEventBus();
|
|
44911
44976
|
const { t } = useTranslate();
|
|
44912
|
-
const handleActionClick =
|
|
44977
|
+
const handleActionClick = React87__default.useCallback(() => {
|
|
44913
44978
|
if (action?.event) {
|
|
44914
44979
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44915
44980
|
}
|
|
@@ -44920,7 +44985,7 @@ var init_StatCard = __esm({
|
|
|
44920
44985
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44921
44986
|
const isLoading = externalLoading ?? false;
|
|
44922
44987
|
const error = externalError;
|
|
44923
|
-
const computeMetricValue =
|
|
44988
|
+
const computeMetricValue = React87__default.useCallback(
|
|
44924
44989
|
(metric, items) => {
|
|
44925
44990
|
if (metric.value !== void 0) {
|
|
44926
44991
|
return metric.value;
|
|
@@ -44959,7 +45024,7 @@ var init_StatCard = __esm({
|
|
|
44959
45024
|
},
|
|
44960
45025
|
[]
|
|
44961
45026
|
);
|
|
44962
|
-
const schemaStats =
|
|
45027
|
+
const schemaStats = React87__default.useMemo(() => {
|
|
44963
45028
|
if (!metrics || metrics.length === 0) return null;
|
|
44964
45029
|
return metrics.map((metric) => ({
|
|
44965
45030
|
label: metric.label,
|
|
@@ -44967,7 +45032,7 @@ var init_StatCard = __esm({
|
|
|
44967
45032
|
format: metric.format
|
|
44968
45033
|
}));
|
|
44969
45034
|
}, [metrics, data, computeMetricValue]);
|
|
44970
|
-
const calculatedTrend =
|
|
45035
|
+
const calculatedTrend = React87__default.useMemo(() => {
|
|
44971
45036
|
if (manualTrend !== void 0) return manualTrend;
|
|
44972
45037
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44973
45038
|
return void 0;
|
|
@@ -45901,7 +45966,7 @@ var init_Timeline = __esm({
|
|
|
45901
45966
|
}) => {
|
|
45902
45967
|
const { t } = useTranslate();
|
|
45903
45968
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45904
|
-
const items =
|
|
45969
|
+
const items = React87__default.useMemo(() => {
|
|
45905
45970
|
if (propItems) return propItems;
|
|
45906
45971
|
if (entityData.length === 0) return [];
|
|
45907
45972
|
return entityData.map((record, idx) => {
|
|
@@ -46008,7 +46073,7 @@ var init_Timeline = __esm({
|
|
|
46008
46073
|
}
|
|
46009
46074
|
});
|
|
46010
46075
|
function extractToastProps(children) {
|
|
46011
|
-
if (!
|
|
46076
|
+
if (!React87__default.isValidElement(children)) {
|
|
46012
46077
|
if (typeof children === "string") {
|
|
46013
46078
|
return { message: children };
|
|
46014
46079
|
}
|
|
@@ -46046,7 +46111,7 @@ var init_ToastSlot = __esm({
|
|
|
46046
46111
|
eventBus.emit("UI:CLOSE");
|
|
46047
46112
|
};
|
|
46048
46113
|
if (!isVisible) return null;
|
|
46049
|
-
const isCustomContent =
|
|
46114
|
+
const isCustomContent = React87__default.isValidElement(children) && !message;
|
|
46050
46115
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
46051
46116
|
Toast,
|
|
46052
46117
|
{
|
|
@@ -46556,12 +46621,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
46556
46621
|
}
|
|
46557
46622
|
});
|
|
46558
46623
|
function lazyThree(name, loader) {
|
|
46559
|
-
const Lazy =
|
|
46624
|
+
const Lazy = React87__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46560
46625
|
function ThreeWrapper(props) {
|
|
46561
|
-
return
|
|
46562
|
-
|
|
46626
|
+
return React87__default.createElement(
|
|
46627
|
+
React87__default.Suspense,
|
|
46563
46628
|
{ fallback: null },
|
|
46564
|
-
|
|
46629
|
+
React87__default.createElement(Lazy, props)
|
|
46565
46630
|
);
|
|
46566
46631
|
}
|
|
46567
46632
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -47177,7 +47242,7 @@ function SuspenseConfigProvider({
|
|
|
47177
47242
|
config,
|
|
47178
47243
|
children
|
|
47179
47244
|
}) {
|
|
47180
|
-
return
|
|
47245
|
+
return React87__default.createElement(
|
|
47181
47246
|
SuspenseConfigContext.Provider,
|
|
47182
47247
|
{ value: config },
|
|
47183
47248
|
children
|
|
@@ -47252,6 +47317,9 @@ function renderContainedPortal(t, slot, content, onDismiss) {
|
|
|
47252
47317
|
const slotId = `slot-${slot}`;
|
|
47253
47318
|
switch (slot) {
|
|
47254
47319
|
case "modal":
|
|
47320
|
+
if (SELF_OVERLAY_PATTERNS.has(content.pattern)) {
|
|
47321
|
+
return /* @__PURE__ */ jsx(Box, { id: slotId, className: "contents", children: slotContent });
|
|
47322
|
+
}
|
|
47255
47323
|
return /* @__PURE__ */ jsx(
|
|
47256
47324
|
Box,
|
|
47257
47325
|
{
|
|
@@ -47513,8 +47581,8 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
47513
47581
|
const slotId = `slot-${slot}`;
|
|
47514
47582
|
let wrapper;
|
|
47515
47583
|
switch (slot) {
|
|
47516
|
-
case "modal":
|
|
47517
|
-
|
|
47584
|
+
case "modal": {
|
|
47585
|
+
const innerContent = /* @__PURE__ */ jsx(
|
|
47518
47586
|
Box,
|
|
47519
47587
|
{
|
|
47520
47588
|
id: slotId,
|
|
@@ -47523,8 +47591,10 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
|
|
|
47523
47591
|
"data-source-trait": sourceTrait,
|
|
47524
47592
|
children
|
|
47525
47593
|
}
|
|
47526
|
-
)
|
|
47594
|
+
);
|
|
47595
|
+
wrapper = pattern !== void 0 && SELF_OVERLAY_PATTERNS.has(pattern) ? innerContent : /* @__PURE__ */ jsx(Modal, { isOpen: true, onClose: handleDismiss, showCloseButton: true, size: "lg", children: innerContent });
|
|
47527
47596
|
break;
|
|
47597
|
+
}
|
|
47528
47598
|
case "drawer":
|
|
47529
47599
|
wrapper = /* @__PURE__ */ jsx(Drawer, { isOpen: true, onClose: handleDismiss, position: "right", children: /* @__PURE__ */ jsx(
|
|
47530
47600
|
Box,
|
|
@@ -47582,7 +47652,7 @@ function SlotPortal({
|
|
|
47582
47652
|
let wrapper;
|
|
47583
47653
|
switch (slot) {
|
|
47584
47654
|
case "modal":
|
|
47585
|
-
wrapper = /* @__PURE__ */ jsx(
|
|
47655
|
+
wrapper = SELF_OVERLAY_PATTERNS.has(content.pattern) ? /* @__PURE__ */ jsx(Box, { id: slotId, children: slotContent }) : /* @__PURE__ */ jsx(
|
|
47586
47656
|
Modal,
|
|
47587
47657
|
{
|
|
47588
47658
|
isOpen: true,
|
|
@@ -47662,7 +47732,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47662
47732
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47663
47733
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47664
47734
|
}
|
|
47665
|
-
return /* @__PURE__ */ jsx(
|
|
47735
|
+
return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47666
47736
|
}
|
|
47667
47737
|
if (!child || typeof child !== "object") return null;
|
|
47668
47738
|
const childId = `${parentId}-${index}`;
|
|
@@ -47702,14 +47772,14 @@ function isPatternConfig(value) {
|
|
|
47702
47772
|
if (value === null || value === void 0) return false;
|
|
47703
47773
|
if (typeof value !== "object") return false;
|
|
47704
47774
|
if (Array.isArray(value)) return false;
|
|
47705
|
-
if (
|
|
47775
|
+
if (React87__default.isValidElement(value)) return false;
|
|
47706
47776
|
if (value instanceof Date) return false;
|
|
47707
47777
|
if (typeof value === "function") return false;
|
|
47708
47778
|
const record = value;
|
|
47709
47779
|
return "type" in record && typeof record.type === "string";
|
|
47710
47780
|
}
|
|
47711
47781
|
function isPlainConfigObject(value) {
|
|
47712
|
-
if (
|
|
47782
|
+
if (React87__default.isValidElement(value)) return false;
|
|
47713
47783
|
if (value instanceof Date) return false;
|
|
47714
47784
|
const proto = Object.getPrototypeOf(value);
|
|
47715
47785
|
return proto === Object.prototype || proto === null;
|
|
@@ -47962,7 +48032,7 @@ function UISlotRenderer({
|
|
|
47962
48032
|
}
|
|
47963
48033
|
return wrapped;
|
|
47964
48034
|
}
|
|
47965
|
-
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
48035
|
+
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, SELF_OVERLAY_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
47966
48036
|
var init_UISlotRenderer = __esm({
|
|
47967
48037
|
"components/core/organisms/UISlotRenderer.tsx"() {
|
|
47968
48038
|
"use client";
|
|
@@ -47998,6 +48068,7 @@ var init_UISlotRenderer = __esm({
|
|
|
47998
48068
|
"inline-edit-form",
|
|
47999
48069
|
"wizard-step"
|
|
48000
48070
|
]);
|
|
48071
|
+
SELF_OVERLAY_PATTERNS = /* @__PURE__ */ new Set(["modal", "confirm-dialog"]);
|
|
48001
48072
|
PATTERNS_WITH_CHILDREN = /* @__PURE__ */ new Set([
|
|
48002
48073
|
"stack",
|
|
48003
48074
|
"vstack",
|