@almadar/ui 2.27.3 → 2.27.5
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/atoms/flow/FlowLabel.d.ts +23 -0
- package/dist/components/atoms/flow/FlowMinimap.d.ts +28 -0
- package/dist/components/atoms/flow/FlowNodeShell.d.ts +25 -0
- package/dist/components/atoms/flow/FlowPort.d.ts +26 -0
- package/dist/components/atoms/flow/FlowWire.d.ts +39 -0
- package/dist/components/atoms/flow/index.d.ts +13 -0
- package/dist/components/atoms/index.d.ts +1 -0
- package/dist/components/index.cjs +1744 -1017
- package/dist/components/index.js +853 -141
- package/dist/components/molecules/avl/AvlBehaviorGlyph.d.ts +61 -0
- package/dist/components/molecules/avl/index.d.ts +1 -0
- package/dist/components/molecules/flow/BehaviorNode.d.ts +28 -0
- package/dist/components/molecules/flow/EffectNode.d.ts +26 -0
- package/dist/components/molecules/flow/EventWireEdge.d.ts +23 -0
- package/dist/components/molecules/flow/ExprNode.d.ts +27 -0
- package/dist/components/molecules/flow/FlowStateNode.d.ts +18 -0
- package/dist/components/molecules/flow/NodePalette.d.ts +36 -0
- package/dist/components/molecules/flow/OrbitalNode.d.ts +31 -0
- package/dist/components/molecules/flow/TransitionEdge.d.ts +26 -0
- package/dist/components/molecules/flow/index.d.ts +8 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/flow/index.cjs +3832 -0
- package/dist/flow/index.d.cts +367 -0
- package/dist/flow/index.d.ts +10 -0
- package/dist/flow/index.js +3793 -0
- package/dist/providers/index.cjs +145 -143
- package/dist/providers/index.js +43 -41
- package/dist/runtime/index.cjs +978 -920
- package/dist/runtime/index.js +204 -146
- package/package.json +7 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React117 from 'react';
|
|
2
|
+
import React117__default, { createContext, useCallback, useState, useRef, useEffect, useLayoutEffect, lazy, useContext, useMemo, Suspense, useId } from 'react';
|
|
3
3
|
import { EventBusContext } from '@almadar/ui/providers';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import '@tanstack/react-query';
|
|
@@ -23,6 +23,7 @@ import remarkMath from 'remark-math';
|
|
|
23
23
|
import rehypeKatex from 'rehype-katex';
|
|
24
24
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism';
|
|
25
25
|
import dark from 'react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus';
|
|
26
|
+
import '@xyflow/react';
|
|
26
27
|
|
|
27
28
|
var __defProp = Object.defineProperty;
|
|
28
29
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -1585,7 +1586,7 @@ var positionStyles = {
|
|
|
1585
1586
|
fixed: "fixed",
|
|
1586
1587
|
sticky: "sticky"
|
|
1587
1588
|
};
|
|
1588
|
-
var Box =
|
|
1589
|
+
var Box = React117__default.forwardRef(
|
|
1589
1590
|
({
|
|
1590
1591
|
padding,
|
|
1591
1592
|
paddingX,
|
|
@@ -1754,7 +1755,7 @@ var Typography = ({
|
|
|
1754
1755
|
align,
|
|
1755
1756
|
weight,
|
|
1756
1757
|
size,
|
|
1757
|
-
truncate = false,
|
|
1758
|
+
truncate: truncate2 = false,
|
|
1758
1759
|
overflow,
|
|
1759
1760
|
as,
|
|
1760
1761
|
id,
|
|
@@ -1776,7 +1777,7 @@ var Typography = ({
|
|
|
1776
1777
|
weight && weightStyles[weight],
|
|
1777
1778
|
size && typographySizeStyles[size],
|
|
1778
1779
|
align && `text-${align}`,
|
|
1779
|
-
|
|
1780
|
+
truncate2 && "truncate overflow-hidden text-ellipsis",
|
|
1780
1781
|
overflow && overflowStyles2[overflow],
|
|
1781
1782
|
className
|
|
1782
1783
|
),
|
|
@@ -2680,7 +2681,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2680
2681
|
const IconComp = value;
|
|
2681
2682
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
2682
2683
|
}
|
|
2683
|
-
if (
|
|
2684
|
+
if (React117__default.isValidElement(value)) {
|
|
2684
2685
|
return value;
|
|
2685
2686
|
}
|
|
2686
2687
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -2689,7 +2690,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
2689
2690
|
}
|
|
2690
2691
|
return value;
|
|
2691
2692
|
}
|
|
2692
|
-
var Button =
|
|
2693
|
+
var Button = React117__default.forwardRef(
|
|
2693
2694
|
({
|
|
2694
2695
|
className,
|
|
2695
2696
|
variant = "primary",
|
|
@@ -2785,7 +2786,7 @@ var sizeStyles3 = {
|
|
|
2785
2786
|
md: "px-2.5 py-1 text-sm",
|
|
2786
2787
|
lg: "px-3 py-1.5 text-base"
|
|
2787
2788
|
};
|
|
2788
|
-
var Badge =
|
|
2789
|
+
var Badge = React117__default.forwardRef(
|
|
2789
2790
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
2790
2791
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
2791
2792
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -2908,7 +2909,7 @@ var Toast = ({
|
|
|
2908
2909
|
);
|
|
2909
2910
|
};
|
|
2910
2911
|
Toast.displayName = "Toast";
|
|
2911
|
-
var Input =
|
|
2912
|
+
var Input = React117__default.forwardRef(
|
|
2912
2913
|
({
|
|
2913
2914
|
className,
|
|
2914
2915
|
inputType,
|
|
@@ -3020,7 +3021,7 @@ var Input = React116__default.forwardRef(
|
|
|
3020
3021
|
}
|
|
3021
3022
|
);
|
|
3022
3023
|
Input.displayName = "Input";
|
|
3023
|
-
var Label =
|
|
3024
|
+
var Label = React117__default.forwardRef(
|
|
3024
3025
|
({ className, required, children, ...props }, ref) => {
|
|
3025
3026
|
return /* @__PURE__ */ jsxs(
|
|
3026
3027
|
"label",
|
|
@@ -3040,7 +3041,7 @@ var Label = React116__default.forwardRef(
|
|
|
3040
3041
|
}
|
|
3041
3042
|
);
|
|
3042
3043
|
Label.displayName = "Label";
|
|
3043
|
-
var Textarea =
|
|
3044
|
+
var Textarea = React117__default.forwardRef(
|
|
3044
3045
|
({ className, error, ...props }, ref) => {
|
|
3045
3046
|
return /* @__PURE__ */ jsx(
|
|
3046
3047
|
"textarea",
|
|
@@ -3063,7 +3064,7 @@ var Textarea = React116__default.forwardRef(
|
|
|
3063
3064
|
}
|
|
3064
3065
|
);
|
|
3065
3066
|
Textarea.displayName = "Textarea";
|
|
3066
|
-
var Select =
|
|
3067
|
+
var Select = React117__default.forwardRef(
|
|
3067
3068
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3068
3069
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3069
3070
|
/* @__PURE__ */ jsxs(
|
|
@@ -3099,7 +3100,7 @@ var Select = React116__default.forwardRef(
|
|
|
3099
3100
|
}
|
|
3100
3101
|
);
|
|
3101
3102
|
Select.displayName = "Select";
|
|
3102
|
-
var Checkbox =
|
|
3103
|
+
var Checkbox = React117__default.forwardRef(
|
|
3103
3104
|
({ className, label, id, ...props }, ref) => {
|
|
3104
3105
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3105
3106
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3175,7 +3176,7 @@ var shadowStyles2 = {
|
|
|
3175
3176
|
md: "shadow",
|
|
3176
3177
|
lg: "shadow-lg"
|
|
3177
3178
|
};
|
|
3178
|
-
var Card =
|
|
3179
|
+
var Card = React117__default.forwardRef(
|
|
3179
3180
|
({
|
|
3180
3181
|
className,
|
|
3181
3182
|
variant = "bordered",
|
|
@@ -3211,9 +3212,9 @@ var Card = React116__default.forwardRef(
|
|
|
3211
3212
|
}
|
|
3212
3213
|
);
|
|
3213
3214
|
Card.displayName = "Card";
|
|
3214
|
-
var CardHeader =
|
|
3215
|
+
var CardHeader = React117__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3215
3216
|
CardHeader.displayName = "CardHeader";
|
|
3216
|
-
var CardTitle =
|
|
3217
|
+
var CardTitle = React117__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3217
3218
|
"h3",
|
|
3218
3219
|
{
|
|
3219
3220
|
ref,
|
|
@@ -3226,11 +3227,11 @@ var CardTitle = React116__default.forwardRef(({ className, ...props }, ref) => /
|
|
|
3226
3227
|
}
|
|
3227
3228
|
));
|
|
3228
3229
|
CardTitle.displayName = "CardTitle";
|
|
3229
|
-
var CardContent =
|
|
3230
|
+
var CardContent = React117__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3230
3231
|
CardContent.displayName = "CardContent";
|
|
3231
3232
|
var CardBody = CardContent;
|
|
3232
3233
|
CardBody.displayName = "CardBody";
|
|
3233
|
-
var CardFooter =
|
|
3234
|
+
var CardFooter = React117__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3234
3235
|
"div",
|
|
3235
3236
|
{
|
|
3236
3237
|
ref,
|
|
@@ -3245,7 +3246,7 @@ var sizeStyles4 = {
|
|
|
3245
3246
|
md: "h-6 w-6",
|
|
3246
3247
|
lg: "h-8 w-8"
|
|
3247
3248
|
};
|
|
3248
|
-
var Spinner =
|
|
3249
|
+
var Spinner = React117__default.forwardRef(
|
|
3249
3250
|
({ className, size = "md", ...props }, ref) => {
|
|
3250
3251
|
return /* @__PURE__ */ jsx(
|
|
3251
3252
|
"div",
|
|
@@ -3661,7 +3662,7 @@ var ProgressBar = ({
|
|
|
3661
3662
|
return null;
|
|
3662
3663
|
};
|
|
3663
3664
|
ProgressBar.displayName = "ProgressBar";
|
|
3664
|
-
var Radio =
|
|
3665
|
+
var Radio = React117__default.forwardRef(
|
|
3665
3666
|
({
|
|
3666
3667
|
label,
|
|
3667
3668
|
helperText,
|
|
@@ -3765,7 +3766,7 @@ var Radio = React116__default.forwardRef(
|
|
|
3765
3766
|
}
|
|
3766
3767
|
);
|
|
3767
3768
|
Radio.displayName = "Radio";
|
|
3768
|
-
var Switch =
|
|
3769
|
+
var Switch = React117.forwardRef(
|
|
3769
3770
|
({
|
|
3770
3771
|
checked,
|
|
3771
3772
|
defaultChecked = false,
|
|
@@ -3776,10 +3777,10 @@ var Switch = React116.forwardRef(
|
|
|
3776
3777
|
name,
|
|
3777
3778
|
className
|
|
3778
3779
|
}, ref) => {
|
|
3779
|
-
const [isChecked, setIsChecked] =
|
|
3780
|
+
const [isChecked, setIsChecked] = React117.useState(
|
|
3780
3781
|
checked !== void 0 ? checked : defaultChecked
|
|
3781
3782
|
);
|
|
3782
|
-
|
|
3783
|
+
React117.useEffect(() => {
|
|
3783
3784
|
if (checked !== void 0) {
|
|
3784
3785
|
setIsChecked(checked);
|
|
3785
3786
|
}
|
|
@@ -4144,8 +4145,8 @@ var LawReferenceTooltip = ({
|
|
|
4144
4145
|
position = "top",
|
|
4145
4146
|
className
|
|
4146
4147
|
}) => {
|
|
4147
|
-
const [isVisible, setIsVisible] =
|
|
4148
|
-
const timeoutRef =
|
|
4148
|
+
const [isVisible, setIsVisible] = React117__default.useState(false);
|
|
4149
|
+
const timeoutRef = React117__default.useRef(null);
|
|
4149
4150
|
const handleMouseEnter = () => {
|
|
4150
4151
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4151
4152
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4154,7 +4155,7 @@ var LawReferenceTooltip = ({
|
|
|
4154
4155
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4155
4156
|
setIsVisible(false);
|
|
4156
4157
|
};
|
|
4157
|
-
|
|
4158
|
+
React117__default.useEffect(() => {
|
|
4158
4159
|
return () => {
|
|
4159
4160
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4160
4161
|
};
|
|
@@ -4342,7 +4343,7 @@ var sizeStyles5 = {
|
|
|
4342
4343
|
md: "w-2.5 h-2.5",
|
|
4343
4344
|
lg: "w-3 h-3"
|
|
4344
4345
|
};
|
|
4345
|
-
var StatusDot =
|
|
4346
|
+
var StatusDot = React117__default.forwardRef(
|
|
4346
4347
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
4347
4348
|
return /* @__PURE__ */ jsx(
|
|
4348
4349
|
"span",
|
|
@@ -4389,7 +4390,7 @@ var iconMap2 = {
|
|
|
4389
4390
|
down: TrendingDown,
|
|
4390
4391
|
flat: ArrowRight
|
|
4391
4392
|
};
|
|
4392
|
-
var TrendIndicator =
|
|
4393
|
+
var TrendIndicator = React117__default.forwardRef(
|
|
4393
4394
|
({
|
|
4394
4395
|
className,
|
|
4395
4396
|
value,
|
|
@@ -4448,7 +4449,7 @@ var thumbSizes = {
|
|
|
4448
4449
|
md: "w-4 h-4",
|
|
4449
4450
|
lg: "w-5 h-5"
|
|
4450
4451
|
};
|
|
4451
|
-
var RangeSlider =
|
|
4452
|
+
var RangeSlider = React117__default.forwardRef(
|
|
4452
4453
|
({
|
|
4453
4454
|
className,
|
|
4454
4455
|
min = 0,
|
|
@@ -4899,7 +4900,7 @@ var paddingClasses = {
|
|
|
4899
4900
|
md: "py-16",
|
|
4900
4901
|
lg: "py-24"
|
|
4901
4902
|
};
|
|
4902
|
-
var ContentSection =
|
|
4903
|
+
var ContentSection = React117__default.forwardRef(
|
|
4903
4904
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4904
4905
|
return /* @__PURE__ */ jsx(
|
|
4905
4906
|
Box,
|
|
@@ -4938,7 +4939,7 @@ var animatedStyles = {
|
|
|
4938
4939
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4939
4940
|
"none": {}
|
|
4940
4941
|
};
|
|
4941
|
-
var AnimatedReveal =
|
|
4942
|
+
var AnimatedReveal = React117__default.forwardRef(
|
|
4942
4943
|
({
|
|
4943
4944
|
trigger = "scroll",
|
|
4944
4945
|
animation = "fade-up",
|
|
@@ -5091,7 +5092,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
5091
5092
|
el.style.opacity = animate ? "1" : "0";
|
|
5092
5093
|
});
|
|
5093
5094
|
}
|
|
5094
|
-
var AnimatedGraphic =
|
|
5095
|
+
var AnimatedGraphic = React117__default.forwardRef(
|
|
5095
5096
|
({
|
|
5096
5097
|
src,
|
|
5097
5098
|
svgContent,
|
|
@@ -5114,7 +5115,7 @@ var AnimatedGraphic = React116__default.forwardRef(
|
|
|
5114
5115
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5115
5116
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5116
5117
|
const prevAnimateRef = useRef(animate);
|
|
5117
|
-
const setRef =
|
|
5118
|
+
const setRef = React117__default.useCallback(
|
|
5118
5119
|
(node) => {
|
|
5119
5120
|
containerRef.current = node;
|
|
5120
5121
|
if (typeof ref === "function") ref(node);
|
|
@@ -5285,9 +5286,9 @@ function ScoreDisplay({
|
|
|
5285
5286
|
...rest
|
|
5286
5287
|
}) {
|
|
5287
5288
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
5288
|
-
const [displayValue, setDisplayValue] =
|
|
5289
|
-
const [isAnimating, setIsAnimating] =
|
|
5290
|
-
|
|
5289
|
+
const [displayValue, setDisplayValue] = React117.useState(resolvedValue);
|
|
5290
|
+
const [isAnimating, setIsAnimating] = React117.useState(false);
|
|
5291
|
+
React117.useEffect(() => {
|
|
5291
5292
|
if (!animated || displayValue === resolvedValue) {
|
|
5292
5293
|
setDisplayValue(resolvedValue);
|
|
5293
5294
|
return;
|
|
@@ -5360,9 +5361,9 @@ function ControlButton({
|
|
|
5360
5361
|
className
|
|
5361
5362
|
}) {
|
|
5362
5363
|
const eventBus = useEventBus();
|
|
5363
|
-
const [isPressed, setIsPressed] =
|
|
5364
|
+
const [isPressed, setIsPressed] = React117.useState(false);
|
|
5364
5365
|
const actualPressed = pressed ?? isPressed;
|
|
5365
|
-
const handlePointerDown =
|
|
5366
|
+
const handlePointerDown = React117.useCallback(
|
|
5366
5367
|
(e) => {
|
|
5367
5368
|
e.preventDefault();
|
|
5368
5369
|
if (disabled) return;
|
|
@@ -5372,7 +5373,7 @@ function ControlButton({
|
|
|
5372
5373
|
},
|
|
5373
5374
|
[disabled, pressEvent, eventBus, onPress]
|
|
5374
5375
|
);
|
|
5375
|
-
const handlePointerUp =
|
|
5376
|
+
const handlePointerUp = React117.useCallback(
|
|
5376
5377
|
(e) => {
|
|
5377
5378
|
e.preventDefault();
|
|
5378
5379
|
if (disabled) return;
|
|
@@ -5382,7 +5383,7 @@ function ControlButton({
|
|
|
5382
5383
|
},
|
|
5383
5384
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5384
5385
|
);
|
|
5385
|
-
const handlePointerLeave =
|
|
5386
|
+
const handlePointerLeave = React117.useCallback(
|
|
5386
5387
|
(e) => {
|
|
5387
5388
|
if (isPressed) {
|
|
5388
5389
|
setIsPressed(false);
|
|
@@ -6172,9 +6173,9 @@ function MiniMap({
|
|
|
6172
6173
|
viewportRect,
|
|
6173
6174
|
className
|
|
6174
6175
|
}) {
|
|
6175
|
-
const canvasRef =
|
|
6176
|
-
const frameRef =
|
|
6177
|
-
|
|
6176
|
+
const canvasRef = React117.useRef(null);
|
|
6177
|
+
const frameRef = React117.useRef(0);
|
|
6178
|
+
React117.useEffect(() => {
|
|
6178
6179
|
const canvas = canvasRef.current;
|
|
6179
6180
|
if (!canvas) return;
|
|
6180
6181
|
const ctx = canvas.getContext("2d");
|
|
@@ -6283,7 +6284,7 @@ var ErrorState = ({
|
|
|
6283
6284
|
);
|
|
6284
6285
|
};
|
|
6285
6286
|
ErrorState.displayName = "ErrorState";
|
|
6286
|
-
var ErrorBoundary = class extends
|
|
6287
|
+
var ErrorBoundary = class extends React117__default.Component {
|
|
6287
6288
|
constructor(props) {
|
|
6288
6289
|
super(props);
|
|
6289
6290
|
__publicField(this, "reset", () => {
|
|
@@ -6506,6 +6507,26 @@ var SLOT_DEFINITIONS = {
|
|
|
6506
6507
|
function isPortalSlot(slot) {
|
|
6507
6508
|
return SLOT_DEFINITIONS[slot]?.type === "portal";
|
|
6508
6509
|
}
|
|
6510
|
+
function isInlineOrbital(orbital) {
|
|
6511
|
+
return "name" in orbital && typeof orbital.name === "string";
|
|
6512
|
+
}
|
|
6513
|
+
function isInlinePage(page) {
|
|
6514
|
+
return typeof page === "object" && page !== null && "name" in page && typeof page.name === "string";
|
|
6515
|
+
}
|
|
6516
|
+
function getAllPages(schema) {
|
|
6517
|
+
const pages = [];
|
|
6518
|
+
if (!schema.orbitals) return pages;
|
|
6519
|
+
for (const orbital of schema.orbitals) {
|
|
6520
|
+
if (!isInlineOrbital(orbital)) continue;
|
|
6521
|
+
if (!orbital.pages) continue;
|
|
6522
|
+
for (const pageRef of orbital.pages) {
|
|
6523
|
+
if (isInlinePage(pageRef)) {
|
|
6524
|
+
pages.push({ page: pageRef, orbitalName: orbital.name });
|
|
6525
|
+
}
|
|
6526
|
+
}
|
|
6527
|
+
}
|
|
6528
|
+
return pages;
|
|
6529
|
+
}
|
|
6509
6530
|
createContext(null);
|
|
6510
6531
|
var variantBorderClasses = {
|
|
6511
6532
|
info: "border-info",
|
|
@@ -6646,8 +6667,8 @@ var Tooltip = ({
|
|
|
6646
6667
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
6647
6668
|
};
|
|
6648
6669
|
}, []);
|
|
6649
|
-
const triggerElement =
|
|
6650
|
-
const trigger =
|
|
6670
|
+
const triggerElement = React117__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6671
|
+
const trigger = React117__default.cloneElement(triggerElement, {
|
|
6651
6672
|
ref: triggerRef,
|
|
6652
6673
|
onMouseEnter: handleMouseEnter,
|
|
6653
6674
|
onMouseLeave: handleMouseLeave,
|
|
@@ -6760,8 +6781,8 @@ var Popover = ({
|
|
|
6760
6781
|
onMouseEnter: handleOpen,
|
|
6761
6782
|
onMouseLeave: handleClose
|
|
6762
6783
|
};
|
|
6763
|
-
const childElement =
|
|
6764
|
-
const triggerElement =
|
|
6784
|
+
const childElement = React117__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6785
|
+
const triggerElement = React117__default.cloneElement(
|
|
6765
6786
|
childElement,
|
|
6766
6787
|
{
|
|
6767
6788
|
ref: triggerRef,
|
|
@@ -6865,8 +6886,8 @@ var Menu = ({
|
|
|
6865
6886
|
"bottom-start": "top-full left-0 mt-2",
|
|
6866
6887
|
"bottom-end": "top-full right-0 mt-2"
|
|
6867
6888
|
};
|
|
6868
|
-
const triggerChild =
|
|
6869
|
-
const triggerElement =
|
|
6889
|
+
const triggerChild = React117__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6890
|
+
const triggerElement = React117__default.cloneElement(
|
|
6870
6891
|
triggerChild,
|
|
6871
6892
|
{
|
|
6872
6893
|
ref: triggerRef,
|
|
@@ -7566,7 +7587,7 @@ function InputPattern({
|
|
|
7566
7587
|
className
|
|
7567
7588
|
}) {
|
|
7568
7589
|
const { emit } = useEventBus();
|
|
7569
|
-
const [localValue, setLocalValue] =
|
|
7590
|
+
const [localValue, setLocalValue] = React117__default.useState(value);
|
|
7570
7591
|
const handleChange = (e) => {
|
|
7571
7592
|
setLocalValue(e.target.value);
|
|
7572
7593
|
if (onChange) {
|
|
@@ -7603,7 +7624,7 @@ function TextareaPattern({
|
|
|
7603
7624
|
className
|
|
7604
7625
|
}) {
|
|
7605
7626
|
const { emit } = useEventBus();
|
|
7606
|
-
const [localValue, setLocalValue] =
|
|
7627
|
+
const [localValue, setLocalValue] = React117__default.useState(value);
|
|
7607
7628
|
const handleChange = (e) => {
|
|
7608
7629
|
setLocalValue(e.target.value);
|
|
7609
7630
|
if (onChange) {
|
|
@@ -7634,7 +7655,7 @@ function SelectPattern({
|
|
|
7634
7655
|
className
|
|
7635
7656
|
}) {
|
|
7636
7657
|
const { emit } = useEventBus();
|
|
7637
|
-
const [localValue, setLocalValue] =
|
|
7658
|
+
const [localValue, setLocalValue] = React117__default.useState(value);
|
|
7638
7659
|
const handleChange = (e) => {
|
|
7639
7660
|
setLocalValue(e.target.value);
|
|
7640
7661
|
if (onChange) {
|
|
@@ -7663,7 +7684,7 @@ function CheckboxPattern({
|
|
|
7663
7684
|
className
|
|
7664
7685
|
}) {
|
|
7665
7686
|
const { emit } = useEventBus();
|
|
7666
|
-
const [localChecked, setLocalChecked] =
|
|
7687
|
+
const [localChecked, setLocalChecked] = React117__default.useState(checked);
|
|
7667
7688
|
const handleChange = (e) => {
|
|
7668
7689
|
setLocalChecked(e.target.checked);
|
|
7669
7690
|
if (onChange) {
|
|
@@ -7864,8 +7885,8 @@ function ActionButtons({
|
|
|
7864
7885
|
disabled
|
|
7865
7886
|
}) {
|
|
7866
7887
|
const eventBus = useEventBus();
|
|
7867
|
-
const [activeButtons, setActiveButtons] =
|
|
7868
|
-
const handlePress =
|
|
7888
|
+
const [activeButtons, setActiveButtons] = React117.useState(/* @__PURE__ */ new Set());
|
|
7889
|
+
const handlePress = React117.useCallback(
|
|
7869
7890
|
(id) => {
|
|
7870
7891
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7871
7892
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7873,7 +7894,7 @@ function ActionButtons({
|
|
|
7873
7894
|
},
|
|
7874
7895
|
[actionEvent, eventBus, onAction]
|
|
7875
7896
|
);
|
|
7876
|
-
const handleRelease =
|
|
7897
|
+
const handleRelease = React117.useCallback(
|
|
7877
7898
|
(id) => {
|
|
7878
7899
|
setActiveButtons((prev) => {
|
|
7879
7900
|
const next = new Set(prev);
|
|
@@ -9537,7 +9558,7 @@ var ScaledDiagram = ({
|
|
|
9537
9558
|
);
|
|
9538
9559
|
};
|
|
9539
9560
|
ScaledDiagram.displayName = "ScaledDiagram";
|
|
9540
|
-
var MarkdownContent =
|
|
9561
|
+
var MarkdownContent = React117__default.memo(
|
|
9541
9562
|
({ content, direction, className }) => {
|
|
9542
9563
|
const { t: _t } = useTranslate();
|
|
9543
9564
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -9639,7 +9660,7 @@ var MarkdownContent = React116__default.memo(
|
|
|
9639
9660
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
9640
9661
|
);
|
|
9641
9662
|
MarkdownContent.displayName = "MarkdownContent";
|
|
9642
|
-
var CodeBlock =
|
|
9663
|
+
var CodeBlock = React117__default.memo(
|
|
9643
9664
|
({
|
|
9644
9665
|
code: rawCode,
|
|
9645
9666
|
language = "text",
|
|
@@ -10599,7 +10620,7 @@ var StateMachineView = ({
|
|
|
10599
10620
|
style: { top: title ? 30 : 0 },
|
|
10600
10621
|
children: [
|
|
10601
10622
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
10602
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
10623
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React117__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
10603
10624
|
StateNode,
|
|
10604
10625
|
{
|
|
10605
10626
|
state,
|
|
@@ -15936,7 +15957,7 @@ function CraftingRecipe({
|
|
|
15936
15957
|
className
|
|
15937
15958
|
}) {
|
|
15938
15959
|
const eventBus = useEventBus();
|
|
15939
|
-
const handleCraft =
|
|
15960
|
+
const handleCraft = React117.useCallback(() => {
|
|
15940
15961
|
onCraft?.();
|
|
15941
15962
|
if (craftEvent) {
|
|
15942
15963
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -15953,7 +15974,7 @@ function CraftingRecipe({
|
|
|
15953
15974
|
children: [
|
|
15954
15975
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
15955
15976
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
15956
|
-
return /* @__PURE__ */ jsxs(
|
|
15977
|
+
return /* @__PURE__ */ jsxs(React117.Fragment, { children: [
|
|
15957
15978
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
15958
15979
|
ItemSlot,
|
|
15959
15980
|
{
|
|
@@ -16232,8 +16253,8 @@ function DPad({
|
|
|
16232
16253
|
}) {
|
|
16233
16254
|
const eventBus = useEventBus();
|
|
16234
16255
|
const sizes = sizeMap15[size];
|
|
16235
|
-
const [activeDirections, setActiveDirections] =
|
|
16236
|
-
const handlePress =
|
|
16256
|
+
const [activeDirections, setActiveDirections] = React117.useState(/* @__PURE__ */ new Set());
|
|
16257
|
+
const handlePress = React117.useCallback(
|
|
16237
16258
|
(direction) => {
|
|
16238
16259
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
16239
16260
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -16241,7 +16262,7 @@ function DPad({
|
|
|
16241
16262
|
},
|
|
16242
16263
|
[directionEvent, eventBus, onDirection]
|
|
16243
16264
|
);
|
|
16244
|
-
const handleRelease =
|
|
16265
|
+
const handleRelease = React117.useCallback(
|
|
16245
16266
|
(direction) => {
|
|
16246
16267
|
setActiveDirections((prev) => {
|
|
16247
16268
|
const next = new Set(prev);
|
|
@@ -17018,7 +17039,7 @@ var DataList = ({
|
|
|
17018
17039
|
}) => {
|
|
17019
17040
|
const eventBus = useEventBus();
|
|
17020
17041
|
const { t } = useTranslate();
|
|
17021
|
-
const [visibleCount, setVisibleCount] =
|
|
17042
|
+
const [visibleCount, setVisibleCount] = React117__default.useState(pageSize || Infinity);
|
|
17022
17043
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
17023
17044
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17024
17045
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -17055,7 +17076,7 @@ var DataList = ({
|
|
|
17055
17076
|
const items2 = data.map((item) => item);
|
|
17056
17077
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17057
17078
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
17058
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17079
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
17059
17080
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
17060
17081
|
group.items.map((itemData, index) => {
|
|
17061
17082
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -17258,7 +17279,7 @@ var DataList = ({
|
|
|
17258
17279
|
className
|
|
17259
17280
|
),
|
|
17260
17281
|
children: [
|
|
17261
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17282
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
17262
17283
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
17263
17284
|
group.items.map(
|
|
17264
17285
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -18227,7 +18248,7 @@ var WizardProgress = ({
|
|
|
18227
18248
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
18228
18249
|
const isActive = index === currentStep;
|
|
18229
18250
|
const isCompleted = index < currentStep;
|
|
18230
|
-
return /* @__PURE__ */ jsxs(
|
|
18251
|
+
return /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
18231
18252
|
/* @__PURE__ */ jsx(
|
|
18232
18253
|
"button",
|
|
18233
18254
|
{
|
|
@@ -19052,7 +19073,7 @@ function InventoryGrid({
|
|
|
19052
19073
|
const eventBus = useEventBus();
|
|
19053
19074
|
const slotCount = totalSlots ?? items.length;
|
|
19054
19075
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
19055
|
-
const handleSelect =
|
|
19076
|
+
const handleSelect = React117.useCallback(
|
|
19056
19077
|
(id) => {
|
|
19057
19078
|
onSelect?.(id);
|
|
19058
19079
|
if (selectEvent) {
|
|
@@ -19225,15 +19246,15 @@ function GameCanvas2D({
|
|
|
19225
19246
|
fps = 60,
|
|
19226
19247
|
className
|
|
19227
19248
|
}) {
|
|
19228
|
-
const canvasRef =
|
|
19229
|
-
const rafRef =
|
|
19230
|
-
const frameRef =
|
|
19231
|
-
const lastTimeRef =
|
|
19232
|
-
const onDrawRef =
|
|
19249
|
+
const canvasRef = React117.useRef(null);
|
|
19250
|
+
const rafRef = React117.useRef(0);
|
|
19251
|
+
const frameRef = React117.useRef(0);
|
|
19252
|
+
const lastTimeRef = React117.useRef(0);
|
|
19253
|
+
const onDrawRef = React117.useRef(onDraw);
|
|
19233
19254
|
onDrawRef.current = onDraw;
|
|
19234
|
-
const onTickRef =
|
|
19255
|
+
const onTickRef = React117.useRef(onTick);
|
|
19235
19256
|
onTickRef.current = onTick;
|
|
19236
|
-
|
|
19257
|
+
React117.useEffect(() => {
|
|
19237
19258
|
const canvas = canvasRef.current;
|
|
19238
19259
|
if (!canvas) return;
|
|
19239
19260
|
const ctx = canvas.getContext("2d");
|
|
@@ -19486,7 +19507,7 @@ function TurnPanel({
|
|
|
19486
19507
|
className
|
|
19487
19508
|
}) {
|
|
19488
19509
|
const eventBus = useEventBus();
|
|
19489
|
-
const handleAction =
|
|
19510
|
+
const handleAction = React117.useCallback(
|
|
19490
19511
|
(event) => {
|
|
19491
19512
|
if (event) {
|
|
19492
19513
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -19611,7 +19632,7 @@ function UnitCommandBar({
|
|
|
19611
19632
|
className
|
|
19612
19633
|
}) {
|
|
19613
19634
|
const eventBus = useEventBus();
|
|
19614
|
-
const handleCommand =
|
|
19635
|
+
const handleCommand = React117.useCallback(
|
|
19615
19636
|
(event) => {
|
|
19616
19637
|
if (event) {
|
|
19617
19638
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -20070,7 +20091,7 @@ function GameMenu({
|
|
|
20070
20091
|
} catch {
|
|
20071
20092
|
}
|
|
20072
20093
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
20073
|
-
const handleOptionClick =
|
|
20094
|
+
const handleOptionClick = React117.useCallback(
|
|
20074
20095
|
(option) => {
|
|
20075
20096
|
if (option.event && eventBus) {
|
|
20076
20097
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -20193,7 +20214,7 @@ function GameOverScreen({
|
|
|
20193
20214
|
} catch {
|
|
20194
20215
|
}
|
|
20195
20216
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
20196
|
-
const handleActionClick =
|
|
20217
|
+
const handleActionClick = React117.useCallback(
|
|
20197
20218
|
(action) => {
|
|
20198
20219
|
if (action.event && eventBus) {
|
|
20199
20220
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -23293,7 +23314,7 @@ var DocumentViewer = ({
|
|
|
23293
23314
|
};
|
|
23294
23315
|
DocumentViewer.displayName = "DocumentViewer";
|
|
23295
23316
|
function extractTitle(children) {
|
|
23296
|
-
if (!
|
|
23317
|
+
if (!React117__default.isValidElement(children)) return void 0;
|
|
23297
23318
|
const props = children.props;
|
|
23298
23319
|
if (typeof props.title === "string") {
|
|
23299
23320
|
return props.title;
|
|
@@ -23345,7 +23366,7 @@ function LinearView({
|
|
|
23345
23366
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
23346
23367
|
const isDone = i < currentIdx;
|
|
23347
23368
|
const isCurrent = i === currentIdx;
|
|
23348
|
-
return /* @__PURE__ */ jsxs(
|
|
23369
|
+
return /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
23349
23370
|
i > 0 && /* @__PURE__ */ jsx(
|
|
23350
23371
|
Typography,
|
|
23351
23372
|
{
|
|
@@ -24011,7 +24032,7 @@ var Form = ({
|
|
|
24011
24032
|
const normalizedInitialData = initialData ?? {};
|
|
24012
24033
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
24013
24034
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
24014
|
-
const entityDerivedFields =
|
|
24035
|
+
const entityDerivedFields = React117__default.useMemo(() => {
|
|
24015
24036
|
if (fields && fields.length > 0) return void 0;
|
|
24016
24037
|
if (!resolvedEntity) return void 0;
|
|
24017
24038
|
return resolvedEntity.fields.map(
|
|
@@ -24030,14 +24051,14 @@ var Form = ({
|
|
|
24030
24051
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
24031
24052
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
24032
24053
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
24033
|
-
const [formData, setFormData] =
|
|
24054
|
+
const [formData, setFormData] = React117__default.useState(
|
|
24034
24055
|
normalizedInitialData
|
|
24035
24056
|
);
|
|
24036
|
-
const [collapsedSections, setCollapsedSections] =
|
|
24057
|
+
const [collapsedSections, setCollapsedSections] = React117__default.useState(
|
|
24037
24058
|
/* @__PURE__ */ new Set()
|
|
24038
24059
|
);
|
|
24039
24060
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
24040
|
-
const evalContext =
|
|
24061
|
+
const evalContext = React117__default.useMemo(
|
|
24041
24062
|
() => ({
|
|
24042
24063
|
formValues: formData,
|
|
24043
24064
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -24046,13 +24067,13 @@ var Form = ({
|
|
|
24046
24067
|
}),
|
|
24047
24068
|
[formData, externalContext]
|
|
24048
24069
|
);
|
|
24049
|
-
|
|
24070
|
+
React117__default.useEffect(() => {
|
|
24050
24071
|
const data = initialData;
|
|
24051
24072
|
if (data && Object.keys(data).length > 0) {
|
|
24052
24073
|
setFormData(data);
|
|
24053
24074
|
}
|
|
24054
24075
|
}, [initialData]);
|
|
24055
|
-
const processCalculations =
|
|
24076
|
+
const processCalculations = React117__default.useCallback(
|
|
24056
24077
|
(changedFieldId, newFormData) => {
|
|
24057
24078
|
if (!hiddenCalculations.length) return;
|
|
24058
24079
|
const context = {
|
|
@@ -24077,7 +24098,7 @@ var Form = ({
|
|
|
24077
24098
|
},
|
|
24078
24099
|
[hiddenCalculations, externalContext, eventBus]
|
|
24079
24100
|
);
|
|
24080
|
-
const checkViolations =
|
|
24101
|
+
const checkViolations = React117__default.useCallback(
|
|
24081
24102
|
(changedFieldId, newFormData) => {
|
|
24082
24103
|
if (!violationTriggers.length) return;
|
|
24083
24104
|
const context = {
|
|
@@ -24114,7 +24135,7 @@ var Form = ({
|
|
|
24114
24135
|
processCalculations(name, newFormData);
|
|
24115
24136
|
checkViolations(name, newFormData);
|
|
24116
24137
|
};
|
|
24117
|
-
const isFieldVisible =
|
|
24138
|
+
const isFieldVisible = React117__default.useCallback(
|
|
24118
24139
|
(fieldName) => {
|
|
24119
24140
|
const condition = conditionalFields[fieldName];
|
|
24120
24141
|
if (!condition) return true;
|
|
@@ -24122,7 +24143,7 @@ var Form = ({
|
|
|
24122
24143
|
},
|
|
24123
24144
|
[conditionalFields, evalContext]
|
|
24124
24145
|
);
|
|
24125
|
-
const isSectionVisible =
|
|
24146
|
+
const isSectionVisible = React117__default.useCallback(
|
|
24126
24147
|
(section) => {
|
|
24127
24148
|
if (!section.condition) return true;
|
|
24128
24149
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -24154,7 +24175,7 @@ var Form = ({
|
|
|
24154
24175
|
eventBus.emit(`UI:${onCancel}`);
|
|
24155
24176
|
}
|
|
24156
24177
|
};
|
|
24157
|
-
const renderField =
|
|
24178
|
+
const renderField = React117__default.useCallback(
|
|
24158
24179
|
(field) => {
|
|
24159
24180
|
const fieldName = field.name || field.field;
|
|
24160
24181
|
if (!fieldName) return null;
|
|
@@ -24175,7 +24196,7 @@ var Form = ({
|
|
|
24175
24196
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
24176
24197
|
);
|
|
24177
24198
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
24178
|
-
const normalizedFields =
|
|
24199
|
+
const normalizedFields = React117__default.useMemo(() => {
|
|
24179
24200
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
24180
24201
|
return effectiveFields.map((field) => {
|
|
24181
24202
|
if (typeof field === "string") {
|
|
@@ -24197,7 +24218,7 @@ var Form = ({
|
|
|
24197
24218
|
return field;
|
|
24198
24219
|
});
|
|
24199
24220
|
}, [effectiveFields, resolvedEntity]);
|
|
24200
|
-
const schemaFields =
|
|
24221
|
+
const schemaFields = React117__default.useMemo(() => {
|
|
24201
24222
|
if (normalizedFields.length === 0) return null;
|
|
24202
24223
|
if (isDebugEnabled()) {
|
|
24203
24224
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -24207,7 +24228,7 @@ var Form = ({
|
|
|
24207
24228
|
}
|
|
24208
24229
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
24209
24230
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
24210
|
-
const sectionElements =
|
|
24231
|
+
const sectionElements = React117__default.useMemo(() => {
|
|
24211
24232
|
if (!sections || sections.length === 0) return null;
|
|
24212
24233
|
return sections.map((section) => {
|
|
24213
24234
|
if (!isSectionVisible(section)) {
|
|
@@ -25611,7 +25632,7 @@ var List2 = ({
|
|
|
25611
25632
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
25612
25633
|
return [];
|
|
25613
25634
|
}, [entity]);
|
|
25614
|
-
const getItemActions =
|
|
25635
|
+
const getItemActions = React117__default.useCallback(
|
|
25615
25636
|
(item) => {
|
|
25616
25637
|
if (!itemActions) return [];
|
|
25617
25638
|
if (typeof itemActions === "function") {
|
|
@@ -26037,7 +26058,7 @@ var MediaGallery = ({
|
|
|
26037
26058
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
26038
26059
|
);
|
|
26039
26060
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
26040
|
-
const items =
|
|
26061
|
+
const items = React117__default.useMemo(() => {
|
|
26041
26062
|
if (propItems) return propItems;
|
|
26042
26063
|
if (entityData.length === 0) return [];
|
|
26043
26064
|
return entityData.map((record, idx) => ({
|
|
@@ -26199,7 +26220,7 @@ var MediaGallery = ({
|
|
|
26199
26220
|
};
|
|
26200
26221
|
MediaGallery.displayName = "MediaGallery";
|
|
26201
26222
|
function extractTitle2(children) {
|
|
26202
|
-
if (!
|
|
26223
|
+
if (!React117__default.isValidElement(children)) return void 0;
|
|
26203
26224
|
const props = children.props;
|
|
26204
26225
|
if (typeof props.title === "string") {
|
|
26205
26226
|
return props.title;
|
|
@@ -26869,7 +26890,7 @@ var PageHeader = ({
|
|
|
26869
26890
|
info: "bg-info/10 text-info"
|
|
26870
26891
|
};
|
|
26871
26892
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
26872
|
-
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(
|
|
26893
|
+
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(React117__default.Fragment, { children: [
|
|
26873
26894
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
26874
26895
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
26875
26896
|
"a",
|
|
@@ -26995,7 +27016,7 @@ function subscribeToDebugEvents(listener) {
|
|
|
26995
27016
|
|
|
26996
27017
|
// components/organisms/debug/hooks/useDebugData.ts
|
|
26997
27018
|
function useDebugData() {
|
|
26998
|
-
const [data, setData] =
|
|
27019
|
+
const [data, setData] = React117.useState(() => ({
|
|
26999
27020
|
traits: [],
|
|
27000
27021
|
ticks: [],
|
|
27001
27022
|
guards: [],
|
|
@@ -27009,7 +27030,7 @@ function useDebugData() {
|
|
|
27009
27030
|
},
|
|
27010
27031
|
lastUpdate: Date.now()
|
|
27011
27032
|
}));
|
|
27012
|
-
|
|
27033
|
+
React117.useEffect(() => {
|
|
27013
27034
|
const updateData = () => {
|
|
27014
27035
|
setData({
|
|
27015
27036
|
traits: getAllTraits(),
|
|
@@ -27278,15 +27299,15 @@ var TYPE_BADGES = {
|
|
|
27278
27299
|
state: { variant: "danger", icon: "\u{1F4CA}" }
|
|
27279
27300
|
};
|
|
27280
27301
|
function EventFlowTab({ events: events2 }) {
|
|
27281
|
-
const [filter, setFilter] =
|
|
27282
|
-
const containerRef =
|
|
27283
|
-
const [autoScroll, setAutoScroll] =
|
|
27284
|
-
|
|
27302
|
+
const [filter, setFilter] = React117.useState("all");
|
|
27303
|
+
const containerRef = React117.useRef(null);
|
|
27304
|
+
const [autoScroll, setAutoScroll] = React117.useState(true);
|
|
27305
|
+
React117.useEffect(() => {
|
|
27285
27306
|
if (autoScroll && containerRef.current) {
|
|
27286
27307
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
27287
27308
|
}
|
|
27288
27309
|
}, [events2.length, autoScroll]);
|
|
27289
|
-
const filteredEvents =
|
|
27310
|
+
const filteredEvents = React117.useMemo(() => {
|
|
27290
27311
|
if (filter === "all") return events2;
|
|
27291
27312
|
return events2.filter((e) => e.type === filter);
|
|
27292
27313
|
}, [events2, filter]);
|
|
@@ -27385,7 +27406,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
27385
27406
|
}
|
|
27386
27407
|
EventFlowTab.displayName = "EventFlowTab";
|
|
27387
27408
|
function GuardsPanel({ guards }) {
|
|
27388
|
-
const [filter, setFilter] =
|
|
27409
|
+
const [filter, setFilter] = React117.useState("all");
|
|
27389
27410
|
if (guards.length === 0) {
|
|
27390
27411
|
return /* @__PURE__ */ jsx(
|
|
27391
27412
|
EmptyState,
|
|
@@ -27398,7 +27419,7 @@ function GuardsPanel({ guards }) {
|
|
|
27398
27419
|
}
|
|
27399
27420
|
const passedCount = guards.filter((g) => g.result).length;
|
|
27400
27421
|
const failedCount = guards.length - passedCount;
|
|
27401
|
-
const filteredGuards =
|
|
27422
|
+
const filteredGuards = React117.useMemo(() => {
|
|
27402
27423
|
if (filter === "all") return guards;
|
|
27403
27424
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
27404
27425
|
return guards.filter((g) => !g.result);
|
|
@@ -27542,10 +27563,10 @@ function EffectBadge({ effect }) {
|
|
|
27542
27563
|
] });
|
|
27543
27564
|
}
|
|
27544
27565
|
function TransitionTimeline({ transitions }) {
|
|
27545
|
-
const containerRef =
|
|
27546
|
-
const [autoScroll, setAutoScroll] =
|
|
27547
|
-
const [expandedId, setExpandedId] =
|
|
27548
|
-
|
|
27566
|
+
const containerRef = React117.useRef(null);
|
|
27567
|
+
const [autoScroll, setAutoScroll] = React117.useState(true);
|
|
27568
|
+
const [expandedId, setExpandedId] = React117.useState(null);
|
|
27569
|
+
React117.useEffect(() => {
|
|
27549
27570
|
if (autoScroll && containerRef.current) {
|
|
27550
27571
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
27551
27572
|
}
|
|
@@ -27806,9 +27827,9 @@ function getAllEvents(traits2) {
|
|
|
27806
27827
|
}
|
|
27807
27828
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
27808
27829
|
const eventBus = useEventBus();
|
|
27809
|
-
const [log, setLog] =
|
|
27810
|
-
const prevStatesRef =
|
|
27811
|
-
|
|
27830
|
+
const [log, setLog] = React117.useState([]);
|
|
27831
|
+
const prevStatesRef = React117.useRef(/* @__PURE__ */ new Map());
|
|
27832
|
+
React117.useEffect(() => {
|
|
27812
27833
|
for (const trait of traits2) {
|
|
27813
27834
|
const prev = prevStatesRef.current.get(trait.id);
|
|
27814
27835
|
if (prev && prev !== trait.currentState) {
|
|
@@ -27891,10 +27912,10 @@ function RuntimeDebugger({
|
|
|
27891
27912
|
defaultTab,
|
|
27892
27913
|
schema
|
|
27893
27914
|
}) {
|
|
27894
|
-
const [isCollapsed, setIsCollapsed] =
|
|
27895
|
-
const [isVisible, setIsVisible] =
|
|
27915
|
+
const [isCollapsed, setIsCollapsed] = React117.useState(mode === "verify" ? true : defaultCollapsed);
|
|
27916
|
+
const [isVisible, setIsVisible] = React117.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
27896
27917
|
const debugData = useDebugData();
|
|
27897
|
-
|
|
27918
|
+
React117.useEffect(() => {
|
|
27898
27919
|
if (mode === "inline") return;
|
|
27899
27920
|
return onDebugToggle((enabled) => {
|
|
27900
27921
|
setIsVisible(enabled);
|
|
@@ -27903,7 +27924,7 @@ function RuntimeDebugger({
|
|
|
27903
27924
|
}
|
|
27904
27925
|
});
|
|
27905
27926
|
}, [mode]);
|
|
27906
|
-
|
|
27927
|
+
React117.useEffect(() => {
|
|
27907
27928
|
if (mode === "inline") return;
|
|
27908
27929
|
const handleKeyDown = (e) => {
|
|
27909
27930
|
if (e.key === "`" && isVisible) {
|
|
@@ -28037,7 +28058,7 @@ function RuntimeDebugger({
|
|
|
28037
28058
|
{
|
|
28038
28059
|
className: cn(
|
|
28039
28060
|
"runtime-debugger runtime-debugger--verify",
|
|
28040
|
-
"h-[35vh] flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
|
|
28061
|
+
"fixed bottom-0 left-0 right-0 z-[9999] h-[35vh] flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
|
|
28041
28062
|
className
|
|
28042
28063
|
),
|
|
28043
28064
|
"data-testid": "debugger-verify",
|
|
@@ -28442,7 +28463,7 @@ function SequenceBar({
|
|
|
28442
28463
|
onSlotRemove(index);
|
|
28443
28464
|
}, [onSlotRemove, playing]);
|
|
28444
28465
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
28445
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
28466
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
28446
28467
|
i > 0 && /* @__PURE__ */ jsx(
|
|
28447
28468
|
Typography,
|
|
28448
28469
|
{
|
|
@@ -29680,7 +29701,7 @@ var StatCard = ({
|
|
|
29680
29701
|
const labelToUse = propLabel ?? propTitle;
|
|
29681
29702
|
const eventBus = useEventBus();
|
|
29682
29703
|
const { t } = useTranslate();
|
|
29683
|
-
const handleActionClick =
|
|
29704
|
+
const handleActionClick = React117__default.useCallback(() => {
|
|
29684
29705
|
if (action?.event) {
|
|
29685
29706
|
eventBus.emit(`UI:${action.event}`, {});
|
|
29686
29707
|
}
|
|
@@ -29691,7 +29712,7 @@ var StatCard = ({
|
|
|
29691
29712
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29692
29713
|
const isLoading = externalLoading ?? false;
|
|
29693
29714
|
const error = externalError;
|
|
29694
|
-
const computeMetricValue =
|
|
29715
|
+
const computeMetricValue = React117__default.useCallback(
|
|
29695
29716
|
(metric, items) => {
|
|
29696
29717
|
if (metric.value !== void 0) {
|
|
29697
29718
|
return metric.value;
|
|
@@ -29730,7 +29751,7 @@ var StatCard = ({
|
|
|
29730
29751
|
},
|
|
29731
29752
|
[]
|
|
29732
29753
|
);
|
|
29733
|
-
const schemaStats =
|
|
29754
|
+
const schemaStats = React117__default.useMemo(() => {
|
|
29734
29755
|
if (!metrics || metrics.length === 0) return null;
|
|
29735
29756
|
return metrics.map((metric) => ({
|
|
29736
29757
|
label: metric.label,
|
|
@@ -29738,7 +29759,7 @@ var StatCard = ({
|
|
|
29738
29759
|
format: metric.format
|
|
29739
29760
|
}));
|
|
29740
29761
|
}, [metrics, data, computeMetricValue]);
|
|
29741
|
-
const calculatedTrend =
|
|
29762
|
+
const calculatedTrend = React117__default.useMemo(() => {
|
|
29742
29763
|
if (manualTrend !== void 0) return manualTrend;
|
|
29743
29764
|
if (previousValue === void 0 || currentValue === void 0)
|
|
29744
29765
|
return void 0;
|
|
@@ -30649,7 +30670,7 @@ var Timeline = ({
|
|
|
30649
30670
|
}) => {
|
|
30650
30671
|
const { t } = useTranslate();
|
|
30651
30672
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30652
|
-
const items =
|
|
30673
|
+
const items = React117__default.useMemo(() => {
|
|
30653
30674
|
if (propItems) return propItems;
|
|
30654
30675
|
if (entityData.length === 0) return [];
|
|
30655
30676
|
return entityData.map((record, idx) => {
|
|
@@ -30751,7 +30772,7 @@ var Timeline = ({
|
|
|
30751
30772
|
};
|
|
30752
30773
|
Timeline.displayName = "Timeline";
|
|
30753
30774
|
function extractToastProps(children) {
|
|
30754
|
-
if (!
|
|
30775
|
+
if (!React117__default.isValidElement(children)) {
|
|
30755
30776
|
if (typeof children === "string") {
|
|
30756
30777
|
return { message: children };
|
|
30757
30778
|
}
|
|
@@ -30782,7 +30803,7 @@ var ToastSlot = ({
|
|
|
30782
30803
|
eventBus.emit("UI:CLOSE");
|
|
30783
30804
|
};
|
|
30784
30805
|
if (!isVisible) return null;
|
|
30785
|
-
const isCustomContent =
|
|
30806
|
+
const isCustomContent = React117__default.isValidElement(children) && !message;
|
|
30786
30807
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
30787
30808
|
Toast,
|
|
30788
30809
|
{
|
|
@@ -31026,7 +31047,7 @@ var WizardContainer = ({
|
|
|
31026
31047
|
const isCompleted = index < currentStep;
|
|
31027
31048
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
31028
31049
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
31029
|
-
return /* @__PURE__ */ jsxs(
|
|
31050
|
+
return /* @__PURE__ */ jsxs(React117__default.Fragment, { children: [
|
|
31030
31051
|
/* @__PURE__ */ jsx(
|
|
31031
31052
|
Button,
|
|
31032
31053
|
{
|
|
@@ -31392,12 +31413,12 @@ WorldMapTemplate.displayName = "WorldMapTemplate";
|
|
|
31392
31413
|
|
|
31393
31414
|
// components/organisms/component-registry.generated.ts
|
|
31394
31415
|
function lazyThree(name, loader) {
|
|
31395
|
-
const Lazy =
|
|
31416
|
+
const Lazy = React117__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
31396
31417
|
function ThreeWrapper(props) {
|
|
31397
|
-
return
|
|
31398
|
-
|
|
31418
|
+
return React117__default.createElement(
|
|
31419
|
+
React117__default.Suspense,
|
|
31399
31420
|
{ fallback: null },
|
|
31400
|
-
|
|
31421
|
+
React117__default.createElement(Lazy, props)
|
|
31401
31422
|
);
|
|
31402
31423
|
}
|
|
31403
31424
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -31685,7 +31706,7 @@ function SuspenseConfigProvider({
|
|
|
31685
31706
|
config,
|
|
31686
31707
|
children
|
|
31687
31708
|
}) {
|
|
31688
|
-
return
|
|
31709
|
+
return React117__default.createElement(
|
|
31689
31710
|
SuspenseConfigContext.Provider,
|
|
31690
31711
|
{ value: config },
|
|
31691
31712
|
children
|
|
@@ -32291,7 +32312,7 @@ function VerificationProvider({
|
|
|
32291
32312
|
})) : [];
|
|
32292
32313
|
recordTransition({
|
|
32293
32314
|
traitName: parsed.traitName,
|
|
32294
|
-
from: pending?.from ??
|
|
32315
|
+
from: pending?.from ?? payload["currentState"] ?? newState,
|
|
32295
32316
|
to: newState,
|
|
32296
32317
|
event: parsed.event,
|
|
32297
32318
|
effects,
|
|
@@ -32302,10 +32323,11 @@ function VerificationProvider({
|
|
|
32302
32323
|
const pending = pendingRef.current.get(key);
|
|
32303
32324
|
pendingRef.current.delete(key);
|
|
32304
32325
|
const errorMsg = payload["error"] ?? "Unknown error";
|
|
32326
|
+
const fromState = pending?.from ?? payload["currentState"] ?? "unknown";
|
|
32305
32327
|
recordTransition({
|
|
32306
32328
|
traitName: parsed.traitName,
|
|
32307
|
-
from:
|
|
32308
|
-
to:
|
|
32329
|
+
from: fromState,
|
|
32330
|
+
to: fromState,
|
|
32309
32331
|
// state didn't change on error
|
|
32310
32332
|
event: parsed.event,
|
|
32311
32333
|
effects: [{
|
|
@@ -32560,7 +32582,7 @@ function SlotBridge({ mockData }) {
|
|
|
32560
32582
|
}, [slots, render, clear, mockData]);
|
|
32561
32583
|
return null;
|
|
32562
32584
|
}
|
|
32563
|
-
function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
32585
|
+
function TraitInitializer({ traits: traits2, orbitalNames, onNavigate }) {
|
|
32564
32586
|
const slotsActions = useSlotsActions();
|
|
32565
32587
|
const bridge = useServerBridge();
|
|
32566
32588
|
const onEventProcessed = useCallback(async (event, payload) => {
|
|
@@ -32574,11 +32596,13 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32574
32596
|
[{ pattern: eff.pattern, props: {} }],
|
|
32575
32597
|
{ trait: "server", state: "server", transition: "server-effect" }
|
|
32576
32598
|
);
|
|
32599
|
+
} else if (eff.type === "navigate" && eff.route && onNavigate) {
|
|
32600
|
+
onNavigate(eff.route, eff.params);
|
|
32577
32601
|
}
|
|
32578
32602
|
}
|
|
32579
32603
|
}
|
|
32580
|
-
}, [bridge.connected, bridge.sendEvent, orbitalNames, slotsActions]);
|
|
32581
|
-
const opts = orbitalNames ? { onEventProcessed } : {};
|
|
32604
|
+
}, [bridge.connected, bridge.sendEvent, orbitalNames, slotsActions, onNavigate]);
|
|
32605
|
+
const opts = orbitalNames ? { onEventProcessed, navigate: onNavigate } : { navigate: onNavigate };
|
|
32582
32606
|
const { sendEvent } = useTraitStateMachine(traits2, slotsActions, opts);
|
|
32583
32607
|
const initSentRef = useRef(false);
|
|
32584
32608
|
useEffect(() => {
|
|
@@ -32629,9 +32653,10 @@ function TraitInitializer({ traits: traits2, orbitalNames }) {
|
|
|
32629
32653
|
}, [bridge.connected, orbitalNames, bridge.sendEvent, slotsActions]);
|
|
32630
32654
|
return null;
|
|
32631
32655
|
}
|
|
32632
|
-
function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
32633
|
-
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema);
|
|
32656
|
+
function SchemaRunner({ schema, serverUrl, mockData, pageName, onNavigate }) {
|
|
32657
|
+
const { traits: traits2, allEntities, ir } = useResolvedSchema(schema, pageName);
|
|
32634
32658
|
const allPageTraits = useMemo(() => {
|
|
32659
|
+
if (pageName && traits2.length > 0) return traits2;
|
|
32635
32660
|
if (!ir?.pages || ir.pages.size <= 1) return traits2;
|
|
32636
32661
|
const combined = [];
|
|
32637
32662
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -32647,7 +32672,7 @@ function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
|
32647
32672
|
}
|
|
32648
32673
|
}
|
|
32649
32674
|
return combined.length > 0 ? combined : traits2;
|
|
32650
|
-
}, [ir, traits2]);
|
|
32675
|
+
}, [ir, traits2, pageName]);
|
|
32651
32676
|
const orbitalNames = useMemo(() => {
|
|
32652
32677
|
const parsed = schema;
|
|
32653
32678
|
const orbitals = parsed?.orbitals;
|
|
@@ -32655,7 +32680,7 @@ function SchemaRunner({ schema, serverUrl, mockData }) {
|
|
|
32655
32680
|
return orbitals.filter((o) => typeof o.name === "string").map((o) => o.name);
|
|
32656
32681
|
}, [schema]);
|
|
32657
32682
|
const inner = /* @__PURE__ */ jsx(VerificationProvider, { enabled: true, children: /* @__PURE__ */ jsx(SlotsProvider, { children: /* @__PURE__ */ jsxs(EntitySchemaProvider, { entities: Array.from(allEntities.values()), children: [
|
|
32658
|
-
/* @__PURE__ */ jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0 }),
|
|
32683
|
+
/* @__PURE__ */ jsx(TraitInitializer, { traits: allPageTraits, orbitalNames: serverUrl ? orbitalNames : void 0, onNavigate }),
|
|
32659
32684
|
/* @__PURE__ */ jsx(SlotBridge, { mockData: !serverUrl ? mockData : void 0 }),
|
|
32660
32685
|
/* @__PURE__ */ jsx(Box, { className: "min-h-full p-4", children: /* @__PURE__ */ jsx(UISlotRenderer, { includeHud: true, hudMode: "inline", includeFloating: true }) })
|
|
32661
32686
|
] }) }) });
|
|
@@ -32681,18 +32706,51 @@ function OrbPreview({
|
|
|
32681
32706
|
}
|
|
32682
32707
|
return schema;
|
|
32683
32708
|
}, [schema]);
|
|
32709
|
+
const pages = useMemo(() => {
|
|
32710
|
+
if (!parsedSchema || parsedSchema.error) return [];
|
|
32711
|
+
try {
|
|
32712
|
+
return getAllPages(parsedSchema);
|
|
32713
|
+
} catch {
|
|
32714
|
+
return [];
|
|
32715
|
+
}
|
|
32716
|
+
}, [parsedSchema]);
|
|
32717
|
+
const [currentPage, setCurrentPage] = useState(void 0);
|
|
32718
|
+
const handleNavigate = useCallback((path) => {
|
|
32719
|
+
const match = pages.find(({ page }) => page.path === path);
|
|
32720
|
+
if (match) {
|
|
32721
|
+
setCurrentPage(match.page.name);
|
|
32722
|
+
}
|
|
32723
|
+
}, [pages]);
|
|
32684
32724
|
if (parsedSchema.error) {
|
|
32685
32725
|
return /* @__PURE__ */ jsx(Box, { className, style: { height }, children: /* @__PURE__ */ jsxs(Typography, { as: "pre", color: "error", variant: "small", className: "font-mono whitespace-pre-wrap break-all m-0 p-4", children: [
|
|
32686
32726
|
"Parse error: ",
|
|
32687
32727
|
parsedSchema.error
|
|
32688
32728
|
] }) });
|
|
32689
32729
|
}
|
|
32730
|
+
const containerRef = useRef(null);
|
|
32731
|
+
useEffect(() => {
|
|
32732
|
+
const el = containerRef.current;
|
|
32733
|
+
if (!el || pages.length <= 1) return;
|
|
32734
|
+
const handler = (e) => {
|
|
32735
|
+
const anchor = e.target.closest("a");
|
|
32736
|
+
if (!anchor) return;
|
|
32737
|
+
const href = anchor.getAttribute("href") ?? anchor.getAttribute("to") ?? "";
|
|
32738
|
+
if (!href || href.startsWith("http") || href.startsWith("mailto:") || href.startsWith("#")) return;
|
|
32739
|
+
e.preventDefault();
|
|
32740
|
+
e.stopPropagation();
|
|
32741
|
+
e.stopImmediatePropagation();
|
|
32742
|
+
handleNavigate(href);
|
|
32743
|
+
};
|
|
32744
|
+
el.addEventListener("click", handler, true);
|
|
32745
|
+
return () => el.removeEventListener("click", handler, true);
|
|
32746
|
+
}, [pages, handleNavigate]);
|
|
32690
32747
|
return /* @__PURE__ */ jsx(
|
|
32691
32748
|
Box,
|
|
32692
32749
|
{
|
|
32750
|
+
ref: containerRef,
|
|
32693
32751
|
className: `overflow-auto border border-[var(--color-border)] rounded-[var(--radius-md)] ${className ?? ""}`,
|
|
32694
32752
|
style: { height },
|
|
32695
|
-
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData }) }) })
|
|
32753
|
+
children: /* @__PURE__ */ jsx(OrbitalProvider, { initialData: mockData, skipTheme: true, verification: true, children: /* @__PURE__ */ jsx(UISlotProvider, { children: /* @__PURE__ */ jsx(SchemaRunner, { schema: parsedSchema, serverUrl, mockData, pageName: currentPage, onNavigate: handleNavigate }) }) })
|
|
32696
32754
|
}
|
|
32697
32755
|
);
|
|
32698
32756
|
}
|