@almadar/ui 4.31.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 +1500 -1473
- package/dist/avl/index.js +420 -393
- package/dist/components/index.cjs +1305 -1278
- package/dist/components/index.js +406 -379
- 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 +1130 -1103
- package/dist/providers/index.js +398 -371
- package/dist/runtime/index.cjs +1166 -1139
- package/dist/runtime/index.js +402 -375
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React105 from 'react';
|
|
2
|
+
import React105__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScope, OrbitalProvider, TraitScopeProvider, VerificationProvider } from '@almadar/ui/providers';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -1015,7 +1015,7 @@ var init_Box = __esm({
|
|
|
1015
1015
|
fixed: "fixed",
|
|
1016
1016
|
sticky: "sticky"
|
|
1017
1017
|
};
|
|
1018
|
-
Box =
|
|
1018
|
+
Box = React105__default.forwardRef(
|
|
1019
1019
|
({
|
|
1020
1020
|
padding,
|
|
1021
1021
|
paddingX,
|
|
@@ -1714,7 +1714,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1714
1714
|
const IconComp = value;
|
|
1715
1715
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1716
1716
|
}
|
|
1717
|
-
if (
|
|
1717
|
+
if (React105__default.isValidElement(value)) {
|
|
1718
1718
|
return value;
|
|
1719
1719
|
}
|
|
1720
1720
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1790,7 +1790,7 @@ var init_Button = __esm({
|
|
|
1790
1790
|
md: "h-4 w-4",
|
|
1791
1791
|
lg: "h-5 w-5"
|
|
1792
1792
|
};
|
|
1793
|
-
Button =
|
|
1793
|
+
Button = React105__default.forwardRef(
|
|
1794
1794
|
({
|
|
1795
1795
|
className,
|
|
1796
1796
|
variant = "primary",
|
|
@@ -1893,7 +1893,7 @@ var init_Badge = __esm({
|
|
|
1893
1893
|
md: "px-2.5 py-1 text-sm",
|
|
1894
1894
|
lg: "px-3 py-1.5 text-base"
|
|
1895
1895
|
};
|
|
1896
|
-
Badge =
|
|
1896
|
+
Badge = React105__default.forwardRef(
|
|
1897
1897
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1898
1898
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1899
1899
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -2053,7 +2053,7 @@ var Input;
|
|
|
2053
2053
|
var init_Input = __esm({
|
|
2054
2054
|
"components/atoms/Input.tsx"() {
|
|
2055
2055
|
init_cn();
|
|
2056
|
-
Input =
|
|
2056
|
+
Input = React105__default.forwardRef(
|
|
2057
2057
|
({
|
|
2058
2058
|
className,
|
|
2059
2059
|
inputType,
|
|
@@ -2171,7 +2171,7 @@ var Label;
|
|
|
2171
2171
|
var init_Label = __esm({
|
|
2172
2172
|
"components/atoms/Label.tsx"() {
|
|
2173
2173
|
init_cn();
|
|
2174
|
-
Label =
|
|
2174
|
+
Label = React105__default.forwardRef(
|
|
2175
2175
|
({ className, required, children, ...props }, ref) => {
|
|
2176
2176
|
return /* @__PURE__ */ jsxs(
|
|
2177
2177
|
"label",
|
|
@@ -2197,7 +2197,7 @@ var Textarea;
|
|
|
2197
2197
|
var init_Textarea = __esm({
|
|
2198
2198
|
"components/atoms/Textarea.tsx"() {
|
|
2199
2199
|
init_cn();
|
|
2200
|
-
Textarea =
|
|
2200
|
+
Textarea = React105__default.forwardRef(
|
|
2201
2201
|
({ className, error, ...props }, ref) => {
|
|
2202
2202
|
return /* @__PURE__ */ jsx(
|
|
2203
2203
|
"textarea",
|
|
@@ -2226,7 +2226,7 @@ var Select;
|
|
|
2226
2226
|
var init_Select = __esm({
|
|
2227
2227
|
"components/atoms/Select.tsx"() {
|
|
2228
2228
|
init_cn();
|
|
2229
|
-
Select =
|
|
2229
|
+
Select = React105__default.forwardRef(
|
|
2230
2230
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
2231
2231
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
2232
2232
|
/* @__PURE__ */ jsxs(
|
|
@@ -2268,7 +2268,7 @@ var Checkbox;
|
|
|
2268
2268
|
var init_Checkbox = __esm({
|
|
2269
2269
|
"components/atoms/Checkbox.tsx"() {
|
|
2270
2270
|
init_cn();
|
|
2271
|
-
Checkbox =
|
|
2271
|
+
Checkbox = React105__default.forwardRef(
|
|
2272
2272
|
({ className, label, id, ...props }, ref) => {
|
|
2273
2273
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
2274
2274
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -2350,7 +2350,7 @@ var init_Card = __esm({
|
|
|
2350
2350
|
md: "shadow",
|
|
2351
2351
|
lg: "shadow-lg"
|
|
2352
2352
|
};
|
|
2353
|
-
Card =
|
|
2353
|
+
Card = React105__default.forwardRef(
|
|
2354
2354
|
({
|
|
2355
2355
|
className,
|
|
2356
2356
|
variant = "bordered",
|
|
@@ -2386,9 +2386,9 @@ var init_Card = __esm({
|
|
|
2386
2386
|
}
|
|
2387
2387
|
);
|
|
2388
2388
|
Card.displayName = "Card";
|
|
2389
|
-
CardHeader =
|
|
2389
|
+
CardHeader = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2390
2390
|
CardHeader.displayName = "CardHeader";
|
|
2391
|
-
CardTitle =
|
|
2391
|
+
CardTitle = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2392
2392
|
"h3",
|
|
2393
2393
|
{
|
|
2394
2394
|
ref,
|
|
@@ -2401,11 +2401,11 @@ var init_Card = __esm({
|
|
|
2401
2401
|
}
|
|
2402
2402
|
));
|
|
2403
2403
|
CardTitle.displayName = "CardTitle";
|
|
2404
|
-
CardContent =
|
|
2404
|
+
CardContent = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2405
2405
|
CardContent.displayName = "CardContent";
|
|
2406
2406
|
CardBody = CardContent;
|
|
2407
2407
|
CardBody.displayName = "CardBody";
|
|
2408
|
-
CardFooter =
|
|
2408
|
+
CardFooter = React105__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2409
2409
|
"div",
|
|
2410
2410
|
{
|
|
2411
2411
|
ref,
|
|
@@ -2426,7 +2426,7 @@ var init_Spinner = __esm({
|
|
|
2426
2426
|
md: "h-6 w-6",
|
|
2427
2427
|
lg: "h-8 w-8"
|
|
2428
2428
|
};
|
|
2429
|
-
Spinner =
|
|
2429
|
+
Spinner = React105__default.forwardRef(
|
|
2430
2430
|
({ className, size = "md", ...props }, ref) => {
|
|
2431
2431
|
return /* @__PURE__ */ jsx(
|
|
2432
2432
|
"div",
|
|
@@ -2874,7 +2874,7 @@ var Radio;
|
|
|
2874
2874
|
var init_Radio = __esm({
|
|
2875
2875
|
"components/atoms/Radio.tsx"() {
|
|
2876
2876
|
init_cn();
|
|
2877
|
-
Radio =
|
|
2877
|
+
Radio = React105__default.forwardRef(
|
|
2878
2878
|
({
|
|
2879
2879
|
label,
|
|
2880
2880
|
helperText,
|
|
@@ -2985,7 +2985,7 @@ var init_Switch = __esm({
|
|
|
2985
2985
|
"components/atoms/Switch.tsx"() {
|
|
2986
2986
|
"use client";
|
|
2987
2987
|
init_cn();
|
|
2988
|
-
Switch =
|
|
2988
|
+
Switch = React105.forwardRef(
|
|
2989
2989
|
({
|
|
2990
2990
|
checked,
|
|
2991
2991
|
defaultChecked = false,
|
|
@@ -2996,10 +2996,10 @@ var init_Switch = __esm({
|
|
|
2996
2996
|
name,
|
|
2997
2997
|
className
|
|
2998
2998
|
}, ref) => {
|
|
2999
|
-
const [isChecked, setIsChecked] =
|
|
2999
|
+
const [isChecked, setIsChecked] = React105.useState(
|
|
3000
3000
|
checked !== void 0 ? checked : defaultChecked
|
|
3001
3001
|
);
|
|
3002
|
-
|
|
3002
|
+
React105.useEffect(() => {
|
|
3003
3003
|
if (checked !== void 0) {
|
|
3004
3004
|
setIsChecked(checked);
|
|
3005
3005
|
}
|
|
@@ -3544,8 +3544,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3544
3544
|
position = "top",
|
|
3545
3545
|
className
|
|
3546
3546
|
}) => {
|
|
3547
|
-
const [isVisible, setIsVisible] =
|
|
3548
|
-
const timeoutRef =
|
|
3547
|
+
const [isVisible, setIsVisible] = React105__default.useState(false);
|
|
3548
|
+
const timeoutRef = React105__default.useRef(null);
|
|
3549
3549
|
const handleMouseEnter = () => {
|
|
3550
3550
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3551
3551
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -3554,7 +3554,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3554
3554
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3555
3555
|
setIsVisible(false);
|
|
3556
3556
|
};
|
|
3557
|
-
|
|
3557
|
+
React105__default.useEffect(() => {
|
|
3558
3558
|
return () => {
|
|
3559
3559
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3560
3560
|
};
|
|
@@ -3764,7 +3764,7 @@ var init_StatusDot = __esm({
|
|
|
3764
3764
|
md: "w-2.5 h-2.5",
|
|
3765
3765
|
lg: "w-3 h-3"
|
|
3766
3766
|
};
|
|
3767
|
-
StatusDot =
|
|
3767
|
+
StatusDot = React105__default.forwardRef(
|
|
3768
3768
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
3769
3769
|
return /* @__PURE__ */ jsx(
|
|
3770
3770
|
"span",
|
|
@@ -3817,7 +3817,7 @@ var init_TrendIndicator = __esm({
|
|
|
3817
3817
|
down: TrendingDown,
|
|
3818
3818
|
flat: ArrowRight
|
|
3819
3819
|
};
|
|
3820
|
-
TrendIndicator =
|
|
3820
|
+
TrendIndicator = React105__default.forwardRef(
|
|
3821
3821
|
({
|
|
3822
3822
|
className,
|
|
3823
3823
|
value,
|
|
@@ -3884,7 +3884,7 @@ var init_RangeSlider = __esm({
|
|
|
3884
3884
|
md: "w-4 h-4",
|
|
3885
3885
|
lg: "w-5 h-5"
|
|
3886
3886
|
};
|
|
3887
|
-
RangeSlider =
|
|
3887
|
+
RangeSlider = React105__default.forwardRef(
|
|
3888
3888
|
({
|
|
3889
3889
|
className,
|
|
3890
3890
|
min = 0,
|
|
@@ -4494,9 +4494,9 @@ function ScoreDisplay({
|
|
|
4494
4494
|
...rest
|
|
4495
4495
|
}) {
|
|
4496
4496
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
4497
|
-
const [displayValue, setDisplayValue] =
|
|
4498
|
-
const [isAnimating, setIsAnimating] =
|
|
4499
|
-
|
|
4497
|
+
const [displayValue, setDisplayValue] = React105.useState(resolvedValue);
|
|
4498
|
+
const [isAnimating, setIsAnimating] = React105.useState(false);
|
|
4499
|
+
React105.useEffect(() => {
|
|
4500
4500
|
if (!animated || displayValue === resolvedValue) {
|
|
4501
4501
|
setDisplayValue(resolvedValue);
|
|
4502
4502
|
return;
|
|
@@ -4566,9 +4566,9 @@ function ControlButton({
|
|
|
4566
4566
|
className
|
|
4567
4567
|
}) {
|
|
4568
4568
|
const eventBus = useEventBus();
|
|
4569
|
-
const [isPressed, setIsPressed] =
|
|
4569
|
+
const [isPressed, setIsPressed] = React105.useState(false);
|
|
4570
4570
|
const actualPressed = pressed ?? isPressed;
|
|
4571
|
-
const handlePointerDown =
|
|
4571
|
+
const handlePointerDown = React105.useCallback(
|
|
4572
4572
|
(e) => {
|
|
4573
4573
|
e.preventDefault();
|
|
4574
4574
|
if (disabled) return;
|
|
@@ -4578,7 +4578,7 @@ function ControlButton({
|
|
|
4578
4578
|
},
|
|
4579
4579
|
[disabled, pressEvent, eventBus, onPress]
|
|
4580
4580
|
);
|
|
4581
|
-
const handlePointerUp =
|
|
4581
|
+
const handlePointerUp = React105.useCallback(
|
|
4582
4582
|
(e) => {
|
|
4583
4583
|
e.preventDefault();
|
|
4584
4584
|
if (disabled) return;
|
|
@@ -4588,7 +4588,7 @@ function ControlButton({
|
|
|
4588
4588
|
},
|
|
4589
4589
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
4590
4590
|
);
|
|
4591
|
-
const handlePointerLeave =
|
|
4591
|
+
const handlePointerLeave = React105.useCallback(
|
|
4592
4592
|
(e) => {
|
|
4593
4593
|
if (isPressed) {
|
|
4594
4594
|
setIsPressed(false);
|
|
@@ -5486,9 +5486,9 @@ function MiniMap({
|
|
|
5486
5486
|
viewportRect,
|
|
5487
5487
|
className
|
|
5488
5488
|
}) {
|
|
5489
|
-
const canvasRef =
|
|
5490
|
-
const frameRef =
|
|
5491
|
-
|
|
5489
|
+
const canvasRef = React105.useRef(null);
|
|
5490
|
+
const frameRef = React105.useRef(0);
|
|
5491
|
+
React105.useEffect(() => {
|
|
5492
5492
|
const canvas = canvasRef.current;
|
|
5493
5493
|
if (!canvas) return;
|
|
5494
5494
|
const ctx = canvas.getContext("2d");
|
|
@@ -5650,7 +5650,7 @@ var init_ErrorBoundary = __esm({
|
|
|
5650
5650
|
"use client";
|
|
5651
5651
|
init_cn();
|
|
5652
5652
|
init_ErrorState();
|
|
5653
|
-
ErrorBoundary = class extends
|
|
5653
|
+
ErrorBoundary = class extends React105__default.Component {
|
|
5654
5654
|
constructor(props) {
|
|
5655
5655
|
super(props);
|
|
5656
5656
|
__publicField(this, "reset", () => {
|
|
@@ -6097,8 +6097,8 @@ var init_Tooltip = __esm({
|
|
|
6097
6097
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
6098
6098
|
};
|
|
6099
6099
|
}, []);
|
|
6100
|
-
const triggerElement =
|
|
6101
|
-
const trigger =
|
|
6100
|
+
const triggerElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6101
|
+
const trigger = React105__default.cloneElement(triggerElement, {
|
|
6102
6102
|
ref: triggerRef,
|
|
6103
6103
|
onMouseEnter: handleMouseEnter,
|
|
6104
6104
|
onMouseLeave: handleMouseLeave,
|
|
@@ -6219,8 +6219,8 @@ var init_Popover = __esm({
|
|
|
6219
6219
|
onMouseEnter: handleOpen,
|
|
6220
6220
|
onMouseLeave: handleClose
|
|
6221
6221
|
};
|
|
6222
|
-
const childElement =
|
|
6223
|
-
const triggerElement =
|
|
6222
|
+
const childElement = React105__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
6223
|
+
const triggerElement = React105__default.cloneElement(
|
|
6224
6224
|
childElement,
|
|
6225
6225
|
{
|
|
6226
6226
|
ref: triggerRef,
|
|
@@ -6337,8 +6337,8 @@ var init_Menu = __esm({
|
|
|
6337
6337
|
"bottom-start": "top-full left-0 mt-2",
|
|
6338
6338
|
"bottom-end": "top-full right-0 mt-2"
|
|
6339
6339
|
};
|
|
6340
|
-
const triggerChild =
|
|
6341
|
-
const triggerElement =
|
|
6340
|
+
const triggerChild = React105__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
6341
|
+
const triggerElement = React105__default.cloneElement(
|
|
6342
6342
|
triggerChild,
|
|
6343
6343
|
{
|
|
6344
6344
|
ref: triggerRef,
|
|
@@ -6857,7 +6857,7 @@ var init_MapView = __esm({
|
|
|
6857
6857
|
shadowSize: [41, 41]
|
|
6858
6858
|
});
|
|
6859
6859
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
6860
|
-
const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback88, useState: useState83 } =
|
|
6860
|
+
const { useEffect: useEffect61, useRef: useRef58, useCallback: useCallback88, useState: useState83 } = React105__default;
|
|
6861
6861
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
6862
6862
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
6863
6863
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -7088,7 +7088,7 @@ function InputPattern({
|
|
|
7088
7088
|
fieldName
|
|
7089
7089
|
}) {
|
|
7090
7090
|
const { emit } = useEventBus();
|
|
7091
|
-
const [localValue, setLocalValue] =
|
|
7091
|
+
const [localValue, setLocalValue] = React105__default.useState(value);
|
|
7092
7092
|
const handleChange = (e) => {
|
|
7093
7093
|
setLocalValue(e.target.value);
|
|
7094
7094
|
if (onChange) {
|
|
@@ -7126,7 +7126,7 @@ function TextareaPattern({
|
|
|
7126
7126
|
fieldName
|
|
7127
7127
|
}) {
|
|
7128
7128
|
const { emit } = useEventBus();
|
|
7129
|
-
const [localValue, setLocalValue] =
|
|
7129
|
+
const [localValue, setLocalValue] = React105__default.useState(value);
|
|
7130
7130
|
const handleChange = (e) => {
|
|
7131
7131
|
setLocalValue(e.target.value);
|
|
7132
7132
|
if (onChange) {
|
|
@@ -7158,7 +7158,7 @@ function SelectPattern({
|
|
|
7158
7158
|
fieldName
|
|
7159
7159
|
}) {
|
|
7160
7160
|
const { emit } = useEventBus();
|
|
7161
|
-
const [localValue, setLocalValue] =
|
|
7161
|
+
const [localValue, setLocalValue] = React105__default.useState(value);
|
|
7162
7162
|
const handleChange = (e) => {
|
|
7163
7163
|
setLocalValue(e.target.value);
|
|
7164
7164
|
if (onChange) {
|
|
@@ -7187,7 +7187,7 @@ function CheckboxPattern({
|
|
|
7187
7187
|
className
|
|
7188
7188
|
}) {
|
|
7189
7189
|
const { emit } = useEventBus();
|
|
7190
|
-
const [localChecked, setLocalChecked] =
|
|
7190
|
+
const [localChecked, setLocalChecked] = React105__default.useState(checked);
|
|
7191
7191
|
const handleChange = (e) => {
|
|
7192
7192
|
setLocalChecked(e.target.checked);
|
|
7193
7193
|
if (onChange) {
|
|
@@ -7418,8 +7418,8 @@ function ActionButtons({
|
|
|
7418
7418
|
disabled
|
|
7419
7419
|
}) {
|
|
7420
7420
|
const eventBus = useEventBus();
|
|
7421
|
-
const [activeButtons, setActiveButtons] =
|
|
7422
|
-
const handlePress =
|
|
7421
|
+
const [activeButtons, setActiveButtons] = React105.useState(/* @__PURE__ */ new Set());
|
|
7422
|
+
const handlePress = React105.useCallback(
|
|
7423
7423
|
(id) => {
|
|
7424
7424
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
7425
7425
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7427,7 +7427,7 @@ function ActionButtons({
|
|
|
7427
7427
|
},
|
|
7428
7428
|
[actionEvent, eventBus, onAction]
|
|
7429
7429
|
);
|
|
7430
|
-
const handleRelease =
|
|
7430
|
+
const handleRelease = React105.useCallback(
|
|
7431
7431
|
(id) => {
|
|
7432
7432
|
setActiveButtons((prev) => {
|
|
7433
7433
|
const next = new Set(prev);
|
|
@@ -9462,7 +9462,7 @@ var init_MarkdownContent = __esm({
|
|
|
9462
9462
|
init_Box();
|
|
9463
9463
|
init_useTranslate();
|
|
9464
9464
|
init_cn();
|
|
9465
|
-
MarkdownContent =
|
|
9465
|
+
MarkdownContent = React105__default.memo(
|
|
9466
9466
|
({ content, direction, className }) => {
|
|
9467
9467
|
const { t: _t } = useTranslate();
|
|
9468
9468
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -9679,7 +9679,7 @@ var init_CodeBlock = __esm({
|
|
|
9679
9679
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
9680
9680
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
9681
9681
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
9682
|
-
CodeBlock =
|
|
9682
|
+
CodeBlock = React105__default.memo(
|
|
9683
9683
|
({
|
|
9684
9684
|
code: rawCode,
|
|
9685
9685
|
language = "text",
|
|
@@ -10938,7 +10938,7 @@ var init_StateMachineView = __esm({
|
|
|
10938
10938
|
style: { top: title ? 30 : 0 },
|
|
10939
10939
|
children: [
|
|
10940
10940
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
10941
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
10941
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React105__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
10942
10942
|
StateNode,
|
|
10943
10943
|
{
|
|
10944
10944
|
state,
|
|
@@ -16658,7 +16658,7 @@ function CraftingRecipe({
|
|
|
16658
16658
|
className
|
|
16659
16659
|
}) {
|
|
16660
16660
|
const eventBus = useEventBus();
|
|
16661
|
-
const handleCraft =
|
|
16661
|
+
const handleCraft = React105.useCallback(() => {
|
|
16662
16662
|
onCraft?.();
|
|
16663
16663
|
if (craftEvent) {
|
|
16664
16664
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -16675,7 +16675,7 @@ function CraftingRecipe({
|
|
|
16675
16675
|
children: [
|
|
16676
16676
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
16677
16677
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
16678
|
-
return /* @__PURE__ */ jsxs(
|
|
16678
|
+
return /* @__PURE__ */ jsxs(React105.Fragment, { children: [
|
|
16679
16679
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
16680
16680
|
ItemSlot,
|
|
16681
16681
|
{
|
|
@@ -16969,8 +16969,8 @@ function DPad({
|
|
|
16969
16969
|
}) {
|
|
16970
16970
|
const eventBus = useEventBus();
|
|
16971
16971
|
const sizes = sizeMap15[size];
|
|
16972
|
-
const [activeDirections, setActiveDirections] =
|
|
16973
|
-
const handlePress =
|
|
16972
|
+
const [activeDirections, setActiveDirections] = React105.useState(/* @__PURE__ */ new Set());
|
|
16973
|
+
const handlePress = React105.useCallback(
|
|
16974
16974
|
(direction) => {
|
|
16975
16975
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
16976
16976
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -16978,7 +16978,7 @@ function DPad({
|
|
|
16978
16978
|
},
|
|
16979
16979
|
[directionEvent, eventBus, onDirection]
|
|
16980
16980
|
);
|
|
16981
|
-
const handleRelease =
|
|
16981
|
+
const handleRelease = React105.useCallback(
|
|
16982
16982
|
(direction) => {
|
|
16983
16983
|
setActiveDirections((prev) => {
|
|
16984
16984
|
const next = new Set(prev);
|
|
@@ -17096,6 +17096,19 @@ var init_DashboardGrid = __esm({
|
|
|
17096
17096
|
DashboardGrid.displayName = "DashboardGrid";
|
|
17097
17097
|
}
|
|
17098
17098
|
});
|
|
17099
|
+
var CurrentPagePathContext, CurrentPagePathProvider, useCurrentPagePath;
|
|
17100
|
+
var init_CurrentPagePathContext = __esm({
|
|
17101
|
+
"context/CurrentPagePathContext.tsx"() {
|
|
17102
|
+
"use client";
|
|
17103
|
+
CurrentPagePathContext = createContext(void 0);
|
|
17104
|
+
CurrentPagePathProvider = ({
|
|
17105
|
+
value,
|
|
17106
|
+
children
|
|
17107
|
+
}) => /* @__PURE__ */ jsx(CurrentPagePathContext.Provider, { value, children });
|
|
17108
|
+
CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
|
|
17109
|
+
useCurrentPagePath = () => useContext(CurrentPagePathContext);
|
|
17110
|
+
}
|
|
17111
|
+
});
|
|
17099
17112
|
var DashboardLayout, NavLink;
|
|
17100
17113
|
var init_DashboardLayout = __esm({
|
|
17101
17114
|
"components/templates/DashboardLayout.tsx"() {
|
|
@@ -17109,6 +17122,7 @@ var init_DashboardLayout = __esm({
|
|
|
17109
17122
|
init_useAuthContext();
|
|
17110
17123
|
init_useEventBus();
|
|
17111
17124
|
init_useTranslate();
|
|
17125
|
+
init_CurrentPagePathContext();
|
|
17112
17126
|
DashboardLayout = ({
|
|
17113
17127
|
appName = "{{APP_TITLE}}",
|
|
17114
17128
|
logo,
|
|
@@ -17125,6 +17139,7 @@ var init_DashboardLayout = __esm({
|
|
|
17125
17139
|
showThemeToggle = true,
|
|
17126
17140
|
sidebarFooter,
|
|
17127
17141
|
onSignOut: onSignOutProp,
|
|
17142
|
+
currentPath,
|
|
17128
17143
|
children
|
|
17129
17144
|
}) => {
|
|
17130
17145
|
const eventBus = useEventBus();
|
|
@@ -17145,259 +17160,271 @@ var init_DashboardLayout = __esm({
|
|
|
17145
17160
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
17146
17161
|
const [userMenuOpen, setUserMenuOpen] = useState(false);
|
|
17147
17162
|
const location = useLocation();
|
|
17163
|
+
const ctxPagePath = useCurrentPagePath();
|
|
17164
|
+
const activePath = currentPath ?? ctxPagePath ?? location.pathname;
|
|
17148
17165
|
const { signOut: authSignOut } = useAuthContext();
|
|
17149
17166
|
const user = userProp || (null);
|
|
17150
17167
|
const { t } = useTranslate();
|
|
17151
17168
|
const handleSignOut = onSignOutProp || authSignOut;
|
|
17152
|
-
return /* @__PURE__ */ jsxs(
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
className: cn(
|
|
17165
|
-
"fixed inset-y-0 left-0 z-30 w-64 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
17166
|
-
"transform transition-transform duration-200 ease-in-out lg:translate-x-0",
|
|
17167
|
-
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
17169
|
+
return /* @__PURE__ */ jsxs(
|
|
17170
|
+
HStack,
|
|
17171
|
+
{
|
|
17172
|
+
gap: "none",
|
|
17173
|
+
className: "min-h-screen w-full bg-background dark:bg-background items-stretch",
|
|
17174
|
+
children: [
|
|
17175
|
+
sidebarOpen && /* @__PURE__ */ jsx(
|
|
17176
|
+
Box,
|
|
17177
|
+
{
|
|
17178
|
+
className: "fixed inset-0 bg-foreground/50 dark:bg-foreground/70 z-20 lg:hidden",
|
|
17179
|
+
onClick: () => setSidebarOpen(false)
|
|
17180
|
+
}
|
|
17168
17181
|
),
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17178
|
-
|
|
17179
|
-
|
|
17180
|
-
|
|
17181
|
-
|
|
17182
|
-
|
|
17183
|
-
as: "span",
|
|
17184
|
-
children: appName.charAt(0).toUpperCase()
|
|
17185
|
-
}
|
|
17186
|
-
) }),
|
|
17187
|
-
/* @__PURE__ */ jsx(
|
|
17188
|
-
Typography,
|
|
17189
|
-
{
|
|
17190
|
-
variant: "label",
|
|
17191
|
-
className: "font-semibold text-foreground dark:text-foreground",
|
|
17192
|
-
as: "span",
|
|
17193
|
-
children: appName
|
|
17194
|
-
}
|
|
17195
|
-
)
|
|
17196
|
-
] }),
|
|
17197
|
-
/* @__PURE__ */ jsx(
|
|
17198
|
-
Button,
|
|
17199
|
-
{
|
|
17200
|
-
variant: "ghost",
|
|
17201
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
17202
|
-
onClick: () => setSidebarOpen(false),
|
|
17203
|
-
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
17204
|
-
}
|
|
17205
|
-
)
|
|
17206
|
-
]
|
|
17207
|
-
}
|
|
17208
|
-
),
|
|
17209
|
-
/* @__PURE__ */ jsx(
|
|
17210
|
-
VStack,
|
|
17211
|
-
{
|
|
17212
|
-
as: "nav",
|
|
17213
|
-
gap: "none",
|
|
17214
|
-
className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
|
|
17215
|
-
children: navItems.map((item) => /* @__PURE__ */ jsx(
|
|
17216
|
-
NavLink,
|
|
17182
|
+
/* @__PURE__ */ jsxs(
|
|
17183
|
+
Box,
|
|
17184
|
+
{
|
|
17185
|
+
as: "aside",
|
|
17186
|
+
className: cn(
|
|
17187
|
+
"z-30 w-64 flex-shrink-0 bg-card dark:bg-card border-r border-border dark:border-border",
|
|
17188
|
+
"fixed inset-y-0 left-0 lg:static lg:translate-x-0 lg:h-auto",
|
|
17189
|
+
"transform transition-transform duration-200 ease-in-out",
|
|
17190
|
+
"flex flex-col",
|
|
17191
|
+
sidebarOpen ? "translate-x-0" : "-translate-x-full"
|
|
17192
|
+
),
|
|
17193
|
+
children: [
|
|
17194
|
+
/* @__PURE__ */ jsxs(
|
|
17195
|
+
HStack,
|
|
17217
17196
|
{
|
|
17218
|
-
|
|
17219
|
-
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
|
|
17223
|
-
|
|
17224
|
-
|
|
17225
|
-
|
|
17226
|
-
|
|
17227
|
-
|
|
17228
|
-
|
|
17229
|
-
|
|
17230
|
-
/* @__PURE__ */ jsx(
|
|
17231
|
-
Box,
|
|
17232
|
-
{
|
|
17233
|
-
as: "header",
|
|
17234
|
-
className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
|
|
17235
|
-
children: /* @__PURE__ */ jsxs(
|
|
17236
|
-
HStack,
|
|
17237
|
-
{
|
|
17238
|
-
align: "center",
|
|
17239
|
-
justify: "between",
|
|
17240
|
-
className: "h-full px-4 gap-4",
|
|
17241
|
-
children: [
|
|
17242
|
-
/* @__PURE__ */ jsx(
|
|
17243
|
-
Button,
|
|
17244
|
-
{
|
|
17245
|
-
variant: "ghost",
|
|
17246
|
-
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
17247
|
-
onClick: () => setSidebarOpen(true),
|
|
17248
|
-
"aria-label": "Open sidebar",
|
|
17249
|
-
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
17250
|
-
}
|
|
17251
|
-
),
|
|
17252
|
-
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
17253
|
-
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
17254
|
-
/* @__PURE__ */ jsx(
|
|
17255
|
-
Input,
|
|
17256
|
-
{
|
|
17257
|
-
type: "search",
|
|
17258
|
-
placeholder: t("common.search"),
|
|
17259
|
-
className: "pl-10 w-full",
|
|
17260
|
-
onKeyDown: (e) => {
|
|
17261
|
-
if (e.key === "Enter") {
|
|
17262
|
-
handleSearchSubmit(e.target.value);
|
|
17197
|
+
align: "center",
|
|
17198
|
+
justify: "between",
|
|
17199
|
+
className: "h-16 px-4 border-b border-border dark:border-border",
|
|
17200
|
+
children: [
|
|
17201
|
+
/* @__PURE__ */ jsxs(Link, { to: "/", className: "flex items-center gap-2", children: [
|
|
17202
|
+
logo || /* @__PURE__ */ jsx(Box, { className: "w-8 h-8 bg-primary-600 rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
17203
|
+
Typography,
|
|
17204
|
+
{
|
|
17205
|
+
variant: "small",
|
|
17206
|
+
className: "text-white font-bold text-sm",
|
|
17207
|
+
as: "span",
|
|
17208
|
+
children: appName.charAt(0).toUpperCase()
|
|
17263
17209
|
}
|
|
17210
|
+
) }),
|
|
17211
|
+
/* @__PURE__ */ jsx(
|
|
17212
|
+
Typography,
|
|
17213
|
+
{
|
|
17214
|
+
variant: "label",
|
|
17215
|
+
className: "font-semibold text-foreground dark:text-foreground",
|
|
17216
|
+
as: "span",
|
|
17217
|
+
children: appName
|
|
17218
|
+
}
|
|
17219
|
+
)
|
|
17220
|
+
] }),
|
|
17221
|
+
/* @__PURE__ */ jsx(
|
|
17222
|
+
Button,
|
|
17223
|
+
{
|
|
17224
|
+
variant: "ghost",
|
|
17225
|
+
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground",
|
|
17226
|
+
onClick: () => setSidebarOpen(false),
|
|
17227
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-5 w-5" })
|
|
17264
17228
|
}
|
|
17265
|
-
|
|
17266
|
-
|
|
17267
|
-
|
|
17268
|
-
|
|
17269
|
-
|
|
17270
|
-
|
|
17271
|
-
|
|
17272
|
-
|
|
17229
|
+
)
|
|
17230
|
+
]
|
|
17231
|
+
}
|
|
17232
|
+
),
|
|
17233
|
+
/* @__PURE__ */ jsx(
|
|
17234
|
+
VStack,
|
|
17235
|
+
{
|
|
17236
|
+
as: "nav",
|
|
17237
|
+
gap: "none",
|
|
17238
|
+
className: "flex-1 px-3 py-4 space-y-1 overflow-y-auto",
|
|
17239
|
+
children: navItems.map((item) => /* @__PURE__ */ jsx(
|
|
17240
|
+
NavLink,
|
|
17273
17241
|
{
|
|
17274
|
-
|
|
17275
|
-
|
|
17276
|
-
onClick: () => handleTopBarActionClick(action.event),
|
|
17277
|
-
"aria-label": action.label ?? action.icon,
|
|
17278
|
-
children: [
|
|
17279
|
-
/* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
|
|
17280
|
-
action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
|
|
17281
|
-
Box,
|
|
17282
|
-
{
|
|
17283
|
-
as: "span",
|
|
17284
|
-
className: cn(
|
|
17285
|
-
"absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
|
|
17286
|
-
action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
|
|
17287
|
-
),
|
|
17288
|
-
children: action.badge
|
|
17289
|
-
}
|
|
17290
|
-
)
|
|
17291
|
-
]
|
|
17242
|
+
item,
|
|
17243
|
+
currentPath: activePath
|
|
17292
17244
|
},
|
|
17293
|
-
|
|
17294
|
-
))
|
|
17295
|
-
|
|
17296
|
-
|
|
17297
|
-
|
|
17298
|
-
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17309
|
-
|
|
17310
|
-
|
|
17311
|
-
|
|
17312
|
-
|
|
17313
|
-
|
|
17314
|
-
|
|
17315
|
-
user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
17316
|
-
/* @__PURE__ */ jsxs(
|
|
17245
|
+
item.href
|
|
17246
|
+
))
|
|
17247
|
+
}
|
|
17248
|
+
),
|
|
17249
|
+
sidebarFooter && /* @__PURE__ */ jsx(Box, { className: "p-4 border-t border-border dark:border-border", children: sidebarFooter })
|
|
17250
|
+
]
|
|
17251
|
+
}
|
|
17252
|
+
),
|
|
17253
|
+
/* @__PURE__ */ jsxs(VStack, { gap: "none", className: "flex-1 min-w-0 min-h-screen", children: [
|
|
17254
|
+
/* @__PURE__ */ jsx(
|
|
17255
|
+
Box,
|
|
17256
|
+
{
|
|
17257
|
+
as: "header",
|
|
17258
|
+
className: "sticky top-0 z-20 h-16 bg-card dark:bg-card border-b border-border dark:border-border",
|
|
17259
|
+
children: /* @__PURE__ */ jsxs(
|
|
17260
|
+
HStack,
|
|
17261
|
+
{
|
|
17262
|
+
align: "center",
|
|
17263
|
+
justify: "between",
|
|
17264
|
+
className: "h-full px-3 sm:px-4 gap-2 sm:gap-4",
|
|
17265
|
+
children: [
|
|
17266
|
+
/* @__PURE__ */ jsx(
|
|
17317
17267
|
Button,
|
|
17318
17268
|
{
|
|
17319
17269
|
variant: "ghost",
|
|
17320
|
-
className: "
|
|
17321
|
-
onClick: () =>
|
|
17322
|
-
|
|
17323
|
-
|
|
17324
|
-
Avatar,
|
|
17325
|
-
{
|
|
17326
|
-
src: user.avatar,
|
|
17327
|
-
alt: user.name,
|
|
17328
|
-
initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
|
|
17329
|
-
size: "sm"
|
|
17330
|
-
}
|
|
17331
|
-
),
|
|
17332
|
-
/* @__PURE__ */ jsx(
|
|
17333
|
-
Typography,
|
|
17334
|
-
{
|
|
17335
|
-
variant: "small",
|
|
17336
|
-
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
17337
|
-
as: "span",
|
|
17338
|
-
children: user.name
|
|
17339
|
-
}
|
|
17340
|
-
),
|
|
17341
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
17342
|
-
]
|
|
17270
|
+
className: "lg:hidden p-2 rounded-md hover:bg-muted dark:hover:bg-muted text-muted-foreground dark:text-muted-foreground touch-manipulation min-h-[44px] min-w-[44px] flex items-center justify-center",
|
|
17271
|
+
onClick: () => setSidebarOpen(true),
|
|
17272
|
+
"aria-label": "Open sidebar",
|
|
17273
|
+
children: /* @__PURE__ */ jsx(Menu$1, { className: "h-5 w-5" })
|
|
17343
17274
|
}
|
|
17344
17275
|
),
|
|
17345
|
-
|
|
17276
|
+
searchEnabled && /* @__PURE__ */ jsx(Box, { className: "hidden sm:block flex-1 min-w-0 xl:max-w-md", children: /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
17277
|
+
/* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground dark:text-muted-foreground" }),
|
|
17346
17278
|
/* @__PURE__ */ jsx(
|
|
17347
|
-
|
|
17279
|
+
Input,
|
|
17280
|
+
{
|
|
17281
|
+
type: "search",
|
|
17282
|
+
placeholder: t("common.search"),
|
|
17283
|
+
className: "pl-10 w-full",
|
|
17284
|
+
onKeyDown: (e) => {
|
|
17285
|
+
if (e.key === "Enter") {
|
|
17286
|
+
handleSearchSubmit(e.target.value);
|
|
17287
|
+
}
|
|
17288
|
+
}
|
|
17289
|
+
}
|
|
17290
|
+
)
|
|
17291
|
+
] }) }),
|
|
17292
|
+
!searchEnabled && /* @__PURE__ */ jsx(Box, { className: "flex-1" }),
|
|
17293
|
+
/* @__PURE__ */ jsxs(HStack, { align: "center", gap: "xs", children: [
|
|
17294
|
+
headerActions,
|
|
17295
|
+
showThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, {}),
|
|
17296
|
+
topBarActions.map((action, idx) => /* @__PURE__ */ jsxs(
|
|
17297
|
+
Button,
|
|
17298
|
+
{
|
|
17299
|
+
variant: "ghost",
|
|
17300
|
+
className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
|
|
17301
|
+
onClick: () => handleTopBarActionClick(action.event),
|
|
17302
|
+
"aria-label": action.label ?? action.icon,
|
|
17303
|
+
children: [
|
|
17304
|
+
/* @__PURE__ */ jsx(Icon, { name: action.icon, className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
|
|
17305
|
+
action.badge !== void 0 && action.badge !== null && action.badge !== 0 && action.badge !== "" && /* @__PURE__ */ jsx(
|
|
17306
|
+
Box,
|
|
17307
|
+
{
|
|
17308
|
+
as: "span",
|
|
17309
|
+
className: cn(
|
|
17310
|
+
"absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
|
|
17311
|
+
action.variant === "danger" ? "bg-error" : action.variant === "primary" ? "bg-primary" : "bg-foreground"
|
|
17312
|
+
),
|
|
17313
|
+
children: action.badge
|
|
17314
|
+
}
|
|
17315
|
+
)
|
|
17316
|
+
]
|
|
17317
|
+
},
|
|
17318
|
+
`${action.event}-${idx}`
|
|
17319
|
+
)),
|
|
17320
|
+
notificationsEnabled && /* @__PURE__ */ jsxs(
|
|
17321
|
+
Button,
|
|
17348
17322
|
{
|
|
17349
|
-
|
|
17350
|
-
|
|
17323
|
+
variant: "ghost",
|
|
17324
|
+
className: "relative p-2 rounded-full hover:bg-muted dark:hover:bg-muted",
|
|
17325
|
+
onClick: handleNotificationClick,
|
|
17326
|
+
"aria-label": t("common.notifications"),
|
|
17327
|
+
children: [
|
|
17328
|
+
/* @__PURE__ */ jsx(Bell, { className: "h-5 w-5 text-muted-foreground dark:text-muted-foreground" }),
|
|
17329
|
+
unreadCount > 0 && /* @__PURE__ */ jsx(
|
|
17330
|
+
Box,
|
|
17331
|
+
{
|
|
17332
|
+
as: "span",
|
|
17333
|
+
className: "absolute -top-0.5 -right-0.5 min-w-[18px] h-[18px] px-1 bg-error rounded-full text-[10px] font-semibold text-white flex items-center justify-center",
|
|
17334
|
+
children: unreadCount > 99 ? "99+" : unreadCount
|
|
17335
|
+
}
|
|
17336
|
+
)
|
|
17337
|
+
]
|
|
17351
17338
|
}
|
|
17352
17339
|
),
|
|
17353
|
-
/* @__PURE__ */ jsxs(Box, { className: "
|
|
17354
|
-
/* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
|
|
17355
|
-
/* @__PURE__ */ jsx(
|
|
17356
|
-
Typography,
|
|
17357
|
-
{
|
|
17358
|
-
variant: "small",
|
|
17359
|
-
className: "text-sm font-medium text-foreground dark:text-foreground",
|
|
17360
|
-
as: "p",
|
|
17361
|
-
children: user.name
|
|
17362
|
-
}
|
|
17363
|
-
),
|
|
17364
|
-
/* @__PURE__ */ jsx(
|
|
17365
|
-
Typography,
|
|
17366
|
-
{
|
|
17367
|
-
variant: "caption",
|
|
17368
|
-
className: "text-xs text-muted-foreground dark:text-muted-foreground",
|
|
17369
|
-
as: "p",
|
|
17370
|
-
children: user.email
|
|
17371
|
-
}
|
|
17372
|
-
)
|
|
17373
|
-
] }),
|
|
17340
|
+
user && /* @__PURE__ */ jsxs(Box, { className: "relative", children: [
|
|
17374
17341
|
/* @__PURE__ */ jsxs(
|
|
17375
17342
|
Button,
|
|
17376
17343
|
{
|
|
17377
17344
|
variant: "ghost",
|
|
17378
|
-
|
|
17379
|
-
|
|
17380
|
-
handleSignOut?.();
|
|
17381
|
-
},
|
|
17382
|
-
className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
|
|
17345
|
+
className: "flex items-center gap-2 p-2 rounded-lg hover:bg-muted dark:hover:bg-muted",
|
|
17346
|
+
onClick: () => setUserMenuOpen(!userMenuOpen),
|
|
17383
17347
|
children: [
|
|
17384
|
-
/* @__PURE__ */ jsx(
|
|
17385
|
-
|
|
17348
|
+
/* @__PURE__ */ jsx(
|
|
17349
|
+
Avatar,
|
|
17350
|
+
{
|
|
17351
|
+
src: user.avatar,
|
|
17352
|
+
alt: user.name,
|
|
17353
|
+
initials: user.name.split(" ").map((n) => n[0]).join("").substring(0, 2),
|
|
17354
|
+
size: "sm"
|
|
17355
|
+
}
|
|
17356
|
+
),
|
|
17357
|
+
/* @__PURE__ */ jsx(
|
|
17358
|
+
Typography,
|
|
17359
|
+
{
|
|
17360
|
+
variant: "small",
|
|
17361
|
+
className: "hidden sm:block text-sm font-medium text-foreground dark:text-foreground",
|
|
17362
|
+
as: "span",
|
|
17363
|
+
children: user.name
|
|
17364
|
+
}
|
|
17365
|
+
),
|
|
17366
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "hidden sm:block h-4 w-4 text-muted-foreground dark:text-muted-foreground" })
|
|
17386
17367
|
]
|
|
17387
17368
|
}
|
|
17388
|
-
)
|
|
17369
|
+
),
|
|
17370
|
+
userMenuOpen && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17371
|
+
/* @__PURE__ */ jsx(
|
|
17372
|
+
Box,
|
|
17373
|
+
{
|
|
17374
|
+
className: "fixed inset-0 z-20",
|
|
17375
|
+
onClick: () => setUserMenuOpen(false)
|
|
17376
|
+
}
|
|
17377
|
+
),
|
|
17378
|
+
/* @__PURE__ */ jsxs(Box, { className: "absolute right-0 mt-2 w-48 bg-card dark:bg-card rounded-lg shadow-lg border border-border dark:border-border py-1 z-30", children: [
|
|
17379
|
+
/* @__PURE__ */ jsxs(Box, { className: "px-4 py-2 border-b border-border dark:border-border", children: [
|
|
17380
|
+
/* @__PURE__ */ jsx(
|
|
17381
|
+
Typography,
|
|
17382
|
+
{
|
|
17383
|
+
variant: "small",
|
|
17384
|
+
className: "text-sm font-medium text-foreground dark:text-foreground",
|
|
17385
|
+
as: "p",
|
|
17386
|
+
children: user.name
|
|
17387
|
+
}
|
|
17388
|
+
),
|
|
17389
|
+
/* @__PURE__ */ jsx(
|
|
17390
|
+
Typography,
|
|
17391
|
+
{
|
|
17392
|
+
variant: "caption",
|
|
17393
|
+
className: "text-xs text-muted-foreground dark:text-muted-foreground",
|
|
17394
|
+
as: "p",
|
|
17395
|
+
children: user.email
|
|
17396
|
+
}
|
|
17397
|
+
)
|
|
17398
|
+
] }),
|
|
17399
|
+
/* @__PURE__ */ jsxs(
|
|
17400
|
+
Button,
|
|
17401
|
+
{
|
|
17402
|
+
variant: "ghost",
|
|
17403
|
+
onClick: () => {
|
|
17404
|
+
setUserMenuOpen(false);
|
|
17405
|
+
handleSignOut?.();
|
|
17406
|
+
},
|
|
17407
|
+
className: "w-full flex items-center gap-2 px-4 py-2 text-sm text-error dark:text-error hover:bg-error/10 dark:hover:bg-error/20",
|
|
17408
|
+
children: [
|
|
17409
|
+
/* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }),
|
|
17410
|
+
t("auth.signOut")
|
|
17411
|
+
]
|
|
17412
|
+
}
|
|
17413
|
+
)
|
|
17414
|
+
] })
|
|
17415
|
+
] })
|
|
17389
17416
|
] })
|
|
17390
17417
|
] })
|
|
17391
|
-
]
|
|
17392
|
-
|
|
17393
|
-
|
|
17418
|
+
]
|
|
17419
|
+
}
|
|
17420
|
+
)
|
|
17394
17421
|
}
|
|
17395
|
-
)
|
|
17396
|
-
|
|
17397
|
-
|
|
17398
|
-
|
|
17399
|
-
|
|
17400
|
-
|
|
17422
|
+
),
|
|
17423
|
+
/* @__PURE__ */ jsx(Box, { as: "main", className: "flex-1 p-3 sm:p-4 md:p-6", children })
|
|
17424
|
+
] })
|
|
17425
|
+
]
|
|
17426
|
+
}
|
|
17427
|
+
);
|
|
17401
17428
|
};
|
|
17402
17429
|
DashboardLayout.displayName = "DashboardLayout";
|
|
17403
17430
|
NavLink = ({
|
|
@@ -17891,13 +17918,13 @@ function DataList({
|
|
|
17891
17918
|
}) {
|
|
17892
17919
|
const eventBus = useEventBus();
|
|
17893
17920
|
const { t } = useTranslate();
|
|
17894
|
-
const [visibleCount, setVisibleCount] =
|
|
17921
|
+
const [visibleCount, setVisibleCount] = React105__default.useState(pageSize || Infinity);
|
|
17895
17922
|
const fieldDefs = fields ?? columns ?? [];
|
|
17896
17923
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17897
17924
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17898
17925
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
17899
17926
|
const hasRenderProp = typeof children === "function";
|
|
17900
|
-
|
|
17927
|
+
React105__default.useEffect(() => {
|
|
17901
17928
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
17902
17929
|
const childrenTypeOf = typeof children;
|
|
17903
17930
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -17953,7 +17980,7 @@ function DataList({
|
|
|
17953
17980
|
const items2 = data.map((item) => item);
|
|
17954
17981
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17955
17982
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
17956
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
17983
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
17957
17984
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
17958
17985
|
group.items.map((itemData, index) => {
|
|
17959
17986
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -18144,7 +18171,7 @@ function DataList({
|
|
|
18144
18171
|
className
|
|
18145
18172
|
),
|
|
18146
18173
|
children: [
|
|
18147
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
18174
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
18148
18175
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
18149
18176
|
group.items.map(
|
|
18150
18177
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -19227,7 +19254,7 @@ var init_WizardProgress = __esm({
|
|
|
19227
19254
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
19228
19255
|
const isActive = index === currentStep;
|
|
19229
19256
|
const isCompleted = index < currentStep;
|
|
19230
|
-
return /* @__PURE__ */ jsxs(
|
|
19257
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
19231
19258
|
/* @__PURE__ */ jsx(
|
|
19232
19259
|
"button",
|
|
19233
19260
|
{
|
|
@@ -20138,7 +20165,7 @@ function InventoryGrid({
|
|
|
20138
20165
|
const eventBus = useEventBus();
|
|
20139
20166
|
const slotCount = totalSlots ?? items.length;
|
|
20140
20167
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
20141
|
-
const handleSelect =
|
|
20168
|
+
const handleSelect = React105.useCallback(
|
|
20142
20169
|
(id) => {
|
|
20143
20170
|
onSelect?.(id);
|
|
20144
20171
|
if (selectEvent) {
|
|
@@ -20351,15 +20378,15 @@ function GameCanvas2D({
|
|
|
20351
20378
|
fps = 60,
|
|
20352
20379
|
className
|
|
20353
20380
|
}) {
|
|
20354
|
-
const canvasRef =
|
|
20355
|
-
const rafRef =
|
|
20356
|
-
const frameRef =
|
|
20357
|
-
const lastTimeRef =
|
|
20358
|
-
const onDrawRef =
|
|
20381
|
+
const canvasRef = React105.useRef(null);
|
|
20382
|
+
const rafRef = React105.useRef(0);
|
|
20383
|
+
const frameRef = React105.useRef(0);
|
|
20384
|
+
const lastTimeRef = React105.useRef(0);
|
|
20385
|
+
const onDrawRef = React105.useRef(onDraw);
|
|
20359
20386
|
onDrawRef.current = onDraw;
|
|
20360
|
-
const onTickRef =
|
|
20387
|
+
const onTickRef = React105.useRef(onTick);
|
|
20361
20388
|
onTickRef.current = onTick;
|
|
20362
|
-
|
|
20389
|
+
React105.useEffect(() => {
|
|
20363
20390
|
const canvas = canvasRef.current;
|
|
20364
20391
|
if (!canvas) return;
|
|
20365
20392
|
const ctx = canvas.getContext("2d");
|
|
@@ -20648,7 +20675,7 @@ function TurnPanel({
|
|
|
20648
20675
|
className
|
|
20649
20676
|
}) {
|
|
20650
20677
|
const eventBus = useEventBus();
|
|
20651
|
-
const handleAction =
|
|
20678
|
+
const handleAction = React105.useCallback(
|
|
20652
20679
|
(event) => {
|
|
20653
20680
|
if (event) {
|
|
20654
20681
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -20794,7 +20821,7 @@ function UnitCommandBar({
|
|
|
20794
20821
|
className
|
|
20795
20822
|
}) {
|
|
20796
20823
|
const eventBus = useEventBus();
|
|
20797
|
-
const handleCommand =
|
|
20824
|
+
const handleCommand = React105.useCallback(
|
|
20798
20825
|
(event) => {
|
|
20799
20826
|
if (event) {
|
|
20800
20827
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -21279,7 +21306,7 @@ function GameMenu({
|
|
|
21279
21306
|
} catch {
|
|
21280
21307
|
}
|
|
21281
21308
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21282
|
-
const handleOptionClick =
|
|
21309
|
+
const handleOptionClick = React105.useCallback(
|
|
21283
21310
|
(option) => {
|
|
21284
21311
|
if (option.event && eventBus) {
|
|
21285
21312
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -21393,7 +21420,7 @@ function GameOverScreen({
|
|
|
21393
21420
|
} catch {
|
|
21394
21421
|
}
|
|
21395
21422
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
21396
|
-
const handleActionClick =
|
|
21423
|
+
const handleActionClick = React105.useCallback(
|
|
21397
21424
|
(action) => {
|
|
21398
21425
|
if (action.event && eventBus) {
|
|
21399
21426
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -24744,7 +24771,7 @@ var init_DocumentViewer = __esm({
|
|
|
24744
24771
|
}
|
|
24745
24772
|
});
|
|
24746
24773
|
function extractTitle(children) {
|
|
24747
|
-
if (!
|
|
24774
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
24748
24775
|
const props = children.props;
|
|
24749
24776
|
if (typeof props.title === "string") {
|
|
24750
24777
|
return props.title;
|
|
@@ -24799,7 +24826,7 @@ function LinearView({
|
|
|
24799
24826
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
24800
24827
|
const isDone = i < currentIdx;
|
|
24801
24828
|
const isCurrent = i === currentIdx;
|
|
24802
|
-
return /* @__PURE__ */ jsxs(
|
|
24829
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
24803
24830
|
i > 0 && /* @__PURE__ */ jsx(
|
|
24804
24831
|
Typography,
|
|
24805
24832
|
{
|
|
@@ -25583,12 +25610,12 @@ var init_Form = __esm({
|
|
|
25583
25610
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
25584
25611
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
25585
25612
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
25586
|
-
const normalizedInitialData =
|
|
25613
|
+
const normalizedInitialData = React105__default.useMemo(() => {
|
|
25587
25614
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
25588
25615
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
25589
25616
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
25590
25617
|
}, [entity, initialData]);
|
|
25591
|
-
const entityDerivedFields =
|
|
25618
|
+
const entityDerivedFields = React105__default.useMemo(() => {
|
|
25592
25619
|
if (fields && fields.length > 0) return void 0;
|
|
25593
25620
|
if (!resolvedEntity) return void 0;
|
|
25594
25621
|
return resolvedEntity.fields.map(
|
|
@@ -25607,16 +25634,16 @@ var init_Form = __esm({
|
|
|
25607
25634
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
25608
25635
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
25609
25636
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
25610
|
-
const [formData, setFormData] =
|
|
25637
|
+
const [formData, setFormData] = React105__default.useState(
|
|
25611
25638
|
normalizedInitialData
|
|
25612
25639
|
);
|
|
25613
|
-
const [collapsedSections, setCollapsedSections] =
|
|
25640
|
+
const [collapsedSections, setCollapsedSections] = React105__default.useState(
|
|
25614
25641
|
/* @__PURE__ */ new Set()
|
|
25615
25642
|
);
|
|
25616
|
-
const [submitError, setSubmitError] =
|
|
25617
|
-
const formRef =
|
|
25643
|
+
const [submitError, setSubmitError] = React105__default.useState(null);
|
|
25644
|
+
const formRef = React105__default.useRef(null);
|
|
25618
25645
|
const formMode = props.mode;
|
|
25619
|
-
const mountedRef =
|
|
25646
|
+
const mountedRef = React105__default.useRef(false);
|
|
25620
25647
|
if (!mountedRef.current) {
|
|
25621
25648
|
mountedRef.current = true;
|
|
25622
25649
|
debug("forms", "mount", {
|
|
@@ -25629,7 +25656,7 @@ var init_Form = __esm({
|
|
|
25629
25656
|
});
|
|
25630
25657
|
}
|
|
25631
25658
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
25632
|
-
const evalContext =
|
|
25659
|
+
const evalContext = React105__default.useMemo(
|
|
25633
25660
|
() => ({
|
|
25634
25661
|
formValues: formData,
|
|
25635
25662
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -25638,7 +25665,7 @@ var init_Form = __esm({
|
|
|
25638
25665
|
}),
|
|
25639
25666
|
[formData, externalContext]
|
|
25640
25667
|
);
|
|
25641
|
-
|
|
25668
|
+
React105__default.useEffect(() => {
|
|
25642
25669
|
debug("forms", "initialData-sync", {
|
|
25643
25670
|
mode: formMode,
|
|
25644
25671
|
normalizedInitialData,
|
|
@@ -25649,7 +25676,7 @@ var init_Form = __esm({
|
|
|
25649
25676
|
setFormData(normalizedInitialData);
|
|
25650
25677
|
}
|
|
25651
25678
|
}, [normalizedInitialData]);
|
|
25652
|
-
const processCalculations =
|
|
25679
|
+
const processCalculations = React105__default.useCallback(
|
|
25653
25680
|
(changedFieldId, newFormData) => {
|
|
25654
25681
|
if (!hiddenCalculations.length) return;
|
|
25655
25682
|
const context = {
|
|
@@ -25674,7 +25701,7 @@ var init_Form = __esm({
|
|
|
25674
25701
|
},
|
|
25675
25702
|
[hiddenCalculations, externalContext, eventBus]
|
|
25676
25703
|
);
|
|
25677
|
-
const checkViolations =
|
|
25704
|
+
const checkViolations = React105__default.useCallback(
|
|
25678
25705
|
(changedFieldId, newFormData) => {
|
|
25679
25706
|
if (!violationTriggers.length) return;
|
|
25680
25707
|
const context = {
|
|
@@ -25712,7 +25739,7 @@ var init_Form = __esm({
|
|
|
25712
25739
|
processCalculations(name, newFormData);
|
|
25713
25740
|
checkViolations(name, newFormData);
|
|
25714
25741
|
};
|
|
25715
|
-
const isFieldVisible =
|
|
25742
|
+
const isFieldVisible = React105__default.useCallback(
|
|
25716
25743
|
(fieldName) => {
|
|
25717
25744
|
const condition = conditionalFields[fieldName];
|
|
25718
25745
|
if (!condition) return true;
|
|
@@ -25720,7 +25747,7 @@ var init_Form = __esm({
|
|
|
25720
25747
|
},
|
|
25721
25748
|
[conditionalFields, evalContext]
|
|
25722
25749
|
);
|
|
25723
|
-
const isSectionVisible =
|
|
25750
|
+
const isSectionVisible = React105__default.useCallback(
|
|
25724
25751
|
(section) => {
|
|
25725
25752
|
if (!section.condition) return true;
|
|
25726
25753
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -25796,7 +25823,7 @@ var init_Form = __esm({
|
|
|
25796
25823
|
eventBus.emit(`UI:${onCancel}`);
|
|
25797
25824
|
}
|
|
25798
25825
|
};
|
|
25799
|
-
const renderField =
|
|
25826
|
+
const renderField = React105__default.useCallback(
|
|
25800
25827
|
(field) => {
|
|
25801
25828
|
const fieldName = field.name || field.field;
|
|
25802
25829
|
if (!fieldName) return null;
|
|
@@ -25817,7 +25844,7 @@ var init_Form = __esm({
|
|
|
25817
25844
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
25818
25845
|
);
|
|
25819
25846
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
25820
|
-
const normalizedFields =
|
|
25847
|
+
const normalizedFields = React105__default.useMemo(() => {
|
|
25821
25848
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
25822
25849
|
return effectiveFields.map((field) => {
|
|
25823
25850
|
if (typeof field === "string") {
|
|
@@ -25839,7 +25866,7 @@ var init_Form = __esm({
|
|
|
25839
25866
|
return field;
|
|
25840
25867
|
});
|
|
25841
25868
|
}, [effectiveFields, resolvedEntity]);
|
|
25842
|
-
const schemaFields =
|
|
25869
|
+
const schemaFields = React105__default.useMemo(() => {
|
|
25843
25870
|
if (normalizedFields.length === 0) return null;
|
|
25844
25871
|
if (isDebugEnabled()) {
|
|
25845
25872
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -25849,7 +25876,7 @@ var init_Form = __esm({
|
|
|
25849
25876
|
}
|
|
25850
25877
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
25851
25878
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
25852
|
-
const sectionElements =
|
|
25879
|
+
const sectionElements = React105__default.useMemo(() => {
|
|
25853
25880
|
if (!sections || sections.length === 0) return null;
|
|
25854
25881
|
return sections.map((section) => {
|
|
25855
25882
|
if (!isSectionVisible(section)) {
|
|
@@ -27381,7 +27408,7 @@ var init_List = __esm({
|
|
|
27381
27408
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
27382
27409
|
return [];
|
|
27383
27410
|
}, [entity]);
|
|
27384
|
-
const getItemActions =
|
|
27411
|
+
const getItemActions = React105__default.useCallback(
|
|
27385
27412
|
(item) => {
|
|
27386
27413
|
if (!itemActions) return [];
|
|
27387
27414
|
if (typeof itemActions === "function") {
|
|
@@ -27818,7 +27845,7 @@ var init_MediaGallery = __esm({
|
|
|
27818
27845
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
27819
27846
|
);
|
|
27820
27847
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
27821
|
-
const items =
|
|
27848
|
+
const items = React105__default.useMemo(() => {
|
|
27822
27849
|
if (propItems) return propItems;
|
|
27823
27850
|
if (entityData.length === 0) return [];
|
|
27824
27851
|
return entityData.map((record, idx) => ({
|
|
@@ -27982,7 +28009,7 @@ var init_MediaGallery = __esm({
|
|
|
27982
28009
|
}
|
|
27983
28010
|
});
|
|
27984
28011
|
function extractTitle2(children) {
|
|
27985
|
-
if (!
|
|
28012
|
+
if (!React105__default.isValidElement(children)) return void 0;
|
|
27986
28013
|
const props = children.props;
|
|
27987
28014
|
if (typeof props.title === "string") {
|
|
27988
28015
|
return props.title;
|
|
@@ -28695,7 +28722,7 @@ var init_PageHeader = __esm({
|
|
|
28695
28722
|
info: "bg-info/10 text-info"
|
|
28696
28723
|
};
|
|
28697
28724
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
28698
|
-
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(
|
|
28725
|
+
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(React105__default.Fragment, { children: [
|
|
28699
28726
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
28700
28727
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
28701
28728
|
"a",
|
|
@@ -28888,7 +28915,7 @@ var init_debugRegistry = __esm({
|
|
|
28888
28915
|
}
|
|
28889
28916
|
});
|
|
28890
28917
|
function useDebugData() {
|
|
28891
|
-
const [data, setData] =
|
|
28918
|
+
const [data, setData] = React105.useState(() => ({
|
|
28892
28919
|
traits: [],
|
|
28893
28920
|
ticks: [],
|
|
28894
28921
|
guards: [],
|
|
@@ -28902,7 +28929,7 @@ function useDebugData() {
|
|
|
28902
28929
|
},
|
|
28903
28930
|
lastUpdate: Date.now()
|
|
28904
28931
|
}));
|
|
28905
|
-
|
|
28932
|
+
React105.useEffect(() => {
|
|
28906
28933
|
const updateData = () => {
|
|
28907
28934
|
setData({
|
|
28908
28935
|
traits: getAllTraits(),
|
|
@@ -29011,12 +29038,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
29011
29038
|
return positions;
|
|
29012
29039
|
}
|
|
29013
29040
|
function WalkMinimap() {
|
|
29014
|
-
const [walkStep, setWalkStep] =
|
|
29015
|
-
const [traits2, setTraits] =
|
|
29016
|
-
const [coveredEdges, setCoveredEdges] =
|
|
29017
|
-
const [completedTraits, setCompletedTraits] =
|
|
29018
|
-
const prevTraitRef =
|
|
29019
|
-
|
|
29041
|
+
const [walkStep, setWalkStep] = React105.useState(null);
|
|
29042
|
+
const [traits2, setTraits] = React105.useState([]);
|
|
29043
|
+
const [coveredEdges, setCoveredEdges] = React105.useState([]);
|
|
29044
|
+
const [completedTraits, setCompletedTraits] = React105.useState(/* @__PURE__ */ new Set());
|
|
29045
|
+
const prevTraitRef = React105.useRef(null);
|
|
29046
|
+
React105.useEffect(() => {
|
|
29020
29047
|
const interval = setInterval(() => {
|
|
29021
29048
|
const w = window;
|
|
29022
29049
|
const step = w.__orbitalWalkStep;
|
|
@@ -29463,15 +29490,15 @@ var init_EntitiesTab = __esm({
|
|
|
29463
29490
|
}
|
|
29464
29491
|
});
|
|
29465
29492
|
function EventFlowTab({ events: events2 }) {
|
|
29466
|
-
const [filter, setFilter] =
|
|
29467
|
-
const containerRef =
|
|
29468
|
-
const [autoScroll, setAutoScroll] =
|
|
29469
|
-
|
|
29493
|
+
const [filter, setFilter] = React105.useState("all");
|
|
29494
|
+
const containerRef = React105.useRef(null);
|
|
29495
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
29496
|
+
React105.useEffect(() => {
|
|
29470
29497
|
if (autoScroll && containerRef.current) {
|
|
29471
29498
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
29472
29499
|
}
|
|
29473
29500
|
}, [events2.length, autoScroll]);
|
|
29474
|
-
const filteredEvents =
|
|
29501
|
+
const filteredEvents = React105.useMemo(() => {
|
|
29475
29502
|
if (filter === "all") return events2;
|
|
29476
29503
|
return events2.filter((e) => e.type === filter);
|
|
29477
29504
|
}, [events2, filter]);
|
|
@@ -29590,7 +29617,7 @@ var init_EventFlowTab = __esm({
|
|
|
29590
29617
|
}
|
|
29591
29618
|
});
|
|
29592
29619
|
function GuardsPanel({ guards }) {
|
|
29593
|
-
const [filter, setFilter] =
|
|
29620
|
+
const [filter, setFilter] = React105.useState("all");
|
|
29594
29621
|
if (guards.length === 0) {
|
|
29595
29622
|
return /* @__PURE__ */ jsx(
|
|
29596
29623
|
EmptyState,
|
|
@@ -29603,7 +29630,7 @@ function GuardsPanel({ guards }) {
|
|
|
29603
29630
|
}
|
|
29604
29631
|
const passedCount = guards.filter((g) => g.result).length;
|
|
29605
29632
|
const failedCount = guards.length - passedCount;
|
|
29606
|
-
const filteredGuards =
|
|
29633
|
+
const filteredGuards = React105.useMemo(() => {
|
|
29607
29634
|
if (filter === "all") return guards;
|
|
29608
29635
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
29609
29636
|
return guards.filter((g) => !g.result);
|
|
@@ -29764,10 +29791,10 @@ function EffectBadge({ effect }) {
|
|
|
29764
29791
|
] });
|
|
29765
29792
|
}
|
|
29766
29793
|
function TransitionTimeline({ transitions }) {
|
|
29767
|
-
const containerRef =
|
|
29768
|
-
const [autoScroll, setAutoScroll] =
|
|
29769
|
-
const [expandedId, setExpandedId] =
|
|
29770
|
-
|
|
29794
|
+
const containerRef = React105.useRef(null);
|
|
29795
|
+
const [autoScroll, setAutoScroll] = React105.useState(true);
|
|
29796
|
+
const [expandedId, setExpandedId] = React105.useState(null);
|
|
29797
|
+
React105.useEffect(() => {
|
|
29771
29798
|
if (autoScroll && containerRef.current) {
|
|
29772
29799
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
29773
29800
|
}
|
|
@@ -30053,9 +30080,9 @@ function getAllEvents(traits2) {
|
|
|
30053
30080
|
}
|
|
30054
30081
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
30055
30082
|
const eventBus = useEventBus();
|
|
30056
|
-
const [log3, setLog] =
|
|
30057
|
-
const prevStatesRef =
|
|
30058
|
-
|
|
30083
|
+
const [log3, setLog] = React105.useState([]);
|
|
30084
|
+
const prevStatesRef = React105.useRef(/* @__PURE__ */ new Map());
|
|
30085
|
+
React105.useEffect(() => {
|
|
30059
30086
|
for (const trait of traits2) {
|
|
30060
30087
|
const prev = prevStatesRef.current.get(trait.id);
|
|
30061
30088
|
if (prev && prev !== trait.currentState) {
|
|
@@ -30225,10 +30252,10 @@ function VerifyModePanel({
|
|
|
30225
30252
|
serverCount,
|
|
30226
30253
|
localCount
|
|
30227
30254
|
}) {
|
|
30228
|
-
const [expanded, setExpanded] =
|
|
30229
|
-
const scrollRef =
|
|
30230
|
-
const prevCountRef =
|
|
30231
|
-
|
|
30255
|
+
const [expanded, setExpanded] = React105.useState(true);
|
|
30256
|
+
const scrollRef = React105.useRef(null);
|
|
30257
|
+
const prevCountRef = React105.useRef(0);
|
|
30258
|
+
React105.useEffect(() => {
|
|
30232
30259
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
30233
30260
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
30234
30261
|
}
|
|
@@ -30294,10 +30321,10 @@ function RuntimeDebugger({
|
|
|
30294
30321
|
defaultTab,
|
|
30295
30322
|
schema
|
|
30296
30323
|
}) {
|
|
30297
|
-
const [isCollapsed, setIsCollapsed] =
|
|
30298
|
-
const [isVisible, setIsVisible] =
|
|
30324
|
+
const [isCollapsed, setIsCollapsed] = React105.useState(mode === "verify" ? true : defaultCollapsed);
|
|
30325
|
+
const [isVisible, setIsVisible] = React105.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
30299
30326
|
const debugData = useDebugData();
|
|
30300
|
-
|
|
30327
|
+
React105.useEffect(() => {
|
|
30301
30328
|
if (mode === "inline") return;
|
|
30302
30329
|
return onDebugToggle((enabled) => {
|
|
30303
30330
|
setIsVisible(enabled);
|
|
@@ -30306,7 +30333,7 @@ function RuntimeDebugger({
|
|
|
30306
30333
|
}
|
|
30307
30334
|
});
|
|
30308
30335
|
}, [mode]);
|
|
30309
|
-
|
|
30336
|
+
React105.useEffect(() => {
|
|
30310
30337
|
if (mode === "inline") return;
|
|
30311
30338
|
const handleKeyDown = (e) => {
|
|
30312
30339
|
if (e.key === "`" && isVisible) {
|
|
@@ -30855,7 +30882,7 @@ function SequenceBar({
|
|
|
30855
30882
|
onSlotRemove(index);
|
|
30856
30883
|
}, [onSlotRemove, playing]);
|
|
30857
30884
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
30858
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
30885
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
30859
30886
|
i > 0 && /* @__PURE__ */ jsx(
|
|
30860
30887
|
Typography,
|
|
30861
30888
|
{
|
|
@@ -32200,7 +32227,7 @@ var init_StatCard = __esm({
|
|
|
32200
32227
|
const labelToUse = propLabel ?? propTitle;
|
|
32201
32228
|
const eventBus = useEventBus();
|
|
32202
32229
|
const { t } = useTranslate();
|
|
32203
|
-
const handleActionClick =
|
|
32230
|
+
const handleActionClick = React105__default.useCallback(() => {
|
|
32204
32231
|
if (action?.event) {
|
|
32205
32232
|
eventBus.emit(`UI:${action.event}`, {});
|
|
32206
32233
|
}
|
|
@@ -32211,7 +32238,7 @@ var init_StatCard = __esm({
|
|
|
32211
32238
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
32212
32239
|
const isLoading = externalLoading ?? false;
|
|
32213
32240
|
const error = externalError;
|
|
32214
|
-
const computeMetricValue =
|
|
32241
|
+
const computeMetricValue = React105__default.useCallback(
|
|
32215
32242
|
(metric, items) => {
|
|
32216
32243
|
if (metric.value !== void 0) {
|
|
32217
32244
|
return metric.value;
|
|
@@ -32250,7 +32277,7 @@ var init_StatCard = __esm({
|
|
|
32250
32277
|
},
|
|
32251
32278
|
[]
|
|
32252
32279
|
);
|
|
32253
|
-
const schemaStats =
|
|
32280
|
+
const schemaStats = React105__default.useMemo(() => {
|
|
32254
32281
|
if (!metrics || metrics.length === 0) return null;
|
|
32255
32282
|
return metrics.map((metric) => ({
|
|
32256
32283
|
label: metric.label,
|
|
@@ -32258,7 +32285,7 @@ var init_StatCard = __esm({
|
|
|
32258
32285
|
format: metric.format
|
|
32259
32286
|
}));
|
|
32260
32287
|
}, [metrics, data, computeMetricValue]);
|
|
32261
|
-
const calculatedTrend =
|
|
32288
|
+
const calculatedTrend = React105__default.useMemo(() => {
|
|
32262
32289
|
if (manualTrend !== void 0) return manualTrend;
|
|
32263
32290
|
if (previousValue === void 0 || currentValue === void 0)
|
|
32264
32291
|
return void 0;
|
|
@@ -33242,7 +33269,7 @@ var init_Timeline = __esm({
|
|
|
33242
33269
|
}) => {
|
|
33243
33270
|
const { t } = useTranslate();
|
|
33244
33271
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
33245
|
-
const items =
|
|
33272
|
+
const items = React105__default.useMemo(() => {
|
|
33246
33273
|
if (propItems) return propItems;
|
|
33247
33274
|
if (entityData.length === 0) return [];
|
|
33248
33275
|
return entityData.map((record, idx) => {
|
|
@@ -33349,7 +33376,7 @@ var init_Timeline = __esm({
|
|
|
33349
33376
|
}
|
|
33350
33377
|
});
|
|
33351
33378
|
function extractToastProps(children) {
|
|
33352
|
-
if (!
|
|
33379
|
+
if (!React105__default.isValidElement(children)) {
|
|
33353
33380
|
if (typeof children === "string") {
|
|
33354
33381
|
return { message: children };
|
|
33355
33382
|
}
|
|
@@ -33387,7 +33414,7 @@ var init_ToastSlot = __esm({
|
|
|
33387
33414
|
eventBus.emit("UI:CLOSE");
|
|
33388
33415
|
};
|
|
33389
33416
|
if (!isVisible) return null;
|
|
33390
|
-
const isCustomContent =
|
|
33417
|
+
const isCustomContent = React105__default.isValidElement(children) && !message;
|
|
33391
33418
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
33392
33419
|
Toast,
|
|
33393
33420
|
{
|
|
@@ -33656,7 +33683,7 @@ var init_WizardContainer = __esm({
|
|
|
33656
33683
|
const isCompleted = index < currentStep;
|
|
33657
33684
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
33658
33685
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
33659
|
-
return /* @__PURE__ */ jsxs(
|
|
33686
|
+
return /* @__PURE__ */ jsxs(React105__default.Fragment, { children: [
|
|
33660
33687
|
/* @__PURE__ */ jsx(
|
|
33661
33688
|
Button,
|
|
33662
33689
|
{
|
|
@@ -34038,12 +34065,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
34038
34065
|
}
|
|
34039
34066
|
});
|
|
34040
34067
|
function lazyThree(name, loader) {
|
|
34041
|
-
const Lazy =
|
|
34068
|
+
const Lazy = React105__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
34042
34069
|
function ThreeWrapper(props) {
|
|
34043
|
-
return
|
|
34044
|
-
|
|
34070
|
+
return React105__default.createElement(
|
|
34071
|
+
React105__default.Suspense,
|
|
34045
34072
|
{ fallback: null },
|
|
34046
|
-
|
|
34073
|
+
React105__default.createElement(Lazy, props)
|
|
34047
34074
|
);
|
|
34048
34075
|
}
|
|
34049
34076
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -34531,7 +34558,7 @@ function SuspenseConfigProvider({
|
|
|
34531
34558
|
config,
|
|
34532
34559
|
children
|
|
34533
34560
|
}) {
|
|
34534
|
-
return
|
|
34561
|
+
return React105__default.createElement(
|
|
34535
34562
|
SuspenseConfigContext.Provider,
|
|
34536
34563
|
{ value: config },
|
|
34537
34564
|
children
|
|
@@ -35014,7 +35041,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
35014
35041
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
35015
35042
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
35016
35043
|
}
|
|
35017
|
-
return /* @__PURE__ */ jsx(
|
|
35044
|
+
return /* @__PURE__ */ jsx(React105__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
35018
35045
|
}
|
|
35019
35046
|
if (!child || typeof child !== "object") return null;
|
|
35020
35047
|
const childId = `${parentId}-${index}`;
|
|
@@ -35051,14 +35078,14 @@ function isPatternConfig(value) {
|
|
|
35051
35078
|
if (value === null || value === void 0) return false;
|
|
35052
35079
|
if (typeof value !== "object") return false;
|
|
35053
35080
|
if (Array.isArray(value)) return false;
|
|
35054
|
-
if (
|
|
35081
|
+
if (React105__default.isValidElement(value)) return false;
|
|
35055
35082
|
if (value instanceof Date) return false;
|
|
35056
35083
|
if (typeof value === "function") return false;
|
|
35057
35084
|
const record = value;
|
|
35058
35085
|
return "type" in record && typeof record.type === "string";
|
|
35059
35086
|
}
|
|
35060
35087
|
function isPlainConfigObject(value) {
|
|
35061
|
-
if (
|
|
35088
|
+
if (React105__default.isValidElement(value)) return false;
|
|
35062
35089
|
if (value instanceof Date) return false;
|
|
35063
35090
|
const proto = Object.getPrototypeOf(value);
|
|
35064
35091
|
return proto === Object.prototype || proto === null;
|
|
@@ -35427,7 +35454,7 @@ function resolveLambdaBindings(body, argName, arg) {
|
|
|
35427
35454
|
if (Array.isArray(body)) {
|
|
35428
35455
|
return body.map((b) => resolveLambdaBindings(b, argName, arg));
|
|
35429
35456
|
}
|
|
35430
|
-
if (body !== null && typeof body === "object" && !
|
|
35457
|
+
if (body !== null && typeof body === "object" && !React105__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
35431
35458
|
const out = {};
|
|
35432
35459
|
for (const [k, v] of Object.entries(body)) {
|
|
35433
35460
|
out[k] = resolveLambdaBindings(v, argName, arg);
|
|
@@ -35446,7 +35473,7 @@ function getSlotContentRenderer2() {
|
|
|
35446
35473
|
function makeLambdaFn(argName, lambdaBody, callerKey) {
|
|
35447
35474
|
return (item, index) => {
|
|
35448
35475
|
const resolvedBody = resolveLambdaBindings(lambdaBody, argName, item);
|
|
35449
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
35476
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React105__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
35450
35477
|
return null;
|
|
35451
35478
|
}
|
|
35452
35479
|
const record = resolvedBody;
|
|
@@ -35464,7 +35491,7 @@ function makeLambdaFn(argName, lambdaBody, callerKey) {
|
|
|
35464
35491
|
props: childProps,
|
|
35465
35492
|
priority: 0
|
|
35466
35493
|
};
|
|
35467
|
-
return
|
|
35494
|
+
return React105__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
35468
35495
|
};
|
|
35469
35496
|
}
|
|
35470
35497
|
function convertNode(node, callerKey) {
|
|
@@ -35483,7 +35510,7 @@ function convertNode(node, callerKey) {
|
|
|
35483
35510
|
});
|
|
35484
35511
|
return anyChanged ? mapped : node;
|
|
35485
35512
|
}
|
|
35486
|
-
if (typeof node === "object" && !
|
|
35513
|
+
if (typeof node === "object" && !React105__default.isValidElement(node) && !(node instanceof Date)) {
|
|
35487
35514
|
return convertObjectProps(node);
|
|
35488
35515
|
}
|
|
35489
35516
|
return node;
|