@almadar/ui 4.24.0 → 4.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +1457 -4340
- package/dist/avl/index.js +384 -3267
- package/dist/components/index.cjs +1105 -1135
- package/dist/components/index.js +207 -237
- package/dist/context/UISlotContext.d.ts +2 -2
- package/dist/hooks/useUISlots.d.ts +65 -7
- package/dist/providers/index.cjs +1036 -3878
- package/dist/providers/index.js +304 -3146
- package/dist/runtime/fn-form-lambda.d.ts +4 -3
- package/dist/runtime/index.cjs +1090 -3987
- package/dist/runtime/index.js +326 -3223
- package/package.json +6 -2
package/dist/components/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as React109 from 'react';
|
|
4
|
+
import React109__default, { useContext, useMemo, useRef, useEffect, useCallback, createContext, useState, Suspense, lazy, useSyncExternalStore, useLayoutEffect, useId } from 'react';
|
|
5
5
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
6
6
|
import * as LucideIcons from 'lucide-react';
|
|
7
|
-
import { Loader2, X, AlertTriangle, Info, AlertCircle, CheckCircle, ChevronDown, List, Printer, ChevronRight, ChevronLeft, XCircle, Wrench, RotateCcw, Send, Code, FileText, WrapText, Check, Copy,
|
|
7
|
+
import { Loader2, X, AlertTriangle, Info, AlertCircle, CheckCircle, ChevronDown, List, Printer, ChevronRight, ChevronLeft, XCircle, Wrench, RotateCcw, Send, Code, FileText, WrapText, Check, Copy, Trash2, Menu as Menu$1, Search, Bell, LogOut, ChevronUp, MoreHorizontal, Bug, ZoomOut, ZoomIn, Download, Pause, Play, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ArrowRight, ArrowLeft, Eraser, SkipForward, TrendingUp, TrendingDown, Minus, ArrowUp, ArrowDown, MoreVertical, Circle, Clock, CheckCircle2, HelpCircle, FileQuestion, Inbox, Plus, User, Filter, Star, FileWarning, Tag, DollarSign, Sun, Moon, Zap, Sword, Move, Heart, Shield } from 'lucide-react';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
9
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
10
|
-
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
11
10
|
import { createPortal } from 'react-dom';
|
|
12
11
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
13
12
|
import ReactMarkdown from 'react-markdown';
|
|
@@ -35,6 +34,7 @@ import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
|
|
|
35
34
|
import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
|
|
36
35
|
import { isInlineTrait } from '@almadar/core';
|
|
37
36
|
import { useUISlots } from '@almadar/ui/context';
|
|
37
|
+
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
38
38
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
39
39
|
|
|
40
40
|
var __defProp = Object.defineProperty;
|
|
@@ -368,7 +368,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
368
368
|
const IconComp = value;
|
|
369
369
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
370
370
|
}
|
|
371
|
-
if (
|
|
371
|
+
if (React109__default.isValidElement(value)) {
|
|
372
372
|
return value;
|
|
373
373
|
}
|
|
374
374
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -444,7 +444,7 @@ var init_Button = __esm({
|
|
|
444
444
|
md: "h-4 w-4",
|
|
445
445
|
lg: "h-5 w-5"
|
|
446
446
|
};
|
|
447
|
-
Button =
|
|
447
|
+
Button = React109__default.forwardRef(
|
|
448
448
|
({
|
|
449
449
|
className,
|
|
450
450
|
variant = "primary",
|
|
@@ -509,7 +509,7 @@ var Input;
|
|
|
509
509
|
var init_Input = __esm({
|
|
510
510
|
"components/atoms/Input.tsx"() {
|
|
511
511
|
init_cn();
|
|
512
|
-
Input =
|
|
512
|
+
Input = React109__default.forwardRef(
|
|
513
513
|
({
|
|
514
514
|
className,
|
|
515
515
|
inputType,
|
|
@@ -627,7 +627,7 @@ var Label;
|
|
|
627
627
|
var init_Label = __esm({
|
|
628
628
|
"components/atoms/Label.tsx"() {
|
|
629
629
|
init_cn();
|
|
630
|
-
Label =
|
|
630
|
+
Label = React109__default.forwardRef(
|
|
631
631
|
({ className, required, children, ...props }, ref) => {
|
|
632
632
|
return /* @__PURE__ */ jsxs(
|
|
633
633
|
"label",
|
|
@@ -653,7 +653,7 @@ var Textarea;
|
|
|
653
653
|
var init_Textarea = __esm({
|
|
654
654
|
"components/atoms/Textarea.tsx"() {
|
|
655
655
|
init_cn();
|
|
656
|
-
Textarea =
|
|
656
|
+
Textarea = React109__default.forwardRef(
|
|
657
657
|
({ className, error, ...props }, ref) => {
|
|
658
658
|
return /* @__PURE__ */ jsx(
|
|
659
659
|
"textarea",
|
|
@@ -682,7 +682,7 @@ var Select;
|
|
|
682
682
|
var init_Select = __esm({
|
|
683
683
|
"components/atoms/Select.tsx"() {
|
|
684
684
|
init_cn();
|
|
685
|
-
Select =
|
|
685
|
+
Select = React109__default.forwardRef(
|
|
686
686
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
687
687
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
688
688
|
/* @__PURE__ */ jsxs(
|
|
@@ -724,7 +724,7 @@ var Checkbox;
|
|
|
724
724
|
var init_Checkbox = __esm({
|
|
725
725
|
"components/atoms/Checkbox.tsx"() {
|
|
726
726
|
init_cn();
|
|
727
|
-
Checkbox =
|
|
727
|
+
Checkbox = React109__default.forwardRef(
|
|
728
728
|
({ className, label, id, ...props }, ref) => {
|
|
729
729
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
730
730
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -806,7 +806,7 @@ var init_Card = __esm({
|
|
|
806
806
|
md: "shadow",
|
|
807
807
|
lg: "shadow-lg"
|
|
808
808
|
};
|
|
809
|
-
Card =
|
|
809
|
+
Card = React109__default.forwardRef(
|
|
810
810
|
({
|
|
811
811
|
className,
|
|
812
812
|
variant = "bordered",
|
|
@@ -842,9 +842,9 @@ var init_Card = __esm({
|
|
|
842
842
|
}
|
|
843
843
|
);
|
|
844
844
|
Card.displayName = "Card";
|
|
845
|
-
CardHeader =
|
|
845
|
+
CardHeader = React109__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
846
846
|
CardHeader.displayName = "CardHeader";
|
|
847
|
-
CardTitle =
|
|
847
|
+
CardTitle = React109__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
848
848
|
"h3",
|
|
849
849
|
{
|
|
850
850
|
ref,
|
|
@@ -857,11 +857,11 @@ var init_Card = __esm({
|
|
|
857
857
|
}
|
|
858
858
|
));
|
|
859
859
|
CardTitle.displayName = "CardTitle";
|
|
860
|
-
CardContent =
|
|
860
|
+
CardContent = React109__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
861
861
|
CardContent.displayName = "CardContent";
|
|
862
862
|
CardBody = CardContent;
|
|
863
863
|
CardBody.displayName = "CardBody";
|
|
864
|
-
CardFooter =
|
|
864
|
+
CardFooter = React109__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
865
865
|
"div",
|
|
866
866
|
{
|
|
867
867
|
ref,
|
|
@@ -914,7 +914,7 @@ var init_Badge = __esm({
|
|
|
914
914
|
md: "px-2.5 py-1 text-sm",
|
|
915
915
|
lg: "px-3 py-1.5 text-base"
|
|
916
916
|
};
|
|
917
|
-
Badge =
|
|
917
|
+
Badge = React109__default.forwardRef(
|
|
918
918
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
919
919
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
920
920
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -953,7 +953,7 @@ var init_Spinner = __esm({
|
|
|
953
953
|
md: "h-6 w-6",
|
|
954
954
|
lg: "h-8 w-8"
|
|
955
955
|
};
|
|
956
|
-
Spinner =
|
|
956
|
+
Spinner = React109__default.forwardRef(
|
|
957
957
|
({ className, size = "md", ...props }, ref) => {
|
|
958
958
|
return /* @__PURE__ */ jsx(
|
|
959
959
|
"div",
|
|
@@ -1234,7 +1234,7 @@ var init_Box = __esm({
|
|
|
1234
1234
|
fixed: "fixed",
|
|
1235
1235
|
sticky: "sticky"
|
|
1236
1236
|
};
|
|
1237
|
-
Box =
|
|
1237
|
+
Box = React109__default.forwardRef(
|
|
1238
1238
|
({
|
|
1239
1239
|
padding,
|
|
1240
1240
|
paddingX,
|
|
@@ -1607,7 +1607,7 @@ var Radio;
|
|
|
1607
1607
|
var init_Radio = __esm({
|
|
1608
1608
|
"components/atoms/Radio.tsx"() {
|
|
1609
1609
|
init_cn();
|
|
1610
|
-
Radio =
|
|
1610
|
+
Radio = React109__default.forwardRef(
|
|
1611
1611
|
({
|
|
1612
1612
|
label,
|
|
1613
1613
|
helperText,
|
|
@@ -1718,7 +1718,7 @@ var init_Switch = __esm({
|
|
|
1718
1718
|
"components/atoms/Switch.tsx"() {
|
|
1719
1719
|
"use client";
|
|
1720
1720
|
init_cn();
|
|
1721
|
-
Switch =
|
|
1721
|
+
Switch = React109.forwardRef(
|
|
1722
1722
|
({
|
|
1723
1723
|
checked,
|
|
1724
1724
|
defaultChecked = false,
|
|
@@ -1729,10 +1729,10 @@ var init_Switch = __esm({
|
|
|
1729
1729
|
name,
|
|
1730
1730
|
className
|
|
1731
1731
|
}, ref) => {
|
|
1732
|
-
const [isChecked, setIsChecked] =
|
|
1732
|
+
const [isChecked, setIsChecked] = React109.useState(
|
|
1733
1733
|
checked !== void 0 ? checked : defaultChecked
|
|
1734
1734
|
);
|
|
1735
|
-
|
|
1735
|
+
React109.useEffect(() => {
|
|
1736
1736
|
if (checked !== void 0) {
|
|
1737
1737
|
setIsChecked(checked);
|
|
1738
1738
|
}
|
|
@@ -2617,8 +2617,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
2617
2617
|
position = "top",
|
|
2618
2618
|
className
|
|
2619
2619
|
}) => {
|
|
2620
|
-
const [isVisible, setIsVisible] =
|
|
2621
|
-
const timeoutRef =
|
|
2620
|
+
const [isVisible, setIsVisible] = React109__default.useState(false);
|
|
2621
|
+
const timeoutRef = React109__default.useRef(null);
|
|
2622
2622
|
const handleMouseEnter = () => {
|
|
2623
2623
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2624
2624
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -2627,7 +2627,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
2627
2627
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2628
2628
|
setIsVisible(false);
|
|
2629
2629
|
};
|
|
2630
|
-
|
|
2630
|
+
React109__default.useEffect(() => {
|
|
2631
2631
|
return () => {
|
|
2632
2632
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
2633
2633
|
};
|
|
@@ -2837,7 +2837,7 @@ var init_StatusDot = __esm({
|
|
|
2837
2837
|
md: "w-2.5 h-2.5",
|
|
2838
2838
|
lg: "w-3 h-3"
|
|
2839
2839
|
};
|
|
2840
|
-
StatusDot =
|
|
2840
|
+
StatusDot = React109__default.forwardRef(
|
|
2841
2841
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
2842
2842
|
return /* @__PURE__ */ jsx(
|
|
2843
2843
|
"span",
|
|
@@ -2890,7 +2890,7 @@ var init_TrendIndicator = __esm({
|
|
|
2890
2890
|
down: TrendingDown,
|
|
2891
2891
|
flat: ArrowRight
|
|
2892
2892
|
};
|
|
2893
|
-
TrendIndicator =
|
|
2893
|
+
TrendIndicator = React109__default.forwardRef(
|
|
2894
2894
|
({
|
|
2895
2895
|
className,
|
|
2896
2896
|
value,
|
|
@@ -2957,7 +2957,7 @@ var init_RangeSlider = __esm({
|
|
|
2957
2957
|
md: "w-4 h-4",
|
|
2958
2958
|
lg: "w-5 h-5"
|
|
2959
2959
|
};
|
|
2960
|
-
RangeSlider =
|
|
2960
|
+
RangeSlider = React109__default.forwardRef(
|
|
2961
2961
|
({
|
|
2962
2962
|
className,
|
|
2963
2963
|
min = 0,
|
|
@@ -3553,7 +3553,7 @@ var init_ContentSection = __esm({
|
|
|
3553
3553
|
md: "py-16",
|
|
3554
3554
|
lg: "py-24"
|
|
3555
3555
|
};
|
|
3556
|
-
ContentSection =
|
|
3556
|
+
ContentSection = React109__default.forwardRef(
|
|
3557
3557
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
3558
3558
|
return /* @__PURE__ */ jsx(
|
|
3559
3559
|
Box,
|
|
@@ -4087,7 +4087,7 @@ var init_AnimatedReveal = __esm({
|
|
|
4087
4087
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4088
4088
|
"none": {}
|
|
4089
4089
|
};
|
|
4090
|
-
AnimatedReveal =
|
|
4090
|
+
AnimatedReveal = React109__default.forwardRef(
|
|
4091
4091
|
({
|
|
4092
4092
|
trigger = "scroll",
|
|
4093
4093
|
animation = "fade-up",
|
|
@@ -4247,7 +4247,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4247
4247
|
"components/atoms/AnimatedGraphic.tsx"() {
|
|
4248
4248
|
"use client";
|
|
4249
4249
|
init_cn();
|
|
4250
|
-
AnimatedGraphic =
|
|
4250
|
+
AnimatedGraphic = React109__default.forwardRef(
|
|
4251
4251
|
({
|
|
4252
4252
|
src,
|
|
4253
4253
|
svgContent,
|
|
@@ -4270,7 +4270,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4270
4270
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
4271
4271
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
4272
4272
|
const prevAnimateRef = useRef(animate);
|
|
4273
|
-
const setRef =
|
|
4273
|
+
const setRef = React109__default.useCallback(
|
|
4274
4274
|
(node) => {
|
|
4275
4275
|
containerRef.current = node;
|
|
4276
4276
|
if (typeof ref === "function") ref(node);
|
|
@@ -5083,7 +5083,7 @@ var init_ErrorBoundary = __esm({
|
|
|
5083
5083
|
"use client";
|
|
5084
5084
|
init_cn();
|
|
5085
5085
|
init_ErrorState();
|
|
5086
|
-
ErrorBoundary = class extends
|
|
5086
|
+
ErrorBoundary = class extends React109__default.Component {
|
|
5087
5087
|
constructor(props) {
|
|
5088
5088
|
super(props);
|
|
5089
5089
|
__publicField(this, "reset", () => {
|
|
@@ -5246,33 +5246,6 @@ var init_Skeleton = __esm({
|
|
|
5246
5246
|
}
|
|
5247
5247
|
});
|
|
5248
5248
|
|
|
5249
|
-
// renderer/pattern-resolver.ts
|
|
5250
|
-
var init_pattern_resolver = __esm({
|
|
5251
|
-
"renderer/pattern-resolver.ts"() {
|
|
5252
|
-
}
|
|
5253
|
-
});
|
|
5254
|
-
|
|
5255
|
-
// renderer/client-effect-executor.ts
|
|
5256
|
-
var init_client_effect_executor = __esm({
|
|
5257
|
-
"renderer/client-effect-executor.ts"() {
|
|
5258
|
-
}
|
|
5259
|
-
});
|
|
5260
|
-
var ClientEffectConfigContext;
|
|
5261
|
-
var init_useClientEffects = __esm({
|
|
5262
|
-
"renderer/useClientEffects.ts"() {
|
|
5263
|
-
"use client";
|
|
5264
|
-
init_client_effect_executor();
|
|
5265
|
-
ClientEffectConfigContext = createContext(null);
|
|
5266
|
-
ClientEffectConfigContext.Provider;
|
|
5267
|
-
}
|
|
5268
|
-
});
|
|
5269
|
-
|
|
5270
|
-
// renderer/data-resolver.ts
|
|
5271
|
-
var init_data_resolver = __esm({
|
|
5272
|
-
"renderer/data-resolver.ts"() {
|
|
5273
|
-
}
|
|
5274
|
-
});
|
|
5275
|
-
|
|
5276
5249
|
// renderer/slot-definitions.ts
|
|
5277
5250
|
function isPortalSlot(slot) {
|
|
5278
5251
|
return SLOT_DEFINITIONS[slot]?.type === "portal";
|
|
@@ -5349,35 +5322,11 @@ var init_slot_definitions = __esm({
|
|
|
5349
5322
|
};
|
|
5350
5323
|
}
|
|
5351
5324
|
});
|
|
5352
|
-
var init_offline_executor = __esm({
|
|
5353
|
-
"renderer/offline-executor.ts"() {
|
|
5354
|
-
"use client";
|
|
5355
|
-
init_client_effect_executor();
|
|
5356
|
-
}
|
|
5357
|
-
});
|
|
5358
|
-
var init_navigation = __esm({
|
|
5359
|
-
"renderer/navigation.tsx"() {
|
|
5360
|
-
"use client";
|
|
5361
|
-
createContext(null);
|
|
5362
|
-
}
|
|
5363
|
-
});
|
|
5364
|
-
var init_init = __esm({
|
|
5365
|
-
"renderer/init.ts"() {
|
|
5366
|
-
init_pattern_resolver();
|
|
5367
|
-
}
|
|
5368
|
-
});
|
|
5369
5325
|
|
|
5370
5326
|
// renderer/index.ts
|
|
5371
5327
|
var init_renderer = __esm({
|
|
5372
5328
|
"renderer/index.ts"() {
|
|
5373
|
-
init_pattern_resolver();
|
|
5374
|
-
init_client_effect_executor();
|
|
5375
|
-
init_useClientEffects();
|
|
5376
|
-
init_data_resolver();
|
|
5377
5329
|
init_slot_definitions();
|
|
5378
|
-
init_offline_executor();
|
|
5379
|
-
init_navigation();
|
|
5380
|
-
init_init();
|
|
5381
5330
|
}
|
|
5382
5331
|
});
|
|
5383
5332
|
|
|
@@ -5555,8 +5504,8 @@ var init_Tooltip = __esm({
|
|
|
5555
5504
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
5556
5505
|
};
|
|
5557
5506
|
}, []);
|
|
5558
|
-
const triggerElement =
|
|
5559
|
-
const trigger =
|
|
5507
|
+
const triggerElement = React109__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
5508
|
+
const trigger = React109__default.cloneElement(triggerElement, {
|
|
5560
5509
|
ref: triggerRef,
|
|
5561
5510
|
onMouseEnter: handleMouseEnter,
|
|
5562
5511
|
onMouseLeave: handleMouseLeave,
|
|
@@ -5677,8 +5626,8 @@ var init_Popover = __esm({
|
|
|
5677
5626
|
onMouseEnter: handleOpen,
|
|
5678
5627
|
onMouseLeave: handleClose
|
|
5679
5628
|
};
|
|
5680
|
-
const childElement =
|
|
5681
|
-
const triggerElement =
|
|
5629
|
+
const childElement = React109__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
5630
|
+
const triggerElement = React109__default.cloneElement(
|
|
5682
5631
|
childElement,
|
|
5683
5632
|
{
|
|
5684
5633
|
ref: triggerRef,
|
|
@@ -5795,8 +5744,8 @@ var init_Menu = __esm({
|
|
|
5795
5744
|
"bottom-start": "top-full left-0 mt-2",
|
|
5796
5745
|
"bottom-end": "top-full right-0 mt-2"
|
|
5797
5746
|
};
|
|
5798
|
-
const triggerChild =
|
|
5799
|
-
const triggerElement =
|
|
5747
|
+
const triggerChild = React109__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
5748
|
+
const triggerElement = React109__default.cloneElement(
|
|
5800
5749
|
triggerChild,
|
|
5801
5750
|
{
|
|
5802
5751
|
ref: triggerRef,
|
|
@@ -6315,13 +6264,13 @@ var init_MapView = __esm({
|
|
|
6315
6264
|
shadowSize: [41, 41]
|
|
6316
6265
|
});
|
|
6317
6266
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
6318
|
-
const { useEffect:
|
|
6267
|
+
const { useEffect: useEffect65, useRef: useRef62, useCallback: useCallback111, useState: useState96 } = React109__default;
|
|
6319
6268
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
6320
6269
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
6321
6270
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
6322
6271
|
const map = useMap();
|
|
6323
|
-
const prevRef =
|
|
6324
|
-
|
|
6272
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
6273
|
+
useEffect65(() => {
|
|
6325
6274
|
const prev = prevRef.current;
|
|
6326
6275
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
6327
6276
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -6332,7 +6281,7 @@ var init_MapView = __esm({
|
|
|
6332
6281
|
}
|
|
6333
6282
|
function MapClickHandler({ onMapClick }) {
|
|
6334
6283
|
const map = useMap();
|
|
6335
|
-
|
|
6284
|
+
useEffect65(() => {
|
|
6336
6285
|
if (!onMapClick) return;
|
|
6337
6286
|
const handler = (e) => {
|
|
6338
6287
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -6359,8 +6308,8 @@ var init_MapView = __esm({
|
|
|
6359
6308
|
showAttribution = true
|
|
6360
6309
|
}) {
|
|
6361
6310
|
const eventBus = useEventBus2();
|
|
6362
|
-
const [clickedPosition, setClickedPosition] =
|
|
6363
|
-
const handleMapClick =
|
|
6311
|
+
const [clickedPosition, setClickedPosition] = useState96(null);
|
|
6312
|
+
const handleMapClick = useCallback111((lat, lng) => {
|
|
6364
6313
|
if (showClickedPin) {
|
|
6365
6314
|
setClickedPosition({ lat, lng });
|
|
6366
6315
|
}
|
|
@@ -6369,7 +6318,7 @@ var init_MapView = __esm({
|
|
|
6369
6318
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
6370
6319
|
}
|
|
6371
6320
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
6372
|
-
const handleMarkerClick =
|
|
6321
|
+
const handleMarkerClick = useCallback111((marker) => {
|
|
6373
6322
|
onMarkerClick?.(marker);
|
|
6374
6323
|
if (markerClickEvent) {
|
|
6375
6324
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -6546,7 +6495,7 @@ function InputPattern({
|
|
|
6546
6495
|
fieldName
|
|
6547
6496
|
}) {
|
|
6548
6497
|
const { emit } = useEventBus();
|
|
6549
|
-
const [localValue, setLocalValue] =
|
|
6498
|
+
const [localValue, setLocalValue] = React109__default.useState(value);
|
|
6550
6499
|
const handleChange = (e) => {
|
|
6551
6500
|
setLocalValue(e.target.value);
|
|
6552
6501
|
if (onChange) {
|
|
@@ -6584,7 +6533,7 @@ function TextareaPattern({
|
|
|
6584
6533
|
fieldName
|
|
6585
6534
|
}) {
|
|
6586
6535
|
const { emit } = useEventBus();
|
|
6587
|
-
const [localValue, setLocalValue] =
|
|
6536
|
+
const [localValue, setLocalValue] = React109__default.useState(value);
|
|
6588
6537
|
const handleChange = (e) => {
|
|
6589
6538
|
setLocalValue(e.target.value);
|
|
6590
6539
|
if (onChange) {
|
|
@@ -6616,7 +6565,7 @@ function SelectPattern({
|
|
|
6616
6565
|
fieldName
|
|
6617
6566
|
}) {
|
|
6618
6567
|
const { emit } = useEventBus();
|
|
6619
|
-
const [localValue, setLocalValue] =
|
|
6568
|
+
const [localValue, setLocalValue] = React109__default.useState(value);
|
|
6620
6569
|
const handleChange = (e) => {
|
|
6621
6570
|
setLocalValue(e.target.value);
|
|
6622
6571
|
if (onChange) {
|
|
@@ -6645,7 +6594,7 @@ function CheckboxPattern({
|
|
|
6645
6594
|
className
|
|
6646
6595
|
}) {
|
|
6647
6596
|
const { emit } = useEventBus();
|
|
6648
|
-
const [localChecked, setLocalChecked] =
|
|
6597
|
+
const [localChecked, setLocalChecked] = React109__default.useState(checked);
|
|
6649
6598
|
const handleChange = (e) => {
|
|
6650
6599
|
setLocalChecked(e.target.checked);
|
|
6651
6600
|
if (onChange) {
|
|
@@ -6954,9 +6903,9 @@ function ControlButton({
|
|
|
6954
6903
|
className
|
|
6955
6904
|
}) {
|
|
6956
6905
|
const eventBus = useEventBus();
|
|
6957
|
-
const [isPressed, setIsPressed] =
|
|
6906
|
+
const [isPressed, setIsPressed] = React109.useState(false);
|
|
6958
6907
|
const actualPressed = pressed ?? isPressed;
|
|
6959
|
-
const handlePointerDown =
|
|
6908
|
+
const handlePointerDown = React109.useCallback(
|
|
6960
6909
|
(e) => {
|
|
6961
6910
|
e.preventDefault();
|
|
6962
6911
|
if (disabled) return;
|
|
@@ -6966,7 +6915,7 @@ function ControlButton({
|
|
|
6966
6915
|
},
|
|
6967
6916
|
[disabled, pressEvent, eventBus, onPress]
|
|
6968
6917
|
);
|
|
6969
|
-
const handlePointerUp =
|
|
6918
|
+
const handlePointerUp = React109.useCallback(
|
|
6970
6919
|
(e) => {
|
|
6971
6920
|
e.preventDefault();
|
|
6972
6921
|
if (disabled) return;
|
|
@@ -6976,7 +6925,7 @@ function ControlButton({
|
|
|
6976
6925
|
},
|
|
6977
6926
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
6978
6927
|
);
|
|
6979
|
-
const handlePointerLeave =
|
|
6928
|
+
const handlePointerLeave = React109.useCallback(
|
|
6980
6929
|
(e) => {
|
|
6981
6930
|
if (isPressed) {
|
|
6982
6931
|
setIsPressed(false);
|
|
@@ -7049,8 +6998,8 @@ function ActionButtons({
|
|
|
7049
6998
|
disabled
|
|
7050
6999
|
}) {
|
|
7051
7000
|
const eventBus = useEventBus();
|
|
7052
|
-
const [activeButtons, setActiveButtons] =
|
|
7053
|
-
const handlePress =
|
|
7001
|
+
const [activeButtons, setActiveButtons] = React109.useState(/* @__PURE__ */ new Set());
|
|
7002
|
+
const handlePress = React109.useCallback(
|
|
7054
7003
|
(id) => {
|
|
7055
7004
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7056
7005
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7058,7 +7007,7 @@ function ActionButtons({
|
|
|
7058
7007
|
},
|
|
7059
7008
|
[actionEvent, eventBus, onAction]
|
|
7060
7009
|
);
|
|
7061
|
-
const handleRelease =
|
|
7010
|
+
const handleRelease = React109.useCallback(
|
|
7062
7011
|
(id) => {
|
|
7063
7012
|
setActiveButtons((prev) => {
|
|
7064
7013
|
const next = new Set(prev);
|
|
@@ -8497,7 +8446,6 @@ var init_IsometricCanvas = __esm({
|
|
|
8497
8446
|
var init_IsometricCanvas2 = __esm({
|
|
8498
8447
|
"components/organisms/game/IsometricCanvas.tsx"() {
|
|
8499
8448
|
init_IsometricCanvas();
|
|
8500
|
-
init_IsometricCanvas();
|
|
8501
8449
|
}
|
|
8502
8450
|
});
|
|
8503
8451
|
function BattleBoard({
|
|
@@ -8993,7 +8941,7 @@ var init_MarkdownContent = __esm({
|
|
|
8993
8941
|
init_Box();
|
|
8994
8942
|
init_useTranslate();
|
|
8995
8943
|
init_cn();
|
|
8996
|
-
MarkdownContent =
|
|
8944
|
+
MarkdownContent = React109__default.memo(
|
|
8997
8945
|
({ content, direction, className }) => {
|
|
8998
8946
|
const { t: _t } = useTranslate();
|
|
8999
8947
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -9210,7 +9158,7 @@ var init_CodeBlock = __esm({
|
|
|
9210
9158
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
9211
9159
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
9212
9160
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
9213
|
-
CodeBlock =
|
|
9161
|
+
CodeBlock = React109__default.memo(
|
|
9214
9162
|
({
|
|
9215
9163
|
code: rawCode,
|
|
9216
9164
|
language = "text",
|
|
@@ -10519,7 +10467,7 @@ var init_StateMachineView = __esm({
|
|
|
10519
10467
|
style: { top: title ? 30 : 0 },
|
|
10520
10468
|
children: [
|
|
10521
10469
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
10522
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
10470
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React109__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
10523
10471
|
StateNode,
|
|
10524
10472
|
{
|
|
10525
10473
|
state,
|
|
@@ -16484,7 +16432,7 @@ function CraftingRecipe({
|
|
|
16484
16432
|
className
|
|
16485
16433
|
}) {
|
|
16486
16434
|
const eventBus = useEventBus();
|
|
16487
|
-
const handleCraft =
|
|
16435
|
+
const handleCraft = React109.useCallback(() => {
|
|
16488
16436
|
onCraft?.();
|
|
16489
16437
|
if (craftEvent) {
|
|
16490
16438
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -16501,7 +16449,7 @@ function CraftingRecipe({
|
|
|
16501
16449
|
children: [
|
|
16502
16450
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
16503
16451
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
16504
|
-
return /* @__PURE__ */ jsxs(
|
|
16452
|
+
return /* @__PURE__ */ jsxs(React109.Fragment, { children: [
|
|
16505
16453
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
16506
16454
|
ItemSlot,
|
|
16507
16455
|
{
|
|
@@ -16795,8 +16743,8 @@ function DPad({
|
|
|
16795
16743
|
}) {
|
|
16796
16744
|
const eventBus = useEventBus();
|
|
16797
16745
|
const sizes = sizeMap6[size];
|
|
16798
|
-
const [activeDirections, setActiveDirections] =
|
|
16799
|
-
const handlePress =
|
|
16746
|
+
const [activeDirections, setActiveDirections] = React109.useState(/* @__PURE__ */ new Set());
|
|
16747
|
+
const handlePress = React109.useCallback(
|
|
16800
16748
|
(direction) => {
|
|
16801
16749
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
16802
16750
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -16804,7 +16752,7 @@ function DPad({
|
|
|
16804
16752
|
},
|
|
16805
16753
|
[directionEvent, eventBus, onDirection]
|
|
16806
16754
|
);
|
|
16807
|
-
const handleRelease =
|
|
16755
|
+
const handleRelease = React109.useCallback(
|
|
16808
16756
|
(direction) => {
|
|
16809
16757
|
setActiveDirections((prev) => {
|
|
16810
16758
|
const next = new Set(prev);
|
|
@@ -17756,13 +17704,13 @@ function DataList({
|
|
|
17756
17704
|
}) {
|
|
17757
17705
|
const eventBus = useEventBus();
|
|
17758
17706
|
const { t } = useTranslate();
|
|
17759
|
-
const [visibleCount, setVisibleCount] =
|
|
17707
|
+
const [visibleCount, setVisibleCount] = React109__default.useState(pageSize || Infinity);
|
|
17760
17708
|
const fieldDefs = fields ?? columns ?? [];
|
|
17761
17709
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17762
17710
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17763
17711
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
17764
17712
|
const hasRenderProp = typeof children === "function";
|
|
17765
|
-
|
|
17713
|
+
React109__default.useEffect(() => {
|
|
17766
17714
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
17767
17715
|
const childrenTypeOf = typeof children;
|
|
17768
17716
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -17818,7 +17766,7 @@ function DataList({
|
|
|
17818
17766
|
const items2 = data.map((item) => item);
|
|
17819
17767
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17820
17768
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
17821
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17769
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
17822
17770
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
17823
17771
|
group.items.map((itemData, index) => {
|
|
17824
17772
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -18009,7 +17957,7 @@ function DataList({
|
|
|
18009
17957
|
className
|
|
18010
17958
|
),
|
|
18011
17959
|
children: [
|
|
18012
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17960
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
18013
17961
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
18014
17962
|
group.items.map(
|
|
18015
17963
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -19293,7 +19241,7 @@ var init_WizardProgress = __esm({
|
|
|
19293
19241
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
19294
19242
|
const isActive = index === currentStep;
|
|
19295
19243
|
const isCompleted = index < currentStep;
|
|
19296
|
-
return /* @__PURE__ */ jsxs(
|
|
19244
|
+
return /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
19297
19245
|
/* @__PURE__ */ jsx(
|
|
19298
19246
|
"button",
|
|
19299
19247
|
{
|
|
@@ -20193,9 +20141,9 @@ function ScoreDisplay({
|
|
|
20193
20141
|
...rest
|
|
20194
20142
|
}) {
|
|
20195
20143
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
20196
|
-
const [displayValue, setDisplayValue] =
|
|
20197
|
-
const [isAnimating, setIsAnimating] =
|
|
20198
|
-
|
|
20144
|
+
const [displayValue, setDisplayValue] = React109.useState(resolvedValue);
|
|
20145
|
+
const [isAnimating, setIsAnimating] = React109.useState(false);
|
|
20146
|
+
React109.useEffect(() => {
|
|
20199
20147
|
if (!animated || displayValue === resolvedValue) {
|
|
20200
20148
|
setDisplayValue(resolvedValue);
|
|
20201
20149
|
return;
|
|
@@ -20345,7 +20293,7 @@ function InventoryGrid({
|
|
|
20345
20293
|
const eventBus = useEventBus();
|
|
20346
20294
|
const slotCount = totalSlots ?? items.length;
|
|
20347
20295
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
20348
|
-
const handleSelect =
|
|
20296
|
+
const handleSelect = React109.useCallback(
|
|
20349
20297
|
(id) => {
|
|
20350
20298
|
onSelect?.(id);
|
|
20351
20299
|
if (selectEvent) {
|
|
@@ -20627,15 +20575,15 @@ function GameCanvas2D({
|
|
|
20627
20575
|
fps = 60,
|
|
20628
20576
|
className
|
|
20629
20577
|
}) {
|
|
20630
|
-
const canvasRef =
|
|
20631
|
-
const rafRef =
|
|
20632
|
-
const frameRef =
|
|
20633
|
-
const lastTimeRef =
|
|
20634
|
-
const onDrawRef =
|
|
20578
|
+
const canvasRef = React109.useRef(null);
|
|
20579
|
+
const rafRef = React109.useRef(0);
|
|
20580
|
+
const frameRef = React109.useRef(0);
|
|
20581
|
+
const lastTimeRef = React109.useRef(0);
|
|
20582
|
+
const onDrawRef = React109.useRef(onDraw);
|
|
20635
20583
|
onDrawRef.current = onDraw;
|
|
20636
|
-
const onTickRef =
|
|
20584
|
+
const onTickRef = React109.useRef(onTick);
|
|
20637
20585
|
onTickRef.current = onTick;
|
|
20638
|
-
|
|
20586
|
+
React109.useEffect(() => {
|
|
20639
20587
|
const canvas = canvasRef.current;
|
|
20640
20588
|
if (!canvas) return;
|
|
20641
20589
|
const ctx = canvas.getContext("2d");
|
|
@@ -20976,7 +20924,7 @@ function TurnPanel({
|
|
|
20976
20924
|
className
|
|
20977
20925
|
}) {
|
|
20978
20926
|
const eventBus = useEventBus();
|
|
20979
|
-
const handleAction =
|
|
20927
|
+
const handleAction = React109.useCallback(
|
|
20980
20928
|
(event) => {
|
|
20981
20929
|
if (event) {
|
|
20982
20930
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -21122,7 +21070,7 @@ function UnitCommandBar({
|
|
|
21122
21070
|
className
|
|
21123
21071
|
}) {
|
|
21124
21072
|
const eventBus = useEventBus();
|
|
21125
|
-
const handleCommand =
|
|
21073
|
+
const handleCommand = React109.useCallback(
|
|
21126
21074
|
(event) => {
|
|
21127
21075
|
if (event) {
|
|
21128
21076
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -21607,7 +21555,7 @@ function GameMenu({
|
|
|
21607
21555
|
} catch {
|
|
21608
21556
|
}
|
|
21609
21557
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21610
|
-
const handleOptionClick =
|
|
21558
|
+
const handleOptionClick = React109.useCallback(
|
|
21611
21559
|
(option) => {
|
|
21612
21560
|
if (option.event && eventBus) {
|
|
21613
21561
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -21721,7 +21669,7 @@ function GameOverScreen({
|
|
|
21721
21669
|
} catch {
|
|
21722
21670
|
}
|
|
21723
21671
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21724
|
-
const handleActionClick =
|
|
21672
|
+
const handleActionClick = React109.useCallback(
|
|
21725
21673
|
(action) => {
|
|
21726
21674
|
if (action.event && eventBus) {
|
|
21727
21675
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -24852,7 +24800,7 @@ var init_StepFlow = __esm({
|
|
|
24852
24800
|
className
|
|
24853
24801
|
}) => {
|
|
24854
24802
|
if (orientation === "vertical") {
|
|
24855
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
24803
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React109__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
24856
24804
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
24857
24805
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
24858
24806
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -24863,7 +24811,7 @@ var init_StepFlow = __esm({
|
|
|
24863
24811
|
] })
|
|
24864
24812
|
] }) }, index)) });
|
|
24865
24813
|
}
|
|
24866
|
-
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(
|
|
24814
|
+
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(React109__default.Fragment, { children: [
|
|
24867
24815
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
24868
24816
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
24869
24817
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -27015,7 +26963,7 @@ var init_DocumentViewer = __esm({
|
|
|
27015
26963
|
}
|
|
27016
26964
|
});
|
|
27017
26965
|
function extractTitle(children) {
|
|
27018
|
-
if (!
|
|
26966
|
+
if (!React109__default.isValidElement(children)) return void 0;
|
|
27019
26967
|
const props = children.props;
|
|
27020
26968
|
if (typeof props.title === "string") {
|
|
27021
26969
|
return props.title;
|
|
@@ -27127,7 +27075,7 @@ function LinearView({
|
|
|
27127
27075
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27128
27076
|
const isDone = i < currentIdx;
|
|
27129
27077
|
const isCurrent = i === currentIdx;
|
|
27130
|
-
return /* @__PURE__ */ jsxs(
|
|
27078
|
+
return /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
27131
27079
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27132
27080
|
Typography,
|
|
27133
27081
|
{
|
|
@@ -27911,12 +27859,12 @@ var init_Form = __esm({
|
|
|
27911
27859
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
27912
27860
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
27913
27861
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
27914
|
-
const normalizedInitialData =
|
|
27862
|
+
const normalizedInitialData = React109__default.useMemo(() => {
|
|
27915
27863
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
27916
27864
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
27917
27865
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
27918
27866
|
}, [entity, initialData]);
|
|
27919
|
-
const entityDerivedFields =
|
|
27867
|
+
const entityDerivedFields = React109__default.useMemo(() => {
|
|
27920
27868
|
if (fields && fields.length > 0) return void 0;
|
|
27921
27869
|
if (!resolvedEntity) return void 0;
|
|
27922
27870
|
return resolvedEntity.fields.map(
|
|
@@ -27935,14 +27883,14 @@ var init_Form = __esm({
|
|
|
27935
27883
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
27936
27884
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
27937
27885
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
27938
|
-
const [formData, setFormData] =
|
|
27886
|
+
const [formData, setFormData] = React109__default.useState(
|
|
27939
27887
|
normalizedInitialData
|
|
27940
27888
|
);
|
|
27941
|
-
const [collapsedSections, setCollapsedSections] =
|
|
27889
|
+
const [collapsedSections, setCollapsedSections] = React109__default.useState(
|
|
27942
27890
|
/* @__PURE__ */ new Set()
|
|
27943
27891
|
);
|
|
27944
27892
|
const formMode = props.mode;
|
|
27945
|
-
const mountedRef =
|
|
27893
|
+
const mountedRef = React109__default.useRef(false);
|
|
27946
27894
|
if (!mountedRef.current) {
|
|
27947
27895
|
mountedRef.current = true;
|
|
27948
27896
|
debug("forms", "mount", {
|
|
@@ -27955,7 +27903,7 @@ var init_Form = __esm({
|
|
|
27955
27903
|
});
|
|
27956
27904
|
}
|
|
27957
27905
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
27958
|
-
const evalContext =
|
|
27906
|
+
const evalContext = React109__default.useMemo(
|
|
27959
27907
|
() => ({
|
|
27960
27908
|
formValues: formData,
|
|
27961
27909
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -27964,7 +27912,7 @@ var init_Form = __esm({
|
|
|
27964
27912
|
}),
|
|
27965
27913
|
[formData, externalContext]
|
|
27966
27914
|
);
|
|
27967
|
-
|
|
27915
|
+
React109__default.useEffect(() => {
|
|
27968
27916
|
debug("forms", "initialData-sync", {
|
|
27969
27917
|
mode: formMode,
|
|
27970
27918
|
normalizedInitialData,
|
|
@@ -27975,7 +27923,7 @@ var init_Form = __esm({
|
|
|
27975
27923
|
setFormData(normalizedInitialData);
|
|
27976
27924
|
}
|
|
27977
27925
|
}, [normalizedInitialData]);
|
|
27978
|
-
const processCalculations =
|
|
27926
|
+
const processCalculations = React109__default.useCallback(
|
|
27979
27927
|
(changedFieldId, newFormData) => {
|
|
27980
27928
|
if (!hiddenCalculations.length) return;
|
|
27981
27929
|
const context = {
|
|
@@ -28000,7 +27948,7 @@ var init_Form = __esm({
|
|
|
28000
27948
|
},
|
|
28001
27949
|
[hiddenCalculations, externalContext, eventBus]
|
|
28002
27950
|
);
|
|
28003
|
-
const checkViolations =
|
|
27951
|
+
const checkViolations = React109__default.useCallback(
|
|
28004
27952
|
(changedFieldId, newFormData) => {
|
|
28005
27953
|
if (!violationTriggers.length) return;
|
|
28006
27954
|
const context = {
|
|
@@ -28038,7 +27986,7 @@ var init_Form = __esm({
|
|
|
28038
27986
|
processCalculations(name, newFormData);
|
|
28039
27987
|
checkViolations(name, newFormData);
|
|
28040
27988
|
};
|
|
28041
|
-
const isFieldVisible =
|
|
27989
|
+
const isFieldVisible = React109__default.useCallback(
|
|
28042
27990
|
(fieldName) => {
|
|
28043
27991
|
const condition = conditionalFields[fieldName];
|
|
28044
27992
|
if (!condition) return true;
|
|
@@ -28046,7 +27994,7 @@ var init_Form = __esm({
|
|
|
28046
27994
|
},
|
|
28047
27995
|
[conditionalFields, evalContext]
|
|
28048
27996
|
);
|
|
28049
|
-
const isSectionVisible =
|
|
27997
|
+
const isSectionVisible = React109__default.useCallback(
|
|
28050
27998
|
(section) => {
|
|
28051
27999
|
if (!section.condition) return true;
|
|
28052
28000
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -28090,7 +28038,7 @@ var init_Form = __esm({
|
|
|
28090
28038
|
eventBus.emit(`UI:${onCancel}`);
|
|
28091
28039
|
}
|
|
28092
28040
|
};
|
|
28093
|
-
const renderField =
|
|
28041
|
+
const renderField = React109__default.useCallback(
|
|
28094
28042
|
(field) => {
|
|
28095
28043
|
const fieldName = field.name || field.field;
|
|
28096
28044
|
if (!fieldName) return null;
|
|
@@ -28111,7 +28059,7 @@ var init_Form = __esm({
|
|
|
28111
28059
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
28112
28060
|
);
|
|
28113
28061
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
28114
|
-
const normalizedFields =
|
|
28062
|
+
const normalizedFields = React109__default.useMemo(() => {
|
|
28115
28063
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
28116
28064
|
return effectiveFields.map((field) => {
|
|
28117
28065
|
if (typeof field === "string") {
|
|
@@ -28133,7 +28081,7 @@ var init_Form = __esm({
|
|
|
28133
28081
|
return field;
|
|
28134
28082
|
});
|
|
28135
28083
|
}, [effectiveFields, resolvedEntity]);
|
|
28136
|
-
const schemaFields =
|
|
28084
|
+
const schemaFields = React109__default.useMemo(() => {
|
|
28137
28085
|
if (normalizedFields.length === 0) return null;
|
|
28138
28086
|
if (isDebugEnabled()) {
|
|
28139
28087
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -28143,7 +28091,7 @@ var init_Form = __esm({
|
|
|
28143
28091
|
}
|
|
28144
28092
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
28145
28093
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
28146
|
-
const sectionElements =
|
|
28094
|
+
const sectionElements = React109__default.useMemo(() => {
|
|
28147
28095
|
if (!sections || sections.length === 0) return null;
|
|
28148
28096
|
return sections.map((section) => {
|
|
28149
28097
|
if (!isSectionVisible(section)) {
|
|
@@ -29667,7 +29615,7 @@ var init_List = __esm({
|
|
|
29667
29615
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
29668
29616
|
return [];
|
|
29669
29617
|
}, [entity]);
|
|
29670
|
-
const getItemActions =
|
|
29618
|
+
const getItemActions = React109__default.useCallback(
|
|
29671
29619
|
(item) => {
|
|
29672
29620
|
if (!itemActions) return [];
|
|
29673
29621
|
if (typeof itemActions === "function") {
|
|
@@ -30104,7 +30052,7 @@ var init_MediaGallery = __esm({
|
|
|
30104
30052
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
30105
30053
|
);
|
|
30106
30054
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30107
|
-
const items =
|
|
30055
|
+
const items = React109__default.useMemo(() => {
|
|
30108
30056
|
if (propItems) return propItems;
|
|
30109
30057
|
if (entityData.length === 0) return [];
|
|
30110
30058
|
return entityData.map((record, idx) => ({
|
|
@@ -30277,9 +30225,9 @@ function MiniMap({
|
|
|
30277
30225
|
viewportRect,
|
|
30278
30226
|
className
|
|
30279
30227
|
}) {
|
|
30280
|
-
const canvasRef =
|
|
30281
|
-
const frameRef =
|
|
30282
|
-
|
|
30228
|
+
const canvasRef = React109.useRef(null);
|
|
30229
|
+
const frameRef = React109.useRef(0);
|
|
30230
|
+
React109.useEffect(() => {
|
|
30283
30231
|
const canvas = canvasRef.current;
|
|
30284
30232
|
if (!canvas) return;
|
|
30285
30233
|
const ctx = canvas.getContext("2d");
|
|
@@ -30361,7 +30309,7 @@ var init_MiniMap = __esm({
|
|
|
30361
30309
|
}
|
|
30362
30310
|
});
|
|
30363
30311
|
function extractTitle2(children) {
|
|
30364
|
-
if (!
|
|
30312
|
+
if (!React109__default.isValidElement(children)) return void 0;
|
|
30365
30313
|
const props = children.props;
|
|
30366
30314
|
if (typeof props.title === "string") {
|
|
30367
30315
|
return props.title;
|
|
@@ -31074,7 +31022,7 @@ var init_PageHeader = __esm({
|
|
|
31074
31022
|
info: "bg-info/10 text-info"
|
|
31075
31023
|
};
|
|
31076
31024
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
31077
|
-
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(
|
|
31025
|
+
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(React109__default.Fragment, { children: [
|
|
31078
31026
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
31079
31027
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
31080
31028
|
"a",
|
|
@@ -31293,7 +31241,7 @@ var init_debugRegistry = __esm({
|
|
|
31293
31241
|
}
|
|
31294
31242
|
});
|
|
31295
31243
|
function useDebugData() {
|
|
31296
|
-
const [data, setData] =
|
|
31244
|
+
const [data, setData] = React109.useState(() => ({
|
|
31297
31245
|
traits: [],
|
|
31298
31246
|
ticks: [],
|
|
31299
31247
|
guards: [],
|
|
@@ -31307,7 +31255,7 @@ function useDebugData() {
|
|
|
31307
31255
|
},
|
|
31308
31256
|
lastUpdate: Date.now()
|
|
31309
31257
|
}));
|
|
31310
|
-
|
|
31258
|
+
React109.useEffect(() => {
|
|
31311
31259
|
const updateData = () => {
|
|
31312
31260
|
setData({
|
|
31313
31261
|
traits: getAllTraits(),
|
|
@@ -31416,12 +31364,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
31416
31364
|
return positions;
|
|
31417
31365
|
}
|
|
31418
31366
|
function WalkMinimap() {
|
|
31419
|
-
const [walkStep, setWalkStep] =
|
|
31420
|
-
const [traits2, setTraits] =
|
|
31421
|
-
const [coveredEdges, setCoveredEdges] =
|
|
31422
|
-
const [completedTraits, setCompletedTraits] =
|
|
31423
|
-
const prevTraitRef =
|
|
31424
|
-
|
|
31367
|
+
const [walkStep, setWalkStep] = React109.useState(null);
|
|
31368
|
+
const [traits2, setTraits] = React109.useState([]);
|
|
31369
|
+
const [coveredEdges, setCoveredEdges] = React109.useState([]);
|
|
31370
|
+
const [completedTraits, setCompletedTraits] = React109.useState(/* @__PURE__ */ new Set());
|
|
31371
|
+
const prevTraitRef = React109.useRef(null);
|
|
31372
|
+
React109.useEffect(() => {
|
|
31425
31373
|
const interval = setInterval(() => {
|
|
31426
31374
|
const w = window;
|
|
31427
31375
|
const step = w.__orbitalWalkStep;
|
|
@@ -31868,15 +31816,15 @@ var init_EntitiesTab = __esm({
|
|
|
31868
31816
|
}
|
|
31869
31817
|
});
|
|
31870
31818
|
function EventFlowTab({ events: events2 }) {
|
|
31871
|
-
const [filter, setFilter] =
|
|
31872
|
-
const containerRef =
|
|
31873
|
-
const [autoScroll, setAutoScroll] =
|
|
31874
|
-
|
|
31819
|
+
const [filter, setFilter] = React109.useState("all");
|
|
31820
|
+
const containerRef = React109.useRef(null);
|
|
31821
|
+
const [autoScroll, setAutoScroll] = React109.useState(true);
|
|
31822
|
+
React109.useEffect(() => {
|
|
31875
31823
|
if (autoScroll && containerRef.current) {
|
|
31876
31824
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
31877
31825
|
}
|
|
31878
31826
|
}, [events2.length, autoScroll]);
|
|
31879
|
-
const filteredEvents =
|
|
31827
|
+
const filteredEvents = React109.useMemo(() => {
|
|
31880
31828
|
if (filter === "all") return events2;
|
|
31881
31829
|
return events2.filter((e) => e.type === filter);
|
|
31882
31830
|
}, [events2, filter]);
|
|
@@ -31995,7 +31943,7 @@ var init_EventFlowTab = __esm({
|
|
|
31995
31943
|
}
|
|
31996
31944
|
});
|
|
31997
31945
|
function GuardsPanel({ guards }) {
|
|
31998
|
-
const [filter, setFilter] =
|
|
31946
|
+
const [filter, setFilter] = React109.useState("all");
|
|
31999
31947
|
if (guards.length === 0) {
|
|
32000
31948
|
return /* @__PURE__ */ jsx(
|
|
32001
31949
|
EmptyState,
|
|
@@ -32008,7 +31956,7 @@ function GuardsPanel({ guards }) {
|
|
|
32008
31956
|
}
|
|
32009
31957
|
const passedCount = guards.filter((g) => g.result).length;
|
|
32010
31958
|
const failedCount = guards.length - passedCount;
|
|
32011
|
-
const filteredGuards =
|
|
31959
|
+
const filteredGuards = React109.useMemo(() => {
|
|
32012
31960
|
if (filter === "all") return guards;
|
|
32013
31961
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
32014
31962
|
return guards.filter((g) => !g.result);
|
|
@@ -32169,10 +32117,10 @@ function EffectBadge({ effect }) {
|
|
|
32169
32117
|
] });
|
|
32170
32118
|
}
|
|
32171
32119
|
function TransitionTimeline({ transitions }) {
|
|
32172
|
-
const containerRef =
|
|
32173
|
-
const [autoScroll, setAutoScroll] =
|
|
32174
|
-
const [expandedId, setExpandedId] =
|
|
32175
|
-
|
|
32120
|
+
const containerRef = React109.useRef(null);
|
|
32121
|
+
const [autoScroll, setAutoScroll] = React109.useState(true);
|
|
32122
|
+
const [expandedId, setExpandedId] = React109.useState(null);
|
|
32123
|
+
React109.useEffect(() => {
|
|
32176
32124
|
if (autoScroll && containerRef.current) {
|
|
32177
32125
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
32178
32126
|
}
|
|
@@ -32458,9 +32406,9 @@ function getAllEvents(traits2) {
|
|
|
32458
32406
|
}
|
|
32459
32407
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
32460
32408
|
const eventBus = useEventBus();
|
|
32461
|
-
const [log3, setLog] =
|
|
32462
|
-
const prevStatesRef =
|
|
32463
|
-
|
|
32409
|
+
const [log3, setLog] = React109.useState([]);
|
|
32410
|
+
const prevStatesRef = React109.useRef(/* @__PURE__ */ new Map());
|
|
32411
|
+
React109.useEffect(() => {
|
|
32464
32412
|
for (const trait of traits2) {
|
|
32465
32413
|
const prev = prevStatesRef.current.get(trait.id);
|
|
32466
32414
|
if (prev && prev !== trait.currentState) {
|
|
@@ -32630,10 +32578,10 @@ function VerifyModePanel({
|
|
|
32630
32578
|
serverCount,
|
|
32631
32579
|
localCount
|
|
32632
32580
|
}) {
|
|
32633
|
-
const [expanded, setExpanded] =
|
|
32634
|
-
const scrollRef =
|
|
32635
|
-
const prevCountRef =
|
|
32636
|
-
|
|
32581
|
+
const [expanded, setExpanded] = React109.useState(true);
|
|
32582
|
+
const scrollRef = React109.useRef(null);
|
|
32583
|
+
const prevCountRef = React109.useRef(0);
|
|
32584
|
+
React109.useEffect(() => {
|
|
32637
32585
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
32638
32586
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
32639
32587
|
}
|
|
@@ -32699,10 +32647,10 @@ function RuntimeDebugger({
|
|
|
32699
32647
|
defaultTab,
|
|
32700
32648
|
schema
|
|
32701
32649
|
}) {
|
|
32702
|
-
const [isCollapsed, setIsCollapsed] =
|
|
32703
|
-
const [isVisible, setIsVisible] =
|
|
32650
|
+
const [isCollapsed, setIsCollapsed] = React109.useState(mode === "verify" ? true : defaultCollapsed);
|
|
32651
|
+
const [isVisible, setIsVisible] = React109.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
32704
32652
|
const debugData = useDebugData();
|
|
32705
|
-
|
|
32653
|
+
React109.useEffect(() => {
|
|
32706
32654
|
if (mode === "inline") return;
|
|
32707
32655
|
return onDebugToggle((enabled) => {
|
|
32708
32656
|
setIsVisible(enabled);
|
|
@@ -32711,7 +32659,7 @@ function RuntimeDebugger({
|
|
|
32711
32659
|
}
|
|
32712
32660
|
});
|
|
32713
32661
|
}, [mode]);
|
|
32714
|
-
|
|
32662
|
+
React109.useEffect(() => {
|
|
32715
32663
|
if (mode === "inline") return;
|
|
32716
32664
|
const handleKeyDown = (e) => {
|
|
32717
32665
|
if (e.key === "`" && isVisible) {
|
|
@@ -33260,7 +33208,7 @@ function SequenceBar({
|
|
|
33260
33208
|
onSlotRemove(index);
|
|
33261
33209
|
}, [onSlotRemove, playing]);
|
|
33262
33210
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
33263
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
33211
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
33264
33212
|
i > 0 && /* @__PURE__ */ jsx(
|
|
33265
33213
|
Typography,
|
|
33266
33214
|
{
|
|
@@ -34716,7 +34664,7 @@ var init_StatCard2 = __esm({
|
|
|
34716
34664
|
const labelToUse = propLabel ?? propTitle;
|
|
34717
34665
|
const eventBus = useEventBus();
|
|
34718
34666
|
const { t } = useTranslate();
|
|
34719
|
-
const handleActionClick =
|
|
34667
|
+
const handleActionClick = React109__default.useCallback(() => {
|
|
34720
34668
|
if (action?.event) {
|
|
34721
34669
|
eventBus.emit(`UI:${action.event}`, {});
|
|
34722
34670
|
}
|
|
@@ -34727,7 +34675,7 @@ var init_StatCard2 = __esm({
|
|
|
34727
34675
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
34728
34676
|
const isLoading = externalLoading ?? false;
|
|
34729
34677
|
const error = externalError;
|
|
34730
|
-
const computeMetricValue =
|
|
34678
|
+
const computeMetricValue = React109__default.useCallback(
|
|
34731
34679
|
(metric, items) => {
|
|
34732
34680
|
if (metric.value !== void 0) {
|
|
34733
34681
|
return metric.value;
|
|
@@ -34766,7 +34714,7 @@ var init_StatCard2 = __esm({
|
|
|
34766
34714
|
},
|
|
34767
34715
|
[]
|
|
34768
34716
|
);
|
|
34769
|
-
const schemaStats =
|
|
34717
|
+
const schemaStats = React109__default.useMemo(() => {
|
|
34770
34718
|
if (!metrics || metrics.length === 0) return null;
|
|
34771
34719
|
return metrics.map((metric) => ({
|
|
34772
34720
|
label: metric.label,
|
|
@@ -34774,7 +34722,7 @@ var init_StatCard2 = __esm({
|
|
|
34774
34722
|
format: metric.format
|
|
34775
34723
|
}));
|
|
34776
34724
|
}, [metrics, data, computeMetricValue]);
|
|
34777
|
-
const calculatedTrend =
|
|
34725
|
+
const calculatedTrend = React109__default.useMemo(() => {
|
|
34778
34726
|
if (manualTrend !== void 0) return manualTrend;
|
|
34779
34727
|
if (previousValue === void 0 || currentValue === void 0)
|
|
34780
34728
|
return void 0;
|
|
@@ -35829,7 +35777,7 @@ var init_Timeline = __esm({
|
|
|
35829
35777
|
}) => {
|
|
35830
35778
|
const { t } = useTranslate();
|
|
35831
35779
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
35832
|
-
const items =
|
|
35780
|
+
const items = React109__default.useMemo(() => {
|
|
35833
35781
|
if (propItems) return propItems;
|
|
35834
35782
|
if (entityData.length === 0) return [];
|
|
35835
35783
|
return entityData.map((record, idx) => {
|
|
@@ -35986,7 +35934,7 @@ var init_TimerDisplay = __esm({
|
|
|
35986
35934
|
}
|
|
35987
35935
|
});
|
|
35988
35936
|
function extractToastProps(children) {
|
|
35989
|
-
if (!
|
|
35937
|
+
if (!React109__default.isValidElement(children)) {
|
|
35990
35938
|
if (typeof children === "string") {
|
|
35991
35939
|
return { message: children };
|
|
35992
35940
|
}
|
|
@@ -36024,7 +35972,7 @@ var init_ToastSlot = __esm({
|
|
|
36024
35972
|
eventBus.emit("UI:CLOSE");
|
|
36025
35973
|
};
|
|
36026
35974
|
if (!isVisible) return null;
|
|
36027
|
-
const isCustomContent =
|
|
35975
|
+
const isCustomContent = React109__default.isValidElement(children) && !message;
|
|
36028
35976
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
36029
35977
|
Toast,
|
|
36030
35978
|
{
|
|
@@ -36293,7 +36241,7 @@ var init_WizardContainer = __esm({
|
|
|
36293
36241
|
const isCompleted = index < currentStep;
|
|
36294
36242
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36295
36243
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36296
|
-
return /* @__PURE__ */ jsxs(
|
|
36244
|
+
return /* @__PURE__ */ jsxs(React109__default.Fragment, { children: [
|
|
36297
36245
|
/* @__PURE__ */ jsx(
|
|
36298
36246
|
Button,
|
|
36299
36247
|
{
|
|
@@ -36743,12 +36691,12 @@ var init_XPBar = __esm({
|
|
|
36743
36691
|
}
|
|
36744
36692
|
});
|
|
36745
36693
|
function lazyThree(name, loader) {
|
|
36746
|
-
const Lazy =
|
|
36694
|
+
const Lazy = React109__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
36747
36695
|
function ThreeWrapper(props) {
|
|
36748
|
-
return
|
|
36749
|
-
|
|
36696
|
+
return React109__default.createElement(
|
|
36697
|
+
React109__default.Suspense,
|
|
36750
36698
|
{ fallback: null },
|
|
36751
|
-
|
|
36699
|
+
React109__default.createElement(Lazy, props)
|
|
36752
36700
|
);
|
|
36753
36701
|
}
|
|
36754
36702
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -37236,7 +37184,7 @@ function SuspenseConfigProvider({
|
|
|
37236
37184
|
config,
|
|
37237
37185
|
children
|
|
37238
37186
|
}) {
|
|
37239
|
-
return
|
|
37187
|
+
return React109__default.createElement(
|
|
37240
37188
|
SuspenseConfigContext.Provider,
|
|
37241
37189
|
{ value: config },
|
|
37242
37190
|
children
|
|
@@ -37719,12 +37667,13 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
37719
37667
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
37720
37668
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
37721
37669
|
}
|
|
37722
|
-
return /* @__PURE__ */ jsx(
|
|
37670
|
+
return /* @__PURE__ */ jsx(React109__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
37723
37671
|
}
|
|
37724
37672
|
if (!child || typeof child !== "object") return null;
|
|
37725
37673
|
const childId = `${parentId}-${index}`;
|
|
37726
37674
|
const childPath = parentPath === "root" ? `root.children.${index}` : `${parentPath}.children.${index}`;
|
|
37727
|
-
const
|
|
37675
|
+
const childAsRecord = child;
|
|
37676
|
+
const { type: _childType, props: nestedProps, _id: _childNodeId, children: _childChildren, ...flatProps } = childAsRecord;
|
|
37728
37677
|
const resolvedProps = nestedProps !== void 0 ? nestedProps : flatProps;
|
|
37729
37678
|
if (_childChildren !== void 0 && nestedProps === void 0) {
|
|
37730
37679
|
resolvedProps.children = _childChildren;
|
|
@@ -37752,7 +37701,46 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
37752
37701
|
});
|
|
37753
37702
|
}
|
|
37754
37703
|
function isPatternConfig(value) {
|
|
37755
|
-
|
|
37704
|
+
if (value === null || value === void 0) return false;
|
|
37705
|
+
if (typeof value !== "object") return false;
|
|
37706
|
+
if (Array.isArray(value)) return false;
|
|
37707
|
+
if (React109__default.isValidElement(value)) return false;
|
|
37708
|
+
if (value instanceof Date) return false;
|
|
37709
|
+
if (typeof value === "function") return false;
|
|
37710
|
+
const record = value;
|
|
37711
|
+
return "type" in record && typeof record.type === "string";
|
|
37712
|
+
}
|
|
37713
|
+
function isPlainConfigObject(value) {
|
|
37714
|
+
if (React109__default.isValidElement(value)) return false;
|
|
37715
|
+
if (value instanceof Date) return false;
|
|
37716
|
+
const proto = Object.getPrototypeOf(value);
|
|
37717
|
+
return proto === Object.prototype || proto === null;
|
|
37718
|
+
}
|
|
37719
|
+
function substituteTraitRefsDeep(value, pathKey) {
|
|
37720
|
+
if (typeof value === "string") {
|
|
37721
|
+
const match = TRAIT_BINDING_RE.exec(value);
|
|
37722
|
+
if (match) {
|
|
37723
|
+
const traitName = match[1];
|
|
37724
|
+
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, `${pathKey}:${traitName}`);
|
|
37725
|
+
}
|
|
37726
|
+
return value;
|
|
37727
|
+
}
|
|
37728
|
+
if (typeof value === "number" || typeof value === "boolean" || value === null || value === void 0 || typeof value === "function") {
|
|
37729
|
+
return value;
|
|
37730
|
+
}
|
|
37731
|
+
if (Array.isArray(value)) {
|
|
37732
|
+
return value.map(
|
|
37733
|
+
(item, i) => substituteTraitRefsDeep(item, `${pathKey}[${i}]`)
|
|
37734
|
+
);
|
|
37735
|
+
}
|
|
37736
|
+
if (typeof value === "object" && isPlainConfigObject(value)) {
|
|
37737
|
+
const out = {};
|
|
37738
|
+
for (const [k, v] of Object.entries(value)) {
|
|
37739
|
+
out[k] = substituteTraitRefsDeep(v, `${pathKey}.${k}`);
|
|
37740
|
+
}
|
|
37741
|
+
return out;
|
|
37742
|
+
}
|
|
37743
|
+
return value;
|
|
37756
37744
|
}
|
|
37757
37745
|
function renderPatternProps(props, onDismiss) {
|
|
37758
37746
|
const rendered = {};
|
|
@@ -37760,17 +37748,19 @@ function renderPatternProps(props, onDismiss) {
|
|
|
37760
37748
|
if (key === "children") {
|
|
37761
37749
|
rendered[key] = value;
|
|
37762
37750
|
} else if (isPatternConfig(value)) {
|
|
37751
|
+
const nestedProps = {};
|
|
37752
|
+
for (const [k, v] of Object.entries(value)) {
|
|
37753
|
+
if (k !== "type") nestedProps[k] = v;
|
|
37754
|
+
}
|
|
37763
37755
|
const childContent = {
|
|
37764
37756
|
id: `prop-${key}`,
|
|
37765
37757
|
pattern: value.type,
|
|
37766
|
-
props:
|
|
37767
|
-
Object.entries(value).filter(([k]) => k !== "type")
|
|
37768
|
-
),
|
|
37758
|
+
props: nestedProps,
|
|
37769
37759
|
priority: 0
|
|
37770
37760
|
};
|
|
37771
37761
|
rendered[key] = /* @__PURE__ */ jsx(SlotContentRenderer, { content: childContent, onDismiss });
|
|
37772
37762
|
} else {
|
|
37773
|
-
rendered[key] = value;
|
|
37763
|
+
rendered[key] = substituteTraitRefsDeep(value, `prop:${key}`);
|
|
37774
37764
|
}
|
|
37775
37765
|
}
|
|
37776
37766
|
return rendered;
|
|
@@ -38164,7 +38154,7 @@ var FormSection = ({
|
|
|
38164
38154
|
columns = 1,
|
|
38165
38155
|
className
|
|
38166
38156
|
}) => {
|
|
38167
|
-
const [collapsed, setCollapsed] =
|
|
38157
|
+
const [collapsed, setCollapsed] = React109__default.useState(defaultCollapsed);
|
|
38168
38158
|
const { t } = useTranslate();
|
|
38169
38159
|
const eventBus = useEventBus();
|
|
38170
38160
|
const gridClass = {
|
|
@@ -38172,7 +38162,7 @@ var FormSection = ({
|
|
|
38172
38162
|
2: "grid-cols-1 md:grid-cols-2",
|
|
38173
38163
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
38174
38164
|
}[columns];
|
|
38175
|
-
|
|
38165
|
+
React109__default.useCallback(() => {
|
|
38176
38166
|
if (collapsible) {
|
|
38177
38167
|
setCollapsed((prev) => !prev);
|
|
38178
38168
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -38330,16 +38320,9 @@ init_types();
|
|
|
38330
38320
|
|
|
38331
38321
|
// components/organisms/layout/index.ts
|
|
38332
38322
|
init_SplitPane();
|
|
38333
|
-
init_MasterDetail();
|
|
38334
38323
|
init_DashboardGrid();
|
|
38335
38324
|
init_TabbedContainer();
|
|
38336
38325
|
|
|
38337
|
-
// components/organisms/game/index.ts
|
|
38338
|
-
init_IsometricCanvas2();
|
|
38339
|
-
|
|
38340
|
-
// components/organisms/game/PlatformerCanvas.tsx
|
|
38341
|
-
init_PlatformerCanvas();
|
|
38342
|
-
|
|
38343
38326
|
// components/organisms/game/index.ts
|
|
38344
38327
|
init_CanvasEffect();
|
|
38345
38328
|
init_GameAudioProvider();
|
|
@@ -38821,11 +38804,6 @@ function usePhysics2D(options = {}) {
|
|
|
38821
38804
|
|
|
38822
38805
|
// components/organisms/game/index.ts
|
|
38823
38806
|
init_isometric();
|
|
38824
|
-
init_GameHud2();
|
|
38825
|
-
init_GameMenu2();
|
|
38826
|
-
init_GameOverScreen2();
|
|
38827
|
-
init_InventoryPanel2();
|
|
38828
|
-
init_DialogueBox2();
|
|
38829
38807
|
init_BattleBoard();
|
|
38830
38808
|
init_UncontrolledBattleBoard();
|
|
38831
38809
|
init_useBattleState();
|
|
@@ -39048,9 +39026,6 @@ init_SimulationControls();
|
|
|
39048
39026
|
init_SimulationGraph();
|
|
39049
39027
|
init_presets();
|
|
39050
39028
|
|
|
39051
|
-
// components/organisms/game/CombatLog.tsx
|
|
39052
|
-
init_CombatLog();
|
|
39053
|
-
|
|
39054
39029
|
// components/organisms/game/types/game.ts
|
|
39055
39030
|
function createInitialGameState(width, height, units, defaultTerrain = "floorStone") {
|
|
39056
39031
|
const board = Array.from(
|
|
@@ -39265,11 +39240,6 @@ init_CodeViewer();
|
|
|
39265
39240
|
|
|
39266
39241
|
// components/organisms/debug/index.ts
|
|
39267
39242
|
init_RuntimeDebugger2();
|
|
39268
|
-
init_useDebugData();
|
|
39269
|
-
init_VerificationTab();
|
|
39270
|
-
init_TransitionTimeline();
|
|
39271
|
-
init_ServerBridgeTab();
|
|
39272
|
-
init_EventDispatcherTab();
|
|
39273
39243
|
|
|
39274
39244
|
// components/organisms/HeroOrganism.tsx
|
|
39275
39245
|
init_cn();
|