@almadar/ui 5.71.0 → 5.72.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 +1780 -1951
- package/dist/avl/index.js +513 -684
- package/dist/components/game/atoms/ScoreDisplay.d.ts +1 -3
- package/dist/components/game/atoms/Sprite.d.ts +6 -1
- package/dist/components/game/atoms/XPBar.d.ts +1 -1
- package/dist/components/game/molecules/GameCanvas3D.d.ts +0 -2
- package/dist/components/game/molecules/IsometricCanvas.d.ts +4 -2
- package/dist/components/game/molecules/PlatformerCanvas.d.ts +4 -1
- package/dist/components/game/molecules/StatBadge.d.ts +3 -1
- package/dist/components/game/molecules/three/index.cjs +4 -81
- package/dist/components/game/molecules/three/index.js +4 -81
- package/dist/components/game/molecules/useUnitSpriteAtlas.d.ts +3 -2
- package/dist/components/game/organisms/types/isometric.d.ts +16 -0
- package/dist/components/index.cjs +1906 -2057
- package/dist/components/index.js +794 -945
- package/dist/providers/index.cjs +1589 -1760
- package/dist/providers/index.js +489 -660
- package/dist/runtime/index.cjs +1645 -1816
- package/dist/runtime/index.js +493 -664
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React87 from 'react';
|
|
2
|
+
import React87__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -445,7 +445,7 @@ var init_Box = __esm({
|
|
|
445
445
|
fixed: "fixed",
|
|
446
446
|
sticky: "sticky"
|
|
447
447
|
};
|
|
448
|
-
Box =
|
|
448
|
+
Box = React87__default.forwardRef(
|
|
449
449
|
({
|
|
450
450
|
padding,
|
|
451
451
|
paddingX,
|
|
@@ -510,7 +510,7 @@ var init_Box = __esm({
|
|
|
510
510
|
onPointerDown?.(e);
|
|
511
511
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
512
512
|
const isClickable = action || onClick;
|
|
513
|
-
return
|
|
513
|
+
return React87__default.createElement(
|
|
514
514
|
Component2,
|
|
515
515
|
{
|
|
516
516
|
ref,
|
|
@@ -606,7 +606,7 @@ function loadLib(key, importer) {
|
|
|
606
606
|
return p2;
|
|
607
607
|
}
|
|
608
608
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
609
|
-
const Lazy =
|
|
609
|
+
const Lazy = React87__default.lazy(async () => {
|
|
610
610
|
const lib = await loadLib(libKey, importer);
|
|
611
611
|
const Comp = pick(lib);
|
|
612
612
|
if (!Comp) {
|
|
@@ -616,7 +616,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
616
616
|
return { default: Comp };
|
|
617
617
|
});
|
|
618
618
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
619
|
-
|
|
619
|
+
React87__default.Suspense,
|
|
620
620
|
{
|
|
621
621
|
fallback: /* @__PURE__ */ jsx(
|
|
622
622
|
"span",
|
|
@@ -1343,7 +1343,7 @@ var init_Icon = __esm({
|
|
|
1343
1343
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1344
1344
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1345
1345
|
const family = useIconFamily();
|
|
1346
|
-
const RenderedComponent =
|
|
1346
|
+
const RenderedComponent = React87__default.useMemo(() => {
|
|
1347
1347
|
if (directIcon) return null;
|
|
1348
1348
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1349
1349
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1405,7 +1405,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1405
1405
|
const IconComp = value;
|
|
1406
1406
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1407
1407
|
}
|
|
1408
|
-
if (
|
|
1408
|
+
if (React87__default.isValidElement(value)) {
|
|
1409
1409
|
return value;
|
|
1410
1410
|
}
|
|
1411
1411
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1481,7 +1481,7 @@ var init_Button = __esm({
|
|
|
1481
1481
|
md: "h-icon-default w-icon-default",
|
|
1482
1482
|
lg: "h-icon-default w-icon-default"
|
|
1483
1483
|
};
|
|
1484
|
-
Button =
|
|
1484
|
+
Button = React87__default.forwardRef(
|
|
1485
1485
|
({
|
|
1486
1486
|
className,
|
|
1487
1487
|
variant = "primary",
|
|
@@ -1547,7 +1547,7 @@ var Dialog;
|
|
|
1547
1547
|
var init_Dialog = __esm({
|
|
1548
1548
|
"components/core/atoms/Dialog.tsx"() {
|
|
1549
1549
|
init_cn();
|
|
1550
|
-
Dialog =
|
|
1550
|
+
Dialog = React87__default.forwardRef(
|
|
1551
1551
|
({
|
|
1552
1552
|
role = "dialog",
|
|
1553
1553
|
"aria-modal": ariaModal = true,
|
|
@@ -1665,7 +1665,7 @@ var init_Typography = __esm({
|
|
|
1665
1665
|
}) => {
|
|
1666
1666
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1667
1667
|
const Component2 = as || defaultElements[variant];
|
|
1668
|
-
return
|
|
1668
|
+
return React87__default.createElement(
|
|
1669
1669
|
Component2,
|
|
1670
1670
|
{
|
|
1671
1671
|
id,
|
|
@@ -2160,7 +2160,7 @@ var init_Badge = __esm({
|
|
|
2160
2160
|
md: "px-2.5 py-1 text-sm",
|
|
2161
2161
|
lg: "px-3 py-1.5 text-base"
|
|
2162
2162
|
};
|
|
2163
|
-
Badge =
|
|
2163
|
+
Badge = React87__default.forwardRef(
|
|
2164
2164
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2165
2165
|
const iconSizes3 = {
|
|
2166
2166
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2496,7 +2496,7 @@ var init_SvgFlow = __esm({
|
|
|
2496
2496
|
width = 100,
|
|
2497
2497
|
height = 100
|
|
2498
2498
|
}) => {
|
|
2499
|
-
const markerId =
|
|
2499
|
+
const markerId = React87__default.useMemo(() => {
|
|
2500
2500
|
flowIdCounter += 1;
|
|
2501
2501
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2502
2502
|
}, []);
|
|
@@ -3089,7 +3089,7 @@ var init_SvgRing = __esm({
|
|
|
3089
3089
|
width = 100,
|
|
3090
3090
|
height = 100
|
|
3091
3091
|
}) => {
|
|
3092
|
-
const gradientId =
|
|
3092
|
+
const gradientId = React87__default.useMemo(() => {
|
|
3093
3093
|
ringIdCounter += 1;
|
|
3094
3094
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3095
3095
|
}, []);
|
|
@@ -3270,7 +3270,7 @@ var init_Input = __esm({
|
|
|
3270
3270
|
init_cn();
|
|
3271
3271
|
init_Icon();
|
|
3272
3272
|
init_useEventBus();
|
|
3273
|
-
Input =
|
|
3273
|
+
Input = React87__default.forwardRef(
|
|
3274
3274
|
({
|
|
3275
3275
|
className,
|
|
3276
3276
|
inputType,
|
|
@@ -3430,7 +3430,7 @@ var Label;
|
|
|
3430
3430
|
var init_Label = __esm({
|
|
3431
3431
|
"components/core/atoms/Label.tsx"() {
|
|
3432
3432
|
init_cn();
|
|
3433
|
-
Label =
|
|
3433
|
+
Label = React87__default.forwardRef(
|
|
3434
3434
|
({ className, required, children, ...props }, ref) => {
|
|
3435
3435
|
return /* @__PURE__ */ jsxs(
|
|
3436
3436
|
"label",
|
|
@@ -3457,7 +3457,7 @@ var init_Textarea = __esm({
|
|
|
3457
3457
|
"components/core/atoms/Textarea.tsx"() {
|
|
3458
3458
|
init_cn();
|
|
3459
3459
|
init_useEventBus();
|
|
3460
|
-
Textarea =
|
|
3460
|
+
Textarea = React87__default.forwardRef(
|
|
3461
3461
|
({ className, error, onChange, ...props }, ref) => {
|
|
3462
3462
|
const eventBus = useEventBus();
|
|
3463
3463
|
const handleChange = (e) => {
|
|
@@ -3696,7 +3696,7 @@ var init_Select = __esm({
|
|
|
3696
3696
|
init_cn();
|
|
3697
3697
|
init_Icon();
|
|
3698
3698
|
init_useEventBus();
|
|
3699
|
-
Select =
|
|
3699
|
+
Select = React87__default.forwardRef(
|
|
3700
3700
|
(props, _ref) => {
|
|
3701
3701
|
const { multiple, searchable, clearable } = props;
|
|
3702
3702
|
if (multiple || searchable || clearable) {
|
|
@@ -3713,7 +3713,7 @@ var init_Checkbox = __esm({
|
|
|
3713
3713
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3714
3714
|
init_cn();
|
|
3715
3715
|
init_useEventBus();
|
|
3716
|
-
Checkbox =
|
|
3716
|
+
Checkbox = React87__default.forwardRef(
|
|
3717
3717
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3718
3718
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3719
3719
|
const eventBus = useEventBus();
|
|
@@ -3767,7 +3767,7 @@ var init_Spinner = __esm({
|
|
|
3767
3767
|
md: "h-6 w-6",
|
|
3768
3768
|
lg: "h-8 w-8"
|
|
3769
3769
|
};
|
|
3770
|
-
Spinner =
|
|
3770
|
+
Spinner = React87__default.forwardRef(
|
|
3771
3771
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3772
3772
|
if (overlay) {
|
|
3773
3773
|
return /* @__PURE__ */ jsx(
|
|
@@ -3857,7 +3857,7 @@ var init_Card = __esm({
|
|
|
3857
3857
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3858
3858
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3859
3859
|
};
|
|
3860
|
-
Card =
|
|
3860
|
+
Card = React87__default.forwardRef(
|
|
3861
3861
|
({
|
|
3862
3862
|
className,
|
|
3863
3863
|
variant = "bordered",
|
|
@@ -3905,9 +3905,9 @@ var init_Card = __esm({
|
|
|
3905
3905
|
}
|
|
3906
3906
|
);
|
|
3907
3907
|
Card.displayName = "Card";
|
|
3908
|
-
CardHeader =
|
|
3908
|
+
CardHeader = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3909
3909
|
CardHeader.displayName = "CardHeader";
|
|
3910
|
-
CardTitle =
|
|
3910
|
+
CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3911
3911
|
"h3",
|
|
3912
3912
|
{
|
|
3913
3913
|
ref,
|
|
@@ -3920,11 +3920,11 @@ var init_Card = __esm({
|
|
|
3920
3920
|
}
|
|
3921
3921
|
));
|
|
3922
3922
|
CardTitle.displayName = "CardTitle";
|
|
3923
|
-
CardContent =
|
|
3923
|
+
CardContent = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3924
3924
|
CardContent.displayName = "CardContent";
|
|
3925
3925
|
CardBody = CardContent;
|
|
3926
3926
|
CardBody.displayName = "CardBody";
|
|
3927
|
-
CardFooter =
|
|
3927
|
+
CardFooter = React87__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3928
3928
|
"div",
|
|
3929
3929
|
{
|
|
3930
3930
|
ref,
|
|
@@ -3979,7 +3979,7 @@ var init_FilterPill = __esm({
|
|
|
3979
3979
|
md: "w-3.5 h-3.5",
|
|
3980
3980
|
lg: "w-4 h-4"
|
|
3981
3981
|
};
|
|
3982
|
-
FilterPill =
|
|
3982
|
+
FilterPill = React87__default.forwardRef(
|
|
3983
3983
|
({
|
|
3984
3984
|
className,
|
|
3985
3985
|
variant = "default",
|
|
@@ -4108,8 +4108,8 @@ var init_Avatar = __esm({
|
|
|
4108
4108
|
actionPayload
|
|
4109
4109
|
}) => {
|
|
4110
4110
|
const eventBus = useEventBus();
|
|
4111
|
-
const [imgFailed, setImgFailed] =
|
|
4112
|
-
|
|
4111
|
+
const [imgFailed, setImgFailed] = React87__default.useState(false);
|
|
4112
|
+
React87__default.useEffect(() => {
|
|
4113
4113
|
setImgFailed(false);
|
|
4114
4114
|
}, [src]);
|
|
4115
4115
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4222,7 +4222,7 @@ var init_Center = __esm({
|
|
|
4222
4222
|
as: Component2 = "div"
|
|
4223
4223
|
}) => {
|
|
4224
4224
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4225
|
-
return
|
|
4225
|
+
return React87__default.createElement(Component2, {
|
|
4226
4226
|
className: cn(
|
|
4227
4227
|
inline ? "inline-flex" : "flex",
|
|
4228
4228
|
horizontal && "justify-center",
|
|
@@ -4490,7 +4490,7 @@ var init_Radio = __esm({
|
|
|
4490
4490
|
md: "w-2.5 h-2.5",
|
|
4491
4491
|
lg: "w-3 h-3"
|
|
4492
4492
|
};
|
|
4493
|
-
Radio =
|
|
4493
|
+
Radio = React87__default.forwardRef(
|
|
4494
4494
|
({
|
|
4495
4495
|
label,
|
|
4496
4496
|
helperText,
|
|
@@ -4507,12 +4507,12 @@ var init_Radio = __esm({
|
|
|
4507
4507
|
onChange,
|
|
4508
4508
|
...props
|
|
4509
4509
|
}, ref) => {
|
|
4510
|
-
const reactId =
|
|
4510
|
+
const reactId = React87__default.useId();
|
|
4511
4511
|
const baseId = id || `radio-${reactId}`;
|
|
4512
4512
|
const hasError = !!error;
|
|
4513
4513
|
const eventBus = useEventBus();
|
|
4514
|
-
const [selected, setSelected] =
|
|
4515
|
-
|
|
4514
|
+
const [selected, setSelected] = React87__default.useState(value);
|
|
4515
|
+
React87__default.useEffect(() => {
|
|
4516
4516
|
if (value !== void 0) setSelected(value);
|
|
4517
4517
|
}, [value]);
|
|
4518
4518
|
const pick = (next, e) => {
|
|
@@ -4694,7 +4694,7 @@ var init_Switch = __esm({
|
|
|
4694
4694
|
"components/core/atoms/Switch.tsx"() {
|
|
4695
4695
|
"use client";
|
|
4696
4696
|
init_cn();
|
|
4697
|
-
Switch =
|
|
4697
|
+
Switch = React87.forwardRef(
|
|
4698
4698
|
({
|
|
4699
4699
|
checked,
|
|
4700
4700
|
defaultChecked = false,
|
|
@@ -4705,10 +4705,10 @@ var init_Switch = __esm({
|
|
|
4705
4705
|
name,
|
|
4706
4706
|
className
|
|
4707
4707
|
}, ref) => {
|
|
4708
|
-
const [isChecked, setIsChecked] =
|
|
4708
|
+
const [isChecked, setIsChecked] = React87.useState(
|
|
4709
4709
|
checked !== void 0 ? checked : defaultChecked
|
|
4710
4710
|
);
|
|
4711
|
-
|
|
4711
|
+
React87.useEffect(() => {
|
|
4712
4712
|
if (checked !== void 0) {
|
|
4713
4713
|
setIsChecked(checked);
|
|
4714
4714
|
}
|
|
@@ -4867,7 +4867,7 @@ var init_Stack = __esm({
|
|
|
4867
4867
|
};
|
|
4868
4868
|
const isHorizontal = direction === "horizontal";
|
|
4869
4869
|
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";
|
|
4870
|
-
return
|
|
4870
|
+
return React87__default.createElement(
|
|
4871
4871
|
Component2,
|
|
4872
4872
|
{
|
|
4873
4873
|
className: cn(
|
|
@@ -5067,7 +5067,7 @@ var Aside;
|
|
|
5067
5067
|
var init_Aside = __esm({
|
|
5068
5068
|
"components/core/atoms/Aside.tsx"() {
|
|
5069
5069
|
init_cn();
|
|
5070
|
-
Aside =
|
|
5070
|
+
Aside = React87__default.forwardRef(
|
|
5071
5071
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5072
5072
|
);
|
|
5073
5073
|
Aside.displayName = "Aside";
|
|
@@ -5146,9 +5146,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5146
5146
|
className
|
|
5147
5147
|
}) => {
|
|
5148
5148
|
const { t } = useTranslate();
|
|
5149
|
-
const [isVisible, setIsVisible] =
|
|
5150
|
-
const timeoutRef =
|
|
5151
|
-
const triggerRef =
|
|
5149
|
+
const [isVisible, setIsVisible] = React87__default.useState(false);
|
|
5150
|
+
const timeoutRef = React87__default.useRef(null);
|
|
5151
|
+
const triggerRef = React87__default.useRef(null);
|
|
5152
5152
|
const handleMouseEnter = () => {
|
|
5153
5153
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5154
5154
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5159,7 +5159,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5159
5159
|
};
|
|
5160
5160
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5161
5161
|
const open = isVisible || revealed;
|
|
5162
|
-
|
|
5162
|
+
React87__default.useEffect(() => {
|
|
5163
5163
|
return () => {
|
|
5164
5164
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5165
5165
|
};
|
|
@@ -5371,7 +5371,7 @@ var init_StatusDot = __esm({
|
|
|
5371
5371
|
md: "w-2.5 h-2.5",
|
|
5372
5372
|
lg: "w-3 h-3"
|
|
5373
5373
|
};
|
|
5374
|
-
StatusDot =
|
|
5374
|
+
StatusDot = React87__default.forwardRef(
|
|
5375
5375
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5376
5376
|
return /* @__PURE__ */ jsx(
|
|
5377
5377
|
"span",
|
|
@@ -5425,7 +5425,7 @@ var init_TrendIndicator = __esm({
|
|
|
5425
5425
|
down: "trending-down",
|
|
5426
5426
|
flat: "arrow-right"
|
|
5427
5427
|
};
|
|
5428
|
-
TrendIndicator =
|
|
5428
|
+
TrendIndicator = React87__default.forwardRef(
|
|
5429
5429
|
({
|
|
5430
5430
|
className,
|
|
5431
5431
|
value,
|
|
@@ -5492,7 +5492,7 @@ var init_RangeSlider = __esm({
|
|
|
5492
5492
|
md: "w-4 h-4",
|
|
5493
5493
|
lg: "w-5 h-5"
|
|
5494
5494
|
};
|
|
5495
|
-
RangeSlider =
|
|
5495
|
+
RangeSlider = React87__default.forwardRef(
|
|
5496
5496
|
({
|
|
5497
5497
|
className,
|
|
5498
5498
|
min = 0,
|
|
@@ -6000,7 +6000,7 @@ var init_ContentSection = __esm({
|
|
|
6000
6000
|
md: "py-16",
|
|
6001
6001
|
lg: "py-24"
|
|
6002
6002
|
};
|
|
6003
|
-
ContentSection =
|
|
6003
|
+
ContentSection = React87__default.forwardRef(
|
|
6004
6004
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6005
6005
|
return /* @__PURE__ */ jsx(
|
|
6006
6006
|
Box,
|
|
@@ -6534,7 +6534,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6534
6534
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6535
6535
|
"none": {}
|
|
6536
6536
|
};
|
|
6537
|
-
AnimatedReveal =
|
|
6537
|
+
AnimatedReveal = React87__default.forwardRef(
|
|
6538
6538
|
({
|
|
6539
6539
|
trigger = "scroll",
|
|
6540
6540
|
animation = "fade-up",
|
|
@@ -6694,7 +6694,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6694
6694
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6695
6695
|
"use client";
|
|
6696
6696
|
init_cn();
|
|
6697
|
-
AnimatedGraphic =
|
|
6697
|
+
AnimatedGraphic = React87__default.forwardRef(
|
|
6698
6698
|
({
|
|
6699
6699
|
src,
|
|
6700
6700
|
svgContent,
|
|
@@ -6717,7 +6717,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6717
6717
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6718
6718
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6719
6719
|
const prevAnimateRef = useRef(animate);
|
|
6720
|
-
const setRef =
|
|
6720
|
+
const setRef = React87__default.useCallback(
|
|
6721
6721
|
(node) => {
|
|
6722
6722
|
containerRef.current = node;
|
|
6723
6723
|
if (typeof ref === "function") ref(node);
|
|
@@ -6939,43 +6939,16 @@ function ScoreDisplay({
|
|
|
6939
6939
|
icon,
|
|
6940
6940
|
size = "md",
|
|
6941
6941
|
className,
|
|
6942
|
-
animated = true,
|
|
6943
6942
|
locale = "en-US"
|
|
6944
6943
|
}) {
|
|
6945
6944
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
|
|
6946
|
-
const
|
|
6947
|
-
const [isAnimating, setIsAnimating] = React89.useState(false);
|
|
6948
|
-
React89.useEffect(() => {
|
|
6949
|
-
if (!animated || displayValue === resolvedValue) {
|
|
6950
|
-
setDisplayValue(resolvedValue);
|
|
6951
|
-
return;
|
|
6952
|
-
}
|
|
6953
|
-
setIsAnimating(true);
|
|
6954
|
-
const diff = resolvedValue - displayValue;
|
|
6955
|
-
const steps = Math.min(Math.abs(diff), 20);
|
|
6956
|
-
const increment = diff / steps;
|
|
6957
|
-
let current = displayValue;
|
|
6958
|
-
let step = 0;
|
|
6959
|
-
const timer = setInterval(() => {
|
|
6960
|
-
step++;
|
|
6961
|
-
current += increment;
|
|
6962
|
-
setDisplayValue(Math.round(current));
|
|
6963
|
-
if (step >= steps) {
|
|
6964
|
-
clearInterval(timer);
|
|
6965
|
-
setDisplayValue(resolvedValue);
|
|
6966
|
-
setIsAnimating(false);
|
|
6967
|
-
}
|
|
6968
|
-
}, 50);
|
|
6969
|
-
return () => clearInterval(timer);
|
|
6970
|
-
}, [resolvedValue, animated]);
|
|
6971
|
-
const formattedValue = new Intl.NumberFormat(locale).format(displayValue);
|
|
6945
|
+
const formattedValue = new Intl.NumberFormat(locale).format(resolvedValue);
|
|
6972
6946
|
return /* @__PURE__ */ jsxs(
|
|
6973
6947
|
"div",
|
|
6974
6948
|
{
|
|
6975
6949
|
className: cn(
|
|
6976
6950
|
"flex items-center gap-2 font-bold",
|
|
6977
6951
|
sizeMap2[size],
|
|
6978
|
-
isAnimating && "animate-pulse",
|
|
6979
6952
|
className
|
|
6980
6953
|
),
|
|
6981
6954
|
children: [
|
|
@@ -6999,7 +6972,6 @@ function ScoreDisplay({
|
|
|
6999
6972
|
var sizeMap2, DEFAULT_ASSET_URL;
|
|
7000
6973
|
var init_ScoreDisplay = __esm({
|
|
7001
6974
|
"components/game/atoms/ScoreDisplay.tsx"() {
|
|
7002
|
-
"use client";
|
|
7003
6975
|
init_cn();
|
|
7004
6976
|
init_Icon();
|
|
7005
6977
|
sizeMap2 = {
|
|
@@ -7028,9 +7000,9 @@ function ControlButton({
|
|
|
7028
7000
|
className
|
|
7029
7001
|
}) {
|
|
7030
7002
|
const eventBus = useEventBus();
|
|
7031
|
-
const [isPressed, setIsPressed] =
|
|
7003
|
+
const [isPressed, setIsPressed] = React87.useState(false);
|
|
7032
7004
|
const actualPressed = pressed ?? isPressed;
|
|
7033
|
-
const handlePointerDown =
|
|
7005
|
+
const handlePointerDown = React87.useCallback(
|
|
7034
7006
|
(e) => {
|
|
7035
7007
|
e.preventDefault();
|
|
7036
7008
|
if (disabled) return;
|
|
@@ -7040,7 +7012,7 @@ function ControlButton({
|
|
|
7040
7012
|
},
|
|
7041
7013
|
[disabled, pressEvent, eventBus, onPress]
|
|
7042
7014
|
);
|
|
7043
|
-
const handlePointerUp =
|
|
7015
|
+
const handlePointerUp = React87.useCallback(
|
|
7044
7016
|
(e) => {
|
|
7045
7017
|
e.preventDefault();
|
|
7046
7018
|
if (disabled) return;
|
|
@@ -7050,7 +7022,7 @@ function ControlButton({
|
|
|
7050
7022
|
},
|
|
7051
7023
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7052
7024
|
);
|
|
7053
|
-
const handlePointerLeave =
|
|
7025
|
+
const handlePointerLeave = React87.useCallback(
|
|
7054
7026
|
(e) => {
|
|
7055
7027
|
if (isPressed) {
|
|
7056
7028
|
setIsPressed(false);
|
|
@@ -7138,13 +7110,6 @@ var init_spriteSheetConstants = __esm({
|
|
|
7138
7110
|
});
|
|
7139
7111
|
|
|
7140
7112
|
// components/game/organisms/utils/spriteAnimation.ts
|
|
7141
|
-
function inferDirection(dx, dy) {
|
|
7142
|
-
if (dx === 0 && dy === 0) return "se";
|
|
7143
|
-
if (dx >= 0 && dy >= 0) return "se";
|
|
7144
|
-
if (dx <= 0 && dy >= 0) return "sw";
|
|
7145
|
-
if (dx >= 0 && dy <= 0) return "ne";
|
|
7146
|
-
return "nw";
|
|
7147
|
-
}
|
|
7148
7113
|
function resolveSheetDirection(facing) {
|
|
7149
7114
|
switch (facing) {
|
|
7150
7115
|
case "se":
|
|
@@ -7165,19 +7130,6 @@ function frameRect(frame, row, columns, frameWidth, frameHeight) {
|
|
|
7165
7130
|
sh: frameHeight
|
|
7166
7131
|
};
|
|
7167
7132
|
}
|
|
7168
|
-
function getCurrentFrameFromDef(def, elapsed) {
|
|
7169
|
-
const frameDuration = 1e3 / def.frameRate;
|
|
7170
|
-
const totalDuration = def.frames * frameDuration;
|
|
7171
|
-
if (def.loop) {
|
|
7172
|
-
const frame2 = Math.floor(elapsed % totalDuration / frameDuration);
|
|
7173
|
-
return { frame: frame2, finished: false };
|
|
7174
|
-
}
|
|
7175
|
-
if (elapsed >= totalDuration) {
|
|
7176
|
-
return { frame: def.frames - 1, finished: true };
|
|
7177
|
-
}
|
|
7178
|
-
const frame = Math.floor(elapsed / frameDuration);
|
|
7179
|
-
return { frame, finished: false };
|
|
7180
|
-
}
|
|
7181
7133
|
var init_spriteAnimation = __esm({
|
|
7182
7134
|
"components/game/organisms/utils/spriteAnimation.ts"() {
|
|
7183
7135
|
}
|
|
@@ -7196,6 +7148,8 @@ function Sprite({
|
|
|
7196
7148
|
opacity = 1,
|
|
7197
7149
|
zIndex = 0,
|
|
7198
7150
|
columns = 16,
|
|
7151
|
+
animState: _animState,
|
|
7152
|
+
frameRate: _frameRate,
|
|
7199
7153
|
className,
|
|
7200
7154
|
onClick,
|
|
7201
7155
|
action
|
|
@@ -7679,21 +7633,6 @@ function XPBar({
|
|
|
7679
7633
|
}) {
|
|
7680
7634
|
const sizes = sizeMap9[size];
|
|
7681
7635
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7682
|
-
const [fillWidth, setFillWidth] = React89.useState(animated ? 0 : percentage);
|
|
7683
|
-
React89.useEffect(() => {
|
|
7684
|
-
if (!animated) {
|
|
7685
|
-
setFillWidth(percentage);
|
|
7686
|
-
return;
|
|
7687
|
-
}
|
|
7688
|
-
let frame2;
|
|
7689
|
-
const frame1 = requestAnimationFrame(() => {
|
|
7690
|
-
frame2 = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7691
|
-
});
|
|
7692
|
-
return () => {
|
|
7693
|
-
cancelAnimationFrame(frame1);
|
|
7694
|
-
cancelAnimationFrame(frame2);
|
|
7695
|
-
};
|
|
7696
|
-
}, [animated, percentage]);
|
|
7697
7636
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7698
7637
|
level != null && /* @__PURE__ */ jsxs(
|
|
7699
7638
|
"span",
|
|
@@ -7725,7 +7664,7 @@ function XPBar({
|
|
|
7725
7664
|
"bg-gradient-to-r from-accent to-info",
|
|
7726
7665
|
animated && "transition-all duration-500 ease-out"
|
|
7727
7666
|
),
|
|
7728
|
-
style: { width: `${
|
|
7667
|
+
style: { width: `${percentage}%` }
|
|
7729
7668
|
}
|
|
7730
7669
|
)
|
|
7731
7670
|
}
|
|
@@ -7742,7 +7681,6 @@ function XPBar({
|
|
|
7742
7681
|
var sizeMap9;
|
|
7743
7682
|
var init_XPBar = __esm({
|
|
7744
7683
|
"components/game/atoms/XPBar.tsx"() {
|
|
7745
|
-
"use client";
|
|
7746
7684
|
init_cn();
|
|
7747
7685
|
sizeMap9 = {
|
|
7748
7686
|
sm: { bar: "h-2", text: "text-xs", badge: "text-xs px-1.5 py-0.5" },
|
|
@@ -8188,9 +8126,9 @@ function MiniMap({
|
|
|
8188
8126
|
viewportRect = DEFAULT_VIEWPORT,
|
|
8189
8127
|
className
|
|
8190
8128
|
}) {
|
|
8191
|
-
const canvasRef =
|
|
8192
|
-
const frameRef =
|
|
8193
|
-
|
|
8129
|
+
const canvasRef = React87.useRef(null);
|
|
8130
|
+
const frameRef = React87.useRef(0);
|
|
8131
|
+
React87.useEffect(() => {
|
|
8194
8132
|
const canvas = canvasRef.current;
|
|
8195
8133
|
if (!canvas) return;
|
|
8196
8134
|
const ctx = canvas.getContext("2d");
|
|
@@ -8379,7 +8317,7 @@ var init_ErrorBoundary = __esm({
|
|
|
8379
8317
|
}
|
|
8380
8318
|
);
|
|
8381
8319
|
};
|
|
8382
|
-
ErrorBoundary = class extends
|
|
8320
|
+
ErrorBoundary = class extends React87__default.Component {
|
|
8383
8321
|
constructor(props) {
|
|
8384
8322
|
super(props);
|
|
8385
8323
|
__publicField(this, "reset", () => {
|
|
@@ -8690,7 +8628,7 @@ var init_Container = __esm({
|
|
|
8690
8628
|
as: Component2 = "div"
|
|
8691
8629
|
}) => {
|
|
8692
8630
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
8693
|
-
return
|
|
8631
|
+
return React87__default.createElement(
|
|
8694
8632
|
Component2,
|
|
8695
8633
|
{
|
|
8696
8634
|
className: cn(
|
|
@@ -9413,8 +9351,8 @@ function ActionButtons({
|
|
|
9413
9351
|
disabled
|
|
9414
9352
|
}) {
|
|
9415
9353
|
const eventBus = useEventBus();
|
|
9416
|
-
const [activeButtons, setActiveButtons] =
|
|
9417
|
-
const handlePress =
|
|
9354
|
+
const [activeButtons, setActiveButtons] = React87.useState(/* @__PURE__ */ new Set());
|
|
9355
|
+
const handlePress = React87.useCallback(
|
|
9418
9356
|
(id) => {
|
|
9419
9357
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9420
9358
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9422,7 +9360,7 @@ function ActionButtons({
|
|
|
9422
9360
|
},
|
|
9423
9361
|
[actionEvent, eventBus, onAction]
|
|
9424
9362
|
);
|
|
9425
|
-
const handleRelease =
|
|
9363
|
+
const handleRelease = React87.useCallback(
|
|
9426
9364
|
(id) => {
|
|
9427
9365
|
setActiveButtons((prev) => {
|
|
9428
9366
|
const next = new Set(prev);
|
|
@@ -10252,50 +10190,6 @@ var init_AuthLayout = __esm({
|
|
|
10252
10190
|
AuthLayout.displayName = "AuthLayout";
|
|
10253
10191
|
}
|
|
10254
10192
|
});
|
|
10255
|
-
var LoadingState;
|
|
10256
|
-
var init_LoadingState = __esm({
|
|
10257
|
-
"components/core/molecules/LoadingState.tsx"() {
|
|
10258
|
-
"use client";
|
|
10259
|
-
init_cn();
|
|
10260
|
-
init_atoms2();
|
|
10261
|
-
init_Stack();
|
|
10262
|
-
init_Typography();
|
|
10263
|
-
LoadingState = ({
|
|
10264
|
-
title,
|
|
10265
|
-
message,
|
|
10266
|
-
className
|
|
10267
|
-
}) => {
|
|
10268
|
-
const { t } = useTranslate();
|
|
10269
|
-
const displayMessage = message ?? t("common.loading");
|
|
10270
|
-
return /* @__PURE__ */ jsxs(
|
|
10271
|
-
VStack,
|
|
10272
|
-
{
|
|
10273
|
-
align: "center",
|
|
10274
|
-
className: cn(
|
|
10275
|
-
"justify-center py-12",
|
|
10276
|
-
className
|
|
10277
|
-
),
|
|
10278
|
-
children: [
|
|
10279
|
-
/* @__PURE__ */ jsx(Spinner, { size: "lg" }),
|
|
10280
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "h3", className: "mt-4 text-lg font-semibold text-foreground", children: title }),
|
|
10281
|
-
/* @__PURE__ */ jsx(
|
|
10282
|
-
Typography,
|
|
10283
|
-
{
|
|
10284
|
-
variant: "small",
|
|
10285
|
-
className: cn(
|
|
10286
|
-
"text-muted-foreground",
|
|
10287
|
-
title ? "mt-2" : "mt-4"
|
|
10288
|
-
),
|
|
10289
|
-
children: displayMessage
|
|
10290
|
-
}
|
|
10291
|
-
)
|
|
10292
|
-
]
|
|
10293
|
-
}
|
|
10294
|
-
);
|
|
10295
|
-
};
|
|
10296
|
-
LoadingState.displayName = "LoadingState";
|
|
10297
|
-
}
|
|
10298
|
-
});
|
|
10299
10193
|
function getState() {
|
|
10300
10194
|
if (typeof window !== "undefined") {
|
|
10301
10195
|
const w = window;
|
|
@@ -10825,9 +10719,6 @@ function useUnitSpriteAtlas(units) {
|
|
|
10825
10719
|
const loadingRef = useRef(/* @__PURE__ */ new Set());
|
|
10826
10720
|
const [pendingCount, setPendingCount] = useState(0);
|
|
10827
10721
|
const [, forceTick] = useState(0);
|
|
10828
|
-
const animStatesRef = useRef(/* @__PURE__ */ new Map());
|
|
10829
|
-
const lastTickRef = useRef(0);
|
|
10830
|
-
const rafRef = useRef(0);
|
|
10831
10722
|
const atlasUrls = useMemo(() => {
|
|
10832
10723
|
const set = /* @__PURE__ */ new Set();
|
|
10833
10724
|
for (const unit of units) {
|
|
@@ -10873,54 +10764,6 @@ function useUnitSpriteAtlas(units) {
|
|
|
10873
10764
|
}
|
|
10874
10765
|
return [...urls];
|
|
10875
10766
|
}, [units, pendingCount]);
|
|
10876
|
-
useEffect(() => {
|
|
10877
|
-
const hasAtlasUnits = units.some((u) => unitAtlasUrl(u) !== null);
|
|
10878
|
-
if (!hasAtlasUnits) return;
|
|
10879
|
-
let running = true;
|
|
10880
|
-
const tick = (ts) => {
|
|
10881
|
-
if (!running) return;
|
|
10882
|
-
const last = lastTickRef.current || ts;
|
|
10883
|
-
const delta = ts - last;
|
|
10884
|
-
lastTickRef.current = ts;
|
|
10885
|
-
const states = animStatesRef.current;
|
|
10886
|
-
const currentIds = /* @__PURE__ */ new Set();
|
|
10887
|
-
for (const unit of units) {
|
|
10888
|
-
if (unitAtlasUrl(unit) === null) continue;
|
|
10889
|
-
currentIds.add(unit.id);
|
|
10890
|
-
let state = states.get(unit.id);
|
|
10891
|
-
if (!state) {
|
|
10892
|
-
state = { animation: "idle", direction: "se", elapsed: 0, walkHold: 0, prev: null };
|
|
10893
|
-
states.set(unit.id, state);
|
|
10894
|
-
}
|
|
10895
|
-
const posX = unit.position?.x ?? unit.x ?? 0;
|
|
10896
|
-
const posY = unit.position?.y ?? unit.y ?? 0;
|
|
10897
|
-
if (state.prev) {
|
|
10898
|
-
const dx = posX - state.prev.x;
|
|
10899
|
-
const dy = posY - state.prev.y;
|
|
10900
|
-
if (dx !== 0 || dy !== 0) {
|
|
10901
|
-
state.animation = "walk";
|
|
10902
|
-
state.direction = inferDirection(dx, dy);
|
|
10903
|
-
state.walkHold = WALK_HOLD_MS;
|
|
10904
|
-
} else if (state.animation === "walk") {
|
|
10905
|
-
state.walkHold -= delta;
|
|
10906
|
-
if (state.walkHold <= 0) state.animation = "idle";
|
|
10907
|
-
}
|
|
10908
|
-
}
|
|
10909
|
-
state.prev = { x: posX, y: posY };
|
|
10910
|
-
state.elapsed += delta;
|
|
10911
|
-
}
|
|
10912
|
-
for (const id of states.keys()) {
|
|
10913
|
-
if (!currentIds.has(id)) states.delete(id);
|
|
10914
|
-
}
|
|
10915
|
-
rafRef.current = requestAnimationFrame(tick);
|
|
10916
|
-
};
|
|
10917
|
-
rafRef.current = requestAnimationFrame(tick);
|
|
10918
|
-
return () => {
|
|
10919
|
-
running = false;
|
|
10920
|
-
cancelAnimationFrame(rafRef.current);
|
|
10921
|
-
lastTickRef.current = 0;
|
|
10922
|
-
};
|
|
10923
|
-
}, [units]);
|
|
10924
10767
|
const resolveUnitFrame = useCallback((unitId) => {
|
|
10925
10768
|
const unit = units.find((u) => u.id === unitId);
|
|
10926
10769
|
if (!unit) return null;
|
|
@@ -10928,18 +10771,14 @@ function useUnitSpriteAtlas(units) {
|
|
|
10928
10771
|
if (!atlasUrl) return null;
|
|
10929
10772
|
const atlas = atlasCacheRef.current.get(atlasUrl);
|
|
10930
10773
|
if (!atlas) return null;
|
|
10931
|
-
const
|
|
10932
|
-
const
|
|
10933
|
-
const direction = state?.direction ?? "se";
|
|
10934
|
-
const elapsed = state?.elapsed ?? 0;
|
|
10774
|
+
const animation = unit.animation ?? "idle";
|
|
10775
|
+
const frame = unit.frame ?? 0;
|
|
10935
10776
|
const def = atlas.animations[animation] ?? atlas.animations.idle;
|
|
10936
10777
|
if (!def) return null;
|
|
10937
|
-
const { sheetDir, flipX } = resolveSheetDirection(
|
|
10778
|
+
const { sheetDir, flipX } = resolveSheetDirection("se");
|
|
10938
10779
|
const rel = atlas.sheets[sheetDir] ?? atlas.sheets.se ?? atlas.sheets.sw;
|
|
10939
10780
|
if (!rel) return null;
|
|
10940
10781
|
const sheetUrl = resolveSheetUrl(atlasUrl, rel);
|
|
10941
|
-
const isIdle = animation === "idle";
|
|
10942
|
-
const frame = isIdle ? 0 : getCurrentFrameFromDef(def, elapsed).frame;
|
|
10943
10782
|
const rect = frameRect(frame, def.row, atlas.columns, atlas.frameWidth, atlas.frameHeight);
|
|
10944
10783
|
return {
|
|
10945
10784
|
sheetUrl,
|
|
@@ -10948,17 +10787,15 @@ function useUnitSpriteAtlas(units) {
|
|
|
10948
10787
|
sw: rect.sw,
|
|
10949
10788
|
sh: rect.sh,
|
|
10950
10789
|
flipX,
|
|
10951
|
-
applyBreathing:
|
|
10790
|
+
applyBreathing: animation === "idle"
|
|
10952
10791
|
};
|
|
10953
10792
|
}, [units]);
|
|
10954
10793
|
return { sheetUrls, resolveUnitFrame, pendingCount };
|
|
10955
10794
|
}
|
|
10956
|
-
var WALK_HOLD_MS;
|
|
10957
10795
|
var init_useUnitSpriteAtlas = __esm({
|
|
10958
10796
|
"components/game/molecules/useUnitSpriteAtlas.ts"() {
|
|
10959
10797
|
"use client";
|
|
10960
10798
|
init_spriteAnimation();
|
|
10961
|
-
WALK_HOLD_MS = 600;
|
|
10962
10799
|
}
|
|
10963
10800
|
});
|
|
10964
10801
|
|
|
@@ -11026,6 +10863,7 @@ function IsometricCanvas({
|
|
|
11026
10863
|
tiles: _tilesPropRaw = [],
|
|
11027
10864
|
units: _unitsPropRaw = [],
|
|
11028
10865
|
features: _featuresPropRaw = [],
|
|
10866
|
+
effects: _effectsPropRaw = [],
|
|
11029
10867
|
// Interaction state
|
|
11030
10868
|
selectedUnitId = null,
|
|
11031
10869
|
validMoves = [],
|
|
@@ -11058,7 +10896,7 @@ function IsometricCanvas({
|
|
|
11058
10896
|
resolveUnitFrame,
|
|
11059
10897
|
effectSpriteUrls = [],
|
|
11060
10898
|
onDrawEffects,
|
|
11061
|
-
hasActiveEffects:
|
|
10899
|
+
hasActiveEffects: _hasActiveEffects = false,
|
|
11062
10900
|
// Tuning
|
|
11063
10901
|
diamondTopY: diamondTopYProp,
|
|
11064
10902
|
// Remote asset loading
|
|
@@ -11068,13 +10906,12 @@ function IsometricCanvas({
|
|
|
11068
10906
|
const tilesProp = Array.isArray(_tilesPropRaw) ? _tilesPropRaw : [];
|
|
11069
10907
|
const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
|
|
11070
10908
|
const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
|
|
10909
|
+
const effects = Array.isArray(_effectsPropRaw) ? _effectsPropRaw : [];
|
|
11071
10910
|
const eventBus = useEventBus();
|
|
11072
10911
|
const { t } = useTranslate();
|
|
11073
10912
|
const canvasRef = useRef(null);
|
|
11074
10913
|
const containerRef = useRef(null);
|
|
11075
|
-
const
|
|
11076
|
-
const animTimeRef = useRef(0);
|
|
11077
|
-
const rafIdRef = useRef(0);
|
|
10914
|
+
const lerpRafRef = useRef(0);
|
|
11078
10915
|
const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
|
|
11079
10916
|
useEffect(() => {
|
|
11080
10917
|
const el = containerRef.current;
|
|
@@ -11098,7 +10935,7 @@ function IsometricCanvas({
|
|
|
11098
10935
|
() => unitsProp.map((u) => u.position ? u : { ...u, position: { x: u.x ?? 0, y: u.y ?? 0 } }),
|
|
11099
10936
|
[unitsProp]
|
|
11100
10937
|
);
|
|
11101
|
-
const { sheetUrls: atlasSheetUrls, resolveUnitFrame: resolveUnitFrameInternal
|
|
10938
|
+
const { sheetUrls: atlasSheetUrls, resolveUnitFrame: resolveUnitFrameInternal } = useUnitSpriteAtlas(units);
|
|
11102
10939
|
const resolveFrameForUnit = useCallback((unitId) => {
|
|
11103
10940
|
return resolveUnitFrame?.(unitId) ?? resolveUnitFrameInternal(unitId);
|
|
11104
10941
|
}, [resolveUnitFrame, resolveUnitFrameInternal]);
|
|
@@ -11193,7 +11030,7 @@ function IsometricCanvas({
|
|
|
11193
11030
|
if (backgroundImage) urls.push(backgroundImage);
|
|
11194
11031
|
return [...new Set(urls.filter(Boolean))];
|
|
11195
11032
|
}, [sortedTiles, features, units, getTerrainSprite, getFeatureSprite, getUnitSprite, effectSpriteUrls, atlasSheetUrls, backgroundImage, assetManifest, resolveManifestUrl7]);
|
|
11196
|
-
const { getImage, pendingCount } = useImageCache(spriteUrls);
|
|
11033
|
+
const { getImage, pendingCount: _imagePendingCount } = useImageCache(spriteUrls);
|
|
11197
11034
|
useEffect(() => {
|
|
11198
11035
|
if (typeof window === "undefined") return;
|
|
11199
11036
|
const canvas = canvasRef.current;
|
|
@@ -11225,63 +11062,26 @@ function IsometricCanvas({
|
|
|
11225
11062
|
const resolveUnitSpriteUrl = useCallback((unit) => {
|
|
11226
11063
|
return unit.sprite || getUnitSprite?.(unit) || (unit.unitType ? resolveManifestUrl7(assetManifest?.units?.[unit.unitType]) : void 0);
|
|
11227
11064
|
}, [getUnitSprite, assetManifest, resolveManifestUrl7]);
|
|
11228
|
-
const
|
|
11229
|
-
if (!showMinimap) return;
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
const offsetMx = (mW - worldW * scaleM) / 2;
|
|
11249
|
-
const offsetMy = (mH - worldH * scaleM) / 2;
|
|
11250
|
-
for (const tile of sortedTiles) {
|
|
11251
|
-
const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX, tileLayout);
|
|
11252
|
-
const mx = (pos.x - minX) * scaleM + offsetMx;
|
|
11253
|
-
const my = (pos.y - minY) * scaleM + offsetMy;
|
|
11254
|
-
const mTileW = scaledTileWidth * scaleM;
|
|
11255
|
-
const mFloorH = scaledFloorHeight * scaleM;
|
|
11256
|
-
mCtx.fillStyle = tile.terrain === "water" ? "#3b82f6" : tile.terrain === "mountain" ? "#78716c" : "#4ade80";
|
|
11257
|
-
mCtx.beginPath();
|
|
11258
|
-
mCtx.moveTo(mx + mTileW / 2, my);
|
|
11259
|
-
mCtx.lineTo(mx + mTileW, my + mFloorH / 2);
|
|
11260
|
-
mCtx.lineTo(mx + mTileW / 2, my + mFloorH);
|
|
11261
|
-
mCtx.lineTo(mx, my + mFloorH / 2);
|
|
11262
|
-
mCtx.closePath();
|
|
11263
|
-
mCtx.fill();
|
|
11264
|
-
}
|
|
11265
|
-
for (const unit of units) {
|
|
11266
|
-
if (!unit.position) continue;
|
|
11267
|
-
const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX, tileLayout);
|
|
11268
|
-
const mx = (pos.x + scaledTileWidth / 2 - minX) * scaleM + offsetMx;
|
|
11269
|
-
const my = (pos.y + scaledTileHeight / 2 - minY) * scaleM + offsetMy;
|
|
11270
|
-
mCtx.fillStyle = unit.team === "player" ? "#60a5fa" : unit.team === "enemy" ? "#f87171" : "#9ca3af";
|
|
11271
|
-
mCtx.beginPath();
|
|
11272
|
-
mCtx.arc(mx, my, 3, 0, Math.PI * 2);
|
|
11273
|
-
mCtx.fill();
|
|
11274
|
-
}
|
|
11275
|
-
const cam = cameraRef.current;
|
|
11276
|
-
const vLeft = (cam.x - minX) * scaleM + offsetMx;
|
|
11277
|
-
const vTop = (cam.y - minY) * scaleM + offsetMy;
|
|
11278
|
-
const vW = viewportSize.width / cam.zoom * scaleM;
|
|
11279
|
-
const vH = viewportSize.height / cam.zoom * scaleM;
|
|
11280
|
-
mCtx.strokeStyle = "rgba(255, 255, 255, 0.8)";
|
|
11281
|
-
mCtx.lineWidth = 1;
|
|
11282
|
-
mCtx.strokeRect(vLeft, vTop, vW, vH);
|
|
11283
|
-
}, [showMinimap, sortedTiles, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledTileHeight, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11284
|
-
const draw = useCallback((animTime) => {
|
|
11065
|
+
const miniMapTiles = useMemo(() => {
|
|
11066
|
+
if (!showMinimap) return [];
|
|
11067
|
+
return sortedTiles.map((t2) => ({
|
|
11068
|
+
x: t2.x,
|
|
11069
|
+
y: t2.y,
|
|
11070
|
+
color: t2.terrain === "water" ? "#3b82f6" : t2.terrain === "mountain" ? "#78716c" : "#4ade80"
|
|
11071
|
+
}));
|
|
11072
|
+
}, [showMinimap, sortedTiles]);
|
|
11073
|
+
const miniMapUnits = useMemo(() => {
|
|
11074
|
+
if (!showMinimap) return [];
|
|
11075
|
+
return units.filter((u) => u.position).map((u) => ({
|
|
11076
|
+
x: u.position.x,
|
|
11077
|
+
y: u.position.y,
|
|
11078
|
+
color: u.team === "player" ? "#60a5fa" : u.team === "enemy" ? "#f87171" : "#9ca3af",
|
|
11079
|
+
isPlayer: u.team === "player"
|
|
11080
|
+
}));
|
|
11081
|
+
}, [showMinimap, units]);
|
|
11082
|
+
const miniMapWidth = gridWidth || 10;
|
|
11083
|
+
const miniMapHeight = gridHeight || 10;
|
|
11084
|
+
const draw = useCallback(() => {
|
|
11285
11085
|
const canvas = canvasRef.current;
|
|
11286
11086
|
if (!canvas) return;
|
|
11287
11087
|
const ctx = canvas.getContext("2d");
|
|
@@ -11367,8 +11167,7 @@ function IsometricCanvas({
|
|
|
11367
11167
|
if (validMoveSet.has(tileKey)) {
|
|
11368
11168
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11369
11169
|
const topY = pos.y + scaledDiamondTopY;
|
|
11370
|
-
|
|
11371
|
-
ctx.fillStyle = `rgba(74, 222, 128, ${pulse})`;
|
|
11170
|
+
ctx.fillStyle = "rgba(74, 222, 128, 0.25)";
|
|
11372
11171
|
ctx.beginPath();
|
|
11373
11172
|
ctx.moveTo(centerX, topY);
|
|
11374
11173
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -11380,8 +11179,7 @@ function IsometricCanvas({
|
|
|
11380
11179
|
if (attackTargetSet.has(tileKey)) {
|
|
11381
11180
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11382
11181
|
const topY = pos.y + scaledDiamondTopY;
|
|
11383
|
-
|
|
11384
|
-
ctx.fillStyle = `rgba(239, 68, 68, ${pulse})`;
|
|
11182
|
+
ctx.fillStyle = "rgba(239, 68, 68, 0.35)";
|
|
11385
11183
|
ctx.beginPath();
|
|
11386
11184
|
ctx.moveTo(centerX, topY);
|
|
11387
11185
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -11454,7 +11252,7 @@ function IsometricCanvas({
|
|
|
11454
11252
|
const isSelected = unit.id === selectedUnitId;
|
|
11455
11253
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11456
11254
|
const groundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11457
|
-
const breatheOffset = 0
|
|
11255
|
+
const breatheOffset = 0;
|
|
11458
11256
|
const unitSpriteUrl = resolveUnitSpriteUrl(unit);
|
|
11459
11257
|
const img = unitSpriteUrl ? getImage(unitSpriteUrl) : null;
|
|
11460
11258
|
const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
@@ -11494,10 +11292,9 @@ function IsometricCanvas({
|
|
|
11494
11292
|
ctx.restore();
|
|
11495
11293
|
}
|
|
11496
11294
|
if (isSelected) {
|
|
11497
|
-
const ringAlpha = 0.6 + 0.3 * Math.sin(animTime * 4e-3);
|
|
11498
11295
|
ctx.beginPath();
|
|
11499
11296
|
ctx.ellipse(centerX, groundY, drawW / 2 + 4 * scale, 12 * scale, 0, 0, Math.PI * 2);
|
|
11500
|
-
ctx.strokeStyle =
|
|
11297
|
+
ctx.strokeStyle = "rgba(0, 200, 255, 0.8)";
|
|
11501
11298
|
ctx.lineWidth = 3;
|
|
11502
11299
|
ctx.stroke();
|
|
11503
11300
|
}
|
|
@@ -11553,66 +11350,29 @@ function IsometricCanvas({
|
|
|
11553
11350
|
ctx.lineWidth = 2;
|
|
11554
11351
|
ctx.stroke();
|
|
11555
11352
|
}
|
|
11556
|
-
if (unit.name) {
|
|
11557
|
-
const labelBg = unit.team === "player" ? "rgba(59, 130, 246, 0.9)" : unit.team === "enemy" ? "rgba(239, 68, 68, 0.9)" : "rgba(107, 114, 128, 0.9)";
|
|
11558
|
-
ctx.font = `bold ${10 * scale * 2.5}px system-ui`;
|
|
11559
|
-
ctx.textAlign = "center";
|
|
11560
|
-
const textWidth = ctx.measureText(unit.name).width;
|
|
11561
|
-
const labelY = groundY + 14 * scale - breatheOffset;
|
|
11562
|
-
ctx.fillStyle = labelBg;
|
|
11563
|
-
ctx.beginPath();
|
|
11564
|
-
ctx.roundRect(centerX - textWidth / 2 - 6 * scale, labelY - 8 * scale, textWidth + 12 * scale, 16 * scale, 4 * scale);
|
|
11565
|
-
ctx.fill();
|
|
11566
|
-
ctx.fillStyle = "white";
|
|
11567
|
-
ctx.fillText(unit.name, centerX, labelY + 4 * scale);
|
|
11568
|
-
}
|
|
11569
|
-
if (unit.health !== void 0 && unit.maxHealth !== void 0) {
|
|
11570
|
-
const barWidth = 40 * scale;
|
|
11571
|
-
const barHeight = 6 * scale;
|
|
11572
|
-
const barX = centerX - barWidth / 2;
|
|
11573
|
-
const barY = groundY - drawH - 2 * scale - breatheOffset;
|
|
11574
|
-
const healthRatio = unit.health / unit.maxHealth;
|
|
11575
|
-
const barRadius = barHeight / 2;
|
|
11576
|
-
ctx.fillStyle = "rgba(0, 0, 0, 0.7)";
|
|
11577
|
-
ctx.beginPath();
|
|
11578
|
-
ctx.roundRect(barX, barY, barWidth, barHeight, barRadius);
|
|
11579
|
-
ctx.fill();
|
|
11580
|
-
if (healthRatio > 0) {
|
|
11581
|
-
const fillWidth = barWidth * healthRatio;
|
|
11582
|
-
const gradient = ctx.createLinearGradient(barX, barY, barX, barY + barHeight);
|
|
11583
|
-
if (healthRatio > 0.6) {
|
|
11584
|
-
gradient.addColorStop(0, "#4ade80");
|
|
11585
|
-
gradient.addColorStop(1, "#22c55e");
|
|
11586
|
-
} else if (healthRatio > 0.3) {
|
|
11587
|
-
gradient.addColorStop(0, "#fde047");
|
|
11588
|
-
gradient.addColorStop(1, "#eab308");
|
|
11589
|
-
} else {
|
|
11590
|
-
gradient.addColorStop(0, "#f87171");
|
|
11591
|
-
gradient.addColorStop(1, "#ef4444");
|
|
11592
|
-
}
|
|
11593
|
-
ctx.fillStyle = gradient;
|
|
11594
|
-
ctx.save();
|
|
11595
|
-
ctx.beginPath();
|
|
11596
|
-
ctx.roundRect(barX, barY, fillWidth, barHeight, barRadius);
|
|
11597
|
-
ctx.clip();
|
|
11598
|
-
ctx.fillRect(barX, barY, fillWidth, barHeight);
|
|
11599
|
-
ctx.restore();
|
|
11600
|
-
}
|
|
11601
|
-
ctx.strokeStyle = "rgba(255, 255, 255, 0.3)";
|
|
11602
|
-
ctx.lineWidth = 1;
|
|
11603
|
-
ctx.beginPath();
|
|
11604
|
-
ctx.roundRect(barX, barY, barWidth, barHeight, barRadius);
|
|
11605
|
-
ctx.stroke();
|
|
11606
|
-
}
|
|
11607
11353
|
}
|
|
11608
|
-
|
|
11354
|
+
for (const fx of effects) {
|
|
11355
|
+
const spriteUrl = resolveManifestUrl7(assetManifest?.effects?.[fx.key]);
|
|
11356
|
+
if (!spriteUrl) continue;
|
|
11357
|
+
const img = getImage(spriteUrl);
|
|
11358
|
+
if (!img) continue;
|
|
11359
|
+
const pos = isoToScreen(fx.x, fx.y, scale, baseOffsetX, tileLayout);
|
|
11360
|
+
const cx = pos.x + scaledTileWidth / 2;
|
|
11361
|
+
const cy = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11362
|
+
const alpha = Math.min(1, fx.ttl / 4);
|
|
11363
|
+
const prev = ctx.globalAlpha;
|
|
11364
|
+
ctx.globalAlpha = alpha;
|
|
11365
|
+
ctx.drawImage(img, cx - img.naturalWidth / 2, cy - img.naturalHeight / 2);
|
|
11366
|
+
ctx.globalAlpha = prev;
|
|
11367
|
+
}
|
|
11368
|
+
onDrawEffects?.(ctx, 0, getImage);
|
|
11609
11369
|
ctx.restore();
|
|
11610
|
-
drawMinimap();
|
|
11611
11370
|
}, [
|
|
11612
11371
|
sortedTiles,
|
|
11613
11372
|
units,
|
|
11614
11373
|
features,
|
|
11615
11374
|
selectedUnitId,
|
|
11375
|
+
effects,
|
|
11616
11376
|
tileLayout,
|
|
11617
11377
|
scale,
|
|
11618
11378
|
debug2,
|
|
@@ -11632,11 +11392,12 @@ function IsometricCanvas({
|
|
|
11632
11392
|
attackTargetSet,
|
|
11633
11393
|
hoveredTile,
|
|
11634
11394
|
viewportSize,
|
|
11635
|
-
drawMinimap,
|
|
11636
11395
|
onDrawEffects,
|
|
11637
11396
|
backgroundImage,
|
|
11638
11397
|
cameraRef,
|
|
11639
|
-
unitScale
|
|
11398
|
+
unitScale,
|
|
11399
|
+
resolveManifestUrl7,
|
|
11400
|
+
assetManifest
|
|
11640
11401
|
]);
|
|
11641
11402
|
useEffect(() => {
|
|
11642
11403
|
if (!selectedUnitId) return;
|
|
@@ -11651,30 +11412,33 @@ function IsometricCanvas({
|
|
|
11651
11412
|
};
|
|
11652
11413
|
}, [selectedUnitId, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11653
11414
|
useEffect(() => {
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11415
|
+
draw();
|
|
11416
|
+
}, [draw]);
|
|
11417
|
+
useEffect(() => {
|
|
11418
|
+
draw();
|
|
11419
|
+
}, [_imagePendingCount]);
|
|
11420
|
+
useEffect(() => {
|
|
11421
|
+
if (selectedUnitId == null) return;
|
|
11657
11422
|
let running = true;
|
|
11658
|
-
const
|
|
11423
|
+
const tick = () => {
|
|
11659
11424
|
if (!running) return;
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11663
|
-
rafIdRef.current = requestAnimationFrame(animate);
|
|
11425
|
+
const stillLerping = lerpToTarget();
|
|
11426
|
+
draw();
|
|
11427
|
+
if (stillLerping) lerpRafRef.current = requestAnimationFrame(tick);
|
|
11664
11428
|
};
|
|
11665
|
-
|
|
11429
|
+
lerpRafRef.current = requestAnimationFrame(tick);
|
|
11666
11430
|
return () => {
|
|
11667
11431
|
running = false;
|
|
11668
|
-
cancelAnimationFrame(
|
|
11432
|
+
cancelAnimationFrame(lerpRafRef.current);
|
|
11669
11433
|
};
|
|
11670
|
-
}, [
|
|
11434
|
+
}, [selectedUnitId, lerpToTarget, draw]);
|
|
11671
11435
|
const singlePointerActiveRef = useRef(false);
|
|
11672
11436
|
const handleCanvasPointerDown = useCallback((e) => {
|
|
11673
11437
|
singlePointerActiveRef.current = true;
|
|
11674
11438
|
if (enableCamera) handlePointerDown(e);
|
|
11675
11439
|
}, [enableCamera, handlePointerDown]);
|
|
11676
11440
|
const handleCanvasPointerMove = useCallback((e) => {
|
|
11677
|
-
if (enableCamera) handlePointerMove(e, () => draw(
|
|
11441
|
+
if (enableCamera) handlePointerMove(e, () => draw());
|
|
11678
11442
|
}, [enableCamera, handlePointerMove, draw]);
|
|
11679
11443
|
const handleCanvasHover = useCallback((e) => {
|
|
11680
11444
|
if (singlePointerActiveRef.current) return;
|
|
@@ -11716,10 +11480,10 @@ function IsometricCanvas({
|
|
|
11716
11480
|
onTileLeave?.();
|
|
11717
11481
|
}, [handleMouseLeave, onTileLeave, tileLeaveEvent, eventBus]);
|
|
11718
11482
|
const applyZoom = useCallback((factor, centerX, centerY) => {
|
|
11719
|
-
if (enableCamera) zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw(
|
|
11483
|
+
if (enableCamera) zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw());
|
|
11720
11484
|
}, [enableCamera, zoomAtPoint, viewportSize, draw]);
|
|
11721
11485
|
const applyPanDelta = useCallback((dx, dy) => {
|
|
11722
|
-
if (enableCamera) panBy(dx, dy, () => draw(
|
|
11486
|
+
if (enableCamera) panBy(dx, dy, () => draw());
|
|
11723
11487
|
}, [enableCamera, panBy, draw]);
|
|
11724
11488
|
const cancelSinglePointer = useCallback(() => {
|
|
11725
11489
|
singlePointerActiveRef.current = false;
|
|
@@ -11735,11 +11499,27 @@ function IsometricCanvas({
|
|
|
11735
11499
|
onPanDelta: applyPanDelta,
|
|
11736
11500
|
onMultiTouchStart: cancelSinglePointer
|
|
11737
11501
|
});
|
|
11502
|
+
const unitOverlays = useMemo(() => {
|
|
11503
|
+
if (sortedTiles.length === 0) return [];
|
|
11504
|
+
return units.filter((u) => !!u.position).map((u) => {
|
|
11505
|
+
const pos = isoToScreen(u.position.x, u.position.y, scale, baseOffsetX, tileLayout);
|
|
11506
|
+
const cam = cameraRef.current;
|
|
11507
|
+
const screenX = (pos.x + scaledTileWidth / 2 - (cam.x + viewportSize.width / 2)) * cam.zoom + viewportSize.width / 2;
|
|
11508
|
+
const screenY = (pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5 - (cam.y + viewportSize.height / 2)) * cam.zoom + viewportSize.height / 2;
|
|
11509
|
+
return { unit: u, screenX, screenY };
|
|
11510
|
+
});
|
|
11511
|
+
}, [units, sortedTiles.length, scale, baseOffsetX, tileLayout, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11738
11512
|
if (error) {
|
|
11739
|
-
return /* @__PURE__ */ jsx(
|
|
11513
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("flex items-center justify-center w-full h-full bg-[var(--color-card)] rounded-container", className), children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
|
|
11514
|
+
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: "xl" }),
|
|
11515
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-error", children: error.message })
|
|
11516
|
+
] }) });
|
|
11740
11517
|
}
|
|
11741
11518
|
if (isLoading) {
|
|
11742
|
-
return /* @__PURE__ */ jsx(
|
|
11519
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("flex items-center justify-center w-full h-full bg-[var(--color-card)] rounded-container", className), children: /* @__PURE__ */ jsxs(Stack, { direction: "vertical", gap: "md", align: "center", children: [
|
|
11520
|
+
/* @__PURE__ */ jsx(Icon, { name: "loader", size: "xl", className: "animate-spin" }),
|
|
11521
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
11522
|
+
] }) });
|
|
11743
11523
|
}
|
|
11744
11524
|
if (sortedTiles.length === 0) {
|
|
11745
11525
|
return /* @__PURE__ */ jsx(
|
|
@@ -11804,14 +11584,36 @@ function IsometricCanvas({
|
|
|
11804
11584
|
}
|
|
11805
11585
|
)
|
|
11806
11586
|
] }),
|
|
11807
|
-
|
|
11808
|
-
"
|
|
11587
|
+
unitOverlays.map(({ unit, screenX, screenY }) => /* @__PURE__ */ jsxs(
|
|
11588
|
+
"div",
|
|
11809
11589
|
{
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11590
|
+
className: "absolute pointer-events-none",
|
|
11591
|
+
style: { left: Math.round(screenX), top: Math.round(screenY), transform: "translate(-50%, 0)", zIndex: 5 },
|
|
11592
|
+
children: [
|
|
11593
|
+
unit.name && /* @__PURE__ */ jsx(
|
|
11594
|
+
"div",
|
|
11595
|
+
{
|
|
11596
|
+
className: "text-white text-xs font-bold px-1.5 py-0.5 rounded mb-0.5 whitespace-nowrap",
|
|
11597
|
+
style: { background: unit.team === "player" ? "rgba(59,130,246,0.9)" : unit.team === "enemy" ? "rgba(239,68,68,0.9)" : "rgba(107,114,128,0.9)" },
|
|
11598
|
+
children: unit.name
|
|
11599
|
+
}
|
|
11600
|
+
),
|
|
11601
|
+
unit.health !== void 0 && unit.maxHealth !== void 0 && unit.maxHealth > 0 && /* @__PURE__ */ jsx(HealthBar, { current: unit.health, max: unit.maxHealth, format: "bar", size: "sm" })
|
|
11602
|
+
]
|
|
11603
|
+
},
|
|
11604
|
+
unit.id
|
|
11605
|
+
)),
|
|
11606
|
+
showMinimap && /* @__PURE__ */ jsx("div", { className: "absolute bottom-2 right-2 pointer-events-none", style: { zIndex: 10 }, children: /* @__PURE__ */ jsx(
|
|
11607
|
+
MiniMap,
|
|
11608
|
+
{
|
|
11609
|
+
tiles: miniMapTiles,
|
|
11610
|
+
units: miniMapUnits,
|
|
11611
|
+
width: 150,
|
|
11612
|
+
height: 100,
|
|
11613
|
+
mapWidth: miniMapWidth,
|
|
11614
|
+
mapHeight: miniMapHeight
|
|
11813
11615
|
}
|
|
11814
|
-
)
|
|
11616
|
+
) })
|
|
11815
11617
|
]
|
|
11816
11618
|
}
|
|
11817
11619
|
);
|
|
@@ -11826,8 +11628,8 @@ var init_IsometricCanvas = __esm({
|
|
|
11826
11628
|
init_Stack();
|
|
11827
11629
|
init_Icon();
|
|
11828
11630
|
init_Typography();
|
|
11829
|
-
|
|
11830
|
-
|
|
11631
|
+
init_MiniMap();
|
|
11632
|
+
init_HealthBar();
|
|
11831
11633
|
init_useImageCache();
|
|
11832
11634
|
init_useCamera();
|
|
11833
11635
|
init_useCanvasGestures();
|
|
@@ -13385,6 +13187,50 @@ var init_Tabs = __esm({
|
|
|
13385
13187
|
Tabs.displayName = "Tabs";
|
|
13386
13188
|
}
|
|
13387
13189
|
});
|
|
13190
|
+
var LoadingState;
|
|
13191
|
+
var init_LoadingState = __esm({
|
|
13192
|
+
"components/core/molecules/LoadingState.tsx"() {
|
|
13193
|
+
"use client";
|
|
13194
|
+
init_cn();
|
|
13195
|
+
init_atoms2();
|
|
13196
|
+
init_Stack();
|
|
13197
|
+
init_Typography();
|
|
13198
|
+
LoadingState = ({
|
|
13199
|
+
title,
|
|
13200
|
+
message,
|
|
13201
|
+
className
|
|
13202
|
+
}) => {
|
|
13203
|
+
const { t } = useTranslate();
|
|
13204
|
+
const displayMessage = message ?? t("common.loading");
|
|
13205
|
+
return /* @__PURE__ */ jsxs(
|
|
13206
|
+
VStack,
|
|
13207
|
+
{
|
|
13208
|
+
align: "center",
|
|
13209
|
+
className: cn(
|
|
13210
|
+
"justify-center py-12",
|
|
13211
|
+
className
|
|
13212
|
+
),
|
|
13213
|
+
children: [
|
|
13214
|
+
/* @__PURE__ */ jsx(Spinner, { size: "lg" }),
|
|
13215
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "h3", className: "mt-4 text-lg font-semibold text-foreground", children: title }),
|
|
13216
|
+
/* @__PURE__ */ jsx(
|
|
13217
|
+
Typography,
|
|
13218
|
+
{
|
|
13219
|
+
variant: "small",
|
|
13220
|
+
className: cn(
|
|
13221
|
+
"text-muted-foreground",
|
|
13222
|
+
title ? "mt-2" : "mt-4"
|
|
13223
|
+
),
|
|
13224
|
+
children: displayMessage
|
|
13225
|
+
}
|
|
13226
|
+
)
|
|
13227
|
+
]
|
|
13228
|
+
}
|
|
13229
|
+
);
|
|
13230
|
+
};
|
|
13231
|
+
LoadingState.displayName = "LoadingState";
|
|
13232
|
+
}
|
|
13233
|
+
});
|
|
13388
13234
|
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
13389
13235
|
var init_EmptyState = __esm({
|
|
13390
13236
|
"components/core/molecules/EmptyState.tsx"() {
|
|
@@ -13665,7 +13511,7 @@ var init_CodeBlock = __esm({
|
|
|
13665
13511
|
};
|
|
13666
13512
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13667
13513
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13668
|
-
CodeBlock =
|
|
13514
|
+
CodeBlock = React87__default.memo(
|
|
13669
13515
|
({
|
|
13670
13516
|
code: rawCode,
|
|
13671
13517
|
language = "text",
|
|
@@ -14252,7 +14098,7 @@ var init_MarkdownContent = __esm({
|
|
|
14252
14098
|
init_Box();
|
|
14253
14099
|
init_CodeBlock();
|
|
14254
14100
|
init_cn();
|
|
14255
|
-
MarkdownContent =
|
|
14101
|
+
MarkdownContent = React87__default.memo(
|
|
14256
14102
|
({ content, direction = "ltr", className }) => {
|
|
14257
14103
|
const { t: _t } = useTranslate();
|
|
14258
14104
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -15621,7 +15467,7 @@ var init_StateMachineView = __esm({
|
|
|
15621
15467
|
style: { top: title ? 30 : 0 },
|
|
15622
15468
|
children: [
|
|
15623
15469
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15624
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15470
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React87__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15625
15471
|
StateNode,
|
|
15626
15472
|
{
|
|
15627
15473
|
state,
|
|
@@ -19590,7 +19436,7 @@ function CardHand({
|
|
|
19590
19436
|
className
|
|
19591
19437
|
}) {
|
|
19592
19438
|
const eventBus = useEventBus();
|
|
19593
|
-
const handleClick =
|
|
19439
|
+
const handleClick = React87.useCallback(
|
|
19594
19440
|
(card) => {
|
|
19595
19441
|
if (card.disabled) return;
|
|
19596
19442
|
onCardClick?.(card.id);
|
|
@@ -22579,10 +22425,10 @@ function CombatLog({
|
|
|
22579
22425
|
}, [events2, autoScroll]);
|
|
22580
22426
|
const safeEvents = events2 ?? [];
|
|
22581
22427
|
const visibleEvents = safeEvents.slice(-maxVisible);
|
|
22582
|
-
return /* @__PURE__ */ jsxs(
|
|
22428
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col rounded-container border border-border bg-card shadow-elevation-card", className), children: [
|
|
22583
22429
|
/* @__PURE__ */ jsx(Box, { padding: "sm", border: true, className: "border-b-2 border-x-0 border-t-0 border-border", children: /* @__PURE__ */ jsxs(Box, { display: "flex", className: "items-center justify-between", children: [
|
|
22584
22430
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-bold", children: title }),
|
|
22585
|
-
/* @__PURE__ */ jsxs(
|
|
22431
|
+
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground bg-muted/60 rounded px-1.5 py-0.5 border border-border/50 font-mono", children: [
|
|
22586
22432
|
safeEvents.length,
|
|
22587
22433
|
" events"
|
|
22588
22434
|
] })
|
|
@@ -22602,7 +22448,7 @@ function CombatLog({
|
|
|
22602
22448
|
/* @__PURE__ */ jsx(Box, { className: cn("flex-shrink-0 mt-0.5", colorClass), children: /* @__PURE__ */ jsx(EventIcon, { className: "h-4 w-4" }) }),
|
|
22603
22449
|
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
22604
22450
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "block", children: event.message }),
|
|
22605
|
-
event.value !== void 0 && /* @__PURE__ */ jsxs(
|
|
22451
|
+
event.value !== void 0 && /* @__PURE__ */ jsxs("span", { className: cn("inline-block mt-1 text-xs font-bold rounded px-1.5 py-0.5 border", eventValueColors[eventType]), children: [
|
|
22606
22452
|
eventType === "heal" ? "+" : eventType === "attack" ? "-" : "",
|
|
22607
22453
|
event.value
|
|
22608
22454
|
] })
|
|
@@ -22615,7 +22461,7 @@ function CombatLog({
|
|
|
22615
22461
|
}) }) })
|
|
22616
22462
|
] });
|
|
22617
22463
|
}
|
|
22618
|
-
var eventIcons, eventColors,
|
|
22464
|
+
var eventIcons, eventColors, eventValueColors, DEFAULT_COMBAT_EVENTS;
|
|
22619
22465
|
var init_CombatLog = __esm({
|
|
22620
22466
|
"components/game/molecules/CombatLog.tsx"() {
|
|
22621
22467
|
init_atoms2();
|
|
@@ -22638,14 +22484,14 @@ var init_CombatLog = __esm({
|
|
|
22638
22484
|
death: "text-muted-foreground",
|
|
22639
22485
|
spawn: "text-accent"
|
|
22640
22486
|
};
|
|
22641
|
-
|
|
22642
|
-
attack: "
|
|
22643
|
-
defend: "
|
|
22644
|
-
heal: "success",
|
|
22645
|
-
move: "warning",
|
|
22646
|
-
special: "
|
|
22647
|
-
death: "
|
|
22648
|
-
spawn: "
|
|
22487
|
+
eventValueColors = {
|
|
22488
|
+
attack: "text-error bg-error/10 border-error/30",
|
|
22489
|
+
defend: "text-info bg-info/10 border-info/30",
|
|
22490
|
+
heal: "text-success bg-success/10 border-success/30",
|
|
22491
|
+
move: "text-warning bg-warning/10 border-warning/30",
|
|
22492
|
+
special: "text-accent bg-accent/10 border-accent/30",
|
|
22493
|
+
death: "text-muted-foreground bg-muted/30 border-border",
|
|
22494
|
+
spawn: "text-accent bg-accent/10 border-accent/30"
|
|
22649
22495
|
};
|
|
22650
22496
|
DEFAULT_COMBAT_EVENTS = [
|
|
22651
22497
|
{ id: "e1", type: "spawn", message: "Shadow Guard entered the field.", timestamp: 0, turn: 1 },
|
|
@@ -23069,7 +22915,7 @@ function CraftingRecipe({
|
|
|
23069
22915
|
className
|
|
23070
22916
|
}) {
|
|
23071
22917
|
const eventBus = useEventBus();
|
|
23072
|
-
const handleCraft =
|
|
22918
|
+
const handleCraft = React87.useCallback(() => {
|
|
23073
22919
|
onCraft?.();
|
|
23074
22920
|
if (craftEvent) {
|
|
23075
22921
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -23086,7 +22932,7 @@ function CraftingRecipe({
|
|
|
23086
22932
|
children: [
|
|
23087
22933
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
23088
22934
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
23089
|
-
return /* @__PURE__ */ jsxs(
|
|
22935
|
+
return /* @__PURE__ */ jsxs(React87.Fragment, { children: [
|
|
23090
22936
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
23091
22937
|
ItemSlot,
|
|
23092
22938
|
{
|
|
@@ -23111,13 +22957,13 @@ function CraftingRecipe({
|
|
|
23111
22957
|
}
|
|
23112
22958
|
),
|
|
23113
22959
|
/* @__PURE__ */ jsx(
|
|
23114
|
-
|
|
22960
|
+
ActionButton,
|
|
23115
22961
|
{
|
|
22962
|
+
label: "Craft",
|
|
23116
22963
|
onClick: handleCraft,
|
|
23117
22964
|
disabled: !canCraft,
|
|
23118
22965
|
variant: canCraft ? "primary" : "secondary",
|
|
23119
|
-
size: "sm"
|
|
23120
|
-
children: "Craft"
|
|
22966
|
+
size: "sm"
|
|
23121
22967
|
}
|
|
23122
22968
|
)
|
|
23123
22969
|
]
|
|
@@ -23131,7 +22977,7 @@ var init_CraftingRecipe = __esm({
|
|
|
23131
22977
|
init_cn();
|
|
23132
22978
|
init_useEventBus();
|
|
23133
22979
|
init_ItemSlot();
|
|
23134
|
-
|
|
22980
|
+
init_ActionButton();
|
|
23135
22981
|
init_Box();
|
|
23136
22982
|
init_Stack();
|
|
23137
22983
|
init_Icon();
|
|
@@ -23158,8 +23004,8 @@ function DPad({
|
|
|
23158
23004
|
}) {
|
|
23159
23005
|
const eventBus = useEventBus();
|
|
23160
23006
|
const sizes = sizeMap15[size];
|
|
23161
|
-
const [activeDirections, setActiveDirections] =
|
|
23162
|
-
const handlePress =
|
|
23007
|
+
const [activeDirections, setActiveDirections] = React87.useState(/* @__PURE__ */ new Set());
|
|
23008
|
+
const handlePress = React87.useCallback(
|
|
23163
23009
|
(direction) => {
|
|
23164
23010
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
23165
23011
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -23167,7 +23013,7 @@ function DPad({
|
|
|
23167
23013
|
},
|
|
23168
23014
|
[directionEvent, eventBus, onDirection]
|
|
23169
23015
|
);
|
|
23170
|
-
const handleRelease =
|
|
23016
|
+
const handleRelease = React87.useCallback(
|
|
23171
23017
|
(direction) => {
|
|
23172
23018
|
setActiveDirections((prev) => {
|
|
23173
23019
|
const next = new Set(prev);
|
|
@@ -24052,8 +23898,8 @@ var init_Menu = __esm({
|
|
|
24052
23898
|
"bottom-end": "bottom-start"
|
|
24053
23899
|
};
|
|
24054
23900
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
24055
|
-
const triggerChild =
|
|
24056
|
-
const triggerElement =
|
|
23901
|
+
const triggerChild = React87__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
23902
|
+
const triggerElement = React87__default.cloneElement(
|
|
24057
23903
|
triggerChild,
|
|
24058
23904
|
{
|
|
24059
23905
|
ref: triggerRef,
|
|
@@ -24148,14 +23994,14 @@ function useDataDnd(args) {
|
|
|
24148
23994
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
24149
23995
|
const enabled = isZone || Boolean(dndRoot);
|
|
24150
23996
|
const eventBus = useEventBus();
|
|
24151
|
-
const parentRoot =
|
|
23997
|
+
const parentRoot = React87__default.useContext(RootCtx);
|
|
24152
23998
|
const isRoot = enabled && parentRoot === null;
|
|
24153
|
-
const zoneId =
|
|
23999
|
+
const zoneId = React87__default.useId();
|
|
24154
24000
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24155
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
24156
|
-
const optimisticOrdersRef =
|
|
24001
|
+
const [optimisticOrders, setOptimisticOrders] = React87__default.useState(() => /* @__PURE__ */ new Map());
|
|
24002
|
+
const optimisticOrdersRef = React87__default.useRef(optimisticOrders);
|
|
24157
24003
|
optimisticOrdersRef.current = optimisticOrders;
|
|
24158
|
-
const clearOptimisticOrder =
|
|
24004
|
+
const clearOptimisticOrder = React87__default.useCallback((group) => {
|
|
24159
24005
|
setOptimisticOrders((prev) => {
|
|
24160
24006
|
if (!prev.has(group)) return prev;
|
|
24161
24007
|
const next = new Map(prev);
|
|
@@ -24180,7 +24026,7 @@ function useDataDnd(args) {
|
|
|
24180
24026
|
const raw = it[dndItemIdField];
|
|
24181
24027
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
24182
24028
|
}).join("|");
|
|
24183
|
-
const itemIds =
|
|
24029
|
+
const itemIds = React87__default.useMemo(
|
|
24184
24030
|
() => orderedItems.map((it, idx) => {
|
|
24185
24031
|
const raw = it[dndItemIdField];
|
|
24186
24032
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -24191,7 +24037,7 @@ function useDataDnd(args) {
|
|
|
24191
24037
|
const raw = it[dndItemIdField];
|
|
24192
24038
|
return raw != null ? String(raw) : `__${idx}`;
|
|
24193
24039
|
}).join("|");
|
|
24194
|
-
|
|
24040
|
+
React87__default.useEffect(() => {
|
|
24195
24041
|
const root = isRoot ? null : parentRoot;
|
|
24196
24042
|
if (root) {
|
|
24197
24043
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -24199,20 +24045,20 @@ function useDataDnd(args) {
|
|
|
24199
24045
|
clearOptimisticOrder(ownGroup);
|
|
24200
24046
|
}
|
|
24201
24047
|
}, [itemsContentSig, ownGroup]);
|
|
24202
|
-
const zonesRef =
|
|
24203
|
-
const registerZone =
|
|
24048
|
+
const zonesRef = React87__default.useRef(/* @__PURE__ */ new Map());
|
|
24049
|
+
const registerZone = React87__default.useCallback((zoneId2, meta2) => {
|
|
24204
24050
|
zonesRef.current.set(zoneId2, meta2);
|
|
24205
24051
|
}, []);
|
|
24206
|
-
const unregisterZone =
|
|
24052
|
+
const unregisterZone = React87__default.useCallback((zoneId2) => {
|
|
24207
24053
|
zonesRef.current.delete(zoneId2);
|
|
24208
24054
|
}, []);
|
|
24209
|
-
const [activeDrag, setActiveDrag] =
|
|
24210
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
24211
|
-
const meta =
|
|
24055
|
+
const [activeDrag, setActiveDrag] = React87__default.useState(null);
|
|
24056
|
+
const [overZoneGroup, setOverZoneGroup] = React87__default.useState(null);
|
|
24057
|
+
const meta = React87__default.useMemo(
|
|
24212
24058
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
24213
24059
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
24214
24060
|
);
|
|
24215
|
-
|
|
24061
|
+
React87__default.useEffect(() => {
|
|
24216
24062
|
const target = isRoot ? null : parentRoot;
|
|
24217
24063
|
if (!target) {
|
|
24218
24064
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -24231,7 +24077,7 @@ function useDataDnd(args) {
|
|
|
24231
24077
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
24232
24078
|
const sensors = useAlmadarDndSensors(true);
|
|
24233
24079
|
const collisionDetection = almadarDndCollisionDetection;
|
|
24234
|
-
const findZoneByItem =
|
|
24080
|
+
const findZoneByItem = React87__default.useCallback(
|
|
24235
24081
|
(id) => {
|
|
24236
24082
|
for (const z of zonesRef.current.values()) {
|
|
24237
24083
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -24240,7 +24086,7 @@ function useDataDnd(args) {
|
|
|
24240
24086
|
},
|
|
24241
24087
|
[]
|
|
24242
24088
|
);
|
|
24243
|
-
|
|
24089
|
+
React87__default.useCallback(
|
|
24244
24090
|
(group) => {
|
|
24245
24091
|
for (const z of zonesRef.current.values()) {
|
|
24246
24092
|
if (z.group === group) return z;
|
|
@@ -24249,7 +24095,7 @@ function useDataDnd(args) {
|
|
|
24249
24095
|
},
|
|
24250
24096
|
[]
|
|
24251
24097
|
);
|
|
24252
|
-
const handleDragEnd =
|
|
24098
|
+
const handleDragEnd = React87__default.useCallback(
|
|
24253
24099
|
(event) => {
|
|
24254
24100
|
const { active, over } = event;
|
|
24255
24101
|
const activeIdStr = String(active.id);
|
|
@@ -24340,8 +24186,8 @@ function useDataDnd(args) {
|
|
|
24340
24186
|
},
|
|
24341
24187
|
[eventBus]
|
|
24342
24188
|
);
|
|
24343
|
-
const sortableData =
|
|
24344
|
-
const SortableItem =
|
|
24189
|
+
const sortableData = React87__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
24190
|
+
const SortableItem = React87__default.useCallback(
|
|
24345
24191
|
({ id, children }) => {
|
|
24346
24192
|
const {
|
|
24347
24193
|
attributes,
|
|
@@ -24381,7 +24227,7 @@ function useDataDnd(args) {
|
|
|
24381
24227
|
id: droppableId,
|
|
24382
24228
|
data: sortableData
|
|
24383
24229
|
});
|
|
24384
|
-
const ctx =
|
|
24230
|
+
const ctx = React87__default.useContext(RootCtx);
|
|
24385
24231
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
24386
24232
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
24387
24233
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -24396,7 +24242,7 @@ function useDataDnd(args) {
|
|
|
24396
24242
|
showForeignPlaceholder,
|
|
24397
24243
|
ctxAvailable: ctx != null
|
|
24398
24244
|
});
|
|
24399
|
-
|
|
24245
|
+
React87__default.useEffect(() => {
|
|
24400
24246
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
24401
24247
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
24402
24248
|
return /* @__PURE__ */ jsx(
|
|
@@ -24410,11 +24256,11 @@ function useDataDnd(args) {
|
|
|
24410
24256
|
}
|
|
24411
24257
|
);
|
|
24412
24258
|
};
|
|
24413
|
-
const rootContextValue =
|
|
24259
|
+
const rootContextValue = React87__default.useMemo(
|
|
24414
24260
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
24415
24261
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
24416
24262
|
);
|
|
24417
|
-
const handleDragStart =
|
|
24263
|
+
const handleDragStart = React87__default.useCallback((event) => {
|
|
24418
24264
|
const sourceZone = findZoneByItem(event.active.id);
|
|
24419
24265
|
const rect = event.active.rect.current.initial;
|
|
24420
24266
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -24433,7 +24279,7 @@ function useDataDnd(args) {
|
|
|
24433
24279
|
isRoot
|
|
24434
24280
|
});
|
|
24435
24281
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
24436
|
-
const handleDragOver =
|
|
24282
|
+
const handleDragOver = React87__default.useCallback((event) => {
|
|
24437
24283
|
const { active, over } = event;
|
|
24438
24284
|
const overData = over?.data?.current;
|
|
24439
24285
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -24503,7 +24349,7 @@ function useDataDnd(args) {
|
|
|
24503
24349
|
return next;
|
|
24504
24350
|
});
|
|
24505
24351
|
}, []);
|
|
24506
|
-
const handleDragCancel =
|
|
24352
|
+
const handleDragCancel = React87__default.useCallback((event) => {
|
|
24507
24353
|
setActiveDrag(null);
|
|
24508
24354
|
setOverZoneGroup(null);
|
|
24509
24355
|
dndLog.warn("dragCancel", {
|
|
@@ -24511,12 +24357,12 @@ function useDataDnd(args) {
|
|
|
24511
24357
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
24512
24358
|
});
|
|
24513
24359
|
}, []);
|
|
24514
|
-
const handleDragEndWithCleanup =
|
|
24360
|
+
const handleDragEndWithCleanup = React87__default.useCallback((event) => {
|
|
24515
24361
|
handleDragEnd(event);
|
|
24516
24362
|
setActiveDrag(null);
|
|
24517
24363
|
setOverZoneGroup(null);
|
|
24518
24364
|
}, [handleDragEnd]);
|
|
24519
|
-
const wrapContainer =
|
|
24365
|
+
const wrapContainer = React87__default.useCallback(
|
|
24520
24366
|
(children) => {
|
|
24521
24367
|
if (!enabled) return children;
|
|
24522
24368
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -24570,7 +24416,7 @@ var init_useDataDnd = __esm({
|
|
|
24570
24416
|
init_useAlmadarDndCollision();
|
|
24571
24417
|
init_Box();
|
|
24572
24418
|
dndLog = createLogger("almadar:ui:dnd");
|
|
24573
|
-
RootCtx =
|
|
24419
|
+
RootCtx = React87__default.createContext(null);
|
|
24574
24420
|
}
|
|
24575
24421
|
});
|
|
24576
24422
|
function renderIconInput(icon, props) {
|
|
@@ -25096,7 +24942,7 @@ function DataList({
|
|
|
25096
24942
|
}) {
|
|
25097
24943
|
const eventBus = useEventBus();
|
|
25098
24944
|
const { t } = useTranslate();
|
|
25099
|
-
const [visibleCount, setVisibleCount] =
|
|
24945
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize || Infinity);
|
|
25100
24946
|
const fieldDefs = fields ?? columns ?? [];
|
|
25101
24947
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
25102
24948
|
const dnd = useDataDnd({
|
|
@@ -25115,7 +24961,7 @@ function DataList({
|
|
|
25115
24961
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
25116
24962
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
25117
24963
|
const hasRenderProp = typeof children === "function";
|
|
25118
|
-
|
|
24964
|
+
React87__default.useEffect(() => {
|
|
25119
24965
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
25120
24966
|
const childrenTypeOf = typeof children;
|
|
25121
24967
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -25219,7 +25065,7 @@ function DataList({
|
|
|
25219
25065
|
const items2 = [...data];
|
|
25220
25066
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
25221
25067
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
25222
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25068
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
25223
25069
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
25224
25070
|
group.items.map((itemData, index) => {
|
|
25225
25071
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -25360,7 +25206,7 @@ function DataList({
|
|
|
25360
25206
|
className
|
|
25361
25207
|
),
|
|
25362
25208
|
children: [
|
|
25363
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25209
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
25364
25210
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
25365
25211
|
group.items.map(
|
|
25366
25212
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26153,7 +25999,7 @@ var init_Flex = __esm({
|
|
|
26153
25999
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
26154
26000
|
}
|
|
26155
26001
|
}
|
|
26156
|
-
return
|
|
26002
|
+
return React87__default.createElement(Component2, {
|
|
26157
26003
|
className: cn(
|
|
26158
26004
|
inline ? "inline-flex" : "flex",
|
|
26159
26005
|
directionStyles[direction],
|
|
@@ -26272,7 +26118,7 @@ var init_Grid = __esm({
|
|
|
26272
26118
|
as: Component2 = "div"
|
|
26273
26119
|
}) => {
|
|
26274
26120
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
26275
|
-
return
|
|
26121
|
+
return React87__default.createElement(
|
|
26276
26122
|
Component2,
|
|
26277
26123
|
{
|
|
26278
26124
|
className: cn(
|
|
@@ -26468,9 +26314,9 @@ var init_Popover = __esm({
|
|
|
26468
26314
|
onMouseLeave: handleClose,
|
|
26469
26315
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26470
26316
|
};
|
|
26471
|
-
const childElement =
|
|
26317
|
+
const childElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26472
26318
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26473
|
-
const triggerElement =
|
|
26319
|
+
const triggerElement = React87__default.cloneElement(
|
|
26474
26320
|
childElement,
|
|
26475
26321
|
{
|
|
26476
26322
|
ref: triggerRef,
|
|
@@ -27072,9 +26918,9 @@ var init_Tooltip = __esm({
|
|
|
27072
26918
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
27073
26919
|
};
|
|
27074
26920
|
}, []);
|
|
27075
|
-
const triggerElement =
|
|
26921
|
+
const triggerElement = React87__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27076
26922
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
27077
|
-
const trigger =
|
|
26923
|
+
const trigger = React87__default.cloneElement(triggerElement, {
|
|
27078
26924
|
ref: triggerRef,
|
|
27079
26925
|
onMouseEnter: handleMouseEnter,
|
|
27080
26926
|
onMouseLeave: handleMouseLeave,
|
|
@@ -27164,7 +27010,7 @@ var init_WizardProgress = __esm({
|
|
|
27164
27010
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
27165
27011
|
const isActive = index === currentStep;
|
|
27166
27012
|
const isCompleted = index < currentStep;
|
|
27167
|
-
return /* @__PURE__ */ jsxs(
|
|
27013
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
27168
27014
|
/* @__PURE__ */ jsx(
|
|
27169
27015
|
"button",
|
|
27170
27016
|
{
|
|
@@ -28127,6 +27973,7 @@ var init_ProgressDots = __esm({
|
|
|
28127
27973
|
});
|
|
28128
27974
|
function StatBadge({
|
|
28129
27975
|
assetUrl,
|
|
27976
|
+
iconUrl,
|
|
28130
27977
|
label,
|
|
28131
27978
|
value = 0,
|
|
28132
27979
|
max,
|
|
@@ -28140,6 +27987,7 @@ function StatBadge({
|
|
|
28140
27987
|
field: _field
|
|
28141
27988
|
}) {
|
|
28142
27989
|
const numValue = typeof value === "number" ? value : parseInt(String(value), 10) || 0;
|
|
27990
|
+
const resolvedAsset = iconUrl ?? assetUrl;
|
|
28143
27991
|
return /* @__PURE__ */ jsxs(
|
|
28144
27992
|
"div",
|
|
28145
27993
|
{
|
|
@@ -28150,10 +27998,10 @@ function StatBadge({
|
|
|
28150
27998
|
className
|
|
28151
27999
|
),
|
|
28152
28000
|
children: [
|
|
28153
|
-
|
|
28001
|
+
resolvedAsset ? /* @__PURE__ */ jsx(
|
|
28154
28002
|
"img",
|
|
28155
28003
|
{
|
|
28156
|
-
src:
|
|
28004
|
+
src: resolvedAsset,
|
|
28157
28005
|
alt: "",
|
|
28158
28006
|
width: 16,
|
|
28159
28007
|
height: 16,
|
|
@@ -28184,8 +28032,7 @@ function StatBadge({
|
|
|
28184
28032
|
ScoreDisplay,
|
|
28185
28033
|
{
|
|
28186
28034
|
value: numValue,
|
|
28187
|
-
size: size === "lg" ? "md" : "sm"
|
|
28188
|
-
animated: true
|
|
28035
|
+
size: size === "lg" ? "md" : "sm"
|
|
28189
28036
|
}
|
|
28190
28037
|
),
|
|
28191
28038
|
format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-foreground", children: value })
|
|
@@ -28228,7 +28075,7 @@ function InventoryGrid({
|
|
|
28228
28075
|
const eventBus = useEventBus();
|
|
28229
28076
|
const slotCount = totalSlots ?? items.length;
|
|
28230
28077
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
28231
|
-
const handleSelect =
|
|
28078
|
+
const handleSelect = React87.useCallback(
|
|
28232
28079
|
(id) => {
|
|
28233
28080
|
onSelect?.(id);
|
|
28234
28081
|
if (selectEvent) {
|
|
@@ -28335,12 +28182,14 @@ function QuestTracker({
|
|
|
28335
28182
|
}
|
|
28336
28183
|
),
|
|
28337
28184
|
/* @__PURE__ */ jsx(Box, { className: "mt-1.5", children: /* @__PURE__ */ jsx(
|
|
28338
|
-
|
|
28185
|
+
HealthBar,
|
|
28339
28186
|
{
|
|
28340
|
-
|
|
28187
|
+
current: quest.progress,
|
|
28341
28188
|
max: quest.maxProgress,
|
|
28342
|
-
|
|
28343
|
-
size: "sm"
|
|
28189
|
+
format: "bar",
|
|
28190
|
+
size: "sm",
|
|
28191
|
+
animated: true,
|
|
28192
|
+
className: isCompleted ? "[--health-color:var(--color-success)]" : isActive ? "" : "opacity-60"
|
|
28344
28193
|
}
|
|
28345
28194
|
) }),
|
|
28346
28195
|
/* @__PURE__ */ jsxs(
|
|
@@ -28368,7 +28217,7 @@ var init_QuestTracker = __esm({
|
|
|
28368
28217
|
"use client";
|
|
28369
28218
|
init_cn();
|
|
28370
28219
|
init_WaypointMarker();
|
|
28371
|
-
|
|
28220
|
+
init_HealthBar();
|
|
28372
28221
|
init_Typography();
|
|
28373
28222
|
init_Box();
|
|
28374
28223
|
init_Stack();
|
|
@@ -28463,31 +28312,31 @@ function GameCanvas2D({
|
|
|
28463
28312
|
assetBaseUrl,
|
|
28464
28313
|
className
|
|
28465
28314
|
}) {
|
|
28466
|
-
const canvasRef =
|
|
28467
|
-
const rafRef =
|
|
28468
|
-
const frameRef =
|
|
28469
|
-
const lastTimeRef =
|
|
28470
|
-
const imageCache =
|
|
28315
|
+
const canvasRef = React87.useRef(null);
|
|
28316
|
+
const rafRef = React87.useRef(0);
|
|
28317
|
+
const frameRef = React87.useRef(0);
|
|
28318
|
+
const lastTimeRef = React87.useRef(0);
|
|
28319
|
+
const imageCache = React87.useRef(/* @__PURE__ */ new Map());
|
|
28471
28320
|
const emit = useEmitEvent();
|
|
28472
|
-
const onDrawRef =
|
|
28321
|
+
const onDrawRef = React87.useRef(onDraw);
|
|
28473
28322
|
onDrawRef.current = onDraw;
|
|
28474
|
-
const onTickRef =
|
|
28323
|
+
const onTickRef = React87.useRef(onTick);
|
|
28475
28324
|
onTickRef.current = onTick;
|
|
28476
|
-
const tickEventRef =
|
|
28325
|
+
const tickEventRef = React87.useRef(tickEvent);
|
|
28477
28326
|
tickEventRef.current = tickEvent;
|
|
28478
|
-
const drawEventRef =
|
|
28327
|
+
const drawEventRef = React87.useRef(drawEvent);
|
|
28479
28328
|
drawEventRef.current = drawEvent;
|
|
28480
|
-
const emitRef =
|
|
28329
|
+
const emitRef = React87.useRef(emit);
|
|
28481
28330
|
emitRef.current = emit;
|
|
28482
|
-
const assetBaseUrlRef =
|
|
28331
|
+
const assetBaseUrlRef = React87.useRef(assetBaseUrl);
|
|
28483
28332
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
28484
|
-
const backgroundImageRef =
|
|
28333
|
+
const backgroundImageRef = React87.useRef(backgroundImage);
|
|
28485
28334
|
backgroundImageRef.current = backgroundImage;
|
|
28486
|
-
const widthRef =
|
|
28335
|
+
const widthRef = React87.useRef(width);
|
|
28487
28336
|
widthRef.current = width;
|
|
28488
|
-
const heightRef =
|
|
28337
|
+
const heightRef = React87.useRef(height);
|
|
28489
28338
|
heightRef.current = height;
|
|
28490
|
-
const loadImage =
|
|
28339
|
+
const loadImage = React87.useCallback((url) => {
|
|
28491
28340
|
const base = assetBaseUrlRef.current;
|
|
28492
28341
|
if (!url.startsWith("http") && !base) return null;
|
|
28493
28342
|
const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
|
|
@@ -28501,7 +28350,7 @@ function GameCanvas2D({
|
|
|
28501
28350
|
}
|
|
28502
28351
|
return null;
|
|
28503
28352
|
}, []);
|
|
28504
|
-
|
|
28353
|
+
React87.useEffect(() => {
|
|
28505
28354
|
const canvas = canvasRef.current;
|
|
28506
28355
|
if (!canvas) return;
|
|
28507
28356
|
const ctx = canvas.getContext("2d");
|
|
@@ -28649,26 +28498,14 @@ function HealthPanel({
|
|
|
28649
28498
|
)
|
|
28650
28499
|
}
|
|
28651
28500
|
),
|
|
28652
|
-
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */
|
|
28653
|
-
|
|
28501
|
+
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
|
|
28502
|
+
StatusEffect,
|
|
28654
28503
|
{
|
|
28504
|
+
assetUrl: effect.assetUrl,
|
|
28505
|
+
icon: effect.icon,
|
|
28506
|
+
label: effect.label,
|
|
28655
28507
|
variant: effectVariantMap[effect.variant ?? "neutral"],
|
|
28656
|
-
size: "sm"
|
|
28657
|
-
icon: effect.assetUrl ? void 0 : effect.icon,
|
|
28658
|
-
children: [
|
|
28659
|
-
effect.assetUrl && /* @__PURE__ */ jsx(
|
|
28660
|
-
"img",
|
|
28661
|
-
{
|
|
28662
|
-
src: effect.assetUrl,
|
|
28663
|
-
alt: "",
|
|
28664
|
-
width: 12,
|
|
28665
|
-
height: 12,
|
|
28666
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
28667
|
-
className: "flex-shrink-0 inline-block"
|
|
28668
|
-
}
|
|
28669
|
-
),
|
|
28670
|
-
effect.label
|
|
28671
|
-
]
|
|
28508
|
+
size: "sm"
|
|
28672
28509
|
},
|
|
28673
28510
|
i
|
|
28674
28511
|
)) })
|
|
@@ -28682,17 +28519,17 @@ var init_HealthPanel = __esm({
|
|
|
28682
28519
|
"use client";
|
|
28683
28520
|
init_cn();
|
|
28684
28521
|
init_HealthBar();
|
|
28522
|
+
init_StatusEffect();
|
|
28685
28523
|
init_Box();
|
|
28686
28524
|
init_Typography();
|
|
28687
|
-
init_Badge();
|
|
28688
28525
|
sizeMap18 = {
|
|
28689
28526
|
sm: { gap: "gap-1", padding: "px-2 py-1.5", text: "text-xs", barSize: "sm" },
|
|
28690
28527
|
md: { gap: "gap-1.5", padding: "px-3 py-2", text: "text-sm", barSize: "md" },
|
|
28691
28528
|
lg: { gap: "gap-2", padding: "px-4 py-3", text: "text-base", barSize: "lg" }
|
|
28692
28529
|
};
|
|
28693
28530
|
effectVariantMap = {
|
|
28694
|
-
buff: "
|
|
28695
|
-
debuff: "
|
|
28531
|
+
buff: "buff",
|
|
28532
|
+
debuff: "debuff",
|
|
28696
28533
|
neutral: "neutral"
|
|
28697
28534
|
};
|
|
28698
28535
|
HealthPanel.displayName = "HealthPanel";
|
|
@@ -28712,13 +28549,13 @@ function ScoreBoard({
|
|
|
28712
28549
|
const multiplier = rawMultiplier ?? 1;
|
|
28713
28550
|
const level = rawLevel ?? 1;
|
|
28714
28551
|
return /* @__PURE__ */ jsx(
|
|
28715
|
-
|
|
28552
|
+
Box,
|
|
28716
28553
|
{
|
|
28717
28554
|
className: cn(
|
|
28718
|
-
"bg-[var(--color-card)]/90
|
|
28555
|
+
"rounded-container border border-border bg-[var(--color-card)]/90 backdrop-blur-sm p-3",
|
|
28719
28556
|
className
|
|
28720
28557
|
),
|
|
28721
|
-
children: /* @__PURE__ */
|
|
28558
|
+
children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
|
|
28722
28559
|
/* @__PURE__ */ jsx(
|
|
28723
28560
|
StatBadge,
|
|
28724
28561
|
{
|
|
@@ -28760,7 +28597,7 @@ function ScoreBoard({
|
|
|
28760
28597
|
}
|
|
28761
28598
|
),
|
|
28762
28599
|
combo != null && combo > 0 && /* @__PURE__ */ jsx(ComboCounter, { combo, multiplier, size: "sm" })
|
|
28763
|
-
] })
|
|
28600
|
+
] })
|
|
28764
28601
|
}
|
|
28765
28602
|
);
|
|
28766
28603
|
}
|
|
@@ -28770,7 +28607,6 @@ var init_ScoreBoard = __esm({
|
|
|
28770
28607
|
init_cn();
|
|
28771
28608
|
init_ComboCounter();
|
|
28772
28609
|
init_StatBadge();
|
|
28773
|
-
init_Card();
|
|
28774
28610
|
init_Box();
|
|
28775
28611
|
ScoreBoard.displayName = "ScoreBoard";
|
|
28776
28612
|
}
|
|
@@ -28826,7 +28662,7 @@ function TurnPanel({
|
|
|
28826
28662
|
className
|
|
28827
28663
|
}) {
|
|
28828
28664
|
const eventBus = useEventBus();
|
|
28829
|
-
const handleAction =
|
|
28665
|
+
const handleAction = React87.useCallback(
|
|
28830
28666
|
(event) => {
|
|
28831
28667
|
if (event) {
|
|
28832
28668
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -28851,28 +28687,16 @@ function TurnPanel({
|
|
|
28851
28687
|
activeTeam
|
|
28852
28688
|
}
|
|
28853
28689
|
),
|
|
28854
|
-
actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */
|
|
28855
|
-
|
|
28690
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsx(
|
|
28691
|
+
ActionButton,
|
|
28856
28692
|
{
|
|
28857
|
-
|
|
28858
|
-
|
|
28693
|
+
label: action.label,
|
|
28694
|
+
icon: action.assetUrl ? void 0 : action.icon,
|
|
28695
|
+
assetUrl: action.assetUrl,
|
|
28859
28696
|
disabled: action.disabled,
|
|
28860
|
-
|
|
28861
|
-
|
|
28862
|
-
|
|
28863
|
-
action.assetUrl && /* @__PURE__ */ jsx(
|
|
28864
|
-
"img",
|
|
28865
|
-
{
|
|
28866
|
-
src: action.assetUrl,
|
|
28867
|
-
alt: "",
|
|
28868
|
-
width: 14,
|
|
28869
|
-
height: 14,
|
|
28870
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
28871
|
-
className: "flex-shrink-0"
|
|
28872
|
-
}
|
|
28873
|
-
),
|
|
28874
|
-
action.label
|
|
28875
|
-
]
|
|
28697
|
+
variant: "secondary",
|
|
28698
|
+
size: "sm",
|
|
28699
|
+
onClick: () => handleAction(action.event)
|
|
28876
28700
|
},
|
|
28877
28701
|
i
|
|
28878
28702
|
)) })
|
|
@@ -28886,7 +28710,7 @@ var init_TurnPanel = __esm({
|
|
|
28886
28710
|
"use client";
|
|
28887
28711
|
init_cn();
|
|
28888
28712
|
init_TurnIndicator();
|
|
28889
|
-
|
|
28713
|
+
init_ActionButton();
|
|
28890
28714
|
init_Box();
|
|
28891
28715
|
init_useEventBus();
|
|
28892
28716
|
DEFAULT_TURN_ACTIONS = [
|
|
@@ -28937,7 +28761,7 @@ function EnemyPlate({
|
|
|
28937
28761
|
}
|
|
28938
28762
|
)
|
|
28939
28763
|
] }),
|
|
28940
|
-
level != null && /* @__PURE__ */ jsxs(
|
|
28764
|
+
level != null && /* @__PURE__ */ jsxs("span", { className: "text-xs font-bold text-muted-foreground bg-muted/60 rounded px-1.5 py-0.5 border border-border/50 shrink-0", children: [
|
|
28941
28765
|
"Lv.",
|
|
28942
28766
|
level
|
|
28943
28767
|
] })
|
|
@@ -28968,12 +28792,12 @@ function EnemyPlate({
|
|
|
28968
28792
|
)
|
|
28969
28793
|
] }),
|
|
28970
28794
|
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
|
|
28971
|
-
|
|
28795
|
+
StatusEffect,
|
|
28972
28796
|
{
|
|
28973
|
-
variant: effectVariantMap2[effect.variant ?? "neutral"],
|
|
28974
|
-
size: "sm",
|
|
28975
28797
|
icon: effect.icon,
|
|
28976
|
-
|
|
28798
|
+
label: effect.label,
|
|
28799
|
+
variant: effectVariantMap2[effect.variant ?? "neutral"],
|
|
28800
|
+
size: "sm"
|
|
28977
28801
|
},
|
|
28978
28802
|
i
|
|
28979
28803
|
)) })
|
|
@@ -28987,12 +28811,12 @@ var init_EnemyPlate = __esm({
|
|
|
28987
28811
|
"use client";
|
|
28988
28812
|
init_cn();
|
|
28989
28813
|
init_HealthBar();
|
|
28814
|
+
init_StatusEffect();
|
|
28990
28815
|
init_Box();
|
|
28991
28816
|
init_Typography();
|
|
28992
|
-
init_Badge();
|
|
28993
28817
|
effectVariantMap2 = {
|
|
28994
|
-
buff: "
|
|
28995
|
-
debuff: "
|
|
28818
|
+
buff: "buff",
|
|
28819
|
+
debuff: "debuff",
|
|
28996
28820
|
neutral: "neutral"
|
|
28997
28821
|
};
|
|
28998
28822
|
DEFAULT_ENEMY_EFFECTS = [
|
|
@@ -29007,7 +28831,7 @@ function UnitCommandBar({
|
|
|
29007
28831
|
className
|
|
29008
28832
|
}) {
|
|
29009
28833
|
const eventBus = useEventBus();
|
|
29010
|
-
const handleCommand =
|
|
28834
|
+
const handleCommand = React87.useCallback(
|
|
29011
28835
|
(event) => {
|
|
29012
28836
|
if (event) {
|
|
29013
28837
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -29022,27 +28846,18 @@ function UnitCommandBar({
|
|
|
29022
28846
|
"flex items-center gap-1.5 rounded-container bg-[var(--color-card)]/90 border border-border backdrop-blur-sm px-2 py-1.5",
|
|
29023
28847
|
className
|
|
29024
28848
|
),
|
|
29025
|
-
children: commands.map((command, i) => /* @__PURE__ */
|
|
29026
|
-
|
|
29027
|
-
|
|
29028
|
-
|
|
29029
|
-
|
|
29030
|
-
|
|
29031
|
-
|
|
29032
|
-
|
|
29033
|
-
|
|
29034
|
-
|
|
29035
|
-
|
|
29036
|
-
|
|
29037
|
-
command.hotkey && /* @__PURE__ */ jsx(
|
|
29038
|
-
Typography,
|
|
29039
|
-
{
|
|
29040
|
-
variant: "caption",
|
|
29041
|
-
className: "text-muted-foreground text-xs font-mono",
|
|
29042
|
-
children: command.hotkey
|
|
29043
|
-
}
|
|
29044
|
-
)
|
|
29045
|
-
] }, i))
|
|
28849
|
+
children: commands.map((command, i) => /* @__PURE__ */ jsx(Box, { className: "flex flex-col items-center gap-0.5", children: /* @__PURE__ */ jsx(
|
|
28850
|
+
ActionButton,
|
|
28851
|
+
{
|
|
28852
|
+
label: command.label,
|
|
28853
|
+
icon: command.icon,
|
|
28854
|
+
disabled: command.disabled,
|
|
28855
|
+
hotkey: command.hotkey,
|
|
28856
|
+
variant: "secondary",
|
|
28857
|
+
size: "sm",
|
|
28858
|
+
onClick: () => handleCommand(command.event)
|
|
28859
|
+
}
|
|
28860
|
+
) }, i))
|
|
29046
28861
|
}
|
|
29047
28862
|
);
|
|
29048
28863
|
}
|
|
@@ -29051,9 +28866,8 @@ var init_UnitCommandBar = __esm({
|
|
|
29051
28866
|
"components/game/molecules/UnitCommandBar.tsx"() {
|
|
29052
28867
|
"use client";
|
|
29053
28868
|
init_cn();
|
|
29054
|
-
|
|
28869
|
+
init_ActionButton();
|
|
29055
28870
|
init_Box();
|
|
29056
|
-
init_Typography();
|
|
29057
28871
|
init_useEventBus();
|
|
29058
28872
|
DEFAULT_COMMANDS = [
|
|
29059
28873
|
{ label: "Move", icon: "move", event: "MOVE", hotkey: "M" },
|
|
@@ -29558,7 +29372,7 @@ function GameMenu({
|
|
|
29558
29372
|
} catch {
|
|
29559
29373
|
}
|
|
29560
29374
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29561
|
-
const handleOptionClick =
|
|
29375
|
+
const handleOptionClick = React87.useCallback(
|
|
29562
29376
|
(option) => {
|
|
29563
29377
|
if (option.event && eventBus) {
|
|
29564
29378
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -29677,7 +29491,7 @@ function GameOverScreen({
|
|
|
29677
29491
|
} catch {
|
|
29678
29492
|
}
|
|
29679
29493
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29680
|
-
const handleActionClick =
|
|
29494
|
+
const handleActionClick = React87.useCallback(
|
|
29681
29495
|
(action) => {
|
|
29682
29496
|
if (action.event && eventBus) {
|
|
29683
29497
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -29892,6 +29706,7 @@ function PlatformerCanvas({
|
|
|
29892
29706
|
rightEvent = "MOVE_RIGHT",
|
|
29893
29707
|
jumpEvent = "JUMP",
|
|
29894
29708
|
stopEvent = "STOP",
|
|
29709
|
+
effects = [],
|
|
29895
29710
|
className
|
|
29896
29711
|
}) {
|
|
29897
29712
|
const canvasRef = useRef(null);
|
|
@@ -29962,7 +29777,8 @@ function PlatformerCanvas({
|
|
|
29962
29777
|
playerSprite,
|
|
29963
29778
|
tileSprites,
|
|
29964
29779
|
backgroundImage,
|
|
29965
|
-
assetBaseUrl
|
|
29780
|
+
assetBaseUrl,
|
|
29781
|
+
effects
|
|
29966
29782
|
});
|
|
29967
29783
|
propsRef.current = {
|
|
29968
29784
|
platforms,
|
|
@@ -29975,7 +29791,8 @@ function PlatformerCanvas({
|
|
|
29975
29791
|
playerSprite,
|
|
29976
29792
|
tileSprites,
|
|
29977
29793
|
backgroundImage,
|
|
29978
|
-
assetBaseUrl
|
|
29794
|
+
assetBaseUrl,
|
|
29795
|
+
effects
|
|
29979
29796
|
};
|
|
29980
29797
|
const handleKeyDown = useCallback((e) => {
|
|
29981
29798
|
if (keysRef.current.has(e.code)) return;
|
|
@@ -30042,7 +29859,8 @@ function PlatformerCanvas({
|
|
|
30042
29859
|
bgColor: bg,
|
|
30043
29860
|
playerSprite: pSprite,
|
|
30044
29861
|
tileSprites: tSprites,
|
|
30045
|
-
backgroundImage: bgImg
|
|
29862
|
+
backgroundImage: bgImg,
|
|
29863
|
+
effects: fxList
|
|
30046
29864
|
} = propsRef.current;
|
|
30047
29865
|
const auth = playerRef.current;
|
|
30048
29866
|
const interped = positions.get("player");
|
|
@@ -30196,6 +30014,18 @@ function PlatformerCanvas({
|
|
|
30196
30014
|
ctx.arc(ppx + eyeOffsetX + 7, eyeY, eyeSize, 0, Math.PI * 2);
|
|
30197
30015
|
ctx.fill();
|
|
30198
30016
|
}
|
|
30017
|
+
for (const fx of fxList) {
|
|
30018
|
+
const fxScreenX = fx.x - camX;
|
|
30019
|
+
const fxScreenY = fx.y - camY;
|
|
30020
|
+
const alpha = Math.min(1, fx.ttl / 4);
|
|
30021
|
+
const prev = ctx.globalAlpha;
|
|
30022
|
+
ctx.globalAlpha = alpha;
|
|
30023
|
+
ctx.fillStyle = "#ffe066";
|
|
30024
|
+
ctx.beginPath();
|
|
30025
|
+
ctx.arc(fxScreenX, fxScreenY, 12, 0, Math.PI * 2);
|
|
30026
|
+
ctx.fill();
|
|
30027
|
+
ctx.globalAlpha = prev;
|
|
30028
|
+
}
|
|
30199
30029
|
};
|
|
30200
30030
|
return interp.startLoop(drawFrame);
|
|
30201
30031
|
}, [interp.startLoop, loadImage]);
|
|
@@ -30609,13 +30439,13 @@ var init_MapView = __esm({
|
|
|
30609
30439
|
shadowSize: [41, 41]
|
|
30610
30440
|
});
|
|
30611
30441
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30612
|
-
const { useEffect:
|
|
30442
|
+
const { useEffect: useEffect83, useRef: useRef80, useCallback: useCallback127, useState: useState115 } = React87__default;
|
|
30613
30443
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30614
30444
|
const { useEventBus: useEventBus4 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30615
30445
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30616
30446
|
const map = useMap();
|
|
30617
30447
|
const prevRef = useRef80({ centerLat, centerLng, zoom });
|
|
30618
|
-
|
|
30448
|
+
useEffect83(() => {
|
|
30619
30449
|
const prev = prevRef.current;
|
|
30620
30450
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30621
30451
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30626,7 +30456,7 @@ var init_MapView = __esm({
|
|
|
30626
30456
|
}
|
|
30627
30457
|
function MapClickHandler({ onMapClick }) {
|
|
30628
30458
|
const map = useMap();
|
|
30629
|
-
|
|
30459
|
+
useEffect83(() => {
|
|
30630
30460
|
if (!onMapClick) return;
|
|
30631
30461
|
const handler = (e) => {
|
|
30632
30462
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -30654,7 +30484,7 @@ var init_MapView = __esm({
|
|
|
30654
30484
|
showAttribution = true
|
|
30655
30485
|
}) {
|
|
30656
30486
|
const eventBus = useEventBus4();
|
|
30657
|
-
const [clickedPosition, setClickedPosition] =
|
|
30487
|
+
const [clickedPosition, setClickedPosition] = useState115(null);
|
|
30658
30488
|
const handleMapClick = useCallback127((lat, lng) => {
|
|
30659
30489
|
if (showClickedPin) {
|
|
30660
30490
|
setClickedPosition({ lat, lng });
|
|
@@ -31524,8 +31354,8 @@ function TableView({
|
|
|
31524
31354
|
}) {
|
|
31525
31355
|
const eventBus = useEventBus();
|
|
31526
31356
|
const { t } = useTranslate();
|
|
31527
|
-
const [visibleCount, setVisibleCount] =
|
|
31528
|
-
const [localSelected, setLocalSelected] =
|
|
31357
|
+
const [visibleCount, setVisibleCount] = React87__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31358
|
+
const [localSelected, setLocalSelected] = React87__default.useState(/* @__PURE__ */ new Set());
|
|
31529
31359
|
const colDefs = columns ?? fields ?? [];
|
|
31530
31360
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31531
31361
|
const dnd = useDataDnd({
|
|
@@ -31720,12 +31550,12 @@ function TableView({
|
|
|
31720
31550
|
]
|
|
31721
31551
|
}
|
|
31722
31552
|
);
|
|
31723
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31553
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React87__default.Fragment, { children: rowInner }, id);
|
|
31724
31554
|
};
|
|
31725
31555
|
const items = Array.from(data);
|
|
31726
31556
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
31727
31557
|
let runningIndex = 0;
|
|
31728
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31558
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
31729
31559
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
31730
31560
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
31731
31561
|
] }, gi)) });
|
|
@@ -33082,7 +32912,7 @@ var init_StepFlow = __esm({
|
|
|
33082
32912
|
className
|
|
33083
32913
|
}) => {
|
|
33084
32914
|
if (orientation === "vertical") {
|
|
33085
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32915
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
33086
32916
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
33087
32917
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33088
32918
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -33093,7 +32923,7 @@ var init_StepFlow = __esm({
|
|
|
33093
32923
|
] })
|
|
33094
32924
|
] }) }, index)) });
|
|
33095
32925
|
}
|
|
33096
|
-
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(
|
|
32926
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
33097
32927
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
33098
32928
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33099
32929
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -34078,7 +33908,7 @@ var init_LikertScale = __esm({
|
|
|
34078
33908
|
md: "text-base",
|
|
34079
33909
|
lg: "text-lg"
|
|
34080
33910
|
};
|
|
34081
|
-
LikertScale =
|
|
33911
|
+
LikertScale = React87__default.forwardRef(
|
|
34082
33912
|
({
|
|
34083
33913
|
question,
|
|
34084
33914
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -34090,7 +33920,7 @@ var init_LikertScale = __esm({
|
|
|
34090
33920
|
variant = "radios",
|
|
34091
33921
|
className
|
|
34092
33922
|
}, ref) => {
|
|
34093
|
-
const groupId =
|
|
33923
|
+
const groupId = React87__default.useId();
|
|
34094
33924
|
const eventBus = useEventBus();
|
|
34095
33925
|
const handleSelect = useCallback(
|
|
34096
33926
|
(next) => {
|
|
@@ -36372,7 +36202,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36372
36202
|
"aria-label": t("aria.breadcrumb"),
|
|
36373
36203
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36374
36204
|
const isLast = idx === items.length - 1;
|
|
36375
|
-
return /* @__PURE__ */ jsxs(
|
|
36205
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
36376
36206
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36377
36207
|
Icon,
|
|
36378
36208
|
{
|
|
@@ -37241,7 +37071,7 @@ var init_MiniStateMachine = __esm({
|
|
|
37241
37071
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
37242
37072
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37243
37073
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37244
|
-
return /* @__PURE__ */ jsxs(
|
|
37074
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
37245
37075
|
/* @__PURE__ */ jsx(
|
|
37246
37076
|
AvlState,
|
|
37247
37077
|
{
|
|
@@ -37445,7 +37275,7 @@ var init_PageHeader = __esm({
|
|
|
37445
37275
|
info: "bg-info/10 text-info"
|
|
37446
37276
|
};
|
|
37447
37277
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37448
|
-
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(
|
|
37278
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
37449
37279
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37450
37280
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37451
37281
|
"a",
|
|
@@ -37803,7 +37633,7 @@ var init_Section = __esm({
|
|
|
37803
37633
|
as: Component2 = "section"
|
|
37804
37634
|
}) => {
|
|
37805
37635
|
const hasHeader = title || description || action;
|
|
37806
|
-
return
|
|
37636
|
+
return React87__default.createElement(
|
|
37807
37637
|
Component2,
|
|
37808
37638
|
{
|
|
37809
37639
|
className: cn(
|
|
@@ -38171,7 +38001,7 @@ var init_WizardContainer = __esm({
|
|
|
38171
38001
|
const isCompleted = index < currentStep;
|
|
38172
38002
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
38173
38003
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
38174
|
-
return /* @__PURE__ */ jsxs(
|
|
38004
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
38175
38005
|
/* @__PURE__ */ jsx(
|
|
38176
38006
|
Button,
|
|
38177
38007
|
{
|
|
@@ -40750,7 +40580,7 @@ var init_DetailPanel = __esm({
|
|
|
40750
40580
|
}
|
|
40751
40581
|
});
|
|
40752
40582
|
function extractTitle(children) {
|
|
40753
|
-
if (!
|
|
40583
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
40754
40584
|
const props = children.props;
|
|
40755
40585
|
if (typeof props.title === "string") {
|
|
40756
40586
|
return props.title;
|
|
@@ -40805,7 +40635,7 @@ function LinearView({
|
|
|
40805
40635
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
40806
40636
|
const isDone = i < currentIdx;
|
|
40807
40637
|
const isCurrent = i === currentIdx;
|
|
40808
|
-
return /* @__PURE__ */ jsxs(
|
|
40638
|
+
return /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
40809
40639
|
i > 0 && /* @__PURE__ */ jsx(
|
|
40810
40640
|
Typography,
|
|
40811
40641
|
{
|
|
@@ -41791,12 +41621,12 @@ var init_Form = __esm({
|
|
|
41791
41621
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
41792
41622
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
41793
41623
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
41794
|
-
const normalizedInitialData =
|
|
41624
|
+
const normalizedInitialData = React87__default.useMemo(() => {
|
|
41795
41625
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
41796
41626
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
41797
41627
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
41798
41628
|
}, [entity, initialData]);
|
|
41799
|
-
const entityDerivedFields =
|
|
41629
|
+
const entityDerivedFields = React87__default.useMemo(() => {
|
|
41800
41630
|
if (fields && fields.length > 0) return void 0;
|
|
41801
41631
|
if (!resolvedEntity) return void 0;
|
|
41802
41632
|
return resolvedEntity.fields.map(
|
|
@@ -41817,16 +41647,16 @@ var init_Form = __esm({
|
|
|
41817
41647
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
41818
41648
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
41819
41649
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
41820
|
-
const [formData, setFormData] =
|
|
41650
|
+
const [formData, setFormData] = React87__default.useState(
|
|
41821
41651
|
normalizedInitialData
|
|
41822
41652
|
);
|
|
41823
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41653
|
+
const [collapsedSections, setCollapsedSections] = React87__default.useState(
|
|
41824
41654
|
/* @__PURE__ */ new Set()
|
|
41825
41655
|
);
|
|
41826
|
-
const [submitError, setSubmitError] =
|
|
41827
|
-
const formRef =
|
|
41656
|
+
const [submitError, setSubmitError] = React87__default.useState(null);
|
|
41657
|
+
const formRef = React87__default.useRef(null);
|
|
41828
41658
|
const formMode = props.mode;
|
|
41829
|
-
const mountedRef =
|
|
41659
|
+
const mountedRef = React87__default.useRef(false);
|
|
41830
41660
|
if (!mountedRef.current) {
|
|
41831
41661
|
mountedRef.current = true;
|
|
41832
41662
|
debug("forms", "mount", {
|
|
@@ -41839,7 +41669,7 @@ var init_Form = __esm({
|
|
|
41839
41669
|
});
|
|
41840
41670
|
}
|
|
41841
41671
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
41842
|
-
const evalContext =
|
|
41672
|
+
const evalContext = React87__default.useMemo(
|
|
41843
41673
|
() => ({
|
|
41844
41674
|
formValues: formData,
|
|
41845
41675
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -41848,7 +41678,7 @@ var init_Form = __esm({
|
|
|
41848
41678
|
}),
|
|
41849
41679
|
[formData, externalContext]
|
|
41850
41680
|
);
|
|
41851
|
-
|
|
41681
|
+
React87__default.useEffect(() => {
|
|
41852
41682
|
debug("forms", "initialData-sync", {
|
|
41853
41683
|
mode: formMode,
|
|
41854
41684
|
normalizedInitialData,
|
|
@@ -41859,7 +41689,7 @@ var init_Form = __esm({
|
|
|
41859
41689
|
setFormData(normalizedInitialData);
|
|
41860
41690
|
}
|
|
41861
41691
|
}, [normalizedInitialData]);
|
|
41862
|
-
const processCalculations =
|
|
41692
|
+
const processCalculations = React87__default.useCallback(
|
|
41863
41693
|
(changedFieldId, newFormData) => {
|
|
41864
41694
|
if (!hiddenCalculations.length) return;
|
|
41865
41695
|
const context = {
|
|
@@ -41884,7 +41714,7 @@ var init_Form = __esm({
|
|
|
41884
41714
|
},
|
|
41885
41715
|
[hiddenCalculations, externalContext, eventBus]
|
|
41886
41716
|
);
|
|
41887
|
-
const checkViolations =
|
|
41717
|
+
const checkViolations = React87__default.useCallback(
|
|
41888
41718
|
(changedFieldId, newFormData) => {
|
|
41889
41719
|
if (!violationTriggers.length) return;
|
|
41890
41720
|
const context = {
|
|
@@ -41922,7 +41752,7 @@ var init_Form = __esm({
|
|
|
41922
41752
|
processCalculations(name, newFormData);
|
|
41923
41753
|
checkViolations(name, newFormData);
|
|
41924
41754
|
};
|
|
41925
|
-
const isFieldVisible =
|
|
41755
|
+
const isFieldVisible = React87__default.useCallback(
|
|
41926
41756
|
(fieldName) => {
|
|
41927
41757
|
const condition = conditionalFields[fieldName];
|
|
41928
41758
|
if (!condition) return true;
|
|
@@ -41930,7 +41760,7 @@ var init_Form = __esm({
|
|
|
41930
41760
|
},
|
|
41931
41761
|
[conditionalFields, evalContext]
|
|
41932
41762
|
);
|
|
41933
|
-
const isSectionVisible =
|
|
41763
|
+
const isSectionVisible = React87__default.useCallback(
|
|
41934
41764
|
(section) => {
|
|
41935
41765
|
if (!section.condition) return true;
|
|
41936
41766
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42006,7 +41836,7 @@ var init_Form = __esm({
|
|
|
42006
41836
|
eventBus.emit(`UI:${onCancel}`);
|
|
42007
41837
|
}
|
|
42008
41838
|
};
|
|
42009
|
-
const renderField =
|
|
41839
|
+
const renderField = React87__default.useCallback(
|
|
42010
41840
|
(field) => {
|
|
42011
41841
|
const fieldName = field.name || field.field;
|
|
42012
41842
|
if (!fieldName) return null;
|
|
@@ -42027,7 +41857,7 @@ var init_Form = __esm({
|
|
|
42027
41857
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42028
41858
|
);
|
|
42029
41859
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42030
|
-
const normalizedFields =
|
|
41860
|
+
const normalizedFields = React87__default.useMemo(() => {
|
|
42031
41861
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42032
41862
|
return effectiveFields.map((field) => {
|
|
42033
41863
|
if (typeof field === "string") {
|
|
@@ -42051,7 +41881,7 @@ var init_Form = __esm({
|
|
|
42051
41881
|
return field;
|
|
42052
41882
|
});
|
|
42053
41883
|
}, [effectiveFields, resolvedEntity]);
|
|
42054
|
-
const schemaFields =
|
|
41884
|
+
const schemaFields = React87__default.useMemo(() => {
|
|
42055
41885
|
if (normalizedFields.length === 0) return null;
|
|
42056
41886
|
if (isDebugEnabled()) {
|
|
42057
41887
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42061,7 +41891,7 @@ var init_Form = __esm({
|
|
|
42061
41891
|
}
|
|
42062
41892
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42063
41893
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42064
|
-
const sectionElements =
|
|
41894
|
+
const sectionElements = React87__default.useMemo(() => {
|
|
42065
41895
|
if (!sections || sections.length === 0) return null;
|
|
42066
41896
|
return sections.map((section) => {
|
|
42067
41897
|
if (!isSectionVisible(section)) {
|
|
@@ -43582,7 +43412,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
43582
43412
|
className,
|
|
43583
43413
|
isLoading: externalLoading,
|
|
43584
43414
|
error: externalError,
|
|
43585
|
-
entity,
|
|
43586
43415
|
preloadAssets = [],
|
|
43587
43416
|
tileClickEvent,
|
|
43588
43417
|
unitClickEvent,
|
|
@@ -44318,7 +44147,7 @@ var init_GameBoard3D = __esm({
|
|
|
44318
44147
|
}
|
|
44319
44148
|
});
|
|
44320
44149
|
function asDescriptor(v) {
|
|
44321
|
-
if (Array.isArray(v) ||
|
|
44150
|
+
if (Array.isArray(v) || React87__default.isValidElement(v)) return null;
|
|
44322
44151
|
const o = v;
|
|
44323
44152
|
if (typeof o.type !== "string") return null;
|
|
44324
44153
|
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
@@ -44333,10 +44162,10 @@ function getSlotContentRenderer2() {
|
|
|
44333
44162
|
}
|
|
44334
44163
|
function resolveDescriptor(value, idPrefix) {
|
|
44335
44164
|
if (value === null || value === void 0) return value;
|
|
44336
|
-
if (
|
|
44165
|
+
if (React87__default.isValidElement(value)) return value;
|
|
44337
44166
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44338
44167
|
if (Array.isArray(value)) {
|
|
44339
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44168
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
44340
44169
|
}
|
|
44341
44170
|
if (typeof value === "object" && value !== null) {
|
|
44342
44171
|
const desc = asDescriptor(value);
|
|
@@ -44436,10 +44265,10 @@ function getSlotContentRenderer3() {
|
|
|
44436
44265
|
}
|
|
44437
44266
|
function resolveDescriptor2(value, idPrefix) {
|
|
44438
44267
|
if (value === null || value === void 0) return value;
|
|
44439
|
-
if (
|
|
44268
|
+
if (React87__default.isValidElement(value)) return value;
|
|
44440
44269
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44441
44270
|
if (Array.isArray(value)) {
|
|
44442
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44271
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React87__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
44443
44272
|
}
|
|
44444
44273
|
if (typeof value === "object") {
|
|
44445
44274
|
const rec = value;
|
|
@@ -45152,7 +44981,7 @@ var init_List = __esm({
|
|
|
45152
44981
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
45153
44982
|
return [];
|
|
45154
44983
|
}, [entity]);
|
|
45155
|
-
const getItemActions =
|
|
44984
|
+
const getItemActions = React87__default.useCallback(
|
|
45156
44985
|
(item) => {
|
|
45157
44986
|
if (!itemActions) return [];
|
|
45158
44987
|
if (typeof itemActions === "function") {
|
|
@@ -45669,7 +45498,7 @@ var init_MediaGallery = __esm({
|
|
|
45669
45498
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
45670
45499
|
);
|
|
45671
45500
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45672
|
-
const items =
|
|
45501
|
+
const items = React87__default.useMemo(() => {
|
|
45673
45502
|
if (propItems) return propItems;
|
|
45674
45503
|
if (entityData.length === 0) return [];
|
|
45675
45504
|
return entityData.map((record, idx) => {
|
|
@@ -45874,7 +45703,7 @@ var init_MinigolfBoard = __esm({
|
|
|
45874
45703
|
}
|
|
45875
45704
|
});
|
|
45876
45705
|
function extractTitle2(children) {
|
|
45877
|
-
if (!
|
|
45706
|
+
if (!React87__default.isValidElement(children)) return void 0;
|
|
45878
45707
|
const props = children.props;
|
|
45879
45708
|
if (typeof props.title === "string") {
|
|
45880
45709
|
return props.title;
|
|
@@ -47075,7 +46904,7 @@ var init_debugRegistry = __esm({
|
|
|
47075
46904
|
}
|
|
47076
46905
|
});
|
|
47077
46906
|
function useDebugData() {
|
|
47078
|
-
const [data, setData] =
|
|
46907
|
+
const [data, setData] = React87.useState(() => ({
|
|
47079
46908
|
traits: [],
|
|
47080
46909
|
ticks: [],
|
|
47081
46910
|
guards: [],
|
|
@@ -47089,7 +46918,7 @@ function useDebugData() {
|
|
|
47089
46918
|
},
|
|
47090
46919
|
lastUpdate: Date.now()
|
|
47091
46920
|
}));
|
|
47092
|
-
|
|
46921
|
+
React87.useEffect(() => {
|
|
47093
46922
|
const updateData = () => {
|
|
47094
46923
|
setData({
|
|
47095
46924
|
traits: getAllTraits(),
|
|
@@ -47198,12 +47027,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
47198
47027
|
return positions;
|
|
47199
47028
|
}
|
|
47200
47029
|
function WalkMinimap() {
|
|
47201
|
-
const [walkStep, setWalkStep] =
|
|
47202
|
-
const [traits2, setTraits] =
|
|
47203
|
-
const [coveredEdges, setCoveredEdges] =
|
|
47204
|
-
const [completedTraits, setCompletedTraits] =
|
|
47205
|
-
const prevTraitRef =
|
|
47206
|
-
|
|
47030
|
+
const [walkStep, setWalkStep] = React87.useState(null);
|
|
47031
|
+
const [traits2, setTraits] = React87.useState([]);
|
|
47032
|
+
const [coveredEdges, setCoveredEdges] = React87.useState([]);
|
|
47033
|
+
const [completedTraits, setCompletedTraits] = React87.useState(/* @__PURE__ */ new Set());
|
|
47034
|
+
const prevTraitRef = React87.useRef(null);
|
|
47035
|
+
React87.useEffect(() => {
|
|
47207
47036
|
const interval = setInterval(() => {
|
|
47208
47037
|
const w = window;
|
|
47209
47038
|
const step = w.__orbitalWalkStep;
|
|
@@ -47639,15 +47468,15 @@ var init_EntitiesTab = __esm({
|
|
|
47639
47468
|
});
|
|
47640
47469
|
function EventFlowTab({ events: events2 }) {
|
|
47641
47470
|
const { t } = useTranslate();
|
|
47642
|
-
const [filter, setFilter] =
|
|
47643
|
-
const containerRef =
|
|
47644
|
-
const [autoScroll, setAutoScroll] =
|
|
47645
|
-
|
|
47471
|
+
const [filter, setFilter] = React87.useState("all");
|
|
47472
|
+
const containerRef = React87.useRef(null);
|
|
47473
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
47474
|
+
React87.useEffect(() => {
|
|
47646
47475
|
if (autoScroll && containerRef.current) {
|
|
47647
47476
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
47648
47477
|
}
|
|
47649
47478
|
}, [events2.length, autoScroll]);
|
|
47650
|
-
const filteredEvents =
|
|
47479
|
+
const filteredEvents = React87.useMemo(() => {
|
|
47651
47480
|
if (filter === "all") return events2;
|
|
47652
47481
|
return events2.filter((e) => e.type === filter);
|
|
47653
47482
|
}, [events2, filter]);
|
|
@@ -47763,7 +47592,7 @@ var init_EventFlowTab = __esm({
|
|
|
47763
47592
|
});
|
|
47764
47593
|
function GuardsPanel({ guards }) {
|
|
47765
47594
|
const { t } = useTranslate();
|
|
47766
|
-
const [filter, setFilter] =
|
|
47595
|
+
const [filter, setFilter] = React87.useState("all");
|
|
47767
47596
|
if (guards.length === 0) {
|
|
47768
47597
|
return /* @__PURE__ */ jsx(
|
|
47769
47598
|
EmptyState,
|
|
@@ -47776,7 +47605,7 @@ function GuardsPanel({ guards }) {
|
|
|
47776
47605
|
}
|
|
47777
47606
|
const passedCount = guards.filter((g) => g.result).length;
|
|
47778
47607
|
const failedCount = guards.length - passedCount;
|
|
47779
|
-
const filteredGuards =
|
|
47608
|
+
const filteredGuards = React87.useMemo(() => {
|
|
47780
47609
|
if (filter === "all") return guards;
|
|
47781
47610
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
47782
47611
|
return guards.filter((g) => !g.result);
|
|
@@ -47939,10 +47768,10 @@ function EffectBadge({ effect }) {
|
|
|
47939
47768
|
}
|
|
47940
47769
|
function TransitionTimeline({ transitions }) {
|
|
47941
47770
|
const { t } = useTranslate();
|
|
47942
|
-
const containerRef =
|
|
47943
|
-
const [autoScroll, setAutoScroll] =
|
|
47944
|
-
const [expandedId, setExpandedId] =
|
|
47945
|
-
|
|
47771
|
+
const containerRef = React87.useRef(null);
|
|
47772
|
+
const [autoScroll, setAutoScroll] = React87.useState(true);
|
|
47773
|
+
const [expandedId, setExpandedId] = React87.useState(null);
|
|
47774
|
+
React87.useEffect(() => {
|
|
47946
47775
|
if (autoScroll && containerRef.current) {
|
|
47947
47776
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
47948
47777
|
}
|
|
@@ -48222,9 +48051,9 @@ function getAllEvents(traits2) {
|
|
|
48222
48051
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
48223
48052
|
const eventBus = useEventBus();
|
|
48224
48053
|
const { t } = useTranslate();
|
|
48225
|
-
const [log14, setLog] =
|
|
48226
|
-
const prevStatesRef =
|
|
48227
|
-
|
|
48054
|
+
const [log14, setLog] = React87.useState([]);
|
|
48055
|
+
const prevStatesRef = React87.useRef(/* @__PURE__ */ new Map());
|
|
48056
|
+
React87.useEffect(() => {
|
|
48228
48057
|
for (const trait of traits2) {
|
|
48229
48058
|
const prev = prevStatesRef.current.get(trait.id);
|
|
48230
48059
|
if (prev && prev !== trait.currentState) {
|
|
@@ -48393,10 +48222,10 @@ function VerifyModePanel({
|
|
|
48393
48222
|
localCount
|
|
48394
48223
|
}) {
|
|
48395
48224
|
const { t } = useTranslate();
|
|
48396
|
-
const [expanded, setExpanded] =
|
|
48397
|
-
const scrollRef =
|
|
48398
|
-
const prevCountRef =
|
|
48399
|
-
|
|
48225
|
+
const [expanded, setExpanded] = React87.useState(true);
|
|
48226
|
+
const scrollRef = React87.useRef(null);
|
|
48227
|
+
const prevCountRef = React87.useRef(0);
|
|
48228
|
+
React87.useEffect(() => {
|
|
48400
48229
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
48401
48230
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
48402
48231
|
}
|
|
@@ -48453,10 +48282,10 @@ function RuntimeDebugger({
|
|
|
48453
48282
|
schema
|
|
48454
48283
|
}) {
|
|
48455
48284
|
const { t } = useTranslate();
|
|
48456
|
-
const [isCollapsed, setIsCollapsed] =
|
|
48457
|
-
const [isVisible, setIsVisible] =
|
|
48285
|
+
const [isCollapsed, setIsCollapsed] = React87.useState(mode === "verify" ? true : defaultCollapsed);
|
|
48286
|
+
const [isVisible, setIsVisible] = React87.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
48458
48287
|
const debugData = useDebugData();
|
|
48459
|
-
|
|
48288
|
+
React87.useEffect(() => {
|
|
48460
48289
|
if (mode === "inline") return;
|
|
48461
48290
|
return onDebugToggle((enabled) => {
|
|
48462
48291
|
setIsVisible(enabled);
|
|
@@ -48465,7 +48294,7 @@ function RuntimeDebugger({
|
|
|
48465
48294
|
}
|
|
48466
48295
|
});
|
|
48467
48296
|
}, [mode]);
|
|
48468
|
-
|
|
48297
|
+
React87.useEffect(() => {
|
|
48469
48298
|
if (mode === "inline") return;
|
|
48470
48299
|
const handleKeyDown = (e) => {
|
|
48471
48300
|
if (e.key === "`" && isVisible) {
|
|
@@ -49025,7 +48854,7 @@ function SequenceBar({
|
|
|
49025
48854
|
onSlotRemove(index);
|
|
49026
48855
|
}, [onSlotRemove, playing]);
|
|
49027
48856
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
49028
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
48857
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React87__default.Fragment, { children: [
|
|
49029
48858
|
i > 0 && /* @__PURE__ */ jsx(
|
|
49030
48859
|
Typography,
|
|
49031
48860
|
{
|
|
@@ -50114,7 +49943,7 @@ var init_StatCard = __esm({
|
|
|
50114
49943
|
const labelToUse = propLabel ?? propTitle;
|
|
50115
49944
|
const eventBus = useEventBus();
|
|
50116
49945
|
const { t } = useTranslate();
|
|
50117
|
-
const handleActionClick =
|
|
49946
|
+
const handleActionClick = React87__default.useCallback(() => {
|
|
50118
49947
|
if (action?.event) {
|
|
50119
49948
|
eventBus.emit(`UI:${action.event}`, {});
|
|
50120
49949
|
}
|
|
@@ -50125,7 +49954,7 @@ var init_StatCard = __esm({
|
|
|
50125
49954
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
50126
49955
|
const isLoading = externalLoading ?? false;
|
|
50127
49956
|
const error = externalError;
|
|
50128
|
-
const computeMetricValue =
|
|
49957
|
+
const computeMetricValue = React87__default.useCallback(
|
|
50129
49958
|
(metric, items) => {
|
|
50130
49959
|
if (metric.value !== void 0) {
|
|
50131
49960
|
return metric.value;
|
|
@@ -50164,7 +49993,7 @@ var init_StatCard = __esm({
|
|
|
50164
49993
|
},
|
|
50165
49994
|
[]
|
|
50166
49995
|
);
|
|
50167
|
-
const schemaStats =
|
|
49996
|
+
const schemaStats = React87__default.useMemo(() => {
|
|
50168
49997
|
if (!metrics || metrics.length === 0) return null;
|
|
50169
49998
|
return metrics.map((metric) => ({
|
|
50170
49999
|
label: metric.label,
|
|
@@ -50172,7 +50001,7 @@ var init_StatCard = __esm({
|
|
|
50172
50001
|
format: metric.format
|
|
50173
50002
|
}));
|
|
50174
50003
|
}, [metrics, data, computeMetricValue]);
|
|
50175
|
-
const calculatedTrend =
|
|
50004
|
+
const calculatedTrend = React87__default.useMemo(() => {
|
|
50176
50005
|
if (manualTrend !== void 0) return manualTrend;
|
|
50177
50006
|
if (previousValue === void 0 || currentValue === void 0)
|
|
50178
50007
|
return void 0;
|
|
@@ -51378,8 +51207,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51378
51207
|
] });
|
|
51379
51208
|
};
|
|
51380
51209
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
51381
|
-
const endRef =
|
|
51382
|
-
|
|
51210
|
+
const endRef = React87__default.useRef(null);
|
|
51211
|
+
React87__default.useEffect(() => {
|
|
51383
51212
|
if (!autoScroll) return;
|
|
51384
51213
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51385
51214
|
}, [activities.length, autoScroll]);
|
|
@@ -51473,7 +51302,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
51473
51302
|
};
|
|
51474
51303
|
SubagentRichCard = ({ subagent }) => {
|
|
51475
51304
|
const { t } = useTranslate();
|
|
51476
|
-
const activities =
|
|
51305
|
+
const activities = React87__default.useMemo(
|
|
51477
51306
|
() => subagentMessagesToActivities(subagent.messages),
|
|
51478
51307
|
[subagent.messages]
|
|
51479
51308
|
);
|
|
@@ -51550,8 +51379,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51550
51379
|
] });
|
|
51551
51380
|
};
|
|
51552
51381
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
51553
|
-
const endRef =
|
|
51554
|
-
|
|
51382
|
+
const endRef = React87__default.useRef(null);
|
|
51383
|
+
React87__default.useEffect(() => {
|
|
51555
51384
|
if (!autoScroll) return;
|
|
51556
51385
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51557
51386
|
}, [messages.length, autoScroll]);
|
|
@@ -52023,7 +51852,7 @@ var init_Timeline = __esm({
|
|
|
52023
51852
|
}) => {
|
|
52024
51853
|
const { t } = useTranslate();
|
|
52025
51854
|
const entityData = entity ?? [];
|
|
52026
|
-
const items =
|
|
51855
|
+
const items = React87__default.useMemo(() => {
|
|
52027
51856
|
if (propItems) return propItems;
|
|
52028
51857
|
if (entityData.length === 0) return [];
|
|
52029
51858
|
return entityData.map((record, idx) => {
|
|
@@ -52125,7 +51954,7 @@ var init_Timeline = __esm({
|
|
|
52125
51954
|
}
|
|
52126
51955
|
});
|
|
52127
51956
|
function extractToastProps(children) {
|
|
52128
|
-
if (!
|
|
51957
|
+
if (!React87__default.isValidElement(children)) {
|
|
52129
51958
|
if (typeof children === "string") {
|
|
52130
51959
|
return { message: children };
|
|
52131
51960
|
}
|
|
@@ -52163,7 +51992,7 @@ var init_ToastSlot = __esm({
|
|
|
52163
51992
|
eventBus.emit("UI:CLOSE");
|
|
52164
51993
|
};
|
|
52165
51994
|
if (!isVisible) return null;
|
|
52166
|
-
const isCustomContent =
|
|
51995
|
+
const isCustomContent = React87__default.isValidElement(children) && !message;
|
|
52167
51996
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
52168
51997
|
Toast,
|
|
52169
51998
|
{
|
|
@@ -53780,7 +53609,7 @@ var init_WorldMapTemplate = __esm({
|
|
|
53780
53609
|
}
|
|
53781
53610
|
});
|
|
53782
53611
|
function lazyThree(name, loader) {
|
|
53783
|
-
const Lazy =
|
|
53612
|
+
const Lazy = React87__default.lazy(
|
|
53784
53613
|
() => loader().then((m) => {
|
|
53785
53614
|
const Resolved = m[name];
|
|
53786
53615
|
if (!Resolved) {
|
|
@@ -53792,13 +53621,13 @@ function lazyThree(name, loader) {
|
|
|
53792
53621
|
})
|
|
53793
53622
|
);
|
|
53794
53623
|
function ThreeWrapper(props) {
|
|
53795
|
-
return
|
|
53624
|
+
return React87__default.createElement(
|
|
53796
53625
|
ThreeBoundary,
|
|
53797
53626
|
{ name },
|
|
53798
|
-
|
|
53799
|
-
|
|
53627
|
+
React87__default.createElement(
|
|
53628
|
+
React87__default.Suspense,
|
|
53800
53629
|
{ fallback: null },
|
|
53801
|
-
|
|
53630
|
+
React87__default.createElement(Lazy, props)
|
|
53802
53631
|
)
|
|
53803
53632
|
);
|
|
53804
53633
|
}
|
|
@@ -54121,7 +53950,7 @@ var init_component_registry_generated = __esm({
|
|
|
54121
53950
|
init_WorldMapBoard();
|
|
54122
53951
|
init_WorldMapTemplate();
|
|
54123
53952
|
init_XPBar();
|
|
54124
|
-
ThreeBoundary = class extends
|
|
53953
|
+
ThreeBoundary = class extends React87__default.Component {
|
|
54125
53954
|
constructor() {
|
|
54126
53955
|
super(...arguments);
|
|
54127
53956
|
__publicField(this, "state", { failed: false });
|
|
@@ -54131,7 +53960,7 @@ var init_component_registry_generated = __esm({
|
|
|
54131
53960
|
}
|
|
54132
53961
|
render() {
|
|
54133
53962
|
if (this.state.failed) {
|
|
54134
|
-
return
|
|
53963
|
+
return React87__default.createElement(
|
|
54135
53964
|
"div",
|
|
54136
53965
|
{
|
|
54137
53966
|
"data-testid": "three-unavailable",
|
|
@@ -54497,7 +54326,7 @@ function SuspenseConfigProvider({
|
|
|
54497
54326
|
config,
|
|
54498
54327
|
children
|
|
54499
54328
|
}) {
|
|
54500
|
-
return
|
|
54329
|
+
return React87__default.createElement(
|
|
54501
54330
|
SuspenseConfigContext.Provider,
|
|
54502
54331
|
{ value: config },
|
|
54503
54332
|
children
|
|
@@ -54539,7 +54368,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54539
54368
|
}
|
|
54540
54369
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
54541
54370
|
}
|
|
54542
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
54371
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React87__default.isValidElement(field) && !(field instanceof Date)) {
|
|
54543
54372
|
const obj = field;
|
|
54544
54373
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
54545
54374
|
if (!fieldName) return field;
|
|
@@ -54985,7 +54814,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
54985
54814
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
54986
54815
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
54987
54816
|
}
|
|
54988
|
-
return /* @__PURE__ */ jsx(
|
|
54817
|
+
return /* @__PURE__ */ jsx(React87__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
54989
54818
|
}
|
|
54990
54819
|
if (!child || typeof child !== "object") return null;
|
|
54991
54820
|
const childId = `${parentId}-${index}`;
|
|
@@ -55025,14 +54854,14 @@ function isPatternConfig(value) {
|
|
|
55025
54854
|
if (value === null || value === void 0) return false;
|
|
55026
54855
|
if (typeof value !== "object") return false;
|
|
55027
54856
|
if (Array.isArray(value)) return false;
|
|
55028
|
-
if (
|
|
54857
|
+
if (React87__default.isValidElement(value)) return false;
|
|
55029
54858
|
if (value instanceof Date) return false;
|
|
55030
54859
|
if (typeof value === "function") return false;
|
|
55031
54860
|
const record = value;
|
|
55032
54861
|
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
55033
54862
|
}
|
|
55034
54863
|
function isPlainConfigObject(value) {
|
|
55035
|
-
if (
|
|
54864
|
+
if (React87__default.isValidElement(value)) return false;
|
|
55036
54865
|
if (value instanceof Date) return false;
|
|
55037
54866
|
const proto = Object.getPrototypeOf(value);
|
|
55038
54867
|
return proto === Object.prototype || proto === null;
|
|
@@ -55158,7 +54987,7 @@ function SlotContentRenderer({
|
|
|
55158
54987
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
55159
54988
|
const slotVal = restProps[slotKey];
|
|
55160
54989
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
55161
|
-
if (
|
|
54990
|
+
if (React87__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
55162
54991
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
55163
54992
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
55164
54993
|
slotVal,
|
|
@@ -55207,7 +55036,7 @@ function SlotContentRenderer({
|
|
|
55207
55036
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
55208
55037
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
55209
55038
|
const sample = resolvedItems[0];
|
|
55210
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
55039
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React87__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
55211
55040
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
55212
55041
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
55213
55042
|
}
|
|
@@ -55495,7 +55324,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
55495
55324
|
if (Array.isArray(body)) {
|
|
55496
55325
|
return body.map((b) => recur(b));
|
|
55497
55326
|
}
|
|
55498
|
-
if (body !== null && typeof body === "object" && !
|
|
55327
|
+
if (body !== null && typeof body === "object" && !React87__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
55499
55328
|
const out = {};
|
|
55500
55329
|
for (const [k, v] of Object.entries(body)) {
|
|
55501
55330
|
out[k] = recur(v);
|
|
@@ -55514,7 +55343,7 @@ function getSlotContentRenderer4() {
|
|
|
55514
55343
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
55515
55344
|
return (item, index) => {
|
|
55516
55345
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
55517
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
55346
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React87__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
55518
55347
|
return null;
|
|
55519
55348
|
}
|
|
55520
55349
|
const record = resolvedBody;
|
|
@@ -55533,7 +55362,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
55533
55362
|
props: childProps,
|
|
55534
55363
|
priority: 0
|
|
55535
55364
|
};
|
|
55536
|
-
return
|
|
55365
|
+
return React87__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
55537
55366
|
};
|
|
55538
55367
|
}
|
|
55539
55368
|
function convertNode(node, callerKey) {
|
|
@@ -55552,7 +55381,7 @@ function convertNode(node, callerKey) {
|
|
|
55552
55381
|
});
|
|
55553
55382
|
return anyChanged ? mapped : node;
|
|
55554
55383
|
}
|
|
55555
|
-
if (typeof node === "object" && !
|
|
55384
|
+
if (typeof node === "object" && !React87__default.isValidElement(node) && !(node instanceof Date)) {
|
|
55556
55385
|
return convertObjectProps(node);
|
|
55557
55386
|
}
|
|
55558
55387
|
return node;
|