@almadar/ui 5.87.0 → 5.91.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 +1510 -1426
- package/dist/avl/index.js +500 -416
- package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
- package/dist/components/game/2d/molecules/StateGraph.d.ts +38 -0
- package/dist/components/game/2d/molecules/StateJsonView.d.ts +37 -0
- package/dist/components/game/2d/{organisms → molecules}/TraitSlot.d.ts +6 -3
- package/dist/components/game/2d/{organisms → molecules}/TraitStateViewer.d.ts +0 -2
- package/dist/components/game/2d/molecules/VariablePanel.d.ts +28 -0
- package/dist/components/game/2d/molecules/index.d.ts +12 -11
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/2d/organisms/SequenceBar.d.ts +1 -1
- package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
- package/dist/components/index.cjs +275 -189
- package/dist/components/index.js +275 -190
- package/dist/providers/index.cjs +1377 -1293
- package/dist/providers/index.js +476 -392
- package/dist/runtime/index.cjs +1371 -1287
- package/dist/runtime/index.js +480 -396
- package/package.json +1 -1
- package/dist/components/game/2d/organisms/StateJsonView.d.ts +0 -17
- package/dist/components/game/2d/organisms/VariablePanel.d.ts +0 -22
- /package/dist/components/game/2d/{organisms → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/ActionTile.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/EventLog.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/RuleEditor.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/StateNode.d.ts +0 -0
- /package/dist/components/game/2d/{organisms → molecules}/TransitionArrow.d.ts +0 -0
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React98 from 'react';
|
|
2
|
+
import React98__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -388,7 +388,7 @@ var init_Box = __esm({
|
|
|
388
388
|
fixed: "fixed",
|
|
389
389
|
sticky: "sticky"
|
|
390
390
|
};
|
|
391
|
-
Box =
|
|
391
|
+
Box = React98__default.forwardRef(
|
|
392
392
|
({
|
|
393
393
|
padding,
|
|
394
394
|
paddingX,
|
|
@@ -453,7 +453,7 @@ var init_Box = __esm({
|
|
|
453
453
|
onPointerDown?.(e);
|
|
454
454
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
455
455
|
const isClickable = action || onClick;
|
|
456
|
-
return
|
|
456
|
+
return React98__default.createElement(
|
|
457
457
|
Component,
|
|
458
458
|
{
|
|
459
459
|
ref,
|
|
@@ -549,7 +549,7 @@ function loadLib(key, importer) {
|
|
|
549
549
|
return p;
|
|
550
550
|
}
|
|
551
551
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
552
|
-
const Lazy =
|
|
552
|
+
const Lazy = React98__default.lazy(async () => {
|
|
553
553
|
const lib = await loadLib(libKey, importer);
|
|
554
554
|
const Comp = pick(lib);
|
|
555
555
|
if (!Comp) {
|
|
@@ -559,7 +559,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
559
559
|
return { default: Comp };
|
|
560
560
|
});
|
|
561
561
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
562
|
-
|
|
562
|
+
React98__default.Suspense,
|
|
563
563
|
{
|
|
564
564
|
fallback: /* @__PURE__ */ jsx(
|
|
565
565
|
"span",
|
|
@@ -1290,7 +1290,7 @@ var init_Icon = __esm({
|
|
|
1290
1290
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1291
1291
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1292
1292
|
const family = useIconFamily();
|
|
1293
|
-
const RenderedComponent =
|
|
1293
|
+
const RenderedComponent = React98__default.useMemo(() => {
|
|
1294
1294
|
if (directIcon) return null;
|
|
1295
1295
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1296
1296
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1352,7 +1352,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1352
1352
|
const IconComp = value;
|
|
1353
1353
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1354
1354
|
}
|
|
1355
|
-
if (
|
|
1355
|
+
if (React98__default.isValidElement(value)) {
|
|
1356
1356
|
return value;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1428,7 +1428,7 @@ var init_Button = __esm({
|
|
|
1428
1428
|
md: "h-icon-default w-icon-default",
|
|
1429
1429
|
lg: "h-icon-default w-icon-default"
|
|
1430
1430
|
};
|
|
1431
|
-
Button =
|
|
1431
|
+
Button = React98__default.forwardRef(
|
|
1432
1432
|
({
|
|
1433
1433
|
className,
|
|
1434
1434
|
variant = "primary",
|
|
@@ -1496,7 +1496,7 @@ var Dialog;
|
|
|
1496
1496
|
var init_Dialog = __esm({
|
|
1497
1497
|
"components/core/atoms/Dialog.tsx"() {
|
|
1498
1498
|
init_cn();
|
|
1499
|
-
Dialog =
|
|
1499
|
+
Dialog = React98__default.forwardRef(
|
|
1500
1500
|
({
|
|
1501
1501
|
role = "dialog",
|
|
1502
1502
|
"aria-modal": ariaModal = true,
|
|
@@ -1614,7 +1614,7 @@ var init_Typography = __esm({
|
|
|
1614
1614
|
}) => {
|
|
1615
1615
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1616
1616
|
const Component = as || defaultElements[variant];
|
|
1617
|
-
return
|
|
1617
|
+
return React98__default.createElement(
|
|
1618
1618
|
Component,
|
|
1619
1619
|
{
|
|
1620
1620
|
id,
|
|
@@ -2109,7 +2109,7 @@ var init_Badge = __esm({
|
|
|
2109
2109
|
md: "px-2.5 py-1 text-sm",
|
|
2110
2110
|
lg: "px-3 py-1.5 text-base"
|
|
2111
2111
|
};
|
|
2112
|
-
Badge =
|
|
2112
|
+
Badge = React98__default.forwardRef(
|
|
2113
2113
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2114
2114
|
const iconSizes3 = {
|
|
2115
2115
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2446,7 +2446,7 @@ var init_SvgFlow = __esm({
|
|
|
2446
2446
|
width = 100,
|
|
2447
2447
|
height = 100
|
|
2448
2448
|
}) => {
|
|
2449
|
-
const markerId =
|
|
2449
|
+
const markerId = React98__default.useMemo(() => {
|
|
2450
2450
|
flowIdCounter += 1;
|
|
2451
2451
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2452
2452
|
}, []);
|
|
@@ -3039,7 +3039,7 @@ var init_SvgRing = __esm({
|
|
|
3039
3039
|
width = 100,
|
|
3040
3040
|
height = 100
|
|
3041
3041
|
}) => {
|
|
3042
|
-
const gradientId =
|
|
3042
|
+
const gradientId = React98__default.useMemo(() => {
|
|
3043
3043
|
ringIdCounter += 1;
|
|
3044
3044
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3045
3045
|
}, []);
|
|
@@ -3220,7 +3220,7 @@ var init_Input = __esm({
|
|
|
3220
3220
|
init_cn();
|
|
3221
3221
|
init_Icon();
|
|
3222
3222
|
init_useEventBus();
|
|
3223
|
-
Input =
|
|
3223
|
+
Input = React98__default.forwardRef(
|
|
3224
3224
|
({
|
|
3225
3225
|
className,
|
|
3226
3226
|
inputType,
|
|
@@ -3380,7 +3380,7 @@ var Label;
|
|
|
3380
3380
|
var init_Label = __esm({
|
|
3381
3381
|
"components/core/atoms/Label.tsx"() {
|
|
3382
3382
|
init_cn();
|
|
3383
|
-
Label =
|
|
3383
|
+
Label = React98__default.forwardRef(
|
|
3384
3384
|
({ className, required, children, ...props }, ref) => {
|
|
3385
3385
|
return /* @__PURE__ */ jsxs(
|
|
3386
3386
|
"label",
|
|
@@ -3407,7 +3407,7 @@ var init_Textarea = __esm({
|
|
|
3407
3407
|
"components/core/atoms/Textarea.tsx"() {
|
|
3408
3408
|
init_cn();
|
|
3409
3409
|
init_useEventBus();
|
|
3410
|
-
Textarea =
|
|
3410
|
+
Textarea = React98__default.forwardRef(
|
|
3411
3411
|
({ className, error, onChange, ...props }, ref) => {
|
|
3412
3412
|
const eventBus = useEventBus();
|
|
3413
3413
|
const handleChange = (e) => {
|
|
@@ -3646,7 +3646,7 @@ var init_Select = __esm({
|
|
|
3646
3646
|
init_cn();
|
|
3647
3647
|
init_Icon();
|
|
3648
3648
|
init_useEventBus();
|
|
3649
|
-
Select =
|
|
3649
|
+
Select = React98__default.forwardRef(
|
|
3650
3650
|
(props, _ref) => {
|
|
3651
3651
|
const { multiple, searchable, clearable } = props;
|
|
3652
3652
|
if (multiple || searchable || clearable) {
|
|
@@ -3663,7 +3663,7 @@ var init_Checkbox = __esm({
|
|
|
3663
3663
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3664
3664
|
init_cn();
|
|
3665
3665
|
init_useEventBus();
|
|
3666
|
-
Checkbox =
|
|
3666
|
+
Checkbox = React98__default.forwardRef(
|
|
3667
3667
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3668
3668
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3669
3669
|
const eventBus = useEventBus();
|
|
@@ -3717,7 +3717,7 @@ var init_Spinner = __esm({
|
|
|
3717
3717
|
md: "h-6 w-6",
|
|
3718
3718
|
lg: "h-8 w-8"
|
|
3719
3719
|
};
|
|
3720
|
-
Spinner =
|
|
3720
|
+
Spinner = React98__default.forwardRef(
|
|
3721
3721
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3722
3722
|
if (overlay) {
|
|
3723
3723
|
return /* @__PURE__ */ jsx(
|
|
@@ -3807,7 +3807,7 @@ var init_Card = __esm({
|
|
|
3807
3807
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3808
3808
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3809
3809
|
};
|
|
3810
|
-
Card =
|
|
3810
|
+
Card = React98__default.forwardRef(
|
|
3811
3811
|
({
|
|
3812
3812
|
className,
|
|
3813
3813
|
variant = "bordered",
|
|
@@ -3855,9 +3855,9 @@ var init_Card = __esm({
|
|
|
3855
3855
|
}
|
|
3856
3856
|
);
|
|
3857
3857
|
Card.displayName = "Card";
|
|
3858
|
-
CardHeader =
|
|
3858
|
+
CardHeader = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3859
3859
|
CardHeader.displayName = "CardHeader";
|
|
3860
|
-
CardTitle =
|
|
3860
|
+
CardTitle = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3861
3861
|
"h3",
|
|
3862
3862
|
{
|
|
3863
3863
|
ref,
|
|
@@ -3870,11 +3870,11 @@ var init_Card = __esm({
|
|
|
3870
3870
|
}
|
|
3871
3871
|
));
|
|
3872
3872
|
CardTitle.displayName = "CardTitle";
|
|
3873
|
-
CardContent =
|
|
3873
|
+
CardContent = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3874
3874
|
CardContent.displayName = "CardContent";
|
|
3875
3875
|
CardBody = CardContent;
|
|
3876
3876
|
CardBody.displayName = "CardBody";
|
|
3877
|
-
CardFooter =
|
|
3877
|
+
CardFooter = React98__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3878
3878
|
"div",
|
|
3879
3879
|
{
|
|
3880
3880
|
ref,
|
|
@@ -3929,7 +3929,7 @@ var init_FilterPill = __esm({
|
|
|
3929
3929
|
md: "w-3.5 h-3.5",
|
|
3930
3930
|
lg: "w-4 h-4"
|
|
3931
3931
|
};
|
|
3932
|
-
FilterPill =
|
|
3932
|
+
FilterPill = React98__default.forwardRef(
|
|
3933
3933
|
({
|
|
3934
3934
|
className,
|
|
3935
3935
|
variant = "default",
|
|
@@ -4058,8 +4058,8 @@ var init_Avatar = __esm({
|
|
|
4058
4058
|
actionPayload
|
|
4059
4059
|
}) => {
|
|
4060
4060
|
const eventBus = useEventBus();
|
|
4061
|
-
const [imgFailed, setImgFailed] =
|
|
4062
|
-
|
|
4061
|
+
const [imgFailed, setImgFailed] = React98__default.useState(false);
|
|
4062
|
+
React98__default.useEffect(() => {
|
|
4063
4063
|
setImgFailed(false);
|
|
4064
4064
|
}, [src]);
|
|
4065
4065
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4172,7 +4172,7 @@ var init_Center = __esm({
|
|
|
4172
4172
|
as: Component = "div"
|
|
4173
4173
|
}) => {
|
|
4174
4174
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4175
|
-
return
|
|
4175
|
+
return React98__default.createElement(Component, {
|
|
4176
4176
|
className: cn(
|
|
4177
4177
|
inline ? "inline-flex" : "flex",
|
|
4178
4178
|
horizontal && "justify-center",
|
|
@@ -4440,7 +4440,7 @@ var init_Radio = __esm({
|
|
|
4440
4440
|
md: "w-2.5 h-2.5",
|
|
4441
4441
|
lg: "w-3 h-3"
|
|
4442
4442
|
};
|
|
4443
|
-
Radio =
|
|
4443
|
+
Radio = React98__default.forwardRef(
|
|
4444
4444
|
({
|
|
4445
4445
|
label,
|
|
4446
4446
|
helperText,
|
|
@@ -4457,12 +4457,12 @@ var init_Radio = __esm({
|
|
|
4457
4457
|
onChange,
|
|
4458
4458
|
...props
|
|
4459
4459
|
}, ref) => {
|
|
4460
|
-
const reactId =
|
|
4460
|
+
const reactId = React98__default.useId();
|
|
4461
4461
|
const baseId = id || `radio-${reactId}`;
|
|
4462
4462
|
const hasError = !!error;
|
|
4463
4463
|
const eventBus = useEventBus();
|
|
4464
|
-
const [selected, setSelected] =
|
|
4465
|
-
|
|
4464
|
+
const [selected, setSelected] = React98__default.useState(value);
|
|
4465
|
+
React98__default.useEffect(() => {
|
|
4466
4466
|
if (value !== void 0) setSelected(value);
|
|
4467
4467
|
}, [value]);
|
|
4468
4468
|
const pick = (next, e) => {
|
|
@@ -4644,7 +4644,7 @@ var init_Switch = __esm({
|
|
|
4644
4644
|
"components/core/atoms/Switch.tsx"() {
|
|
4645
4645
|
"use client";
|
|
4646
4646
|
init_cn();
|
|
4647
|
-
Switch =
|
|
4647
|
+
Switch = React98.forwardRef(
|
|
4648
4648
|
({
|
|
4649
4649
|
checked,
|
|
4650
4650
|
defaultChecked = false,
|
|
@@ -4655,10 +4655,10 @@ var init_Switch = __esm({
|
|
|
4655
4655
|
name,
|
|
4656
4656
|
className
|
|
4657
4657
|
}, ref) => {
|
|
4658
|
-
const [isChecked, setIsChecked] =
|
|
4658
|
+
const [isChecked, setIsChecked] = React98.useState(
|
|
4659
4659
|
checked !== void 0 ? checked : defaultChecked
|
|
4660
4660
|
);
|
|
4661
|
-
|
|
4661
|
+
React98.useEffect(() => {
|
|
4662
4662
|
if (checked !== void 0) {
|
|
4663
4663
|
setIsChecked(checked);
|
|
4664
4664
|
}
|
|
@@ -4821,7 +4821,7 @@ var init_Stack = __esm({
|
|
|
4821
4821
|
};
|
|
4822
4822
|
const isHorizontal = direction === "horizontal";
|
|
4823
4823
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
4824
|
-
return
|
|
4824
|
+
return React98__default.createElement(
|
|
4825
4825
|
Component,
|
|
4826
4826
|
{
|
|
4827
4827
|
className: cn(
|
|
@@ -5021,7 +5021,7 @@ var Aside;
|
|
|
5021
5021
|
var init_Aside = __esm({
|
|
5022
5022
|
"components/core/atoms/Aside.tsx"() {
|
|
5023
5023
|
init_cn();
|
|
5024
|
-
Aside =
|
|
5024
|
+
Aside = React98__default.forwardRef(
|
|
5025
5025
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5026
5026
|
);
|
|
5027
5027
|
Aside.displayName = "Aside";
|
|
@@ -5100,9 +5100,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5100
5100
|
className
|
|
5101
5101
|
}) => {
|
|
5102
5102
|
const { t } = useTranslate();
|
|
5103
|
-
const [isVisible, setIsVisible] =
|
|
5104
|
-
const timeoutRef =
|
|
5105
|
-
const triggerRef =
|
|
5103
|
+
const [isVisible, setIsVisible] = React98__default.useState(false);
|
|
5104
|
+
const timeoutRef = React98__default.useRef(null);
|
|
5105
|
+
const triggerRef = React98__default.useRef(null);
|
|
5106
5106
|
const handleMouseEnter = () => {
|
|
5107
5107
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5108
5108
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5113,7 +5113,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5113
5113
|
};
|
|
5114
5114
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5115
5115
|
const open = isVisible || revealed;
|
|
5116
|
-
|
|
5116
|
+
React98__default.useEffect(() => {
|
|
5117
5117
|
return () => {
|
|
5118
5118
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5119
5119
|
};
|
|
@@ -5323,7 +5323,7 @@ var init_StatusDot = __esm({
|
|
|
5323
5323
|
md: "w-2.5 h-2.5",
|
|
5324
5324
|
lg: "w-3 h-3"
|
|
5325
5325
|
};
|
|
5326
|
-
StatusDot =
|
|
5326
|
+
StatusDot = React98__default.forwardRef(
|
|
5327
5327
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5328
5328
|
return /* @__PURE__ */ jsx(
|
|
5329
5329
|
"span",
|
|
@@ -5377,7 +5377,7 @@ var init_TrendIndicator = __esm({
|
|
|
5377
5377
|
down: "trending-down",
|
|
5378
5378
|
flat: "arrow-right"
|
|
5379
5379
|
};
|
|
5380
|
-
TrendIndicator =
|
|
5380
|
+
TrendIndicator = React98__default.forwardRef(
|
|
5381
5381
|
({
|
|
5382
5382
|
className,
|
|
5383
5383
|
value,
|
|
@@ -5444,7 +5444,7 @@ var init_RangeSlider = __esm({
|
|
|
5444
5444
|
md: "w-4 h-4",
|
|
5445
5445
|
lg: "w-5 h-5"
|
|
5446
5446
|
};
|
|
5447
|
-
RangeSlider =
|
|
5447
|
+
RangeSlider = React98__default.forwardRef(
|
|
5448
5448
|
({
|
|
5449
5449
|
className,
|
|
5450
5450
|
min = 0,
|
|
@@ -6038,7 +6038,7 @@ var init_ContentSection = __esm({
|
|
|
6038
6038
|
md: "py-16",
|
|
6039
6039
|
lg: "py-24"
|
|
6040
6040
|
};
|
|
6041
|
-
ContentSection =
|
|
6041
|
+
ContentSection = React98__default.forwardRef(
|
|
6042
6042
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6043
6043
|
return /* @__PURE__ */ jsx(
|
|
6044
6044
|
Box,
|
|
@@ -6572,7 +6572,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6572
6572
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6573
6573
|
"none": {}
|
|
6574
6574
|
};
|
|
6575
|
-
AnimatedReveal =
|
|
6575
|
+
AnimatedReveal = React98__default.forwardRef(
|
|
6576
6576
|
({
|
|
6577
6577
|
trigger = "scroll",
|
|
6578
6578
|
animation = "fade-up",
|
|
@@ -6732,7 +6732,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6732
6732
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6733
6733
|
"use client";
|
|
6734
6734
|
init_cn();
|
|
6735
|
-
AnimatedGraphic =
|
|
6735
|
+
AnimatedGraphic = React98__default.forwardRef(
|
|
6736
6736
|
({
|
|
6737
6737
|
src,
|
|
6738
6738
|
svgContent,
|
|
@@ -6755,7 +6755,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6755
6755
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6756
6756
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6757
6757
|
const prevAnimateRef = useRef(animate);
|
|
6758
|
-
const setRef =
|
|
6758
|
+
const setRef = React98__default.useCallback(
|
|
6759
6759
|
(node) => {
|
|
6760
6760
|
containerRef.current = node;
|
|
6761
6761
|
if (typeof ref === "function") ref(node);
|
|
@@ -7350,7 +7350,7 @@ function GameCard({
|
|
|
7350
7350
|
className
|
|
7351
7351
|
}) {
|
|
7352
7352
|
const eventBus = useEventBus();
|
|
7353
|
-
const handleClick =
|
|
7353
|
+
const handleClick = React98.useCallback(() => {
|
|
7354
7354
|
if (disabled) return;
|
|
7355
7355
|
onClick?.(id);
|
|
7356
7356
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -7632,9 +7632,9 @@ function ControlButton({
|
|
|
7632
7632
|
className
|
|
7633
7633
|
}) {
|
|
7634
7634
|
const eventBus = useEventBus();
|
|
7635
|
-
const [isPressed, setIsPressed] =
|
|
7635
|
+
const [isPressed, setIsPressed] = React98.useState(false);
|
|
7636
7636
|
const actualPressed = pressed ?? isPressed;
|
|
7637
|
-
const handlePointerDown =
|
|
7637
|
+
const handlePointerDown = React98.useCallback(
|
|
7638
7638
|
(e) => {
|
|
7639
7639
|
e.preventDefault();
|
|
7640
7640
|
if (disabled) return;
|
|
@@ -7644,7 +7644,7 @@ function ControlButton({
|
|
|
7644
7644
|
},
|
|
7645
7645
|
[disabled, pressEvent, eventBus, onPress]
|
|
7646
7646
|
);
|
|
7647
|
-
const handlePointerUp =
|
|
7647
|
+
const handlePointerUp = React98.useCallback(
|
|
7648
7648
|
(e) => {
|
|
7649
7649
|
e.preventDefault();
|
|
7650
7650
|
if (disabled) return;
|
|
@@ -7654,7 +7654,7 @@ function ControlButton({
|
|
|
7654
7654
|
},
|
|
7655
7655
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7656
7656
|
);
|
|
7657
|
-
const handlePointerLeave =
|
|
7657
|
+
const handlePointerLeave = React98.useCallback(
|
|
7658
7658
|
(e) => {
|
|
7659
7659
|
if (isPressed) {
|
|
7660
7660
|
setIsPressed(false);
|
|
@@ -8673,8 +8673,8 @@ function MiniMap({
|
|
|
8673
8673
|
tileAssets,
|
|
8674
8674
|
unitAssets
|
|
8675
8675
|
}) {
|
|
8676
|
-
const canvasRef =
|
|
8677
|
-
const imgCacheRef =
|
|
8676
|
+
const canvasRef = React98.useRef(null);
|
|
8677
|
+
const imgCacheRef = React98.useRef(/* @__PURE__ */ new Map());
|
|
8678
8678
|
function loadImg(url) {
|
|
8679
8679
|
const cached = imgCacheRef.current.get(url);
|
|
8680
8680
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8689,7 +8689,7 @@ function MiniMap({
|
|
|
8689
8689
|
imgCacheRef.current.set(url, img);
|
|
8690
8690
|
return null;
|
|
8691
8691
|
}
|
|
8692
|
-
|
|
8692
|
+
React98.useEffect(() => {
|
|
8693
8693
|
const canvas = canvasRef.current;
|
|
8694
8694
|
if (!canvas) return;
|
|
8695
8695
|
const ctx = canvas.getContext("2d");
|
|
@@ -8824,8 +8824,8 @@ function ControlGrid({
|
|
|
8824
8824
|
className
|
|
8825
8825
|
}) {
|
|
8826
8826
|
const eventBus = useEventBus();
|
|
8827
|
-
const [active, setActive] =
|
|
8828
|
-
const handlePress =
|
|
8827
|
+
const [active, setActive] = React98.useState(/* @__PURE__ */ new Set());
|
|
8828
|
+
const handlePress = React98.useCallback(
|
|
8829
8829
|
(id) => {
|
|
8830
8830
|
setActive((prev) => new Set(prev).add(id));
|
|
8831
8831
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8839,7 +8839,7 @@ function ControlGrid({
|
|
|
8839
8839
|
},
|
|
8840
8840
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
8841
8841
|
);
|
|
8842
|
-
const handleRelease =
|
|
8842
|
+
const handleRelease = React98.useCallback(
|
|
8843
8843
|
(id) => {
|
|
8844
8844
|
setActive((prev) => {
|
|
8845
8845
|
const next = new Set(prev);
|
|
@@ -9097,7 +9097,7 @@ function InventoryGrid({
|
|
|
9097
9097
|
const eventBus = useEventBus();
|
|
9098
9098
|
const slotCount = totalSlots ?? items.length;
|
|
9099
9099
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9100
|
-
const handleSelect =
|
|
9100
|
+
const handleSelect = React98.useCallback(
|
|
9101
9101
|
(id) => {
|
|
9102
9102
|
onSelect?.(id);
|
|
9103
9103
|
if (selectEvent) {
|
|
@@ -9314,7 +9314,7 @@ function GameMenu({
|
|
|
9314
9314
|
}) {
|
|
9315
9315
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9316
9316
|
const eventBus = useEventBus();
|
|
9317
|
-
const handleOptionClick =
|
|
9317
|
+
const handleOptionClick = React98.useCallback(
|
|
9318
9318
|
(option) => {
|
|
9319
9319
|
if (option.event) {
|
|
9320
9320
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -9391,6 +9391,214 @@ var init_GameMenu = __esm({
|
|
|
9391
9391
|
GameMenu.displayName = "GameMenu";
|
|
9392
9392
|
}
|
|
9393
9393
|
});
|
|
9394
|
+
function StateNode({
|
|
9395
|
+
name,
|
|
9396
|
+
isCurrent = false,
|
|
9397
|
+
isSelected = false,
|
|
9398
|
+
isInitial = false,
|
|
9399
|
+
position,
|
|
9400
|
+
onClick,
|
|
9401
|
+
className
|
|
9402
|
+
}) {
|
|
9403
|
+
return /* @__PURE__ */ jsx(
|
|
9404
|
+
Box,
|
|
9405
|
+
{
|
|
9406
|
+
position: "absolute",
|
|
9407
|
+
display: "flex",
|
|
9408
|
+
className: cn(
|
|
9409
|
+
"items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
|
|
9410
|
+
"min-w-[80px] h-[80px] px-3",
|
|
9411
|
+
isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
|
|
9412
|
+
isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
|
|
9413
|
+
!isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
|
|
9414
|
+
className
|
|
9415
|
+
),
|
|
9416
|
+
style: {
|
|
9417
|
+
left: position.x,
|
|
9418
|
+
top: position.y,
|
|
9419
|
+
transform: "translate(-50%, -50%)"
|
|
9420
|
+
},
|
|
9421
|
+
onClick,
|
|
9422
|
+
children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
|
|
9423
|
+
isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
|
|
9424
|
+
/* @__PURE__ */ jsx(
|
|
9425
|
+
Typography,
|
|
9426
|
+
{
|
|
9427
|
+
variant: "body2",
|
|
9428
|
+
className: cn(
|
|
9429
|
+
"font-bold whitespace-nowrap",
|
|
9430
|
+
isCurrent ? "text-primary" : "text-foreground"
|
|
9431
|
+
),
|
|
9432
|
+
children: name
|
|
9433
|
+
}
|
|
9434
|
+
)
|
|
9435
|
+
] })
|
|
9436
|
+
}
|
|
9437
|
+
);
|
|
9438
|
+
}
|
|
9439
|
+
var init_StateNode = __esm({
|
|
9440
|
+
"components/game/2d/molecules/StateNode.tsx"() {
|
|
9441
|
+
init_atoms();
|
|
9442
|
+
init_cn();
|
|
9443
|
+
StateNode.displayName = "StateNode";
|
|
9444
|
+
}
|
|
9445
|
+
});
|
|
9446
|
+
function TransitionArrow({
|
|
9447
|
+
from,
|
|
9448
|
+
to,
|
|
9449
|
+
eventLabel,
|
|
9450
|
+
guardHint,
|
|
9451
|
+
isActive = false,
|
|
9452
|
+
onClick,
|
|
9453
|
+
className
|
|
9454
|
+
}) {
|
|
9455
|
+
const dx = to.x - from.x;
|
|
9456
|
+
const dy = to.y - from.y;
|
|
9457
|
+
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
9458
|
+
if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
|
|
9459
|
+
const nx = dx / dist;
|
|
9460
|
+
const ny = dy / dist;
|
|
9461
|
+
const startX = from.x + nx * NODE_RADIUS;
|
|
9462
|
+
const startY = from.y + ny * NODE_RADIUS;
|
|
9463
|
+
const endX = to.x - nx * NODE_RADIUS;
|
|
9464
|
+
const endY = to.y - ny * NODE_RADIUS;
|
|
9465
|
+
const midX = (startX + endX) / 2;
|
|
9466
|
+
const midY = (startY + endY) / 2;
|
|
9467
|
+
const perpX = -ny * 20;
|
|
9468
|
+
const perpY = nx * 20;
|
|
9469
|
+
const ctrlX = midX + perpX;
|
|
9470
|
+
const ctrlY = midY + perpY;
|
|
9471
|
+
const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
|
|
9472
|
+
return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
|
|
9473
|
+
/* @__PURE__ */ jsx(
|
|
9474
|
+
"path",
|
|
9475
|
+
{
|
|
9476
|
+
d: path,
|
|
9477
|
+
fill: "none",
|
|
9478
|
+
stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
|
|
9479
|
+
strokeWidth: isActive ? 3 : 2,
|
|
9480
|
+
markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
|
|
9481
|
+
}
|
|
9482
|
+
),
|
|
9483
|
+
/* @__PURE__ */ jsx(
|
|
9484
|
+
"text",
|
|
9485
|
+
{
|
|
9486
|
+
x: ctrlX,
|
|
9487
|
+
y: ctrlY - 8,
|
|
9488
|
+
textAnchor: "middle",
|
|
9489
|
+
fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
|
|
9490
|
+
fontSize: 12,
|
|
9491
|
+
fontWeight: isActive ? "bold" : "normal",
|
|
9492
|
+
className: "select-none",
|
|
9493
|
+
children: eventLabel
|
|
9494
|
+
}
|
|
9495
|
+
),
|
|
9496
|
+
guardHint && /* @__PURE__ */ jsx(
|
|
9497
|
+
"text",
|
|
9498
|
+
{
|
|
9499
|
+
x: ctrlX,
|
|
9500
|
+
y: ctrlY + 6,
|
|
9501
|
+
textAnchor: "middle",
|
|
9502
|
+
fill: "var(--color-warning)",
|
|
9503
|
+
fontSize: 10,
|
|
9504
|
+
className: "select-none",
|
|
9505
|
+
children: "\u26A0 " + guardHint
|
|
9506
|
+
}
|
|
9507
|
+
)
|
|
9508
|
+
] });
|
|
9509
|
+
}
|
|
9510
|
+
var NODE_RADIUS;
|
|
9511
|
+
var init_TransitionArrow = __esm({
|
|
9512
|
+
"components/game/2d/molecules/TransitionArrow.tsx"() {
|
|
9513
|
+
init_cn();
|
|
9514
|
+
NODE_RADIUS = 40;
|
|
9515
|
+
TransitionArrow.displayName = "TransitionArrow";
|
|
9516
|
+
}
|
|
9517
|
+
});
|
|
9518
|
+
function layoutStates(states, width, height) {
|
|
9519
|
+
const cx = width / 2;
|
|
9520
|
+
const cy = height / 2;
|
|
9521
|
+
const radius = Math.min(cx, cy) - 60;
|
|
9522
|
+
const positions = {};
|
|
9523
|
+
states.forEach((state, i) => {
|
|
9524
|
+
const angle = 2 * Math.PI * i / Math.max(states.length, 1) - Math.PI / 2;
|
|
9525
|
+
positions[state] = { x: cx + radius * Math.cos(angle), y: cy + radius * Math.sin(angle) };
|
|
9526
|
+
});
|
|
9527
|
+
return positions;
|
|
9528
|
+
}
|
|
9529
|
+
function StateGraph({
|
|
9530
|
+
states,
|
|
9531
|
+
transitions = [],
|
|
9532
|
+
currentState,
|
|
9533
|
+
selectedState,
|
|
9534
|
+
addingFrom,
|
|
9535
|
+
initialState,
|
|
9536
|
+
width = 500,
|
|
9537
|
+
height = 400,
|
|
9538
|
+
nodeClickEvent,
|
|
9539
|
+
className
|
|
9540
|
+
}) {
|
|
9541
|
+
const eventBus = useEventBus();
|
|
9542
|
+
const nodes = states ?? [];
|
|
9543
|
+
const positions = React98.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
9544
|
+
return /* @__PURE__ */ jsxs(
|
|
9545
|
+
Box,
|
|
9546
|
+
{
|
|
9547
|
+
position: "relative",
|
|
9548
|
+
className: cn("rounded-container border border-border bg-background overflow-hidden", className),
|
|
9549
|
+
style: { width, height },
|
|
9550
|
+
children: [
|
|
9551
|
+
/* @__PURE__ */ jsxs("svg", { width, height, className: "absolute inset-0", style: { pointerEvents: "none" }, children: [
|
|
9552
|
+
/* @__PURE__ */ jsxs("defs", { children: [
|
|
9553
|
+
/* @__PURE__ */ jsx("marker", { id: "arrowhead", markerWidth: "10", markerHeight: "7", refX: "10", refY: "3.5", orient: "auto", children: /* @__PURE__ */ jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--color-border)" }) }),
|
|
9554
|
+
/* @__PURE__ */ jsx("marker", { id: "arrowhead-active", markerWidth: "10", markerHeight: "7", refX: "10", refY: "3.5", orient: "auto", children: /* @__PURE__ */ jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: "var(--color-primary)" }) })
|
|
9555
|
+
] }),
|
|
9556
|
+
transitions.map((tr, i) => {
|
|
9557
|
+
const fromPos = positions[tr.from];
|
|
9558
|
+
const toPos = positions[tr.to];
|
|
9559
|
+
if (!fromPos || !toPos) return null;
|
|
9560
|
+
return /* @__PURE__ */ jsx(
|
|
9561
|
+
TransitionArrow,
|
|
9562
|
+
{
|
|
9563
|
+
from: fromPos,
|
|
9564
|
+
to: toPos,
|
|
9565
|
+
eventLabel: tr.event,
|
|
9566
|
+
guardHint: tr.guardHint,
|
|
9567
|
+
isActive: tr.from === currentState
|
|
9568
|
+
},
|
|
9569
|
+
`${tr.from}-${tr.event}-${tr.to}-${i}`
|
|
9570
|
+
);
|
|
9571
|
+
})
|
|
9572
|
+
] }),
|
|
9573
|
+
nodes.map((state) => {
|
|
9574
|
+
const pos = positions[state];
|
|
9575
|
+
if (!pos) return null;
|
|
9576
|
+
return /* @__PURE__ */ jsx(
|
|
9577
|
+
StateNode,
|
|
9578
|
+
{
|
|
9579
|
+
name: state,
|
|
9580
|
+
position: pos,
|
|
9581
|
+
isCurrent: state === currentState,
|
|
9582
|
+
isSelected: state === selectedState || state === addingFrom,
|
|
9583
|
+
isInitial: state === initialState,
|
|
9584
|
+
onClick: nodeClickEvent ? () => eventBus.emit(`UI:${nodeClickEvent}`, { stateId: state }) : void 0
|
|
9585
|
+
},
|
|
9586
|
+
state
|
|
9587
|
+
);
|
|
9588
|
+
})
|
|
9589
|
+
]
|
|
9590
|
+
}
|
|
9591
|
+
);
|
|
9592
|
+
}
|
|
9593
|
+
var init_StateGraph = __esm({
|
|
9594
|
+
"components/game/2d/molecules/StateGraph.tsx"() {
|
|
9595
|
+
init_atoms();
|
|
9596
|
+
init_cn();
|
|
9597
|
+
init_useEventBus();
|
|
9598
|
+
init_StateNode();
|
|
9599
|
+
init_TransitionArrow();
|
|
9600
|
+
}
|
|
9601
|
+
});
|
|
9394
9602
|
function useCamera() {
|
|
9395
9603
|
const cameraRef = useRef({ x: 0, y: 0, zoom: 1 });
|
|
9396
9604
|
const targetCameraRef = useRef(null);
|
|
@@ -10988,7 +11196,7 @@ function LinearView({
|
|
|
10988
11196
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
10989
11197
|
const isDone = i < currentIdx;
|
|
10990
11198
|
const isCurrent = i === currentIdx;
|
|
10991
|
-
return /* @__PURE__ */ jsxs(
|
|
11199
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
10992
11200
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10993
11201
|
Typography,
|
|
10994
11202
|
{
|
|
@@ -11185,7 +11393,7 @@ function TraitStateViewer({
|
|
|
11185
11393
|
}
|
|
11186
11394
|
var SIZE_CONFIG;
|
|
11187
11395
|
var init_TraitStateViewer = __esm({
|
|
11188
|
-
"components/game/2d/
|
|
11396
|
+
"components/game/2d/molecules/TraitStateViewer.tsx"() {
|
|
11189
11397
|
"use client";
|
|
11190
11398
|
init_cn();
|
|
11191
11399
|
init_Box();
|
|
@@ -11218,7 +11426,8 @@ function TraitSlot({
|
|
|
11218
11426
|
onClick,
|
|
11219
11427
|
onRemove,
|
|
11220
11428
|
clickEvent,
|
|
11221
|
-
removeEvent
|
|
11429
|
+
removeEvent,
|
|
11430
|
+
dropEvent
|
|
11222
11431
|
}) {
|
|
11223
11432
|
const { emit } = useEventBus();
|
|
11224
11433
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -11250,29 +11459,30 @@ function TraitSlot({
|
|
|
11250
11459
|
onDragStart?.(equippedItem);
|
|
11251
11460
|
}, [equippedItem, draggable, onDragStart]);
|
|
11252
11461
|
const handleDragOver = useCallback((e) => {
|
|
11253
|
-
if (locked || !onItemDrop) return;
|
|
11462
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11254
11463
|
if (e.dataTransfer.types.includes(DRAG_MIME)) {
|
|
11255
11464
|
e.preventDefault();
|
|
11256
11465
|
const allowed = e.dataTransfer.effectAllowed;
|
|
11257
11466
|
e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
|
|
11258
11467
|
setIsDragOver(true);
|
|
11259
11468
|
}
|
|
11260
|
-
}, [locked, onItemDrop]);
|
|
11469
|
+
}, [locked, onItemDrop, dropEvent]);
|
|
11261
11470
|
const handleDragLeave = useCallback(() => {
|
|
11262
11471
|
setIsDragOver(false);
|
|
11263
11472
|
}, []);
|
|
11264
11473
|
const handleDrop = useCallback((e) => {
|
|
11265
11474
|
e.preventDefault();
|
|
11266
11475
|
setIsDragOver(false);
|
|
11267
|
-
if (locked || !onItemDrop) return;
|
|
11476
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11268
11477
|
const raw = e.dataTransfer.getData(DRAG_MIME);
|
|
11269
11478
|
if (!raw) return;
|
|
11270
11479
|
try {
|
|
11271
11480
|
const item = JSON.parse(raw);
|
|
11272
|
-
|
|
11481
|
+
if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
|
|
11482
|
+
else onItemDrop?.(item);
|
|
11273
11483
|
} catch {
|
|
11274
11484
|
}
|
|
11275
|
-
}, [locked, onItemDrop]);
|
|
11485
|
+
}, [locked, onItemDrop, dropEvent, emit, slotNumber]);
|
|
11276
11486
|
const getTooltipStyle = () => {
|
|
11277
11487
|
if (!slotRef.current) return {};
|
|
11278
11488
|
const rect = slotRef.current.getBoundingClientRect();
|
|
@@ -11392,7 +11602,7 @@ function TraitSlot({
|
|
|
11392
11602
|
}
|
|
11393
11603
|
var SIZE_CONFIG2, DRAG_MIME;
|
|
11394
11604
|
var init_TraitSlot = __esm({
|
|
11395
|
-
"components/game/2d/
|
|
11605
|
+
"components/game/2d/molecules/TraitSlot.tsx"() {
|
|
11396
11606
|
"use client";
|
|
11397
11607
|
init_cn();
|
|
11398
11608
|
init_useEventBus();
|
|
@@ -11451,7 +11661,7 @@ function ActionTile({
|
|
|
11451
11661
|
}
|
|
11452
11662
|
var DRAG_MIME2, SIZE_CONFIG3;
|
|
11453
11663
|
var init_ActionTile = __esm({
|
|
11454
|
-
"components/game/2d/
|
|
11664
|
+
"components/game/2d/molecules/ActionTile.tsx"() {
|
|
11455
11665
|
init_atoms();
|
|
11456
11666
|
init_cn();
|
|
11457
11667
|
DRAG_MIME2 = "application/x-almadar-slot-item";
|
|
@@ -11488,7 +11698,7 @@ function ActionPalette({
|
|
|
11488
11698
|
] });
|
|
11489
11699
|
}
|
|
11490
11700
|
var init_ActionPalette = __esm({
|
|
11491
|
-
"components/game/2d/
|
|
11701
|
+
"components/game/2d/molecules/ActionPalette.tsx"() {
|
|
11492
11702
|
init_atoms();
|
|
11493
11703
|
init_cn();
|
|
11494
11704
|
init_ActionTile();
|
|
@@ -11516,7 +11726,7 @@ function SequenceBar({
|
|
|
11516
11726
|
onSlotRemove(index);
|
|
11517
11727
|
}, [onSlotRemove, playing]);
|
|
11518
11728
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11519
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
11729
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
11520
11730
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11521
11731
|
Typography,
|
|
11522
11732
|
{
|
|
@@ -11864,7 +12074,7 @@ function RuleEditor({
|
|
|
11864
12074
|
] });
|
|
11865
12075
|
}
|
|
11866
12076
|
var init_RuleEditor = __esm({
|
|
11867
|
-
"components/game/2d/
|
|
12077
|
+
"components/game/2d/molecules/RuleEditor.tsx"() {
|
|
11868
12078
|
init_atoms();
|
|
11869
12079
|
init_cn();
|
|
11870
12080
|
RuleEditor.displayName = "RuleEditor";
|
|
@@ -11905,7 +12115,7 @@ function EventLog({
|
|
|
11905
12115
|
}
|
|
11906
12116
|
var STATUS_STYLES, STATUS_DOTS;
|
|
11907
12117
|
var init_EventLog = __esm({
|
|
11908
|
-
"components/game/2d/
|
|
12118
|
+
"components/game/2d/molecules/EventLog.tsx"() {
|
|
11909
12119
|
init_atoms();
|
|
11910
12120
|
init_cn();
|
|
11911
12121
|
STATUS_STYLES = {
|
|
@@ -11960,10 +12170,12 @@ var init_puzzleObject = __esm({
|
|
|
11960
12170
|
function ObjectRulePanel({
|
|
11961
12171
|
object,
|
|
11962
12172
|
onRulesChange,
|
|
12173
|
+
rulesChangeEvent,
|
|
11963
12174
|
disabled = false,
|
|
11964
12175
|
className
|
|
11965
12176
|
}) {
|
|
11966
12177
|
const { t } = useTranslate();
|
|
12178
|
+
const { emit } = useEventBus();
|
|
11967
12179
|
const id = objId(object);
|
|
11968
12180
|
const name = objName(object);
|
|
11969
12181
|
const icon = objIcon(object);
|
|
@@ -11974,15 +12186,19 @@ function ObjectRulePanel({
|
|
|
11974
12186
|
const rules = objRules(object);
|
|
11975
12187
|
const maxRules = objMaxRules(object);
|
|
11976
12188
|
const canAdd = rules.length < maxRules;
|
|
12189
|
+
const emitRules = useCallback((newRules) => {
|
|
12190
|
+
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
12191
|
+
else onRulesChange?.(id, newRules);
|
|
12192
|
+
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
11977
12193
|
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
11978
12194
|
const newRules = [...rules];
|
|
11979
12195
|
newRules[index] = updatedRule;
|
|
11980
|
-
|
|
11981
|
-
}, [
|
|
12196
|
+
emitRules(newRules);
|
|
12197
|
+
}, [rules, emitRules]);
|
|
11982
12198
|
const handleRuleRemove = useCallback((index) => {
|
|
11983
12199
|
const newRules = rules.filter((_, i) => i !== index);
|
|
11984
|
-
|
|
11985
|
-
}, [
|
|
12200
|
+
emitRules(newRules);
|
|
12201
|
+
}, [rules, emitRules]);
|
|
11986
12202
|
const handleAddRule = useCallback(() => {
|
|
11987
12203
|
if (!canAdd || disabled) return;
|
|
11988
12204
|
const firstEvent = availableEvents[0]?.value || "";
|
|
@@ -11992,8 +12208,8 @@ function ObjectRulePanel({
|
|
|
11992
12208
|
whenEvent: firstEvent,
|
|
11993
12209
|
thenAction: firstAction
|
|
11994
12210
|
};
|
|
11995
|
-
|
|
11996
|
-
}, [canAdd, disabled,
|
|
12211
|
+
emitRules([...rules, newRule]);
|
|
12212
|
+
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
11997
12213
|
const machine = {
|
|
11998
12214
|
name,
|
|
11999
12215
|
states,
|
|
@@ -12033,9 +12249,10 @@ function ObjectRulePanel({
|
|
|
12033
12249
|
}
|
|
12034
12250
|
var nextRuleId;
|
|
12035
12251
|
var init_ObjectRulePanel = __esm({
|
|
12036
|
-
"components/game/2d/
|
|
12252
|
+
"components/game/2d/molecules/ObjectRulePanel.tsx"() {
|
|
12037
12253
|
init_atoms();
|
|
12038
12254
|
init_cn();
|
|
12255
|
+
init_useEventBus();
|
|
12039
12256
|
init_TraitStateViewer();
|
|
12040
12257
|
init_RuleEditor();
|
|
12041
12258
|
init_puzzleObject();
|
|
@@ -12257,130 +12474,6 @@ var init_EventHandlerBoard = __esm({
|
|
|
12257
12474
|
EventHandlerBoard.displayName = "EventHandlerBoard";
|
|
12258
12475
|
}
|
|
12259
12476
|
});
|
|
12260
|
-
function StateNode({
|
|
12261
|
-
name,
|
|
12262
|
-
isCurrent = false,
|
|
12263
|
-
isSelected = false,
|
|
12264
|
-
isInitial = false,
|
|
12265
|
-
position,
|
|
12266
|
-
onClick,
|
|
12267
|
-
className
|
|
12268
|
-
}) {
|
|
12269
|
-
return /* @__PURE__ */ jsx(
|
|
12270
|
-
Box,
|
|
12271
|
-
{
|
|
12272
|
-
position: "absolute",
|
|
12273
|
-
display: "flex",
|
|
12274
|
-
className: cn(
|
|
12275
|
-
"items-center justify-center rounded-pill border-3 transition-all cursor-pointer select-none",
|
|
12276
|
-
"min-w-[80px] h-[80px] px-3",
|
|
12277
|
-
isCurrent && "bg-primary/20 border-primary shadow-lg shadow-primary/30 scale-110",
|
|
12278
|
-
isSelected && !isCurrent && "bg-accent/20 border-accent ring-2 ring-accent/50",
|
|
12279
|
-
!isCurrent && !isSelected && "bg-card border-border hover:border-muted-foreground hover:scale-105",
|
|
12280
|
-
className
|
|
12281
|
-
),
|
|
12282
|
-
style: {
|
|
12283
|
-
left: position.x,
|
|
12284
|
-
top: position.y,
|
|
12285
|
-
transform: "translate(-50%, -50%)"
|
|
12286
|
-
},
|
|
12287
|
-
onClick,
|
|
12288
|
-
children: /* @__PURE__ */ jsxs(Box, { className: "text-center", children: [
|
|
12289
|
-
isInitial && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground text-xs block", children: "\u25B6 start" }),
|
|
12290
|
-
/* @__PURE__ */ jsx(
|
|
12291
|
-
Typography,
|
|
12292
|
-
{
|
|
12293
|
-
variant: "body2",
|
|
12294
|
-
className: cn(
|
|
12295
|
-
"font-bold whitespace-nowrap",
|
|
12296
|
-
isCurrent ? "text-primary" : "text-foreground"
|
|
12297
|
-
),
|
|
12298
|
-
children: name
|
|
12299
|
-
}
|
|
12300
|
-
)
|
|
12301
|
-
] })
|
|
12302
|
-
}
|
|
12303
|
-
);
|
|
12304
|
-
}
|
|
12305
|
-
var init_StateNode = __esm({
|
|
12306
|
-
"components/game/2d/organisms/StateNode.tsx"() {
|
|
12307
|
-
init_atoms();
|
|
12308
|
-
init_cn();
|
|
12309
|
-
StateNode.displayName = "StateNode";
|
|
12310
|
-
}
|
|
12311
|
-
});
|
|
12312
|
-
function TransitionArrow({
|
|
12313
|
-
from,
|
|
12314
|
-
to,
|
|
12315
|
-
eventLabel,
|
|
12316
|
-
guardHint,
|
|
12317
|
-
isActive = false,
|
|
12318
|
-
onClick,
|
|
12319
|
-
className
|
|
12320
|
-
}) {
|
|
12321
|
-
const dx = to.x - from.x;
|
|
12322
|
-
const dy = to.y - from.y;
|
|
12323
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
12324
|
-
if (dist === 0) return /* @__PURE__ */ jsx(Fragment, {});
|
|
12325
|
-
const nx = dx / dist;
|
|
12326
|
-
const ny = dy / dist;
|
|
12327
|
-
const startX = from.x + nx * NODE_RADIUS;
|
|
12328
|
-
const startY = from.y + ny * NODE_RADIUS;
|
|
12329
|
-
const endX = to.x - nx * NODE_RADIUS;
|
|
12330
|
-
const endY = to.y - ny * NODE_RADIUS;
|
|
12331
|
-
const midX = (startX + endX) / 2;
|
|
12332
|
-
const midY = (startY + endY) / 2;
|
|
12333
|
-
const perpX = -ny * 20;
|
|
12334
|
-
const perpY = nx * 20;
|
|
12335
|
-
const ctrlX = midX + perpX;
|
|
12336
|
-
const ctrlY = midY + perpY;
|
|
12337
|
-
const path = `M ${startX} ${startY} Q ${ctrlX} ${ctrlY} ${endX} ${endY}`;
|
|
12338
|
-
return /* @__PURE__ */ jsxs("g", { className: cn("cursor-pointer", className), onClick, children: [
|
|
12339
|
-
/* @__PURE__ */ jsx(
|
|
12340
|
-
"path",
|
|
12341
|
-
{
|
|
12342
|
-
d: path,
|
|
12343
|
-
fill: "none",
|
|
12344
|
-
stroke: isActive ? "var(--color-primary)" : "var(--color-border)",
|
|
12345
|
-
strokeWidth: isActive ? 3 : 2,
|
|
12346
|
-
markerEnd: isActive ? "url(#arrowhead-active)" : "url(#arrowhead)"
|
|
12347
|
-
}
|
|
12348
|
-
),
|
|
12349
|
-
/* @__PURE__ */ jsx(
|
|
12350
|
-
"text",
|
|
12351
|
-
{
|
|
12352
|
-
x: ctrlX,
|
|
12353
|
-
y: ctrlY - 8,
|
|
12354
|
-
textAnchor: "middle",
|
|
12355
|
-
fill: isActive ? "var(--color-primary)" : "var(--color-foreground)",
|
|
12356
|
-
fontSize: 12,
|
|
12357
|
-
fontWeight: isActive ? "bold" : "normal",
|
|
12358
|
-
className: "select-none",
|
|
12359
|
-
children: eventLabel
|
|
12360
|
-
}
|
|
12361
|
-
),
|
|
12362
|
-
guardHint && /* @__PURE__ */ jsx(
|
|
12363
|
-
"text",
|
|
12364
|
-
{
|
|
12365
|
-
x: ctrlX,
|
|
12366
|
-
y: ctrlY + 6,
|
|
12367
|
-
textAnchor: "middle",
|
|
12368
|
-
fill: "var(--color-warning)",
|
|
12369
|
-
fontSize: 10,
|
|
12370
|
-
className: "select-none",
|
|
12371
|
-
children: "\u26A0 " + guardHint
|
|
12372
|
-
}
|
|
12373
|
-
)
|
|
12374
|
-
] });
|
|
12375
|
-
}
|
|
12376
|
-
var NODE_RADIUS;
|
|
12377
|
-
var init_TransitionArrow = __esm({
|
|
12378
|
-
"components/game/2d/organisms/TransitionArrow.tsx"() {
|
|
12379
|
-
init_cn();
|
|
12380
|
-
NODE_RADIUS = 40;
|
|
12381
|
-
TransitionArrow.displayName = "TransitionArrow";
|
|
12382
|
-
}
|
|
12383
|
-
});
|
|
12384
12477
|
function VariablePanel({
|
|
12385
12478
|
entityName,
|
|
12386
12479
|
variables,
|
|
@@ -12389,61 +12482,35 @@ function VariablePanel({
|
|
|
12389
12482
|
const { t } = useTranslate();
|
|
12390
12483
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
12391
12484
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
12392
|
-
variables.map((v) => {
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
const min = numField(v.min, 0);
|
|
12397
|
-
const unit = v.unit == null ? "" : String(v.unit);
|
|
12398
|
-
const pct = Math.round((value - min) / (max - min) * 100);
|
|
12399
|
-
const isHigh = pct > 80;
|
|
12400
|
-
const isLow = pct < 20;
|
|
12401
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
12402
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12403
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
|
|
12404
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
|
|
12405
|
-
isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
|
|
12406
|
-
), children: [
|
|
12407
|
-
value,
|
|
12408
|
-
unit,
|
|
12409
|
-
" / ",
|
|
12410
|
-
max,
|
|
12411
|
-
unit
|
|
12412
|
-
] })
|
|
12413
|
-
] }),
|
|
12414
|
-
/* @__PURE__ */ jsx(
|
|
12415
|
-
ProgressBar,
|
|
12416
|
-
{
|
|
12417
|
-
value: pct,
|
|
12418
|
-
color: isHigh ? "danger" : isLow ? "warning" : "primary",
|
|
12419
|
-
size: "sm"
|
|
12420
|
-
}
|
|
12421
|
-
)
|
|
12422
|
-
] }, name);
|
|
12423
|
-
})
|
|
12485
|
+
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12486
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
12487
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
12488
|
+
] }, v.name))
|
|
12424
12489
|
] });
|
|
12425
12490
|
}
|
|
12426
|
-
var numField;
|
|
12427
12491
|
var init_VariablePanel = __esm({
|
|
12428
|
-
"components/game/2d/
|
|
12492
|
+
"components/game/2d/molecules/VariablePanel.tsx"() {
|
|
12429
12493
|
init_atoms();
|
|
12430
12494
|
init_cn();
|
|
12431
|
-
numField = (v, fallback = 0) => {
|
|
12432
|
-
const n = Number(v);
|
|
12433
|
-
return Number.isFinite(n) ? n : fallback;
|
|
12434
|
-
};
|
|
12435
12495
|
VariablePanel.displayName = "VariablePanel";
|
|
12436
12496
|
}
|
|
12437
12497
|
});
|
|
12438
12498
|
function StateJsonView({
|
|
12439
|
-
|
|
12499
|
+
name,
|
|
12500
|
+
initialState,
|
|
12501
|
+
states,
|
|
12502
|
+
transitions,
|
|
12440
12503
|
label,
|
|
12441
12504
|
defaultExpanded = false,
|
|
12442
12505
|
className
|
|
12443
12506
|
}) {
|
|
12444
12507
|
const { t } = useTranslate();
|
|
12445
12508
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
12446
|
-
const jsonString = JSON.stringify(
|
|
12509
|
+
const jsonString = JSON.stringify(
|
|
12510
|
+
{ name, initialState, states: states ?? [], transitions: transitions ?? [] },
|
|
12511
|
+
null,
|
|
12512
|
+
2
|
|
12513
|
+
);
|
|
12447
12514
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
12448
12515
|
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
12449
12516
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
@@ -12460,13 +12527,13 @@ function StateJsonView({
|
|
|
12460
12527
|
] });
|
|
12461
12528
|
}
|
|
12462
12529
|
var init_StateJsonView = __esm({
|
|
12463
|
-
"components/game/2d/
|
|
12530
|
+
"components/game/2d/molecules/StateJsonView.tsx"() {
|
|
12464
12531
|
init_atoms();
|
|
12465
12532
|
init_cn();
|
|
12466
12533
|
StateJsonView.displayName = "StateJsonView";
|
|
12467
12534
|
}
|
|
12468
12535
|
});
|
|
12469
|
-
function
|
|
12536
|
+
function layoutStates2(states, width, height) {
|
|
12470
12537
|
const cx = width / 2;
|
|
12471
12538
|
const cy = height / 2;
|
|
12472
12539
|
const radius = Math.min(cx, cy) - 60;
|
|
@@ -12534,7 +12601,7 @@ function StateArchitectBoard({
|
|
|
12534
12601
|
}, []);
|
|
12535
12602
|
const GRAPH_W = 500;
|
|
12536
12603
|
const GRAPH_H = 400;
|
|
12537
|
-
const positions = useMemo(() =>
|
|
12604
|
+
const positions = useMemo(() => layoutStates2(entityStates, GRAPH_W, GRAPH_H), [entityStates]);
|
|
12538
12605
|
const handleStateClick = useCallback((state) => {
|
|
12539
12606
|
if (isTesting) return;
|
|
12540
12607
|
if (addingFrom) {
|
|
@@ -12629,7 +12696,7 @@ function StateArchitectBoard({
|
|
|
12629
12696
|
setAddingFrom(null);
|
|
12630
12697
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
12631
12698
|
}, [initialState, entityVariables, playAgainEvent, emit]);
|
|
12632
|
-
|
|
12699
|
+
useMemo(() => ({
|
|
12633
12700
|
name: entityName,
|
|
12634
12701
|
states: entityStates,
|
|
12635
12702
|
initialState,
|
|
@@ -12764,7 +12831,7 @@ function StateArchitectBoard({
|
|
|
12764
12831
|
VariablePanel,
|
|
12765
12832
|
{
|
|
12766
12833
|
entityName,
|
|
12767
|
-
variables
|
|
12834
|
+
variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
|
|
12768
12835
|
}
|
|
12769
12836
|
),
|
|
12770
12837
|
testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
|
|
@@ -12775,7 +12842,16 @@ function StateArchitectBoard({
|
|
|
12775
12842
|
!r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
|
|
12776
12843
|
] }, i))
|
|
12777
12844
|
] }),
|
|
12778
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
12845
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
12846
|
+
StateJsonView,
|
|
12847
|
+
{
|
|
12848
|
+
name: entityName,
|
|
12849
|
+
initialState,
|
|
12850
|
+
states: entityStates,
|
|
12851
|
+
transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
|
|
12852
|
+
label: "View Code"
|
|
12853
|
+
}
|
|
12854
|
+
)
|
|
12779
12855
|
] })
|
|
12780
12856
|
] }),
|
|
12781
12857
|
isSuccess && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
|
|
@@ -14516,7 +14592,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14516
14592
|
}
|
|
14517
14593
|
);
|
|
14518
14594
|
};
|
|
14519
|
-
ErrorBoundary = class extends
|
|
14595
|
+
ErrorBoundary = class extends React98__default.Component {
|
|
14520
14596
|
constructor(props) {
|
|
14521
14597
|
super(props);
|
|
14522
14598
|
__publicField(this, "reset", () => {
|
|
@@ -15181,7 +15257,7 @@ var init_Container = __esm({
|
|
|
15181
15257
|
as: Component = "div"
|
|
15182
15258
|
}) => {
|
|
15183
15259
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
15184
|
-
return
|
|
15260
|
+
return React98__default.createElement(
|
|
15185
15261
|
Component,
|
|
15186
15262
|
{
|
|
15187
15263
|
className: cn(
|
|
@@ -17849,7 +17925,7 @@ var init_CodeBlock = __esm({
|
|
|
17849
17925
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
17850
17926
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
17851
17927
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
17852
|
-
CodeBlock =
|
|
17928
|
+
CodeBlock = React98__default.memo(
|
|
17853
17929
|
({
|
|
17854
17930
|
code: rawCode,
|
|
17855
17931
|
language = "text",
|
|
@@ -18436,7 +18512,7 @@ var init_MarkdownContent = __esm({
|
|
|
18436
18512
|
init_Box();
|
|
18437
18513
|
init_CodeBlock();
|
|
18438
18514
|
init_cn();
|
|
18439
|
-
MarkdownContent =
|
|
18515
|
+
MarkdownContent = React98__default.memo(
|
|
18440
18516
|
({ content, direction = "ltr", className }) => {
|
|
18441
18517
|
const { t: _t } = useTranslate();
|
|
18442
18518
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -19763,7 +19839,7 @@ var init_StateMachineView = __esm({
|
|
|
19763
19839
|
style: { top: title ? 30 : 0 },
|
|
19764
19840
|
children: [
|
|
19765
19841
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
19766
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
19842
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React98__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
19767
19843
|
StateNode2,
|
|
19768
19844
|
{
|
|
19769
19845
|
state,
|
|
@@ -25401,8 +25477,8 @@ var init_Menu = __esm({
|
|
|
25401
25477
|
"bottom-end": "bottom-start"
|
|
25402
25478
|
};
|
|
25403
25479
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
25404
|
-
const triggerChild =
|
|
25405
|
-
const triggerElement =
|
|
25480
|
+
const triggerChild = React98__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25481
|
+
const triggerElement = React98__default.cloneElement(
|
|
25406
25482
|
triggerChild,
|
|
25407
25483
|
{
|
|
25408
25484
|
ref: triggerRef,
|
|
@@ -25497,14 +25573,14 @@ function useDataDnd(args) {
|
|
|
25497
25573
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
25498
25574
|
const enabled = isZone || Boolean(dndRoot);
|
|
25499
25575
|
const eventBus = useEventBus();
|
|
25500
|
-
const parentRoot =
|
|
25576
|
+
const parentRoot = React98__default.useContext(RootCtx);
|
|
25501
25577
|
const isRoot = enabled && parentRoot === null;
|
|
25502
|
-
const zoneId =
|
|
25578
|
+
const zoneId = React98__default.useId();
|
|
25503
25579
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
25504
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
25505
|
-
const optimisticOrdersRef =
|
|
25580
|
+
const [optimisticOrders, setOptimisticOrders] = React98__default.useState(() => /* @__PURE__ */ new Map());
|
|
25581
|
+
const optimisticOrdersRef = React98__default.useRef(optimisticOrders);
|
|
25506
25582
|
optimisticOrdersRef.current = optimisticOrders;
|
|
25507
|
-
const clearOptimisticOrder =
|
|
25583
|
+
const clearOptimisticOrder = React98__default.useCallback((group) => {
|
|
25508
25584
|
setOptimisticOrders((prev) => {
|
|
25509
25585
|
if (!prev.has(group)) return prev;
|
|
25510
25586
|
const next = new Map(prev);
|
|
@@ -25529,7 +25605,7 @@ function useDataDnd(args) {
|
|
|
25529
25605
|
const raw = it[dndItemIdField];
|
|
25530
25606
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
25531
25607
|
}).join("|");
|
|
25532
|
-
const itemIds =
|
|
25608
|
+
const itemIds = React98__default.useMemo(
|
|
25533
25609
|
() => orderedItems.map((it, idx) => {
|
|
25534
25610
|
const raw = it[dndItemIdField];
|
|
25535
25611
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -25540,7 +25616,7 @@ function useDataDnd(args) {
|
|
|
25540
25616
|
const raw = it[dndItemIdField];
|
|
25541
25617
|
return raw != null ? String(raw) : `__${idx}`;
|
|
25542
25618
|
}).join("|");
|
|
25543
|
-
|
|
25619
|
+
React98__default.useEffect(() => {
|
|
25544
25620
|
const root = isRoot ? null : parentRoot;
|
|
25545
25621
|
if (root) {
|
|
25546
25622
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -25548,20 +25624,20 @@ function useDataDnd(args) {
|
|
|
25548
25624
|
clearOptimisticOrder(ownGroup);
|
|
25549
25625
|
}
|
|
25550
25626
|
}, [itemsContentSig, ownGroup]);
|
|
25551
|
-
const zonesRef =
|
|
25552
|
-
const registerZone =
|
|
25627
|
+
const zonesRef = React98__default.useRef(/* @__PURE__ */ new Map());
|
|
25628
|
+
const registerZone = React98__default.useCallback((zoneId2, meta2) => {
|
|
25553
25629
|
zonesRef.current.set(zoneId2, meta2);
|
|
25554
25630
|
}, []);
|
|
25555
|
-
const unregisterZone =
|
|
25631
|
+
const unregisterZone = React98__default.useCallback((zoneId2) => {
|
|
25556
25632
|
zonesRef.current.delete(zoneId2);
|
|
25557
25633
|
}, []);
|
|
25558
|
-
const [activeDrag, setActiveDrag] =
|
|
25559
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
25560
|
-
const meta =
|
|
25634
|
+
const [activeDrag, setActiveDrag] = React98__default.useState(null);
|
|
25635
|
+
const [overZoneGroup, setOverZoneGroup] = React98__default.useState(null);
|
|
25636
|
+
const meta = React98__default.useMemo(
|
|
25561
25637
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
25562
25638
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
25563
25639
|
);
|
|
25564
|
-
|
|
25640
|
+
React98__default.useEffect(() => {
|
|
25565
25641
|
const target = isRoot ? null : parentRoot;
|
|
25566
25642
|
if (!target) {
|
|
25567
25643
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -25580,7 +25656,7 @@ function useDataDnd(args) {
|
|
|
25580
25656
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
25581
25657
|
const sensors = useAlmadarDndSensors(true);
|
|
25582
25658
|
const collisionDetection = almadarDndCollisionDetection;
|
|
25583
|
-
const findZoneByItem =
|
|
25659
|
+
const findZoneByItem = React98__default.useCallback(
|
|
25584
25660
|
(id) => {
|
|
25585
25661
|
for (const z of zonesRef.current.values()) {
|
|
25586
25662
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -25589,7 +25665,7 @@ function useDataDnd(args) {
|
|
|
25589
25665
|
},
|
|
25590
25666
|
[]
|
|
25591
25667
|
);
|
|
25592
|
-
|
|
25668
|
+
React98__default.useCallback(
|
|
25593
25669
|
(group) => {
|
|
25594
25670
|
for (const z of zonesRef.current.values()) {
|
|
25595
25671
|
if (z.group === group) return z;
|
|
@@ -25598,7 +25674,7 @@ function useDataDnd(args) {
|
|
|
25598
25674
|
},
|
|
25599
25675
|
[]
|
|
25600
25676
|
);
|
|
25601
|
-
const handleDragEnd =
|
|
25677
|
+
const handleDragEnd = React98__default.useCallback(
|
|
25602
25678
|
(event) => {
|
|
25603
25679
|
const { active, over } = event;
|
|
25604
25680
|
const activeIdStr = String(active.id);
|
|
@@ -25689,8 +25765,8 @@ function useDataDnd(args) {
|
|
|
25689
25765
|
},
|
|
25690
25766
|
[eventBus]
|
|
25691
25767
|
);
|
|
25692
|
-
const sortableData =
|
|
25693
|
-
const SortableItem =
|
|
25768
|
+
const sortableData = React98__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
25769
|
+
const SortableItem = React98__default.useCallback(
|
|
25694
25770
|
({ id, children }) => {
|
|
25695
25771
|
const {
|
|
25696
25772
|
attributes,
|
|
@@ -25730,7 +25806,7 @@ function useDataDnd(args) {
|
|
|
25730
25806
|
id: droppableId,
|
|
25731
25807
|
data: sortableData
|
|
25732
25808
|
});
|
|
25733
|
-
const ctx =
|
|
25809
|
+
const ctx = React98__default.useContext(RootCtx);
|
|
25734
25810
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25735
25811
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25736
25812
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25745,7 +25821,7 @@ function useDataDnd(args) {
|
|
|
25745
25821
|
showForeignPlaceholder,
|
|
25746
25822
|
ctxAvailable: ctx != null
|
|
25747
25823
|
});
|
|
25748
|
-
|
|
25824
|
+
React98__default.useEffect(() => {
|
|
25749
25825
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25750
25826
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25751
25827
|
return /* @__PURE__ */ jsx(
|
|
@@ -25759,11 +25835,11 @@ function useDataDnd(args) {
|
|
|
25759
25835
|
}
|
|
25760
25836
|
);
|
|
25761
25837
|
};
|
|
25762
|
-
const rootContextValue =
|
|
25838
|
+
const rootContextValue = React98__default.useMemo(
|
|
25763
25839
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25764
25840
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25765
25841
|
);
|
|
25766
|
-
const handleDragStart =
|
|
25842
|
+
const handleDragStart = React98__default.useCallback((event) => {
|
|
25767
25843
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25768
25844
|
const rect = event.active.rect.current.initial;
|
|
25769
25845
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25782,7 +25858,7 @@ function useDataDnd(args) {
|
|
|
25782
25858
|
isRoot
|
|
25783
25859
|
});
|
|
25784
25860
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25785
|
-
const handleDragOver =
|
|
25861
|
+
const handleDragOver = React98__default.useCallback((event) => {
|
|
25786
25862
|
const { active, over } = event;
|
|
25787
25863
|
const overData = over?.data?.current;
|
|
25788
25864
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25852,7 +25928,7 @@ function useDataDnd(args) {
|
|
|
25852
25928
|
return next;
|
|
25853
25929
|
});
|
|
25854
25930
|
}, []);
|
|
25855
|
-
const handleDragCancel =
|
|
25931
|
+
const handleDragCancel = React98__default.useCallback((event) => {
|
|
25856
25932
|
setActiveDrag(null);
|
|
25857
25933
|
setOverZoneGroup(null);
|
|
25858
25934
|
dndLog.warn("dragCancel", {
|
|
@@ -25860,12 +25936,12 @@ function useDataDnd(args) {
|
|
|
25860
25936
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25861
25937
|
});
|
|
25862
25938
|
}, []);
|
|
25863
|
-
const handleDragEndWithCleanup =
|
|
25939
|
+
const handleDragEndWithCleanup = React98__default.useCallback((event) => {
|
|
25864
25940
|
handleDragEnd(event);
|
|
25865
25941
|
setActiveDrag(null);
|
|
25866
25942
|
setOverZoneGroup(null);
|
|
25867
25943
|
}, [handleDragEnd]);
|
|
25868
|
-
const wrapContainer =
|
|
25944
|
+
const wrapContainer = React98__default.useCallback(
|
|
25869
25945
|
(children) => {
|
|
25870
25946
|
if (!enabled) return children;
|
|
25871
25947
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -25919,7 +25995,7 @@ var init_useDataDnd = __esm({
|
|
|
25919
25995
|
init_useAlmadarDndCollision();
|
|
25920
25996
|
init_Box();
|
|
25921
25997
|
dndLog = createLogger("almadar:ui:dnd");
|
|
25922
|
-
RootCtx =
|
|
25998
|
+
RootCtx = React98__default.createContext(null);
|
|
25923
25999
|
}
|
|
25924
26000
|
});
|
|
25925
26001
|
function renderIconInput(icon, props) {
|
|
@@ -26445,7 +26521,7 @@ function DataList({
|
|
|
26445
26521
|
}) {
|
|
26446
26522
|
const eventBus = useEventBus();
|
|
26447
26523
|
const { t } = useTranslate();
|
|
26448
|
-
const [visibleCount, setVisibleCount] =
|
|
26524
|
+
const [visibleCount, setVisibleCount] = React98__default.useState(pageSize || Infinity);
|
|
26449
26525
|
const fieldDefs = fields ?? columns ?? [];
|
|
26450
26526
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
26451
26527
|
const dnd = useDataDnd({
|
|
@@ -26464,7 +26540,7 @@ function DataList({
|
|
|
26464
26540
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
26465
26541
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
26466
26542
|
const hasRenderProp = typeof children === "function";
|
|
26467
|
-
|
|
26543
|
+
React98__default.useEffect(() => {
|
|
26468
26544
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
26469
26545
|
const childrenTypeOf = typeof children;
|
|
26470
26546
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -26568,7 +26644,7 @@ function DataList({
|
|
|
26568
26644
|
const items2 = [...data];
|
|
26569
26645
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
26570
26646
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
26571
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26647
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
26572
26648
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26573
26649
|
group.items.map((itemData, index) => {
|
|
26574
26650
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -26709,7 +26785,7 @@ function DataList({
|
|
|
26709
26785
|
className
|
|
26710
26786
|
),
|
|
26711
26787
|
children: [
|
|
26712
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26788
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
26713
26789
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26714
26790
|
group.items.map(
|
|
26715
26791
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26794,7 +26870,7 @@ var init_FormSection = __esm({
|
|
|
26794
26870
|
columns = 1,
|
|
26795
26871
|
className
|
|
26796
26872
|
}) => {
|
|
26797
|
-
const [collapsed, setCollapsed] =
|
|
26873
|
+
const [collapsed, setCollapsed] = React98__default.useState(defaultCollapsed);
|
|
26798
26874
|
const { t } = useTranslate();
|
|
26799
26875
|
const eventBus = useEventBus();
|
|
26800
26876
|
const gridClass = {
|
|
@@ -26802,7 +26878,7 @@ var init_FormSection = __esm({
|
|
|
26802
26878
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26803
26879
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26804
26880
|
}[columns];
|
|
26805
|
-
|
|
26881
|
+
React98__default.useCallback(() => {
|
|
26806
26882
|
if (collapsible) {
|
|
26807
26883
|
setCollapsed((prev) => !prev);
|
|
26808
26884
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27752,7 +27828,7 @@ var init_Flex = __esm({
|
|
|
27752
27828
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27753
27829
|
}
|
|
27754
27830
|
}
|
|
27755
|
-
return
|
|
27831
|
+
return React98__default.createElement(Component, {
|
|
27756
27832
|
className: cn(
|
|
27757
27833
|
inline ? "inline-flex" : "flex",
|
|
27758
27834
|
directionStyles[direction],
|
|
@@ -27871,7 +27947,7 @@ var init_Grid = __esm({
|
|
|
27871
27947
|
as: Component = "div"
|
|
27872
27948
|
}) => {
|
|
27873
27949
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
27874
|
-
return
|
|
27950
|
+
return React98__default.createElement(
|
|
27875
27951
|
Component,
|
|
27876
27952
|
{
|
|
27877
27953
|
className: cn(
|
|
@@ -28067,9 +28143,9 @@ var init_Popover = __esm({
|
|
|
28067
28143
|
onMouseLeave: handleClose,
|
|
28068
28144
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
28069
28145
|
};
|
|
28070
|
-
const childElement =
|
|
28146
|
+
const childElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28071
28147
|
const childPointerDown = childElement.props.onPointerDown;
|
|
28072
|
-
const triggerElement =
|
|
28148
|
+
const triggerElement = React98__default.cloneElement(
|
|
28073
28149
|
childElement,
|
|
28074
28150
|
{
|
|
28075
28151
|
ref: triggerRef,
|
|
@@ -28671,9 +28747,9 @@ var init_Tooltip = __esm({
|
|
|
28671
28747
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28672
28748
|
};
|
|
28673
28749
|
}, []);
|
|
28674
|
-
const triggerElement =
|
|
28750
|
+
const triggerElement = React98__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28675
28751
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28676
|
-
const trigger =
|
|
28752
|
+
const trigger = React98__default.cloneElement(triggerElement, {
|
|
28677
28753
|
ref: triggerRef,
|
|
28678
28754
|
onMouseEnter: handleMouseEnter,
|
|
28679
28755
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28763,7 +28839,7 @@ var init_WizardProgress = __esm({
|
|
|
28763
28839
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28764
28840
|
const isActive = index === currentStep;
|
|
28765
28841
|
const isCompleted = index < currentStep;
|
|
28766
|
-
return /* @__PURE__ */ jsxs(
|
|
28842
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
28767
28843
|
/* @__PURE__ */ jsx(
|
|
28768
28844
|
"button",
|
|
28769
28845
|
{
|
|
@@ -30323,7 +30399,7 @@ var init_MapView = __esm({
|
|
|
30323
30399
|
shadowSize: [41, 41]
|
|
30324
30400
|
});
|
|
30325
30401
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30326
|
-
const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback104, useState: useState98 } =
|
|
30402
|
+
const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback104, useState: useState98 } = React98__default;
|
|
30327
30403
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30328
30404
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30329
30405
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -31238,8 +31314,8 @@ function TableView({
|
|
|
31238
31314
|
}) {
|
|
31239
31315
|
const eventBus = useEventBus();
|
|
31240
31316
|
const { t } = useTranslate();
|
|
31241
|
-
const [visibleCount, setVisibleCount] =
|
|
31242
|
-
const [localSelected, setLocalSelected] =
|
|
31317
|
+
const [visibleCount, setVisibleCount] = React98__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31318
|
+
const [localSelected, setLocalSelected] = React98__default.useState(/* @__PURE__ */ new Set());
|
|
31243
31319
|
const colDefs = columns ?? fields ?? [];
|
|
31244
31320
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31245
31321
|
const dnd = useDataDnd({
|
|
@@ -31434,12 +31510,12 @@ function TableView({
|
|
|
31434
31510
|
]
|
|
31435
31511
|
}
|
|
31436
31512
|
);
|
|
31437
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31513
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React98__default.Fragment, { children: rowInner }, id);
|
|
31438
31514
|
};
|
|
31439
31515
|
const items = Array.from(data);
|
|
31440
31516
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31441
31517
|
let runningIndex = 0;
|
|
31442
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31518
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
31443
31519
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31444
31520
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31445
31521
|
] }, gi)) });
|
|
@@ -32796,7 +32872,7 @@ var init_StepFlow = __esm({
|
|
|
32796
32872
|
className
|
|
32797
32873
|
}) => {
|
|
32798
32874
|
if (orientation === "vertical") {
|
|
32799
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32875
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React98__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32800
32876
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32801
32877
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32802
32878
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32807,7 +32883,7 @@ var init_StepFlow = __esm({
|
|
|
32807
32883
|
] })
|
|
32808
32884
|
] }) }, index)) });
|
|
32809
32885
|
}
|
|
32810
|
-
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(
|
|
32886
|
+
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(React98__default.Fragment, { children: [
|
|
32811
32887
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32812
32888
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32813
32889
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33792,7 +33868,7 @@ var init_LikertScale = __esm({
|
|
|
33792
33868
|
md: "text-base",
|
|
33793
33869
|
lg: "text-lg"
|
|
33794
33870
|
};
|
|
33795
|
-
LikertScale =
|
|
33871
|
+
LikertScale = React98__default.forwardRef(
|
|
33796
33872
|
({
|
|
33797
33873
|
question,
|
|
33798
33874
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33804,7 +33880,7 @@ var init_LikertScale = __esm({
|
|
|
33804
33880
|
variant = "radios",
|
|
33805
33881
|
className
|
|
33806
33882
|
}, ref) => {
|
|
33807
|
-
const groupId =
|
|
33883
|
+
const groupId = React98__default.useId();
|
|
33808
33884
|
const eventBus = useEventBus();
|
|
33809
33885
|
const handleSelect = useCallback(
|
|
33810
33886
|
(next) => {
|
|
@@ -36086,7 +36162,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36086
36162
|
"aria-label": t("aria.breadcrumb"),
|
|
36087
36163
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36088
36164
|
const isLast = idx === items.length - 1;
|
|
36089
|
-
return /* @__PURE__ */ jsxs(
|
|
36165
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
36090
36166
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36091
36167
|
Icon,
|
|
36092
36168
|
{
|
|
@@ -36955,7 +37031,7 @@ var init_MiniStateMachine = __esm({
|
|
|
36955
37031
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
36956
37032
|
const tc = transitionCounts[s.name] ?? 0;
|
|
36957
37033
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
36958
|
-
return /* @__PURE__ */ jsxs(
|
|
37034
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
36959
37035
|
/* @__PURE__ */ jsx(
|
|
36960
37036
|
AvlState,
|
|
36961
37037
|
{
|
|
@@ -37159,7 +37235,7 @@ var init_PageHeader = __esm({
|
|
|
37159
37235
|
info: "bg-info/10 text-info"
|
|
37160
37236
|
};
|
|
37161
37237
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37162
|
-
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(
|
|
37238
|
+
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(React98__default.Fragment, { children: [
|
|
37163
37239
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37164
37240
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37165
37241
|
"a",
|
|
@@ -37517,7 +37593,7 @@ var init_Section = __esm({
|
|
|
37517
37593
|
as: Component = "section"
|
|
37518
37594
|
}) => {
|
|
37519
37595
|
const hasHeader = title || description || action;
|
|
37520
|
-
return
|
|
37596
|
+
return React98__default.createElement(
|
|
37521
37597
|
Component,
|
|
37522
37598
|
{
|
|
37523
37599
|
className: cn(
|
|
@@ -37891,7 +37967,7 @@ var init_WizardContainer = __esm({
|
|
|
37891
37967
|
const isCompleted = index < currentStep;
|
|
37892
37968
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
37893
37969
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
37894
|
-
return /* @__PURE__ */ jsxs(
|
|
37970
|
+
return /* @__PURE__ */ jsxs(React98__default.Fragment, { children: [
|
|
37895
37971
|
/* @__PURE__ */ jsx(
|
|
37896
37972
|
Button,
|
|
37897
37973
|
{
|
|
@@ -40324,7 +40400,7 @@ var init_DetailPanel = __esm({
|
|
|
40324
40400
|
}
|
|
40325
40401
|
});
|
|
40326
40402
|
function extractTitle(children) {
|
|
40327
|
-
if (!
|
|
40403
|
+
if (!React98__default.isValidElement(children)) return void 0;
|
|
40328
40404
|
const props = children.props;
|
|
40329
40405
|
if (typeof props.title === "string") {
|
|
40330
40406
|
return props.title;
|
|
@@ -40674,12 +40750,12 @@ var init_Form = __esm({
|
|
|
40674
40750
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40675
40751
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40676
40752
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40677
|
-
const normalizedInitialData =
|
|
40753
|
+
const normalizedInitialData = React98__default.useMemo(() => {
|
|
40678
40754
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40679
40755
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40680
40756
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40681
40757
|
}, [entity, initialData]);
|
|
40682
|
-
const entityDerivedFields =
|
|
40758
|
+
const entityDerivedFields = React98__default.useMemo(() => {
|
|
40683
40759
|
if (fields && fields.length > 0) return void 0;
|
|
40684
40760
|
if (!resolvedEntity) return void 0;
|
|
40685
40761
|
return resolvedEntity.fields.map(
|
|
@@ -40700,16 +40776,16 @@ var init_Form = __esm({
|
|
|
40700
40776
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40701
40777
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40702
40778
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40703
|
-
const [formData, setFormData] =
|
|
40779
|
+
const [formData, setFormData] = React98__default.useState(
|
|
40704
40780
|
normalizedInitialData
|
|
40705
40781
|
);
|
|
40706
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40782
|
+
const [collapsedSections, setCollapsedSections] = React98__default.useState(
|
|
40707
40783
|
/* @__PURE__ */ new Set()
|
|
40708
40784
|
);
|
|
40709
|
-
const [submitError, setSubmitError] =
|
|
40710
|
-
const formRef =
|
|
40785
|
+
const [submitError, setSubmitError] = React98__default.useState(null);
|
|
40786
|
+
const formRef = React98__default.useRef(null);
|
|
40711
40787
|
const formMode = props.mode;
|
|
40712
|
-
const mountedRef =
|
|
40788
|
+
const mountedRef = React98__default.useRef(false);
|
|
40713
40789
|
if (!mountedRef.current) {
|
|
40714
40790
|
mountedRef.current = true;
|
|
40715
40791
|
debug("forms", "mount", {
|
|
@@ -40722,7 +40798,7 @@ var init_Form = __esm({
|
|
|
40722
40798
|
});
|
|
40723
40799
|
}
|
|
40724
40800
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40725
|
-
const evalContext =
|
|
40801
|
+
const evalContext = React98__default.useMemo(
|
|
40726
40802
|
() => ({
|
|
40727
40803
|
formValues: formData,
|
|
40728
40804
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40731,7 +40807,7 @@ var init_Form = __esm({
|
|
|
40731
40807
|
}),
|
|
40732
40808
|
[formData, externalContext]
|
|
40733
40809
|
);
|
|
40734
|
-
|
|
40810
|
+
React98__default.useEffect(() => {
|
|
40735
40811
|
debug("forms", "initialData-sync", {
|
|
40736
40812
|
mode: formMode,
|
|
40737
40813
|
normalizedInitialData,
|
|
@@ -40742,7 +40818,7 @@ var init_Form = __esm({
|
|
|
40742
40818
|
setFormData(normalizedInitialData);
|
|
40743
40819
|
}
|
|
40744
40820
|
}, [normalizedInitialData]);
|
|
40745
|
-
const processCalculations =
|
|
40821
|
+
const processCalculations = React98__default.useCallback(
|
|
40746
40822
|
(changedFieldId, newFormData) => {
|
|
40747
40823
|
if (!hiddenCalculations.length) return;
|
|
40748
40824
|
const context = {
|
|
@@ -40767,7 +40843,7 @@ var init_Form = __esm({
|
|
|
40767
40843
|
},
|
|
40768
40844
|
[hiddenCalculations, externalContext, eventBus]
|
|
40769
40845
|
);
|
|
40770
|
-
const checkViolations =
|
|
40846
|
+
const checkViolations = React98__default.useCallback(
|
|
40771
40847
|
(changedFieldId, newFormData) => {
|
|
40772
40848
|
if (!violationTriggers.length) return;
|
|
40773
40849
|
const context = {
|
|
@@ -40805,7 +40881,7 @@ var init_Form = __esm({
|
|
|
40805
40881
|
processCalculations(name, newFormData);
|
|
40806
40882
|
checkViolations(name, newFormData);
|
|
40807
40883
|
};
|
|
40808
|
-
const isFieldVisible =
|
|
40884
|
+
const isFieldVisible = React98__default.useCallback(
|
|
40809
40885
|
(fieldName) => {
|
|
40810
40886
|
const condition = conditionalFields[fieldName];
|
|
40811
40887
|
if (!condition) return true;
|
|
@@ -40813,7 +40889,7 @@ var init_Form = __esm({
|
|
|
40813
40889
|
},
|
|
40814
40890
|
[conditionalFields, evalContext]
|
|
40815
40891
|
);
|
|
40816
|
-
const isSectionVisible =
|
|
40892
|
+
const isSectionVisible = React98__default.useCallback(
|
|
40817
40893
|
(section) => {
|
|
40818
40894
|
if (!section.condition) return true;
|
|
40819
40895
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40889,7 +40965,7 @@ var init_Form = __esm({
|
|
|
40889
40965
|
eventBus.emit(`UI:${onCancel}`);
|
|
40890
40966
|
}
|
|
40891
40967
|
};
|
|
40892
|
-
const renderField =
|
|
40968
|
+
const renderField = React98__default.useCallback(
|
|
40893
40969
|
(field) => {
|
|
40894
40970
|
const fieldName = field.name || field.field;
|
|
40895
40971
|
if (!fieldName) return null;
|
|
@@ -40910,7 +40986,7 @@ var init_Form = __esm({
|
|
|
40910
40986
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40911
40987
|
);
|
|
40912
40988
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40913
|
-
const normalizedFields =
|
|
40989
|
+
const normalizedFields = React98__default.useMemo(() => {
|
|
40914
40990
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40915
40991
|
return effectiveFields.map((field) => {
|
|
40916
40992
|
if (typeof field === "string") {
|
|
@@ -40934,7 +41010,7 @@ var init_Form = __esm({
|
|
|
40934
41010
|
return field;
|
|
40935
41011
|
});
|
|
40936
41012
|
}, [effectiveFields, resolvedEntity]);
|
|
40937
|
-
const schemaFields =
|
|
41013
|
+
const schemaFields = React98__default.useMemo(() => {
|
|
40938
41014
|
if (normalizedFields.length === 0) return null;
|
|
40939
41015
|
if (isDebugEnabled()) {
|
|
40940
41016
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40944,7 +41020,7 @@ var init_Form = __esm({
|
|
|
40944
41020
|
}
|
|
40945
41021
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40946
41022
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40947
|
-
const sectionElements =
|
|
41023
|
+
const sectionElements = React98__default.useMemo(() => {
|
|
40948
41024
|
if (!sections || sections.length === 0) return null;
|
|
40949
41025
|
return sections.map((section) => {
|
|
40950
41026
|
if (!isSectionVisible(section)) {
|
|
@@ -41669,7 +41745,7 @@ var init_List = __esm({
|
|
|
41669
41745
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41670
41746
|
return [];
|
|
41671
41747
|
}, [entity]);
|
|
41672
|
-
const getItemActions =
|
|
41748
|
+
const getItemActions = React98__default.useCallback(
|
|
41673
41749
|
(item) => {
|
|
41674
41750
|
if (!itemActions) return [];
|
|
41675
41751
|
if (typeof itemActions === "function") {
|
|
@@ -42144,7 +42220,7 @@ var init_MediaGallery = __esm({
|
|
|
42144
42220
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
42145
42221
|
);
|
|
42146
42222
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
42147
|
-
const items =
|
|
42223
|
+
const items = React98__default.useMemo(() => {
|
|
42148
42224
|
if (propItems) return propItems;
|
|
42149
42225
|
if (entityData.length === 0) return [];
|
|
42150
42226
|
return entityData.map((record, idx) => {
|
|
@@ -42307,7 +42383,7 @@ var init_MediaGallery = __esm({
|
|
|
42307
42383
|
}
|
|
42308
42384
|
});
|
|
42309
42385
|
function extractTitle2(children) {
|
|
42310
|
-
if (!
|
|
42386
|
+
if (!React98__default.isValidElement(children)) return void 0;
|
|
42311
42387
|
const props = children.props;
|
|
42312
42388
|
if (typeof props.title === "string") {
|
|
42313
42389
|
return props.title;
|
|
@@ -42562,7 +42638,7 @@ var init_debugRegistry = __esm({
|
|
|
42562
42638
|
}
|
|
42563
42639
|
});
|
|
42564
42640
|
function useDebugData() {
|
|
42565
|
-
const [data, setData] =
|
|
42641
|
+
const [data, setData] = React98.useState(() => ({
|
|
42566
42642
|
traits: [],
|
|
42567
42643
|
ticks: [],
|
|
42568
42644
|
guards: [],
|
|
@@ -42576,7 +42652,7 @@ function useDebugData() {
|
|
|
42576
42652
|
},
|
|
42577
42653
|
lastUpdate: Date.now()
|
|
42578
42654
|
}));
|
|
42579
|
-
|
|
42655
|
+
React98.useEffect(() => {
|
|
42580
42656
|
const updateData = () => {
|
|
42581
42657
|
setData({
|
|
42582
42658
|
traits: getAllTraits(),
|
|
@@ -42685,12 +42761,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42685
42761
|
return positions;
|
|
42686
42762
|
}
|
|
42687
42763
|
function WalkMinimap() {
|
|
42688
|
-
const [walkStep, setWalkStep] =
|
|
42689
|
-
const [traits2, setTraits] =
|
|
42690
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42691
|
-
const [completedTraits, setCompletedTraits] =
|
|
42692
|
-
const prevTraitRef =
|
|
42693
|
-
|
|
42764
|
+
const [walkStep, setWalkStep] = React98.useState(null);
|
|
42765
|
+
const [traits2, setTraits] = React98.useState([]);
|
|
42766
|
+
const [coveredEdges, setCoveredEdges] = React98.useState([]);
|
|
42767
|
+
const [completedTraits, setCompletedTraits] = React98.useState(/* @__PURE__ */ new Set());
|
|
42768
|
+
const prevTraitRef = React98.useRef(null);
|
|
42769
|
+
React98.useEffect(() => {
|
|
42694
42770
|
const interval = setInterval(() => {
|
|
42695
42771
|
const w = window;
|
|
42696
42772
|
const step = w.__orbitalWalkStep;
|
|
@@ -43126,15 +43202,15 @@ var init_EntitiesTab = __esm({
|
|
|
43126
43202
|
});
|
|
43127
43203
|
function EventFlowTab({ events: events2 }) {
|
|
43128
43204
|
const { t } = useTranslate();
|
|
43129
|
-
const [filter, setFilter] =
|
|
43130
|
-
const containerRef =
|
|
43131
|
-
const [autoScroll, setAutoScroll] =
|
|
43132
|
-
|
|
43205
|
+
const [filter, setFilter] = React98.useState("all");
|
|
43206
|
+
const containerRef = React98.useRef(null);
|
|
43207
|
+
const [autoScroll, setAutoScroll] = React98.useState(true);
|
|
43208
|
+
React98.useEffect(() => {
|
|
43133
43209
|
if (autoScroll && containerRef.current) {
|
|
43134
43210
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43135
43211
|
}
|
|
43136
43212
|
}, [events2.length, autoScroll]);
|
|
43137
|
-
const filteredEvents =
|
|
43213
|
+
const filteredEvents = React98.useMemo(() => {
|
|
43138
43214
|
if (filter === "all") return events2;
|
|
43139
43215
|
return events2.filter((e) => e.type === filter);
|
|
43140
43216
|
}, [events2, filter]);
|
|
@@ -43250,7 +43326,7 @@ var init_EventFlowTab = __esm({
|
|
|
43250
43326
|
});
|
|
43251
43327
|
function GuardsPanel({ guards }) {
|
|
43252
43328
|
const { t } = useTranslate();
|
|
43253
|
-
const [filter, setFilter] =
|
|
43329
|
+
const [filter, setFilter] = React98.useState("all");
|
|
43254
43330
|
if (guards.length === 0) {
|
|
43255
43331
|
return /* @__PURE__ */ jsx(
|
|
43256
43332
|
EmptyState,
|
|
@@ -43263,7 +43339,7 @@ function GuardsPanel({ guards }) {
|
|
|
43263
43339
|
}
|
|
43264
43340
|
const passedCount = guards.filter((g) => g.result).length;
|
|
43265
43341
|
const failedCount = guards.length - passedCount;
|
|
43266
|
-
const filteredGuards =
|
|
43342
|
+
const filteredGuards = React98.useMemo(() => {
|
|
43267
43343
|
if (filter === "all") return guards;
|
|
43268
43344
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43269
43345
|
return guards.filter((g) => !g.result);
|
|
@@ -43426,10 +43502,10 @@ function EffectBadge({ effect }) {
|
|
|
43426
43502
|
}
|
|
43427
43503
|
function TransitionTimeline({ transitions }) {
|
|
43428
43504
|
const { t } = useTranslate();
|
|
43429
|
-
const containerRef =
|
|
43430
|
-
const [autoScroll, setAutoScroll] =
|
|
43431
|
-
const [expandedId, setExpandedId] =
|
|
43432
|
-
|
|
43505
|
+
const containerRef = React98.useRef(null);
|
|
43506
|
+
const [autoScroll, setAutoScroll] = React98.useState(true);
|
|
43507
|
+
const [expandedId, setExpandedId] = React98.useState(null);
|
|
43508
|
+
React98.useEffect(() => {
|
|
43433
43509
|
if (autoScroll && containerRef.current) {
|
|
43434
43510
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43435
43511
|
}
|
|
@@ -43709,9 +43785,9 @@ function getAllEvents(traits2) {
|
|
|
43709
43785
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43710
43786
|
const eventBus = useEventBus();
|
|
43711
43787
|
const { t } = useTranslate();
|
|
43712
|
-
const [log13, setLog] =
|
|
43713
|
-
const prevStatesRef =
|
|
43714
|
-
|
|
43788
|
+
const [log13, setLog] = React98.useState([]);
|
|
43789
|
+
const prevStatesRef = React98.useRef(/* @__PURE__ */ new Map());
|
|
43790
|
+
React98.useEffect(() => {
|
|
43715
43791
|
for (const trait of traits2) {
|
|
43716
43792
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43717
43793
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43880,10 +43956,10 @@ function VerifyModePanel({
|
|
|
43880
43956
|
localCount
|
|
43881
43957
|
}) {
|
|
43882
43958
|
const { t } = useTranslate();
|
|
43883
|
-
const [expanded, setExpanded] =
|
|
43884
|
-
const scrollRef =
|
|
43885
|
-
const prevCountRef =
|
|
43886
|
-
|
|
43959
|
+
const [expanded, setExpanded] = React98.useState(true);
|
|
43960
|
+
const scrollRef = React98.useRef(null);
|
|
43961
|
+
const prevCountRef = React98.useRef(0);
|
|
43962
|
+
React98.useEffect(() => {
|
|
43887
43963
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43888
43964
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43889
43965
|
}
|
|
@@ -43940,10 +44016,10 @@ function RuntimeDebugger({
|
|
|
43940
44016
|
schema
|
|
43941
44017
|
}) {
|
|
43942
44018
|
const { t } = useTranslate();
|
|
43943
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43944
|
-
const [isVisible, setIsVisible] =
|
|
44019
|
+
const [isCollapsed, setIsCollapsed] = React98.useState(mode === "verify" ? true : defaultCollapsed);
|
|
44020
|
+
const [isVisible, setIsVisible] = React98.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43945
44021
|
const debugData = useDebugData();
|
|
43946
|
-
|
|
44022
|
+
React98.useEffect(() => {
|
|
43947
44023
|
if (mode === "inline") return;
|
|
43948
44024
|
return onDebugToggle((enabled) => {
|
|
43949
44025
|
setIsVisible(enabled);
|
|
@@ -43952,7 +44028,7 @@ function RuntimeDebugger({
|
|
|
43952
44028
|
}
|
|
43953
44029
|
});
|
|
43954
44030
|
}, [mode]);
|
|
43955
|
-
|
|
44031
|
+
React98.useEffect(() => {
|
|
43956
44032
|
if (mode === "inline") return;
|
|
43957
44033
|
const handleKeyDown = (e) => {
|
|
43958
44034
|
if (e.key === "`" && isVisible) {
|
|
@@ -44472,7 +44548,7 @@ var init_StatCard = __esm({
|
|
|
44472
44548
|
const labelToUse = propLabel ?? propTitle;
|
|
44473
44549
|
const eventBus = useEventBus();
|
|
44474
44550
|
const { t } = useTranslate();
|
|
44475
|
-
const handleActionClick =
|
|
44551
|
+
const handleActionClick = React98__default.useCallback(() => {
|
|
44476
44552
|
if (action?.event) {
|
|
44477
44553
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44478
44554
|
}
|
|
@@ -44483,7 +44559,7 @@ var init_StatCard = __esm({
|
|
|
44483
44559
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44484
44560
|
const isLoading = externalLoading ?? false;
|
|
44485
44561
|
const error = externalError;
|
|
44486
|
-
const computeMetricValue =
|
|
44562
|
+
const computeMetricValue = React98__default.useCallback(
|
|
44487
44563
|
(metric, items) => {
|
|
44488
44564
|
if (metric.value !== void 0) {
|
|
44489
44565
|
return metric.value;
|
|
@@ -44522,7 +44598,7 @@ var init_StatCard = __esm({
|
|
|
44522
44598
|
},
|
|
44523
44599
|
[]
|
|
44524
44600
|
);
|
|
44525
|
-
const schemaStats =
|
|
44601
|
+
const schemaStats = React98__default.useMemo(() => {
|
|
44526
44602
|
if (!metrics || metrics.length === 0) return null;
|
|
44527
44603
|
return metrics.map((metric) => ({
|
|
44528
44604
|
label: metric.label,
|
|
@@ -44530,7 +44606,7 @@ var init_StatCard = __esm({
|
|
|
44530
44606
|
format: metric.format
|
|
44531
44607
|
}));
|
|
44532
44608
|
}, [metrics, data, computeMetricValue]);
|
|
44533
|
-
const calculatedTrend =
|
|
44609
|
+
const calculatedTrend = React98__default.useMemo(() => {
|
|
44534
44610
|
if (manualTrend !== void 0) return manualTrend;
|
|
44535
44611
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44536
44612
|
return void 0;
|
|
@@ -45170,8 +45246,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45170
45246
|
] });
|
|
45171
45247
|
};
|
|
45172
45248
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
45173
|
-
const endRef =
|
|
45174
|
-
|
|
45249
|
+
const endRef = React98__default.useRef(null);
|
|
45250
|
+
React98__default.useEffect(() => {
|
|
45175
45251
|
if (!autoScroll) return;
|
|
45176
45252
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45177
45253
|
}, [activities.length, autoScroll]);
|
|
@@ -45265,7 +45341,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
45265
45341
|
};
|
|
45266
45342
|
SubagentRichCard = ({ subagent }) => {
|
|
45267
45343
|
const { t } = useTranslate();
|
|
45268
|
-
const activities =
|
|
45344
|
+
const activities = React98__default.useMemo(
|
|
45269
45345
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45270
45346
|
[subagent.messages]
|
|
45271
45347
|
);
|
|
@@ -45342,8 +45418,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45342
45418
|
] });
|
|
45343
45419
|
};
|
|
45344
45420
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45345
|
-
const endRef =
|
|
45346
|
-
|
|
45421
|
+
const endRef = React98__default.useRef(null);
|
|
45422
|
+
React98__default.useEffect(() => {
|
|
45347
45423
|
if (!autoScroll) return;
|
|
45348
45424
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45349
45425
|
}, [messages.length, autoScroll]);
|
|
@@ -45773,7 +45849,7 @@ var init_Timeline = __esm({
|
|
|
45773
45849
|
}) => {
|
|
45774
45850
|
const { t } = useTranslate();
|
|
45775
45851
|
const entityData = entity ?? [];
|
|
45776
|
-
const items =
|
|
45852
|
+
const items = React98__default.useMemo(() => {
|
|
45777
45853
|
if (propItems) return propItems;
|
|
45778
45854
|
if (entityData.length === 0) return [];
|
|
45779
45855
|
return entityData.map((record, idx) => {
|
|
@@ -45875,7 +45951,7 @@ var init_Timeline = __esm({
|
|
|
45875
45951
|
}
|
|
45876
45952
|
});
|
|
45877
45953
|
function extractToastProps(children) {
|
|
45878
|
-
if (!
|
|
45954
|
+
if (!React98__default.isValidElement(children)) {
|
|
45879
45955
|
if (typeof children === "string") {
|
|
45880
45956
|
return { message: children };
|
|
45881
45957
|
}
|
|
@@ -45917,7 +45993,7 @@ var init_ToastSlot = __esm({
|
|
|
45917
45993
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45918
45994
|
};
|
|
45919
45995
|
if (!isVisible) return null;
|
|
45920
|
-
const isCustomContent =
|
|
45996
|
+
const isCustomContent = React98__default.isValidElement(children) && !message;
|
|
45921
45997
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45922
45998
|
Toast,
|
|
45923
45999
|
{
|
|
@@ -45934,7 +46010,7 @@ var init_ToastSlot = __esm({
|
|
|
45934
46010
|
}
|
|
45935
46011
|
});
|
|
45936
46012
|
function lazyThree(name, loader) {
|
|
45937
|
-
const Lazy =
|
|
46013
|
+
const Lazy = React98__default.lazy(
|
|
45938
46014
|
() => loader().then((m) => {
|
|
45939
46015
|
const Resolved = m[name];
|
|
45940
46016
|
if (!Resolved) {
|
|
@@ -45946,13 +46022,13 @@ function lazyThree(name, loader) {
|
|
|
45946
46022
|
})
|
|
45947
46023
|
);
|
|
45948
46024
|
function ThreeWrapper(props) {
|
|
45949
|
-
return
|
|
46025
|
+
return React98__default.createElement(
|
|
45950
46026
|
ThreeBoundary,
|
|
45951
46027
|
{ name },
|
|
45952
|
-
|
|
45953
|
-
|
|
46028
|
+
React98__default.createElement(
|
|
46029
|
+
React98__default.Suspense,
|
|
45954
46030
|
{ fallback: null },
|
|
45955
|
-
|
|
46031
|
+
React98__default.createElement(Lazy, props)
|
|
45956
46032
|
)
|
|
45957
46033
|
);
|
|
45958
46034
|
}
|
|
@@ -46113,6 +46189,7 @@ var init_component_registry_generated = __esm({
|
|
|
46113
46189
|
init_Navigation();
|
|
46114
46190
|
init_NegotiatorBoard();
|
|
46115
46191
|
init_NumberStepper();
|
|
46192
|
+
init_ObjectRulePanel();
|
|
46116
46193
|
init_OptionConstraintGroup();
|
|
46117
46194
|
init_OrbitalVisualization();
|
|
46118
46195
|
init_Overlay();
|
|
@@ -46174,7 +46251,9 @@ var init_component_registry_generated = __esm({
|
|
|
46174
46251
|
init_StatCard();
|
|
46175
46252
|
init_StatDisplay();
|
|
46176
46253
|
init_StateArchitectBoard();
|
|
46254
|
+
init_StateGraph();
|
|
46177
46255
|
init_StateIndicator();
|
|
46256
|
+
init_StateJsonView();
|
|
46178
46257
|
init_StateMachineView();
|
|
46179
46258
|
init_StatsGrid();
|
|
46180
46259
|
init_StatsOrganism();
|
|
@@ -46221,6 +46300,7 @@ var init_component_registry_generated = __esm({
|
|
|
46221
46300
|
init_Typography();
|
|
46222
46301
|
init_UISlotRenderer();
|
|
46223
46302
|
init_UploadDropZone();
|
|
46303
|
+
init_VariablePanel();
|
|
46224
46304
|
init_VersionDiff();
|
|
46225
46305
|
init_ViolationAlert();
|
|
46226
46306
|
init_VoteStack();
|
|
@@ -46228,7 +46308,7 @@ var init_component_registry_generated = __esm({
|
|
|
46228
46308
|
init_WizardContainer();
|
|
46229
46309
|
init_WizardNavigation();
|
|
46230
46310
|
init_WizardProgress();
|
|
46231
|
-
ThreeBoundary = class extends
|
|
46311
|
+
ThreeBoundary = class extends React98__default.Component {
|
|
46232
46312
|
constructor() {
|
|
46233
46313
|
super(...arguments);
|
|
46234
46314
|
__publicField(this, "state", { failed: false });
|
|
@@ -46238,7 +46318,7 @@ var init_component_registry_generated = __esm({
|
|
|
46238
46318
|
}
|
|
46239
46319
|
render() {
|
|
46240
46320
|
if (this.state.failed) {
|
|
46241
|
-
return
|
|
46321
|
+
return React98__default.createElement(
|
|
46242
46322
|
"div",
|
|
46243
46323
|
{
|
|
46244
46324
|
"data-testid": "three-unavailable",
|
|
@@ -46421,6 +46501,7 @@ var init_component_registry_generated = __esm({
|
|
|
46421
46501
|
"Navigation": Navigation,
|
|
46422
46502
|
"NegotiatorBoard": NegotiatorBoard,
|
|
46423
46503
|
"NumberStepper": NumberStepper,
|
|
46504
|
+
"ObjectRulePanel": ObjectRulePanel,
|
|
46424
46505
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
46425
46506
|
"OrbitalVisualization": OrbitalVisualization,
|
|
46426
46507
|
"Overlay": Overlay,
|
|
@@ -46485,7 +46566,9 @@ var init_component_registry_generated = __esm({
|
|
|
46485
46566
|
"StatCard": StatCard,
|
|
46486
46567
|
"StatDisplay": StatDisplay,
|
|
46487
46568
|
"StateArchitectBoard": StateArchitectBoard,
|
|
46569
|
+
"StateGraph": StateGraph,
|
|
46488
46570
|
"StateIndicator": StateIndicator,
|
|
46571
|
+
"StateJsonView": StateJsonView,
|
|
46489
46572
|
"StateMachineView": StateMachineView,
|
|
46490
46573
|
"StatsGrid": StatsGrid,
|
|
46491
46574
|
"StatsOrganism": StatsOrganism,
|
|
@@ -46533,6 +46616,7 @@ var init_component_registry_generated = __esm({
|
|
|
46533
46616
|
"UISlotRenderer": UISlotRenderer,
|
|
46534
46617
|
"UploadDropZone": UploadDropZone,
|
|
46535
46618
|
"VStack": VStack,
|
|
46619
|
+
"VariablePanel": VariablePanel,
|
|
46536
46620
|
"VersionDiff": VersionDiff,
|
|
46537
46621
|
"ViolationAlert": ViolationAlert,
|
|
46538
46622
|
"VoteStack": VoteStack,
|
|
@@ -46558,7 +46642,7 @@ function SuspenseConfigProvider({
|
|
|
46558
46642
|
config,
|
|
46559
46643
|
children
|
|
46560
46644
|
}) {
|
|
46561
|
-
return
|
|
46645
|
+
return React98__default.createElement(
|
|
46562
46646
|
SuspenseConfigContext.Provider,
|
|
46563
46647
|
{ value: config },
|
|
46564
46648
|
children
|
|
@@ -46600,7 +46684,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46600
46684
|
}
|
|
46601
46685
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
46602
46686
|
}
|
|
46603
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46687
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React98__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46604
46688
|
const obj = field;
|
|
46605
46689
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46606
46690
|
if (!fieldName) return field;
|
|
@@ -47053,7 +47137,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47053
47137
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47054
47138
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47055
47139
|
}
|
|
47056
|
-
return /* @__PURE__ */ jsx(
|
|
47140
|
+
return /* @__PURE__ */ jsx(React98__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47057
47141
|
}
|
|
47058
47142
|
if (!child || typeof child !== "object") return null;
|
|
47059
47143
|
const childId = `${parentId}-${index}`;
|
|
@@ -47093,14 +47177,14 @@ function isPatternConfig(value) {
|
|
|
47093
47177
|
if (value === null || value === void 0) return false;
|
|
47094
47178
|
if (typeof value !== "object") return false;
|
|
47095
47179
|
if (Array.isArray(value)) return false;
|
|
47096
|
-
if (
|
|
47180
|
+
if (React98__default.isValidElement(value)) return false;
|
|
47097
47181
|
if (value instanceof Date) return false;
|
|
47098
47182
|
if (typeof value === "function") return false;
|
|
47099
47183
|
const record = value;
|
|
47100
47184
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
47101
47185
|
}
|
|
47102
47186
|
function isPlainConfigObject(value) {
|
|
47103
|
-
if (
|
|
47187
|
+
if (React98__default.isValidElement(value)) return false;
|
|
47104
47188
|
if (value instanceof Date) return false;
|
|
47105
47189
|
const proto = Object.getPrototypeOf(value);
|
|
47106
47190
|
return proto === Object.prototype || proto === null;
|
|
@@ -47226,7 +47310,7 @@ function SlotContentRenderer({
|
|
|
47226
47310
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
47227
47311
|
const slotVal = restProps[slotKey];
|
|
47228
47312
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
47229
|
-
if (
|
|
47313
|
+
if (React98__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47230
47314
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
47231
47315
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
47232
47316
|
slotVal,
|
|
@@ -47275,7 +47359,7 @@ function SlotContentRenderer({
|
|
|
47275
47359
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47276
47360
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47277
47361
|
const sample = resolvedItems[0];
|
|
47278
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47362
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React98__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47279
47363
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47280
47364
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47281
47365
|
}
|