@almadar/ui 5.84.0 → 5.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1263 -1671
- package/dist/avl/index.js +233 -641
- package/dist/components/game/2d/molecules/index.d.ts +0 -2
- package/dist/components/index.cjs +1352 -1764
- package/dist/components/index.js +309 -719
- package/dist/providers/index.cjs +1130 -1538
- package/dist/providers/index.js +209 -617
- package/dist/runtime/index.cjs +1124 -1532
- package/dist/runtime/index.js +213 -621
- package/package.json +1 -1
- package/dist/components/game/2d/organisms/CardBattlerBoard.d.ts +0 -45
- package/dist/components/game/2d/organisms/VisualNovelBoard.d.ts +0 -44
package/dist/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);
|
|
@@ -10214,8 +10214,8 @@ function MiniMap({
|
|
|
10214
10214
|
tileAssets,
|
|
10215
10215
|
unitAssets
|
|
10216
10216
|
}) {
|
|
10217
|
-
const canvasRef =
|
|
10218
|
-
const imgCacheRef =
|
|
10217
|
+
const canvasRef = React95.useRef(null);
|
|
10218
|
+
const imgCacheRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
10219
10219
|
function loadImg(url) {
|
|
10220
10220
|
const cached = imgCacheRef.current.get(url);
|
|
10221
10221
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -10230,7 +10230,7 @@ function MiniMap({
|
|
|
10230
10230
|
imgCacheRef.current.set(url, img);
|
|
10231
10231
|
return null;
|
|
10232
10232
|
}
|
|
10233
|
-
|
|
10233
|
+
React95.useEffect(() => {
|
|
10234
10234
|
const canvas = canvasRef.current;
|
|
10235
10235
|
if (!canvas) return;
|
|
10236
10236
|
const ctx = canvas.getContext("2d");
|
|
@@ -10365,8 +10365,8 @@ function ControlGrid({
|
|
|
10365
10365
|
className
|
|
10366
10366
|
}) {
|
|
10367
10367
|
const eventBus = useEventBus();
|
|
10368
|
-
const [active, setActive] =
|
|
10369
|
-
const handlePress =
|
|
10368
|
+
const [active, setActive] = React95.useState(/* @__PURE__ */ new Set());
|
|
10369
|
+
const handlePress = React95.useCallback(
|
|
10370
10370
|
(id) => {
|
|
10371
10371
|
setActive((prev) => new Set(prev).add(id));
|
|
10372
10372
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10380,7 +10380,7 @@ function ControlGrid({
|
|
|
10380
10380
|
},
|
|
10381
10381
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
10382
10382
|
);
|
|
10383
|
-
const handleRelease =
|
|
10383
|
+
const handleRelease = React95.useCallback(
|
|
10384
10384
|
(id) => {
|
|
10385
10385
|
setActive((prev) => {
|
|
10386
10386
|
const next = new Set(prev);
|
|
@@ -10638,7 +10638,7 @@ function InventoryGrid({
|
|
|
10638
10638
|
const eventBus = useEventBus();
|
|
10639
10639
|
const slotCount = totalSlots ?? items.length;
|
|
10640
10640
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
10641
|
-
const handleSelect =
|
|
10641
|
+
const handleSelect = React95.useCallback(
|
|
10642
10642
|
(id) => {
|
|
10643
10643
|
onSelect?.(id);
|
|
10644
10644
|
if (selectEvent) {
|
|
@@ -10855,7 +10855,7 @@ function GameMenu({
|
|
|
10855
10855
|
}) {
|
|
10856
10856
|
const resolvedOptions = options ?? menuItems ?? DEFAULT_MENU_OPTIONS;
|
|
10857
10857
|
const eventBus = useEventBus();
|
|
10858
|
-
const handleOptionClick =
|
|
10858
|
+
const handleOptionClick = React95.useCallback(
|
|
10859
10859
|
(option) => {
|
|
10860
10860
|
if (option.event) {
|
|
10861
10861
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -12597,410 +12597,6 @@ var init_GameAudioToggle = __esm({
|
|
|
12597
12597
|
GameAudioToggle.displayName = "GameAudioToggle";
|
|
12598
12598
|
}
|
|
12599
12599
|
});
|
|
12600
|
-
function VisualNovelBoard({
|
|
12601
|
-
entity,
|
|
12602
|
-
nodes: propNodes,
|
|
12603
|
-
currentNodeId: propCurrentNodeId,
|
|
12604
|
-
assetManifest: propAssetManifest,
|
|
12605
|
-
typewriterSpeed = 30,
|
|
12606
|
-
portraitScale = 1,
|
|
12607
|
-
chooseEvent,
|
|
12608
|
-
advanceEvent,
|
|
12609
|
-
restartEvent,
|
|
12610
|
-
className
|
|
12611
|
-
}) {
|
|
12612
|
-
const board = boardEntity(entity) ?? {};
|
|
12613
|
-
const eventBus = useEventBus();
|
|
12614
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12615
|
-
const entityNodes = useMemo(
|
|
12616
|
-
() => rows(board.nodes).map((r) => ({
|
|
12617
|
-
id: str(r.id),
|
|
12618
|
-
speaker: str(r.speaker),
|
|
12619
|
-
text: str(r.text),
|
|
12620
|
-
backgroundKey: r.backgroundKey == null ? void 0 : str(r.backgroundKey),
|
|
12621
|
-
portraitKey: r.portraitKey == null ? void 0 : str(r.portraitKey),
|
|
12622
|
-
choices: rows(r.choices).map((c) => ({
|
|
12623
|
-
label: str(c.label),
|
|
12624
|
-
nextId: str(c.nextId)
|
|
12625
|
-
}))
|
|
12626
|
-
})),
|
|
12627
|
-
[board.nodes]
|
|
12628
|
-
);
|
|
12629
|
-
const rawNodes = propNodes ?? entityNodes;
|
|
12630
|
-
const nodes = rawNodes.length > 0 ? rawNodes : DEFAULT_NODES;
|
|
12631
|
-
const currentNodeId = propCurrentNodeId ?? (str(board.currentNodeId) || nodes[0]?.id);
|
|
12632
|
-
const currentNode = nodes.find((n) => n.id === currentNodeId) ?? nodes[0];
|
|
12633
|
-
const backgroundImage = useMemo(
|
|
12634
|
-
() => assetManifest?.backgrounds?.[currentNode?.backgroundKey ?? ""],
|
|
12635
|
-
[assetManifest, currentNode?.backgroundKey]
|
|
12636
|
-
);
|
|
12637
|
-
const portraitAsset = useMemo(
|
|
12638
|
-
() => assetManifest?.portraits?.[currentNode?.portraitKey ?? ""],
|
|
12639
|
-
[assetManifest, currentNode?.portraitKey]
|
|
12640
|
-
);
|
|
12641
|
-
const [displayedText, setDisplayedText] = useState("");
|
|
12642
|
-
const [isTyping, setIsTyping] = useState(false);
|
|
12643
|
-
const textRef = useRef(currentNode?.text ?? "");
|
|
12644
|
-
const charIndexRef = useRef(0);
|
|
12645
|
-
useEffect(() => {
|
|
12646
|
-
const fullText = currentNode?.text ?? "";
|
|
12647
|
-
textRef.current = fullText;
|
|
12648
|
-
charIndexRef.current = 0;
|
|
12649
|
-
if (typewriterSpeed === 0) {
|
|
12650
|
-
setDisplayedText(fullText);
|
|
12651
|
-
setIsTyping(false);
|
|
12652
|
-
} else {
|
|
12653
|
-
setDisplayedText("");
|
|
12654
|
-
setIsTyping(true);
|
|
12655
|
-
}
|
|
12656
|
-
}, [currentNode?.id, typewriterSpeed]);
|
|
12657
|
-
useEffect(() => {
|
|
12658
|
-
if (!isTyping || typewriterSpeed === 0) return;
|
|
12659
|
-
const interval = setInterval(() => {
|
|
12660
|
-
if (charIndexRef.current < textRef.current.length) {
|
|
12661
|
-
charIndexRef.current++;
|
|
12662
|
-
setDisplayedText(textRef.current.slice(0, charIndexRef.current));
|
|
12663
|
-
} else {
|
|
12664
|
-
setIsTyping(false);
|
|
12665
|
-
clearInterval(interval);
|
|
12666
|
-
}
|
|
12667
|
-
}, typewriterSpeed);
|
|
12668
|
-
return () => clearInterval(interval);
|
|
12669
|
-
}, [isTyping, typewriterSpeed]);
|
|
12670
|
-
const skipTypewriter = useCallback(() => {
|
|
12671
|
-
if (isTyping) {
|
|
12672
|
-
charIndexRef.current = textRef.current.length;
|
|
12673
|
-
setDisplayedText(textRef.current);
|
|
12674
|
-
setIsTyping(false);
|
|
12675
|
-
}
|
|
12676
|
-
}, [isTyping]);
|
|
12677
|
-
const handleChoice = useCallback(
|
|
12678
|
-
(index) => {
|
|
12679
|
-
if (chooseEvent) {
|
|
12680
|
-
eventBus.emit(`UI:${chooseEvent}`, { choiceIndex: index });
|
|
12681
|
-
}
|
|
12682
|
-
},
|
|
12683
|
-
[chooseEvent, eventBus]
|
|
12684
|
-
);
|
|
12685
|
-
const handleAdvance = useCallback(() => {
|
|
12686
|
-
if (advanceEvent) {
|
|
12687
|
-
eventBus.emit(`UI:${advanceEvent}`, {});
|
|
12688
|
-
}
|
|
12689
|
-
}, [advanceEvent, eventBus]);
|
|
12690
|
-
const handleRestart = useCallback(() => {
|
|
12691
|
-
if (restartEvent) {
|
|
12692
|
-
eventBus.emit(`UI:${restartEvent}`, {});
|
|
12693
|
-
}
|
|
12694
|
-
}, [restartEvent, eventBus]);
|
|
12695
|
-
const handleContainerClick = useCallback(() => {
|
|
12696
|
-
if (isTyping) {
|
|
12697
|
-
skipTypewriter();
|
|
12698
|
-
} else if (!currentNode?.choices?.length) {
|
|
12699
|
-
handleAdvance();
|
|
12700
|
-
}
|
|
12701
|
-
}, [isTyping, skipTypewriter, currentNode?.choices, handleAdvance]);
|
|
12702
|
-
if (!currentNode) {
|
|
12703
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("visual-novel-board relative min-h-[600px] bg-background items-center justify-center", className), gap: "lg", children: [
|
|
12704
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h3", color: "muted", children: "No dialogue nodes" }),
|
|
12705
|
-
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleRestart, children: "Restart" })
|
|
12706
|
-
] });
|
|
12707
|
-
}
|
|
12708
|
-
return /* @__PURE__ */ jsxs(
|
|
12709
|
-
Box,
|
|
12710
|
-
{
|
|
12711
|
-
className: cn("visual-novel-board relative min-h-[600px] bg-background overflow-hidden", className),
|
|
12712
|
-
onClick: handleContainerClick,
|
|
12713
|
-
children: [
|
|
12714
|
-
backgroundImage && /* @__PURE__ */ jsx(
|
|
12715
|
-
"div",
|
|
12716
|
-
{
|
|
12717
|
-
className: "absolute inset-0 z-0 bg-center bg-cover bg-no-repeat",
|
|
12718
|
-
style: { backgroundImage: `url(${backgroundImage.url})` },
|
|
12719
|
-
"aria-hidden": "true"
|
|
12720
|
-
}
|
|
12721
|
-
),
|
|
12722
|
-
portraitAsset && /* @__PURE__ */ jsx(
|
|
12723
|
-
"div",
|
|
12724
|
-
{
|
|
12725
|
-
className: "absolute left-1/2 -translate-x-1/2 bottom-0 z-10 pointer-events-none flex items-end",
|
|
12726
|
-
style: { height: `${60 * portraitScale}vh` },
|
|
12727
|
-
children: /* @__PURE__ */ jsx(
|
|
12728
|
-
"img",
|
|
12729
|
-
{
|
|
12730
|
-
src: portraitAsset.url,
|
|
12731
|
-
alt: currentNode.speaker,
|
|
12732
|
-
className: "h-full w-auto object-contain drop-shadow-2xl"
|
|
12733
|
-
}
|
|
12734
|
-
)
|
|
12735
|
-
}
|
|
12736
|
-
),
|
|
12737
|
-
/* @__PURE__ */ jsx("div", { className: "absolute left-0 right-0 bottom-0 z-20 mx-4 mb-4", children: /* @__PURE__ */ jsxs("div", { className: cn(
|
|
12738
|
-
"rounded-container border-2 overflow-hidden",
|
|
12739
|
-
backgroundImage ? "bg-black/80 backdrop-blur-sm border-white/20" : "bg-card/95 border-border"
|
|
12740
|
-
), children: [
|
|
12741
|
-
/* @__PURE__ */ jsx(
|
|
12742
|
-
DialogueBubble,
|
|
12743
|
-
{
|
|
12744
|
-
speaker: currentNode.speaker,
|
|
12745
|
-
text: displayedText + (isTyping ? "\u258C" : ""),
|
|
12746
|
-
portrait: portraitAsset,
|
|
12747
|
-
position: "bottom",
|
|
12748
|
-
className: "border-0 rounded-none bg-transparent backdrop-blur-none"
|
|
12749
|
-
}
|
|
12750
|
-
),
|
|
12751
|
-
!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(
|
|
12752
|
-
ChoiceButton,
|
|
12753
|
-
{
|
|
12754
|
-
text: choice.label,
|
|
12755
|
-
index: index + 1,
|
|
12756
|
-
onClick: () => handleChoice(index)
|
|
12757
|
-
},
|
|
12758
|
-
choice.nextId
|
|
12759
|
-
)) }),
|
|
12760
|
-
!isTyping && !currentNode.choices?.length && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 text-muted-foreground text-sm animate-pulse", children: "Press click to continue..." })
|
|
12761
|
-
] }) })
|
|
12762
|
-
]
|
|
12763
|
-
}
|
|
12764
|
-
);
|
|
12765
|
-
}
|
|
12766
|
-
var DEFAULT_NODES;
|
|
12767
|
-
var init_VisualNovelBoard = __esm({
|
|
12768
|
-
"components/game/2d/organisms/VisualNovelBoard.tsx"() {
|
|
12769
|
-
"use client";
|
|
12770
|
-
init_cn();
|
|
12771
|
-
init_useEventBus();
|
|
12772
|
-
init_Box();
|
|
12773
|
-
init_Typography();
|
|
12774
|
-
init_Stack();
|
|
12775
|
-
init_Button();
|
|
12776
|
-
init_DialogueBubble();
|
|
12777
|
-
init_ChoiceButton();
|
|
12778
|
-
init_boardEntity();
|
|
12779
|
-
DEFAULT_NODES = [
|
|
12780
|
-
{
|
|
12781
|
-
id: "start",
|
|
12782
|
-
speaker: "Narrator",
|
|
12783
|
-
text: "The corridor stretches into shadow. A lone sentinel blocks your path.",
|
|
12784
|
-
backgroundKey: "corridor",
|
|
12785
|
-
portraitKey: "guide",
|
|
12786
|
-
choices: [
|
|
12787
|
-
{ label: "Approach the sentinel.", nextId: "meet" },
|
|
12788
|
-
{ label: "Turn back.", nextId: "retreat" }
|
|
12789
|
-
]
|
|
12790
|
-
},
|
|
12791
|
-
{
|
|
12792
|
-
id: "meet",
|
|
12793
|
-
speaker: "Sentinel",
|
|
12794
|
-
text: "You carry the old marks. Speak your purpose, traveler.",
|
|
12795
|
-
backgroundKey: "forge",
|
|
12796
|
-
portraitKey: "rival",
|
|
12797
|
-
choices: [
|
|
12798
|
-
{ label: "I seek the core.", nextId: "end" },
|
|
12799
|
-
{ label: "I am only passing through.", nextId: "retreat" }
|
|
12800
|
-
]
|
|
12801
|
-
},
|
|
12802
|
-
{
|
|
12803
|
-
id: "retreat",
|
|
12804
|
-
speaker: "Narrator",
|
|
12805
|
-
text: "You withdraw into the dark. The path will wait for braver feet.",
|
|
12806
|
-
backgroundKey: "corridor",
|
|
12807
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12808
|
-
},
|
|
12809
|
-
{
|
|
12810
|
-
id: "end",
|
|
12811
|
-
speaker: "Sentinel",
|
|
12812
|
-
text: "Then the way is open. Walk it well.",
|
|
12813
|
-
backgroundKey: "core",
|
|
12814
|
-
portraitKey: "rival",
|
|
12815
|
-
choices: [{ label: "Begin again.", nextId: "start" }]
|
|
12816
|
-
}
|
|
12817
|
-
];
|
|
12818
|
-
VisualNovelBoard.displayName = "VisualNovelBoard";
|
|
12819
|
-
}
|
|
12820
|
-
});
|
|
12821
|
-
function rowToCard(r) {
|
|
12822
|
-
return {
|
|
12823
|
-
id: str(r.id),
|
|
12824
|
-
iconKey: r.iconKey == null ? void 0 : str(r.iconKey),
|
|
12825
|
-
title: r.title == null ? void 0 : str(r.title),
|
|
12826
|
-
cost: r.cost == null ? void 0 : num(r.cost),
|
|
12827
|
-
attack: r.attack == null ? void 0 : num(r.attack),
|
|
12828
|
-
defense: r.defense == null ? void 0 : num(r.defense)
|
|
12829
|
-
};
|
|
12830
|
-
}
|
|
12831
|
-
function resolveCardArt(card, manifest) {
|
|
12832
|
-
const key = card.iconKey ?? card.id;
|
|
12833
|
-
return manifest?.cards?.[key];
|
|
12834
|
-
}
|
|
12835
|
-
function CardBattlerBoard({
|
|
12836
|
-
entity,
|
|
12837
|
-
deck: propDeck,
|
|
12838
|
-
hand: propHand,
|
|
12839
|
-
board: propBoard,
|
|
12840
|
-
mana: propMana,
|
|
12841
|
-
maxMana: propMaxMana,
|
|
12842
|
-
turn: propTurn,
|
|
12843
|
-
result: propResult,
|
|
12844
|
-
assetManifest: propAssetManifest,
|
|
12845
|
-
playCardEvent,
|
|
12846
|
-
endTurnEvent,
|
|
12847
|
-
playAgainEvent,
|
|
12848
|
-
gameEndEvent,
|
|
12849
|
-
className
|
|
12850
|
-
}) {
|
|
12851
|
-
const board = boardEntity(entity) ?? {};
|
|
12852
|
-
const eventBus = useEventBus();
|
|
12853
|
-
const { t } = useTranslate();
|
|
12854
|
-
const assetManifest = propAssetManifest ?? board.assetManifest;
|
|
12855
|
-
const entityHand = useMemo(() => rows(board.hand).map(rowToCard), [board.hand]);
|
|
12856
|
-
const rawHand = propHand ?? entityHand;
|
|
12857
|
-
const hand = rawHand.length > 0 ? rawHand : DEFAULT_HAND;
|
|
12858
|
-
const entityBoard = useMemo(() => rows(board.board).map(rowToCard), [board.board]);
|
|
12859
|
-
const playedCards = propBoard ?? entityBoard;
|
|
12860
|
-
const entityDeck = useMemo(() => rows(board.deck).map(rowToCard), [board.deck]);
|
|
12861
|
-
const deck = propDeck ?? entityDeck;
|
|
12862
|
-
const mana = propMana ?? num(board.mana, 3);
|
|
12863
|
-
const maxMana = propMaxMana ?? num(board.maxMana, 3);
|
|
12864
|
-
const turn = propTurn ?? num(board.turn, 1);
|
|
12865
|
-
const result = propResult ?? (str(board.result) || "none");
|
|
12866
|
-
const handCards = hand;
|
|
12867
|
-
const boardCards = playedCards;
|
|
12868
|
-
const emittedGameEnd = useRef(false);
|
|
12869
|
-
if (result !== "none" && !emittedGameEnd.current) {
|
|
12870
|
-
emittedGameEnd.current = true;
|
|
12871
|
-
if (gameEndEvent) {
|
|
12872
|
-
eventBus.emit(`UI:${gameEndEvent}`, { result });
|
|
12873
|
-
}
|
|
12874
|
-
}
|
|
12875
|
-
if (result === "none") {
|
|
12876
|
-
emittedGameEnd.current = false;
|
|
12877
|
-
}
|
|
12878
|
-
const handlePlayCard = useCallback((cardId) => {
|
|
12879
|
-
if (result !== "none") return;
|
|
12880
|
-
if (playCardEvent) {
|
|
12881
|
-
eventBus.emit(`UI:${playCardEvent}`, { cardId });
|
|
12882
|
-
}
|
|
12883
|
-
}, [result, playCardEvent, eventBus]);
|
|
12884
|
-
const handleEndTurn = useCallback(() => {
|
|
12885
|
-
if (result !== "none") return;
|
|
12886
|
-
if (endTurnEvent) {
|
|
12887
|
-
eventBus.emit(`UI:${endTurnEvent}`, {});
|
|
12888
|
-
}
|
|
12889
|
-
}, [result, endTurnEvent, eventBus]);
|
|
12890
|
-
const handlePlayAgain = useCallback(() => {
|
|
12891
|
-
if (playAgainEvent) {
|
|
12892
|
-
eventBus.emit(`UI:${playAgainEvent}`, {});
|
|
12893
|
-
}
|
|
12894
|
-
}, [playAgainEvent, eventBus]);
|
|
12895
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("card-battler-board relative min-h-[600px] bg-background", className), gap: "none", children: [
|
|
12896
|
-
/* @__PURE__ */ jsxs(
|
|
12897
|
-
HStack,
|
|
12898
|
-
{
|
|
12899
|
-
className: "px-4 py-2 border-b border-border bg-surface",
|
|
12900
|
-
gap: "lg",
|
|
12901
|
-
align: "center",
|
|
12902
|
-
children: [
|
|
12903
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12904
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.mana") ?? "Mana" }),
|
|
12905
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "body2", weight: "bold", className: "text-info", children: [
|
|
12906
|
-
mana,
|
|
12907
|
-
" / ",
|
|
12908
|
-
maxMana
|
|
12909
|
-
] })
|
|
12910
|
-
] }),
|
|
12911
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12912
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.turn") ?? "Turn" }),
|
|
12913
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: turn })
|
|
12914
|
-
] }),
|
|
12915
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
12916
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: t("cb.deck") ?? "Deck" }),
|
|
12917
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body2", weight: "bold", children: deck.length })
|
|
12918
|
-
] }),
|
|
12919
|
-
/* @__PURE__ */ jsx(Box, { className: "ml-auto", children: result === "none" && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", onClick: handleEndTurn, children: t("cb.endTurn") ?? "End Turn" }) })
|
|
12920
|
-
]
|
|
12921
|
-
}
|
|
12922
|
-
),
|
|
12923
|
-
/* @__PURE__ */ jsxs(Box, { className: "flex-1 relative p-4 overflow-auto", children: [
|
|
12924
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.battlefield") ?? "Battlefield" }),
|
|
12925
|
-
boardCards.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 items-end justify-start", children: boardCards.map((card) => /* @__PURE__ */ jsx(
|
|
12926
|
-
GameCard,
|
|
12927
|
-
{
|
|
12928
|
-
id: card.id,
|
|
12929
|
-
cost: card.cost,
|
|
12930
|
-
art: resolveCardArt(card, assetManifest),
|
|
12931
|
-
attack: card.attack,
|
|
12932
|
-
defense: card.defense,
|
|
12933
|
-
name: card.title,
|
|
12934
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12935
|
-
size: "md"
|
|
12936
|
-
},
|
|
12937
|
-
card.id
|
|
12938
|
-
)) }) : /* @__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" }) })
|
|
12939
|
-
] }),
|
|
12940
|
-
/* @__PURE__ */ jsxs(Box, { className: "border-t border-border bg-surface px-4 py-3", children: [
|
|
12941
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "mb-2 uppercase tracking-wide", children: t("cb.hand") ?? "Your Hand" }),
|
|
12942
|
-
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(
|
|
12943
|
-
GameCard,
|
|
12944
|
-
{
|
|
12945
|
-
id: card.id,
|
|
12946
|
-
cost: card.cost,
|
|
12947
|
-
art: resolveCardArt(card, assetManifest),
|
|
12948
|
-
attack: card.attack,
|
|
12949
|
-
defense: card.defense,
|
|
12950
|
-
name: card.title,
|
|
12951
|
-
disabled: card.cost != null && card.cost > mana,
|
|
12952
|
-
size: "lg",
|
|
12953
|
-
onClick: handlePlayCard
|
|
12954
|
-
},
|
|
12955
|
-
card.id
|
|
12956
|
-
)) })
|
|
12957
|
-
] }),
|
|
12958
|
-
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: [
|
|
12959
|
-
/* @__PURE__ */ jsx(
|
|
12960
|
-
Typography,
|
|
12961
|
-
{
|
|
12962
|
-
variant: "h2",
|
|
12963
|
-
className: cn(
|
|
12964
|
-
"text-4xl font-black tracking-widest uppercase",
|
|
12965
|
-
result === "won" ? "text-warning" : "text-error"
|
|
12966
|
-
),
|
|
12967
|
-
children: result === "won" ? t("cb.victory") ?? "Victory!" : t("cb.defeat") ?? "Defeat!"
|
|
12968
|
-
}
|
|
12969
|
-
),
|
|
12970
|
-
/* @__PURE__ */ jsx(
|
|
12971
|
-
Button,
|
|
12972
|
-
{
|
|
12973
|
-
variant: "primary",
|
|
12974
|
-
className: "px-8 py-3 font-semibold",
|
|
12975
|
-
onClick: handlePlayAgain,
|
|
12976
|
-
children: t("cb.playAgain") ?? "Play Again"
|
|
12977
|
-
}
|
|
12978
|
-
)
|
|
12979
|
-
] }) })
|
|
12980
|
-
] });
|
|
12981
|
-
}
|
|
12982
|
-
var DEFAULT_HAND;
|
|
12983
|
-
var init_CardBattlerBoard = __esm({
|
|
12984
|
-
"components/game/2d/organisms/CardBattlerBoard.tsx"() {
|
|
12985
|
-
"use client";
|
|
12986
|
-
init_cn();
|
|
12987
|
-
init_useEventBus();
|
|
12988
|
-
init_Box();
|
|
12989
|
-
init_Button();
|
|
12990
|
-
init_Typography();
|
|
12991
|
-
init_Stack();
|
|
12992
|
-
init_GameCard();
|
|
12993
|
-
init_boardEntity();
|
|
12994
|
-
DEFAULT_HAND = [
|
|
12995
|
-
{ id: "c1", iconKey: "bear", title: "Bear", cost: 3, attack: 5, defense: 4 },
|
|
12996
|
-
{ id: "c2", iconKey: "owl", title: "Owl", cost: 1, attack: 2, defense: 1 },
|
|
12997
|
-
{ id: "c3", iconKey: "gorilla", title: "Gorilla", cost: 4, attack: 6, defense: 5 },
|
|
12998
|
-
{ id: "c4", iconKey: "frog", title: "Frog", cost: 1, attack: 1, defense: 2 },
|
|
12999
|
-
{ id: "c5", iconKey: "snake", title: "Snake", cost: 2, attack: 4, defense: 1 }
|
|
13000
|
-
];
|
|
13001
|
-
CardBattlerBoard.displayName = "CardBattlerBoard";
|
|
13002
|
-
}
|
|
13003
|
-
});
|
|
13004
12600
|
function LinearView({
|
|
13005
12601
|
trait,
|
|
13006
12602
|
size = "md",
|
|
@@ -13012,7 +12608,7 @@ function LinearView({
|
|
|
13012
12608
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
13013
12609
|
const isDone = i < currentIdx;
|
|
13014
12610
|
const isCurrent = i === currentIdx;
|
|
13015
|
-
return /* @__PURE__ */ jsxs(
|
|
12611
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
13016
12612
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13017
12613
|
Typography,
|
|
13018
12614
|
{
|
|
@@ -13540,7 +13136,7 @@ function SequenceBar({
|
|
|
13540
13136
|
onSlotRemove(index);
|
|
13541
13137
|
}, [onSlotRemove, playing]);
|
|
13542
13138
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
13543
|
-
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: [
|
|
13544
13140
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13545
13141
|
Typography,
|
|
13546
13142
|
{
|
|
@@ -16541,7 +16137,7 @@ var init_ErrorBoundary = __esm({
|
|
|
16541
16137
|
}
|
|
16542
16138
|
);
|
|
16543
16139
|
};
|
|
16544
|
-
ErrorBoundary = class extends
|
|
16140
|
+
ErrorBoundary = class extends React95__default.Component {
|
|
16545
16141
|
constructor(props) {
|
|
16546
16142
|
super(props);
|
|
16547
16143
|
__publicField(this, "reset", () => {
|
|
@@ -16823,7 +16419,7 @@ var init_Container = __esm({
|
|
|
16823
16419
|
as: Component = "div"
|
|
16824
16420
|
}) => {
|
|
16825
16421
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
16826
|
-
return
|
|
16422
|
+
return React95__default.createElement(
|
|
16827
16423
|
Component,
|
|
16828
16424
|
{
|
|
16829
16425
|
className: cn(
|
|
@@ -19491,7 +19087,7 @@ var init_CodeBlock = __esm({
|
|
|
19491
19087
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
19492
19088
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
19493
19089
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
19494
|
-
CodeBlock =
|
|
19090
|
+
CodeBlock = React95__default.memo(
|
|
19495
19091
|
({
|
|
19496
19092
|
code: rawCode,
|
|
19497
19093
|
language = "text",
|
|
@@ -20078,7 +19674,7 @@ var init_MarkdownContent = __esm({
|
|
|
20078
19674
|
init_Box();
|
|
20079
19675
|
init_CodeBlock();
|
|
20080
19676
|
init_cn();
|
|
20081
|
-
MarkdownContent =
|
|
19677
|
+
MarkdownContent = React95__default.memo(
|
|
20082
19678
|
({ content, direction = "ltr", className }) => {
|
|
20083
19679
|
const { t: _t } = useTranslate();
|
|
20084
19680
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -21355,7 +20951,7 @@ var init_StateMachineView = __esm({
|
|
|
21355
20951
|
style: { top: title ? 30 : 0 },
|
|
21356
20952
|
children: [
|
|
21357
20953
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
21358
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20954
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React95__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
21359
20955
|
StateNode2,
|
|
21360
20956
|
{
|
|
21361
20957
|
state,
|
|
@@ -26912,8 +26508,8 @@ var init_Menu = __esm({
|
|
|
26912
26508
|
"bottom-end": "bottom-start"
|
|
26913
26509
|
};
|
|
26914
26510
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
26915
|
-
const triggerChild =
|
|
26916
|
-
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(
|
|
26917
26513
|
triggerChild,
|
|
26918
26514
|
{
|
|
26919
26515
|
ref: triggerRef,
|
|
@@ -27008,14 +26604,14 @@ function useDataDnd(args) {
|
|
|
27008
26604
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
27009
26605
|
const enabled = isZone || Boolean(dndRoot);
|
|
27010
26606
|
const eventBus = useEventBus();
|
|
27011
|
-
const parentRoot =
|
|
26607
|
+
const parentRoot = React95__default.useContext(RootCtx);
|
|
27012
26608
|
const isRoot = enabled && parentRoot === null;
|
|
27013
|
-
const zoneId =
|
|
26609
|
+
const zoneId = React95__default.useId();
|
|
27014
26610
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
27015
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
27016
|
-
const optimisticOrdersRef =
|
|
26611
|
+
const [optimisticOrders, setOptimisticOrders] = React95__default.useState(() => /* @__PURE__ */ new Map());
|
|
26612
|
+
const optimisticOrdersRef = React95__default.useRef(optimisticOrders);
|
|
27017
26613
|
optimisticOrdersRef.current = optimisticOrders;
|
|
27018
|
-
const clearOptimisticOrder =
|
|
26614
|
+
const clearOptimisticOrder = React95__default.useCallback((group) => {
|
|
27019
26615
|
setOptimisticOrders((prev) => {
|
|
27020
26616
|
if (!prev.has(group)) return prev;
|
|
27021
26617
|
const next = new Map(prev);
|
|
@@ -27040,7 +26636,7 @@ function useDataDnd(args) {
|
|
|
27040
26636
|
const raw = it[dndItemIdField];
|
|
27041
26637
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
27042
26638
|
}).join("|");
|
|
27043
|
-
const itemIds =
|
|
26639
|
+
const itemIds = React95__default.useMemo(
|
|
27044
26640
|
() => orderedItems.map((it, idx) => {
|
|
27045
26641
|
const raw = it[dndItemIdField];
|
|
27046
26642
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -27051,7 +26647,7 @@ function useDataDnd(args) {
|
|
|
27051
26647
|
const raw = it[dndItemIdField];
|
|
27052
26648
|
return raw != null ? String(raw) : `__${idx}`;
|
|
27053
26649
|
}).join("|");
|
|
27054
|
-
|
|
26650
|
+
React95__default.useEffect(() => {
|
|
27055
26651
|
const root = isRoot ? null : parentRoot;
|
|
27056
26652
|
if (root) {
|
|
27057
26653
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -27059,20 +26655,20 @@ function useDataDnd(args) {
|
|
|
27059
26655
|
clearOptimisticOrder(ownGroup);
|
|
27060
26656
|
}
|
|
27061
26657
|
}, [itemsContentSig, ownGroup]);
|
|
27062
|
-
const zonesRef =
|
|
27063
|
-
const registerZone =
|
|
26658
|
+
const zonesRef = React95__default.useRef(/* @__PURE__ */ new Map());
|
|
26659
|
+
const registerZone = React95__default.useCallback((zoneId2, meta2) => {
|
|
27064
26660
|
zonesRef.current.set(zoneId2, meta2);
|
|
27065
26661
|
}, []);
|
|
27066
|
-
const unregisterZone =
|
|
26662
|
+
const unregisterZone = React95__default.useCallback((zoneId2) => {
|
|
27067
26663
|
zonesRef.current.delete(zoneId2);
|
|
27068
26664
|
}, []);
|
|
27069
|
-
const [activeDrag, setActiveDrag] =
|
|
27070
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
27071
|
-
const meta =
|
|
26665
|
+
const [activeDrag, setActiveDrag] = React95__default.useState(null);
|
|
26666
|
+
const [overZoneGroup, setOverZoneGroup] = React95__default.useState(null);
|
|
26667
|
+
const meta = React95__default.useMemo(
|
|
27072
26668
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
27073
26669
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
27074
26670
|
);
|
|
27075
|
-
|
|
26671
|
+
React95__default.useEffect(() => {
|
|
27076
26672
|
const target = isRoot ? null : parentRoot;
|
|
27077
26673
|
if (!target) {
|
|
27078
26674
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -27091,7 +26687,7 @@ function useDataDnd(args) {
|
|
|
27091
26687
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
27092
26688
|
const sensors = useAlmadarDndSensors(true);
|
|
27093
26689
|
const collisionDetection = almadarDndCollisionDetection;
|
|
27094
|
-
const findZoneByItem =
|
|
26690
|
+
const findZoneByItem = React95__default.useCallback(
|
|
27095
26691
|
(id) => {
|
|
27096
26692
|
for (const z of zonesRef.current.values()) {
|
|
27097
26693
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -27100,7 +26696,7 @@ function useDataDnd(args) {
|
|
|
27100
26696
|
},
|
|
27101
26697
|
[]
|
|
27102
26698
|
);
|
|
27103
|
-
|
|
26699
|
+
React95__default.useCallback(
|
|
27104
26700
|
(group) => {
|
|
27105
26701
|
for (const z of zonesRef.current.values()) {
|
|
27106
26702
|
if (z.group === group) return z;
|
|
@@ -27109,7 +26705,7 @@ function useDataDnd(args) {
|
|
|
27109
26705
|
},
|
|
27110
26706
|
[]
|
|
27111
26707
|
);
|
|
27112
|
-
const handleDragEnd =
|
|
26708
|
+
const handleDragEnd = React95__default.useCallback(
|
|
27113
26709
|
(event) => {
|
|
27114
26710
|
const { active, over } = event;
|
|
27115
26711
|
const activeIdStr = String(active.id);
|
|
@@ -27200,8 +26796,8 @@ function useDataDnd(args) {
|
|
|
27200
26796
|
},
|
|
27201
26797
|
[eventBus]
|
|
27202
26798
|
);
|
|
27203
|
-
const sortableData =
|
|
27204
|
-
const SortableItem =
|
|
26799
|
+
const sortableData = React95__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
26800
|
+
const SortableItem = React95__default.useCallback(
|
|
27205
26801
|
({ id, children }) => {
|
|
27206
26802
|
const {
|
|
27207
26803
|
attributes,
|
|
@@ -27241,7 +26837,7 @@ function useDataDnd(args) {
|
|
|
27241
26837
|
id: droppableId,
|
|
27242
26838
|
data: sortableData
|
|
27243
26839
|
});
|
|
27244
|
-
const ctx =
|
|
26840
|
+
const ctx = React95__default.useContext(RootCtx);
|
|
27245
26841
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
27246
26842
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
27247
26843
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -27256,7 +26852,7 @@ function useDataDnd(args) {
|
|
|
27256
26852
|
showForeignPlaceholder,
|
|
27257
26853
|
ctxAvailable: ctx != null
|
|
27258
26854
|
});
|
|
27259
|
-
|
|
26855
|
+
React95__default.useEffect(() => {
|
|
27260
26856
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
27261
26857
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
27262
26858
|
return /* @__PURE__ */ jsx(
|
|
@@ -27270,11 +26866,11 @@ function useDataDnd(args) {
|
|
|
27270
26866
|
}
|
|
27271
26867
|
);
|
|
27272
26868
|
};
|
|
27273
|
-
const rootContextValue =
|
|
26869
|
+
const rootContextValue = React95__default.useMemo(
|
|
27274
26870
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
27275
26871
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
27276
26872
|
);
|
|
27277
|
-
const handleDragStart =
|
|
26873
|
+
const handleDragStart = React95__default.useCallback((event) => {
|
|
27278
26874
|
const sourceZone = findZoneByItem(event.active.id);
|
|
27279
26875
|
const rect = event.active.rect.current.initial;
|
|
27280
26876
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -27293,7 +26889,7 @@ function useDataDnd(args) {
|
|
|
27293
26889
|
isRoot
|
|
27294
26890
|
});
|
|
27295
26891
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
27296
|
-
const handleDragOver =
|
|
26892
|
+
const handleDragOver = React95__default.useCallback((event) => {
|
|
27297
26893
|
const { active, over } = event;
|
|
27298
26894
|
const overData = over?.data?.current;
|
|
27299
26895
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -27363,7 +26959,7 @@ function useDataDnd(args) {
|
|
|
27363
26959
|
return next;
|
|
27364
26960
|
});
|
|
27365
26961
|
}, []);
|
|
27366
|
-
const handleDragCancel =
|
|
26962
|
+
const handleDragCancel = React95__default.useCallback((event) => {
|
|
27367
26963
|
setActiveDrag(null);
|
|
27368
26964
|
setOverZoneGroup(null);
|
|
27369
26965
|
dndLog.warn("dragCancel", {
|
|
@@ -27371,12 +26967,12 @@ function useDataDnd(args) {
|
|
|
27371
26967
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
27372
26968
|
});
|
|
27373
26969
|
}, []);
|
|
27374
|
-
const handleDragEndWithCleanup =
|
|
26970
|
+
const handleDragEndWithCleanup = React95__default.useCallback((event) => {
|
|
27375
26971
|
handleDragEnd(event);
|
|
27376
26972
|
setActiveDrag(null);
|
|
27377
26973
|
setOverZoneGroup(null);
|
|
27378
26974
|
}, [handleDragEnd]);
|
|
27379
|
-
const wrapContainer =
|
|
26975
|
+
const wrapContainer = React95__default.useCallback(
|
|
27380
26976
|
(children) => {
|
|
27381
26977
|
if (!enabled) return children;
|
|
27382
26978
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -27430,7 +27026,7 @@ var init_useDataDnd = __esm({
|
|
|
27430
27026
|
init_useAlmadarDndCollision();
|
|
27431
27027
|
init_Box();
|
|
27432
27028
|
dndLog = createLogger("almadar:ui:dnd");
|
|
27433
|
-
RootCtx =
|
|
27029
|
+
RootCtx = React95__default.createContext(null);
|
|
27434
27030
|
}
|
|
27435
27031
|
});
|
|
27436
27032
|
function renderIconInput(icon, props) {
|
|
@@ -27956,7 +27552,7 @@ function DataList({
|
|
|
27956
27552
|
}) {
|
|
27957
27553
|
const eventBus = useEventBus();
|
|
27958
27554
|
const { t } = useTranslate();
|
|
27959
|
-
const [visibleCount, setVisibleCount] =
|
|
27555
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize || Infinity);
|
|
27960
27556
|
const fieldDefs = fields ?? columns ?? [];
|
|
27961
27557
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
27962
27558
|
const dnd = useDataDnd({
|
|
@@ -27975,7 +27571,7 @@ function DataList({
|
|
|
27975
27571
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
27976
27572
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
27977
27573
|
const hasRenderProp = typeof children === "function";
|
|
27978
|
-
|
|
27574
|
+
React95__default.useEffect(() => {
|
|
27979
27575
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
27980
27576
|
const childrenTypeOf = typeof children;
|
|
27981
27577
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -28079,7 +27675,7 @@ function DataList({
|
|
|
28079
27675
|
const items2 = [...data];
|
|
28080
27676
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
28081
27677
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
28082
|
-
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: [
|
|
28083
27679
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
28084
27680
|
group.items.map((itemData, index) => {
|
|
28085
27681
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -28220,7 +27816,7 @@ function DataList({
|
|
|
28220
27816
|
className
|
|
28221
27817
|
),
|
|
28222
27818
|
children: [
|
|
28223
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
27819
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
28224
27820
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
28225
27821
|
group.items.map(
|
|
28226
27822
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -28305,7 +27901,7 @@ var init_FormSection = __esm({
|
|
|
28305
27901
|
columns = 1,
|
|
28306
27902
|
className
|
|
28307
27903
|
}) => {
|
|
28308
|
-
const [collapsed, setCollapsed] =
|
|
27904
|
+
const [collapsed, setCollapsed] = React95__default.useState(defaultCollapsed);
|
|
28309
27905
|
const { t } = useTranslate();
|
|
28310
27906
|
const eventBus = useEventBus();
|
|
28311
27907
|
const gridClass = {
|
|
@@ -28313,7 +27909,7 @@ var init_FormSection = __esm({
|
|
|
28313
27909
|
2: "grid-cols-1 md:grid-cols-2",
|
|
28314
27910
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
28315
27911
|
}[columns];
|
|
28316
|
-
|
|
27912
|
+
React95__default.useCallback(() => {
|
|
28317
27913
|
if (collapsible) {
|
|
28318
27914
|
setCollapsed((prev) => !prev);
|
|
28319
27915
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -29199,7 +28795,7 @@ var init_Flex = __esm({
|
|
|
29199
28795
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
29200
28796
|
}
|
|
29201
28797
|
}
|
|
29202
|
-
return
|
|
28798
|
+
return React95__default.createElement(Component, {
|
|
29203
28799
|
className: cn(
|
|
29204
28800
|
inline ? "inline-flex" : "flex",
|
|
29205
28801
|
directionStyles[direction],
|
|
@@ -29318,7 +28914,7 @@ var init_Grid = __esm({
|
|
|
29318
28914
|
as: Component = "div"
|
|
29319
28915
|
}) => {
|
|
29320
28916
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
29321
|
-
return
|
|
28917
|
+
return React95__default.createElement(
|
|
29322
28918
|
Component,
|
|
29323
28919
|
{
|
|
29324
28920
|
className: cn(
|
|
@@ -29514,9 +29110,9 @@ var init_Popover = __esm({
|
|
|
29514
29110
|
onMouseLeave: handleClose,
|
|
29515
29111
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
29516
29112
|
};
|
|
29517
|
-
const childElement =
|
|
29113
|
+
const childElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
29518
29114
|
const childPointerDown = childElement.props.onPointerDown;
|
|
29519
|
-
const triggerElement =
|
|
29115
|
+
const triggerElement = React95__default.cloneElement(
|
|
29520
29116
|
childElement,
|
|
29521
29117
|
{
|
|
29522
29118
|
ref: triggerRef,
|
|
@@ -30118,9 +29714,9 @@ var init_Tooltip = __esm({
|
|
|
30118
29714
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
30119
29715
|
};
|
|
30120
29716
|
}, []);
|
|
30121
|
-
const triggerElement =
|
|
29717
|
+
const triggerElement = React95__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
30122
29718
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
30123
|
-
const trigger =
|
|
29719
|
+
const trigger = React95__default.cloneElement(triggerElement, {
|
|
30124
29720
|
ref: triggerRef,
|
|
30125
29721
|
onMouseEnter: handleMouseEnter,
|
|
30126
29722
|
onMouseLeave: handleMouseLeave,
|
|
@@ -30210,7 +29806,7 @@ var init_WizardProgress = __esm({
|
|
|
30210
29806
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
30211
29807
|
const isActive = index === currentStep;
|
|
30212
29808
|
const isCompleted = index < currentStep;
|
|
30213
|
-
return /* @__PURE__ */ jsxs(
|
|
29809
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
30214
29810
|
/* @__PURE__ */ jsx(
|
|
30215
29811
|
"button",
|
|
30216
29812
|
{
|
|
@@ -31770,13 +31366,13 @@ var init_MapView = __esm({
|
|
|
31770
31366
|
shadowSize: [41, 41]
|
|
31771
31367
|
});
|
|
31772
31368
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
31773
|
-
const { useEffect:
|
|
31369
|
+
const { useEffect: useEffect68, useRef: useRef67, useCallback: useCallback101, useState: useState99 } = React95__default;
|
|
31774
31370
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
31775
31371
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
31776
31372
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
31777
31373
|
const map = useMap();
|
|
31778
|
-
const prevRef =
|
|
31779
|
-
|
|
31374
|
+
const prevRef = useRef67({ centerLat, centerLng, zoom });
|
|
31375
|
+
useEffect68(() => {
|
|
31780
31376
|
const prev = prevRef.current;
|
|
31781
31377
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
31782
31378
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -31787,7 +31383,7 @@ var init_MapView = __esm({
|
|
|
31787
31383
|
}
|
|
31788
31384
|
function MapClickHandler({ onMapClick }) {
|
|
31789
31385
|
const map = useMap();
|
|
31790
|
-
|
|
31386
|
+
useEffect68(() => {
|
|
31791
31387
|
if (!onMapClick) return;
|
|
31792
31388
|
const handler = (e) => {
|
|
31793
31389
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -31815,8 +31411,8 @@ var init_MapView = __esm({
|
|
|
31815
31411
|
showAttribution = true
|
|
31816
31412
|
}) {
|
|
31817
31413
|
const eventBus = useEventBus2();
|
|
31818
|
-
const [clickedPosition, setClickedPosition] =
|
|
31819
|
-
const handleMapClick =
|
|
31414
|
+
const [clickedPosition, setClickedPosition] = useState99(null);
|
|
31415
|
+
const handleMapClick = useCallback101((lat, lng) => {
|
|
31820
31416
|
if (showClickedPin) {
|
|
31821
31417
|
setClickedPosition({ lat, lng });
|
|
31822
31418
|
}
|
|
@@ -31825,7 +31421,7 @@ var init_MapView = __esm({
|
|
|
31825
31421
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
31826
31422
|
}
|
|
31827
31423
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
31828
|
-
const handleMarkerClick =
|
|
31424
|
+
const handleMarkerClick = useCallback101((marker) => {
|
|
31829
31425
|
onMarkerClick?.(marker);
|
|
31830
31426
|
if (markerClickEvent) {
|
|
31831
31427
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -32685,8 +32281,8 @@ function TableView({
|
|
|
32685
32281
|
}) {
|
|
32686
32282
|
const eventBus = useEventBus();
|
|
32687
32283
|
const { t } = useTranslate();
|
|
32688
|
-
const [visibleCount, setVisibleCount] =
|
|
32689
|
-
const [localSelected, setLocalSelected] =
|
|
32284
|
+
const [visibleCount, setVisibleCount] = React95__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
32285
|
+
const [localSelected, setLocalSelected] = React95__default.useState(/* @__PURE__ */ new Set());
|
|
32690
32286
|
const colDefs = columns ?? fields ?? [];
|
|
32691
32287
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32692
32288
|
const dnd = useDataDnd({
|
|
@@ -32881,12 +32477,12 @@ function TableView({
|
|
|
32881
32477
|
]
|
|
32882
32478
|
}
|
|
32883
32479
|
);
|
|
32884
|
-
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);
|
|
32885
32481
|
};
|
|
32886
32482
|
const items = Array.from(data);
|
|
32887
32483
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
32888
32484
|
let runningIndex = 0;
|
|
32889
|
-
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: [
|
|
32890
32486
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
32891
32487
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
32892
32488
|
] }, gi)) });
|
|
@@ -34105,7 +33701,7 @@ var init_StepFlow = __esm({
|
|
|
34105
33701
|
className
|
|
34106
33702
|
}) => {
|
|
34107
33703
|
if (orientation === "vertical") {
|
|
34108
|
-
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: [
|
|
34109
33705
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
34110
33706
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34111
33707
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -34116,7 +33712,7 @@ var init_StepFlow = __esm({
|
|
|
34116
33712
|
] })
|
|
34117
33713
|
] }) }, index)) });
|
|
34118
33714
|
}
|
|
34119
|
-
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: [
|
|
34120
33716
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
34121
33717
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
34122
33718
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -35101,7 +34697,7 @@ var init_LikertScale = __esm({
|
|
|
35101
34697
|
md: "text-base",
|
|
35102
34698
|
lg: "text-lg"
|
|
35103
34699
|
};
|
|
35104
|
-
LikertScale =
|
|
34700
|
+
LikertScale = React95__default.forwardRef(
|
|
35105
34701
|
({
|
|
35106
34702
|
question,
|
|
35107
34703
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -35113,7 +34709,7 @@ var init_LikertScale = __esm({
|
|
|
35113
34709
|
variant = "radios",
|
|
35114
34710
|
className
|
|
35115
34711
|
}, ref) => {
|
|
35116
|
-
const groupId =
|
|
34712
|
+
const groupId = React95__default.useId();
|
|
35117
34713
|
const eventBus = useEventBus();
|
|
35118
34714
|
const handleSelect = useCallback(
|
|
35119
34715
|
(next) => {
|
|
@@ -37395,7 +36991,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
37395
36991
|
"aria-label": t("aria.breadcrumb"),
|
|
37396
36992
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
37397
36993
|
const isLast = idx === items.length - 1;
|
|
37398
|
-
return /* @__PURE__ */ jsxs(
|
|
36994
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
37399
36995
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
37400
36996
|
Icon,
|
|
37401
36997
|
{
|
|
@@ -38264,7 +37860,7 @@ var init_MiniStateMachine = __esm({
|
|
|
38264
37860
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
38265
37861
|
const tc = transitionCounts[s.name] ?? 0;
|
|
38266
37862
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
38267
|
-
return /* @__PURE__ */ jsxs(
|
|
37863
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
38268
37864
|
/* @__PURE__ */ jsx(
|
|
38269
37865
|
AvlState,
|
|
38270
37866
|
{
|
|
@@ -38468,7 +38064,7 @@ var init_PageHeader = __esm({
|
|
|
38468
38064
|
info: "bg-info/10 text-info"
|
|
38469
38065
|
};
|
|
38470
38066
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
38471
|
-
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: [
|
|
38472
38068
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
38473
38069
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
38474
38070
|
"a",
|
|
@@ -38826,7 +38422,7 @@ var init_Section = __esm({
|
|
|
38826
38422
|
as: Component = "section"
|
|
38827
38423
|
}) => {
|
|
38828
38424
|
const hasHeader = title || description || action;
|
|
38829
|
-
return
|
|
38425
|
+
return React95__default.createElement(
|
|
38830
38426
|
Component,
|
|
38831
38427
|
{
|
|
38832
38428
|
className: cn(
|
|
@@ -39200,7 +38796,7 @@ var init_WizardContainer = __esm({
|
|
|
39200
38796
|
const isCompleted = index < currentStep;
|
|
39201
38797
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
39202
38798
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
39203
|
-
return /* @__PURE__ */ jsxs(
|
|
38799
|
+
return /* @__PURE__ */ jsxs(React95__default.Fragment, { children: [
|
|
39204
38800
|
/* @__PURE__ */ jsx(
|
|
39205
38801
|
Button,
|
|
39206
38802
|
{
|
|
@@ -41633,7 +41229,7 @@ var init_DetailPanel = __esm({
|
|
|
41633
41229
|
}
|
|
41634
41230
|
});
|
|
41635
41231
|
function extractTitle(children) {
|
|
41636
|
-
if (!
|
|
41232
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
41637
41233
|
const props = children.props;
|
|
41638
41234
|
if (typeof props.title === "string") {
|
|
41639
41235
|
return props.title;
|
|
@@ -41983,12 +41579,12 @@ var init_Form = __esm({
|
|
|
41983
41579
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
41984
41580
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
41985
41581
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
41986
|
-
const normalizedInitialData =
|
|
41582
|
+
const normalizedInitialData = React95__default.useMemo(() => {
|
|
41987
41583
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
41988
41584
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
41989
41585
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
41990
41586
|
}, [entity, initialData]);
|
|
41991
|
-
const entityDerivedFields =
|
|
41587
|
+
const entityDerivedFields = React95__default.useMemo(() => {
|
|
41992
41588
|
if (fields && fields.length > 0) return void 0;
|
|
41993
41589
|
if (!resolvedEntity) return void 0;
|
|
41994
41590
|
return resolvedEntity.fields.map(
|
|
@@ -42009,16 +41605,16 @@ var init_Form = __esm({
|
|
|
42009
41605
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
42010
41606
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
42011
41607
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
42012
|
-
const [formData, setFormData] =
|
|
41608
|
+
const [formData, setFormData] = React95__default.useState(
|
|
42013
41609
|
normalizedInitialData
|
|
42014
41610
|
);
|
|
42015
|
-
const [collapsedSections, setCollapsedSections] =
|
|
41611
|
+
const [collapsedSections, setCollapsedSections] = React95__default.useState(
|
|
42016
41612
|
/* @__PURE__ */ new Set()
|
|
42017
41613
|
);
|
|
42018
|
-
const [submitError, setSubmitError] =
|
|
42019
|
-
const formRef =
|
|
41614
|
+
const [submitError, setSubmitError] = React95__default.useState(null);
|
|
41615
|
+
const formRef = React95__default.useRef(null);
|
|
42020
41616
|
const formMode = props.mode;
|
|
42021
|
-
const mountedRef =
|
|
41617
|
+
const mountedRef = React95__default.useRef(false);
|
|
42022
41618
|
if (!mountedRef.current) {
|
|
42023
41619
|
mountedRef.current = true;
|
|
42024
41620
|
debug("forms", "mount", {
|
|
@@ -42031,7 +41627,7 @@ var init_Form = __esm({
|
|
|
42031
41627
|
});
|
|
42032
41628
|
}
|
|
42033
41629
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
42034
|
-
const evalContext =
|
|
41630
|
+
const evalContext = React95__default.useMemo(
|
|
42035
41631
|
() => ({
|
|
42036
41632
|
formValues: formData,
|
|
42037
41633
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -42040,7 +41636,7 @@ var init_Form = __esm({
|
|
|
42040
41636
|
}),
|
|
42041
41637
|
[formData, externalContext]
|
|
42042
41638
|
);
|
|
42043
|
-
|
|
41639
|
+
React95__default.useEffect(() => {
|
|
42044
41640
|
debug("forms", "initialData-sync", {
|
|
42045
41641
|
mode: formMode,
|
|
42046
41642
|
normalizedInitialData,
|
|
@@ -42051,7 +41647,7 @@ var init_Form = __esm({
|
|
|
42051
41647
|
setFormData(normalizedInitialData);
|
|
42052
41648
|
}
|
|
42053
41649
|
}, [normalizedInitialData]);
|
|
42054
|
-
const processCalculations =
|
|
41650
|
+
const processCalculations = React95__default.useCallback(
|
|
42055
41651
|
(changedFieldId, newFormData) => {
|
|
42056
41652
|
if (!hiddenCalculations.length) return;
|
|
42057
41653
|
const context = {
|
|
@@ -42076,7 +41672,7 @@ var init_Form = __esm({
|
|
|
42076
41672
|
},
|
|
42077
41673
|
[hiddenCalculations, externalContext, eventBus]
|
|
42078
41674
|
);
|
|
42079
|
-
const checkViolations =
|
|
41675
|
+
const checkViolations = React95__default.useCallback(
|
|
42080
41676
|
(changedFieldId, newFormData) => {
|
|
42081
41677
|
if (!violationTriggers.length) return;
|
|
42082
41678
|
const context = {
|
|
@@ -42114,7 +41710,7 @@ var init_Form = __esm({
|
|
|
42114
41710
|
processCalculations(name, newFormData);
|
|
42115
41711
|
checkViolations(name, newFormData);
|
|
42116
41712
|
};
|
|
42117
|
-
const isFieldVisible =
|
|
41713
|
+
const isFieldVisible = React95__default.useCallback(
|
|
42118
41714
|
(fieldName) => {
|
|
42119
41715
|
const condition = conditionalFields[fieldName];
|
|
42120
41716
|
if (!condition) return true;
|
|
@@ -42122,7 +41718,7 @@ var init_Form = __esm({
|
|
|
42122
41718
|
},
|
|
42123
41719
|
[conditionalFields, evalContext]
|
|
42124
41720
|
);
|
|
42125
|
-
const isSectionVisible =
|
|
41721
|
+
const isSectionVisible = React95__default.useCallback(
|
|
42126
41722
|
(section) => {
|
|
42127
41723
|
if (!section.condition) return true;
|
|
42128
41724
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -42198,7 +41794,7 @@ var init_Form = __esm({
|
|
|
42198
41794
|
eventBus.emit(`UI:${onCancel}`);
|
|
42199
41795
|
}
|
|
42200
41796
|
};
|
|
42201
|
-
const renderField =
|
|
41797
|
+
const renderField = React95__default.useCallback(
|
|
42202
41798
|
(field) => {
|
|
42203
41799
|
const fieldName = field.name || field.field;
|
|
42204
41800
|
if (!fieldName) return null;
|
|
@@ -42219,7 +41815,7 @@ var init_Form = __esm({
|
|
|
42219
41815
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
42220
41816
|
);
|
|
42221
41817
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
42222
|
-
const normalizedFields =
|
|
41818
|
+
const normalizedFields = React95__default.useMemo(() => {
|
|
42223
41819
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
42224
41820
|
return effectiveFields.map((field) => {
|
|
42225
41821
|
if (typeof field === "string") {
|
|
@@ -42243,7 +41839,7 @@ var init_Form = __esm({
|
|
|
42243
41839
|
return field;
|
|
42244
41840
|
});
|
|
42245
41841
|
}, [effectiveFields, resolvedEntity]);
|
|
42246
|
-
const schemaFields =
|
|
41842
|
+
const schemaFields = React95__default.useMemo(() => {
|
|
42247
41843
|
if (normalizedFields.length === 0) return null;
|
|
42248
41844
|
if (isDebugEnabled()) {
|
|
42249
41845
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -42253,7 +41849,7 @@ var init_Form = __esm({
|
|
|
42253
41849
|
}
|
|
42254
41850
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
42255
41851
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
42256
|
-
const sectionElements =
|
|
41852
|
+
const sectionElements = React95__default.useMemo(() => {
|
|
42257
41853
|
if (!sections || sections.length === 0) return null;
|
|
42258
41854
|
return sections.map((section) => {
|
|
42259
41855
|
if (!isSectionVisible(section)) {
|
|
@@ -42978,7 +42574,7 @@ var init_List = __esm({
|
|
|
42978
42574
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
42979
42575
|
return [];
|
|
42980
42576
|
}, [entity]);
|
|
42981
|
-
const getItemActions =
|
|
42577
|
+
const getItemActions = React95__default.useCallback(
|
|
42982
42578
|
(item) => {
|
|
42983
42579
|
if (!itemActions) return [];
|
|
42984
42580
|
if (typeof itemActions === "function") {
|
|
@@ -43453,7 +43049,7 @@ var init_MediaGallery = __esm({
|
|
|
43453
43049
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
43454
43050
|
);
|
|
43455
43051
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
43456
|
-
const items =
|
|
43052
|
+
const items = React95__default.useMemo(() => {
|
|
43457
43053
|
if (propItems) return propItems;
|
|
43458
43054
|
if (entityData.length === 0) return [];
|
|
43459
43055
|
return entityData.map((record, idx) => {
|
|
@@ -43616,7 +43212,7 @@ var init_MediaGallery = __esm({
|
|
|
43616
43212
|
}
|
|
43617
43213
|
});
|
|
43618
43214
|
function extractTitle2(children) {
|
|
43619
|
-
if (!
|
|
43215
|
+
if (!React95__default.isValidElement(children)) return void 0;
|
|
43620
43216
|
const props = children.props;
|
|
43621
43217
|
if (typeof props.title === "string") {
|
|
43622
43218
|
return props.title;
|
|
@@ -43890,7 +43486,7 @@ var init_debugRegistry = __esm({
|
|
|
43890
43486
|
}
|
|
43891
43487
|
});
|
|
43892
43488
|
function useDebugData() {
|
|
43893
|
-
const [data, setData] =
|
|
43489
|
+
const [data, setData] = React95.useState(() => ({
|
|
43894
43490
|
traits: [],
|
|
43895
43491
|
ticks: [],
|
|
43896
43492
|
guards: [],
|
|
@@ -43904,7 +43500,7 @@ function useDebugData() {
|
|
|
43904
43500
|
},
|
|
43905
43501
|
lastUpdate: Date.now()
|
|
43906
43502
|
}));
|
|
43907
|
-
|
|
43503
|
+
React95.useEffect(() => {
|
|
43908
43504
|
const updateData = () => {
|
|
43909
43505
|
setData({
|
|
43910
43506
|
traits: getAllTraits(),
|
|
@@ -44013,12 +43609,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
44013
43609
|
return positions;
|
|
44014
43610
|
}
|
|
44015
43611
|
function WalkMinimap() {
|
|
44016
|
-
const [walkStep, setWalkStep] =
|
|
44017
|
-
const [traits2, setTraits] =
|
|
44018
|
-
const [coveredEdges, setCoveredEdges] =
|
|
44019
|
-
const [completedTraits, setCompletedTraits] =
|
|
44020
|
-
const prevTraitRef =
|
|
44021
|
-
|
|
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(() => {
|
|
44022
43618
|
const interval = setInterval(() => {
|
|
44023
43619
|
const w = window;
|
|
44024
43620
|
const step = w.__orbitalWalkStep;
|
|
@@ -44454,15 +44050,15 @@ var init_EntitiesTab = __esm({
|
|
|
44454
44050
|
});
|
|
44455
44051
|
function EventFlowTab({ events: events2 }) {
|
|
44456
44052
|
const { t } = useTranslate();
|
|
44457
|
-
const [filter, setFilter] =
|
|
44458
|
-
const containerRef =
|
|
44459
|
-
const [autoScroll, setAutoScroll] =
|
|
44460
|
-
|
|
44053
|
+
const [filter, setFilter] = React95.useState("all");
|
|
44054
|
+
const containerRef = React95.useRef(null);
|
|
44055
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
44056
|
+
React95.useEffect(() => {
|
|
44461
44057
|
if (autoScroll && containerRef.current) {
|
|
44462
44058
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44463
44059
|
}
|
|
44464
44060
|
}, [events2.length, autoScroll]);
|
|
44465
|
-
const filteredEvents =
|
|
44061
|
+
const filteredEvents = React95.useMemo(() => {
|
|
44466
44062
|
if (filter === "all") return events2;
|
|
44467
44063
|
return events2.filter((e) => e.type === filter);
|
|
44468
44064
|
}, [events2, filter]);
|
|
@@ -44578,7 +44174,7 @@ var init_EventFlowTab = __esm({
|
|
|
44578
44174
|
});
|
|
44579
44175
|
function GuardsPanel({ guards }) {
|
|
44580
44176
|
const { t } = useTranslate();
|
|
44581
|
-
const [filter, setFilter] =
|
|
44177
|
+
const [filter, setFilter] = React95.useState("all");
|
|
44582
44178
|
if (guards.length === 0) {
|
|
44583
44179
|
return /* @__PURE__ */ jsx(
|
|
44584
44180
|
EmptyState,
|
|
@@ -44591,7 +44187,7 @@ function GuardsPanel({ guards }) {
|
|
|
44591
44187
|
}
|
|
44592
44188
|
const passedCount = guards.filter((g) => g.result).length;
|
|
44593
44189
|
const failedCount = guards.length - passedCount;
|
|
44594
|
-
const filteredGuards =
|
|
44190
|
+
const filteredGuards = React95.useMemo(() => {
|
|
44595
44191
|
if (filter === "all") return guards;
|
|
44596
44192
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
44597
44193
|
return guards.filter((g) => !g.result);
|
|
@@ -44754,10 +44350,10 @@ function EffectBadge({ effect }) {
|
|
|
44754
44350
|
}
|
|
44755
44351
|
function TransitionTimeline({ transitions }) {
|
|
44756
44352
|
const { t } = useTranslate();
|
|
44757
|
-
const containerRef =
|
|
44758
|
-
const [autoScroll, setAutoScroll] =
|
|
44759
|
-
const [expandedId, setExpandedId] =
|
|
44760
|
-
|
|
44353
|
+
const containerRef = React95.useRef(null);
|
|
44354
|
+
const [autoScroll, setAutoScroll] = React95.useState(true);
|
|
44355
|
+
const [expandedId, setExpandedId] = React95.useState(null);
|
|
44356
|
+
React95.useEffect(() => {
|
|
44761
44357
|
if (autoScroll && containerRef.current) {
|
|
44762
44358
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
44763
44359
|
}
|
|
@@ -45037,9 +44633,9 @@ function getAllEvents(traits2) {
|
|
|
45037
44633
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
45038
44634
|
const eventBus = useEventBus();
|
|
45039
44635
|
const { t } = useTranslate();
|
|
45040
|
-
const [log9, setLog] =
|
|
45041
|
-
const prevStatesRef =
|
|
45042
|
-
|
|
44636
|
+
const [log9, setLog] = React95.useState([]);
|
|
44637
|
+
const prevStatesRef = React95.useRef(/* @__PURE__ */ new Map());
|
|
44638
|
+
React95.useEffect(() => {
|
|
45043
44639
|
for (const trait of traits2) {
|
|
45044
44640
|
const prev = prevStatesRef.current.get(trait.id);
|
|
45045
44641
|
if (prev && prev !== trait.currentState) {
|
|
@@ -45208,10 +44804,10 @@ function VerifyModePanel({
|
|
|
45208
44804
|
localCount
|
|
45209
44805
|
}) {
|
|
45210
44806
|
const { t } = useTranslate();
|
|
45211
|
-
const [expanded, setExpanded] =
|
|
45212
|
-
const scrollRef =
|
|
45213
|
-
const prevCountRef =
|
|
45214
|
-
|
|
44807
|
+
const [expanded, setExpanded] = React95.useState(true);
|
|
44808
|
+
const scrollRef = React95.useRef(null);
|
|
44809
|
+
const prevCountRef = React95.useRef(0);
|
|
44810
|
+
React95.useEffect(() => {
|
|
45215
44811
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
45216
44812
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
45217
44813
|
}
|
|
@@ -45268,10 +44864,10 @@ function RuntimeDebugger({
|
|
|
45268
44864
|
schema
|
|
45269
44865
|
}) {
|
|
45270
44866
|
const { t } = useTranslate();
|
|
45271
|
-
const [isCollapsed, setIsCollapsed] =
|
|
45272
|
-
const [isVisible, setIsVisible] =
|
|
44867
|
+
const [isCollapsed, setIsCollapsed] = React95.useState(mode === "verify" ? true : defaultCollapsed);
|
|
44868
|
+
const [isVisible, setIsVisible] = React95.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
45273
44869
|
const debugData = useDebugData();
|
|
45274
|
-
|
|
44870
|
+
React95.useEffect(() => {
|
|
45275
44871
|
if (mode === "inline") return;
|
|
45276
44872
|
return onDebugToggle((enabled) => {
|
|
45277
44873
|
setIsVisible(enabled);
|
|
@@ -45280,7 +44876,7 @@ function RuntimeDebugger({
|
|
|
45280
44876
|
}
|
|
45281
44877
|
});
|
|
45282
44878
|
}, [mode]);
|
|
45283
|
-
|
|
44879
|
+
React95.useEffect(() => {
|
|
45284
44880
|
if (mode === "inline") return;
|
|
45285
44881
|
const handleKeyDown = (e) => {
|
|
45286
44882
|
if (e.key === "`" && isVisible) {
|
|
@@ -45800,7 +45396,7 @@ var init_StatCard = __esm({
|
|
|
45800
45396
|
const labelToUse = propLabel ?? propTitle;
|
|
45801
45397
|
const eventBus = useEventBus();
|
|
45802
45398
|
const { t } = useTranslate();
|
|
45803
|
-
const handleActionClick =
|
|
45399
|
+
const handleActionClick = React95__default.useCallback(() => {
|
|
45804
45400
|
if (action?.event) {
|
|
45805
45401
|
eventBus.emit(`UI:${action.event}`, {});
|
|
45806
45402
|
}
|
|
@@ -45811,7 +45407,7 @@ var init_StatCard = __esm({
|
|
|
45811
45407
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
45812
45408
|
const isLoading = externalLoading ?? false;
|
|
45813
45409
|
const error = externalError;
|
|
45814
|
-
const computeMetricValue =
|
|
45410
|
+
const computeMetricValue = React95__default.useCallback(
|
|
45815
45411
|
(metric, items) => {
|
|
45816
45412
|
if (metric.value !== void 0) {
|
|
45817
45413
|
return metric.value;
|
|
@@ -45850,7 +45446,7 @@ var init_StatCard = __esm({
|
|
|
45850
45446
|
},
|
|
45851
45447
|
[]
|
|
45852
45448
|
);
|
|
45853
|
-
const schemaStats =
|
|
45449
|
+
const schemaStats = React95__default.useMemo(() => {
|
|
45854
45450
|
if (!metrics || metrics.length === 0) return null;
|
|
45855
45451
|
return metrics.map((metric) => ({
|
|
45856
45452
|
label: metric.label,
|
|
@@ -45858,7 +45454,7 @@ var init_StatCard = __esm({
|
|
|
45858
45454
|
format: metric.format
|
|
45859
45455
|
}));
|
|
45860
45456
|
}, [metrics, data, computeMetricValue]);
|
|
45861
|
-
const calculatedTrend =
|
|
45457
|
+
const calculatedTrend = React95__default.useMemo(() => {
|
|
45862
45458
|
if (manualTrend !== void 0) return manualTrend;
|
|
45863
45459
|
if (previousValue === void 0 || currentValue === void 0)
|
|
45864
45460
|
return void 0;
|
|
@@ -46498,8 +46094,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46498
46094
|
] });
|
|
46499
46095
|
};
|
|
46500
46096
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
46501
|
-
const endRef =
|
|
46502
|
-
|
|
46097
|
+
const endRef = React95__default.useRef(null);
|
|
46098
|
+
React95__default.useEffect(() => {
|
|
46503
46099
|
if (!autoScroll) return;
|
|
46504
46100
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46505
46101
|
}, [activities.length, autoScroll]);
|
|
@@ -46593,7 +46189,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
46593
46189
|
};
|
|
46594
46190
|
SubagentRichCard = ({ subagent }) => {
|
|
46595
46191
|
const { t } = useTranslate();
|
|
46596
|
-
const activities =
|
|
46192
|
+
const activities = React95__default.useMemo(
|
|
46597
46193
|
() => subagentMessagesToActivities(subagent.messages),
|
|
46598
46194
|
[subagent.messages]
|
|
46599
46195
|
);
|
|
@@ -46670,8 +46266,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
46670
46266
|
] });
|
|
46671
46267
|
};
|
|
46672
46268
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
46673
|
-
const endRef =
|
|
46674
|
-
|
|
46269
|
+
const endRef = React95__default.useRef(null);
|
|
46270
|
+
React95__default.useEffect(() => {
|
|
46675
46271
|
if (!autoScroll) return;
|
|
46676
46272
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
46677
46273
|
}, [messages.length, autoScroll]);
|
|
@@ -47101,7 +46697,7 @@ var init_Timeline = __esm({
|
|
|
47101
46697
|
}) => {
|
|
47102
46698
|
const { t } = useTranslate();
|
|
47103
46699
|
const entityData = entity ?? [];
|
|
47104
|
-
const items =
|
|
46700
|
+
const items = React95__default.useMemo(() => {
|
|
47105
46701
|
if (propItems) return propItems;
|
|
47106
46702
|
if (entityData.length === 0) return [];
|
|
47107
46703
|
return entityData.map((record, idx) => {
|
|
@@ -47203,7 +46799,7 @@ var init_Timeline = __esm({
|
|
|
47203
46799
|
}
|
|
47204
46800
|
});
|
|
47205
46801
|
function extractToastProps(children) {
|
|
47206
|
-
if (!
|
|
46802
|
+
if (!React95__default.isValidElement(children)) {
|
|
47207
46803
|
if (typeof children === "string") {
|
|
47208
46804
|
return { message: children };
|
|
47209
46805
|
}
|
|
@@ -47245,7 +46841,7 @@ var init_ToastSlot = __esm({
|
|
|
47245
46841
|
eventBus.emit(`${prefix}CLOSE`);
|
|
47246
46842
|
};
|
|
47247
46843
|
if (!isVisible) return null;
|
|
47248
|
-
const isCustomContent =
|
|
46844
|
+
const isCustomContent = React95__default.isValidElement(children) && !message;
|
|
47249
46845
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
47250
46846
|
Toast,
|
|
47251
46847
|
{
|
|
@@ -47262,7 +46858,7 @@ var init_ToastSlot = __esm({
|
|
|
47262
46858
|
}
|
|
47263
46859
|
});
|
|
47264
46860
|
function lazyThree(name, loader) {
|
|
47265
|
-
const Lazy =
|
|
46861
|
+
const Lazy = React95__default.lazy(
|
|
47266
46862
|
() => loader().then((m) => {
|
|
47267
46863
|
const Resolved = m[name];
|
|
47268
46864
|
if (!Resolved) {
|
|
@@ -47274,13 +46870,13 @@ function lazyThree(name, loader) {
|
|
|
47274
46870
|
})
|
|
47275
46871
|
);
|
|
47276
46872
|
function ThreeWrapper(props) {
|
|
47277
|
-
return
|
|
46873
|
+
return React95__default.createElement(
|
|
47278
46874
|
ThreeBoundary,
|
|
47279
46875
|
{ name },
|
|
47280
|
-
|
|
47281
|
-
|
|
46876
|
+
React95__default.createElement(
|
|
46877
|
+
React95__default.Suspense,
|
|
47282
46878
|
{ fallback: null },
|
|
47283
|
-
|
|
46879
|
+
React95__default.createElement(Lazy, props)
|
|
47284
46880
|
)
|
|
47285
46881
|
);
|
|
47286
46882
|
}
|
|
@@ -47322,7 +46918,6 @@ var init_component_registry_generated = __esm({
|
|
|
47322
46918
|
init_Canvas2D();
|
|
47323
46919
|
init_CanvasEffect();
|
|
47324
46920
|
init_Card();
|
|
47325
|
-
init_CardBattlerBoard();
|
|
47326
46921
|
init_CardGrid();
|
|
47327
46922
|
init_Carousel();
|
|
47328
46923
|
init_CaseStudyCard();
|
|
@@ -47553,13 +47148,12 @@ var init_component_registry_generated = __esm({
|
|
|
47553
47148
|
init_UploadDropZone();
|
|
47554
47149
|
init_VersionDiff();
|
|
47555
47150
|
init_ViolationAlert();
|
|
47556
|
-
init_VisualNovelBoard();
|
|
47557
47151
|
init_VoteStack();
|
|
47558
47152
|
init_WaypointMarker();
|
|
47559
47153
|
init_WizardContainer();
|
|
47560
47154
|
init_WizardNavigation();
|
|
47561
47155
|
init_WizardProgress();
|
|
47562
|
-
ThreeBoundary = class extends
|
|
47156
|
+
ThreeBoundary = class extends React95__default.Component {
|
|
47563
47157
|
constructor() {
|
|
47564
47158
|
super(...arguments);
|
|
47565
47159
|
__publicField(this, "state", { failed: false });
|
|
@@ -47569,7 +47163,7 @@ var init_component_registry_generated = __esm({
|
|
|
47569
47163
|
}
|
|
47570
47164
|
render() {
|
|
47571
47165
|
if (this.state.failed) {
|
|
47572
|
-
return
|
|
47166
|
+
return React95__default.createElement(
|
|
47573
47167
|
"div",
|
|
47574
47168
|
{
|
|
47575
47169
|
"data-testid": "three-unavailable",
|
|
@@ -47623,7 +47217,6 @@ var init_component_registry_generated = __esm({
|
|
|
47623
47217
|
"Canvas2D": Canvas2D,
|
|
47624
47218
|
"CanvasEffect": CanvasEffect,
|
|
47625
47219
|
"Card": Card,
|
|
47626
|
-
"CardBattlerBoard": CardBattlerBoard,
|
|
47627
47220
|
"CardGrid": CardGrid,
|
|
47628
47221
|
"Carousel": Carousel,
|
|
47629
47222
|
"CaseStudyCard": CaseStudyCard,
|
|
@@ -47868,7 +47461,6 @@ var init_component_registry_generated = __esm({
|
|
|
47868
47461
|
"VStack": VStack,
|
|
47869
47462
|
"VersionDiff": VersionDiff,
|
|
47870
47463
|
"ViolationAlert": ViolationAlert,
|
|
47871
|
-
"VisualNovelBoard": VisualNovelBoard,
|
|
47872
47464
|
"VoteStack": VoteStack,
|
|
47873
47465
|
"WaypointMarker": WaypointMarker,
|
|
47874
47466
|
"WizardContainer": WizardContainer,
|
|
@@ -47892,7 +47484,7 @@ function SuspenseConfigProvider({
|
|
|
47892
47484
|
config,
|
|
47893
47485
|
children
|
|
47894
47486
|
}) {
|
|
47895
|
-
return
|
|
47487
|
+
return React95__default.createElement(
|
|
47896
47488
|
SuspenseConfigContext.Provider,
|
|
47897
47489
|
{ value: config },
|
|
47898
47490
|
children
|
|
@@ -47934,7 +47526,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
47934
47526
|
}
|
|
47935
47527
|
return { name: field, label: field.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (c) => c.toUpperCase()) };
|
|
47936
47528
|
}
|
|
47937
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
47529
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React95__default.isValidElement(field) && !(field instanceof Date)) {
|
|
47938
47530
|
const obj = field;
|
|
47939
47531
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
47940
47532
|
if (!fieldName) return field;
|
|
@@ -48387,7 +47979,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
48387
47979
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
48388
47980
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
48389
47981
|
}
|
|
48390
|
-
return /* @__PURE__ */ jsx(
|
|
47982
|
+
return /* @__PURE__ */ jsx(React95__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
48391
47983
|
}
|
|
48392
47984
|
if (!child || typeof child !== "object") return null;
|
|
48393
47985
|
const childId = `${parentId}-${index}`;
|
|
@@ -48427,14 +48019,14 @@ function isPatternConfig(value) {
|
|
|
48427
48019
|
if (value === null || value === void 0) return false;
|
|
48428
48020
|
if (typeof value !== "object") return false;
|
|
48429
48021
|
if (Array.isArray(value)) return false;
|
|
48430
|
-
if (
|
|
48022
|
+
if (React95__default.isValidElement(value)) return false;
|
|
48431
48023
|
if (value instanceof Date) return false;
|
|
48432
48024
|
if (typeof value === "function") return false;
|
|
48433
48025
|
const record = value;
|
|
48434
48026
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
48435
48027
|
}
|
|
48436
48028
|
function isPlainConfigObject(value) {
|
|
48437
|
-
if (
|
|
48029
|
+
if (React95__default.isValidElement(value)) return false;
|
|
48438
48030
|
if (value instanceof Date) return false;
|
|
48439
48031
|
const proto = Object.getPrototypeOf(value);
|
|
48440
48032
|
return proto === Object.prototype || proto === null;
|
|
@@ -48560,7 +48152,7 @@ function SlotContentRenderer({
|
|
|
48560
48152
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
48561
48153
|
const slotVal = restProps[slotKey];
|
|
48562
48154
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
48563
|
-
if (
|
|
48155
|
+
if (React95__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
48564
48156
|
if (Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
48565
48157
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
48566
48158
|
slotVal,
|
|
@@ -48609,7 +48201,7 @@ function SlotContentRenderer({
|
|
|
48609
48201
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
48610
48202
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
48611
48203
|
const sample = resolvedItems[0];
|
|
48612
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
48204
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React95__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
48613
48205
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
48614
48206
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
48615
48207
|
}
|
|
@@ -48901,7 +48493,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
48901
48493
|
if (Array.isArray(body)) {
|
|
48902
48494
|
return body.map((b) => recur(b));
|
|
48903
48495
|
}
|
|
48904
|
-
if (body !== null && typeof body === "object" && !
|
|
48496
|
+
if (body !== null && typeof body === "object" && !React95__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
48905
48497
|
const out = {};
|
|
48906
48498
|
for (const [k, v] of Object.entries(body)) {
|
|
48907
48499
|
out[k] = recur(v);
|
|
@@ -48920,7 +48512,7 @@ function getSlotContentRenderer2() {
|
|
|
48920
48512
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
48921
48513
|
return (item, index) => {
|
|
48922
48514
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
48923
|
-
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) {
|
|
48924
48516
|
return null;
|
|
48925
48517
|
}
|
|
48926
48518
|
const record = resolvedBody;
|
|
@@ -48939,7 +48531,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
48939
48531
|
props: childProps,
|
|
48940
48532
|
priority: 0
|
|
48941
48533
|
};
|
|
48942
|
-
return
|
|
48534
|
+
return React95__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
48943
48535
|
};
|
|
48944
48536
|
}
|
|
48945
48537
|
function convertNode(node, callerKey) {
|
|
@@ -48958,7 +48550,7 @@ function convertNode(node, callerKey) {
|
|
|
48958
48550
|
});
|
|
48959
48551
|
return anyChanged ? mapped : node;
|
|
48960
48552
|
}
|
|
48961
|
-
if (typeof node === "object" && !
|
|
48553
|
+
if (typeof node === "object" && !React95__default.isValidElement(node) && !(node instanceof Date)) {
|
|
48962
48554
|
return convertObjectProps(node);
|
|
48963
48555
|
}
|
|
48964
48556
|
return node;
|