@almadar/ui 5.89.0 → 5.93.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 +1350 -1562
- package/dist/avl/index.js +353 -565
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +9 -1
- package/dist/components/game/2d/atoms/GameCard.d.ts +7 -1
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +9 -1
- package/dist/components/game/2d/{organisms → molecules}/ObjectRulePanel.d.ts +9 -4
- package/dist/components/game/2d/{organisms → molecules}/SequenceBar.d.ts +15 -5
- 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 -16
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +1 -1
- package/dist/components/game/shared/lib/puzzleObject.d.ts +1 -1
- package/dist/components/game/shared/spriteAnimationTypes.d.ts +10 -35
- package/dist/components/index.cjs +121 -420
- package/dist/components/index.js +123 -419
- package/dist/lib/verificationRegistry.d.ts +1 -1
- package/dist/providers/index.cjs +1214 -1398
- package/dist/providers/index.js +324 -508
- package/dist/runtime/index.cjs +1211 -1423
- package/dist/runtime/index.js +333 -545
- package/package.json +3 -3
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +0 -27
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +0 -51
- package/dist/components/game/2d/organisms/SimulationGraph.d.ts +0 -25
- 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 React97 from 'react';
|
|
2
|
+
import React97__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 = React97__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 React97__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 = React97__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
|
+
React97__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 = React97__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 (React97__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 = React97__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 = React97__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 React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3859
3859
|
CardHeader.displayName = "CardHeader";
|
|
3860
|
-
CardTitle =
|
|
3860
|
+
CardTitle = React97__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 = React97__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 = React97__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 = React97__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] = React97__default.useState(false);
|
|
4062
|
+
React97__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 React97__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 = React97__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 = React97__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] = React97__default.useState(value);
|
|
4465
|
+
React97__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 = React97.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] = React97.useState(
|
|
4659
4659
|
checked !== void 0 ? checked : defaultChecked
|
|
4660
4660
|
);
|
|
4661
|
-
|
|
4661
|
+
React97.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 React97__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 = React97__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] = React97__default.useState(false);
|
|
5104
|
+
const timeoutRef = React97__default.useRef(null);
|
|
5105
|
+
const triggerRef = React97__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
|
+
React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__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 = React97__default.useCallback(
|
|
6759
6759
|
(node) => {
|
|
6760
6760
|
containerRef.current = node;
|
|
6761
6761
|
if (typeof ref === "function") ref(node);
|
|
@@ -7345,12 +7345,13 @@ function GameCard({
|
|
|
7345
7345
|
selected = false,
|
|
7346
7346
|
disabled = false,
|
|
7347
7347
|
size = "md",
|
|
7348
|
+
animState = "idle",
|
|
7348
7349
|
onClick,
|
|
7349
7350
|
clickEvent,
|
|
7350
7351
|
className
|
|
7351
7352
|
}) {
|
|
7352
7353
|
const eventBus = useEventBus();
|
|
7353
|
-
const handleClick =
|
|
7354
|
+
const handleClick = React97.useCallback(() => {
|
|
7354
7355
|
if (disabled) return;
|
|
7355
7356
|
onClick?.(id);
|
|
7356
7357
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -7372,6 +7373,7 @@ function GameCard({
|
|
|
7372
7373
|
cardSizeMap[size],
|
|
7373
7374
|
disabled ? "border-border opacity-50 cursor-not-allowed" : "border-accent hover:brightness-125 hover:-translate-y-1 cursor-pointer",
|
|
7374
7375
|
selected && "ring-2 ring-foreground ring-offset-1 ring-offset-background -translate-y-1",
|
|
7376
|
+
ANIM_STATE_CLASS[animState],
|
|
7375
7377
|
className
|
|
7376
7378
|
),
|
|
7377
7379
|
children: [
|
|
@@ -7404,7 +7406,7 @@ function GameCard({
|
|
|
7404
7406
|
}
|
|
7405
7407
|
);
|
|
7406
7408
|
}
|
|
7407
|
-
var cardSizeMap, artPxMap;
|
|
7409
|
+
var cardSizeMap, artPxMap, ANIM_STATE_CLASS;
|
|
7408
7410
|
var init_GameCard = __esm({
|
|
7409
7411
|
"components/game/2d/atoms/GameCard.tsx"() {
|
|
7410
7412
|
"use client";
|
|
@@ -7420,6 +7422,12 @@ var init_GameCard = __esm({
|
|
|
7420
7422
|
lg: "w-24 h-36"
|
|
7421
7423
|
};
|
|
7422
7424
|
artPxMap = { sm: 40, md: 52, lg: 64 };
|
|
7425
|
+
ANIM_STATE_CLASS = {
|
|
7426
|
+
idle: "",
|
|
7427
|
+
drawn: "scale-105",
|
|
7428
|
+
played: "-translate-y-2 opacity-80",
|
|
7429
|
+
flipped: "scale-x-0"
|
|
7430
|
+
};
|
|
7423
7431
|
GameCard.displayName = "GameCard";
|
|
7424
7432
|
}
|
|
7425
7433
|
});
|
|
@@ -7632,9 +7640,9 @@ function ControlButton({
|
|
|
7632
7640
|
className
|
|
7633
7641
|
}) {
|
|
7634
7642
|
const eventBus = useEventBus();
|
|
7635
|
-
const [isPressed, setIsPressed] =
|
|
7643
|
+
const [isPressed, setIsPressed] = React97.useState(false);
|
|
7636
7644
|
const actualPressed = pressed ?? isPressed;
|
|
7637
|
-
const handlePointerDown =
|
|
7645
|
+
const handlePointerDown = React97.useCallback(
|
|
7638
7646
|
(e) => {
|
|
7639
7647
|
e.preventDefault();
|
|
7640
7648
|
if (disabled) return;
|
|
@@ -7644,7 +7652,7 @@ function ControlButton({
|
|
|
7644
7652
|
},
|
|
7645
7653
|
[disabled, pressEvent, eventBus, onPress]
|
|
7646
7654
|
);
|
|
7647
|
-
const handlePointerUp =
|
|
7655
|
+
const handlePointerUp = React97.useCallback(
|
|
7648
7656
|
(e) => {
|
|
7649
7657
|
e.preventDefault();
|
|
7650
7658
|
if (disabled) return;
|
|
@@ -7654,7 +7662,7 @@ function ControlButton({
|
|
|
7654
7662
|
},
|
|
7655
7663
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7656
7664
|
);
|
|
7657
|
-
const handlePointerLeave =
|
|
7665
|
+
const handlePointerLeave = React97.useCallback(
|
|
7658
7666
|
(e) => {
|
|
7659
7667
|
if (isPressed) {
|
|
7660
7668
|
setIsPressed(false);
|
|
@@ -8460,8 +8468,11 @@ function DialogueBubble({
|
|
|
8460
8468
|
text = "The dungeon awaits. Choose your path wisely.",
|
|
8461
8469
|
portrait = DEFAULT_PORTRAIT,
|
|
8462
8470
|
position = "bottom",
|
|
8471
|
+
mood = "neutral",
|
|
8472
|
+
revealedChars,
|
|
8463
8473
|
className
|
|
8464
8474
|
}) {
|
|
8475
|
+
const visibleText = revealedChars === void 0 ? text : text.slice(0, revealedChars);
|
|
8465
8476
|
return /* @__PURE__ */ jsxs(
|
|
8466
8477
|
Box,
|
|
8467
8478
|
{
|
|
@@ -8471,16 +8482,16 @@ function DialogueBubble({
|
|
|
8471
8482
|
className
|
|
8472
8483
|
),
|
|
8473
8484
|
children: [
|
|
8474
|
-
portrait && /* @__PURE__ */ jsx(Box, { className: "flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2
|
|
8485
|
+
portrait && /* @__PURE__ */ jsx(Box, { className: cn("flex-shrink-0 w-12 h-12 rounded-full overflow-hidden border-2 transition-colors duration-300", MOOD_RING_CLASS[mood]), children: /* @__PURE__ */ jsx(GameIcon, { assetUrl: portrait, icon: "image", size: 48, alt: speaker ?? "speaker", className: "w-full h-full object-cover" }) }),
|
|
8475
8486
|
/* @__PURE__ */ jsxs(Box, { className: "flex flex-col gap-1 min-w-0", children: [
|
|
8476
8487
|
speaker && /* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm font-bold text-warning", children: speaker }),
|
|
8477
|
-
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children:
|
|
8488
|
+
/* @__PURE__ */ jsx(Typography, { as: "span", className: "text-sm text-foreground leading-relaxed", children: visibleText })
|
|
8478
8489
|
] })
|
|
8479
8490
|
]
|
|
8480
8491
|
}
|
|
8481
8492
|
);
|
|
8482
8493
|
}
|
|
8483
|
-
var DEFAULT_PORTRAIT;
|
|
8494
|
+
var DEFAULT_PORTRAIT, MOOD_RING_CLASS;
|
|
8484
8495
|
var init_DialogueBubble = __esm({
|
|
8485
8496
|
"components/game/2d/atoms/DialogueBubble.tsx"() {
|
|
8486
8497
|
init_cn();
|
|
@@ -8492,6 +8503,12 @@ var init_DialogueBubble = __esm({
|
|
|
8492
8503
|
role: "effect",
|
|
8493
8504
|
category: "character"
|
|
8494
8505
|
};
|
|
8506
|
+
MOOD_RING_CLASS = {
|
|
8507
|
+
neutral: "border-warning/60",
|
|
8508
|
+
happy: "border-success/70",
|
|
8509
|
+
concerned: "border-info/70",
|
|
8510
|
+
angry: "border-error/70"
|
|
8511
|
+
};
|
|
8495
8512
|
DialogueBubble.displayName = "DialogueBubble";
|
|
8496
8513
|
}
|
|
8497
8514
|
});
|
|
@@ -8673,8 +8690,8 @@ function MiniMap({
|
|
|
8673
8690
|
tileAssets,
|
|
8674
8691
|
unitAssets
|
|
8675
8692
|
}) {
|
|
8676
|
-
const canvasRef =
|
|
8677
|
-
const imgCacheRef =
|
|
8693
|
+
const canvasRef = React97.useRef(null);
|
|
8694
|
+
const imgCacheRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
8678
8695
|
function loadImg(url) {
|
|
8679
8696
|
const cached = imgCacheRef.current.get(url);
|
|
8680
8697
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8689,7 +8706,7 @@ function MiniMap({
|
|
|
8689
8706
|
imgCacheRef.current.set(url, img);
|
|
8690
8707
|
return null;
|
|
8691
8708
|
}
|
|
8692
|
-
|
|
8709
|
+
React97.useEffect(() => {
|
|
8693
8710
|
const canvas = canvasRef.current;
|
|
8694
8711
|
if (!canvas) return;
|
|
8695
8712
|
const ctx = canvas.getContext("2d");
|
|
@@ -8824,8 +8841,8 @@ function ControlGrid({
|
|
|
8824
8841
|
className
|
|
8825
8842
|
}) {
|
|
8826
8843
|
const eventBus = useEventBus();
|
|
8827
|
-
const [active, setActive] =
|
|
8828
|
-
const handlePress =
|
|
8844
|
+
const [active, setActive] = React97.useState(/* @__PURE__ */ new Set());
|
|
8845
|
+
const handlePress = React97.useCallback(
|
|
8829
8846
|
(id) => {
|
|
8830
8847
|
setActive((prev) => new Set(prev).add(id));
|
|
8831
8848
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8839,7 +8856,7 @@ function ControlGrid({
|
|
|
8839
8856
|
},
|
|
8840
8857
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
8841
8858
|
);
|
|
8842
|
-
const handleRelease =
|
|
8859
|
+
const handleRelease = React97.useCallback(
|
|
8843
8860
|
(id) => {
|
|
8844
8861
|
setActive((prev) => {
|
|
8845
8862
|
const next = new Set(prev);
|
|
@@ -9097,7 +9114,7 @@ function InventoryGrid({
|
|
|
9097
9114
|
const eventBus = useEventBus();
|
|
9098
9115
|
const slotCount = totalSlots ?? items.length;
|
|
9099
9116
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9100
|
-
const handleSelect =
|
|
9117
|
+
const handleSelect = React97.useCallback(
|
|
9101
9118
|
(id) => {
|
|
9102
9119
|
onSelect?.(id);
|
|
9103
9120
|
if (selectEvent) {
|
|
@@ -9314,7 +9331,7 @@ function GameMenu({
|
|
|
9314
9331
|
}) {
|
|
9315
9332
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
9316
9333
|
const eventBus = useEventBus();
|
|
9317
|
-
const handleOptionClick =
|
|
9334
|
+
const handleOptionClick = React97.useCallback(
|
|
9318
9335
|
(option) => {
|
|
9319
9336
|
if (option.event) {
|
|
9320
9337
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -9437,7 +9454,7 @@ function StateNode({
|
|
|
9437
9454
|
);
|
|
9438
9455
|
}
|
|
9439
9456
|
var init_StateNode = __esm({
|
|
9440
|
-
"components/game/2d/
|
|
9457
|
+
"components/game/2d/molecules/StateNode.tsx"() {
|
|
9441
9458
|
init_atoms();
|
|
9442
9459
|
init_cn();
|
|
9443
9460
|
StateNode.displayName = "StateNode";
|
|
@@ -9509,7 +9526,7 @@ function TransitionArrow({
|
|
|
9509
9526
|
}
|
|
9510
9527
|
var NODE_RADIUS;
|
|
9511
9528
|
var init_TransitionArrow = __esm({
|
|
9512
|
-
"components/game/2d/
|
|
9529
|
+
"components/game/2d/molecules/TransitionArrow.tsx"() {
|
|
9513
9530
|
init_cn();
|
|
9514
9531
|
NODE_RADIUS = 40;
|
|
9515
9532
|
TransitionArrow.displayName = "TransitionArrow";
|
|
@@ -9540,7 +9557,7 @@ function StateGraph({
|
|
|
9540
9557
|
}) {
|
|
9541
9558
|
const eventBus = useEventBus();
|
|
9542
9559
|
const nodes = states ?? [];
|
|
9543
|
-
const positions =
|
|
9560
|
+
const positions = React97.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
9544
9561
|
return /* @__PURE__ */ jsxs(
|
|
9545
9562
|
Box,
|
|
9546
9563
|
{
|
|
@@ -10306,6 +10323,7 @@ function Canvas2D({
|
|
|
10306
10323
|
unitScale = 1,
|
|
10307
10324
|
showMinimap = true,
|
|
10308
10325
|
animate,
|
|
10326
|
+
interpolateUnits = false,
|
|
10309
10327
|
// Tuning
|
|
10310
10328
|
debug: debug2 = false,
|
|
10311
10329
|
spriteHeightRatio = 1.5,
|
|
@@ -10340,6 +10358,8 @@ function Canvas2D({
|
|
|
10340
10358
|
const containerRef = useRef(null);
|
|
10341
10359
|
const lerpRafRef = useRef(0);
|
|
10342
10360
|
const animRafRef = useRef(0);
|
|
10361
|
+
const unitInterp = useRenderInterpolation();
|
|
10362
|
+
const interpolatedUnitPositionsRef = useRef(/* @__PURE__ */ new Map());
|
|
10343
10363
|
const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
|
|
10344
10364
|
useEffect(() => {
|
|
10345
10365
|
const el = containerRef.current;
|
|
@@ -10654,7 +10674,8 @@ function Canvas2D({
|
|
|
10654
10674
|
return depthA !== depthB ? depthA - depthB : a.position.y - b.position.y;
|
|
10655
10675
|
});
|
|
10656
10676
|
for (const unit of sortedUnits) {
|
|
10657
|
-
const
|
|
10677
|
+
const interpolated = interpolateUnits ? interpolatedUnitPositionsRef.current.get(unit.id) : void 0;
|
|
10678
|
+
const pos = project(interpolated?.x ?? unit.position.x, interpolated?.y ?? unit.position.y, baseOffsetX);
|
|
10658
10679
|
if (pos.x + scaledTileWidth < visLeft || pos.x > visRight || pos.y + scaledTileHeight < visTop || pos.y > visBottom) {
|
|
10659
10680
|
continue;
|
|
10660
10681
|
}
|
|
@@ -10806,7 +10827,8 @@ function Canvas2D({
|
|
|
10806
10827
|
unitScale,
|
|
10807
10828
|
assetManifest,
|
|
10808
10829
|
spriteHeightRatio,
|
|
10809
|
-
spriteMaxWidthRatio
|
|
10830
|
+
spriteMaxWidthRatio,
|
|
10831
|
+
interpolateUnits
|
|
10810
10832
|
]);
|
|
10811
10833
|
useEffect(() => {
|
|
10812
10834
|
if (camera === "fixed") return;
|
|
@@ -10821,6 +10843,19 @@ function Canvas2D({
|
|
|
10821
10843
|
y: centerY - viewportSize.height / 2
|
|
10822
10844
|
};
|
|
10823
10845
|
}, [camera, selectedUnitId, units, project, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
10846
|
+
useEffect(() => {
|
|
10847
|
+
if (isSide || !interpolateUnits) return;
|
|
10848
|
+
unitInterp.onSnapshot(
|
|
10849
|
+
units.filter((u) => !!u.position).map((u) => ({ id: u.id, x: u.position.x, y: u.position.y }))
|
|
10850
|
+
);
|
|
10851
|
+
}, [isSide, interpolateUnits, units, unitInterp]);
|
|
10852
|
+
useEffect(() => {
|
|
10853
|
+
if (isSide || !interpolateUnits) return;
|
|
10854
|
+
return unitInterp.startLoop((positions) => {
|
|
10855
|
+
interpolatedUnitPositionsRef.current = positions;
|
|
10856
|
+
draw();
|
|
10857
|
+
});
|
|
10858
|
+
}, [isSide, interpolateUnits, unitInterp, draw]);
|
|
10824
10859
|
useEffect(() => {
|
|
10825
10860
|
if (isSide) return;
|
|
10826
10861
|
draw();
|
|
@@ -11196,7 +11231,7 @@ function LinearView({
|
|
|
11196
11231
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
11197
11232
|
const isDone = i < currentIdx;
|
|
11198
11233
|
const isCurrent = i === currentIdx;
|
|
11199
|
-
return /* @__PURE__ */ jsxs(
|
|
11234
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
11200
11235
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11201
11236
|
Typography,
|
|
11202
11237
|
{
|
|
@@ -11393,7 +11428,7 @@ function TraitStateViewer({
|
|
|
11393
11428
|
}
|
|
11394
11429
|
var SIZE_CONFIG;
|
|
11395
11430
|
var init_TraitStateViewer = __esm({
|
|
11396
|
-
"components/game/2d/
|
|
11431
|
+
"components/game/2d/molecules/TraitStateViewer.tsx"() {
|
|
11397
11432
|
"use client";
|
|
11398
11433
|
init_cn();
|
|
11399
11434
|
init_Box();
|
|
@@ -11426,7 +11461,8 @@ function TraitSlot({
|
|
|
11426
11461
|
onClick,
|
|
11427
11462
|
onRemove,
|
|
11428
11463
|
clickEvent,
|
|
11429
|
-
removeEvent
|
|
11464
|
+
removeEvent,
|
|
11465
|
+
dropEvent
|
|
11430
11466
|
}) {
|
|
11431
11467
|
const { emit } = useEventBus();
|
|
11432
11468
|
const [isHovered, setIsHovered] = useState(false);
|
|
@@ -11458,29 +11494,30 @@ function TraitSlot({
|
|
|
11458
11494
|
onDragStart?.(equippedItem);
|
|
11459
11495
|
}, [equippedItem, draggable, onDragStart]);
|
|
11460
11496
|
const handleDragOver = useCallback((e) => {
|
|
11461
|
-
if (locked || !onItemDrop) return;
|
|
11497
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11462
11498
|
if (e.dataTransfer.types.includes(DRAG_MIME)) {
|
|
11463
11499
|
e.preventDefault();
|
|
11464
11500
|
const allowed = e.dataTransfer.effectAllowed;
|
|
11465
11501
|
e.dataTransfer.dropEffect = allowed === "copy" ? "copy" : "move";
|
|
11466
11502
|
setIsDragOver(true);
|
|
11467
11503
|
}
|
|
11468
|
-
}, [locked, onItemDrop]);
|
|
11504
|
+
}, [locked, onItemDrop, dropEvent]);
|
|
11469
11505
|
const handleDragLeave = useCallback(() => {
|
|
11470
11506
|
setIsDragOver(false);
|
|
11471
11507
|
}, []);
|
|
11472
11508
|
const handleDrop = useCallback((e) => {
|
|
11473
11509
|
e.preventDefault();
|
|
11474
11510
|
setIsDragOver(false);
|
|
11475
|
-
if (locked || !onItemDrop) return;
|
|
11511
|
+
if (locked || !onItemDrop && !dropEvent) return;
|
|
11476
11512
|
const raw = e.dataTransfer.getData(DRAG_MIME);
|
|
11477
11513
|
if (!raw) return;
|
|
11478
11514
|
try {
|
|
11479
11515
|
const item = JSON.parse(raw);
|
|
11480
|
-
|
|
11516
|
+
if (dropEvent) emit(`UI:${dropEvent}`, { slotNumber, itemId: item.id });
|
|
11517
|
+
else onItemDrop?.(item);
|
|
11481
11518
|
} catch {
|
|
11482
11519
|
}
|
|
11483
|
-
}, [locked, onItemDrop]);
|
|
11520
|
+
}, [locked, onItemDrop, dropEvent, emit, slotNumber]);
|
|
11484
11521
|
const getTooltipStyle = () => {
|
|
11485
11522
|
if (!slotRef.current) return {};
|
|
11486
11523
|
const rect = slotRef.current.getBoundingClientRect();
|
|
@@ -11600,7 +11637,7 @@ function TraitSlot({
|
|
|
11600
11637
|
}
|
|
11601
11638
|
var SIZE_CONFIG2, DRAG_MIME;
|
|
11602
11639
|
var init_TraitSlot = __esm({
|
|
11603
|
-
"components/game/2d/
|
|
11640
|
+
"components/game/2d/molecules/TraitSlot.tsx"() {
|
|
11604
11641
|
"use client";
|
|
11605
11642
|
init_cn();
|
|
11606
11643
|
init_useEventBus();
|
|
@@ -11659,7 +11696,7 @@ function ActionTile({
|
|
|
11659
11696
|
}
|
|
11660
11697
|
var DRAG_MIME2, SIZE_CONFIG3;
|
|
11661
11698
|
var init_ActionTile = __esm({
|
|
11662
|
-
"components/game/2d/
|
|
11699
|
+
"components/game/2d/molecules/ActionTile.tsx"() {
|
|
11663
11700
|
init_atoms();
|
|
11664
11701
|
init_cn();
|
|
11665
11702
|
DRAG_MIME2 = "application/x-almadar-slot-item";
|
|
@@ -11696,7 +11733,7 @@ function ActionPalette({
|
|
|
11696
11733
|
] });
|
|
11697
11734
|
}
|
|
11698
11735
|
var init_ActionPalette = __esm({
|
|
11699
|
-
"components/game/2d/
|
|
11736
|
+
"components/game/2d/molecules/ActionPalette.tsx"() {
|
|
11700
11737
|
init_atoms();
|
|
11701
11738
|
init_cn();
|
|
11702
11739
|
init_ActionTile();
|
|
@@ -11708,6 +11745,8 @@ function SequenceBar({
|
|
|
11708
11745
|
maxSlots,
|
|
11709
11746
|
onSlotDrop,
|
|
11710
11747
|
onSlotRemove,
|
|
11748
|
+
slotDropEvent,
|
|
11749
|
+
slotRemoveEvent,
|
|
11711
11750
|
playing = false,
|
|
11712
11751
|
currentStep = -1,
|
|
11713
11752
|
categoryColors,
|
|
@@ -11715,16 +11754,19 @@ function SequenceBar({
|
|
|
11715
11754
|
size = "lg",
|
|
11716
11755
|
className
|
|
11717
11756
|
}) {
|
|
11757
|
+
const { emit } = useEventBus();
|
|
11718
11758
|
const handleDrop = useCallback((index) => (item) => {
|
|
11719
11759
|
if (playing) return;
|
|
11720
|
-
|
|
11721
|
-
|
|
11760
|
+
if (slotDropEvent) emit(`UI:${slotDropEvent}`, { slotNumber: index, itemId: item.id });
|
|
11761
|
+
else onSlotDrop?.(index, item);
|
|
11762
|
+
}, [emit, slotDropEvent, onSlotDrop, playing]);
|
|
11722
11763
|
const handleRemove = useCallback((index) => () => {
|
|
11723
11764
|
if (playing) return;
|
|
11724
|
-
|
|
11725
|
-
|
|
11765
|
+
if (slotRemoveEvent) emit(`UI:${slotRemoveEvent}`, { slotNumber: index });
|
|
11766
|
+
else onSlotRemove?.(index);
|
|
11767
|
+
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
11726
11768
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
11727
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
11769
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
11728
11770
|
i > 0 && /* @__PURE__ */ jsx(
|
|
11729
11771
|
Typography,
|
|
11730
11772
|
{
|
|
@@ -11754,9 +11796,10 @@ function SequenceBar({
|
|
|
11754
11796
|
] }, i)) });
|
|
11755
11797
|
}
|
|
11756
11798
|
var init_SequenceBar = __esm({
|
|
11757
|
-
"components/game/2d/
|
|
11799
|
+
"components/game/2d/molecules/SequenceBar.tsx"() {
|
|
11758
11800
|
init_atoms();
|
|
11759
11801
|
init_cn();
|
|
11802
|
+
init_useEventBus();
|
|
11760
11803
|
init_TraitSlot();
|
|
11761
11804
|
SequenceBar.displayName = "SequenceBar";
|
|
11762
11805
|
}
|
|
@@ -12072,7 +12115,7 @@ function RuleEditor({
|
|
|
12072
12115
|
] });
|
|
12073
12116
|
}
|
|
12074
12117
|
var init_RuleEditor = __esm({
|
|
12075
|
-
"components/game/2d/
|
|
12118
|
+
"components/game/2d/molecules/RuleEditor.tsx"() {
|
|
12076
12119
|
init_atoms();
|
|
12077
12120
|
init_cn();
|
|
12078
12121
|
RuleEditor.displayName = "RuleEditor";
|
|
@@ -12113,7 +12156,7 @@ function EventLog({
|
|
|
12113
12156
|
}
|
|
12114
12157
|
var STATUS_STYLES, STATUS_DOTS;
|
|
12115
12158
|
var init_EventLog = __esm({
|
|
12116
|
-
"components/game/2d/
|
|
12159
|
+
"components/game/2d/molecules/EventLog.tsx"() {
|
|
12117
12160
|
init_atoms();
|
|
12118
12161
|
init_cn();
|
|
12119
12162
|
STATUS_STYLES = {
|
|
@@ -12168,10 +12211,12 @@ var init_puzzleObject = __esm({
|
|
|
12168
12211
|
function ObjectRulePanel({
|
|
12169
12212
|
object,
|
|
12170
12213
|
onRulesChange,
|
|
12214
|
+
rulesChangeEvent,
|
|
12171
12215
|
disabled = false,
|
|
12172
12216
|
className
|
|
12173
12217
|
}) {
|
|
12174
12218
|
const { t } = useTranslate();
|
|
12219
|
+
const { emit } = useEventBus();
|
|
12175
12220
|
const id = objId(object);
|
|
12176
12221
|
const name = objName(object);
|
|
12177
12222
|
const icon = objIcon(object);
|
|
@@ -12182,15 +12227,19 @@ function ObjectRulePanel({
|
|
|
12182
12227
|
const rules = objRules(object);
|
|
12183
12228
|
const maxRules = objMaxRules(object);
|
|
12184
12229
|
const canAdd = rules.length < maxRules;
|
|
12230
|
+
const emitRules = useCallback((newRules) => {
|
|
12231
|
+
if (rulesChangeEvent) emit(`UI:${rulesChangeEvent}`, { objectId: id, rules: newRules });
|
|
12232
|
+
else onRulesChange?.(id, newRules);
|
|
12233
|
+
}, [rulesChangeEvent, emit, id, onRulesChange]);
|
|
12185
12234
|
const handleRuleChange = useCallback((index, updatedRule) => {
|
|
12186
12235
|
const newRules = [...rules];
|
|
12187
12236
|
newRules[index] = updatedRule;
|
|
12188
|
-
|
|
12189
|
-
}, [
|
|
12237
|
+
emitRules(newRules);
|
|
12238
|
+
}, [rules, emitRules]);
|
|
12190
12239
|
const handleRuleRemove = useCallback((index) => {
|
|
12191
12240
|
const newRules = rules.filter((_, i) => i !== index);
|
|
12192
|
-
|
|
12193
|
-
}, [
|
|
12241
|
+
emitRules(newRules);
|
|
12242
|
+
}, [rules, emitRules]);
|
|
12194
12243
|
const handleAddRule = useCallback(() => {
|
|
12195
12244
|
if (!canAdd || disabled) return;
|
|
12196
12245
|
const firstEvent = availableEvents[0]?.value || "";
|
|
@@ -12200,8 +12249,8 @@ function ObjectRulePanel({
|
|
|
12200
12249
|
whenEvent: firstEvent,
|
|
12201
12250
|
thenAction: firstAction
|
|
12202
12251
|
};
|
|
12203
|
-
|
|
12204
|
-
}, [canAdd, disabled,
|
|
12252
|
+
emitRules([...rules, newRule]);
|
|
12253
|
+
}, [canAdd, disabled, rules, availableEvents, availableActions, emitRules]);
|
|
12205
12254
|
const machine = {
|
|
12206
12255
|
name,
|
|
12207
12256
|
states,
|
|
@@ -12241,9 +12290,10 @@ function ObjectRulePanel({
|
|
|
12241
12290
|
}
|
|
12242
12291
|
var nextRuleId;
|
|
12243
12292
|
var init_ObjectRulePanel = __esm({
|
|
12244
|
-
"components/game/2d/
|
|
12293
|
+
"components/game/2d/molecules/ObjectRulePanel.tsx"() {
|
|
12245
12294
|
init_atoms();
|
|
12246
12295
|
init_cn();
|
|
12296
|
+
init_useEventBus();
|
|
12247
12297
|
init_TraitStateViewer();
|
|
12248
12298
|
init_RuleEditor();
|
|
12249
12299
|
init_puzzleObject();
|
|
@@ -12473,61 +12523,35 @@ function VariablePanel({
|
|
|
12473
12523
|
const { t } = useTranslate();
|
|
12474
12524
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
|
|
12475
12525
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
|
|
12476
|
-
variables.map((v) => {
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
const min = numField(v.min, 0);
|
|
12481
|
-
const unit = v.unit == null ? "" : String(v.unit);
|
|
12482
|
-
const pct = Math.round((value - min) / (max - min) * 100);
|
|
12483
|
-
const isHigh = pct > 80;
|
|
12484
|
-
const isLow = pct < 20;
|
|
12485
|
-
return /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
12486
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12487
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: name }),
|
|
12488
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "caption", className: cn(
|
|
12489
|
-
isHigh ? "text-error" : isLow ? "text-warning" : "text-foreground"
|
|
12490
|
-
), children: [
|
|
12491
|
-
value,
|
|
12492
|
-
unit,
|
|
12493
|
-
" / ",
|
|
12494
|
-
max,
|
|
12495
|
-
unit
|
|
12496
|
-
] })
|
|
12497
|
-
] }),
|
|
12498
|
-
/* @__PURE__ */ jsx(
|
|
12499
|
-
ProgressBar,
|
|
12500
|
-
{
|
|
12501
|
-
value: pct,
|
|
12502
|
-
color: isHigh ? "danger" : isLow ? "warning" : "primary",
|
|
12503
|
-
size: "sm"
|
|
12504
|
-
}
|
|
12505
|
-
)
|
|
12506
|
-
] }, name);
|
|
12507
|
-
})
|
|
12526
|
+
(variables ?? []).map((v) => /* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between", children: [
|
|
12527
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-foreground font-medium", children: v.name }),
|
|
12528
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-accent font-mono", children: v.value })
|
|
12529
|
+
] }, v.name))
|
|
12508
12530
|
] });
|
|
12509
12531
|
}
|
|
12510
|
-
var numField;
|
|
12511
12532
|
var init_VariablePanel = __esm({
|
|
12512
|
-
"components/game/2d/
|
|
12533
|
+
"components/game/2d/molecules/VariablePanel.tsx"() {
|
|
12513
12534
|
init_atoms();
|
|
12514
12535
|
init_cn();
|
|
12515
|
-
numField = (v, fallback = 0) => {
|
|
12516
|
-
const n = Number(v);
|
|
12517
|
-
return Number.isFinite(n) ? n : fallback;
|
|
12518
|
-
};
|
|
12519
12536
|
VariablePanel.displayName = "VariablePanel";
|
|
12520
12537
|
}
|
|
12521
12538
|
});
|
|
12522
12539
|
function StateJsonView({
|
|
12523
|
-
|
|
12540
|
+
name,
|
|
12541
|
+
initialState,
|
|
12542
|
+
states,
|
|
12543
|
+
transitions,
|
|
12524
12544
|
label,
|
|
12525
12545
|
defaultExpanded = false,
|
|
12526
12546
|
className
|
|
12527
12547
|
}) {
|
|
12528
12548
|
const { t } = useTranslate();
|
|
12529
12549
|
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
12530
|
-
const jsonString = JSON.stringify(
|
|
12550
|
+
const jsonString = JSON.stringify(
|
|
12551
|
+
{ name, initialState, states: states ?? [], transitions: transitions ?? [] },
|
|
12552
|
+
null,
|
|
12553
|
+
2
|
|
12554
|
+
);
|
|
12531
12555
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
12532
12556
|
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
12533
12557
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
@@ -12544,7 +12568,7 @@ function StateJsonView({
|
|
|
12544
12568
|
] });
|
|
12545
12569
|
}
|
|
12546
12570
|
var init_StateJsonView = __esm({
|
|
12547
|
-
"components/game/2d/
|
|
12571
|
+
"components/game/2d/molecules/StateJsonView.tsx"() {
|
|
12548
12572
|
init_atoms();
|
|
12549
12573
|
init_cn();
|
|
12550
12574
|
StateJsonView.displayName = "StateJsonView";
|
|
@@ -12713,7 +12737,7 @@ function StateArchitectBoard({
|
|
|
12713
12737
|
setAddingFrom(null);
|
|
12714
12738
|
if (playAgainEvent) emit(`UI:${playAgainEvent}`, {});
|
|
12715
12739
|
}, [initialState, entityVariables, playAgainEvent, emit]);
|
|
12716
|
-
|
|
12740
|
+
useMemo(() => ({
|
|
12717
12741
|
name: entityName,
|
|
12718
12742
|
states: entityStates,
|
|
12719
12743
|
initialState,
|
|
@@ -12848,7 +12872,7 @@ function StateArchitectBoard({
|
|
|
12848
12872
|
VariablePanel,
|
|
12849
12873
|
{
|
|
12850
12874
|
entityName,
|
|
12851
|
-
variables
|
|
12875
|
+
variables: variables.map((v) => ({ name: String(v.name ?? ""), value: String(v.value ?? "") }))
|
|
12852
12876
|
}
|
|
12853
12877
|
),
|
|
12854
12878
|
testResults.length > 0 && /* @__PURE__ */ jsxs(VStack, { className: "p-3 rounded-container bg-card border border-border", gap: "xs", children: [
|
|
@@ -12859,7 +12883,16 @@ function StateArchitectBoard({
|
|
|
12859
12883
|
!r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
|
|
12860
12884
|
] }, i))
|
|
12861
12885
|
] }),
|
|
12862
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
12886
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
12887
|
+
StateJsonView,
|
|
12888
|
+
{
|
|
12889
|
+
name: entityName,
|
|
12890
|
+
initialState,
|
|
12891
|
+
states: entityStates,
|
|
12892
|
+
transitions: transitions.map((tr) => ({ from: tr.from, to: tr.to, event: tr.event })),
|
|
12893
|
+
label: "View Code"
|
|
12894
|
+
}
|
|
12895
|
+
)
|
|
12863
12896
|
] })
|
|
12864
12897
|
] }),
|
|
12865
12898
|
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") }) }),
|
|
@@ -13771,227 +13804,6 @@ var init_NegotiatorBoard = __esm({
|
|
|
13771
13804
|
NegotiatorBoard.displayName = "NegotiatorBoard";
|
|
13772
13805
|
}
|
|
13773
13806
|
});
|
|
13774
|
-
|
|
13775
|
-
// components/game/shared/lib/mechanics.ts
|
|
13776
|
-
var projectileMotion, pendulum, springOscillator;
|
|
13777
|
-
var init_mechanics = __esm({
|
|
13778
|
-
"components/game/shared/lib/mechanics.ts"() {
|
|
13779
|
-
projectileMotion = {
|
|
13780
|
-
id: "mechanics-projectile",
|
|
13781
|
-
name: "Projectile Motion",
|
|
13782
|
-
description: "Launch a ball and observe parabolic trajectory under gravity.",
|
|
13783
|
-
domain: "natural",
|
|
13784
|
-
gravity: { x: 0, y: 9.81 },
|
|
13785
|
-
bodies: [
|
|
13786
|
-
{ id: "ball", x: 50, y: 350, vx: 80, vy: -120, mass: 1, radius: 10, color: "#e94560", fixed: false },
|
|
13787
|
-
{ id: "ground", x: 300, y: 390, vx: 0, vy: 0, mass: 1e3, radius: 400, color: "#333", fixed: true }
|
|
13788
|
-
],
|
|
13789
|
-
showVelocity: true,
|
|
13790
|
-
parameters: {
|
|
13791
|
-
angle: { value: 45, min: 0, max: 90, step: 1, label: "Launch angle (deg)" },
|
|
13792
|
-
velocity: { value: 100, min: 10, max: 200, step: 5, label: "Initial velocity (m/s)" },
|
|
13793
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
13794
|
-
}
|
|
13795
|
-
};
|
|
13796
|
-
pendulum = {
|
|
13797
|
-
id: "mechanics-pendulum",
|
|
13798
|
-
name: "Simple Pendulum",
|
|
13799
|
-
description: "A mass on a string swinging under gravity.",
|
|
13800
|
-
domain: "natural",
|
|
13801
|
-
gravity: { x: 0, y: 9.81 },
|
|
13802
|
-
bodies: [
|
|
13803
|
-
{ id: "pivot", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 5, color: "#888", fixed: true },
|
|
13804
|
-
{ id: "bob", x: 400, y: 200, vx: 0, vy: 0, mass: 5, radius: 15, color: "#e94560", fixed: false }
|
|
13805
|
-
],
|
|
13806
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 180, stiffness: 1 }],
|
|
13807
|
-
parameters: {
|
|
13808
|
-
length: { value: 180, min: 50, max: 300, step: 10, label: "String length (px)" },
|
|
13809
|
-
mass: { value: 5, min: 1, max: 20, step: 0.5, label: "Mass (kg)" },
|
|
13810
|
-
gravity: { value: 9.81, min: 0, max: 20, step: 0.1, label: "Gravity (m/s\xB2)" }
|
|
13811
|
-
}
|
|
13812
|
-
};
|
|
13813
|
-
springOscillator = {
|
|
13814
|
-
id: "mechanics-spring",
|
|
13815
|
-
name: "Spring Oscillator",
|
|
13816
|
-
description: "A mass bouncing on a spring \u2014 simple harmonic motion.",
|
|
13817
|
-
domain: "natural",
|
|
13818
|
-
gravity: { x: 0, y: 0 },
|
|
13819
|
-
bodies: [
|
|
13820
|
-
{ id: "anchor", x: 300, y: 50, vx: 0, vy: 0, mass: 1e3, radius: 8, color: "#888", fixed: true },
|
|
13821
|
-
{ id: "mass", x: 300, y: 250, vx: 0, vy: 0, mass: 2, radius: 20, color: "#0f3460", fixed: false }
|
|
13822
|
-
],
|
|
13823
|
-
constraints: [{ bodyA: 0, bodyB: 1, length: 150, stiffness: 0.5 }],
|
|
13824
|
-
parameters: {
|
|
13825
|
-
stiffness: { value: 0.5, min: 0.1, max: 2, step: 0.05, label: "Spring stiffness (k)" },
|
|
13826
|
-
mass: { value: 2, min: 0.5, max: 10, step: 0.5, label: "Mass (kg)" },
|
|
13827
|
-
damping: { value: 0, min: 0, max: 0.5, step: 0.01, label: "Damping" }
|
|
13828
|
-
}
|
|
13829
|
-
};
|
|
13830
|
-
}
|
|
13831
|
-
});
|
|
13832
|
-
|
|
13833
|
-
// components/game/shared/lib/physicsPresets.ts
|
|
13834
|
-
var init_physicsPresets = __esm({
|
|
13835
|
-
"components/game/shared/lib/physicsPresets.ts"() {
|
|
13836
|
-
init_mechanics();
|
|
13837
|
-
}
|
|
13838
|
-
});
|
|
13839
|
-
function resolvePreset(preset) {
|
|
13840
|
-
if (typeof preset !== "string") return preset;
|
|
13841
|
-
return PRESET_BY_ID[preset] ?? projectileMotion;
|
|
13842
|
-
}
|
|
13843
|
-
function SimulationCanvas({
|
|
13844
|
-
preset: presetProp,
|
|
13845
|
-
width = 600,
|
|
13846
|
-
height = 400,
|
|
13847
|
-
bodies: externalBodies,
|
|
13848
|
-
className
|
|
13849
|
-
}) {
|
|
13850
|
-
const preset = useMemo(() => resolvePreset(presetProp), [presetProp]);
|
|
13851
|
-
const canvasRef = useRef(null);
|
|
13852
|
-
const bodiesRef = useRef(structuredClone(preset.bodies));
|
|
13853
|
-
const interp = useRenderInterpolation();
|
|
13854
|
-
useEffect(() => {
|
|
13855
|
-
bodiesRef.current = structuredClone(preset.bodies);
|
|
13856
|
-
}, [preset]);
|
|
13857
|
-
const draw = useCallback(() => {
|
|
13858
|
-
const canvas = canvasRef.current;
|
|
13859
|
-
if (!canvas) return;
|
|
13860
|
-
const ctx = canvas.getContext("2d");
|
|
13861
|
-
if (!ctx) return;
|
|
13862
|
-
const bodies = bodiesRef.current;
|
|
13863
|
-
ctx.clearRect(0, 0, width, height);
|
|
13864
|
-
ctx.fillStyle = preset.backgroundColor ?? "#1a1a2e";
|
|
13865
|
-
ctx.fillRect(0, 0, width, height);
|
|
13866
|
-
if (preset.constraints) {
|
|
13867
|
-
for (const c of preset.constraints) {
|
|
13868
|
-
const a = bodies[c.bodyA];
|
|
13869
|
-
const b = bodies[c.bodyB];
|
|
13870
|
-
if (a && b) {
|
|
13871
|
-
ctx.beginPath();
|
|
13872
|
-
ctx.moveTo(a.x, a.y);
|
|
13873
|
-
ctx.lineTo(b.x, b.y);
|
|
13874
|
-
ctx.strokeStyle = "#533483";
|
|
13875
|
-
ctx.lineWidth = 1;
|
|
13876
|
-
ctx.setLineDash([4, 4]);
|
|
13877
|
-
ctx.stroke();
|
|
13878
|
-
ctx.setLineDash([]);
|
|
13879
|
-
}
|
|
13880
|
-
}
|
|
13881
|
-
}
|
|
13882
|
-
for (const body of bodies) {
|
|
13883
|
-
ctx.beginPath();
|
|
13884
|
-
ctx.arc(body.x, body.y, body.radius, 0, Math.PI * 2);
|
|
13885
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
13886
|
-
ctx.fill();
|
|
13887
|
-
if (preset.showVelocity) {
|
|
13888
|
-
ctx.beginPath();
|
|
13889
|
-
ctx.moveTo(body.x, body.y);
|
|
13890
|
-
ctx.lineTo(body.x + body.vx * 0.1, body.y + body.vy * 0.1);
|
|
13891
|
-
ctx.strokeStyle = "#16213e";
|
|
13892
|
-
ctx.lineWidth = 2;
|
|
13893
|
-
ctx.stroke();
|
|
13894
|
-
}
|
|
13895
|
-
}
|
|
13896
|
-
}, [width, height, preset]);
|
|
13897
|
-
useEffect(() => {
|
|
13898
|
-
if (!externalBodies) return;
|
|
13899
|
-
interp.onSnapshot(externalBodies.map((b) => ({ id: b.id, x: b.x, y: b.y })));
|
|
13900
|
-
}, [externalBodies]);
|
|
13901
|
-
const presetRef = useRef(preset);
|
|
13902
|
-
presetRef.current = preset;
|
|
13903
|
-
const widthRef = useRef(width);
|
|
13904
|
-
widthRef.current = width;
|
|
13905
|
-
const heightRef = useRef(height);
|
|
13906
|
-
heightRef.current = height;
|
|
13907
|
-
useEffect(() => {
|
|
13908
|
-
if (!externalBodies) return;
|
|
13909
|
-
const drawInterpolated = (positions) => {
|
|
13910
|
-
const canvas = canvasRef.current;
|
|
13911
|
-
if (!canvas) return;
|
|
13912
|
-
const ctx = canvas.getContext("2d");
|
|
13913
|
-
if (!ctx) return;
|
|
13914
|
-
const bodies = bodiesRef.current;
|
|
13915
|
-
const p = presetRef.current;
|
|
13916
|
-
const w = widthRef.current;
|
|
13917
|
-
const h = heightRef.current;
|
|
13918
|
-
ctx.clearRect(0, 0, w, h);
|
|
13919
|
-
ctx.fillStyle = p.backgroundColor ?? "#1a1a2e";
|
|
13920
|
-
ctx.fillRect(0, 0, w, h);
|
|
13921
|
-
if (p.constraints) {
|
|
13922
|
-
for (const c of p.constraints) {
|
|
13923
|
-
const a = bodies[c.bodyA];
|
|
13924
|
-
const b = bodies[c.bodyB];
|
|
13925
|
-
if (a && b) {
|
|
13926
|
-
const aPos = positions.get(a.id) ?? a;
|
|
13927
|
-
const bPos = positions.get(b.id) ?? b;
|
|
13928
|
-
ctx.beginPath();
|
|
13929
|
-
ctx.moveTo(aPos.x, aPos.y);
|
|
13930
|
-
ctx.lineTo(bPos.x, bPos.y);
|
|
13931
|
-
ctx.strokeStyle = "#533483";
|
|
13932
|
-
ctx.lineWidth = 1;
|
|
13933
|
-
ctx.setLineDash([4, 4]);
|
|
13934
|
-
ctx.stroke();
|
|
13935
|
-
ctx.setLineDash([]);
|
|
13936
|
-
}
|
|
13937
|
-
}
|
|
13938
|
-
}
|
|
13939
|
-
for (const body of bodies) {
|
|
13940
|
-
const pos = positions.get(body.id) ?? body;
|
|
13941
|
-
ctx.beginPath();
|
|
13942
|
-
ctx.arc(pos.x, pos.y, body.radius, 0, Math.PI * 2);
|
|
13943
|
-
ctx.fillStyle = body.color ?? "#e94560";
|
|
13944
|
-
ctx.fill();
|
|
13945
|
-
if (p.showVelocity) {
|
|
13946
|
-
ctx.beginPath();
|
|
13947
|
-
ctx.moveTo(pos.x, pos.y);
|
|
13948
|
-
ctx.lineTo(pos.x + body.vx * 0.1, pos.y + body.vy * 0.1);
|
|
13949
|
-
ctx.strokeStyle = "#16213e";
|
|
13950
|
-
ctx.lineWidth = 2;
|
|
13951
|
-
ctx.stroke();
|
|
13952
|
-
}
|
|
13953
|
-
}
|
|
13954
|
-
};
|
|
13955
|
-
return interp.startLoop(drawInterpolated);
|
|
13956
|
-
}, [externalBodies !== void 0, interp.startLoop]);
|
|
13957
|
-
useEffect(() => {
|
|
13958
|
-
draw();
|
|
13959
|
-
}, [draw]);
|
|
13960
|
-
useEffect(() => {
|
|
13961
|
-
if (typeof window === "undefined") return;
|
|
13962
|
-
const canvas = canvasRef.current;
|
|
13963
|
-
if (!canvas) return;
|
|
13964
|
-
bindCanvasCapture(() => canvas.toDataURL("image/png"));
|
|
13965
|
-
return () => {
|
|
13966
|
-
bindCanvasCapture(() => null);
|
|
13967
|
-
};
|
|
13968
|
-
}, []);
|
|
13969
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("flex justify-center", className), children: /* @__PURE__ */ jsx(
|
|
13970
|
-
"canvas",
|
|
13971
|
-
{
|
|
13972
|
-
ref: canvasRef,
|
|
13973
|
-
width,
|
|
13974
|
-
height,
|
|
13975
|
-
className: "rounded-container block max-w-full h-auto"
|
|
13976
|
-
}
|
|
13977
|
-
) });
|
|
13978
|
-
}
|
|
13979
|
-
var PRESET_BY_ID;
|
|
13980
|
-
var init_SimulationCanvas = __esm({
|
|
13981
|
-
"components/game/2d/organisms/SimulationCanvas.tsx"() {
|
|
13982
|
-
init_cn();
|
|
13983
|
-
init_atoms();
|
|
13984
|
-
init_verificationRegistry();
|
|
13985
|
-
init_physicsPresets();
|
|
13986
|
-
init_useRenderInterpolation();
|
|
13987
|
-
PRESET_BY_ID = {
|
|
13988
|
-
"mechanics-projectile": projectileMotion,
|
|
13989
|
-
"mechanics-pendulum": pendulum,
|
|
13990
|
-
"mechanics-spring": springOscillator
|
|
13991
|
-
};
|
|
13992
|
-
SimulationCanvas.displayName = "SimulationCanvas";
|
|
13993
|
-
}
|
|
13994
|
-
});
|
|
13995
13807
|
var GameTemplate;
|
|
13996
13808
|
var init_GameTemplate = __esm({
|
|
13997
13809
|
"components/game/2d/templates/GameTemplate.tsx"() {
|
|
@@ -14600,7 +14412,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14600
14412
|
}
|
|
14601
14413
|
);
|
|
14602
14414
|
};
|
|
14603
|
-
ErrorBoundary = class extends
|
|
14415
|
+
ErrorBoundary = class extends React97__default.Component {
|
|
14604
14416
|
constructor(props) {
|
|
14605
14417
|
super(props);
|
|
14606
14418
|
__publicField(this, "reset", () => {
|
|
@@ -15265,7 +15077,7 @@ var init_Container = __esm({
|
|
|
15265
15077
|
as: Component = "div"
|
|
15266
15078
|
}) => {
|
|
15267
15079
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
15268
|
-
return
|
|
15080
|
+
return React97__default.createElement(
|
|
15269
15081
|
Component,
|
|
15270
15082
|
{
|
|
15271
15083
|
className: cn(
|
|
@@ -17933,7 +17745,7 @@ var init_CodeBlock = __esm({
|
|
|
17933
17745
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
17934
17746
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
17935
17747
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
17936
|
-
CodeBlock =
|
|
17748
|
+
CodeBlock = React97__default.memo(
|
|
17937
17749
|
({
|
|
17938
17750
|
code: rawCode,
|
|
17939
17751
|
language = "text",
|
|
@@ -18520,7 +18332,7 @@ var init_MarkdownContent = __esm({
|
|
|
18520
18332
|
init_Box();
|
|
18521
18333
|
init_CodeBlock();
|
|
18522
18334
|
init_cn();
|
|
18523
|
-
MarkdownContent =
|
|
18335
|
+
MarkdownContent = React97__default.memo(
|
|
18524
18336
|
({ content, direction = "ltr", className }) => {
|
|
18525
18337
|
const { t: _t } = useTranslate();
|
|
18526
18338
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -19847,7 +19659,7 @@ var init_StateMachineView = __esm({
|
|
|
19847
19659
|
style: { top: title ? 30 : 0 },
|
|
19848
19660
|
children: [
|
|
19849
19661
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
19850
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
19662
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React97__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
19851
19663
|
StateNode2,
|
|
19852
19664
|
{
|
|
19853
19665
|
state,
|
|
@@ -25485,8 +25297,8 @@ var init_Menu = __esm({
|
|
|
25485
25297
|
"bottom-end": "bottom-start"
|
|
25486
25298
|
};
|
|
25487
25299
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
25488
|
-
const triggerChild =
|
|
25489
|
-
const triggerElement =
|
|
25300
|
+
const triggerChild = React97__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25301
|
+
const triggerElement = React97__default.cloneElement(
|
|
25490
25302
|
triggerChild,
|
|
25491
25303
|
{
|
|
25492
25304
|
ref: triggerRef,
|
|
@@ -25581,14 +25393,14 @@ function useDataDnd(args) {
|
|
|
25581
25393
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
25582
25394
|
const enabled = isZone || Boolean(dndRoot);
|
|
25583
25395
|
const eventBus = useEventBus();
|
|
25584
|
-
const parentRoot =
|
|
25396
|
+
const parentRoot = React97__default.useContext(RootCtx);
|
|
25585
25397
|
const isRoot = enabled && parentRoot === null;
|
|
25586
|
-
const zoneId =
|
|
25398
|
+
const zoneId = React97__default.useId();
|
|
25587
25399
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
25588
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
25589
|
-
const optimisticOrdersRef =
|
|
25400
|
+
const [optimisticOrders, setOptimisticOrders] = React97__default.useState(() => /* @__PURE__ */ new Map());
|
|
25401
|
+
const optimisticOrdersRef = React97__default.useRef(optimisticOrders);
|
|
25590
25402
|
optimisticOrdersRef.current = optimisticOrders;
|
|
25591
|
-
const clearOptimisticOrder =
|
|
25403
|
+
const clearOptimisticOrder = React97__default.useCallback((group) => {
|
|
25592
25404
|
setOptimisticOrders((prev) => {
|
|
25593
25405
|
if (!prev.has(group)) return prev;
|
|
25594
25406
|
const next = new Map(prev);
|
|
@@ -25613,7 +25425,7 @@ function useDataDnd(args) {
|
|
|
25613
25425
|
const raw = it[dndItemIdField];
|
|
25614
25426
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
25615
25427
|
}).join("|");
|
|
25616
|
-
const itemIds =
|
|
25428
|
+
const itemIds = React97__default.useMemo(
|
|
25617
25429
|
() => orderedItems.map((it, idx) => {
|
|
25618
25430
|
const raw = it[dndItemIdField];
|
|
25619
25431
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -25624,7 +25436,7 @@ function useDataDnd(args) {
|
|
|
25624
25436
|
const raw = it[dndItemIdField];
|
|
25625
25437
|
return raw != null ? String(raw) : `__${idx}`;
|
|
25626
25438
|
}).join("|");
|
|
25627
|
-
|
|
25439
|
+
React97__default.useEffect(() => {
|
|
25628
25440
|
const root = isRoot ? null : parentRoot;
|
|
25629
25441
|
if (root) {
|
|
25630
25442
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -25632,20 +25444,20 @@ function useDataDnd(args) {
|
|
|
25632
25444
|
clearOptimisticOrder(ownGroup);
|
|
25633
25445
|
}
|
|
25634
25446
|
}, [itemsContentSig, ownGroup]);
|
|
25635
|
-
const zonesRef =
|
|
25636
|
-
const registerZone =
|
|
25447
|
+
const zonesRef = React97__default.useRef(/* @__PURE__ */ new Map());
|
|
25448
|
+
const registerZone = React97__default.useCallback((zoneId2, meta2) => {
|
|
25637
25449
|
zonesRef.current.set(zoneId2, meta2);
|
|
25638
25450
|
}, []);
|
|
25639
|
-
const unregisterZone =
|
|
25451
|
+
const unregisterZone = React97__default.useCallback((zoneId2) => {
|
|
25640
25452
|
zonesRef.current.delete(zoneId2);
|
|
25641
25453
|
}, []);
|
|
25642
|
-
const [activeDrag, setActiveDrag] =
|
|
25643
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
25644
|
-
const meta =
|
|
25454
|
+
const [activeDrag, setActiveDrag] = React97__default.useState(null);
|
|
25455
|
+
const [overZoneGroup, setOverZoneGroup] = React97__default.useState(null);
|
|
25456
|
+
const meta = React97__default.useMemo(
|
|
25645
25457
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
25646
25458
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
25647
25459
|
);
|
|
25648
|
-
|
|
25460
|
+
React97__default.useEffect(() => {
|
|
25649
25461
|
const target = isRoot ? null : parentRoot;
|
|
25650
25462
|
if (!target) {
|
|
25651
25463
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -25664,7 +25476,7 @@ function useDataDnd(args) {
|
|
|
25664
25476
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
25665
25477
|
const sensors = useAlmadarDndSensors(true);
|
|
25666
25478
|
const collisionDetection = almadarDndCollisionDetection;
|
|
25667
|
-
const findZoneByItem =
|
|
25479
|
+
const findZoneByItem = React97__default.useCallback(
|
|
25668
25480
|
(id) => {
|
|
25669
25481
|
for (const z of zonesRef.current.values()) {
|
|
25670
25482
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -25673,7 +25485,7 @@ function useDataDnd(args) {
|
|
|
25673
25485
|
},
|
|
25674
25486
|
[]
|
|
25675
25487
|
);
|
|
25676
|
-
|
|
25488
|
+
React97__default.useCallback(
|
|
25677
25489
|
(group) => {
|
|
25678
25490
|
for (const z of zonesRef.current.values()) {
|
|
25679
25491
|
if (z.group === group) return z;
|
|
@@ -25682,7 +25494,7 @@ function useDataDnd(args) {
|
|
|
25682
25494
|
},
|
|
25683
25495
|
[]
|
|
25684
25496
|
);
|
|
25685
|
-
const handleDragEnd =
|
|
25497
|
+
const handleDragEnd = React97__default.useCallback(
|
|
25686
25498
|
(event) => {
|
|
25687
25499
|
const { active, over } = event;
|
|
25688
25500
|
const activeIdStr = String(active.id);
|
|
@@ -25773,8 +25585,8 @@ function useDataDnd(args) {
|
|
|
25773
25585
|
},
|
|
25774
25586
|
[eventBus]
|
|
25775
25587
|
);
|
|
25776
|
-
const sortableData =
|
|
25777
|
-
const SortableItem =
|
|
25588
|
+
const sortableData = React97__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
25589
|
+
const SortableItem = React97__default.useCallback(
|
|
25778
25590
|
({ id, children }) => {
|
|
25779
25591
|
const {
|
|
25780
25592
|
attributes,
|
|
@@ -25814,7 +25626,7 @@ function useDataDnd(args) {
|
|
|
25814
25626
|
id: droppableId,
|
|
25815
25627
|
data: sortableData
|
|
25816
25628
|
});
|
|
25817
|
-
const ctx =
|
|
25629
|
+
const ctx = React97__default.useContext(RootCtx);
|
|
25818
25630
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25819
25631
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25820
25632
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25829,7 +25641,7 @@ function useDataDnd(args) {
|
|
|
25829
25641
|
showForeignPlaceholder,
|
|
25830
25642
|
ctxAvailable: ctx != null
|
|
25831
25643
|
});
|
|
25832
|
-
|
|
25644
|
+
React97__default.useEffect(() => {
|
|
25833
25645
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25834
25646
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25835
25647
|
return /* @__PURE__ */ jsx(
|
|
@@ -25843,11 +25655,11 @@ function useDataDnd(args) {
|
|
|
25843
25655
|
}
|
|
25844
25656
|
);
|
|
25845
25657
|
};
|
|
25846
|
-
const rootContextValue =
|
|
25658
|
+
const rootContextValue = React97__default.useMemo(
|
|
25847
25659
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25848
25660
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25849
25661
|
);
|
|
25850
|
-
const handleDragStart =
|
|
25662
|
+
const handleDragStart = React97__default.useCallback((event) => {
|
|
25851
25663
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25852
25664
|
const rect = event.active.rect.current.initial;
|
|
25853
25665
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25866,7 +25678,7 @@ function useDataDnd(args) {
|
|
|
25866
25678
|
isRoot
|
|
25867
25679
|
});
|
|
25868
25680
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25869
|
-
const handleDragOver =
|
|
25681
|
+
const handleDragOver = React97__default.useCallback((event) => {
|
|
25870
25682
|
const { active, over } = event;
|
|
25871
25683
|
const overData = over?.data?.current;
|
|
25872
25684
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25936,7 +25748,7 @@ function useDataDnd(args) {
|
|
|
25936
25748
|
return next;
|
|
25937
25749
|
});
|
|
25938
25750
|
}, []);
|
|
25939
|
-
const handleDragCancel =
|
|
25751
|
+
const handleDragCancel = React97__default.useCallback((event) => {
|
|
25940
25752
|
setActiveDrag(null);
|
|
25941
25753
|
setOverZoneGroup(null);
|
|
25942
25754
|
dndLog.warn("dragCancel", {
|
|
@@ -25944,12 +25756,12 @@ function useDataDnd(args) {
|
|
|
25944
25756
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25945
25757
|
});
|
|
25946
25758
|
}, []);
|
|
25947
|
-
const handleDragEndWithCleanup =
|
|
25759
|
+
const handleDragEndWithCleanup = React97__default.useCallback((event) => {
|
|
25948
25760
|
handleDragEnd(event);
|
|
25949
25761
|
setActiveDrag(null);
|
|
25950
25762
|
setOverZoneGroup(null);
|
|
25951
25763
|
}, [handleDragEnd]);
|
|
25952
|
-
const wrapContainer =
|
|
25764
|
+
const wrapContainer = React97__default.useCallback(
|
|
25953
25765
|
(children) => {
|
|
25954
25766
|
if (!enabled) return children;
|
|
25955
25767
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -26003,7 +25815,7 @@ var init_useDataDnd = __esm({
|
|
|
26003
25815
|
init_useAlmadarDndCollision();
|
|
26004
25816
|
init_Box();
|
|
26005
25817
|
dndLog = createLogger("almadar:ui:dnd");
|
|
26006
|
-
RootCtx =
|
|
25818
|
+
RootCtx = React97__default.createContext(null);
|
|
26007
25819
|
}
|
|
26008
25820
|
});
|
|
26009
25821
|
function renderIconInput(icon, props) {
|
|
@@ -26529,7 +26341,7 @@ function DataList({
|
|
|
26529
26341
|
}) {
|
|
26530
26342
|
const eventBus = useEventBus();
|
|
26531
26343
|
const { t } = useTranslate();
|
|
26532
|
-
const [visibleCount, setVisibleCount] =
|
|
26344
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize || Infinity);
|
|
26533
26345
|
const fieldDefs = fields ?? columns ?? [];
|
|
26534
26346
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
26535
26347
|
const dnd = useDataDnd({
|
|
@@ -26548,7 +26360,7 @@ function DataList({
|
|
|
26548
26360
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
26549
26361
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
26550
26362
|
const hasRenderProp = typeof children === "function";
|
|
26551
|
-
|
|
26363
|
+
React97__default.useEffect(() => {
|
|
26552
26364
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
26553
26365
|
const childrenTypeOf = typeof children;
|
|
26554
26366
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -26652,7 +26464,7 @@ function DataList({
|
|
|
26652
26464
|
const items2 = [...data];
|
|
26653
26465
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
26654
26466
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
26655
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26467
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
26656
26468
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26657
26469
|
group.items.map((itemData, index) => {
|
|
26658
26470
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -26793,7 +26605,7 @@ function DataList({
|
|
|
26793
26605
|
className
|
|
26794
26606
|
),
|
|
26795
26607
|
children: [
|
|
26796
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26608
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
26797
26609
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26798
26610
|
group.items.map(
|
|
26799
26611
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26878,7 +26690,7 @@ var init_FormSection = __esm({
|
|
|
26878
26690
|
columns = 1,
|
|
26879
26691
|
className
|
|
26880
26692
|
}) => {
|
|
26881
|
-
const [collapsed, setCollapsed] =
|
|
26693
|
+
const [collapsed, setCollapsed] = React97__default.useState(defaultCollapsed);
|
|
26882
26694
|
const { t } = useTranslate();
|
|
26883
26695
|
const eventBus = useEventBus();
|
|
26884
26696
|
const gridClass = {
|
|
@@ -26886,7 +26698,7 @@ var init_FormSection = __esm({
|
|
|
26886
26698
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26887
26699
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26888
26700
|
}[columns];
|
|
26889
|
-
|
|
26701
|
+
React97__default.useCallback(() => {
|
|
26890
26702
|
if (collapsible) {
|
|
26891
26703
|
setCollapsed((prev) => !prev);
|
|
26892
26704
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27836,7 +27648,7 @@ var init_Flex = __esm({
|
|
|
27836
27648
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27837
27649
|
}
|
|
27838
27650
|
}
|
|
27839
|
-
return
|
|
27651
|
+
return React97__default.createElement(Component, {
|
|
27840
27652
|
className: cn(
|
|
27841
27653
|
inline ? "inline-flex" : "flex",
|
|
27842
27654
|
directionStyles[direction],
|
|
@@ -27955,7 +27767,7 @@ var init_Grid = __esm({
|
|
|
27955
27767
|
as: Component = "div"
|
|
27956
27768
|
}) => {
|
|
27957
27769
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
27958
|
-
return
|
|
27770
|
+
return React97__default.createElement(
|
|
27959
27771
|
Component,
|
|
27960
27772
|
{
|
|
27961
27773
|
className: cn(
|
|
@@ -28151,9 +27963,9 @@ var init_Popover = __esm({
|
|
|
28151
27963
|
onMouseLeave: handleClose,
|
|
28152
27964
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
28153
27965
|
};
|
|
28154
|
-
const childElement =
|
|
27966
|
+
const childElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28155
27967
|
const childPointerDown = childElement.props.onPointerDown;
|
|
28156
|
-
const triggerElement =
|
|
27968
|
+
const triggerElement = React97__default.cloneElement(
|
|
28157
27969
|
childElement,
|
|
28158
27970
|
{
|
|
28159
27971
|
ref: triggerRef,
|
|
@@ -28755,9 +28567,9 @@ var init_Tooltip = __esm({
|
|
|
28755
28567
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28756
28568
|
};
|
|
28757
28569
|
}, []);
|
|
28758
|
-
const triggerElement =
|
|
28570
|
+
const triggerElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28759
28571
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28760
|
-
const trigger =
|
|
28572
|
+
const trigger = React97__default.cloneElement(triggerElement, {
|
|
28761
28573
|
ref: triggerRef,
|
|
28762
28574
|
onMouseEnter: handleMouseEnter,
|
|
28763
28575
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28847,7 +28659,7 @@ var init_WizardProgress = __esm({
|
|
|
28847
28659
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28848
28660
|
const isActive = index === currentStep;
|
|
28849
28661
|
const isCompleted = index < currentStep;
|
|
28850
|
-
return /* @__PURE__ */ jsxs(
|
|
28662
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
28851
28663
|
/* @__PURE__ */ jsx(
|
|
28852
28664
|
"button",
|
|
28853
28665
|
{
|
|
@@ -30407,13 +30219,13 @@ var init_MapView = __esm({
|
|
|
30407
30219
|
shadowSize: [41, 41]
|
|
30408
30220
|
});
|
|
30409
30221
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30410
|
-
const { useEffect:
|
|
30222
|
+
const { useEffect: useEffect67, useRef: useRef64, useCallback: useCallback103, useState: useState98 } = React97__default;
|
|
30411
30223
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30412
30224
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30413
30225
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30414
30226
|
const map = useMap();
|
|
30415
|
-
const prevRef =
|
|
30416
|
-
|
|
30227
|
+
const prevRef = useRef64({ centerLat, centerLng, zoom });
|
|
30228
|
+
useEffect67(() => {
|
|
30417
30229
|
const prev = prevRef.current;
|
|
30418
30230
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30419
30231
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30424,7 +30236,7 @@ var init_MapView = __esm({
|
|
|
30424
30236
|
}
|
|
30425
30237
|
function MapClickHandler({ onMapClick }) {
|
|
30426
30238
|
const map = useMap();
|
|
30427
|
-
|
|
30239
|
+
useEffect67(() => {
|
|
30428
30240
|
if (!onMapClick) return;
|
|
30429
30241
|
const handler = (e) => {
|
|
30430
30242
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -30453,7 +30265,7 @@ var init_MapView = __esm({
|
|
|
30453
30265
|
}) {
|
|
30454
30266
|
const eventBus = useEventBus2();
|
|
30455
30267
|
const [clickedPosition, setClickedPosition] = useState98(null);
|
|
30456
|
-
const handleMapClick =
|
|
30268
|
+
const handleMapClick = useCallback103((lat, lng) => {
|
|
30457
30269
|
if (showClickedPin) {
|
|
30458
30270
|
setClickedPosition({ lat, lng });
|
|
30459
30271
|
}
|
|
@@ -30462,7 +30274,7 @@ var init_MapView = __esm({
|
|
|
30462
30274
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
30463
30275
|
}
|
|
30464
30276
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
30465
|
-
const handleMarkerClick =
|
|
30277
|
+
const handleMarkerClick = useCallback103((marker) => {
|
|
30466
30278
|
onMarkerClick?.(marker);
|
|
30467
30279
|
if (markerClickEvent) {
|
|
30468
30280
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -31322,8 +31134,8 @@ function TableView({
|
|
|
31322
31134
|
}) {
|
|
31323
31135
|
const eventBus = useEventBus();
|
|
31324
31136
|
const { t } = useTranslate();
|
|
31325
|
-
const [visibleCount, setVisibleCount] =
|
|
31326
|
-
const [localSelected, setLocalSelected] =
|
|
31137
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31138
|
+
const [localSelected, setLocalSelected] = React97__default.useState(/* @__PURE__ */ new Set());
|
|
31327
31139
|
const colDefs = columns ?? fields ?? [];
|
|
31328
31140
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31329
31141
|
const dnd = useDataDnd({
|
|
@@ -31518,12 +31330,12 @@ function TableView({
|
|
|
31518
31330
|
]
|
|
31519
31331
|
}
|
|
31520
31332
|
);
|
|
31521
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31333
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React97__default.Fragment, { children: rowInner }, id);
|
|
31522
31334
|
};
|
|
31523
31335
|
const items = Array.from(data);
|
|
31524
31336
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31525
31337
|
let runningIndex = 0;
|
|
31526
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31338
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
31527
31339
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31528
31340
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31529
31341
|
] }, gi)) });
|
|
@@ -32880,7 +32692,7 @@ var init_StepFlow = __esm({
|
|
|
32880
32692
|
className
|
|
32881
32693
|
}) => {
|
|
32882
32694
|
if (orientation === "vertical") {
|
|
32883
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32695
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React97__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32884
32696
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32885
32697
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32886
32698
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32891,7 +32703,7 @@ var init_StepFlow = __esm({
|
|
|
32891
32703
|
] })
|
|
32892
32704
|
] }) }, index)) });
|
|
32893
32705
|
}
|
|
32894
|
-
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(
|
|
32706
|
+
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(React97__default.Fragment, { children: [
|
|
32895
32707
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32896
32708
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32897
32709
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33876,7 +33688,7 @@ var init_LikertScale = __esm({
|
|
|
33876
33688
|
md: "text-base",
|
|
33877
33689
|
lg: "text-lg"
|
|
33878
33690
|
};
|
|
33879
|
-
LikertScale =
|
|
33691
|
+
LikertScale = React97__default.forwardRef(
|
|
33880
33692
|
({
|
|
33881
33693
|
question,
|
|
33882
33694
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33888,7 +33700,7 @@ var init_LikertScale = __esm({
|
|
|
33888
33700
|
variant = "radios",
|
|
33889
33701
|
className
|
|
33890
33702
|
}, ref) => {
|
|
33891
|
-
const groupId =
|
|
33703
|
+
const groupId = React97__default.useId();
|
|
33892
33704
|
const eventBus = useEventBus();
|
|
33893
33705
|
const handleSelect = useCallback(
|
|
33894
33706
|
(next) => {
|
|
@@ -36170,7 +35982,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36170
35982
|
"aria-label": t("aria.breadcrumb"),
|
|
36171
35983
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36172
35984
|
const isLast = idx === items.length - 1;
|
|
36173
|
-
return /* @__PURE__ */ jsxs(
|
|
35985
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
36174
35986
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36175
35987
|
Icon,
|
|
36176
35988
|
{
|
|
@@ -37039,7 +36851,7 @@ var init_MiniStateMachine = __esm({
|
|
|
37039
36851
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
37040
36852
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37041
36853
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37042
|
-
return /* @__PURE__ */ jsxs(
|
|
36854
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
37043
36855
|
/* @__PURE__ */ jsx(
|
|
37044
36856
|
AvlState,
|
|
37045
36857
|
{
|
|
@@ -37243,7 +37055,7 @@ var init_PageHeader = __esm({
|
|
|
37243
37055
|
info: "bg-info/10 text-info"
|
|
37244
37056
|
};
|
|
37245
37057
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37246
|
-
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(
|
|
37058
|
+
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(React97__default.Fragment, { children: [
|
|
37247
37059
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37248
37060
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37249
37061
|
"a",
|
|
@@ -37601,7 +37413,7 @@ var init_Section = __esm({
|
|
|
37601
37413
|
as: Component = "section"
|
|
37602
37414
|
}) => {
|
|
37603
37415
|
const hasHeader = title || description || action;
|
|
37604
|
-
return
|
|
37416
|
+
return React97__default.createElement(
|
|
37605
37417
|
Component,
|
|
37606
37418
|
{
|
|
37607
37419
|
className: cn(
|
|
@@ -37975,7 +37787,7 @@ var init_WizardContainer = __esm({
|
|
|
37975
37787
|
const isCompleted = index < currentStep;
|
|
37976
37788
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
37977
37789
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
37978
|
-
return /* @__PURE__ */ jsxs(
|
|
37790
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
37979
37791
|
/* @__PURE__ */ jsx(
|
|
37980
37792
|
Button,
|
|
37981
37793
|
{
|
|
@@ -40408,7 +40220,7 @@ var init_DetailPanel = __esm({
|
|
|
40408
40220
|
}
|
|
40409
40221
|
});
|
|
40410
40222
|
function extractTitle(children) {
|
|
40411
|
-
if (!
|
|
40223
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
40412
40224
|
const props = children.props;
|
|
40413
40225
|
if (typeof props.title === "string") {
|
|
40414
40226
|
return props.title;
|
|
@@ -40758,12 +40570,12 @@ var init_Form = __esm({
|
|
|
40758
40570
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40759
40571
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40760
40572
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40761
|
-
const normalizedInitialData =
|
|
40573
|
+
const normalizedInitialData = React97__default.useMemo(() => {
|
|
40762
40574
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40763
40575
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40764
40576
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40765
40577
|
}, [entity, initialData]);
|
|
40766
|
-
const entityDerivedFields =
|
|
40578
|
+
const entityDerivedFields = React97__default.useMemo(() => {
|
|
40767
40579
|
if (fields && fields.length > 0) return void 0;
|
|
40768
40580
|
if (!resolvedEntity) return void 0;
|
|
40769
40581
|
return resolvedEntity.fields.map(
|
|
@@ -40784,16 +40596,16 @@ var init_Form = __esm({
|
|
|
40784
40596
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40785
40597
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40786
40598
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40787
|
-
const [formData, setFormData] =
|
|
40599
|
+
const [formData, setFormData] = React97__default.useState(
|
|
40788
40600
|
normalizedInitialData
|
|
40789
40601
|
);
|
|
40790
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40602
|
+
const [collapsedSections, setCollapsedSections] = React97__default.useState(
|
|
40791
40603
|
/* @__PURE__ */ new Set()
|
|
40792
40604
|
);
|
|
40793
|
-
const [submitError, setSubmitError] =
|
|
40794
|
-
const formRef =
|
|
40605
|
+
const [submitError, setSubmitError] = React97__default.useState(null);
|
|
40606
|
+
const formRef = React97__default.useRef(null);
|
|
40795
40607
|
const formMode = props.mode;
|
|
40796
|
-
const mountedRef =
|
|
40608
|
+
const mountedRef = React97__default.useRef(false);
|
|
40797
40609
|
if (!mountedRef.current) {
|
|
40798
40610
|
mountedRef.current = true;
|
|
40799
40611
|
debug("forms", "mount", {
|
|
@@ -40806,7 +40618,7 @@ var init_Form = __esm({
|
|
|
40806
40618
|
});
|
|
40807
40619
|
}
|
|
40808
40620
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40809
|
-
const evalContext =
|
|
40621
|
+
const evalContext = React97__default.useMemo(
|
|
40810
40622
|
() => ({
|
|
40811
40623
|
formValues: formData,
|
|
40812
40624
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40815,7 +40627,7 @@ var init_Form = __esm({
|
|
|
40815
40627
|
}),
|
|
40816
40628
|
[formData, externalContext]
|
|
40817
40629
|
);
|
|
40818
|
-
|
|
40630
|
+
React97__default.useEffect(() => {
|
|
40819
40631
|
debug("forms", "initialData-sync", {
|
|
40820
40632
|
mode: formMode,
|
|
40821
40633
|
normalizedInitialData,
|
|
@@ -40826,7 +40638,7 @@ var init_Form = __esm({
|
|
|
40826
40638
|
setFormData(normalizedInitialData);
|
|
40827
40639
|
}
|
|
40828
40640
|
}, [normalizedInitialData]);
|
|
40829
|
-
const processCalculations =
|
|
40641
|
+
const processCalculations = React97__default.useCallback(
|
|
40830
40642
|
(changedFieldId, newFormData) => {
|
|
40831
40643
|
if (!hiddenCalculations.length) return;
|
|
40832
40644
|
const context = {
|
|
@@ -40851,7 +40663,7 @@ var init_Form = __esm({
|
|
|
40851
40663
|
},
|
|
40852
40664
|
[hiddenCalculations, externalContext, eventBus]
|
|
40853
40665
|
);
|
|
40854
|
-
const checkViolations =
|
|
40666
|
+
const checkViolations = React97__default.useCallback(
|
|
40855
40667
|
(changedFieldId, newFormData) => {
|
|
40856
40668
|
if (!violationTriggers.length) return;
|
|
40857
40669
|
const context = {
|
|
@@ -40889,7 +40701,7 @@ var init_Form = __esm({
|
|
|
40889
40701
|
processCalculations(name, newFormData);
|
|
40890
40702
|
checkViolations(name, newFormData);
|
|
40891
40703
|
};
|
|
40892
|
-
const isFieldVisible =
|
|
40704
|
+
const isFieldVisible = React97__default.useCallback(
|
|
40893
40705
|
(fieldName) => {
|
|
40894
40706
|
const condition = conditionalFields[fieldName];
|
|
40895
40707
|
if (!condition) return true;
|
|
@@ -40897,7 +40709,7 @@ var init_Form = __esm({
|
|
|
40897
40709
|
},
|
|
40898
40710
|
[conditionalFields, evalContext]
|
|
40899
40711
|
);
|
|
40900
|
-
const isSectionVisible =
|
|
40712
|
+
const isSectionVisible = React97__default.useCallback(
|
|
40901
40713
|
(section) => {
|
|
40902
40714
|
if (!section.condition) return true;
|
|
40903
40715
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40973,7 +40785,7 @@ var init_Form = __esm({
|
|
|
40973
40785
|
eventBus.emit(`UI:${onCancel}`);
|
|
40974
40786
|
}
|
|
40975
40787
|
};
|
|
40976
|
-
const renderField =
|
|
40788
|
+
const renderField = React97__default.useCallback(
|
|
40977
40789
|
(field) => {
|
|
40978
40790
|
const fieldName = field.name || field.field;
|
|
40979
40791
|
if (!fieldName) return null;
|
|
@@ -40994,7 +40806,7 @@ var init_Form = __esm({
|
|
|
40994
40806
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40995
40807
|
);
|
|
40996
40808
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40997
|
-
const normalizedFields =
|
|
40809
|
+
const normalizedFields = React97__default.useMemo(() => {
|
|
40998
40810
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40999
40811
|
return effectiveFields.map((field) => {
|
|
41000
40812
|
if (typeof field === "string") {
|
|
@@ -41018,7 +40830,7 @@ var init_Form = __esm({
|
|
|
41018
40830
|
return field;
|
|
41019
40831
|
});
|
|
41020
40832
|
}, [effectiveFields, resolvedEntity]);
|
|
41021
|
-
const schemaFields =
|
|
40833
|
+
const schemaFields = React97__default.useMemo(() => {
|
|
41022
40834
|
if (normalizedFields.length === 0) return null;
|
|
41023
40835
|
if (isDebugEnabled()) {
|
|
41024
40836
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -41028,7 +40840,7 @@ var init_Form = __esm({
|
|
|
41028
40840
|
}
|
|
41029
40841
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
41030
40842
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
41031
|
-
const sectionElements =
|
|
40843
|
+
const sectionElements = React97__default.useMemo(() => {
|
|
41032
40844
|
if (!sections || sections.length === 0) return null;
|
|
41033
40845
|
return sections.map((section) => {
|
|
41034
40846
|
if (!isSectionVisible(section)) {
|
|
@@ -41753,7 +41565,7 @@ var init_List = __esm({
|
|
|
41753
41565
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41754
41566
|
return [];
|
|
41755
41567
|
}, [entity]);
|
|
41756
|
-
const getItemActions =
|
|
41568
|
+
const getItemActions = React97__default.useCallback(
|
|
41757
41569
|
(item) => {
|
|
41758
41570
|
if (!itemActions) return [];
|
|
41759
41571
|
if (typeof itemActions === "function") {
|
|
@@ -42228,7 +42040,7 @@ var init_MediaGallery = __esm({
|
|
|
42228
42040
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
42229
42041
|
);
|
|
42230
42042
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
42231
|
-
const items =
|
|
42043
|
+
const items = React97__default.useMemo(() => {
|
|
42232
42044
|
if (propItems) return propItems;
|
|
42233
42045
|
if (entityData.length === 0) return [];
|
|
42234
42046
|
return entityData.map((record, idx) => {
|
|
@@ -42391,7 +42203,7 @@ var init_MediaGallery = __esm({
|
|
|
42391
42203
|
}
|
|
42392
42204
|
});
|
|
42393
42205
|
function extractTitle2(children) {
|
|
42394
|
-
if (!
|
|
42206
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
42395
42207
|
const props = children.props;
|
|
42396
42208
|
if (typeof props.title === "string") {
|
|
42397
42209
|
return props.title;
|
|
@@ -42646,7 +42458,7 @@ var init_debugRegistry = __esm({
|
|
|
42646
42458
|
}
|
|
42647
42459
|
});
|
|
42648
42460
|
function useDebugData() {
|
|
42649
|
-
const [data, setData] =
|
|
42461
|
+
const [data, setData] = React97.useState(() => ({
|
|
42650
42462
|
traits: [],
|
|
42651
42463
|
ticks: [],
|
|
42652
42464
|
guards: [],
|
|
@@ -42660,7 +42472,7 @@ function useDebugData() {
|
|
|
42660
42472
|
},
|
|
42661
42473
|
lastUpdate: Date.now()
|
|
42662
42474
|
}));
|
|
42663
|
-
|
|
42475
|
+
React97.useEffect(() => {
|
|
42664
42476
|
const updateData = () => {
|
|
42665
42477
|
setData({
|
|
42666
42478
|
traits: getAllTraits(),
|
|
@@ -42769,12 +42581,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42769
42581
|
return positions;
|
|
42770
42582
|
}
|
|
42771
42583
|
function WalkMinimap() {
|
|
42772
|
-
const [walkStep, setWalkStep] =
|
|
42773
|
-
const [traits2, setTraits] =
|
|
42774
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42775
|
-
const [completedTraits, setCompletedTraits] =
|
|
42776
|
-
const prevTraitRef =
|
|
42777
|
-
|
|
42584
|
+
const [walkStep, setWalkStep] = React97.useState(null);
|
|
42585
|
+
const [traits2, setTraits] = React97.useState([]);
|
|
42586
|
+
const [coveredEdges, setCoveredEdges] = React97.useState([]);
|
|
42587
|
+
const [completedTraits, setCompletedTraits] = React97.useState(/* @__PURE__ */ new Set());
|
|
42588
|
+
const prevTraitRef = React97.useRef(null);
|
|
42589
|
+
React97.useEffect(() => {
|
|
42778
42590
|
const interval = setInterval(() => {
|
|
42779
42591
|
const w = window;
|
|
42780
42592
|
const step = w.__orbitalWalkStep;
|
|
@@ -43210,15 +43022,15 @@ var init_EntitiesTab = __esm({
|
|
|
43210
43022
|
});
|
|
43211
43023
|
function EventFlowTab({ events: events2 }) {
|
|
43212
43024
|
const { t } = useTranslate();
|
|
43213
|
-
const [filter, setFilter] =
|
|
43214
|
-
const containerRef =
|
|
43215
|
-
const [autoScroll, setAutoScroll] =
|
|
43216
|
-
|
|
43025
|
+
const [filter, setFilter] = React97.useState("all");
|
|
43026
|
+
const containerRef = React97.useRef(null);
|
|
43027
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
43028
|
+
React97.useEffect(() => {
|
|
43217
43029
|
if (autoScroll && containerRef.current) {
|
|
43218
43030
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43219
43031
|
}
|
|
43220
43032
|
}, [events2.length, autoScroll]);
|
|
43221
|
-
const filteredEvents =
|
|
43033
|
+
const filteredEvents = React97.useMemo(() => {
|
|
43222
43034
|
if (filter === "all") return events2;
|
|
43223
43035
|
return events2.filter((e) => e.type === filter);
|
|
43224
43036
|
}, [events2, filter]);
|
|
@@ -43334,7 +43146,7 @@ var init_EventFlowTab = __esm({
|
|
|
43334
43146
|
});
|
|
43335
43147
|
function GuardsPanel({ guards }) {
|
|
43336
43148
|
const { t } = useTranslate();
|
|
43337
|
-
const [filter, setFilter] =
|
|
43149
|
+
const [filter, setFilter] = React97.useState("all");
|
|
43338
43150
|
if (guards.length === 0) {
|
|
43339
43151
|
return /* @__PURE__ */ jsx(
|
|
43340
43152
|
EmptyState,
|
|
@@ -43347,7 +43159,7 @@ function GuardsPanel({ guards }) {
|
|
|
43347
43159
|
}
|
|
43348
43160
|
const passedCount = guards.filter((g) => g.result).length;
|
|
43349
43161
|
const failedCount = guards.length - passedCount;
|
|
43350
|
-
const filteredGuards =
|
|
43162
|
+
const filteredGuards = React97.useMemo(() => {
|
|
43351
43163
|
if (filter === "all") return guards;
|
|
43352
43164
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
43353
43165
|
return guards.filter((g) => !g.result);
|
|
@@ -43510,10 +43322,10 @@ function EffectBadge({ effect }) {
|
|
|
43510
43322
|
}
|
|
43511
43323
|
function TransitionTimeline({ transitions }) {
|
|
43512
43324
|
const { t } = useTranslate();
|
|
43513
|
-
const containerRef =
|
|
43514
|
-
const [autoScroll, setAutoScroll] =
|
|
43515
|
-
const [expandedId, setExpandedId] =
|
|
43516
|
-
|
|
43325
|
+
const containerRef = React97.useRef(null);
|
|
43326
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
43327
|
+
const [expandedId, setExpandedId] = React97.useState(null);
|
|
43328
|
+
React97.useEffect(() => {
|
|
43517
43329
|
if (autoScroll && containerRef.current) {
|
|
43518
43330
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
43519
43331
|
}
|
|
@@ -43793,9 +43605,9 @@ function getAllEvents(traits2) {
|
|
|
43793
43605
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43794
43606
|
const eventBus = useEventBus();
|
|
43795
43607
|
const { t } = useTranslate();
|
|
43796
|
-
const [log13, setLog] =
|
|
43797
|
-
const prevStatesRef =
|
|
43798
|
-
|
|
43608
|
+
const [log13, setLog] = React97.useState([]);
|
|
43609
|
+
const prevStatesRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
43610
|
+
React97.useEffect(() => {
|
|
43799
43611
|
for (const trait of traits2) {
|
|
43800
43612
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43801
43613
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43964,10 +43776,10 @@ function VerifyModePanel({
|
|
|
43964
43776
|
localCount
|
|
43965
43777
|
}) {
|
|
43966
43778
|
const { t } = useTranslate();
|
|
43967
|
-
const [expanded, setExpanded] =
|
|
43968
|
-
const scrollRef =
|
|
43969
|
-
const prevCountRef =
|
|
43970
|
-
|
|
43779
|
+
const [expanded, setExpanded] = React97.useState(true);
|
|
43780
|
+
const scrollRef = React97.useRef(null);
|
|
43781
|
+
const prevCountRef = React97.useRef(0);
|
|
43782
|
+
React97.useEffect(() => {
|
|
43971
43783
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43972
43784
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43973
43785
|
}
|
|
@@ -44024,10 +43836,10 @@ function RuntimeDebugger({
|
|
|
44024
43836
|
schema
|
|
44025
43837
|
}) {
|
|
44026
43838
|
const { t } = useTranslate();
|
|
44027
|
-
const [isCollapsed, setIsCollapsed] =
|
|
44028
|
-
const [isVisible, setIsVisible] =
|
|
43839
|
+
const [isCollapsed, setIsCollapsed] = React97.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43840
|
+
const [isVisible, setIsVisible] = React97.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
44029
43841
|
const debugData = useDebugData();
|
|
44030
|
-
|
|
43842
|
+
React97.useEffect(() => {
|
|
44031
43843
|
if (mode === "inline") return;
|
|
44032
43844
|
return onDebugToggle((enabled) => {
|
|
44033
43845
|
setIsVisible(enabled);
|
|
@@ -44036,7 +43848,7 @@ function RuntimeDebugger({
|
|
|
44036
43848
|
}
|
|
44037
43849
|
});
|
|
44038
43850
|
}, [mode]);
|
|
44039
|
-
|
|
43851
|
+
React97.useEffect(() => {
|
|
44040
43852
|
if (mode === "inline") return;
|
|
44041
43853
|
const handleKeyDown = (e) => {
|
|
44042
43854
|
if (e.key === "`" && isVisible) {
|
|
@@ -44556,7 +44368,7 @@ var init_StatCard = __esm({
|
|
|
44556
44368
|
const labelToUse = propLabel ?? propTitle;
|
|
44557
44369
|
const eventBus = useEventBus();
|
|
44558
44370
|
const { t } = useTranslate();
|
|
44559
|
-
const handleActionClick =
|
|
44371
|
+
const handleActionClick = React97__default.useCallback(() => {
|
|
44560
44372
|
if (action?.event) {
|
|
44561
44373
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44562
44374
|
}
|
|
@@ -44567,7 +44379,7 @@ var init_StatCard = __esm({
|
|
|
44567
44379
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44568
44380
|
const isLoading = externalLoading ?? false;
|
|
44569
44381
|
const error = externalError;
|
|
44570
|
-
const computeMetricValue =
|
|
44382
|
+
const computeMetricValue = React97__default.useCallback(
|
|
44571
44383
|
(metric, items) => {
|
|
44572
44384
|
if (metric.value !== void 0) {
|
|
44573
44385
|
return metric.value;
|
|
@@ -44606,7 +44418,7 @@ var init_StatCard = __esm({
|
|
|
44606
44418
|
},
|
|
44607
44419
|
[]
|
|
44608
44420
|
);
|
|
44609
|
-
const schemaStats =
|
|
44421
|
+
const schemaStats = React97__default.useMemo(() => {
|
|
44610
44422
|
if (!metrics || metrics.length === 0) return null;
|
|
44611
44423
|
return metrics.map((metric) => ({
|
|
44612
44424
|
label: metric.label,
|
|
@@ -44614,7 +44426,7 @@ var init_StatCard = __esm({
|
|
|
44614
44426
|
format: metric.format
|
|
44615
44427
|
}));
|
|
44616
44428
|
}, [metrics, data, computeMetricValue]);
|
|
44617
|
-
const calculatedTrend =
|
|
44429
|
+
const calculatedTrend = React97__default.useMemo(() => {
|
|
44618
44430
|
if (manualTrend !== void 0) return manualTrend;
|
|
44619
44431
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44620
44432
|
return void 0;
|
|
@@ -45254,8 +45066,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45254
45066
|
] });
|
|
45255
45067
|
};
|
|
45256
45068
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
45257
|
-
const endRef =
|
|
45258
|
-
|
|
45069
|
+
const endRef = React97__default.useRef(null);
|
|
45070
|
+
React97__default.useEffect(() => {
|
|
45259
45071
|
if (!autoScroll) return;
|
|
45260
45072
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45261
45073
|
}, [activities.length, autoScroll]);
|
|
@@ -45349,7 +45161,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
45349
45161
|
};
|
|
45350
45162
|
SubagentRichCard = ({ subagent }) => {
|
|
45351
45163
|
const { t } = useTranslate();
|
|
45352
|
-
const activities =
|
|
45164
|
+
const activities = React97__default.useMemo(
|
|
45353
45165
|
() => subagentMessagesToActivities(subagent.messages),
|
|
45354
45166
|
[subagent.messages]
|
|
45355
45167
|
);
|
|
@@ -45426,8 +45238,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
45426
45238
|
] });
|
|
45427
45239
|
};
|
|
45428
45240
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
45429
|
-
const endRef =
|
|
45430
|
-
|
|
45241
|
+
const endRef = React97__default.useRef(null);
|
|
45242
|
+
React97__default.useEffect(() => {
|
|
45431
45243
|
if (!autoScroll) return;
|
|
45432
45244
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
45433
45245
|
}, [messages.length, autoScroll]);
|
|
@@ -45857,7 +45669,7 @@ var init_Timeline = __esm({
|
|
|
45857
45669
|
}) => {
|
|
45858
45670
|
const { t } = useTranslate();
|
|
45859
45671
|
const entityData = entity ?? [];
|
|
45860
|
-
const items =
|
|
45672
|
+
const items = React97__default.useMemo(() => {
|
|
45861
45673
|
if (propItems) return propItems;
|
|
45862
45674
|
if (entityData.length === 0) return [];
|
|
45863
45675
|
return entityData.map((record, idx) => {
|
|
@@ -45959,7 +45771,7 @@ var init_Timeline = __esm({
|
|
|
45959
45771
|
}
|
|
45960
45772
|
});
|
|
45961
45773
|
function extractToastProps(children) {
|
|
45962
|
-
if (!
|
|
45774
|
+
if (!React97__default.isValidElement(children)) {
|
|
45963
45775
|
if (typeof children === "string") {
|
|
45964
45776
|
return { message: children };
|
|
45965
45777
|
}
|
|
@@ -46001,7 +45813,7 @@ var init_ToastSlot = __esm({
|
|
|
46001
45813
|
eventBus.emit(`${prefix}CLOSE`);
|
|
46002
45814
|
};
|
|
46003
45815
|
if (!isVisible) return null;
|
|
46004
|
-
const isCustomContent =
|
|
45816
|
+
const isCustomContent = React97__default.isValidElement(children) && !message;
|
|
46005
45817
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
46006
45818
|
Toast,
|
|
46007
45819
|
{
|
|
@@ -46018,7 +45830,7 @@ var init_ToastSlot = __esm({
|
|
|
46018
45830
|
}
|
|
46019
45831
|
});
|
|
46020
45832
|
function lazyThree(name, loader) {
|
|
46021
|
-
const Lazy =
|
|
45833
|
+
const Lazy = React97__default.lazy(
|
|
46022
45834
|
() => loader().then((m) => {
|
|
46023
45835
|
const Resolved = m[name];
|
|
46024
45836
|
if (!Resolved) {
|
|
@@ -46030,13 +45842,13 @@ function lazyThree(name, loader) {
|
|
|
46030
45842
|
})
|
|
46031
45843
|
);
|
|
46032
45844
|
function ThreeWrapper(props) {
|
|
46033
|
-
return
|
|
45845
|
+
return React97__default.createElement(
|
|
46034
45846
|
ThreeBoundary,
|
|
46035
45847
|
{ name },
|
|
46036
|
-
|
|
46037
|
-
|
|
45848
|
+
React97__default.createElement(
|
|
45849
|
+
React97__default.Suspense,
|
|
46038
45850
|
{ fallback: null },
|
|
46039
|
-
|
|
45851
|
+
React97__default.createElement(Lazy, props)
|
|
46040
45852
|
)
|
|
46041
45853
|
);
|
|
46042
45854
|
}
|
|
@@ -46197,6 +46009,7 @@ var init_component_registry_generated = __esm({
|
|
|
46197
46009
|
init_Navigation();
|
|
46198
46010
|
init_NegotiatorBoard();
|
|
46199
46011
|
init_NumberStepper();
|
|
46012
|
+
init_ObjectRulePanel();
|
|
46200
46013
|
init_OptionConstraintGroup();
|
|
46201
46014
|
init_OrbitalVisualization();
|
|
46202
46015
|
init_Overlay();
|
|
@@ -46242,7 +46055,6 @@ var init_component_registry_generated = __esm({
|
|
|
46242
46055
|
init_Sidebar();
|
|
46243
46056
|
init_SignaturePad();
|
|
46244
46057
|
init_SimpleGrid();
|
|
46245
|
-
init_SimulationCanvas();
|
|
46246
46058
|
init_SimulatorBoard();
|
|
46247
46059
|
init_Skeleton();
|
|
46248
46060
|
init_SocialProof();
|
|
@@ -46260,6 +46072,7 @@ var init_component_registry_generated = __esm({
|
|
|
46260
46072
|
init_StateArchitectBoard();
|
|
46261
46073
|
init_StateGraph();
|
|
46262
46074
|
init_StateIndicator();
|
|
46075
|
+
init_StateJsonView();
|
|
46263
46076
|
init_StateMachineView();
|
|
46264
46077
|
init_StatsGrid();
|
|
46265
46078
|
init_StatsOrganism();
|
|
@@ -46306,6 +46119,7 @@ var init_component_registry_generated = __esm({
|
|
|
46306
46119
|
init_Typography();
|
|
46307
46120
|
init_UISlotRenderer();
|
|
46308
46121
|
init_UploadDropZone();
|
|
46122
|
+
init_VariablePanel();
|
|
46309
46123
|
init_VersionDiff();
|
|
46310
46124
|
init_ViolationAlert();
|
|
46311
46125
|
init_VoteStack();
|
|
@@ -46313,7 +46127,7 @@ var init_component_registry_generated = __esm({
|
|
|
46313
46127
|
init_WizardContainer();
|
|
46314
46128
|
init_WizardNavigation();
|
|
46315
46129
|
init_WizardProgress();
|
|
46316
|
-
ThreeBoundary = class extends
|
|
46130
|
+
ThreeBoundary = class extends React97__default.Component {
|
|
46317
46131
|
constructor() {
|
|
46318
46132
|
super(...arguments);
|
|
46319
46133
|
__publicField(this, "state", { failed: false });
|
|
@@ -46323,7 +46137,7 @@ var init_component_registry_generated = __esm({
|
|
|
46323
46137
|
}
|
|
46324
46138
|
render() {
|
|
46325
46139
|
if (this.state.failed) {
|
|
46326
|
-
return
|
|
46140
|
+
return React97__default.createElement(
|
|
46327
46141
|
"div",
|
|
46328
46142
|
{
|
|
46329
46143
|
"data-testid": "three-unavailable",
|
|
@@ -46506,6 +46320,7 @@ var init_component_registry_generated = __esm({
|
|
|
46506
46320
|
"Navigation": Navigation,
|
|
46507
46321
|
"NegotiatorBoard": NegotiatorBoard,
|
|
46508
46322
|
"NumberStepper": NumberStepper,
|
|
46323
|
+
"ObjectRulePanel": ObjectRulePanel,
|
|
46509
46324
|
"OptionConstraintGroup": OptionConstraintGroup,
|
|
46510
46325
|
"OrbitalVisualization": OrbitalVisualization,
|
|
46511
46326
|
"Overlay": Overlay,
|
|
@@ -46551,7 +46366,6 @@ var init_component_registry_generated = __esm({
|
|
|
46551
46366
|
"Sidebar": Sidebar,
|
|
46552
46367
|
"SignaturePad": SignaturePad,
|
|
46553
46368
|
"SimpleGrid": SimpleGrid,
|
|
46554
|
-
"SimulationCanvas": SimulationCanvas,
|
|
46555
46369
|
"SimulatorBoard": SimulatorBoard,
|
|
46556
46370
|
"Skeleton": Skeleton,
|
|
46557
46371
|
"SocialProof": SocialProof,
|
|
@@ -46572,6 +46386,7 @@ var init_component_registry_generated = __esm({
|
|
|
46572
46386
|
"StateArchitectBoard": StateArchitectBoard,
|
|
46573
46387
|
"StateGraph": StateGraph,
|
|
46574
46388
|
"StateIndicator": StateIndicator,
|
|
46389
|
+
"StateJsonView": StateJsonView,
|
|
46575
46390
|
"StateMachineView": StateMachineView,
|
|
46576
46391
|
"StatsGrid": StatsGrid,
|
|
46577
46392
|
"StatsOrganism": StatsOrganism,
|
|
@@ -46619,6 +46434,7 @@ var init_component_registry_generated = __esm({
|
|
|
46619
46434
|
"UISlotRenderer": UISlotRenderer,
|
|
46620
46435
|
"UploadDropZone": UploadDropZone,
|
|
46621
46436
|
"VStack": VStack,
|
|
46437
|
+
"VariablePanel": VariablePanel,
|
|
46622
46438
|
"VersionDiff": VersionDiff,
|
|
46623
46439
|
"ViolationAlert": ViolationAlert,
|
|
46624
46440
|
"VoteStack": VoteStack,
|
|
@@ -46644,7 +46460,7 @@ function SuspenseConfigProvider({
|
|
|
46644
46460
|
config,
|
|
46645
46461
|
children
|
|
46646
46462
|
}) {
|
|
46647
|
-
return
|
|
46463
|
+
return React97__default.createElement(
|
|
46648
46464
|
SuspenseConfigContext.Provider,
|
|
46649
46465
|
{ value: config },
|
|
46650
46466
|
children
|
|
@@ -46686,7 +46502,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46686
46502
|
}
|
|
46687
46503
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
46688
46504
|
}
|
|
46689
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46505
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React97__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46690
46506
|
const obj = field;
|
|
46691
46507
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46692
46508
|
if (!fieldName) return field;
|
|
@@ -47139,7 +46955,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47139
46955
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47140
46956
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47141
46957
|
}
|
|
47142
|
-
return /* @__PURE__ */ jsx(
|
|
46958
|
+
return /* @__PURE__ */ jsx(React97__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47143
46959
|
}
|
|
47144
46960
|
if (!child || typeof child !== "object") return null;
|
|
47145
46961
|
const childId = `${parentId}-${index}`;
|
|
@@ -47179,14 +46995,14 @@ function isPatternConfig(value) {
|
|
|
47179
46995
|
if (value === null || value === void 0) return false;
|
|
47180
46996
|
if (typeof value !== "object") return false;
|
|
47181
46997
|
if (Array.isArray(value)) return false;
|
|
47182
|
-
if (
|
|
46998
|
+
if (React97__default.isValidElement(value)) return false;
|
|
47183
46999
|
if (value instanceof Date) return false;
|
|
47184
47000
|
if (typeof value === "function") return false;
|
|
47185
47001
|
const record = value;
|
|
47186
47002
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
47187
47003
|
}
|
|
47188
47004
|
function isPlainConfigObject(value) {
|
|
47189
|
-
if (
|
|
47005
|
+
if (React97__default.isValidElement(value)) return false;
|
|
47190
47006
|
if (value instanceof Date) return false;
|
|
47191
47007
|
const proto = Object.getPrototypeOf(value);
|
|
47192
47008
|
return proto === Object.prototype || proto === null;
|
|
@@ -47312,7 +47128,7 @@ function SlotContentRenderer({
|
|
|
47312
47128
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
47313
47129
|
const slotVal = restProps[slotKey];
|
|
47314
47130
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
47315
|
-
if (
|
|
47131
|
+
if (React97__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47316
47132
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
47317
47133
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
47318
47134
|
slotVal,
|
|
@@ -47361,7 +47177,7 @@ function SlotContentRenderer({
|
|
|
47361
47177
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
47362
47178
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
47363
47179
|
const sample = resolvedItems[0];
|
|
47364
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47180
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React97__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
47365
47181
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
47366
47182
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
47367
47183
|
}
|