@almadar/ui 2.61.1 → 3.1.2
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 +1344 -1507
- package/dist/avl/index.css +7 -2
- package/dist/avl/index.js +268 -431
- package/dist/components/index.cjs +40 -38
- package/dist/components/index.css +7 -2
- package/dist/components/index.js +41 -39
- 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/game/three/index.cjs +8 -4
- package/dist/components/organisms/game/three/index.js +8 -4
- package/dist/components/organisms/marketing-types.d.ts +22 -12
- package/dist/components/organisms/types.d.ts +24 -12
- package/dist/components/templates/types.d.ts +7 -2
- package/dist/docs/index.cjs +6 -2
- package/dist/docs/index.d.cts +1 -1
- package/dist/docs/index.js +6 -2
- package/dist/hooks/event-bus-types.d.ts +19 -27
- package/dist/hooks/index.cjs +13 -6
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +13 -6
- package/dist/hooks/useEventBus.d.ts +3 -3
- package/dist/lib/index.cjs +5 -2
- package/dist/lib/index.js +5 -2
- package/dist/lib/verificationRegistry.d.ts +3 -5
- package/dist/marketing/index.cjs +6 -2
- package/dist/marketing/index.js +6 -2
- package/dist/providers/index.cjs +997 -1168
- package/dist/providers/index.css +7 -2
- package/dist/providers/index.d.ts +0 -2
- package/dist/providers/index.js +241 -406
- package/dist/runtime/index.cjs +47 -70
- package/dist/runtime/index.css +7 -2
- package/dist/runtime/index.js +48 -71
- package/package.json +4 -4
- 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
|
});
|
|
@@ -409,8 +410,8 @@ function useEventListener(event, handler) {
|
|
|
409
410
|
function useEmitEvent() {
|
|
410
411
|
const eventBus = useEventBus();
|
|
411
412
|
return useCallback(
|
|
412
|
-
(type, payload) => {
|
|
413
|
-
eventBus.emit(type, payload);
|
|
413
|
+
(type, payload, source) => {
|
|
414
|
+
eventBus.emit(type, payload, source);
|
|
414
415
|
},
|
|
415
416
|
[eventBus]
|
|
416
417
|
);
|
|
@@ -425,11 +426,15 @@ var init_useEventBus = __esm({
|
|
|
425
426
|
fallbackListeners = /* @__PURE__ */ new Map();
|
|
426
427
|
fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
427
428
|
fallbackEventBus = {
|
|
428
|
-
emit: (type, payload) => {
|
|
429
|
+
emit: (type, payload, source) => {
|
|
429
430
|
const event = {
|
|
430
431
|
type,
|
|
432
|
+
// Narrow at the bus boundary: public emit accepts an opaque object so
|
|
433
|
+
// generic UI emit sites don't require casts; the envelope stores the
|
|
434
|
+
// payload as EventPayload which listeners consume directly.
|
|
431
435
|
payload,
|
|
432
|
-
timestamp: Date.now()
|
|
436
|
+
timestamp: Date.now(),
|
|
437
|
+
source
|
|
433
438
|
};
|
|
434
439
|
const handlers = fallbackListeners.get(type);
|
|
435
440
|
log.debug("emit", { type, payloadKeys: payload ? Object.keys(payload).length : 0, listenerCount: (handlers?.size ?? 0) + fallbackAnyListeners.size });
|
|
@@ -697,7 +702,7 @@ var init_Box = __esm({
|
|
|
697
702
|
fixed: "fixed",
|
|
698
703
|
sticky: "sticky"
|
|
699
704
|
};
|
|
700
|
-
Box =
|
|
705
|
+
Box = React115__default.forwardRef(
|
|
701
706
|
({
|
|
702
707
|
padding,
|
|
703
708
|
paddingX,
|
|
@@ -1396,7 +1401,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1396
1401
|
const IconComp = value;
|
|
1397
1402
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1398
1403
|
}
|
|
1399
|
-
if (
|
|
1404
|
+
if (React115__default.isValidElement(value)) {
|
|
1400
1405
|
return value;
|
|
1401
1406
|
}
|
|
1402
1407
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1472,7 +1477,7 @@ var init_Button = __esm({
|
|
|
1472
1477
|
md: "h-4 w-4",
|
|
1473
1478
|
lg: "h-5 w-5"
|
|
1474
1479
|
};
|
|
1475
|
-
Button =
|
|
1480
|
+
Button = React115__default.forwardRef(
|
|
1476
1481
|
({
|
|
1477
1482
|
className,
|
|
1478
1483
|
variant = "primary",
|
|
@@ -1575,7 +1580,7 @@ var init_Badge = __esm({
|
|
|
1575
1580
|
md: "px-2.5 py-1 text-sm",
|
|
1576
1581
|
lg: "px-3 py-1.5 text-base"
|
|
1577
1582
|
};
|
|
1578
|
-
Badge =
|
|
1583
|
+
Badge = React115__default.forwardRef(
|
|
1579
1584
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1580
1585
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1581
1586
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1716,7 +1721,7 @@ var Input;
|
|
|
1716
1721
|
var init_Input = __esm({
|
|
1717
1722
|
"components/atoms/Input.tsx"() {
|
|
1718
1723
|
init_cn();
|
|
1719
|
-
Input =
|
|
1724
|
+
Input = React115__default.forwardRef(
|
|
1720
1725
|
({
|
|
1721
1726
|
className,
|
|
1722
1727
|
inputType,
|
|
@@ -1834,7 +1839,7 @@ var Label;
|
|
|
1834
1839
|
var init_Label = __esm({
|
|
1835
1840
|
"components/atoms/Label.tsx"() {
|
|
1836
1841
|
init_cn();
|
|
1837
|
-
Label =
|
|
1842
|
+
Label = React115__default.forwardRef(
|
|
1838
1843
|
({ className, required, children, ...props }, ref) => {
|
|
1839
1844
|
return /* @__PURE__ */ jsxs(
|
|
1840
1845
|
"label",
|
|
@@ -1860,7 +1865,7 @@ var Textarea;
|
|
|
1860
1865
|
var init_Textarea = __esm({
|
|
1861
1866
|
"components/atoms/Textarea.tsx"() {
|
|
1862
1867
|
init_cn();
|
|
1863
|
-
Textarea =
|
|
1868
|
+
Textarea = React115__default.forwardRef(
|
|
1864
1869
|
({ className, error, ...props }, ref) => {
|
|
1865
1870
|
return /* @__PURE__ */ jsx(
|
|
1866
1871
|
"textarea",
|
|
@@ -1889,7 +1894,7 @@ var Select;
|
|
|
1889
1894
|
var init_Select = __esm({
|
|
1890
1895
|
"components/atoms/Select.tsx"() {
|
|
1891
1896
|
init_cn();
|
|
1892
|
-
Select =
|
|
1897
|
+
Select = React115__default.forwardRef(
|
|
1893
1898
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1894
1899
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1895
1900
|
/* @__PURE__ */ jsxs(
|
|
@@ -1931,7 +1936,7 @@ var Checkbox;
|
|
|
1931
1936
|
var init_Checkbox = __esm({
|
|
1932
1937
|
"components/atoms/Checkbox.tsx"() {
|
|
1933
1938
|
init_cn();
|
|
1934
|
-
Checkbox =
|
|
1939
|
+
Checkbox = React115__default.forwardRef(
|
|
1935
1940
|
({ className, label, id, ...props }, ref) => {
|
|
1936
1941
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1937
1942
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -2013,7 +2018,7 @@ var init_Card = __esm({
|
|
|
2013
2018
|
md: "shadow",
|
|
2014
2019
|
lg: "shadow-lg"
|
|
2015
2020
|
};
|
|
2016
|
-
Card =
|
|
2021
|
+
Card = React115__default.forwardRef(
|
|
2017
2022
|
({
|
|
2018
2023
|
className,
|
|
2019
2024
|
variant = "bordered",
|
|
@@ -2049,9 +2054,9 @@ var init_Card = __esm({
|
|
|
2049
2054
|
}
|
|
2050
2055
|
);
|
|
2051
2056
|
Card.displayName = "Card";
|
|
2052
|
-
CardHeader =
|
|
2057
|
+
CardHeader = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
2053
2058
|
CardHeader.displayName = "CardHeader";
|
|
2054
|
-
CardTitle =
|
|
2059
|
+
CardTitle = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2055
2060
|
"h3",
|
|
2056
2061
|
{
|
|
2057
2062
|
ref,
|
|
@@ -2064,11 +2069,11 @@ var init_Card = __esm({
|
|
|
2064
2069
|
}
|
|
2065
2070
|
));
|
|
2066
2071
|
CardTitle.displayName = "CardTitle";
|
|
2067
|
-
CardContent =
|
|
2072
|
+
CardContent = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
2068
2073
|
CardContent.displayName = "CardContent";
|
|
2069
2074
|
CardBody = CardContent;
|
|
2070
2075
|
CardBody.displayName = "CardBody";
|
|
2071
|
-
CardFooter =
|
|
2076
|
+
CardFooter = React115__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2072
2077
|
"div",
|
|
2073
2078
|
{
|
|
2074
2079
|
ref,
|
|
@@ -2089,7 +2094,7 @@ var init_Spinner = __esm({
|
|
|
2089
2094
|
md: "h-6 w-6",
|
|
2090
2095
|
lg: "h-8 w-8"
|
|
2091
2096
|
};
|
|
2092
|
-
Spinner =
|
|
2097
|
+
Spinner = React115__default.forwardRef(
|
|
2093
2098
|
({ className, size = "md", ...props }, ref) => {
|
|
2094
2099
|
return /* @__PURE__ */ jsx(
|
|
2095
2100
|
"div",
|
|
@@ -2537,7 +2542,7 @@ var Radio;
|
|
|
2537
2542
|
var init_Radio = __esm({
|
|
2538
2543
|
"components/atoms/Radio.tsx"() {
|
|
2539
2544
|
init_cn();
|
|
2540
|
-
Radio =
|
|
2545
|
+
Radio = React115__default.forwardRef(
|
|
2541
2546
|
({
|
|
2542
2547
|
label,
|
|
2543
2548
|
helperText,
|
|
@@ -2648,7 +2653,7 @@ var init_Switch = __esm({
|
|
|
2648
2653
|
"components/atoms/Switch.tsx"() {
|
|
2649
2654
|
"use client";
|
|
2650
2655
|
init_cn();
|
|
2651
|
-
Switch =
|
|
2656
|
+
Switch = React115.forwardRef(
|
|
2652
2657
|
({
|
|
2653
2658
|
checked,
|
|
2654
2659
|
defaultChecked = false,
|
|
@@ -2659,10 +2664,10 @@ var init_Switch = __esm({
|
|
|
2659
2664
|
name,
|
|
2660
2665
|
className
|
|
2661
2666
|
}, ref) => {
|
|
2662
|
-
const [isChecked, setIsChecked] =
|
|
2667
|
+
const [isChecked, setIsChecked] = React115.useState(
|
|
2663
2668
|
checked !== void 0 ? checked : defaultChecked
|
|
2664
2669
|
);
|
|
2665
|
-
|
|
2670
|
+
React115.useEffect(() => {
|
|
2666
2671
|
if (checked !== void 0) {
|
|
2667
2672
|
setIsChecked(checked);
|
|
2668
2673
|
}
|
|
@@ -3088,8 +3093,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3088
3093
|
position = "top",
|
|
3089
3094
|
className
|
|
3090
3095
|
}) => {
|
|
3091
|
-
const [isVisible, setIsVisible] =
|
|
3092
|
-
const timeoutRef =
|
|
3096
|
+
const [isVisible, setIsVisible] = React115__default.useState(false);
|
|
3097
|
+
const timeoutRef = React115__default.useRef(null);
|
|
3093
3098
|
const handleMouseEnter = () => {
|
|
3094
3099
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3095
3100
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -3098,7 +3103,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
3098
3103
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3099
3104
|
setIsVisible(false);
|
|
3100
3105
|
};
|
|
3101
|
-
|
|
3106
|
+
React115__default.useEffect(() => {
|
|
3102
3107
|
return () => {
|
|
3103
3108
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
3104
3109
|
};
|
|
@@ -3308,7 +3313,7 @@ var init_StatusDot = __esm({
|
|
|
3308
3313
|
md: "w-2.5 h-2.5",
|
|
3309
3314
|
lg: "w-3 h-3"
|
|
3310
3315
|
};
|
|
3311
|
-
StatusDot =
|
|
3316
|
+
StatusDot = React115__default.forwardRef(
|
|
3312
3317
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
3313
3318
|
return /* @__PURE__ */ jsx(
|
|
3314
3319
|
"span",
|
|
@@ -3361,7 +3366,7 @@ var init_TrendIndicator = __esm({
|
|
|
3361
3366
|
down: TrendingDown,
|
|
3362
3367
|
flat: ArrowRight
|
|
3363
3368
|
};
|
|
3364
|
-
TrendIndicator =
|
|
3369
|
+
TrendIndicator = React115__default.forwardRef(
|
|
3365
3370
|
({
|
|
3366
3371
|
className,
|
|
3367
3372
|
value,
|
|
@@ -3428,7 +3433,7 @@ var init_RangeSlider = __esm({
|
|
|
3428
3433
|
md: "w-4 h-4",
|
|
3429
3434
|
lg: "w-5 h-5"
|
|
3430
3435
|
};
|
|
3431
|
-
RangeSlider =
|
|
3436
|
+
RangeSlider = React115__default.forwardRef(
|
|
3432
3437
|
({
|
|
3433
3438
|
className,
|
|
3434
3439
|
min = 0,
|
|
@@ -4023,7 +4028,7 @@ var init_ContentSection = __esm({
|
|
|
4023
4028
|
md: "py-16",
|
|
4024
4029
|
lg: "py-24"
|
|
4025
4030
|
};
|
|
4026
|
-
ContentSection =
|
|
4031
|
+
ContentSection = React115__default.forwardRef(
|
|
4027
4032
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4028
4033
|
return /* @__PURE__ */ jsx(
|
|
4029
4034
|
Box,
|
|
@@ -4557,7 +4562,7 @@ var init_AnimatedReveal = __esm({
|
|
|
4557
4562
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
4558
4563
|
"none": {}
|
|
4559
4564
|
};
|
|
4560
|
-
AnimatedReveal =
|
|
4565
|
+
AnimatedReveal = React115__default.forwardRef(
|
|
4561
4566
|
({
|
|
4562
4567
|
trigger = "scroll",
|
|
4563
4568
|
animation = "fade-up",
|
|
@@ -4717,7 +4722,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4717
4722
|
"components/atoms/AnimatedGraphic.tsx"() {
|
|
4718
4723
|
"use client";
|
|
4719
4724
|
init_cn();
|
|
4720
|
-
AnimatedGraphic =
|
|
4725
|
+
AnimatedGraphic = React115__default.forwardRef(
|
|
4721
4726
|
({
|
|
4722
4727
|
src,
|
|
4723
4728
|
svgContent,
|
|
@@ -4740,7 +4745,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
4740
4745
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
4741
4746
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
4742
4747
|
const prevAnimateRef = useRef(animate);
|
|
4743
|
-
const setRef =
|
|
4748
|
+
const setRef = React115__default.useCallback(
|
|
4744
4749
|
(node) => {
|
|
4745
4750
|
containerRef.current = node;
|
|
4746
4751
|
if (typeof ref === "function") ref(node);
|
|
@@ -4958,9 +4963,9 @@ function ScoreDisplay({
|
|
|
4958
4963
|
...rest
|
|
4959
4964
|
}) {
|
|
4960
4965
|
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
|
-
|
|
4966
|
+
const [displayValue, setDisplayValue] = React115.useState(resolvedValue);
|
|
4967
|
+
const [isAnimating, setIsAnimating] = React115.useState(false);
|
|
4968
|
+
React115.useEffect(() => {
|
|
4964
4969
|
if (!animated || displayValue === resolvedValue) {
|
|
4965
4970
|
setDisplayValue(resolvedValue);
|
|
4966
4971
|
return;
|
|
@@ -5030,9 +5035,9 @@ function ControlButton({
|
|
|
5030
5035
|
className
|
|
5031
5036
|
}) {
|
|
5032
5037
|
const eventBus = useEventBus();
|
|
5033
|
-
const [isPressed, setIsPressed] =
|
|
5038
|
+
const [isPressed, setIsPressed] = React115.useState(false);
|
|
5034
5039
|
const actualPressed = pressed ?? isPressed;
|
|
5035
|
-
const handlePointerDown =
|
|
5040
|
+
const handlePointerDown = React115.useCallback(
|
|
5036
5041
|
(e) => {
|
|
5037
5042
|
e.preventDefault();
|
|
5038
5043
|
if (disabled) return;
|
|
@@ -5042,7 +5047,7 @@ function ControlButton({
|
|
|
5042
5047
|
},
|
|
5043
5048
|
[disabled, pressEvent, eventBus, onPress]
|
|
5044
5049
|
);
|
|
5045
|
-
const handlePointerUp =
|
|
5050
|
+
const handlePointerUp = React115.useCallback(
|
|
5046
5051
|
(e) => {
|
|
5047
5052
|
e.preventDefault();
|
|
5048
5053
|
if (disabled) return;
|
|
@@ -5052,7 +5057,7 @@ function ControlButton({
|
|
|
5052
5057
|
},
|
|
5053
5058
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
5054
5059
|
);
|
|
5055
|
-
const handlePointerLeave =
|
|
5060
|
+
const handlePointerLeave = React115.useCallback(
|
|
5056
5061
|
(e) => {
|
|
5057
5062
|
if (isPressed) {
|
|
5058
5063
|
setIsPressed(false);
|
|
@@ -5950,9 +5955,9 @@ function MiniMap({
|
|
|
5950
5955
|
viewportRect,
|
|
5951
5956
|
className
|
|
5952
5957
|
}) {
|
|
5953
|
-
const canvasRef =
|
|
5954
|
-
const frameRef =
|
|
5955
|
-
|
|
5958
|
+
const canvasRef = React115.useRef(null);
|
|
5959
|
+
const frameRef = React115.useRef(0);
|
|
5960
|
+
React115.useEffect(() => {
|
|
5956
5961
|
const canvas = canvasRef.current;
|
|
5957
5962
|
if (!canvas) return;
|
|
5958
5963
|
const ctx = canvas.getContext("2d");
|
|
@@ -6291,7 +6296,7 @@ var init_ErrorBoundary = __esm({
|
|
|
6291
6296
|
"use client";
|
|
6292
6297
|
init_cn();
|
|
6293
6298
|
init_ErrorState();
|
|
6294
|
-
ErrorBoundary = class extends
|
|
6299
|
+
ErrorBoundary = class extends React115__default.Component {
|
|
6295
6300
|
constructor(props) {
|
|
6296
6301
|
super(props);
|
|
6297
6302
|
__publicField(this, "reset", () => {
|
|
@@ -7115,8 +7120,8 @@ var init_Tooltip = __esm({
|
|
|
7115
7120
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
7116
7121
|
};
|
|
7117
7122
|
}, []);
|
|
7118
|
-
const triggerElement =
|
|
7119
|
-
const trigger =
|
|
7123
|
+
const triggerElement = React115__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7124
|
+
const trigger = React115__default.cloneElement(triggerElement, {
|
|
7120
7125
|
ref: triggerRef,
|
|
7121
7126
|
onMouseEnter: handleMouseEnter,
|
|
7122
7127
|
onMouseLeave: handleMouseLeave,
|
|
@@ -7237,8 +7242,8 @@ var init_Popover = __esm({
|
|
|
7237
7242
|
onMouseEnter: handleOpen,
|
|
7238
7243
|
onMouseLeave: handleClose
|
|
7239
7244
|
};
|
|
7240
|
-
const childElement =
|
|
7241
|
-
const triggerElement =
|
|
7245
|
+
const childElement = React115__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
7246
|
+
const triggerElement = React115__default.cloneElement(
|
|
7242
7247
|
childElement,
|
|
7243
7248
|
{
|
|
7244
7249
|
ref: triggerRef,
|
|
@@ -7355,8 +7360,8 @@ var init_Menu = __esm({
|
|
|
7355
7360
|
"bottom-start": "top-full left-0 mt-2",
|
|
7356
7361
|
"bottom-end": "top-full right-0 mt-2"
|
|
7357
7362
|
};
|
|
7358
|
-
const triggerChild =
|
|
7359
|
-
const triggerElement =
|
|
7363
|
+
const triggerChild = React115__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx("span", { children: trigger });
|
|
7364
|
+
const triggerElement = React115__default.cloneElement(
|
|
7360
7365
|
triggerChild,
|
|
7361
7366
|
{
|
|
7362
7367
|
ref: triggerRef,
|
|
@@ -7870,13 +7875,13 @@ var init_MapView = __esm({
|
|
|
7870
7875
|
shadowSize: [41, 41]
|
|
7871
7876
|
});
|
|
7872
7877
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
7873
|
-
const { useEffect:
|
|
7878
|
+
const { useEffect: useEffect62, useRef: useRef62, useCallback: useCallback95, useState: useState87 } = React115__default;
|
|
7874
7879
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
7875
7880
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
7876
7881
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
7877
7882
|
const map = useMap();
|
|
7878
|
-
const prevRef =
|
|
7879
|
-
|
|
7883
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
7884
|
+
useEffect62(() => {
|
|
7880
7885
|
const prev = prevRef.current;
|
|
7881
7886
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
7882
7887
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -7887,7 +7892,7 @@ var init_MapView = __esm({
|
|
|
7887
7892
|
}
|
|
7888
7893
|
function MapClickHandler({ onMapClick }) {
|
|
7889
7894
|
const map = useMap();
|
|
7890
|
-
|
|
7895
|
+
useEffect62(() => {
|
|
7891
7896
|
if (!onMapClick) return;
|
|
7892
7897
|
const handler = (e) => {
|
|
7893
7898
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -8122,7 +8127,7 @@ function InputPattern({
|
|
|
8122
8127
|
className
|
|
8123
8128
|
}) {
|
|
8124
8129
|
const { emit } = useEventBus();
|
|
8125
|
-
const [localValue, setLocalValue] =
|
|
8130
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8126
8131
|
const handleChange = (e) => {
|
|
8127
8132
|
setLocalValue(e.target.value);
|
|
8128
8133
|
if (onChange) {
|
|
@@ -8158,7 +8163,7 @@ function TextareaPattern({
|
|
|
8158
8163
|
className
|
|
8159
8164
|
}) {
|
|
8160
8165
|
const { emit } = useEventBus();
|
|
8161
|
-
const [localValue, setLocalValue] =
|
|
8166
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8162
8167
|
const handleChange = (e) => {
|
|
8163
8168
|
setLocalValue(e.target.value);
|
|
8164
8169
|
if (onChange) {
|
|
@@ -8188,7 +8193,7 @@ function SelectPattern({
|
|
|
8188
8193
|
className
|
|
8189
8194
|
}) {
|
|
8190
8195
|
const { emit } = useEventBus();
|
|
8191
|
-
const [localValue, setLocalValue] =
|
|
8196
|
+
const [localValue, setLocalValue] = React115__default.useState(value);
|
|
8192
8197
|
const handleChange = (e) => {
|
|
8193
8198
|
setLocalValue(e.target.value);
|
|
8194
8199
|
if (onChange) {
|
|
@@ -8216,7 +8221,7 @@ function CheckboxPattern({
|
|
|
8216
8221
|
className
|
|
8217
8222
|
}) {
|
|
8218
8223
|
const { emit } = useEventBus();
|
|
8219
|
-
const [localChecked, setLocalChecked] =
|
|
8224
|
+
const [localChecked, setLocalChecked] = React115__default.useState(checked);
|
|
8220
8225
|
const handleChange = (e) => {
|
|
8221
8226
|
setLocalChecked(e.target.checked);
|
|
8222
8227
|
if (onChange) {
|
|
@@ -8447,8 +8452,8 @@ function ActionButtons({
|
|
|
8447
8452
|
disabled
|
|
8448
8453
|
}) {
|
|
8449
8454
|
const eventBus = useEventBus();
|
|
8450
|
-
const [activeButtons, setActiveButtons] =
|
|
8451
|
-
const handlePress =
|
|
8455
|
+
const [activeButtons, setActiveButtons] = React115.useState(/* @__PURE__ */ new Set());
|
|
8456
|
+
const handlePress = React115.useCallback(
|
|
8452
8457
|
(id) => {
|
|
8453
8458
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
8454
8459
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -8456,7 +8461,7 @@ function ActionButtons({
|
|
|
8456
8461
|
},
|
|
8457
8462
|
[actionEvent, eventBus, onAction]
|
|
8458
8463
|
);
|
|
8459
|
-
const handleRelease =
|
|
8464
|
+
const handleRelease = React115.useCallback(
|
|
8460
8465
|
(id) => {
|
|
8461
8466
|
setActiveButtons((prev) => {
|
|
8462
8467
|
const next = new Set(prev);
|
|
@@ -8858,13 +8863,13 @@ function getState() {
|
|
|
8858
8863
|
}
|
|
8859
8864
|
return { checks: /* @__PURE__ */ new Map(), transitions: [], bridgeHealth: null, listeners: /* @__PURE__ */ new Set() };
|
|
8860
8865
|
}
|
|
8861
|
-
function
|
|
8866
|
+
function notifyListeners() {
|
|
8862
8867
|
getState().listeners.forEach((l) => l());
|
|
8863
8868
|
exposeOnWindow();
|
|
8864
8869
|
}
|
|
8865
8870
|
function registerCheck(id, label, status = "pending", details) {
|
|
8866
8871
|
getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
|
|
8867
|
-
|
|
8872
|
+
notifyListeners();
|
|
8868
8873
|
}
|
|
8869
8874
|
function getAllChecks() {
|
|
8870
8875
|
return Array.from(getState().checks.values());
|
|
@@ -8909,7 +8914,7 @@ function recordTransition(trace) {
|
|
|
8909
8914
|
failedEffects.map((e) => `${e.type}: ${e.error}`).join("; ")
|
|
8910
8915
|
);
|
|
8911
8916
|
}
|
|
8912
|
-
|
|
8917
|
+
notifyListeners();
|
|
8913
8918
|
}
|
|
8914
8919
|
function getTransitions() {
|
|
8915
8920
|
return [...getState().transitions];
|
|
@@ -8928,7 +8933,7 @@ function getSummary() {
|
|
|
8928
8933
|
pending: allChecks.filter((c) => c.status === "pending").length
|
|
8929
8934
|
};
|
|
8930
8935
|
}
|
|
8931
|
-
function
|
|
8936
|
+
function getSnapshot() {
|
|
8932
8937
|
return {
|
|
8933
8938
|
checks: getAllChecks(),
|
|
8934
8939
|
transitions: getTransitions(),
|
|
@@ -8944,7 +8949,7 @@ function exposeOnWindow() {
|
|
|
8944
8949
|
if (typeof window === "undefined") return;
|
|
8945
8950
|
if (!window.__orbitalVerification) {
|
|
8946
8951
|
window.__orbitalVerification = {
|
|
8947
|
-
getSnapshot
|
|
8952
|
+
getSnapshot,
|
|
8948
8953
|
getChecks: getAllChecks,
|
|
8949
8954
|
getTransitions,
|
|
8950
8955
|
getBridge: getBridgeHealth,
|
|
@@ -10442,9 +10447,9 @@ var init_ScaledDiagram = __esm({
|
|
|
10442
10447
|
}
|
|
10443
10448
|
});
|
|
10444
10449
|
|
|
10445
|
-
// node_modules/.pnpm/katex@0.16.
|
|
10450
|
+
// node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css
|
|
10446
10451
|
var init_katex_min = __esm({
|
|
10447
|
-
"node_modules/.pnpm/katex@0.16.
|
|
10452
|
+
"node_modules/.pnpm/katex@0.16.45/node_modules/katex/dist/katex.min.css"() {
|
|
10448
10453
|
}
|
|
10449
10454
|
});
|
|
10450
10455
|
var MarkdownContent;
|
|
@@ -10454,7 +10459,7 @@ var init_MarkdownContent = __esm({
|
|
|
10454
10459
|
init_Box();
|
|
10455
10460
|
init_useTranslate();
|
|
10456
10461
|
init_cn();
|
|
10457
|
-
MarkdownContent =
|
|
10462
|
+
MarkdownContent = React115__default.memo(
|
|
10458
10463
|
({ content, direction, className }) => {
|
|
10459
10464
|
const { t: _t } = useTranslate();
|
|
10460
10465
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -10671,7 +10676,7 @@ var init_CodeBlock = __esm({
|
|
|
10671
10676
|
loloStyle = { ...dark, ...loloStyleOverrides };
|
|
10672
10677
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
10673
10678
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
10674
|
-
CodeBlock =
|
|
10679
|
+
CodeBlock = React115__default.memo(
|
|
10675
10680
|
({
|
|
10676
10681
|
code: rawCode,
|
|
10677
10682
|
language = "text",
|
|
@@ -11980,7 +11985,7 @@ var init_StateMachineView = __esm({
|
|
|
11980
11985
|
style: { top: title ? 30 : 0 },
|
|
11981
11986
|
children: [
|
|
11982
11987
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
11983
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
11988
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React115__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
11984
11989
|
StateNode,
|
|
11985
11990
|
{
|
|
11986
11991
|
state,
|
|
@@ -12493,7 +12498,9 @@ function extractTrait(schema, trait, traitIndex) {
|
|
|
12493
12498
|
for (const orbital of schema.orbitals) {
|
|
12494
12499
|
const traits2 = orbital.traits ?? [];
|
|
12495
12500
|
if (traitIndex < traits2.length) {
|
|
12496
|
-
|
|
12501
|
+
const traitRef = traits2[traitIndex];
|
|
12502
|
+
if (isInlineTrait(traitRef)) return traitRef;
|
|
12503
|
+
return null;
|
|
12497
12504
|
}
|
|
12498
12505
|
}
|
|
12499
12506
|
return null;
|
|
@@ -12501,8 +12508,10 @@ function extractTrait(schema, trait, traitIndex) {
|
|
|
12501
12508
|
function extractEntityFields(schema) {
|
|
12502
12509
|
if (!schema?.orbitals?.length) return [];
|
|
12503
12510
|
const entity = schema.orbitals[0].entity;
|
|
12504
|
-
if (!entity
|
|
12505
|
-
|
|
12511
|
+
if (!entity || typeof entity !== "object" || !("fields" in entity)) return [];
|
|
12512
|
+
const inlineEntity = entity;
|
|
12513
|
+
if (!inlineEntity.fields) return [];
|
|
12514
|
+
return inlineEntity.fields.map((f3) => f3.name);
|
|
12506
12515
|
}
|
|
12507
12516
|
function toStateMachineDefinition(sm) {
|
|
12508
12517
|
return {
|
|
@@ -12797,12 +12806,18 @@ var init_ContentRenderer = __esm({
|
|
|
12797
12806
|
);
|
|
12798
12807
|
case "orbital": {
|
|
12799
12808
|
const parsed = segment.schema;
|
|
12809
|
+
const inlineTrait = {
|
|
12810
|
+
name: "inline",
|
|
12811
|
+
scope: "instance",
|
|
12812
|
+
stateMachine: parsed
|
|
12813
|
+
};
|
|
12800
12814
|
const schema = Array.isArray(parsed.orbitals) ? parsed : {
|
|
12815
|
+
name: "inline",
|
|
12801
12816
|
orbitals: [{
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12817
|
+
name: "inline",
|
|
12818
|
+
entity: { name: "inline", fields: [] },
|
|
12819
|
+
traits: [inlineTrait],
|
|
12820
|
+
pages: []
|
|
12806
12821
|
}]
|
|
12807
12822
|
};
|
|
12808
12823
|
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", children: [
|
|
@@ -17747,7 +17762,7 @@ function CraftingRecipe({
|
|
|
17747
17762
|
className
|
|
17748
17763
|
}) {
|
|
17749
17764
|
const eventBus = useEventBus();
|
|
17750
|
-
const handleCraft =
|
|
17765
|
+
const handleCraft = React115.useCallback(() => {
|
|
17751
17766
|
onCraft?.();
|
|
17752
17767
|
if (craftEvent) {
|
|
17753
17768
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -17764,7 +17779,7 @@ function CraftingRecipe({
|
|
|
17764
17779
|
children: [
|
|
17765
17780
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
17766
17781
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
17767
|
-
return /* @__PURE__ */ jsxs(
|
|
17782
|
+
return /* @__PURE__ */ jsxs(React115.Fragment, { children: [
|
|
17768
17783
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
17769
17784
|
ItemSlot,
|
|
17770
17785
|
{
|
|
@@ -18058,8 +18073,8 @@ function DPad({
|
|
|
18058
18073
|
}) {
|
|
18059
18074
|
const eventBus = useEventBus();
|
|
18060
18075
|
const sizes = sizeMap15[size];
|
|
18061
|
-
const [activeDirections, setActiveDirections] =
|
|
18062
|
-
const handlePress =
|
|
18076
|
+
const [activeDirections, setActiveDirections] = React115.useState(/* @__PURE__ */ new Set());
|
|
18077
|
+
const handlePress = React115.useCallback(
|
|
18063
18078
|
(direction) => {
|
|
18064
18079
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
18065
18080
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -18067,7 +18082,7 @@ function DPad({
|
|
|
18067
18082
|
},
|
|
18068
18083
|
[directionEvent, eventBus, onDirection]
|
|
18069
18084
|
);
|
|
18070
|
-
const handleRelease =
|
|
18085
|
+
const handleRelease = React115.useCallback(
|
|
18071
18086
|
(direction) => {
|
|
18072
18087
|
setActiveDirections((prev) => {
|
|
18073
18088
|
const next = new Set(prev);
|
|
@@ -18934,7 +18949,7 @@ var init_DataList = __esm({
|
|
|
18934
18949
|
}) => {
|
|
18935
18950
|
const eventBus = useEventBus();
|
|
18936
18951
|
const { t } = useTranslate();
|
|
18937
|
-
const [visibleCount, setVisibleCount] =
|
|
18952
|
+
const [visibleCount, setVisibleCount] = React115__default.useState(pageSize || Infinity);
|
|
18938
18953
|
const fields = fieldsProp ?? columnsProp ?? [];
|
|
18939
18954
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
18940
18955
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
@@ -18971,7 +18986,7 @@ var init_DataList = __esm({
|
|
|
18971
18986
|
const items2 = data.map((item) => item);
|
|
18972
18987
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
18973
18988
|
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(
|
|
18989
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
18975
18990
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
18976
18991
|
group.items.map((itemData, index) => {
|
|
18977
18992
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -19174,7 +19189,7 @@ var init_DataList = __esm({
|
|
|
19174
19189
|
className
|
|
19175
19190
|
),
|
|
19176
19191
|
children: [
|
|
19177
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
19192
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
19178
19193
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
19179
19194
|
group.items.map(
|
|
19180
19195
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -19380,43 +19395,43 @@ function useQuerySingleton(query) {
|
|
|
19380
19395
|
if (!query) {
|
|
19381
19396
|
return null;
|
|
19382
19397
|
}
|
|
19383
|
-
const
|
|
19398
|
+
const store = useMemo(() => getOrCreateStore(query), [query]);
|
|
19384
19399
|
useMemo(() => {
|
|
19385
19400
|
const listener = () => forceUpdate({});
|
|
19386
|
-
|
|
19401
|
+
store.listeners.add(listener);
|
|
19387
19402
|
return () => {
|
|
19388
|
-
|
|
19403
|
+
store.listeners.delete(listener);
|
|
19389
19404
|
};
|
|
19390
|
-
}, [
|
|
19391
|
-
const
|
|
19392
|
-
|
|
19393
|
-
}, [
|
|
19405
|
+
}, [store]);
|
|
19406
|
+
const notifyListeners2 = useCallback(() => {
|
|
19407
|
+
store.listeners.forEach((listener) => listener());
|
|
19408
|
+
}, [store]);
|
|
19394
19409
|
const setSearch = useCallback((value) => {
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
}, [
|
|
19410
|
+
store.search = value;
|
|
19411
|
+
notifyListeners2();
|
|
19412
|
+
}, [store, notifyListeners2]);
|
|
19398
19413
|
const setFilter = useCallback((key, value) => {
|
|
19399
|
-
|
|
19400
|
-
|
|
19401
|
-
}, [
|
|
19414
|
+
store.filters = { ...store.filters, [key]: value };
|
|
19415
|
+
notifyListeners2();
|
|
19416
|
+
}, [store, notifyListeners2]);
|
|
19402
19417
|
const clearFilters = useCallback(() => {
|
|
19403
|
-
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
}, [
|
|
19418
|
+
store.filters = {};
|
|
19419
|
+
store.search = "";
|
|
19420
|
+
notifyListeners2();
|
|
19421
|
+
}, [store, notifyListeners2]);
|
|
19407
19422
|
const setSort = useCallback((field, direction) => {
|
|
19408
|
-
|
|
19409
|
-
|
|
19410
|
-
|
|
19411
|
-
}, [
|
|
19423
|
+
store.sortField = field;
|
|
19424
|
+
store.sortDirection = direction;
|
|
19425
|
+
notifyListeners2();
|
|
19426
|
+
}, [store, notifyListeners2]);
|
|
19412
19427
|
return {
|
|
19413
|
-
search:
|
|
19428
|
+
search: store.search,
|
|
19414
19429
|
setSearch,
|
|
19415
|
-
filters:
|
|
19430
|
+
filters: store.filters,
|
|
19416
19431
|
setFilter,
|
|
19417
19432
|
clearFilters,
|
|
19418
|
-
sortField:
|
|
19419
|
-
sortDirection:
|
|
19433
|
+
sortField: store.sortField,
|
|
19434
|
+
sortDirection: store.sortDirection,
|
|
19420
19435
|
setSort
|
|
19421
19436
|
};
|
|
19422
19437
|
}
|
|
@@ -20427,7 +20442,7 @@ var init_WizardProgress = __esm({
|
|
|
20427
20442
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: steps.map((step, index) => {
|
|
20428
20443
|
const isActive = index === currentStep;
|
|
20429
20444
|
const isCompleted = index < currentStep;
|
|
20430
|
-
return /* @__PURE__ */ jsxs(
|
|
20445
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
20431
20446
|
/* @__PURE__ */ jsx(
|
|
20432
20447
|
"button",
|
|
20433
20448
|
{
|
|
@@ -21338,7 +21353,7 @@ function InventoryGrid({
|
|
|
21338
21353
|
const eventBus = useEventBus();
|
|
21339
21354
|
const slotCount = totalSlots ?? items.length;
|
|
21340
21355
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
21341
|
-
const handleSelect =
|
|
21356
|
+
const handleSelect = React115.useCallback(
|
|
21342
21357
|
(id) => {
|
|
21343
21358
|
onSelect?.(id);
|
|
21344
21359
|
if (selectEvent) {
|
|
@@ -21551,15 +21566,15 @@ function GameCanvas2D({
|
|
|
21551
21566
|
fps = 60,
|
|
21552
21567
|
className
|
|
21553
21568
|
}) {
|
|
21554
|
-
const canvasRef =
|
|
21555
|
-
const rafRef =
|
|
21556
|
-
const frameRef =
|
|
21557
|
-
const lastTimeRef =
|
|
21558
|
-
const onDrawRef =
|
|
21569
|
+
const canvasRef = React115.useRef(null);
|
|
21570
|
+
const rafRef = React115.useRef(0);
|
|
21571
|
+
const frameRef = React115.useRef(0);
|
|
21572
|
+
const lastTimeRef = React115.useRef(0);
|
|
21573
|
+
const onDrawRef = React115.useRef(onDraw);
|
|
21559
21574
|
onDrawRef.current = onDraw;
|
|
21560
|
-
const onTickRef =
|
|
21575
|
+
const onTickRef = React115.useRef(onTick);
|
|
21561
21576
|
onTickRef.current = onTick;
|
|
21562
|
-
|
|
21577
|
+
React115.useEffect(() => {
|
|
21563
21578
|
const canvas = canvasRef.current;
|
|
21564
21579
|
if (!canvas) return;
|
|
21565
21580
|
const ctx = canvas.getContext("2d");
|
|
@@ -21848,7 +21863,7 @@ function TurnPanel({
|
|
|
21848
21863
|
className
|
|
21849
21864
|
}) {
|
|
21850
21865
|
const eventBus = useEventBus();
|
|
21851
|
-
const handleAction =
|
|
21866
|
+
const handleAction = React115.useCallback(
|
|
21852
21867
|
(event) => {
|
|
21853
21868
|
if (event) {
|
|
21854
21869
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -21994,7 +22009,7 @@ function UnitCommandBar({
|
|
|
21994
22009
|
className
|
|
21995
22010
|
}) {
|
|
21996
22011
|
const eventBus = useEventBus();
|
|
21997
|
-
const handleCommand =
|
|
22012
|
+
const handleCommand = React115.useCallback(
|
|
21998
22013
|
(event) => {
|
|
21999
22014
|
if (event) {
|
|
22000
22015
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -22479,7 +22494,7 @@ function GameMenu({
|
|
|
22479
22494
|
} catch {
|
|
22480
22495
|
}
|
|
22481
22496
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
22482
|
-
const handleOptionClick =
|
|
22497
|
+
const handleOptionClick = React115.useCallback(
|
|
22483
22498
|
(option) => {
|
|
22484
22499
|
if (option.event && eventBus) {
|
|
22485
22500
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -22593,7 +22608,7 @@ function GameOverScreen({
|
|
|
22593
22608
|
} catch {
|
|
22594
22609
|
}
|
|
22595
22610
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
22596
|
-
const handleActionClick =
|
|
22611
|
+
const handleActionClick = React115.useCallback(
|
|
22597
22612
|
(action) => {
|
|
22598
22613
|
if (action.event && eventBus) {
|
|
22599
22614
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -25697,7 +25712,7 @@ var init_StepFlow = __esm({
|
|
|
25697
25712
|
className
|
|
25698
25713
|
}) => {
|
|
25699
25714
|
if (orientation === "vertical") {
|
|
25700
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
25715
|
+
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
25716
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
25702
25717
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
25703
25718
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -25708,7 +25723,7 @@ var init_StepFlow = __esm({
|
|
|
25708
25723
|
] })
|
|
25709
25724
|
] }) }, index)) });
|
|
25710
25725
|
}
|
|
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(
|
|
25726
|
+
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
25727
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
25713
25728
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
25714
25729
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -27820,7 +27835,7 @@ var init_DocumentViewer = __esm({
|
|
|
27820
27835
|
}
|
|
27821
27836
|
});
|
|
27822
27837
|
function extractTitle(children) {
|
|
27823
|
-
if (!
|
|
27838
|
+
if (!React115__default.isValidElement(children)) return void 0;
|
|
27824
27839
|
const props = children.props;
|
|
27825
27840
|
if (typeof props.title === "string") {
|
|
27826
27841
|
return props.title;
|
|
@@ -27875,7 +27890,7 @@ function LinearView({
|
|
|
27875
27890
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
27876
27891
|
const isDone = i < currentIdx;
|
|
27877
27892
|
const isCurrent = i === currentIdx;
|
|
27878
|
-
return /* @__PURE__ */ jsxs(
|
|
27893
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
27879
27894
|
i > 0 && /* @__PURE__ */ jsx(
|
|
27880
27895
|
Typography,
|
|
27881
27896
|
{
|
|
@@ -28642,7 +28657,7 @@ var init_Form = __esm({
|
|
|
28642
28657
|
const normalizedInitialData = initialData ?? {};
|
|
28643
28658
|
const resolvedEntity = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
28644
28659
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
28645
|
-
const entityDerivedFields =
|
|
28660
|
+
const entityDerivedFields = React115__default.useMemo(() => {
|
|
28646
28661
|
if (fields && fields.length > 0) return void 0;
|
|
28647
28662
|
if (!resolvedEntity) return void 0;
|
|
28648
28663
|
return resolvedEntity.fields.map(
|
|
@@ -28661,14 +28676,14 @@ var init_Form = __esm({
|
|
|
28661
28676
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
28662
28677
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
28663
28678
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
28664
|
-
const [formData, setFormData] =
|
|
28679
|
+
const [formData, setFormData] = React115__default.useState(
|
|
28665
28680
|
normalizedInitialData
|
|
28666
28681
|
);
|
|
28667
|
-
const [collapsedSections, setCollapsedSections] =
|
|
28682
|
+
const [collapsedSections, setCollapsedSections] = React115__default.useState(
|
|
28668
28683
|
/* @__PURE__ */ new Set()
|
|
28669
28684
|
);
|
|
28670
28685
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
28671
|
-
const evalContext =
|
|
28686
|
+
const evalContext = React115__default.useMemo(
|
|
28672
28687
|
() => ({
|
|
28673
28688
|
formValues: formData,
|
|
28674
28689
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -28677,13 +28692,13 @@ var init_Form = __esm({
|
|
|
28677
28692
|
}),
|
|
28678
28693
|
[formData, externalContext]
|
|
28679
28694
|
);
|
|
28680
|
-
|
|
28695
|
+
React115__default.useEffect(() => {
|
|
28681
28696
|
const data = initialData;
|
|
28682
28697
|
if (data && Object.keys(data).length > 0) {
|
|
28683
28698
|
setFormData(data);
|
|
28684
28699
|
}
|
|
28685
28700
|
}, [initialData]);
|
|
28686
|
-
const processCalculations =
|
|
28701
|
+
const processCalculations = React115__default.useCallback(
|
|
28687
28702
|
(changedFieldId, newFormData) => {
|
|
28688
28703
|
if (!hiddenCalculations.length) return;
|
|
28689
28704
|
const context = {
|
|
@@ -28708,7 +28723,7 @@ var init_Form = __esm({
|
|
|
28708
28723
|
},
|
|
28709
28724
|
[hiddenCalculations, externalContext, eventBus]
|
|
28710
28725
|
);
|
|
28711
|
-
const checkViolations =
|
|
28726
|
+
const checkViolations = React115__default.useCallback(
|
|
28712
28727
|
(changedFieldId, newFormData) => {
|
|
28713
28728
|
if (!violationTriggers.length) return;
|
|
28714
28729
|
const context = {
|
|
@@ -28745,7 +28760,7 @@ var init_Form = __esm({
|
|
|
28745
28760
|
processCalculations(name, newFormData);
|
|
28746
28761
|
checkViolations(name, newFormData);
|
|
28747
28762
|
};
|
|
28748
|
-
const isFieldVisible =
|
|
28763
|
+
const isFieldVisible = React115__default.useCallback(
|
|
28749
28764
|
(fieldName) => {
|
|
28750
28765
|
const condition = conditionalFields[fieldName];
|
|
28751
28766
|
if (!condition) return true;
|
|
@@ -28753,7 +28768,7 @@ var init_Form = __esm({
|
|
|
28753
28768
|
},
|
|
28754
28769
|
[conditionalFields, evalContext]
|
|
28755
28770
|
);
|
|
28756
|
-
const isSectionVisible =
|
|
28771
|
+
const isSectionVisible = React115__default.useCallback(
|
|
28757
28772
|
(section) => {
|
|
28758
28773
|
if (!section.condition) return true;
|
|
28759
28774
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -28785,7 +28800,7 @@ var init_Form = __esm({
|
|
|
28785
28800
|
eventBus.emit(`UI:${onCancel}`);
|
|
28786
28801
|
}
|
|
28787
28802
|
};
|
|
28788
|
-
const renderField =
|
|
28803
|
+
const renderField = React115__default.useCallback(
|
|
28789
28804
|
(field) => {
|
|
28790
28805
|
const fieldName = field.name || field.field;
|
|
28791
28806
|
if (!fieldName) return null;
|
|
@@ -28806,7 +28821,7 @@ var init_Form = __esm({
|
|
|
28806
28821
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
28807
28822
|
);
|
|
28808
28823
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
28809
|
-
const normalizedFields =
|
|
28824
|
+
const normalizedFields = React115__default.useMemo(() => {
|
|
28810
28825
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
28811
28826
|
return effectiveFields.map((field) => {
|
|
28812
28827
|
if (typeof field === "string") {
|
|
@@ -28828,7 +28843,7 @@ var init_Form = __esm({
|
|
|
28828
28843
|
return field;
|
|
28829
28844
|
});
|
|
28830
28845
|
}, [effectiveFields, resolvedEntity]);
|
|
28831
|
-
const schemaFields =
|
|
28846
|
+
const schemaFields = React115__default.useMemo(() => {
|
|
28832
28847
|
if (normalizedFields.length === 0) return null;
|
|
28833
28848
|
if (isDebugEnabled()) {
|
|
28834
28849
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -28838,7 +28853,7 @@ var init_Form = __esm({
|
|
|
28838
28853
|
}
|
|
28839
28854
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
28840
28855
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
28841
|
-
const sectionElements =
|
|
28856
|
+
const sectionElements = React115__default.useMemo(() => {
|
|
28842
28857
|
if (!sections || sections.length === 0) return null;
|
|
28843
28858
|
return sections.map((section) => {
|
|
28844
28859
|
if (!isSectionVisible(section)) {
|
|
@@ -30335,7 +30350,7 @@ var init_List = __esm({
|
|
|
30335
30350
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
30336
30351
|
return [];
|
|
30337
30352
|
}, [entity]);
|
|
30338
|
-
const getItemActions =
|
|
30353
|
+
const getItemActions = React115__default.useCallback(
|
|
30339
30354
|
(item) => {
|
|
30340
30355
|
if (!itemActions) return [];
|
|
30341
30356
|
if (typeof itemActions === "function") {
|
|
@@ -30782,7 +30797,7 @@ var init_MediaGallery = __esm({
|
|
|
30782
30797
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
30783
30798
|
);
|
|
30784
30799
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
30785
|
-
const items =
|
|
30800
|
+
const items = React115__default.useMemo(() => {
|
|
30786
30801
|
if (propItems) return propItems;
|
|
30787
30802
|
if (entityData.length === 0) return [];
|
|
30788
30803
|
return entityData.map((record, idx) => ({
|
|
@@ -30946,7 +30961,7 @@ var init_MediaGallery = __esm({
|
|
|
30946
30961
|
}
|
|
30947
30962
|
});
|
|
30948
30963
|
function extractTitle2(children) {
|
|
30949
|
-
if (!
|
|
30964
|
+
if (!React115__default.isValidElement(children)) return void 0;
|
|
30950
30965
|
const props = children.props;
|
|
30951
30966
|
if (typeof props.title === "string") {
|
|
30952
30967
|
return props.title;
|
|
@@ -31659,7 +31674,7 @@ var init_PageHeader = __esm({
|
|
|
31659
31674
|
info: "bg-info/10 text-info"
|
|
31660
31675
|
};
|
|
31661
31676
|
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(
|
|
31677
|
+
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
31678
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
31664
31679
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
31665
31680
|
"a",
|
|
@@ -31833,7 +31848,7 @@ var init_debugRegistry = __esm({
|
|
|
31833
31848
|
}
|
|
31834
31849
|
});
|
|
31835
31850
|
function useDebugData() {
|
|
31836
|
-
const [data, setData] =
|
|
31851
|
+
const [data, setData] = React115.useState(() => ({
|
|
31837
31852
|
traits: [],
|
|
31838
31853
|
ticks: [],
|
|
31839
31854
|
guards: [],
|
|
@@ -31847,7 +31862,7 @@ function useDebugData() {
|
|
|
31847
31862
|
},
|
|
31848
31863
|
lastUpdate: Date.now()
|
|
31849
31864
|
}));
|
|
31850
|
-
|
|
31865
|
+
React115.useEffect(() => {
|
|
31851
31866
|
const updateData = () => {
|
|
31852
31867
|
setData({
|
|
31853
31868
|
traits: getAllTraits(),
|
|
@@ -31956,12 +31971,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
31956
31971
|
return positions;
|
|
31957
31972
|
}
|
|
31958
31973
|
function WalkMinimap() {
|
|
31959
|
-
const [walkStep, setWalkStep] =
|
|
31960
|
-
const [traits2, setTraits] =
|
|
31961
|
-
const [coveredEdges, setCoveredEdges] =
|
|
31962
|
-
const [completedTraits, setCompletedTraits] =
|
|
31963
|
-
const prevTraitRef =
|
|
31964
|
-
|
|
31974
|
+
const [walkStep, setWalkStep] = React115.useState(null);
|
|
31975
|
+
const [traits2, setTraits] = React115.useState([]);
|
|
31976
|
+
const [coveredEdges, setCoveredEdges] = React115.useState([]);
|
|
31977
|
+
const [completedTraits, setCompletedTraits] = React115.useState(/* @__PURE__ */ new Set());
|
|
31978
|
+
const prevTraitRef = React115.useRef(null);
|
|
31979
|
+
React115.useEffect(() => {
|
|
31965
31980
|
const interval = setInterval(() => {
|
|
31966
31981
|
const w = window;
|
|
31967
31982
|
const step = w.__orbitalWalkStep;
|
|
@@ -32408,15 +32423,15 @@ var init_EntitiesTab = __esm({
|
|
|
32408
32423
|
}
|
|
32409
32424
|
});
|
|
32410
32425
|
function EventFlowTab({ events: events2 }) {
|
|
32411
|
-
const [filter, setFilter] =
|
|
32412
|
-
const containerRef =
|
|
32413
|
-
const [autoScroll, setAutoScroll] =
|
|
32414
|
-
|
|
32426
|
+
const [filter, setFilter] = React115.useState("all");
|
|
32427
|
+
const containerRef = React115.useRef(null);
|
|
32428
|
+
const [autoScroll, setAutoScroll] = React115.useState(true);
|
|
32429
|
+
React115.useEffect(() => {
|
|
32415
32430
|
if (autoScroll && containerRef.current) {
|
|
32416
32431
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
32417
32432
|
}
|
|
32418
32433
|
}, [events2.length, autoScroll]);
|
|
32419
|
-
const filteredEvents =
|
|
32434
|
+
const filteredEvents = React115.useMemo(() => {
|
|
32420
32435
|
if (filter === "all") return events2;
|
|
32421
32436
|
return events2.filter((e) => e.type === filter);
|
|
32422
32437
|
}, [events2, filter]);
|
|
@@ -32535,7 +32550,7 @@ var init_EventFlowTab = __esm({
|
|
|
32535
32550
|
}
|
|
32536
32551
|
});
|
|
32537
32552
|
function GuardsPanel({ guards }) {
|
|
32538
|
-
const [filter, setFilter] =
|
|
32553
|
+
const [filter, setFilter] = React115.useState("all");
|
|
32539
32554
|
if (guards.length === 0) {
|
|
32540
32555
|
return /* @__PURE__ */ jsx(
|
|
32541
32556
|
EmptyState,
|
|
@@ -32548,7 +32563,7 @@ function GuardsPanel({ guards }) {
|
|
|
32548
32563
|
}
|
|
32549
32564
|
const passedCount = guards.filter((g) => g.result).length;
|
|
32550
32565
|
const failedCount = guards.length - passedCount;
|
|
32551
|
-
const filteredGuards =
|
|
32566
|
+
const filteredGuards = React115.useMemo(() => {
|
|
32552
32567
|
if (filter === "all") return guards;
|
|
32553
32568
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
32554
32569
|
return guards.filter((g) => !g.result);
|
|
@@ -32709,10 +32724,10 @@ function EffectBadge({ effect }) {
|
|
|
32709
32724
|
] });
|
|
32710
32725
|
}
|
|
32711
32726
|
function TransitionTimeline({ transitions }) {
|
|
32712
|
-
const containerRef =
|
|
32713
|
-
const [autoScroll, setAutoScroll] =
|
|
32714
|
-
const [expandedId, setExpandedId] =
|
|
32715
|
-
|
|
32727
|
+
const containerRef = React115.useRef(null);
|
|
32728
|
+
const [autoScroll, setAutoScroll] = React115.useState(true);
|
|
32729
|
+
const [expandedId, setExpandedId] = React115.useState(null);
|
|
32730
|
+
React115.useEffect(() => {
|
|
32716
32731
|
if (autoScroll && containerRef.current) {
|
|
32717
32732
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
32718
32733
|
}
|
|
@@ -32998,9 +33013,9 @@ function getAllEvents(traits2) {
|
|
|
32998
33013
|
}
|
|
32999
33014
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
33000
33015
|
const eventBus = useEventBus();
|
|
33001
|
-
const [log4, setLog] =
|
|
33002
|
-
const prevStatesRef =
|
|
33003
|
-
|
|
33016
|
+
const [log4, setLog] = React115.useState([]);
|
|
33017
|
+
const prevStatesRef = React115.useRef(/* @__PURE__ */ new Map());
|
|
33018
|
+
React115.useEffect(() => {
|
|
33004
33019
|
for (const trait of traits2) {
|
|
33005
33020
|
const prev = prevStatesRef.current.get(trait.id);
|
|
33006
33021
|
if (prev && prev !== trait.currentState) {
|
|
@@ -33170,10 +33185,10 @@ function VerifyModePanel({
|
|
|
33170
33185
|
serverCount,
|
|
33171
33186
|
localCount
|
|
33172
33187
|
}) {
|
|
33173
|
-
const [expanded, setExpanded] =
|
|
33174
|
-
const scrollRef =
|
|
33175
|
-
const prevCountRef =
|
|
33176
|
-
|
|
33188
|
+
const [expanded, setExpanded] = React115.useState(true);
|
|
33189
|
+
const scrollRef = React115.useRef(null);
|
|
33190
|
+
const prevCountRef = React115.useRef(0);
|
|
33191
|
+
React115.useEffect(() => {
|
|
33177
33192
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
33178
33193
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
33179
33194
|
}
|
|
@@ -33239,10 +33254,10 @@ function RuntimeDebugger({
|
|
|
33239
33254
|
defaultTab,
|
|
33240
33255
|
schema
|
|
33241
33256
|
}) {
|
|
33242
|
-
const [isCollapsed, setIsCollapsed] =
|
|
33243
|
-
const [isVisible, setIsVisible] =
|
|
33257
|
+
const [isCollapsed, setIsCollapsed] = React115.useState(mode === "verify" ? true : defaultCollapsed);
|
|
33258
|
+
const [isVisible, setIsVisible] = React115.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
33244
33259
|
const debugData = useDebugData();
|
|
33245
|
-
|
|
33260
|
+
React115.useEffect(() => {
|
|
33246
33261
|
if (mode === "inline") return;
|
|
33247
33262
|
return onDebugToggle((enabled) => {
|
|
33248
33263
|
setIsVisible(enabled);
|
|
@@ -33251,7 +33266,7 @@ function RuntimeDebugger({
|
|
|
33251
33266
|
}
|
|
33252
33267
|
});
|
|
33253
33268
|
}, [mode]);
|
|
33254
|
-
|
|
33269
|
+
React115.useEffect(() => {
|
|
33255
33270
|
if (mode === "inline") return;
|
|
33256
33271
|
const handleKeyDown = (e) => {
|
|
33257
33272
|
if (e.key === "`" && isVisible) {
|
|
@@ -33800,7 +33815,7 @@ function SequenceBar({
|
|
|
33800
33815
|
onSlotRemove(index);
|
|
33801
33816
|
}, [onSlotRemove, playing]);
|
|
33802
33817
|
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(
|
|
33818
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
33804
33819
|
i > 0 && /* @__PURE__ */ jsx(
|
|
33805
33820
|
Typography,
|
|
33806
33821
|
{
|
|
@@ -35145,7 +35160,7 @@ var init_StatCard2 = __esm({
|
|
|
35145
35160
|
const labelToUse = propLabel ?? propTitle;
|
|
35146
35161
|
const eventBus = useEventBus();
|
|
35147
35162
|
const { t } = useTranslate();
|
|
35148
|
-
const handleActionClick =
|
|
35163
|
+
const handleActionClick = React115__default.useCallback(() => {
|
|
35149
35164
|
if (action?.event) {
|
|
35150
35165
|
eventBus.emit(`UI:${action.event}`, {});
|
|
35151
35166
|
}
|
|
@@ -35156,7 +35171,7 @@ var init_StatCard2 = __esm({
|
|
|
35156
35171
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
35157
35172
|
const isLoading = externalLoading ?? false;
|
|
35158
35173
|
const error = externalError;
|
|
35159
|
-
const computeMetricValue =
|
|
35174
|
+
const computeMetricValue = React115__default.useCallback(
|
|
35160
35175
|
(metric, items) => {
|
|
35161
35176
|
if (metric.value !== void 0) {
|
|
35162
35177
|
return metric.value;
|
|
@@ -35195,7 +35210,7 @@ var init_StatCard2 = __esm({
|
|
|
35195
35210
|
},
|
|
35196
35211
|
[]
|
|
35197
35212
|
);
|
|
35198
|
-
const schemaStats =
|
|
35213
|
+
const schemaStats = React115__default.useMemo(() => {
|
|
35199
35214
|
if (!metrics || metrics.length === 0) return null;
|
|
35200
35215
|
return metrics.map((metric) => ({
|
|
35201
35216
|
label: metric.label,
|
|
@@ -35203,7 +35218,7 @@ var init_StatCard2 = __esm({
|
|
|
35203
35218
|
format: metric.format
|
|
35204
35219
|
}));
|
|
35205
35220
|
}, [metrics, data, computeMetricValue]);
|
|
35206
|
-
const calculatedTrend =
|
|
35221
|
+
const calculatedTrend = React115__default.useMemo(() => {
|
|
35207
35222
|
if (manualTrend !== void 0) return manualTrend;
|
|
35208
35223
|
if (previousValue === void 0 || currentValue === void 0)
|
|
35209
35224
|
return void 0;
|
|
@@ -36187,7 +36202,7 @@ var init_Timeline = __esm({
|
|
|
36187
36202
|
}) => {
|
|
36188
36203
|
const { t } = useTranslate();
|
|
36189
36204
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
36190
|
-
const items =
|
|
36205
|
+
const items = React115__default.useMemo(() => {
|
|
36191
36206
|
if (propItems) return propItems;
|
|
36192
36207
|
if (entityData.length === 0) return [];
|
|
36193
36208
|
return entityData.map((record, idx) => {
|
|
@@ -36291,7 +36306,7 @@ var init_Timeline = __esm({
|
|
|
36291
36306
|
}
|
|
36292
36307
|
});
|
|
36293
36308
|
function extractToastProps(children) {
|
|
36294
|
-
if (!
|
|
36309
|
+
if (!React115__default.isValidElement(children)) {
|
|
36295
36310
|
if (typeof children === "string") {
|
|
36296
36311
|
return { message: children };
|
|
36297
36312
|
}
|
|
@@ -36329,7 +36344,7 @@ var init_ToastSlot = __esm({
|
|
|
36329
36344
|
eventBus.emit("UI:CLOSE");
|
|
36330
36345
|
};
|
|
36331
36346
|
if (!isVisible) return null;
|
|
36332
|
-
const isCustomContent =
|
|
36347
|
+
const isCustomContent = React115__default.isValidElement(children) && !message;
|
|
36333
36348
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
36334
36349
|
Toast,
|
|
36335
36350
|
{
|
|
@@ -36598,7 +36613,7 @@ var init_WizardContainer = __esm({
|
|
|
36598
36613
|
const isCompleted = index < currentStep;
|
|
36599
36614
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36600
36615
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36601
|
-
return /* @__PURE__ */ jsxs(
|
|
36616
|
+
return /* @__PURE__ */ jsxs(React115__default.Fragment, { children: [
|
|
36602
36617
|
/* @__PURE__ */ jsx(
|
|
36603
36618
|
Button,
|
|
36604
36619
|
{
|
|
@@ -36980,12 +36995,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
36980
36995
|
}
|
|
36981
36996
|
});
|
|
36982
36997
|
function lazyThree(name, loader) {
|
|
36983
|
-
const Lazy =
|
|
36998
|
+
const Lazy = React115__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
36984
36999
|
function ThreeWrapper(props) {
|
|
36985
|
-
return
|
|
36986
|
-
|
|
37000
|
+
return React115__default.createElement(
|
|
37001
|
+
React115__default.Suspense,
|
|
36987
37002
|
{ fallback: null },
|
|
36988
|
-
|
|
37003
|
+
React115__default.createElement(Lazy, props)
|
|
36989
37004
|
);
|
|
36990
37005
|
}
|
|
36991
37006
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -37473,7 +37488,7 @@ function SuspenseConfigProvider({
|
|
|
37473
37488
|
config,
|
|
37474
37489
|
children
|
|
37475
37490
|
}) {
|
|
37476
|
-
return
|
|
37491
|
+
return React115__default.createElement(
|
|
37477
37492
|
SuspenseConfigContext.Provider,
|
|
37478
37493
|
{ value: config },
|
|
37479
37494
|
children
|
|
@@ -37903,7 +37918,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
37903
37918
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
37904
37919
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
37905
37920
|
}
|
|
37906
|
-
return /* @__PURE__ */ jsx(
|
|
37921
|
+
return /* @__PURE__ */ jsx(React115__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
37907
37922
|
}
|
|
37908
37923
|
if (!child || typeof child !== "object") return null;
|
|
37909
37924
|
const childId = `${parentId}-${index}`;
|
|
@@ -37956,19 +37971,15 @@ function SlotContentRenderer({
|
|
|
37956
37971
|
patternPath
|
|
37957
37972
|
}) {
|
|
37958
37973
|
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]);
|
|
37974
|
+
if (typeof entityProp === "string" && entityProp.length > 0) {
|
|
37975
|
+
if (typeof process !== "undefined" && process.env && process.env.NODE_ENV !== "production") {
|
|
37976
|
+
throw new Error(
|
|
37977
|
+
`[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.`
|
|
37978
|
+
);
|
|
37979
|
+
}
|
|
37980
|
+
}
|
|
37970
37981
|
const schemaCtx = useEntitySchemaOptional();
|
|
37971
|
-
const entityDef =
|
|
37982
|
+
const entityDef = typeof entityProp === "string" && entityProp.length > 0 && schemaCtx ? schemaCtx.entities.get(entityProp) : void 0;
|
|
37972
37983
|
const PatternComponent = getComponentForPattern(content.pattern);
|
|
37973
37984
|
if (PatternComponent) {
|
|
37974
37985
|
const childrenConfig = content.props.children;
|
|
@@ -37977,12 +37988,7 @@ function SlotContentRenderer({
|
|
|
37977
37988
|
const renderedChildren = hasChildren ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath) : void 0;
|
|
37978
37989
|
const { children: _childrenConfig, ...restProps } = content.props;
|
|
37979
37990
|
const renderedProps = renderPatternProps(restProps, onDismiss);
|
|
37980
|
-
|
|
37981
|
-
if (entityType) {
|
|
37982
|
-
finalProps = { ...renderedProps, entity: storeData };
|
|
37983
|
-
} else {
|
|
37984
|
-
finalProps = renderedProps;
|
|
37985
|
-
}
|
|
37991
|
+
const finalProps = renderedProps;
|
|
37986
37992
|
const resolvedItems = Array.isArray(
|
|
37987
37993
|
finalProps.entity
|
|
37988
37994
|
) ? finalProps.entity : null;
|
|
@@ -37996,9 +38002,6 @@ function SlotContentRenderer({
|
|
|
37996
38002
|
const isFormPattern = FORM_PATTERNS.has(content.pattern) || content.pattern.includes("form");
|
|
37997
38003
|
if (isFormPattern && entityDef && Array.isArray(finalProps.fields)) {
|
|
37998
38004
|
finalProps.fields = enrichFormFields(finalProps.fields, entityDef);
|
|
37999
|
-
if (finalProps.mode === "edit" && !finalProps.initialData && storeData.length > 0) {
|
|
38000
|
-
finalProps.initialData = storeData[0];
|
|
38001
|
-
}
|
|
38002
38005
|
}
|
|
38003
38006
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
38004
38007
|
return /* @__PURE__ */ jsx(
|
|
@@ -38092,7 +38095,7 @@ function UISlotRenderer({
|
|
|
38092
38095
|
}
|
|
38093
38096
|
return wrapped;
|
|
38094
38097
|
}
|
|
38095
|
-
var TRAIT_BINDING_RE,
|
|
38098
|
+
var TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, FORM_PATTERNS, PATTERNS_WITH_CHILDREN;
|
|
38096
38099
|
var init_UISlotRenderer = __esm({
|
|
38097
38100
|
"components/organisms/UISlotRenderer.tsx"() {
|
|
38098
38101
|
"use client";
|
|
@@ -38109,7 +38112,6 @@ var init_UISlotRenderer = __esm({
|
|
|
38109
38112
|
init_TraitFrame();
|
|
38110
38113
|
init_component_registry_generated();
|
|
38111
38114
|
TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
|
|
38112
|
-
STRING_ENTITY_WARNED = /* @__PURE__ */ new Set();
|
|
38113
38115
|
SuspenseConfigContext = createContext({ enabled: false });
|
|
38114
38116
|
SlotContainedContext = createContext(false);
|
|
38115
38117
|
SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
|
|
@@ -38159,177 +38161,6 @@ var init_UISlotRenderer = __esm({
|
|
|
38159
38161
|
// providers/OrbitalProvider.tsx
|
|
38160
38162
|
init_ThemeContext();
|
|
38161
38163
|
|
|
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
38164
|
// providers/EventBusProvider.tsx
|
|
38334
38165
|
init_useEventBus();
|
|
38335
38166
|
init_logger();
|
|
@@ -38357,11 +38188,15 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
38357
38188
|
deprecationWarningShown.current = true;
|
|
38358
38189
|
}
|
|
38359
38190
|
}, []);
|
|
38360
|
-
const emit = useCallback((type, payload) => {
|
|
38191
|
+
const emit = useCallback((type, payload, source) => {
|
|
38361
38192
|
const event = {
|
|
38362
38193
|
type,
|
|
38194
|
+
// Narrow at the bus boundary: public emit takes Record for ergonomics
|
|
38195
|
+
// (generic UI components pass consumer-defined rows) while the envelope
|
|
38196
|
+
// stores the payload as EventPayload for listeners.
|
|
38363
38197
|
payload,
|
|
38364
|
-
timestamp: Date.now()
|
|
38198
|
+
timestamp: Date.now(),
|
|
38199
|
+
source
|
|
38365
38200
|
};
|
|
38366
38201
|
const listeners6 = listenersRef.current.get(type);
|
|
38367
38202
|
const listenerCount = (listeners6?.size ?? 0) + anyListenersRef.current.size;
|
|
@@ -38436,7 +38271,7 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
38436
38271
|
}
|
|
38437
38272
|
};
|
|
38438
38273
|
}, [debug2]);
|
|
38439
|
-
const
|
|
38274
|
+
const contextValue = useMemo(
|
|
38440
38275
|
() => ({
|
|
38441
38276
|
emit,
|
|
38442
38277
|
on,
|
|
@@ -38449,12 +38284,12 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
38449
38284
|
[emit, on, once, hasListeners, onAny, getSelectedEntity, clearSelectedEntity]
|
|
38450
38285
|
);
|
|
38451
38286
|
useEffect(() => {
|
|
38452
|
-
setGlobalEventBus(
|
|
38287
|
+
setGlobalEventBus(contextValue);
|
|
38453
38288
|
return () => {
|
|
38454
38289
|
setGlobalEventBus(null);
|
|
38455
38290
|
};
|
|
38456
|
-
}, [
|
|
38457
|
-
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value:
|
|
38291
|
+
}, [contextValue]);
|
|
38292
|
+
return /* @__PURE__ */ jsx(EventBusContext2.Provider, { value: contextValue, children });
|
|
38458
38293
|
}
|
|
38459
38294
|
|
|
38460
38295
|
// providers/SelectionProvider.tsx
|
|
@@ -38527,13 +38362,13 @@ function SelectionProvider({
|
|
|
38527
38362
|
unsubCancel();
|
|
38528
38363
|
};
|
|
38529
38364
|
}, [eventBus, setSelected, clearSelection, debug2]);
|
|
38530
|
-
const
|
|
38365
|
+
const contextValue = {
|
|
38531
38366
|
selected,
|
|
38532
38367
|
setSelected,
|
|
38533
38368
|
clearSelection,
|
|
38534
38369
|
isSelected
|
|
38535
38370
|
};
|
|
38536
|
-
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value:
|
|
38371
|
+
return /* @__PURE__ */ jsx(SelectionContext.Provider, { value: contextValue, children });
|
|
38537
38372
|
}
|
|
38538
38373
|
function useSelection() {
|
|
38539
38374
|
const context = useContext(SelectionContext);
|
|
@@ -38750,7 +38585,7 @@ function OrbitalProvider({
|
|
|
38750
38585
|
() => ({ enabled: suspense }),
|
|
38751
38586
|
[suspense]
|
|
38752
38587
|
);
|
|
38753
|
-
const inner = /* @__PURE__ */ jsx(
|
|
38588
|
+
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
38589
|
if (skipTheme) {
|
|
38755
38590
|
return inner;
|
|
38756
38591
|
}
|
|
@@ -38783,7 +38618,7 @@ function FetchedDataProvider({
|
|
|
38783
38618
|
},
|
|
38784
38619
|
[state.data]
|
|
38785
38620
|
);
|
|
38786
|
-
const
|
|
38621
|
+
const getById = useCallback(
|
|
38787
38622
|
(entityName, id) => {
|
|
38788
38623
|
const records = state.data[entityName];
|
|
38789
38624
|
return records?.find((r) => r.id === id);
|
|
@@ -38847,10 +38682,10 @@ function FetchedDataProvider({
|
|
|
38847
38682
|
const setError = useCallback((error) => {
|
|
38848
38683
|
setState((prev) => ({ ...prev, error, loading: false }));
|
|
38849
38684
|
}, []);
|
|
38850
|
-
const
|
|
38685
|
+
const contextValue = useMemo(
|
|
38851
38686
|
() => ({
|
|
38852
38687
|
getData,
|
|
38853
|
-
getById
|
|
38688
|
+
getById,
|
|
38854
38689
|
hasData,
|
|
38855
38690
|
getFetchedAt,
|
|
38856
38691
|
setData,
|
|
@@ -38863,7 +38698,7 @@ function FetchedDataProvider({
|
|
|
38863
38698
|
}),
|
|
38864
38699
|
[
|
|
38865
38700
|
getData,
|
|
38866
|
-
|
|
38701
|
+
getById,
|
|
38867
38702
|
hasData,
|
|
38868
38703
|
getFetchedAt,
|
|
38869
38704
|
setData,
|
|
@@ -38875,7 +38710,7 @@ function FetchedDataProvider({
|
|
|
38875
38710
|
setError
|
|
38876
38711
|
]
|
|
38877
38712
|
);
|
|
38878
|
-
return /* @__PURE__ */ jsx(FetchedDataContext.Provider, { value:
|
|
38713
|
+
return /* @__PURE__ */ jsx(FetchedDataContext.Provider, { value: contextValue, children });
|
|
38879
38714
|
}
|
|
38880
38715
|
function useFetchedDataContext() {
|
|
38881
38716
|
return useContext(FetchedDataContext);
|
|
@@ -38932,7 +38767,7 @@ function OfflineModeProvider({
|
|
|
38932
38767
|
const [forceOffline, setForceOffline] = useState(false);
|
|
38933
38768
|
const executor = useOfflineExecutor(executorOptions);
|
|
38934
38769
|
const effectivelyOffline = executor.isOffline || forceOffline;
|
|
38935
|
-
const
|
|
38770
|
+
const contextValue = useMemo(
|
|
38936
38771
|
() => ({
|
|
38937
38772
|
...executor,
|
|
38938
38773
|
forceOffline,
|
|
@@ -38941,7 +38776,7 @@ function OfflineModeProvider({
|
|
|
38941
38776
|
}),
|
|
38942
38777
|
[executor, forceOffline, effectivelyOffline]
|
|
38943
38778
|
);
|
|
38944
|
-
return /* @__PURE__ */ jsx(OfflineModeContext.Provider, { value:
|
|
38779
|
+
return /* @__PURE__ */ jsx(OfflineModeContext.Provider, { value: contextValue, children });
|
|
38945
38780
|
}
|
|
38946
38781
|
function useOfflineMode() {
|
|
38947
38782
|
const context = useContext(OfflineModeContext);
|
|
@@ -38954,4 +38789,4 @@ function useOptionalOfflineMode() {
|
|
|
38954
38789
|
return useContext(OfflineModeContext);
|
|
38955
38790
|
}
|
|
38956
38791
|
|
|
38957
|
-
export {
|
|
38792
|
+
export { EventBusContext2 as EventBusContext, EventBusProvider, FetchedDataContext, FetchedDataProvider, OfflineModeProvider, OrbitalProvider, SelectionContext, SelectionProvider, VerificationProvider, useFetchedData, useFetchedDataContext, useFetchedEntity, useOfflineMode, useOptionalOfflineMode, useSelection, useSelectionOptional };
|