@almadar/ui 2.61.0 → 3.0.1
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 +1328 -1505
- package/dist/avl/index.css +7 -2
- package/dist/avl/index.js +251 -428
- package/dist/components/index.cjs +35 -37
- package/dist/components/index.css +7 -2
- package/dist/components/index.js +36 -38
- package/dist/components/organisms/DataTable.d.ts +3 -2
- package/dist/components/organisms/JazariStateMachine.d.ts +10 -37
- package/dist/components/organisms/MasterDetail.d.ts +4 -3
- package/dist/components/organisms/MediaGallery.d.ts +3 -2
- package/dist/components/organisms/Sidebar.d.ts +7 -2
- package/dist/components/organisms/StateMachineView.d.ts +7 -2
- package/dist/components/organisms/Table.d.ts +2 -1
- package/dist/components/organisms/Timeline.d.ts +15 -2
- package/dist/components/organisms/book/BookChapterView.d.ts +3 -2
- package/dist/components/organisms/book/BookCoverPage.d.ts +3 -3
- package/dist/components/organisms/book/BookNavBar.d.ts +3 -3
- package/dist/components/organisms/book/BookTableOfContents.d.ts +3 -2
- package/dist/components/organisms/book/BookViewer.d.ts +2 -2
- package/dist/components/organisms/book/types.d.ts +9 -4
- package/dist/components/organisms/game/WorldMapBoard.d.ts +9 -3
- package/dist/components/organisms/marketing-types.d.ts +22 -12
- package/dist/components/organisms/types.d.ts +23 -17
- package/dist/components/templates/types.d.ts +7 -2
- package/dist/hooks/index.cjs +5 -2
- package/dist/hooks/index.js +5 -2
- package/dist/lib/index.cjs +5 -2
- package/dist/lib/index.js +5 -2
- package/dist/providers/index.cjs +987 -1166
- package/dist/providers/index.css +7 -2
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/index.js +230 -403
- package/dist/runtime/index.cjs +36 -69
- package/dist/runtime/index.css +7 -2
- package/dist/runtime/index.js +37 -70
- package/package.json +3 -3
- package/dist/providers/EntityStoreProvider.d.ts +0 -63
package/dist/providers/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React115 from 'react';
|
|
2
|
+
import React115__default, { createContext, useContext, useRef, useEffect, useCallback, Suspense, useState, useMemo, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { EventBusContext
|
|
4
|
+
import { EventBusContext } from '@almadar/ui/providers';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import * as LucideIcons from 'lucide-react';
|
|
@@ -34,6 +34,7 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff.js'
|
|
|
34
34
|
import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js';
|
|
35
35
|
import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
|
|
36
36
|
import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
|
|
37
|
+
import { isInlineTrait } from '@almadar/core';
|
|
37
38
|
|
|
38
39
|
var __defProp = Object.defineProperty;
|
|
39
40
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -286,7 +287,7 @@ var init_ThemeContext = __esm({
|
|
|
286
287
|
const newMode = resolvedMode === "dark" ? "light" : "dark";
|
|
287
288
|
setMode(newMode);
|
|
288
289
|
}, [resolvedMode, setMode]);
|
|
289
|
-
const
|
|
290
|
+
const contextValue = useMemo(
|
|
290
291
|
() => ({
|
|
291
292
|
theme,
|
|
292
293
|
mode,
|
|
@@ -308,7 +309,7 @@ var init_ThemeContext = __esm({
|
|
|
308
309
|
appliedTheme
|
|
309
310
|
]
|
|
310
311
|
);
|
|
311
|
-
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value:
|
|
312
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, { value: contextValue, children });
|
|
312
313
|
};
|
|
313
314
|
}
|
|
314
315
|
});
|
|
@@ -697,7 +698,7 @@ var init_Box = __esm({
|
|
|
697
698
|
fixed: "fixed",
|
|
698
699
|
sticky: "sticky"
|
|
699
700
|
};
|
|
700
|
-
Box =
|
|
701
|
+
Box = React115__default.forwardRef(
|
|
701
702
|
({
|
|
702
703
|
padding,
|
|
703
704
|
paddingX,
|
|
@@ -1396,7 +1397,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1396
1397
|
const IconComp = value;
|
|
1397
1398
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1398
1399
|
}
|
|
1399
|
-
if (
|
|
1400
|
+
if (React115__default.isValidElement(value)) {
|
|
1400
1401
|
return value;
|
|
1401
1402
|
}
|
|
1402
1403
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1472,7 +1473,7 @@ var init_Button = __esm({
|
|
|
1472
1473
|
md: "h-4 w-4",
|
|
1473
1474
|
lg: "h-5 w-5"
|
|
1474
1475
|
};
|
|
1475
|
-
Button =
|
|
1476
|
+
Button = React115__default.forwardRef(
|
|
1476
1477
|
({
|
|
1477
1478
|
className,
|
|
1478
1479
|
variant = "primary",
|
|
@@ -1575,7 +1576,7 @@ var init_Badge = __esm({
|
|
|
1575
1576
|
md: "px-2.5 py-1 text-sm",
|
|
1576
1577
|
lg: "px-3 py-1.5 text-base"
|
|
1577
1578
|
};
|
|
1578
|
-
Badge =
|
|
1579
|
+
Badge = React115__default.forwardRef(
|
|
1579
1580
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1580
1581
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1581
1582
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1716,7 +1717,7 @@ var Input;
|
|
|
1716
1717
|
var init_Input = __esm({
|
|
1717
1718
|
"components/atoms/Input.tsx"() {
|
|
1718
1719
|
init_cn();
|
|
1719
|
-
Input =
|
|
1720
|
+
Input = React115__default.forwardRef(
|
|
1720
1721
|
({
|
|
1721
1722
|
className,
|
|
1722
1723
|
inputType,
|
|
@@ -1834,7 +1835,7 @@ var Label;
|
|
|
1834
1835
|
var init_Label = __esm({
|
|
1835
1836
|
"components/atoms/Label.tsx"() {
|
|
1836
1837
|
init_cn();
|
|
1837
|
-
Label =
|
|
1838
|
+
Label = React115__default.forwardRef(
|
|
1838
1839
|
({ className, required, children, ...props }, ref) => {
|
|
1839
1840
|
return /* @__PURE__ */ jsxs(
|
|
1840
1841
|
"label",
|
|
@@ -1860,7 +1861,7 @@ var Textarea;
|
|
|
1860
1861
|
var init_Textarea = __esm({
|
|
1861
1862
|
"components/atoms/Textarea.tsx"() {
|
|
1862
1863
|
init_cn();
|
|
1863
|
-
Textarea =
|
|
1864
|
+
Textarea = React115__default.forwardRef(
|
|
1864
1865
|
({ className, error, ...props }, ref) => {
|
|
1865
1866
|
return /* @__PURE__ */ jsx(
|
|
1866
1867
|
"textarea",
|
|
@@ -1889,7 +1890,7 @@ var Select;
|
|
|
1889
1890
|
var init_Select = __esm({
|
|
1890
1891
|
"components/atoms/Select.tsx"() {
|
|
1891
1892
|
init_cn();
|
|
1892
|
-
Select =
|
|
1893
|
+
Select = React115__default.forwardRef(
|
|
1893
1894
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1894
1895
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1895
1896
|
/* @__PURE__ */ jsxs(
|
|
@@ -1931,7 +1932,7 @@ var Checkbox;
|
|
|
1931
1932
|
var init_Checkbox = __esm({
|
|
1932
1933
|
"components/atoms/Checkbox.tsx"() {
|
|
1933
1934
|
init_cn();
|
|
1934
|
-
Checkbox =
|
|
1935
|
+
Checkbox = React115__default.forwardRef(
|
|
1935
1936
|
({ className, label, id, ...props }, ref) => {
|
|
1936
1937
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1937
1938
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -2013,7 +2014,7 @@ var init_Card = __esm({
|
|
|
2013
2014
|
md: "shadow",
|
|
2014
2015
|
lg: "shadow-lg"
|
|
2015
2016
|
};
|
|
2016
|
-
Card =
|
|
2017
|
+
Card = React115__default.forwardRef(
|
|
2017
2018
|
({
|
|
2018
2019
|
className,
|
|
2019
2020
|
variant = "bordered",
|
|
@@ -2049,9 +2050,9 @@ var init_Card = __esm({
|
|
|
2049
2050
|
}
|
|
2050
2051
|
);
|
|
2051
2052
|
Card.displayName = "Card";
|
|
2052
|
-
CardHeader =
|
|
2053
|
+
CardHeader = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2053
2054
|
CardHeader.displayName = "CardHeader";
|
|
2054
|
-
CardTitle =
|
|
2055
|
+
CardTitle = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2055
2056
|
"h3",
|
|
2056
2057
|
{
|
|
2057
2058
|
ref,
|
|
@@ -2064,11 +2065,11 @@ var init_Card = __esm({
|
|
|
2064
2065
|
}
|
|
2065
2066
|
));
|
|
2066
2067
|
CardTitle.displayName = "CardTitle";
|
|
2067
|
-
CardContent =
|
|
2068
|
+
CardContent = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2068
2069
|
CardContent.displayName = "CardContent";
|
|
2069
2070
|
CardBody = CardContent;
|
|
2070
2071
|
CardBody.displayName = "CardBody";
|
|
2071
|
-
CardFooter =
|
|
2072
|
+
CardFooter = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2072
2073
|
"div",
|
|
2073
2074
|
{
|
|
2074
2075
|
ref,
|
|
@@ -2089,7 +2090,7 @@ var init_Spinner = __esm({
|
|
|
2089
2090
|
md: "h-6 w-6",
|
|
2090
2091
|
lg: "h-8 w-8"
|
|
2091
2092
|
};
|
|
2092
|
-
Spinner =
|
|
2093
|
+
Spinner = React115__default.forwardRef(
|
|
2093
2094
|
({ className, size = "md", ...props }, ref) => {
|
|
2094
2095
|
return /* @__PURE__ */ jsx(
|
|
2095
2096
|
"div",
|
|
@@ -2537,7 +2538,7 @@ var Radio;
|
|
|
2537
2538
|
var init_Radio = __esm({
|
|
2538
2539
|
"components/atoms/Radio.tsx"() {
|
|
2539
2540
|
init_cn();
|
|
2540
|
-
Radio =
|
|
2541
|
+
Radio = React115__default.forwardRef(
|
|
2541
2542
|
({
|
|
2542
2543
|
label,
|
|
2543
2544
|
helperText,
|
|
@@ -2648,7 +2649,7 @@ var init_Switch = __esm({
|
|
|
2648
2649
|
"components/atoms/Switch.tsx"() {
|
|
2649
2650
|
"use client";
|
|
2650
2651
|
init_cn();
|
|
2651
|
-
Switch =
|
|
2652
|
+
Switch = React115.forwardRef(
|
|
2652
2653
|
({
|
|
2653
2654
|
checked,
|
|
2654
2655
|
defaultChecked = false,
|
|
@@ -2659,10 +2660,10 @@ var init_Switch = __esm({
|
|
|
2659
2660
|
name,
|
|
2660
2661
|
className
|
|
2661
2662
|
}, ref) => {
|
|
2662
|
-
const [isChecked, setIsChecked] =
|
|
2663
|
+
const [isChecked, setIsChecked] = React115.useState(
|
|
2663
2664
|
checked !== void 0 ? checked : defaultChecked
|
|
2664
2665
|
);
|
|
2665
|
-
|
|
2666
|
+
React115.useEffect(() => {
|
|
2666
2667
|
if (checked !== void 0) {
|
|
2667
2668
|
setIsChecked(checked);
|
|
2668
2669
|
}
|
|
@@ -3088,8 +3089,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3088
3089
|
position = "top",
|
|
3089
3090
|
className
|
|
3090
3091
|
}) => {
|
|
3091
|
-
const [isVisible, setIsVisible] =
|
|
3092
|
-
const timeoutRef =
|
|
3092
|
+
const [isVisible, setIsVisible] = React115__default.useState(false);
|
|
3093
|
+
const timeoutRef = React115__default.useRef(null);
|
|
3093
3094
|
const handleMouseEnter = () => {
|
|
3094
3095
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3095
3096
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -3098,7 +3099,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3098
3099
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3099
3100
|
setIsVisible(false);
|
|
3100
3101
|
};
|
|
3101
|
-
|
|
3102
|
+
React115__default.useEffect(() => {
|
|
3102
3103
|
return () => {
|
|
3103
3104
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3104
3105
|
};
|
|
@@ -3308,7 +3309,7 @@ var init_StatusDot = __esm({
|
|
|
3308
3309
|
md: "w-2.5 h-2.5",
|
|
3309
3310
|
lg: "w-3 h-3"
|
|
3310
3311
|
};
|
|
3311
|
-
StatusDot =
|
|
3312
|
+
StatusDot = React115__default.forwardRef(
|
|
3312
3313
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
3313
3314
|
return /* @__PURE__ */ jsx(
|
|
3314
3315
|
"span",
|
|
@@ -3361,7 +3362,7 @@ var init_TrendIndicator = __esm({
|
|
|
3361
3362
|
down: TrendingDown,
|
|
3362
3363
|
flat: ArrowRight
|
|
3363
3364
|
};
|
|
3364
|
-
TrendIndicator =
|
|
3365
|
+
TrendIndicator = React115__default.forwardRef(
|
|
3365
3366
|
({
|
|
3366
3367
|
className,
|
|
3367
3368
|
value,
|
|
@@ -3428,7 +3429,7 @@ var init_RangeSlider = __esm({
|
|
|
3428
3429
|
md: "w-4 h-4",
|
|
3429
3430
|
lg: "w-5 h-5"
|
|
3430
3431
|
};
|
|
3431
|
-
RangeSlider =
|
|
3432
|
+
RangeSlider = React115__default.forwardRef(
|
|
3432
3433
|
({
|
|
3433
3434
|
className,
|
|
3434
3435
|
min = 0,
|
|
@@ -4023,7 +4024,7 @@ var init_ContentSection = __esm({
|
|
|
4023
4024
|
md: "py-16",
|
|
4024
4025
|
lg: "py-24"
|
|
4025
4026
|
};
|
|
4026
|
-
ContentSection =
|
|
4027
|
+
ContentSection = React115__default.forwardRef(
|
|
4027
4028
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4028
4029
|
return /* @__PURE__ */ jsx(
|
|
4029
4030
|
Box,
|
|
@@ -4557,7 +4558,7 @@ var init_AnimatedReveal = __esm({
|
|
|
4557
4558
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4558
4559
|
"none": {}
|
|
4559
4560
|
};
|
|
4560
|
-
AnimatedReveal =
|
|
4561
|
+
AnimatedReveal = React115__default.forwardRef(
|
|
4561
4562
|
({
|
|
4562
4563
|
trigger = "scroll",
|
|
4563
4564
|
animation = "fade-up",
|
|
@@ -4717,7 +4718,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4717
4718
|
"components/atoms/AnimatedGraphic.tsx"() {
|
|
4718
4719
|
"use client";
|
|
4719
4720
|
init_cn();
|
|
4720
|
-
AnimatedGraphic =
|
|
4721
|
+
AnimatedGraphic = React115__default.forwardRef(
|
|
4721
4722
|
({
|
|
4722
4723
|
src,
|
|
4723
4724
|
svgContent,
|
|
@@ -4740,7 +4741,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4740
4741
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
4741
4742
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
4742
4743
|
const prevAnimateRef = useRef(animate);
|
|
4743
|
-
const setRef =
|
|
4744
|
+
const setRef = React115__default.useCallback(
|
|
4744
4745
|
(node) => {
|
|
4745
4746
|
containerRef.current = node;
|
|
4746
4747
|
if (typeof ref === "function") ref(node);
|
|
@@ -4958,9 +4959,9 @@ function ScoreDisplay({
|
|
|
4958
4959
|
...rest
|
|
4959
4960
|
}) {
|
|
4960
4961
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
4961
|
-
const [displayValue, setDisplayValue] =
|
|
4962
|
-
const [isAnimating, setIsAnimating] =
|
|
4963
|
-
|
|
4962
|
+
const [displayValue, setDisplayValue] = React115.useState(resolvedValue);
|
|
4963
|
+
const [isAnimating, setIsAnimating] = React115.useState(false);
|
|
4964
|
+
React115.useEffect(() => {
|
|
4964
4965
|
if (!animated || displayValue === resolvedValue) {
|
|
4965
4966
|
setDisplayValue(resolvedValue);
|
|
4966
4967
|
return;
|
|
@@ -5030,9 +5031,9 @@ function ControlButton({
|
|
|
5030
5031
|
className
|
|
5031
5032
|
}) {
|
|
5032
5033
|
const eventBus = useEventBus();
|
|
5033
|
-
const [isPressed, setIsPressed] =
|
|
5034
|
+
const [isPressed, setIsPressed] = React115.useState(false);
|
|
5034
5035
|
const actualPressed = pressed ?? isPressed;
|
|
5035
|
-
const handlePointerDown =
|
|
5036
|
+
const handlePointerDown = React115.useCallback(
|
|
5036
5037
|
(e) => {
|
|
5037
5038
|
e.preventDefault();
|
|
5038
5039
|
if (disabled) return;
|
|
@@ -5042,7 +5043,7 @@ function ControlButton({
|
|
|
5042
5043
|
},
|
|
5043
5044
|
[disabled, pressEvent, eventBus, onPress]
|
|
5044
5045
|
);
|
|
5045
|
-
const handlePointerUp =
|
|
5046
|
+
const handlePointerUp = React115.useCallback(
|
|
5046
5047
|
(e) => {
|
|
5047
5048
|
e.preventDefault();
|
|
5048
5049
|
if (disabled) return;
|
|
@@ -5052,7 +5053,7 @@ function ControlButton({
|
|
|
5052
5053
|
},
|
|
5053
5054
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5054
5055
|
);
|
|
5055
|
-
const handlePointerLeave =
|
|
5056
|
+
const handlePointerLeave = React115.useCallback(
|
|
5056
5057
|
(e) => {
|
|
5057
5058
|
if (isPressed) {
|
|
5058
5059
|
setIsPressed(false);
|
|
@@ -5950,9 +5951,9 @@ function MiniMap({
|
|
|
5950
5951
|
viewportRect,
|
|
5951
5952
|
className
|
|
5952
5953
|
}) {
|
|
5953
|
-
const canvasRef =
|
|
5954
|
-
const frameRef =
|
|
5955
|
-
|
|
5954
|
+
const canvasRef = React115.useRef(null);
|
|
5955
|
+
const frameRef = React115.useRef(0);
|
|
5956
|
+
React115.useEffect(() => {
|
|
5956
5957
|
const canvas = canvasRef.current;
|
|
5957
5958
|
if (!canvas) return;
|
|
5958
5959
|
const ctx = canvas.getContext("2d");
|
|
@@ -6291,7 +6292,7 @@ var init_ErrorBoundary = __esm({
|
|
|
6291
6292
|
"use client";
|
|
6292
6293
|
init_cn();
|
|
6293
6294
|
init_ErrorState();
|
|
6294
|
-
ErrorBoundary = class extends
|
|
6295
|
+
ErrorBoundary = class extends React115__default.Component {
|
|
6295
6296
|
constructor(props) {
|
|
6296
6297
|
super(props);
|
|
6297
6298
|
__publicField(this, "reset", () => {
|
|
@@ -7115,8 +7116,8 @@ var init_Tooltip = __esm({
|
|
|
7115
7116
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
7116
7117
|
};
|
|
7117
7118
|
}, []);
|
|
7118
|
-
const triggerElement =
|
|
7119
|
-
const trigger =
|
|
7119
|
+
const triggerElement = React115__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7120
|
+
const trigger = React115__default.cloneElement(triggerElement, {
|
|
7120
7121
|
ref: triggerRef,
|
|
7121
7122
|
onMouseEnter: handleMouseEnter,
|
|
7122
7123
|
onMouseLeave: handleMouseLeave,
|
|
@@ -7237,8 +7238,8 @@ var init_Popover = __esm({
|
|
|
7237
7238
|
onMouseEnter: handleOpen,
|
|
7238
7239
|
onMouseLeave: handleClose
|
|
7239
7240
|
};
|
|
7240
|
-
const childElement =
|
|
7241
|
-
const triggerElement =
|
|
7241
|
+
const childElement = React115__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7242
|
+
const triggerElement = React115__default.cloneElement(
|
|
7242
7243
|
childElement,
|
|
7243
7244
|
{
|
|
7244
7245
|
ref: triggerRef,
|
|
@@ -7355,8 +7356,8 @@ var init_Menu = __esm({
|
|
|
7355
7356
|
"bottom-start": "top-full left-0 mt-2",
|
|
7356
7357
|
"bottom-end": "top-full right-0 mt-2"
|
|
7357
7358
|
};
|
|
7358
|
-
const triggerChild =
|
|
7359
|
-
const triggerElement =
|
|
7359
|
+
const triggerChild = React115__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
7360
|
+
const triggerElement = React115__default.cloneElement(
|
|
7360
7361
|
triggerChild,
|
|
7361
7362
|
{
|
|
7362
7363
|
ref: triggerRef,
|
|
@@ -7870,13 +7871,13 @@ var init_MapView = __esm({
|
|
|
7870
7871
|
shadowSize: [41, 41]
|
|
7871
7872
|
});
|
|
7872
7873
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
7873
|
-
const { useEffect:
|
|
7874
|
+
const { useEffect: useEffect62, useRef: useRef62, useCallback: useCallback95, useState: useState87 } = React115__default;
|
|
7874
7875
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
7875
7876
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
7876
7877
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
7877
7878
|
const map = useMap();
|
|
7878
|
-
const prevRef =
|
|
7879
|
-
|
|
7879
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
7880
|
+
useEffect62(() => {
|
|
7880
7881
|
const prev = prevRef.current;
|
|
7881
7882
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
7882
7883
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -7887,7 +7888,7 @@ var init_MapView = __esm({
|
|
|
7887
7888
|
}
|
|
7888
7889
|
function MapClickHandler({ onMapClick }) {
|
|
7889
7890
|
const map = useMap();
|
|
7890
|
-
|
|
7891
|
+
useEffect62(() => {
|
|
7891
7892
|
if (!onMapClick) return;
|
|
7892
7893
|
const handler = (e) => {
|
|
7893
7894
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -8122,7 +8123,7 @@ function InputPattern({
|
|
|
8122
8123
|
className
|
|
8123
8124
|
}) {
|
|
8124
8125
|
const { emit } = useEventBus();
|
|
8125
|
-
const [localValue, setLocalValue] =
|
|
8126
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8126
8127
|
const handleChange = (e) => {
|
|
8127
8128
|
setLocalValue(e.target.value);
|
|
8128
8129
|
if (onChange) {
|
|
@@ -8158,7 +8159,7 @@ function TextareaPattern({
|
|
|
8158
8159
|
className
|
|
8159
8160
|
}) {
|
|
8160
8161
|
const { emit } = useEventBus();
|
|
8161
|
-
const [localValue, setLocalValue] =
|
|
8162
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8162
8163
|
const handleChange = (e) => {
|
|
8163
8164
|
setLocalValue(e.target.value);
|
|
8164
8165
|
if (onChange) {
|
|
@@ -8188,7 +8189,7 @@ function SelectPattern({
|
|
|
8188
8189
|
className
|
|
8189
8190
|
}) {
|
|
8190
8191
|
const { emit } = useEventBus();
|
|
8191
|
-
const [localValue, setLocalValue] =
|
|
8192
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8192
8193
|
const handleChange = (e) => {
|
|
8193
8194
|
setLocalValue(e.target.value);
|
|
8194
8195
|
if (onChange) {
|
|
@@ -8216,7 +8217,7 @@ function CheckboxPattern({
|
|
|
8216
8217
|
className
|
|
8217
8218
|
}) {
|
|
8218
8219
|
const { emit } = useEventBus();
|
|
8219
|
-
const [localChecked, setLocalChecked] =
|
|
8220
|
+
const [localChecked, setLocalChecked] = React115__default.useState(checked);
|
|
8220
8221
|
const handleChange = (e) => {
|
|
8221
8222
|
setLocalChecked(e.target.checked);
|
|
8222
8223
|
if (onChange) {
|
|
@@ -8447,8 +8448,8 @@ function ActionButtons({
|
|
|
8447
8448
|
disabled
|
|
8448
8449
|
}) {
|
|
8449
8450
|
const eventBus = useEventBus();
|
|
8450
|
-
const [activeButtons, setActiveButtons] =
|
|
8451
|
-
const handlePress =
|
|
8451
|
+
const [activeButtons, setActiveButtons] = React115.useState(/* @__PURE__ */ new Set());
|
|
8452
|
+
const handlePress = React115.useCallback(
|
|
8452
8453
|
(id) => {
|
|
8453
8454
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
8454
8455
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8456,7 +8457,7 @@ function ActionButtons({
|
|
|
8456
8457
|
},
|
|
8457
8458
|
[actionEvent, eventBus, onAction]
|
|
8458
8459
|
);
|
|
8459
|
-
const handleRelease =
|
|
8460
|
+
const handleRelease = React115.useCallback(
|
|
8460
8461
|
(id) => {
|
|
8461
8462
|
setActiveButtons((prev) => {
|
|
8462
8463
|
const next = new Set(prev);
|
|
@@ -8858,13 +8859,13 @@ function getState() {
|
|
|
8858
8859
|
}
|
|
8859
8860
|
return { checks: /* @__PURE__ */ new Map(), transitions: [], bridgeHealth: null, listeners: /* @__PURE__ */ new Set() };
|
|
8860
8861
|
}
|
|
8861
|
-
function
|
|
8862
|
+
function notifyListeners() {
|
|
8862
8863
|
getState().listeners.forEach((l) => l());
|
|
8863
8864
|
exposeOnWindow();
|
|
8864
8865
|
}
|
|
8865
8866
|
function registerCheck(id, label, status = "pending", details) {
|
|
8866
8867
|
getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
|
|
8867
|
-
|
|
8868
|
+
notifyListeners();
|
|
8868
8869
|
}
|
|
8869
8870
|
function getAllChecks() {
|
|
8870
8871
|
return Array.from(getState().checks.values());
|
|
@@ -8909,7 +8910,7 @@ function recordTransition(trace) {
|
|
|
8909
8910
|
failedEffects.map((e) => `${e.type}: ${e.error}`).join("; ")
|
|
8910
8911
|
);
|
|
8911
8912
|
}
|
|
8912
|
-
|
|
8913
|
+
notifyListeners();
|
|
8913
8914
|
}
|
|
8914
8915
|
function getTransitions() {
|
|
8915
8916
|
return [...getState().transitions];
|
|
@@ -8928,7 +8929,7 @@ function getSummary() {
|
|
|
8928
8929
|
pending: allChecks.filter((c) => c.status === "pending").length
|
|
8929
8930
|
};
|
|
8930
8931
|
}
|
|
8931
|
-
function
|
|
8932
|
+
function getSnapshot() {
|
|
8932
8933
|
return {
|
|
8933
8934
|
checks: getAllChecks(),
|
|
8934
8935
|
transitions: getTransitions(),
|
|
@@ -8944,7 +8945,7 @@ function exposeOnWindow() {
|
|
|
8944
8945
|
if (typeof window === "undefined") return;
|
|
8945
8946
|
if (!window.__orbitalVerification) {
|
|
8946
8947
|
window.__orbitalVerification = {
|
|
8947
|
-
getSnapshot
|
|
8948
|
+
getSnapshot,
|
|
8948
8949
|
getChecks: getAllChecks,
|
|
8949
8950
|
getTransitions,
|
|
8950
8951
|
getBridge: getBridgeHealth,
|
|
@@ -10442,9 +10443,9 @@ var init_ScaledDiagram = __esm({
|
|
|
10442
10443
|
}
|
|
10443
10444
|
});
|
|
10444
10445
|
|
|
10445
|
-
// node_modules/.pnpm/katex@0.16.
|
|
10446
|
+
// node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
|
|
10446
10447
|
var init_katex_min = __esm({
|
|
10447
|
-
"node_modules/.pnpm/katex@0.16.
|
|
10448
|
+
"node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
|
|
10448
10449
|
}
|
|
10449
10450
|
});
|
|
10450
10451
|
var MarkdownContent;
|
|
@@ -10454,7 +10455,7 @@ var init_MarkdownContent = __esm({
|
|
|
10454
10455
|
init_Box();
|
|
10455
10456
|
init_useTranslate();
|
|
10456
10457
|
init_cn();
|
|
10457
|
-
MarkdownContent =
|
|
10458
|
+
MarkdownContent = React115__default.memo(
|
|
10458
10459
|
({ content, direction, className }) => {
|
|
10459
10460
|
const { t: _t } = useTranslate();
|
|
10460
10461
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -10671,7 +10672,7 @@ var init_CodeBlock = __esm({
|
|
|
10671
10672
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
10672
10673
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
10673
10674
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
10674
|
-
CodeBlock =
|
|
10675
|
+
CodeBlock = React115__default.memo(
|
|
10675
10676
|
({
|
|
10676
10677
|
code: rawCode,
|
|
10677
10678
|
language = "text",
|
|
@@ -11980,7 +11981,7 @@ var init_StateMachineView = __esm({
|
|
|
11980
11981
|
style: { top: title ? 30 : 0 },
|
|
11981
11982
|
children: [
|
|
11982
11983
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
11983
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
11984
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React115__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
11984
11985
|
StateNode,
|
|
11985
11986
|
{
|
|
11986
11987
|
state,
|
|
@@ -12493,7 +12494,9 @@ function extractTrait(schema, trait, traitIndex) {
|
|
|
12493
12494
|
for (const orbital of schema.orbitals) {
|
|
12494
12495
|
const traits2 = orbital.traits ?? [];
|
|
12495
12496
|
if (traitIndex < traits2.length) {
|
|
12496
|
-
|
|
12497
|
+
const traitRef = traits2[traitIndex];
|
|
12498
|
+
if (isInlineTrait(traitRef)) return traitRef;
|
|
12499
|
+
return null;
|
|
12497
12500
|
}
|
|
12498
12501
|
}
|
|
12499
12502
|
return null;
|
|
@@ -12501,8 +12504,10 @@ function extractTrait(schema, trait, traitIndex) {
|
|
|
12501
12504
|
function extractEntityFields(schema) {
|
|
12502
12505
|
if (!schema?.orbitals?.length) return [];
|
|
12503
12506
|
const entity = schema.orbitals[0].entity;
|
|
12504
|
-
if (!entity
|
|
12505
|
-
|
|
12507
|
+
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12508
|
+
const inlineEntity = entity;
|
|
12509
|
+
if (!inlineEntity.fields) return [];
|
|
12510
|
+
return inlineEntity.fields.map((f3) => f3.name);
|
|
12506
12511
|
}
|
|
12507
12512
|
function toStateMachineDefinition(sm) {
|
|
12508
12513
|
return {
|
|
@@ -12797,12 +12802,18 @@ var init_ContentRenderer = __esm({
|
|
|
12797
12802
|
);
|
|
12798
12803
|
case "orbital": {
|
|
12799
12804
|
const parsed = segment.schema;
|
|
12805
|
+
const inlineTrait = {
|
|
12806
|
+
name: "inline",
|
|
12807
|
+
scope: "instance",
|
|
12808
|
+
stateMachine: parsed
|
|
12809
|
+
};
|
|
12800
12810
|
const schema = Array.isArray(parsed.orbitals) ? parsed : {
|
|
12811
|
+
name: "inline",
|
|
12801
12812
|
orbitals: [{
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12813
|
+
name: "inline",
|
|
12814
|
+
entity: { name: "inline", fields: [] },
|
|
12815
|
+
traits: [inlineTrait],
|
|
12816
|
+
pages: []
|
|
12806
12817
|
}]
|
|
12807
12818
|
};
|
|
12808
12819
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
@@ -17747,7 +17758,7 @@ function CraftingRecipe({
|
|
|
17747
17758
|
className
|
|
17748
17759
|
}) {
|
|
17749
17760
|
const eventBus = useEventBus();
|
|
17750
|
-
const handleCraft =
|
|
17761
|
+
const handleCraft = React115.useCallback(() => {
|
|
17751
17762
|
onCraft?.();
|
|
17752
17763
|
if (craftEvent) {
|
|
17753
17764
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -17764,7 +17775,7 @@ function CraftingRecipe({
|
|
|
17764
17775
|
children: [
|
|
17765
17776
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
17766
17777
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
17767
|
-
return /* @__PURE__ */ jsxs(
|
|
17778
|
+
return /* @__PURE__ */ jsxs(React115.Fragment, { children: [
|
|
17768
17779
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
17769
17780
|
ItemSlot,
|
|
17770
17781
|
{
|
|
@@ -18058,8 +18069,8 @@ function DPad({
|
|
|
18058
18069
|
}) {
|
|
18059
18070
|
const eventBus = useEventBus();
|
|
18060
18071
|
const sizes = sizeMap15[size];
|
|
18061
|
-
const [activeDirections, setActiveDirections] =
|
|
18062
|
-
const handlePress =
|
|
18072
|
+
const [activeDirections, setActiveDirections] = React115.useState(/* @__PURE__ */ new Set());
|
|
18073
|
+
const handlePress = React115.useCallback(
|
|
18063
18074
|
(direction) => {
|
|
18064
18075
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
18065
18076
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -18067,7 +18078,7 @@ function DPad({
|
|
|
18067
18078
|
},
|
|
18068
18079
|
[directionEvent, eventBus, onDirection]
|
|
18069
18080
|
);
|
|
18070
|
-
const handleRelease =
|
|
18081
|
+
const handleRelease = React115.useCallback(
|
|
18071
18082
|
(direction) => {
|
|
18072
18083
|
setActiveDirections((prev) => {
|
|
18073
18084
|
const next = new Set(prev);
|
|
@@ -18934,7 +18945,7 @@ var init_DataList = __esm({
|
|
|
18934
18945
|
}) => {
|
|
18935
18946
|
const eventBus = useEventBus();
|
|
18936
18947
|
const { t } = useTranslate();
|
|
18937
|
-
const [visibleCount, setVisibleCount] =
|
|
18948
|
+
const [visibleCount, setVisibleCount] = React115__default.useState(pageSize || Infinity);
|
|
18938
18949
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
18939
18950
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
18940
18951
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -18971,7 +18982,7 @@ var init_DataList = __esm({
|
|
|
18971
18982
|
const items2 = data.map((item) => item);
|
|
18972
18983
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
18973
18984
|
const contentField = titleField?.name ?? fields[0]?.name ?? "";
|
|
18974
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
18985
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
18975
18986
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
18976
18987
|
group.items.map((itemData, index) => {
|
|
18977
18988
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -19174,7 +19185,7 @@ var init_DataList = __esm({
|
|
|
19174
19185
|
className
|
|
19175
19186
|
),
|
|
19176
19187
|
children: [
|
|
19177
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
19188
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
19178
19189
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
19179
19190
|
group.items.map(
|
|
19180
19191
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -19380,43 +19391,43 @@ function useQuerySingleton(query) {
|
|
|
19380
19391
|
if (!query) {
|
|
19381
19392
|
return null;
|
|
19382
19393
|
}
|
|
19383
|
-
const
|
|
19394
|
+
const store = useMemo(() => getOrCreateStore(query), [query]);
|
|
19384
19395
|
useMemo(() => {
|
|
19385
19396
|
const listener = () => forceUpdate({});
|
|
19386
|
-
|
|
19397
|
+
store.listeners.add(listener);
|
|
19387
19398
|
return () => {
|
|
19388
|
-
|
|
19399
|
+
store.listeners.delete(listener);
|
|
19389
19400
|
};
|
|
19390
|
-
}, [
|
|
19391
|
-
const
|
|
19392
|
-
|
|
19393
|
-
}, [
|
|
19401
|
+
}, [store]);
|
|
19402
|
+
const notifyListeners2 = useCallback(() => {
|
|
19403
|
+
store.listeners.forEach((listener) => listener());
|
|
19404
|
+
}, [store]);
|
|
19394
19405
|
const setSearch = useCallback((value) => {
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
}, [
|
|
19406
|
+
store.search = value;
|
|
19407
|
+
notifyListeners2();
|
|
19408
|
+
}, [store, notifyListeners2]);
|
|
19398
19409
|
const setFilter = useCallback((key, value) => {
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
}, [
|
|
19410
|
+
store.filters = { ...store.filters, [key]: value };
|
|
19411
|
+
notifyListeners2();
|
|
19412
|
+
}, [store, notifyListeners2]);
|
|
19402
19413
|
const clearFilters = useCallback(() => {
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
}, [
|
|
19414
|
+
store.filters = {};
|
|
19415
|
+
store.search = "";
|
|
19416
|
+
notifyListeners2();
|
|
19417
|
+
}, [store, notifyListeners2]);
|
|
19407
19418
|
const setSort = useCallback((field, direction) => {
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
}, [
|
|
19419
|
+
store.sortField = field;
|
|
19420
|
+
store.sortDirection = direction;
|
|
19421
|
+
notifyListeners2();
|
|
19422
|
+
}, [store, notifyListeners2]);
|
|
19412
19423
|
return {
|
|
19413
|
-
search:
|
|
19424
|
+
search: store.search,
|
|
19414
19425
|
setSearch,
|
|
19415
|
-
filters:
|
|
19426
|
+
filters: store.filters,
|
|
19416
19427
|
setFilter,
|
|
19417
19428
|
clearFilters,
|
|
19418
|
-
sortField:
|
|
19419
|
-
sortDirection:
|
|
19429
|
+
sortField: store.sortField,
|
|
19430
|
+
sortDirection: store.sortDirection,
|
|
19420
19431
|
setSort
|
|
19421
19432
|
};
|
|
19422
19433
|
}
|
|
@@ -20427,7 +20438,7 @@ var init_WizardProgress = __esm({
|
|
|
20427
20438
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
20428
20439
|
const isActive = index === currentStep;
|
|
20429
20440
|
const isCompleted = index < currentStep;
|
|
20430
|
-
return /* @__PURE__ */ jsxs(
|
|
20441
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
20431
20442
|
/* @__PURE__ */ jsx(
|
|
20432
20443
|
"button",
|
|
20433
20444
|
{
|
|
@@ -21338,7 +21349,7 @@ function InventoryGrid({
|
|
|
21338
21349
|
const eventBus = useEventBus();
|
|
21339
21350
|
const slotCount = totalSlots ?? items.length;
|
|
21340
21351
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
21341
|
-
const handleSelect =
|
|
21352
|
+
const handleSelect = React115.useCallback(
|
|
21342
21353
|
(id) => {
|
|
21343
21354
|
onSelect?.(id);
|
|
21344
21355
|
if (selectEvent) {
|
|
@@ -21551,15 +21562,15 @@ function GameCanvas2D({
|
|
|
21551
21562
|
fps = 60,
|
|
21552
21563
|
className
|
|
21553
21564
|
}) {
|
|
21554
|
-
const canvasRef =
|
|
21555
|
-
const rafRef =
|
|
21556
|
-
const frameRef =
|
|
21557
|
-
const lastTimeRef =
|
|
21558
|
-
const onDrawRef =
|
|
21565
|
+
const canvasRef = React115.useRef(null);
|
|
21566
|
+
const rafRef = React115.useRef(0);
|
|
21567
|
+
const frameRef = React115.useRef(0);
|
|
21568
|
+
const lastTimeRef = React115.useRef(0);
|
|
21569
|
+
const onDrawRef = React115.useRef(onDraw);
|
|
21559
21570
|
onDrawRef.current = onDraw;
|
|
21560
|
-
const onTickRef =
|
|
21571
|
+
const onTickRef = React115.useRef(onTick);
|
|
21561
21572
|
onTickRef.current = onTick;
|
|
21562
|
-
|
|
21573
|
+
React115.useEffect(() => {
|
|
21563
21574
|
const canvas = canvasRef.current;
|
|
21564
21575
|
if (!canvas) return;
|
|
21565
21576
|
const ctx = canvas.getContext("2d");
|
|
@@ -21848,7 +21859,7 @@ function TurnPanel({
|
|
|
21848
21859
|
className
|
|
21849
21860
|
}) {
|
|
21850
21861
|
const eventBus = useEventBus();
|
|
21851
|
-
const handleAction =
|
|
21862
|
+
const handleAction = React115.useCallback(
|
|
21852
21863
|
(event) => {
|
|
21853
21864
|
if (event) {
|
|
21854
21865
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -21994,7 +22005,7 @@ function UnitCommandBar({
|
|
|
21994
22005
|
className
|
|
21995
22006
|
}) {
|
|
21996
22007
|
const eventBus = useEventBus();
|
|
21997
|
-
const handleCommand =
|
|
22008
|
+
const handleCommand = React115.useCallback(
|
|
21998
22009
|
(event) => {
|
|
21999
22010
|
if (event) {
|
|
22000
22011
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -22479,7 +22490,7 @@ function GameMenu({
|
|
|
22479
22490
|
} catch {
|
|
22480
22491
|
}
|
|
22481
22492
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
22482
|
-
const handleOptionClick =
|
|
22493
|
+
const handleOptionClick = React115.useCallback(
|
|
22483
22494
|
(option) => {
|
|
22484
22495
|
if (option.event && eventBus) {
|
|
22485
22496
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -22593,7 +22604,7 @@ function GameOverScreen({
|
|
|
22593
22604
|
} catch {
|
|
22594
22605
|
}
|
|
22595
22606
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
22596
|
-
const handleActionClick =
|
|
22607
|
+
const handleActionClick = React115.useCallback(
|
|
22597
22608
|
(action) => {
|
|
22598
22609
|
if (action.event && eventBus) {
|
|
22599
22610
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -25697,7 +25708,7 @@ var init_StepFlow = __esm({
|
|
|
25697
25708
|
className
|
|
25698
25709
|
}) => {
|
|
25699
25710
|
if (orientation === "vertical") {
|
|
25700
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
25711
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React115__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
25701
25712
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
25702
25713
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
25703
25714
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -25708,7 +25719,7 @@ var init_StepFlow = __esm({
|
|
|
25708
25719
|
] })
|
|
25709
25720
|
] }) }, index)) });
|
|
25710
25721
|
}
|
|
25711
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(
|
|
25722
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
25712
25723
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
25713
25724
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
25714
25725
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -27820,7 +27831,7 @@ var init_DocumentViewer = __esm({
|
|
|
27820
27831
|
}
|
|
27821
27832
|
});
|
|
27822
27833
|
function extractTitle(children) {
|
|
27823
|
-
if (!
|
|
27834
|
+
if (!React115__default.isValidElement(children)) return void 0;
|
|
27824
27835
|
const props = children.props;
|
|
27825
27836
|
if (typeof props.title === "string") {
|
|
27826
27837
|
return props.title;
|
|
@@ -27875,7 +27886,7 @@ function LinearView({
|
|
|
27875
27886
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27876
27887
|
const isDone = i < currentIdx;
|
|
27877
27888
|
const isCurrent = i === currentIdx;
|
|
27878
|
-
return /* @__PURE__ */ jsxs(
|
|
27889
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
27879
27890
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27880
27891
|
Typography,
|
|
27881
27892
|
{
|
|
@@ -28642,7 +28653,7 @@ var init_Form = __esm({
|
|
|
28642
28653
|
const normalizedInitialData = initialData ?? {};
|
|
28643
28654
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
28644
28655
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
28645
|
-
const entityDerivedFields =
|
|
28656
|
+
const entityDerivedFields = React115__default.useMemo(() => {
|
|
28646
28657
|
if (fields && fields.length > 0) return void 0;
|
|
28647
28658
|
if (!resolvedEntity) return void 0;
|
|
28648
28659
|
return resolvedEntity.fields.map(
|
|
@@ -28661,14 +28672,14 @@ var init_Form = __esm({
|
|
|
28661
28672
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
28662
28673
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
28663
28674
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
28664
|
-
const [formData, setFormData] =
|
|
28675
|
+
const [formData, setFormData] = React115__default.useState(
|
|
28665
28676
|
normalizedInitialData
|
|
28666
28677
|
);
|
|
28667
|
-
const [collapsedSections, setCollapsedSections] =
|
|
28678
|
+
const [collapsedSections, setCollapsedSections] = React115__default.useState(
|
|
28668
28679
|
/* @__PURE__ */ new Set()
|
|
28669
28680
|
);
|
|
28670
28681
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
28671
|
-
const evalContext =
|
|
28682
|
+
const evalContext = React115__default.useMemo(
|
|
28672
28683
|
() => ({
|
|
28673
28684
|
formValues: formData,
|
|
28674
28685
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -28677,13 +28688,13 @@ var init_Form = __esm({
|
|
|
28677
28688
|
}),
|
|
28678
28689
|
[formData, externalContext]
|
|
28679
28690
|
);
|
|
28680
|
-
|
|
28691
|
+
React115__default.useEffect(() => {
|
|
28681
28692
|
const data = initialData;
|
|
28682
28693
|
if (data && Object.keys(data).length > 0) {
|
|
28683
28694
|
setFormData(data);
|
|
28684
28695
|
}
|
|
28685
28696
|
}, [initialData]);
|
|
28686
|
-
const processCalculations =
|
|
28697
|
+
const processCalculations = React115__default.useCallback(
|
|
28687
28698
|
(changedFieldId, newFormData) => {
|
|
28688
28699
|
if (!hiddenCalculations.length) return;
|
|
28689
28700
|
const context = {
|
|
@@ -28708,7 +28719,7 @@ var init_Form = __esm({
|
|
|
28708
28719
|
},
|
|
28709
28720
|
[hiddenCalculations, externalContext, eventBus]
|
|
28710
28721
|
);
|
|
28711
|
-
const checkViolations =
|
|
28722
|
+
const checkViolations = React115__default.useCallback(
|
|
28712
28723
|
(changedFieldId, newFormData) => {
|
|
28713
28724
|
if (!violationTriggers.length) return;
|
|
28714
28725
|
const context = {
|
|
@@ -28745,7 +28756,7 @@ var init_Form = __esm({
|
|
|
28745
28756
|
processCalculations(name, newFormData);
|
|
28746
28757
|
checkViolations(name, newFormData);
|
|
28747
28758
|
};
|
|
28748
|
-
const isFieldVisible =
|
|
28759
|
+
const isFieldVisible = React115__default.useCallback(
|
|
28749
28760
|
(fieldName) => {
|
|
28750
28761
|
const condition = conditionalFields[fieldName];
|
|
28751
28762
|
if (!condition) return true;
|
|
@@ -28753,7 +28764,7 @@ var init_Form = __esm({
|
|
|
28753
28764
|
},
|
|
28754
28765
|
[conditionalFields, evalContext]
|
|
28755
28766
|
);
|
|
28756
|
-
const isSectionVisible =
|
|
28767
|
+
const isSectionVisible = React115__default.useCallback(
|
|
28757
28768
|
(section) => {
|
|
28758
28769
|
if (!section.condition) return true;
|
|
28759
28770
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -28785,7 +28796,7 @@ var init_Form = __esm({
|
|
|
28785
28796
|
eventBus.emit(`UI:${onCancel}`);
|
|
28786
28797
|
}
|
|
28787
28798
|
};
|
|
28788
|
-
const renderField =
|
|
28799
|
+
const renderField = React115__default.useCallback(
|
|
28789
28800
|
(field) => {
|
|
28790
28801
|
const fieldName = field.name || field.field;
|
|
28791
28802
|
if (!fieldName) return null;
|
|
@@ -28806,7 +28817,7 @@ var init_Form = __esm({
|
|
|
28806
28817
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
28807
28818
|
);
|
|
28808
28819
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
28809
|
-
const normalizedFields =
|
|
28820
|
+
const normalizedFields = React115__default.useMemo(() => {
|
|
28810
28821
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
28811
28822
|
return effectiveFields.map((field) => {
|
|
28812
28823
|
if (typeof field === "string") {
|
|
@@ -28828,7 +28839,7 @@ var init_Form = __esm({
|
|
|
28828
28839
|
return field;
|
|
28829
28840
|
});
|
|
28830
28841
|
}, [effectiveFields, resolvedEntity]);
|
|
28831
|
-
const schemaFields =
|
|
28842
|
+
const schemaFields = React115__default.useMemo(() => {
|
|
28832
28843
|
if (normalizedFields.length === 0) return null;
|
|
28833
28844
|
if (isDebugEnabled()) {
|
|
28834
28845
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -28838,7 +28849,7 @@ var init_Form = __esm({
|
|
|
28838
28849
|
}
|
|
28839
28850
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
28840
28851
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
28841
|
-
const sectionElements =
|
|
28852
|
+
const sectionElements = React115__default.useMemo(() => {
|
|
28842
28853
|
if (!sections || sections.length === 0) return null;
|
|
28843
28854
|
return sections.map((section) => {
|
|
28844
28855
|
if (!isSectionVisible(section)) {
|
|
@@ -30335,7 +30346,7 @@ var init_List = __esm({
|
|
|
30335
30346
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
30336
30347
|
return [];
|
|
30337
30348
|
}, [entity]);
|
|
30338
|
-
const getItemActions =
|
|
30349
|
+
const getItemActions = React115__default.useCallback(
|
|
30339
30350
|
(item) => {
|
|
30340
30351
|
if (!itemActions) return [];
|
|
30341
30352
|
if (typeof itemActions === "function") {
|
|
@@ -30782,7 +30793,7 @@ var init_MediaGallery = __esm({
|
|
|
30782
30793
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
30783
30794
|
);
|
|
30784
30795
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30785
|
-
const items =
|
|
30796
|
+
const items = React115__default.useMemo(() => {
|
|
30786
30797
|
if (propItems) return propItems;
|
|
30787
30798
|
if (entityData.length === 0) return [];
|
|
30788
30799
|
return entityData.map((record, idx) => ({
|
|
@@ -30946,7 +30957,7 @@ var init_MediaGallery = __esm({
|
|
|
30946
30957
|
}
|
|
30947
30958
|
});
|
|
30948
30959
|
function extractTitle2(children) {
|
|
30949
|
-
if (!
|
|
30960
|
+
if (!React115__default.isValidElement(children)) return void 0;
|
|
30950
30961
|
const props = children.props;
|
|
30951
30962
|
if (typeof props.title === "string") {
|
|
30952
30963
|
return props.title;
|
|
@@ -31659,7 +31670,7 @@ var init_PageHeader = __esm({
|
|
|
31659
31670
|
info: "bg-info/10 text-info"
|
|
31660
31671
|
};
|
|
31661
31672
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
31662
|
-
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(
|
|
31673
|
+
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(React115__default.Fragment, { children: [
|
|
31663
31674
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
31664
31675
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
31665
31676
|
"a",
|
|
@@ -31833,7 +31844,7 @@ var init_debugRegistry = __esm({
|
|
|
31833
31844
|
}
|
|
31834
31845
|
});
|
|
31835
31846
|
function useDebugData() {
|
|
31836
|
-
const [data, setData] =
|
|
31847
|
+
const [data, setData] = React115.useState(() => ({
|
|
31837
31848
|
traits: [],
|
|
31838
31849
|
ticks: [],
|
|
31839
31850
|
guards: [],
|
|
@@ -31847,7 +31858,7 @@ function useDebugData() {
|
|
|
31847
31858
|
},
|
|
31848
31859
|
lastUpdate: Date.now()
|
|
31849
31860
|
}));
|
|
31850
|
-
|
|
31861
|
+
React115.useEffect(() => {
|
|
31851
31862
|
const updateData = () => {
|
|
31852
31863
|
setData({
|
|
31853
31864
|
traits: getAllTraits(),
|
|
@@ -31956,12 +31967,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
31956
31967
|
return positions;
|
|
31957
31968
|
}
|
|
31958
31969
|
function WalkMinimap() {
|
|
31959
|
-
const [walkStep, setWalkStep] =
|
|
31960
|
-
const [traits2, setTraits] =
|
|
31961
|
-
const [coveredEdges, setCoveredEdges] =
|
|
31962
|
-
const [completedTraits, setCompletedTraits] =
|
|
31963
|
-
const prevTraitRef =
|
|
31964
|
-
|
|
31970
|
+
const [walkStep, setWalkStep] = React115.useState(null);
|
|
31971
|
+
const [traits2, setTraits] = React115.useState([]);
|
|
31972
|
+
const [coveredEdges, setCoveredEdges] = React115.useState([]);
|
|
31973
|
+
const [completedTraits, setCompletedTraits] = React115.useState(/* @__PURE__ */ new Set());
|
|
31974
|
+
const prevTraitRef = React115.useRef(null);
|
|
31975
|
+
React115.useEffect(() => {
|
|
31965
31976
|
const interval = setInterval(() => {
|
|
31966
31977
|
const w = window;
|
|
31967
31978
|
const step = w.__orbitalWalkStep;
|
|
@@ -32408,15 +32419,15 @@ var init_EntitiesTab = __esm({
|
|
|
32408
32419
|
}
|
|
32409
32420
|
});
|
|
32410
32421
|
function EventFlowTab({ events: events2 }) {
|
|
32411
|
-
const [filter, setFilter] =
|
|
32412
|
-
const containerRef =
|
|
32413
|
-
const [autoScroll, setAutoScroll] =
|
|
32414
|
-
|
|
32422
|
+
const [filter, setFilter] = React115.useState("all");
|
|
32423
|
+
const containerRef = React115.useRef(null);
|
|
32424
|
+
const [autoScroll, setAutoScroll] = React115.useState(true);
|
|
32425
|
+
React115.useEffect(() => {
|
|
32415
32426
|
if (autoScroll && containerRef.current) {
|
|
32416
32427
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
32417
32428
|
}
|
|
32418
32429
|
}, [events2.length, autoScroll]);
|
|
32419
|
-
const filteredEvents =
|
|
32430
|
+
const filteredEvents = React115.useMemo(() => {
|
|
32420
32431
|
if (filter === "all") return events2;
|
|
32421
32432
|
return events2.filter((e) => e.type === filter);
|
|
32422
32433
|
}, [events2, filter]);
|
|
@@ -32535,7 +32546,7 @@ var init_EventFlowTab = __esm({
|
|
|
32535
32546
|
}
|
|
32536
32547
|
});
|
|
32537
32548
|
function GuardsPanel({ guards }) {
|
|
32538
|
-
const [filter, setFilter] =
|
|
32549
|
+
const [filter, setFilter] = React115.useState("all");
|
|
32539
32550
|
if (guards.length === 0) {
|
|
32540
32551
|
return /* @__PURE__ */ jsx(
|
|
32541
32552
|
EmptyState,
|
|
@@ -32548,7 +32559,7 @@ function GuardsPanel({ guards }) {
|
|
|
32548
32559
|
}
|
|
32549
32560
|
const passedCount = guards.filter((g) => g.result).length;
|
|
32550
32561
|
const failedCount = guards.length - passedCount;
|
|
32551
|
-
const filteredGuards =
|
|
32562
|
+
const filteredGuards = React115.useMemo(() => {
|
|
32552
32563
|
if (filter === "all") return guards;
|
|
32553
32564
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
32554
32565
|
return guards.filter((g) => !g.result);
|
|
@@ -32709,10 +32720,10 @@ function EffectBadge({ effect }) {
|
|
|
32709
32720
|
] });
|
|
32710
32721
|
}
|
|
32711
32722
|
function TransitionTimeline({ transitions }) {
|
|
32712
|
-
const containerRef =
|
|
32713
|
-
const [autoScroll, setAutoScroll] =
|
|
32714
|
-
const [expandedId, setExpandedId] =
|
|
32715
|
-
|
|
32723
|
+
const containerRef = React115.useRef(null);
|
|
32724
|
+
const [autoScroll, setAutoScroll] = React115.useState(true);
|
|
32725
|
+
const [expandedId, setExpandedId] = React115.useState(null);
|
|
32726
|
+
React115.useEffect(() => {
|
|
32716
32727
|
if (autoScroll && containerRef.current) {
|
|
32717
32728
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
32718
32729
|
}
|
|
@@ -32998,9 +33009,9 @@ function getAllEvents(traits2) {
|
|
|
32998
33009
|
}
|
|
32999
33010
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
33000
33011
|
const eventBus = useEventBus();
|
|
33001
|
-
const [log4, setLog] =
|
|
33002
|
-
const prevStatesRef =
|
|
33003
|
-
|
|
33012
|
+
const [log4, setLog] = React115.useState([]);
|
|
33013
|
+
const prevStatesRef = React115.useRef(/* @__PURE__ */ new Map());
|
|
33014
|
+
React115.useEffect(() => {
|
|
33004
33015
|
for (const trait of traits2) {
|
|
33005
33016
|
const prev = prevStatesRef.current.get(trait.id);
|
|
33006
33017
|
if (prev && prev !== trait.currentState) {
|
|
@@ -33170,10 +33181,10 @@ function VerifyModePanel({
|
|
|
33170
33181
|
serverCount,
|
|
33171
33182
|
localCount
|
|
33172
33183
|
}) {
|
|
33173
|
-
const [expanded, setExpanded] =
|
|
33174
|
-
const scrollRef =
|
|
33175
|
-
const prevCountRef =
|
|
33176
|
-
|
|
33184
|
+
const [expanded, setExpanded] = React115.useState(true);
|
|
33185
|
+
const scrollRef = React115.useRef(null);
|
|
33186
|
+
const prevCountRef = React115.useRef(0);
|
|
33187
|
+
React115.useEffect(() => {
|
|
33177
33188
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
33178
33189
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
33179
33190
|
}
|
|
@@ -33239,10 +33250,10 @@ function RuntimeDebugger({
|
|
|
33239
33250
|
defaultTab,
|
|
33240
33251
|
schema
|
|
33241
33252
|
}) {
|
|
33242
|
-
const [isCollapsed, setIsCollapsed] =
|
|
33243
|
-
const [isVisible, setIsVisible] =
|
|
33253
|
+
const [isCollapsed, setIsCollapsed] = React115.useState(mode === "verify" ? true : defaultCollapsed);
|
|
33254
|
+
const [isVisible, setIsVisible] = React115.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
33244
33255
|
const debugData = useDebugData();
|
|
33245
|
-
|
|
33256
|
+
React115.useEffect(() => {
|
|
33246
33257
|
if (mode === "inline") return;
|
|
33247
33258
|
return onDebugToggle((enabled) => {
|
|
33248
33259
|
setIsVisible(enabled);
|
|
@@ -33251,7 +33262,7 @@ function RuntimeDebugger({
|
|
|
33251
33262
|
}
|
|
33252
33263
|
});
|
|
33253
33264
|
}, [mode]);
|
|
33254
|
-
|
|
33265
|
+
React115.useEffect(() => {
|
|
33255
33266
|
if (mode === "inline") return;
|
|
33256
33267
|
const handleKeyDown = (e) => {
|
|
33257
33268
|
if (e.key === "`" && isVisible) {
|
|
@@ -33800,7 +33811,7 @@ function SequenceBar({
|
|
|
33800
33811
|
onSlotRemove(index);
|
|
33801
33812
|
}, [onSlotRemove, playing]);
|
|
33802
33813
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
33803
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
33814
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
33804
33815
|
i > 0 && /* @__PURE__ */ jsx(
|
|
33805
33816
|
Typography,
|
|
33806
33817
|
{
|
|
@@ -35145,7 +35156,7 @@ var init_StatCard2 = __esm({
|
|
|
35145
35156
|
const labelToUse = propLabel ?? propTitle;
|
|
35146
35157
|
const eventBus = useEventBus();
|
|
35147
35158
|
const { t } = useTranslate();
|
|
35148
|
-
const handleActionClick =
|
|
35159
|
+
const handleActionClick = React115__default.useCallback(() => {
|
|
35149
35160
|
if (action?.event) {
|
|
35150
35161
|
eventBus.emit(`UI:${action.event}`, {});
|
|
35151
35162
|
}
|
|
@@ -35156,7 +35167,7 @@ var init_StatCard2 = __esm({
|
|
|
35156
35167
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
35157
35168
|
const isLoading = externalLoading ?? false;
|
|
35158
35169
|
const error = externalError;
|
|
35159
|
-
const computeMetricValue =
|
|
35170
|
+
const computeMetricValue = React115__default.useCallback(
|
|
35160
35171
|
(metric, items) => {
|
|
35161
35172
|
if (metric.value !== void 0) {
|
|
35162
35173
|
return metric.value;
|
|
@@ -35195,7 +35206,7 @@ var init_StatCard2 = __esm({
|
|
|
35195
35206
|
},
|
|
35196
35207
|
[]
|
|
35197
35208
|
);
|
|
35198
|
-
const schemaStats =
|
|
35209
|
+
const schemaStats = React115__default.useMemo(() => {
|
|
35199
35210
|
if (!metrics || metrics.length === 0) return null;
|
|
35200
35211
|
return metrics.map((metric) => ({
|
|
35201
35212
|
label: metric.label,
|
|
@@ -35203,7 +35214,7 @@ var init_StatCard2 = __esm({
|
|
|
35203
35214
|
format: metric.format
|
|
35204
35215
|
}));
|
|
35205
35216
|
}, [metrics, data, computeMetricValue]);
|
|
35206
|
-
const calculatedTrend =
|
|
35217
|
+
const calculatedTrend = React115__default.useMemo(() => {
|
|
35207
35218
|
if (manualTrend !== void 0) return manualTrend;
|
|
35208
35219
|
if (previousValue === void 0 || currentValue === void 0)
|
|
35209
35220
|
return void 0;
|
|
@@ -36187,7 +36198,7 @@ var init_Timeline = __esm({
|
|
|
36187
36198
|
}) => {
|
|
36188
36199
|
const { t } = useTranslate();
|
|
36189
36200
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
36190
|
-
const items =
|
|
36201
|
+
const items = React115__default.useMemo(() => {
|
|
36191
36202
|
if (propItems) return propItems;
|
|
36192
36203
|
if (entityData.length === 0) return [];
|
|
36193
36204
|
return entityData.map((record, idx) => {
|
|
@@ -36291,7 +36302,7 @@ var init_Timeline = __esm({
|
|
|
36291
36302
|
}
|
|
36292
36303
|
});
|
|
36293
36304
|
function extractToastProps(children) {
|
|
36294
|
-
if (!
|
|
36305
|
+
if (!React115__default.isValidElement(children)) {
|
|
36295
36306
|
if (typeof children === "string") {
|
|
36296
36307
|
return { message: children };
|
|
36297
36308
|
}
|
|
@@ -36329,7 +36340,7 @@ var init_ToastSlot = __esm({
|
|
|
36329
36340
|
eventBus.emit("UI:CLOSE");
|
|
36330
36341
|
};
|
|
36331
36342
|
if (!isVisible) return null;
|
|
36332
|
-
const isCustomContent =
|
|
36343
|
+
const isCustomContent = React115__default.isValidElement(children) && !message;
|
|
36333
36344
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
36334
36345
|
Toast,
|
|
36335
36346
|
{
|
|
@@ -36598,7 +36609,7 @@ var init_WizardContainer = __esm({
|
|
|
36598
36609
|
const isCompleted = index < currentStep;
|
|
36599
36610
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36600
36611
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36601
|
-
return /* @__PURE__ */ jsxs(
|
|
36612
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
36602
36613
|
/* @__PURE__ */ jsx(
|
|
36603
36614
|
Button,
|
|
36604
36615
|
{
|
|
@@ -36980,12 +36991,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
36980
36991
|
}
|
|
36981
36992
|
});
|
|
36982
36993
|
function lazyThree(name, loader) {
|
|
36983
|
-
const Lazy =
|
|
36994
|
+
const Lazy = React115__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
36984
36995
|
function ThreeWrapper(props) {
|
|
36985
|
-
return
|
|
36986
|
-
|
|
36996
|
+
return React115__default.createElement(
|
|
36997
|
+
React115__default.Suspense,
|
|
36987
36998
|
{ fallback: null },
|
|
36988
|
-
|
|
36999
|
+
React115__default.createElement(Lazy, props)
|
|
36989
37000
|
);
|
|
36990
37001
|
}
|
|
36991
37002
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -37473,7 +37484,7 @@ function SuspenseConfigProvider({
|
|
|
37473
37484
|
config,
|
|
37474
37485
|
children
|
|
37475
37486
|
}) {
|
|
37476
|
-
return
|
|
37487
|
+
return React115__default.createElement(
|
|
37477
37488
|
SuspenseConfigContext.Provider,
|
|
37478
37489
|
{ value: config },
|
|
37479
37490
|
children
|
|
@@ -37903,7 +37914,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
37903
37914
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
37904
37915
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
37905
37916
|
}
|
|
37906
|
-
return /* @__PURE__ */ jsx(
|
|
37917
|
+
return /* @__PURE__ */ jsx(React115__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
37907
37918
|
}
|
|
37908
37919
|
if (!child || typeof child !== "object") return null;
|
|
37909
37920
|
const childId = `${parentId}-${index}`;
|
|
@@ -37956,19 +37967,15 @@ function SlotContentRenderer({
|
|
|
37956
37967
|
patternPath
|
|
37957
37968
|
}) {
|
|
37958
37969
|
const entityProp = content.props.entity;
|
|
37959
|
-
|
|
37960
|
-
|
|
37961
|
-
|
|
37962
|
-
|
|
37963
|
-
|
|
37964
|
-
|
|
37965
|
-
|
|
37966
|
-
console.warn(
|
|
37967
|
-
`[UISlotRenderer] String-entity binding '${entityType}' is deprecated. Pass 'items' or 'entity' as a value prop resolved from @payload.data. See docs/Almadar_Entity_V2_Plan.md \xA75.`
|
|
37968
|
-
);
|
|
37969
|
-
}, [entityType]);
|
|
37970
|
+
if (typeof entityProp === "string" && entityProp.length > 0) {
|
|
37971
|
+
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
|
|
37972
|
+
throw new Error(
|
|
37973
|
+
`[UISlotRenderer] Received string 'entity: "${entityProp}"' at render time. The V2 flow requires pre-resolved data; declare a fetch success listener and pass 'entity: @payload.data'. See docs/Almadar_Entity_V2_Plan.md \xA76.`
|
|
37974
|
+
);
|
|
37975
|
+
}
|
|
37976
|
+
}
|
|
37970
37977
|
const schemaCtx = useEntitySchemaOptional();
|
|
37971
|
-
const entityDef =
|
|
37978
|
+
const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
|
|
37972
37979
|
const PatternComponent = getComponentForPattern(content.pattern);
|
|
37973
37980
|
if (PatternComponent) {
|
|
37974
37981
|
const childrenConfig = content.props.children;
|
|
@@ -37977,15 +37984,10 @@ function SlotContentRenderer({
|
|
|
37977
37984
|
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
|
|
37978
37985
|
const { children: _childrenConfig, ...restProps } = content.props;
|
|
37979
37986
|
const renderedProps = renderPatternProps(restProps, onDismiss);
|
|
37980
|
-
|
|
37981
|
-
const resolvedItems = Array.isArray(
|
|
37982
|
-
|
|
37983
|
-
|
|
37984
|
-
} else if (Array.isArray(renderedProps.items)) {
|
|
37985
|
-
finalProps = { ...renderedProps, entity: renderedProps.items };
|
|
37986
|
-
} else {
|
|
37987
|
-
finalProps = renderedProps;
|
|
37988
|
-
}
|
|
37987
|
+
const finalProps = renderedProps;
|
|
37988
|
+
const resolvedItems = Array.isArray(
|
|
37989
|
+
finalProps.entity
|
|
37990
|
+
) ? finalProps.entity : null;
|
|
37989
37991
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
37990
37992
|
const sample = resolvedItems[0];
|
|
37991
37993
|
if (sample && typeof sample === "object") {
|
|
@@ -37996,9 +37998,6 @@ function SlotContentRenderer({
|
|
|
37996
37998
|
const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
|
|
37997
37999
|
if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
|
|
37998
38000
|
finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
|
|
37999
|
-
if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
|
|
38000
|
-
finalProps.initialData = storeData[0];
|
|
38001
|
-
}
|
|
38002
38001
|
}
|
|
38003
38002
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
38004
38003
|
return /* @__PURE__ */ jsx(
|
|
@@ -38092,7 +38091,7 @@ function UISlotRenderer({
|
|
|
38092
38091
|
}
|
|
38093
38092
|
return wrapped;
|
|
38094
38093
|
}
|
|
38095
|
-
var TRAIT_BINDING_RE,
|
|
38094
|
+
var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
38096
38095
|
var init_UISlotRenderer = __esm({
|
|
38097
38096
|
"components/organisms/UISlotRenderer.tsx"() {
|
|
38098
38097
|
"use client";
|
|
@@ -38109,7 +38108,6 @@ var init_UISlotRenderer = __esm({
|
|
|
38109
38108
|
init_TraitFrame();
|
|
38110
38109
|
init_component_registry_generated();
|
|
38111
38110
|
TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
|
|
38112
|
-
STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
|
|
38113
38111
|
SuspenseConfigContext = createContext({ enabled: false });
|
|
38114
38112
|
SlotContainedContext = createContext(false);
|
|
38115
38113
|
SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
|
|
@@ -38159,177 +38157,6 @@ var init_UISlotRenderer = __esm({
|
|
|
38159
38157
|
// providers/OrbitalProvider.tsx
|
|
38160
38158
|
init_ThemeContext();
|
|
38161
38159
|
|
|
38162
|
-
// providers/EntityStoreProvider.tsx
|
|
38163
|
-
init_logger();
|
|
38164
|
-
var storeLog = createLogger("almadar:entity:store");
|
|
38165
|
-
var store = /* @__PURE__ */ new Map();
|
|
38166
|
-
var storeListeners = /* @__PURE__ */ new Set();
|
|
38167
|
-
var watchCallbacks = /* @__PURE__ */ new Map();
|
|
38168
|
-
function extractId(record) {
|
|
38169
|
-
const r = record;
|
|
38170
|
-
return String(r.id ?? r._id ?? r.key ?? "");
|
|
38171
|
-
}
|
|
38172
|
-
function materialize(snap) {
|
|
38173
|
-
return snap.ids.map((id) => snap.entities.get(id));
|
|
38174
|
-
}
|
|
38175
|
-
function notifyListeners(entityType, prev) {
|
|
38176
|
-
for (const listener of storeListeners) {
|
|
38177
|
-
listener();
|
|
38178
|
-
}
|
|
38179
|
-
const cbs = watchCallbacks.get(entityType);
|
|
38180
|
-
if (cbs) {
|
|
38181
|
-
const oldData = prev ? materialize(prev) : [];
|
|
38182
|
-
const cur = store.get(entityType);
|
|
38183
|
-
const newData = cur ? materialize(cur) : [];
|
|
38184
|
-
for (const cb of cbs) {
|
|
38185
|
-
try {
|
|
38186
|
-
cb(oldData, newData);
|
|
38187
|
-
} catch {
|
|
38188
|
-
}
|
|
38189
|
-
}
|
|
38190
|
-
}
|
|
38191
|
-
}
|
|
38192
|
-
function setAll(entityType, records) {
|
|
38193
|
-
const entities = /* @__PURE__ */ new Map();
|
|
38194
|
-
const ids = [];
|
|
38195
|
-
for (const r of records) {
|
|
38196
|
-
const rec = r;
|
|
38197
|
-
const id = extractId(rec);
|
|
38198
|
-
if (id) {
|
|
38199
|
-
entities.set(id, rec);
|
|
38200
|
-
ids.push(id);
|
|
38201
|
-
}
|
|
38202
|
-
}
|
|
38203
|
-
const prev = store.get(entityType);
|
|
38204
|
-
const newVersion = (prev?.version ?? 0) + 1;
|
|
38205
|
-
store.set(entityType, { entities, ids, version: newVersion });
|
|
38206
|
-
storeLog.debug("setAll", { entityType, recordCount: records.length, version: newVersion });
|
|
38207
|
-
notifyListeners(entityType, prev);
|
|
38208
|
-
}
|
|
38209
|
-
function upsertOne(entityType, record) {
|
|
38210
|
-
const id = extractId(record);
|
|
38211
|
-
if (!id) return;
|
|
38212
|
-
const prev = store.get(entityType);
|
|
38213
|
-
const snapshot = prev ? { entities: new Map(prev.entities), ids: [...prev.ids], version: prev.version } : { entities: /* @__PURE__ */ new Map(), ids: [], version: 0 };
|
|
38214
|
-
snapshot.entities.set(id, record);
|
|
38215
|
-
if (!snapshot.ids.includes(id)) snapshot.ids.push(id);
|
|
38216
|
-
snapshot.version++;
|
|
38217
|
-
store.set(entityType, snapshot);
|
|
38218
|
-
storeLog.debug("upsertOne", { entityType, id, version: snapshot.version });
|
|
38219
|
-
notifyListeners(entityType, prev);
|
|
38220
|
-
}
|
|
38221
|
-
function addOne(entityType, record) {
|
|
38222
|
-
upsertOne(entityType, record);
|
|
38223
|
-
}
|
|
38224
|
-
function updateOne(entityType, id, changes) {
|
|
38225
|
-
const prev = store.get(entityType);
|
|
38226
|
-
if (!prev?.entities.has(id)) return;
|
|
38227
|
-
const snapshot = {
|
|
38228
|
-
entities: new Map(prev.entities),
|
|
38229
|
-
ids: [...prev.ids],
|
|
38230
|
-
version: prev.version
|
|
38231
|
-
};
|
|
38232
|
-
snapshot.entities.set(id, { ...snapshot.entities.get(id), ...changes });
|
|
38233
|
-
snapshot.version++;
|
|
38234
|
-
store.set(entityType, snapshot);
|
|
38235
|
-
storeLog.debug("updateOne", { entityType, id, changedFields: Object.keys(changes), version: snapshot.version });
|
|
38236
|
-
notifyListeners(entityType, prev);
|
|
38237
|
-
}
|
|
38238
|
-
function removeOne(entityType, id) {
|
|
38239
|
-
const prev = store.get(entityType);
|
|
38240
|
-
if (!prev) return;
|
|
38241
|
-
const snapshot = {
|
|
38242
|
-
entities: new Map(prev.entities),
|
|
38243
|
-
ids: prev.ids.filter((i) => i !== id),
|
|
38244
|
-
version: prev.version
|
|
38245
|
-
};
|
|
38246
|
-
snapshot.entities.delete(id);
|
|
38247
|
-
snapshot.version++;
|
|
38248
|
-
store.set(entityType, snapshot);
|
|
38249
|
-
storeLog.debug("removeOne", { entityType, id, remainingCount: snapshot.ids.length, version: snapshot.version });
|
|
38250
|
-
notifyListeners(entityType, prev);
|
|
38251
|
-
}
|
|
38252
|
-
function getSnapshot(entityType) {
|
|
38253
|
-
const snap = store.get(entityType);
|
|
38254
|
-
if (!snap) return [];
|
|
38255
|
-
return materialize(snap);
|
|
38256
|
-
}
|
|
38257
|
-
function getById(entityType, id) {
|
|
38258
|
-
return store.get(entityType)?.entities.get(id) ?? null;
|
|
38259
|
-
}
|
|
38260
|
-
function getVersion(entityType) {
|
|
38261
|
-
return store.get(entityType)?.version ?? 0;
|
|
38262
|
-
}
|
|
38263
|
-
function subscribeToStore(listener) {
|
|
38264
|
-
storeListeners.add(listener);
|
|
38265
|
-
return () => {
|
|
38266
|
-
storeListeners.delete(listener);
|
|
38267
|
-
};
|
|
38268
|
-
}
|
|
38269
|
-
function addWatch(entityType, callback) {
|
|
38270
|
-
let cbs = watchCallbacks.get(entityType);
|
|
38271
|
-
if (!cbs) {
|
|
38272
|
-
cbs = /* @__PURE__ */ new Set();
|
|
38273
|
-
watchCallbacks.set(entityType, cbs);
|
|
38274
|
-
}
|
|
38275
|
-
cbs.add(callback);
|
|
38276
|
-
return () => {
|
|
38277
|
-
cbs.delete(callback);
|
|
38278
|
-
};
|
|
38279
|
-
}
|
|
38280
|
-
function useEntityRef(entityType) {
|
|
38281
|
-
const versionRef = useRef(0);
|
|
38282
|
-
const dataRef = useRef([]);
|
|
38283
|
-
const getSnapshotStable = React116__default.useCallback(() => {
|
|
38284
|
-
const currentVersion = getVersion(entityType);
|
|
38285
|
-
if (currentVersion !== versionRef.current) {
|
|
38286
|
-
versionRef.current = currentVersion;
|
|
38287
|
-
dataRef.current = getSnapshot(entityType);
|
|
38288
|
-
}
|
|
38289
|
-
return dataRef.current;
|
|
38290
|
-
}, [entityType]);
|
|
38291
|
-
return useSyncExternalStore(subscribeToStore, getSnapshotStable, () => []);
|
|
38292
|
-
}
|
|
38293
|
-
function useEntityById(entityType, id) {
|
|
38294
|
-
const versionRef = useRef(0);
|
|
38295
|
-
const dataRef = useRef(null);
|
|
38296
|
-
const getSnapshotStable = React116__default.useCallback(() => {
|
|
38297
|
-
if (!id) return null;
|
|
38298
|
-
const currentVersion = getVersion(entityType);
|
|
38299
|
-
if (currentVersion !== versionRef.current) {
|
|
38300
|
-
versionRef.current = currentVersion;
|
|
38301
|
-
dataRef.current = getById(entityType, id);
|
|
38302
|
-
}
|
|
38303
|
-
return dataRef.current;
|
|
38304
|
-
}, [entityType, id]);
|
|
38305
|
-
return useSyncExternalStore(subscribeToStore, getSnapshotStable, () => null);
|
|
38306
|
-
}
|
|
38307
|
-
function useEntityWatch(entityType, callback) {
|
|
38308
|
-
const callbackRef = useRef(callback);
|
|
38309
|
-
callbackRef.current = callback;
|
|
38310
|
-
useEffect(() => {
|
|
38311
|
-
return addWatch(entityType, (oldData, newData) => {
|
|
38312
|
-
callbackRef.current(oldData, newData);
|
|
38313
|
-
});
|
|
38314
|
-
}, [entityType]);
|
|
38315
|
-
}
|
|
38316
|
-
var contextValue = {
|
|
38317
|
-
setAll,
|
|
38318
|
-
upsertOne,
|
|
38319
|
-
addOne,
|
|
38320
|
-
updateOne,
|
|
38321
|
-
removeOne,
|
|
38322
|
-
getSnapshot,
|
|
38323
|
-
getById
|
|
38324
|
-
};
|
|
38325
|
-
var EntityStoreContext = createContext(contextValue);
|
|
38326
|
-
function useEntityStore() {
|
|
38327
|
-
return useContext(EntityStoreContext);
|
|
38328
|
-
}
|
|
38329
|
-
function EntityStoreProvider({ children }) {
|
|
38330
|
-
return /* @__PURE__ */ jsx(EntityStoreContext.Provider, { value: contextValue, children });
|
|
38331
|
-
}
|
|
38332
|
-
|
|
38333
38160
|
// providers/EventBusProvider.tsx
|
|
38334
38161
|
init_useEventBus();
|
|
38335
38162
|
init_logger();
|
|
@@ -38436,7 +38263,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
38436
38263
|
}
|
|
38437
38264
|
};
|
|
38438
38265
|
}, [debug2]);
|
|
38439
|
-
const
|
|
38266
|
+
const contextValue = useMemo(
|
|
38440
38267
|
() => ({
|
|
38441
38268
|
emit,
|
|
38442
38269
|
on,
|
|
@@ -38449,12 +38276,12 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
38449
38276
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
38450
38277
|
);
|
|
38451
38278
|
useEffect(() => {
|
|
38452
|
-
setGlobalEventBus(
|
|
38279
|
+
setGlobalEventBus(contextValue);
|
|
38453
38280
|
return () => {
|
|
38454
38281
|
setGlobalEventBus(null);
|
|
38455
38282
|
};
|
|
38456
|
-
}, [
|
|
38457
|
-
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value:
|
|
38283
|
+
}, [contextValue]);
|
|
38284
|
+
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
38458
38285
|
}
|
|
38459
38286
|
|
|
38460
38287
|
// providers/SelectionProvider.tsx
|
|
@@ -38527,13 +38354,13 @@ function SelectionProvider({
|
|
|
38527
38354
|
unsubCancel();
|
|
38528
38355
|
};
|
|
38529
38356
|
}, [eventBus, setSelected, clearSelection, debug2]);
|
|
38530
|
-
const
|
|
38357
|
+
const contextValue = {
|
|
38531
38358
|
selected,
|
|
38532
38359
|
setSelected,
|
|
38533
38360
|
clearSelection,
|
|
38534
38361
|
isSelected
|
|
38535
38362
|
};
|
|
38536
|
-
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value:
|
|
38363
|
+
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue, children });
|
|
38537
38364
|
}
|
|
38538
38365
|
function useSelection() {
|
|
38539
38366
|
const context = useContext(SelectionContext);
|
|
@@ -38750,7 +38577,7 @@ function OrbitalProvider({
|
|
|
38750
38577
|
() => ({ enabled: suspense }),
|
|
38751
38578
|
[suspense]
|
|
38752
38579
|
);
|
|
38753
|
-
const inner = /* @__PURE__ */ jsx(
|
|
38580
|
+
const inner = /* @__PURE__ */ jsx(EventBusProvider, { debug: debug2, children: /* @__PURE__ */ jsx(VerificationProvider, { enabled: verification, children: /* @__PURE__ */ jsx(SelectionProvider, { debug: debug2, children: /* @__PURE__ */ jsx(SuspenseConfigProvider, { config: suspenseConfig, children }) }) }) });
|
|
38754
38581
|
if (skipTheme) {
|
|
38755
38582
|
return inner;
|
|
38756
38583
|
}
|
|
@@ -38783,7 +38610,7 @@ function FetchedDataProvider({
|
|
|
38783
38610
|
},
|
|
38784
38611
|
[state.data]
|
|
38785
38612
|
);
|
|
38786
|
-
const
|
|
38613
|
+
const getById = useCallback(
|
|
38787
38614
|
(entityName, id) => {
|
|
38788
38615
|
const records = state.data[entityName];
|
|
38789
38616
|
return records?.find((r) => r.id === id);
|
|
@@ -38847,10 +38674,10 @@ function FetchedDataProvider({
|
|
|
38847
38674
|
const setError = useCallback((error) => {
|
|
38848
38675
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
38849
38676
|
}, []);
|
|
38850
|
-
const
|
|
38677
|
+
const contextValue = useMemo(
|
|
38851
38678
|
() => ({
|
|
38852
38679
|
getData,
|
|
38853
|
-
getById
|
|
38680
|
+
getById,
|
|
38854
38681
|
hasData,
|
|
38855
38682
|
getFetchedAt,
|
|
38856
38683
|
setData,
|
|
@@ -38863,7 +38690,7 @@ function FetchedDataProvider({
|
|
|
38863
38690
|
}),
|
|
38864
38691
|
[
|
|
38865
38692
|
getData,
|
|
38866
|
-
|
|
38693
|
+
getById,
|
|
38867
38694
|
hasData,
|
|
38868
38695
|
getFetchedAt,
|
|
38869
38696
|
setData,
|
|
@@ -38875,7 +38702,7 @@ function FetchedDataProvider({
|
|
|
38875
38702
|
setError
|
|
38876
38703
|
]
|
|
38877
38704
|
);
|
|
38878
|
-
return /* @__PURE__ */ jsx(FetchedDataContext.Provider, { value:
|
|
38705
|
+
return /* @__PURE__ */ jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
38879
38706
|
}
|
|
38880
38707
|
function useFetchedDataContext() {
|
|
38881
38708
|
return useContext(FetchedDataContext);
|
|
@@ -38932,7 +38759,7 @@ function OfflineModeProvider({
|
|
|
38932
38759
|
const [forceOffline, setForceOffline] = useState(false);
|
|
38933
38760
|
const executor = useOfflineExecutor(executorOptions);
|
|
38934
38761
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
38935
|
-
const
|
|
38762
|
+
const contextValue = useMemo(
|
|
38936
38763
|
() => ({
|
|
38937
38764
|
...executor,
|
|
38938
38765
|
forceOffline,
|
|
@@ -38941,7 +38768,7 @@ function OfflineModeProvider({
|
|
|
38941
38768
|
}),
|
|
38942
38769
|
[executor, forceOffline, effectivelyOffline]
|
|
38943
38770
|
);
|
|
38944
|
-
return /* @__PURE__ */ jsx(OfflineModeContext.Provider, { value:
|
|
38771
|
+
return /* @__PURE__ */ jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
38945
38772
|
}
|
|
38946
38773
|
function useOfflineMode() {
|
|
38947
38774
|
const context = useContext(OfflineModeContext);
|
|
@@ -38954,4 +38781,4 @@ function useOptionalOfflineMode() {
|
|
|
38954
38781
|
return useContext(OfflineModeContext);
|
|
38955
38782
|
}
|
|
38956
38783
|
|
|
38957
|
-
export {
|
|
38784
|
+
export { EventBusContext2 as EventBusContext, EventBusProvider, FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, SelectionContext, SelectionProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional };
|