@almadar/ui 2.17.0 → 2.19.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 +1004 -1000
- package/dist/components/index.js +143 -139
- package/dist/components/organisms/game/three/index.cjs +121 -123
- package/dist/components/organisms/game/three/index.js +4 -6
- package/dist/hooks/index.cjs +221 -223
- package/dist/hooks/index.js +3 -5
- package/dist/marketing/index.cjs +8 -2
- package/dist/marketing/index.js +8 -2
- package/dist/providers/EventBusProvider.d.ts +2 -8
- package/dist/providers/index.cjs +5 -4
- package/dist/providers/index.js +4 -3
- package/dist/runtime/OrbPreview.d.ts +39 -0
- package/dist/runtime/index.cjs +139 -2
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +138 -2
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React86 from 'react';
|
|
2
|
+
import React86__default, { useCallback, createContext, 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';
|
|
6
6
|
import { Loader2, ChevronDown, X, ArrowRight, TrendingDown, TrendingUp, Check, Copy, AlertCircle, User, Sun, Moon, FileQuestion, Inbox, Search, Info, XCircle, CheckCircle, AlertTriangle, ChevronRight, Filter, Plus, ChevronLeft, HelpCircle, ChevronUp, Zap, Sword, Move, Heart, Shield, Minus, Star, FileWarning, Upload, MoreHorizontal, ArrowLeft, Menu as Menu$1, ArrowUp, ArrowDown, MoreVertical, Package, Trash2, List as List$1, Printer, Play, RotateCcw, Send, Wrench, Bug, Pause, SkipForward, Code, FileText, WrapText, Settings, Bell, LogOut, ZoomOut, ZoomIn, Download, Image as Image$1, Eraser, Circle, Clock, CheckCircle2, Calendar, Pencil, Eye, Tag, DollarSign } from 'lucide-react';
|
|
7
|
+
import { EventBusContext } from '@almadar/ui/providers';
|
|
7
8
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
8
9
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
9
10
|
import { createPortal } from 'react-dom';
|
|
@@ -27,9 +28,6 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
27
28
|
function cn(...inputs) {
|
|
28
29
|
return twMerge(clsx(inputs));
|
|
29
30
|
}
|
|
30
|
-
var EventBusContext = createContext(null);
|
|
31
|
-
|
|
32
|
-
// hooks/useEventBus.ts
|
|
33
31
|
function getGlobalEventBus() {
|
|
34
32
|
if (typeof window !== "undefined") {
|
|
35
33
|
return window.__kflowEventBus ?? null;
|
|
@@ -270,7 +268,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
270
268
|
const IconComp = value;
|
|
271
269
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
272
270
|
}
|
|
273
|
-
if (
|
|
271
|
+
if (React86__default.isValidElement(value)) {
|
|
274
272
|
return value;
|
|
275
273
|
}
|
|
276
274
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -279,7 +277,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
279
277
|
}
|
|
280
278
|
return value;
|
|
281
279
|
}
|
|
282
|
-
var Button =
|
|
280
|
+
var Button = React86__default.forwardRef(
|
|
283
281
|
({
|
|
284
282
|
className,
|
|
285
283
|
variant = "primary",
|
|
@@ -337,7 +335,7 @@ var Button = React87__default.forwardRef(
|
|
|
337
335
|
}
|
|
338
336
|
);
|
|
339
337
|
Button.displayName = "Button";
|
|
340
|
-
var Input =
|
|
338
|
+
var Input = React86__default.forwardRef(
|
|
341
339
|
({
|
|
342
340
|
className,
|
|
343
341
|
inputType,
|
|
@@ -449,7 +447,7 @@ var Input = React87__default.forwardRef(
|
|
|
449
447
|
}
|
|
450
448
|
);
|
|
451
449
|
Input.displayName = "Input";
|
|
452
|
-
var Label =
|
|
450
|
+
var Label = React86__default.forwardRef(
|
|
453
451
|
({ className, required, children, ...props }, ref) => {
|
|
454
452
|
return /* @__PURE__ */ jsxs(
|
|
455
453
|
"label",
|
|
@@ -469,7 +467,7 @@ var Label = React87__default.forwardRef(
|
|
|
469
467
|
}
|
|
470
468
|
);
|
|
471
469
|
Label.displayName = "Label";
|
|
472
|
-
var Textarea =
|
|
470
|
+
var Textarea = React86__default.forwardRef(
|
|
473
471
|
({ className, error, ...props }, ref) => {
|
|
474
472
|
return /* @__PURE__ */ jsx(
|
|
475
473
|
"textarea",
|
|
@@ -492,7 +490,7 @@ var Textarea = React87__default.forwardRef(
|
|
|
492
490
|
}
|
|
493
491
|
);
|
|
494
492
|
Textarea.displayName = "Textarea";
|
|
495
|
-
var Select =
|
|
493
|
+
var Select = React86__default.forwardRef(
|
|
496
494
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
497
495
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
498
496
|
/* @__PURE__ */ jsxs(
|
|
@@ -528,7 +526,7 @@ var Select = React87__default.forwardRef(
|
|
|
528
526
|
}
|
|
529
527
|
);
|
|
530
528
|
Select.displayName = "Select";
|
|
531
|
-
var Checkbox =
|
|
529
|
+
var Checkbox = React86__default.forwardRef(
|
|
532
530
|
({ className, label, id, ...props }, ref) => {
|
|
533
531
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
534
532
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -602,7 +600,7 @@ var shadowStyles = {
|
|
|
602
600
|
md: "shadow-[var(--shadow-main)]",
|
|
603
601
|
lg: "shadow-[var(--shadow-lg)]"
|
|
604
602
|
};
|
|
605
|
-
var Card =
|
|
603
|
+
var Card = React86__default.forwardRef(
|
|
606
604
|
({
|
|
607
605
|
className,
|
|
608
606
|
variant = "bordered",
|
|
@@ -638,9 +636,9 @@ var Card = React87__default.forwardRef(
|
|
|
638
636
|
}
|
|
639
637
|
);
|
|
640
638
|
Card.displayName = "Card";
|
|
641
|
-
var CardHeader =
|
|
639
|
+
var CardHeader = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
642
640
|
CardHeader.displayName = "CardHeader";
|
|
643
|
-
var CardTitle =
|
|
641
|
+
var CardTitle = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
644
642
|
"h3",
|
|
645
643
|
{
|
|
646
644
|
ref,
|
|
@@ -653,11 +651,11 @@ var CardTitle = React87__default.forwardRef(({ className, ...props }, ref) => /*
|
|
|
653
651
|
}
|
|
654
652
|
));
|
|
655
653
|
CardTitle.displayName = "CardTitle";
|
|
656
|
-
var CardContent =
|
|
654
|
+
var CardContent = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
657
655
|
CardContent.displayName = "CardContent";
|
|
658
656
|
var CardBody = CardContent;
|
|
659
657
|
CardBody.displayName = "CardBody";
|
|
660
|
-
var CardFooter =
|
|
658
|
+
var CardFooter = React86__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
661
659
|
"div",
|
|
662
660
|
{
|
|
663
661
|
ref,
|
|
@@ -703,7 +701,7 @@ var sizeStyles2 = {
|
|
|
703
701
|
md: "px-2.5 py-1 text-sm",
|
|
704
702
|
lg: "px-3 py-1.5 text-base"
|
|
705
703
|
};
|
|
706
|
-
var Badge =
|
|
704
|
+
var Badge = React86__default.forwardRef(
|
|
707
705
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
708
706
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
709
707
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -736,7 +734,7 @@ var sizeStyles3 = {
|
|
|
736
734
|
md: "h-6 w-6",
|
|
737
735
|
lg: "h-8 w-8"
|
|
738
736
|
};
|
|
739
|
-
var Spinner =
|
|
737
|
+
var Spinner = React86__default.forwardRef(
|
|
740
738
|
({ className, size = "md", ...props }, ref) => {
|
|
741
739
|
return /* @__PURE__ */ jsx(
|
|
742
740
|
"div",
|
|
@@ -1001,7 +999,7 @@ var positionStyles = {
|
|
|
1001
999
|
fixed: "fixed",
|
|
1002
1000
|
sticky: "sticky"
|
|
1003
1001
|
};
|
|
1004
|
-
var Box =
|
|
1002
|
+
var Box = React86__default.forwardRef(
|
|
1005
1003
|
({
|
|
1006
1004
|
padding,
|
|
1007
1005
|
paddingX,
|
|
@@ -1348,7 +1346,7 @@ var ProgressBar = ({
|
|
|
1348
1346
|
return null;
|
|
1349
1347
|
};
|
|
1350
1348
|
ProgressBar.displayName = "ProgressBar";
|
|
1351
|
-
var Radio =
|
|
1349
|
+
var Radio = React86__default.forwardRef(
|
|
1352
1350
|
({
|
|
1353
1351
|
label,
|
|
1354
1352
|
helperText,
|
|
@@ -1452,7 +1450,7 @@ var Radio = React87__default.forwardRef(
|
|
|
1452
1450
|
}
|
|
1453
1451
|
);
|
|
1454
1452
|
Radio.displayName = "Radio";
|
|
1455
|
-
var Switch =
|
|
1453
|
+
var Switch = React86.forwardRef(
|
|
1456
1454
|
({
|
|
1457
1455
|
checked,
|
|
1458
1456
|
defaultChecked = false,
|
|
@@ -1463,10 +1461,10 @@ var Switch = React87.forwardRef(
|
|
|
1463
1461
|
name,
|
|
1464
1462
|
className
|
|
1465
1463
|
}, ref) => {
|
|
1466
|
-
const [isChecked, setIsChecked] =
|
|
1464
|
+
const [isChecked, setIsChecked] = React86.useState(
|
|
1467
1465
|
checked !== void 0 ? checked : defaultChecked
|
|
1468
1466
|
);
|
|
1469
|
-
|
|
1467
|
+
React86.useEffect(() => {
|
|
1470
1468
|
if (checked !== void 0) {
|
|
1471
1469
|
setIsChecked(checked);
|
|
1472
1470
|
}
|
|
@@ -2260,8 +2258,8 @@ var LawReferenceTooltip = ({
|
|
|
2260
2258
|
position = "top",
|
|
2261
2259
|
className
|
|
2262
2260
|
}) => {
|
|
2263
|
-
const [isVisible, setIsVisible] =
|
|
2264
|
-
const timeoutRef =
|
|
2261
|
+
const [isVisible, setIsVisible] = React86__default.useState(false);
|
|
2262
|
+
const timeoutRef = React86__default.useRef(null);
|
|
2265
2263
|
const handleMouseEnter = () => {
|
|
2266
2264
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2267
2265
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -2270,7 +2268,7 @@ var LawReferenceTooltip = ({
|
|
|
2270
2268
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2271
2269
|
setIsVisible(false);
|
|
2272
2270
|
};
|
|
2273
|
-
|
|
2271
|
+
React86__default.useEffect(() => {
|
|
2274
2272
|
return () => {
|
|
2275
2273
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2276
2274
|
};
|
|
@@ -2458,7 +2456,7 @@ var sizeStyles5 = {
|
|
|
2458
2456
|
md: "w-2.5 h-2.5",
|
|
2459
2457
|
lg: "w-3 h-3"
|
|
2460
2458
|
};
|
|
2461
|
-
var StatusDot =
|
|
2459
|
+
var StatusDot = React86__default.forwardRef(
|
|
2462
2460
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
2463
2461
|
return /* @__PURE__ */ jsx(
|
|
2464
2462
|
"span",
|
|
@@ -2505,7 +2503,7 @@ var iconMap = {
|
|
|
2505
2503
|
down: TrendingDown,
|
|
2506
2504
|
flat: ArrowRight
|
|
2507
2505
|
};
|
|
2508
|
-
var TrendIndicator =
|
|
2506
|
+
var TrendIndicator = React86__default.forwardRef(
|
|
2509
2507
|
({
|
|
2510
2508
|
className,
|
|
2511
2509
|
value,
|
|
@@ -2564,7 +2562,7 @@ var thumbSizes = {
|
|
|
2564
2562
|
md: "w-4 h-4",
|
|
2565
2563
|
lg: "w-5 h-5"
|
|
2566
2564
|
};
|
|
2567
|
-
var RangeSlider =
|
|
2565
|
+
var RangeSlider = React86__default.forwardRef(
|
|
2568
2566
|
({
|
|
2569
2567
|
className,
|
|
2570
2568
|
min = 0,
|
|
@@ -3094,7 +3092,7 @@ var paddingClasses = {
|
|
|
3094
3092
|
md: "py-16",
|
|
3095
3093
|
lg: "py-24"
|
|
3096
3094
|
};
|
|
3097
|
-
var ContentSection =
|
|
3095
|
+
var ContentSection = React86__default.forwardRef(
|
|
3098
3096
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
3099
3097
|
return /* @__PURE__ */ jsx(
|
|
3100
3098
|
Box,
|
|
@@ -3197,9 +3195,9 @@ function ScoreDisplay({
|
|
|
3197
3195
|
...rest
|
|
3198
3196
|
}) {
|
|
3199
3197
|
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
|
-
|
|
3198
|
+
const [displayValue, setDisplayValue] = React86.useState(resolvedValue);
|
|
3199
|
+
const [isAnimating, setIsAnimating] = React86.useState(false);
|
|
3200
|
+
React86.useEffect(() => {
|
|
3203
3201
|
if (!animated || displayValue === resolvedValue) {
|
|
3204
3202
|
setDisplayValue(resolvedValue);
|
|
3205
3203
|
return;
|
|
@@ -3272,9 +3270,9 @@ function ControlButton({
|
|
|
3272
3270
|
className
|
|
3273
3271
|
}) {
|
|
3274
3272
|
const eventBus = useEventBus();
|
|
3275
|
-
const [isPressed, setIsPressed] =
|
|
3273
|
+
const [isPressed, setIsPressed] = React86.useState(false);
|
|
3276
3274
|
const actualPressed = pressed ?? isPressed;
|
|
3277
|
-
const handlePointerDown =
|
|
3275
|
+
const handlePointerDown = React86.useCallback(
|
|
3278
3276
|
(e) => {
|
|
3279
3277
|
e.preventDefault();
|
|
3280
3278
|
if (disabled) return;
|
|
@@ -3284,7 +3282,7 @@ function ControlButton({
|
|
|
3284
3282
|
},
|
|
3285
3283
|
[disabled, pressEvent, eventBus, onPress]
|
|
3286
3284
|
);
|
|
3287
|
-
const handlePointerUp =
|
|
3285
|
+
const handlePointerUp = React86.useCallback(
|
|
3288
3286
|
(e) => {
|
|
3289
3287
|
e.preventDefault();
|
|
3290
3288
|
if (disabled) return;
|
|
@@ -3294,7 +3292,7 @@ function ControlButton({
|
|
|
3294
3292
|
},
|
|
3295
3293
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
3296
3294
|
);
|
|
3297
|
-
const handlePointerLeave =
|
|
3295
|
+
const handlePointerLeave = React86.useCallback(
|
|
3298
3296
|
(e) => {
|
|
3299
3297
|
if (isPressed) {
|
|
3300
3298
|
setIsPressed(false);
|
|
@@ -4120,9 +4118,9 @@ function MiniMap({
|
|
|
4120
4118
|
viewportRect,
|
|
4121
4119
|
className
|
|
4122
4120
|
}) {
|
|
4123
|
-
const canvasRef =
|
|
4124
|
-
const frameRef =
|
|
4125
|
-
|
|
4121
|
+
const canvasRef = React86.useRef(null);
|
|
4122
|
+
const frameRef = React86.useRef(0);
|
|
4123
|
+
React86.useEffect(() => {
|
|
4126
4124
|
const canvas = canvasRef.current;
|
|
4127
4125
|
if (!canvas) return;
|
|
4128
4126
|
const ctx = canvas.getContext("2d");
|
|
@@ -4363,7 +4361,7 @@ var ErrorState = ({
|
|
|
4363
4361
|
);
|
|
4364
4362
|
};
|
|
4365
4363
|
ErrorState.displayName = "ErrorState";
|
|
4366
|
-
var ErrorBoundary = class extends
|
|
4364
|
+
var ErrorBoundary = class extends React86__default.Component {
|
|
4367
4365
|
constructor(props) {
|
|
4368
4366
|
super(props);
|
|
4369
4367
|
__publicField(this, "reset", () => {
|
|
@@ -6099,8 +6097,8 @@ var Menu = ({
|
|
|
6099
6097
|
"bottom-start": "top-full left-0 mt-2",
|
|
6100
6098
|
"bottom-end": "top-full right-0 mt-2"
|
|
6101
6099
|
};
|
|
6102
|
-
const triggerChild =
|
|
6103
|
-
const triggerElement =
|
|
6100
|
+
const triggerChild = React86__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6101
|
+
const triggerElement = React86__default.cloneElement(
|
|
6104
6102
|
triggerChild,
|
|
6105
6103
|
{
|
|
6106
6104
|
ref: triggerRef,
|
|
@@ -6605,8 +6603,8 @@ var Popover = ({
|
|
|
6605
6603
|
onMouseEnter: handleOpen,
|
|
6606
6604
|
onMouseLeave: handleClose
|
|
6607
6605
|
};
|
|
6608
|
-
const childElement =
|
|
6609
|
-
const triggerElement =
|
|
6606
|
+
const childElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6607
|
+
const triggerElement = React86__default.cloneElement(
|
|
6610
6608
|
childElement,
|
|
6611
6609
|
{
|
|
6612
6610
|
ref: triggerRef,
|
|
@@ -7361,8 +7359,8 @@ var Tooltip = ({
|
|
|
7361
7359
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
7362
7360
|
};
|
|
7363
7361
|
}, []);
|
|
7364
|
-
const triggerElement =
|
|
7365
|
-
const trigger =
|
|
7362
|
+
const triggerElement = React86__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7363
|
+
const trigger = React86__default.cloneElement(triggerElement, {
|
|
7366
7364
|
ref: triggerRef,
|
|
7367
7365
|
onMouseEnter: handleMouseEnter,
|
|
7368
7366
|
onMouseLeave: handleMouseLeave,
|
|
@@ -7611,7 +7609,7 @@ var WizardProgress = ({
|
|
|
7611
7609
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
7612
7610
|
const isActive = index === currentStep;
|
|
7613
7611
|
const isCompleted = index < currentStep;
|
|
7614
|
-
return /* @__PURE__ */ jsxs(
|
|
7612
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
7615
7613
|
/* @__PURE__ */ jsx(
|
|
7616
7614
|
"button",
|
|
7617
7615
|
{
|
|
@@ -7741,7 +7739,7 @@ var WizardNavigation = ({
|
|
|
7741
7739
|
);
|
|
7742
7740
|
};
|
|
7743
7741
|
WizardNavigation.displayName = "WizardNavigation";
|
|
7744
|
-
var MarkdownContent =
|
|
7742
|
+
var MarkdownContent = React86__default.memo(
|
|
7745
7743
|
({ content, direction, className }) => {
|
|
7746
7744
|
const { t: _t } = useTranslate();
|
|
7747
7745
|
return /* @__PURE__ */ jsx(
|
|
@@ -7842,7 +7840,7 @@ var MarkdownContent = React87__default.memo(
|
|
|
7842
7840
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
7843
7841
|
);
|
|
7844
7842
|
MarkdownContent.displayName = "MarkdownContent";
|
|
7845
|
-
var CodeBlock =
|
|
7843
|
+
var CodeBlock = React86__default.memo(
|
|
7846
7844
|
({
|
|
7847
7845
|
code,
|
|
7848
7846
|
language = "text",
|
|
@@ -8962,8 +8960,8 @@ function DPad({
|
|
|
8962
8960
|
}) {
|
|
8963
8961
|
const eventBus = useEventBus();
|
|
8964
8962
|
const sizes = sizeMap15[size];
|
|
8965
|
-
const [activeDirections, setActiveDirections] =
|
|
8966
|
-
const handlePress =
|
|
8963
|
+
const [activeDirections, setActiveDirections] = React86.useState(/* @__PURE__ */ new Set());
|
|
8964
|
+
const handlePress = React86.useCallback(
|
|
8967
8965
|
(direction) => {
|
|
8968
8966
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
8969
8967
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -8971,7 +8969,7 @@ function DPad({
|
|
|
8971
8969
|
},
|
|
8972
8970
|
[directionEvent, eventBus, onDirection]
|
|
8973
8971
|
);
|
|
8974
|
-
const handleRelease =
|
|
8972
|
+
const handleRelease = React86.useCallback(
|
|
8975
8973
|
(direction) => {
|
|
8976
8974
|
setActiveDirections((prev) => {
|
|
8977
8975
|
const next = new Set(prev);
|
|
@@ -9029,8 +9027,8 @@ function ActionButtons({
|
|
|
9029
9027
|
disabled
|
|
9030
9028
|
}) {
|
|
9031
9029
|
const eventBus = useEventBus();
|
|
9032
|
-
const [activeButtons, setActiveButtons] =
|
|
9033
|
-
const handlePress =
|
|
9030
|
+
const [activeButtons, setActiveButtons] = React86.useState(/* @__PURE__ */ new Set());
|
|
9031
|
+
const handlePress = React86.useCallback(
|
|
9034
9032
|
(id) => {
|
|
9035
9033
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
9036
9034
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -9038,7 +9036,7 @@ function ActionButtons({
|
|
|
9038
9036
|
},
|
|
9039
9037
|
[actionEvent, eventBus, onAction]
|
|
9040
9038
|
);
|
|
9041
|
-
const handleRelease =
|
|
9039
|
+
const handleRelease = React86.useCallback(
|
|
9042
9040
|
(id) => {
|
|
9043
9041
|
setActiveButtons((prev) => {
|
|
9044
9042
|
const next = new Set(prev);
|
|
@@ -9223,7 +9221,7 @@ function InventoryGrid({
|
|
|
9223
9221
|
const eventBus = useEventBus();
|
|
9224
9222
|
const slotCount = totalSlots ?? items.length;
|
|
9225
9223
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
9226
|
-
const handleSelect =
|
|
9224
|
+
const handleSelect = React86.useCallback(
|
|
9227
9225
|
(id) => {
|
|
9228
9226
|
onSelect?.(id);
|
|
9229
9227
|
if (selectEvent) {
|
|
@@ -9347,7 +9345,7 @@ function CraftingRecipe({
|
|
|
9347
9345
|
className
|
|
9348
9346
|
}) {
|
|
9349
9347
|
const eventBus = useEventBus();
|
|
9350
|
-
const handleCraft =
|
|
9348
|
+
const handleCraft = React86.useCallback(() => {
|
|
9351
9349
|
onCraft?.();
|
|
9352
9350
|
if (craftEvent) {
|
|
9353
9351
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -9364,7 +9362,7 @@ function CraftingRecipe({
|
|
|
9364
9362
|
children: [
|
|
9365
9363
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
9366
9364
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
9367
|
-
return /* @__PURE__ */ jsxs(
|
|
9365
|
+
return /* @__PURE__ */ jsxs(React86.Fragment, { children: [
|
|
9368
9366
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
9369
9367
|
ItemSlot,
|
|
9370
9368
|
{
|
|
@@ -9466,15 +9464,15 @@ function GameCanvas2D({
|
|
|
9466
9464
|
fps = 60,
|
|
9467
9465
|
className
|
|
9468
9466
|
}) {
|
|
9469
|
-
const canvasRef =
|
|
9470
|
-
const rafRef =
|
|
9471
|
-
const frameRef =
|
|
9472
|
-
const lastTimeRef =
|
|
9473
|
-
const onDrawRef =
|
|
9467
|
+
const canvasRef = React86.useRef(null);
|
|
9468
|
+
const rafRef = React86.useRef(0);
|
|
9469
|
+
const frameRef = React86.useRef(0);
|
|
9470
|
+
const lastTimeRef = React86.useRef(0);
|
|
9471
|
+
const onDrawRef = React86.useRef(onDraw);
|
|
9474
9472
|
onDrawRef.current = onDraw;
|
|
9475
|
-
const onTickRef =
|
|
9473
|
+
const onTickRef = React86.useRef(onTick);
|
|
9476
9474
|
onTickRef.current = onTick;
|
|
9477
|
-
|
|
9475
|
+
React86.useEffect(() => {
|
|
9478
9476
|
const canvas = canvasRef.current;
|
|
9479
9477
|
if (!canvas) return;
|
|
9480
9478
|
const ctx = canvas.getContext("2d");
|
|
@@ -9722,7 +9720,7 @@ function TurnPanel({
|
|
|
9722
9720
|
className
|
|
9723
9721
|
}) {
|
|
9724
9722
|
const eventBus = useEventBus();
|
|
9725
|
-
const handleAction =
|
|
9723
|
+
const handleAction = React86.useCallback(
|
|
9726
9724
|
(event) => {
|
|
9727
9725
|
if (event) {
|
|
9728
9726
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -9847,7 +9845,7 @@ function UnitCommandBar({
|
|
|
9847
9845
|
className
|
|
9848
9846
|
}) {
|
|
9849
9847
|
const eventBus = useEventBus();
|
|
9850
|
-
const handleCommand =
|
|
9848
|
+
const handleCommand = React86.useCallback(
|
|
9851
9849
|
(event) => {
|
|
9852
9850
|
if (event) {
|
|
9853
9851
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -10385,7 +10383,7 @@ function GameMenu({
|
|
|
10385
10383
|
} catch {
|
|
10386
10384
|
}
|
|
10387
10385
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
10388
|
-
const handleOptionClick =
|
|
10386
|
+
const handleOptionClick = React86.useCallback(
|
|
10389
10387
|
(option) => {
|
|
10390
10388
|
if (option.event && eventBus) {
|
|
10391
10389
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -10508,7 +10506,7 @@ function GameOverScreen({
|
|
|
10508
10506
|
} catch {
|
|
10509
10507
|
}
|
|
10510
10508
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
10511
|
-
const handleActionClick =
|
|
10509
|
+
const handleActionClick = React86.useCallback(
|
|
10512
10510
|
(action) => {
|
|
10513
10511
|
if (action.event && eventBus) {
|
|
10514
10512
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -13309,7 +13307,7 @@ var DataList = ({
|
|
|
13309
13307
|
}) => {
|
|
13310
13308
|
const eventBus = useEventBus();
|
|
13311
13309
|
const { t } = useTranslate();
|
|
13312
|
-
const [visibleCount, setVisibleCount] =
|
|
13310
|
+
const [visibleCount, setVisibleCount] = React86__default.useState(pageSize || Infinity);
|
|
13313
13311
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
13314
13312
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
13315
13313
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -13346,7 +13344,7 @@ var DataList = ({
|
|
|
13346
13344
|
const items2 = data.map((item) => item);
|
|
13347
13345
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
13348
13346
|
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(
|
|
13347
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
13350
13348
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
13351
13349
|
group.items.map((itemData, index) => {
|
|
13352
13350
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -13549,7 +13547,7 @@ var DataList = ({
|
|
|
13549
13547
|
className
|
|
13550
13548
|
),
|
|
13551
13549
|
children: [
|
|
13552
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
13550
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
13553
13551
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
13554
13552
|
group.items.map(
|
|
13555
13553
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -14877,8 +14875,14 @@ var HeroSection = ({
|
|
|
14877
14875
|
),
|
|
14878
14876
|
installCommand && /* @__PURE__ */ jsx(InstallBox, { command: installCommand }),
|
|
14879
14877
|
(primaryAction || secondaryAction) && /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "center", children: [
|
|
14880
|
-
primaryAction && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "lg",
|
|
14881
|
-
|
|
14878
|
+
primaryAction && /* @__PURE__ */ jsx(Button, { variant: "primary", size: "lg", onClick: () => {
|
|
14879
|
+
const external = primaryAction.href.startsWith("http");
|
|
14880
|
+
window.open(primaryAction.href, external ? "_blank" : "_self");
|
|
14881
|
+
}, children: primaryAction.label }),
|
|
14882
|
+
secondaryAction && /* @__PURE__ */ jsx(Button, { variant: "secondary", size: "lg", onClick: () => {
|
|
14883
|
+
const external = secondaryAction.href.startsWith("http");
|
|
14884
|
+
window.open(secondaryAction.href, external ? "_blank" : "_self");
|
|
14885
|
+
}, children: secondaryAction.label })
|
|
14882
14886
|
] }),
|
|
14883
14887
|
children
|
|
14884
14888
|
]
|
|
@@ -15271,7 +15275,7 @@ var StepFlow = ({
|
|
|
15271
15275
|
className
|
|
15272
15276
|
}) => {
|
|
15273
15277
|
if (orientation === "vertical") {
|
|
15274
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
15278
|
+
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
15279
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
15276
15280
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
15277
15281
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-[var(--color-border)]" })
|
|
@@ -15282,7 +15286,7 @@ var StepFlow = ({
|
|
|
15282
15286
|
] })
|
|
15283
15287
|
] }) }, index)) });
|
|
15284
15288
|
}
|
|
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(
|
|
15289
|
+
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
15290
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
15287
15291
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
15288
15292
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -15917,7 +15921,7 @@ var StatCard = ({
|
|
|
15917
15921
|
const labelToUse = propLabel ?? propTitle;
|
|
15918
15922
|
const eventBus = useEventBus();
|
|
15919
15923
|
const { t } = useTranslate();
|
|
15920
|
-
const handleActionClick =
|
|
15924
|
+
const handleActionClick = React86__default.useCallback(() => {
|
|
15921
15925
|
if (action?.event) {
|
|
15922
15926
|
eventBus.emit(`UI:${action.event}`, {});
|
|
15923
15927
|
}
|
|
@@ -15928,7 +15932,7 @@ var StatCard = ({
|
|
|
15928
15932
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
15929
15933
|
const isLoading = externalLoading ?? false;
|
|
15930
15934
|
const error = externalError;
|
|
15931
|
-
const computeMetricValue =
|
|
15935
|
+
const computeMetricValue = React86__default.useCallback(
|
|
15932
15936
|
(metric, items) => {
|
|
15933
15937
|
if (metric.value !== void 0) {
|
|
15934
15938
|
return metric.value;
|
|
@@ -15967,7 +15971,7 @@ var StatCard = ({
|
|
|
15967
15971
|
},
|
|
15968
15972
|
[]
|
|
15969
15973
|
);
|
|
15970
|
-
const schemaStats =
|
|
15974
|
+
const schemaStats = React86__default.useMemo(() => {
|
|
15971
15975
|
if (!metrics || metrics.length === 0) return null;
|
|
15972
15976
|
return metrics.map((metric) => ({
|
|
15973
15977
|
label: metric.label,
|
|
@@ -15975,7 +15979,7 @@ var StatCard = ({
|
|
|
15975
15979
|
format: metric.format
|
|
15976
15980
|
}));
|
|
15977
15981
|
}, [metrics, data, computeMetricValue]);
|
|
15978
|
-
const calculatedTrend =
|
|
15982
|
+
const calculatedTrend = React86__default.useMemo(() => {
|
|
15979
15983
|
if (manualTrend !== void 0) return manualTrend;
|
|
15980
15984
|
if (previousValue === void 0 || currentValue === void 0)
|
|
15981
15985
|
return void 0;
|
|
@@ -16139,7 +16143,7 @@ var PageHeader = ({
|
|
|
16139
16143
|
info: "bg-[var(--color-info)]/10 text-[var(--color-info)]"
|
|
16140
16144
|
};
|
|
16141
16145
|
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(
|
|
16146
|
+
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
16147
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
16144
16148
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
16145
16149
|
"a",
|
|
@@ -16665,7 +16669,7 @@ var FormSection = ({
|
|
|
16665
16669
|
columns = 1,
|
|
16666
16670
|
className
|
|
16667
16671
|
}) => {
|
|
16668
|
-
const [collapsed, setCollapsed] =
|
|
16672
|
+
const [collapsed, setCollapsed] = React86__default.useState(defaultCollapsed);
|
|
16669
16673
|
const { t } = useTranslate();
|
|
16670
16674
|
const eventBus = useEventBus();
|
|
16671
16675
|
const gridClass = {
|
|
@@ -16673,7 +16677,7 @@ var FormSection = ({
|
|
|
16673
16677
|
2: "grid-cols-1 md:grid-cols-2",
|
|
16674
16678
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
16675
16679
|
}[columns];
|
|
16676
|
-
|
|
16680
|
+
React86__default.useCallback(() => {
|
|
16677
16681
|
if (collapsible) {
|
|
16678
16682
|
setCollapsed((prev) => !prev);
|
|
16679
16683
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -16885,7 +16889,7 @@ var Form = ({
|
|
|
16885
16889
|
const normalizedInitialData = initialData ?? {};
|
|
16886
16890
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
16887
16891
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
16888
|
-
const entityDerivedFields =
|
|
16892
|
+
const entityDerivedFields = React86__default.useMemo(() => {
|
|
16889
16893
|
if (fields && fields.length > 0) return void 0;
|
|
16890
16894
|
if (!resolvedEntity) return void 0;
|
|
16891
16895
|
return resolvedEntity.fields.map(
|
|
@@ -16904,14 +16908,14 @@ var Form = ({
|
|
|
16904
16908
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
16905
16909
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
16906
16910
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
16907
|
-
const [formData, setFormData] =
|
|
16911
|
+
const [formData, setFormData] = React86__default.useState(
|
|
16908
16912
|
normalizedInitialData
|
|
16909
16913
|
);
|
|
16910
|
-
const [collapsedSections, setCollapsedSections] =
|
|
16914
|
+
const [collapsedSections, setCollapsedSections] = React86__default.useState(
|
|
16911
16915
|
/* @__PURE__ */ new Set()
|
|
16912
16916
|
);
|
|
16913
16917
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
16914
|
-
const evalContext =
|
|
16918
|
+
const evalContext = React86__default.useMemo(
|
|
16915
16919
|
() => ({
|
|
16916
16920
|
formValues: formData,
|
|
16917
16921
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -16920,13 +16924,13 @@ var Form = ({
|
|
|
16920
16924
|
}),
|
|
16921
16925
|
[formData, externalContext]
|
|
16922
16926
|
);
|
|
16923
|
-
|
|
16927
|
+
React86__default.useEffect(() => {
|
|
16924
16928
|
const data = initialData;
|
|
16925
16929
|
if (data && Object.keys(data).length > 0) {
|
|
16926
16930
|
setFormData(data);
|
|
16927
16931
|
}
|
|
16928
16932
|
}, [initialData]);
|
|
16929
|
-
const processCalculations =
|
|
16933
|
+
const processCalculations = React86__default.useCallback(
|
|
16930
16934
|
(changedFieldId, newFormData) => {
|
|
16931
16935
|
if (!hiddenCalculations.length) return;
|
|
16932
16936
|
const context = {
|
|
@@ -16951,7 +16955,7 @@ var Form = ({
|
|
|
16951
16955
|
},
|
|
16952
16956
|
[hiddenCalculations, externalContext, eventBus]
|
|
16953
16957
|
);
|
|
16954
|
-
const checkViolations =
|
|
16958
|
+
const checkViolations = React86__default.useCallback(
|
|
16955
16959
|
(changedFieldId, newFormData) => {
|
|
16956
16960
|
if (!violationTriggers.length) return;
|
|
16957
16961
|
const context = {
|
|
@@ -16988,7 +16992,7 @@ var Form = ({
|
|
|
16988
16992
|
processCalculations(name, newFormData);
|
|
16989
16993
|
checkViolations(name, newFormData);
|
|
16990
16994
|
};
|
|
16991
|
-
const isFieldVisible =
|
|
16995
|
+
const isFieldVisible = React86__default.useCallback(
|
|
16992
16996
|
(fieldName) => {
|
|
16993
16997
|
const condition = conditionalFields[fieldName];
|
|
16994
16998
|
if (!condition) return true;
|
|
@@ -16996,7 +17000,7 @@ var Form = ({
|
|
|
16996
17000
|
},
|
|
16997
17001
|
[conditionalFields, evalContext]
|
|
16998
17002
|
);
|
|
16999
|
-
const isSectionVisible =
|
|
17003
|
+
const isSectionVisible = React86__default.useCallback(
|
|
17000
17004
|
(section) => {
|
|
17001
17005
|
if (!section.condition) return true;
|
|
17002
17006
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -17028,7 +17032,7 @@ var Form = ({
|
|
|
17028
17032
|
eventBus.emit(`UI:${onCancel}`);
|
|
17029
17033
|
}
|
|
17030
17034
|
};
|
|
17031
|
-
const renderField =
|
|
17035
|
+
const renderField = React86__default.useCallback(
|
|
17032
17036
|
(field) => {
|
|
17033
17037
|
const fieldName = field.name || field.field;
|
|
17034
17038
|
if (!fieldName) return null;
|
|
@@ -17049,7 +17053,7 @@ var Form = ({
|
|
|
17049
17053
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
17050
17054
|
);
|
|
17051
17055
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
17052
|
-
const normalizedFields =
|
|
17056
|
+
const normalizedFields = React86__default.useMemo(() => {
|
|
17053
17057
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
17054
17058
|
return effectiveFields.map((field) => {
|
|
17055
17059
|
if (typeof field === "string") {
|
|
@@ -17071,7 +17075,7 @@ var Form = ({
|
|
|
17071
17075
|
return field;
|
|
17072
17076
|
});
|
|
17073
17077
|
}, [effectiveFields, resolvedEntity]);
|
|
17074
|
-
const schemaFields =
|
|
17078
|
+
const schemaFields = React86__default.useMemo(() => {
|
|
17075
17079
|
if (normalizedFields.length === 0) return null;
|
|
17076
17080
|
if (isDebugEnabled()) {
|
|
17077
17081
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -17081,7 +17085,7 @@ var Form = ({
|
|
|
17081
17085
|
}
|
|
17082
17086
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
17083
17087
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
17084
|
-
const sectionElements =
|
|
17088
|
+
const sectionElements = React86__default.useMemo(() => {
|
|
17085
17089
|
if (!sections || sections.length === 0) return null;
|
|
17086
17090
|
return sections.map((section) => {
|
|
17087
17091
|
if (!isSectionVisible(section)) {
|
|
@@ -18206,7 +18210,7 @@ var List = ({
|
|
|
18206
18210
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
18207
18211
|
return [];
|
|
18208
18212
|
}, [entity]);
|
|
18209
|
-
const getItemActions =
|
|
18213
|
+
const getItemActions = React86__default.useCallback(
|
|
18210
18214
|
(item) => {
|
|
18211
18215
|
if (!itemActions) return [];
|
|
18212
18216
|
if (typeof itemActions === "function") {
|
|
@@ -18972,7 +18976,7 @@ var WizardContainer = ({
|
|
|
18972
18976
|
const isCompleted = index < currentStep;
|
|
18973
18977
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
18974
18978
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
18975
|
-
return /* @__PURE__ */ jsxs(
|
|
18979
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
18976
18980
|
/* @__PURE__ */ jsx(
|
|
18977
18981
|
Button,
|
|
18978
18982
|
{
|
|
@@ -20196,7 +20200,7 @@ var StateMachineView = ({
|
|
|
20196
20200
|
style: { top: title ? 30 : 0 },
|
|
20197
20201
|
children: [
|
|
20198
20202
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
20199
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
20203
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React86__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
20200
20204
|
StateNode,
|
|
20201
20205
|
{
|
|
20202
20206
|
state,
|
|
@@ -24642,7 +24646,7 @@ function LinearView({
|
|
|
24642
24646
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
24643
24647
|
const isDone = i < currentIdx;
|
|
24644
24648
|
const isCurrent = i === currentIdx;
|
|
24645
|
-
return /* @__PURE__ */ jsxs(
|
|
24649
|
+
return /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
24646
24650
|
i > 0 && /* @__PURE__ */ jsx(
|
|
24647
24651
|
Typography,
|
|
24648
24652
|
{
|
|
@@ -25296,7 +25300,7 @@ function SequenceBar({
|
|
|
25296
25300
|
onSlotRemove(index);
|
|
25297
25301
|
}, [onSlotRemove, playing]);
|
|
25298
25302
|
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(
|
|
25303
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React86__default.Fragment, { children: [
|
|
25300
25304
|
i > 0 && /* @__PURE__ */ jsx(
|
|
25301
25305
|
Typography,
|
|
25302
25306
|
{
|
|
@@ -27784,7 +27788,7 @@ function InputPattern({
|
|
|
27784
27788
|
className
|
|
27785
27789
|
}) {
|
|
27786
27790
|
const { emit } = useEventBus();
|
|
27787
|
-
const [localValue, setLocalValue] =
|
|
27791
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27788
27792
|
const handleChange = (e) => {
|
|
27789
27793
|
setLocalValue(e.target.value);
|
|
27790
27794
|
if (onChange) {
|
|
@@ -27821,7 +27825,7 @@ function TextareaPattern({
|
|
|
27821
27825
|
className
|
|
27822
27826
|
}) {
|
|
27823
27827
|
const { emit } = useEventBus();
|
|
27824
|
-
const [localValue, setLocalValue] =
|
|
27828
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27825
27829
|
const handleChange = (e) => {
|
|
27826
27830
|
setLocalValue(e.target.value);
|
|
27827
27831
|
if (onChange) {
|
|
@@ -27852,7 +27856,7 @@ function SelectPattern({
|
|
|
27852
27856
|
className
|
|
27853
27857
|
}) {
|
|
27854
27858
|
const { emit } = useEventBus();
|
|
27855
|
-
const [localValue, setLocalValue] =
|
|
27859
|
+
const [localValue, setLocalValue] = React86__default.useState(value);
|
|
27856
27860
|
const handleChange = (e) => {
|
|
27857
27861
|
setLocalValue(e.target.value);
|
|
27858
27862
|
if (onChange) {
|
|
@@ -27881,7 +27885,7 @@ function CheckboxPattern({
|
|
|
27881
27885
|
className
|
|
27882
27886
|
}) {
|
|
27883
27887
|
const { emit } = useEventBus();
|
|
27884
|
-
const [localChecked, setLocalChecked] =
|
|
27888
|
+
const [localChecked, setLocalChecked] = React86__default.useState(checked);
|
|
27885
27889
|
const handleChange = (e) => {
|
|
27886
27890
|
setLocalChecked(e.target.checked);
|
|
27887
27891
|
if (onChange) {
|
|
@@ -29763,7 +29767,7 @@ var DocumentViewer = ({
|
|
|
29763
29767
|
};
|
|
29764
29768
|
DocumentViewer.displayName = "DocumentViewer";
|
|
29765
29769
|
function extractTitle(children) {
|
|
29766
|
-
if (!
|
|
29770
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
29767
29771
|
const props = children.props;
|
|
29768
29772
|
if (typeof props.title === "string") {
|
|
29769
29773
|
return props.title;
|
|
@@ -30361,7 +30365,7 @@ var MediaGallery = ({
|
|
|
30361
30365
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
30362
30366
|
);
|
|
30363
30367
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30364
|
-
const items =
|
|
30368
|
+
const items = React86__default.useMemo(() => {
|
|
30365
30369
|
if (propItems) return propItems;
|
|
30366
30370
|
if (entityData.length === 0) return [];
|
|
30367
30371
|
return entityData.map((record, idx) => ({
|
|
@@ -30523,7 +30527,7 @@ var MediaGallery = ({
|
|
|
30523
30527
|
};
|
|
30524
30528
|
MediaGallery.displayName = "MediaGallery";
|
|
30525
30529
|
function extractTitle2(children) {
|
|
30526
|
-
if (!
|
|
30530
|
+
if (!React86__default.isValidElement(children)) return void 0;
|
|
30527
30531
|
const props = children.props;
|
|
30528
30532
|
if (typeof props.title === "string") {
|
|
30529
30533
|
return props.title;
|
|
@@ -30609,7 +30613,7 @@ function subscribeToDebugEvents(listener) {
|
|
|
30609
30613
|
|
|
30610
30614
|
// components/organisms/debug/hooks/useDebugData.ts
|
|
30611
30615
|
function useDebugData() {
|
|
30612
|
-
const [data, setData] =
|
|
30616
|
+
const [data, setData] = React86.useState(() => ({
|
|
30613
30617
|
traits: [],
|
|
30614
30618
|
ticks: [],
|
|
30615
30619
|
guards: [],
|
|
@@ -30623,7 +30627,7 @@ function useDebugData() {
|
|
|
30623
30627
|
},
|
|
30624
30628
|
lastUpdate: Date.now()
|
|
30625
30629
|
}));
|
|
30626
|
-
|
|
30630
|
+
React86.useEffect(() => {
|
|
30627
30631
|
const updateData = () => {
|
|
30628
30632
|
setData({
|
|
30629
30633
|
traits: getAllTraits(),
|
|
@@ -30892,15 +30896,15 @@ var TYPE_BADGES = {
|
|
|
30892
30896
|
state: { variant: "danger", icon: "\u{1F4CA}" }
|
|
30893
30897
|
};
|
|
30894
30898
|
function EventFlowTab({ events: events2 }) {
|
|
30895
|
-
const [filter, setFilter] =
|
|
30896
|
-
const containerRef =
|
|
30897
|
-
const [autoScroll, setAutoScroll] =
|
|
30898
|
-
|
|
30899
|
+
const [filter, setFilter] = React86.useState("all");
|
|
30900
|
+
const containerRef = React86.useRef(null);
|
|
30901
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
30902
|
+
React86.useEffect(() => {
|
|
30899
30903
|
if (autoScroll && containerRef.current) {
|
|
30900
30904
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
30901
30905
|
}
|
|
30902
30906
|
}, [events2.length, autoScroll]);
|
|
30903
|
-
const filteredEvents =
|
|
30907
|
+
const filteredEvents = React86.useMemo(() => {
|
|
30904
30908
|
if (filter === "all") return events2;
|
|
30905
30909
|
return events2.filter((e) => e.type === filter);
|
|
30906
30910
|
}, [events2, filter]);
|
|
@@ -30999,7 +31003,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
30999
31003
|
}
|
|
31000
31004
|
EventFlowTab.displayName = "EventFlowTab";
|
|
31001
31005
|
function GuardsPanel({ guards }) {
|
|
31002
|
-
const [filter, setFilter] =
|
|
31006
|
+
const [filter, setFilter] = React86.useState("all");
|
|
31003
31007
|
if (guards.length === 0) {
|
|
31004
31008
|
return /* @__PURE__ */ jsx(
|
|
31005
31009
|
EmptyState,
|
|
@@ -31012,7 +31016,7 @@ function GuardsPanel({ guards }) {
|
|
|
31012
31016
|
}
|
|
31013
31017
|
const passedCount = guards.filter((g) => g.result).length;
|
|
31014
31018
|
const failedCount = guards.length - passedCount;
|
|
31015
|
-
const filteredGuards =
|
|
31019
|
+
const filteredGuards = React86.useMemo(() => {
|
|
31016
31020
|
if (filter === "all") return guards;
|
|
31017
31021
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
31018
31022
|
return guards.filter((g) => !g.result);
|
|
@@ -31156,10 +31160,10 @@ function EffectBadge({ effect }) {
|
|
|
31156
31160
|
] });
|
|
31157
31161
|
}
|
|
31158
31162
|
function TransitionTimeline({ transitions: transitions2 }) {
|
|
31159
|
-
const containerRef =
|
|
31160
|
-
const [autoScroll, setAutoScroll] =
|
|
31161
|
-
const [expandedId, setExpandedId] =
|
|
31162
|
-
|
|
31163
|
+
const containerRef = React86.useRef(null);
|
|
31164
|
+
const [autoScroll, setAutoScroll] = React86.useState(true);
|
|
31165
|
+
const [expandedId, setExpandedId] = React86.useState(null);
|
|
31166
|
+
React86.useEffect(() => {
|
|
31163
31167
|
if (autoScroll && containerRef.current) {
|
|
31164
31168
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
31165
31169
|
}
|
|
@@ -31420,9 +31424,9 @@ function getAllEvents(traits2) {
|
|
|
31420
31424
|
}
|
|
31421
31425
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
31422
31426
|
const eventBus = useEventBus();
|
|
31423
|
-
const [log, setLog] =
|
|
31424
|
-
const prevStatesRef =
|
|
31425
|
-
|
|
31427
|
+
const [log, setLog] = React86.useState([]);
|
|
31428
|
+
const prevStatesRef = React86.useRef(/* @__PURE__ */ new Map());
|
|
31429
|
+
React86.useEffect(() => {
|
|
31426
31430
|
for (const trait of traits2) {
|
|
31427
31431
|
const prev = prevStatesRef.current.get(trait.id);
|
|
31428
31432
|
if (prev && prev !== trait.currentState) {
|
|
@@ -31505,10 +31509,10 @@ function RuntimeDebugger({
|
|
|
31505
31509
|
defaultTab,
|
|
31506
31510
|
schema
|
|
31507
31511
|
}) {
|
|
31508
|
-
const [isCollapsed, setIsCollapsed] =
|
|
31509
|
-
const [isVisible, setIsVisible] =
|
|
31512
|
+
const [isCollapsed, setIsCollapsed] = React86.useState(defaultCollapsed);
|
|
31513
|
+
const [isVisible, setIsVisible] = React86.useState(mode === "inline" || isDebugEnabled2());
|
|
31510
31514
|
const debugData = useDebugData();
|
|
31511
|
-
|
|
31515
|
+
React86.useEffect(() => {
|
|
31512
31516
|
if (mode === "inline") return;
|
|
31513
31517
|
return onDebugToggle((enabled) => {
|
|
31514
31518
|
setIsVisible(enabled);
|
|
@@ -31517,7 +31521,7 @@ function RuntimeDebugger({
|
|
|
31517
31521
|
}
|
|
31518
31522
|
});
|
|
31519
31523
|
}, [mode]);
|
|
31520
|
-
|
|
31524
|
+
React86.useEffect(() => {
|
|
31521
31525
|
if (mode === "inline") return;
|
|
31522
31526
|
const handleKeyDown = (e) => {
|
|
31523
31527
|
if (e.key === "`" && isVisible) {
|
|
@@ -31914,7 +31918,7 @@ var Timeline = ({
|
|
|
31914
31918
|
}) => {
|
|
31915
31919
|
const { t } = useTranslate();
|
|
31916
31920
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
31917
|
-
const items =
|
|
31921
|
+
const items = React86__default.useMemo(() => {
|
|
31918
31922
|
if (propItems) return propItems;
|
|
31919
31923
|
if (entityData.length === 0) return [];
|
|
31920
31924
|
return entityData.map((record, idx) => {
|
|
@@ -32016,7 +32020,7 @@ var Timeline = ({
|
|
|
32016
32020
|
};
|
|
32017
32021
|
Timeline.displayName = "Timeline";
|
|
32018
32022
|
function extractToastProps(children) {
|
|
32019
|
-
if (!
|
|
32023
|
+
if (!React86__default.isValidElement(children)) {
|
|
32020
32024
|
if (typeof children === "string") {
|
|
32021
32025
|
return { message: children };
|
|
32022
32026
|
}
|
|
@@ -32047,7 +32051,7 @@ var ToastSlot = ({
|
|
|
32047
32051
|
eventBus.emit("UI:CLOSE");
|
|
32048
32052
|
};
|
|
32049
32053
|
if (!isVisible) return null;
|
|
32050
|
-
const isCustomContent =
|
|
32054
|
+
const isCustomContent = React86__default.isValidElement(children) && !message;
|
|
32051
32055
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
32052
32056
|
Toast,
|
|
32053
32057
|
{
|
|
@@ -32089,12 +32093,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
|
32089
32093
|
|
|
32090
32094
|
// components/organisms/component-registry.generated.ts
|
|
32091
32095
|
function lazyThree(name, loader) {
|
|
32092
|
-
const Lazy =
|
|
32096
|
+
const Lazy = React86__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
32093
32097
|
function ThreeWrapper(props) {
|
|
32094
|
-
return
|
|
32095
|
-
|
|
32098
|
+
return React86__default.createElement(
|
|
32099
|
+
React86__default.Suspense,
|
|
32096
32100
|
{ fallback: null },
|
|
32097
|
-
|
|
32101
|
+
React86__default.createElement(Lazy, props)
|
|
32098
32102
|
);
|
|
32099
32103
|
}
|
|
32100
32104
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -32382,7 +32386,7 @@ function SuspenseConfigProvider({
|
|
|
32382
32386
|
config,
|
|
32383
32387
|
children
|
|
32384
32388
|
}) {
|
|
32385
|
-
return
|
|
32389
|
+
return React86__default.createElement(
|
|
32386
32390
|
SuspenseConfigContext.Provider,
|
|
32387
32391
|
{ value: config },
|
|
32388
32392
|
children
|
|
@@ -34754,7 +34758,7 @@ function EntityDataProvider({
|
|
|
34754
34758
|
adapter,
|
|
34755
34759
|
children
|
|
34756
34760
|
}) {
|
|
34757
|
-
return
|
|
34761
|
+
return React86__default.createElement(
|
|
34758
34762
|
EntityDataContext.Provider,
|
|
34759
34763
|
{ value: adapter },
|
|
34760
34764
|
children
|