@almadar/ui 4.32.0 → 4.33.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 +1267 -1250
- package/dist/avl/index.js +187 -170
- package/dist/components/index.cjs +1072 -1055
- package/dist/components/index.js +173 -156
- package/dist/components/templates/DashboardLayout.d.ts +7 -0
- package/dist/context/CurrentPagePathContext.d.ts +9 -0
- package/dist/context/index.cjs +10 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +8 -1
- package/dist/providers/index.cjs +897 -880
- package/dist/providers/index.js +165 -148
- package/dist/runtime/index.cjs +933 -916
- package/dist/runtime/index.js +169 -152
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React106 from 'react';
|
|
2
|
+
import React106__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -729,7 +729,7 @@ var init_Box = __esm({
|
|
|
729
729
|
fixed: "fixed",
|
|
730
730
|
sticky: "sticky"
|
|
731
731
|
};
|
|
732
|
-
Box =
|
|
732
|
+
Box = React106__default.forwardRef(
|
|
733
733
|
({
|
|
734
734
|
padding,
|
|
735
735
|
paddingX,
|
|
@@ -1428,7 +1428,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1428
1428
|
const IconComp = value;
|
|
1429
1429
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1430
1430
|
}
|
|
1431
|
-
if (
|
|
1431
|
+
if (React106__default.isValidElement(value)) {
|
|
1432
1432
|
return value;
|
|
1433
1433
|
}
|
|
1434
1434
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1504,7 +1504,7 @@ var init_Button = __esm({
|
|
|
1504
1504
|
md: "h-4 w-4",
|
|
1505
1505
|
lg: "h-5 w-5"
|
|
1506
1506
|
};
|
|
1507
|
-
Button =
|
|
1507
|
+
Button = React106__default.forwardRef(
|
|
1508
1508
|
({
|
|
1509
1509
|
className,
|
|
1510
1510
|
variant = "primary",
|
|
@@ -1607,7 +1607,7 @@ var init_Badge = __esm({
|
|
|
1607
1607
|
md: "px-2.5 py-1 text-sm",
|
|
1608
1608
|
lg: "px-3 py-1.5 text-base"
|
|
1609
1609
|
};
|
|
1610
|
-
Badge =
|
|
1610
|
+
Badge = React106__default.forwardRef(
|
|
1611
1611
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1612
1612
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1613
1613
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1767,7 +1767,7 @@ var Input;
|
|
|
1767
1767
|
var init_Input = __esm({
|
|
1768
1768
|
"components/atoms/Input.tsx"() {
|
|
1769
1769
|
init_cn();
|
|
1770
|
-
Input =
|
|
1770
|
+
Input = React106__default.forwardRef(
|
|
1771
1771
|
({
|
|
1772
1772
|
className,
|
|
1773
1773
|
inputType,
|
|
@@ -1885,7 +1885,7 @@ var Label;
|
|
|
1885
1885
|
var init_Label = __esm({
|
|
1886
1886
|
"components/atoms/Label.tsx"() {
|
|
1887
1887
|
init_cn();
|
|
1888
|
-
Label =
|
|
1888
|
+
Label = React106__default.forwardRef(
|
|
1889
1889
|
({ className, required, children, ...props }, ref) => {
|
|
1890
1890
|
return /* @__PURE__ */ jsxs(
|
|
1891
1891
|
"label",
|
|
@@ -1911,7 +1911,7 @@ var Textarea;
|
|
|
1911
1911
|
var init_Textarea = __esm({
|
|
1912
1912
|
"components/atoms/Textarea.tsx"() {
|
|
1913
1913
|
init_cn();
|
|
1914
|
-
Textarea =
|
|
1914
|
+
Textarea = React106__default.forwardRef(
|
|
1915
1915
|
({ className, error, ...props }, ref) => {
|
|
1916
1916
|
return /* @__PURE__ */ jsx(
|
|
1917
1917
|
"textarea",
|
|
@@ -1940,7 +1940,7 @@ var Select;
|
|
|
1940
1940
|
var init_Select = __esm({
|
|
1941
1941
|
"components/atoms/Select.tsx"() {
|
|
1942
1942
|
init_cn();
|
|
1943
|
-
Select =
|
|
1943
|
+
Select = React106__default.forwardRef(
|
|
1944
1944
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1945
1945
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1946
1946
|
/* @__PURE__ */ jsxs(
|
|
@@ -1982,7 +1982,7 @@ var Checkbox;
|
|
|
1982
1982
|
var init_Checkbox = __esm({
|
|
1983
1983
|
"components/atoms/Checkbox.tsx"() {
|
|
1984
1984
|
init_cn();
|
|
1985
|
-
Checkbox =
|
|
1985
|
+
Checkbox = React106__default.forwardRef(
|
|
1986
1986
|
({ className, label, id, ...props }, ref) => {
|
|
1987
1987
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1988
1988
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -2064,7 +2064,7 @@ var init_Card = __esm({
|
|
|
2064
2064
|
md: "shadow",
|
|
2065
2065
|
lg: "shadow-lg"
|
|
2066
2066
|
};
|
|
2067
|
-
Card =
|
|
2067
|
+
Card = React106__default.forwardRef(
|
|
2068
2068
|
({
|
|
2069
2069
|
className,
|
|
2070
2070
|
variant = "bordered",
|
|
@@ -2100,9 +2100,9 @@ var init_Card = __esm({
|
|
|
2100
2100
|
}
|
|
2101
2101
|
);
|
|
2102
2102
|
Card.displayName = "Card";
|
|
2103
|
-
CardHeader =
|
|
2103
|
+
CardHeader = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2104
2104
|
CardHeader.displayName = "CardHeader";
|
|
2105
|
-
CardTitle =
|
|
2105
|
+
CardTitle = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2106
2106
|
"h3",
|
|
2107
2107
|
{
|
|
2108
2108
|
ref,
|
|
@@ -2115,11 +2115,11 @@ var init_Card = __esm({
|
|
|
2115
2115
|
}
|
|
2116
2116
|
));
|
|
2117
2117
|
CardTitle.displayName = "CardTitle";
|
|
2118
|
-
CardContent =
|
|
2118
|
+
CardContent = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2119
2119
|
CardContent.displayName = "CardContent";
|
|
2120
2120
|
CardBody = CardContent;
|
|
2121
2121
|
CardBody.displayName = "CardBody";
|
|
2122
|
-
CardFooter =
|
|
2122
|
+
CardFooter = React106__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2123
2123
|
"div",
|
|
2124
2124
|
{
|
|
2125
2125
|
ref,
|
|
@@ -2140,7 +2140,7 @@ var init_Spinner = __esm({
|
|
|
2140
2140
|
md: "h-6 w-6",
|
|
2141
2141
|
lg: "h-8 w-8"
|
|
2142
2142
|
};
|
|
2143
|
-
Spinner =
|
|
2143
|
+
Spinner = React106__default.forwardRef(
|
|
2144
2144
|
({ className, size = "md", ...props }, ref) => {
|
|
2145
2145
|
return /* @__PURE__ */ jsx(
|
|
2146
2146
|
"div",
|
|
@@ -2588,7 +2588,7 @@ var Radio;
|
|
|
2588
2588
|
var init_Radio = __esm({
|
|
2589
2589
|
"components/atoms/Radio.tsx"() {
|
|
2590
2590
|
init_cn();
|
|
2591
|
-
Radio =
|
|
2591
|
+
Radio = React106__default.forwardRef(
|
|
2592
2592
|
({
|
|
2593
2593
|
label,
|
|
2594
2594
|
helperText,
|
|
@@ -2699,7 +2699,7 @@ var init_Switch = __esm({
|
|
|
2699
2699
|
"components/atoms/Switch.tsx"() {
|
|
2700
2700
|
"use client";
|
|
2701
2701
|
init_cn();
|
|
2702
|
-
Switch =
|
|
2702
|
+
Switch = React106.forwardRef(
|
|
2703
2703
|
({
|
|
2704
2704
|
checked,
|
|
2705
2705
|
defaultChecked = false,
|
|
@@ -2710,10 +2710,10 @@ var init_Switch = __esm({
|
|
|
2710
2710
|
name,
|
|
2711
2711
|
className
|
|
2712
2712
|
}, ref) => {
|
|
2713
|
-
const [isChecked, setIsChecked] =
|
|
2713
|
+
const [isChecked, setIsChecked] = React106.useState(
|
|
2714
2714
|
checked !== void 0 ? checked : defaultChecked
|
|
2715
2715
|
);
|
|
2716
|
-
|
|
2716
|
+
React106.useEffect(() => {
|
|
2717
2717
|
if (checked !== void 0) {
|
|
2718
2718
|
setIsChecked(checked);
|
|
2719
2719
|
}
|
|
@@ -3133,8 +3133,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3133
3133
|
position = "top",
|
|
3134
3134
|
className
|
|
3135
3135
|
}) => {
|
|
3136
|
-
const [isVisible, setIsVisible] =
|
|
3137
|
-
const timeoutRef =
|
|
3136
|
+
const [isVisible, setIsVisible] = React106__default.useState(false);
|
|
3137
|
+
const timeoutRef = React106__default.useRef(null);
|
|
3138
3138
|
const handleMouseEnter = () => {
|
|
3139
3139
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3140
3140
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -3143,7 +3143,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3143
3143
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3144
3144
|
setIsVisible(false);
|
|
3145
3145
|
};
|
|
3146
|
-
|
|
3146
|
+
React106__default.useEffect(() => {
|
|
3147
3147
|
return () => {
|
|
3148
3148
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3149
3149
|
};
|
|
@@ -3353,7 +3353,7 @@ var init_StatusDot = __esm({
|
|
|
3353
3353
|
md: "w-2.5 h-2.5",
|
|
3354
3354
|
lg: "w-3 h-3"
|
|
3355
3355
|
};
|
|
3356
|
-
StatusDot =
|
|
3356
|
+
StatusDot = React106__default.forwardRef(
|
|
3357
3357
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
3358
3358
|
return /* @__PURE__ */ jsx(
|
|
3359
3359
|
"span",
|
|
@@ -3406,7 +3406,7 @@ var init_TrendIndicator = __esm({
|
|
|
3406
3406
|
down: TrendingDown,
|
|
3407
3407
|
flat: ArrowRight
|
|
3408
3408
|
};
|
|
3409
|
-
TrendIndicator =
|
|
3409
|
+
TrendIndicator = React106__default.forwardRef(
|
|
3410
3410
|
({
|
|
3411
3411
|
className,
|
|
3412
3412
|
value,
|
|
@@ -3473,7 +3473,7 @@ var init_RangeSlider = __esm({
|
|
|
3473
3473
|
md: "w-4 h-4",
|
|
3474
3474
|
lg: "w-5 h-5"
|
|
3475
3475
|
};
|
|
3476
|
-
RangeSlider =
|
|
3476
|
+
RangeSlider = React106__default.forwardRef(
|
|
3477
3477
|
({
|
|
3478
3478
|
className,
|
|
3479
3479
|
min = 0,
|
|
@@ -4118,9 +4118,9 @@ function ScoreDisplay({
|
|
|
4118
4118
|
...rest
|
|
4119
4119
|
}) {
|
|
4120
4120
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
4121
|
-
const [displayValue, setDisplayValue] =
|
|
4122
|
-
const [isAnimating, setIsAnimating] =
|
|
4123
|
-
|
|
4121
|
+
const [displayValue, setDisplayValue] = React106.useState(resolvedValue);
|
|
4122
|
+
const [isAnimating, setIsAnimating] = React106.useState(false);
|
|
4123
|
+
React106.useEffect(() => {
|
|
4124
4124
|
if (!animated || displayValue === resolvedValue) {
|
|
4125
4125
|
setDisplayValue(resolvedValue);
|
|
4126
4126
|
return;
|
|
@@ -4190,9 +4190,9 @@ function ControlButton({
|
|
|
4190
4190
|
className
|
|
4191
4191
|
}) {
|
|
4192
4192
|
const eventBus = useEventBus();
|
|
4193
|
-
const [isPressed, setIsPressed] =
|
|
4193
|
+
const [isPressed, setIsPressed] = React106.useState(false);
|
|
4194
4194
|
const actualPressed = pressed ?? isPressed;
|
|
4195
|
-
const handlePointerDown =
|
|
4195
|
+
const handlePointerDown = React106.useCallback(
|
|
4196
4196
|
(e) => {
|
|
4197
4197
|
e.preventDefault();
|
|
4198
4198
|
if (disabled) return;
|
|
@@ -4202,7 +4202,7 @@ function ControlButton({
|
|
|
4202
4202
|
},
|
|
4203
4203
|
[disabled, pressEvent, eventBus, onPress]
|
|
4204
4204
|
);
|
|
4205
|
-
const handlePointerUp =
|
|
4205
|
+
const handlePointerUp = React106.useCallback(
|
|
4206
4206
|
(e) => {
|
|
4207
4207
|
e.preventDefault();
|
|
4208
4208
|
if (disabled) return;
|
|
@@ -4212,7 +4212,7 @@ function ControlButton({
|
|
|
4212
4212
|
},
|
|
4213
4213
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
4214
4214
|
);
|
|
4215
|
-
const handlePointerLeave =
|
|
4215
|
+
const handlePointerLeave = React106.useCallback(
|
|
4216
4216
|
(e) => {
|
|
4217
4217
|
if (isPressed) {
|
|
4218
4218
|
setIsPressed(false);
|
|
@@ -5110,9 +5110,9 @@ function MiniMap({
|
|
|
5110
5110
|
viewportRect,
|
|
5111
5111
|
className
|
|
5112
5112
|
}) {
|
|
5113
|
-
const canvasRef =
|
|
5114
|
-
const frameRef =
|
|
5115
|
-
|
|
5113
|
+
const canvasRef = React106.useRef(null);
|
|
5114
|
+
const frameRef = React106.useRef(0);
|
|
5115
|
+
React106.useEffect(() => {
|
|
5116
5116
|
const canvas = canvasRef.current;
|
|
5117
5117
|
if (!canvas) return;
|
|
5118
5118
|
const ctx = canvas.getContext("2d");
|
|
@@ -5405,7 +5405,7 @@ var init_ErrorBoundary = __esm({
|
|
|
5405
5405
|
"use client";
|
|
5406
5406
|
init_cn();
|
|
5407
5407
|
init_ErrorState();
|
|
5408
|
-
ErrorBoundary = class extends
|
|
5408
|
+
ErrorBoundary = class extends React106__default.Component {
|
|
5409
5409
|
constructor(props) {
|
|
5410
5410
|
super(props);
|
|
5411
5411
|
__publicField(this, "reset", () => {
|
|
@@ -6209,8 +6209,8 @@ var init_Tooltip = __esm({
|
|
|
6209
6209
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
6210
6210
|
};
|
|
6211
6211
|
}, []);
|
|
6212
|
-
const triggerElement =
|
|
6213
|
-
const trigger =
|
|
6212
|
+
const triggerElement = React106__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6213
|
+
const trigger = React106__default.cloneElement(triggerElement, {
|
|
6214
6214
|
ref: triggerRef,
|
|
6215
6215
|
onMouseEnter: handleMouseEnter,
|
|
6216
6216
|
onMouseLeave: handleMouseLeave,
|
|
@@ -6331,8 +6331,8 @@ var init_Popover = __esm({
|
|
|
6331
6331
|
onMouseEnter: handleOpen,
|
|
6332
6332
|
onMouseLeave: handleClose
|
|
6333
6333
|
};
|
|
6334
|
-
const childElement =
|
|
6335
|
-
const triggerElement =
|
|
6334
|
+
const childElement = React106__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6335
|
+
const triggerElement = React106__default.cloneElement(
|
|
6336
6336
|
childElement,
|
|
6337
6337
|
{
|
|
6338
6338
|
ref: triggerRef,
|
|
@@ -6449,8 +6449,8 @@ var init_Menu = __esm({
|
|
|
6449
6449
|
"bottom-start": "top-full left-0 mt-2",
|
|
6450
6450
|
"bottom-end": "top-full right-0 mt-2"
|
|
6451
6451
|
};
|
|
6452
|
-
const triggerChild =
|
|
6453
|
-
const triggerElement =
|
|
6452
|
+
const triggerChild = React106__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6453
|
+
const triggerElement = React106__default.cloneElement(
|
|
6454
6454
|
triggerChild,
|
|
6455
6455
|
{
|
|
6456
6456
|
ref: triggerRef,
|
|
@@ -6969,7 +6969,7 @@ var init_MapView = __esm({
|
|
|
6969
6969
|
shadowSize: [41, 41]
|
|
6970
6970
|
});
|
|
6971
6971
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
6972
|
-
const { useEffect: useEffect60, useRef: useRef59, useCallback: useCallback88, useState: useState80 } =
|
|
6972
|
+
const { useEffect: useEffect60, useRef: useRef59, useCallback: useCallback88, useState: useState80 } = React106__default;
|
|
6973
6973
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
6974
6974
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
6975
6975
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -7200,7 +7200,7 @@ function InputPattern({
|
|
|
7200
7200
|
fieldName
|
|
7201
7201
|
}) {
|
|
7202
7202
|
const { emit } = useEventBus();
|
|
7203
|
-
const [localValue, setLocalValue] =
|
|
7203
|
+
const [localValue, setLocalValue] = React106__default.useState(value);
|
|
7204
7204
|
const handleChange = (e) => {
|
|
7205
7205
|
setLocalValue(e.target.value);
|
|
7206
7206
|
if (onChange) {
|
|
@@ -7238,7 +7238,7 @@ function TextareaPattern({
|
|
|
7238
7238
|
fieldName
|
|
7239
7239
|
}) {
|
|
7240
7240
|
const { emit } = useEventBus();
|
|
7241
|
-
const [localValue, setLocalValue] =
|
|
7241
|
+
const [localValue, setLocalValue] = React106__default.useState(value);
|
|
7242
7242
|
const handleChange = (e) => {
|
|
7243
7243
|
setLocalValue(e.target.value);
|
|
7244
7244
|
if (onChange) {
|
|
@@ -7270,7 +7270,7 @@ function SelectPattern({
|
|
|
7270
7270
|
fieldName
|
|
7271
7271
|
}) {
|
|
7272
7272
|
const { emit } = useEventBus();
|
|
7273
|
-
const [localValue, setLocalValue] =
|
|
7273
|
+
const [localValue, setLocalValue] = React106__default.useState(value);
|
|
7274
7274
|
const handleChange = (e) => {
|
|
7275
7275
|
setLocalValue(e.target.value);
|
|
7276
7276
|
if (onChange) {
|
|
@@ -7299,7 +7299,7 @@ function CheckboxPattern({
|
|
|
7299
7299
|
className
|
|
7300
7300
|
}) {
|
|
7301
7301
|
const { emit } = useEventBus();
|
|
7302
|
-
const [localChecked, setLocalChecked] =
|
|
7302
|
+
const [localChecked, setLocalChecked] = React106__default.useState(checked);
|
|
7303
7303
|
const handleChange = (e) => {
|
|
7304
7304
|
setLocalChecked(e.target.checked);
|
|
7305
7305
|
if (onChange) {
|
|
@@ -7530,8 +7530,8 @@ function ActionButtons({
|
|
|
7530
7530
|
disabled
|
|
7531
7531
|
}) {
|
|
7532
7532
|
const eventBus = useEventBus();
|
|
7533
|
-
const [activeButtons, setActiveButtons] =
|
|
7534
|
-
const handlePress =
|
|
7533
|
+
const [activeButtons, setActiveButtons] = React106.useState(/* @__PURE__ */ new Set());
|
|
7534
|
+
const handlePress = React106.useCallback(
|
|
7535
7535
|
(id) => {
|
|
7536
7536
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7537
7537
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7539,7 +7539,7 @@ function ActionButtons({
|
|
|
7539
7539
|
},
|
|
7540
7540
|
[actionEvent, eventBus, onAction]
|
|
7541
7541
|
);
|
|
7542
|
-
const handleRelease =
|
|
7542
|
+
const handleRelease = React106.useCallback(
|
|
7543
7543
|
(id) => {
|
|
7544
7544
|
setActiveButtons((prev) => {
|
|
7545
7545
|
const next = new Set(prev);
|
|
@@ -9562,7 +9562,7 @@ var init_MarkdownContent = __esm({
|
|
|
9562
9562
|
init_Box();
|
|
9563
9563
|
init_useTranslate();
|
|
9564
9564
|
init_cn();
|
|
9565
|
-
MarkdownContent =
|
|
9565
|
+
MarkdownContent = React106__default.memo(
|
|
9566
9566
|
({ content, direction, className }) => {
|
|
9567
9567
|
const { t: _t } = useTranslate();
|
|
9568
9568
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -9779,7 +9779,7 @@ var init_CodeBlock = __esm({
|
|
|
9779
9779
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
9780
9780
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
9781
9781
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
9782
|
-
CodeBlock =
|
|
9782
|
+
CodeBlock = React106__default.memo(
|
|
9783
9783
|
({
|
|
9784
9784
|
code: rawCode,
|
|
9785
9785
|
language = "text",
|
|
@@ -11088,7 +11088,7 @@ var init_StateMachineView = __esm({
|
|
|
11088
11088
|
style: { top: title ? 30 : 0 },
|
|
11089
11089
|
children: [
|
|
11090
11090
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
11091
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
11091
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React106__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
11092
11092
|
StateNode,
|
|
11093
11093
|
{
|
|
11094
11094
|
state,
|
|
@@ -16875,7 +16875,7 @@ function CraftingRecipe({
|
|
|
16875
16875
|
className
|
|
16876
16876
|
}) {
|
|
16877
16877
|
const eventBus = useEventBus();
|
|
16878
|
-
const handleCraft =
|
|
16878
|
+
const handleCraft = React106.useCallback(() => {
|
|
16879
16879
|
onCraft?.();
|
|
16880
16880
|
if (craftEvent) {
|
|
16881
16881
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -16892,7 +16892,7 @@ function CraftingRecipe({
|
|
|
16892
16892
|
children: [
|
|
16893
16893
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
16894
16894
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
16895
|
-
return /* @__PURE__ */ jsxs(
|
|
16895
|
+
return /* @__PURE__ */ jsxs(React106.Fragment, { children: [
|
|
16896
16896
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
16897
16897
|
ItemSlot,
|
|
16898
16898
|
{
|
|
@@ -17186,8 +17186,8 @@ function DPad({
|
|
|
17186
17186
|
}) {
|
|
17187
17187
|
const eventBus = useEventBus();
|
|
17188
17188
|
const sizes = sizeMap15[size];
|
|
17189
|
-
const [activeDirections, setActiveDirections] =
|
|
17190
|
-
const handlePress =
|
|
17189
|
+
const [activeDirections, setActiveDirections] = React106.useState(/* @__PURE__ */ new Set());
|
|
17190
|
+
const handlePress = React106.useCallback(
|
|
17191
17191
|
(direction) => {
|
|
17192
17192
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
17193
17193
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -17195,7 +17195,7 @@ function DPad({
|
|
|
17195
17195
|
},
|
|
17196
17196
|
[directionEvent, eventBus, onDirection]
|
|
17197
17197
|
);
|
|
17198
|
-
const handleRelease =
|
|
17198
|
+
const handleRelease = React106.useCallback(
|
|
17199
17199
|
(direction) => {
|
|
17200
17200
|
setActiveDirections((prev) => {
|
|
17201
17201
|
const next = new Set(prev);
|
|
@@ -17327,6 +17327,19 @@ var init_useAuthContext = __esm({
|
|
|
17327
17327
|
"hooks/useAuthContext.ts"() {
|
|
17328
17328
|
}
|
|
17329
17329
|
});
|
|
17330
|
+
var CurrentPagePathContext, CurrentPagePathProvider, useCurrentPagePath;
|
|
17331
|
+
var init_CurrentPagePathContext = __esm({
|
|
17332
|
+
"context/CurrentPagePathContext.tsx"() {
|
|
17333
|
+
"use client";
|
|
17334
|
+
CurrentPagePathContext = createContext(void 0);
|
|
17335
|
+
CurrentPagePathProvider = ({
|
|
17336
|
+
value,
|
|
17337
|
+
children
|
|
17338
|
+
}) => /* @__PURE__ */ jsx(CurrentPagePathContext.Provider, { value, children });
|
|
17339
|
+
CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
|
|
17340
|
+
useCurrentPagePath = () => useContext(CurrentPagePathContext);
|
|
17341
|
+
}
|
|
17342
|
+
});
|
|
17330
17343
|
var DashboardLayout, NavLink;
|
|
17331
17344
|
var init_DashboardLayout = __esm({
|
|
17332
17345
|
"components/templates/DashboardLayout.tsx"() {
|
|
@@ -17340,6 +17353,7 @@ var init_DashboardLayout = __esm({
|
|
|
17340
17353
|
init_useAuthContext();
|
|
17341
17354
|
init_useEventBus();
|
|
17342
17355
|
init_useTranslate();
|
|
17356
|
+
init_CurrentPagePathContext();
|
|
17343
17357
|
DashboardLayout = ({
|
|
17344
17358
|
appName = "{{APP_TITLE}}",
|
|
17345
17359
|
logo,
|
|
@@ -17356,6 +17370,7 @@ var init_DashboardLayout = __esm({
|
|
|
17356
17370
|
showThemeToggle = true,
|
|
17357
17371
|
sidebarFooter,
|
|
17358
17372
|
onSignOut: onSignOutProp,
|
|
17373
|
+
currentPath,
|
|
17359
17374
|
children
|
|
17360
17375
|
}) => {
|
|
17361
17376
|
const eventBus = useEventBus();
|
|
@@ -17376,6 +17391,8 @@ var init_DashboardLayout = __esm({
|
|
|
17376
17391
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
17377
17392
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
17378
17393
|
const location = useLocation();
|
|
17394
|
+
const ctxPagePath = useCurrentPagePath();
|
|
17395
|
+
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
17379
17396
|
const { signOut: authSignOut } = useAuthContext();
|
|
17380
17397
|
const user = userProp || (null);
|
|
17381
17398
|
const { t } = useTranslate();
|
|
@@ -17454,7 +17471,7 @@ var init_DashboardLayout = __esm({
|
|
|
17454
17471
|
NavLink,
|
|
17455
17472
|
{
|
|
17456
17473
|
item,
|
|
17457
|
-
currentPath:
|
|
17474
|
+
currentPath: activePath
|
|
17458
17475
|
},
|
|
17459
17476
|
item.href
|
|
17460
17477
|
))
|
|
@@ -18132,13 +18149,13 @@ function DataList({
|
|
|
18132
18149
|
}) {
|
|
18133
18150
|
const eventBus = useEventBus();
|
|
18134
18151
|
const { t } = useTranslate();
|
|
18135
|
-
const [visibleCount, setVisibleCount] =
|
|
18152
|
+
const [visibleCount, setVisibleCount] = React106__default.useState(pageSize || Infinity);
|
|
18136
18153
|
const fieldDefs = fields ?? columns ?? [];
|
|
18137
18154
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
18138
18155
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
18139
18156
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
18140
18157
|
const hasRenderProp = typeof children === "function";
|
|
18141
|
-
|
|
18158
|
+
React106__default.useEffect(() => {
|
|
18142
18159
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
18143
18160
|
const childrenTypeOf = typeof children;
|
|
18144
18161
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -18194,7 +18211,7 @@ function DataList({
|
|
|
18194
18211
|
const items2 = data.map((item) => item);
|
|
18195
18212
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
18196
18213
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
18197
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
18214
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
18198
18215
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
18199
18216
|
group.items.map((itemData, index) => {
|
|
18200
18217
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -18385,7 +18402,7 @@ function DataList({
|
|
|
18385
18402
|
className
|
|
18386
18403
|
),
|
|
18387
18404
|
children: [
|
|
18388
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
18405
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
18389
18406
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
18390
18407
|
group.items.map(
|
|
18391
18408
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -19532,7 +19549,7 @@ var init_WizardProgress = __esm({
|
|
|
19532
19549
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
19533
19550
|
const isActive = index === currentStep;
|
|
19534
19551
|
const isCompleted = index < currentStep;
|
|
19535
|
-
return /* @__PURE__ */ jsxs(
|
|
19552
|
+
return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
19536
19553
|
/* @__PURE__ */ jsx(
|
|
19537
19554
|
"button",
|
|
19538
19555
|
{
|
|
@@ -20443,7 +20460,7 @@ function InventoryGrid({
|
|
|
20443
20460
|
const eventBus = useEventBus();
|
|
20444
20461
|
const slotCount = totalSlots ?? items.length;
|
|
20445
20462
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
20446
|
-
const handleSelect =
|
|
20463
|
+
const handleSelect = React106.useCallback(
|
|
20447
20464
|
(id) => {
|
|
20448
20465
|
onSelect?.(id);
|
|
20449
20466
|
if (selectEvent) {
|
|
@@ -20656,15 +20673,15 @@ function GameCanvas2D({
|
|
|
20656
20673
|
fps = 60,
|
|
20657
20674
|
className
|
|
20658
20675
|
}) {
|
|
20659
|
-
const canvasRef =
|
|
20660
|
-
const rafRef =
|
|
20661
|
-
const frameRef =
|
|
20662
|
-
const lastTimeRef =
|
|
20663
|
-
const onDrawRef =
|
|
20676
|
+
const canvasRef = React106.useRef(null);
|
|
20677
|
+
const rafRef = React106.useRef(0);
|
|
20678
|
+
const frameRef = React106.useRef(0);
|
|
20679
|
+
const lastTimeRef = React106.useRef(0);
|
|
20680
|
+
const onDrawRef = React106.useRef(onDraw);
|
|
20664
20681
|
onDrawRef.current = onDraw;
|
|
20665
|
-
const onTickRef =
|
|
20682
|
+
const onTickRef = React106.useRef(onTick);
|
|
20666
20683
|
onTickRef.current = onTick;
|
|
20667
|
-
|
|
20684
|
+
React106.useEffect(() => {
|
|
20668
20685
|
const canvas = canvasRef.current;
|
|
20669
20686
|
if (!canvas) return;
|
|
20670
20687
|
const ctx = canvas.getContext("2d");
|
|
@@ -20953,7 +20970,7 @@ function TurnPanel({
|
|
|
20953
20970
|
className
|
|
20954
20971
|
}) {
|
|
20955
20972
|
const eventBus = useEventBus();
|
|
20956
|
-
const handleAction =
|
|
20973
|
+
const handleAction = React106.useCallback(
|
|
20957
20974
|
(event) => {
|
|
20958
20975
|
if (event) {
|
|
20959
20976
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -21099,7 +21116,7 @@ function UnitCommandBar({
|
|
|
21099
21116
|
className
|
|
21100
21117
|
}) {
|
|
21101
21118
|
const eventBus = useEventBus();
|
|
21102
|
-
const handleCommand =
|
|
21119
|
+
const handleCommand = React106.useCallback(
|
|
21103
21120
|
(event) => {
|
|
21104
21121
|
if (event) {
|
|
21105
21122
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -21584,7 +21601,7 @@ function GameMenu({
|
|
|
21584
21601
|
} catch {
|
|
21585
21602
|
}
|
|
21586
21603
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21587
|
-
const handleOptionClick =
|
|
21604
|
+
const handleOptionClick = React106.useCallback(
|
|
21588
21605
|
(option) => {
|
|
21589
21606
|
if (option.event && eventBus) {
|
|
21590
21607
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -21698,7 +21715,7 @@ function GameOverScreen({
|
|
|
21698
21715
|
} catch {
|
|
21699
21716
|
}
|
|
21700
21717
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21701
|
-
const handleActionClick =
|
|
21718
|
+
const handleActionClick = React106.useCallback(
|
|
21702
21719
|
(action) => {
|
|
21703
21720
|
if (action.event && eventBus) {
|
|
21704
21721
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -25187,7 +25204,7 @@ var init_DocumentViewer = __esm({
|
|
|
25187
25204
|
}
|
|
25188
25205
|
});
|
|
25189
25206
|
function extractTitle(children) {
|
|
25190
|
-
if (!
|
|
25207
|
+
if (!React106__default.isValidElement(children)) return void 0;
|
|
25191
25208
|
const props = children.props;
|
|
25192
25209
|
if (typeof props.title === "string") {
|
|
25193
25210
|
return props.title;
|
|
@@ -25242,7 +25259,7 @@ function LinearView({
|
|
|
25242
25259
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
25243
25260
|
const isDone = i < currentIdx;
|
|
25244
25261
|
const isCurrent = i === currentIdx;
|
|
25245
|
-
return /* @__PURE__ */ jsxs(
|
|
25262
|
+
return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
25246
25263
|
i > 0 && /* @__PURE__ */ jsx(
|
|
25247
25264
|
Typography,
|
|
25248
25265
|
{
|
|
@@ -26026,12 +26043,12 @@ var init_Form = __esm({
|
|
|
26026
26043
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
26027
26044
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
26028
26045
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
26029
|
-
const normalizedInitialData =
|
|
26046
|
+
const normalizedInitialData = React106__default.useMemo(() => {
|
|
26030
26047
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
26031
26048
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
26032
26049
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
26033
26050
|
}, [entity, initialData]);
|
|
26034
|
-
const entityDerivedFields =
|
|
26051
|
+
const entityDerivedFields = React106__default.useMemo(() => {
|
|
26035
26052
|
if (fields && fields.length > 0) return void 0;
|
|
26036
26053
|
if (!resolvedEntity) return void 0;
|
|
26037
26054
|
return resolvedEntity.fields.map(
|
|
@@ -26050,16 +26067,16 @@ var init_Form = __esm({
|
|
|
26050
26067
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
26051
26068
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
26052
26069
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
26053
|
-
const [formData, setFormData] =
|
|
26070
|
+
const [formData, setFormData] = React106__default.useState(
|
|
26054
26071
|
normalizedInitialData
|
|
26055
26072
|
);
|
|
26056
|
-
const [collapsedSections, setCollapsedSections] =
|
|
26073
|
+
const [collapsedSections, setCollapsedSections] = React106__default.useState(
|
|
26057
26074
|
/* @__PURE__ */ new Set()
|
|
26058
26075
|
);
|
|
26059
|
-
const [submitError, setSubmitError] =
|
|
26060
|
-
const formRef =
|
|
26076
|
+
const [submitError, setSubmitError] = React106__default.useState(null);
|
|
26077
|
+
const formRef = React106__default.useRef(null);
|
|
26061
26078
|
const formMode = props.mode;
|
|
26062
|
-
const mountedRef =
|
|
26079
|
+
const mountedRef = React106__default.useRef(false);
|
|
26063
26080
|
if (!mountedRef.current) {
|
|
26064
26081
|
mountedRef.current = true;
|
|
26065
26082
|
debug("forms", "mount", {
|
|
@@ -26072,7 +26089,7 @@ var init_Form = __esm({
|
|
|
26072
26089
|
});
|
|
26073
26090
|
}
|
|
26074
26091
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
26075
|
-
const evalContext =
|
|
26092
|
+
const evalContext = React106__default.useMemo(
|
|
26076
26093
|
() => ({
|
|
26077
26094
|
formValues: formData,
|
|
26078
26095
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -26081,7 +26098,7 @@ var init_Form = __esm({
|
|
|
26081
26098
|
}),
|
|
26082
26099
|
[formData, externalContext]
|
|
26083
26100
|
);
|
|
26084
|
-
|
|
26101
|
+
React106__default.useEffect(() => {
|
|
26085
26102
|
debug("forms", "initialData-sync", {
|
|
26086
26103
|
mode: formMode,
|
|
26087
26104
|
normalizedInitialData,
|
|
@@ -26092,7 +26109,7 @@ var init_Form = __esm({
|
|
|
26092
26109
|
setFormData(normalizedInitialData);
|
|
26093
26110
|
}
|
|
26094
26111
|
}, [normalizedInitialData]);
|
|
26095
|
-
const processCalculations =
|
|
26112
|
+
const processCalculations = React106__default.useCallback(
|
|
26096
26113
|
(changedFieldId, newFormData) => {
|
|
26097
26114
|
if (!hiddenCalculations.length) return;
|
|
26098
26115
|
const context = {
|
|
@@ -26117,7 +26134,7 @@ var init_Form = __esm({
|
|
|
26117
26134
|
},
|
|
26118
26135
|
[hiddenCalculations, externalContext, eventBus]
|
|
26119
26136
|
);
|
|
26120
|
-
const checkViolations =
|
|
26137
|
+
const checkViolations = React106__default.useCallback(
|
|
26121
26138
|
(changedFieldId, newFormData) => {
|
|
26122
26139
|
if (!violationTriggers.length) return;
|
|
26123
26140
|
const context = {
|
|
@@ -26155,7 +26172,7 @@ var init_Form = __esm({
|
|
|
26155
26172
|
processCalculations(name, newFormData);
|
|
26156
26173
|
checkViolations(name, newFormData);
|
|
26157
26174
|
};
|
|
26158
|
-
const isFieldVisible =
|
|
26175
|
+
const isFieldVisible = React106__default.useCallback(
|
|
26159
26176
|
(fieldName) => {
|
|
26160
26177
|
const condition = conditionalFields[fieldName];
|
|
26161
26178
|
if (!condition) return true;
|
|
@@ -26163,7 +26180,7 @@ var init_Form = __esm({
|
|
|
26163
26180
|
},
|
|
26164
26181
|
[conditionalFields, evalContext]
|
|
26165
26182
|
);
|
|
26166
|
-
const isSectionVisible =
|
|
26183
|
+
const isSectionVisible = React106__default.useCallback(
|
|
26167
26184
|
(section) => {
|
|
26168
26185
|
if (!section.condition) return true;
|
|
26169
26186
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -26239,7 +26256,7 @@ var init_Form = __esm({
|
|
|
26239
26256
|
eventBus.emit(`UI:${onCancel}`);
|
|
26240
26257
|
}
|
|
26241
26258
|
};
|
|
26242
|
-
const renderField =
|
|
26259
|
+
const renderField = React106__default.useCallback(
|
|
26243
26260
|
(field) => {
|
|
26244
26261
|
const fieldName = field.name || field.field;
|
|
26245
26262
|
if (!fieldName) return null;
|
|
@@ -26260,7 +26277,7 @@ var init_Form = __esm({
|
|
|
26260
26277
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
26261
26278
|
);
|
|
26262
26279
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
26263
|
-
const normalizedFields =
|
|
26280
|
+
const normalizedFields = React106__default.useMemo(() => {
|
|
26264
26281
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
26265
26282
|
return effectiveFields.map((field) => {
|
|
26266
26283
|
if (typeof field === "string") {
|
|
@@ -26282,7 +26299,7 @@ var init_Form = __esm({
|
|
|
26282
26299
|
return field;
|
|
26283
26300
|
});
|
|
26284
26301
|
}, [effectiveFields, resolvedEntity]);
|
|
26285
|
-
const schemaFields =
|
|
26302
|
+
const schemaFields = React106__default.useMemo(() => {
|
|
26286
26303
|
if (normalizedFields.length === 0) return null;
|
|
26287
26304
|
if (isDebugEnabled()) {
|
|
26288
26305
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -26292,7 +26309,7 @@ var init_Form = __esm({
|
|
|
26292
26309
|
}
|
|
26293
26310
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
26294
26311
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
26295
|
-
const sectionElements =
|
|
26312
|
+
const sectionElements = React106__default.useMemo(() => {
|
|
26296
26313
|
if (!sections || sections.length === 0) return null;
|
|
26297
26314
|
return sections.map((section) => {
|
|
26298
26315
|
if (!isSectionVisible(section)) {
|
|
@@ -27824,7 +27841,7 @@ var init_List = __esm({
|
|
|
27824
27841
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
27825
27842
|
return [];
|
|
27826
27843
|
}, [entity]);
|
|
27827
|
-
const getItemActions =
|
|
27844
|
+
const getItemActions = React106__default.useCallback(
|
|
27828
27845
|
(item) => {
|
|
27829
27846
|
if (!itemActions) return [];
|
|
27830
27847
|
if (typeof itemActions === "function") {
|
|
@@ -28261,7 +28278,7 @@ var init_MediaGallery = __esm({
|
|
|
28261
28278
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
28262
28279
|
);
|
|
28263
28280
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
28264
|
-
const items =
|
|
28281
|
+
const items = React106__default.useMemo(() => {
|
|
28265
28282
|
if (propItems) return propItems;
|
|
28266
28283
|
if (entityData.length === 0) return [];
|
|
28267
28284
|
return entityData.map((record, idx) => ({
|
|
@@ -28425,7 +28442,7 @@ var init_MediaGallery = __esm({
|
|
|
28425
28442
|
}
|
|
28426
28443
|
});
|
|
28427
28444
|
function extractTitle2(children) {
|
|
28428
|
-
if (!
|
|
28445
|
+
if (!React106__default.isValidElement(children)) return void 0;
|
|
28429
28446
|
const props = children.props;
|
|
28430
28447
|
if (typeof props.title === "string") {
|
|
28431
28448
|
return props.title;
|
|
@@ -29138,7 +29155,7 @@ var init_PageHeader = __esm({
|
|
|
29138
29155
|
info: "bg-info/10 text-info"
|
|
29139
29156
|
};
|
|
29140
29157
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
29141
|
-
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(
|
|
29158
|
+
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(React106__default.Fragment, { children: [
|
|
29142
29159
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
29143
29160
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
29144
29161
|
"a",
|
|
@@ -29312,7 +29329,7 @@ var init_debugRegistry = __esm({
|
|
|
29312
29329
|
}
|
|
29313
29330
|
});
|
|
29314
29331
|
function useDebugData() {
|
|
29315
|
-
const [data, setData] =
|
|
29332
|
+
const [data, setData] = React106.useState(() => ({
|
|
29316
29333
|
traits: [],
|
|
29317
29334
|
ticks: [],
|
|
29318
29335
|
guards: [],
|
|
@@ -29326,7 +29343,7 @@ function useDebugData() {
|
|
|
29326
29343
|
},
|
|
29327
29344
|
lastUpdate: Date.now()
|
|
29328
29345
|
}));
|
|
29329
|
-
|
|
29346
|
+
React106.useEffect(() => {
|
|
29330
29347
|
const updateData = () => {
|
|
29331
29348
|
setData({
|
|
29332
29349
|
traits: getAllTraits(),
|
|
@@ -29435,12 +29452,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
29435
29452
|
return positions;
|
|
29436
29453
|
}
|
|
29437
29454
|
function WalkMinimap() {
|
|
29438
|
-
const [walkStep, setWalkStep] =
|
|
29439
|
-
const [traits2, setTraits] =
|
|
29440
|
-
const [coveredEdges, setCoveredEdges] =
|
|
29441
|
-
const [completedTraits, setCompletedTraits] =
|
|
29442
|
-
const prevTraitRef =
|
|
29443
|
-
|
|
29455
|
+
const [walkStep, setWalkStep] = React106.useState(null);
|
|
29456
|
+
const [traits2, setTraits] = React106.useState([]);
|
|
29457
|
+
const [coveredEdges, setCoveredEdges] = React106.useState([]);
|
|
29458
|
+
const [completedTraits, setCompletedTraits] = React106.useState(/* @__PURE__ */ new Set());
|
|
29459
|
+
const prevTraitRef = React106.useRef(null);
|
|
29460
|
+
React106.useEffect(() => {
|
|
29444
29461
|
const interval = setInterval(() => {
|
|
29445
29462
|
const w = window;
|
|
29446
29463
|
const step = w.__orbitalWalkStep;
|
|
@@ -29887,15 +29904,15 @@ var init_EntitiesTab = __esm({
|
|
|
29887
29904
|
}
|
|
29888
29905
|
});
|
|
29889
29906
|
function EventFlowTab({ events: events2 }) {
|
|
29890
|
-
const [filter, setFilter] =
|
|
29891
|
-
const containerRef =
|
|
29892
|
-
const [autoScroll, setAutoScroll] =
|
|
29893
|
-
|
|
29907
|
+
const [filter, setFilter] = React106.useState("all");
|
|
29908
|
+
const containerRef = React106.useRef(null);
|
|
29909
|
+
const [autoScroll, setAutoScroll] = React106.useState(true);
|
|
29910
|
+
React106.useEffect(() => {
|
|
29894
29911
|
if (autoScroll && containerRef.current) {
|
|
29895
29912
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
29896
29913
|
}
|
|
29897
29914
|
}, [events2.length, autoScroll]);
|
|
29898
|
-
const filteredEvents =
|
|
29915
|
+
const filteredEvents = React106.useMemo(() => {
|
|
29899
29916
|
if (filter === "all") return events2;
|
|
29900
29917
|
return events2.filter((e) => e.type === filter);
|
|
29901
29918
|
}, [events2, filter]);
|
|
@@ -30014,7 +30031,7 @@ var init_EventFlowTab = __esm({
|
|
|
30014
30031
|
}
|
|
30015
30032
|
});
|
|
30016
30033
|
function GuardsPanel({ guards }) {
|
|
30017
|
-
const [filter, setFilter] =
|
|
30034
|
+
const [filter, setFilter] = React106.useState("all");
|
|
30018
30035
|
if (guards.length === 0) {
|
|
30019
30036
|
return /* @__PURE__ */ jsx(
|
|
30020
30037
|
EmptyState,
|
|
@@ -30027,7 +30044,7 @@ function GuardsPanel({ guards }) {
|
|
|
30027
30044
|
}
|
|
30028
30045
|
const passedCount = guards.filter((g) => g.result).length;
|
|
30029
30046
|
const failedCount = guards.length - passedCount;
|
|
30030
|
-
const filteredGuards =
|
|
30047
|
+
const filteredGuards = React106.useMemo(() => {
|
|
30031
30048
|
if (filter === "all") return guards;
|
|
30032
30049
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
30033
30050
|
return guards.filter((g) => !g.result);
|
|
@@ -30188,10 +30205,10 @@ function EffectBadge({ effect }) {
|
|
|
30188
30205
|
] });
|
|
30189
30206
|
}
|
|
30190
30207
|
function TransitionTimeline({ transitions }) {
|
|
30191
|
-
const containerRef =
|
|
30192
|
-
const [autoScroll, setAutoScroll] =
|
|
30193
|
-
const [expandedId, setExpandedId] =
|
|
30194
|
-
|
|
30208
|
+
const containerRef = React106.useRef(null);
|
|
30209
|
+
const [autoScroll, setAutoScroll] = React106.useState(true);
|
|
30210
|
+
const [expandedId, setExpandedId] = React106.useState(null);
|
|
30211
|
+
React106.useEffect(() => {
|
|
30195
30212
|
if (autoScroll && containerRef.current) {
|
|
30196
30213
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
30197
30214
|
}
|
|
@@ -30477,9 +30494,9 @@ function getAllEvents(traits2) {
|
|
|
30477
30494
|
}
|
|
30478
30495
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
30479
30496
|
const eventBus = useEventBus();
|
|
30480
|
-
const [log4, setLog] =
|
|
30481
|
-
const prevStatesRef =
|
|
30482
|
-
|
|
30497
|
+
const [log4, setLog] = React106.useState([]);
|
|
30498
|
+
const prevStatesRef = React106.useRef(/* @__PURE__ */ new Map());
|
|
30499
|
+
React106.useEffect(() => {
|
|
30483
30500
|
for (const trait of traits2) {
|
|
30484
30501
|
const prev = prevStatesRef.current.get(trait.id);
|
|
30485
30502
|
if (prev && prev !== trait.currentState) {
|
|
@@ -30649,10 +30666,10 @@ function VerifyModePanel({
|
|
|
30649
30666
|
serverCount,
|
|
30650
30667
|
localCount
|
|
30651
30668
|
}) {
|
|
30652
|
-
const [expanded, setExpanded] =
|
|
30653
|
-
const scrollRef =
|
|
30654
|
-
const prevCountRef =
|
|
30655
|
-
|
|
30669
|
+
const [expanded, setExpanded] = React106.useState(true);
|
|
30670
|
+
const scrollRef = React106.useRef(null);
|
|
30671
|
+
const prevCountRef = React106.useRef(0);
|
|
30672
|
+
React106.useEffect(() => {
|
|
30656
30673
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
30657
30674
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
30658
30675
|
}
|
|
@@ -30718,10 +30735,10 @@ function RuntimeDebugger({
|
|
|
30718
30735
|
defaultTab,
|
|
30719
30736
|
schema
|
|
30720
30737
|
}) {
|
|
30721
|
-
const [isCollapsed, setIsCollapsed] =
|
|
30722
|
-
const [isVisible, setIsVisible] =
|
|
30738
|
+
const [isCollapsed, setIsCollapsed] = React106.useState(mode === "verify" ? true : defaultCollapsed);
|
|
30739
|
+
const [isVisible, setIsVisible] = React106.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
30723
30740
|
const debugData = useDebugData();
|
|
30724
|
-
|
|
30741
|
+
React106.useEffect(() => {
|
|
30725
30742
|
if (mode === "inline") return;
|
|
30726
30743
|
return onDebugToggle((enabled) => {
|
|
30727
30744
|
setIsVisible(enabled);
|
|
@@ -30730,7 +30747,7 @@ function RuntimeDebugger({
|
|
|
30730
30747
|
}
|
|
30731
30748
|
});
|
|
30732
30749
|
}, [mode]);
|
|
30733
|
-
|
|
30750
|
+
React106.useEffect(() => {
|
|
30734
30751
|
if (mode === "inline") return;
|
|
30735
30752
|
const handleKeyDown = (e) => {
|
|
30736
30753
|
if (e.key === "`" && isVisible) {
|
|
@@ -31279,7 +31296,7 @@ function SequenceBar({
|
|
|
31279
31296
|
onSlotRemove(index);
|
|
31280
31297
|
}, [onSlotRemove, playing]);
|
|
31281
31298
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
31282
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
31299
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
31283
31300
|
i > 0 && /* @__PURE__ */ jsx(
|
|
31284
31301
|
Typography,
|
|
31285
31302
|
{
|
|
@@ -32624,7 +32641,7 @@ var init_StatCard = __esm({
|
|
|
32624
32641
|
const labelToUse = propLabel ?? propTitle;
|
|
32625
32642
|
const eventBus = useEventBus();
|
|
32626
32643
|
const { t } = useTranslate();
|
|
32627
|
-
const handleActionClick =
|
|
32644
|
+
const handleActionClick = React106__default.useCallback(() => {
|
|
32628
32645
|
if (action?.event) {
|
|
32629
32646
|
eventBus.emit(`UI:${action.event}`, {});
|
|
32630
32647
|
}
|
|
@@ -32635,7 +32652,7 @@ var init_StatCard = __esm({
|
|
|
32635
32652
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32636
32653
|
const isLoading = externalLoading ?? false;
|
|
32637
32654
|
const error = externalError;
|
|
32638
|
-
const computeMetricValue =
|
|
32655
|
+
const computeMetricValue = React106__default.useCallback(
|
|
32639
32656
|
(metric, items) => {
|
|
32640
32657
|
if (metric.value !== void 0) {
|
|
32641
32658
|
return metric.value;
|
|
@@ -32674,7 +32691,7 @@ var init_StatCard = __esm({
|
|
|
32674
32691
|
},
|
|
32675
32692
|
[]
|
|
32676
32693
|
);
|
|
32677
|
-
const schemaStats =
|
|
32694
|
+
const schemaStats = React106__default.useMemo(() => {
|
|
32678
32695
|
if (!metrics || metrics.length === 0) return null;
|
|
32679
32696
|
return metrics.map((metric) => ({
|
|
32680
32697
|
label: metric.label,
|
|
@@ -32682,7 +32699,7 @@ var init_StatCard = __esm({
|
|
|
32682
32699
|
format: metric.format
|
|
32683
32700
|
}));
|
|
32684
32701
|
}, [metrics, data, computeMetricValue]);
|
|
32685
|
-
const calculatedTrend =
|
|
32702
|
+
const calculatedTrend = React106__default.useMemo(() => {
|
|
32686
32703
|
if (manualTrend !== void 0) return manualTrend;
|
|
32687
32704
|
if (previousValue === void 0 || currentValue === void 0)
|
|
32688
32705
|
return void 0;
|
|
@@ -33666,7 +33683,7 @@ var init_Timeline = __esm({
|
|
|
33666
33683
|
}) => {
|
|
33667
33684
|
const { t } = useTranslate();
|
|
33668
33685
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
33669
|
-
const items =
|
|
33686
|
+
const items = React106__default.useMemo(() => {
|
|
33670
33687
|
if (propItems) return propItems;
|
|
33671
33688
|
if (entityData.length === 0) return [];
|
|
33672
33689
|
return entityData.map((record, idx) => {
|
|
@@ -33773,7 +33790,7 @@ var init_Timeline = __esm({
|
|
|
33773
33790
|
}
|
|
33774
33791
|
});
|
|
33775
33792
|
function extractToastProps(children) {
|
|
33776
|
-
if (!
|
|
33793
|
+
if (!React106__default.isValidElement(children)) {
|
|
33777
33794
|
if (typeof children === "string") {
|
|
33778
33795
|
return { message: children };
|
|
33779
33796
|
}
|
|
@@ -33811,7 +33828,7 @@ var init_ToastSlot = __esm({
|
|
|
33811
33828
|
eventBus.emit("UI:CLOSE");
|
|
33812
33829
|
};
|
|
33813
33830
|
if (!isVisible) return null;
|
|
33814
|
-
const isCustomContent =
|
|
33831
|
+
const isCustomContent = React106__default.isValidElement(children) && !message;
|
|
33815
33832
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
33816
33833
|
Toast,
|
|
33817
33834
|
{
|
|
@@ -34080,7 +34097,7 @@ var init_WizardContainer = __esm({
|
|
|
34080
34097
|
const isCompleted = index < currentStep;
|
|
34081
34098
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
34082
34099
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
34083
|
-
return /* @__PURE__ */ jsxs(
|
|
34100
|
+
return /* @__PURE__ */ jsxs(React106__default.Fragment, { children: [
|
|
34084
34101
|
/* @__PURE__ */ jsx(
|
|
34085
34102
|
Button,
|
|
34086
34103
|
{
|
|
@@ -34462,12 +34479,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
34462
34479
|
}
|
|
34463
34480
|
});
|
|
34464
34481
|
function lazyThree(name, loader) {
|
|
34465
|
-
const Lazy =
|
|
34482
|
+
const Lazy = React106__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
34466
34483
|
function ThreeWrapper(props) {
|
|
34467
|
-
return
|
|
34468
|
-
|
|
34484
|
+
return React106__default.createElement(
|
|
34485
|
+
React106__default.Suspense,
|
|
34469
34486
|
{ fallback: null },
|
|
34470
|
-
|
|
34487
|
+
React106__default.createElement(Lazy, props)
|
|
34471
34488
|
);
|
|
34472
34489
|
}
|
|
34473
34490
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -34955,7 +34972,7 @@ function SuspenseConfigProvider({
|
|
|
34955
34972
|
config,
|
|
34956
34973
|
children
|
|
34957
34974
|
}) {
|
|
34958
|
-
return
|
|
34975
|
+
return React106__default.createElement(
|
|
34959
34976
|
SuspenseConfigContext.Provider,
|
|
34960
34977
|
{ value: config },
|
|
34961
34978
|
children
|
|
@@ -35438,7 +35455,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
35438
35455
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
35439
35456
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
35440
35457
|
}
|
|
35441
|
-
return /* @__PURE__ */ jsx(
|
|
35458
|
+
return /* @__PURE__ */ jsx(React106__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
35442
35459
|
}
|
|
35443
35460
|
if (!child || typeof child !== "object") return null;
|
|
35444
35461
|
const childId = `${parentId}-${index}`;
|
|
@@ -35475,14 +35492,14 @@ function isPatternConfig(value) {
|
|
|
35475
35492
|
if (value === null || value === void 0) return false;
|
|
35476
35493
|
if (typeof value !== "object") return false;
|
|
35477
35494
|
if (Array.isArray(value)) return false;
|
|
35478
|
-
if (
|
|
35495
|
+
if (React106__default.isValidElement(value)) return false;
|
|
35479
35496
|
if (value instanceof Date) return false;
|
|
35480
35497
|
if (typeof value === "function") return false;
|
|
35481
35498
|
const record = value;
|
|
35482
35499
|
return "type" in record && typeof record.type === "string";
|
|
35483
35500
|
}
|
|
35484
35501
|
function isPlainConfigObject(value) {
|
|
35485
|
-
if (
|
|
35502
|
+
if (React106__default.isValidElement(value)) return false;
|
|
35486
35503
|
if (value instanceof Date) return false;
|
|
35487
35504
|
const proto = Object.getPrototypeOf(value);
|
|
35488
35505
|
return proto === Object.prototype || proto === null;
|