@almadar/ui 5.83.0 → 5.85.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 +1265 -1672
- package/dist/avl/index.js +235 -642
- package/dist/components/game/2d/atoms/ChoiceButton.d.ts +3 -1
- package/dist/components/game/2d/molecules/index.d.ts +0 -2
- package/dist/components/index.cjs +1354 -1765
- package/dist/components/index.js +311 -720
- package/dist/providers/index.cjs +1132 -1539
- package/dist/providers/index.js +211 -618
- package/dist/runtime/index.cjs +1126 -1533
- package/dist/runtime/index.js +215 -622
- package/package.json +1 -1
- package/dist/components/game/2d/organisms/CardBattlerBoard.d.ts +0 -45
- package/dist/components/game/2d/organisms/VisualNovelBoard.d.ts +0 -44
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React97 from 'react';
|
|
2
|
+
import React97__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -388,7 +388,7 @@ var init_Box = __esm({
|
|
|
388
388
|
fixed: "fixed",
|
|
389
389
|
sticky: "sticky"
|
|
390
390
|
};
|
|
391
|
-
Box =
|
|
391
|
+
Box = React97__default.forwardRef(
|
|
392
392
|
({
|
|
393
393
|
padding,
|
|
394
394
|
paddingX,
|
|
@@ -453,7 +453,7 @@ var init_Box = __esm({
|
|
|
453
453
|
onPointerDown?.(e);
|
|
454
454
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
455
455
|
const isClickable = action || onClick;
|
|
456
|
-
return
|
|
456
|
+
return React97__default.createElement(
|
|
457
457
|
Component,
|
|
458
458
|
{
|
|
459
459
|
ref,
|
|
@@ -549,7 +549,7 @@ function loadLib(key, importer) {
|
|
|
549
549
|
return p2;
|
|
550
550
|
}
|
|
551
551
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
552
|
-
const Lazy =
|
|
552
|
+
const Lazy = React97__default.lazy(async () => {
|
|
553
553
|
const lib = await loadLib(libKey, importer);
|
|
554
554
|
const Comp = pick(lib);
|
|
555
555
|
if (!Comp) {
|
|
@@ -559,7 +559,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
559
559
|
return { default: Comp };
|
|
560
560
|
});
|
|
561
561
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
562
|
-
|
|
562
|
+
React97__default.Suspense,
|
|
563
563
|
{
|
|
564
564
|
fallback: /* @__PURE__ */ jsx(
|
|
565
565
|
"span",
|
|
@@ -1290,7 +1290,7 @@ var init_Icon = __esm({
|
|
|
1290
1290
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1291
1291
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1292
1292
|
const family = useIconFamily();
|
|
1293
|
-
const RenderedComponent =
|
|
1293
|
+
const RenderedComponent = React97__default.useMemo(() => {
|
|
1294
1294
|
if (directIcon) return null;
|
|
1295
1295
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1296
1296
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1352,7 +1352,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1352
1352
|
const IconComp = value;
|
|
1353
1353
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1354
1354
|
}
|
|
1355
|
-
if (
|
|
1355
|
+
if (React97__default.isValidElement(value)) {
|
|
1356
1356
|
return value;
|
|
1357
1357
|
}
|
|
1358
1358
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1428,7 +1428,7 @@ var init_Button = __esm({
|
|
|
1428
1428
|
md: "h-icon-default w-icon-default",
|
|
1429
1429
|
lg: "h-icon-default w-icon-default"
|
|
1430
1430
|
};
|
|
1431
|
-
Button =
|
|
1431
|
+
Button = React97__default.forwardRef(
|
|
1432
1432
|
({
|
|
1433
1433
|
className,
|
|
1434
1434
|
variant = "primary",
|
|
@@ -1496,7 +1496,7 @@ var Dialog;
|
|
|
1496
1496
|
var init_Dialog = __esm({
|
|
1497
1497
|
"components/core/atoms/Dialog.tsx"() {
|
|
1498
1498
|
init_cn();
|
|
1499
|
-
Dialog =
|
|
1499
|
+
Dialog = React97__default.forwardRef(
|
|
1500
1500
|
({
|
|
1501
1501
|
role = "dialog",
|
|
1502
1502
|
"aria-modal": ariaModal = true,
|
|
@@ -1614,7 +1614,7 @@ var init_Typography = __esm({
|
|
|
1614
1614
|
}) => {
|
|
1615
1615
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1616
1616
|
const Component = as || defaultElements[variant];
|
|
1617
|
-
return
|
|
1617
|
+
return React97__default.createElement(
|
|
1618
1618
|
Component,
|
|
1619
1619
|
{
|
|
1620
1620
|
id,
|
|
@@ -2109,7 +2109,7 @@ var init_Badge = __esm({
|
|
|
2109
2109
|
md: "px-2.5 py-1 text-sm",
|
|
2110
2110
|
lg: "px-3 py-1.5 text-base"
|
|
2111
2111
|
};
|
|
2112
|
-
Badge =
|
|
2112
|
+
Badge = React97__default.forwardRef(
|
|
2113
2113
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2114
2114
|
const iconSizes3 = {
|
|
2115
2115
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2446,7 +2446,7 @@ var init_SvgFlow = __esm({
|
|
|
2446
2446
|
width = 100,
|
|
2447
2447
|
height = 100
|
|
2448
2448
|
}) => {
|
|
2449
|
-
const markerId =
|
|
2449
|
+
const markerId = React97__default.useMemo(() => {
|
|
2450
2450
|
flowIdCounter += 1;
|
|
2451
2451
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2452
2452
|
}, []);
|
|
@@ -3039,7 +3039,7 @@ var init_SvgRing = __esm({
|
|
|
3039
3039
|
width = 100,
|
|
3040
3040
|
height = 100
|
|
3041
3041
|
}) => {
|
|
3042
|
-
const gradientId =
|
|
3042
|
+
const gradientId = React97__default.useMemo(() => {
|
|
3043
3043
|
ringIdCounter += 1;
|
|
3044
3044
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3045
3045
|
}, []);
|
|
@@ -3220,7 +3220,7 @@ var init_Input = __esm({
|
|
|
3220
3220
|
init_cn();
|
|
3221
3221
|
init_Icon();
|
|
3222
3222
|
init_useEventBus();
|
|
3223
|
-
Input =
|
|
3223
|
+
Input = React97__default.forwardRef(
|
|
3224
3224
|
({
|
|
3225
3225
|
className,
|
|
3226
3226
|
inputType,
|
|
@@ -3380,7 +3380,7 @@ var Label;
|
|
|
3380
3380
|
var init_Label = __esm({
|
|
3381
3381
|
"components/core/atoms/Label.tsx"() {
|
|
3382
3382
|
init_cn();
|
|
3383
|
-
Label =
|
|
3383
|
+
Label = React97__default.forwardRef(
|
|
3384
3384
|
({ className, required, children, ...props }, ref) => {
|
|
3385
3385
|
return /* @__PURE__ */ jsxs(
|
|
3386
3386
|
"label",
|
|
@@ -3407,7 +3407,7 @@ var init_Textarea = __esm({
|
|
|
3407
3407
|
"components/core/atoms/Textarea.tsx"() {
|
|
3408
3408
|
init_cn();
|
|
3409
3409
|
init_useEventBus();
|
|
3410
|
-
Textarea =
|
|
3410
|
+
Textarea = React97__default.forwardRef(
|
|
3411
3411
|
({ className, error, onChange, ...props }, ref) => {
|
|
3412
3412
|
const eventBus = useEventBus();
|
|
3413
3413
|
const handleChange = (e) => {
|
|
@@ -3646,7 +3646,7 @@ var init_Select = __esm({
|
|
|
3646
3646
|
init_cn();
|
|
3647
3647
|
init_Icon();
|
|
3648
3648
|
init_useEventBus();
|
|
3649
|
-
Select =
|
|
3649
|
+
Select = React97__default.forwardRef(
|
|
3650
3650
|
(props, _ref) => {
|
|
3651
3651
|
const { multiple, searchable, clearable } = props;
|
|
3652
3652
|
if (multiple || searchable || clearable) {
|
|
@@ -3663,7 +3663,7 @@ var init_Checkbox = __esm({
|
|
|
3663
3663
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3664
3664
|
init_cn();
|
|
3665
3665
|
init_useEventBus();
|
|
3666
|
-
Checkbox =
|
|
3666
|
+
Checkbox = React97__default.forwardRef(
|
|
3667
3667
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3668
3668
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3669
3669
|
const eventBus = useEventBus();
|
|
@@ -3717,7 +3717,7 @@ var init_Spinner = __esm({
|
|
|
3717
3717
|
md: "h-6 w-6",
|
|
3718
3718
|
lg: "h-8 w-8"
|
|
3719
3719
|
};
|
|
3720
|
-
Spinner =
|
|
3720
|
+
Spinner = React97__default.forwardRef(
|
|
3721
3721
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3722
3722
|
if (overlay) {
|
|
3723
3723
|
return /* @__PURE__ */ jsx(
|
|
@@ -3807,7 +3807,7 @@ var init_Card = __esm({
|
|
|
3807
3807
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3808
3808
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3809
3809
|
};
|
|
3810
|
-
Card =
|
|
3810
|
+
Card = React97__default.forwardRef(
|
|
3811
3811
|
({
|
|
3812
3812
|
className,
|
|
3813
3813
|
variant = "bordered",
|
|
@@ -3855,9 +3855,9 @@ var init_Card = __esm({
|
|
|
3855
3855
|
}
|
|
3856
3856
|
);
|
|
3857
3857
|
Card.displayName = "Card";
|
|
3858
|
-
CardHeader =
|
|
3858
|
+
CardHeader = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3859
3859
|
CardHeader.displayName = "CardHeader";
|
|
3860
|
-
CardTitle =
|
|
3860
|
+
CardTitle = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3861
3861
|
"h3",
|
|
3862
3862
|
{
|
|
3863
3863
|
ref,
|
|
@@ -3870,11 +3870,11 @@ var init_Card = __esm({
|
|
|
3870
3870
|
}
|
|
3871
3871
|
));
|
|
3872
3872
|
CardTitle.displayName = "CardTitle";
|
|
3873
|
-
CardContent =
|
|
3873
|
+
CardContent = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3874
3874
|
CardContent.displayName = "CardContent";
|
|
3875
3875
|
CardBody = CardContent;
|
|
3876
3876
|
CardBody.displayName = "CardBody";
|
|
3877
|
-
CardFooter =
|
|
3877
|
+
CardFooter = React97__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3878
3878
|
"div",
|
|
3879
3879
|
{
|
|
3880
3880
|
ref,
|
|
@@ -3929,7 +3929,7 @@ var init_FilterPill = __esm({
|
|
|
3929
3929
|
md: "w-3.5 h-3.5",
|
|
3930
3930
|
lg: "w-4 h-4"
|
|
3931
3931
|
};
|
|
3932
|
-
FilterPill =
|
|
3932
|
+
FilterPill = React97__default.forwardRef(
|
|
3933
3933
|
({
|
|
3934
3934
|
className,
|
|
3935
3935
|
variant = "default",
|
|
@@ -4058,8 +4058,8 @@ var init_Avatar = __esm({
|
|
|
4058
4058
|
actionPayload
|
|
4059
4059
|
}) => {
|
|
4060
4060
|
const eventBus = useEventBus();
|
|
4061
|
-
const [imgFailed, setImgFailed] =
|
|
4062
|
-
|
|
4061
|
+
const [imgFailed, setImgFailed] = React97__default.useState(false);
|
|
4062
|
+
React97__default.useEffect(() => {
|
|
4063
4063
|
setImgFailed(false);
|
|
4064
4064
|
}, [src]);
|
|
4065
4065
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4172,7 +4172,7 @@ var init_Center = __esm({
|
|
|
4172
4172
|
as: Component = "div"
|
|
4173
4173
|
}) => {
|
|
4174
4174
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4175
|
-
return
|
|
4175
|
+
return React97__default.createElement(Component, {
|
|
4176
4176
|
className: cn(
|
|
4177
4177
|
inline ? "inline-flex" : "flex",
|
|
4178
4178
|
horizontal && "justify-center",
|
|
@@ -4440,7 +4440,7 @@ var init_Radio = __esm({
|
|
|
4440
4440
|
md: "w-2.5 h-2.5",
|
|
4441
4441
|
lg: "w-3 h-3"
|
|
4442
4442
|
};
|
|
4443
|
-
Radio =
|
|
4443
|
+
Radio = React97__default.forwardRef(
|
|
4444
4444
|
({
|
|
4445
4445
|
label,
|
|
4446
4446
|
helperText,
|
|
@@ -4457,12 +4457,12 @@ var init_Radio = __esm({
|
|
|
4457
4457
|
onChange,
|
|
4458
4458
|
...props
|
|
4459
4459
|
}, ref) => {
|
|
4460
|
-
const reactId =
|
|
4460
|
+
const reactId = React97__default.useId();
|
|
4461
4461
|
const baseId = id || `radio-${reactId}`;
|
|
4462
4462
|
const hasError = !!error;
|
|
4463
4463
|
const eventBus = useEventBus();
|
|
4464
|
-
const [selected, setSelected] =
|
|
4465
|
-
|
|
4464
|
+
const [selected, setSelected] = React97__default.useState(value);
|
|
4465
|
+
React97__default.useEffect(() => {
|
|
4466
4466
|
if (value !== void 0) setSelected(value);
|
|
4467
4467
|
}, [value]);
|
|
4468
4468
|
const pick = (next, e) => {
|
|
@@ -4644,7 +4644,7 @@ var init_Switch = __esm({
|
|
|
4644
4644
|
"components/core/atoms/Switch.tsx"() {
|
|
4645
4645
|
"use client";
|
|
4646
4646
|
init_cn();
|
|
4647
|
-
Switch =
|
|
4647
|
+
Switch = React97.forwardRef(
|
|
4648
4648
|
({
|
|
4649
4649
|
checked,
|
|
4650
4650
|
defaultChecked = false,
|
|
@@ -4655,10 +4655,10 @@ var init_Switch = __esm({
|
|
|
4655
4655
|
name,
|
|
4656
4656
|
className
|
|
4657
4657
|
}, ref) => {
|
|
4658
|
-
const [isChecked, setIsChecked] =
|
|
4658
|
+
const [isChecked, setIsChecked] = React97.useState(
|
|
4659
4659
|
checked !== void 0 ? checked : defaultChecked
|
|
4660
4660
|
);
|
|
4661
|
-
|
|
4661
|
+
React97.useEffect(() => {
|
|
4662
4662
|
if (checked !== void 0) {
|
|
4663
4663
|
setIsChecked(checked);
|
|
4664
4664
|
}
|
|
@@ -4821,7 +4821,7 @@ var init_Stack = __esm({
|
|
|
4821
4821
|
};
|
|
4822
4822
|
const isHorizontal = direction === "horizontal";
|
|
4823
4823
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
4824
|
-
return
|
|
4824
|
+
return React97__default.createElement(
|
|
4825
4825
|
Component,
|
|
4826
4826
|
{
|
|
4827
4827
|
className: cn(
|
|
@@ -5021,7 +5021,7 @@ var Aside;
|
|
|
5021
5021
|
var init_Aside = __esm({
|
|
5022
5022
|
"components/core/atoms/Aside.tsx"() {
|
|
5023
5023
|
init_cn();
|
|
5024
|
-
Aside =
|
|
5024
|
+
Aside = React97__default.forwardRef(
|
|
5025
5025
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5026
5026
|
);
|
|
5027
5027
|
Aside.displayName = "Aside";
|
|
@@ -5100,9 +5100,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5100
5100
|
className
|
|
5101
5101
|
}) => {
|
|
5102
5102
|
const { t } = useTranslate();
|
|
5103
|
-
const [isVisible, setIsVisible] =
|
|
5104
|
-
const timeoutRef =
|
|
5105
|
-
const triggerRef =
|
|
5103
|
+
const [isVisible, setIsVisible] = React97__default.useState(false);
|
|
5104
|
+
const timeoutRef = React97__default.useRef(null);
|
|
5105
|
+
const triggerRef = React97__default.useRef(null);
|
|
5106
5106
|
const handleMouseEnter = () => {
|
|
5107
5107
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5108
5108
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5113,7 +5113,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5113
5113
|
};
|
|
5114
5114
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5115
5115
|
const open = isVisible || revealed;
|
|
5116
|
-
|
|
5116
|
+
React97__default.useEffect(() => {
|
|
5117
5117
|
return () => {
|
|
5118
5118
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5119
5119
|
};
|
|
@@ -5323,7 +5323,7 @@ var init_StatusDot = __esm({
|
|
|
5323
5323
|
md: "w-2.5 h-2.5",
|
|
5324
5324
|
lg: "w-3 h-3"
|
|
5325
5325
|
};
|
|
5326
|
-
StatusDot =
|
|
5326
|
+
StatusDot = React97__default.forwardRef(
|
|
5327
5327
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5328
5328
|
return /* @__PURE__ */ jsx(
|
|
5329
5329
|
"span",
|
|
@@ -5377,7 +5377,7 @@ var init_TrendIndicator = __esm({
|
|
|
5377
5377
|
down: "trending-down",
|
|
5378
5378
|
flat: "arrow-right"
|
|
5379
5379
|
};
|
|
5380
|
-
TrendIndicator =
|
|
5380
|
+
TrendIndicator = React97__default.forwardRef(
|
|
5381
5381
|
({
|
|
5382
5382
|
className,
|
|
5383
5383
|
value,
|
|
@@ -5444,7 +5444,7 @@ var init_RangeSlider = __esm({
|
|
|
5444
5444
|
md: "w-4 h-4",
|
|
5445
5445
|
lg: "w-5 h-5"
|
|
5446
5446
|
};
|
|
5447
|
-
RangeSlider =
|
|
5447
|
+
RangeSlider = React97__default.forwardRef(
|
|
5448
5448
|
({
|
|
5449
5449
|
className,
|
|
5450
5450
|
min = 0,
|
|
@@ -6038,7 +6038,7 @@ var init_ContentSection = __esm({
|
|
|
6038
6038
|
md: "py-16",
|
|
6039
6039
|
lg: "py-24"
|
|
6040
6040
|
};
|
|
6041
|
-
ContentSection =
|
|
6041
|
+
ContentSection = React97__default.forwardRef(
|
|
6042
6042
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6043
6043
|
return /* @__PURE__ */ jsx(
|
|
6044
6044
|
Box,
|
|
@@ -6572,7 +6572,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6572
6572
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6573
6573
|
"none": {}
|
|
6574
6574
|
};
|
|
6575
|
-
AnimatedReveal =
|
|
6575
|
+
AnimatedReveal = React97__default.forwardRef(
|
|
6576
6576
|
({
|
|
6577
6577
|
trigger = "scroll",
|
|
6578
6578
|
animation = "fade-up",
|
|
@@ -6732,7 +6732,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6732
6732
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6733
6733
|
"use client";
|
|
6734
6734
|
init_cn();
|
|
6735
|
-
AnimatedGraphic =
|
|
6735
|
+
AnimatedGraphic = React97__default.forwardRef(
|
|
6736
6736
|
({
|
|
6737
6737
|
src,
|
|
6738
6738
|
svgContent,
|
|
@@ -6755,7 +6755,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6755
6755
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6756
6756
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6757
6757
|
const prevAnimateRef = useRef(animate);
|
|
6758
|
-
const setRef =
|
|
6758
|
+
const setRef = React97__default.useCallback(
|
|
6759
6759
|
(node) => {
|
|
6760
6760
|
containerRef.current = node;
|
|
6761
6761
|
if (typeof ref === "function") ref(node);
|
|
@@ -8365,7 +8365,7 @@ function GameCard({
|
|
|
8365
8365
|
className
|
|
8366
8366
|
}) {
|
|
8367
8367
|
const eventBus = useEventBus();
|
|
8368
|
-
const handleClick =
|
|
8368
|
+
const handleClick = React97.useCallback(() => {
|
|
8369
8369
|
if (disabled) return;
|
|
8370
8370
|
onClick?.(id);
|
|
8371
8371
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -8647,9 +8647,9 @@ function ControlButton({
|
|
|
8647
8647
|
className
|
|
8648
8648
|
}) {
|
|
8649
8649
|
const eventBus = useEventBus();
|
|
8650
|
-
const [isPressed, setIsPressed] =
|
|
8650
|
+
const [isPressed, setIsPressed] = React97.useState(false);
|
|
8651
8651
|
const actualPressed = pressed ?? isPressed;
|
|
8652
|
-
const handlePointerDown =
|
|
8652
|
+
const handlePointerDown = React97.useCallback(
|
|
8653
8653
|
(e) => {
|
|
8654
8654
|
e.preventDefault();
|
|
8655
8655
|
if (disabled) return;
|
|
@@ -8659,7 +8659,7 @@ function ControlButton({
|
|
|
8659
8659
|
},
|
|
8660
8660
|
[disabled, pressEvent, eventBus, onPress]
|
|
8661
8661
|
);
|
|
8662
|
-
const handlePointerUp =
|
|
8662
|
+
const handlePointerUp = React97.useCallback(
|
|
8663
8663
|
(e) => {
|
|
8664
8664
|
e.preventDefault();
|
|
8665
8665
|
if (disabled) return;
|
|
@@ -8669,7 +8669,7 @@ function ControlButton({
|
|
|
8669
8669
|
},
|
|
8670
8670
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
8671
8671
|
);
|
|
8672
|
-
const handlePointerLeave =
|
|
8672
|
+
const handlePointerLeave = React97.useCallback(
|
|
8673
8673
|
(e) => {
|
|
8674
8674
|
if (isPressed) {
|
|
8675
8675
|
setIsPressed(false);
|
|
@@ -9519,6 +9519,7 @@ function ChoiceButton({
|
|
|
9519
9519
|
selected = false,
|
|
9520
9520
|
onClick,
|
|
9521
9521
|
action,
|
|
9522
|
+
payload,
|
|
9522
9523
|
className
|
|
9523
9524
|
}) {
|
|
9524
9525
|
const eventBus = useEventBus();
|
|
@@ -9528,7 +9529,7 @@ function ChoiceButton({
|
|
|
9528
9529
|
variant: "ghost",
|
|
9529
9530
|
disabled,
|
|
9530
9531
|
onClick: () => {
|
|
9531
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
9532
|
+
if (action) eventBus.emit(`UI:${action}`, payload ?? {});
|
|
9532
9533
|
onClick?.();
|
|
9533
9534
|
},
|
|
9534
9535
|
className: cn(
|
|
@@ -9687,8 +9688,8 @@ function MiniMap({
|
|
|
9687
9688
|
tileAssets,
|
|
9688
9689
|
unitAssets
|
|
9689
9690
|
}) {
|
|
9690
|
-
const canvasRef =
|
|
9691
|
-
const imgCacheRef =
|
|
9691
|
+
const canvasRef = React97.useRef(null);
|
|
9692
|
+
const imgCacheRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
9692
9693
|
function loadImg(url) {
|
|
9693
9694
|
const cached = imgCacheRef.current.get(url);
|
|
9694
9695
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -9703,7 +9704,7 @@ function MiniMap({
|
|
|
9703
9704
|
imgCacheRef.current.set(url, img);
|
|
9704
9705
|
return null;
|
|
9705
9706
|
}
|
|
9706
|
-
|
|
9707
|
+
React97.useEffect(() => {
|
|
9707
9708
|
const canvas = canvasRef.current;
|
|
9708
9709
|
if (!canvas) return;
|
|
9709
9710
|
const ctx = canvas.getContext("2d");
|
|
@@ -9838,8 +9839,8 @@ function ControlGrid({
|
|
|
9838
9839
|
className
|
|
9839
9840
|
}) {
|
|
9840
9841
|
const eventBus = useEventBus();
|
|
9841
|
-
const [active, setActive] =
|
|
9842
|
-
const handlePress =
|
|
9842
|
+
const [active, setActive] = React97.useState(/* @__PURE__ */ new Set());
|
|
9843
|
+
const handlePress = React97.useCallback(
|
|
9843
9844
|
(id) => {
|
|
9844
9845
|
setActive((prev) => new Set(prev).add(id));
|
|
9845
9846
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9853,7 +9854,7 @@ function ControlGrid({
|
|
|
9853
9854
|
},
|
|
9854
9855
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9855
9856
|
);
|
|
9856
|
-
const handleRelease =
|
|
9857
|
+
const handleRelease = React97.useCallback(
|
|
9857
9858
|
(id) => {
|
|
9858
9859
|
setActive((prev) => {
|
|
9859
9860
|
const next = new Set(prev);
|
|
@@ -10111,7 +10112,7 @@ function InventoryGrid({
|
|
|
10111
10112
|
const eventBus = useEventBus();
|
|
10112
10113
|
const slotCount = totalSlots ?? items.length;
|
|
10113
10114
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
10114
|
-
const handleSelect =
|
|
10115
|
+
const handleSelect = React97.useCallback(
|
|
10115
10116
|
(id) => {
|
|
10116
10117
|
onSelect?.(id);
|
|
10117
10118
|
if (selectEvent) {
|
|
@@ -10328,7 +10329,7 @@ function GameMenu({
|
|
|
10328
10329
|
}) {
|
|
10329
10330
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
10330
10331
|
const eventBus = useEventBus();
|
|
10331
|
-
const handleOptionClick =
|
|
10332
|
+
const handleOptionClick = React97.useCallback(
|
|
10332
10333
|
(option) => {
|
|
10333
10334
|
if (option.event) {
|
|
10334
10335
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -12249,410 +12250,6 @@ var init_GameAudioToggle = __esm({
|
|
|
12249
12250
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
12250
12251
|
}
|
|
12251
12252
|
});
|
|
12252
|
-
function VisualNovelBoard({
|
|
12253
|
-
entity,
|
|
12254
|
-
nodes: propNodes,
|
|
12255
|
-
currentNodeId: propCurrentNodeId,
|
|
12256
|
-
assetManifest: propAssetManifest,
|
|
12257
|
-
typewriterSpeed = 30,
|
|
12258
|
-
portraitScale = 1,
|
|
12259
|
-
chooseEvent,
|
|
12260
|
-
advanceEvent,
|
|
12261
|
-
restartEvent,
|
|
12262
|
-
className
|
|
12263
|
-
}) {
|
|
12264
|
-
const board = boardEntity(entity) ?? {};
|
|
12265
|
-
const eventBus = useEventBus();
|
|
12266
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12267
|
-
const entityNodes = useMemo(
|
|
12268
|
-
() => rows(board.nodes).map((r) => ({
|
|
12269
|
-
id: str(r.id),
|
|
12270
|
-
speaker: str(r.speaker),
|
|
12271
|
-
text: str(r.text),
|
|
12272
|
-
backgroundKey: r.backgroundKey == null ? void 0 : str(r.backgroundKey),
|
|
12273
|
-
portraitKey: r.portraitKey == null ? void 0 : str(r.portraitKey),
|
|
12274
|
-
choices: rows(r.choices).map((c) => ({
|
|
12275
|
-
label: str(c.label),
|
|
12276
|
-
nextId: str(c.nextId)
|
|
12277
|
-
}))
|
|
12278
|
-
})),
|
|
12279
|
-
[board.nodes]
|
|
12280
|
-
);
|
|
12281
|
-
const rawNodes = propNodes ?? entityNodes;
|
|
12282
|
-
const nodes = rawNodes.length > 0 ? rawNodes : DEFAULT_NODES;
|
|
12283
|
-
const currentNodeId = propCurrentNodeId ?? (str(board.currentNodeId) || nodes[0]?.id);
|
|
12284
|
-
const currentNode = nodes.find((n) => n.id === currentNodeId) ?? nodes[0];
|
|
12285
|
-
const backgroundImage = useMemo(
|
|
12286
|
-
() => assetManifest?.backgrounds?.[currentNode?.backgroundKey ?? ""],
|
|
12287
|
-
[assetManifest, currentNode?.backgroundKey]
|
|
12288
|
-
);
|
|
12289
|
-
const portraitAsset = useMemo(
|
|
12290
|
-
() => assetManifest?.portraits?.[currentNode?.portraitKey ?? ""],
|
|
12291
|
-
[assetManifest, currentNode?.portraitKey]
|
|
12292
|
-
);
|
|
12293
|
-
const [displayedText, setDisplayedText] = useState("");
|
|
12294
|
-
const [isTyping, setIsTyping] = useState(false);
|
|
12295
|
-
const textRef = useRef(currentNode?.text ?? "");
|
|
12296
|
-
const charIndexRef = useRef(0);
|
|
12297
|
-
useEffect(() => {
|
|
12298
|
-
const fullText = currentNode?.text ?? "";
|
|
12299
|
-
textRef.current = fullText;
|
|
12300
|
-
charIndexRef.current = 0;
|
|
12301
|
-
if (typewriterSpeed === 0) {
|
|
12302
|
-
setDisplayedText(fullText);
|
|
12303
|
-
setIsTyping(false);
|
|
12304
|
-
} else {
|
|
12305
|
-
setDisplayedText("");
|
|
12306
|
-
setIsTyping(true);
|
|
12307
|
-
}
|
|
12308
|
-
}, [currentNode?.id, typewriterSpeed]);
|
|
12309
|
-
useEffect(() => {
|
|
12310
|
-
if (!isTyping || typewriterSpeed === 0) return;
|
|
12311
|
-
const interval = setInterval(() => {
|
|
12312
|
-
if (charIndexRef.current < textRef.current.length) {
|
|
12313
|
-
charIndexRef.current++;
|
|
12314
|
-
setDisplayedText(textRef.current.slice(0, charIndexRef.current));
|
|
12315
|
-
} else {
|
|
12316
|
-
setIsTyping(false);
|
|
12317
|
-
clearInterval(interval);
|
|
12318
|
-
}
|
|
12319
|
-
}, typewriterSpeed);
|
|
12320
|
-
return () => clearInterval(interval);
|
|
12321
|
-
}, [isTyping, typewriterSpeed]);
|
|
12322
|
-
const skipTypewriter = useCallback(() => {
|
|
12323
|
-
if (isTyping) {
|
|
12324
|
-
charIndexRef.current = textRef.current.length;
|
|
12325
|
-
setDisplayedText(textRef.current);
|
|
12326
|
-
setIsTyping(false);
|
|
12327
|
-
}
|
|
12328
|
-
}, [isTyping]);
|
|
12329
|
-
const handleChoice = useCallback(
|
|
12330
|
-
(index) => {
|
|
12331
|
-
if (chooseEvent) {
|
|
12332
|
-
eventBus.emit(`UI:${chooseEvent}`, { choiceIndex: index });
|
|
12333
|
-
}
|
|
12334
|
-
},
|
|
12335
|
-
[chooseEvent, eventBus]
|
|
12336
|
-
);
|
|
12337
|
-
const handleAdvance = useCallback(() => {
|
|
12338
|
-
if (advanceEvent) {
|
|
12339
|
-
eventBus.emit(`UI:${advanceEvent}`, {});
|
|
12340
|
-
}
|
|
12341
|
-
}, [advanceEvent, eventBus]);
|
|
12342
|
-
const handleRestart = useCallback(() => {
|
|
12343
|
-
if (restartEvent) {
|
|
12344
|
-
eventBus.emit(`UI:${restartEvent}`, {});
|
|
12345
|
-
}
|
|
12346
|
-
}, [restartEvent, eventBus]);
|
|
12347
|
-
const handleContainerClick = useCallback(() => {
|
|
12348
|
-
if (isTyping) {
|
|
12349
|
-
skipTypewriter();
|
|
12350
|
-
} else if (!currentNode?.choices?.length) {
|
|
12351
|
-
handleAdvance();
|
|
12352
|
-
}
|
|
12353
|
-
}, [isTyping, skipTypewriter, currentNode?.choices, handleAdvance]);
|
|
12354
|
-
if (!currentNode) {
|
|
12355
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("visual-novel-board relative min-h-[600px] bg-background items-center justify-center", className), gap: "lg", children: [
|
|
12356
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h3", color: "muted", children: "No dialogue nodes" }),
|
|
12357
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleRestart, children: "Restart" })
|
|
12358
|
-
] });
|
|
12359
|
-
}
|
|
12360
|
-
return /* @__PURE__ */ jsxs(
|
|
12361
|
-
Box,
|
|
12362
|
-
{
|
|
12363
|
-
className: cn("visual-novel-board relative min-h-[600px] bg-background overflow-hidden", className),
|
|
12364
|
-
onClick: handleContainerClick,
|
|
12365
|
-
children: [
|
|
12366
|
-
backgroundImage && /* @__PURE__ */ jsx(
|
|
12367
|
-
"div",
|
|
12368
|
-
{
|
|
12369
|
-
className: "absolute inset-0 z-0 bg-center bg-cover bg-no-repeat",
|
|
12370
|
-
style: { backgroundImage: `url(${backgroundImage.url})` },
|
|
12371
|
-
"aria-hidden": "true"
|
|
12372
|
-
}
|
|
12373
|
-
),
|
|
12374
|
-
portraitAsset && /* @__PURE__ */ jsx(
|
|
12375
|
-
"div",
|
|
12376
|
-
{
|
|
12377
|
-
className: "absolute left-1/2 -translate-x-1/2 bottom-0 z-10 pointer-events-none flex items-end",
|
|
12378
|
-
style: { height: `${60 * portraitScale}vh` },
|
|
12379
|
-
children: /* @__PURE__ */ jsx(
|
|
12380
|
-
"img",
|
|
12381
|
-
{
|
|
12382
|
-
src: portraitAsset.url,
|
|
12383
|
-
alt: currentNode.speaker,
|
|
12384
|
-
className: "h-full w-auto object-contain drop-shadow-2xl"
|
|
12385
|
-
}
|
|
12386
|
-
)
|
|
12387
|
-
}
|
|
12388
|
-
),
|
|
12389
|
-
/* @__PURE__ */ jsx("div", { className: "absolute left-0 right-0 bottom-0 z-20 mx-4 mb-4", children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
12390
|
-
"rounded-container border-2 overflow-hidden",
|
|
12391
|
-
backgroundImage ? "bg-black/80 backdrop-blur-sm border-white/20" : "bg-card/95 border-border"
|
|
12392
|
-
), children: [
|
|
12393
|
-
/* @__PURE__ */ jsx(
|
|
12394
|
-
DialogueBubble,
|
|
12395
|
-
{
|
|
12396
|
-
speaker: currentNode.speaker,
|
|
12397
|
-
text: displayedText + (isTyping ? "\u258C" : ""),
|
|
12398
|
-
portrait: portraitAsset,
|
|
12399
|
-
position: "bottom",
|
|
12400
|
-
className: "border-0 rounded-none bg-transparent backdrop-blur-none"
|
|
12401
|
-
}
|
|
12402
|
-
),
|
|
12403
|
-
!isTyping && (currentNode.choices?.length ?? 0) > 0 && /* @__PURE__ */ jsx("div", { className: "px-4 pb-4 space-y-2", onClick: (e) => e.stopPropagation(), children: currentNode.choices.map((choice, index) => /* @__PURE__ */ jsx(
|
|
12404
|
-
ChoiceButton,
|
|
12405
|
-
{
|
|
12406
|
-
text: choice.label,
|
|
12407
|
-
index: index + 1,
|
|
12408
|
-
onClick: () => handleChoice(index)
|
|
12409
|
-
},
|
|
12410
|
-
choice.nextId
|
|
12411
|
-
)) }),
|
|
12412
|
-
!isTyping && !currentNode.choices?.length && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 text-muted-foreground text-sm animate-pulse", children: "Press click to continue..." })
|
|
12413
|
-
] }) })
|
|
12414
|
-
]
|
|
12415
|
-
}
|
|
12416
|
-
);
|
|
12417
|
-
}
|
|
12418
|
-
var DEFAULT_NODES;
|
|
12419
|
-
var init_VisualNovelBoard = __esm({
|
|
12420
|
-
"components/game/2d/organisms/VisualNovelBoard.tsx"() {
|
|
12421
|
-
"use client";
|
|
12422
|
-
init_cn();
|
|
12423
|
-
init_useEventBus();
|
|
12424
|
-
init_Box();
|
|
12425
|
-
init_Typography();
|
|
12426
|
-
init_Stack();
|
|
12427
|
-
init_Button();
|
|
12428
|
-
init_DialogueBubble();
|
|
12429
|
-
init_ChoiceButton();
|
|
12430
|
-
init_boardEntity();
|
|
12431
|
-
DEFAULT_NODES = [
|
|
12432
|
-
{
|
|
12433
|
-
id: "start",
|
|
12434
|
-
speaker: "Narrator",
|
|
12435
|
-
text: "The corridor stretches into shadow. A lone sentinel blocks your path.",
|
|
12436
|
-
backgroundKey: "corridor",
|
|
12437
|
-
portraitKey: "guide",
|
|
12438
|
-
choices: [
|
|
12439
|
-
{ label: "Approach the sentinel.", nextId: "meet" },
|
|
12440
|
-
{ label: "Turn back.", nextId: "retreat" }
|
|
12441
|
-
]
|
|
12442
|
-
},
|
|
12443
|
-
{
|
|
12444
|
-
id: "meet",
|
|
12445
|
-
speaker: "Sentinel",
|
|
12446
|
-
text: "You carry the old marks. Speak your purpose, traveler.",
|
|
12447
|
-
backgroundKey: "forge",
|
|
12448
|
-
portraitKey: "rival",
|
|
12449
|
-
choices: [
|
|
12450
|
-
{ label: "I seek the core.", nextId: "end" },
|
|
12451
|
-
{ label: "I am only passing through.", nextId: "retreat" }
|
|
12452
|
-
]
|
|
12453
|
-
},
|
|
12454
|
-
{
|
|
12455
|
-
id: "retreat",
|
|
12456
|
-
speaker: "Narrator",
|
|
12457
|
-
text: "You withdraw into the dark. The path will wait for braver feet.",
|
|
12458
|
-
backgroundKey: "corridor",
|
|
12459
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12460
|
-
},
|
|
12461
|
-
{
|
|
12462
|
-
id: "end",
|
|
12463
|
-
speaker: "Sentinel",
|
|
12464
|
-
text: "Then the way is open. Walk it well.",
|
|
12465
|
-
backgroundKey: "core",
|
|
12466
|
-
portraitKey: "rival",
|
|
12467
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12468
|
-
}
|
|
12469
|
-
];
|
|
12470
|
-
VisualNovelBoard.displayName = "VisualNovelBoard";
|
|
12471
|
-
}
|
|
12472
|
-
});
|
|
12473
|
-
function rowToCard(r) {
|
|
12474
|
-
return {
|
|
12475
|
-
id: str(r.id),
|
|
12476
|
-
iconKey: r.iconKey == null ? void 0 : str(r.iconKey),
|
|
12477
|
-
title: r.title == null ? void 0 : str(r.title),
|
|
12478
|
-
cost: r.cost == null ? void 0 : num(r.cost),
|
|
12479
|
-
attack: r.attack == null ? void 0 : num(r.attack),
|
|
12480
|
-
defense: r.defense == null ? void 0 : num(r.defense)
|
|
12481
|
-
};
|
|
12482
|
-
}
|
|
12483
|
-
function resolveCardArt(card, manifest) {
|
|
12484
|
-
const key = card.iconKey ?? card.id;
|
|
12485
|
-
return manifest?.cards?.[key];
|
|
12486
|
-
}
|
|
12487
|
-
function CardBattlerBoard({
|
|
12488
|
-
entity,
|
|
12489
|
-
deck: propDeck,
|
|
12490
|
-
hand: propHand,
|
|
12491
|
-
board: propBoard,
|
|
12492
|
-
mana: propMana,
|
|
12493
|
-
maxMana: propMaxMana,
|
|
12494
|
-
turn: propTurn,
|
|
12495
|
-
result: propResult,
|
|
12496
|
-
assetManifest: propAssetManifest,
|
|
12497
|
-
playCardEvent,
|
|
12498
|
-
endTurnEvent,
|
|
12499
|
-
playAgainEvent,
|
|
12500
|
-
gameEndEvent,
|
|
12501
|
-
className
|
|
12502
|
-
}) {
|
|
12503
|
-
const board = boardEntity(entity) ?? {};
|
|
12504
|
-
const eventBus = useEventBus();
|
|
12505
|
-
const { t } = useTranslate();
|
|
12506
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12507
|
-
const entityHand = useMemo(() => rows(board.hand).map(rowToCard), [board.hand]);
|
|
12508
|
-
const rawHand = propHand ?? entityHand;
|
|
12509
|
-
const hand = rawHand.length > 0 ? rawHand : DEFAULT_HAND;
|
|
12510
|
-
const entityBoard = useMemo(() => rows(board.board).map(rowToCard), [board.board]);
|
|
12511
|
-
const playedCards = propBoard ?? entityBoard;
|
|
12512
|
-
const entityDeck = useMemo(() => rows(board.deck).map(rowToCard), [board.deck]);
|
|
12513
|
-
const deck = propDeck ?? entityDeck;
|
|
12514
|
-
const mana = propMana ?? num(board.mana, 3);
|
|
12515
|
-
const maxMana = propMaxMana ?? num(board.maxMana, 3);
|
|
12516
|
-
const turn = propTurn ?? num(board.turn, 1);
|
|
12517
|
-
const result = propResult ?? (str(board.result) || "none");
|
|
12518
|
-
const handCards = hand;
|
|
12519
|
-
const boardCards = playedCards;
|
|
12520
|
-
const emittedGameEnd = useRef(false);
|
|
12521
|
-
if (result !== "none" && !emittedGameEnd.current) {
|
|
12522
|
-
emittedGameEnd.current = true;
|
|
12523
|
-
if (gameEndEvent) {
|
|
12524
|
-
eventBus.emit(`UI:${gameEndEvent}`, { result });
|
|
12525
|
-
}
|
|
12526
|
-
}
|
|
12527
|
-
if (result === "none") {
|
|
12528
|
-
emittedGameEnd.current = false;
|
|
12529
|
-
}
|
|
12530
|
-
const handlePlayCard = useCallback((cardId) => {
|
|
12531
|
-
if (result !== "none") return;
|
|
12532
|
-
if (playCardEvent) {
|
|
12533
|
-
eventBus.emit(`UI:${playCardEvent}`, { cardId });
|
|
12534
|
-
}
|
|
12535
|
-
}, [result, playCardEvent, eventBus]);
|
|
12536
|
-
const handleEndTurn = useCallback(() => {
|
|
12537
|
-
if (result !== "none") return;
|
|
12538
|
-
if (endTurnEvent) {
|
|
12539
|
-
eventBus.emit(`UI:${endTurnEvent}`, {});
|
|
12540
|
-
}
|
|
12541
|
-
}, [result, endTurnEvent, eventBus]);
|
|
12542
|
-
const handlePlayAgain = useCallback(() => {
|
|
12543
|
-
if (playAgainEvent) {
|
|
12544
|
-
eventBus.emit(`UI:${playAgainEvent}`, {});
|
|
12545
|
-
}
|
|
12546
|
-
}, [playAgainEvent, eventBus]);
|
|
12547
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("card-battler-board relative min-h-[600px] bg-background", className), gap: "none", children: [
|
|
12548
|
-
/* @__PURE__ */ jsxs(
|
|
12549
|
-
HStack,
|
|
12550
|
-
{
|
|
12551
|
-
className: "px-4 py-2 border-b border-border bg-surface",
|
|
12552
|
-
gap: "lg",
|
|
12553
|
-
align: "center",
|
|
12554
|
-
children: [
|
|
12555
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12556
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.mana") ?? "Mana" }),
|
|
12557
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "body2", weight: "bold", className: "text-info", children: [
|
|
12558
|
-
mana,
|
|
12559
|
-
" / ",
|
|
12560
|
-
maxMana
|
|
12561
|
-
] })
|
|
12562
|
-
] }),
|
|
12563
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12564
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.turn") ?? "Turn" }),
|
|
12565
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: turn })
|
|
12566
|
-
] }),
|
|
12567
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12568
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.deck") ?? "Deck" }),
|
|
12569
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: deck.length })
|
|
12570
|
-
] }),
|
|
12571
|
-
/* @__PURE__ */ jsx(Box, { className: "ml-auto", children: result === "none" && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", onClick: handleEndTurn, children: t("cb.endTurn") ?? "End Turn" }) })
|
|
12572
|
-
]
|
|
12573
|
-
}
|
|
12574
|
-
),
|
|
12575
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 relative p-4 overflow-auto", children: [
|
|
12576
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.battlefield") ?? "Battlefield" }),
|
|
12577
|
-
boardCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 items-end justify-start", children: boardCards.map((card) => /* @__PURE__ */ jsx(
|
|
12578
|
-
GameCard,
|
|
12579
|
-
{
|
|
12580
|
-
id: card.id,
|
|
12581
|
-
cost: card.cost,
|
|
12582
|
-
art: resolveCardArt(card, assetManifest),
|
|
12583
|
-
attack: card.attack,
|
|
12584
|
-
defense: card.defense,
|
|
12585
|
-
name: card.title,
|
|
12586
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12587
|
-
size: "md"
|
|
12588
|
-
},
|
|
12589
|
-
card.id
|
|
12590
|
-
)) }) : /* @__PURE__ */ jsx(Box, { className: "flex items-center justify-center h-32 rounded-interactive border-2 border-dashed border-border", children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.emptyBoard") ?? "Play a card to begin" }) })
|
|
12591
|
-
] }),
|
|
12592
|
-
/* @__PURE__ */ jsxs(Box, { className: "border-t border-border bg-surface px-4 py-3", children: [
|
|
12593
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.hand") ?? "Your Hand" }),
|
|
12594
|
-
handCards.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.emptyHand") ?? "No cards in hand" }) }) : /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 items-end justify-center", children: handCards.map((card) => /* @__PURE__ */ jsx(
|
|
12595
|
-
GameCard,
|
|
12596
|
-
{
|
|
12597
|
-
id: card.id,
|
|
12598
|
-
cost: card.cost,
|
|
12599
|
-
art: resolveCardArt(card, assetManifest),
|
|
12600
|
-
attack: card.attack,
|
|
12601
|
-
defense: card.defense,
|
|
12602
|
-
name: card.title,
|
|
12603
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12604
|
-
size: "lg",
|
|
12605
|
-
onClick: handlePlayCard
|
|
12606
|
-
},
|
|
12607
|
-
card.id
|
|
12608
|
-
)) })
|
|
12609
|
-
] }),
|
|
12610
|
-
result !== "none" && /* @__PURE__ */ jsx(Box, { className: "absolute inset-0 z-50 flex items-center justify-center bg-background/70 backdrop-blur-sm", children: /* @__PURE__ */ jsxs(VStack, { className: "text-center p-8", gap: "lg", children: [
|
|
12611
|
-
/* @__PURE__ */ jsx(
|
|
12612
|
-
Typography,
|
|
12613
|
-
{
|
|
12614
|
-
variant: "h2",
|
|
12615
|
-
className: cn(
|
|
12616
|
-
"text-4xl font-black tracking-widest uppercase",
|
|
12617
|
-
result === "won" ? "text-warning" : "text-error"
|
|
12618
|
-
),
|
|
12619
|
-
children: result === "won" ? t("cb.victory") ?? "Victory!" : t("cb.defeat") ?? "Defeat!"
|
|
12620
|
-
}
|
|
12621
|
-
),
|
|
12622
|
-
/* @__PURE__ */ jsx(
|
|
12623
|
-
Button,
|
|
12624
|
-
{
|
|
12625
|
-
variant: "primary",
|
|
12626
|
-
className: "px-8 py-3 font-semibold",
|
|
12627
|
-
onClick: handlePlayAgain,
|
|
12628
|
-
children: t("cb.playAgain") ?? "Play Again"
|
|
12629
|
-
}
|
|
12630
|
-
)
|
|
12631
|
-
] }) })
|
|
12632
|
-
] });
|
|
12633
|
-
}
|
|
12634
|
-
var DEFAULT_HAND;
|
|
12635
|
-
var init_CardBattlerBoard = __esm({
|
|
12636
|
-
"components/game/2d/organisms/CardBattlerBoard.tsx"() {
|
|
12637
|
-
"use client";
|
|
12638
|
-
init_cn();
|
|
12639
|
-
init_useEventBus();
|
|
12640
|
-
init_Box();
|
|
12641
|
-
init_Button();
|
|
12642
|
-
init_Typography();
|
|
12643
|
-
init_Stack();
|
|
12644
|
-
init_GameCard();
|
|
12645
|
-
init_boardEntity();
|
|
12646
|
-
DEFAULT_HAND = [
|
|
12647
|
-
{ id: "c1", iconKey: "bear", title: "Bear", cost: 3, attack: 5, defense: 4 },
|
|
12648
|
-
{ id: "c2", iconKey: "owl", title: "Owl", cost: 1, attack: 2, defense: 1 },
|
|
12649
|
-
{ id: "c3", iconKey: "gorilla", title: "Gorilla", cost: 4, attack: 6, defense: 5 },
|
|
12650
|
-
{ id: "c4", iconKey: "frog", title: "Frog", cost: 1, attack: 1, defense: 2 },
|
|
12651
|
-
{ id: "c5", iconKey: "snake", title: "Snake", cost: 2, attack: 4, defense: 1 }
|
|
12652
|
-
];
|
|
12653
|
-
CardBattlerBoard.displayName = "CardBattlerBoard";
|
|
12654
|
-
}
|
|
12655
|
-
});
|
|
12656
12253
|
function LinearView({
|
|
12657
12254
|
trait,
|
|
12658
12255
|
size = "md",
|
|
@@ -12664,7 +12261,7 @@ function LinearView({
|
|
|
12664
12261
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
12665
12262
|
const isDone = i < currentIdx;
|
|
12666
12263
|
const isCurrent = i === currentIdx;
|
|
12667
|
-
return /* @__PURE__ */ jsxs(
|
|
12264
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
12668
12265
|
i > 0 && /* @__PURE__ */ jsx(
|
|
12669
12266
|
Typography,
|
|
12670
12267
|
{
|
|
@@ -13192,7 +12789,7 @@ function SequenceBar({
|
|
|
13192
12789
|
onSlotRemove(index);
|
|
13193
12790
|
}, [onSlotRemove, playing]);
|
|
13194
12791
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
13195
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
12792
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
13196
12793
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13197
12794
|
Typography,
|
|
13198
12795
|
{
|
|
@@ -16193,7 +15790,7 @@ var init_ErrorBoundary = __esm({
|
|
|
16193
15790
|
}
|
|
16194
15791
|
);
|
|
16195
15792
|
};
|
|
16196
|
-
ErrorBoundary = class extends
|
|
15793
|
+
ErrorBoundary = class extends React97__default.Component {
|
|
16197
15794
|
constructor(props) {
|
|
16198
15795
|
super(props);
|
|
16199
15796
|
__publicField(this, "reset", () => {
|
|
@@ -16858,7 +16455,7 @@ var init_Container = __esm({
|
|
|
16858
16455
|
as: Component = "div"
|
|
16859
16456
|
}) => {
|
|
16860
16457
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
16861
|
-
return
|
|
16458
|
+
return React97__default.createElement(
|
|
16862
16459
|
Component,
|
|
16863
16460
|
{
|
|
16864
16461
|
className: cn(
|
|
@@ -19526,7 +19123,7 @@ var init_CodeBlock = __esm({
|
|
|
19526
19123
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
19527
19124
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
19528
19125
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
19529
|
-
CodeBlock =
|
|
19126
|
+
CodeBlock = React97__default.memo(
|
|
19530
19127
|
({
|
|
19531
19128
|
code: rawCode,
|
|
19532
19129
|
language = "text",
|
|
@@ -20113,7 +19710,7 @@ var init_MarkdownContent = __esm({
|
|
|
20113
19710
|
init_Box();
|
|
20114
19711
|
init_CodeBlock();
|
|
20115
19712
|
init_cn();
|
|
20116
|
-
MarkdownContent =
|
|
19713
|
+
MarkdownContent = React97__default.memo(
|
|
20117
19714
|
({ content, direction = "ltr", className }) => {
|
|
20118
19715
|
const { t: _t } = useTranslate();
|
|
20119
19716
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -21440,7 +21037,7 @@ var init_StateMachineView = __esm({
|
|
|
21440
21037
|
style: { top: title ? 30 : 0 },
|
|
21441
21038
|
children: [
|
|
21442
21039
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
21443
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
21040
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React97__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
21444
21041
|
StateNode2,
|
|
21445
21042
|
{
|
|
21446
21043
|
state,
|
|
@@ -27078,8 +26675,8 @@ var init_Menu = __esm({
|
|
|
27078
26675
|
"bottom-end": "bottom-start"
|
|
27079
26676
|
};
|
|
27080
26677
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
27081
|
-
const triggerChild =
|
|
27082
|
-
const triggerElement =
|
|
26678
|
+
const triggerChild = React97__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
26679
|
+
const triggerElement = React97__default.cloneElement(
|
|
27083
26680
|
triggerChild,
|
|
27084
26681
|
{
|
|
27085
26682
|
ref: triggerRef,
|
|
@@ -27174,14 +26771,14 @@ function useDataDnd(args) {
|
|
|
27174
26771
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
27175
26772
|
const enabled = isZone || Boolean(dndRoot);
|
|
27176
26773
|
const eventBus = useEventBus();
|
|
27177
|
-
const parentRoot =
|
|
26774
|
+
const parentRoot = React97__default.useContext(RootCtx);
|
|
27178
26775
|
const isRoot = enabled && parentRoot === null;
|
|
27179
|
-
const zoneId =
|
|
26776
|
+
const zoneId = React97__default.useId();
|
|
27180
26777
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
27181
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
27182
|
-
const optimisticOrdersRef =
|
|
26778
|
+
const [optimisticOrders, setOptimisticOrders] = React97__default.useState(() => /* @__PURE__ */ new Map());
|
|
26779
|
+
const optimisticOrdersRef = React97__default.useRef(optimisticOrders);
|
|
27183
26780
|
optimisticOrdersRef.current = optimisticOrders;
|
|
27184
|
-
const clearOptimisticOrder =
|
|
26781
|
+
const clearOptimisticOrder = React97__default.useCallback((group) => {
|
|
27185
26782
|
setOptimisticOrders((prev) => {
|
|
27186
26783
|
if (!prev.has(group)) return prev;
|
|
27187
26784
|
const next = new Map(prev);
|
|
@@ -27206,7 +26803,7 @@ function useDataDnd(args) {
|
|
|
27206
26803
|
const raw = it[dndItemIdField];
|
|
27207
26804
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
27208
26805
|
}).join("|");
|
|
27209
|
-
const itemIds =
|
|
26806
|
+
const itemIds = React97__default.useMemo(
|
|
27210
26807
|
() => orderedItems.map((it, idx) => {
|
|
27211
26808
|
const raw = it[dndItemIdField];
|
|
27212
26809
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -27217,7 +26814,7 @@ function useDataDnd(args) {
|
|
|
27217
26814
|
const raw = it[dndItemIdField];
|
|
27218
26815
|
return raw != null ? String(raw) : `__${idx}`;
|
|
27219
26816
|
}).join("|");
|
|
27220
|
-
|
|
26817
|
+
React97__default.useEffect(() => {
|
|
27221
26818
|
const root = isRoot ? null : parentRoot;
|
|
27222
26819
|
if (root) {
|
|
27223
26820
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -27225,20 +26822,20 @@ function useDataDnd(args) {
|
|
|
27225
26822
|
clearOptimisticOrder(ownGroup);
|
|
27226
26823
|
}
|
|
27227
26824
|
}, [itemsContentSig, ownGroup]);
|
|
27228
|
-
const zonesRef =
|
|
27229
|
-
const registerZone =
|
|
26825
|
+
const zonesRef = React97__default.useRef(/* @__PURE__ */ new Map());
|
|
26826
|
+
const registerZone = React97__default.useCallback((zoneId2, meta2) => {
|
|
27230
26827
|
zonesRef.current.set(zoneId2, meta2);
|
|
27231
26828
|
}, []);
|
|
27232
|
-
const unregisterZone =
|
|
26829
|
+
const unregisterZone = React97__default.useCallback((zoneId2) => {
|
|
27233
26830
|
zonesRef.current.delete(zoneId2);
|
|
27234
26831
|
}, []);
|
|
27235
|
-
const [activeDrag, setActiveDrag] =
|
|
27236
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
27237
|
-
const meta =
|
|
26832
|
+
const [activeDrag, setActiveDrag] = React97__default.useState(null);
|
|
26833
|
+
const [overZoneGroup, setOverZoneGroup] = React97__default.useState(null);
|
|
26834
|
+
const meta = React97__default.useMemo(
|
|
27238
26835
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
27239
26836
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
27240
26837
|
);
|
|
27241
|
-
|
|
26838
|
+
React97__default.useEffect(() => {
|
|
27242
26839
|
const target = isRoot ? null : parentRoot;
|
|
27243
26840
|
if (!target) {
|
|
27244
26841
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -27257,7 +26854,7 @@ function useDataDnd(args) {
|
|
|
27257
26854
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
27258
26855
|
const sensors = useAlmadarDndSensors(true);
|
|
27259
26856
|
const collisionDetection = almadarDndCollisionDetection;
|
|
27260
|
-
const findZoneByItem =
|
|
26857
|
+
const findZoneByItem = React97__default.useCallback(
|
|
27261
26858
|
(id) => {
|
|
27262
26859
|
for (const z of zonesRef.current.values()) {
|
|
27263
26860
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -27266,7 +26863,7 @@ function useDataDnd(args) {
|
|
|
27266
26863
|
},
|
|
27267
26864
|
[]
|
|
27268
26865
|
);
|
|
27269
|
-
|
|
26866
|
+
React97__default.useCallback(
|
|
27270
26867
|
(group) => {
|
|
27271
26868
|
for (const z of zonesRef.current.values()) {
|
|
27272
26869
|
if (z.group === group) return z;
|
|
@@ -27275,7 +26872,7 @@ function useDataDnd(args) {
|
|
|
27275
26872
|
},
|
|
27276
26873
|
[]
|
|
27277
26874
|
);
|
|
27278
|
-
const handleDragEnd =
|
|
26875
|
+
const handleDragEnd = React97__default.useCallback(
|
|
27279
26876
|
(event) => {
|
|
27280
26877
|
const { active, over } = event;
|
|
27281
26878
|
const activeIdStr = String(active.id);
|
|
@@ -27366,8 +26963,8 @@ function useDataDnd(args) {
|
|
|
27366
26963
|
},
|
|
27367
26964
|
[eventBus]
|
|
27368
26965
|
);
|
|
27369
|
-
const sortableData =
|
|
27370
|
-
const SortableItem =
|
|
26966
|
+
const sortableData = React97__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
26967
|
+
const SortableItem = React97__default.useCallback(
|
|
27371
26968
|
({ id, children }) => {
|
|
27372
26969
|
const {
|
|
27373
26970
|
attributes,
|
|
@@ -27407,7 +27004,7 @@ function useDataDnd(args) {
|
|
|
27407
27004
|
id: droppableId,
|
|
27408
27005
|
data: sortableData
|
|
27409
27006
|
});
|
|
27410
|
-
const ctx =
|
|
27007
|
+
const ctx = React97__default.useContext(RootCtx);
|
|
27411
27008
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
27412
27009
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
27413
27010
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -27422,7 +27019,7 @@ function useDataDnd(args) {
|
|
|
27422
27019
|
showForeignPlaceholder,
|
|
27423
27020
|
ctxAvailable: ctx != null
|
|
27424
27021
|
});
|
|
27425
|
-
|
|
27022
|
+
React97__default.useEffect(() => {
|
|
27426
27023
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
27427
27024
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
27428
27025
|
return /* @__PURE__ */ jsx(
|
|
@@ -27436,11 +27033,11 @@ function useDataDnd(args) {
|
|
|
27436
27033
|
}
|
|
27437
27034
|
);
|
|
27438
27035
|
};
|
|
27439
|
-
const rootContextValue =
|
|
27036
|
+
const rootContextValue = React97__default.useMemo(
|
|
27440
27037
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
27441
27038
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
27442
27039
|
);
|
|
27443
|
-
const handleDragStart =
|
|
27040
|
+
const handleDragStart = React97__default.useCallback((event) => {
|
|
27444
27041
|
const sourceZone = findZoneByItem(event.active.id);
|
|
27445
27042
|
const rect = event.active.rect.current.initial;
|
|
27446
27043
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -27459,7 +27056,7 @@ function useDataDnd(args) {
|
|
|
27459
27056
|
isRoot
|
|
27460
27057
|
});
|
|
27461
27058
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
27462
|
-
const handleDragOver =
|
|
27059
|
+
const handleDragOver = React97__default.useCallback((event) => {
|
|
27463
27060
|
const { active, over } = event;
|
|
27464
27061
|
const overData = over?.data?.current;
|
|
27465
27062
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -27529,7 +27126,7 @@ function useDataDnd(args) {
|
|
|
27529
27126
|
return next;
|
|
27530
27127
|
});
|
|
27531
27128
|
}, []);
|
|
27532
|
-
const handleDragCancel =
|
|
27129
|
+
const handleDragCancel = React97__default.useCallback((event) => {
|
|
27533
27130
|
setActiveDrag(null);
|
|
27534
27131
|
setOverZoneGroup(null);
|
|
27535
27132
|
dndLog.warn("dragCancel", {
|
|
@@ -27537,12 +27134,12 @@ function useDataDnd(args) {
|
|
|
27537
27134
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
27538
27135
|
});
|
|
27539
27136
|
}, []);
|
|
27540
|
-
const handleDragEndWithCleanup =
|
|
27137
|
+
const handleDragEndWithCleanup = React97__default.useCallback((event) => {
|
|
27541
27138
|
handleDragEnd(event);
|
|
27542
27139
|
setActiveDrag(null);
|
|
27543
27140
|
setOverZoneGroup(null);
|
|
27544
27141
|
}, [handleDragEnd]);
|
|
27545
|
-
const wrapContainer =
|
|
27142
|
+
const wrapContainer = React97__default.useCallback(
|
|
27546
27143
|
(children) => {
|
|
27547
27144
|
if (!enabled) return children;
|
|
27548
27145
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -27596,7 +27193,7 @@ var init_useDataDnd = __esm({
|
|
|
27596
27193
|
init_useAlmadarDndCollision();
|
|
27597
27194
|
init_Box();
|
|
27598
27195
|
dndLog = createLogger("almadar:ui:dnd");
|
|
27599
|
-
RootCtx =
|
|
27196
|
+
RootCtx = React97__default.createContext(null);
|
|
27600
27197
|
}
|
|
27601
27198
|
});
|
|
27602
27199
|
function renderIconInput(icon, props) {
|
|
@@ -28122,7 +27719,7 @@ function DataList({
|
|
|
28122
27719
|
}) {
|
|
28123
27720
|
const eventBus = useEventBus();
|
|
28124
27721
|
const { t } = useTranslate();
|
|
28125
|
-
const [visibleCount, setVisibleCount] =
|
|
27722
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize || Infinity);
|
|
28126
27723
|
const fieldDefs = fields ?? columns ?? [];
|
|
28127
27724
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
28128
27725
|
const dnd = useDataDnd({
|
|
@@ -28141,7 +27738,7 @@ function DataList({
|
|
|
28141
27738
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
28142
27739
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
28143
27740
|
const hasRenderProp = typeof children === "function";
|
|
28144
|
-
|
|
27741
|
+
React97__default.useEffect(() => {
|
|
28145
27742
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
28146
27743
|
const childrenTypeOf = typeof children;
|
|
28147
27744
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -28245,7 +27842,7 @@ function DataList({
|
|
|
28245
27842
|
const items2 = [...data];
|
|
28246
27843
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
28247
27844
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
28248
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27845
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
28249
27846
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
28250
27847
|
group.items.map((itemData, index) => {
|
|
28251
27848
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -28386,7 +27983,7 @@ function DataList({
|
|
|
28386
27983
|
className
|
|
28387
27984
|
),
|
|
28388
27985
|
children: [
|
|
28389
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27986
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
28390
27987
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
28391
27988
|
group.items.map(
|
|
28392
27989
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -28471,7 +28068,7 @@ var init_FormSection = __esm({
|
|
|
28471
28068
|
columns = 1,
|
|
28472
28069
|
className
|
|
28473
28070
|
}) => {
|
|
28474
|
-
const [collapsed, setCollapsed] =
|
|
28071
|
+
const [collapsed, setCollapsed] = React97__default.useState(defaultCollapsed);
|
|
28475
28072
|
const { t } = useTranslate();
|
|
28476
28073
|
const eventBus = useEventBus();
|
|
28477
28074
|
const gridClass = {
|
|
@@ -28479,7 +28076,7 @@ var init_FormSection = __esm({
|
|
|
28479
28076
|
2: "grid-cols-1 md:grid-cols-2",
|
|
28480
28077
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
28481
28078
|
}[columns];
|
|
28482
|
-
|
|
28079
|
+
React97__default.useCallback(() => {
|
|
28483
28080
|
if (collapsible) {
|
|
28484
28081
|
setCollapsed((prev) => !prev);
|
|
28485
28082
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -29429,7 +29026,7 @@ var init_Flex = __esm({
|
|
|
29429
29026
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
29430
29027
|
}
|
|
29431
29028
|
}
|
|
29432
|
-
return
|
|
29029
|
+
return React97__default.createElement(Component, {
|
|
29433
29030
|
className: cn(
|
|
29434
29031
|
inline ? "inline-flex" : "flex",
|
|
29435
29032
|
directionStyles[direction],
|
|
@@ -29548,7 +29145,7 @@ var init_Grid = __esm({
|
|
|
29548
29145
|
as: Component = "div"
|
|
29549
29146
|
}) => {
|
|
29550
29147
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
29551
|
-
return
|
|
29148
|
+
return React97__default.createElement(
|
|
29552
29149
|
Component,
|
|
29553
29150
|
{
|
|
29554
29151
|
className: cn(
|
|
@@ -29744,9 +29341,9 @@ var init_Popover = __esm({
|
|
|
29744
29341
|
onMouseLeave: handleClose,
|
|
29745
29342
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
29746
29343
|
};
|
|
29747
|
-
const childElement =
|
|
29344
|
+
const childElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
29748
29345
|
const childPointerDown = childElement.props.onPointerDown;
|
|
29749
|
-
const triggerElement =
|
|
29346
|
+
const triggerElement = React97__default.cloneElement(
|
|
29750
29347
|
childElement,
|
|
29751
29348
|
{
|
|
29752
29349
|
ref: triggerRef,
|
|
@@ -30348,9 +29945,9 @@ var init_Tooltip = __esm({
|
|
|
30348
29945
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
30349
29946
|
};
|
|
30350
29947
|
}, []);
|
|
30351
|
-
const triggerElement =
|
|
29948
|
+
const triggerElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30352
29949
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
30353
|
-
const trigger =
|
|
29950
|
+
const trigger = React97__default.cloneElement(triggerElement, {
|
|
30354
29951
|
ref: triggerRef,
|
|
30355
29952
|
onMouseEnter: handleMouseEnter,
|
|
30356
29953
|
onMouseLeave: handleMouseLeave,
|
|
@@ -30440,7 +30037,7 @@ var init_WizardProgress = __esm({
|
|
|
30440
30037
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
30441
30038
|
const isActive = index === currentStep;
|
|
30442
30039
|
const isCompleted = index < currentStep;
|
|
30443
|
-
return /* @__PURE__ */ jsxs(
|
|
30040
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
30444
30041
|
/* @__PURE__ */ jsx(
|
|
30445
30042
|
"button",
|
|
30446
30043
|
{
|
|
@@ -32000,13 +31597,13 @@ var init_MapView = __esm({
|
|
|
32000
31597
|
shadowSize: [41, 41]
|
|
32001
31598
|
});
|
|
32002
31599
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32003
|
-
const { useEffect:
|
|
31600
|
+
const { useEffect: useEffect69, useRef: useRef67, useCallback: useCallback106, useState: useState100 } = React97__default;
|
|
32004
31601
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32005
31602
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32006
31603
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32007
31604
|
const map = useMap();
|
|
32008
|
-
const prevRef =
|
|
32009
|
-
|
|
31605
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
31606
|
+
useEffect69(() => {
|
|
32010
31607
|
const prev = prevRef.current;
|
|
32011
31608
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32012
31609
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32017,7 +31614,7 @@ var init_MapView = __esm({
|
|
|
32017
31614
|
}
|
|
32018
31615
|
function MapClickHandler({ onMapClick }) {
|
|
32019
31616
|
const map = useMap();
|
|
32020
|
-
|
|
31617
|
+
useEffect69(() => {
|
|
32021
31618
|
if (!onMapClick) return;
|
|
32022
31619
|
const handler = (e) => {
|
|
32023
31620
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -32045,8 +31642,8 @@ var init_MapView = __esm({
|
|
|
32045
31642
|
showAttribution = true
|
|
32046
31643
|
}) {
|
|
32047
31644
|
const eventBus = useEventBus2();
|
|
32048
|
-
const [clickedPosition, setClickedPosition] =
|
|
32049
|
-
const handleMapClick =
|
|
31645
|
+
const [clickedPosition, setClickedPosition] = useState100(null);
|
|
31646
|
+
const handleMapClick = useCallback106((lat, lng) => {
|
|
32050
31647
|
if (showClickedPin) {
|
|
32051
31648
|
setClickedPosition({ lat, lng });
|
|
32052
31649
|
}
|
|
@@ -32055,7 +31652,7 @@ var init_MapView = __esm({
|
|
|
32055
31652
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
32056
31653
|
}
|
|
32057
31654
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
32058
|
-
const handleMarkerClick =
|
|
31655
|
+
const handleMarkerClick = useCallback106((marker) => {
|
|
32059
31656
|
onMarkerClick?.(marker);
|
|
32060
31657
|
if (markerClickEvent) {
|
|
32061
31658
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32915,8 +32512,8 @@ function TableView({
|
|
|
32915
32512
|
}) {
|
|
32916
32513
|
const eventBus = useEventBus();
|
|
32917
32514
|
const { t } = useTranslate();
|
|
32918
|
-
const [visibleCount, setVisibleCount] =
|
|
32919
|
-
const [localSelected, setLocalSelected] =
|
|
32515
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
32516
|
+
const [localSelected, setLocalSelected] = React97__default.useState(/* @__PURE__ */ new Set());
|
|
32920
32517
|
const colDefs = columns ?? fields ?? [];
|
|
32921
32518
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32922
32519
|
const dnd = useDataDnd({
|
|
@@ -33111,12 +32708,12 @@ function TableView({
|
|
|
33111
32708
|
]
|
|
33112
32709
|
}
|
|
33113
32710
|
);
|
|
33114
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
32711
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React97__default.Fragment, { children: rowInner }, id);
|
|
33115
32712
|
};
|
|
33116
32713
|
const items = Array.from(data);
|
|
33117
32714
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
33118
32715
|
let runningIndex = 0;
|
|
33119
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32716
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
33120
32717
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
33121
32718
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
33122
32719
|
] }, gi)) });
|
|
@@ -34473,7 +34070,7 @@ var init_StepFlow = __esm({
|
|
|
34473
34070
|
className
|
|
34474
34071
|
}) => {
|
|
34475
34072
|
if (orientation === "vertical") {
|
|
34476
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
34073
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React97__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
34477
34074
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
34478
34075
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34479
34076
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -34484,7 +34081,7 @@ var init_StepFlow = __esm({
|
|
|
34484
34081
|
] })
|
|
34485
34082
|
] }) }, index)) });
|
|
34486
34083
|
}
|
|
34487
|
-
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(
|
|
34084
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
34488
34085
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
34489
34086
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34490
34087
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -35469,7 +35066,7 @@ var init_LikertScale = __esm({
|
|
|
35469
35066
|
md: "text-base",
|
|
35470
35067
|
lg: "text-lg"
|
|
35471
35068
|
};
|
|
35472
|
-
LikertScale =
|
|
35069
|
+
LikertScale = React97__default.forwardRef(
|
|
35473
35070
|
({
|
|
35474
35071
|
question,
|
|
35475
35072
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -35481,7 +35078,7 @@ var init_LikertScale = __esm({
|
|
|
35481
35078
|
variant = "radios",
|
|
35482
35079
|
className
|
|
35483
35080
|
}, ref) => {
|
|
35484
|
-
const groupId =
|
|
35081
|
+
const groupId = React97__default.useId();
|
|
35485
35082
|
const eventBus = useEventBus();
|
|
35486
35083
|
const handleSelect = useCallback(
|
|
35487
35084
|
(next) => {
|
|
@@ -37763,7 +37360,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
37763
37360
|
"aria-label": t("aria.breadcrumb"),
|
|
37764
37361
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
37765
37362
|
const isLast = idx === items.length - 1;
|
|
37766
|
-
return /* @__PURE__ */ jsxs(
|
|
37363
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
37767
37364
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
37768
37365
|
Icon,
|
|
37769
37366
|
{
|
|
@@ -38632,7 +38229,7 @@ var init_MiniStateMachine = __esm({
|
|
|
38632
38229
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
38633
38230
|
const tc = transitionCounts[s.name] ?? 0;
|
|
38634
38231
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
38635
|
-
return /* @__PURE__ */ jsxs(
|
|
38232
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
38636
38233
|
/* @__PURE__ */ jsx(
|
|
38637
38234
|
AvlState,
|
|
38638
38235
|
{
|
|
@@ -38836,7 +38433,7 @@ var init_PageHeader = __esm({
|
|
|
38836
38433
|
info: "bg-info/10 text-info"
|
|
38837
38434
|
};
|
|
38838
38435
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
38839
|
-
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(
|
|
38436
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
38840
38437
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
38841
38438
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
38842
38439
|
"a",
|
|
@@ -39194,7 +38791,7 @@ var init_Section = __esm({
|
|
|
39194
38791
|
as: Component = "section"
|
|
39195
38792
|
}) => {
|
|
39196
38793
|
const hasHeader = title || description || action;
|
|
39197
|
-
return
|
|
38794
|
+
return React97__default.createElement(
|
|
39198
38795
|
Component,
|
|
39199
38796
|
{
|
|
39200
38797
|
className: cn(
|
|
@@ -39568,7 +39165,7 @@ var init_WizardContainer = __esm({
|
|
|
39568
39165
|
const isCompleted = index < currentStep;
|
|
39569
39166
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
39570
39167
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
39571
|
-
return /* @__PURE__ */ jsxs(
|
|
39168
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
39572
39169
|
/* @__PURE__ */ jsx(
|
|
39573
39170
|
Button,
|
|
39574
39171
|
{
|
|
@@ -42001,7 +41598,7 @@ var init_DetailPanel = __esm({
|
|
|
42001
41598
|
}
|
|
42002
41599
|
});
|
|
42003
41600
|
function extractTitle(children) {
|
|
42004
|
-
if (!
|
|
41601
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
42005
41602
|
const props = children.props;
|
|
42006
41603
|
if (typeof props.title === "string") {
|
|
42007
41604
|
return props.title;
|
|
@@ -42351,12 +41948,12 @@ var init_Form = __esm({
|
|
|
42351
41948
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42352
41949
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42353
41950
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42354
|
-
const normalizedInitialData =
|
|
41951
|
+
const normalizedInitialData = React97__default.useMemo(() => {
|
|
42355
41952
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42356
41953
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42357
41954
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42358
41955
|
}, [entity, initialData]);
|
|
42359
|
-
const entityDerivedFields =
|
|
41956
|
+
const entityDerivedFields = React97__default.useMemo(() => {
|
|
42360
41957
|
if (fields && fields.length > 0) return void 0;
|
|
42361
41958
|
if (!resolvedEntity) return void 0;
|
|
42362
41959
|
return resolvedEntity.fields.map(
|
|
@@ -42377,16 +41974,16 @@ var init_Form = __esm({
|
|
|
42377
41974
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42378
41975
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42379
41976
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42380
|
-
const [formData, setFormData] =
|
|
41977
|
+
const [formData, setFormData] = React97__default.useState(
|
|
42381
41978
|
normalizedInitialData
|
|
42382
41979
|
);
|
|
42383
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41980
|
+
const [collapsedSections, setCollapsedSections] = React97__default.useState(
|
|
42384
41981
|
/* @__PURE__ */ new Set()
|
|
42385
41982
|
);
|
|
42386
|
-
const [submitError, setSubmitError] =
|
|
42387
|
-
const formRef =
|
|
41983
|
+
const [submitError, setSubmitError] = React97__default.useState(null);
|
|
41984
|
+
const formRef = React97__default.useRef(null);
|
|
42388
41985
|
const formMode = props.mode;
|
|
42389
|
-
const mountedRef =
|
|
41986
|
+
const mountedRef = React97__default.useRef(false);
|
|
42390
41987
|
if (!mountedRef.current) {
|
|
42391
41988
|
mountedRef.current = true;
|
|
42392
41989
|
debug("forms", "mount", {
|
|
@@ -42399,7 +41996,7 @@ var init_Form = __esm({
|
|
|
42399
41996
|
});
|
|
42400
41997
|
}
|
|
42401
41998
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42402
|
-
const evalContext =
|
|
41999
|
+
const evalContext = React97__default.useMemo(
|
|
42403
42000
|
() => ({
|
|
42404
42001
|
formValues: formData,
|
|
42405
42002
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42408,7 +42005,7 @@ var init_Form = __esm({
|
|
|
42408
42005
|
}),
|
|
42409
42006
|
[formData, externalContext]
|
|
42410
42007
|
);
|
|
42411
|
-
|
|
42008
|
+
React97__default.useEffect(() => {
|
|
42412
42009
|
debug("forms", "initialData-sync", {
|
|
42413
42010
|
mode: formMode,
|
|
42414
42011
|
normalizedInitialData,
|
|
@@ -42419,7 +42016,7 @@ var init_Form = __esm({
|
|
|
42419
42016
|
setFormData(normalizedInitialData);
|
|
42420
42017
|
}
|
|
42421
42018
|
}, [normalizedInitialData]);
|
|
42422
|
-
const processCalculations =
|
|
42019
|
+
const processCalculations = React97__default.useCallback(
|
|
42423
42020
|
(changedFieldId, newFormData) => {
|
|
42424
42021
|
if (!hiddenCalculations.length) return;
|
|
42425
42022
|
const context = {
|
|
@@ -42444,7 +42041,7 @@ var init_Form = __esm({
|
|
|
42444
42041
|
},
|
|
42445
42042
|
[hiddenCalculations, externalContext, eventBus]
|
|
42446
42043
|
);
|
|
42447
|
-
const checkViolations =
|
|
42044
|
+
const checkViolations = React97__default.useCallback(
|
|
42448
42045
|
(changedFieldId, newFormData) => {
|
|
42449
42046
|
if (!violationTriggers.length) return;
|
|
42450
42047
|
const context = {
|
|
@@ -42482,7 +42079,7 @@ var init_Form = __esm({
|
|
|
42482
42079
|
processCalculations(name, newFormData);
|
|
42483
42080
|
checkViolations(name, newFormData);
|
|
42484
42081
|
};
|
|
42485
|
-
const isFieldVisible =
|
|
42082
|
+
const isFieldVisible = React97__default.useCallback(
|
|
42486
42083
|
(fieldName) => {
|
|
42487
42084
|
const condition = conditionalFields[fieldName];
|
|
42488
42085
|
if (!condition) return true;
|
|
@@ -42490,7 +42087,7 @@ var init_Form = __esm({
|
|
|
42490
42087
|
},
|
|
42491
42088
|
[conditionalFields, evalContext]
|
|
42492
42089
|
);
|
|
42493
|
-
const isSectionVisible =
|
|
42090
|
+
const isSectionVisible = React97__default.useCallback(
|
|
42494
42091
|
(section) => {
|
|
42495
42092
|
if (!section.condition) return true;
|
|
42496
42093
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42566,7 +42163,7 @@ var init_Form = __esm({
|
|
|
42566
42163
|
eventBus.emit(`UI:${onCancel}`);
|
|
42567
42164
|
}
|
|
42568
42165
|
};
|
|
42569
|
-
const renderField =
|
|
42166
|
+
const renderField = React97__default.useCallback(
|
|
42570
42167
|
(field) => {
|
|
42571
42168
|
const fieldName = field.name || field.field;
|
|
42572
42169
|
if (!fieldName) return null;
|
|
@@ -42587,7 +42184,7 @@ var init_Form = __esm({
|
|
|
42587
42184
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42588
42185
|
);
|
|
42589
42186
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42590
|
-
const normalizedFields =
|
|
42187
|
+
const normalizedFields = React97__default.useMemo(() => {
|
|
42591
42188
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42592
42189
|
return effectiveFields.map((field) => {
|
|
42593
42190
|
if (typeof field === "string") {
|
|
@@ -42611,7 +42208,7 @@ var init_Form = __esm({
|
|
|
42611
42208
|
return field;
|
|
42612
42209
|
});
|
|
42613
42210
|
}, [effectiveFields, resolvedEntity]);
|
|
42614
|
-
const schemaFields =
|
|
42211
|
+
const schemaFields = React97__default.useMemo(() => {
|
|
42615
42212
|
if (normalizedFields.length === 0) return null;
|
|
42616
42213
|
if (isDebugEnabled()) {
|
|
42617
42214
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42621,7 +42218,7 @@ var init_Form = __esm({
|
|
|
42621
42218
|
}
|
|
42622
42219
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42623
42220
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42624
|
-
const sectionElements =
|
|
42221
|
+
const sectionElements = React97__default.useMemo(() => {
|
|
42625
42222
|
if (!sections || sections.length === 0) return null;
|
|
42626
42223
|
return sections.map((section) => {
|
|
42627
42224
|
if (!isSectionVisible(section)) {
|
|
@@ -43346,7 +42943,7 @@ var init_List = __esm({
|
|
|
43346
42943
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
43347
42944
|
return [];
|
|
43348
42945
|
}, [entity]);
|
|
43349
|
-
const getItemActions =
|
|
42946
|
+
const getItemActions = React97__default.useCallback(
|
|
43350
42947
|
(item) => {
|
|
43351
42948
|
if (!itemActions) return [];
|
|
43352
42949
|
if (typeof itemActions === "function") {
|
|
@@ -43821,7 +43418,7 @@ var init_MediaGallery = __esm({
|
|
|
43821
43418
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
43822
43419
|
);
|
|
43823
43420
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
43824
|
-
const items =
|
|
43421
|
+
const items = React97__default.useMemo(() => {
|
|
43825
43422
|
if (propItems) return propItems;
|
|
43826
43423
|
if (entityData.length === 0) return [];
|
|
43827
43424
|
return entityData.map((record, idx) => {
|
|
@@ -43984,7 +43581,7 @@ var init_MediaGallery = __esm({
|
|
|
43984
43581
|
}
|
|
43985
43582
|
});
|
|
43986
43583
|
function extractTitle2(children) {
|
|
43987
|
-
if (!
|
|
43584
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
43988
43585
|
const props = children.props;
|
|
43989
43586
|
if (typeof props.title === "string") {
|
|
43990
43587
|
return props.title;
|
|
@@ -44239,7 +43836,7 @@ var init_debugRegistry = __esm({
|
|
|
44239
43836
|
}
|
|
44240
43837
|
});
|
|
44241
43838
|
function useDebugData() {
|
|
44242
|
-
const [data, setData] =
|
|
43839
|
+
const [data, setData] = React97.useState(() => ({
|
|
44243
43840
|
traits: [],
|
|
44244
43841
|
ticks: [],
|
|
44245
43842
|
guards: [],
|
|
@@ -44253,7 +43850,7 @@ function useDebugData() {
|
|
|
44253
43850
|
},
|
|
44254
43851
|
lastUpdate: Date.now()
|
|
44255
43852
|
}));
|
|
44256
|
-
|
|
43853
|
+
React97.useEffect(() => {
|
|
44257
43854
|
const updateData = () => {
|
|
44258
43855
|
setData({
|
|
44259
43856
|
traits: getAllTraits(),
|
|
@@ -44362,12 +43959,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44362
43959
|
return positions;
|
|
44363
43960
|
}
|
|
44364
43961
|
function WalkMinimap() {
|
|
44365
|
-
const [walkStep, setWalkStep] =
|
|
44366
|
-
const [traits2, setTraits] =
|
|
44367
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44368
|
-
const [completedTraits, setCompletedTraits] =
|
|
44369
|
-
const prevTraitRef =
|
|
44370
|
-
|
|
43962
|
+
const [walkStep, setWalkStep] = React97.useState(null);
|
|
43963
|
+
const [traits2, setTraits] = React97.useState([]);
|
|
43964
|
+
const [coveredEdges, setCoveredEdges] = React97.useState([]);
|
|
43965
|
+
const [completedTraits, setCompletedTraits] = React97.useState(/* @__PURE__ */ new Set());
|
|
43966
|
+
const prevTraitRef = React97.useRef(null);
|
|
43967
|
+
React97.useEffect(() => {
|
|
44371
43968
|
const interval = setInterval(() => {
|
|
44372
43969
|
const w = window;
|
|
44373
43970
|
const step = w.__orbitalWalkStep;
|
|
@@ -44803,15 +44400,15 @@ var init_EntitiesTab = __esm({
|
|
|
44803
44400
|
});
|
|
44804
44401
|
function EventFlowTab({ events: events2 }) {
|
|
44805
44402
|
const { t } = useTranslate();
|
|
44806
|
-
const [filter, setFilter] =
|
|
44807
|
-
const containerRef =
|
|
44808
|
-
const [autoScroll, setAutoScroll] =
|
|
44809
|
-
|
|
44403
|
+
const [filter, setFilter] = React97.useState("all");
|
|
44404
|
+
const containerRef = React97.useRef(null);
|
|
44405
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
44406
|
+
React97.useEffect(() => {
|
|
44810
44407
|
if (autoScroll && containerRef.current) {
|
|
44811
44408
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44812
44409
|
}
|
|
44813
44410
|
}, [events2.length, autoScroll]);
|
|
44814
|
-
const filteredEvents =
|
|
44411
|
+
const filteredEvents = React97.useMemo(() => {
|
|
44815
44412
|
if (filter === "all") return events2;
|
|
44816
44413
|
return events2.filter((e) => e.type === filter);
|
|
44817
44414
|
}, [events2, filter]);
|
|
@@ -44927,7 +44524,7 @@ var init_EventFlowTab = __esm({
|
|
|
44927
44524
|
});
|
|
44928
44525
|
function GuardsPanel({ guards }) {
|
|
44929
44526
|
const { t } = useTranslate();
|
|
44930
|
-
const [filter, setFilter] =
|
|
44527
|
+
const [filter, setFilter] = React97.useState("all");
|
|
44931
44528
|
if (guards.length === 0) {
|
|
44932
44529
|
return /* @__PURE__ */ jsx(
|
|
44933
44530
|
EmptyState,
|
|
@@ -44940,7 +44537,7 @@ function GuardsPanel({ guards }) {
|
|
|
44940
44537
|
}
|
|
44941
44538
|
const passedCount = guards.filter((g) => g.result).length;
|
|
44942
44539
|
const failedCount = guards.length - passedCount;
|
|
44943
|
-
const filteredGuards =
|
|
44540
|
+
const filteredGuards = React97.useMemo(() => {
|
|
44944
44541
|
if (filter === "all") return guards;
|
|
44945
44542
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
44946
44543
|
return guards.filter((g) => !g.result);
|
|
@@ -45103,10 +44700,10 @@ function EffectBadge({ effect }) {
|
|
|
45103
44700
|
}
|
|
45104
44701
|
function TransitionTimeline({ transitions }) {
|
|
45105
44702
|
const { t } = useTranslate();
|
|
45106
|
-
const containerRef =
|
|
45107
|
-
const [autoScroll, setAutoScroll] =
|
|
45108
|
-
const [expandedId, setExpandedId] =
|
|
45109
|
-
|
|
44703
|
+
const containerRef = React97.useRef(null);
|
|
44704
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
44705
|
+
const [expandedId, setExpandedId] = React97.useState(null);
|
|
44706
|
+
React97.useEffect(() => {
|
|
45110
44707
|
if (autoScroll && containerRef.current) {
|
|
45111
44708
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45112
44709
|
}
|
|
@@ -45386,9 +44983,9 @@ function getAllEvents(traits2) {
|
|
|
45386
44983
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
45387
44984
|
const eventBus = useEventBus();
|
|
45388
44985
|
const { t } = useTranslate();
|
|
45389
|
-
const [log13, setLog] =
|
|
45390
|
-
const prevStatesRef =
|
|
45391
|
-
|
|
44986
|
+
const [log13, setLog] = React97.useState([]);
|
|
44987
|
+
const prevStatesRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
44988
|
+
React97.useEffect(() => {
|
|
45392
44989
|
for (const trait of traits2) {
|
|
45393
44990
|
const prev = prevStatesRef.current.get(trait.id);
|
|
45394
44991
|
if (prev && prev !== trait.currentState) {
|
|
@@ -45557,10 +45154,10 @@ function VerifyModePanel({
|
|
|
45557
45154
|
localCount
|
|
45558
45155
|
}) {
|
|
45559
45156
|
const { t } = useTranslate();
|
|
45560
|
-
const [expanded, setExpanded] =
|
|
45561
|
-
const scrollRef =
|
|
45562
|
-
const prevCountRef =
|
|
45563
|
-
|
|
45157
|
+
const [expanded, setExpanded] = React97.useState(true);
|
|
45158
|
+
const scrollRef = React97.useRef(null);
|
|
45159
|
+
const prevCountRef = React97.useRef(0);
|
|
45160
|
+
React97.useEffect(() => {
|
|
45564
45161
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
45565
45162
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
45566
45163
|
}
|
|
@@ -45617,10 +45214,10 @@ function RuntimeDebugger({
|
|
|
45617
45214
|
schema
|
|
45618
45215
|
}) {
|
|
45619
45216
|
const { t } = useTranslate();
|
|
45620
|
-
const [isCollapsed, setIsCollapsed] =
|
|
45621
|
-
const [isVisible, setIsVisible] =
|
|
45217
|
+
const [isCollapsed, setIsCollapsed] = React97.useState(mode === "verify" ? true : defaultCollapsed);
|
|
45218
|
+
const [isVisible, setIsVisible] = React97.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
45622
45219
|
const debugData = useDebugData();
|
|
45623
|
-
|
|
45220
|
+
React97.useEffect(() => {
|
|
45624
45221
|
if (mode === "inline") return;
|
|
45625
45222
|
return onDebugToggle((enabled) => {
|
|
45626
45223
|
setIsVisible(enabled);
|
|
@@ -45629,7 +45226,7 @@ function RuntimeDebugger({
|
|
|
45629
45226
|
}
|
|
45630
45227
|
});
|
|
45631
45228
|
}, [mode]);
|
|
45632
|
-
|
|
45229
|
+
React97.useEffect(() => {
|
|
45633
45230
|
if (mode === "inline") return;
|
|
45634
45231
|
const handleKeyDown = (e) => {
|
|
45635
45232
|
if (e.key === "`" && isVisible) {
|
|
@@ -46149,7 +45746,7 @@ var init_StatCard = __esm({
|
|
|
46149
45746
|
const labelToUse = propLabel ?? propTitle;
|
|
46150
45747
|
const eventBus = useEventBus();
|
|
46151
45748
|
const { t } = useTranslate();
|
|
46152
|
-
const handleActionClick =
|
|
45749
|
+
const handleActionClick = React97__default.useCallback(() => {
|
|
46153
45750
|
if (action?.event) {
|
|
46154
45751
|
eventBus.emit(`UI:${action.event}`, {});
|
|
46155
45752
|
}
|
|
@@ -46160,7 +45757,7 @@ var init_StatCard = __esm({
|
|
|
46160
45757
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
46161
45758
|
const isLoading = externalLoading ?? false;
|
|
46162
45759
|
const error = externalError;
|
|
46163
|
-
const computeMetricValue =
|
|
45760
|
+
const computeMetricValue = React97__default.useCallback(
|
|
46164
45761
|
(metric, items) => {
|
|
46165
45762
|
if (metric.value !== void 0) {
|
|
46166
45763
|
return metric.value;
|
|
@@ -46199,7 +45796,7 @@ var init_StatCard = __esm({
|
|
|
46199
45796
|
},
|
|
46200
45797
|
[]
|
|
46201
45798
|
);
|
|
46202
|
-
const schemaStats =
|
|
45799
|
+
const schemaStats = React97__default.useMemo(() => {
|
|
46203
45800
|
if (!metrics || metrics.length === 0) return null;
|
|
46204
45801
|
return metrics.map((metric) => ({
|
|
46205
45802
|
label: metric.label,
|
|
@@ -46207,7 +45804,7 @@ var init_StatCard = __esm({
|
|
|
46207
45804
|
format: metric.format
|
|
46208
45805
|
}));
|
|
46209
45806
|
}, [metrics, data, computeMetricValue]);
|
|
46210
|
-
const calculatedTrend =
|
|
45807
|
+
const calculatedTrend = React97__default.useMemo(() => {
|
|
46211
45808
|
if (manualTrend !== void 0) return manualTrend;
|
|
46212
45809
|
if (previousValue === void 0 || currentValue === void 0)
|
|
46213
45810
|
return void 0;
|
|
@@ -46847,8 +46444,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46847
46444
|
] });
|
|
46848
46445
|
};
|
|
46849
46446
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
46850
|
-
const endRef =
|
|
46851
|
-
|
|
46447
|
+
const endRef = React97__default.useRef(null);
|
|
46448
|
+
React97__default.useEffect(() => {
|
|
46852
46449
|
if (!autoScroll) return;
|
|
46853
46450
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46854
46451
|
}, [activities.length, autoScroll]);
|
|
@@ -46942,7 +46539,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
46942
46539
|
};
|
|
46943
46540
|
SubagentRichCard = ({ subagent }) => {
|
|
46944
46541
|
const { t } = useTranslate();
|
|
46945
|
-
const activities =
|
|
46542
|
+
const activities = React97__default.useMemo(
|
|
46946
46543
|
() => subagentMessagesToActivities(subagent.messages),
|
|
46947
46544
|
[subagent.messages]
|
|
46948
46545
|
);
|
|
@@ -47019,8 +46616,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47019
46616
|
] });
|
|
47020
46617
|
};
|
|
47021
46618
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
47022
|
-
const endRef =
|
|
47023
|
-
|
|
46619
|
+
const endRef = React97__default.useRef(null);
|
|
46620
|
+
React97__default.useEffect(() => {
|
|
47024
46621
|
if (!autoScroll) return;
|
|
47025
46622
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47026
46623
|
}, [messages.length, autoScroll]);
|
|
@@ -47450,7 +47047,7 @@ var init_Timeline = __esm({
|
|
|
47450
47047
|
}) => {
|
|
47451
47048
|
const { t } = useTranslate();
|
|
47452
47049
|
const entityData = entity ?? [];
|
|
47453
|
-
const items =
|
|
47050
|
+
const items = React97__default.useMemo(() => {
|
|
47454
47051
|
if (propItems) return propItems;
|
|
47455
47052
|
if (entityData.length === 0) return [];
|
|
47456
47053
|
return entityData.map((record, idx) => {
|
|
@@ -47552,7 +47149,7 @@ var init_Timeline = __esm({
|
|
|
47552
47149
|
}
|
|
47553
47150
|
});
|
|
47554
47151
|
function extractToastProps(children) {
|
|
47555
|
-
if (!
|
|
47152
|
+
if (!React97__default.isValidElement(children)) {
|
|
47556
47153
|
if (typeof children === "string") {
|
|
47557
47154
|
return { message: children };
|
|
47558
47155
|
}
|
|
@@ -47594,7 +47191,7 @@ var init_ToastSlot = __esm({
|
|
|
47594
47191
|
eventBus.emit(`${prefix}CLOSE`);
|
|
47595
47192
|
};
|
|
47596
47193
|
if (!isVisible) return null;
|
|
47597
|
-
const isCustomContent =
|
|
47194
|
+
const isCustomContent = React97__default.isValidElement(children) && !message;
|
|
47598
47195
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
47599
47196
|
Toast,
|
|
47600
47197
|
{
|
|
@@ -47611,7 +47208,7 @@ var init_ToastSlot = __esm({
|
|
|
47611
47208
|
}
|
|
47612
47209
|
});
|
|
47613
47210
|
function lazyThree(name, loader) {
|
|
47614
|
-
const Lazy =
|
|
47211
|
+
const Lazy = React97__default.lazy(
|
|
47615
47212
|
() => loader().then((m) => {
|
|
47616
47213
|
const Resolved = m[name];
|
|
47617
47214
|
if (!Resolved) {
|
|
@@ -47623,13 +47220,13 @@ function lazyThree(name, loader) {
|
|
|
47623
47220
|
})
|
|
47624
47221
|
);
|
|
47625
47222
|
function ThreeWrapper(props) {
|
|
47626
|
-
return
|
|
47223
|
+
return React97__default.createElement(
|
|
47627
47224
|
ThreeBoundary,
|
|
47628
47225
|
{ name },
|
|
47629
|
-
|
|
47630
|
-
|
|
47226
|
+
React97__default.createElement(
|
|
47227
|
+
React97__default.Suspense,
|
|
47631
47228
|
{ fallback: null },
|
|
47632
|
-
|
|
47229
|
+
React97__default.createElement(Lazy, props)
|
|
47633
47230
|
)
|
|
47634
47231
|
);
|
|
47635
47232
|
}
|
|
@@ -47671,7 +47268,6 @@ var init_component_registry_generated = __esm({
|
|
|
47671
47268
|
init_Canvas2D();
|
|
47672
47269
|
init_CanvasEffect();
|
|
47673
47270
|
init_Card();
|
|
47674
|
-
init_CardBattlerBoard();
|
|
47675
47271
|
init_CardGrid();
|
|
47676
47272
|
init_Carousel();
|
|
47677
47273
|
init_CaseStudyCard();
|
|
@@ -47902,13 +47498,12 @@ var init_component_registry_generated = __esm({
|
|
|
47902
47498
|
init_UploadDropZone();
|
|
47903
47499
|
init_VersionDiff();
|
|
47904
47500
|
init_ViolationAlert();
|
|
47905
|
-
init_VisualNovelBoard();
|
|
47906
47501
|
init_VoteStack();
|
|
47907
47502
|
init_WaypointMarker();
|
|
47908
47503
|
init_WizardContainer();
|
|
47909
47504
|
init_WizardNavigation();
|
|
47910
47505
|
init_WizardProgress();
|
|
47911
|
-
ThreeBoundary = class extends
|
|
47506
|
+
ThreeBoundary = class extends React97__default.Component {
|
|
47912
47507
|
constructor() {
|
|
47913
47508
|
super(...arguments);
|
|
47914
47509
|
__publicField(this, "state", { failed: false });
|
|
@@ -47918,7 +47513,7 @@ var init_component_registry_generated = __esm({
|
|
|
47918
47513
|
}
|
|
47919
47514
|
render() {
|
|
47920
47515
|
if (this.state.failed) {
|
|
47921
|
-
return
|
|
47516
|
+
return React97__default.createElement(
|
|
47922
47517
|
"div",
|
|
47923
47518
|
{
|
|
47924
47519
|
"data-testid": "three-unavailable",
|
|
@@ -47972,7 +47567,6 @@ var init_component_registry_generated = __esm({
|
|
|
47972
47567
|
"Canvas2D": Canvas2D,
|
|
47973
47568
|
"CanvasEffect": CanvasEffect,
|
|
47974
47569
|
"Card": Card,
|
|
47975
|
-
"CardBattlerBoard": CardBattlerBoard,
|
|
47976
47570
|
"CardGrid": CardGrid,
|
|
47977
47571
|
"Carousel": Carousel,
|
|
47978
47572
|
"CaseStudyCard": CaseStudyCard,
|
|
@@ -48217,7 +47811,6 @@ var init_component_registry_generated = __esm({
|
|
|
48217
47811
|
"VStack": VStack,
|
|
48218
47812
|
"VersionDiff": VersionDiff,
|
|
48219
47813
|
"ViolationAlert": ViolationAlert,
|
|
48220
|
-
"VisualNovelBoard": VisualNovelBoard,
|
|
48221
47814
|
"VoteStack": VoteStack,
|
|
48222
47815
|
"WaypointMarker": WaypointMarker,
|
|
48223
47816
|
"WizardContainer": WizardContainer,
|
|
@@ -48241,7 +47834,7 @@ function SuspenseConfigProvider({
|
|
|
48241
47834
|
config,
|
|
48242
47835
|
children
|
|
48243
47836
|
}) {
|
|
48244
|
-
return
|
|
47837
|
+
return React97__default.createElement(
|
|
48245
47838
|
SuspenseConfigContext.Provider,
|
|
48246
47839
|
{ value: config },
|
|
48247
47840
|
children
|
|
@@ -48283,7 +47876,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
48283
47876
|
}
|
|
48284
47877
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
48285
47878
|
}
|
|
48286
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
47879
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React97__default.isValidElement(field) && !(field instanceof Date)) {
|
|
48287
47880
|
const obj = field;
|
|
48288
47881
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
48289
47882
|
if (!fieldName) return field;
|
|
@@ -48736,7 +48329,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
48736
48329
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
48737
48330
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
48738
48331
|
}
|
|
48739
|
-
return /* @__PURE__ */ jsx(
|
|
48332
|
+
return /* @__PURE__ */ jsx(React97__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
48740
48333
|
}
|
|
48741
48334
|
if (!child || typeof child !== "object") return null;
|
|
48742
48335
|
const childId = `${parentId}-${index}`;
|
|
@@ -48776,14 +48369,14 @@ function isPatternConfig(value) {
|
|
|
48776
48369
|
if (value === null || value === void 0) return false;
|
|
48777
48370
|
if (typeof value !== "object") return false;
|
|
48778
48371
|
if (Array.isArray(value)) return false;
|
|
48779
|
-
if (
|
|
48372
|
+
if (React97__default.isValidElement(value)) return false;
|
|
48780
48373
|
if (value instanceof Date) return false;
|
|
48781
48374
|
if (typeof value === "function") return false;
|
|
48782
48375
|
const record = value;
|
|
48783
48376
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
48784
48377
|
}
|
|
48785
48378
|
function isPlainConfigObject(value) {
|
|
48786
|
-
if (
|
|
48379
|
+
if (React97__default.isValidElement(value)) return false;
|
|
48787
48380
|
if (value instanceof Date) return false;
|
|
48788
48381
|
const proto = Object.getPrototypeOf(value);
|
|
48789
48382
|
return proto === Object.prototype || proto === null;
|
|
@@ -48909,7 +48502,7 @@ function SlotContentRenderer({
|
|
|
48909
48502
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
48910
48503
|
const slotVal = restProps[slotKey];
|
|
48911
48504
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
48912
|
-
if (
|
|
48505
|
+
if (React97__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
48913
48506
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
48914
48507
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
48915
48508
|
slotVal,
|
|
@@ -48958,7 +48551,7 @@ function SlotContentRenderer({
|
|
|
48958
48551
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
48959
48552
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
48960
48553
|
const sample = resolvedItems[0];
|
|
48961
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
48554
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React97__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
48962
48555
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
48963
48556
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
48964
48557
|
}
|