@almadar/ui 5.84.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 +1263 -1671
- package/dist/avl/index.js +233 -641
- package/dist/components/game/2d/molecules/index.d.ts +0 -2
- package/dist/components/index.cjs +1352 -1764
- package/dist/components/index.js +309 -719
- package/dist/providers/index.cjs +1130 -1538
- package/dist/providers/index.js +209 -617
- package/dist/runtime/index.cjs +1124 -1532
- package/dist/runtime/index.js +213 -621
- 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);
|
|
@@ -9688,8 +9688,8 @@ function MiniMap({
|
|
|
9688
9688
|
tileAssets,
|
|
9689
9689
|
unitAssets
|
|
9690
9690
|
}) {
|
|
9691
|
-
const canvasRef =
|
|
9692
|
-
const imgCacheRef =
|
|
9691
|
+
const canvasRef = React97.useRef(null);
|
|
9692
|
+
const imgCacheRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
9693
9693
|
function loadImg(url) {
|
|
9694
9694
|
const cached = imgCacheRef.current.get(url);
|
|
9695
9695
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -9704,7 +9704,7 @@ function MiniMap({
|
|
|
9704
9704
|
imgCacheRef.current.set(url, img);
|
|
9705
9705
|
return null;
|
|
9706
9706
|
}
|
|
9707
|
-
|
|
9707
|
+
React97.useEffect(() => {
|
|
9708
9708
|
const canvas = canvasRef.current;
|
|
9709
9709
|
if (!canvas) return;
|
|
9710
9710
|
const ctx = canvas.getContext("2d");
|
|
@@ -9839,8 +9839,8 @@ function ControlGrid({
|
|
|
9839
9839
|
className
|
|
9840
9840
|
}) {
|
|
9841
9841
|
const eventBus = useEventBus();
|
|
9842
|
-
const [active, setActive] =
|
|
9843
|
-
const handlePress =
|
|
9842
|
+
const [active, setActive] = React97.useState(/* @__PURE__ */ new Set());
|
|
9843
|
+
const handlePress = React97.useCallback(
|
|
9844
9844
|
(id) => {
|
|
9845
9845
|
setActive((prev) => new Set(prev).add(id));
|
|
9846
9846
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9854,7 +9854,7 @@ function ControlGrid({
|
|
|
9854
9854
|
},
|
|
9855
9855
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
9856
9856
|
);
|
|
9857
|
-
const handleRelease =
|
|
9857
|
+
const handleRelease = React97.useCallback(
|
|
9858
9858
|
(id) => {
|
|
9859
9859
|
setActive((prev) => {
|
|
9860
9860
|
const next = new Set(prev);
|
|
@@ -10112,7 +10112,7 @@ function InventoryGrid({
|
|
|
10112
10112
|
const eventBus = useEventBus();
|
|
10113
10113
|
const slotCount = totalSlots ?? items.length;
|
|
10114
10114
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
10115
|
-
const handleSelect =
|
|
10115
|
+
const handleSelect = React97.useCallback(
|
|
10116
10116
|
(id) => {
|
|
10117
10117
|
onSelect?.(id);
|
|
10118
10118
|
if (selectEvent) {
|
|
@@ -10329,7 +10329,7 @@ function GameMenu({
|
|
|
10329
10329
|
}) {
|
|
10330
10330
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
10331
10331
|
const eventBus = useEventBus();
|
|
10332
|
-
const handleOptionClick =
|
|
10332
|
+
const handleOptionClick = React97.useCallback(
|
|
10333
10333
|
(option) => {
|
|
10334
10334
|
if (option.event) {
|
|
10335
10335
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -12250,410 +12250,6 @@ var init_GameAudioToggle = __esm({
|
|
|
12250
12250
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
12251
12251
|
}
|
|
12252
12252
|
});
|
|
12253
|
-
function VisualNovelBoard({
|
|
12254
|
-
entity,
|
|
12255
|
-
nodes: propNodes,
|
|
12256
|
-
currentNodeId: propCurrentNodeId,
|
|
12257
|
-
assetManifest: propAssetManifest,
|
|
12258
|
-
typewriterSpeed = 30,
|
|
12259
|
-
portraitScale = 1,
|
|
12260
|
-
chooseEvent,
|
|
12261
|
-
advanceEvent,
|
|
12262
|
-
restartEvent,
|
|
12263
|
-
className
|
|
12264
|
-
}) {
|
|
12265
|
-
const board = boardEntity(entity) ?? {};
|
|
12266
|
-
const eventBus = useEventBus();
|
|
12267
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12268
|
-
const entityNodes = useMemo(
|
|
12269
|
-
() => rows(board.nodes).map((r) => ({
|
|
12270
|
-
id: str(r.id),
|
|
12271
|
-
speaker: str(r.speaker),
|
|
12272
|
-
text: str(r.text),
|
|
12273
|
-
backgroundKey: r.backgroundKey == null ? void 0 : str(r.backgroundKey),
|
|
12274
|
-
portraitKey: r.portraitKey == null ? void 0 : str(r.portraitKey),
|
|
12275
|
-
choices: rows(r.choices).map((c) => ({
|
|
12276
|
-
label: str(c.label),
|
|
12277
|
-
nextId: str(c.nextId)
|
|
12278
|
-
}))
|
|
12279
|
-
})),
|
|
12280
|
-
[board.nodes]
|
|
12281
|
-
);
|
|
12282
|
-
const rawNodes = propNodes ?? entityNodes;
|
|
12283
|
-
const nodes = rawNodes.length > 0 ? rawNodes : DEFAULT_NODES;
|
|
12284
|
-
const currentNodeId = propCurrentNodeId ?? (str(board.currentNodeId) || nodes[0]?.id);
|
|
12285
|
-
const currentNode = nodes.find((n) => n.id === currentNodeId) ?? nodes[0];
|
|
12286
|
-
const backgroundImage = useMemo(
|
|
12287
|
-
() => assetManifest?.backgrounds?.[currentNode?.backgroundKey ?? ""],
|
|
12288
|
-
[assetManifest, currentNode?.backgroundKey]
|
|
12289
|
-
);
|
|
12290
|
-
const portraitAsset = useMemo(
|
|
12291
|
-
() => assetManifest?.portraits?.[currentNode?.portraitKey ?? ""],
|
|
12292
|
-
[assetManifest, currentNode?.portraitKey]
|
|
12293
|
-
);
|
|
12294
|
-
const [displayedText, setDisplayedText] = useState("");
|
|
12295
|
-
const [isTyping, setIsTyping] = useState(false);
|
|
12296
|
-
const textRef = useRef(currentNode?.text ?? "");
|
|
12297
|
-
const charIndexRef = useRef(0);
|
|
12298
|
-
useEffect(() => {
|
|
12299
|
-
const fullText = currentNode?.text ?? "";
|
|
12300
|
-
textRef.current = fullText;
|
|
12301
|
-
charIndexRef.current = 0;
|
|
12302
|
-
if (typewriterSpeed === 0) {
|
|
12303
|
-
setDisplayedText(fullText);
|
|
12304
|
-
setIsTyping(false);
|
|
12305
|
-
} else {
|
|
12306
|
-
setDisplayedText("");
|
|
12307
|
-
setIsTyping(true);
|
|
12308
|
-
}
|
|
12309
|
-
}, [currentNode?.id, typewriterSpeed]);
|
|
12310
|
-
useEffect(() => {
|
|
12311
|
-
if (!isTyping || typewriterSpeed === 0) return;
|
|
12312
|
-
const interval = setInterval(() => {
|
|
12313
|
-
if (charIndexRef.current < textRef.current.length) {
|
|
12314
|
-
charIndexRef.current++;
|
|
12315
|
-
setDisplayedText(textRef.current.slice(0, charIndexRef.current));
|
|
12316
|
-
} else {
|
|
12317
|
-
setIsTyping(false);
|
|
12318
|
-
clearInterval(interval);
|
|
12319
|
-
}
|
|
12320
|
-
}, typewriterSpeed);
|
|
12321
|
-
return () => clearInterval(interval);
|
|
12322
|
-
}, [isTyping, typewriterSpeed]);
|
|
12323
|
-
const skipTypewriter = useCallback(() => {
|
|
12324
|
-
if (isTyping) {
|
|
12325
|
-
charIndexRef.current = textRef.current.length;
|
|
12326
|
-
setDisplayedText(textRef.current);
|
|
12327
|
-
setIsTyping(false);
|
|
12328
|
-
}
|
|
12329
|
-
}, [isTyping]);
|
|
12330
|
-
const handleChoice = useCallback(
|
|
12331
|
-
(index) => {
|
|
12332
|
-
if (chooseEvent) {
|
|
12333
|
-
eventBus.emit(`UI:${chooseEvent}`, { choiceIndex: index });
|
|
12334
|
-
}
|
|
12335
|
-
},
|
|
12336
|
-
[chooseEvent, eventBus]
|
|
12337
|
-
);
|
|
12338
|
-
const handleAdvance = useCallback(() => {
|
|
12339
|
-
if (advanceEvent) {
|
|
12340
|
-
eventBus.emit(`UI:${advanceEvent}`, {});
|
|
12341
|
-
}
|
|
12342
|
-
}, [advanceEvent, eventBus]);
|
|
12343
|
-
const handleRestart = useCallback(() => {
|
|
12344
|
-
if (restartEvent) {
|
|
12345
|
-
eventBus.emit(`UI:${restartEvent}`, {});
|
|
12346
|
-
}
|
|
12347
|
-
}, [restartEvent, eventBus]);
|
|
12348
|
-
const handleContainerClick = useCallback(() => {
|
|
12349
|
-
if (isTyping) {
|
|
12350
|
-
skipTypewriter();
|
|
12351
|
-
} else if (!currentNode?.choices?.length) {
|
|
12352
|
-
handleAdvance();
|
|
12353
|
-
}
|
|
12354
|
-
}, [isTyping, skipTypewriter, currentNode?.choices, handleAdvance]);
|
|
12355
|
-
if (!currentNode) {
|
|
12356
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("visual-novel-board relative min-h-[600px] bg-background items-center justify-center", className), gap: "lg", children: [
|
|
12357
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h3", color: "muted", children: "No dialogue nodes" }),
|
|
12358
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleRestart, children: "Restart" })
|
|
12359
|
-
] });
|
|
12360
|
-
}
|
|
12361
|
-
return /* @__PURE__ */ jsxs(
|
|
12362
|
-
Box,
|
|
12363
|
-
{
|
|
12364
|
-
className: cn("visual-novel-board relative min-h-[600px] bg-background overflow-hidden", className),
|
|
12365
|
-
onClick: handleContainerClick,
|
|
12366
|
-
children: [
|
|
12367
|
-
backgroundImage && /* @__PURE__ */ jsx(
|
|
12368
|
-
"div",
|
|
12369
|
-
{
|
|
12370
|
-
className: "absolute inset-0 z-0 bg-center bg-cover bg-no-repeat",
|
|
12371
|
-
style: { backgroundImage: `url(${backgroundImage.url})` },
|
|
12372
|
-
"aria-hidden": "true"
|
|
12373
|
-
}
|
|
12374
|
-
),
|
|
12375
|
-
portraitAsset && /* @__PURE__ */ jsx(
|
|
12376
|
-
"div",
|
|
12377
|
-
{
|
|
12378
|
-
className: "absolute left-1/2 -translate-x-1/2 bottom-0 z-10 pointer-events-none flex items-end",
|
|
12379
|
-
style: { height: `${60 * portraitScale}vh` },
|
|
12380
|
-
children: /* @__PURE__ */ jsx(
|
|
12381
|
-
"img",
|
|
12382
|
-
{
|
|
12383
|
-
src: portraitAsset.url,
|
|
12384
|
-
alt: currentNode.speaker,
|
|
12385
|
-
className: "h-full w-auto object-contain drop-shadow-2xl"
|
|
12386
|
-
}
|
|
12387
|
-
)
|
|
12388
|
-
}
|
|
12389
|
-
),
|
|
12390
|
-
/* @__PURE__ */ jsx("div", { className: "absolute left-0 right-0 bottom-0 z-20 mx-4 mb-4", children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
12391
|
-
"rounded-container border-2 overflow-hidden",
|
|
12392
|
-
backgroundImage ? "bg-black/80 backdrop-blur-sm border-white/20" : "bg-card/95 border-border"
|
|
12393
|
-
), children: [
|
|
12394
|
-
/* @__PURE__ */ jsx(
|
|
12395
|
-
DialogueBubble,
|
|
12396
|
-
{
|
|
12397
|
-
speaker: currentNode.speaker,
|
|
12398
|
-
text: displayedText + (isTyping ? "\u258C" : ""),
|
|
12399
|
-
portrait: portraitAsset,
|
|
12400
|
-
position: "bottom",
|
|
12401
|
-
className: "border-0 rounded-none bg-transparent backdrop-blur-none"
|
|
12402
|
-
}
|
|
12403
|
-
),
|
|
12404
|
-
!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(
|
|
12405
|
-
ChoiceButton,
|
|
12406
|
-
{
|
|
12407
|
-
text: choice.label,
|
|
12408
|
-
index: index + 1,
|
|
12409
|
-
onClick: () => handleChoice(index)
|
|
12410
|
-
},
|
|
12411
|
-
choice.nextId
|
|
12412
|
-
)) }),
|
|
12413
|
-
!isTyping && !currentNode.choices?.length && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 text-muted-foreground text-sm animate-pulse", children: "Press click to continue..." })
|
|
12414
|
-
] }) })
|
|
12415
|
-
]
|
|
12416
|
-
}
|
|
12417
|
-
);
|
|
12418
|
-
}
|
|
12419
|
-
var DEFAULT_NODES;
|
|
12420
|
-
var init_VisualNovelBoard = __esm({
|
|
12421
|
-
"components/game/2d/organisms/VisualNovelBoard.tsx"() {
|
|
12422
|
-
"use client";
|
|
12423
|
-
init_cn();
|
|
12424
|
-
init_useEventBus();
|
|
12425
|
-
init_Box();
|
|
12426
|
-
init_Typography();
|
|
12427
|
-
init_Stack();
|
|
12428
|
-
init_Button();
|
|
12429
|
-
init_DialogueBubble();
|
|
12430
|
-
init_ChoiceButton();
|
|
12431
|
-
init_boardEntity();
|
|
12432
|
-
DEFAULT_NODES = [
|
|
12433
|
-
{
|
|
12434
|
-
id: "start",
|
|
12435
|
-
speaker: "Narrator",
|
|
12436
|
-
text: "The corridor stretches into shadow. A lone sentinel blocks your path.",
|
|
12437
|
-
backgroundKey: "corridor",
|
|
12438
|
-
portraitKey: "guide",
|
|
12439
|
-
choices: [
|
|
12440
|
-
{ label: "Approach the sentinel.", nextId: "meet" },
|
|
12441
|
-
{ label: "Turn back.", nextId: "retreat" }
|
|
12442
|
-
]
|
|
12443
|
-
},
|
|
12444
|
-
{
|
|
12445
|
-
id: "meet",
|
|
12446
|
-
speaker: "Sentinel",
|
|
12447
|
-
text: "You carry the old marks. Speak your purpose, traveler.",
|
|
12448
|
-
backgroundKey: "forge",
|
|
12449
|
-
portraitKey: "rival",
|
|
12450
|
-
choices: [
|
|
12451
|
-
{ label: "I seek the core.", nextId: "end" },
|
|
12452
|
-
{ label: "I am only passing through.", nextId: "retreat" }
|
|
12453
|
-
]
|
|
12454
|
-
},
|
|
12455
|
-
{
|
|
12456
|
-
id: "retreat",
|
|
12457
|
-
speaker: "Narrator",
|
|
12458
|
-
text: "You withdraw into the dark. The path will wait for braver feet.",
|
|
12459
|
-
backgroundKey: "corridor",
|
|
12460
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12461
|
-
},
|
|
12462
|
-
{
|
|
12463
|
-
id: "end",
|
|
12464
|
-
speaker: "Sentinel",
|
|
12465
|
-
text: "Then the way is open. Walk it well.",
|
|
12466
|
-
backgroundKey: "core",
|
|
12467
|
-
portraitKey: "rival",
|
|
12468
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12469
|
-
}
|
|
12470
|
-
];
|
|
12471
|
-
VisualNovelBoard.displayName = "VisualNovelBoard";
|
|
12472
|
-
}
|
|
12473
|
-
});
|
|
12474
|
-
function rowToCard(r) {
|
|
12475
|
-
return {
|
|
12476
|
-
id: str(r.id),
|
|
12477
|
-
iconKey: r.iconKey == null ? void 0 : str(r.iconKey),
|
|
12478
|
-
title: r.title == null ? void 0 : str(r.title),
|
|
12479
|
-
cost: r.cost == null ? void 0 : num(r.cost),
|
|
12480
|
-
attack: r.attack == null ? void 0 : num(r.attack),
|
|
12481
|
-
defense: r.defense == null ? void 0 : num(r.defense)
|
|
12482
|
-
};
|
|
12483
|
-
}
|
|
12484
|
-
function resolveCardArt(card, manifest) {
|
|
12485
|
-
const key = card.iconKey ?? card.id;
|
|
12486
|
-
return manifest?.cards?.[key];
|
|
12487
|
-
}
|
|
12488
|
-
function CardBattlerBoard({
|
|
12489
|
-
entity,
|
|
12490
|
-
deck: propDeck,
|
|
12491
|
-
hand: propHand,
|
|
12492
|
-
board: propBoard,
|
|
12493
|
-
mana: propMana,
|
|
12494
|
-
maxMana: propMaxMana,
|
|
12495
|
-
turn: propTurn,
|
|
12496
|
-
result: propResult,
|
|
12497
|
-
assetManifest: propAssetManifest,
|
|
12498
|
-
playCardEvent,
|
|
12499
|
-
endTurnEvent,
|
|
12500
|
-
playAgainEvent,
|
|
12501
|
-
gameEndEvent,
|
|
12502
|
-
className
|
|
12503
|
-
}) {
|
|
12504
|
-
const board = boardEntity(entity) ?? {};
|
|
12505
|
-
const eventBus = useEventBus();
|
|
12506
|
-
const { t } = useTranslate();
|
|
12507
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12508
|
-
const entityHand = useMemo(() => rows(board.hand).map(rowToCard), [board.hand]);
|
|
12509
|
-
const rawHand = propHand ?? entityHand;
|
|
12510
|
-
const hand = rawHand.length > 0 ? rawHand : DEFAULT_HAND;
|
|
12511
|
-
const entityBoard = useMemo(() => rows(board.board).map(rowToCard), [board.board]);
|
|
12512
|
-
const playedCards = propBoard ?? entityBoard;
|
|
12513
|
-
const entityDeck = useMemo(() => rows(board.deck).map(rowToCard), [board.deck]);
|
|
12514
|
-
const deck = propDeck ?? entityDeck;
|
|
12515
|
-
const mana = propMana ?? num(board.mana, 3);
|
|
12516
|
-
const maxMana = propMaxMana ?? num(board.maxMana, 3);
|
|
12517
|
-
const turn = propTurn ?? num(board.turn, 1);
|
|
12518
|
-
const result = propResult ?? (str(board.result) || "none");
|
|
12519
|
-
const handCards = hand;
|
|
12520
|
-
const boardCards = playedCards;
|
|
12521
|
-
const emittedGameEnd = useRef(false);
|
|
12522
|
-
if (result !== "none" && !emittedGameEnd.current) {
|
|
12523
|
-
emittedGameEnd.current = true;
|
|
12524
|
-
if (gameEndEvent) {
|
|
12525
|
-
eventBus.emit(`UI:${gameEndEvent}`, { result });
|
|
12526
|
-
}
|
|
12527
|
-
}
|
|
12528
|
-
if (result === "none") {
|
|
12529
|
-
emittedGameEnd.current = false;
|
|
12530
|
-
}
|
|
12531
|
-
const handlePlayCard = useCallback((cardId) => {
|
|
12532
|
-
if (result !== "none") return;
|
|
12533
|
-
if (playCardEvent) {
|
|
12534
|
-
eventBus.emit(`UI:${playCardEvent}`, { cardId });
|
|
12535
|
-
}
|
|
12536
|
-
}, [result, playCardEvent, eventBus]);
|
|
12537
|
-
const handleEndTurn = useCallback(() => {
|
|
12538
|
-
if (result !== "none") return;
|
|
12539
|
-
if (endTurnEvent) {
|
|
12540
|
-
eventBus.emit(`UI:${endTurnEvent}`, {});
|
|
12541
|
-
}
|
|
12542
|
-
}, [result, endTurnEvent, eventBus]);
|
|
12543
|
-
const handlePlayAgain = useCallback(() => {
|
|
12544
|
-
if (playAgainEvent) {
|
|
12545
|
-
eventBus.emit(`UI:${playAgainEvent}`, {});
|
|
12546
|
-
}
|
|
12547
|
-
}, [playAgainEvent, eventBus]);
|
|
12548
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("card-battler-board relative min-h-[600px] bg-background", className), gap: "none", children: [
|
|
12549
|
-
/* @__PURE__ */ jsxs(
|
|
12550
|
-
HStack,
|
|
12551
|
-
{
|
|
12552
|
-
className: "px-4 py-2 border-b border-border bg-surface",
|
|
12553
|
-
gap: "lg",
|
|
12554
|
-
align: "center",
|
|
12555
|
-
children: [
|
|
12556
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12557
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.mana") ?? "Mana" }),
|
|
12558
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "body2", weight: "bold", className: "text-info", children: [
|
|
12559
|
-
mana,
|
|
12560
|
-
" / ",
|
|
12561
|
-
maxMana
|
|
12562
|
-
] })
|
|
12563
|
-
] }),
|
|
12564
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12565
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.turn") ?? "Turn" }),
|
|
12566
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: turn })
|
|
12567
|
-
] }),
|
|
12568
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12569
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.deck") ?? "Deck" }),
|
|
12570
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: deck.length })
|
|
12571
|
-
] }),
|
|
12572
|
-
/* @__PURE__ */ jsx(Box, { className: "ml-auto", children: result === "none" && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", onClick: handleEndTurn, children: t("cb.endTurn") ?? "End Turn" }) })
|
|
12573
|
-
]
|
|
12574
|
-
}
|
|
12575
|
-
),
|
|
12576
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 relative p-4 overflow-auto", children: [
|
|
12577
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.battlefield") ?? "Battlefield" }),
|
|
12578
|
-
boardCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 items-end justify-start", children: boardCards.map((card) => /* @__PURE__ */ jsx(
|
|
12579
|
-
GameCard,
|
|
12580
|
-
{
|
|
12581
|
-
id: card.id,
|
|
12582
|
-
cost: card.cost,
|
|
12583
|
-
art: resolveCardArt(card, assetManifest),
|
|
12584
|
-
attack: card.attack,
|
|
12585
|
-
defense: card.defense,
|
|
12586
|
-
name: card.title,
|
|
12587
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12588
|
-
size: "md"
|
|
12589
|
-
},
|
|
12590
|
-
card.id
|
|
12591
|
-
)) }) : /* @__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" }) })
|
|
12592
|
-
] }),
|
|
12593
|
-
/* @__PURE__ */ jsxs(Box, { className: "border-t border-border bg-surface px-4 py-3", children: [
|
|
12594
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.hand") ?? "Your Hand" }),
|
|
12595
|
-
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(
|
|
12596
|
-
GameCard,
|
|
12597
|
-
{
|
|
12598
|
-
id: card.id,
|
|
12599
|
-
cost: card.cost,
|
|
12600
|
-
art: resolveCardArt(card, assetManifest),
|
|
12601
|
-
attack: card.attack,
|
|
12602
|
-
defense: card.defense,
|
|
12603
|
-
name: card.title,
|
|
12604
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12605
|
-
size: "lg",
|
|
12606
|
-
onClick: handlePlayCard
|
|
12607
|
-
},
|
|
12608
|
-
card.id
|
|
12609
|
-
)) })
|
|
12610
|
-
] }),
|
|
12611
|
-
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: [
|
|
12612
|
-
/* @__PURE__ */ jsx(
|
|
12613
|
-
Typography,
|
|
12614
|
-
{
|
|
12615
|
-
variant: "h2",
|
|
12616
|
-
className: cn(
|
|
12617
|
-
"text-4xl font-black tracking-widest uppercase",
|
|
12618
|
-
result === "won" ? "text-warning" : "text-error"
|
|
12619
|
-
),
|
|
12620
|
-
children: result === "won" ? t("cb.victory") ?? "Victory!" : t("cb.defeat") ?? "Defeat!"
|
|
12621
|
-
}
|
|
12622
|
-
),
|
|
12623
|
-
/* @__PURE__ */ jsx(
|
|
12624
|
-
Button,
|
|
12625
|
-
{
|
|
12626
|
-
variant: "primary",
|
|
12627
|
-
className: "px-8 py-3 font-semibold",
|
|
12628
|
-
onClick: handlePlayAgain,
|
|
12629
|
-
children: t("cb.playAgain") ?? "Play Again"
|
|
12630
|
-
}
|
|
12631
|
-
)
|
|
12632
|
-
] }) })
|
|
12633
|
-
] });
|
|
12634
|
-
}
|
|
12635
|
-
var DEFAULT_HAND;
|
|
12636
|
-
var init_CardBattlerBoard = __esm({
|
|
12637
|
-
"components/game/2d/organisms/CardBattlerBoard.tsx"() {
|
|
12638
|
-
"use client";
|
|
12639
|
-
init_cn();
|
|
12640
|
-
init_useEventBus();
|
|
12641
|
-
init_Box();
|
|
12642
|
-
init_Button();
|
|
12643
|
-
init_Typography();
|
|
12644
|
-
init_Stack();
|
|
12645
|
-
init_GameCard();
|
|
12646
|
-
init_boardEntity();
|
|
12647
|
-
DEFAULT_HAND = [
|
|
12648
|
-
{ id: "c1", iconKey: "bear", title: "Bear", cost: 3, attack: 5, defense: 4 },
|
|
12649
|
-
{ id: "c2", iconKey: "owl", title: "Owl", cost: 1, attack: 2, defense: 1 },
|
|
12650
|
-
{ id: "c3", iconKey: "gorilla", title: "Gorilla", cost: 4, attack: 6, defense: 5 },
|
|
12651
|
-
{ id: "c4", iconKey: "frog", title: "Frog", cost: 1, attack: 1, defense: 2 },
|
|
12652
|
-
{ id: "c5", iconKey: "snake", title: "Snake", cost: 2, attack: 4, defense: 1 }
|
|
12653
|
-
];
|
|
12654
|
-
CardBattlerBoard.displayName = "CardBattlerBoard";
|
|
12655
|
-
}
|
|
12656
|
-
});
|
|
12657
12253
|
function LinearView({
|
|
12658
12254
|
trait,
|
|
12659
12255
|
size = "md",
|
|
@@ -12665,7 +12261,7 @@ function LinearView({
|
|
|
12665
12261
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
12666
12262
|
const isDone = i < currentIdx;
|
|
12667
12263
|
const isCurrent = i === currentIdx;
|
|
12668
|
-
return /* @__PURE__ */ jsxs(
|
|
12264
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
12669
12265
|
i > 0 && /* @__PURE__ */ jsx(
|
|
12670
12266
|
Typography,
|
|
12671
12267
|
{
|
|
@@ -13193,7 +12789,7 @@ function SequenceBar({
|
|
|
13193
12789
|
onSlotRemove(index);
|
|
13194
12790
|
}, [onSlotRemove, playing]);
|
|
13195
12791
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
13196
|
-
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: [
|
|
13197
12793
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13198
12794
|
Typography,
|
|
13199
12795
|
{
|
|
@@ -16194,7 +15790,7 @@ var init_ErrorBoundary = __esm({
|
|
|
16194
15790
|
}
|
|
16195
15791
|
);
|
|
16196
15792
|
};
|
|
16197
|
-
ErrorBoundary = class extends
|
|
15793
|
+
ErrorBoundary = class extends React97__default.Component {
|
|
16198
15794
|
constructor(props) {
|
|
16199
15795
|
super(props);
|
|
16200
15796
|
__publicField(this, "reset", () => {
|
|
@@ -16859,7 +16455,7 @@ var init_Container = __esm({
|
|
|
16859
16455
|
as: Component = "div"
|
|
16860
16456
|
}) => {
|
|
16861
16457
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
16862
|
-
return
|
|
16458
|
+
return React97__default.createElement(
|
|
16863
16459
|
Component,
|
|
16864
16460
|
{
|
|
16865
16461
|
className: cn(
|
|
@@ -19527,7 +19123,7 @@ var init_CodeBlock = __esm({
|
|
|
19527
19123
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
19528
19124
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
19529
19125
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
19530
|
-
CodeBlock =
|
|
19126
|
+
CodeBlock = React97__default.memo(
|
|
19531
19127
|
({
|
|
19532
19128
|
code: rawCode,
|
|
19533
19129
|
language = "text",
|
|
@@ -20114,7 +19710,7 @@ var init_MarkdownContent = __esm({
|
|
|
20114
19710
|
init_Box();
|
|
20115
19711
|
init_CodeBlock();
|
|
20116
19712
|
init_cn();
|
|
20117
|
-
MarkdownContent =
|
|
19713
|
+
MarkdownContent = React97__default.memo(
|
|
20118
19714
|
({ content, direction = "ltr", className }) => {
|
|
20119
19715
|
const { t: _t } = useTranslate();
|
|
20120
19716
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -21441,7 +21037,7 @@ var init_StateMachineView = __esm({
|
|
|
21441
21037
|
style: { top: title ? 30 : 0 },
|
|
21442
21038
|
children: [
|
|
21443
21039
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
21444
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
21040
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React97__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
21445
21041
|
StateNode2,
|
|
21446
21042
|
{
|
|
21447
21043
|
state,
|
|
@@ -27079,8 +26675,8 @@ var init_Menu = __esm({
|
|
|
27079
26675
|
"bottom-end": "bottom-start"
|
|
27080
26676
|
};
|
|
27081
26677
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
27082
|
-
const triggerChild =
|
|
27083
|
-
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(
|
|
27084
26680
|
triggerChild,
|
|
27085
26681
|
{
|
|
27086
26682
|
ref: triggerRef,
|
|
@@ -27175,14 +26771,14 @@ function useDataDnd(args) {
|
|
|
27175
26771
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
27176
26772
|
const enabled = isZone || Boolean(dndRoot);
|
|
27177
26773
|
const eventBus = useEventBus();
|
|
27178
|
-
const parentRoot =
|
|
26774
|
+
const parentRoot = React97__default.useContext(RootCtx);
|
|
27179
26775
|
const isRoot = enabled && parentRoot === null;
|
|
27180
|
-
const zoneId =
|
|
26776
|
+
const zoneId = React97__default.useId();
|
|
27181
26777
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
27182
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
27183
|
-
const optimisticOrdersRef =
|
|
26778
|
+
const [optimisticOrders, setOptimisticOrders] = React97__default.useState(() => /* @__PURE__ */ new Map());
|
|
26779
|
+
const optimisticOrdersRef = React97__default.useRef(optimisticOrders);
|
|
27184
26780
|
optimisticOrdersRef.current = optimisticOrders;
|
|
27185
|
-
const clearOptimisticOrder =
|
|
26781
|
+
const clearOptimisticOrder = React97__default.useCallback((group) => {
|
|
27186
26782
|
setOptimisticOrders((prev) => {
|
|
27187
26783
|
if (!prev.has(group)) return prev;
|
|
27188
26784
|
const next = new Map(prev);
|
|
@@ -27207,7 +26803,7 @@ function useDataDnd(args) {
|
|
|
27207
26803
|
const raw = it[dndItemIdField];
|
|
27208
26804
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
27209
26805
|
}).join("|");
|
|
27210
|
-
const itemIds =
|
|
26806
|
+
const itemIds = React97__default.useMemo(
|
|
27211
26807
|
() => orderedItems.map((it, idx) => {
|
|
27212
26808
|
const raw = it[dndItemIdField];
|
|
27213
26809
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -27218,7 +26814,7 @@ function useDataDnd(args) {
|
|
|
27218
26814
|
const raw = it[dndItemIdField];
|
|
27219
26815
|
return raw != null ? String(raw) : `__${idx}`;
|
|
27220
26816
|
}).join("|");
|
|
27221
|
-
|
|
26817
|
+
React97__default.useEffect(() => {
|
|
27222
26818
|
const root = isRoot ? null : parentRoot;
|
|
27223
26819
|
if (root) {
|
|
27224
26820
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -27226,20 +26822,20 @@ function useDataDnd(args) {
|
|
|
27226
26822
|
clearOptimisticOrder(ownGroup);
|
|
27227
26823
|
}
|
|
27228
26824
|
}, [itemsContentSig, ownGroup]);
|
|
27229
|
-
const zonesRef =
|
|
27230
|
-
const registerZone =
|
|
26825
|
+
const zonesRef = React97__default.useRef(/* @__PURE__ */ new Map());
|
|
26826
|
+
const registerZone = React97__default.useCallback((zoneId2, meta2) => {
|
|
27231
26827
|
zonesRef.current.set(zoneId2, meta2);
|
|
27232
26828
|
}, []);
|
|
27233
|
-
const unregisterZone =
|
|
26829
|
+
const unregisterZone = React97__default.useCallback((zoneId2) => {
|
|
27234
26830
|
zonesRef.current.delete(zoneId2);
|
|
27235
26831
|
}, []);
|
|
27236
|
-
const [activeDrag, setActiveDrag] =
|
|
27237
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
27238
|
-
const meta =
|
|
26832
|
+
const [activeDrag, setActiveDrag] = React97__default.useState(null);
|
|
26833
|
+
const [overZoneGroup, setOverZoneGroup] = React97__default.useState(null);
|
|
26834
|
+
const meta = React97__default.useMemo(
|
|
27239
26835
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
27240
26836
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
27241
26837
|
);
|
|
27242
|
-
|
|
26838
|
+
React97__default.useEffect(() => {
|
|
27243
26839
|
const target = isRoot ? null : parentRoot;
|
|
27244
26840
|
if (!target) {
|
|
27245
26841
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -27258,7 +26854,7 @@ function useDataDnd(args) {
|
|
|
27258
26854
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
27259
26855
|
const sensors = useAlmadarDndSensors(true);
|
|
27260
26856
|
const collisionDetection = almadarDndCollisionDetection;
|
|
27261
|
-
const findZoneByItem =
|
|
26857
|
+
const findZoneByItem = React97__default.useCallback(
|
|
27262
26858
|
(id) => {
|
|
27263
26859
|
for (const z of zonesRef.current.values()) {
|
|
27264
26860
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -27267,7 +26863,7 @@ function useDataDnd(args) {
|
|
|
27267
26863
|
},
|
|
27268
26864
|
[]
|
|
27269
26865
|
);
|
|
27270
|
-
|
|
26866
|
+
React97__default.useCallback(
|
|
27271
26867
|
(group) => {
|
|
27272
26868
|
for (const z of zonesRef.current.values()) {
|
|
27273
26869
|
if (z.group === group) return z;
|
|
@@ -27276,7 +26872,7 @@ function useDataDnd(args) {
|
|
|
27276
26872
|
},
|
|
27277
26873
|
[]
|
|
27278
26874
|
);
|
|
27279
|
-
const handleDragEnd =
|
|
26875
|
+
const handleDragEnd = React97__default.useCallback(
|
|
27280
26876
|
(event) => {
|
|
27281
26877
|
const { active, over } = event;
|
|
27282
26878
|
const activeIdStr = String(active.id);
|
|
@@ -27367,8 +26963,8 @@ function useDataDnd(args) {
|
|
|
27367
26963
|
},
|
|
27368
26964
|
[eventBus]
|
|
27369
26965
|
);
|
|
27370
|
-
const sortableData =
|
|
27371
|
-
const SortableItem =
|
|
26966
|
+
const sortableData = React97__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
26967
|
+
const SortableItem = React97__default.useCallback(
|
|
27372
26968
|
({ id, children }) => {
|
|
27373
26969
|
const {
|
|
27374
26970
|
attributes,
|
|
@@ -27408,7 +27004,7 @@ function useDataDnd(args) {
|
|
|
27408
27004
|
id: droppableId,
|
|
27409
27005
|
data: sortableData
|
|
27410
27006
|
});
|
|
27411
|
-
const ctx =
|
|
27007
|
+
const ctx = React97__default.useContext(RootCtx);
|
|
27412
27008
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
27413
27009
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
27414
27010
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -27423,7 +27019,7 @@ function useDataDnd(args) {
|
|
|
27423
27019
|
showForeignPlaceholder,
|
|
27424
27020
|
ctxAvailable: ctx != null
|
|
27425
27021
|
});
|
|
27426
|
-
|
|
27022
|
+
React97__default.useEffect(() => {
|
|
27427
27023
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
27428
27024
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
27429
27025
|
return /* @__PURE__ */ jsx(
|
|
@@ -27437,11 +27033,11 @@ function useDataDnd(args) {
|
|
|
27437
27033
|
}
|
|
27438
27034
|
);
|
|
27439
27035
|
};
|
|
27440
|
-
const rootContextValue =
|
|
27036
|
+
const rootContextValue = React97__default.useMemo(
|
|
27441
27037
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
27442
27038
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
27443
27039
|
);
|
|
27444
|
-
const handleDragStart =
|
|
27040
|
+
const handleDragStart = React97__default.useCallback((event) => {
|
|
27445
27041
|
const sourceZone = findZoneByItem(event.active.id);
|
|
27446
27042
|
const rect = event.active.rect.current.initial;
|
|
27447
27043
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -27460,7 +27056,7 @@ function useDataDnd(args) {
|
|
|
27460
27056
|
isRoot
|
|
27461
27057
|
});
|
|
27462
27058
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
27463
|
-
const handleDragOver =
|
|
27059
|
+
const handleDragOver = React97__default.useCallback((event) => {
|
|
27464
27060
|
const { active, over } = event;
|
|
27465
27061
|
const overData = over?.data?.current;
|
|
27466
27062
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -27530,7 +27126,7 @@ function useDataDnd(args) {
|
|
|
27530
27126
|
return next;
|
|
27531
27127
|
});
|
|
27532
27128
|
}, []);
|
|
27533
|
-
const handleDragCancel =
|
|
27129
|
+
const handleDragCancel = React97__default.useCallback((event) => {
|
|
27534
27130
|
setActiveDrag(null);
|
|
27535
27131
|
setOverZoneGroup(null);
|
|
27536
27132
|
dndLog.warn("dragCancel", {
|
|
@@ -27538,12 +27134,12 @@ function useDataDnd(args) {
|
|
|
27538
27134
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
27539
27135
|
});
|
|
27540
27136
|
}, []);
|
|
27541
|
-
const handleDragEndWithCleanup =
|
|
27137
|
+
const handleDragEndWithCleanup = React97__default.useCallback((event) => {
|
|
27542
27138
|
handleDragEnd(event);
|
|
27543
27139
|
setActiveDrag(null);
|
|
27544
27140
|
setOverZoneGroup(null);
|
|
27545
27141
|
}, [handleDragEnd]);
|
|
27546
|
-
const wrapContainer =
|
|
27142
|
+
const wrapContainer = React97__default.useCallback(
|
|
27547
27143
|
(children) => {
|
|
27548
27144
|
if (!enabled) return children;
|
|
27549
27145
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -27597,7 +27193,7 @@ var init_useDataDnd = __esm({
|
|
|
27597
27193
|
init_useAlmadarDndCollision();
|
|
27598
27194
|
init_Box();
|
|
27599
27195
|
dndLog = createLogger("almadar:ui:dnd");
|
|
27600
|
-
RootCtx =
|
|
27196
|
+
RootCtx = React97__default.createContext(null);
|
|
27601
27197
|
}
|
|
27602
27198
|
});
|
|
27603
27199
|
function renderIconInput(icon, props) {
|
|
@@ -28123,7 +27719,7 @@ function DataList({
|
|
|
28123
27719
|
}) {
|
|
28124
27720
|
const eventBus = useEventBus();
|
|
28125
27721
|
const { t } = useTranslate();
|
|
28126
|
-
const [visibleCount, setVisibleCount] =
|
|
27722
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize || Infinity);
|
|
28127
27723
|
const fieldDefs = fields ?? columns ?? [];
|
|
28128
27724
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
28129
27725
|
const dnd = useDataDnd({
|
|
@@ -28142,7 +27738,7 @@ function DataList({
|
|
|
28142
27738
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
28143
27739
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
28144
27740
|
const hasRenderProp = typeof children === "function";
|
|
28145
|
-
|
|
27741
|
+
React97__default.useEffect(() => {
|
|
28146
27742
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
28147
27743
|
const childrenTypeOf = typeof children;
|
|
28148
27744
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -28246,7 +27842,7 @@ function DataList({
|
|
|
28246
27842
|
const items2 = [...data];
|
|
28247
27843
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
28248
27844
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
28249
|
-
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: [
|
|
28250
27846
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
28251
27847
|
group.items.map((itemData, index) => {
|
|
28252
27848
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -28387,7 +27983,7 @@ function DataList({
|
|
|
28387
27983
|
className
|
|
28388
27984
|
),
|
|
28389
27985
|
children: [
|
|
28390
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27986
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
28391
27987
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
28392
27988
|
group.items.map(
|
|
28393
27989
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -28472,7 +28068,7 @@ var init_FormSection = __esm({
|
|
|
28472
28068
|
columns = 1,
|
|
28473
28069
|
className
|
|
28474
28070
|
}) => {
|
|
28475
|
-
const [collapsed, setCollapsed] =
|
|
28071
|
+
const [collapsed, setCollapsed] = React97__default.useState(defaultCollapsed);
|
|
28476
28072
|
const { t } = useTranslate();
|
|
28477
28073
|
const eventBus = useEventBus();
|
|
28478
28074
|
const gridClass = {
|
|
@@ -28480,7 +28076,7 @@ var init_FormSection = __esm({
|
|
|
28480
28076
|
2: "grid-cols-1 md:grid-cols-2",
|
|
28481
28077
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
28482
28078
|
}[columns];
|
|
28483
|
-
|
|
28079
|
+
React97__default.useCallback(() => {
|
|
28484
28080
|
if (collapsible) {
|
|
28485
28081
|
setCollapsed((prev) => !prev);
|
|
28486
28082
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -29430,7 +29026,7 @@ var init_Flex = __esm({
|
|
|
29430
29026
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
29431
29027
|
}
|
|
29432
29028
|
}
|
|
29433
|
-
return
|
|
29029
|
+
return React97__default.createElement(Component, {
|
|
29434
29030
|
className: cn(
|
|
29435
29031
|
inline ? "inline-flex" : "flex",
|
|
29436
29032
|
directionStyles[direction],
|
|
@@ -29549,7 +29145,7 @@ var init_Grid = __esm({
|
|
|
29549
29145
|
as: Component = "div"
|
|
29550
29146
|
}) => {
|
|
29551
29147
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
29552
|
-
return
|
|
29148
|
+
return React97__default.createElement(
|
|
29553
29149
|
Component,
|
|
29554
29150
|
{
|
|
29555
29151
|
className: cn(
|
|
@@ -29745,9 +29341,9 @@ var init_Popover = __esm({
|
|
|
29745
29341
|
onMouseLeave: handleClose,
|
|
29746
29342
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
29747
29343
|
};
|
|
29748
|
-
const childElement =
|
|
29344
|
+
const childElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
29749
29345
|
const childPointerDown = childElement.props.onPointerDown;
|
|
29750
|
-
const triggerElement =
|
|
29346
|
+
const triggerElement = React97__default.cloneElement(
|
|
29751
29347
|
childElement,
|
|
29752
29348
|
{
|
|
29753
29349
|
ref: triggerRef,
|
|
@@ -30349,9 +29945,9 @@ var init_Tooltip = __esm({
|
|
|
30349
29945
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
30350
29946
|
};
|
|
30351
29947
|
}, []);
|
|
30352
|
-
const triggerElement =
|
|
29948
|
+
const triggerElement = React97__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30353
29949
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
30354
|
-
const trigger =
|
|
29950
|
+
const trigger = React97__default.cloneElement(triggerElement, {
|
|
30355
29951
|
ref: triggerRef,
|
|
30356
29952
|
onMouseEnter: handleMouseEnter,
|
|
30357
29953
|
onMouseLeave: handleMouseLeave,
|
|
@@ -30441,7 +30037,7 @@ var init_WizardProgress = __esm({
|
|
|
30441
30037
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
30442
30038
|
const isActive = index === currentStep;
|
|
30443
30039
|
const isCompleted = index < currentStep;
|
|
30444
|
-
return /* @__PURE__ */ jsxs(
|
|
30040
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
30445
30041
|
/* @__PURE__ */ jsx(
|
|
30446
30042
|
"button",
|
|
30447
30043
|
{
|
|
@@ -32001,13 +31597,13 @@ var init_MapView = __esm({
|
|
|
32001
31597
|
shadowSize: [41, 41]
|
|
32002
31598
|
});
|
|
32003
31599
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32004
|
-
const { useEffect:
|
|
31600
|
+
const { useEffect: useEffect69, useRef: useRef67, useCallback: useCallback106, useState: useState100 } = React97__default;
|
|
32005
31601
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32006
31602
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32007
31603
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32008
31604
|
const map = useMap();
|
|
32009
|
-
const prevRef =
|
|
32010
|
-
|
|
31605
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
31606
|
+
useEffect69(() => {
|
|
32011
31607
|
const prev = prevRef.current;
|
|
32012
31608
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32013
31609
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32018,7 +31614,7 @@ var init_MapView = __esm({
|
|
|
32018
31614
|
}
|
|
32019
31615
|
function MapClickHandler({ onMapClick }) {
|
|
32020
31616
|
const map = useMap();
|
|
32021
|
-
|
|
31617
|
+
useEffect69(() => {
|
|
32022
31618
|
if (!onMapClick) return;
|
|
32023
31619
|
const handler = (e) => {
|
|
32024
31620
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -32046,8 +31642,8 @@ var init_MapView = __esm({
|
|
|
32046
31642
|
showAttribution = true
|
|
32047
31643
|
}) {
|
|
32048
31644
|
const eventBus = useEventBus2();
|
|
32049
|
-
const [clickedPosition, setClickedPosition] =
|
|
32050
|
-
const handleMapClick =
|
|
31645
|
+
const [clickedPosition, setClickedPosition] = useState100(null);
|
|
31646
|
+
const handleMapClick = useCallback106((lat, lng) => {
|
|
32051
31647
|
if (showClickedPin) {
|
|
32052
31648
|
setClickedPosition({ lat, lng });
|
|
32053
31649
|
}
|
|
@@ -32056,7 +31652,7 @@ var init_MapView = __esm({
|
|
|
32056
31652
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
32057
31653
|
}
|
|
32058
31654
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
32059
|
-
const handleMarkerClick =
|
|
31655
|
+
const handleMarkerClick = useCallback106((marker) => {
|
|
32060
31656
|
onMarkerClick?.(marker);
|
|
32061
31657
|
if (markerClickEvent) {
|
|
32062
31658
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32916,8 +32512,8 @@ function TableView({
|
|
|
32916
32512
|
}) {
|
|
32917
32513
|
const eventBus = useEventBus();
|
|
32918
32514
|
const { t } = useTranslate();
|
|
32919
|
-
const [visibleCount, setVisibleCount] =
|
|
32920
|
-
const [localSelected, setLocalSelected] =
|
|
32515
|
+
const [visibleCount, setVisibleCount] = React97__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
32516
|
+
const [localSelected, setLocalSelected] = React97__default.useState(/* @__PURE__ */ new Set());
|
|
32921
32517
|
const colDefs = columns ?? fields ?? [];
|
|
32922
32518
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32923
32519
|
const dnd = useDataDnd({
|
|
@@ -33112,12 +32708,12 @@ function TableView({
|
|
|
33112
32708
|
]
|
|
33113
32709
|
}
|
|
33114
32710
|
);
|
|
33115
|
-
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);
|
|
33116
32712
|
};
|
|
33117
32713
|
const items = Array.from(data);
|
|
33118
32714
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
33119
32715
|
let runningIndex = 0;
|
|
33120
|
-
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: [
|
|
33121
32717
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
33122
32718
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
33123
32719
|
] }, gi)) });
|
|
@@ -34474,7 +34070,7 @@ var init_StepFlow = __esm({
|
|
|
34474
34070
|
className
|
|
34475
34071
|
}) => {
|
|
34476
34072
|
if (orientation === "vertical") {
|
|
34477
|
-
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: [
|
|
34478
34074
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
34479
34075
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34480
34076
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -34485,7 +34081,7 @@ var init_StepFlow = __esm({
|
|
|
34485
34081
|
] })
|
|
34486
34082
|
] }) }, index)) });
|
|
34487
34083
|
}
|
|
34488
|
-
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: [
|
|
34489
34085
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
34490
34086
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34491
34087
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -35470,7 +35066,7 @@ var init_LikertScale = __esm({
|
|
|
35470
35066
|
md: "text-base",
|
|
35471
35067
|
lg: "text-lg"
|
|
35472
35068
|
};
|
|
35473
|
-
LikertScale =
|
|
35069
|
+
LikertScale = React97__default.forwardRef(
|
|
35474
35070
|
({
|
|
35475
35071
|
question,
|
|
35476
35072
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -35482,7 +35078,7 @@ var init_LikertScale = __esm({
|
|
|
35482
35078
|
variant = "radios",
|
|
35483
35079
|
className
|
|
35484
35080
|
}, ref) => {
|
|
35485
|
-
const groupId =
|
|
35081
|
+
const groupId = React97__default.useId();
|
|
35486
35082
|
const eventBus = useEventBus();
|
|
35487
35083
|
const handleSelect = useCallback(
|
|
35488
35084
|
(next) => {
|
|
@@ -37764,7 +37360,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
37764
37360
|
"aria-label": t("aria.breadcrumb"),
|
|
37765
37361
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
37766
37362
|
const isLast = idx === items.length - 1;
|
|
37767
|
-
return /* @__PURE__ */ jsxs(
|
|
37363
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
37768
37364
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
37769
37365
|
Icon,
|
|
37770
37366
|
{
|
|
@@ -38633,7 +38229,7 @@ var init_MiniStateMachine = __esm({
|
|
|
38633
38229
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
38634
38230
|
const tc = transitionCounts[s.name] ?? 0;
|
|
38635
38231
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
38636
|
-
return /* @__PURE__ */ jsxs(
|
|
38232
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
38637
38233
|
/* @__PURE__ */ jsx(
|
|
38638
38234
|
AvlState,
|
|
38639
38235
|
{
|
|
@@ -38837,7 +38433,7 @@ var init_PageHeader = __esm({
|
|
|
38837
38433
|
info: "bg-info/10 text-info"
|
|
38838
38434
|
};
|
|
38839
38435
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
38840
|
-
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: [
|
|
38841
38437
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
38842
38438
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
38843
38439
|
"a",
|
|
@@ -39195,7 +38791,7 @@ var init_Section = __esm({
|
|
|
39195
38791
|
as: Component = "section"
|
|
39196
38792
|
}) => {
|
|
39197
38793
|
const hasHeader = title || description || action;
|
|
39198
|
-
return
|
|
38794
|
+
return React97__default.createElement(
|
|
39199
38795
|
Component,
|
|
39200
38796
|
{
|
|
39201
38797
|
className: cn(
|
|
@@ -39569,7 +39165,7 @@ var init_WizardContainer = __esm({
|
|
|
39569
39165
|
const isCompleted = index < currentStep;
|
|
39570
39166
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
39571
39167
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
39572
|
-
return /* @__PURE__ */ jsxs(
|
|
39168
|
+
return /* @__PURE__ */ jsxs(React97__default.Fragment, { children: [
|
|
39573
39169
|
/* @__PURE__ */ jsx(
|
|
39574
39170
|
Button,
|
|
39575
39171
|
{
|
|
@@ -42002,7 +41598,7 @@ var init_DetailPanel = __esm({
|
|
|
42002
41598
|
}
|
|
42003
41599
|
});
|
|
42004
41600
|
function extractTitle(children) {
|
|
42005
|
-
if (!
|
|
41601
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
42006
41602
|
const props = children.props;
|
|
42007
41603
|
if (typeof props.title === "string") {
|
|
42008
41604
|
return props.title;
|
|
@@ -42352,12 +41948,12 @@ var init_Form = __esm({
|
|
|
42352
41948
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
42353
41949
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
42354
41950
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
42355
|
-
const normalizedInitialData =
|
|
41951
|
+
const normalizedInitialData = React97__default.useMemo(() => {
|
|
42356
41952
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
42357
41953
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
42358
41954
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
42359
41955
|
}, [entity, initialData]);
|
|
42360
|
-
const entityDerivedFields =
|
|
41956
|
+
const entityDerivedFields = React97__default.useMemo(() => {
|
|
42361
41957
|
if (fields && fields.length > 0) return void 0;
|
|
42362
41958
|
if (!resolvedEntity) return void 0;
|
|
42363
41959
|
return resolvedEntity.fields.map(
|
|
@@ -42378,16 +41974,16 @@ var init_Form = __esm({
|
|
|
42378
41974
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42379
41975
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42380
41976
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42381
|
-
const [formData, setFormData] =
|
|
41977
|
+
const [formData, setFormData] = React97__default.useState(
|
|
42382
41978
|
normalizedInitialData
|
|
42383
41979
|
);
|
|
42384
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41980
|
+
const [collapsedSections, setCollapsedSections] = React97__default.useState(
|
|
42385
41981
|
/* @__PURE__ */ new Set()
|
|
42386
41982
|
);
|
|
42387
|
-
const [submitError, setSubmitError] =
|
|
42388
|
-
const formRef =
|
|
41983
|
+
const [submitError, setSubmitError] = React97__default.useState(null);
|
|
41984
|
+
const formRef = React97__default.useRef(null);
|
|
42389
41985
|
const formMode = props.mode;
|
|
42390
|
-
const mountedRef =
|
|
41986
|
+
const mountedRef = React97__default.useRef(false);
|
|
42391
41987
|
if (!mountedRef.current) {
|
|
42392
41988
|
mountedRef.current = true;
|
|
42393
41989
|
debug("forms", "mount", {
|
|
@@ -42400,7 +41996,7 @@ var init_Form = __esm({
|
|
|
42400
41996
|
});
|
|
42401
41997
|
}
|
|
42402
41998
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42403
|
-
const evalContext =
|
|
41999
|
+
const evalContext = React97__default.useMemo(
|
|
42404
42000
|
() => ({
|
|
42405
42001
|
formValues: formData,
|
|
42406
42002
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42409,7 +42005,7 @@ var init_Form = __esm({
|
|
|
42409
42005
|
}),
|
|
42410
42006
|
[formData, externalContext]
|
|
42411
42007
|
);
|
|
42412
|
-
|
|
42008
|
+
React97__default.useEffect(() => {
|
|
42413
42009
|
debug("forms", "initialData-sync", {
|
|
42414
42010
|
mode: formMode,
|
|
42415
42011
|
normalizedInitialData,
|
|
@@ -42420,7 +42016,7 @@ var init_Form = __esm({
|
|
|
42420
42016
|
setFormData(normalizedInitialData);
|
|
42421
42017
|
}
|
|
42422
42018
|
}, [normalizedInitialData]);
|
|
42423
|
-
const processCalculations =
|
|
42019
|
+
const processCalculations = React97__default.useCallback(
|
|
42424
42020
|
(changedFieldId, newFormData) => {
|
|
42425
42021
|
if (!hiddenCalculations.length) return;
|
|
42426
42022
|
const context = {
|
|
@@ -42445,7 +42041,7 @@ var init_Form = __esm({
|
|
|
42445
42041
|
},
|
|
42446
42042
|
[hiddenCalculations, externalContext, eventBus]
|
|
42447
42043
|
);
|
|
42448
|
-
const checkViolations =
|
|
42044
|
+
const checkViolations = React97__default.useCallback(
|
|
42449
42045
|
(changedFieldId, newFormData) => {
|
|
42450
42046
|
if (!violationTriggers.length) return;
|
|
42451
42047
|
const context = {
|
|
@@ -42483,7 +42079,7 @@ var init_Form = __esm({
|
|
|
42483
42079
|
processCalculations(name, newFormData);
|
|
42484
42080
|
checkViolations(name, newFormData);
|
|
42485
42081
|
};
|
|
42486
|
-
const isFieldVisible =
|
|
42082
|
+
const isFieldVisible = React97__default.useCallback(
|
|
42487
42083
|
(fieldName) => {
|
|
42488
42084
|
const condition = conditionalFields[fieldName];
|
|
42489
42085
|
if (!condition) return true;
|
|
@@ -42491,7 +42087,7 @@ var init_Form = __esm({
|
|
|
42491
42087
|
},
|
|
42492
42088
|
[conditionalFields, evalContext]
|
|
42493
42089
|
);
|
|
42494
|
-
const isSectionVisible =
|
|
42090
|
+
const isSectionVisible = React97__default.useCallback(
|
|
42495
42091
|
(section) => {
|
|
42496
42092
|
if (!section.condition) return true;
|
|
42497
42093
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42567,7 +42163,7 @@ var init_Form = __esm({
|
|
|
42567
42163
|
eventBus.emit(`UI:${onCancel}`);
|
|
42568
42164
|
}
|
|
42569
42165
|
};
|
|
42570
|
-
const renderField =
|
|
42166
|
+
const renderField = React97__default.useCallback(
|
|
42571
42167
|
(field) => {
|
|
42572
42168
|
const fieldName = field.name || field.field;
|
|
42573
42169
|
if (!fieldName) return null;
|
|
@@ -42588,7 +42184,7 @@ var init_Form = __esm({
|
|
|
42588
42184
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42589
42185
|
);
|
|
42590
42186
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42591
|
-
const normalizedFields =
|
|
42187
|
+
const normalizedFields = React97__default.useMemo(() => {
|
|
42592
42188
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42593
42189
|
return effectiveFields.map((field) => {
|
|
42594
42190
|
if (typeof field === "string") {
|
|
@@ -42612,7 +42208,7 @@ var init_Form = __esm({
|
|
|
42612
42208
|
return field;
|
|
42613
42209
|
});
|
|
42614
42210
|
}, [effectiveFields, resolvedEntity]);
|
|
42615
|
-
const schemaFields =
|
|
42211
|
+
const schemaFields = React97__default.useMemo(() => {
|
|
42616
42212
|
if (normalizedFields.length === 0) return null;
|
|
42617
42213
|
if (isDebugEnabled()) {
|
|
42618
42214
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42622,7 +42218,7 @@ var init_Form = __esm({
|
|
|
42622
42218
|
}
|
|
42623
42219
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42624
42220
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42625
|
-
const sectionElements =
|
|
42221
|
+
const sectionElements = React97__default.useMemo(() => {
|
|
42626
42222
|
if (!sections || sections.length === 0) return null;
|
|
42627
42223
|
return sections.map((section) => {
|
|
42628
42224
|
if (!isSectionVisible(section)) {
|
|
@@ -43347,7 +42943,7 @@ var init_List = __esm({
|
|
|
43347
42943
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
43348
42944
|
return [];
|
|
43349
42945
|
}, [entity]);
|
|
43350
|
-
const getItemActions =
|
|
42946
|
+
const getItemActions = React97__default.useCallback(
|
|
43351
42947
|
(item) => {
|
|
43352
42948
|
if (!itemActions) return [];
|
|
43353
42949
|
if (typeof itemActions === "function") {
|
|
@@ -43822,7 +43418,7 @@ var init_MediaGallery = __esm({
|
|
|
43822
43418
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
43823
43419
|
);
|
|
43824
43420
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
43825
|
-
const items =
|
|
43421
|
+
const items = React97__default.useMemo(() => {
|
|
43826
43422
|
if (propItems) return propItems;
|
|
43827
43423
|
if (entityData.length === 0) return [];
|
|
43828
43424
|
return entityData.map((record, idx) => {
|
|
@@ -43985,7 +43581,7 @@ var init_MediaGallery = __esm({
|
|
|
43985
43581
|
}
|
|
43986
43582
|
});
|
|
43987
43583
|
function extractTitle2(children) {
|
|
43988
|
-
if (!
|
|
43584
|
+
if (!React97__default.isValidElement(children)) return void 0;
|
|
43989
43585
|
const props = children.props;
|
|
43990
43586
|
if (typeof props.title === "string") {
|
|
43991
43587
|
return props.title;
|
|
@@ -44240,7 +43836,7 @@ var init_debugRegistry = __esm({
|
|
|
44240
43836
|
}
|
|
44241
43837
|
});
|
|
44242
43838
|
function useDebugData() {
|
|
44243
|
-
const [data, setData] =
|
|
43839
|
+
const [data, setData] = React97.useState(() => ({
|
|
44244
43840
|
traits: [],
|
|
44245
43841
|
ticks: [],
|
|
44246
43842
|
guards: [],
|
|
@@ -44254,7 +43850,7 @@ function useDebugData() {
|
|
|
44254
43850
|
},
|
|
44255
43851
|
lastUpdate: Date.now()
|
|
44256
43852
|
}));
|
|
44257
|
-
|
|
43853
|
+
React97.useEffect(() => {
|
|
44258
43854
|
const updateData = () => {
|
|
44259
43855
|
setData({
|
|
44260
43856
|
traits: getAllTraits(),
|
|
@@ -44363,12 +43959,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44363
43959
|
return positions;
|
|
44364
43960
|
}
|
|
44365
43961
|
function WalkMinimap() {
|
|
44366
|
-
const [walkStep, setWalkStep] =
|
|
44367
|
-
const [traits2, setTraits] =
|
|
44368
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44369
|
-
const [completedTraits, setCompletedTraits] =
|
|
44370
|
-
const prevTraitRef =
|
|
44371
|
-
|
|
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(() => {
|
|
44372
43968
|
const interval = setInterval(() => {
|
|
44373
43969
|
const w = window;
|
|
44374
43970
|
const step = w.__orbitalWalkStep;
|
|
@@ -44804,15 +44400,15 @@ var init_EntitiesTab = __esm({
|
|
|
44804
44400
|
});
|
|
44805
44401
|
function EventFlowTab({ events: events2 }) {
|
|
44806
44402
|
const { t } = useTranslate();
|
|
44807
|
-
const [filter, setFilter] =
|
|
44808
|
-
const containerRef =
|
|
44809
|
-
const [autoScroll, setAutoScroll] =
|
|
44810
|
-
|
|
44403
|
+
const [filter, setFilter] = React97.useState("all");
|
|
44404
|
+
const containerRef = React97.useRef(null);
|
|
44405
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
44406
|
+
React97.useEffect(() => {
|
|
44811
44407
|
if (autoScroll && containerRef.current) {
|
|
44812
44408
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44813
44409
|
}
|
|
44814
44410
|
}, [events2.length, autoScroll]);
|
|
44815
|
-
const filteredEvents =
|
|
44411
|
+
const filteredEvents = React97.useMemo(() => {
|
|
44816
44412
|
if (filter === "all") return events2;
|
|
44817
44413
|
return events2.filter((e) => e.type === filter);
|
|
44818
44414
|
}, [events2, filter]);
|
|
@@ -44928,7 +44524,7 @@ var init_EventFlowTab = __esm({
|
|
|
44928
44524
|
});
|
|
44929
44525
|
function GuardsPanel({ guards }) {
|
|
44930
44526
|
const { t } = useTranslate();
|
|
44931
|
-
const [filter, setFilter] =
|
|
44527
|
+
const [filter, setFilter] = React97.useState("all");
|
|
44932
44528
|
if (guards.length === 0) {
|
|
44933
44529
|
return /* @__PURE__ */ jsx(
|
|
44934
44530
|
EmptyState,
|
|
@@ -44941,7 +44537,7 @@ function GuardsPanel({ guards }) {
|
|
|
44941
44537
|
}
|
|
44942
44538
|
const passedCount = guards.filter((g) => g.result).length;
|
|
44943
44539
|
const failedCount = guards.length - passedCount;
|
|
44944
|
-
const filteredGuards =
|
|
44540
|
+
const filteredGuards = React97.useMemo(() => {
|
|
44945
44541
|
if (filter === "all") return guards;
|
|
44946
44542
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
44947
44543
|
return guards.filter((g) => !g.result);
|
|
@@ -45104,10 +44700,10 @@ function EffectBadge({ effect }) {
|
|
|
45104
44700
|
}
|
|
45105
44701
|
function TransitionTimeline({ transitions }) {
|
|
45106
44702
|
const { t } = useTranslate();
|
|
45107
|
-
const containerRef =
|
|
45108
|
-
const [autoScroll, setAutoScroll] =
|
|
45109
|
-
const [expandedId, setExpandedId] =
|
|
45110
|
-
|
|
44703
|
+
const containerRef = React97.useRef(null);
|
|
44704
|
+
const [autoScroll, setAutoScroll] = React97.useState(true);
|
|
44705
|
+
const [expandedId, setExpandedId] = React97.useState(null);
|
|
44706
|
+
React97.useEffect(() => {
|
|
45111
44707
|
if (autoScroll && containerRef.current) {
|
|
45112
44708
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
45113
44709
|
}
|
|
@@ -45387,9 +44983,9 @@ function getAllEvents(traits2) {
|
|
|
45387
44983
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
45388
44984
|
const eventBus = useEventBus();
|
|
45389
44985
|
const { t } = useTranslate();
|
|
45390
|
-
const [log13, setLog] =
|
|
45391
|
-
const prevStatesRef =
|
|
45392
|
-
|
|
44986
|
+
const [log13, setLog] = React97.useState([]);
|
|
44987
|
+
const prevStatesRef = React97.useRef(/* @__PURE__ */ new Map());
|
|
44988
|
+
React97.useEffect(() => {
|
|
45393
44989
|
for (const trait of traits2) {
|
|
45394
44990
|
const prev = prevStatesRef.current.get(trait.id);
|
|
45395
44991
|
if (prev && prev !== trait.currentState) {
|
|
@@ -45558,10 +45154,10 @@ function VerifyModePanel({
|
|
|
45558
45154
|
localCount
|
|
45559
45155
|
}) {
|
|
45560
45156
|
const { t } = useTranslate();
|
|
45561
|
-
const [expanded, setExpanded] =
|
|
45562
|
-
const scrollRef =
|
|
45563
|
-
const prevCountRef =
|
|
45564
|
-
|
|
45157
|
+
const [expanded, setExpanded] = React97.useState(true);
|
|
45158
|
+
const scrollRef = React97.useRef(null);
|
|
45159
|
+
const prevCountRef = React97.useRef(0);
|
|
45160
|
+
React97.useEffect(() => {
|
|
45565
45161
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
45566
45162
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
45567
45163
|
}
|
|
@@ -45618,10 +45214,10 @@ function RuntimeDebugger({
|
|
|
45618
45214
|
schema
|
|
45619
45215
|
}) {
|
|
45620
45216
|
const { t } = useTranslate();
|
|
45621
|
-
const [isCollapsed, setIsCollapsed] =
|
|
45622
|
-
const [isVisible, setIsVisible] =
|
|
45217
|
+
const [isCollapsed, setIsCollapsed] = React97.useState(mode === "verify" ? true : defaultCollapsed);
|
|
45218
|
+
const [isVisible, setIsVisible] = React97.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
45623
45219
|
const debugData = useDebugData();
|
|
45624
|
-
|
|
45220
|
+
React97.useEffect(() => {
|
|
45625
45221
|
if (mode === "inline") return;
|
|
45626
45222
|
return onDebugToggle((enabled) => {
|
|
45627
45223
|
setIsVisible(enabled);
|
|
@@ -45630,7 +45226,7 @@ function RuntimeDebugger({
|
|
|
45630
45226
|
}
|
|
45631
45227
|
});
|
|
45632
45228
|
}, [mode]);
|
|
45633
|
-
|
|
45229
|
+
React97.useEffect(() => {
|
|
45634
45230
|
if (mode === "inline") return;
|
|
45635
45231
|
const handleKeyDown = (e) => {
|
|
45636
45232
|
if (e.key === "`" && isVisible) {
|
|
@@ -46150,7 +45746,7 @@ var init_StatCard = __esm({
|
|
|
46150
45746
|
const labelToUse = propLabel ?? propTitle;
|
|
46151
45747
|
const eventBus = useEventBus();
|
|
46152
45748
|
const { t } = useTranslate();
|
|
46153
|
-
const handleActionClick =
|
|
45749
|
+
const handleActionClick = React97__default.useCallback(() => {
|
|
46154
45750
|
if (action?.event) {
|
|
46155
45751
|
eventBus.emit(`UI:${action.event}`, {});
|
|
46156
45752
|
}
|
|
@@ -46161,7 +45757,7 @@ var init_StatCard = __esm({
|
|
|
46161
45757
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
46162
45758
|
const isLoading = externalLoading ?? false;
|
|
46163
45759
|
const error = externalError;
|
|
46164
|
-
const computeMetricValue =
|
|
45760
|
+
const computeMetricValue = React97__default.useCallback(
|
|
46165
45761
|
(metric, items) => {
|
|
46166
45762
|
if (metric.value !== void 0) {
|
|
46167
45763
|
return metric.value;
|
|
@@ -46200,7 +45796,7 @@ var init_StatCard = __esm({
|
|
|
46200
45796
|
},
|
|
46201
45797
|
[]
|
|
46202
45798
|
);
|
|
46203
|
-
const schemaStats =
|
|
45799
|
+
const schemaStats = React97__default.useMemo(() => {
|
|
46204
45800
|
if (!metrics || metrics.length === 0) return null;
|
|
46205
45801
|
return metrics.map((metric) => ({
|
|
46206
45802
|
label: metric.label,
|
|
@@ -46208,7 +45804,7 @@ var init_StatCard = __esm({
|
|
|
46208
45804
|
format: metric.format
|
|
46209
45805
|
}));
|
|
46210
45806
|
}, [metrics, data, computeMetricValue]);
|
|
46211
|
-
const calculatedTrend =
|
|
45807
|
+
const calculatedTrend = React97__default.useMemo(() => {
|
|
46212
45808
|
if (manualTrend !== void 0) return manualTrend;
|
|
46213
45809
|
if (previousValue === void 0 || currentValue === void 0)
|
|
46214
45810
|
return void 0;
|
|
@@ -46848,8 +46444,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46848
46444
|
] });
|
|
46849
46445
|
};
|
|
46850
46446
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
46851
|
-
const endRef =
|
|
46852
|
-
|
|
46447
|
+
const endRef = React97__default.useRef(null);
|
|
46448
|
+
React97__default.useEffect(() => {
|
|
46853
46449
|
if (!autoScroll) return;
|
|
46854
46450
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46855
46451
|
}, [activities.length, autoScroll]);
|
|
@@ -46943,7 +46539,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
46943
46539
|
};
|
|
46944
46540
|
SubagentRichCard = ({ subagent }) => {
|
|
46945
46541
|
const { t } = useTranslate();
|
|
46946
|
-
const activities =
|
|
46542
|
+
const activities = React97__default.useMemo(
|
|
46947
46543
|
() => subagentMessagesToActivities(subagent.messages),
|
|
46948
46544
|
[subagent.messages]
|
|
46949
46545
|
);
|
|
@@ -47020,8 +46616,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
47020
46616
|
] });
|
|
47021
46617
|
};
|
|
47022
46618
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
47023
|
-
const endRef =
|
|
47024
|
-
|
|
46619
|
+
const endRef = React97__default.useRef(null);
|
|
46620
|
+
React97__default.useEffect(() => {
|
|
47025
46621
|
if (!autoScroll) return;
|
|
47026
46622
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
47027
46623
|
}, [messages.length, autoScroll]);
|
|
@@ -47451,7 +47047,7 @@ var init_Timeline = __esm({
|
|
|
47451
47047
|
}) => {
|
|
47452
47048
|
const { t } = useTranslate();
|
|
47453
47049
|
const entityData = entity ?? [];
|
|
47454
|
-
const items =
|
|
47050
|
+
const items = React97__default.useMemo(() => {
|
|
47455
47051
|
if (propItems) return propItems;
|
|
47456
47052
|
if (entityData.length === 0) return [];
|
|
47457
47053
|
return entityData.map((record, idx) => {
|
|
@@ -47553,7 +47149,7 @@ var init_Timeline = __esm({
|
|
|
47553
47149
|
}
|
|
47554
47150
|
});
|
|
47555
47151
|
function extractToastProps(children) {
|
|
47556
|
-
if (!
|
|
47152
|
+
if (!React97__default.isValidElement(children)) {
|
|
47557
47153
|
if (typeof children === "string") {
|
|
47558
47154
|
return { message: children };
|
|
47559
47155
|
}
|
|
@@ -47595,7 +47191,7 @@ var init_ToastSlot = __esm({
|
|
|
47595
47191
|
eventBus.emit(`${prefix}CLOSE`);
|
|
47596
47192
|
};
|
|
47597
47193
|
if (!isVisible) return null;
|
|
47598
|
-
const isCustomContent =
|
|
47194
|
+
const isCustomContent = React97__default.isValidElement(children) && !message;
|
|
47599
47195
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
47600
47196
|
Toast,
|
|
47601
47197
|
{
|
|
@@ -47612,7 +47208,7 @@ var init_ToastSlot = __esm({
|
|
|
47612
47208
|
}
|
|
47613
47209
|
});
|
|
47614
47210
|
function lazyThree(name, loader) {
|
|
47615
|
-
const Lazy =
|
|
47211
|
+
const Lazy = React97__default.lazy(
|
|
47616
47212
|
() => loader().then((m) => {
|
|
47617
47213
|
const Resolved = m[name];
|
|
47618
47214
|
if (!Resolved) {
|
|
@@ -47624,13 +47220,13 @@ function lazyThree(name, loader) {
|
|
|
47624
47220
|
})
|
|
47625
47221
|
);
|
|
47626
47222
|
function ThreeWrapper(props) {
|
|
47627
|
-
return
|
|
47223
|
+
return React97__default.createElement(
|
|
47628
47224
|
ThreeBoundary,
|
|
47629
47225
|
{ name },
|
|
47630
|
-
|
|
47631
|
-
|
|
47226
|
+
React97__default.createElement(
|
|
47227
|
+
React97__default.Suspense,
|
|
47632
47228
|
{ fallback: null },
|
|
47633
|
-
|
|
47229
|
+
React97__default.createElement(Lazy, props)
|
|
47634
47230
|
)
|
|
47635
47231
|
);
|
|
47636
47232
|
}
|
|
@@ -47672,7 +47268,6 @@ var init_component_registry_generated = __esm({
|
|
|
47672
47268
|
init_Canvas2D();
|
|
47673
47269
|
init_CanvasEffect();
|
|
47674
47270
|
init_Card();
|
|
47675
|
-
init_CardBattlerBoard();
|
|
47676
47271
|
init_CardGrid();
|
|
47677
47272
|
init_Carousel();
|
|
47678
47273
|
init_CaseStudyCard();
|
|
@@ -47903,13 +47498,12 @@ var init_component_registry_generated = __esm({
|
|
|
47903
47498
|
init_UploadDropZone();
|
|
47904
47499
|
init_VersionDiff();
|
|
47905
47500
|
init_ViolationAlert();
|
|
47906
|
-
init_VisualNovelBoard();
|
|
47907
47501
|
init_VoteStack();
|
|
47908
47502
|
init_WaypointMarker();
|
|
47909
47503
|
init_WizardContainer();
|
|
47910
47504
|
init_WizardNavigation();
|
|
47911
47505
|
init_WizardProgress();
|
|
47912
|
-
ThreeBoundary = class extends
|
|
47506
|
+
ThreeBoundary = class extends React97__default.Component {
|
|
47913
47507
|
constructor() {
|
|
47914
47508
|
super(...arguments);
|
|
47915
47509
|
__publicField(this, "state", { failed: false });
|
|
@@ -47919,7 +47513,7 @@ var init_component_registry_generated = __esm({
|
|
|
47919
47513
|
}
|
|
47920
47514
|
render() {
|
|
47921
47515
|
if (this.state.failed) {
|
|
47922
|
-
return
|
|
47516
|
+
return React97__default.createElement(
|
|
47923
47517
|
"div",
|
|
47924
47518
|
{
|
|
47925
47519
|
"data-testid": "three-unavailable",
|
|
@@ -47973,7 +47567,6 @@ var init_component_registry_generated = __esm({
|
|
|
47973
47567
|
"Canvas2D": Canvas2D,
|
|
47974
47568
|
"CanvasEffect": CanvasEffect,
|
|
47975
47569
|
"Card": Card,
|
|
47976
|
-
"CardBattlerBoard": CardBattlerBoard,
|
|
47977
47570
|
"CardGrid": CardGrid,
|
|
47978
47571
|
"Carousel": Carousel,
|
|
47979
47572
|
"CaseStudyCard": CaseStudyCard,
|
|
@@ -48218,7 +47811,6 @@ var init_component_registry_generated = __esm({
|
|
|
48218
47811
|
"VStack": VStack,
|
|
48219
47812
|
"VersionDiff": VersionDiff,
|
|
48220
47813
|
"ViolationAlert": ViolationAlert,
|
|
48221
|
-
"VisualNovelBoard": VisualNovelBoard,
|
|
48222
47814
|
"VoteStack": VoteStack,
|
|
48223
47815
|
"WaypointMarker": WaypointMarker,
|
|
48224
47816
|
"WizardContainer": WizardContainer,
|
|
@@ -48242,7 +47834,7 @@ function SuspenseConfigProvider({
|
|
|
48242
47834
|
config,
|
|
48243
47835
|
children
|
|
48244
47836
|
}) {
|
|
48245
|
-
return
|
|
47837
|
+
return React97__default.createElement(
|
|
48246
47838
|
SuspenseConfigContext.Provider,
|
|
48247
47839
|
{ value: config },
|
|
48248
47840
|
children
|
|
@@ -48284,7 +47876,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
48284
47876
|
}
|
|
48285
47877
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
48286
47878
|
}
|
|
48287
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
47879
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React97__default.isValidElement(field) && !(field instanceof Date)) {
|
|
48288
47880
|
const obj = field;
|
|
48289
47881
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
48290
47882
|
if (!fieldName) return field;
|
|
@@ -48737,7 +48329,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
48737
48329
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
48738
48330
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
48739
48331
|
}
|
|
48740
|
-
return /* @__PURE__ */ jsx(
|
|
48332
|
+
return /* @__PURE__ */ jsx(React97__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
48741
48333
|
}
|
|
48742
48334
|
if (!child || typeof child !== "object") return null;
|
|
48743
48335
|
const childId = `${parentId}-${index}`;
|
|
@@ -48777,14 +48369,14 @@ function isPatternConfig(value) {
|
|
|
48777
48369
|
if (value === null || value === void 0) return false;
|
|
48778
48370
|
if (typeof value !== "object") return false;
|
|
48779
48371
|
if (Array.isArray(value)) return false;
|
|
48780
|
-
if (
|
|
48372
|
+
if (React97__default.isValidElement(value)) return false;
|
|
48781
48373
|
if (value instanceof Date) return false;
|
|
48782
48374
|
if (typeof value === "function") return false;
|
|
48783
48375
|
const record = value;
|
|
48784
48376
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
48785
48377
|
}
|
|
48786
48378
|
function isPlainConfigObject(value) {
|
|
48787
|
-
if (
|
|
48379
|
+
if (React97__default.isValidElement(value)) return false;
|
|
48788
48380
|
if (value instanceof Date) return false;
|
|
48789
48381
|
const proto = Object.getPrototypeOf(value);
|
|
48790
48382
|
return proto === Object.prototype || proto === null;
|
|
@@ -48910,7 +48502,7 @@ function SlotContentRenderer({
|
|
|
48910
48502
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
48911
48503
|
const slotVal = restProps[slotKey];
|
|
48912
48504
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
48913
|
-
if (
|
|
48505
|
+
if (React97__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
48914
48506
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
48915
48507
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
48916
48508
|
slotVal,
|
|
@@ -48959,7 +48551,7 @@ function SlotContentRenderer({
|
|
|
48959
48551
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
48960
48552
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
48961
48553
|
const sample = resolvedItems[0];
|
|
48962
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
48554
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React97__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
48963
48555
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
48964
48556
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
48965
48557
|
}
|