@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/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React88 from 'react';
|
|
2
|
+
import React88__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore, forwardRef, useImperativeHandle, Component } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -403,7 +403,7 @@ var init_Box = __esm({
|
|
|
403
403
|
fixed: "fixed",
|
|
404
404
|
sticky: "sticky"
|
|
405
405
|
};
|
|
406
|
-
Box =
|
|
406
|
+
Box = React88__default.forwardRef(
|
|
407
407
|
({
|
|
408
408
|
padding,
|
|
409
409
|
paddingX,
|
|
@@ -468,7 +468,7 @@ var init_Box = __esm({
|
|
|
468
468
|
onPointerDown?.(e);
|
|
469
469
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
470
470
|
const isClickable = action || onClick;
|
|
471
|
-
return
|
|
471
|
+
return React88__default.createElement(
|
|
472
472
|
Component2,
|
|
473
473
|
{
|
|
474
474
|
ref,
|
|
@@ -564,7 +564,7 @@ function loadLib(key, importer) {
|
|
|
564
564
|
return p2;
|
|
565
565
|
}
|
|
566
566
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
567
|
-
const Lazy =
|
|
567
|
+
const Lazy = React88__default.lazy(async () => {
|
|
568
568
|
const lib = await loadLib(libKey, importer);
|
|
569
569
|
const Comp = pick(lib);
|
|
570
570
|
if (!Comp) {
|
|
@@ -574,7 +574,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
574
574
|
return { default: Comp };
|
|
575
575
|
});
|
|
576
576
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
577
|
-
|
|
577
|
+
React88__default.Suspense,
|
|
578
578
|
{
|
|
579
579
|
fallback: /* @__PURE__ */ jsx(
|
|
580
580
|
"span",
|
|
@@ -1301,7 +1301,7 @@ var init_Icon = __esm({
|
|
|
1301
1301
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1302
1302
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1303
1303
|
const family = useIconFamily();
|
|
1304
|
-
const RenderedComponent =
|
|
1304
|
+
const RenderedComponent = React88__default.useMemo(() => {
|
|
1305
1305
|
if (directIcon) return null;
|
|
1306
1306
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1307
1307
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1363,7 +1363,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1363
1363
|
const IconComp = value;
|
|
1364
1364
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1365
1365
|
}
|
|
1366
|
-
if (
|
|
1366
|
+
if (React88__default.isValidElement(value)) {
|
|
1367
1367
|
return value;
|
|
1368
1368
|
}
|
|
1369
1369
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1439,7 +1439,7 @@ var init_Button = __esm({
|
|
|
1439
1439
|
md: "h-icon-default w-icon-default",
|
|
1440
1440
|
lg: "h-icon-default w-icon-default"
|
|
1441
1441
|
};
|
|
1442
|
-
Button =
|
|
1442
|
+
Button = React88__default.forwardRef(
|
|
1443
1443
|
({
|
|
1444
1444
|
className,
|
|
1445
1445
|
variant = "primary",
|
|
@@ -1505,7 +1505,7 @@ var Dialog;
|
|
|
1505
1505
|
var init_Dialog = __esm({
|
|
1506
1506
|
"components/core/atoms/Dialog.tsx"() {
|
|
1507
1507
|
init_cn();
|
|
1508
|
-
Dialog =
|
|
1508
|
+
Dialog = React88__default.forwardRef(
|
|
1509
1509
|
({
|
|
1510
1510
|
role = "dialog",
|
|
1511
1511
|
"aria-modal": ariaModal = true,
|
|
@@ -1623,7 +1623,7 @@ var init_Typography = __esm({
|
|
|
1623
1623
|
}) => {
|
|
1624
1624
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1625
1625
|
const Component2 = as || defaultElements[variant];
|
|
1626
|
-
return
|
|
1626
|
+
return React88__default.createElement(
|
|
1627
1627
|
Component2,
|
|
1628
1628
|
{
|
|
1629
1629
|
id,
|
|
@@ -2118,7 +2118,7 @@ var init_Badge = __esm({
|
|
|
2118
2118
|
md: "px-2.5 py-1 text-sm",
|
|
2119
2119
|
lg: "px-3 py-1.5 text-base"
|
|
2120
2120
|
};
|
|
2121
|
-
Badge =
|
|
2121
|
+
Badge = React88__default.forwardRef(
|
|
2122
2122
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2123
2123
|
const iconSizes3 = {
|
|
2124
2124
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2454,7 +2454,7 @@ var init_SvgFlow = __esm({
|
|
|
2454
2454
|
width = 100,
|
|
2455
2455
|
height = 100
|
|
2456
2456
|
}) => {
|
|
2457
|
-
const markerId =
|
|
2457
|
+
const markerId = React88__default.useMemo(() => {
|
|
2458
2458
|
flowIdCounter += 1;
|
|
2459
2459
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2460
2460
|
}, []);
|
|
@@ -3047,7 +3047,7 @@ var init_SvgRing = __esm({
|
|
|
3047
3047
|
width = 100,
|
|
3048
3048
|
height = 100
|
|
3049
3049
|
}) => {
|
|
3050
|
-
const gradientId =
|
|
3050
|
+
const gradientId = React88__default.useMemo(() => {
|
|
3051
3051
|
ringIdCounter += 1;
|
|
3052
3052
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3053
3053
|
}, []);
|
|
@@ -3228,7 +3228,7 @@ var init_Input = __esm({
|
|
|
3228
3228
|
init_cn();
|
|
3229
3229
|
init_Icon();
|
|
3230
3230
|
init_useEventBus();
|
|
3231
|
-
Input =
|
|
3231
|
+
Input = React88__default.forwardRef(
|
|
3232
3232
|
({
|
|
3233
3233
|
className,
|
|
3234
3234
|
inputType,
|
|
@@ -3388,7 +3388,7 @@ var Label;
|
|
|
3388
3388
|
var init_Label = __esm({
|
|
3389
3389
|
"components/core/atoms/Label.tsx"() {
|
|
3390
3390
|
init_cn();
|
|
3391
|
-
Label =
|
|
3391
|
+
Label = React88__default.forwardRef(
|
|
3392
3392
|
({ className, required, children, ...props }, ref) => {
|
|
3393
3393
|
return /* @__PURE__ */ jsxs(
|
|
3394
3394
|
"label",
|
|
@@ -3415,7 +3415,7 @@ var init_Textarea = __esm({
|
|
|
3415
3415
|
"components/core/atoms/Textarea.tsx"() {
|
|
3416
3416
|
init_cn();
|
|
3417
3417
|
init_useEventBus();
|
|
3418
|
-
Textarea =
|
|
3418
|
+
Textarea = React88__default.forwardRef(
|
|
3419
3419
|
({ className, error, onChange, ...props }, ref) => {
|
|
3420
3420
|
const eventBus = useEventBus();
|
|
3421
3421
|
const handleChange = (e) => {
|
|
@@ -3654,7 +3654,7 @@ var init_Select = __esm({
|
|
|
3654
3654
|
init_cn();
|
|
3655
3655
|
init_Icon();
|
|
3656
3656
|
init_useEventBus();
|
|
3657
|
-
Select =
|
|
3657
|
+
Select = React88__default.forwardRef(
|
|
3658
3658
|
(props, _ref) => {
|
|
3659
3659
|
const { multiple, searchable, clearable } = props;
|
|
3660
3660
|
if (multiple || searchable || clearable) {
|
|
@@ -3671,7 +3671,7 @@ var init_Checkbox = __esm({
|
|
|
3671
3671
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3672
3672
|
init_cn();
|
|
3673
3673
|
init_useEventBus();
|
|
3674
|
-
Checkbox =
|
|
3674
|
+
Checkbox = React88__default.forwardRef(
|
|
3675
3675
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3676
3676
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3677
3677
|
const eventBus = useEventBus();
|
|
@@ -3725,7 +3725,7 @@ var init_Spinner = __esm({
|
|
|
3725
3725
|
md: "h-6 w-6",
|
|
3726
3726
|
lg: "h-8 w-8"
|
|
3727
3727
|
};
|
|
3728
|
-
Spinner =
|
|
3728
|
+
Spinner = React88__default.forwardRef(
|
|
3729
3729
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3730
3730
|
if (overlay) {
|
|
3731
3731
|
return /* @__PURE__ */ jsx(
|
|
@@ -3815,7 +3815,7 @@ var init_Card = __esm({
|
|
|
3815
3815
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3816
3816
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3817
3817
|
};
|
|
3818
|
-
Card =
|
|
3818
|
+
Card = React88__default.forwardRef(
|
|
3819
3819
|
({
|
|
3820
3820
|
className,
|
|
3821
3821
|
variant = "bordered",
|
|
@@ -3863,9 +3863,9 @@ var init_Card = __esm({
|
|
|
3863
3863
|
}
|
|
3864
3864
|
);
|
|
3865
3865
|
Card.displayName = "Card";
|
|
3866
|
-
CardHeader =
|
|
3866
|
+
CardHeader = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3867
3867
|
CardHeader.displayName = "CardHeader";
|
|
3868
|
-
CardTitle =
|
|
3868
|
+
CardTitle = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3869
3869
|
"h3",
|
|
3870
3870
|
{
|
|
3871
3871
|
ref,
|
|
@@ -3878,11 +3878,11 @@ var init_Card = __esm({
|
|
|
3878
3878
|
}
|
|
3879
3879
|
));
|
|
3880
3880
|
CardTitle.displayName = "CardTitle";
|
|
3881
|
-
CardContent =
|
|
3881
|
+
CardContent = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3882
3882
|
CardContent.displayName = "CardContent";
|
|
3883
3883
|
CardBody = CardContent;
|
|
3884
3884
|
CardBody.displayName = "CardBody";
|
|
3885
|
-
CardFooter =
|
|
3885
|
+
CardFooter = React88__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3886
3886
|
"div",
|
|
3887
3887
|
{
|
|
3888
3888
|
ref,
|
|
@@ -3937,7 +3937,7 @@ var init_FilterPill = __esm({
|
|
|
3937
3937
|
md: "w-3.5 h-3.5",
|
|
3938
3938
|
lg: "w-4 h-4"
|
|
3939
3939
|
};
|
|
3940
|
-
FilterPill =
|
|
3940
|
+
FilterPill = React88__default.forwardRef(
|
|
3941
3941
|
({
|
|
3942
3942
|
className,
|
|
3943
3943
|
variant = "default",
|
|
@@ -4066,8 +4066,8 @@ var init_Avatar = __esm({
|
|
|
4066
4066
|
actionPayload
|
|
4067
4067
|
}) => {
|
|
4068
4068
|
const eventBus = useEventBus();
|
|
4069
|
-
const [imgFailed, setImgFailed] =
|
|
4070
|
-
|
|
4069
|
+
const [imgFailed, setImgFailed] = React88__default.useState(false);
|
|
4070
|
+
React88__default.useEffect(() => {
|
|
4071
4071
|
setImgFailed(false);
|
|
4072
4072
|
}, [src]);
|
|
4073
4073
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4180,7 +4180,7 @@ var init_Center = __esm({
|
|
|
4180
4180
|
as: Component2 = "div"
|
|
4181
4181
|
}) => {
|
|
4182
4182
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4183
|
-
return
|
|
4183
|
+
return React88__default.createElement(Component2, {
|
|
4184
4184
|
className: cn(
|
|
4185
4185
|
inline ? "inline-flex" : "flex",
|
|
4186
4186
|
horizontal && "justify-center",
|
|
@@ -4448,7 +4448,7 @@ var init_Radio = __esm({
|
|
|
4448
4448
|
md: "w-2.5 h-2.5",
|
|
4449
4449
|
lg: "w-3 h-3"
|
|
4450
4450
|
};
|
|
4451
|
-
Radio =
|
|
4451
|
+
Radio = React88__default.forwardRef(
|
|
4452
4452
|
({
|
|
4453
4453
|
label,
|
|
4454
4454
|
helperText,
|
|
@@ -4465,12 +4465,12 @@ var init_Radio = __esm({
|
|
|
4465
4465
|
onChange,
|
|
4466
4466
|
...props
|
|
4467
4467
|
}, ref) => {
|
|
4468
|
-
const reactId =
|
|
4468
|
+
const reactId = React88__default.useId();
|
|
4469
4469
|
const baseId = id || `radio-${reactId}`;
|
|
4470
4470
|
const hasError = !!error;
|
|
4471
4471
|
const eventBus = useEventBus();
|
|
4472
|
-
const [selected, setSelected] =
|
|
4473
|
-
|
|
4472
|
+
const [selected, setSelected] = React88__default.useState(value);
|
|
4473
|
+
React88__default.useEffect(() => {
|
|
4474
4474
|
if (value !== void 0) setSelected(value);
|
|
4475
4475
|
}, [value]);
|
|
4476
4476
|
const pick = (next, e) => {
|
|
@@ -4652,7 +4652,7 @@ var init_Switch = __esm({
|
|
|
4652
4652
|
"components/core/atoms/Switch.tsx"() {
|
|
4653
4653
|
"use client";
|
|
4654
4654
|
init_cn();
|
|
4655
|
-
Switch =
|
|
4655
|
+
Switch = React88.forwardRef(
|
|
4656
4656
|
({
|
|
4657
4657
|
checked,
|
|
4658
4658
|
defaultChecked = false,
|
|
@@ -4663,10 +4663,10 @@ var init_Switch = __esm({
|
|
|
4663
4663
|
name,
|
|
4664
4664
|
className
|
|
4665
4665
|
}, ref) => {
|
|
4666
|
-
const [isChecked, setIsChecked] =
|
|
4666
|
+
const [isChecked, setIsChecked] = React88.useState(
|
|
4667
4667
|
checked !== void 0 ? checked : defaultChecked
|
|
4668
4668
|
);
|
|
4669
|
-
|
|
4669
|
+
React88.useEffect(() => {
|
|
4670
4670
|
if (checked !== void 0) {
|
|
4671
4671
|
setIsChecked(checked);
|
|
4672
4672
|
}
|
|
@@ -4825,7 +4825,7 @@ var init_Stack = __esm({
|
|
|
4825
4825
|
};
|
|
4826
4826
|
const isHorizontal = direction === "horizontal";
|
|
4827
4827
|
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";
|
|
4828
|
-
return
|
|
4828
|
+
return React88__default.createElement(
|
|
4829
4829
|
Component2,
|
|
4830
4830
|
{
|
|
4831
4831
|
className: cn(
|
|
@@ -5025,7 +5025,7 @@ var Aside;
|
|
|
5025
5025
|
var init_Aside = __esm({
|
|
5026
5026
|
"components/core/atoms/Aside.tsx"() {
|
|
5027
5027
|
init_cn();
|
|
5028
|
-
Aside =
|
|
5028
|
+
Aside = React88__default.forwardRef(
|
|
5029
5029
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5030
5030
|
);
|
|
5031
5031
|
Aside.displayName = "Aside";
|
|
@@ -5104,9 +5104,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5104
5104
|
className
|
|
5105
5105
|
}) => {
|
|
5106
5106
|
const { t } = useTranslate();
|
|
5107
|
-
const [isVisible, setIsVisible] =
|
|
5108
|
-
const timeoutRef =
|
|
5109
|
-
const triggerRef =
|
|
5107
|
+
const [isVisible, setIsVisible] = React88__default.useState(false);
|
|
5108
|
+
const timeoutRef = React88__default.useRef(null);
|
|
5109
|
+
const triggerRef = React88__default.useRef(null);
|
|
5110
5110
|
const handleMouseEnter = () => {
|
|
5111
5111
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5112
5112
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5117,7 +5117,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5117
5117
|
};
|
|
5118
5118
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5119
5119
|
const open = isVisible || revealed;
|
|
5120
|
-
|
|
5120
|
+
React88__default.useEffect(() => {
|
|
5121
5121
|
return () => {
|
|
5122
5122
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5123
5123
|
};
|
|
@@ -5329,7 +5329,7 @@ var init_StatusDot = __esm({
|
|
|
5329
5329
|
md: "w-2.5 h-2.5",
|
|
5330
5330
|
lg: "w-3 h-3"
|
|
5331
5331
|
};
|
|
5332
|
-
StatusDot =
|
|
5332
|
+
StatusDot = React88__default.forwardRef(
|
|
5333
5333
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5334
5334
|
return /* @__PURE__ */ jsx(
|
|
5335
5335
|
"span",
|
|
@@ -5383,7 +5383,7 @@ var init_TrendIndicator = __esm({
|
|
|
5383
5383
|
down: "trending-down",
|
|
5384
5384
|
flat: "arrow-right"
|
|
5385
5385
|
};
|
|
5386
|
-
TrendIndicator =
|
|
5386
|
+
TrendIndicator = React88__default.forwardRef(
|
|
5387
5387
|
({
|
|
5388
5388
|
className,
|
|
5389
5389
|
value,
|
|
@@ -5450,7 +5450,7 @@ var init_RangeSlider = __esm({
|
|
|
5450
5450
|
md: "w-4 h-4",
|
|
5451
5451
|
lg: "w-5 h-5"
|
|
5452
5452
|
};
|
|
5453
|
-
RangeSlider =
|
|
5453
|
+
RangeSlider = React88__default.forwardRef(
|
|
5454
5454
|
({
|
|
5455
5455
|
className,
|
|
5456
5456
|
min = 0,
|
|
@@ -5958,7 +5958,7 @@ var init_ContentSection = __esm({
|
|
|
5958
5958
|
md: "py-16",
|
|
5959
5959
|
lg: "py-24"
|
|
5960
5960
|
};
|
|
5961
|
-
ContentSection =
|
|
5961
|
+
ContentSection = React88__default.forwardRef(
|
|
5962
5962
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5963
5963
|
return /* @__PURE__ */ jsx(
|
|
5964
5964
|
Box,
|
|
@@ -6492,7 +6492,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6492
6492
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6493
6493
|
"none": {}
|
|
6494
6494
|
};
|
|
6495
|
-
AnimatedReveal =
|
|
6495
|
+
AnimatedReveal = React88__default.forwardRef(
|
|
6496
6496
|
({
|
|
6497
6497
|
trigger = "scroll",
|
|
6498
6498
|
animation = "fade-up",
|
|
@@ -6652,7 +6652,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6652
6652
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6653
6653
|
"use client";
|
|
6654
6654
|
init_cn();
|
|
6655
|
-
AnimatedGraphic =
|
|
6655
|
+
AnimatedGraphic = React88__default.forwardRef(
|
|
6656
6656
|
({
|
|
6657
6657
|
src,
|
|
6658
6658
|
svgContent,
|
|
@@ -6675,7 +6675,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6675
6675
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6676
6676
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6677
6677
|
const prevAnimateRef = useRef(animate);
|
|
6678
|
-
const setRef =
|
|
6678
|
+
const setRef = React88__default.useCallback(
|
|
6679
6679
|
(node) => {
|
|
6680
6680
|
containerRef.current = node;
|
|
6681
6681
|
if (typeof ref === "function") ref(node);
|
|
@@ -6897,43 +6897,16 @@ function ScoreDisplay({
|
|
|
6897
6897
|
icon,
|
|
6898
6898
|
size = "md",
|
|
6899
6899
|
className,
|
|
6900
|
-
animated = true,
|
|
6901
6900
|
locale = "en-US"
|
|
6902
6901
|
}) {
|
|
6903
6902
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof score === "number" && !Number.isNaN(score) ? score : 0;
|
|
6904
|
-
const
|
|
6905
|
-
const [isAnimating, setIsAnimating] = React90.useState(false);
|
|
6906
|
-
React90.useEffect(() => {
|
|
6907
|
-
if (!animated || displayValue === resolvedValue) {
|
|
6908
|
-
setDisplayValue(resolvedValue);
|
|
6909
|
-
return;
|
|
6910
|
-
}
|
|
6911
|
-
setIsAnimating(true);
|
|
6912
|
-
const diff = resolvedValue - displayValue;
|
|
6913
|
-
const steps = Math.min(Math.abs(diff), 20);
|
|
6914
|
-
const increment = diff / steps;
|
|
6915
|
-
let current = displayValue;
|
|
6916
|
-
let step = 0;
|
|
6917
|
-
const timer = setInterval(() => {
|
|
6918
|
-
step++;
|
|
6919
|
-
current += increment;
|
|
6920
|
-
setDisplayValue(Math.round(current));
|
|
6921
|
-
if (step >= steps) {
|
|
6922
|
-
clearInterval(timer);
|
|
6923
|
-
setDisplayValue(resolvedValue);
|
|
6924
|
-
setIsAnimating(false);
|
|
6925
|
-
}
|
|
6926
|
-
}, 50);
|
|
6927
|
-
return () => clearInterval(timer);
|
|
6928
|
-
}, [resolvedValue, animated]);
|
|
6929
|
-
const formattedValue = new Intl.NumberFormat(locale).format(displayValue);
|
|
6903
|
+
const formattedValue = new Intl.NumberFormat(locale).format(resolvedValue);
|
|
6930
6904
|
return /* @__PURE__ */ jsxs(
|
|
6931
6905
|
"div",
|
|
6932
6906
|
{
|
|
6933
6907
|
className: cn(
|
|
6934
6908
|
"flex items-center gap-2 font-bold",
|
|
6935
6909
|
sizeMap2[size],
|
|
6936
|
-
isAnimating && "animate-pulse",
|
|
6937
6910
|
className
|
|
6938
6911
|
),
|
|
6939
6912
|
children: [
|
|
@@ -6957,7 +6930,6 @@ function ScoreDisplay({
|
|
|
6957
6930
|
var sizeMap2, DEFAULT_ASSET_URL;
|
|
6958
6931
|
var init_ScoreDisplay = __esm({
|
|
6959
6932
|
"components/game/atoms/ScoreDisplay.tsx"() {
|
|
6960
|
-
"use client";
|
|
6961
6933
|
init_cn();
|
|
6962
6934
|
init_Icon();
|
|
6963
6935
|
sizeMap2 = {
|
|
@@ -6986,9 +6958,9 @@ function ControlButton({
|
|
|
6986
6958
|
className
|
|
6987
6959
|
}) {
|
|
6988
6960
|
const eventBus = useEventBus();
|
|
6989
|
-
const [isPressed, setIsPressed] =
|
|
6961
|
+
const [isPressed, setIsPressed] = React88.useState(false);
|
|
6990
6962
|
const actualPressed = pressed ?? isPressed;
|
|
6991
|
-
const handlePointerDown =
|
|
6963
|
+
const handlePointerDown = React88.useCallback(
|
|
6992
6964
|
(e) => {
|
|
6993
6965
|
e.preventDefault();
|
|
6994
6966
|
if (disabled) return;
|
|
@@ -6998,7 +6970,7 @@ function ControlButton({
|
|
|
6998
6970
|
},
|
|
6999
6971
|
[disabled, pressEvent, eventBus, onPress]
|
|
7000
6972
|
);
|
|
7001
|
-
const handlePointerUp =
|
|
6973
|
+
const handlePointerUp = React88.useCallback(
|
|
7002
6974
|
(e) => {
|
|
7003
6975
|
e.preventDefault();
|
|
7004
6976
|
if (disabled) return;
|
|
@@ -7008,7 +6980,7 @@ function ControlButton({
|
|
|
7008
6980
|
},
|
|
7009
6981
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7010
6982
|
);
|
|
7011
|
-
const handlePointerLeave =
|
|
6983
|
+
const handlePointerLeave = React88.useCallback(
|
|
7012
6984
|
(e) => {
|
|
7013
6985
|
if (isPressed) {
|
|
7014
6986
|
setIsPressed(false);
|
|
@@ -7096,13 +7068,6 @@ var init_spriteSheetConstants = __esm({
|
|
|
7096
7068
|
});
|
|
7097
7069
|
|
|
7098
7070
|
// components/game/organisms/utils/spriteAnimation.ts
|
|
7099
|
-
function inferDirection(dx, dy) {
|
|
7100
|
-
if (dx === 0 && dy === 0) return "se";
|
|
7101
|
-
if (dx >= 0 && dy >= 0) return "se";
|
|
7102
|
-
if (dx <= 0 && dy >= 0) return "sw";
|
|
7103
|
-
if (dx >= 0 && dy <= 0) return "ne";
|
|
7104
|
-
return "nw";
|
|
7105
|
-
}
|
|
7106
7071
|
function resolveSheetDirection(facing) {
|
|
7107
7072
|
switch (facing) {
|
|
7108
7073
|
case "se":
|
|
@@ -7123,19 +7088,6 @@ function frameRect(frame, row, columns, frameWidth, frameHeight) {
|
|
|
7123
7088
|
sh: frameHeight
|
|
7124
7089
|
};
|
|
7125
7090
|
}
|
|
7126
|
-
function getCurrentFrameFromDef(def, elapsed) {
|
|
7127
|
-
const frameDuration = 1e3 / def.frameRate;
|
|
7128
|
-
const totalDuration = def.frames * frameDuration;
|
|
7129
|
-
if (def.loop) {
|
|
7130
|
-
const frame2 = Math.floor(elapsed % totalDuration / frameDuration);
|
|
7131
|
-
return { frame: frame2, finished: false };
|
|
7132
|
-
}
|
|
7133
|
-
if (elapsed >= totalDuration) {
|
|
7134
|
-
return { frame: def.frames - 1, finished: true };
|
|
7135
|
-
}
|
|
7136
|
-
const frame = Math.floor(elapsed / frameDuration);
|
|
7137
|
-
return { frame, finished: false };
|
|
7138
|
-
}
|
|
7139
7091
|
var init_spriteAnimation = __esm({
|
|
7140
7092
|
"components/game/organisms/utils/spriteAnimation.ts"() {
|
|
7141
7093
|
}
|
|
@@ -7154,6 +7106,8 @@ function Sprite({
|
|
|
7154
7106
|
opacity = 1,
|
|
7155
7107
|
zIndex = 0,
|
|
7156
7108
|
columns = 16,
|
|
7109
|
+
animState: _animState,
|
|
7110
|
+
frameRate: _frameRate,
|
|
7157
7111
|
className,
|
|
7158
7112
|
onClick,
|
|
7159
7113
|
action
|
|
@@ -7637,21 +7591,6 @@ function XPBar({
|
|
|
7637
7591
|
}) {
|
|
7638
7592
|
const sizes = sizeMap9[size];
|
|
7639
7593
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7640
|
-
const [fillWidth, setFillWidth] = React90.useState(animated ? 0 : percentage);
|
|
7641
|
-
React90.useEffect(() => {
|
|
7642
|
-
if (!animated) {
|
|
7643
|
-
setFillWidth(percentage);
|
|
7644
|
-
return;
|
|
7645
|
-
}
|
|
7646
|
-
let frame2;
|
|
7647
|
-
const frame1 = requestAnimationFrame(() => {
|
|
7648
|
-
frame2 = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7649
|
-
});
|
|
7650
|
-
return () => {
|
|
7651
|
-
cancelAnimationFrame(frame1);
|
|
7652
|
-
cancelAnimationFrame(frame2);
|
|
7653
|
-
};
|
|
7654
|
-
}, [animated, percentage]);
|
|
7655
7594
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7656
7595
|
level != null && /* @__PURE__ */ jsxs(
|
|
7657
7596
|
"span",
|
|
@@ -7683,7 +7622,7 @@ function XPBar({
|
|
|
7683
7622
|
"bg-gradient-to-r from-accent to-info",
|
|
7684
7623
|
animated && "transition-all duration-500 ease-out"
|
|
7685
7624
|
),
|
|
7686
|
-
style: { width: `${
|
|
7625
|
+
style: { width: `${percentage}%` }
|
|
7687
7626
|
}
|
|
7688
7627
|
)
|
|
7689
7628
|
}
|
|
@@ -7700,7 +7639,6 @@ function XPBar({
|
|
|
7700
7639
|
var sizeMap9;
|
|
7701
7640
|
var init_XPBar = __esm({
|
|
7702
7641
|
"components/game/atoms/XPBar.tsx"() {
|
|
7703
|
-
"use client";
|
|
7704
7642
|
init_cn();
|
|
7705
7643
|
sizeMap9 = {
|
|
7706
7644
|
sm: { bar: "h-2", text: "text-xs", badge: "text-xs px-1.5 py-0.5" },
|
|
@@ -8146,9 +8084,9 @@ function MiniMap({
|
|
|
8146
8084
|
viewportRect = DEFAULT_VIEWPORT,
|
|
8147
8085
|
className
|
|
8148
8086
|
}) {
|
|
8149
|
-
const canvasRef =
|
|
8150
|
-
const frameRef =
|
|
8151
|
-
|
|
8087
|
+
const canvasRef = React88.useRef(null);
|
|
8088
|
+
const frameRef = React88.useRef(0);
|
|
8089
|
+
React88.useEffect(() => {
|
|
8152
8090
|
const canvas = canvasRef.current;
|
|
8153
8091
|
if (!canvas) return;
|
|
8154
8092
|
const ctx = canvas.getContext("2d");
|
|
@@ -8337,7 +8275,7 @@ var init_ErrorBoundary = __esm({
|
|
|
8337
8275
|
}
|
|
8338
8276
|
);
|
|
8339
8277
|
};
|
|
8340
|
-
ErrorBoundary = class extends
|
|
8278
|
+
ErrorBoundary = class extends React88__default.Component {
|
|
8341
8279
|
constructor(props) {
|
|
8342
8280
|
super(props);
|
|
8343
8281
|
__publicField(this, "reset", () => {
|
|
@@ -9004,7 +8942,7 @@ var init_Container = __esm({
|
|
|
9004
8942
|
as: Component2 = "div"
|
|
9005
8943
|
}) => {
|
|
9006
8944
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
9007
|
-
return
|
|
8945
|
+
return React88__default.createElement(
|
|
9008
8946
|
Component2,
|
|
9009
8947
|
{
|
|
9010
8948
|
className: cn(
|
|
@@ -9727,8 +9665,8 @@ function ActionButtons({
|
|
|
9727
9665
|
disabled
|
|
9728
9666
|
}) {
|
|
9729
9667
|
const eventBus = useEventBus();
|
|
9730
|
-
const [activeButtons, setActiveButtons] =
|
|
9731
|
-
const handlePress =
|
|
9668
|
+
const [activeButtons, setActiveButtons] = React88.useState(/* @__PURE__ */ new Set());
|
|
9669
|
+
const handlePress = React88.useCallback(
|
|
9732
9670
|
(id) => {
|
|
9733
9671
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9734
9672
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9736,7 +9674,7 @@ function ActionButtons({
|
|
|
9736
9674
|
},
|
|
9737
9675
|
[actionEvent, eventBus, onAction]
|
|
9738
9676
|
);
|
|
9739
|
-
const handleRelease =
|
|
9677
|
+
const handleRelease = React88.useCallback(
|
|
9740
9678
|
(id) => {
|
|
9741
9679
|
setActiveButtons((prev) => {
|
|
9742
9680
|
const next = new Set(prev);
|
|
@@ -10566,50 +10504,6 @@ var init_AuthLayout = __esm({
|
|
|
10566
10504
|
AuthLayout.displayName = "AuthLayout";
|
|
10567
10505
|
}
|
|
10568
10506
|
});
|
|
10569
|
-
var LoadingState;
|
|
10570
|
-
var init_LoadingState = __esm({
|
|
10571
|
-
"components/core/molecules/LoadingState.tsx"() {
|
|
10572
|
-
"use client";
|
|
10573
|
-
init_cn();
|
|
10574
|
-
init_atoms2();
|
|
10575
|
-
init_Stack();
|
|
10576
|
-
init_Typography();
|
|
10577
|
-
LoadingState = ({
|
|
10578
|
-
title,
|
|
10579
|
-
message,
|
|
10580
|
-
className
|
|
10581
|
-
}) => {
|
|
10582
|
-
const { t } = useTranslate();
|
|
10583
|
-
const displayMessage = message ?? t("common.loading");
|
|
10584
|
-
return /* @__PURE__ */ jsxs(
|
|
10585
|
-
VStack,
|
|
10586
|
-
{
|
|
10587
|
-
align: "center",
|
|
10588
|
-
className: cn(
|
|
10589
|
-
"justify-center py-12",
|
|
10590
|
-
className
|
|
10591
|
-
),
|
|
10592
|
-
children: [
|
|
10593
|
-
/* @__PURE__ */ jsx(Spinner, { size: "lg" }),
|
|
10594
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "h3", className: "mt-4 text-lg font-semibold text-foreground", children: title }),
|
|
10595
|
-
/* @__PURE__ */ jsx(
|
|
10596
|
-
Typography,
|
|
10597
|
-
{
|
|
10598
|
-
variant: "small",
|
|
10599
|
-
className: cn(
|
|
10600
|
-
"text-muted-foreground",
|
|
10601
|
-
title ? "mt-2" : "mt-4"
|
|
10602
|
-
),
|
|
10603
|
-
children: displayMessage
|
|
10604
|
-
}
|
|
10605
|
-
)
|
|
10606
|
-
]
|
|
10607
|
-
}
|
|
10608
|
-
);
|
|
10609
|
-
};
|
|
10610
|
-
LoadingState.displayName = "LoadingState";
|
|
10611
|
-
}
|
|
10612
|
-
});
|
|
10613
10507
|
function getState() {
|
|
10614
10508
|
if (typeof window !== "undefined") {
|
|
10615
10509
|
const w = window;
|
|
@@ -11127,9 +11021,6 @@ function useUnitSpriteAtlas(units) {
|
|
|
11127
11021
|
const loadingRef = useRef(/* @__PURE__ */ new Set());
|
|
11128
11022
|
const [pendingCount, setPendingCount] = useState(0);
|
|
11129
11023
|
const [, forceTick] = useState(0);
|
|
11130
|
-
const animStatesRef = useRef(/* @__PURE__ */ new Map());
|
|
11131
|
-
const lastTickRef = useRef(0);
|
|
11132
|
-
const rafRef = useRef(0);
|
|
11133
11024
|
const atlasUrls = useMemo(() => {
|
|
11134
11025
|
const set = /* @__PURE__ */ new Set();
|
|
11135
11026
|
for (const unit of units) {
|
|
@@ -11175,54 +11066,6 @@ function useUnitSpriteAtlas(units) {
|
|
|
11175
11066
|
}
|
|
11176
11067
|
return [...urls];
|
|
11177
11068
|
}, [units, pendingCount]);
|
|
11178
|
-
useEffect(() => {
|
|
11179
|
-
const hasAtlasUnits = units.some((u) => unitAtlasUrl(u) !== null);
|
|
11180
|
-
if (!hasAtlasUnits) return;
|
|
11181
|
-
let running = true;
|
|
11182
|
-
const tick = (ts) => {
|
|
11183
|
-
if (!running) return;
|
|
11184
|
-
const last = lastTickRef.current || ts;
|
|
11185
|
-
const delta = ts - last;
|
|
11186
|
-
lastTickRef.current = ts;
|
|
11187
|
-
const states = animStatesRef.current;
|
|
11188
|
-
const currentIds = /* @__PURE__ */ new Set();
|
|
11189
|
-
for (const unit of units) {
|
|
11190
|
-
if (unitAtlasUrl(unit) === null) continue;
|
|
11191
|
-
currentIds.add(unit.id);
|
|
11192
|
-
let state = states.get(unit.id);
|
|
11193
|
-
if (!state) {
|
|
11194
|
-
state = { animation: "idle", direction: "se", elapsed: 0, walkHold: 0, prev: null };
|
|
11195
|
-
states.set(unit.id, state);
|
|
11196
|
-
}
|
|
11197
|
-
const posX = unit.position?.x ?? unit.x ?? 0;
|
|
11198
|
-
const posY = unit.position?.y ?? unit.y ?? 0;
|
|
11199
|
-
if (state.prev) {
|
|
11200
|
-
const dx = posX - state.prev.x;
|
|
11201
|
-
const dy = posY - state.prev.y;
|
|
11202
|
-
if (dx !== 0 || dy !== 0) {
|
|
11203
|
-
state.animation = "walk";
|
|
11204
|
-
state.direction = inferDirection(dx, dy);
|
|
11205
|
-
state.walkHold = WALK_HOLD_MS;
|
|
11206
|
-
} else if (state.animation === "walk") {
|
|
11207
|
-
state.walkHold -= delta;
|
|
11208
|
-
if (state.walkHold <= 0) state.animation = "idle";
|
|
11209
|
-
}
|
|
11210
|
-
}
|
|
11211
|
-
state.prev = { x: posX, y: posY };
|
|
11212
|
-
state.elapsed += delta;
|
|
11213
|
-
}
|
|
11214
|
-
for (const id of states.keys()) {
|
|
11215
|
-
if (!currentIds.has(id)) states.delete(id);
|
|
11216
|
-
}
|
|
11217
|
-
rafRef.current = requestAnimationFrame(tick);
|
|
11218
|
-
};
|
|
11219
|
-
rafRef.current = requestAnimationFrame(tick);
|
|
11220
|
-
return () => {
|
|
11221
|
-
running = false;
|
|
11222
|
-
cancelAnimationFrame(rafRef.current);
|
|
11223
|
-
lastTickRef.current = 0;
|
|
11224
|
-
};
|
|
11225
|
-
}, [units]);
|
|
11226
11069
|
const resolveUnitFrame = useCallback((unitId) => {
|
|
11227
11070
|
const unit = units.find((u) => u.id === unitId);
|
|
11228
11071
|
if (!unit) return null;
|
|
@@ -11230,18 +11073,14 @@ function useUnitSpriteAtlas(units) {
|
|
|
11230
11073
|
if (!atlasUrl) return null;
|
|
11231
11074
|
const atlas = atlasCacheRef.current.get(atlasUrl);
|
|
11232
11075
|
if (!atlas) return null;
|
|
11233
|
-
const
|
|
11234
|
-
const
|
|
11235
|
-
const direction = state?.direction ?? "se";
|
|
11236
|
-
const elapsed = state?.elapsed ?? 0;
|
|
11076
|
+
const animation = unit.animation ?? "idle";
|
|
11077
|
+
const frame = unit.frame ?? 0;
|
|
11237
11078
|
const def = atlas.animations[animation] ?? atlas.animations.idle;
|
|
11238
11079
|
if (!def) return null;
|
|
11239
|
-
const { sheetDir, flipX } = resolveSheetDirection(
|
|
11080
|
+
const { sheetDir, flipX } = resolveSheetDirection("se");
|
|
11240
11081
|
const rel = atlas.sheets[sheetDir] ?? atlas.sheets.se ?? atlas.sheets.sw;
|
|
11241
11082
|
if (!rel) return null;
|
|
11242
11083
|
const sheetUrl = resolveSheetUrl(atlasUrl, rel);
|
|
11243
|
-
const isIdle = animation === "idle";
|
|
11244
|
-
const frame = isIdle ? 0 : getCurrentFrameFromDef(def, elapsed).frame;
|
|
11245
11084
|
const rect = frameRect(frame, def.row, atlas.columns, atlas.frameWidth, atlas.frameHeight);
|
|
11246
11085
|
return {
|
|
11247
11086
|
sheetUrl,
|
|
@@ -11250,17 +11089,15 @@ function useUnitSpriteAtlas(units) {
|
|
|
11250
11089
|
sw: rect.sw,
|
|
11251
11090
|
sh: rect.sh,
|
|
11252
11091
|
flipX,
|
|
11253
|
-
applyBreathing:
|
|
11092
|
+
applyBreathing: animation === "idle"
|
|
11254
11093
|
};
|
|
11255
11094
|
}, [units]);
|
|
11256
11095
|
return { sheetUrls, resolveUnitFrame, pendingCount };
|
|
11257
11096
|
}
|
|
11258
|
-
var WALK_HOLD_MS;
|
|
11259
11097
|
var init_useUnitSpriteAtlas = __esm({
|
|
11260
11098
|
"components/game/molecules/useUnitSpriteAtlas.ts"() {
|
|
11261
11099
|
"use client";
|
|
11262
11100
|
init_spriteAnimation();
|
|
11263
|
-
WALK_HOLD_MS = 600;
|
|
11264
11101
|
}
|
|
11265
11102
|
});
|
|
11266
11103
|
|
|
@@ -11328,6 +11165,7 @@ function IsometricCanvas({
|
|
|
11328
11165
|
tiles: _tilesPropRaw = [],
|
|
11329
11166
|
units: _unitsPropRaw = [],
|
|
11330
11167
|
features: _featuresPropRaw = [],
|
|
11168
|
+
effects: _effectsPropRaw = [],
|
|
11331
11169
|
// Interaction state
|
|
11332
11170
|
selectedUnitId = null,
|
|
11333
11171
|
validMoves = [],
|
|
@@ -11360,7 +11198,7 @@ function IsometricCanvas({
|
|
|
11360
11198
|
resolveUnitFrame,
|
|
11361
11199
|
effectSpriteUrls = [],
|
|
11362
11200
|
onDrawEffects,
|
|
11363
|
-
hasActiveEffects:
|
|
11201
|
+
hasActiveEffects: _hasActiveEffects = false,
|
|
11364
11202
|
// Tuning
|
|
11365
11203
|
diamondTopY: diamondTopYProp,
|
|
11366
11204
|
// Remote asset loading
|
|
@@ -11370,13 +11208,12 @@ function IsometricCanvas({
|
|
|
11370
11208
|
const tilesProp = Array.isArray(_tilesPropRaw) ? _tilesPropRaw : [];
|
|
11371
11209
|
const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
|
|
11372
11210
|
const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
|
|
11211
|
+
const effects = Array.isArray(_effectsPropRaw) ? _effectsPropRaw : [];
|
|
11373
11212
|
const eventBus = useEventBus();
|
|
11374
11213
|
const { t } = useTranslate();
|
|
11375
11214
|
const canvasRef = useRef(null);
|
|
11376
11215
|
const containerRef = useRef(null);
|
|
11377
|
-
const
|
|
11378
|
-
const animTimeRef = useRef(0);
|
|
11379
|
-
const rafIdRef = useRef(0);
|
|
11216
|
+
const lerpRafRef = useRef(0);
|
|
11380
11217
|
const [viewportSize, setViewportSize] = useState({ width: 800, height: 600 });
|
|
11381
11218
|
useEffect(() => {
|
|
11382
11219
|
const el = containerRef.current;
|
|
@@ -11400,7 +11237,7 @@ function IsometricCanvas({
|
|
|
11400
11237
|
() => unitsProp.map((u) => u.position ? u : { ...u, position: { x: u.x ?? 0, y: u.y ?? 0 } }),
|
|
11401
11238
|
[unitsProp]
|
|
11402
11239
|
);
|
|
11403
|
-
const { sheetUrls: atlasSheetUrls, resolveUnitFrame: resolveUnitFrameInternal
|
|
11240
|
+
const { sheetUrls: atlasSheetUrls, resolveUnitFrame: resolveUnitFrameInternal } = useUnitSpriteAtlas(units);
|
|
11404
11241
|
const resolveFrameForUnit = useCallback((unitId) => {
|
|
11405
11242
|
return resolveUnitFrame?.(unitId) ?? resolveUnitFrameInternal(unitId);
|
|
11406
11243
|
}, [resolveUnitFrame, resolveUnitFrameInternal]);
|
|
@@ -11495,7 +11332,7 @@ function IsometricCanvas({
|
|
|
11495
11332
|
if (backgroundImage) urls.push(backgroundImage);
|
|
11496
11333
|
return [...new Set(urls.filter(Boolean))];
|
|
11497
11334
|
}, [sortedTiles, features, units, getTerrainSprite, getFeatureSprite, getUnitSprite, effectSpriteUrls, atlasSheetUrls, backgroundImage, assetManifest, resolveManifestUrl7]);
|
|
11498
|
-
const { getImage, pendingCount } = useImageCache(spriteUrls);
|
|
11335
|
+
const { getImage, pendingCount: _imagePendingCount } = useImageCache(spriteUrls);
|
|
11499
11336
|
useEffect(() => {
|
|
11500
11337
|
if (typeof window === "undefined") return;
|
|
11501
11338
|
const canvas = canvasRef.current;
|
|
@@ -11527,63 +11364,26 @@ function IsometricCanvas({
|
|
|
11527
11364
|
const resolveUnitSpriteUrl = useCallback((unit) => {
|
|
11528
11365
|
return unit.sprite || getUnitSprite?.(unit) || (unit.unitType ? resolveManifestUrl7(assetManifest?.units?.[unit.unitType]) : void 0);
|
|
11529
11366
|
}, [getUnitSprite, assetManifest, resolveManifestUrl7]);
|
|
11530
|
-
const
|
|
11531
|
-
if (!showMinimap) return;
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
|
|
11536
|
-
|
|
11537
|
-
|
|
11538
|
-
|
|
11539
|
-
|
|
11540
|
-
|
|
11541
|
-
|
|
11542
|
-
|
|
11543
|
-
|
|
11544
|
-
|
|
11545
|
-
|
|
11546
|
-
|
|
11547
|
-
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
const offsetMx = (mW - worldW * scaleM) / 2;
|
|
11551
|
-
const offsetMy = (mH - worldH * scaleM) / 2;
|
|
11552
|
-
for (const tile of sortedTiles) {
|
|
11553
|
-
const pos = isoToScreen(tile.x, tile.y, scale, baseOffsetX, tileLayout);
|
|
11554
|
-
const mx = (pos.x - minX) * scaleM + offsetMx;
|
|
11555
|
-
const my = (pos.y - minY) * scaleM + offsetMy;
|
|
11556
|
-
const mTileW = scaledTileWidth * scaleM;
|
|
11557
|
-
const mFloorH = scaledFloorHeight * scaleM;
|
|
11558
|
-
mCtx.fillStyle = tile.terrain === "water" ? "#3b82f6" : tile.terrain === "mountain" ? "#78716c" : "#4ade80";
|
|
11559
|
-
mCtx.beginPath();
|
|
11560
|
-
mCtx.moveTo(mx + mTileW / 2, my);
|
|
11561
|
-
mCtx.lineTo(mx + mTileW, my + mFloorH / 2);
|
|
11562
|
-
mCtx.lineTo(mx + mTileW / 2, my + mFloorH);
|
|
11563
|
-
mCtx.lineTo(mx, my + mFloorH / 2);
|
|
11564
|
-
mCtx.closePath();
|
|
11565
|
-
mCtx.fill();
|
|
11566
|
-
}
|
|
11567
|
-
for (const unit of units) {
|
|
11568
|
-
if (!unit.position) continue;
|
|
11569
|
-
const pos = isoToScreen(unit.position.x, unit.position.y, scale, baseOffsetX, tileLayout);
|
|
11570
|
-
const mx = (pos.x + scaledTileWidth / 2 - minX) * scaleM + offsetMx;
|
|
11571
|
-
const my = (pos.y + scaledTileHeight / 2 - minY) * scaleM + offsetMy;
|
|
11572
|
-
mCtx.fillStyle = unit.team === "player" ? "#60a5fa" : unit.team === "enemy" ? "#f87171" : "#9ca3af";
|
|
11573
|
-
mCtx.beginPath();
|
|
11574
|
-
mCtx.arc(mx, my, 3, 0, Math.PI * 2);
|
|
11575
|
-
mCtx.fill();
|
|
11576
|
-
}
|
|
11577
|
-
const cam = cameraRef.current;
|
|
11578
|
-
const vLeft = (cam.x - minX) * scaleM + offsetMx;
|
|
11579
|
-
const vTop = (cam.y - minY) * scaleM + offsetMy;
|
|
11580
|
-
const vW = viewportSize.width / cam.zoom * scaleM;
|
|
11581
|
-
const vH = viewportSize.height / cam.zoom * scaleM;
|
|
11582
|
-
mCtx.strokeStyle = "rgba(255, 255, 255, 0.8)";
|
|
11583
|
-
mCtx.lineWidth = 1;
|
|
11584
|
-
mCtx.strokeRect(vLeft, vTop, vW, vH);
|
|
11585
|
-
}, [showMinimap, sortedTiles, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledTileHeight, scaledFloorHeight, viewportSize, cameraRef]);
|
|
11586
|
-
const draw = useCallback((animTime) => {
|
|
11367
|
+
const miniMapTiles = useMemo(() => {
|
|
11368
|
+
if (!showMinimap) return [];
|
|
11369
|
+
return sortedTiles.map((t2) => ({
|
|
11370
|
+
x: t2.x,
|
|
11371
|
+
y: t2.y,
|
|
11372
|
+
color: t2.terrain === "water" ? "#3b82f6" : t2.terrain === "mountain" ? "#78716c" : "#4ade80"
|
|
11373
|
+
}));
|
|
11374
|
+
}, [showMinimap, sortedTiles]);
|
|
11375
|
+
const miniMapUnits = useMemo(() => {
|
|
11376
|
+
if (!showMinimap) return [];
|
|
11377
|
+
return units.filter((u) => u.position).map((u) => ({
|
|
11378
|
+
x: u.position.x,
|
|
11379
|
+
y: u.position.y,
|
|
11380
|
+
color: u.team === "player" ? "#60a5fa" : u.team === "enemy" ? "#f87171" : "#9ca3af",
|
|
11381
|
+
isPlayer: u.team === "player"
|
|
11382
|
+
}));
|
|
11383
|
+
}, [showMinimap, units]);
|
|
11384
|
+
const miniMapWidth = gridWidth || 10;
|
|
11385
|
+
const miniMapHeight = gridHeight || 10;
|
|
11386
|
+
const draw = useCallback(() => {
|
|
11587
11387
|
const canvas = canvasRef.current;
|
|
11588
11388
|
if (!canvas) return;
|
|
11589
11389
|
const ctx = canvas.getContext("2d");
|
|
@@ -11669,8 +11469,7 @@ function IsometricCanvas({
|
|
|
11669
11469
|
if (validMoveSet.has(tileKey)) {
|
|
11670
11470
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11671
11471
|
const topY = pos.y + scaledDiamondTopY;
|
|
11672
|
-
|
|
11673
|
-
ctx.fillStyle = `rgba(74, 222, 128, ${pulse})`;
|
|
11472
|
+
ctx.fillStyle = "rgba(74, 222, 128, 0.25)";
|
|
11674
11473
|
ctx.beginPath();
|
|
11675
11474
|
ctx.moveTo(centerX, topY);
|
|
11676
11475
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -11682,8 +11481,7 @@ function IsometricCanvas({
|
|
|
11682
11481
|
if (attackTargetSet.has(tileKey)) {
|
|
11683
11482
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11684
11483
|
const topY = pos.y + scaledDiamondTopY;
|
|
11685
|
-
|
|
11686
|
-
ctx.fillStyle = `rgba(239, 68, 68, ${pulse})`;
|
|
11484
|
+
ctx.fillStyle = "rgba(239, 68, 68, 0.35)";
|
|
11687
11485
|
ctx.beginPath();
|
|
11688
11486
|
ctx.moveTo(centerX, topY);
|
|
11689
11487
|
ctx.lineTo(pos.x + scaledTileWidth, topY + scaledFloorHeight / 2);
|
|
@@ -11756,7 +11554,7 @@ function IsometricCanvas({
|
|
|
11756
11554
|
const isSelected = unit.id === selectedUnitId;
|
|
11757
11555
|
const centerX = pos.x + scaledTileWidth / 2;
|
|
11758
11556
|
const groundY = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11759
|
-
const breatheOffset = 0
|
|
11557
|
+
const breatheOffset = 0;
|
|
11760
11558
|
const unitSpriteUrl = resolveUnitSpriteUrl(unit);
|
|
11761
11559
|
const img = unitSpriteUrl ? getImage(unitSpriteUrl) : null;
|
|
11762
11560
|
const unitDrawH = scaledFloorHeight * spriteHeightRatio * unitScale;
|
|
@@ -11796,10 +11594,9 @@ function IsometricCanvas({
|
|
|
11796
11594
|
ctx.restore();
|
|
11797
11595
|
}
|
|
11798
11596
|
if (isSelected) {
|
|
11799
|
-
const ringAlpha = 0.6 + 0.3 * Math.sin(animTime * 4e-3);
|
|
11800
11597
|
ctx.beginPath();
|
|
11801
11598
|
ctx.ellipse(centerX, groundY, drawW / 2 + 4 * scale, 12 * scale, 0, 0, Math.PI * 2);
|
|
11802
|
-
ctx.strokeStyle =
|
|
11599
|
+
ctx.strokeStyle = "rgba(0, 200, 255, 0.8)";
|
|
11803
11600
|
ctx.lineWidth = 3;
|
|
11804
11601
|
ctx.stroke();
|
|
11805
11602
|
}
|
|
@@ -11855,66 +11652,29 @@ function IsometricCanvas({
|
|
|
11855
11652
|
ctx.lineWidth = 2;
|
|
11856
11653
|
ctx.stroke();
|
|
11857
11654
|
}
|
|
11858
|
-
if (unit.name) {
|
|
11859
|
-
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)";
|
|
11860
|
-
ctx.font = `bold ${10 * scale * 2.5}px system-ui`;
|
|
11861
|
-
ctx.textAlign = "center";
|
|
11862
|
-
const textWidth = ctx.measureText(unit.name).width;
|
|
11863
|
-
const labelY = groundY + 14 * scale - breatheOffset;
|
|
11864
|
-
ctx.fillStyle = labelBg;
|
|
11865
|
-
ctx.beginPath();
|
|
11866
|
-
ctx.roundRect(centerX - textWidth / 2 - 6 * scale, labelY - 8 * scale, textWidth + 12 * scale, 16 * scale, 4 * scale);
|
|
11867
|
-
ctx.fill();
|
|
11868
|
-
ctx.fillStyle = "white";
|
|
11869
|
-
ctx.fillText(unit.name, centerX, labelY + 4 * scale);
|
|
11870
|
-
}
|
|
11871
|
-
if (unit.health !== void 0 && unit.maxHealth !== void 0) {
|
|
11872
|
-
const barWidth = 40 * scale;
|
|
11873
|
-
const barHeight = 6 * scale;
|
|
11874
|
-
const barX = centerX - barWidth / 2;
|
|
11875
|
-
const barY = groundY - drawH - 2 * scale - breatheOffset;
|
|
11876
|
-
const healthRatio = unit.health / unit.maxHealth;
|
|
11877
|
-
const barRadius = barHeight / 2;
|
|
11878
|
-
ctx.fillStyle = "rgba(0, 0, 0, 0.7)";
|
|
11879
|
-
ctx.beginPath();
|
|
11880
|
-
ctx.roundRect(barX, barY, barWidth, barHeight, barRadius);
|
|
11881
|
-
ctx.fill();
|
|
11882
|
-
if (healthRatio > 0) {
|
|
11883
|
-
const fillWidth = barWidth * healthRatio;
|
|
11884
|
-
const gradient = ctx.createLinearGradient(barX, barY, barX, barY + barHeight);
|
|
11885
|
-
if (healthRatio > 0.6) {
|
|
11886
|
-
gradient.addColorStop(0, "#4ade80");
|
|
11887
|
-
gradient.addColorStop(1, "#22c55e");
|
|
11888
|
-
} else if (healthRatio > 0.3) {
|
|
11889
|
-
gradient.addColorStop(0, "#fde047");
|
|
11890
|
-
gradient.addColorStop(1, "#eab308");
|
|
11891
|
-
} else {
|
|
11892
|
-
gradient.addColorStop(0, "#f87171");
|
|
11893
|
-
gradient.addColorStop(1, "#ef4444");
|
|
11894
|
-
}
|
|
11895
|
-
ctx.fillStyle = gradient;
|
|
11896
|
-
ctx.save();
|
|
11897
|
-
ctx.beginPath();
|
|
11898
|
-
ctx.roundRect(barX, barY, fillWidth, barHeight, barRadius);
|
|
11899
|
-
ctx.clip();
|
|
11900
|
-
ctx.fillRect(barX, barY, fillWidth, barHeight);
|
|
11901
|
-
ctx.restore();
|
|
11902
|
-
}
|
|
11903
|
-
ctx.strokeStyle = "rgba(255, 255, 255, 0.3)";
|
|
11904
|
-
ctx.lineWidth = 1;
|
|
11905
|
-
ctx.beginPath();
|
|
11906
|
-
ctx.roundRect(barX, barY, barWidth, barHeight, barRadius);
|
|
11907
|
-
ctx.stroke();
|
|
11908
|
-
}
|
|
11909
11655
|
}
|
|
11910
|
-
|
|
11656
|
+
for (const fx of effects) {
|
|
11657
|
+
const spriteUrl = resolveManifestUrl7(assetManifest?.effects?.[fx.key]);
|
|
11658
|
+
if (!spriteUrl) continue;
|
|
11659
|
+
const img = getImage(spriteUrl);
|
|
11660
|
+
if (!img) continue;
|
|
11661
|
+
const pos = isoToScreen(fx.x, fx.y, scale, baseOffsetX, tileLayout);
|
|
11662
|
+
const cx = pos.x + scaledTileWidth / 2;
|
|
11663
|
+
const cy = pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5;
|
|
11664
|
+
const alpha = Math.min(1, fx.ttl / 4);
|
|
11665
|
+
const prev = ctx.globalAlpha;
|
|
11666
|
+
ctx.globalAlpha = alpha;
|
|
11667
|
+
ctx.drawImage(img, cx - img.naturalWidth / 2, cy - img.naturalHeight / 2);
|
|
11668
|
+
ctx.globalAlpha = prev;
|
|
11669
|
+
}
|
|
11670
|
+
onDrawEffects?.(ctx, 0, getImage);
|
|
11911
11671
|
ctx.restore();
|
|
11912
|
-
drawMinimap();
|
|
11913
11672
|
}, [
|
|
11914
11673
|
sortedTiles,
|
|
11915
11674
|
units,
|
|
11916
11675
|
features,
|
|
11917
11676
|
selectedUnitId,
|
|
11677
|
+
effects,
|
|
11918
11678
|
tileLayout,
|
|
11919
11679
|
scale,
|
|
11920
11680
|
debug2,
|
|
@@ -11934,11 +11694,12 @@ function IsometricCanvas({
|
|
|
11934
11694
|
attackTargetSet,
|
|
11935
11695
|
hoveredTile,
|
|
11936
11696
|
viewportSize,
|
|
11937
|
-
drawMinimap,
|
|
11938
11697
|
onDrawEffects,
|
|
11939
11698
|
backgroundImage,
|
|
11940
11699
|
cameraRef,
|
|
11941
|
-
unitScale
|
|
11700
|
+
unitScale,
|
|
11701
|
+
resolveManifestUrl7,
|
|
11702
|
+
assetManifest
|
|
11942
11703
|
]);
|
|
11943
11704
|
useEffect(() => {
|
|
11944
11705
|
if (!selectedUnitId) return;
|
|
@@ -11953,30 +11714,33 @@ function IsometricCanvas({
|
|
|
11953
11714
|
};
|
|
11954
11715
|
}, [selectedUnitId, units, tileLayout, scale, baseOffsetX, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, targetCameraRef]);
|
|
11955
11716
|
useEffect(() => {
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
|
|
11717
|
+
draw();
|
|
11718
|
+
}, [draw]);
|
|
11719
|
+
useEffect(() => {
|
|
11720
|
+
draw();
|
|
11721
|
+
}, [_imagePendingCount]);
|
|
11722
|
+
useEffect(() => {
|
|
11723
|
+
if (selectedUnitId == null) return;
|
|
11959
11724
|
let running = true;
|
|
11960
|
-
const
|
|
11725
|
+
const tick = () => {
|
|
11961
11726
|
if (!running) return;
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
rafIdRef.current = requestAnimationFrame(animate);
|
|
11727
|
+
const stillLerping = lerpToTarget();
|
|
11728
|
+
draw();
|
|
11729
|
+
if (stillLerping) lerpRafRef.current = requestAnimationFrame(tick);
|
|
11966
11730
|
};
|
|
11967
|
-
|
|
11731
|
+
lerpRafRef.current = requestAnimationFrame(tick);
|
|
11968
11732
|
return () => {
|
|
11969
11733
|
running = false;
|
|
11970
|
-
cancelAnimationFrame(
|
|
11734
|
+
cancelAnimationFrame(lerpRafRef.current);
|
|
11971
11735
|
};
|
|
11972
|
-
}, [
|
|
11736
|
+
}, [selectedUnitId, lerpToTarget, draw]);
|
|
11973
11737
|
const singlePointerActiveRef = useRef(false);
|
|
11974
11738
|
const handleCanvasPointerDown = useCallback((e) => {
|
|
11975
11739
|
singlePointerActiveRef.current = true;
|
|
11976
11740
|
if (enableCamera) handlePointerDown(e);
|
|
11977
11741
|
}, [enableCamera, handlePointerDown]);
|
|
11978
11742
|
const handleCanvasPointerMove = useCallback((e) => {
|
|
11979
|
-
if (enableCamera) handlePointerMove(e, () => draw(
|
|
11743
|
+
if (enableCamera) handlePointerMove(e, () => draw());
|
|
11980
11744
|
}, [enableCamera, handlePointerMove, draw]);
|
|
11981
11745
|
const handleCanvasHover = useCallback((e) => {
|
|
11982
11746
|
if (singlePointerActiveRef.current) return;
|
|
@@ -12018,10 +11782,10 @@ function IsometricCanvas({
|
|
|
12018
11782
|
onTileLeave?.();
|
|
12019
11783
|
}, [handleMouseLeave, onTileLeave, tileLeaveEvent, eventBus]);
|
|
12020
11784
|
const applyZoom = useCallback((factor, centerX, centerY) => {
|
|
12021
|
-
if (enableCamera) zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw(
|
|
11785
|
+
if (enableCamera) zoomAtPoint(factor, centerX, centerY, viewportSize, () => draw());
|
|
12022
11786
|
}, [enableCamera, zoomAtPoint, viewportSize, draw]);
|
|
12023
11787
|
const applyPanDelta = useCallback((dx, dy) => {
|
|
12024
|
-
if (enableCamera) panBy(dx, dy, () => draw(
|
|
11788
|
+
if (enableCamera) panBy(dx, dy, () => draw());
|
|
12025
11789
|
}, [enableCamera, panBy, draw]);
|
|
12026
11790
|
const cancelSinglePointer = useCallback(() => {
|
|
12027
11791
|
singlePointerActiveRef.current = false;
|
|
@@ -12037,11 +11801,27 @@ function IsometricCanvas({
|
|
|
12037
11801
|
onPanDelta: applyPanDelta,
|
|
12038
11802
|
onMultiTouchStart: cancelSinglePointer
|
|
12039
11803
|
});
|
|
11804
|
+
const unitOverlays = useMemo(() => {
|
|
11805
|
+
if (sortedTiles.length === 0) return [];
|
|
11806
|
+
return units.filter((u) => !!u.position).map((u) => {
|
|
11807
|
+
const pos = isoToScreen(u.position.x, u.position.y, scale, baseOffsetX, tileLayout);
|
|
11808
|
+
const cam = cameraRef.current;
|
|
11809
|
+
const screenX = (pos.x + scaledTileWidth / 2 - (cam.x + viewportSize.width / 2)) * cam.zoom + viewportSize.width / 2;
|
|
11810
|
+
const screenY = (pos.y + scaledDiamondTopY + scaledFloorHeight * 0.5 - (cam.y + viewportSize.height / 2)) * cam.zoom + viewportSize.height / 2;
|
|
11811
|
+
return { unit: u, screenX, screenY };
|
|
11812
|
+
});
|
|
11813
|
+
}, [units, sortedTiles.length, scale, baseOffsetX, tileLayout, scaledTileWidth, scaledDiamondTopY, scaledFloorHeight, viewportSize, cameraRef]);
|
|
12040
11814
|
if (error) {
|
|
12041
|
-
return /* @__PURE__ */ jsx(
|
|
11815
|
+
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: [
|
|
11816
|
+
/* @__PURE__ */ jsx(Icon, { name: "alert-circle", size: "xl" }),
|
|
11817
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-error", children: error.message })
|
|
11818
|
+
] }) });
|
|
12042
11819
|
}
|
|
12043
11820
|
if (isLoading) {
|
|
12044
|
-
return /* @__PURE__ */ jsx(
|
|
11821
|
+
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: [
|
|
11822
|
+
/* @__PURE__ */ jsx(Icon, { name: "loader", size: "xl", className: "animate-spin" }),
|
|
11823
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: "text-muted-foreground", children: t("canvas.loadingMessage") || "Loading\u2026" })
|
|
11824
|
+
] }) });
|
|
12045
11825
|
}
|
|
12046
11826
|
if (sortedTiles.length === 0) {
|
|
12047
11827
|
return /* @__PURE__ */ jsx(
|
|
@@ -12106,14 +11886,36 @@ function IsometricCanvas({
|
|
|
12106
11886
|
}
|
|
12107
11887
|
)
|
|
12108
11888
|
] }),
|
|
12109
|
-
|
|
12110
|
-
"
|
|
11889
|
+
unitOverlays.map(({ unit, screenX, screenY }) => /* @__PURE__ */ jsxs(
|
|
11890
|
+
"div",
|
|
12111
11891
|
{
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
|
|
11892
|
+
className: "absolute pointer-events-none",
|
|
11893
|
+
style: { left: Math.round(screenX), top: Math.round(screenY), transform: "translate(-50%, 0)", zIndex: 5 },
|
|
11894
|
+
children: [
|
|
11895
|
+
unit.name && /* @__PURE__ */ jsx(
|
|
11896
|
+
"div",
|
|
11897
|
+
{
|
|
11898
|
+
className: "text-white text-xs font-bold px-1.5 py-0.5 rounded mb-0.5 whitespace-nowrap",
|
|
11899
|
+
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)" },
|
|
11900
|
+
children: unit.name
|
|
11901
|
+
}
|
|
11902
|
+
),
|
|
11903
|
+
unit.health !== void 0 && unit.maxHealth !== void 0 && unit.maxHealth > 0 && /* @__PURE__ */ jsx(HealthBar, { current: unit.health, max: unit.maxHealth, format: "bar", size: "sm" })
|
|
11904
|
+
]
|
|
11905
|
+
},
|
|
11906
|
+
unit.id
|
|
11907
|
+
)),
|
|
11908
|
+
showMinimap && /* @__PURE__ */ jsx("div", { className: "absolute bottom-2 right-2 pointer-events-none", style: { zIndex: 10 }, children: /* @__PURE__ */ jsx(
|
|
11909
|
+
MiniMap,
|
|
11910
|
+
{
|
|
11911
|
+
tiles: miniMapTiles,
|
|
11912
|
+
units: miniMapUnits,
|
|
11913
|
+
width: 150,
|
|
11914
|
+
height: 100,
|
|
11915
|
+
mapWidth: miniMapWidth,
|
|
11916
|
+
mapHeight: miniMapHeight
|
|
12115
11917
|
}
|
|
12116
|
-
)
|
|
11918
|
+
) })
|
|
12117
11919
|
]
|
|
12118
11920
|
}
|
|
12119
11921
|
);
|
|
@@ -12128,8 +11930,8 @@ var init_IsometricCanvas = __esm({
|
|
|
12128
11930
|
init_Stack();
|
|
12129
11931
|
init_Icon();
|
|
12130
11932
|
init_Typography();
|
|
12131
|
-
|
|
12132
|
-
|
|
11933
|
+
init_MiniMap();
|
|
11934
|
+
init_HealthBar();
|
|
12133
11935
|
init_useImageCache();
|
|
12134
11936
|
init_useCamera();
|
|
12135
11937
|
init_useCanvasGestures();
|
|
@@ -13687,6 +13489,50 @@ var init_Tabs = __esm({
|
|
|
13687
13489
|
Tabs.displayName = "Tabs";
|
|
13688
13490
|
}
|
|
13689
13491
|
});
|
|
13492
|
+
var LoadingState;
|
|
13493
|
+
var init_LoadingState = __esm({
|
|
13494
|
+
"components/core/molecules/LoadingState.tsx"() {
|
|
13495
|
+
"use client";
|
|
13496
|
+
init_cn();
|
|
13497
|
+
init_atoms2();
|
|
13498
|
+
init_Stack();
|
|
13499
|
+
init_Typography();
|
|
13500
|
+
LoadingState = ({
|
|
13501
|
+
title,
|
|
13502
|
+
message,
|
|
13503
|
+
className
|
|
13504
|
+
}) => {
|
|
13505
|
+
const { t } = useTranslate();
|
|
13506
|
+
const displayMessage = message ?? t("common.loading");
|
|
13507
|
+
return /* @__PURE__ */ jsxs(
|
|
13508
|
+
VStack,
|
|
13509
|
+
{
|
|
13510
|
+
align: "center",
|
|
13511
|
+
className: cn(
|
|
13512
|
+
"justify-center py-12",
|
|
13513
|
+
className
|
|
13514
|
+
),
|
|
13515
|
+
children: [
|
|
13516
|
+
/* @__PURE__ */ jsx(Spinner, { size: "lg" }),
|
|
13517
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "h3", className: "mt-4 text-lg font-semibold text-foreground", children: title }),
|
|
13518
|
+
/* @__PURE__ */ jsx(
|
|
13519
|
+
Typography,
|
|
13520
|
+
{
|
|
13521
|
+
variant: "small",
|
|
13522
|
+
className: cn(
|
|
13523
|
+
"text-muted-foreground",
|
|
13524
|
+
title ? "mt-2" : "mt-4"
|
|
13525
|
+
),
|
|
13526
|
+
children: displayMessage
|
|
13527
|
+
}
|
|
13528
|
+
)
|
|
13529
|
+
]
|
|
13530
|
+
}
|
|
13531
|
+
);
|
|
13532
|
+
};
|
|
13533
|
+
LoadingState.displayName = "LoadingState";
|
|
13534
|
+
}
|
|
13535
|
+
});
|
|
13690
13536
|
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
13691
13537
|
var init_EmptyState = __esm({
|
|
13692
13538
|
"components/core/molecules/EmptyState.tsx"() {
|
|
@@ -13967,7 +13813,7 @@ var init_CodeBlock = __esm({
|
|
|
13967
13813
|
};
|
|
13968
13814
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13969
13815
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13970
|
-
CodeBlock =
|
|
13816
|
+
CodeBlock = React88__default.memo(
|
|
13971
13817
|
({
|
|
13972
13818
|
code: rawCode,
|
|
13973
13819
|
language = "text",
|
|
@@ -14554,7 +14400,7 @@ var init_MarkdownContent = __esm({
|
|
|
14554
14400
|
init_Box();
|
|
14555
14401
|
init_CodeBlock();
|
|
14556
14402
|
init_cn();
|
|
14557
|
-
MarkdownContent =
|
|
14403
|
+
MarkdownContent = React88__default.memo(
|
|
14558
14404
|
({ content, direction = "ltr", className }) => {
|
|
14559
14405
|
const { t: _t } = useTranslate();
|
|
14560
14406
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -15923,7 +15769,7 @@ var init_StateMachineView = __esm({
|
|
|
15923
15769
|
style: { top: title ? 30 : 0 },
|
|
15924
15770
|
children: [
|
|
15925
15771
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15926
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15772
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React88__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15927
15773
|
StateNode,
|
|
15928
15774
|
{
|
|
15929
15775
|
state,
|
|
@@ -19892,7 +19738,7 @@ function CardHand({
|
|
|
19892
19738
|
className
|
|
19893
19739
|
}) {
|
|
19894
19740
|
const eventBus = useEventBus();
|
|
19895
|
-
const handleClick =
|
|
19741
|
+
const handleClick = React88.useCallback(
|
|
19896
19742
|
(card) => {
|
|
19897
19743
|
if (card.disabled) return;
|
|
19898
19744
|
onCardClick?.(card.id);
|
|
@@ -22881,10 +22727,10 @@ function CombatLog({
|
|
|
22881
22727
|
}, [events2, autoScroll]);
|
|
22882
22728
|
const safeEvents = events2 ?? [];
|
|
22883
22729
|
const visibleEvents = safeEvents.slice(-maxVisible);
|
|
22884
|
-
return /* @__PURE__ */ jsxs(
|
|
22730
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col rounded-container border border-border bg-card shadow-elevation-card", className), children: [
|
|
22885
22731
|
/* @__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: [
|
|
22886
22732
|
/* @__PURE__ */ jsx(Typography, { variant: "body2", className: "font-bold", children: title }),
|
|
22887
|
-
/* @__PURE__ */ jsxs(
|
|
22733
|
+
/* @__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: [
|
|
22888
22734
|
safeEvents.length,
|
|
22889
22735
|
" events"
|
|
22890
22736
|
] })
|
|
@@ -22904,7 +22750,7 @@ function CombatLog({
|
|
|
22904
22750
|
/* @__PURE__ */ jsx(Box, { className: cn("flex-shrink-0 mt-0.5", colorClass), children: /* @__PURE__ */ jsx(EventIcon, { className: "h-4 w-4" }) }),
|
|
22905
22751
|
/* @__PURE__ */ jsxs(Box, { className: "flex-1 min-w-0", children: [
|
|
22906
22752
|
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "block", children: event.message }),
|
|
22907
|
-
event.value !== void 0 && /* @__PURE__ */ jsxs(
|
|
22753
|
+
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: [
|
|
22908
22754
|
eventType === "heal" ? "+" : eventType === "attack" ? "-" : "",
|
|
22909
22755
|
event.value
|
|
22910
22756
|
] })
|
|
@@ -22917,7 +22763,7 @@ function CombatLog({
|
|
|
22917
22763
|
}) }) })
|
|
22918
22764
|
] });
|
|
22919
22765
|
}
|
|
22920
|
-
var eventIcons, eventColors,
|
|
22766
|
+
var eventIcons, eventColors, eventValueColors, DEFAULT_COMBAT_EVENTS;
|
|
22921
22767
|
var init_CombatLog = __esm({
|
|
22922
22768
|
"components/game/molecules/CombatLog.tsx"() {
|
|
22923
22769
|
init_atoms2();
|
|
@@ -22940,14 +22786,14 @@ var init_CombatLog = __esm({
|
|
|
22940
22786
|
death: "text-muted-foreground",
|
|
22941
22787
|
spawn: "text-accent"
|
|
22942
22788
|
};
|
|
22943
|
-
|
|
22944
|
-
attack: "
|
|
22945
|
-
defend: "
|
|
22946
|
-
heal: "success",
|
|
22947
|
-
move: "warning",
|
|
22948
|
-
special: "
|
|
22949
|
-
death: "
|
|
22950
|
-
spawn: "
|
|
22789
|
+
eventValueColors = {
|
|
22790
|
+
attack: "text-error bg-error/10 border-error/30",
|
|
22791
|
+
defend: "text-info bg-info/10 border-info/30",
|
|
22792
|
+
heal: "text-success bg-success/10 border-success/30",
|
|
22793
|
+
move: "text-warning bg-warning/10 border-warning/30",
|
|
22794
|
+
special: "text-accent bg-accent/10 border-accent/30",
|
|
22795
|
+
death: "text-muted-foreground bg-muted/30 border-border",
|
|
22796
|
+
spawn: "text-accent bg-accent/10 border-accent/30"
|
|
22951
22797
|
};
|
|
22952
22798
|
DEFAULT_COMBAT_EVENTS = [
|
|
22953
22799
|
{ id: "e1", type: "spawn", message: "Shadow Guard entered the field.", timestamp: 0, turn: 1 },
|
|
@@ -23371,7 +23217,7 @@ function CraftingRecipe({
|
|
|
23371
23217
|
className
|
|
23372
23218
|
}) {
|
|
23373
23219
|
const eventBus = useEventBus();
|
|
23374
|
-
const handleCraft =
|
|
23220
|
+
const handleCraft = React88.useCallback(() => {
|
|
23375
23221
|
onCraft?.();
|
|
23376
23222
|
if (craftEvent) {
|
|
23377
23223
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -23388,7 +23234,7 @@ function CraftingRecipe({
|
|
|
23388
23234
|
children: [
|
|
23389
23235
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
23390
23236
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
23391
|
-
return /* @__PURE__ */ jsxs(
|
|
23237
|
+
return /* @__PURE__ */ jsxs(React88.Fragment, { children: [
|
|
23392
23238
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
23393
23239
|
ItemSlot,
|
|
23394
23240
|
{
|
|
@@ -23413,13 +23259,13 @@ function CraftingRecipe({
|
|
|
23413
23259
|
}
|
|
23414
23260
|
),
|
|
23415
23261
|
/* @__PURE__ */ jsx(
|
|
23416
|
-
|
|
23262
|
+
ActionButton,
|
|
23417
23263
|
{
|
|
23264
|
+
label: "Craft",
|
|
23418
23265
|
onClick: handleCraft,
|
|
23419
23266
|
disabled: !canCraft,
|
|
23420
23267
|
variant: canCraft ? "primary" : "secondary",
|
|
23421
|
-
size: "sm"
|
|
23422
|
-
children: "Craft"
|
|
23268
|
+
size: "sm"
|
|
23423
23269
|
}
|
|
23424
23270
|
)
|
|
23425
23271
|
]
|
|
@@ -23433,7 +23279,7 @@ var init_CraftingRecipe = __esm({
|
|
|
23433
23279
|
init_cn();
|
|
23434
23280
|
init_useEventBus();
|
|
23435
23281
|
init_ItemSlot();
|
|
23436
|
-
|
|
23282
|
+
init_ActionButton();
|
|
23437
23283
|
init_Box();
|
|
23438
23284
|
init_Stack();
|
|
23439
23285
|
init_Icon();
|
|
@@ -23460,8 +23306,8 @@ function DPad({
|
|
|
23460
23306
|
}) {
|
|
23461
23307
|
const eventBus = useEventBus();
|
|
23462
23308
|
const sizes = sizeMap15[size];
|
|
23463
|
-
const [activeDirections, setActiveDirections] =
|
|
23464
|
-
const handlePress =
|
|
23309
|
+
const [activeDirections, setActiveDirections] = React88.useState(/* @__PURE__ */ new Set());
|
|
23310
|
+
const handlePress = React88.useCallback(
|
|
23465
23311
|
(direction) => {
|
|
23466
23312
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
23467
23313
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -23469,7 +23315,7 @@ function DPad({
|
|
|
23469
23315
|
},
|
|
23470
23316
|
[directionEvent, eventBus, onDirection]
|
|
23471
23317
|
);
|
|
23472
|
-
const handleRelease =
|
|
23318
|
+
const handleRelease = React88.useCallback(
|
|
23473
23319
|
(direction) => {
|
|
23474
23320
|
setActiveDirections((prev) => {
|
|
23475
23321
|
const next = new Set(prev);
|
|
@@ -24354,8 +24200,8 @@ var init_Menu = __esm({
|
|
|
24354
24200
|
"bottom-end": "bottom-start"
|
|
24355
24201
|
};
|
|
24356
24202
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
24357
|
-
const triggerChild =
|
|
24358
|
-
const triggerElement =
|
|
24203
|
+
const triggerChild = React88__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
24204
|
+
const triggerElement = React88__default.cloneElement(
|
|
24359
24205
|
triggerChild,
|
|
24360
24206
|
{
|
|
24361
24207
|
ref: triggerRef,
|
|
@@ -24450,14 +24296,14 @@ function useDataDnd(args) {
|
|
|
24450
24296
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
24451
24297
|
const enabled = isZone || Boolean(dndRoot);
|
|
24452
24298
|
const eventBus = useEventBus();
|
|
24453
|
-
const parentRoot =
|
|
24299
|
+
const parentRoot = React88__default.useContext(RootCtx);
|
|
24454
24300
|
const isRoot = enabled && parentRoot === null;
|
|
24455
|
-
const zoneId =
|
|
24301
|
+
const zoneId = React88__default.useId();
|
|
24456
24302
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24457
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
24458
|
-
const optimisticOrdersRef =
|
|
24303
|
+
const [optimisticOrders, setOptimisticOrders] = React88__default.useState(() => /* @__PURE__ */ new Map());
|
|
24304
|
+
const optimisticOrdersRef = React88__default.useRef(optimisticOrders);
|
|
24459
24305
|
optimisticOrdersRef.current = optimisticOrders;
|
|
24460
|
-
const clearOptimisticOrder =
|
|
24306
|
+
const clearOptimisticOrder = React88__default.useCallback((group) => {
|
|
24461
24307
|
setOptimisticOrders((prev) => {
|
|
24462
24308
|
if (!prev.has(group)) return prev;
|
|
24463
24309
|
const next = new Map(prev);
|
|
@@ -24482,7 +24328,7 @@ function useDataDnd(args) {
|
|
|
24482
24328
|
const raw = it[dndItemIdField];
|
|
24483
24329
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
24484
24330
|
}).join("|");
|
|
24485
|
-
const itemIds =
|
|
24331
|
+
const itemIds = React88__default.useMemo(
|
|
24486
24332
|
() => orderedItems.map((it, idx) => {
|
|
24487
24333
|
const raw = it[dndItemIdField];
|
|
24488
24334
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -24493,7 +24339,7 @@ function useDataDnd(args) {
|
|
|
24493
24339
|
const raw = it[dndItemIdField];
|
|
24494
24340
|
return raw != null ? String(raw) : `__${idx}`;
|
|
24495
24341
|
}).join("|");
|
|
24496
|
-
|
|
24342
|
+
React88__default.useEffect(() => {
|
|
24497
24343
|
const root = isRoot ? null : parentRoot;
|
|
24498
24344
|
if (root) {
|
|
24499
24345
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -24501,20 +24347,20 @@ function useDataDnd(args) {
|
|
|
24501
24347
|
clearOptimisticOrder(ownGroup);
|
|
24502
24348
|
}
|
|
24503
24349
|
}, [itemsContentSig, ownGroup]);
|
|
24504
|
-
const zonesRef =
|
|
24505
|
-
const registerZone =
|
|
24350
|
+
const zonesRef = React88__default.useRef(/* @__PURE__ */ new Map());
|
|
24351
|
+
const registerZone = React88__default.useCallback((zoneId2, meta2) => {
|
|
24506
24352
|
zonesRef.current.set(zoneId2, meta2);
|
|
24507
24353
|
}, []);
|
|
24508
|
-
const unregisterZone =
|
|
24354
|
+
const unregisterZone = React88__default.useCallback((zoneId2) => {
|
|
24509
24355
|
zonesRef.current.delete(zoneId2);
|
|
24510
24356
|
}, []);
|
|
24511
|
-
const [activeDrag, setActiveDrag] =
|
|
24512
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
24513
|
-
const meta =
|
|
24357
|
+
const [activeDrag, setActiveDrag] = React88__default.useState(null);
|
|
24358
|
+
const [overZoneGroup, setOverZoneGroup] = React88__default.useState(null);
|
|
24359
|
+
const meta = React88__default.useMemo(
|
|
24514
24360
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
24515
24361
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
24516
24362
|
);
|
|
24517
|
-
|
|
24363
|
+
React88__default.useEffect(() => {
|
|
24518
24364
|
const target = isRoot ? null : parentRoot;
|
|
24519
24365
|
if (!target) {
|
|
24520
24366
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -24533,7 +24379,7 @@ function useDataDnd(args) {
|
|
|
24533
24379
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
24534
24380
|
const sensors = useAlmadarDndSensors(true);
|
|
24535
24381
|
const collisionDetection = almadarDndCollisionDetection;
|
|
24536
|
-
const findZoneByItem =
|
|
24382
|
+
const findZoneByItem = React88__default.useCallback(
|
|
24537
24383
|
(id) => {
|
|
24538
24384
|
for (const z of zonesRef.current.values()) {
|
|
24539
24385
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -24542,7 +24388,7 @@ function useDataDnd(args) {
|
|
|
24542
24388
|
},
|
|
24543
24389
|
[]
|
|
24544
24390
|
);
|
|
24545
|
-
|
|
24391
|
+
React88__default.useCallback(
|
|
24546
24392
|
(group) => {
|
|
24547
24393
|
for (const z of zonesRef.current.values()) {
|
|
24548
24394
|
if (z.group === group) return z;
|
|
@@ -24551,7 +24397,7 @@ function useDataDnd(args) {
|
|
|
24551
24397
|
},
|
|
24552
24398
|
[]
|
|
24553
24399
|
);
|
|
24554
|
-
const handleDragEnd =
|
|
24400
|
+
const handleDragEnd = React88__default.useCallback(
|
|
24555
24401
|
(event) => {
|
|
24556
24402
|
const { active, over } = event;
|
|
24557
24403
|
const activeIdStr = String(active.id);
|
|
@@ -24642,8 +24488,8 @@ function useDataDnd(args) {
|
|
|
24642
24488
|
},
|
|
24643
24489
|
[eventBus]
|
|
24644
24490
|
);
|
|
24645
|
-
const sortableData =
|
|
24646
|
-
const SortableItem =
|
|
24491
|
+
const sortableData = React88__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
24492
|
+
const SortableItem = React88__default.useCallback(
|
|
24647
24493
|
({ id, children }) => {
|
|
24648
24494
|
const {
|
|
24649
24495
|
attributes,
|
|
@@ -24683,7 +24529,7 @@ function useDataDnd(args) {
|
|
|
24683
24529
|
id: droppableId,
|
|
24684
24530
|
data: sortableData
|
|
24685
24531
|
});
|
|
24686
|
-
const ctx =
|
|
24532
|
+
const ctx = React88__default.useContext(RootCtx);
|
|
24687
24533
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
24688
24534
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
24689
24535
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -24698,7 +24544,7 @@ function useDataDnd(args) {
|
|
|
24698
24544
|
showForeignPlaceholder,
|
|
24699
24545
|
ctxAvailable: ctx != null
|
|
24700
24546
|
});
|
|
24701
|
-
|
|
24547
|
+
React88__default.useEffect(() => {
|
|
24702
24548
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
24703
24549
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
24704
24550
|
return /* @__PURE__ */ jsx(
|
|
@@ -24712,11 +24558,11 @@ function useDataDnd(args) {
|
|
|
24712
24558
|
}
|
|
24713
24559
|
);
|
|
24714
24560
|
};
|
|
24715
|
-
const rootContextValue =
|
|
24561
|
+
const rootContextValue = React88__default.useMemo(
|
|
24716
24562
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
24717
24563
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
24718
24564
|
);
|
|
24719
|
-
const handleDragStart =
|
|
24565
|
+
const handleDragStart = React88__default.useCallback((event) => {
|
|
24720
24566
|
const sourceZone = findZoneByItem(event.active.id);
|
|
24721
24567
|
const rect = event.active.rect.current.initial;
|
|
24722
24568
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -24735,7 +24581,7 @@ function useDataDnd(args) {
|
|
|
24735
24581
|
isRoot
|
|
24736
24582
|
});
|
|
24737
24583
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
24738
|
-
const handleDragOver =
|
|
24584
|
+
const handleDragOver = React88__default.useCallback((event) => {
|
|
24739
24585
|
const { active, over } = event;
|
|
24740
24586
|
const overData = over?.data?.current;
|
|
24741
24587
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -24805,7 +24651,7 @@ function useDataDnd(args) {
|
|
|
24805
24651
|
return next;
|
|
24806
24652
|
});
|
|
24807
24653
|
}, []);
|
|
24808
|
-
const handleDragCancel =
|
|
24654
|
+
const handleDragCancel = React88__default.useCallback((event) => {
|
|
24809
24655
|
setActiveDrag(null);
|
|
24810
24656
|
setOverZoneGroup(null);
|
|
24811
24657
|
dndLog.warn("dragCancel", {
|
|
@@ -24813,12 +24659,12 @@ function useDataDnd(args) {
|
|
|
24813
24659
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
24814
24660
|
});
|
|
24815
24661
|
}, []);
|
|
24816
|
-
const handleDragEndWithCleanup =
|
|
24662
|
+
const handleDragEndWithCleanup = React88__default.useCallback((event) => {
|
|
24817
24663
|
handleDragEnd(event);
|
|
24818
24664
|
setActiveDrag(null);
|
|
24819
24665
|
setOverZoneGroup(null);
|
|
24820
24666
|
}, [handleDragEnd]);
|
|
24821
|
-
const wrapContainer =
|
|
24667
|
+
const wrapContainer = React88__default.useCallback(
|
|
24822
24668
|
(children) => {
|
|
24823
24669
|
if (!enabled) return children;
|
|
24824
24670
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -24872,7 +24718,7 @@ var init_useDataDnd = __esm({
|
|
|
24872
24718
|
init_useAlmadarDndCollision();
|
|
24873
24719
|
init_Box();
|
|
24874
24720
|
dndLog = createLogger("almadar:ui:dnd");
|
|
24875
|
-
RootCtx =
|
|
24721
|
+
RootCtx = React88__default.createContext(null);
|
|
24876
24722
|
}
|
|
24877
24723
|
});
|
|
24878
24724
|
function renderIconInput(icon, props) {
|
|
@@ -25398,7 +25244,7 @@ function DataList({
|
|
|
25398
25244
|
}) {
|
|
25399
25245
|
const eventBus = useEventBus();
|
|
25400
25246
|
const { t } = useTranslate();
|
|
25401
|
-
const [visibleCount, setVisibleCount] =
|
|
25247
|
+
const [visibleCount, setVisibleCount] = React88__default.useState(pageSize || Infinity);
|
|
25402
25248
|
const fieldDefs = fields ?? columns ?? [];
|
|
25403
25249
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
25404
25250
|
const dnd = useDataDnd({
|
|
@@ -25417,7 +25263,7 @@ function DataList({
|
|
|
25417
25263
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
25418
25264
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
25419
25265
|
const hasRenderProp = typeof children === "function";
|
|
25420
|
-
|
|
25266
|
+
React88__default.useEffect(() => {
|
|
25421
25267
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
25422
25268
|
const childrenTypeOf = typeof children;
|
|
25423
25269
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -25521,7 +25367,7 @@ function DataList({
|
|
|
25521
25367
|
const items2 = [...data];
|
|
25522
25368
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
25523
25369
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
25524
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25370
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
25525
25371
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
25526
25372
|
group.items.map((itemData, index) => {
|
|
25527
25373
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -25662,7 +25508,7 @@ function DataList({
|
|
|
25662
25508
|
className
|
|
25663
25509
|
),
|
|
25664
25510
|
children: [
|
|
25665
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
25511
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
25666
25512
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
25667
25513
|
group.items.map(
|
|
25668
25514
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26455,7 +26301,7 @@ var init_Flex = __esm({
|
|
|
26455
26301
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
26456
26302
|
}
|
|
26457
26303
|
}
|
|
26458
|
-
return
|
|
26304
|
+
return React88__default.createElement(Component2, {
|
|
26459
26305
|
className: cn(
|
|
26460
26306
|
inline ? "inline-flex" : "flex",
|
|
26461
26307
|
directionStyles[direction],
|
|
@@ -26574,7 +26420,7 @@ var init_Grid = __esm({
|
|
|
26574
26420
|
as: Component2 = "div"
|
|
26575
26421
|
}) => {
|
|
26576
26422
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
26577
|
-
return
|
|
26423
|
+
return React88__default.createElement(
|
|
26578
26424
|
Component2,
|
|
26579
26425
|
{
|
|
26580
26426
|
className: cn(
|
|
@@ -26770,9 +26616,9 @@ var init_Popover = __esm({
|
|
|
26770
26616
|
onMouseLeave: handleClose,
|
|
26771
26617
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
26772
26618
|
};
|
|
26773
|
-
const childElement =
|
|
26619
|
+
const childElement = React88__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
26774
26620
|
const childPointerDown = childElement.props.onPointerDown;
|
|
26775
|
-
const triggerElement =
|
|
26621
|
+
const triggerElement = React88__default.cloneElement(
|
|
26776
26622
|
childElement,
|
|
26777
26623
|
{
|
|
26778
26624
|
ref: triggerRef,
|
|
@@ -27374,9 +27220,9 @@ var init_Tooltip = __esm({
|
|
|
27374
27220
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
27375
27221
|
};
|
|
27376
27222
|
}, []);
|
|
27377
|
-
const triggerElement =
|
|
27223
|
+
const triggerElement = React88__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27378
27224
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
27379
|
-
const trigger =
|
|
27225
|
+
const trigger = React88__default.cloneElement(triggerElement, {
|
|
27380
27226
|
ref: triggerRef,
|
|
27381
27227
|
onMouseEnter: handleMouseEnter,
|
|
27382
27228
|
onMouseLeave: handleMouseLeave,
|
|
@@ -27466,7 +27312,7 @@ var init_WizardProgress = __esm({
|
|
|
27466
27312
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
27467
27313
|
const isActive = index === currentStep;
|
|
27468
27314
|
const isCompleted = index < currentStep;
|
|
27469
|
-
return /* @__PURE__ */ jsxs(
|
|
27315
|
+
return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
27470
27316
|
/* @__PURE__ */ jsx(
|
|
27471
27317
|
"button",
|
|
27472
27318
|
{
|
|
@@ -28429,6 +28275,7 @@ var init_ProgressDots = __esm({
|
|
|
28429
28275
|
});
|
|
28430
28276
|
function StatBadge({
|
|
28431
28277
|
assetUrl,
|
|
28278
|
+
iconUrl,
|
|
28432
28279
|
label,
|
|
28433
28280
|
value = 0,
|
|
28434
28281
|
max,
|
|
@@ -28442,6 +28289,7 @@ function StatBadge({
|
|
|
28442
28289
|
field: _field
|
|
28443
28290
|
}) {
|
|
28444
28291
|
const numValue = typeof value === "number" ? value : parseInt(String(value), 10) || 0;
|
|
28292
|
+
const resolvedAsset = iconUrl ?? assetUrl;
|
|
28445
28293
|
return /* @__PURE__ */ jsxs(
|
|
28446
28294
|
"div",
|
|
28447
28295
|
{
|
|
@@ -28452,10 +28300,10 @@ function StatBadge({
|
|
|
28452
28300
|
className
|
|
28453
28301
|
),
|
|
28454
28302
|
children: [
|
|
28455
|
-
|
|
28303
|
+
resolvedAsset ? /* @__PURE__ */ jsx(
|
|
28456
28304
|
"img",
|
|
28457
28305
|
{
|
|
28458
|
-
src:
|
|
28306
|
+
src: resolvedAsset,
|
|
28459
28307
|
alt: "",
|
|
28460
28308
|
width: 16,
|
|
28461
28309
|
height: 16,
|
|
@@ -28486,8 +28334,7 @@ function StatBadge({
|
|
|
28486
28334
|
ScoreDisplay,
|
|
28487
28335
|
{
|
|
28488
28336
|
value: numValue,
|
|
28489
|
-
size: size === "lg" ? "md" : "sm"
|
|
28490
|
-
animated: true
|
|
28337
|
+
size: size === "lg" ? "md" : "sm"
|
|
28491
28338
|
}
|
|
28492
28339
|
),
|
|
28493
28340
|
format === "text" && /* @__PURE__ */ jsx("span", { className: "font-bold text-foreground", children: value })
|
|
@@ -28530,7 +28377,7 @@ function InventoryGrid({
|
|
|
28530
28377
|
const eventBus = useEventBus();
|
|
28531
28378
|
const slotCount = totalSlots ?? items.length;
|
|
28532
28379
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
28533
|
-
const handleSelect =
|
|
28380
|
+
const handleSelect = React88.useCallback(
|
|
28534
28381
|
(id) => {
|
|
28535
28382
|
onSelect?.(id);
|
|
28536
28383
|
if (selectEvent) {
|
|
@@ -28637,12 +28484,14 @@ function QuestTracker({
|
|
|
28637
28484
|
}
|
|
28638
28485
|
),
|
|
28639
28486
|
/* @__PURE__ */ jsx(Box, { className: "mt-1.5", children: /* @__PURE__ */ jsx(
|
|
28640
|
-
|
|
28487
|
+
HealthBar,
|
|
28641
28488
|
{
|
|
28642
|
-
|
|
28489
|
+
current: quest.progress,
|
|
28643
28490
|
max: quest.maxProgress,
|
|
28644
|
-
|
|
28645
|
-
size: "sm"
|
|
28491
|
+
format: "bar",
|
|
28492
|
+
size: "sm",
|
|
28493
|
+
animated: true,
|
|
28494
|
+
className: isCompleted ? "[--health-color:var(--color-success)]" : isActive ? "" : "opacity-60"
|
|
28646
28495
|
}
|
|
28647
28496
|
) }),
|
|
28648
28497
|
/* @__PURE__ */ jsxs(
|
|
@@ -28670,7 +28519,7 @@ var init_QuestTracker = __esm({
|
|
|
28670
28519
|
"use client";
|
|
28671
28520
|
init_cn();
|
|
28672
28521
|
init_WaypointMarker();
|
|
28673
|
-
|
|
28522
|
+
init_HealthBar();
|
|
28674
28523
|
init_Typography();
|
|
28675
28524
|
init_Box();
|
|
28676
28525
|
init_Stack();
|
|
@@ -28765,31 +28614,31 @@ function GameCanvas2D({
|
|
|
28765
28614
|
assetBaseUrl,
|
|
28766
28615
|
className
|
|
28767
28616
|
}) {
|
|
28768
|
-
const canvasRef =
|
|
28769
|
-
const rafRef =
|
|
28770
|
-
const frameRef =
|
|
28771
|
-
const lastTimeRef =
|
|
28772
|
-
const imageCache =
|
|
28617
|
+
const canvasRef = React88.useRef(null);
|
|
28618
|
+
const rafRef = React88.useRef(0);
|
|
28619
|
+
const frameRef = React88.useRef(0);
|
|
28620
|
+
const lastTimeRef = React88.useRef(0);
|
|
28621
|
+
const imageCache = React88.useRef(/* @__PURE__ */ new Map());
|
|
28773
28622
|
const emit = useEmitEvent();
|
|
28774
|
-
const onDrawRef =
|
|
28623
|
+
const onDrawRef = React88.useRef(onDraw);
|
|
28775
28624
|
onDrawRef.current = onDraw;
|
|
28776
|
-
const onTickRef =
|
|
28625
|
+
const onTickRef = React88.useRef(onTick);
|
|
28777
28626
|
onTickRef.current = onTick;
|
|
28778
|
-
const tickEventRef =
|
|
28627
|
+
const tickEventRef = React88.useRef(tickEvent);
|
|
28779
28628
|
tickEventRef.current = tickEvent;
|
|
28780
|
-
const drawEventRef =
|
|
28629
|
+
const drawEventRef = React88.useRef(drawEvent);
|
|
28781
28630
|
drawEventRef.current = drawEvent;
|
|
28782
|
-
const emitRef =
|
|
28631
|
+
const emitRef = React88.useRef(emit);
|
|
28783
28632
|
emitRef.current = emit;
|
|
28784
|
-
const assetBaseUrlRef =
|
|
28633
|
+
const assetBaseUrlRef = React88.useRef(assetBaseUrl);
|
|
28785
28634
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
28786
|
-
const backgroundImageRef =
|
|
28635
|
+
const backgroundImageRef = React88.useRef(backgroundImage);
|
|
28787
28636
|
backgroundImageRef.current = backgroundImage;
|
|
28788
|
-
const widthRef =
|
|
28637
|
+
const widthRef = React88.useRef(width);
|
|
28789
28638
|
widthRef.current = width;
|
|
28790
|
-
const heightRef =
|
|
28639
|
+
const heightRef = React88.useRef(height);
|
|
28791
28640
|
heightRef.current = height;
|
|
28792
|
-
const loadImage =
|
|
28641
|
+
const loadImage = React88.useCallback((url) => {
|
|
28793
28642
|
const base = assetBaseUrlRef.current;
|
|
28794
28643
|
if (!url.startsWith("http") && !base) return null;
|
|
28795
28644
|
const fullUrl = url.startsWith("http") ? url : `${base}${url}`;
|
|
@@ -28803,7 +28652,7 @@ function GameCanvas2D({
|
|
|
28803
28652
|
}
|
|
28804
28653
|
return null;
|
|
28805
28654
|
}, []);
|
|
28806
|
-
|
|
28655
|
+
React88.useEffect(() => {
|
|
28807
28656
|
const canvas = canvasRef.current;
|
|
28808
28657
|
if (!canvas) return;
|
|
28809
28658
|
const ctx = canvas.getContext("2d");
|
|
@@ -28951,26 +28800,14 @@ function HealthPanel({
|
|
|
28951
28800
|
)
|
|
28952
28801
|
}
|
|
28953
28802
|
),
|
|
28954
|
-
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */
|
|
28955
|
-
|
|
28803
|
+
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
|
|
28804
|
+
StatusEffect,
|
|
28956
28805
|
{
|
|
28806
|
+
assetUrl: effect.assetUrl,
|
|
28807
|
+
icon: effect.icon,
|
|
28808
|
+
label: effect.label,
|
|
28957
28809
|
variant: effectVariantMap[effect.variant ?? "neutral"],
|
|
28958
|
-
size: "sm"
|
|
28959
|
-
icon: effect.assetUrl ? void 0 : effect.icon,
|
|
28960
|
-
children: [
|
|
28961
|
-
effect.assetUrl && /* @__PURE__ */ jsx(
|
|
28962
|
-
"img",
|
|
28963
|
-
{
|
|
28964
|
-
src: effect.assetUrl,
|
|
28965
|
-
alt: "",
|
|
28966
|
-
width: 12,
|
|
28967
|
-
height: 12,
|
|
28968
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
28969
|
-
className: "flex-shrink-0 inline-block"
|
|
28970
|
-
}
|
|
28971
|
-
),
|
|
28972
|
-
effect.label
|
|
28973
|
-
]
|
|
28810
|
+
size: "sm"
|
|
28974
28811
|
},
|
|
28975
28812
|
i
|
|
28976
28813
|
)) })
|
|
@@ -28984,17 +28821,17 @@ var init_HealthPanel = __esm({
|
|
|
28984
28821
|
"use client";
|
|
28985
28822
|
init_cn();
|
|
28986
28823
|
init_HealthBar();
|
|
28824
|
+
init_StatusEffect();
|
|
28987
28825
|
init_Box();
|
|
28988
28826
|
init_Typography();
|
|
28989
|
-
init_Badge();
|
|
28990
28827
|
sizeMap18 = {
|
|
28991
28828
|
sm: { gap: "gap-1", padding: "px-2 py-1.5", text: "text-xs", barSize: "sm" },
|
|
28992
28829
|
md: { gap: "gap-1.5", padding: "px-3 py-2", text: "text-sm", barSize: "md" },
|
|
28993
28830
|
lg: { gap: "gap-2", padding: "px-4 py-3", text: "text-base", barSize: "lg" }
|
|
28994
28831
|
};
|
|
28995
28832
|
effectVariantMap = {
|
|
28996
|
-
buff: "
|
|
28997
|
-
debuff: "
|
|
28833
|
+
buff: "buff",
|
|
28834
|
+
debuff: "debuff",
|
|
28998
28835
|
neutral: "neutral"
|
|
28999
28836
|
};
|
|
29000
28837
|
HealthPanel.displayName = "HealthPanel";
|
|
@@ -29014,13 +28851,13 @@ function ScoreBoard({
|
|
|
29014
28851
|
const multiplier = rawMultiplier ?? 1;
|
|
29015
28852
|
const level = rawLevel ?? 1;
|
|
29016
28853
|
return /* @__PURE__ */ jsx(
|
|
29017
|
-
|
|
28854
|
+
Box,
|
|
29018
28855
|
{
|
|
29019
28856
|
className: cn(
|
|
29020
|
-
"bg-[var(--color-card)]/90
|
|
28857
|
+
"rounded-container border border-border bg-[var(--color-card)]/90 backdrop-blur-sm p-3",
|
|
29021
28858
|
className
|
|
29022
28859
|
),
|
|
29023
|
-
children: /* @__PURE__ */
|
|
28860
|
+
children: /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3 flex-wrap", children: [
|
|
29024
28861
|
/* @__PURE__ */ jsx(
|
|
29025
28862
|
StatBadge,
|
|
29026
28863
|
{
|
|
@@ -29062,7 +28899,7 @@ function ScoreBoard({
|
|
|
29062
28899
|
}
|
|
29063
28900
|
),
|
|
29064
28901
|
combo != null && combo > 0 && /* @__PURE__ */ jsx(ComboCounter, { combo, multiplier, size: "sm" })
|
|
29065
|
-
] })
|
|
28902
|
+
] })
|
|
29066
28903
|
}
|
|
29067
28904
|
);
|
|
29068
28905
|
}
|
|
@@ -29072,7 +28909,6 @@ var init_ScoreBoard = __esm({
|
|
|
29072
28909
|
init_cn();
|
|
29073
28910
|
init_ComboCounter();
|
|
29074
28911
|
init_StatBadge();
|
|
29075
|
-
init_Card();
|
|
29076
28912
|
init_Box();
|
|
29077
28913
|
ScoreBoard.displayName = "ScoreBoard";
|
|
29078
28914
|
}
|
|
@@ -29128,7 +28964,7 @@ function TurnPanel({
|
|
|
29128
28964
|
className
|
|
29129
28965
|
}) {
|
|
29130
28966
|
const eventBus = useEventBus();
|
|
29131
|
-
const handleAction =
|
|
28967
|
+
const handleAction = React88.useCallback(
|
|
29132
28968
|
(event) => {
|
|
29133
28969
|
if (event) {
|
|
29134
28970
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -29153,28 +28989,16 @@ function TurnPanel({
|
|
|
29153
28989
|
activeTeam
|
|
29154
28990
|
}
|
|
29155
28991
|
),
|
|
29156
|
-
actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */
|
|
29157
|
-
|
|
28992
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1.5 ml-auto", children: actions.map((action, i) => /* @__PURE__ */ jsx(
|
|
28993
|
+
ActionButton,
|
|
29158
28994
|
{
|
|
29159
|
-
|
|
29160
|
-
|
|
28995
|
+
label: action.label,
|
|
28996
|
+
icon: action.assetUrl ? void 0 : action.icon,
|
|
28997
|
+
assetUrl: action.assetUrl,
|
|
29161
28998
|
disabled: action.disabled,
|
|
29162
|
-
|
|
29163
|
-
|
|
29164
|
-
|
|
29165
|
-
action.assetUrl && /* @__PURE__ */ jsx(
|
|
29166
|
-
"img",
|
|
29167
|
-
{
|
|
29168
|
-
src: action.assetUrl,
|
|
29169
|
-
alt: "",
|
|
29170
|
-
width: 14,
|
|
29171
|
-
height: 14,
|
|
29172
|
-
style: { imageRendering: "pixelated", objectFit: "contain" },
|
|
29173
|
-
className: "flex-shrink-0"
|
|
29174
|
-
}
|
|
29175
|
-
),
|
|
29176
|
-
action.label
|
|
29177
|
-
]
|
|
28999
|
+
variant: "secondary",
|
|
29000
|
+
size: "sm",
|
|
29001
|
+
onClick: () => handleAction(action.event)
|
|
29178
29002
|
},
|
|
29179
29003
|
i
|
|
29180
29004
|
)) })
|
|
@@ -29188,7 +29012,7 @@ var init_TurnPanel = __esm({
|
|
|
29188
29012
|
"use client";
|
|
29189
29013
|
init_cn();
|
|
29190
29014
|
init_TurnIndicator();
|
|
29191
|
-
|
|
29015
|
+
init_ActionButton();
|
|
29192
29016
|
init_Box();
|
|
29193
29017
|
init_useEventBus();
|
|
29194
29018
|
DEFAULT_TURN_ACTIONS = [
|
|
@@ -29239,7 +29063,7 @@ function EnemyPlate({
|
|
|
29239
29063
|
}
|
|
29240
29064
|
)
|
|
29241
29065
|
] }),
|
|
29242
|
-
level != null && /* @__PURE__ */ jsxs(
|
|
29066
|
+
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: [
|
|
29243
29067
|
"Lv.",
|
|
29244
29068
|
level
|
|
29245
29069
|
] })
|
|
@@ -29270,12 +29094,12 @@ function EnemyPlate({
|
|
|
29270
29094
|
)
|
|
29271
29095
|
] }),
|
|
29272
29096
|
effects && effects.length > 0 && /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-1 flex-wrap", children: effects.map((effect, i) => /* @__PURE__ */ jsx(
|
|
29273
|
-
|
|
29097
|
+
StatusEffect,
|
|
29274
29098
|
{
|
|
29275
|
-
variant: effectVariantMap2[effect.variant ?? "neutral"],
|
|
29276
|
-
size: "sm",
|
|
29277
29099
|
icon: effect.icon,
|
|
29278
|
-
|
|
29100
|
+
label: effect.label,
|
|
29101
|
+
variant: effectVariantMap2[effect.variant ?? "neutral"],
|
|
29102
|
+
size: "sm"
|
|
29279
29103
|
},
|
|
29280
29104
|
i
|
|
29281
29105
|
)) })
|
|
@@ -29289,12 +29113,12 @@ var init_EnemyPlate = __esm({
|
|
|
29289
29113
|
"use client";
|
|
29290
29114
|
init_cn();
|
|
29291
29115
|
init_HealthBar();
|
|
29116
|
+
init_StatusEffect();
|
|
29292
29117
|
init_Box();
|
|
29293
29118
|
init_Typography();
|
|
29294
|
-
init_Badge();
|
|
29295
29119
|
effectVariantMap2 = {
|
|
29296
|
-
buff: "
|
|
29297
|
-
debuff: "
|
|
29120
|
+
buff: "buff",
|
|
29121
|
+
debuff: "debuff",
|
|
29298
29122
|
neutral: "neutral"
|
|
29299
29123
|
};
|
|
29300
29124
|
DEFAULT_ENEMY_EFFECTS = [
|
|
@@ -29309,7 +29133,7 @@ function UnitCommandBar({
|
|
|
29309
29133
|
className
|
|
29310
29134
|
}) {
|
|
29311
29135
|
const eventBus = useEventBus();
|
|
29312
|
-
const handleCommand =
|
|
29136
|
+
const handleCommand = React88.useCallback(
|
|
29313
29137
|
(event) => {
|
|
29314
29138
|
if (event) {
|
|
29315
29139
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -29324,27 +29148,18 @@ function UnitCommandBar({
|
|
|
29324
29148
|
"flex items-center gap-1.5 rounded-container bg-[var(--color-card)]/90 border border-border backdrop-blur-sm px-2 py-1.5",
|
|
29325
29149
|
className
|
|
29326
29150
|
),
|
|
29327
|
-
children: commands.map((command, i) => /* @__PURE__ */
|
|
29328
|
-
|
|
29329
|
-
|
|
29330
|
-
|
|
29331
|
-
|
|
29332
|
-
|
|
29333
|
-
|
|
29334
|
-
|
|
29335
|
-
|
|
29336
|
-
|
|
29337
|
-
|
|
29338
|
-
|
|
29339
|
-
command.hotkey && /* @__PURE__ */ jsx(
|
|
29340
|
-
Typography,
|
|
29341
|
-
{
|
|
29342
|
-
variant: "caption",
|
|
29343
|
-
className: "text-muted-foreground text-xs font-mono",
|
|
29344
|
-
children: command.hotkey
|
|
29345
|
-
}
|
|
29346
|
-
)
|
|
29347
|
-
] }, i))
|
|
29151
|
+
children: commands.map((command, i) => /* @__PURE__ */ jsx(Box, { className: "flex flex-col items-center gap-0.5", children: /* @__PURE__ */ jsx(
|
|
29152
|
+
ActionButton,
|
|
29153
|
+
{
|
|
29154
|
+
label: command.label,
|
|
29155
|
+
icon: command.icon,
|
|
29156
|
+
disabled: command.disabled,
|
|
29157
|
+
hotkey: command.hotkey,
|
|
29158
|
+
variant: "secondary",
|
|
29159
|
+
size: "sm",
|
|
29160
|
+
onClick: () => handleCommand(command.event)
|
|
29161
|
+
}
|
|
29162
|
+
) }, i))
|
|
29348
29163
|
}
|
|
29349
29164
|
);
|
|
29350
29165
|
}
|
|
@@ -29353,9 +29168,8 @@ var init_UnitCommandBar = __esm({
|
|
|
29353
29168
|
"components/game/molecules/UnitCommandBar.tsx"() {
|
|
29354
29169
|
"use client";
|
|
29355
29170
|
init_cn();
|
|
29356
|
-
|
|
29171
|
+
init_ActionButton();
|
|
29357
29172
|
init_Box();
|
|
29358
|
-
init_Typography();
|
|
29359
29173
|
init_useEventBus();
|
|
29360
29174
|
DEFAULT_COMMANDS = [
|
|
29361
29175
|
{ label: "Move", icon: "move", event: "MOVE", hotkey: "M" },
|
|
@@ -29860,7 +29674,7 @@ function GameMenu({
|
|
|
29860
29674
|
} catch {
|
|
29861
29675
|
}
|
|
29862
29676
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29863
|
-
const handleOptionClick =
|
|
29677
|
+
const handleOptionClick = React88.useCallback(
|
|
29864
29678
|
(option) => {
|
|
29865
29679
|
if (option.event && eventBus) {
|
|
29866
29680
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -29979,7 +29793,7 @@ function GameOverScreen({
|
|
|
29979
29793
|
} catch {
|
|
29980
29794
|
}
|
|
29981
29795
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
29982
|
-
const handleActionClick =
|
|
29796
|
+
const handleActionClick = React88.useCallback(
|
|
29983
29797
|
(action) => {
|
|
29984
29798
|
if (action.event && eventBus) {
|
|
29985
29799
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -30194,6 +30008,7 @@ function PlatformerCanvas({
|
|
|
30194
30008
|
rightEvent = "MOVE_RIGHT",
|
|
30195
30009
|
jumpEvent = "JUMP",
|
|
30196
30010
|
stopEvent = "STOP",
|
|
30011
|
+
effects = [],
|
|
30197
30012
|
className
|
|
30198
30013
|
}) {
|
|
30199
30014
|
const canvasRef = useRef(null);
|
|
@@ -30264,7 +30079,8 @@ function PlatformerCanvas({
|
|
|
30264
30079
|
playerSprite,
|
|
30265
30080
|
tileSprites,
|
|
30266
30081
|
backgroundImage,
|
|
30267
|
-
assetBaseUrl
|
|
30082
|
+
assetBaseUrl,
|
|
30083
|
+
effects
|
|
30268
30084
|
});
|
|
30269
30085
|
propsRef.current = {
|
|
30270
30086
|
platforms,
|
|
@@ -30277,7 +30093,8 @@ function PlatformerCanvas({
|
|
|
30277
30093
|
playerSprite,
|
|
30278
30094
|
tileSprites,
|
|
30279
30095
|
backgroundImage,
|
|
30280
|
-
assetBaseUrl
|
|
30096
|
+
assetBaseUrl,
|
|
30097
|
+
effects
|
|
30281
30098
|
};
|
|
30282
30099
|
const handleKeyDown = useCallback((e) => {
|
|
30283
30100
|
if (keysRef.current.has(e.code)) return;
|
|
@@ -30344,7 +30161,8 @@ function PlatformerCanvas({
|
|
|
30344
30161
|
bgColor: bg,
|
|
30345
30162
|
playerSprite: pSprite,
|
|
30346
30163
|
tileSprites: tSprites,
|
|
30347
|
-
backgroundImage: bgImg
|
|
30164
|
+
backgroundImage: bgImg,
|
|
30165
|
+
effects: fxList
|
|
30348
30166
|
} = propsRef.current;
|
|
30349
30167
|
const auth = playerRef.current;
|
|
30350
30168
|
const interped = positions.get("player");
|
|
@@ -30498,6 +30316,18 @@ function PlatformerCanvas({
|
|
|
30498
30316
|
ctx.arc(ppx + eyeOffsetX + 7, eyeY, eyeSize, 0, Math.PI * 2);
|
|
30499
30317
|
ctx.fill();
|
|
30500
30318
|
}
|
|
30319
|
+
for (const fx of fxList) {
|
|
30320
|
+
const fxScreenX = fx.x - camX;
|
|
30321
|
+
const fxScreenY = fx.y - camY;
|
|
30322
|
+
const alpha = Math.min(1, fx.ttl / 4);
|
|
30323
|
+
const prev = ctx.globalAlpha;
|
|
30324
|
+
ctx.globalAlpha = alpha;
|
|
30325
|
+
ctx.fillStyle = "#ffe066";
|
|
30326
|
+
ctx.beginPath();
|
|
30327
|
+
ctx.arc(fxScreenX, fxScreenY, 12, 0, Math.PI * 2);
|
|
30328
|
+
ctx.fill();
|
|
30329
|
+
ctx.globalAlpha = prev;
|
|
30330
|
+
}
|
|
30501
30331
|
};
|
|
30502
30332
|
return interp.startLoop(drawFrame);
|
|
30503
30333
|
}, [interp.startLoop, loadImage]);
|
|
@@ -30911,13 +30741,13 @@ var init_MapView = __esm({
|
|
|
30911
30741
|
shadowSize: [41, 41]
|
|
30912
30742
|
});
|
|
30913
30743
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
30914
|
-
const { useEffect:
|
|
30744
|
+
const { useEffect: useEffect81, useRef: useRef80, useCallback: useCallback126, useState: useState111 } = React88__default;
|
|
30915
30745
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
30916
30746
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
30917
30747
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
30918
30748
|
const map = useMap();
|
|
30919
30749
|
const prevRef = useRef80({ centerLat, centerLng, zoom });
|
|
30920
|
-
|
|
30750
|
+
useEffect81(() => {
|
|
30921
30751
|
const prev = prevRef.current;
|
|
30922
30752
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
30923
30753
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -30928,7 +30758,7 @@ var init_MapView = __esm({
|
|
|
30928
30758
|
}
|
|
30929
30759
|
function MapClickHandler({ onMapClick }) {
|
|
30930
30760
|
const map = useMap();
|
|
30931
|
-
|
|
30761
|
+
useEffect81(() => {
|
|
30932
30762
|
if (!onMapClick) return;
|
|
30933
30763
|
const handler = (e) => {
|
|
30934
30764
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -30956,7 +30786,7 @@ var init_MapView = __esm({
|
|
|
30956
30786
|
showAttribution = true
|
|
30957
30787
|
}) {
|
|
30958
30788
|
const eventBus = useEventBus3();
|
|
30959
|
-
const [clickedPosition, setClickedPosition] =
|
|
30789
|
+
const [clickedPosition, setClickedPosition] = useState111(null);
|
|
30960
30790
|
const handleMapClick = useCallback126((lat, lng) => {
|
|
30961
30791
|
if (showClickedPin) {
|
|
30962
30792
|
setClickedPosition({ lat, lng });
|
|
@@ -31826,8 +31656,8 @@ function TableView({
|
|
|
31826
31656
|
}) {
|
|
31827
31657
|
const eventBus = useEventBus();
|
|
31828
31658
|
const { t } = useTranslate();
|
|
31829
|
-
const [visibleCount, setVisibleCount] =
|
|
31830
|
-
const [localSelected, setLocalSelected] =
|
|
31659
|
+
const [visibleCount, setVisibleCount] = React88__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
31660
|
+
const [localSelected, setLocalSelected] = React88__default.useState(/* @__PURE__ */ new Set());
|
|
31831
31661
|
const colDefs = columns ?? fields ?? [];
|
|
31832
31662
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
31833
31663
|
const dnd = useDataDnd({
|
|
@@ -32022,12 +31852,12 @@ function TableView({
|
|
|
32022
31852
|
]
|
|
32023
31853
|
}
|
|
32024
31854
|
);
|
|
32025
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31855
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React88__default.Fragment, { children: rowInner }, id);
|
|
32026
31856
|
};
|
|
32027
31857
|
const items = Array.from(data);
|
|
32028
31858
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
32029
31859
|
let runningIndex = 0;
|
|
32030
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31860
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
32031
31861
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
32032
31862
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
32033
31863
|
] }, gi)) });
|
|
@@ -33384,7 +33214,7 @@ var init_StepFlow = __esm({
|
|
|
33384
33214
|
className
|
|
33385
33215
|
}) => {
|
|
33386
33216
|
if (orientation === "vertical") {
|
|
33387
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
33217
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React88__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
33388
33218
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
33389
33219
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33390
33220
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -33395,7 +33225,7 @@ var init_StepFlow = __esm({
|
|
|
33395
33225
|
] })
|
|
33396
33226
|
] }) }, index)) });
|
|
33397
33227
|
}
|
|
33398
|
-
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(
|
|
33228
|
+
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(React88__default.Fragment, { children: [
|
|
33399
33229
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
33400
33230
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
33401
33231
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -34380,7 +34210,7 @@ var init_LikertScale = __esm({
|
|
|
34380
34210
|
md: "text-base",
|
|
34381
34211
|
lg: "text-lg"
|
|
34382
34212
|
};
|
|
34383
|
-
LikertScale =
|
|
34213
|
+
LikertScale = React88__default.forwardRef(
|
|
34384
34214
|
({
|
|
34385
34215
|
question,
|
|
34386
34216
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -34392,7 +34222,7 @@ var init_LikertScale = __esm({
|
|
|
34392
34222
|
variant = "radios",
|
|
34393
34223
|
className
|
|
34394
34224
|
}, ref) => {
|
|
34395
|
-
const groupId =
|
|
34225
|
+
const groupId = React88__default.useId();
|
|
34396
34226
|
const eventBus = useEventBus();
|
|
34397
34227
|
const handleSelect = useCallback(
|
|
34398
34228
|
(next) => {
|
|
@@ -36674,7 +36504,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
36674
36504
|
"aria-label": t("aria.breadcrumb"),
|
|
36675
36505
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
36676
36506
|
const isLast = idx === items.length - 1;
|
|
36677
|
-
return /* @__PURE__ */ jsxs(
|
|
36507
|
+
return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
36678
36508
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
36679
36509
|
Icon,
|
|
36680
36510
|
{
|
|
@@ -37543,7 +37373,7 @@ var init_MiniStateMachine = __esm({
|
|
|
37543
37373
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
37544
37374
|
const tc = transitionCounts[s.name] ?? 0;
|
|
37545
37375
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
37546
|
-
return /* @__PURE__ */ jsxs(
|
|
37376
|
+
return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
37547
37377
|
/* @__PURE__ */ jsx(
|
|
37548
37378
|
AvlState,
|
|
37549
37379
|
{
|
|
@@ -37747,7 +37577,7 @@ var init_PageHeader = __esm({
|
|
|
37747
37577
|
info: "bg-info/10 text-info"
|
|
37748
37578
|
};
|
|
37749
37579
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
37750
|
-
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(
|
|
37580
|
+
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(React88__default.Fragment, { children: [
|
|
37751
37581
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
37752
37582
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
37753
37583
|
"a",
|
|
@@ -38105,7 +37935,7 @@ var init_Section = __esm({
|
|
|
38105
37935
|
as: Component2 = "section"
|
|
38106
37936
|
}) => {
|
|
38107
37937
|
const hasHeader = title || description || action;
|
|
38108
|
-
return
|
|
37938
|
+
return React88__default.createElement(
|
|
38109
37939
|
Component2,
|
|
38110
37940
|
{
|
|
38111
37941
|
className: cn(
|
|
@@ -38473,7 +38303,7 @@ var init_WizardContainer = __esm({
|
|
|
38473
38303
|
const isCompleted = index < currentStep;
|
|
38474
38304
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
38475
38305
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
38476
|
-
return /* @__PURE__ */ jsxs(
|
|
38306
|
+
return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
38477
38307
|
/* @__PURE__ */ jsx(
|
|
38478
38308
|
Button,
|
|
38479
38309
|
{
|
|
@@ -41052,7 +40882,7 @@ var init_DetailPanel = __esm({
|
|
|
41052
40882
|
}
|
|
41053
40883
|
});
|
|
41054
40884
|
function extractTitle(children) {
|
|
41055
|
-
if (!
|
|
40885
|
+
if (!React88__default.isValidElement(children)) return void 0;
|
|
41056
40886
|
const props = children.props;
|
|
41057
40887
|
if (typeof props.title === "string") {
|
|
41058
40888
|
return props.title;
|
|
@@ -41107,7 +40937,7 @@ function LinearView({
|
|
|
41107
40937
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
41108
40938
|
const isDone = i < currentIdx;
|
|
41109
40939
|
const isCurrent = i === currentIdx;
|
|
41110
|
-
return /* @__PURE__ */ jsxs(
|
|
40940
|
+
return /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
41111
40941
|
i > 0 && /* @__PURE__ */ jsx(
|
|
41112
40942
|
Typography,
|
|
41113
40943
|
{
|
|
@@ -42093,12 +41923,12 @@ var init_Form = __esm({
|
|
|
42093
41923
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42094
41924
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42095
41925
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42096
|
-
const normalizedInitialData =
|
|
41926
|
+
const normalizedInitialData = React88__default.useMemo(() => {
|
|
42097
41927
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42098
41928
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42099
41929
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42100
41930
|
}, [entity, initialData]);
|
|
42101
|
-
const entityDerivedFields =
|
|
41931
|
+
const entityDerivedFields = React88__default.useMemo(() => {
|
|
42102
41932
|
if (fields && fields.length > 0) return void 0;
|
|
42103
41933
|
if (!resolvedEntity) return void 0;
|
|
42104
41934
|
return resolvedEntity.fields.map(
|
|
@@ -42119,16 +41949,16 @@ var init_Form = __esm({
|
|
|
42119
41949
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42120
41950
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42121
41951
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42122
|
-
const [formData, setFormData] =
|
|
41952
|
+
const [formData, setFormData] = React88__default.useState(
|
|
42123
41953
|
normalizedInitialData
|
|
42124
41954
|
);
|
|
42125
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41955
|
+
const [collapsedSections, setCollapsedSections] = React88__default.useState(
|
|
42126
41956
|
/* @__PURE__ */ new Set()
|
|
42127
41957
|
);
|
|
42128
|
-
const [submitError, setSubmitError] =
|
|
42129
|
-
const formRef =
|
|
41958
|
+
const [submitError, setSubmitError] = React88__default.useState(null);
|
|
41959
|
+
const formRef = React88__default.useRef(null);
|
|
42130
41960
|
const formMode = props.mode;
|
|
42131
|
-
const mountedRef =
|
|
41961
|
+
const mountedRef = React88__default.useRef(false);
|
|
42132
41962
|
if (!mountedRef.current) {
|
|
42133
41963
|
mountedRef.current = true;
|
|
42134
41964
|
debug("forms", "mount", {
|
|
@@ -42141,7 +41971,7 @@ var init_Form = __esm({
|
|
|
42141
41971
|
});
|
|
42142
41972
|
}
|
|
42143
41973
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42144
|
-
const evalContext =
|
|
41974
|
+
const evalContext = React88__default.useMemo(
|
|
42145
41975
|
() => ({
|
|
42146
41976
|
formValues: formData,
|
|
42147
41977
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42150,7 +41980,7 @@ var init_Form = __esm({
|
|
|
42150
41980
|
}),
|
|
42151
41981
|
[formData, externalContext]
|
|
42152
41982
|
);
|
|
42153
|
-
|
|
41983
|
+
React88__default.useEffect(() => {
|
|
42154
41984
|
debug("forms", "initialData-sync", {
|
|
42155
41985
|
mode: formMode,
|
|
42156
41986
|
normalizedInitialData,
|
|
@@ -42161,7 +41991,7 @@ var init_Form = __esm({
|
|
|
42161
41991
|
setFormData(normalizedInitialData);
|
|
42162
41992
|
}
|
|
42163
41993
|
}, [normalizedInitialData]);
|
|
42164
|
-
const processCalculations =
|
|
41994
|
+
const processCalculations = React88__default.useCallback(
|
|
42165
41995
|
(changedFieldId, newFormData) => {
|
|
42166
41996
|
if (!hiddenCalculations.length) return;
|
|
42167
41997
|
const context = {
|
|
@@ -42186,7 +42016,7 @@ var init_Form = __esm({
|
|
|
42186
42016
|
},
|
|
42187
42017
|
[hiddenCalculations, externalContext, eventBus]
|
|
42188
42018
|
);
|
|
42189
|
-
const checkViolations =
|
|
42019
|
+
const checkViolations = React88__default.useCallback(
|
|
42190
42020
|
(changedFieldId, newFormData) => {
|
|
42191
42021
|
if (!violationTriggers.length) return;
|
|
42192
42022
|
const context = {
|
|
@@ -42224,7 +42054,7 @@ var init_Form = __esm({
|
|
|
42224
42054
|
processCalculations(name, newFormData);
|
|
42225
42055
|
checkViolations(name, newFormData);
|
|
42226
42056
|
};
|
|
42227
|
-
const isFieldVisible =
|
|
42057
|
+
const isFieldVisible = React88__default.useCallback(
|
|
42228
42058
|
(fieldName) => {
|
|
42229
42059
|
const condition = conditionalFields[fieldName];
|
|
42230
42060
|
if (!condition) return true;
|
|
@@ -42232,7 +42062,7 @@ var init_Form = __esm({
|
|
|
42232
42062
|
},
|
|
42233
42063
|
[conditionalFields, evalContext]
|
|
42234
42064
|
);
|
|
42235
|
-
const isSectionVisible =
|
|
42065
|
+
const isSectionVisible = React88__default.useCallback(
|
|
42236
42066
|
(section) => {
|
|
42237
42067
|
if (!section.condition) return true;
|
|
42238
42068
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42308,7 +42138,7 @@ var init_Form = __esm({
|
|
|
42308
42138
|
eventBus.emit(`UI:${onCancel}`);
|
|
42309
42139
|
}
|
|
42310
42140
|
};
|
|
42311
|
-
const renderField =
|
|
42141
|
+
const renderField = React88__default.useCallback(
|
|
42312
42142
|
(field) => {
|
|
42313
42143
|
const fieldName = field.name || field.field;
|
|
42314
42144
|
if (!fieldName) return null;
|
|
@@ -42329,7 +42159,7 @@ var init_Form = __esm({
|
|
|
42329
42159
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42330
42160
|
);
|
|
42331
42161
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42332
|
-
const normalizedFields =
|
|
42162
|
+
const normalizedFields = React88__default.useMemo(() => {
|
|
42333
42163
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42334
42164
|
return effectiveFields.map((field) => {
|
|
42335
42165
|
if (typeof field === "string") {
|
|
@@ -42353,7 +42183,7 @@ var init_Form = __esm({
|
|
|
42353
42183
|
return field;
|
|
42354
42184
|
});
|
|
42355
42185
|
}, [effectiveFields, resolvedEntity]);
|
|
42356
|
-
const schemaFields =
|
|
42186
|
+
const schemaFields = React88__default.useMemo(() => {
|
|
42357
42187
|
if (normalizedFields.length === 0) return null;
|
|
42358
42188
|
if (isDebugEnabled()) {
|
|
42359
42189
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42363,7 +42193,7 @@ var init_Form = __esm({
|
|
|
42363
42193
|
}
|
|
42364
42194
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42365
42195
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42366
|
-
const sectionElements =
|
|
42196
|
+
const sectionElements = React88__default.useMemo(() => {
|
|
42367
42197
|
if (!sections || sections.length === 0) return null;
|
|
42368
42198
|
return sections.map((section) => {
|
|
42369
42199
|
if (!isSectionVisible(section)) {
|
|
@@ -43884,7 +43714,6 @@ var init_GameCanvas3D2 = __esm({
|
|
|
43884
43714
|
className,
|
|
43885
43715
|
isLoading: externalLoading,
|
|
43886
43716
|
error: externalError,
|
|
43887
|
-
entity,
|
|
43888
43717
|
preloadAssets = [],
|
|
43889
43718
|
tileClickEvent,
|
|
43890
43719
|
unitClickEvent,
|
|
@@ -44620,7 +44449,7 @@ var init_GameBoard3D = __esm({
|
|
|
44620
44449
|
}
|
|
44621
44450
|
});
|
|
44622
44451
|
function asDescriptor(v) {
|
|
44623
|
-
if (Array.isArray(v) ||
|
|
44452
|
+
if (Array.isArray(v) || React88__default.isValidElement(v)) return null;
|
|
44624
44453
|
const o = v;
|
|
44625
44454
|
if (typeof o.type !== "string") return null;
|
|
44626
44455
|
const props = o.props !== void 0 && typeof o.props === "object" && !Array.isArray(o.props) && o.props !== null ? o.props : void 0;
|
|
@@ -44635,10 +44464,10 @@ function getSlotContentRenderer2() {
|
|
|
44635
44464
|
}
|
|
44636
44465
|
function resolveDescriptor(value, idPrefix) {
|
|
44637
44466
|
if (value === null || value === void 0) return value;
|
|
44638
|
-
if (
|
|
44467
|
+
if (React88__default.isValidElement(value)) return value;
|
|
44639
44468
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44640
44469
|
if (Array.isArray(value)) {
|
|
44641
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44470
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React88__default.Fragment, { children: resolveDescriptor(item, `${idPrefix}-${i}`) }, i));
|
|
44642
44471
|
}
|
|
44643
44472
|
if (typeof value === "object" && value !== null) {
|
|
44644
44473
|
const desc = asDescriptor(value);
|
|
@@ -44738,10 +44567,10 @@ function getSlotContentRenderer3() {
|
|
|
44738
44567
|
}
|
|
44739
44568
|
function resolveDescriptor2(value, idPrefix) {
|
|
44740
44569
|
if (value === null || value === void 0) return value;
|
|
44741
|
-
if (
|
|
44570
|
+
if (React88__default.isValidElement(value)) return value;
|
|
44742
44571
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") return value;
|
|
44743
44572
|
if (Array.isArray(value)) {
|
|
44744
|
-
return value.map((item, i) => /* @__PURE__ */ jsx(
|
|
44573
|
+
return value.map((item, i) => /* @__PURE__ */ jsx(React88__default.Fragment, { children: resolveDescriptor2(item, `${idPrefix}-${i}`) }, i));
|
|
44745
44574
|
}
|
|
44746
44575
|
if (typeof value === "object") {
|
|
44747
44576
|
const rec = value;
|
|
@@ -45454,7 +45283,7 @@ var init_List = __esm({
|
|
|
45454
45283
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
45455
45284
|
return [];
|
|
45456
45285
|
}, [entity]);
|
|
45457
|
-
const getItemActions =
|
|
45286
|
+
const getItemActions = React88__default.useCallback(
|
|
45458
45287
|
(item) => {
|
|
45459
45288
|
if (!itemActions) return [];
|
|
45460
45289
|
if (typeof itemActions === "function") {
|
|
@@ -45971,7 +45800,7 @@ var init_MediaGallery = __esm({
|
|
|
45971
45800
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
45972
45801
|
);
|
|
45973
45802
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45974
|
-
const items =
|
|
45803
|
+
const items = React88__default.useMemo(() => {
|
|
45975
45804
|
if (propItems) return propItems;
|
|
45976
45805
|
if (entityData.length === 0) return [];
|
|
45977
45806
|
return entityData.map((record, idx) => {
|
|
@@ -46176,7 +46005,7 @@ var init_MinigolfBoard = __esm({
|
|
|
46176
46005
|
}
|
|
46177
46006
|
});
|
|
46178
46007
|
function extractTitle2(children) {
|
|
46179
|
-
if (!
|
|
46008
|
+
if (!React88__default.isValidElement(children)) return void 0;
|
|
46180
46009
|
const props = children.props;
|
|
46181
46010
|
if (typeof props.title === "string") {
|
|
46182
46011
|
return props.title;
|
|
@@ -47358,7 +47187,7 @@ var init_debugRegistry = __esm({
|
|
|
47358
47187
|
}
|
|
47359
47188
|
});
|
|
47360
47189
|
function useDebugData() {
|
|
47361
|
-
const [data, setData] =
|
|
47190
|
+
const [data, setData] = React88.useState(() => ({
|
|
47362
47191
|
traits: [],
|
|
47363
47192
|
ticks: [],
|
|
47364
47193
|
guards: [],
|
|
@@ -47372,7 +47201,7 @@ function useDebugData() {
|
|
|
47372
47201
|
},
|
|
47373
47202
|
lastUpdate: Date.now()
|
|
47374
47203
|
}));
|
|
47375
|
-
|
|
47204
|
+
React88.useEffect(() => {
|
|
47376
47205
|
const updateData = () => {
|
|
47377
47206
|
setData({
|
|
47378
47207
|
traits: getAllTraits(),
|
|
@@ -47481,12 +47310,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
47481
47310
|
return positions;
|
|
47482
47311
|
}
|
|
47483
47312
|
function WalkMinimap() {
|
|
47484
|
-
const [walkStep, setWalkStep] =
|
|
47485
|
-
const [traits2, setTraits] =
|
|
47486
|
-
const [coveredEdges, setCoveredEdges] =
|
|
47487
|
-
const [completedTraits, setCompletedTraits] =
|
|
47488
|
-
const prevTraitRef =
|
|
47489
|
-
|
|
47313
|
+
const [walkStep, setWalkStep] = React88.useState(null);
|
|
47314
|
+
const [traits2, setTraits] = React88.useState([]);
|
|
47315
|
+
const [coveredEdges, setCoveredEdges] = React88.useState([]);
|
|
47316
|
+
const [completedTraits, setCompletedTraits] = React88.useState(/* @__PURE__ */ new Set());
|
|
47317
|
+
const prevTraitRef = React88.useRef(null);
|
|
47318
|
+
React88.useEffect(() => {
|
|
47490
47319
|
const interval = setInterval(() => {
|
|
47491
47320
|
const w = window;
|
|
47492
47321
|
const step = w.__orbitalWalkStep;
|
|
@@ -47922,15 +47751,15 @@ var init_EntitiesTab = __esm({
|
|
|
47922
47751
|
});
|
|
47923
47752
|
function EventFlowTab({ events: events2 }) {
|
|
47924
47753
|
const { t } = useTranslate();
|
|
47925
|
-
const [filter, setFilter] =
|
|
47926
|
-
const containerRef =
|
|
47927
|
-
const [autoScroll, setAutoScroll] =
|
|
47928
|
-
|
|
47754
|
+
const [filter, setFilter] = React88.useState("all");
|
|
47755
|
+
const containerRef = React88.useRef(null);
|
|
47756
|
+
const [autoScroll, setAutoScroll] = React88.useState(true);
|
|
47757
|
+
React88.useEffect(() => {
|
|
47929
47758
|
if (autoScroll && containerRef.current) {
|
|
47930
47759
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
47931
47760
|
}
|
|
47932
47761
|
}, [events2.length, autoScroll]);
|
|
47933
|
-
const filteredEvents =
|
|
47762
|
+
const filteredEvents = React88.useMemo(() => {
|
|
47934
47763
|
if (filter === "all") return events2;
|
|
47935
47764
|
return events2.filter((e) => e.type === filter);
|
|
47936
47765
|
}, [events2, filter]);
|
|
@@ -48046,7 +47875,7 @@ var init_EventFlowTab = __esm({
|
|
|
48046
47875
|
});
|
|
48047
47876
|
function GuardsPanel({ guards }) {
|
|
48048
47877
|
const { t } = useTranslate();
|
|
48049
|
-
const [filter, setFilter] =
|
|
47878
|
+
const [filter, setFilter] = React88.useState("all");
|
|
48050
47879
|
if (guards.length === 0) {
|
|
48051
47880
|
return /* @__PURE__ */ jsx(
|
|
48052
47881
|
EmptyState,
|
|
@@ -48059,7 +47888,7 @@ function GuardsPanel({ guards }) {
|
|
|
48059
47888
|
}
|
|
48060
47889
|
const passedCount = guards.filter((g) => g.result).length;
|
|
48061
47890
|
const failedCount = guards.length - passedCount;
|
|
48062
|
-
const filteredGuards =
|
|
47891
|
+
const filteredGuards = React88.useMemo(() => {
|
|
48063
47892
|
if (filter === "all") return guards;
|
|
48064
47893
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
48065
47894
|
return guards.filter((g) => !g.result);
|
|
@@ -48222,10 +48051,10 @@ function EffectBadge({ effect }) {
|
|
|
48222
48051
|
}
|
|
48223
48052
|
function TransitionTimeline({ transitions }) {
|
|
48224
48053
|
const { t } = useTranslate();
|
|
48225
|
-
const containerRef =
|
|
48226
|
-
const [autoScroll, setAutoScroll] =
|
|
48227
|
-
const [expandedId, setExpandedId] =
|
|
48228
|
-
|
|
48054
|
+
const containerRef = React88.useRef(null);
|
|
48055
|
+
const [autoScroll, setAutoScroll] = React88.useState(true);
|
|
48056
|
+
const [expandedId, setExpandedId] = React88.useState(null);
|
|
48057
|
+
React88.useEffect(() => {
|
|
48229
48058
|
if (autoScroll && containerRef.current) {
|
|
48230
48059
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
48231
48060
|
}
|
|
@@ -48505,9 +48334,9 @@ function getAllEvents(traits2) {
|
|
|
48505
48334
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
48506
48335
|
const eventBus = useEventBus();
|
|
48507
48336
|
const { t } = useTranslate();
|
|
48508
|
-
const [log13, setLog] =
|
|
48509
|
-
const prevStatesRef =
|
|
48510
|
-
|
|
48337
|
+
const [log13, setLog] = React88.useState([]);
|
|
48338
|
+
const prevStatesRef = React88.useRef(/* @__PURE__ */ new Map());
|
|
48339
|
+
React88.useEffect(() => {
|
|
48511
48340
|
for (const trait of traits2) {
|
|
48512
48341
|
const prev = prevStatesRef.current.get(trait.id);
|
|
48513
48342
|
if (prev && prev !== trait.currentState) {
|
|
@@ -48676,10 +48505,10 @@ function VerifyModePanel({
|
|
|
48676
48505
|
localCount
|
|
48677
48506
|
}) {
|
|
48678
48507
|
const { t } = useTranslate();
|
|
48679
|
-
const [expanded, setExpanded] =
|
|
48680
|
-
const scrollRef =
|
|
48681
|
-
const prevCountRef =
|
|
48682
|
-
|
|
48508
|
+
const [expanded, setExpanded] = React88.useState(true);
|
|
48509
|
+
const scrollRef = React88.useRef(null);
|
|
48510
|
+
const prevCountRef = React88.useRef(0);
|
|
48511
|
+
React88.useEffect(() => {
|
|
48683
48512
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
48684
48513
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
48685
48514
|
}
|
|
@@ -48736,10 +48565,10 @@ function RuntimeDebugger({
|
|
|
48736
48565
|
schema
|
|
48737
48566
|
}) {
|
|
48738
48567
|
const { t } = useTranslate();
|
|
48739
|
-
const [isCollapsed, setIsCollapsed] =
|
|
48740
|
-
const [isVisible, setIsVisible] =
|
|
48568
|
+
const [isCollapsed, setIsCollapsed] = React88.useState(mode === "verify" ? true : defaultCollapsed);
|
|
48569
|
+
const [isVisible, setIsVisible] = React88.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
48741
48570
|
const debugData = useDebugData();
|
|
48742
|
-
|
|
48571
|
+
React88.useEffect(() => {
|
|
48743
48572
|
if (mode === "inline") return;
|
|
48744
48573
|
return onDebugToggle((enabled) => {
|
|
48745
48574
|
setIsVisible(enabled);
|
|
@@ -48748,7 +48577,7 @@ function RuntimeDebugger({
|
|
|
48748
48577
|
}
|
|
48749
48578
|
});
|
|
48750
48579
|
}, [mode]);
|
|
48751
|
-
|
|
48580
|
+
React88.useEffect(() => {
|
|
48752
48581
|
if (mode === "inline") return;
|
|
48753
48582
|
const handleKeyDown = (e) => {
|
|
48754
48583
|
if (e.key === "`" && isVisible) {
|
|
@@ -49308,7 +49137,7 @@ function SequenceBar({
|
|
|
49308
49137
|
onSlotRemove(index);
|
|
49309
49138
|
}, [onSlotRemove, playing]);
|
|
49310
49139
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
49311
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
49140
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React88__default.Fragment, { children: [
|
|
49312
49141
|
i > 0 && /* @__PURE__ */ jsx(
|
|
49313
49142
|
Typography,
|
|
49314
49143
|
{
|
|
@@ -50397,7 +50226,7 @@ var init_StatCard = __esm({
|
|
|
50397
50226
|
const labelToUse = propLabel ?? propTitle;
|
|
50398
50227
|
const eventBus = useEventBus();
|
|
50399
50228
|
const { t } = useTranslate();
|
|
50400
|
-
const handleActionClick =
|
|
50229
|
+
const handleActionClick = React88__default.useCallback(() => {
|
|
50401
50230
|
if (action?.event) {
|
|
50402
50231
|
eventBus.emit(`UI:${action.event}`, {});
|
|
50403
50232
|
}
|
|
@@ -50408,7 +50237,7 @@ var init_StatCard = __esm({
|
|
|
50408
50237
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
50409
50238
|
const isLoading = externalLoading ?? false;
|
|
50410
50239
|
const error = externalError;
|
|
50411
|
-
const computeMetricValue =
|
|
50240
|
+
const computeMetricValue = React88__default.useCallback(
|
|
50412
50241
|
(metric, items) => {
|
|
50413
50242
|
if (metric.value !== void 0) {
|
|
50414
50243
|
return metric.value;
|
|
@@ -50447,7 +50276,7 @@ var init_StatCard = __esm({
|
|
|
50447
50276
|
},
|
|
50448
50277
|
[]
|
|
50449
50278
|
);
|
|
50450
|
-
const schemaStats =
|
|
50279
|
+
const schemaStats = React88__default.useMemo(() => {
|
|
50451
50280
|
if (!metrics || metrics.length === 0) return null;
|
|
50452
50281
|
return metrics.map((metric) => ({
|
|
50453
50282
|
label: metric.label,
|
|
@@ -50455,7 +50284,7 @@ var init_StatCard = __esm({
|
|
|
50455
50284
|
format: metric.format
|
|
50456
50285
|
}));
|
|
50457
50286
|
}, [metrics, data, computeMetricValue]);
|
|
50458
|
-
const calculatedTrend =
|
|
50287
|
+
const calculatedTrend = React88__default.useMemo(() => {
|
|
50459
50288
|
if (manualTrend !== void 0) return manualTrend;
|
|
50460
50289
|
if (previousValue === void 0 || currentValue === void 0)
|
|
50461
50290
|
return void 0;
|
|
@@ -51661,8 +51490,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51661
51490
|
] });
|
|
51662
51491
|
};
|
|
51663
51492
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
51664
|
-
const endRef =
|
|
51665
|
-
|
|
51493
|
+
const endRef = React88__default.useRef(null);
|
|
51494
|
+
React88__default.useEffect(() => {
|
|
51666
51495
|
if (!autoScroll) return;
|
|
51667
51496
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51668
51497
|
}, [activities.length, autoScroll]);
|
|
@@ -51756,7 +51585,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
51756
51585
|
};
|
|
51757
51586
|
SubagentRichCard = ({ subagent }) => {
|
|
51758
51587
|
const { t } = useTranslate();
|
|
51759
|
-
const activities =
|
|
51588
|
+
const activities = React88__default.useMemo(
|
|
51760
51589
|
() => subagentMessagesToActivities(subagent.messages),
|
|
51761
51590
|
[subagent.messages]
|
|
51762
51591
|
);
|
|
@@ -51833,8 +51662,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
51833
51662
|
] });
|
|
51834
51663
|
};
|
|
51835
51664
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
51836
|
-
const endRef =
|
|
51837
|
-
|
|
51665
|
+
const endRef = React88__default.useRef(null);
|
|
51666
|
+
React88__default.useEffect(() => {
|
|
51838
51667
|
if (!autoScroll) return;
|
|
51839
51668
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
51840
51669
|
}, [messages.length, autoScroll]);
|
|
@@ -52306,7 +52135,7 @@ var init_Timeline = __esm({
|
|
|
52306
52135
|
}) => {
|
|
52307
52136
|
const { t } = useTranslate();
|
|
52308
52137
|
const entityData = entity ?? [];
|
|
52309
|
-
const items =
|
|
52138
|
+
const items = React88__default.useMemo(() => {
|
|
52310
52139
|
if (propItems) return propItems;
|
|
52311
52140
|
if (entityData.length === 0) return [];
|
|
52312
52141
|
return entityData.map((record, idx) => {
|
|
@@ -52408,7 +52237,7 @@ var init_Timeline = __esm({
|
|
|
52408
52237
|
}
|
|
52409
52238
|
});
|
|
52410
52239
|
function extractToastProps(children) {
|
|
52411
|
-
if (!
|
|
52240
|
+
if (!React88__default.isValidElement(children)) {
|
|
52412
52241
|
if (typeof children === "string") {
|
|
52413
52242
|
return { message: children };
|
|
52414
52243
|
}
|
|
@@ -52446,7 +52275,7 @@ var init_ToastSlot = __esm({
|
|
|
52446
52275
|
eventBus.emit("UI:CLOSE");
|
|
52447
52276
|
};
|
|
52448
52277
|
if (!isVisible) return null;
|
|
52449
|
-
const isCustomContent =
|
|
52278
|
+
const isCustomContent = React88__default.isValidElement(children) && !message;
|
|
52450
52279
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
52451
52280
|
Toast,
|
|
52452
52281
|
{
|
|
@@ -54063,7 +53892,7 @@ var init_WorldMapTemplate = __esm({
|
|
|
54063
53892
|
}
|
|
54064
53893
|
});
|
|
54065
53894
|
function lazyThree(name, loader) {
|
|
54066
|
-
const Lazy =
|
|
53895
|
+
const Lazy = React88__default.lazy(
|
|
54067
53896
|
() => loader().then((m) => {
|
|
54068
53897
|
const Resolved = m[name];
|
|
54069
53898
|
if (!Resolved) {
|
|
@@ -54075,13 +53904,13 @@ function lazyThree(name, loader) {
|
|
|
54075
53904
|
})
|
|
54076
53905
|
);
|
|
54077
53906
|
function ThreeWrapper(props) {
|
|
54078
|
-
return
|
|
53907
|
+
return React88__default.createElement(
|
|
54079
53908
|
ThreeBoundary,
|
|
54080
53909
|
{ name },
|
|
54081
|
-
|
|
54082
|
-
|
|
53910
|
+
React88__default.createElement(
|
|
53911
|
+
React88__default.Suspense,
|
|
54083
53912
|
{ fallback: null },
|
|
54084
|
-
|
|
53913
|
+
React88__default.createElement(Lazy, props)
|
|
54085
53914
|
)
|
|
54086
53915
|
);
|
|
54087
53916
|
}
|
|
@@ -54404,7 +54233,7 @@ var init_component_registry_generated = __esm({
|
|
|
54404
54233
|
init_WorldMapBoard();
|
|
54405
54234
|
init_WorldMapTemplate();
|
|
54406
54235
|
init_XPBar();
|
|
54407
|
-
ThreeBoundary = class extends
|
|
54236
|
+
ThreeBoundary = class extends React88__default.Component {
|
|
54408
54237
|
constructor() {
|
|
54409
54238
|
super(...arguments);
|
|
54410
54239
|
__publicField(this, "state", { failed: false });
|
|
@@ -54414,7 +54243,7 @@ var init_component_registry_generated = __esm({
|
|
|
54414
54243
|
}
|
|
54415
54244
|
render() {
|
|
54416
54245
|
if (this.state.failed) {
|
|
54417
|
-
return
|
|
54246
|
+
return React88__default.createElement(
|
|
54418
54247
|
"div",
|
|
54419
54248
|
{
|
|
54420
54249
|
"data-testid": "three-unavailable",
|
|
@@ -54780,7 +54609,7 @@ function SuspenseConfigProvider({
|
|
|
54780
54609
|
config,
|
|
54781
54610
|
children
|
|
54782
54611
|
}) {
|
|
54783
|
-
return
|
|
54612
|
+
return React88__default.createElement(
|
|
54784
54613
|
SuspenseConfigContext.Provider,
|
|
54785
54614
|
{ value: config },
|
|
54786
54615
|
children
|
|
@@ -54822,7 +54651,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
54822
54651
|
}
|
|
54823
54652
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
54824
54653
|
}
|
|
54825
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
54654
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React88__default.isValidElement(field) && !(field instanceof Date)) {
|
|
54826
54655
|
const obj = field;
|
|
54827
54656
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
54828
54657
|
if (!fieldName) return field;
|
|
@@ -55268,7 +55097,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
55268
55097
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
55269
55098
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
55270
55099
|
}
|
|
55271
|
-
return /* @__PURE__ */ jsx(
|
|
55100
|
+
return /* @__PURE__ */ jsx(React88__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
55272
55101
|
}
|
|
55273
55102
|
if (!child || typeof child !== "object") return null;
|
|
55274
55103
|
const childId = `${parentId}-${index}`;
|
|
@@ -55308,14 +55137,14 @@ function isPatternConfig(value) {
|
|
|
55308
55137
|
if (value === null || value === void 0) return false;
|
|
55309
55138
|
if (typeof value !== "object") return false;
|
|
55310
55139
|
if (Array.isArray(value)) return false;
|
|
55311
|
-
if (
|
|
55140
|
+
if (React88__default.isValidElement(value)) return false;
|
|
55312
55141
|
if (value instanceof Date) return false;
|
|
55313
55142
|
if (typeof value === "function") return false;
|
|
55314
55143
|
const record = value;
|
|
55315
55144
|
return "type" in record && typeof record.type === "string" && getComponentForPattern(record.type) !== null;
|
|
55316
55145
|
}
|
|
55317
55146
|
function isPlainConfigObject(value) {
|
|
55318
|
-
if (
|
|
55147
|
+
if (React88__default.isValidElement(value)) return false;
|
|
55319
55148
|
if (value instanceof Date) return false;
|
|
55320
55149
|
const proto = Object.getPrototypeOf(value);
|
|
55321
55150
|
return proto === Object.prototype || proto === null;
|
|
@@ -55441,7 +55270,7 @@ function SlotContentRenderer({
|
|
|
55441
55270
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
55442
55271
|
const slotVal = restProps[slotKey];
|
|
55443
55272
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
55444
|
-
if (
|
|
55273
|
+
if (React88__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
55445
55274
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
55446
55275
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
55447
55276
|
slotVal,
|
|
@@ -55490,7 +55319,7 @@ function SlotContentRenderer({
|
|
|
55490
55319
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
55491
55320
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
55492
55321
|
const sample = resolvedItems[0];
|
|
55493
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
55322
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React88__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
55494
55323
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
55495
55324
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
55496
55325
|
}
|