@almadar/ui 2.17.0 → 2.18.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/components/index.cjs +996 -996
- package/dist/components/index.js +134 -134
- package/dist/components/organisms/game/three/index.cjs +121 -121
- package/dist/components/organisms/game/three/index.js +3 -3
- package/dist/docs/index.cjs +33 -33
- package/dist/docs/index.js +11 -11
- package/dist/hooks/index.cjs +221 -221
- package/dist/hooks/index.js +2 -2
- package/dist/internals/event-bus-context.d.ts +15 -0
- package/dist/marketing/index.cjs +26 -26
- package/dist/marketing/index.js +13 -13
- package/dist/providers/EventBusProvider.d.ts +4 -20
- package/dist/providers/index.cjs +3 -1
- package/dist/providers/index.js +3 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React86 from 'react';
|
|
2
|
+
import React86__default, { createContext, useCallback, useState, useRef, useLayoutEffect, useEffect, lazy, useContext, useMemo, useId, Suspense, useSyncExternalStore } from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import * as LucideIcons from 'lucide-react';
|
|
@@ -270,7 +270,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
270
270
|
const IconComp = value;
|
|
271
271
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
272
272
|
}
|
|
273
|
-
if (
|
|
273
|
+
if (React86__default.isValidElement(value)) {
|
|
274
274
|
return value;
|
|
275
275
|
}
|
|
276
276
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -279,7 +279,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
279
279
|
}
|
|
280
280
|
return value;
|
|
281
281
|
}
|
|
282
|
-
var Button =
|
|
282
|
+
var Button = React86__default.forwardRef(
|
|
283
283
|
({
|
|
284
284
|
className,
|
|
285
285
|
variant = "primary",
|
|
@@ -337,7 +337,7 @@ var Button = React87__default.forwardRef(
|
|
|
337
337
|
}
|
|
338
338
|
);
|
|
339
339
|
Button.displayName = "Button";
|
|
340
|
-
var Input =
|
|
340
|
+
var Input = React86__default.forwardRef(
|
|
341
341
|
({
|
|
342
342
|
className,
|
|
343
343
|
inputType,
|
|
@@ -449,7 +449,7 @@ var Input = React87__default.forwardRef(
|
|
|
449
449
|
}
|
|
450
450
|
);
|
|
451
451
|
Input.displayName = "Input";
|
|
452
|
-
var Label =
|
|
452
|
+
var Label = React86__default.forwardRef(
|
|
453
453
|
({ className, required, children, ...props }, ref) => {
|
|
454
454
|
return /* @__PURE__ */ jsxs(
|
|
455
455
|
"label",
|
|
@@ -469,7 +469,7 @@ var Label = React87__default.forwardRef(
|
|
|
469
469
|
}
|
|
470
470
|
);
|
|
471
471
|
Label.displayName = "Label";
|
|
472
|
-
var Textarea =
|
|
472
|
+
var Textarea = React86__default.forwardRef(
|
|
473
473
|
({ className, error, ...props }, ref) => {
|
|
474
474
|
return /* @__PURE__ */ jsx(
|
|
475
475
|
"textarea",
|
|
@@ -492,7 +492,7 @@ var Textarea = React87__default.forwardRef(
|
|
|
492
492
|
}
|
|
493
493
|
);
|
|
494
494
|
Textarea.displayName = "Textarea";
|
|
495
|
-
var Select =
|
|
495
|
+
var Select = React86__default.forwardRef(
|
|
496
496
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
497
497
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
498
498
|
/* @__PURE__ */ jsxs(
|
|
@@ -528,7 +528,7 @@ var Select = React87__default.forwardRef(
|
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
530
|
Select.displayName = "Select";
|
|
531
|
-
var Checkbox =
|
|
531
|
+
var Checkbox = React86__default.forwardRef(
|
|
532
532
|
({ className, label, id, ...props }, ref) => {
|
|
533
533
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
534
534
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -602,7 +602,7 @@ var shadowStyles = {
|
|
|
602
602
|
md: "shadow-[var(--shadow-main)]",
|
|
603
603
|
lg: "shadow-[var(--shadow-lg)]"
|
|
604
604
|
};
|
|
605
|
-
var Card =
|
|
605
|
+
var Card = React86__default.forwardRef(
|
|
606
606
|
({
|
|
607
607
|
className,
|
|
608
608
|
variant = "bordered",
|
|
@@ -638,9 +638,9 @@ var Card = React87__default.forwardRef(
|
|
|
638
638
|
}
|
|
639
639
|
);
|
|
640
640
|
Card.displayName = "Card";
|
|
641
|
-
var CardHeader =
|
|
641
|
+
var CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
642
642
|
CardHeader.displayName = "CardHeader";
|
|
643
|
-
var CardTitle =
|
|
643
|
+
var CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
644
644
|
"h3",
|
|
645
645
|
{
|
|
646
646
|
ref,
|
|
@@ -653,11 +653,11 @@ var CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /*
|
|
|
653
653
|
}
|
|
654
654
|
));
|
|
655
655
|
CardTitle.displayName = "CardTitle";
|
|
656
|
-
var CardContent =
|
|
656
|
+
var CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
657
657
|
CardContent.displayName = "CardContent";
|
|
658
658
|
var CardBody = CardContent;
|
|
659
659
|
CardBody.displayName = "CardBody";
|
|
660
|
-
var CardFooter =
|
|
660
|
+
var CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
661
661
|
"div",
|
|
662
662
|
{
|
|
663
663
|
ref,
|
|
@@ -703,7 +703,7 @@ var sizeStyles2 = {
|
|
|
703
703
|
md: "px-2.5 py-1 text-sm",
|
|
704
704
|
lg: "px-3 py-1.5 text-base"
|
|
705
705
|
};
|
|
706
|
-
var Badge =
|
|
706
|
+
var Badge = React86__default.forwardRef(
|
|
707
707
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
708
708
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
709
709
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -736,7 +736,7 @@ var sizeStyles3 = {
|
|
|
736
736
|
md: "h-6 w-6",
|
|
737
737
|
lg: "h-8 w-8"
|
|
738
738
|
};
|
|
739
|
-
var Spinner =
|
|
739
|
+
var Spinner = React86__default.forwardRef(
|
|
740
740
|
({ className, size = "md", ...props }, ref) => {
|
|
741
741
|
return /* @__PURE__ */ jsx(
|
|
742
742
|
"div",
|
|
@@ -1001,7 +1001,7 @@ var positionStyles = {
|
|
|
1001
1001
|
fixed: "fixed",
|
|
1002
1002
|
sticky: "sticky"
|
|
1003
1003
|
};
|
|
1004
|
-
var Box =
|
|
1004
|
+
var Box = React86__default.forwardRef(
|
|
1005
1005
|
({
|
|
1006
1006
|
padding,
|
|
1007
1007
|
paddingX,
|
|
@@ -1348,7 +1348,7 @@ var ProgressBar = ({
|
|
|
1348
1348
|
return null;
|
|
1349
1349
|
};
|
|
1350
1350
|
ProgressBar.displayName = "ProgressBar";
|
|
1351
|
-
var Radio =
|
|
1351
|
+
var Radio = React86__default.forwardRef(
|
|
1352
1352
|
({
|
|
1353
1353
|
label,
|
|
1354
1354
|
helperText,
|
|
@@ -1452,7 +1452,7 @@ var Radio = React87__default.forwardRef(
|
|
|
1452
1452
|
}
|
|
1453
1453
|
);
|
|
1454
1454
|
Radio.displayName = "Radio";
|
|
1455
|
-
var Switch =
|
|
1455
|
+
var Switch = React86.forwardRef(
|
|
1456
1456
|
({
|
|
1457
1457
|
checked,
|
|
1458
1458
|
defaultChecked = false,
|
|
@@ -1463,10 +1463,10 @@ var Switch = React87.forwardRef(
|
|
|
1463
1463
|
name,
|
|
1464
1464
|
className
|
|
1465
1465
|
}, ref) => {
|
|
1466
|
-
const [isChecked, setIsChecked] =
|
|
1466
|
+
const [isChecked, setIsChecked] = React86.useState(
|
|
1467
1467
|
checked !== void 0 ? checked : defaultChecked
|
|
1468
1468
|
);
|
|
1469
|
-
|
|
1469
|
+
React86.useEffect(() => {
|
|
1470
1470
|
if (checked !== void 0) {
|
|
1471
1471
|
setIsChecked(checked);
|
|
1472
1472
|
}
|
|
@@ -2260,8 +2260,8 @@ var LawReferenceTooltip = ({
|
|
|
2260
2260
|
position = "top",
|
|
2261
2261
|
className
|
|
2262
2262
|
}) => {
|
|
2263
|
-
const [isVisible, setIsVisible] =
|
|
2264
|
-
const timeoutRef =
|
|
2263
|
+
const [isVisible, setIsVisible] = React86__default.useState(false);
|
|
2264
|
+
const timeoutRef = React86__default.useRef(null);
|
|
2265
2265
|
const handleMouseEnter = () => {
|
|
2266
2266
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2267
2267
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -2270,7 +2270,7 @@ var LawReferenceTooltip = ({
|
|
|
2270
2270
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2271
2271
|
setIsVisible(false);
|
|
2272
2272
|
};
|
|
2273
|
-
|
|
2273
|
+
React86__default.useEffect(() => {
|
|
2274
2274
|
return () => {
|
|
2275
2275
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2276
2276
|
};
|
|
@@ -2458,7 +2458,7 @@ var sizeStyles5 = {
|
|
|
2458
2458
|
md: "w-2.5 h-2.5",
|
|
2459
2459
|
lg: "w-3 h-3"
|
|
2460
2460
|
};
|
|
2461
|
-
var StatusDot =
|
|
2461
|
+
var StatusDot = React86__default.forwardRef(
|
|
2462
2462
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
2463
2463
|
return /* @__PURE__ */ jsx(
|
|
2464
2464
|
"span",
|
|
@@ -2505,7 +2505,7 @@ var iconMap = {
|
|
|
2505
2505
|
down: TrendingDown,
|
|
2506
2506
|
flat: ArrowRight
|
|
2507
2507
|
};
|
|
2508
|
-
var TrendIndicator =
|
|
2508
|
+
var TrendIndicator = React86__default.forwardRef(
|
|
2509
2509
|
({
|
|
2510
2510
|
className,
|
|
2511
2511
|
value,
|
|
@@ -2564,7 +2564,7 @@ var thumbSizes = {
|
|
|
2564
2564
|
md: "w-4 h-4",
|
|
2565
2565
|
lg: "w-5 h-5"
|
|
2566
2566
|
};
|
|
2567
|
-
var RangeSlider =
|
|
2567
|
+
var RangeSlider = React86__default.forwardRef(
|
|
2568
2568
|
({
|
|
2569
2569
|
className,
|
|
2570
2570
|
min = 0,
|
|
@@ -3094,7 +3094,7 @@ var paddingClasses = {
|
|
|
3094
3094
|
md: "py-16",
|
|
3095
3095
|
lg: "py-24"
|
|
3096
3096
|
};
|
|
3097
|
-
var ContentSection =
|
|
3097
|
+
var ContentSection = React86__default.forwardRef(
|
|
3098
3098
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
3099
3099
|
return /* @__PURE__ */ jsx(
|
|
3100
3100
|
Box,
|
|
@@ -3197,9 +3197,9 @@ function ScoreDisplay({
|
|
|
3197
3197
|
...rest
|
|
3198
3198
|
}) {
|
|
3199
3199
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
3200
|
-
const [displayValue, setDisplayValue] =
|
|
3201
|
-
const [isAnimating, setIsAnimating] =
|
|
3202
|
-
|
|
3200
|
+
const [displayValue, setDisplayValue] = React86.useState(resolvedValue);
|
|
3201
|
+
const [isAnimating, setIsAnimating] = React86.useState(false);
|
|
3202
|
+
React86.useEffect(() => {
|
|
3203
3203
|
if (!animated || displayValue === resolvedValue) {
|
|
3204
3204
|
setDisplayValue(resolvedValue);
|
|
3205
3205
|
return;
|
|
@@ -3272,9 +3272,9 @@ function ControlButton({
|
|
|
3272
3272
|
className
|
|
3273
3273
|
}) {
|
|
3274
3274
|
const eventBus = useEventBus();
|
|
3275
|
-
const [isPressed, setIsPressed] =
|
|
3275
|
+
const [isPressed, setIsPressed] = React86.useState(false);
|
|
3276
3276
|
const actualPressed = pressed ?? isPressed;
|
|
3277
|
-
const handlePointerDown =
|
|
3277
|
+
const handlePointerDown = React86.useCallback(
|
|
3278
3278
|
(e) => {
|
|
3279
3279
|
e.preventDefault();
|
|
3280
3280
|
if (disabled) return;
|
|
@@ -3284,7 +3284,7 @@ function ControlButton({
|
|
|
3284
3284
|
},
|
|
3285
3285
|
[disabled, pressEvent, eventBus, onPress]
|
|
3286
3286
|
);
|
|
3287
|
-
const handlePointerUp =
|
|
3287
|
+
const handlePointerUp = React86.useCallback(
|
|
3288
3288
|
(e) => {
|
|
3289
3289
|
e.preventDefault();
|
|
3290
3290
|
if (disabled) return;
|
|
@@ -3294,7 +3294,7 @@ function ControlButton({
|
|
|
3294
3294
|
},
|
|
3295
3295
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
3296
3296
|
);
|
|
3297
|
-
const handlePointerLeave =
|
|
3297
|
+
const handlePointerLeave = React86.useCallback(
|
|
3298
3298
|
(e) => {
|
|
3299
3299
|
if (isPressed) {
|
|
3300
3300
|
setIsPressed(false);
|
|
@@ -4120,9 +4120,9 @@ function MiniMap({
|
|
|
4120
4120
|
viewportRect,
|
|
4121
4121
|
className
|
|
4122
4122
|
}) {
|
|
4123
|
-
const canvasRef =
|
|
4124
|
-
const frameRef =
|
|
4125
|
-
|
|
4123
|
+
const canvasRef = React86.useRef(null);
|
|
4124
|
+
const frameRef = React86.useRef(0);
|
|
4125
|
+
React86.useEffect(() => {
|
|
4126
4126
|
const canvas = canvasRef.current;
|
|
4127
4127
|
if (!canvas) return;
|
|
4128
4128
|
const ctx = canvas.getContext("2d");
|
|
@@ -4363,7 +4363,7 @@ var ErrorState = ({
|
|
|
4363
4363
|
);
|
|
4364
4364
|
};
|
|
4365
4365
|
ErrorState.displayName = "ErrorState";
|
|
4366
|
-
var ErrorBoundary = class extends
|
|
4366
|
+
var ErrorBoundary = class extends React86__default.Component {
|
|
4367
4367
|
constructor(props) {
|
|
4368
4368
|
super(props);
|
|
4369
4369
|
__publicField(this, "reset", () => {
|
|
@@ -6099,8 +6099,8 @@ var Menu = ({
|
|
|
6099
6099
|
"bottom-start": "top-full left-0 mt-2",
|
|
6100
6100
|
"bottom-end": "top-full right-0 mt-2"
|
|
6101
6101
|
};
|
|
6102
|
-
const triggerChild =
|
|
6103
|
-
const triggerElement =
|
|
6102
|
+
const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6103
|
+
const triggerElement = React86__default.cloneElement(
|
|
6104
6104
|
triggerChild,
|
|
6105
6105
|
{
|
|
6106
6106
|
ref: triggerRef,
|
|
@@ -6605,8 +6605,8 @@ var Popover = ({
|
|
|
6605
6605
|
onMouseEnter: handleOpen,
|
|
6606
6606
|
onMouseLeave: handleClose
|
|
6607
6607
|
};
|
|
6608
|
-
const childElement =
|
|
6609
|
-
const triggerElement =
|
|
6608
|
+
const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6609
|
+
const triggerElement = React86__default.cloneElement(
|
|
6610
6610
|
childElement,
|
|
6611
6611
|
{
|
|
6612
6612
|
ref: triggerRef,
|
|
@@ -7361,8 +7361,8 @@ var Tooltip = ({
|
|
|
7361
7361
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
7362
7362
|
};
|
|
7363
7363
|
}, []);
|
|
7364
|
-
const triggerElement =
|
|
7365
|
-
const trigger =
|
|
7364
|
+
const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7365
|
+
const trigger = React86__default.cloneElement(triggerElement, {
|
|
7366
7366
|
ref: triggerRef,
|
|
7367
7367
|
onMouseEnter: handleMouseEnter,
|
|
7368
7368
|
onMouseLeave: handleMouseLeave,
|
|
@@ -7611,7 +7611,7 @@ var WizardProgress = ({
|
|
|
7611
7611
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
7612
7612
|
const isActive = index === currentStep;
|
|
7613
7613
|
const isCompleted = index < currentStep;
|
|
7614
|
-
return /* @__PURE__ */ jsxs(
|
|
7614
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
7615
7615
|
/* @__PURE__ */ jsx(
|
|
7616
7616
|
"button",
|
|
7617
7617
|
{
|
|
@@ -7741,7 +7741,7 @@ var WizardNavigation = ({
|
|
|
7741
7741
|
);
|
|
7742
7742
|
};
|
|
7743
7743
|
WizardNavigation.displayName = "WizardNavigation";
|
|
7744
|
-
var MarkdownContent =
|
|
7744
|
+
var MarkdownContent = React86__default.memo(
|
|
7745
7745
|
({ content, direction, className }) => {
|
|
7746
7746
|
const { t: _t } = useTranslate();
|
|
7747
7747
|
return /* @__PURE__ */ jsx(
|
|
@@ -7842,7 +7842,7 @@ var MarkdownContent = React87__default.memo(
|
|
|
7842
7842
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
7843
7843
|
);
|
|
7844
7844
|
MarkdownContent.displayName = "MarkdownContent";
|
|
7845
|
-
var CodeBlock =
|
|
7845
|
+
var CodeBlock = React86__default.memo(
|
|
7846
7846
|
({
|
|
7847
7847
|
code,
|
|
7848
7848
|
language = "text",
|
|
@@ -8962,8 +8962,8 @@ function DPad({
|
|
|
8962
8962
|
}) {
|
|
8963
8963
|
const eventBus = useEventBus();
|
|
8964
8964
|
const sizes = sizeMap15[size];
|
|
8965
|
-
const [activeDirections, setActiveDirections] =
|
|
8966
|
-
const handlePress =
|
|
8965
|
+
const [activeDirections, setActiveDirections] = React86.useState(/* @__PURE__ */ new Set());
|
|
8966
|
+
const handlePress = React86.useCallback(
|
|
8967
8967
|
(direction) => {
|
|
8968
8968
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
8969
8969
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -8971,7 +8971,7 @@ function DPad({
|
|
|
8971
8971
|
},
|
|
8972
8972
|
[directionEvent, eventBus, onDirection]
|
|
8973
8973
|
);
|
|
8974
|
-
const handleRelease =
|
|
8974
|
+
const handleRelease = React86.useCallback(
|
|
8975
8975
|
(direction) => {
|
|
8976
8976
|
setActiveDirections((prev) => {
|
|
8977
8977
|
const next = new Set(prev);
|
|
@@ -9029,8 +9029,8 @@ function ActionButtons({
|
|
|
9029
9029
|
disabled
|
|
9030
9030
|
}) {
|
|
9031
9031
|
const eventBus = useEventBus();
|
|
9032
|
-
const [activeButtons, setActiveButtons] =
|
|
9033
|
-
const handlePress =
|
|
9032
|
+
const [activeButtons, setActiveButtons] = React86.useState(/* @__PURE__ */ new Set());
|
|
9033
|
+
const handlePress = React86.useCallback(
|
|
9034
9034
|
(id) => {
|
|
9035
9035
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9036
9036
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9038,7 +9038,7 @@ function ActionButtons({
|
|
|
9038
9038
|
},
|
|
9039
9039
|
[actionEvent, eventBus, onAction]
|
|
9040
9040
|
);
|
|
9041
|
-
const handleRelease =
|
|
9041
|
+
const handleRelease = React86.useCallback(
|
|
9042
9042
|
(id) => {
|
|
9043
9043
|
setActiveButtons((prev) => {
|
|
9044
9044
|
const next = new Set(prev);
|
|
@@ -9223,7 +9223,7 @@ function InventoryGrid({
|
|
|
9223
9223
|
const eventBus = useEventBus();
|
|
9224
9224
|
const slotCount = totalSlots ?? items.length;
|
|
9225
9225
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9226
|
-
const handleSelect =
|
|
9226
|
+
const handleSelect = React86.useCallback(
|
|
9227
9227
|
(id) => {
|
|
9228
9228
|
onSelect?.(id);
|
|
9229
9229
|
if (selectEvent) {
|
|
@@ -9347,7 +9347,7 @@ function CraftingRecipe({
|
|
|
9347
9347
|
className
|
|
9348
9348
|
}) {
|
|
9349
9349
|
const eventBus = useEventBus();
|
|
9350
|
-
const handleCraft =
|
|
9350
|
+
const handleCraft = React86.useCallback(() => {
|
|
9351
9351
|
onCraft?.();
|
|
9352
9352
|
if (craftEvent) {
|
|
9353
9353
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -9364,7 +9364,7 @@ function CraftingRecipe({
|
|
|
9364
9364
|
children: [
|
|
9365
9365
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
9366
9366
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
9367
|
-
return /* @__PURE__ */ jsxs(
|
|
9367
|
+
return /* @__PURE__ */ jsxs(React86.Fragment, { children: [
|
|
9368
9368
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
9369
9369
|
ItemSlot,
|
|
9370
9370
|
{
|
|
@@ -9466,15 +9466,15 @@ function GameCanvas2D({
|
|
|
9466
9466
|
fps = 60,
|
|
9467
9467
|
className
|
|
9468
9468
|
}) {
|
|
9469
|
-
const canvasRef =
|
|
9470
|
-
const rafRef =
|
|
9471
|
-
const frameRef =
|
|
9472
|
-
const lastTimeRef =
|
|
9473
|
-
const onDrawRef =
|
|
9469
|
+
const canvasRef = React86.useRef(null);
|
|
9470
|
+
const rafRef = React86.useRef(0);
|
|
9471
|
+
const frameRef = React86.useRef(0);
|
|
9472
|
+
const lastTimeRef = React86.useRef(0);
|
|
9473
|
+
const onDrawRef = React86.useRef(onDraw);
|
|
9474
9474
|
onDrawRef.current = onDraw;
|
|
9475
|
-
const onTickRef =
|
|
9475
|
+
const onTickRef = React86.useRef(onTick);
|
|
9476
9476
|
onTickRef.current = onTick;
|
|
9477
|
-
|
|
9477
|
+
React86.useEffect(() => {
|
|
9478
9478
|
const canvas = canvasRef.current;
|
|
9479
9479
|
if (!canvas) return;
|
|
9480
9480
|
const ctx = canvas.getContext("2d");
|
|
@@ -9722,7 +9722,7 @@ function TurnPanel({
|
|
|
9722
9722
|
className
|
|
9723
9723
|
}) {
|
|
9724
9724
|
const eventBus = useEventBus();
|
|
9725
|
-
const handleAction =
|
|
9725
|
+
const handleAction = React86.useCallback(
|
|
9726
9726
|
(event) => {
|
|
9727
9727
|
if (event) {
|
|
9728
9728
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -9847,7 +9847,7 @@ function UnitCommandBar({
|
|
|
9847
9847
|
className
|
|
9848
9848
|
}) {
|
|
9849
9849
|
const eventBus = useEventBus();
|
|
9850
|
-
const handleCommand =
|
|
9850
|
+
const handleCommand = React86.useCallback(
|
|
9851
9851
|
(event) => {
|
|
9852
9852
|
if (event) {
|
|
9853
9853
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -10385,7 +10385,7 @@ function GameMenu({
|
|
|
10385
10385
|
} catch {
|
|
10386
10386
|
}
|
|
10387
10387
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
10388
|
-
const handleOptionClick =
|
|
10388
|
+
const handleOptionClick = React86.useCallback(
|
|
10389
10389
|
(option) => {
|
|
10390
10390
|
if (option.event && eventBus) {
|
|
10391
10391
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -10508,7 +10508,7 @@ function GameOverScreen({
|
|
|
10508
10508
|
} catch {
|
|
10509
10509
|
}
|
|
10510
10510
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
10511
|
-
const handleActionClick =
|
|
10511
|
+
const handleActionClick = React86.useCallback(
|
|
10512
10512
|
(action) => {
|
|
10513
10513
|
if (action.event && eventBus) {
|
|
10514
10514
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -13309,7 +13309,7 @@ var DataList = ({
|
|
|
13309
13309
|
}) => {
|
|
13310
13310
|
const eventBus = useEventBus();
|
|
13311
13311
|
const { t } = useTranslate();
|
|
13312
|
-
const [visibleCount, setVisibleCount] =
|
|
13312
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
|
|
13313
13313
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
13314
13314
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
13315
13315
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -13346,7 +13346,7 @@ var DataList = ({
|
|
|
13346
13346
|
const items2 = data.map((item) => item);
|
|
13347
13347
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
13348
13348
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
13349
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
13349
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
13350
13350
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
13351
13351
|
group.items.map((itemData, index) => {
|
|
13352
13352
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -13549,7 +13549,7 @@ var DataList = ({
|
|
|
13549
13549
|
className
|
|
13550
13550
|
),
|
|
13551
13551
|
children: [
|
|
13552
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
13552
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
13553
13553
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
13554
13554
|
group.items.map(
|
|
13555
13555
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -15271,7 +15271,7 @@ var StepFlow = ({
|
|
|
15271
15271
|
className
|
|
15272
15272
|
}) => {
|
|
15273
15273
|
if (orientation === "vertical") {
|
|
15274
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
15274
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React86__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
15275
15275
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
15276
15276
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
15277
15277
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-[var(--color-border)]" })
|
|
@@ -15282,7 +15282,7 @@ var StepFlow = ({
|
|
|
15282
15282
|
] })
|
|
15283
15283
|
] }) }, index)) });
|
|
15284
15284
|
}
|
|
15285
|
-
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(
|
|
15285
|
+
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(React86__default.Fragment, { children: [
|
|
15286
15286
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
15287
15287
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
15288
15288
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -15917,7 +15917,7 @@ var StatCard = ({
|
|
|
15917
15917
|
const labelToUse = propLabel ?? propTitle;
|
|
15918
15918
|
const eventBus = useEventBus();
|
|
15919
15919
|
const { t } = useTranslate();
|
|
15920
|
-
const handleActionClick =
|
|
15920
|
+
const handleActionClick = React86__default.useCallback(() => {
|
|
15921
15921
|
if (action?.event) {
|
|
15922
15922
|
eventBus.emit(`UI:${action.event}`, {});
|
|
15923
15923
|
}
|
|
@@ -15928,7 +15928,7 @@ var StatCard = ({
|
|
|
15928
15928
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
15929
15929
|
const isLoading = externalLoading ?? false;
|
|
15930
15930
|
const error = externalError;
|
|
15931
|
-
const computeMetricValue =
|
|
15931
|
+
const computeMetricValue = React86__default.useCallback(
|
|
15932
15932
|
(metric, items) => {
|
|
15933
15933
|
if (metric.value !== void 0) {
|
|
15934
15934
|
return metric.value;
|
|
@@ -15967,7 +15967,7 @@ var StatCard = ({
|
|
|
15967
15967
|
},
|
|
15968
15968
|
[]
|
|
15969
15969
|
);
|
|
15970
|
-
const schemaStats =
|
|
15970
|
+
const schemaStats = React86__default.useMemo(() => {
|
|
15971
15971
|
if (!metrics || metrics.length === 0) return null;
|
|
15972
15972
|
return metrics.map((metric) => ({
|
|
15973
15973
|
label: metric.label,
|
|
@@ -15975,7 +15975,7 @@ var StatCard = ({
|
|
|
15975
15975
|
format: metric.format
|
|
15976
15976
|
}));
|
|
15977
15977
|
}, [metrics, data, computeMetricValue]);
|
|
15978
|
-
const calculatedTrend =
|
|
15978
|
+
const calculatedTrend = React86__default.useMemo(() => {
|
|
15979
15979
|
if (manualTrend !== void 0) return manualTrend;
|
|
15980
15980
|
if (previousValue === void 0 || currentValue === void 0)
|
|
15981
15981
|
return void 0;
|
|
@@ -16139,7 +16139,7 @@ var PageHeader = ({
|
|
|
16139
16139
|
info: "bg-[var(--color-info)]/10 text-[var(--color-info)]"
|
|
16140
16140
|
};
|
|
16141
16141
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
16142
|
-
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(
|
|
16142
|
+
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(React86__default.Fragment, { children: [
|
|
16143
16143
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
16144
16144
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
16145
16145
|
"a",
|
|
@@ -16665,7 +16665,7 @@ var FormSection = ({
|
|
|
16665
16665
|
columns = 1,
|
|
16666
16666
|
className
|
|
16667
16667
|
}) => {
|
|
16668
|
-
const [collapsed, setCollapsed] =
|
|
16668
|
+
const [collapsed, setCollapsed] = React86__default.useState(defaultCollapsed);
|
|
16669
16669
|
const { t } = useTranslate();
|
|
16670
16670
|
const eventBus = useEventBus();
|
|
16671
16671
|
const gridClass = {
|
|
@@ -16673,7 +16673,7 @@ var FormSection = ({
|
|
|
16673
16673
|
2: "grid-cols-1 md:grid-cols-2",
|
|
16674
16674
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
16675
16675
|
}[columns];
|
|
16676
|
-
|
|
16676
|
+
React86__default.useCallback(() => {
|
|
16677
16677
|
if (collapsible) {
|
|
16678
16678
|
setCollapsed((prev) => !prev);
|
|
16679
16679
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -16885,7 +16885,7 @@ var Form = ({
|
|
|
16885
16885
|
const normalizedInitialData = initialData ?? {};
|
|
16886
16886
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
16887
16887
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
16888
|
-
const entityDerivedFields =
|
|
16888
|
+
const entityDerivedFields = React86__default.useMemo(() => {
|
|
16889
16889
|
if (fields && fields.length > 0) return void 0;
|
|
16890
16890
|
if (!resolvedEntity) return void 0;
|
|
16891
16891
|
return resolvedEntity.fields.map(
|
|
@@ -16904,14 +16904,14 @@ var Form = ({
|
|
|
16904
16904
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
16905
16905
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
16906
16906
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
16907
|
-
const [formData, setFormData] =
|
|
16907
|
+
const [formData, setFormData] = React86__default.useState(
|
|
16908
16908
|
normalizedInitialData
|
|
16909
16909
|
);
|
|
16910
|
-
const [collapsedSections, setCollapsedSections] =
|
|
16910
|
+
const [collapsedSections, setCollapsedSections] = React86__default.useState(
|
|
16911
16911
|
/* @__PURE__ */ new Set()
|
|
16912
16912
|
);
|
|
16913
16913
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
16914
|
-
const evalContext =
|
|
16914
|
+
const evalContext = React86__default.useMemo(
|
|
16915
16915
|
() => ({
|
|
16916
16916
|
formValues: formData,
|
|
16917
16917
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -16920,13 +16920,13 @@ var Form = ({
|
|
|
16920
16920
|
}),
|
|
16921
16921
|
[formData, externalContext]
|
|
16922
16922
|
);
|
|
16923
|
-
|
|
16923
|
+
React86__default.useEffect(() => {
|
|
16924
16924
|
const data = initialData;
|
|
16925
16925
|
if (data && Object.keys(data).length > 0) {
|
|
16926
16926
|
setFormData(data);
|
|
16927
16927
|
}
|
|
16928
16928
|
}, [initialData]);
|
|
16929
|
-
const processCalculations =
|
|
16929
|
+
const processCalculations = React86__default.useCallback(
|
|
16930
16930
|
(changedFieldId, newFormData) => {
|
|
16931
16931
|
if (!hiddenCalculations.length) return;
|
|
16932
16932
|
const context = {
|
|
@@ -16951,7 +16951,7 @@ var Form = ({
|
|
|
16951
16951
|
},
|
|
16952
16952
|
[hiddenCalculations, externalContext, eventBus]
|
|
16953
16953
|
);
|
|
16954
|
-
const checkViolations =
|
|
16954
|
+
const checkViolations = React86__default.useCallback(
|
|
16955
16955
|
(changedFieldId, newFormData) => {
|
|
16956
16956
|
if (!violationTriggers.length) return;
|
|
16957
16957
|
const context = {
|
|
@@ -16988,7 +16988,7 @@ var Form = ({
|
|
|
16988
16988
|
processCalculations(name, newFormData);
|
|
16989
16989
|
checkViolations(name, newFormData);
|
|
16990
16990
|
};
|
|
16991
|
-
const isFieldVisible =
|
|
16991
|
+
const isFieldVisible = React86__default.useCallback(
|
|
16992
16992
|
(fieldName) => {
|
|
16993
16993
|
const condition = conditionalFields[fieldName];
|
|
16994
16994
|
if (!condition) return true;
|
|
@@ -16996,7 +16996,7 @@ var Form = ({
|
|
|
16996
16996
|
},
|
|
16997
16997
|
[conditionalFields, evalContext]
|
|
16998
16998
|
);
|
|
16999
|
-
const isSectionVisible =
|
|
16999
|
+
const isSectionVisible = React86__default.useCallback(
|
|
17000
17000
|
(section) => {
|
|
17001
17001
|
if (!section.condition) return true;
|
|
17002
17002
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -17028,7 +17028,7 @@ var Form = ({
|
|
|
17028
17028
|
eventBus.emit(`UI:${onCancel}`);
|
|
17029
17029
|
}
|
|
17030
17030
|
};
|
|
17031
|
-
const renderField =
|
|
17031
|
+
const renderField = React86__default.useCallback(
|
|
17032
17032
|
(field) => {
|
|
17033
17033
|
const fieldName = field.name || field.field;
|
|
17034
17034
|
if (!fieldName) return null;
|
|
@@ -17049,7 +17049,7 @@ var Form = ({
|
|
|
17049
17049
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
17050
17050
|
);
|
|
17051
17051
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
17052
|
-
const normalizedFields =
|
|
17052
|
+
const normalizedFields = React86__default.useMemo(() => {
|
|
17053
17053
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
17054
17054
|
return effectiveFields.map((field) => {
|
|
17055
17055
|
if (typeof field === "string") {
|
|
@@ -17071,7 +17071,7 @@ var Form = ({
|
|
|
17071
17071
|
return field;
|
|
17072
17072
|
});
|
|
17073
17073
|
}, [effectiveFields, resolvedEntity]);
|
|
17074
|
-
const schemaFields =
|
|
17074
|
+
const schemaFields = React86__default.useMemo(() => {
|
|
17075
17075
|
if (normalizedFields.length === 0) return null;
|
|
17076
17076
|
if (isDebugEnabled()) {
|
|
17077
17077
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -17081,7 +17081,7 @@ var Form = ({
|
|
|
17081
17081
|
}
|
|
17082
17082
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
17083
17083
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
17084
|
-
const sectionElements =
|
|
17084
|
+
const sectionElements = React86__default.useMemo(() => {
|
|
17085
17085
|
if (!sections || sections.length === 0) return null;
|
|
17086
17086
|
return sections.map((section) => {
|
|
17087
17087
|
if (!isSectionVisible(section)) {
|
|
@@ -18206,7 +18206,7 @@ var List = ({
|
|
|
18206
18206
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
18207
18207
|
return [];
|
|
18208
18208
|
}, [entity]);
|
|
18209
|
-
const getItemActions =
|
|
18209
|
+
const getItemActions = React86__default.useCallback(
|
|
18210
18210
|
(item) => {
|
|
18211
18211
|
if (!itemActions) return [];
|
|
18212
18212
|
if (typeof itemActions === "function") {
|
|
@@ -18972,7 +18972,7 @@ var WizardContainer = ({
|
|
|
18972
18972
|
const isCompleted = index < currentStep;
|
|
18973
18973
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
18974
18974
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
18975
|
-
return /* @__PURE__ */ jsxs(
|
|
18975
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
18976
18976
|
/* @__PURE__ */ jsx(
|
|
18977
18977
|
Button,
|
|
18978
18978
|
{
|
|
@@ -20196,7 +20196,7 @@ var StateMachineView = ({
|
|
|
20196
20196
|
style: { top: title ? 30 : 0 },
|
|
20197
20197
|
children: [
|
|
20198
20198
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
20199
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20199
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
20200
20200
|
StateNode,
|
|
20201
20201
|
{
|
|
20202
20202
|
state,
|
|
@@ -24642,7 +24642,7 @@ function LinearView({
|
|
|
24642
24642
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
24643
24643
|
const isDone = i < currentIdx;
|
|
24644
24644
|
const isCurrent = i === currentIdx;
|
|
24645
|
-
return /* @__PURE__ */ jsxs(
|
|
24645
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
24646
24646
|
i > 0 && /* @__PURE__ */ jsx(
|
|
24647
24647
|
Typography,
|
|
24648
24648
|
{
|
|
@@ -25296,7 +25296,7 @@ function SequenceBar({
|
|
|
25296
25296
|
onSlotRemove(index);
|
|
25297
25297
|
}, [onSlotRemove, playing]);
|
|
25298
25298
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
25299
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
25299
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
25300
25300
|
i > 0 && /* @__PURE__ */ jsx(
|
|
25301
25301
|
Typography,
|
|
25302
25302
|
{
|
|
@@ -27784,7 +27784,7 @@ function InputPattern({
|
|
|
27784
27784
|
className
|
|
27785
27785
|
}) {
|
|
27786
27786
|
const { emit } = useEventBus();
|
|
27787
|
-
const [localValue, setLocalValue] =
|
|
27787
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27788
27788
|
const handleChange = (e) => {
|
|
27789
27789
|
setLocalValue(e.target.value);
|
|
27790
27790
|
if (onChange) {
|
|
@@ -27821,7 +27821,7 @@ function TextareaPattern({
|
|
|
27821
27821
|
className
|
|
27822
27822
|
}) {
|
|
27823
27823
|
const { emit } = useEventBus();
|
|
27824
|
-
const [localValue, setLocalValue] =
|
|
27824
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27825
27825
|
const handleChange = (e) => {
|
|
27826
27826
|
setLocalValue(e.target.value);
|
|
27827
27827
|
if (onChange) {
|
|
@@ -27852,7 +27852,7 @@ function SelectPattern({
|
|
|
27852
27852
|
className
|
|
27853
27853
|
}) {
|
|
27854
27854
|
const { emit } = useEventBus();
|
|
27855
|
-
const [localValue, setLocalValue] =
|
|
27855
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27856
27856
|
const handleChange = (e) => {
|
|
27857
27857
|
setLocalValue(e.target.value);
|
|
27858
27858
|
if (onChange) {
|
|
@@ -27881,7 +27881,7 @@ function CheckboxPattern({
|
|
|
27881
27881
|
className
|
|
27882
27882
|
}) {
|
|
27883
27883
|
const { emit } = useEventBus();
|
|
27884
|
-
const [localChecked, setLocalChecked] =
|
|
27884
|
+
const [localChecked, setLocalChecked] = React86__default.useState(checked);
|
|
27885
27885
|
const handleChange = (e) => {
|
|
27886
27886
|
setLocalChecked(e.target.checked);
|
|
27887
27887
|
if (onChange) {
|
|
@@ -29763,7 +29763,7 @@ var DocumentViewer = ({
|
|
|
29763
29763
|
};
|
|
29764
29764
|
DocumentViewer.displayName = "DocumentViewer";
|
|
29765
29765
|
function extractTitle(children) {
|
|
29766
|
-
if (!
|
|
29766
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
29767
29767
|
const props = children.props;
|
|
29768
29768
|
if (typeof props.title === "string") {
|
|
29769
29769
|
return props.title;
|
|
@@ -30361,7 +30361,7 @@ var MediaGallery = ({
|
|
|
30361
30361
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
30362
30362
|
);
|
|
30363
30363
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30364
|
-
const items =
|
|
30364
|
+
const items = React86__default.useMemo(() => {
|
|
30365
30365
|
if (propItems) return propItems;
|
|
30366
30366
|
if (entityData.length === 0) return [];
|
|
30367
30367
|
return entityData.map((record, idx) => ({
|
|
@@ -30523,7 +30523,7 @@ var MediaGallery = ({
|
|
|
30523
30523
|
};
|
|
30524
30524
|
MediaGallery.displayName = "MediaGallery";
|
|
30525
30525
|
function extractTitle2(children) {
|
|
30526
|
-
if (!
|
|
30526
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
30527
30527
|
const props = children.props;
|
|
30528
30528
|
if (typeof props.title === "string") {
|
|
30529
30529
|
return props.title;
|
|
@@ -30609,7 +30609,7 @@ function subscribeToDebugEvents(listener) {
|
|
|
30609
30609
|
|
|
30610
30610
|
// components/organisms/debug/hooks/useDebugData.ts
|
|
30611
30611
|
function useDebugData() {
|
|
30612
|
-
const [data, setData] =
|
|
30612
|
+
const [data, setData] = React86.useState(() => ({
|
|
30613
30613
|
traits: [],
|
|
30614
30614
|
ticks: [],
|
|
30615
30615
|
guards: [],
|
|
@@ -30623,7 +30623,7 @@ function useDebugData() {
|
|
|
30623
30623
|
},
|
|
30624
30624
|
lastUpdate: Date.now()
|
|
30625
30625
|
}));
|
|
30626
|
-
|
|
30626
|
+
React86.useEffect(() => {
|
|
30627
30627
|
const updateData = () => {
|
|
30628
30628
|
setData({
|
|
30629
30629
|
traits: getAllTraits(),
|
|
@@ -30892,15 +30892,15 @@ var TYPE_BADGES = {
|
|
|
30892
30892
|
state: { variant: "danger", icon: "\u{1F4CA}" }
|
|
30893
30893
|
};
|
|
30894
30894
|
function EventFlowTab({ events: events2 }) {
|
|
30895
|
-
const [filter, setFilter] =
|
|
30896
|
-
const containerRef =
|
|
30897
|
-
const [autoScroll, setAutoScroll] =
|
|
30898
|
-
|
|
30895
|
+
const [filter, setFilter] = React86.useState("all");
|
|
30896
|
+
const containerRef = React86.useRef(null);
|
|
30897
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
30898
|
+
React86.useEffect(() => {
|
|
30899
30899
|
if (autoScroll && containerRef.current) {
|
|
30900
30900
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
30901
30901
|
}
|
|
30902
30902
|
}, [events2.length, autoScroll]);
|
|
30903
|
-
const filteredEvents =
|
|
30903
|
+
const filteredEvents = React86.useMemo(() => {
|
|
30904
30904
|
if (filter === "all") return events2;
|
|
30905
30905
|
return events2.filter((e) => e.type === filter);
|
|
30906
30906
|
}, [events2, filter]);
|
|
@@ -30999,7 +30999,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
30999
30999
|
}
|
|
31000
31000
|
EventFlowTab.displayName = "EventFlowTab";
|
|
31001
31001
|
function GuardsPanel({ guards }) {
|
|
31002
|
-
const [filter, setFilter] =
|
|
31002
|
+
const [filter, setFilter] = React86.useState("all");
|
|
31003
31003
|
if (guards.length === 0) {
|
|
31004
31004
|
return /* @__PURE__ */ jsx(
|
|
31005
31005
|
EmptyState,
|
|
@@ -31012,7 +31012,7 @@ function GuardsPanel({ guards }) {
|
|
|
31012
31012
|
}
|
|
31013
31013
|
const passedCount = guards.filter((g) => g.result).length;
|
|
31014
31014
|
const failedCount = guards.length - passedCount;
|
|
31015
|
-
const filteredGuards =
|
|
31015
|
+
const filteredGuards = React86.useMemo(() => {
|
|
31016
31016
|
if (filter === "all") return guards;
|
|
31017
31017
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
31018
31018
|
return guards.filter((g) => !g.result);
|
|
@@ -31156,10 +31156,10 @@ function EffectBadge({ effect }) {
|
|
|
31156
31156
|
] });
|
|
31157
31157
|
}
|
|
31158
31158
|
function TransitionTimeline({ transitions: transitions2 }) {
|
|
31159
|
-
const containerRef =
|
|
31160
|
-
const [autoScroll, setAutoScroll] =
|
|
31161
|
-
const [expandedId, setExpandedId] =
|
|
31162
|
-
|
|
31159
|
+
const containerRef = React86.useRef(null);
|
|
31160
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
31161
|
+
const [expandedId, setExpandedId] = React86.useState(null);
|
|
31162
|
+
React86.useEffect(() => {
|
|
31163
31163
|
if (autoScroll && containerRef.current) {
|
|
31164
31164
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
31165
31165
|
}
|
|
@@ -31420,9 +31420,9 @@ function getAllEvents(traits2) {
|
|
|
31420
31420
|
}
|
|
31421
31421
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
31422
31422
|
const eventBus = useEventBus();
|
|
31423
|
-
const [log, setLog] =
|
|
31424
|
-
const prevStatesRef =
|
|
31425
|
-
|
|
31423
|
+
const [log, setLog] = React86.useState([]);
|
|
31424
|
+
const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
31425
|
+
React86.useEffect(() => {
|
|
31426
31426
|
for (const trait of traits2) {
|
|
31427
31427
|
const prev = prevStatesRef.current.get(trait.id);
|
|
31428
31428
|
if (prev && prev !== trait.currentState) {
|
|
@@ -31505,10 +31505,10 @@ function RuntimeDebugger({
|
|
|
31505
31505
|
defaultTab,
|
|
31506
31506
|
schema
|
|
31507
31507
|
}) {
|
|
31508
|
-
const [isCollapsed, setIsCollapsed] =
|
|
31509
|
-
const [isVisible, setIsVisible] =
|
|
31508
|
+
const [isCollapsed, setIsCollapsed] = React86.useState(defaultCollapsed);
|
|
31509
|
+
const [isVisible, setIsVisible] = React86.useState(mode === "inline" || isDebugEnabled2());
|
|
31510
31510
|
const debugData = useDebugData();
|
|
31511
|
-
|
|
31511
|
+
React86.useEffect(() => {
|
|
31512
31512
|
if (mode === "inline") return;
|
|
31513
31513
|
return onDebugToggle((enabled) => {
|
|
31514
31514
|
setIsVisible(enabled);
|
|
@@ -31517,7 +31517,7 @@ function RuntimeDebugger({
|
|
|
31517
31517
|
}
|
|
31518
31518
|
});
|
|
31519
31519
|
}, [mode]);
|
|
31520
|
-
|
|
31520
|
+
React86.useEffect(() => {
|
|
31521
31521
|
if (mode === "inline") return;
|
|
31522
31522
|
const handleKeyDown = (e) => {
|
|
31523
31523
|
if (e.key === "`" && isVisible) {
|
|
@@ -31914,7 +31914,7 @@ var Timeline = ({
|
|
|
31914
31914
|
}) => {
|
|
31915
31915
|
const { t } = useTranslate();
|
|
31916
31916
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
31917
|
-
const items =
|
|
31917
|
+
const items = React86__default.useMemo(() => {
|
|
31918
31918
|
if (propItems) return propItems;
|
|
31919
31919
|
if (entityData.length === 0) return [];
|
|
31920
31920
|
return entityData.map((record, idx) => {
|
|
@@ -32016,7 +32016,7 @@ var Timeline = ({
|
|
|
32016
32016
|
};
|
|
32017
32017
|
Timeline.displayName = "Timeline";
|
|
32018
32018
|
function extractToastProps(children) {
|
|
32019
|
-
if (!
|
|
32019
|
+
if (!React86__default.isValidElement(children)) {
|
|
32020
32020
|
if (typeof children === "string") {
|
|
32021
32021
|
return { message: children };
|
|
32022
32022
|
}
|
|
@@ -32047,7 +32047,7 @@ var ToastSlot = ({
|
|
|
32047
32047
|
eventBus.emit("UI:CLOSE");
|
|
32048
32048
|
};
|
|
32049
32049
|
if (!isVisible) return null;
|
|
32050
|
-
const isCustomContent =
|
|
32050
|
+
const isCustomContent = React86__default.isValidElement(children) && !message;
|
|
32051
32051
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
32052
32052
|
Toast,
|
|
32053
32053
|
{
|
|
@@ -32089,12 +32089,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
|
32089
32089
|
|
|
32090
32090
|
// components/organisms/component-registry.generated.ts
|
|
32091
32091
|
function lazyThree(name, loader) {
|
|
32092
|
-
const Lazy =
|
|
32092
|
+
const Lazy = React86__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
32093
32093
|
function ThreeWrapper(props) {
|
|
32094
|
-
return
|
|
32095
|
-
|
|
32094
|
+
return React86__default.createElement(
|
|
32095
|
+
React86__default.Suspense,
|
|
32096
32096
|
{ fallback: null },
|
|
32097
|
-
|
|
32097
|
+
React86__default.createElement(Lazy, props)
|
|
32098
32098
|
);
|
|
32099
32099
|
}
|
|
32100
32100
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -32382,7 +32382,7 @@ function SuspenseConfigProvider({
|
|
|
32382
32382
|
config,
|
|
32383
32383
|
children
|
|
32384
32384
|
}) {
|
|
32385
|
-
return
|
|
32385
|
+
return React86__default.createElement(
|
|
32386
32386
|
SuspenseConfigContext.Provider,
|
|
32387
32387
|
{ value: config },
|
|
32388
32388
|
children
|
|
@@ -34754,7 +34754,7 @@ function EntityDataProvider({
|
|
|
34754
34754
|
adapter,
|
|
34755
34755
|
children
|
|
34756
34756
|
}) {
|
|
34757
|
-
return
|
|
34757
|
+
return React86__default.createElement(
|
|
34758
34758
|
EntityDataContext.Provider,
|
|
34759
34759
|
{ value: adapter },
|
|
34760
34760
|
children
|