@almadar/ui 5.83.0 → 5.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1265 -1672
- package/dist/avl/index.js +235 -642
- package/dist/components/game/2d/atoms/ChoiceButton.d.ts +3 -1
- package/dist/components/game/2d/molecules/index.d.ts +0 -2
- package/dist/components/index.cjs +1354 -1765
- package/dist/components/index.js +311 -720
- package/dist/providers/index.cjs +1132 -1539
- package/dist/providers/index.js +211 -618
- package/dist/runtime/index.cjs +1126 -1533
- package/dist/runtime/index.js +215 -622
- package/package.json +1 -1
- package/dist/components/game/2d/organisms/CardBattlerBoard.d.ts +0 -45
- package/dist/components/game/2d/organisms/VisualNovelBoard.d.ts +0 -44
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React95 from 'react';
|
|
2
|
+
import React95__default, { useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, createContext, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, useEntitySchemaOptional, useEntitySchema, getAllPages, OrbitalProvider, TraitScopeProvider, ServerBridgeProvider, useCurrentPagePath, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge } from '@almadar/ui/providers';
|
|
4
4
|
export { EntitySchemaProvider, ServerBridgeProvider, TraitContext, TraitProvider, useEntitySchema, useEntitySchemaOptional, useServerBridge, useTrait, useTraitContext } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
@@ -937,7 +937,7 @@ var init_Box = __esm({
|
|
|
937
937
|
fixed: "fixed",
|
|
938
938
|
sticky: "sticky"
|
|
939
939
|
};
|
|
940
|
-
Box =
|
|
940
|
+
Box = React95__default.forwardRef(
|
|
941
941
|
({
|
|
942
942
|
padding,
|
|
943
943
|
paddingX,
|
|
@@ -1002,7 +1002,7 @@ var init_Box = __esm({
|
|
|
1002
1002
|
onPointerDown?.(e);
|
|
1003
1003
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
1004
1004
|
const isClickable = action || onClick;
|
|
1005
|
-
return
|
|
1005
|
+
return React95__default.createElement(
|
|
1006
1006
|
Component,
|
|
1007
1007
|
{
|
|
1008
1008
|
ref,
|
|
@@ -1098,7 +1098,7 @@ function loadLib(key, importer) {
|
|
|
1098
1098
|
return p2;
|
|
1099
1099
|
}
|
|
1100
1100
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
1101
|
-
const Lazy =
|
|
1101
|
+
const Lazy = React95__default.lazy(async () => {
|
|
1102
1102
|
const lib = await loadLib(libKey, importer);
|
|
1103
1103
|
const Comp = pick(lib);
|
|
1104
1104
|
if (!Comp) {
|
|
@@ -1108,7 +1108,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
1108
1108
|
return { default: Comp };
|
|
1109
1109
|
});
|
|
1110
1110
|
const Wrapped = (props) => /* @__PURE__ */ jsx(
|
|
1111
|
-
|
|
1111
|
+
React95__default.Suspense,
|
|
1112
1112
|
{
|
|
1113
1113
|
fallback: /* @__PURE__ */ jsx(
|
|
1114
1114
|
"span",
|
|
@@ -1839,7 +1839,7 @@ var init_Icon = __esm({
|
|
|
1839
1839
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1840
1840
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1841
1841
|
const family = useIconFamily();
|
|
1842
|
-
const RenderedComponent =
|
|
1842
|
+
const RenderedComponent = React95__default.useMemo(() => {
|
|
1843
1843
|
if (directIcon) return null;
|
|
1844
1844
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1845
1845
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1901,7 +1901,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1901
1901
|
const IconComp = value;
|
|
1902
1902
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1903
1903
|
}
|
|
1904
|
-
if (
|
|
1904
|
+
if (React95__default.isValidElement(value)) {
|
|
1905
1905
|
return value;
|
|
1906
1906
|
}
|
|
1907
1907
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1977,7 +1977,7 @@ var init_Button = __esm({
|
|
|
1977
1977
|
md: "h-icon-default w-icon-default",
|
|
1978
1978
|
lg: "h-icon-default w-icon-default"
|
|
1979
1979
|
};
|
|
1980
|
-
Button =
|
|
1980
|
+
Button = React95__default.forwardRef(
|
|
1981
1981
|
({
|
|
1982
1982
|
className,
|
|
1983
1983
|
variant = "primary",
|
|
@@ -2045,7 +2045,7 @@ var Dialog;
|
|
|
2045
2045
|
var init_Dialog = __esm({
|
|
2046
2046
|
"components/core/atoms/Dialog.tsx"() {
|
|
2047
2047
|
init_cn();
|
|
2048
|
-
Dialog =
|
|
2048
|
+
Dialog = React95__default.forwardRef(
|
|
2049
2049
|
({
|
|
2050
2050
|
role = "dialog",
|
|
2051
2051
|
"aria-modal": ariaModal = true,
|
|
@@ -2163,7 +2163,7 @@ var init_Typography = __esm({
|
|
|
2163
2163
|
}) => {
|
|
2164
2164
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2165
2165
|
const Component = as || defaultElements[variant];
|
|
2166
|
-
return
|
|
2166
|
+
return React95__default.createElement(
|
|
2167
2167
|
Component,
|
|
2168
2168
|
{
|
|
2169
2169
|
id,
|
|
@@ -2658,7 +2658,7 @@ var init_Badge = __esm({
|
|
|
2658
2658
|
md: "px-2.5 py-1 text-sm",
|
|
2659
2659
|
lg: "px-3 py-1.5 text-base"
|
|
2660
2660
|
};
|
|
2661
|
-
Badge =
|
|
2661
|
+
Badge = React95__default.forwardRef(
|
|
2662
2662
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2663
2663
|
const iconSizes3 = {
|
|
2664
2664
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2995,7 +2995,7 @@ var init_SvgFlow = __esm({
|
|
|
2995
2995
|
width = 100,
|
|
2996
2996
|
height = 100
|
|
2997
2997
|
}) => {
|
|
2998
|
-
const markerId =
|
|
2998
|
+
const markerId = React95__default.useMemo(() => {
|
|
2999
2999
|
flowIdCounter += 1;
|
|
3000
3000
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
3001
3001
|
}, []);
|
|
@@ -3588,7 +3588,7 @@ var init_SvgRing = __esm({
|
|
|
3588
3588
|
width = 100,
|
|
3589
3589
|
height = 100
|
|
3590
3590
|
}) => {
|
|
3591
|
-
const gradientId =
|
|
3591
|
+
const gradientId = React95__default.useMemo(() => {
|
|
3592
3592
|
ringIdCounter += 1;
|
|
3593
3593
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3594
3594
|
}, []);
|
|
@@ -3769,7 +3769,7 @@ var init_Input = __esm({
|
|
|
3769
3769
|
init_cn();
|
|
3770
3770
|
init_Icon();
|
|
3771
3771
|
init_useEventBus();
|
|
3772
|
-
Input =
|
|
3772
|
+
Input = React95__default.forwardRef(
|
|
3773
3773
|
({
|
|
3774
3774
|
className,
|
|
3775
3775
|
inputType,
|
|
@@ -3929,7 +3929,7 @@ var Label;
|
|
|
3929
3929
|
var init_Label = __esm({
|
|
3930
3930
|
"components/core/atoms/Label.tsx"() {
|
|
3931
3931
|
init_cn();
|
|
3932
|
-
Label =
|
|
3932
|
+
Label = React95__default.forwardRef(
|
|
3933
3933
|
({ className, required, children, ...props }, ref) => {
|
|
3934
3934
|
return /* @__PURE__ */ jsxs(
|
|
3935
3935
|
"label",
|
|
@@ -3956,7 +3956,7 @@ var init_Textarea = __esm({
|
|
|
3956
3956
|
"components/core/atoms/Textarea.tsx"() {
|
|
3957
3957
|
init_cn();
|
|
3958
3958
|
init_useEventBus();
|
|
3959
|
-
Textarea =
|
|
3959
|
+
Textarea = React95__default.forwardRef(
|
|
3960
3960
|
({ className, error, onChange, ...props }, ref) => {
|
|
3961
3961
|
const eventBus = useEventBus();
|
|
3962
3962
|
const handleChange = (e) => {
|
|
@@ -4195,7 +4195,7 @@ var init_Select = __esm({
|
|
|
4195
4195
|
init_cn();
|
|
4196
4196
|
init_Icon();
|
|
4197
4197
|
init_useEventBus();
|
|
4198
|
-
Select =
|
|
4198
|
+
Select = React95__default.forwardRef(
|
|
4199
4199
|
(props, _ref) => {
|
|
4200
4200
|
const { multiple, searchable, clearable } = props;
|
|
4201
4201
|
if (multiple || searchable || clearable) {
|
|
@@ -4212,7 +4212,7 @@ var init_Checkbox = __esm({
|
|
|
4212
4212
|
"components/core/atoms/Checkbox.tsx"() {
|
|
4213
4213
|
init_cn();
|
|
4214
4214
|
init_useEventBus();
|
|
4215
|
-
Checkbox =
|
|
4215
|
+
Checkbox = React95__default.forwardRef(
|
|
4216
4216
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
4217
4217
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
4218
4218
|
const eventBus = useEventBus();
|
|
@@ -4266,7 +4266,7 @@ var init_Spinner = __esm({
|
|
|
4266
4266
|
md: "h-6 w-6",
|
|
4267
4267
|
lg: "h-8 w-8"
|
|
4268
4268
|
};
|
|
4269
|
-
Spinner =
|
|
4269
|
+
Spinner = React95__default.forwardRef(
|
|
4270
4270
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4271
4271
|
if (overlay) {
|
|
4272
4272
|
return /* @__PURE__ */ jsx(
|
|
@@ -4356,7 +4356,7 @@ var init_Card = __esm({
|
|
|
4356
4356
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4357
4357
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4358
4358
|
};
|
|
4359
|
-
Card =
|
|
4359
|
+
Card = React95__default.forwardRef(
|
|
4360
4360
|
({
|
|
4361
4361
|
className,
|
|
4362
4362
|
variant = "bordered",
|
|
@@ -4404,9 +4404,9 @@ var init_Card = __esm({
|
|
|
4404
4404
|
}
|
|
4405
4405
|
);
|
|
4406
4406
|
Card.displayName = "Card";
|
|
4407
|
-
CardHeader =
|
|
4407
|
+
CardHeader = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4408
4408
|
CardHeader.displayName = "CardHeader";
|
|
4409
|
-
CardTitle =
|
|
4409
|
+
CardTitle = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4410
4410
|
"h3",
|
|
4411
4411
|
{
|
|
4412
4412
|
ref,
|
|
@@ -4419,11 +4419,11 @@ var init_Card = __esm({
|
|
|
4419
4419
|
}
|
|
4420
4420
|
));
|
|
4421
4421
|
CardTitle.displayName = "CardTitle";
|
|
4422
|
-
CardContent =
|
|
4422
|
+
CardContent = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
4423
4423
|
CardContent.displayName = "CardContent";
|
|
4424
4424
|
CardBody = CardContent;
|
|
4425
4425
|
CardBody.displayName = "CardBody";
|
|
4426
|
-
CardFooter =
|
|
4426
|
+
CardFooter = React95__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4427
4427
|
"div",
|
|
4428
4428
|
{
|
|
4429
4429
|
ref,
|
|
@@ -4478,7 +4478,7 @@ var init_FilterPill = __esm({
|
|
|
4478
4478
|
md: "w-3.5 h-3.5",
|
|
4479
4479
|
lg: "w-4 h-4"
|
|
4480
4480
|
};
|
|
4481
|
-
FilterPill =
|
|
4481
|
+
FilterPill = React95__default.forwardRef(
|
|
4482
4482
|
({
|
|
4483
4483
|
className,
|
|
4484
4484
|
variant = "default",
|
|
@@ -4607,8 +4607,8 @@ var init_Avatar = __esm({
|
|
|
4607
4607
|
actionPayload
|
|
4608
4608
|
}) => {
|
|
4609
4609
|
const eventBus = useEventBus();
|
|
4610
|
-
const [imgFailed, setImgFailed] =
|
|
4611
|
-
|
|
4610
|
+
const [imgFailed, setImgFailed] = React95__default.useState(false);
|
|
4611
|
+
React95__default.useEffect(() => {
|
|
4612
4612
|
setImgFailed(false);
|
|
4613
4613
|
}, [src]);
|
|
4614
4614
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -4721,7 +4721,7 @@ var init_Center = __esm({
|
|
|
4721
4721
|
as: Component = "div"
|
|
4722
4722
|
}) => {
|
|
4723
4723
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4724
|
-
return
|
|
4724
|
+
return React95__default.createElement(Component, {
|
|
4725
4725
|
className: cn(
|
|
4726
4726
|
inline ? "inline-flex" : "flex",
|
|
4727
4727
|
horizontal && "justify-center",
|
|
@@ -4989,7 +4989,7 @@ var init_Radio = __esm({
|
|
|
4989
4989
|
md: "w-2.5 h-2.5",
|
|
4990
4990
|
lg: "w-3 h-3"
|
|
4991
4991
|
};
|
|
4992
|
-
Radio =
|
|
4992
|
+
Radio = React95__default.forwardRef(
|
|
4993
4993
|
({
|
|
4994
4994
|
label,
|
|
4995
4995
|
helperText,
|
|
@@ -5006,12 +5006,12 @@ var init_Radio = __esm({
|
|
|
5006
5006
|
onChange,
|
|
5007
5007
|
...props
|
|
5008
5008
|
}, ref) => {
|
|
5009
|
-
const reactId =
|
|
5009
|
+
const reactId = React95__default.useId();
|
|
5010
5010
|
const baseId = id || `radio-${reactId}`;
|
|
5011
5011
|
const hasError = !!error;
|
|
5012
5012
|
const eventBus = useEventBus();
|
|
5013
|
-
const [selected, setSelected] =
|
|
5014
|
-
|
|
5013
|
+
const [selected, setSelected] = React95__default.useState(value);
|
|
5014
|
+
React95__default.useEffect(() => {
|
|
5015
5015
|
if (value !== void 0) setSelected(value);
|
|
5016
5016
|
}, [value]);
|
|
5017
5017
|
const pick = (next, e) => {
|
|
@@ -5193,7 +5193,7 @@ var init_Switch = __esm({
|
|
|
5193
5193
|
"components/core/atoms/Switch.tsx"() {
|
|
5194
5194
|
"use client";
|
|
5195
5195
|
init_cn();
|
|
5196
|
-
Switch =
|
|
5196
|
+
Switch = React95.forwardRef(
|
|
5197
5197
|
({
|
|
5198
5198
|
checked,
|
|
5199
5199
|
defaultChecked = false,
|
|
@@ -5204,10 +5204,10 @@ var init_Switch = __esm({
|
|
|
5204
5204
|
name,
|
|
5205
5205
|
className
|
|
5206
5206
|
}, ref) => {
|
|
5207
|
-
const [isChecked, setIsChecked] =
|
|
5207
|
+
const [isChecked, setIsChecked] = React95.useState(
|
|
5208
5208
|
checked !== void 0 ? checked : defaultChecked
|
|
5209
5209
|
);
|
|
5210
|
-
|
|
5210
|
+
React95.useEffect(() => {
|
|
5211
5211
|
if (checked !== void 0) {
|
|
5212
5212
|
setIsChecked(checked);
|
|
5213
5213
|
}
|
|
@@ -5370,7 +5370,7 @@ var init_Stack = __esm({
|
|
|
5370
5370
|
};
|
|
5371
5371
|
const isHorizontal = direction === "horizontal";
|
|
5372
5372
|
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";
|
|
5373
|
-
return
|
|
5373
|
+
return React95__default.createElement(
|
|
5374
5374
|
Component,
|
|
5375
5375
|
{
|
|
5376
5376
|
className: cn(
|
|
@@ -5570,7 +5570,7 @@ var Aside;
|
|
|
5570
5570
|
var init_Aside = __esm({
|
|
5571
5571
|
"components/core/atoms/Aside.tsx"() {
|
|
5572
5572
|
init_cn();
|
|
5573
|
-
Aside =
|
|
5573
|
+
Aside = React95__default.forwardRef(
|
|
5574
5574
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
5575
5575
|
);
|
|
5576
5576
|
Aside.displayName = "Aside";
|
|
@@ -5649,9 +5649,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5649
5649
|
className
|
|
5650
5650
|
}) => {
|
|
5651
5651
|
const { t } = useTranslate();
|
|
5652
|
-
const [isVisible, setIsVisible] =
|
|
5653
|
-
const timeoutRef =
|
|
5654
|
-
const triggerRef =
|
|
5652
|
+
const [isVisible, setIsVisible] = React95__default.useState(false);
|
|
5653
|
+
const timeoutRef = React95__default.useRef(null);
|
|
5654
|
+
const triggerRef = React95__default.useRef(null);
|
|
5655
5655
|
const handleMouseEnter = () => {
|
|
5656
5656
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5657
5657
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -5662,7 +5662,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
5662
5662
|
};
|
|
5663
5663
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
5664
5664
|
const open = isVisible || revealed;
|
|
5665
|
-
|
|
5665
|
+
React95__default.useEffect(() => {
|
|
5666
5666
|
return () => {
|
|
5667
5667
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
5668
5668
|
};
|
|
@@ -5872,7 +5872,7 @@ var init_StatusDot = __esm({
|
|
|
5872
5872
|
md: "w-2.5 h-2.5",
|
|
5873
5873
|
lg: "w-3 h-3"
|
|
5874
5874
|
};
|
|
5875
|
-
StatusDot =
|
|
5875
|
+
StatusDot = React95__default.forwardRef(
|
|
5876
5876
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5877
5877
|
return /* @__PURE__ */ jsx(
|
|
5878
5878
|
"span",
|
|
@@ -5926,7 +5926,7 @@ var init_TrendIndicator = __esm({
|
|
|
5926
5926
|
down: "trending-down",
|
|
5927
5927
|
flat: "arrow-right"
|
|
5928
5928
|
};
|
|
5929
|
-
TrendIndicator =
|
|
5929
|
+
TrendIndicator = React95__default.forwardRef(
|
|
5930
5930
|
({
|
|
5931
5931
|
className,
|
|
5932
5932
|
value,
|
|
@@ -5993,7 +5993,7 @@ var init_RangeSlider = __esm({
|
|
|
5993
5993
|
md: "w-4 h-4",
|
|
5994
5994
|
lg: "w-5 h-5"
|
|
5995
5995
|
};
|
|
5996
|
-
RangeSlider =
|
|
5996
|
+
RangeSlider = React95__default.forwardRef(
|
|
5997
5997
|
({
|
|
5998
5998
|
className,
|
|
5999
5999
|
min = 0,
|
|
@@ -6552,7 +6552,7 @@ var init_ContentSection = __esm({
|
|
|
6552
6552
|
md: "py-16",
|
|
6553
6553
|
lg: "py-24"
|
|
6554
6554
|
};
|
|
6555
|
-
ContentSection =
|
|
6555
|
+
ContentSection = React95__default.forwardRef(
|
|
6556
6556
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
6557
6557
|
return /* @__PURE__ */ jsx(
|
|
6558
6558
|
Box,
|
|
@@ -7086,7 +7086,7 @@ var init_AnimatedReveal = __esm({
|
|
|
7086
7086
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
7087
7087
|
"none": {}
|
|
7088
7088
|
};
|
|
7089
|
-
AnimatedReveal =
|
|
7089
|
+
AnimatedReveal = React95__default.forwardRef(
|
|
7090
7090
|
({
|
|
7091
7091
|
trigger = "scroll",
|
|
7092
7092
|
animation = "fade-up",
|
|
@@ -7246,7 +7246,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7246
7246
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
7247
7247
|
"use client";
|
|
7248
7248
|
init_cn();
|
|
7249
|
-
AnimatedGraphic =
|
|
7249
|
+
AnimatedGraphic = React95__default.forwardRef(
|
|
7250
7250
|
({
|
|
7251
7251
|
src,
|
|
7252
7252
|
svgContent,
|
|
@@ -7269,7 +7269,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
7269
7269
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
7270
7270
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
7271
7271
|
const prevAnimateRef = useRef(animate);
|
|
7272
|
-
const setRef =
|
|
7272
|
+
const setRef = React95__default.useCallback(
|
|
7273
7273
|
(node) => {
|
|
7274
7274
|
containerRef.current = node;
|
|
7275
7275
|
if (typeof ref === "function") ref(node);
|
|
@@ -8891,7 +8891,7 @@ function GameCard({
|
|
|
8891
8891
|
className
|
|
8892
8892
|
}) {
|
|
8893
8893
|
const eventBus = useEventBus();
|
|
8894
|
-
const handleClick =
|
|
8894
|
+
const handleClick = React95.useCallback(() => {
|
|
8895
8895
|
if (disabled) return;
|
|
8896
8896
|
onClick?.(id);
|
|
8897
8897
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { cardId: id });
|
|
@@ -9173,9 +9173,9 @@ function ControlButton({
|
|
|
9173
9173
|
className
|
|
9174
9174
|
}) {
|
|
9175
9175
|
const eventBus = useEventBus();
|
|
9176
|
-
const [isPressed, setIsPressed] =
|
|
9176
|
+
const [isPressed, setIsPressed] = React95.useState(false);
|
|
9177
9177
|
const actualPressed = pressed ?? isPressed;
|
|
9178
|
-
const handlePointerDown =
|
|
9178
|
+
const handlePointerDown = React95.useCallback(
|
|
9179
9179
|
(e) => {
|
|
9180
9180
|
e.preventDefault();
|
|
9181
9181
|
if (disabled) return;
|
|
@@ -9185,7 +9185,7 @@ function ControlButton({
|
|
|
9185
9185
|
},
|
|
9186
9186
|
[disabled, pressEvent, eventBus, onPress]
|
|
9187
9187
|
);
|
|
9188
|
-
const handlePointerUp =
|
|
9188
|
+
const handlePointerUp = React95.useCallback(
|
|
9189
9189
|
(e) => {
|
|
9190
9190
|
e.preventDefault();
|
|
9191
9191
|
if (disabled) return;
|
|
@@ -9195,7 +9195,7 @@ function ControlButton({
|
|
|
9195
9195
|
},
|
|
9196
9196
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
9197
9197
|
);
|
|
9198
|
-
const handlePointerLeave =
|
|
9198
|
+
const handlePointerLeave = React95.useCallback(
|
|
9199
9199
|
(e) => {
|
|
9200
9200
|
if (isPressed) {
|
|
9201
9201
|
setIsPressed(false);
|
|
@@ -10045,6 +10045,7 @@ function ChoiceButton({
|
|
|
10045
10045
|
selected = false,
|
|
10046
10046
|
onClick,
|
|
10047
10047
|
action,
|
|
10048
|
+
payload,
|
|
10048
10049
|
className
|
|
10049
10050
|
}) {
|
|
10050
10051
|
const eventBus = useEventBus();
|
|
@@ -10054,7 +10055,7 @@ function ChoiceButton({
|
|
|
10054
10055
|
variant: "ghost",
|
|
10055
10056
|
disabled,
|
|
10056
10057
|
onClick: () => {
|
|
10057
|
-
if (action) eventBus.emit(`UI:${action}`, {});
|
|
10058
|
+
if (action) eventBus.emit(`UI:${action}`, payload ?? {});
|
|
10058
10059
|
onClick?.();
|
|
10059
10060
|
},
|
|
10060
10061
|
className: cn(
|
|
@@ -10213,8 +10214,8 @@ function MiniMap({
|
|
|
10213
10214
|
tileAssets,
|
|
10214
10215
|
unitAssets
|
|
10215
10216
|
}) {
|
|
10216
|
-
const canvasRef =
|
|
10217
|
-
const imgCacheRef =
|
|
10217
|
+
const canvasRef = React95.useRef(null);
|
|
10218
|
+
const imgCacheRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
10218
10219
|
function loadImg(url) {
|
|
10219
10220
|
const cached = imgCacheRef.current.get(url);
|
|
10220
10221
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -10229,7 +10230,7 @@ function MiniMap({
|
|
|
10229
10230
|
imgCacheRef.current.set(url, img);
|
|
10230
10231
|
return null;
|
|
10231
10232
|
}
|
|
10232
|
-
|
|
10233
|
+
React95.useEffect(() => {
|
|
10233
10234
|
const canvas = canvasRef.current;
|
|
10234
10235
|
if (!canvas) return;
|
|
10235
10236
|
const ctx = canvas.getContext("2d");
|
|
@@ -10364,8 +10365,8 @@ function ControlGrid({
|
|
|
10364
10365
|
className
|
|
10365
10366
|
}) {
|
|
10366
10367
|
const eventBus = useEventBus();
|
|
10367
|
-
const [active, setActive] =
|
|
10368
|
-
const handlePress =
|
|
10368
|
+
const [active, setActive] = React95.useState(/* @__PURE__ */ new Set());
|
|
10369
|
+
const handlePress = React95.useCallback(
|
|
10369
10370
|
(id) => {
|
|
10370
10371
|
setActive((prev) => new Set(prev).add(id));
|
|
10371
10372
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10379,7 +10380,7 @@ function ControlGrid({
|
|
|
10379
10380
|
},
|
|
10380
10381
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
10381
10382
|
);
|
|
10382
|
-
const handleRelease =
|
|
10383
|
+
const handleRelease = React95.useCallback(
|
|
10383
10384
|
(id) => {
|
|
10384
10385
|
setActive((prev) => {
|
|
10385
10386
|
const next = new Set(prev);
|
|
@@ -10637,7 +10638,7 @@ function InventoryGrid({
|
|
|
10637
10638
|
const eventBus = useEventBus();
|
|
10638
10639
|
const slotCount = totalSlots ?? items.length;
|
|
10639
10640
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
10640
|
-
const handleSelect =
|
|
10641
|
+
const handleSelect = React95.useCallback(
|
|
10641
10642
|
(id) => {
|
|
10642
10643
|
onSelect?.(id);
|
|
10643
10644
|
if (selectEvent) {
|
|
@@ -10854,7 +10855,7 @@ function GameMenu({
|
|
|
10854
10855
|
}) {
|
|
10855
10856
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
10856
10857
|
const eventBus = useEventBus();
|
|
10857
|
-
const handleOptionClick =
|
|
10858
|
+
const handleOptionClick = React95.useCallback(
|
|
10858
10859
|
(option) => {
|
|
10859
10860
|
if (option.event) {
|
|
10860
10861
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -12596,410 +12597,6 @@ var init_GameAudioToggle = __esm({
|
|
|
12596
12597
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
12597
12598
|
}
|
|
12598
12599
|
});
|
|
12599
|
-
function VisualNovelBoard({
|
|
12600
|
-
entity,
|
|
12601
|
-
nodes: propNodes,
|
|
12602
|
-
currentNodeId: propCurrentNodeId,
|
|
12603
|
-
assetManifest: propAssetManifest,
|
|
12604
|
-
typewriterSpeed = 30,
|
|
12605
|
-
portraitScale = 1,
|
|
12606
|
-
chooseEvent,
|
|
12607
|
-
advanceEvent,
|
|
12608
|
-
restartEvent,
|
|
12609
|
-
className
|
|
12610
|
-
}) {
|
|
12611
|
-
const board = boardEntity(entity) ?? {};
|
|
12612
|
-
const eventBus = useEventBus();
|
|
12613
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12614
|
-
const entityNodes = useMemo(
|
|
12615
|
-
() => rows(board.nodes).map((r) => ({
|
|
12616
|
-
id: str(r.id),
|
|
12617
|
-
speaker: str(r.speaker),
|
|
12618
|
-
text: str(r.text),
|
|
12619
|
-
backgroundKey: r.backgroundKey == null ? void 0 : str(r.backgroundKey),
|
|
12620
|
-
portraitKey: r.portraitKey == null ? void 0 : str(r.portraitKey),
|
|
12621
|
-
choices: rows(r.choices).map((c) => ({
|
|
12622
|
-
label: str(c.label),
|
|
12623
|
-
nextId: str(c.nextId)
|
|
12624
|
-
}))
|
|
12625
|
-
})),
|
|
12626
|
-
[board.nodes]
|
|
12627
|
-
);
|
|
12628
|
-
const rawNodes = propNodes ?? entityNodes;
|
|
12629
|
-
const nodes = rawNodes.length > 0 ? rawNodes : DEFAULT_NODES;
|
|
12630
|
-
const currentNodeId = propCurrentNodeId ?? (str(board.currentNodeId) || nodes[0]?.id);
|
|
12631
|
-
const currentNode = nodes.find((n) => n.id === currentNodeId) ?? nodes[0];
|
|
12632
|
-
const backgroundImage = useMemo(
|
|
12633
|
-
() => assetManifest?.backgrounds?.[currentNode?.backgroundKey ?? ""],
|
|
12634
|
-
[assetManifest, currentNode?.backgroundKey]
|
|
12635
|
-
);
|
|
12636
|
-
const portraitAsset = useMemo(
|
|
12637
|
-
() => assetManifest?.portraits?.[currentNode?.portraitKey ?? ""],
|
|
12638
|
-
[assetManifest, currentNode?.portraitKey]
|
|
12639
|
-
);
|
|
12640
|
-
const [displayedText, setDisplayedText] = useState("");
|
|
12641
|
-
const [isTyping, setIsTyping] = useState(false);
|
|
12642
|
-
const textRef = useRef(currentNode?.text ?? "");
|
|
12643
|
-
const charIndexRef = useRef(0);
|
|
12644
|
-
useEffect(() => {
|
|
12645
|
-
const fullText = currentNode?.text ?? "";
|
|
12646
|
-
textRef.current = fullText;
|
|
12647
|
-
charIndexRef.current = 0;
|
|
12648
|
-
if (typewriterSpeed === 0) {
|
|
12649
|
-
setDisplayedText(fullText);
|
|
12650
|
-
setIsTyping(false);
|
|
12651
|
-
} else {
|
|
12652
|
-
setDisplayedText("");
|
|
12653
|
-
setIsTyping(true);
|
|
12654
|
-
}
|
|
12655
|
-
}, [currentNode?.id, typewriterSpeed]);
|
|
12656
|
-
useEffect(() => {
|
|
12657
|
-
if (!isTyping || typewriterSpeed === 0) return;
|
|
12658
|
-
const interval = setInterval(() => {
|
|
12659
|
-
if (charIndexRef.current < textRef.current.length) {
|
|
12660
|
-
charIndexRef.current++;
|
|
12661
|
-
setDisplayedText(textRef.current.slice(0, charIndexRef.current));
|
|
12662
|
-
} else {
|
|
12663
|
-
setIsTyping(false);
|
|
12664
|
-
clearInterval(interval);
|
|
12665
|
-
}
|
|
12666
|
-
}, typewriterSpeed);
|
|
12667
|
-
return () => clearInterval(interval);
|
|
12668
|
-
}, [isTyping, typewriterSpeed]);
|
|
12669
|
-
const skipTypewriter = useCallback(() => {
|
|
12670
|
-
if (isTyping) {
|
|
12671
|
-
charIndexRef.current = textRef.current.length;
|
|
12672
|
-
setDisplayedText(textRef.current);
|
|
12673
|
-
setIsTyping(false);
|
|
12674
|
-
}
|
|
12675
|
-
}, [isTyping]);
|
|
12676
|
-
const handleChoice = useCallback(
|
|
12677
|
-
(index) => {
|
|
12678
|
-
if (chooseEvent) {
|
|
12679
|
-
eventBus.emit(`UI:${chooseEvent}`, { choiceIndex: index });
|
|
12680
|
-
}
|
|
12681
|
-
},
|
|
12682
|
-
[chooseEvent, eventBus]
|
|
12683
|
-
);
|
|
12684
|
-
const handleAdvance = useCallback(() => {
|
|
12685
|
-
if (advanceEvent) {
|
|
12686
|
-
eventBus.emit(`UI:${advanceEvent}`, {});
|
|
12687
|
-
}
|
|
12688
|
-
}, [advanceEvent, eventBus]);
|
|
12689
|
-
const handleRestart = useCallback(() => {
|
|
12690
|
-
if (restartEvent) {
|
|
12691
|
-
eventBus.emit(`UI:${restartEvent}`, {});
|
|
12692
|
-
}
|
|
12693
|
-
}, [restartEvent, eventBus]);
|
|
12694
|
-
const handleContainerClick = useCallback(() => {
|
|
12695
|
-
if (isTyping) {
|
|
12696
|
-
skipTypewriter();
|
|
12697
|
-
} else if (!currentNode?.choices?.length) {
|
|
12698
|
-
handleAdvance();
|
|
12699
|
-
}
|
|
12700
|
-
}, [isTyping, skipTypewriter, currentNode?.choices, handleAdvance]);
|
|
12701
|
-
if (!currentNode) {
|
|
12702
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("visual-novel-board relative min-h-[600px] bg-background items-center justify-center", className), gap: "lg", children: [
|
|
12703
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h3", color: "muted", children: "No dialogue nodes" }),
|
|
12704
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleRestart, children: "Restart" })
|
|
12705
|
-
] });
|
|
12706
|
-
}
|
|
12707
|
-
return /* @__PURE__ */ jsxs(
|
|
12708
|
-
Box,
|
|
12709
|
-
{
|
|
12710
|
-
className: cn("visual-novel-board relative min-h-[600px] bg-background overflow-hidden", className),
|
|
12711
|
-
onClick: handleContainerClick,
|
|
12712
|
-
children: [
|
|
12713
|
-
backgroundImage && /* @__PURE__ */ jsx(
|
|
12714
|
-
"div",
|
|
12715
|
-
{
|
|
12716
|
-
className: "absolute inset-0 z-0 bg-center bg-cover bg-no-repeat",
|
|
12717
|
-
style: { backgroundImage: `url(${backgroundImage.url})` },
|
|
12718
|
-
"aria-hidden": "true"
|
|
12719
|
-
}
|
|
12720
|
-
),
|
|
12721
|
-
portraitAsset && /* @__PURE__ */ jsx(
|
|
12722
|
-
"div",
|
|
12723
|
-
{
|
|
12724
|
-
className: "absolute left-1/2 -translate-x-1/2 bottom-0 z-10 pointer-events-none flex items-end",
|
|
12725
|
-
style: { height: `${60 * portraitScale}vh` },
|
|
12726
|
-
children: /* @__PURE__ */ jsx(
|
|
12727
|
-
"img",
|
|
12728
|
-
{
|
|
12729
|
-
src: portraitAsset.url,
|
|
12730
|
-
alt: currentNode.speaker,
|
|
12731
|
-
className: "h-full w-auto object-contain drop-shadow-2xl"
|
|
12732
|
-
}
|
|
12733
|
-
)
|
|
12734
|
-
}
|
|
12735
|
-
),
|
|
12736
|
-
/* @__PURE__ */ jsx("div", { className: "absolute left-0 right-0 bottom-0 z-20 mx-4 mb-4", children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
12737
|
-
"rounded-container border-2 overflow-hidden",
|
|
12738
|
-
backgroundImage ? "bg-black/80 backdrop-blur-sm border-white/20" : "bg-card/95 border-border"
|
|
12739
|
-
), children: [
|
|
12740
|
-
/* @__PURE__ */ jsx(
|
|
12741
|
-
DialogueBubble,
|
|
12742
|
-
{
|
|
12743
|
-
speaker: currentNode.speaker,
|
|
12744
|
-
text: displayedText + (isTyping ? "\u258C" : ""),
|
|
12745
|
-
portrait: portraitAsset,
|
|
12746
|
-
position: "bottom",
|
|
12747
|
-
className: "border-0 rounded-none bg-transparent backdrop-blur-none"
|
|
12748
|
-
}
|
|
12749
|
-
),
|
|
12750
|
-
!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(
|
|
12751
|
-
ChoiceButton,
|
|
12752
|
-
{
|
|
12753
|
-
text: choice.label,
|
|
12754
|
-
index: index + 1,
|
|
12755
|
-
onClick: () => handleChoice(index)
|
|
12756
|
-
},
|
|
12757
|
-
choice.nextId
|
|
12758
|
-
)) }),
|
|
12759
|
-
!isTyping && !currentNode.choices?.length && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 text-muted-foreground text-sm animate-pulse", children: "Press click to continue..." })
|
|
12760
|
-
] }) })
|
|
12761
|
-
]
|
|
12762
|
-
}
|
|
12763
|
-
);
|
|
12764
|
-
}
|
|
12765
|
-
var DEFAULT_NODES;
|
|
12766
|
-
var init_VisualNovelBoard = __esm({
|
|
12767
|
-
"components/game/2d/organisms/VisualNovelBoard.tsx"() {
|
|
12768
|
-
"use client";
|
|
12769
|
-
init_cn();
|
|
12770
|
-
init_useEventBus();
|
|
12771
|
-
init_Box();
|
|
12772
|
-
init_Typography();
|
|
12773
|
-
init_Stack();
|
|
12774
|
-
init_Button();
|
|
12775
|
-
init_DialogueBubble();
|
|
12776
|
-
init_ChoiceButton();
|
|
12777
|
-
init_boardEntity();
|
|
12778
|
-
DEFAULT_NODES = [
|
|
12779
|
-
{
|
|
12780
|
-
id: "start",
|
|
12781
|
-
speaker: "Narrator",
|
|
12782
|
-
text: "The corridor stretches into shadow. A lone sentinel blocks your path.",
|
|
12783
|
-
backgroundKey: "corridor",
|
|
12784
|
-
portraitKey: "guide",
|
|
12785
|
-
choices: [
|
|
12786
|
-
{ label: "Approach the sentinel.", nextId: "meet" },
|
|
12787
|
-
{ label: "Turn back.", nextId: "retreat" }
|
|
12788
|
-
]
|
|
12789
|
-
},
|
|
12790
|
-
{
|
|
12791
|
-
id: "meet",
|
|
12792
|
-
speaker: "Sentinel",
|
|
12793
|
-
text: "You carry the old marks. Speak your purpose, traveler.",
|
|
12794
|
-
backgroundKey: "forge",
|
|
12795
|
-
portraitKey: "rival",
|
|
12796
|
-
choices: [
|
|
12797
|
-
{ label: "I seek the core.", nextId: "end" },
|
|
12798
|
-
{ label: "I am only passing through.", nextId: "retreat" }
|
|
12799
|
-
]
|
|
12800
|
-
},
|
|
12801
|
-
{
|
|
12802
|
-
id: "retreat",
|
|
12803
|
-
speaker: "Narrator",
|
|
12804
|
-
text: "You withdraw into the dark. The path will wait for braver feet.",
|
|
12805
|
-
backgroundKey: "corridor",
|
|
12806
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12807
|
-
},
|
|
12808
|
-
{
|
|
12809
|
-
id: "end",
|
|
12810
|
-
speaker: "Sentinel",
|
|
12811
|
-
text: "Then the way is open. Walk it well.",
|
|
12812
|
-
backgroundKey: "core",
|
|
12813
|
-
portraitKey: "rival",
|
|
12814
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12815
|
-
}
|
|
12816
|
-
];
|
|
12817
|
-
VisualNovelBoard.displayName = "VisualNovelBoard";
|
|
12818
|
-
}
|
|
12819
|
-
});
|
|
12820
|
-
function rowToCard(r) {
|
|
12821
|
-
return {
|
|
12822
|
-
id: str(r.id),
|
|
12823
|
-
iconKey: r.iconKey == null ? void 0 : str(r.iconKey),
|
|
12824
|
-
title: r.title == null ? void 0 : str(r.title),
|
|
12825
|
-
cost: r.cost == null ? void 0 : num(r.cost),
|
|
12826
|
-
attack: r.attack == null ? void 0 : num(r.attack),
|
|
12827
|
-
defense: r.defense == null ? void 0 : num(r.defense)
|
|
12828
|
-
};
|
|
12829
|
-
}
|
|
12830
|
-
function resolveCardArt(card, manifest) {
|
|
12831
|
-
const key = card.iconKey ?? card.id;
|
|
12832
|
-
return manifest?.cards?.[key];
|
|
12833
|
-
}
|
|
12834
|
-
function CardBattlerBoard({
|
|
12835
|
-
entity,
|
|
12836
|
-
deck: propDeck,
|
|
12837
|
-
hand: propHand,
|
|
12838
|
-
board: propBoard,
|
|
12839
|
-
mana: propMana,
|
|
12840
|
-
maxMana: propMaxMana,
|
|
12841
|
-
turn: propTurn,
|
|
12842
|
-
result: propResult,
|
|
12843
|
-
assetManifest: propAssetManifest,
|
|
12844
|
-
playCardEvent,
|
|
12845
|
-
endTurnEvent,
|
|
12846
|
-
playAgainEvent,
|
|
12847
|
-
gameEndEvent,
|
|
12848
|
-
className
|
|
12849
|
-
}) {
|
|
12850
|
-
const board = boardEntity(entity) ?? {};
|
|
12851
|
-
const eventBus = useEventBus();
|
|
12852
|
-
const { t } = useTranslate();
|
|
12853
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12854
|
-
const entityHand = useMemo(() => rows(board.hand).map(rowToCard), [board.hand]);
|
|
12855
|
-
const rawHand = propHand ?? entityHand;
|
|
12856
|
-
const hand = rawHand.length > 0 ? rawHand : DEFAULT_HAND;
|
|
12857
|
-
const entityBoard = useMemo(() => rows(board.board).map(rowToCard), [board.board]);
|
|
12858
|
-
const playedCards = propBoard ?? entityBoard;
|
|
12859
|
-
const entityDeck = useMemo(() => rows(board.deck).map(rowToCard), [board.deck]);
|
|
12860
|
-
const deck = propDeck ?? entityDeck;
|
|
12861
|
-
const mana = propMana ?? num(board.mana, 3);
|
|
12862
|
-
const maxMana = propMaxMana ?? num(board.maxMana, 3);
|
|
12863
|
-
const turn = propTurn ?? num(board.turn, 1);
|
|
12864
|
-
const result = propResult ?? (str(board.result) || "none");
|
|
12865
|
-
const handCards = hand;
|
|
12866
|
-
const boardCards = playedCards;
|
|
12867
|
-
const emittedGameEnd = useRef(false);
|
|
12868
|
-
if (result !== "none" && !emittedGameEnd.current) {
|
|
12869
|
-
emittedGameEnd.current = true;
|
|
12870
|
-
if (gameEndEvent) {
|
|
12871
|
-
eventBus.emit(`UI:${gameEndEvent}`, { result });
|
|
12872
|
-
}
|
|
12873
|
-
}
|
|
12874
|
-
if (result === "none") {
|
|
12875
|
-
emittedGameEnd.current = false;
|
|
12876
|
-
}
|
|
12877
|
-
const handlePlayCard = useCallback((cardId) => {
|
|
12878
|
-
if (result !== "none") return;
|
|
12879
|
-
if (playCardEvent) {
|
|
12880
|
-
eventBus.emit(`UI:${playCardEvent}`, { cardId });
|
|
12881
|
-
}
|
|
12882
|
-
}, [result, playCardEvent, eventBus]);
|
|
12883
|
-
const handleEndTurn = useCallback(() => {
|
|
12884
|
-
if (result !== "none") return;
|
|
12885
|
-
if (endTurnEvent) {
|
|
12886
|
-
eventBus.emit(`UI:${endTurnEvent}`, {});
|
|
12887
|
-
}
|
|
12888
|
-
}, [result, endTurnEvent, eventBus]);
|
|
12889
|
-
const handlePlayAgain = useCallback(() => {
|
|
12890
|
-
if (playAgainEvent) {
|
|
12891
|
-
eventBus.emit(`UI:${playAgainEvent}`, {});
|
|
12892
|
-
}
|
|
12893
|
-
}, [playAgainEvent, eventBus]);
|
|
12894
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("card-battler-board relative min-h-[600px] bg-background", className), gap: "none", children: [
|
|
12895
|
-
/* @__PURE__ */ jsxs(
|
|
12896
|
-
HStack,
|
|
12897
|
-
{
|
|
12898
|
-
className: "px-4 py-2 border-b border-border bg-surface",
|
|
12899
|
-
gap: "lg",
|
|
12900
|
-
align: "center",
|
|
12901
|
-
children: [
|
|
12902
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12903
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.mana") ?? "Mana" }),
|
|
12904
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "body2", weight: "bold", className: "text-info", children: [
|
|
12905
|
-
mana,
|
|
12906
|
-
" / ",
|
|
12907
|
-
maxMana
|
|
12908
|
-
] })
|
|
12909
|
-
] }),
|
|
12910
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12911
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.turn") ?? "Turn" }),
|
|
12912
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: turn })
|
|
12913
|
-
] }),
|
|
12914
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12915
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.deck") ?? "Deck" }),
|
|
12916
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: deck.length })
|
|
12917
|
-
] }),
|
|
12918
|
-
/* @__PURE__ */ jsx(Box, { className: "ml-auto", children: result === "none" && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", onClick: handleEndTurn, children: t("cb.endTurn") ?? "End Turn" }) })
|
|
12919
|
-
]
|
|
12920
|
-
}
|
|
12921
|
-
),
|
|
12922
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 relative p-4 overflow-auto", children: [
|
|
12923
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.battlefield") ?? "Battlefield" }),
|
|
12924
|
-
boardCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 items-end justify-start", children: boardCards.map((card) => /* @__PURE__ */ jsx(
|
|
12925
|
-
GameCard,
|
|
12926
|
-
{
|
|
12927
|
-
id: card.id,
|
|
12928
|
-
cost: card.cost,
|
|
12929
|
-
art: resolveCardArt(card, assetManifest),
|
|
12930
|
-
attack: card.attack,
|
|
12931
|
-
defense: card.defense,
|
|
12932
|
-
name: card.title,
|
|
12933
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12934
|
-
size: "md"
|
|
12935
|
-
},
|
|
12936
|
-
card.id
|
|
12937
|
-
)) }) : /* @__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" }) })
|
|
12938
|
-
] }),
|
|
12939
|
-
/* @__PURE__ */ jsxs(Box, { className: "border-t border-border bg-surface px-4 py-3", children: [
|
|
12940
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.hand") ?? "Your Hand" }),
|
|
12941
|
-
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(
|
|
12942
|
-
GameCard,
|
|
12943
|
-
{
|
|
12944
|
-
id: card.id,
|
|
12945
|
-
cost: card.cost,
|
|
12946
|
-
art: resolveCardArt(card, assetManifest),
|
|
12947
|
-
attack: card.attack,
|
|
12948
|
-
defense: card.defense,
|
|
12949
|
-
name: card.title,
|
|
12950
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12951
|
-
size: "lg",
|
|
12952
|
-
onClick: handlePlayCard
|
|
12953
|
-
},
|
|
12954
|
-
card.id
|
|
12955
|
-
)) })
|
|
12956
|
-
] }),
|
|
12957
|
-
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: [
|
|
12958
|
-
/* @__PURE__ */ jsx(
|
|
12959
|
-
Typography,
|
|
12960
|
-
{
|
|
12961
|
-
variant: "h2",
|
|
12962
|
-
className: cn(
|
|
12963
|
-
"text-4xl font-black tracking-widest uppercase",
|
|
12964
|
-
result === "won" ? "text-warning" : "text-error"
|
|
12965
|
-
),
|
|
12966
|
-
children: result === "won" ? t("cb.victory") ?? "Victory!" : t("cb.defeat") ?? "Defeat!"
|
|
12967
|
-
}
|
|
12968
|
-
),
|
|
12969
|
-
/* @__PURE__ */ jsx(
|
|
12970
|
-
Button,
|
|
12971
|
-
{
|
|
12972
|
-
variant: "primary",
|
|
12973
|
-
className: "px-8 py-3 font-semibold",
|
|
12974
|
-
onClick: handlePlayAgain,
|
|
12975
|
-
children: t("cb.playAgain") ?? "Play Again"
|
|
12976
|
-
}
|
|
12977
|
-
)
|
|
12978
|
-
] }) })
|
|
12979
|
-
] });
|
|
12980
|
-
}
|
|
12981
|
-
var DEFAULT_HAND;
|
|
12982
|
-
var init_CardBattlerBoard = __esm({
|
|
12983
|
-
"components/game/2d/organisms/CardBattlerBoard.tsx"() {
|
|
12984
|
-
"use client";
|
|
12985
|
-
init_cn();
|
|
12986
|
-
init_useEventBus();
|
|
12987
|
-
init_Box();
|
|
12988
|
-
init_Button();
|
|
12989
|
-
init_Typography();
|
|
12990
|
-
init_Stack();
|
|
12991
|
-
init_GameCard();
|
|
12992
|
-
init_boardEntity();
|
|
12993
|
-
DEFAULT_HAND = [
|
|
12994
|
-
{ id: "c1", iconKey: "bear", title: "Bear", cost: 3, attack: 5, defense: 4 },
|
|
12995
|
-
{ id: "c2", iconKey: "owl", title: "Owl", cost: 1, attack: 2, defense: 1 },
|
|
12996
|
-
{ id: "c3", iconKey: "gorilla", title: "Gorilla", cost: 4, attack: 6, defense: 5 },
|
|
12997
|
-
{ id: "c4", iconKey: "frog", title: "Frog", cost: 1, attack: 1, defense: 2 },
|
|
12998
|
-
{ id: "c5", iconKey: "snake", title: "Snake", cost: 2, attack: 4, defense: 1 }
|
|
12999
|
-
];
|
|
13000
|
-
CardBattlerBoard.displayName = "CardBattlerBoard";
|
|
13001
|
-
}
|
|
13002
|
-
});
|
|
13003
12600
|
function LinearView({
|
|
13004
12601
|
trait,
|
|
13005
12602
|
size = "md",
|
|
@@ -13011,7 +12608,7 @@ function LinearView({
|
|
|
13011
12608
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
13012
12609
|
const isDone = i < currentIdx;
|
|
13013
12610
|
const isCurrent = i === currentIdx;
|
|
13014
|
-
return /* @__PURE__ */ jsxs(
|
|
12611
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
13015
12612
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13016
12613
|
Typography,
|
|
13017
12614
|
{
|
|
@@ -13539,7 +13136,7 @@ function SequenceBar({
|
|
|
13539
13136
|
onSlotRemove(index);
|
|
13540
13137
|
}, [onSlotRemove, playing]);
|
|
13541
13138
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
13542
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
13139
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
13543
13140
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13544
13141
|
Typography,
|
|
13545
13142
|
{
|
|
@@ -16540,7 +16137,7 @@ var init_ErrorBoundary = __esm({
|
|
|
16540
16137
|
}
|
|
16541
16138
|
);
|
|
16542
16139
|
};
|
|
16543
|
-
ErrorBoundary = class extends
|
|
16140
|
+
ErrorBoundary = class extends React95__default.Component {
|
|
16544
16141
|
constructor(props) {
|
|
16545
16142
|
super(props);
|
|
16546
16143
|
__publicField(this, "reset", () => {
|
|
@@ -16822,7 +16419,7 @@ var init_Container = __esm({
|
|
|
16822
16419
|
as: Component = "div"
|
|
16823
16420
|
}) => {
|
|
16824
16421
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
16825
|
-
return
|
|
16422
|
+
return React95__default.createElement(
|
|
16826
16423
|
Component,
|
|
16827
16424
|
{
|
|
16828
16425
|
className: cn(
|
|
@@ -19490,7 +19087,7 @@ var init_CodeBlock = __esm({
|
|
|
19490
19087
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
19491
19088
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
19492
19089
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
19493
|
-
CodeBlock =
|
|
19090
|
+
CodeBlock = React95__default.memo(
|
|
19494
19091
|
({
|
|
19495
19092
|
code: rawCode,
|
|
19496
19093
|
language = "text",
|
|
@@ -20077,7 +19674,7 @@ var init_MarkdownContent = __esm({
|
|
|
20077
19674
|
init_Box();
|
|
20078
19675
|
init_CodeBlock();
|
|
20079
19676
|
init_cn();
|
|
20080
|
-
MarkdownContent =
|
|
19677
|
+
MarkdownContent = React95__default.memo(
|
|
20081
19678
|
({ content, direction = "ltr", className }) => {
|
|
20082
19679
|
const { t: _t } = useTranslate();
|
|
20083
19680
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -21354,7 +20951,7 @@ var init_StateMachineView = __esm({
|
|
|
21354
20951
|
style: { top: title ? 30 : 0 },
|
|
21355
20952
|
children: [
|
|
21356
20953
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
21357
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20954
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
21358
20955
|
StateNode2,
|
|
21359
20956
|
{
|
|
21360
20957
|
state,
|
|
@@ -26911,8 +26508,8 @@ var init_Menu = __esm({
|
|
|
26911
26508
|
"bottom-end": "bottom-start"
|
|
26912
26509
|
};
|
|
26913
26510
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
26914
|
-
const triggerChild =
|
|
26915
|
-
const triggerElement =
|
|
26511
|
+
const triggerChild = React95__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
26512
|
+
const triggerElement = React95__default.cloneElement(
|
|
26916
26513
|
triggerChild,
|
|
26917
26514
|
{
|
|
26918
26515
|
ref: triggerRef,
|
|
@@ -27007,14 +26604,14 @@ function useDataDnd(args) {
|
|
|
27007
26604
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
27008
26605
|
const enabled = isZone || Boolean(dndRoot);
|
|
27009
26606
|
const eventBus = useEventBus();
|
|
27010
|
-
const parentRoot =
|
|
26607
|
+
const parentRoot = React95__default.useContext(RootCtx);
|
|
27011
26608
|
const isRoot = enabled && parentRoot === null;
|
|
27012
|
-
const zoneId =
|
|
26609
|
+
const zoneId = React95__default.useId();
|
|
27013
26610
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
27014
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
27015
|
-
const optimisticOrdersRef =
|
|
26611
|
+
const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
|
|
26612
|
+
const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
|
|
27016
26613
|
optimisticOrdersRef.current = optimisticOrders;
|
|
27017
|
-
const clearOptimisticOrder =
|
|
26614
|
+
const clearOptimisticOrder = React95__default.useCallback((group) => {
|
|
27018
26615
|
setOptimisticOrders((prev) => {
|
|
27019
26616
|
if (!prev.has(group)) return prev;
|
|
27020
26617
|
const next = new Map(prev);
|
|
@@ -27039,7 +26636,7 @@ function useDataDnd(args) {
|
|
|
27039
26636
|
const raw = it[dndItemIdField];
|
|
27040
26637
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
27041
26638
|
}).join("|");
|
|
27042
|
-
const itemIds =
|
|
26639
|
+
const itemIds = React95__default.useMemo(
|
|
27043
26640
|
() => orderedItems.map((it, idx) => {
|
|
27044
26641
|
const raw = it[dndItemIdField];
|
|
27045
26642
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -27050,7 +26647,7 @@ function useDataDnd(args) {
|
|
|
27050
26647
|
const raw = it[dndItemIdField];
|
|
27051
26648
|
return raw != null ? String(raw) : `__${idx}`;
|
|
27052
26649
|
}).join("|");
|
|
27053
|
-
|
|
26650
|
+
React95__default.useEffect(() => {
|
|
27054
26651
|
const root = isRoot ? null : parentRoot;
|
|
27055
26652
|
if (root) {
|
|
27056
26653
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -27058,20 +26655,20 @@ function useDataDnd(args) {
|
|
|
27058
26655
|
clearOptimisticOrder(ownGroup);
|
|
27059
26656
|
}
|
|
27060
26657
|
}, [itemsContentSig, ownGroup]);
|
|
27061
|
-
const zonesRef =
|
|
27062
|
-
const registerZone =
|
|
26658
|
+
const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
|
|
26659
|
+
const registerZone = React95__default.useCallback((zoneId2, meta2) => {
|
|
27063
26660
|
zonesRef.current.set(zoneId2, meta2);
|
|
27064
26661
|
}, []);
|
|
27065
|
-
const unregisterZone =
|
|
26662
|
+
const unregisterZone = React95__default.useCallback((zoneId2) => {
|
|
27066
26663
|
zonesRef.current.delete(zoneId2);
|
|
27067
26664
|
}, []);
|
|
27068
|
-
const [activeDrag, setActiveDrag] =
|
|
27069
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
27070
|
-
const meta =
|
|
26665
|
+
const [activeDrag, setActiveDrag] = React95__default.useState(null);
|
|
26666
|
+
const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
|
|
26667
|
+
const meta = React95__default.useMemo(
|
|
27071
26668
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
27072
26669
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
27073
26670
|
);
|
|
27074
|
-
|
|
26671
|
+
React95__default.useEffect(() => {
|
|
27075
26672
|
const target = isRoot ? null : parentRoot;
|
|
27076
26673
|
if (!target) {
|
|
27077
26674
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -27090,7 +26687,7 @@ function useDataDnd(args) {
|
|
|
27090
26687
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
27091
26688
|
const sensors = useAlmadarDndSensors(true);
|
|
27092
26689
|
const collisionDetection = almadarDndCollisionDetection;
|
|
27093
|
-
const findZoneByItem =
|
|
26690
|
+
const findZoneByItem = React95__default.useCallback(
|
|
27094
26691
|
(id) => {
|
|
27095
26692
|
for (const z of zonesRef.current.values()) {
|
|
27096
26693
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -27099,7 +26696,7 @@ function useDataDnd(args) {
|
|
|
27099
26696
|
},
|
|
27100
26697
|
[]
|
|
27101
26698
|
);
|
|
27102
|
-
|
|
26699
|
+
React95__default.useCallback(
|
|
27103
26700
|
(group) => {
|
|
27104
26701
|
for (const z of zonesRef.current.values()) {
|
|
27105
26702
|
if (z.group === group) return z;
|
|
@@ -27108,7 +26705,7 @@ function useDataDnd(args) {
|
|
|
27108
26705
|
},
|
|
27109
26706
|
[]
|
|
27110
26707
|
);
|
|
27111
|
-
const handleDragEnd =
|
|
26708
|
+
const handleDragEnd = React95__default.useCallback(
|
|
27112
26709
|
(event) => {
|
|
27113
26710
|
const { active, over } = event;
|
|
27114
26711
|
const activeIdStr = String(active.id);
|
|
@@ -27199,8 +26796,8 @@ function useDataDnd(args) {
|
|
|
27199
26796
|
},
|
|
27200
26797
|
[eventBus]
|
|
27201
26798
|
);
|
|
27202
|
-
const sortableData =
|
|
27203
|
-
const SortableItem =
|
|
26799
|
+
const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
26800
|
+
const SortableItem = React95__default.useCallback(
|
|
27204
26801
|
({ id, children }) => {
|
|
27205
26802
|
const {
|
|
27206
26803
|
attributes,
|
|
@@ -27240,7 +26837,7 @@ function useDataDnd(args) {
|
|
|
27240
26837
|
id: droppableId,
|
|
27241
26838
|
data: sortableData
|
|
27242
26839
|
});
|
|
27243
|
-
const ctx =
|
|
26840
|
+
const ctx = React95__default.useContext(RootCtx);
|
|
27244
26841
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
27245
26842
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
27246
26843
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -27255,7 +26852,7 @@ function useDataDnd(args) {
|
|
|
27255
26852
|
showForeignPlaceholder,
|
|
27256
26853
|
ctxAvailable: ctx != null
|
|
27257
26854
|
});
|
|
27258
|
-
|
|
26855
|
+
React95__default.useEffect(() => {
|
|
27259
26856
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
27260
26857
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
27261
26858
|
return /* @__PURE__ */ jsx(
|
|
@@ -27269,11 +26866,11 @@ function useDataDnd(args) {
|
|
|
27269
26866
|
}
|
|
27270
26867
|
);
|
|
27271
26868
|
};
|
|
27272
|
-
const rootContextValue =
|
|
26869
|
+
const rootContextValue = React95__default.useMemo(
|
|
27273
26870
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
27274
26871
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
27275
26872
|
);
|
|
27276
|
-
const handleDragStart =
|
|
26873
|
+
const handleDragStart = React95__default.useCallback((event) => {
|
|
27277
26874
|
const sourceZone = findZoneByItem(event.active.id);
|
|
27278
26875
|
const rect = event.active.rect.current.initial;
|
|
27279
26876
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -27292,7 +26889,7 @@ function useDataDnd(args) {
|
|
|
27292
26889
|
isRoot
|
|
27293
26890
|
});
|
|
27294
26891
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
27295
|
-
const handleDragOver =
|
|
26892
|
+
const handleDragOver = React95__default.useCallback((event) => {
|
|
27296
26893
|
const { active, over } = event;
|
|
27297
26894
|
const overData = over?.data?.current;
|
|
27298
26895
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -27362,7 +26959,7 @@ function useDataDnd(args) {
|
|
|
27362
26959
|
return next;
|
|
27363
26960
|
});
|
|
27364
26961
|
}, []);
|
|
27365
|
-
const handleDragCancel =
|
|
26962
|
+
const handleDragCancel = React95__default.useCallback((event) => {
|
|
27366
26963
|
setActiveDrag(null);
|
|
27367
26964
|
setOverZoneGroup(null);
|
|
27368
26965
|
dndLog.warn("dragCancel", {
|
|
@@ -27370,12 +26967,12 @@ function useDataDnd(args) {
|
|
|
27370
26967
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
27371
26968
|
});
|
|
27372
26969
|
}, []);
|
|
27373
|
-
const handleDragEndWithCleanup =
|
|
26970
|
+
const handleDragEndWithCleanup = React95__default.useCallback((event) => {
|
|
27374
26971
|
handleDragEnd(event);
|
|
27375
26972
|
setActiveDrag(null);
|
|
27376
26973
|
setOverZoneGroup(null);
|
|
27377
26974
|
}, [handleDragEnd]);
|
|
27378
|
-
const wrapContainer =
|
|
26975
|
+
const wrapContainer = React95__default.useCallback(
|
|
27379
26976
|
(children) => {
|
|
27380
26977
|
if (!enabled) return children;
|
|
27381
26978
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -27429,7 +27026,7 @@ var init_useDataDnd = __esm({
|
|
|
27429
27026
|
init_useAlmadarDndCollision();
|
|
27430
27027
|
init_Box();
|
|
27431
27028
|
dndLog = createLogger("almadar:ui:dnd");
|
|
27432
|
-
RootCtx =
|
|
27029
|
+
RootCtx = React95__default.createContext(null);
|
|
27433
27030
|
}
|
|
27434
27031
|
});
|
|
27435
27032
|
function renderIconInput(icon, props) {
|
|
@@ -27955,7 +27552,7 @@ function DataList({
|
|
|
27955
27552
|
}) {
|
|
27956
27553
|
const eventBus = useEventBus();
|
|
27957
27554
|
const { t } = useTranslate();
|
|
27958
|
-
const [visibleCount, setVisibleCount] =
|
|
27555
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
|
|
27959
27556
|
const fieldDefs = fields ?? columns ?? [];
|
|
27960
27557
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
27961
27558
|
const dnd = useDataDnd({
|
|
@@ -27974,7 +27571,7 @@ function DataList({
|
|
|
27974
27571
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
27975
27572
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
27976
27573
|
const hasRenderProp = typeof children === "function";
|
|
27977
|
-
|
|
27574
|
+
React95__default.useEffect(() => {
|
|
27978
27575
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
27979
27576
|
const childrenTypeOf = typeof children;
|
|
27980
27577
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -28078,7 +27675,7 @@ function DataList({
|
|
|
28078
27675
|
const items2 = [...data];
|
|
28079
27676
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
28080
27677
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
28081
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27678
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
28082
27679
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
28083
27680
|
group.items.map((itemData, index) => {
|
|
28084
27681
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -28219,7 +27816,7 @@ function DataList({
|
|
|
28219
27816
|
className
|
|
28220
27817
|
),
|
|
28221
27818
|
children: [
|
|
28222
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27819
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
28223
27820
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
28224
27821
|
group.items.map(
|
|
28225
27822
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -28304,7 +27901,7 @@ var init_FormSection = __esm({
|
|
|
28304
27901
|
columns = 1,
|
|
28305
27902
|
className
|
|
28306
27903
|
}) => {
|
|
28307
|
-
const [collapsed, setCollapsed] =
|
|
27904
|
+
const [collapsed, setCollapsed] = React95__default.useState(defaultCollapsed);
|
|
28308
27905
|
const { t } = useTranslate();
|
|
28309
27906
|
const eventBus = useEventBus();
|
|
28310
27907
|
const gridClass = {
|
|
@@ -28312,7 +27909,7 @@ var init_FormSection = __esm({
|
|
|
28312
27909
|
2: "grid-cols-1 md:grid-cols-2",
|
|
28313
27910
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
28314
27911
|
}[columns];
|
|
28315
|
-
|
|
27912
|
+
React95__default.useCallback(() => {
|
|
28316
27913
|
if (collapsible) {
|
|
28317
27914
|
setCollapsed((prev) => !prev);
|
|
28318
27915
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -29198,7 +28795,7 @@ var init_Flex = __esm({
|
|
|
29198
28795
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
29199
28796
|
}
|
|
29200
28797
|
}
|
|
29201
|
-
return
|
|
28798
|
+
return React95__default.createElement(Component, {
|
|
29202
28799
|
className: cn(
|
|
29203
28800
|
inline ? "inline-flex" : "flex",
|
|
29204
28801
|
directionStyles[direction],
|
|
@@ -29317,7 +28914,7 @@ var init_Grid = __esm({
|
|
|
29317
28914
|
as: Component = "div"
|
|
29318
28915
|
}) => {
|
|
29319
28916
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
29320
|
-
return
|
|
28917
|
+
return React95__default.createElement(
|
|
29321
28918
|
Component,
|
|
29322
28919
|
{
|
|
29323
28920
|
className: cn(
|
|
@@ -29513,9 +29110,9 @@ var init_Popover = __esm({
|
|
|
29513
29110
|
onMouseLeave: handleClose,
|
|
29514
29111
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
29515
29112
|
};
|
|
29516
|
-
const childElement =
|
|
29113
|
+
const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
29517
29114
|
const childPointerDown = childElement.props.onPointerDown;
|
|
29518
|
-
const triggerElement =
|
|
29115
|
+
const triggerElement = React95__default.cloneElement(
|
|
29519
29116
|
childElement,
|
|
29520
29117
|
{
|
|
29521
29118
|
ref: triggerRef,
|
|
@@ -30117,9 +29714,9 @@ var init_Tooltip = __esm({
|
|
|
30117
29714
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
30118
29715
|
};
|
|
30119
29716
|
}, []);
|
|
30120
|
-
const triggerElement =
|
|
29717
|
+
const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30121
29718
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
30122
|
-
const trigger =
|
|
29719
|
+
const trigger = React95__default.cloneElement(triggerElement, {
|
|
30123
29720
|
ref: triggerRef,
|
|
30124
29721
|
onMouseEnter: handleMouseEnter,
|
|
30125
29722
|
onMouseLeave: handleMouseLeave,
|
|
@@ -30209,7 +29806,7 @@ var init_WizardProgress = __esm({
|
|
|
30209
29806
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
30210
29807
|
const isActive = index === currentStep;
|
|
30211
29808
|
const isCompleted = index < currentStep;
|
|
30212
|
-
return /* @__PURE__ */ jsxs(
|
|
29809
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
30213
29810
|
/* @__PURE__ */ jsx(
|
|
30214
29811
|
"button",
|
|
30215
29812
|
{
|
|
@@ -31769,13 +31366,13 @@ var init_MapView = __esm({
|
|
|
31769
31366
|
shadowSize: [41, 41]
|
|
31770
31367
|
});
|
|
31771
31368
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
31772
|
-
const { useEffect:
|
|
31369
|
+
const { useEffect: useEffect68, useRef: useRef67, useCallback: useCallback101, useState: useState99 } = React95__default;
|
|
31773
31370
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
31774
31371
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
31775
31372
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
31776
31373
|
const map = useMap();
|
|
31777
|
-
const prevRef =
|
|
31778
|
-
|
|
31374
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
31375
|
+
useEffect68(() => {
|
|
31779
31376
|
const prev = prevRef.current;
|
|
31780
31377
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
31781
31378
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -31786,7 +31383,7 @@ var init_MapView = __esm({
|
|
|
31786
31383
|
}
|
|
31787
31384
|
function MapClickHandler({ onMapClick }) {
|
|
31788
31385
|
const map = useMap();
|
|
31789
|
-
|
|
31386
|
+
useEffect68(() => {
|
|
31790
31387
|
if (!onMapClick) return;
|
|
31791
31388
|
const handler = (e) => {
|
|
31792
31389
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31814,8 +31411,8 @@ var init_MapView = __esm({
|
|
|
31814
31411
|
showAttribution = true
|
|
31815
31412
|
}) {
|
|
31816
31413
|
const eventBus = useEventBus2();
|
|
31817
|
-
const [clickedPosition, setClickedPosition] =
|
|
31818
|
-
const handleMapClick =
|
|
31414
|
+
const [clickedPosition, setClickedPosition] = useState99(null);
|
|
31415
|
+
const handleMapClick = useCallback101((lat, lng) => {
|
|
31819
31416
|
if (showClickedPin) {
|
|
31820
31417
|
setClickedPosition({ lat, lng });
|
|
31821
31418
|
}
|
|
@@ -31824,7 +31421,7 @@ var init_MapView = __esm({
|
|
|
31824
31421
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
31825
31422
|
}
|
|
31826
31423
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
31827
|
-
const handleMarkerClick =
|
|
31424
|
+
const handleMarkerClick = useCallback101((marker) => {
|
|
31828
31425
|
onMarkerClick?.(marker);
|
|
31829
31426
|
if (markerClickEvent) {
|
|
31830
31427
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32684,8 +32281,8 @@ function TableView({
|
|
|
32684
32281
|
}) {
|
|
32685
32282
|
const eventBus = useEventBus();
|
|
32686
32283
|
const { t } = useTranslate();
|
|
32687
|
-
const [visibleCount, setVisibleCount] =
|
|
32688
|
-
const [localSelected, setLocalSelected] =
|
|
32284
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
32285
|
+
const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
|
|
32689
32286
|
const colDefs = columns ?? fields ?? [];
|
|
32690
32287
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32691
32288
|
const dnd = useDataDnd({
|
|
@@ -32880,12 +32477,12 @@ function TableView({
|
|
|
32880
32477
|
]
|
|
32881
32478
|
}
|
|
32882
32479
|
);
|
|
32883
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
32480
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React95__default.Fragment, { children: rowInner }, id);
|
|
32884
32481
|
};
|
|
32885
32482
|
const items = Array.from(data);
|
|
32886
32483
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
32887
32484
|
let runningIndex = 0;
|
|
32888
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
32485
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
32889
32486
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
32890
32487
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
32891
32488
|
] }, gi)) });
|
|
@@ -34104,7 +33701,7 @@ var init_StepFlow = __esm({
|
|
|
34104
33701
|
className
|
|
34105
33702
|
}) => {
|
|
34106
33703
|
if (orientation === "vertical") {
|
|
34107
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
33704
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React95__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
34108
33705
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
34109
33706
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34110
33707
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -34115,7 +33712,7 @@ var init_StepFlow = __esm({
|
|
|
34115
33712
|
] })
|
|
34116
33713
|
] }) }, index)) });
|
|
34117
33714
|
}
|
|
34118
|
-
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(
|
|
33715
|
+
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(React95__default.Fragment, { children: [
|
|
34119
33716
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
34120
33717
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34121
33718
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -35100,7 +34697,7 @@ var init_LikertScale = __esm({
|
|
|
35100
34697
|
md: "text-base",
|
|
35101
34698
|
lg: "text-lg"
|
|
35102
34699
|
};
|
|
35103
|
-
LikertScale =
|
|
34700
|
+
LikertScale = React95__default.forwardRef(
|
|
35104
34701
|
({
|
|
35105
34702
|
question,
|
|
35106
34703
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -35112,7 +34709,7 @@ var init_LikertScale = __esm({
|
|
|
35112
34709
|
variant = "radios",
|
|
35113
34710
|
className
|
|
35114
34711
|
}, ref) => {
|
|
35115
|
-
const groupId =
|
|
34712
|
+
const groupId = React95__default.useId();
|
|
35116
34713
|
const eventBus = useEventBus();
|
|
35117
34714
|
const handleSelect = useCallback(
|
|
35118
34715
|
(next) => {
|
|
@@ -37394,7 +36991,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
37394
36991
|
"aria-label": t("aria.breadcrumb"),
|
|
37395
36992
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
37396
36993
|
const isLast = idx === items.length - 1;
|
|
37397
|
-
return /* @__PURE__ */ jsxs(
|
|
36994
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
37398
36995
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
37399
36996
|
Icon,
|
|
37400
36997
|
{
|
|
@@ -38263,7 +37860,7 @@ var init_MiniStateMachine = __esm({
|
|
|
38263
37860
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
38264
37861
|
const tc = transitionCounts[s.name] ?? 0;
|
|
38265
37862
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
38266
|
-
return /* @__PURE__ */ jsxs(
|
|
37863
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
38267
37864
|
/* @__PURE__ */ jsx(
|
|
38268
37865
|
AvlState,
|
|
38269
37866
|
{
|
|
@@ -38467,7 +38064,7 @@ var init_PageHeader = __esm({
|
|
|
38467
38064
|
info: "bg-info/10 text-info"
|
|
38468
38065
|
};
|
|
38469
38066
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
38470
|
-
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(
|
|
38067
|
+
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(React95__default.Fragment, { children: [
|
|
38471
38068
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
38472
38069
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
38473
38070
|
"a",
|
|
@@ -38825,7 +38422,7 @@ var init_Section = __esm({
|
|
|
38825
38422
|
as: Component = "section"
|
|
38826
38423
|
}) => {
|
|
38827
38424
|
const hasHeader = title || description || action;
|
|
38828
|
-
return
|
|
38425
|
+
return React95__default.createElement(
|
|
38829
38426
|
Component,
|
|
38830
38427
|
{
|
|
38831
38428
|
className: cn(
|
|
@@ -39199,7 +38796,7 @@ var init_WizardContainer = __esm({
|
|
|
39199
38796
|
const isCompleted = index < currentStep;
|
|
39200
38797
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
39201
38798
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
39202
|
-
return /* @__PURE__ */ jsxs(
|
|
38799
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
39203
38800
|
/* @__PURE__ */ jsx(
|
|
39204
38801
|
Button,
|
|
39205
38802
|
{
|
|
@@ -41632,7 +41229,7 @@ var init_DetailPanel = __esm({
|
|
|
41632
41229
|
}
|
|
41633
41230
|
});
|
|
41634
41231
|
function extractTitle(children) {
|
|
41635
|
-
if (!
|
|
41232
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
41636
41233
|
const props = children.props;
|
|
41637
41234
|
if (typeof props.title === "string") {
|
|
41638
41235
|
return props.title;
|
|
@@ -41982,12 +41579,12 @@ var init_Form = __esm({
|
|
|
41982
41579
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
41983
41580
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
41984
41581
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
41985
|
-
const normalizedInitialData =
|
|
41582
|
+
const normalizedInitialData = React95__default.useMemo(() => {
|
|
41986
41583
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
41987
41584
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
41988
41585
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
41989
41586
|
}, [entity, initialData]);
|
|
41990
|
-
const entityDerivedFields =
|
|
41587
|
+
const entityDerivedFields = React95__default.useMemo(() => {
|
|
41991
41588
|
if (fields && fields.length > 0) return void 0;
|
|
41992
41589
|
if (!resolvedEntity) return void 0;
|
|
41993
41590
|
return resolvedEntity.fields.map(
|
|
@@ -42008,16 +41605,16 @@ var init_Form = __esm({
|
|
|
42008
41605
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42009
41606
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42010
41607
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42011
|
-
const [formData, setFormData] =
|
|
41608
|
+
const [formData, setFormData] = React95__default.useState(
|
|
42012
41609
|
normalizedInitialData
|
|
42013
41610
|
);
|
|
42014
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41611
|
+
const [collapsedSections, setCollapsedSections] = React95__default.useState(
|
|
42015
41612
|
/* @__PURE__ */ new Set()
|
|
42016
41613
|
);
|
|
42017
|
-
const [submitError, setSubmitError] =
|
|
42018
|
-
const formRef =
|
|
41614
|
+
const [submitError, setSubmitError] = React95__default.useState(null);
|
|
41615
|
+
const formRef = React95__default.useRef(null);
|
|
42019
41616
|
const formMode = props.mode;
|
|
42020
|
-
const mountedRef =
|
|
41617
|
+
const mountedRef = React95__default.useRef(false);
|
|
42021
41618
|
if (!mountedRef.current) {
|
|
42022
41619
|
mountedRef.current = true;
|
|
42023
41620
|
debug("forms", "mount", {
|
|
@@ -42030,7 +41627,7 @@ var init_Form = __esm({
|
|
|
42030
41627
|
});
|
|
42031
41628
|
}
|
|
42032
41629
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42033
|
-
const evalContext =
|
|
41630
|
+
const evalContext = React95__default.useMemo(
|
|
42034
41631
|
() => ({
|
|
42035
41632
|
formValues: formData,
|
|
42036
41633
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42039,7 +41636,7 @@ var init_Form = __esm({
|
|
|
42039
41636
|
}),
|
|
42040
41637
|
[formData, externalContext]
|
|
42041
41638
|
);
|
|
42042
|
-
|
|
41639
|
+
React95__default.useEffect(() => {
|
|
42043
41640
|
debug("forms", "initialData-sync", {
|
|
42044
41641
|
mode: formMode,
|
|
42045
41642
|
normalizedInitialData,
|
|
@@ -42050,7 +41647,7 @@ var init_Form = __esm({
|
|
|
42050
41647
|
setFormData(normalizedInitialData);
|
|
42051
41648
|
}
|
|
42052
41649
|
}, [normalizedInitialData]);
|
|
42053
|
-
const processCalculations =
|
|
41650
|
+
const processCalculations = React95__default.useCallback(
|
|
42054
41651
|
(changedFieldId, newFormData) => {
|
|
42055
41652
|
if (!hiddenCalculations.length) return;
|
|
42056
41653
|
const context = {
|
|
@@ -42075,7 +41672,7 @@ var init_Form = __esm({
|
|
|
42075
41672
|
},
|
|
42076
41673
|
[hiddenCalculations, externalContext, eventBus]
|
|
42077
41674
|
);
|
|
42078
|
-
const checkViolations =
|
|
41675
|
+
const checkViolations = React95__default.useCallback(
|
|
42079
41676
|
(changedFieldId, newFormData) => {
|
|
42080
41677
|
if (!violationTriggers.length) return;
|
|
42081
41678
|
const context = {
|
|
@@ -42113,7 +41710,7 @@ var init_Form = __esm({
|
|
|
42113
41710
|
processCalculations(name, newFormData);
|
|
42114
41711
|
checkViolations(name, newFormData);
|
|
42115
41712
|
};
|
|
42116
|
-
const isFieldVisible =
|
|
41713
|
+
const isFieldVisible = React95__default.useCallback(
|
|
42117
41714
|
(fieldName) => {
|
|
42118
41715
|
const condition = conditionalFields[fieldName];
|
|
42119
41716
|
if (!condition) return true;
|
|
@@ -42121,7 +41718,7 @@ var init_Form = __esm({
|
|
|
42121
41718
|
},
|
|
42122
41719
|
[conditionalFields, evalContext]
|
|
42123
41720
|
);
|
|
42124
|
-
const isSectionVisible =
|
|
41721
|
+
const isSectionVisible = React95__default.useCallback(
|
|
42125
41722
|
(section) => {
|
|
42126
41723
|
if (!section.condition) return true;
|
|
42127
41724
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42197,7 +41794,7 @@ var init_Form = __esm({
|
|
|
42197
41794
|
eventBus.emit(`UI:${onCancel}`);
|
|
42198
41795
|
}
|
|
42199
41796
|
};
|
|
42200
|
-
const renderField =
|
|
41797
|
+
const renderField = React95__default.useCallback(
|
|
42201
41798
|
(field) => {
|
|
42202
41799
|
const fieldName = field.name || field.field;
|
|
42203
41800
|
if (!fieldName) return null;
|
|
@@ -42218,7 +41815,7 @@ var init_Form = __esm({
|
|
|
42218
41815
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42219
41816
|
);
|
|
42220
41817
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42221
|
-
const normalizedFields =
|
|
41818
|
+
const normalizedFields = React95__default.useMemo(() => {
|
|
42222
41819
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42223
41820
|
return effectiveFields.map((field) => {
|
|
42224
41821
|
if (typeof field === "string") {
|
|
@@ -42242,7 +41839,7 @@ var init_Form = __esm({
|
|
|
42242
41839
|
return field;
|
|
42243
41840
|
});
|
|
42244
41841
|
}, [effectiveFields, resolvedEntity]);
|
|
42245
|
-
const schemaFields =
|
|
41842
|
+
const schemaFields = React95__default.useMemo(() => {
|
|
42246
41843
|
if (normalizedFields.length === 0) return null;
|
|
42247
41844
|
if (isDebugEnabled()) {
|
|
42248
41845
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42252,7 +41849,7 @@ var init_Form = __esm({
|
|
|
42252
41849
|
}
|
|
42253
41850
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42254
41851
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42255
|
-
const sectionElements =
|
|
41852
|
+
const sectionElements = React95__default.useMemo(() => {
|
|
42256
41853
|
if (!sections || sections.length === 0) return null;
|
|
42257
41854
|
return sections.map((section) => {
|
|
42258
41855
|
if (!isSectionVisible(section)) {
|
|
@@ -42977,7 +42574,7 @@ var init_List = __esm({
|
|
|
42977
42574
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
42978
42575
|
return [];
|
|
42979
42576
|
}, [entity]);
|
|
42980
|
-
const getItemActions =
|
|
42577
|
+
const getItemActions = React95__default.useCallback(
|
|
42981
42578
|
(item) => {
|
|
42982
42579
|
if (!itemActions) return [];
|
|
42983
42580
|
if (typeof itemActions === "function") {
|
|
@@ -43452,7 +43049,7 @@ var init_MediaGallery = __esm({
|
|
|
43452
43049
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
43453
43050
|
);
|
|
43454
43051
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
43455
|
-
const items =
|
|
43052
|
+
const items = React95__default.useMemo(() => {
|
|
43456
43053
|
if (propItems) return propItems;
|
|
43457
43054
|
if (entityData.length === 0) return [];
|
|
43458
43055
|
return entityData.map((record, idx) => {
|
|
@@ -43615,7 +43212,7 @@ var init_MediaGallery = __esm({
|
|
|
43615
43212
|
}
|
|
43616
43213
|
});
|
|
43617
43214
|
function extractTitle2(children) {
|
|
43618
|
-
if (!
|
|
43215
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
43619
43216
|
const props = children.props;
|
|
43620
43217
|
if (typeof props.title === "string") {
|
|
43621
43218
|
return props.title;
|
|
@@ -43889,7 +43486,7 @@ var init_debugRegistry = __esm({
|
|
|
43889
43486
|
}
|
|
43890
43487
|
});
|
|
43891
43488
|
function useDebugData() {
|
|
43892
|
-
const [data, setData] =
|
|
43489
|
+
const [data, setData] = React95.useState(() => ({
|
|
43893
43490
|
traits: [],
|
|
43894
43491
|
ticks: [],
|
|
43895
43492
|
guards: [],
|
|
@@ -43903,7 +43500,7 @@ function useDebugData() {
|
|
|
43903
43500
|
},
|
|
43904
43501
|
lastUpdate: Date.now()
|
|
43905
43502
|
}));
|
|
43906
|
-
|
|
43503
|
+
React95.useEffect(() => {
|
|
43907
43504
|
const updateData = () => {
|
|
43908
43505
|
setData({
|
|
43909
43506
|
traits: getAllTraits(),
|
|
@@ -44012,12 +43609,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44012
43609
|
return positions;
|
|
44013
43610
|
}
|
|
44014
43611
|
function WalkMinimap() {
|
|
44015
|
-
const [walkStep, setWalkStep] =
|
|
44016
|
-
const [traits2, setTraits] =
|
|
44017
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44018
|
-
const [completedTraits, setCompletedTraits] =
|
|
44019
|
-
const prevTraitRef =
|
|
44020
|
-
|
|
43612
|
+
const [walkStep, setWalkStep] = React95.useState(null);
|
|
43613
|
+
const [traits2, setTraits] = React95.useState([]);
|
|
43614
|
+
const [coveredEdges, setCoveredEdges] = React95.useState([]);
|
|
43615
|
+
const [completedTraits, setCompletedTraits] = React95.useState(/* @__PURE__ */ new Set());
|
|
43616
|
+
const prevTraitRef = React95.useRef(null);
|
|
43617
|
+
React95.useEffect(() => {
|
|
44021
43618
|
const interval = setInterval(() => {
|
|
44022
43619
|
const w = window;
|
|
44023
43620
|
const step = w.__orbitalWalkStep;
|
|
@@ -44453,15 +44050,15 @@ var init_EntitiesTab = __esm({
|
|
|
44453
44050
|
});
|
|
44454
44051
|
function EventFlowTab({ events: events2 }) {
|
|
44455
44052
|
const { t } = useTranslate();
|
|
44456
|
-
const [filter, setFilter] =
|
|
44457
|
-
const containerRef =
|
|
44458
|
-
const [autoScroll, setAutoScroll] =
|
|
44459
|
-
|
|
44053
|
+
const [filter, setFilter] = React95.useState("all");
|
|
44054
|
+
const containerRef = React95.useRef(null);
|
|
44055
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
44056
|
+
React95.useEffect(() => {
|
|
44460
44057
|
if (autoScroll && containerRef.current) {
|
|
44461
44058
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44462
44059
|
}
|
|
44463
44060
|
}, [events2.length, autoScroll]);
|
|
44464
|
-
const filteredEvents =
|
|
44061
|
+
const filteredEvents = React95.useMemo(() => {
|
|
44465
44062
|
if (filter === "all") return events2;
|
|
44466
44063
|
return events2.filter((e) => e.type === filter);
|
|
44467
44064
|
}, [events2, filter]);
|
|
@@ -44577,7 +44174,7 @@ var init_EventFlowTab = __esm({
|
|
|
44577
44174
|
});
|
|
44578
44175
|
function GuardsPanel({ guards }) {
|
|
44579
44176
|
const { t } = useTranslate();
|
|
44580
|
-
const [filter, setFilter] =
|
|
44177
|
+
const [filter, setFilter] = React95.useState("all");
|
|
44581
44178
|
if (guards.length === 0) {
|
|
44582
44179
|
return /* @__PURE__ */ jsx(
|
|
44583
44180
|
EmptyState,
|
|
@@ -44590,7 +44187,7 @@ function GuardsPanel({ guards }) {
|
|
|
44590
44187
|
}
|
|
44591
44188
|
const passedCount = guards.filter((g) => g.result).length;
|
|
44592
44189
|
const failedCount = guards.length - passedCount;
|
|
44593
|
-
const filteredGuards =
|
|
44190
|
+
const filteredGuards = React95.useMemo(() => {
|
|
44594
44191
|
if (filter === "all") return guards;
|
|
44595
44192
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
44596
44193
|
return guards.filter((g) => !g.result);
|
|
@@ -44753,10 +44350,10 @@ function EffectBadge({ effect }) {
|
|
|
44753
44350
|
}
|
|
44754
44351
|
function TransitionTimeline({ transitions }) {
|
|
44755
44352
|
const { t } = useTranslate();
|
|
44756
|
-
const containerRef =
|
|
44757
|
-
const [autoScroll, setAutoScroll] =
|
|
44758
|
-
const [expandedId, setExpandedId] =
|
|
44759
|
-
|
|
44353
|
+
const containerRef = React95.useRef(null);
|
|
44354
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
44355
|
+
const [expandedId, setExpandedId] = React95.useState(null);
|
|
44356
|
+
React95.useEffect(() => {
|
|
44760
44357
|
if (autoScroll && containerRef.current) {
|
|
44761
44358
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44762
44359
|
}
|
|
@@ -45036,9 +44633,9 @@ function getAllEvents(traits2) {
|
|
|
45036
44633
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
45037
44634
|
const eventBus = useEventBus();
|
|
45038
44635
|
const { t } = useTranslate();
|
|
45039
|
-
const [log9, setLog] =
|
|
45040
|
-
const prevStatesRef =
|
|
45041
|
-
|
|
44636
|
+
const [log9, setLog] = React95.useState([]);
|
|
44637
|
+
const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
44638
|
+
React95.useEffect(() => {
|
|
45042
44639
|
for (const trait of traits2) {
|
|
45043
44640
|
const prev = prevStatesRef.current.get(trait.id);
|
|
45044
44641
|
if (prev && prev !== trait.currentState) {
|
|
@@ -45207,10 +44804,10 @@ function VerifyModePanel({
|
|
|
45207
44804
|
localCount
|
|
45208
44805
|
}) {
|
|
45209
44806
|
const { t } = useTranslate();
|
|
45210
|
-
const [expanded, setExpanded] =
|
|
45211
|
-
const scrollRef =
|
|
45212
|
-
const prevCountRef =
|
|
45213
|
-
|
|
44807
|
+
const [expanded, setExpanded] = React95.useState(true);
|
|
44808
|
+
const scrollRef = React95.useRef(null);
|
|
44809
|
+
const prevCountRef = React95.useRef(0);
|
|
44810
|
+
React95.useEffect(() => {
|
|
45214
44811
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
45215
44812
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
45216
44813
|
}
|
|
@@ -45267,10 +44864,10 @@ function RuntimeDebugger({
|
|
|
45267
44864
|
schema
|
|
45268
44865
|
}) {
|
|
45269
44866
|
const { t } = useTranslate();
|
|
45270
|
-
const [isCollapsed, setIsCollapsed] =
|
|
45271
|
-
const [isVisible, setIsVisible] =
|
|
44867
|
+
const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
|
|
44868
|
+
const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
45272
44869
|
const debugData = useDebugData();
|
|
45273
|
-
|
|
44870
|
+
React95.useEffect(() => {
|
|
45274
44871
|
if (mode === "inline") return;
|
|
45275
44872
|
return onDebugToggle((enabled) => {
|
|
45276
44873
|
setIsVisible(enabled);
|
|
@@ -45279,7 +44876,7 @@ function RuntimeDebugger({
|
|
|
45279
44876
|
}
|
|
45280
44877
|
});
|
|
45281
44878
|
}, [mode]);
|
|
45282
|
-
|
|
44879
|
+
React95.useEffect(() => {
|
|
45283
44880
|
if (mode === "inline") return;
|
|
45284
44881
|
const handleKeyDown = (e) => {
|
|
45285
44882
|
if (e.key === "`" && isVisible) {
|
|
@@ -45799,7 +45396,7 @@ var init_StatCard = __esm({
|
|
|
45799
45396
|
const labelToUse = propLabel ?? propTitle;
|
|
45800
45397
|
const eventBus = useEventBus();
|
|
45801
45398
|
const { t } = useTranslate();
|
|
45802
|
-
const handleActionClick =
|
|
45399
|
+
const handleActionClick = React95__default.useCallback(() => {
|
|
45803
45400
|
if (action?.event) {
|
|
45804
45401
|
eventBus.emit(`UI:${action.event}`, {});
|
|
45805
45402
|
}
|
|
@@ -45810,7 +45407,7 @@ var init_StatCard = __esm({
|
|
|
45810
45407
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
45811
45408
|
const isLoading = externalLoading ?? false;
|
|
45812
45409
|
const error = externalError;
|
|
45813
|
-
const computeMetricValue =
|
|
45410
|
+
const computeMetricValue = React95__default.useCallback(
|
|
45814
45411
|
(metric, items) => {
|
|
45815
45412
|
if (metric.value !== void 0) {
|
|
45816
45413
|
return metric.value;
|
|
@@ -45849,7 +45446,7 @@ var init_StatCard = __esm({
|
|
|
45849
45446
|
},
|
|
45850
45447
|
[]
|
|
45851
45448
|
);
|
|
45852
|
-
const schemaStats =
|
|
45449
|
+
const schemaStats = React95__default.useMemo(() => {
|
|
45853
45450
|
if (!metrics || metrics.length === 0) return null;
|
|
45854
45451
|
return metrics.map((metric) => ({
|
|
45855
45452
|
label: metric.label,
|
|
@@ -45857,7 +45454,7 @@ var init_StatCard = __esm({
|
|
|
45857
45454
|
format: metric.format
|
|
45858
45455
|
}));
|
|
45859
45456
|
}, [metrics, data, computeMetricValue]);
|
|
45860
|
-
const calculatedTrend =
|
|
45457
|
+
const calculatedTrend = React95__default.useMemo(() => {
|
|
45861
45458
|
if (manualTrend !== void 0) return manualTrend;
|
|
45862
45459
|
if (previousValue === void 0 || currentValue === void 0)
|
|
45863
45460
|
return void 0;
|
|
@@ -46497,8 +46094,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46497
46094
|
] });
|
|
46498
46095
|
};
|
|
46499
46096
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
46500
|
-
const endRef =
|
|
46501
|
-
|
|
46097
|
+
const endRef = React95__default.useRef(null);
|
|
46098
|
+
React95__default.useEffect(() => {
|
|
46502
46099
|
if (!autoScroll) return;
|
|
46503
46100
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46504
46101
|
}, [activities.length, autoScroll]);
|
|
@@ -46592,7 +46189,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
46592
46189
|
};
|
|
46593
46190
|
SubagentRichCard = ({ subagent }) => {
|
|
46594
46191
|
const { t } = useTranslate();
|
|
46595
|
-
const activities =
|
|
46192
|
+
const activities = React95__default.useMemo(
|
|
46596
46193
|
() => subagentMessagesToActivities(subagent.messages),
|
|
46597
46194
|
[subagent.messages]
|
|
46598
46195
|
);
|
|
@@ -46669,8 +46266,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46669
46266
|
] });
|
|
46670
46267
|
};
|
|
46671
46268
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
46672
|
-
const endRef =
|
|
46673
|
-
|
|
46269
|
+
const endRef = React95__default.useRef(null);
|
|
46270
|
+
React95__default.useEffect(() => {
|
|
46674
46271
|
if (!autoScroll) return;
|
|
46675
46272
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46676
46273
|
}, [messages.length, autoScroll]);
|
|
@@ -47100,7 +46697,7 @@ var init_Timeline = __esm({
|
|
|
47100
46697
|
}) => {
|
|
47101
46698
|
const { t } = useTranslate();
|
|
47102
46699
|
const entityData = entity ?? [];
|
|
47103
|
-
const items =
|
|
46700
|
+
const items = React95__default.useMemo(() => {
|
|
47104
46701
|
if (propItems) return propItems;
|
|
47105
46702
|
if (entityData.length === 0) return [];
|
|
47106
46703
|
return entityData.map((record, idx) => {
|
|
@@ -47202,7 +46799,7 @@ var init_Timeline = __esm({
|
|
|
47202
46799
|
}
|
|
47203
46800
|
});
|
|
47204
46801
|
function extractToastProps(children) {
|
|
47205
|
-
if (!
|
|
46802
|
+
if (!React95__default.isValidElement(children)) {
|
|
47206
46803
|
if (typeof children === "string") {
|
|
47207
46804
|
return { message: children };
|
|
47208
46805
|
}
|
|
@@ -47244,7 +46841,7 @@ var init_ToastSlot = __esm({
|
|
|
47244
46841
|
eventBus.emit(`${prefix}CLOSE`);
|
|
47245
46842
|
};
|
|
47246
46843
|
if (!isVisible) return null;
|
|
47247
|
-
const isCustomContent =
|
|
46844
|
+
const isCustomContent = React95__default.isValidElement(children) && !message;
|
|
47248
46845
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
47249
46846
|
Toast,
|
|
47250
46847
|
{
|
|
@@ -47261,7 +46858,7 @@ var init_ToastSlot = __esm({
|
|
|
47261
46858
|
}
|
|
47262
46859
|
});
|
|
47263
46860
|
function lazyThree(name, loader) {
|
|
47264
|
-
const Lazy =
|
|
46861
|
+
const Lazy = React95__default.lazy(
|
|
47265
46862
|
() => loader().then((m) => {
|
|
47266
46863
|
const Resolved = m[name];
|
|
47267
46864
|
if (!Resolved) {
|
|
@@ -47273,13 +46870,13 @@ function lazyThree(name, loader) {
|
|
|
47273
46870
|
})
|
|
47274
46871
|
);
|
|
47275
46872
|
function ThreeWrapper(props) {
|
|
47276
|
-
return
|
|
46873
|
+
return React95__default.createElement(
|
|
47277
46874
|
ThreeBoundary,
|
|
47278
46875
|
{ name },
|
|
47279
|
-
|
|
47280
|
-
|
|
46876
|
+
React95__default.createElement(
|
|
46877
|
+
React95__default.Suspense,
|
|
47281
46878
|
{ fallback: null },
|
|
47282
|
-
|
|
46879
|
+
React95__default.createElement(Lazy, props)
|
|
47283
46880
|
)
|
|
47284
46881
|
);
|
|
47285
46882
|
}
|
|
@@ -47321,7 +46918,6 @@ var init_component_registry_generated = __esm({
|
|
|
47321
46918
|
init_Canvas2D();
|
|
47322
46919
|
init_CanvasEffect();
|
|
47323
46920
|
init_Card();
|
|
47324
|
-
init_CardBattlerBoard();
|
|
47325
46921
|
init_CardGrid();
|
|
47326
46922
|
init_Carousel();
|
|
47327
46923
|
init_CaseStudyCard();
|
|
@@ -47552,13 +47148,12 @@ var init_component_registry_generated = __esm({
|
|
|
47552
47148
|
init_UploadDropZone();
|
|
47553
47149
|
init_VersionDiff();
|
|
47554
47150
|
init_ViolationAlert();
|
|
47555
|
-
init_VisualNovelBoard();
|
|
47556
47151
|
init_VoteStack();
|
|
47557
47152
|
init_WaypointMarker();
|
|
47558
47153
|
init_WizardContainer();
|
|
47559
47154
|
init_WizardNavigation();
|
|
47560
47155
|
init_WizardProgress();
|
|
47561
|
-
ThreeBoundary = class extends
|
|
47156
|
+
ThreeBoundary = class extends React95__default.Component {
|
|
47562
47157
|
constructor() {
|
|
47563
47158
|
super(...arguments);
|
|
47564
47159
|
__publicField(this, "state", { failed: false });
|
|
@@ -47568,7 +47163,7 @@ var init_component_registry_generated = __esm({
|
|
|
47568
47163
|
}
|
|
47569
47164
|
render() {
|
|
47570
47165
|
if (this.state.failed) {
|
|
47571
|
-
return
|
|
47166
|
+
return React95__default.createElement(
|
|
47572
47167
|
"div",
|
|
47573
47168
|
{
|
|
47574
47169
|
"data-testid": "three-unavailable",
|
|
@@ -47622,7 +47217,6 @@ var init_component_registry_generated = __esm({
|
|
|
47622
47217
|
"Canvas2D": Canvas2D,
|
|
47623
47218
|
"CanvasEffect": CanvasEffect,
|
|
47624
47219
|
"Card": Card,
|
|
47625
|
-
"CardBattlerBoard": CardBattlerBoard,
|
|
47626
47220
|
"CardGrid": CardGrid,
|
|
47627
47221
|
"Carousel": Carousel,
|
|
47628
47222
|
"CaseStudyCard": CaseStudyCard,
|
|
@@ -47867,7 +47461,6 @@ var init_component_registry_generated = __esm({
|
|
|
47867
47461
|
"VStack": VStack,
|
|
47868
47462
|
"VersionDiff": VersionDiff,
|
|
47869
47463
|
"ViolationAlert": ViolationAlert,
|
|
47870
|
-
"VisualNovelBoard": VisualNovelBoard,
|
|
47871
47464
|
"VoteStack": VoteStack,
|
|
47872
47465
|
"WaypointMarker": WaypointMarker,
|
|
47873
47466
|
"WizardContainer": WizardContainer,
|
|
@@ -47891,7 +47484,7 @@ function SuspenseConfigProvider({
|
|
|
47891
47484
|
config,
|
|
47892
47485
|
children
|
|
47893
47486
|
}) {
|
|
47894
|
-
return
|
|
47487
|
+
return React95__default.createElement(
|
|
47895
47488
|
SuspenseConfigContext.Provider,
|
|
47896
47489
|
{ value: config },
|
|
47897
47490
|
children
|
|
@@ -47933,7 +47526,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
47933
47526
|
}
|
|
47934
47527
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
47935
47528
|
}
|
|
47936
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
47529
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React95__default.isValidElement(field) && !(field instanceof Date)) {
|
|
47937
47530
|
const obj = field;
|
|
47938
47531
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
47939
47532
|
if (!fieldName) return field;
|
|
@@ -48386,7 +47979,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
48386
47979
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
48387
47980
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
48388
47981
|
}
|
|
48389
|
-
return /* @__PURE__ */ jsx(
|
|
47982
|
+
return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
48390
47983
|
}
|
|
48391
47984
|
if (!child || typeof child !== "object") return null;
|
|
48392
47985
|
const childId = `${parentId}-${index}`;
|
|
@@ -48426,14 +48019,14 @@ function isPatternConfig(value) {
|
|
|
48426
48019
|
if (value === null || value === void 0) return false;
|
|
48427
48020
|
if (typeof value !== "object") return false;
|
|
48428
48021
|
if (Array.isArray(value)) return false;
|
|
48429
|
-
if (
|
|
48022
|
+
if (React95__default.isValidElement(value)) return false;
|
|
48430
48023
|
if (value instanceof Date) return false;
|
|
48431
48024
|
if (typeof value === "function") return false;
|
|
48432
48025
|
const record = value;
|
|
48433
48026
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
48434
48027
|
}
|
|
48435
48028
|
function isPlainConfigObject(value) {
|
|
48436
|
-
if (
|
|
48029
|
+
if (React95__default.isValidElement(value)) return false;
|
|
48437
48030
|
if (value instanceof Date) return false;
|
|
48438
48031
|
const proto = Object.getPrototypeOf(value);
|
|
48439
48032
|
return proto === Object.prototype || proto === null;
|
|
@@ -48559,7 +48152,7 @@ function SlotContentRenderer({
|
|
|
48559
48152
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
48560
48153
|
const slotVal = restProps[slotKey];
|
|
48561
48154
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
48562
|
-
if (
|
|
48155
|
+
if (React95__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
48563
48156
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
48564
48157
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
48565
48158
|
slotVal,
|
|
@@ -48608,7 +48201,7 @@ function SlotContentRenderer({
|
|
|
48608
48201
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
48609
48202
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
48610
48203
|
const sample = resolvedItems[0];
|
|
48611
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
48204
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React95__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
48612
48205
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
48613
48206
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
48614
48207
|
}
|
|
@@ -48900,7 +48493,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
48900
48493
|
if (Array.isArray(body)) {
|
|
48901
48494
|
return body.map((b) => recur(b));
|
|
48902
48495
|
}
|
|
48903
|
-
if (body !== null && typeof body === "object" && !
|
|
48496
|
+
if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
48904
48497
|
const out = {};
|
|
48905
48498
|
for (const [k, v] of Object.entries(body)) {
|
|
48906
48499
|
out[k] = recur(v);
|
|
@@ -48919,7 +48512,7 @@ function getSlotContentRenderer2() {
|
|
|
48919
48512
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
48920
48513
|
return (item, index) => {
|
|
48921
48514
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
48922
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
48515
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React95__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
48923
48516
|
return null;
|
|
48924
48517
|
}
|
|
48925
48518
|
const record = resolvedBody;
|
|
@@ -48938,7 +48531,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
48938
48531
|
props: childProps,
|
|
48939
48532
|
priority: 0
|
|
48940
48533
|
};
|
|
48941
|
-
return
|
|
48534
|
+
return React95__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
48942
48535
|
};
|
|
48943
48536
|
}
|
|
48944
48537
|
function convertNode(node, callerKey) {
|
|
@@ -48957,7 +48550,7 @@ function convertNode(node, callerKey) {
|
|
|
48957
48550
|
});
|
|
48958
48551
|
return anyChanged ? mapped : node;
|
|
48959
48552
|
}
|
|
48960
|
-
if (typeof node === "object" && !
|
|
48553
|
+
if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
|
|
48961
48554
|
return convertObjectProps(node);
|
|
48962
48555
|
}
|
|
48963
48556
|
return node;
|