@almadar/ui 5.25.1 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +2001 -2178
- package/dist/avl/index.js +950 -1127
- package/dist/components/core/atoms/FlipContainer.d.ts +4 -4
- package/dist/components/core/atoms/Icon.d.ts +4 -2
- package/dist/components/core/atoms/ProgressBar.d.ts +1 -1
- package/dist/components/core/atoms/types.d.ts +6 -0
- package/dist/components/core/molecules/ArrayEditor.d.ts +15 -0
- package/dist/components/core/molecules/Carousel.d.ts +8 -2
- package/dist/components/core/molecules/Container.d.ts +4 -4
- package/dist/components/core/molecules/DateRangeSelector.d.ts +3 -4
- package/dist/components/core/molecules/DocSidebar.d.ts +4 -4
- package/dist/components/core/molecules/EdgeDecoration.d.ts +3 -2
- package/dist/components/core/molecules/Flex.d.ts +4 -4
- package/dist/components/core/molecules/FlipCard.d.ts +3 -4
- package/dist/components/core/molecules/GradientDivider.d.ts +3 -2
- package/dist/components/core/molecules/MapEditor.d.ts +16 -0
- package/dist/components/core/molecules/ObjectEditor.d.ts +15 -0
- package/dist/components/core/molecules/SidePanel.d.ts +4 -4
- package/dist/components/core/molecules/SortableList.d.ts +4 -5
- package/dist/components/core/molecules/ViolationAlert.d.ts +4 -9
- package/dist/components/core/molecules/index.d.ts +4 -3
- package/dist/components/core/molecules/markdown/CodeBlock.d.ts +44 -2
- package/dist/components/game/atoms/ResourceCounter.d.ts +3 -2
- package/dist/components/game/atoms/StateIndicator.d.ts +4 -5
- package/dist/components/game/atoms/StatusEffect.d.ts +2 -3
- package/dist/components/game/molecules/ActionButtons.d.ts +6 -0
- package/dist/components/game/molecules/GameHud.d.ts +2 -3
- package/dist/components/game/molecules/StatBadge.d.ts +6 -0
- package/dist/components/game/organisms/puzzles/state-architect/StateJsonView.d.ts +16 -0
- package/dist/components/game/organisms/puzzles/state-architect/index.d.ts +2 -2
- package/dist/components/index.cjs +2249 -1975
- package/dist/components/index.js +1349 -1075
- package/dist/docs/index.cjs +6014 -4606
- package/dist/docs/index.css +1252 -0
- package/dist/docs/index.d.cts +108 -16
- package/dist/docs/index.d.ts +2 -2
- package/dist/docs/index.js +5970 -4567
- package/dist/marketing/index.cjs +32 -9
- package/dist/marketing/index.d.cts +30 -20
- package/dist/marketing/index.js +32 -9
- package/dist/providers/index.cjs +1826 -2003
- package/dist/providers/index.js +925 -1102
- package/dist/runtime/index.cjs +1866 -2043
- package/dist/runtime/index.js +929 -1106
- package/package.json +1 -1
- package/dist/components/core/molecules/CodeViewer.d.ts +0 -70
- package/dist/components/core/molecules/DocCodeBlock.d.ts +0 -14
- package/dist/components/game/organisms/puzzles/state-architect/CodeView.d.ts +0 -24
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React85 from 'react';
|
|
2
|
+
import React85__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { EventBusContext, useTraitScope, TraitScopeProvider } from '@almadar/ui/providers';
|
|
@@ -657,7 +657,7 @@ var init_Box = __esm({
|
|
|
657
657
|
fixed: "fixed",
|
|
658
658
|
sticky: "sticky"
|
|
659
659
|
};
|
|
660
|
-
Box =
|
|
660
|
+
Box = React85__default.forwardRef(
|
|
661
661
|
({
|
|
662
662
|
padding,
|
|
663
663
|
paddingX,
|
|
@@ -707,7 +707,7 @@ var init_Box = __esm({
|
|
|
707
707
|
onMouseLeave?.(e);
|
|
708
708
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
709
709
|
const isClickable = action || onClick;
|
|
710
|
-
return
|
|
710
|
+
return React85__default.createElement(
|
|
711
711
|
Component,
|
|
712
712
|
{
|
|
713
713
|
ref,
|
|
@@ -1446,12 +1446,20 @@ function doResolve(name) {
|
|
|
1446
1446
|
if (asIs && typeof asIs === "object") return asIs;
|
|
1447
1447
|
return LucideIcons2.HelpCircle;
|
|
1448
1448
|
}
|
|
1449
|
-
var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
1449
|
+
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
1450
1450
|
var init_Icon = __esm({
|
|
1451
1451
|
"components/core/atoms/Icon.tsx"() {
|
|
1452
1452
|
"use client";
|
|
1453
1453
|
init_cn();
|
|
1454
1454
|
init_iconFamily();
|
|
1455
|
+
colorTokenClasses = {
|
|
1456
|
+
primary: "text-primary",
|
|
1457
|
+
secondary: "text-secondary",
|
|
1458
|
+
success: "text-success",
|
|
1459
|
+
warning: "text-warning",
|
|
1460
|
+
error: "text-error",
|
|
1461
|
+
muted: "text-muted-foreground"
|
|
1462
|
+
};
|
|
1455
1463
|
iconAliases = {
|
|
1456
1464
|
"close": LucideIcons2.X,
|
|
1457
1465
|
"trash": LucideIcons2.Trash2,
|
|
@@ -1490,7 +1498,7 @@ var init_Icon = __esm({
|
|
|
1490
1498
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1491
1499
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1492
1500
|
const family = useIconFamily();
|
|
1493
|
-
const RenderedComponent =
|
|
1501
|
+
const RenderedComponent = React85__default.useMemo(() => {
|
|
1494
1502
|
if (directIcon) return null;
|
|
1495
1503
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1496
1504
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1499,10 +1507,11 @@ var init_Icon = __esm({
|
|
|
1499
1507
|
...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
|
|
1500
1508
|
...style
|
|
1501
1509
|
};
|
|
1510
|
+
const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
|
|
1502
1511
|
const composedClassName = cn(
|
|
1503
1512
|
sizeClasses[size],
|
|
1504
1513
|
animationClasses[animation],
|
|
1505
|
-
|
|
1514
|
+
resolvedColor,
|
|
1506
1515
|
className
|
|
1507
1516
|
);
|
|
1508
1517
|
if (directIcon) {
|
|
@@ -1548,7 +1557,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1548
1557
|
const IconComp = value;
|
|
1549
1558
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1550
1559
|
}
|
|
1551
|
-
if (
|
|
1560
|
+
if (React85__default.isValidElement(value)) {
|
|
1552
1561
|
return value;
|
|
1553
1562
|
}
|
|
1554
1563
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1624,7 +1633,7 @@ var init_Button = __esm({
|
|
|
1624
1633
|
md: "h-icon-default w-icon-default",
|
|
1625
1634
|
lg: "h-icon-default w-icon-default"
|
|
1626
1635
|
};
|
|
1627
|
-
Button =
|
|
1636
|
+
Button = React85__default.forwardRef(
|
|
1628
1637
|
({
|
|
1629
1638
|
className,
|
|
1630
1639
|
variant = "primary",
|
|
@@ -1689,7 +1698,7 @@ var Dialog;
|
|
|
1689
1698
|
var init_Dialog = __esm({
|
|
1690
1699
|
"components/core/atoms/Dialog.tsx"() {
|
|
1691
1700
|
init_cn();
|
|
1692
|
-
Dialog =
|
|
1701
|
+
Dialog = React85__default.forwardRef(
|
|
1693
1702
|
({
|
|
1694
1703
|
role = "dialog",
|
|
1695
1704
|
"aria-modal": ariaModal = true,
|
|
@@ -1830,43 +1839,6 @@ var init_Typography = __esm({
|
|
|
1830
1839
|
Typography.displayName = "Typography";
|
|
1831
1840
|
}
|
|
1832
1841
|
});
|
|
1833
|
-
var Overlay;
|
|
1834
|
-
var init_Overlay = __esm({
|
|
1835
|
-
"components/core/atoms/Overlay.tsx"() {
|
|
1836
|
-
"use client";
|
|
1837
|
-
init_cn();
|
|
1838
|
-
init_useEventBus();
|
|
1839
|
-
Overlay = ({
|
|
1840
|
-
isVisible = true,
|
|
1841
|
-
onClick,
|
|
1842
|
-
className,
|
|
1843
|
-
blur = false,
|
|
1844
|
-
action
|
|
1845
|
-
}) => {
|
|
1846
|
-
const eventBus = useEventBus();
|
|
1847
|
-
if (!isVisible) return null;
|
|
1848
|
-
const handleClick = (e) => {
|
|
1849
|
-
if (action) {
|
|
1850
|
-
eventBus.emit(`UI:${action}`, {});
|
|
1851
|
-
}
|
|
1852
|
-
onClick?.(e);
|
|
1853
|
-
};
|
|
1854
|
-
return /* @__PURE__ */ jsx(
|
|
1855
|
-
"div",
|
|
1856
|
-
{
|
|
1857
|
-
className: cn(
|
|
1858
|
-
"fixed inset-0 z-40",
|
|
1859
|
-
blur && "backdrop-blur-sm",
|
|
1860
|
-
className
|
|
1861
|
-
),
|
|
1862
|
-
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
1863
|
-
onClick: action || onClick ? handleClick : void 0,
|
|
1864
|
-
"aria-hidden": "true"
|
|
1865
|
-
}
|
|
1866
|
-
);
|
|
1867
|
-
};
|
|
1868
|
-
}
|
|
1869
|
-
});
|
|
1870
1842
|
var sizeClasses2, minWidthClasses, lookStyles, Modal;
|
|
1871
1843
|
var init_Modal = __esm({
|
|
1872
1844
|
"components/core/molecules/Modal.tsx"() {
|
|
@@ -1875,7 +1847,6 @@ var init_Modal = __esm({
|
|
|
1875
1847
|
init_Button();
|
|
1876
1848
|
init_Dialog();
|
|
1877
1849
|
init_Typography();
|
|
1878
|
-
init_Overlay();
|
|
1879
1850
|
init_cn();
|
|
1880
1851
|
init_useEventBus();
|
|
1881
1852
|
sizeClasses2 = {
|
|
@@ -1965,130 +1936,160 @@ var init_Modal = __esm({
|
|
|
1965
1936
|
}
|
|
1966
1937
|
};
|
|
1967
1938
|
return createPortal(
|
|
1968
|
-
/* @__PURE__ */
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
1939
|
+
/* @__PURE__ */ jsx(
|
|
1940
|
+
"div",
|
|
1941
|
+
{
|
|
1942
|
+
className: cn(
|
|
1943
|
+
"fixed inset-0 z-[1000]",
|
|
1944
|
+
"flex items-start justify-center px-4 pb-4 pt-[10vh]",
|
|
1945
|
+
"max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
|
|
1946
|
+
),
|
|
1947
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
1948
|
+
onClick: handleOverlayClick,
|
|
1949
|
+
"aria-hidden": "true",
|
|
1950
|
+
children: /* @__PURE__ */ jsxs(
|
|
1951
|
+
Dialog,
|
|
1952
|
+
{
|
|
1953
|
+
ref: modalRef,
|
|
1954
|
+
open: true,
|
|
1955
|
+
className: cn(
|
|
1956
|
+
// Reset browser-default dialog chrome — we own styling. `static`
|
|
1957
|
+
// overrides the user-agent `position: absolute` so the parent
|
|
1958
|
+
// flex container's `justify-center` actually centers the dialog
|
|
1959
|
+
// (without this, the dialog drops out of flex flow and `m-0`
|
|
1960
|
+
// kills the user-agent's `margin: auto` centering, pinning the
|
|
1961
|
+
// dialog to top-left).
|
|
1962
|
+
"static m-0 p-0 border-0 bg-transparent",
|
|
1963
|
+
// Pre-existing dialog frame
|
|
1964
|
+
"pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
|
|
1965
|
+
// Desktop sizing + viewport-aware floor.
|
|
1966
|
+
sizeClasses2[size],
|
|
1967
|
+
minWidthClasses[size],
|
|
1968
|
+
"max-h-[80vh]",
|
|
1969
|
+
// Mobile: take the entire screen. Override desktop max-w cap,
|
|
1970
|
+
// full height, no rounded corners, no min-width.
|
|
1971
|
+
"max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
|
|
1972
|
+
lookStyles[look],
|
|
1973
|
+
className
|
|
1974
|
+
),
|
|
1975
|
+
style: dragY > 0 ? {
|
|
1976
|
+
transform: `translateY(${dragY}px)`,
|
|
1977
|
+
transition: isDragging.current ? "none" : "transform 200ms ease-out"
|
|
1978
|
+
} : void 0,
|
|
1979
|
+
...title && { "aria-labelledby": "modal-title" },
|
|
1980
|
+
children: [
|
|
1981
|
+
/* @__PURE__ */ jsx(
|
|
1982
|
+
Box,
|
|
1983
|
+
{
|
|
1984
|
+
className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
|
|
1985
|
+
onPointerDown: (e) => {
|
|
1986
|
+
if (!swipeDownToClose) return;
|
|
1987
|
+
dragStartY.current = e.clientY;
|
|
1988
|
+
isDragging.current = true;
|
|
1989
|
+
e.target.setPointerCapture(e.pointerId);
|
|
1990
|
+
},
|
|
1991
|
+
onPointerMove: (e) => {
|
|
1992
|
+
if (!isDragging.current) return;
|
|
1993
|
+
const dy = Math.max(0, e.clientY - dragStartY.current);
|
|
1994
|
+
setDragY(dy);
|
|
1995
|
+
},
|
|
1996
|
+
onPointerUp: () => {
|
|
1997
|
+
if (!isDragging.current) return;
|
|
1998
|
+
isDragging.current = false;
|
|
1999
|
+
if (dragY > 100) {
|
|
2000
|
+
handleClose();
|
|
2001
|
+
}
|
|
2002
|
+
setDragY(0);
|
|
2003
|
+
},
|
|
2004
|
+
onPointerCancel: () => {
|
|
2005
|
+
isDragging.current = false;
|
|
2006
|
+
setDragY(0);
|
|
2007
|
+
},
|
|
2008
|
+
children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
|
|
2009
|
+
}
|
|
2009
2010
|
),
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
const dy = Math.max(0, e.clientY - dragStartY.current);
|
|
2029
|
-
setDragY(dy);
|
|
2030
|
-
},
|
|
2031
|
-
onPointerUp: () => {
|
|
2032
|
-
if (!isDragging.current) return;
|
|
2033
|
-
isDragging.current = false;
|
|
2034
|
-
if (dragY > 100) {
|
|
2035
|
-
handleClose();
|
|
2011
|
+
(title || showCloseButton) && /* @__PURE__ */ jsxs(
|
|
2012
|
+
Box,
|
|
2013
|
+
{
|
|
2014
|
+
className: cn(
|
|
2015
|
+
"px-6 py-4 flex items-center justify-between",
|
|
2016
|
+
"border-b-[length:var(--border-width)] border-border"
|
|
2017
|
+
),
|
|
2018
|
+
children: [
|
|
2019
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
|
|
2020
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
2021
|
+
Button,
|
|
2022
|
+
{
|
|
2023
|
+
variant: "ghost",
|
|
2024
|
+
size: "sm",
|
|
2025
|
+
icon: "x",
|
|
2026
|
+
onClick: handleClose,
|
|
2027
|
+
"data-event": "CLOSE",
|
|
2028
|
+
"aria-label": t("aria.closeModal")
|
|
2036
2029
|
}
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
{
|
|
2058
|
-
variant: "ghost",
|
|
2059
|
-
size: "sm",
|
|
2060
|
-
icon: "x",
|
|
2061
|
-
onClick: handleClose,
|
|
2062
|
-
"data-event": "CLOSE",
|
|
2063
|
-
"aria-label": t("aria.closeModal")
|
|
2064
|
-
}
|
|
2065
|
-
)
|
|
2066
|
-
]
|
|
2067
|
-
}
|
|
2068
|
-
),
|
|
2069
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
|
|
2070
|
-
footer && /* @__PURE__ */ jsx(
|
|
2071
|
-
Box,
|
|
2072
|
-
{
|
|
2073
|
-
className: cn(
|
|
2074
|
-
"px-6 py-4 bg-muted",
|
|
2075
|
-
"border-t-[length:var(--border-width)] border-border"
|
|
2076
|
-
),
|
|
2077
|
-
children: footer
|
|
2078
|
-
}
|
|
2079
|
-
)
|
|
2080
|
-
]
|
|
2081
|
-
}
|
|
2082
|
-
)
|
|
2083
|
-
}
|
|
2084
|
-
)
|
|
2085
|
-
] }),
|
|
2030
|
+
)
|
|
2031
|
+
]
|
|
2032
|
+
}
|
|
2033
|
+
),
|
|
2034
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
|
|
2035
|
+
footer && /* @__PURE__ */ jsx(
|
|
2036
|
+
Box,
|
|
2037
|
+
{
|
|
2038
|
+
className: cn(
|
|
2039
|
+
"px-6 py-4 bg-muted",
|
|
2040
|
+
"border-t-[length:var(--border-width)] border-border"
|
|
2041
|
+
),
|
|
2042
|
+
children: footer
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
]
|
|
2046
|
+
}
|
|
2047
|
+
)
|
|
2048
|
+
}
|
|
2049
|
+
),
|
|
2086
2050
|
document.body
|
|
2087
2051
|
);
|
|
2088
2052
|
};
|
|
2089
2053
|
Modal.displayName = "Modal";
|
|
2090
2054
|
}
|
|
2091
2055
|
});
|
|
2056
|
+
var Overlay;
|
|
2057
|
+
var init_Overlay = __esm({
|
|
2058
|
+
"components/core/atoms/Overlay.tsx"() {
|
|
2059
|
+
"use client";
|
|
2060
|
+
init_cn();
|
|
2061
|
+
init_useEventBus();
|
|
2062
|
+
Overlay = ({
|
|
2063
|
+
isVisible = true,
|
|
2064
|
+
onClick,
|
|
2065
|
+
className,
|
|
2066
|
+
blur = false,
|
|
2067
|
+
action
|
|
2068
|
+
}) => {
|
|
2069
|
+
const eventBus = useEventBus();
|
|
2070
|
+
if (!isVisible) return null;
|
|
2071
|
+
const handleClick = (e) => {
|
|
2072
|
+
if (action) {
|
|
2073
|
+
eventBus.emit(`UI:${action}`, {});
|
|
2074
|
+
}
|
|
2075
|
+
onClick?.(e);
|
|
2076
|
+
};
|
|
2077
|
+
return /* @__PURE__ */ jsx(
|
|
2078
|
+
"div",
|
|
2079
|
+
{
|
|
2080
|
+
className: cn(
|
|
2081
|
+
"fixed inset-0 z-40",
|
|
2082
|
+
blur && "backdrop-blur-sm",
|
|
2083
|
+
className
|
|
2084
|
+
),
|
|
2085
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
2086
|
+
onClick: action || onClick ? handleClick : void 0,
|
|
2087
|
+
"aria-hidden": "true"
|
|
2088
|
+
}
|
|
2089
|
+
);
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
2092
2093
|
var sizeWidths, Drawer;
|
|
2093
2094
|
var init_Drawer = __esm({
|
|
2094
2095
|
"components/core/molecules/Drawer.tsx"() {
|
|
@@ -2311,7 +2312,7 @@ var init_Badge = __esm({
|
|
|
2311
2312
|
md: "px-2.5 py-1 text-sm",
|
|
2312
2313
|
lg: "px-3 py-1.5 text-base"
|
|
2313
2314
|
};
|
|
2314
|
-
Badge =
|
|
2315
|
+
Badge = React85__default.forwardRef(
|
|
2315
2316
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2316
2317
|
const iconSizes3 = {
|
|
2317
2318
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2627,7 +2628,7 @@ var init_SvgFlow = __esm({
|
|
|
2627
2628
|
opacity = 1,
|
|
2628
2629
|
className
|
|
2629
2630
|
}) => {
|
|
2630
|
-
const markerId =
|
|
2631
|
+
const markerId = React85__default.useMemo(() => {
|
|
2631
2632
|
flowIdCounter += 1;
|
|
2632
2633
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2633
2634
|
}, []);
|
|
@@ -3170,7 +3171,7 @@ var init_SvgRing = __esm({
|
|
|
3170
3171
|
className,
|
|
3171
3172
|
label
|
|
3172
3173
|
}) => {
|
|
3173
|
-
const gradientId =
|
|
3174
|
+
const gradientId = React85__default.useMemo(() => {
|
|
3174
3175
|
ringIdCounter += 1;
|
|
3175
3176
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
3176
3177
|
}, []);
|
|
@@ -3332,7 +3333,7 @@ var init_Input = __esm({
|
|
|
3332
3333
|
"components/core/atoms/Input.tsx"() {
|
|
3333
3334
|
init_cn();
|
|
3334
3335
|
init_Icon();
|
|
3335
|
-
Input =
|
|
3336
|
+
Input = React85__default.forwardRef(
|
|
3336
3337
|
({
|
|
3337
3338
|
className,
|
|
3338
3339
|
inputType,
|
|
@@ -3453,7 +3454,7 @@ var Label;
|
|
|
3453
3454
|
var init_Label = __esm({
|
|
3454
3455
|
"components/core/atoms/Label.tsx"() {
|
|
3455
3456
|
init_cn();
|
|
3456
|
-
Label =
|
|
3457
|
+
Label = React85__default.forwardRef(
|
|
3457
3458
|
({ className, required, children, ...props }, ref) => {
|
|
3458
3459
|
return /* @__PURE__ */ jsxs(
|
|
3459
3460
|
"label",
|
|
@@ -3479,7 +3480,7 @@ var Textarea;
|
|
|
3479
3480
|
var init_Textarea = __esm({
|
|
3480
3481
|
"components/core/atoms/Textarea.tsx"() {
|
|
3481
3482
|
init_cn();
|
|
3482
|
-
Textarea =
|
|
3483
|
+
Textarea = React85__default.forwardRef(
|
|
3483
3484
|
({ className, error, ...props }, ref) => {
|
|
3484
3485
|
return /* @__PURE__ */ jsx(
|
|
3485
3486
|
"textarea",
|
|
@@ -3509,7 +3510,7 @@ var init_Select = __esm({
|
|
|
3509
3510
|
"components/core/atoms/Select.tsx"() {
|
|
3510
3511
|
init_cn();
|
|
3511
3512
|
init_Icon();
|
|
3512
|
-
Select =
|
|
3513
|
+
Select = React85__default.forwardRef(
|
|
3513
3514
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3514
3515
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3515
3516
|
/* @__PURE__ */ jsxs(
|
|
@@ -3551,7 +3552,7 @@ var Checkbox;
|
|
|
3551
3552
|
var init_Checkbox = __esm({
|
|
3552
3553
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3553
3554
|
init_cn();
|
|
3554
|
-
Checkbox =
|
|
3555
|
+
Checkbox = React85__default.forwardRef(
|
|
3555
3556
|
({ className, label, id, ...props }, ref) => {
|
|
3556
3557
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3557
3558
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3642,7 +3643,7 @@ var init_Card = __esm({
|
|
|
3642
3643
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3643
3644
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3644
3645
|
};
|
|
3645
|
-
Card =
|
|
3646
|
+
Card = React85__default.forwardRef(
|
|
3646
3647
|
({
|
|
3647
3648
|
className,
|
|
3648
3649
|
variant = "bordered",
|
|
@@ -3680,9 +3681,9 @@ var init_Card = __esm({
|
|
|
3680
3681
|
}
|
|
3681
3682
|
);
|
|
3682
3683
|
Card.displayName = "Card";
|
|
3683
|
-
CardHeader =
|
|
3684
|
+
CardHeader = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3684
3685
|
CardHeader.displayName = "CardHeader";
|
|
3685
|
-
CardTitle =
|
|
3686
|
+
CardTitle = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3686
3687
|
"h3",
|
|
3687
3688
|
{
|
|
3688
3689
|
ref,
|
|
@@ -3695,11 +3696,11 @@ var init_Card = __esm({
|
|
|
3695
3696
|
}
|
|
3696
3697
|
));
|
|
3697
3698
|
CardTitle.displayName = "CardTitle";
|
|
3698
|
-
CardContent =
|
|
3699
|
+
CardContent = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3699
3700
|
CardContent.displayName = "CardContent";
|
|
3700
3701
|
CardBody = CardContent;
|
|
3701
3702
|
CardBody.displayName = "CardBody";
|
|
3702
|
-
CardFooter =
|
|
3703
|
+
CardFooter = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3703
3704
|
"div",
|
|
3704
3705
|
{
|
|
3705
3706
|
ref,
|
|
@@ -3754,7 +3755,7 @@ var init_FilterPill = __esm({
|
|
|
3754
3755
|
md: "w-3.5 h-3.5",
|
|
3755
3756
|
lg: "w-4 h-4"
|
|
3756
3757
|
};
|
|
3757
|
-
FilterPill =
|
|
3758
|
+
FilterPill = React85__default.forwardRef(
|
|
3758
3759
|
({
|
|
3759
3760
|
className,
|
|
3760
3761
|
variant = "default",
|
|
@@ -3831,7 +3832,7 @@ var init_Spinner = __esm({
|
|
|
3831
3832
|
md: "h-6 w-6",
|
|
3832
3833
|
lg: "h-8 w-8"
|
|
3833
3834
|
};
|
|
3834
|
-
Spinner =
|
|
3835
|
+
Spinner = React85__default.forwardRef(
|
|
3835
3836
|
({ className, size = "md", ...props }, ref) => {
|
|
3836
3837
|
return /* @__PURE__ */ jsx(
|
|
3837
3838
|
"div",
|
|
@@ -3910,13 +3911,12 @@ var init_Avatar = __esm({
|
|
|
3910
3911
|
actionPayload
|
|
3911
3912
|
}) => {
|
|
3912
3913
|
const eventBus = useEventBus();
|
|
3913
|
-
const [imgFailed, setImgFailed] =
|
|
3914
|
-
|
|
3914
|
+
const [imgFailed, setImgFailed] = React85__default.useState(false);
|
|
3915
|
+
React85__default.useEffect(() => {
|
|
3915
3916
|
setImgFailed(false);
|
|
3916
3917
|
}, [src]);
|
|
3917
3918
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
3918
3919
|
const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
|
|
3919
|
-
const hasImage = !!src && !imgFailed;
|
|
3920
3920
|
const hasIcon = !!IconComponent;
|
|
3921
3921
|
const hasInitials = !!initials && !(hasIcon && !providedInitials);
|
|
3922
3922
|
const getInitialsBackground = () => "bg-primary text-primary-foreground";
|
|
@@ -3942,15 +3942,13 @@ var init_Avatar = __esm({
|
|
|
3942
3942
|
onClick: isClickable ? handleClick : void 0,
|
|
3943
3943
|
role: isClickable ? "button" : void 0,
|
|
3944
3944
|
tabIndex: isClickable ? 0 : void 0,
|
|
3945
|
-
children:
|
|
3945
|
+
children: src && !imgFailed ? /* @__PURE__ */ jsx(
|
|
3946
3946
|
"img",
|
|
3947
3947
|
{
|
|
3948
3948
|
src,
|
|
3949
3949
|
alt: alt || "Avatar",
|
|
3950
3950
|
className: "w-full h-full object-cover",
|
|
3951
|
-
onError: () =>
|
|
3952
|
-
setImgFailed(true);
|
|
3953
|
-
}
|
|
3951
|
+
onError: () => setImgFailed(true)
|
|
3954
3952
|
}
|
|
3955
3953
|
) : hasInitials ? /* @__PURE__ */ jsx(
|
|
3956
3954
|
"div",
|
|
@@ -4131,6 +4129,7 @@ var init_ProgressBar = __esm({
|
|
|
4131
4129
|
primary: "bg-primary",
|
|
4132
4130
|
success: "bg-success",
|
|
4133
4131
|
warning: "bg-warning",
|
|
4132
|
+
error: "bg-error",
|
|
4134
4133
|
danger: "bg-error"
|
|
4135
4134
|
};
|
|
4136
4135
|
circularSizeClasses = {
|
|
@@ -4296,7 +4295,7 @@ var init_Radio = __esm({
|
|
|
4296
4295
|
md: "w-2.5 h-2.5",
|
|
4297
4296
|
lg: "w-3 h-3"
|
|
4298
4297
|
};
|
|
4299
|
-
Radio =
|
|
4298
|
+
Radio = React85__default.forwardRef(
|
|
4300
4299
|
({
|
|
4301
4300
|
label,
|
|
4302
4301
|
helperText,
|
|
@@ -4313,12 +4312,12 @@ var init_Radio = __esm({
|
|
|
4313
4312
|
onChange,
|
|
4314
4313
|
...props
|
|
4315
4314
|
}, ref) => {
|
|
4316
|
-
const reactId =
|
|
4315
|
+
const reactId = React85__default.useId();
|
|
4317
4316
|
const baseId = id || `radio-${reactId}`;
|
|
4318
4317
|
const hasError = !!error;
|
|
4319
4318
|
const eventBus = useEventBus();
|
|
4320
|
-
const [selected, setSelected] =
|
|
4321
|
-
|
|
4319
|
+
const [selected, setSelected] = React85__default.useState(value);
|
|
4320
|
+
React85__default.useEffect(() => {
|
|
4322
4321
|
if (value !== void 0) setSelected(value);
|
|
4323
4322
|
}, [value]);
|
|
4324
4323
|
const pick = (next, e) => {
|
|
@@ -4500,7 +4499,7 @@ var init_Switch = __esm({
|
|
|
4500
4499
|
"components/core/atoms/Switch.tsx"() {
|
|
4501
4500
|
"use client";
|
|
4502
4501
|
init_cn();
|
|
4503
|
-
Switch =
|
|
4502
|
+
Switch = React85.forwardRef(
|
|
4504
4503
|
({
|
|
4505
4504
|
checked,
|
|
4506
4505
|
defaultChecked = false,
|
|
@@ -4511,10 +4510,10 @@ var init_Switch = __esm({
|
|
|
4511
4510
|
name,
|
|
4512
4511
|
className
|
|
4513
4512
|
}, ref) => {
|
|
4514
|
-
const [isChecked, setIsChecked] =
|
|
4513
|
+
const [isChecked, setIsChecked] = React85.useState(
|
|
4515
4514
|
checked !== void 0 ? checked : defaultChecked
|
|
4516
4515
|
);
|
|
4517
|
-
|
|
4516
|
+
React85.useEffect(() => {
|
|
4518
4517
|
if (checked !== void 0) {
|
|
4519
4518
|
setIsChecked(checked);
|
|
4520
4519
|
}
|
|
@@ -4870,7 +4869,7 @@ var Aside;
|
|
|
4870
4869
|
var init_Aside = __esm({
|
|
4871
4870
|
"components/core/atoms/Aside.tsx"() {
|
|
4872
4871
|
init_cn();
|
|
4873
|
-
Aside =
|
|
4872
|
+
Aside = React85__default.forwardRef(
|
|
4874
4873
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4875
4874
|
);
|
|
4876
4875
|
Aside.displayName = "Aside";
|
|
@@ -4948,8 +4947,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4948
4947
|
className
|
|
4949
4948
|
}) => {
|
|
4950
4949
|
const { t } = useTranslate();
|
|
4951
|
-
const [isVisible, setIsVisible] =
|
|
4952
|
-
const timeoutRef =
|
|
4950
|
+
const [isVisible, setIsVisible] = React85__default.useState(false);
|
|
4951
|
+
const timeoutRef = React85__default.useRef(null);
|
|
4953
4952
|
const handleMouseEnter = () => {
|
|
4954
4953
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4955
4954
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4958,7 +4957,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4958
4957
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4959
4958
|
setIsVisible(false);
|
|
4960
4959
|
};
|
|
4961
|
-
|
|
4960
|
+
React85__default.useEffect(() => {
|
|
4962
4961
|
return () => {
|
|
4963
4962
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4964
4963
|
};
|
|
@@ -5168,7 +5167,7 @@ var init_StatusDot = __esm({
|
|
|
5168
5167
|
md: "w-2.5 h-2.5",
|
|
5169
5168
|
lg: "w-3 h-3"
|
|
5170
5169
|
};
|
|
5171
|
-
StatusDot =
|
|
5170
|
+
StatusDot = React85__default.forwardRef(
|
|
5172
5171
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5173
5172
|
return /* @__PURE__ */ jsx(
|
|
5174
5173
|
"span",
|
|
@@ -5222,7 +5221,7 @@ var init_TrendIndicator = __esm({
|
|
|
5222
5221
|
down: "trending-down",
|
|
5223
5222
|
flat: "arrow-right"
|
|
5224
5223
|
};
|
|
5225
|
-
TrendIndicator =
|
|
5224
|
+
TrendIndicator = React85__default.forwardRef(
|
|
5226
5225
|
({
|
|
5227
5226
|
className,
|
|
5228
5227
|
value,
|
|
@@ -5289,7 +5288,7 @@ var init_RangeSlider = __esm({
|
|
|
5289
5288
|
md: "w-4 h-4",
|
|
5290
5289
|
lg: "w-5 h-5"
|
|
5291
5290
|
};
|
|
5292
|
-
RangeSlider =
|
|
5291
|
+
RangeSlider = React85__default.forwardRef(
|
|
5293
5292
|
({
|
|
5294
5293
|
className,
|
|
5295
5294
|
min = 0,
|
|
@@ -5797,7 +5796,7 @@ var init_ContentSection = __esm({
|
|
|
5797
5796
|
md: "py-16",
|
|
5798
5797
|
lg: "py-24"
|
|
5799
5798
|
};
|
|
5800
|
-
ContentSection =
|
|
5799
|
+
ContentSection = React85__default.forwardRef(
|
|
5801
5800
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5802
5801
|
return /* @__PURE__ */ jsx(
|
|
5803
5802
|
Box,
|
|
@@ -6331,7 +6330,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6331
6330
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6332
6331
|
"none": {}
|
|
6333
6332
|
};
|
|
6334
|
-
AnimatedReveal =
|
|
6333
|
+
AnimatedReveal = React85__default.forwardRef(
|
|
6335
6334
|
({
|
|
6336
6335
|
trigger = "scroll",
|
|
6337
6336
|
animation = "fade-up",
|
|
@@ -6491,7 +6490,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6491
6490
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6492
6491
|
"use client";
|
|
6493
6492
|
init_cn();
|
|
6494
|
-
AnimatedGraphic =
|
|
6493
|
+
AnimatedGraphic = React85__default.forwardRef(
|
|
6495
6494
|
({
|
|
6496
6495
|
src,
|
|
6497
6496
|
svgContent,
|
|
@@ -6514,7 +6513,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6514
6513
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6515
6514
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6516
6515
|
const prevAnimateRef = useRef(animate);
|
|
6517
|
-
const setRef =
|
|
6516
|
+
const setRef = React85__default.useCallback(
|
|
6518
6517
|
(node) => {
|
|
6519
6518
|
containerRef.current = node;
|
|
6520
6519
|
if (typeof ref === "function") ref(node);
|
|
@@ -6739,9 +6738,9 @@ function ScoreDisplay({
|
|
|
6739
6738
|
...rest
|
|
6740
6739
|
}) {
|
|
6741
6740
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
6742
|
-
const [displayValue, setDisplayValue] =
|
|
6743
|
-
const [isAnimating, setIsAnimating] =
|
|
6744
|
-
|
|
6741
|
+
const [displayValue, setDisplayValue] = React85.useState(resolvedValue);
|
|
6742
|
+
const [isAnimating, setIsAnimating] = React85.useState(false);
|
|
6743
|
+
React85.useEffect(() => {
|
|
6745
6744
|
if (!animated || displayValue === resolvedValue) {
|
|
6746
6745
|
setDisplayValue(resolvedValue);
|
|
6747
6746
|
return;
|
|
@@ -6811,9 +6810,9 @@ function ControlButton({
|
|
|
6811
6810
|
className
|
|
6812
6811
|
}) {
|
|
6813
6812
|
const eventBus = useEventBus();
|
|
6814
|
-
const [isPressed, setIsPressed] =
|
|
6813
|
+
const [isPressed, setIsPressed] = React85.useState(false);
|
|
6815
6814
|
const actualPressed = pressed ?? isPressed;
|
|
6816
|
-
const handlePointerDown =
|
|
6815
|
+
const handlePointerDown = React85.useCallback(
|
|
6817
6816
|
(e) => {
|
|
6818
6817
|
e.preventDefault();
|
|
6819
6818
|
if (disabled) return;
|
|
@@ -6823,7 +6822,7 @@ function ControlButton({
|
|
|
6823
6822
|
},
|
|
6824
6823
|
[disabled, pressEvent, eventBus, onPress]
|
|
6825
6824
|
);
|
|
6826
|
-
const handlePointerUp =
|
|
6825
|
+
const handlePointerUp = React85.useCallback(
|
|
6827
6826
|
(e) => {
|
|
6828
6827
|
e.preventDefault();
|
|
6829
6828
|
if (disabled) return;
|
|
@@ -6833,7 +6832,7 @@ function ControlButton({
|
|
|
6833
6832
|
},
|
|
6834
6833
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
6835
6834
|
);
|
|
6836
|
-
const handlePointerLeave =
|
|
6835
|
+
const handlePointerLeave = React85.useCallback(
|
|
6837
6836
|
(e) => {
|
|
6838
6837
|
if (isPressed) {
|
|
6839
6838
|
setIsPressed(false);
|
|
@@ -7104,7 +7103,7 @@ function ResourceCounter({
|
|
|
7104
7103
|
children: [
|
|
7105
7104
|
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
|
|
7106
7105
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
|
|
7107
|
-
/* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
|
|
7106
|
+
/* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
7108
7107
|
value,
|
|
7109
7108
|
max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
7110
7109
|
"/",
|
|
@@ -7115,10 +7114,18 @@ function ResourceCounter({
|
|
|
7115
7114
|
}
|
|
7116
7115
|
);
|
|
7117
7116
|
}
|
|
7118
|
-
var sizeMap5;
|
|
7117
|
+
var colorTokenClasses2, sizeMap5;
|
|
7119
7118
|
var init_ResourceCounter = __esm({
|
|
7120
7119
|
"components/game/atoms/ResourceCounter.tsx"() {
|
|
7121
7120
|
init_cn();
|
|
7121
|
+
colorTokenClasses2 = {
|
|
7122
|
+
primary: "text-primary",
|
|
7123
|
+
secondary: "text-secondary",
|
|
7124
|
+
success: "text-success",
|
|
7125
|
+
warning: "text-warning",
|
|
7126
|
+
error: "text-error",
|
|
7127
|
+
muted: "text-muted-foreground"
|
|
7128
|
+
};
|
|
7122
7129
|
sizeMap5 = {
|
|
7123
7130
|
sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
|
|
7124
7131
|
md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
|
|
@@ -7322,14 +7329,20 @@ function XPBar({
|
|
|
7322
7329
|
}) {
|
|
7323
7330
|
const sizes = sizeMap9[size];
|
|
7324
7331
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7325
|
-
const [fillWidth, setFillWidth] =
|
|
7326
|
-
|
|
7332
|
+
const [fillWidth, setFillWidth] = React85.useState(animated ? 0 : percentage);
|
|
7333
|
+
React85.useEffect(() => {
|
|
7327
7334
|
if (!animated) {
|
|
7328
7335
|
setFillWidth(percentage);
|
|
7329
7336
|
return;
|
|
7330
7337
|
}
|
|
7331
|
-
|
|
7332
|
-
|
|
7338
|
+
let frame2;
|
|
7339
|
+
const frame1 = requestAnimationFrame(() => {
|
|
7340
|
+
frame2 = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7341
|
+
});
|
|
7342
|
+
return () => {
|
|
7343
|
+
cancelAnimationFrame(frame1);
|
|
7344
|
+
cancelAnimationFrame(frame2);
|
|
7345
|
+
};
|
|
7333
7346
|
}, [animated, percentage]);
|
|
7334
7347
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7335
7348
|
level != null && /* @__PURE__ */ jsxs(
|
|
@@ -7367,7 +7380,7 @@ function XPBar({
|
|
|
7367
7380
|
)
|
|
7368
7381
|
}
|
|
7369
7382
|
),
|
|
7370
|
-
showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-
|
|
7383
|
+
showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
|
|
7371
7384
|
current,
|
|
7372
7385
|
" / ",
|
|
7373
7386
|
max,
|
|
@@ -7485,7 +7498,7 @@ function StatusEffect({
|
|
|
7485
7498
|
),
|
|
7486
7499
|
title: label,
|
|
7487
7500
|
children: [
|
|
7488
|
-
/* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
|
|
7501
|
+
/* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
|
|
7489
7502
|
duration !== void 0 && /* @__PURE__ */ jsx(
|
|
7490
7503
|
"span",
|
|
7491
7504
|
{
|
|
@@ -7516,6 +7529,7 @@ var sizeMap11, variantStyles7;
|
|
|
7516
7529
|
var init_StatusEffect = __esm({
|
|
7517
7530
|
"components/game/atoms/StatusEffect.tsx"() {
|
|
7518
7531
|
init_cn();
|
|
7532
|
+
init_Icon();
|
|
7519
7533
|
sizeMap11 = {
|
|
7520
7534
|
sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
|
|
7521
7535
|
md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
|
|
@@ -7749,9 +7763,9 @@ function MiniMap({
|
|
|
7749
7763
|
viewportRect,
|
|
7750
7764
|
className
|
|
7751
7765
|
}) {
|
|
7752
|
-
const canvasRef =
|
|
7753
|
-
const frameRef =
|
|
7754
|
-
|
|
7766
|
+
const canvasRef = React85.useRef(null);
|
|
7767
|
+
const frameRef = React85.useRef(0);
|
|
7768
|
+
React85.useEffect(() => {
|
|
7755
7769
|
const canvas = canvasRef.current;
|
|
7756
7770
|
if (!canvas) return;
|
|
7757
7771
|
const ctx = canvas.getContext("2d");
|
|
@@ -7925,7 +7939,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7925
7939
|
}
|
|
7926
7940
|
);
|
|
7927
7941
|
};
|
|
7928
|
-
ErrorBoundary = class extends
|
|
7942
|
+
ErrorBoundary = class extends React85__default.Component {
|
|
7929
7943
|
constructor(props) {
|
|
7930
7944
|
super(props);
|
|
7931
7945
|
__publicField(this, "reset", () => {
|
|
@@ -9360,7 +9374,7 @@ var init_Tooltip = __esm({
|
|
|
9360
9374
|
setIsVisible(false);
|
|
9361
9375
|
}, hideDelay);
|
|
9362
9376
|
};
|
|
9363
|
-
|
|
9377
|
+
useLayoutEffect(() => {
|
|
9364
9378
|
if (isVisible) {
|
|
9365
9379
|
updatePosition();
|
|
9366
9380
|
}
|
|
@@ -9371,8 +9385,8 @@ var init_Tooltip = __esm({
|
|
|
9371
9385
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
9372
9386
|
};
|
|
9373
9387
|
}, []);
|
|
9374
|
-
const triggerElement =
|
|
9375
|
-
const trigger =
|
|
9388
|
+
const triggerElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9389
|
+
const trigger = React85__default.cloneElement(triggerElement, {
|
|
9376
9390
|
ref: triggerRef,
|
|
9377
9391
|
onMouseEnter: handleMouseEnter,
|
|
9378
9392
|
onMouseLeave: handleMouseLeave,
|
|
@@ -9519,8 +9533,8 @@ var init_Popover = __esm({
|
|
|
9519
9533
|
onMouseEnter: handleOpen,
|
|
9520
9534
|
onMouseLeave: handleClose
|
|
9521
9535
|
};
|
|
9522
|
-
const childElement =
|
|
9523
|
-
const triggerElement =
|
|
9536
|
+
const childElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9537
|
+
const triggerElement = React85__default.cloneElement(
|
|
9524
9538
|
childElement,
|
|
9525
9539
|
{
|
|
9526
9540
|
ref: triggerRef,
|
|
@@ -9536,7 +9550,10 @@ var init_Popover = __esm({
|
|
|
9536
9550
|
"bg-card border-2 border-border shadow-elevation-popover",
|
|
9537
9551
|
className
|
|
9538
9552
|
),
|
|
9539
|
-
style:
|
|
9553
|
+
style: {
|
|
9554
|
+
...computePopoverStyle(position, triggerRect, popoverWidth),
|
|
9555
|
+
...popoverWidth === 0 ? { visibility: "hidden" } : void 0
|
|
9556
|
+
},
|
|
9540
9557
|
role: "dialog",
|
|
9541
9558
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
9542
9559
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -9646,8 +9663,8 @@ var init_Menu = __esm({
|
|
|
9646
9663
|
};
|
|
9647
9664
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9648
9665
|
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9649
|
-
const triggerChild =
|
|
9650
|
-
const triggerElement =
|
|
9666
|
+
const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9667
|
+
const triggerElement = React85__default.cloneElement(
|
|
9651
9668
|
triggerChild,
|
|
9652
9669
|
{
|
|
9653
9670
|
ref: triggerRef,
|
|
@@ -10054,7 +10071,7 @@ var init_MapView = __esm({
|
|
|
10054
10071
|
shadowSize: [41, 41]
|
|
10055
10072
|
});
|
|
10056
10073
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
10057
|
-
const { useEffect: useEffect71, useRef: useRef66, useCallback:
|
|
10074
|
+
const { useEffect: useEffect71, useRef: useRef66, useCallback: useCallback112, useState: useState99 } = React85__default;
|
|
10058
10075
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
10059
10076
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
10060
10077
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -10099,8 +10116,8 @@ var init_MapView = __esm({
|
|
|
10099
10116
|
showAttribution = true
|
|
10100
10117
|
}) {
|
|
10101
10118
|
const eventBus = useEventBus2();
|
|
10102
|
-
const [clickedPosition, setClickedPosition] =
|
|
10103
|
-
const handleMapClick =
|
|
10119
|
+
const [clickedPosition, setClickedPosition] = useState99(null);
|
|
10120
|
+
const handleMapClick = useCallback112((lat, lng) => {
|
|
10104
10121
|
if (showClickedPin) {
|
|
10105
10122
|
setClickedPosition({ lat, lng });
|
|
10106
10123
|
}
|
|
@@ -10109,7 +10126,7 @@ var init_MapView = __esm({
|
|
|
10109
10126
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
10110
10127
|
}
|
|
10111
10128
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
10112
|
-
const handleMarkerClick =
|
|
10129
|
+
const handleMarkerClick = useCallback112((marker) => {
|
|
10113
10130
|
onMarkerClick?.(marker);
|
|
10114
10131
|
if (markerClickEvent) {
|
|
10115
10132
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -10118,7 +10135,7 @@ var init_MapView = __esm({
|
|
|
10118
10135
|
return /* @__PURE__ */ jsx(
|
|
10119
10136
|
Box,
|
|
10120
10137
|
{
|
|
10121
|
-
className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
|
|
10138
|
+
className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
|
|
10122
10139
|
style: { height },
|
|
10123
10140
|
"data-testid": "map-view",
|
|
10124
10141
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -10300,7 +10317,7 @@ function InputPattern({
|
|
|
10300
10317
|
fieldName
|
|
10301
10318
|
}) {
|
|
10302
10319
|
const { emit } = useEventBus();
|
|
10303
|
-
const [localValue, setLocalValue] =
|
|
10320
|
+
const [localValue, setLocalValue] = React85__default.useState(value);
|
|
10304
10321
|
const handleChange = (e) => {
|
|
10305
10322
|
setLocalValue(e.target.value);
|
|
10306
10323
|
if (onChange) {
|
|
@@ -10338,7 +10355,7 @@ function TextareaPattern({
|
|
|
10338
10355
|
fieldName
|
|
10339
10356
|
}) {
|
|
10340
10357
|
const { emit } = useEventBus();
|
|
10341
|
-
const [localValue, setLocalValue] =
|
|
10358
|
+
const [localValue, setLocalValue] = React85__default.useState(value);
|
|
10342
10359
|
const handleChange = (e) => {
|
|
10343
10360
|
setLocalValue(e.target.value);
|
|
10344
10361
|
if (onChange) {
|
|
@@ -10370,7 +10387,7 @@ function SelectPattern({
|
|
|
10370
10387
|
fieldName
|
|
10371
10388
|
}) {
|
|
10372
10389
|
const { emit } = useEventBus();
|
|
10373
|
-
const [localValue, setLocalValue] =
|
|
10390
|
+
const [localValue, setLocalValue] = React85__default.useState(value);
|
|
10374
10391
|
const handleChange = (e) => {
|
|
10375
10392
|
setLocalValue(e.target.value);
|
|
10376
10393
|
if (onChange) {
|
|
@@ -10399,7 +10416,7 @@ function CheckboxPattern({
|
|
|
10399
10416
|
className
|
|
10400
10417
|
}) {
|
|
10401
10418
|
const { emit } = useEventBus();
|
|
10402
|
-
const [localChecked, setLocalChecked] =
|
|
10419
|
+
const [localChecked, setLocalChecked] = React85__default.useState(checked);
|
|
10403
10420
|
const handleChange = (e) => {
|
|
10404
10421
|
setLocalChecked(e.target.checked);
|
|
10405
10422
|
if (onChange) {
|
|
@@ -10631,8 +10648,8 @@ function ActionButtons({
|
|
|
10631
10648
|
disabled
|
|
10632
10649
|
}) {
|
|
10633
10650
|
const eventBus = useEventBus();
|
|
10634
|
-
const [activeButtons, setActiveButtons] =
|
|
10635
|
-
const handlePress =
|
|
10651
|
+
const [activeButtons, setActiveButtons] = React85.useState(/* @__PURE__ */ new Set());
|
|
10652
|
+
const handlePress = React85.useCallback(
|
|
10636
10653
|
(id) => {
|
|
10637
10654
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
10638
10655
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10640,7 +10657,7 @@ function ActionButtons({
|
|
|
10640
10657
|
},
|
|
10641
10658
|
[actionEvent, eventBus, onAction]
|
|
10642
10659
|
);
|
|
10643
|
-
const handleRelease =
|
|
10660
|
+
const handleRelease = React85.useCallback(
|
|
10644
10661
|
(id) => {
|
|
10645
10662
|
setActiveButtons((prev) => {
|
|
10646
10663
|
const next = new Set(prev);
|
|
@@ -13621,6 +13638,263 @@ var init_katex_min = __esm({
|
|
|
13621
13638
|
"node_modules/katex/dist/katex.min.css"() {
|
|
13622
13639
|
}
|
|
13623
13640
|
});
|
|
13641
|
+
var Tabs;
|
|
13642
|
+
var init_Tabs = __esm({
|
|
13643
|
+
"components/core/molecules/Tabs.tsx"() {
|
|
13644
|
+
"use client";
|
|
13645
|
+
init_Icon();
|
|
13646
|
+
init_Badge();
|
|
13647
|
+
init_Typography();
|
|
13648
|
+
init_Box();
|
|
13649
|
+
init_cn();
|
|
13650
|
+
init_useEventBus();
|
|
13651
|
+
Tabs = ({
|
|
13652
|
+
items,
|
|
13653
|
+
tabs,
|
|
13654
|
+
defaultActiveTab,
|
|
13655
|
+
activeTab: controlledActiveTab,
|
|
13656
|
+
onTabChange,
|
|
13657
|
+
tabChangeEvent,
|
|
13658
|
+
variant = "default",
|
|
13659
|
+
orientation = "horizontal",
|
|
13660
|
+
className
|
|
13661
|
+
}) => {
|
|
13662
|
+
const rawItems = items ?? tabs ?? [];
|
|
13663
|
+
const safeItems = rawItems.map(({ id, value, ...rest }) => ({
|
|
13664
|
+
...rest,
|
|
13665
|
+
id: id || value || ""
|
|
13666
|
+
}));
|
|
13667
|
+
const eventBus = useEventBus();
|
|
13668
|
+
const { t } = useTranslate();
|
|
13669
|
+
const initialActive = safeItems.find((item) => item.active)?.id;
|
|
13670
|
+
const [internalActiveTab, setInternalActiveTab] = useState(
|
|
13671
|
+
defaultActiveTab || initialActive || safeItems[0]?.id || ""
|
|
13672
|
+
);
|
|
13673
|
+
const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
|
|
13674
|
+
const tabRefs = useRef({});
|
|
13675
|
+
const handleTabChange = (tabId, tabEvent) => {
|
|
13676
|
+
if (controlledActiveTab === void 0) {
|
|
13677
|
+
setInternalActiveTab(tabId);
|
|
13678
|
+
}
|
|
13679
|
+
onTabChange?.(tabId);
|
|
13680
|
+
if (tabChangeEvent) {
|
|
13681
|
+
eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
|
|
13682
|
+
}
|
|
13683
|
+
if (tabEvent) {
|
|
13684
|
+
eventBus.emit(`UI:${tabEvent}`, { tabId });
|
|
13685
|
+
}
|
|
13686
|
+
};
|
|
13687
|
+
const handleKeyDown = (e, index) => {
|
|
13688
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
13689
|
+
e.preventDefault();
|
|
13690
|
+
const direction = e.key === "ArrowLeft" ? -1 : 1;
|
|
13691
|
+
const nextIndex = (index + direction + safeItems.length) % safeItems.length;
|
|
13692
|
+
const nextTab = safeItems[nextIndex];
|
|
13693
|
+
if (nextTab && !nextTab.disabled) {
|
|
13694
|
+
handleTabChange(nextTab.id);
|
|
13695
|
+
tabRefs.current[nextTab.id]?.focus();
|
|
13696
|
+
}
|
|
13697
|
+
} else if (e.key === "Home" || e.key === "End") {
|
|
13698
|
+
e.preventDefault();
|
|
13699
|
+
const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
|
|
13700
|
+
const targetTab = safeItems[targetIndex];
|
|
13701
|
+
if (targetTab && !targetTab.disabled) {
|
|
13702
|
+
handleTabChange(targetTab.id);
|
|
13703
|
+
tabRefs.current[targetTab.id]?.focus();
|
|
13704
|
+
}
|
|
13705
|
+
}
|
|
13706
|
+
};
|
|
13707
|
+
const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
|
|
13708
|
+
if (safeItems.length === 0) {
|
|
13709
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
|
|
13710
|
+
}
|
|
13711
|
+
const variantClasses2 = {
|
|
13712
|
+
default: [
|
|
13713
|
+
"border-b-[length:var(--border-width)] border-transparent",
|
|
13714
|
+
"hover:border-muted-foreground",
|
|
13715
|
+
"data-[active=true]:border-primary"
|
|
13716
|
+
].join(" "),
|
|
13717
|
+
pills: [
|
|
13718
|
+
"rounded-sm",
|
|
13719
|
+
"data-[active=true]:bg-primary",
|
|
13720
|
+
"data-[active=true]:text-primary-foreground"
|
|
13721
|
+
].join(" "),
|
|
13722
|
+
underline: [
|
|
13723
|
+
"border-b-[length:var(--border-width)] border-transparent",
|
|
13724
|
+
"data-[active=true]:border-primary"
|
|
13725
|
+
].join(" ")
|
|
13726
|
+
};
|
|
13727
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
|
|
13728
|
+
/* @__PURE__ */ jsx(
|
|
13729
|
+
Box,
|
|
13730
|
+
{
|
|
13731
|
+
role: "tablist",
|
|
13732
|
+
className: cn(
|
|
13733
|
+
"flex",
|
|
13734
|
+
// Horizontal tab strip becomes a horizontally-scrollable lane
|
|
13735
|
+
// below its container width — phones with many tabs scroll
|
|
13736
|
+
// instead of clipping. `snap-x` snaps to each tab; the
|
|
13737
|
+
// scrollbar is hidden for a cleaner affordance (the swipe
|
|
13738
|
+
// gesture is the discoverability cue).
|
|
13739
|
+
orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
|
|
13740
|
+
variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
|
|
13741
|
+
variant === "underline" && orientation === "vertical" && "border-b-0"
|
|
13742
|
+
),
|
|
13743
|
+
children: safeItems.map((item, index) => {
|
|
13744
|
+
const isActive = item.id === activeTab;
|
|
13745
|
+
const isDisabled = item.disabled;
|
|
13746
|
+
return /* @__PURE__ */ jsxs(
|
|
13747
|
+
Box,
|
|
13748
|
+
{
|
|
13749
|
+
as: "button",
|
|
13750
|
+
ref: (el) => {
|
|
13751
|
+
tabRefs.current[item.id] = el;
|
|
13752
|
+
},
|
|
13753
|
+
role: "tab",
|
|
13754
|
+
"aria-selected": isActive,
|
|
13755
|
+
"aria-controls": `tabpanel-${item.id}`,
|
|
13756
|
+
"aria-disabled": isDisabled,
|
|
13757
|
+
onClick: () => !isDisabled && handleTabChange(item.id, item.event),
|
|
13758
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
13759
|
+
"data-active": isActive,
|
|
13760
|
+
className: cn(
|
|
13761
|
+
"flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
|
|
13762
|
+
orientation === "horizontal" && "snap-start shrink-0",
|
|
13763
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
13764
|
+
isDisabled && "opacity-50 cursor-not-allowed",
|
|
13765
|
+
variantClasses2[variant],
|
|
13766
|
+
isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
|
|
13767
|
+
),
|
|
13768
|
+
children: [
|
|
13769
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
|
|
13770
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
|
|
13771
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
|
|
13772
|
+
]
|
|
13773
|
+
},
|
|
13774
|
+
item.id
|
|
13775
|
+
);
|
|
13776
|
+
})
|
|
13777
|
+
}
|
|
13778
|
+
),
|
|
13779
|
+
activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
|
|
13780
|
+
Box,
|
|
13781
|
+
{
|
|
13782
|
+
role: "tabpanel",
|
|
13783
|
+
id: `tabpanel-${activeTab}`,
|
|
13784
|
+
"aria-labelledby": `tab-${activeTab}`,
|
|
13785
|
+
className: "mt-4",
|
|
13786
|
+
children: activeTabContent
|
|
13787
|
+
}
|
|
13788
|
+
)
|
|
13789
|
+
] });
|
|
13790
|
+
};
|
|
13791
|
+
Tabs.displayName = "Tabs";
|
|
13792
|
+
}
|
|
13793
|
+
});
|
|
13794
|
+
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
13795
|
+
var init_EmptyState = __esm({
|
|
13796
|
+
"components/core/molecules/EmptyState.tsx"() {
|
|
13797
|
+
"use client";
|
|
13798
|
+
init_cn();
|
|
13799
|
+
init_atoms2();
|
|
13800
|
+
init_Box();
|
|
13801
|
+
init_Icon();
|
|
13802
|
+
init_Stack();
|
|
13803
|
+
init_Typography();
|
|
13804
|
+
init_useEventBus();
|
|
13805
|
+
ICON_NAME_ALIASES = {
|
|
13806
|
+
check: "check-circle",
|
|
13807
|
+
error: "x-circle",
|
|
13808
|
+
warning: "alert-circle"
|
|
13809
|
+
};
|
|
13810
|
+
lookStyles3 = {
|
|
13811
|
+
"icon-only": "",
|
|
13812
|
+
illustrated: "[&_svg]:w-32 [&_svg]:h-32",
|
|
13813
|
+
"text-only": "[&_svg]:hidden",
|
|
13814
|
+
mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
|
|
13815
|
+
};
|
|
13816
|
+
EmptyState = ({
|
|
13817
|
+
icon,
|
|
13818
|
+
title,
|
|
13819
|
+
message,
|
|
13820
|
+
description,
|
|
13821
|
+
actionLabel,
|
|
13822
|
+
onAction,
|
|
13823
|
+
className,
|
|
13824
|
+
destructive,
|
|
13825
|
+
variant,
|
|
13826
|
+
actionEvent,
|
|
13827
|
+
look = "icon-only"
|
|
13828
|
+
}) => {
|
|
13829
|
+
const eventBus = useEventBus();
|
|
13830
|
+
const { t } = useTranslate();
|
|
13831
|
+
const handleAction = () => {
|
|
13832
|
+
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
|
|
13833
|
+
onAction?.();
|
|
13834
|
+
};
|
|
13835
|
+
const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
|
|
13836
|
+
const iconComponent = typeof icon === "function" ? icon : void 0;
|
|
13837
|
+
const hasIcon = Boolean(iconName || iconComponent);
|
|
13838
|
+
const isDestructive = destructive || variant === "error";
|
|
13839
|
+
const isSuccess = variant === "success";
|
|
13840
|
+
const displayText = title || message || t("empty.noItems");
|
|
13841
|
+
return /* @__PURE__ */ jsxs(
|
|
13842
|
+
VStack,
|
|
13843
|
+
{
|
|
13844
|
+
align: "center",
|
|
13845
|
+
className: cn(
|
|
13846
|
+
"justify-center py-12 text-center",
|
|
13847
|
+
lookStyles3[look],
|
|
13848
|
+
className
|
|
13849
|
+
),
|
|
13850
|
+
children: [
|
|
13851
|
+
hasIcon && /* @__PURE__ */ jsx(
|
|
13852
|
+
Box,
|
|
13853
|
+
{
|
|
13854
|
+
className: cn(
|
|
13855
|
+
"mb-4 rounded-full p-3",
|
|
13856
|
+
isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
|
|
13857
|
+
),
|
|
13858
|
+
children: /* @__PURE__ */ jsx(
|
|
13859
|
+
Icon,
|
|
13860
|
+
{
|
|
13861
|
+
...iconName ? { name: iconName } : { icon: iconComponent },
|
|
13862
|
+
className: cn(
|
|
13863
|
+
"h-8 w-8",
|
|
13864
|
+
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
|
|
13865
|
+
)
|
|
13866
|
+
}
|
|
13867
|
+
)
|
|
13868
|
+
}
|
|
13869
|
+
),
|
|
13870
|
+
/* @__PURE__ */ jsx(
|
|
13871
|
+
Typography,
|
|
13872
|
+
{
|
|
13873
|
+
variant: "h3",
|
|
13874
|
+
className: cn(
|
|
13875
|
+
"text-lg font-medium",
|
|
13876
|
+
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
|
|
13877
|
+
),
|
|
13878
|
+
children: displayText
|
|
13879
|
+
}
|
|
13880
|
+
),
|
|
13881
|
+
description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
|
|
13882
|
+
actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
|
|
13883
|
+
Button,
|
|
13884
|
+
{
|
|
13885
|
+
className: "mt-4",
|
|
13886
|
+
variant: isDestructive ? "danger" : "primary",
|
|
13887
|
+
onClick: handleAction,
|
|
13888
|
+
children: actionLabel
|
|
13889
|
+
}
|
|
13890
|
+
)
|
|
13891
|
+
]
|
|
13892
|
+
}
|
|
13893
|
+
);
|
|
13894
|
+
};
|
|
13895
|
+
EmptyState.displayName = "EmptyState";
|
|
13896
|
+
}
|
|
13897
|
+
});
|
|
13624
13898
|
function computeFoldRegions(code) {
|
|
13625
13899
|
const lines = code.split("\n");
|
|
13626
13900
|
const regions = [];
|
|
@@ -13658,9 +13932,32 @@ function computeFoldRegions(code) {
|
|
|
13658
13932
|
function toCodeLanguage(value) {
|
|
13659
13933
|
return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
|
|
13660
13934
|
}
|
|
13661
|
-
|
|
13935
|
+
function generateDiff(oldVal, newVal) {
|
|
13936
|
+
const oldLines = oldVal.split("\n");
|
|
13937
|
+
const newLines = newVal.split("\n");
|
|
13938
|
+
const diff = [];
|
|
13939
|
+
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
13940
|
+
for (let i = 0; i < maxLen; i++) {
|
|
13941
|
+
const oldLine = oldLines[i];
|
|
13942
|
+
const newLine = newLines[i];
|
|
13943
|
+
if (oldLine === newLine) {
|
|
13944
|
+
diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
|
|
13945
|
+
} else {
|
|
13946
|
+
if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
|
|
13947
|
+
if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
|
|
13948
|
+
}
|
|
13949
|
+
}
|
|
13950
|
+
return diff;
|
|
13951
|
+
}
|
|
13952
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log8, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13662
13953
|
var init_CodeBlock = __esm({
|
|
13663
13954
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13955
|
+
init_cn();
|
|
13956
|
+
init_atoms2();
|
|
13957
|
+
init_Tabs();
|
|
13958
|
+
init_LoadingState();
|
|
13959
|
+
init_ErrorState();
|
|
13960
|
+
init_EmptyState();
|
|
13664
13961
|
init_Box();
|
|
13665
13962
|
init_Button();
|
|
13666
13963
|
init_Badge();
|
|
@@ -13767,9 +14064,14 @@ var init_CodeBlock = __esm({
|
|
|
13767
14064
|
"lolo"
|
|
13768
14065
|
];
|
|
13769
14066
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
14067
|
+
DIFF_STYLES = {
|
|
14068
|
+
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
14069
|
+
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
14070
|
+
context: { bg: "", prefix: " ", text: "text-foreground" }
|
|
14071
|
+
};
|
|
13770
14072
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13771
14073
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13772
|
-
CodeBlock =
|
|
14074
|
+
CodeBlock = React85__default.memo(
|
|
13773
14075
|
({
|
|
13774
14076
|
code: rawCode,
|
|
13775
14077
|
language = "text",
|
|
@@ -13780,7 +14082,20 @@ var init_CodeBlock = __esm({
|
|
|
13780
14082
|
className,
|
|
13781
14083
|
editable = false,
|
|
13782
14084
|
onChange,
|
|
13783
|
-
errorLines
|
|
14085
|
+
errorLines,
|
|
14086
|
+
// viewer props
|
|
14087
|
+
title,
|
|
14088
|
+
mode = "code",
|
|
14089
|
+
diff: propDiff,
|
|
14090
|
+
oldValue,
|
|
14091
|
+
newValue,
|
|
14092
|
+
showLineNumbers = false,
|
|
14093
|
+
wordWrap = false,
|
|
14094
|
+
files,
|
|
14095
|
+
actions,
|
|
14096
|
+
isLoading = false,
|
|
14097
|
+
error,
|
|
14098
|
+
showCopy
|
|
13784
14099
|
}) => {
|
|
13785
14100
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
13786
14101
|
const isOrb = language === "orb";
|
|
@@ -13792,6 +14107,20 @@ var init_CodeBlock = __esm({
|
|
|
13792
14107
|
const codeRef = useRef(null);
|
|
13793
14108
|
const savedScrollLeftRef = useRef(0);
|
|
13794
14109
|
const [copied, setCopied] = useState(false);
|
|
14110
|
+
const [wrap, setWrap] = useState(wordWrap);
|
|
14111
|
+
const [activeFileIndex, setActiveFileIndex] = useState(0);
|
|
14112
|
+
const activeFile = files?.[activeFileIndex];
|
|
14113
|
+
const activeCode = activeFile?.code ?? code;
|
|
14114
|
+
const activeLanguage = activeFile?.language ?? language;
|
|
14115
|
+
const diffLines = useMemo(() => {
|
|
14116
|
+
if (propDiff) return propDiff;
|
|
14117
|
+
if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
|
|
14118
|
+
return generateDiff(oldValue, newValue);
|
|
14119
|
+
}
|
|
14120
|
+
return null;
|
|
14121
|
+
}, [propDiff, mode, oldValue, newValue]);
|
|
14122
|
+
const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
|
|
14123
|
+
const effectiveCopy = showCopy ?? showCopyButton;
|
|
13795
14124
|
const [editableValue, setEditableValue] = useState(code);
|
|
13796
14125
|
const [editableTextareaKey, setEditableTextareaKey] = useState(0);
|
|
13797
14126
|
const lastPropCodeRef = useRef(code);
|
|
@@ -13962,13 +14291,13 @@ var init_CodeBlock = __esm({
|
|
|
13962
14291
|
}, [language, code]);
|
|
13963
14292
|
const handleCopy = async () => {
|
|
13964
14293
|
try {
|
|
13965
|
-
await navigator.clipboard.writeText(
|
|
14294
|
+
await navigator.clipboard.writeText(activeCode);
|
|
13966
14295
|
setCopied(true);
|
|
13967
|
-
eventBus.emit("UI:COPY_CODE", { language, success: true });
|
|
14296
|
+
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
|
|
13968
14297
|
setTimeout(() => setCopied(false), 2e3);
|
|
13969
14298
|
} catch (err) {
|
|
13970
14299
|
log8.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
13971
|
-
eventBus.emit("UI:COPY_CODE", { language, success: false });
|
|
14300
|
+
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
13972
14301
|
}
|
|
13973
14302
|
};
|
|
13974
14303
|
const handleSelectionCopy = useCallback((e) => {
|
|
@@ -14021,11 +14350,134 @@ var init_CodeBlock = __esm({
|
|
|
14021
14350
|
}
|
|
14022
14351
|
});
|
|
14023
14352
|
}
|
|
14024
|
-
const full =
|
|
14353
|
+
const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
|
|
14025
14354
|
e.clipboardData.setData("text/plain", full);
|
|
14026
14355
|
e.preventDefault();
|
|
14027
14356
|
}, [code]);
|
|
14028
|
-
|
|
14357
|
+
if (isLoading) {
|
|
14358
|
+
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
14359
|
+
}
|
|
14360
|
+
if (error) {
|
|
14361
|
+
return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
|
|
14362
|
+
}
|
|
14363
|
+
if (isViewerMode && !activeCode && !diffLines) {
|
|
14364
|
+
return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
|
|
14365
|
+
}
|
|
14366
|
+
if (isViewerMode) {
|
|
14367
|
+
const tabItems = files?.map((file, idx) => ({
|
|
14368
|
+
id: `file-${idx}`,
|
|
14369
|
+
label: file.label,
|
|
14370
|
+
content: null
|
|
14371
|
+
}));
|
|
14372
|
+
const lines = activeCode.split("\n");
|
|
14373
|
+
return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
14374
|
+
tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
|
|
14375
|
+
Tabs,
|
|
14376
|
+
{
|
|
14377
|
+
tabs: tabItems,
|
|
14378
|
+
activeTab: `file-${activeFileIndex}`,
|
|
14379
|
+
onTabChange: (id) => {
|
|
14380
|
+
const idx = parseInt(id.replace("file-", ""), 10);
|
|
14381
|
+
setActiveFileIndex(idx);
|
|
14382
|
+
}
|
|
14383
|
+
}
|
|
14384
|
+
) }),
|
|
14385
|
+
/* @__PURE__ */ jsxs(
|
|
14386
|
+
HStack,
|
|
14387
|
+
{
|
|
14388
|
+
gap: "sm",
|
|
14389
|
+
align: "center",
|
|
14390
|
+
justify: "between",
|
|
14391
|
+
className: "px-4 py-2 border-b border-border bg-muted/30",
|
|
14392
|
+
children: [
|
|
14393
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
14394
|
+
/* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
|
|
14395
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
|
|
14396
|
+
activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
|
|
14397
|
+
] }),
|
|
14398
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
14399
|
+
/* @__PURE__ */ jsx(
|
|
14400
|
+
Button,
|
|
14401
|
+
{
|
|
14402
|
+
variant: "ghost",
|
|
14403
|
+
size: "sm",
|
|
14404
|
+
icon: WrapText,
|
|
14405
|
+
onClick: () => setWrap(!wrap),
|
|
14406
|
+
className: cn(wrap && "text-primary")
|
|
14407
|
+
}
|
|
14408
|
+
),
|
|
14409
|
+
effectiveCopy && /* @__PURE__ */ jsx(
|
|
14410
|
+
Button,
|
|
14411
|
+
{
|
|
14412
|
+
variant: "ghost",
|
|
14413
|
+
size: "sm",
|
|
14414
|
+
icon: copied ? Check : Copy,
|
|
14415
|
+
onClick: handleCopy,
|
|
14416
|
+
className: cn(copied && "text-success")
|
|
14417
|
+
}
|
|
14418
|
+
),
|
|
14419
|
+
actions?.map((action, idx) => /* @__PURE__ */ jsx(
|
|
14420
|
+
Badge,
|
|
14421
|
+
{
|
|
14422
|
+
variant: "default",
|
|
14423
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
14424
|
+
onClick: () => {
|
|
14425
|
+
if (action.event) eventBus.emit(`UI:${action.event}`, {});
|
|
14426
|
+
},
|
|
14427
|
+
children: action.label
|
|
14428
|
+
},
|
|
14429
|
+
idx
|
|
14430
|
+
))
|
|
14431
|
+
] })
|
|
14432
|
+
]
|
|
14433
|
+
}
|
|
14434
|
+
),
|
|
14435
|
+
/* @__PURE__ */ jsx(Box, { className: "overflow-auto bg-muted/20", style: { maxHeight }, children: diffLines ? /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
14436
|
+
const style = DIFF_STYLES[line.type];
|
|
14437
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
14438
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
14439
|
+
Typography,
|
|
14440
|
+
{
|
|
14441
|
+
variant: "caption",
|
|
14442
|
+
color: "secondary",
|
|
14443
|
+
className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
|
|
14444
|
+
children: line.lineNumber ?? ""
|
|
14445
|
+
}
|
|
14446
|
+
),
|
|
14447
|
+
/* @__PURE__ */ jsxs(
|
|
14448
|
+
Typography,
|
|
14449
|
+
{
|
|
14450
|
+
variant: "caption",
|
|
14451
|
+
className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
|
|
14452
|
+
children: [
|
|
14453
|
+
/* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
|
|
14454
|
+
line.content
|
|
14455
|
+
]
|
|
14456
|
+
}
|
|
14457
|
+
)
|
|
14458
|
+
] }, idx);
|
|
14459
|
+
}) }) : /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column" }, className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
|
|
14460
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
14461
|
+
Typography,
|
|
14462
|
+
{
|
|
14463
|
+
variant: "caption",
|
|
14464
|
+
color: "secondary",
|
|
14465
|
+
className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
|
|
14466
|
+
children: idx + 1
|
|
14467
|
+
}
|
|
14468
|
+
),
|
|
14469
|
+
/* @__PURE__ */ jsx(
|
|
14470
|
+
Typography,
|
|
14471
|
+
{
|
|
14472
|
+
variant: "caption",
|
|
14473
|
+
className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
|
|
14474
|
+
children: line || " "
|
|
14475
|
+
}
|
|
14476
|
+
)
|
|
14477
|
+
] }, idx)) }) })
|
|
14478
|
+
] }) });
|
|
14479
|
+
}
|
|
14480
|
+
const hasHeader = showLanguageBadge || effectiveCopy;
|
|
14029
14481
|
return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
14030
14482
|
hasHeader && /* @__PURE__ */ jsxs(
|
|
14031
14483
|
HStack,
|
|
@@ -14035,7 +14487,7 @@ var init_CodeBlock = __esm({
|
|
|
14035
14487
|
className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
|
|
14036
14488
|
children: [
|
|
14037
14489
|
showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
|
|
14038
|
-
|
|
14490
|
+
effectiveCopy && /* @__PURE__ */ jsx(
|
|
14039
14491
|
Button,
|
|
14040
14492
|
{
|
|
14041
14493
|
variant: "ghost",
|
|
@@ -14194,7 +14646,7 @@ var init_CodeBlock = __esm({
|
|
|
14194
14646
|
)
|
|
14195
14647
|
] });
|
|
14196
14648
|
},
|
|
14197
|
-
(prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines
|
|
14649
|
+
(prev, next) => prev.language === next.language && prev.code === next.code && prev.showCopyButton === next.showCopyButton && prev.showCopy === next.showCopy && prev.maxHeight === next.maxHeight && prev.foldable === next.foldable && prev.editable === next.editable && prev.onChange === next.onChange && prev.errorLines === next.errorLines && prev.mode === next.mode && prev.title === next.title && prev.diff === next.diff && prev.files === next.files && prev.actions === next.actions && prev.isLoading === next.isLoading && prev.error === next.error
|
|
14198
14650
|
);
|
|
14199
14651
|
CodeBlock.displayName = "CodeBlock";
|
|
14200
14652
|
}
|
|
@@ -14206,7 +14658,7 @@ var init_MarkdownContent = __esm({
|
|
|
14206
14658
|
init_Box();
|
|
14207
14659
|
init_CodeBlock();
|
|
14208
14660
|
init_cn();
|
|
14209
|
-
MarkdownContent =
|
|
14661
|
+
MarkdownContent = React85__default.memo(
|
|
14210
14662
|
({ content, direction, className }) => {
|
|
14211
14663
|
const { t: _t } = useTranslate();
|
|
14212
14664
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -15302,7 +15754,7 @@ var init_StateMachineView = __esm({
|
|
|
15302
15754
|
style: { top: title ? 30 : 0 },
|
|
15303
15755
|
children: [
|
|
15304
15756
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
15305
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15757
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React85__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
15306
15758
|
StateNode,
|
|
15307
15759
|
{
|
|
15308
15760
|
state,
|
|
@@ -16451,110 +16903,6 @@ var init_BookTableOfContents = __esm({
|
|
|
16451
16903
|
BookTableOfContents.displayName = "BookTableOfContents";
|
|
16452
16904
|
}
|
|
16453
16905
|
});
|
|
16454
|
-
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
16455
|
-
var init_EmptyState = __esm({
|
|
16456
|
-
"components/core/molecules/EmptyState.tsx"() {
|
|
16457
|
-
"use client";
|
|
16458
|
-
init_cn();
|
|
16459
|
-
init_atoms2();
|
|
16460
|
-
init_Box();
|
|
16461
|
-
init_Icon();
|
|
16462
|
-
init_Stack();
|
|
16463
|
-
init_Typography();
|
|
16464
|
-
init_useEventBus();
|
|
16465
|
-
ICON_NAME_ALIASES = {
|
|
16466
|
-
check: "check-circle",
|
|
16467
|
-
error: "x-circle",
|
|
16468
|
-
warning: "alert-circle"
|
|
16469
|
-
};
|
|
16470
|
-
lookStyles3 = {
|
|
16471
|
-
"icon-only": "",
|
|
16472
|
-
illustrated: "[&_svg]:w-32 [&_svg]:h-32",
|
|
16473
|
-
"text-only": "[&_svg]:hidden",
|
|
16474
|
-
mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
|
|
16475
|
-
};
|
|
16476
|
-
EmptyState = ({
|
|
16477
|
-
icon,
|
|
16478
|
-
title,
|
|
16479
|
-
message,
|
|
16480
|
-
description,
|
|
16481
|
-
actionLabel,
|
|
16482
|
-
onAction,
|
|
16483
|
-
className,
|
|
16484
|
-
destructive,
|
|
16485
|
-
variant,
|
|
16486
|
-
actionEvent,
|
|
16487
|
-
look = "icon-only"
|
|
16488
|
-
}) => {
|
|
16489
|
-
const eventBus = useEventBus();
|
|
16490
|
-
const { t } = useTranslate();
|
|
16491
|
-
const handleAction = () => {
|
|
16492
|
-
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
|
|
16493
|
-
onAction?.();
|
|
16494
|
-
};
|
|
16495
|
-
const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
|
|
16496
|
-
const iconComponent = typeof icon === "function" ? icon : void 0;
|
|
16497
|
-
const hasIcon = Boolean(iconName || iconComponent);
|
|
16498
|
-
const isDestructive = destructive || variant === "error";
|
|
16499
|
-
const isSuccess = variant === "success";
|
|
16500
|
-
const displayText = title || message || t("empty.noItems");
|
|
16501
|
-
return /* @__PURE__ */ jsxs(
|
|
16502
|
-
VStack,
|
|
16503
|
-
{
|
|
16504
|
-
align: "center",
|
|
16505
|
-
className: cn(
|
|
16506
|
-
"justify-center py-12 text-center",
|
|
16507
|
-
lookStyles3[look],
|
|
16508
|
-
className
|
|
16509
|
-
),
|
|
16510
|
-
children: [
|
|
16511
|
-
hasIcon && /* @__PURE__ */ jsx(
|
|
16512
|
-
Box,
|
|
16513
|
-
{
|
|
16514
|
-
className: cn(
|
|
16515
|
-
"mb-4 rounded-full p-3",
|
|
16516
|
-
isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
|
|
16517
|
-
),
|
|
16518
|
-
children: /* @__PURE__ */ jsx(
|
|
16519
|
-
Icon,
|
|
16520
|
-
{
|
|
16521
|
-
...iconName ? { name: iconName } : { icon: iconComponent },
|
|
16522
|
-
className: cn(
|
|
16523
|
-
"h-8 w-8",
|
|
16524
|
-
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
|
|
16525
|
-
)
|
|
16526
|
-
}
|
|
16527
|
-
)
|
|
16528
|
-
}
|
|
16529
|
-
),
|
|
16530
|
-
/* @__PURE__ */ jsx(
|
|
16531
|
-
Typography,
|
|
16532
|
-
{
|
|
16533
|
-
variant: "h3",
|
|
16534
|
-
className: cn(
|
|
16535
|
-
"text-lg font-medium",
|
|
16536
|
-
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
|
|
16537
|
-
),
|
|
16538
|
-
children: displayText
|
|
16539
|
-
}
|
|
16540
|
-
),
|
|
16541
|
-
description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
|
|
16542
|
-
actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
|
|
16543
|
-
Button,
|
|
16544
|
-
{
|
|
16545
|
-
className: "mt-4",
|
|
16546
|
-
variant: isDestructive ? "danger" : "primary",
|
|
16547
|
-
onClick: handleAction,
|
|
16548
|
-
children: actionLabel
|
|
16549
|
-
}
|
|
16550
|
-
)
|
|
16551
|
-
]
|
|
16552
|
-
}
|
|
16553
|
-
);
|
|
16554
|
-
};
|
|
16555
|
-
EmptyState.displayName = "EmptyState";
|
|
16556
|
-
}
|
|
16557
|
-
});
|
|
16558
16906
|
|
|
16559
16907
|
// components/core/organisms/book/types.ts
|
|
16560
16908
|
function resolveFieldMap(fieldMap) {
|
|
@@ -16907,7 +17255,7 @@ var init_Grid = __esm({
|
|
|
16907
17255
|
as: Component = "div"
|
|
16908
17256
|
}) => {
|
|
16909
17257
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
16910
|
-
return
|
|
17258
|
+
return React85__default.createElement(
|
|
16911
17259
|
Component,
|
|
16912
17260
|
{
|
|
16913
17261
|
className: cn(
|
|
@@ -21350,449 +21698,6 @@ var init_ClassifierBoard = __esm({
|
|
|
21350
21698
|
ClassifierBoard.displayName = "ClassifierBoard";
|
|
21351
21699
|
}
|
|
21352
21700
|
});
|
|
21353
|
-
function CodeView({
|
|
21354
|
-
data,
|
|
21355
|
-
label,
|
|
21356
|
-
defaultExpanded = false,
|
|
21357
|
-
className
|
|
21358
|
-
}) {
|
|
21359
|
-
const { t } = useTranslate();
|
|
21360
|
-
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
21361
|
-
const jsonString = JSON.stringify(data, null, 2);
|
|
21362
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
21363
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
21364
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
21365
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
|
|
21366
|
-
] }),
|
|
21367
|
-
expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
21368
|
-
Typography,
|
|
21369
|
-
{
|
|
21370
|
-
variant: "caption",
|
|
21371
|
-
className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
|
|
21372
|
-
children: jsonString
|
|
21373
|
-
}
|
|
21374
|
-
) })
|
|
21375
|
-
] });
|
|
21376
|
-
}
|
|
21377
|
-
var init_CodeView = __esm({
|
|
21378
|
-
"components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
|
|
21379
|
-
init_atoms2();
|
|
21380
|
-
init_cn();
|
|
21381
|
-
CodeView.displayName = "CodeView";
|
|
21382
|
-
}
|
|
21383
|
-
});
|
|
21384
|
-
var Tabs;
|
|
21385
|
-
var init_Tabs = __esm({
|
|
21386
|
-
"components/core/molecules/Tabs.tsx"() {
|
|
21387
|
-
"use client";
|
|
21388
|
-
init_Icon();
|
|
21389
|
-
init_Badge();
|
|
21390
|
-
init_Typography();
|
|
21391
|
-
init_Box();
|
|
21392
|
-
init_cn();
|
|
21393
|
-
init_useEventBus();
|
|
21394
|
-
Tabs = ({
|
|
21395
|
-
items,
|
|
21396
|
-
tabs,
|
|
21397
|
-
defaultActiveTab,
|
|
21398
|
-
activeTab: controlledActiveTab,
|
|
21399
|
-
onTabChange,
|
|
21400
|
-
tabChangeEvent,
|
|
21401
|
-
variant = "default",
|
|
21402
|
-
orientation = "horizontal",
|
|
21403
|
-
className
|
|
21404
|
-
}) => {
|
|
21405
|
-
const rawItems = items ?? tabs ?? [];
|
|
21406
|
-
const safeItems = rawItems.map(({ id, value, ...rest }) => ({
|
|
21407
|
-
...rest,
|
|
21408
|
-
id: id || value || ""
|
|
21409
|
-
}));
|
|
21410
|
-
const eventBus = useEventBus();
|
|
21411
|
-
const { t } = useTranslate();
|
|
21412
|
-
const initialActive = safeItems.find((item) => item.active)?.id;
|
|
21413
|
-
const [internalActiveTab, setInternalActiveTab] = useState(
|
|
21414
|
-
defaultActiveTab || initialActive || safeItems[0]?.id || ""
|
|
21415
|
-
);
|
|
21416
|
-
const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
|
|
21417
|
-
const tabRefs = useRef({});
|
|
21418
|
-
const handleTabChange = (tabId, tabEvent) => {
|
|
21419
|
-
if (controlledActiveTab === void 0) {
|
|
21420
|
-
setInternalActiveTab(tabId);
|
|
21421
|
-
}
|
|
21422
|
-
onTabChange?.(tabId);
|
|
21423
|
-
if (tabChangeEvent) {
|
|
21424
|
-
eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
|
|
21425
|
-
}
|
|
21426
|
-
if (tabEvent) {
|
|
21427
|
-
eventBus.emit(`UI:${tabEvent}`, { tabId });
|
|
21428
|
-
}
|
|
21429
|
-
};
|
|
21430
|
-
const handleKeyDown = (e, index) => {
|
|
21431
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
21432
|
-
e.preventDefault();
|
|
21433
|
-
const direction = e.key === "ArrowLeft" ? -1 : 1;
|
|
21434
|
-
const nextIndex = (index + direction + safeItems.length) % safeItems.length;
|
|
21435
|
-
const nextTab = safeItems[nextIndex];
|
|
21436
|
-
if (nextTab && !nextTab.disabled) {
|
|
21437
|
-
handleTabChange(nextTab.id);
|
|
21438
|
-
tabRefs.current[nextTab.id]?.focus();
|
|
21439
|
-
}
|
|
21440
|
-
} else if (e.key === "Home" || e.key === "End") {
|
|
21441
|
-
e.preventDefault();
|
|
21442
|
-
const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
|
|
21443
|
-
const targetTab = safeItems[targetIndex];
|
|
21444
|
-
if (targetTab && !targetTab.disabled) {
|
|
21445
|
-
handleTabChange(targetTab.id);
|
|
21446
|
-
tabRefs.current[targetTab.id]?.focus();
|
|
21447
|
-
}
|
|
21448
|
-
}
|
|
21449
|
-
};
|
|
21450
|
-
const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
|
|
21451
|
-
if (safeItems.length === 0) {
|
|
21452
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
|
|
21453
|
-
}
|
|
21454
|
-
const variantClasses2 = {
|
|
21455
|
-
default: [
|
|
21456
|
-
"border-b-[length:var(--border-width)] border-transparent",
|
|
21457
|
-
"hover:border-muted-foreground",
|
|
21458
|
-
"data-[active=true]:border-primary"
|
|
21459
|
-
].join(" "),
|
|
21460
|
-
pills: [
|
|
21461
|
-
"rounded-sm",
|
|
21462
|
-
"data-[active=true]:bg-primary",
|
|
21463
|
-
"data-[active=true]:text-primary-foreground"
|
|
21464
|
-
].join(" "),
|
|
21465
|
-
underline: [
|
|
21466
|
-
"border-b-[length:var(--border-width)] border-transparent",
|
|
21467
|
-
"data-[active=true]:border-primary"
|
|
21468
|
-
].join(" ")
|
|
21469
|
-
};
|
|
21470
|
-
return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
|
|
21471
|
-
/* @__PURE__ */ jsx(
|
|
21472
|
-
Box,
|
|
21473
|
-
{
|
|
21474
|
-
role: "tablist",
|
|
21475
|
-
className: cn(
|
|
21476
|
-
"flex",
|
|
21477
|
-
// Horizontal tab strip becomes a horizontally-scrollable lane
|
|
21478
|
-
// below its container width — phones with many tabs scroll
|
|
21479
|
-
// instead of clipping. `snap-x` snaps to each tab; the
|
|
21480
|
-
// scrollbar is hidden for a cleaner affordance (the swipe
|
|
21481
|
-
// gesture is the discoverability cue).
|
|
21482
|
-
orientation === "horizontal" ? "flex-row border-b-[length:var(--border-width)] border-border overflow-x-auto snap-x snap-mandatory [&::-webkit-scrollbar]:hidden" : "flex-col border-r-[length:var(--border-width)] border-border",
|
|
21483
|
-
variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
|
|
21484
|
-
variant === "underline" && orientation === "vertical" && "border-b-0"
|
|
21485
|
-
),
|
|
21486
|
-
children: safeItems.map((item, index) => {
|
|
21487
|
-
const isActive = item.id === activeTab;
|
|
21488
|
-
const isDisabled = item.disabled;
|
|
21489
|
-
return /* @__PURE__ */ jsxs(
|
|
21490
|
-
Box,
|
|
21491
|
-
{
|
|
21492
|
-
as: "button",
|
|
21493
|
-
ref: (el) => {
|
|
21494
|
-
tabRefs.current[item.id] = el;
|
|
21495
|
-
},
|
|
21496
|
-
role: "tab",
|
|
21497
|
-
"aria-selected": isActive,
|
|
21498
|
-
"aria-controls": `tabpanel-${item.id}`,
|
|
21499
|
-
"aria-disabled": isDisabled,
|
|
21500
|
-
onClick: () => !isDisabled && handleTabChange(item.id, item.event),
|
|
21501
|
-
onKeyDown: (e) => handleKeyDown(e, index),
|
|
21502
|
-
"data-active": isActive,
|
|
21503
|
-
className: cn(
|
|
21504
|
-
"flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
|
|
21505
|
-
orientation === "horizontal" && "snap-start shrink-0",
|
|
21506
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
21507
|
-
isDisabled && "opacity-50 cursor-not-allowed",
|
|
21508
|
-
variantClasses2[variant],
|
|
21509
|
-
isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
|
|
21510
|
-
),
|
|
21511
|
-
children: [
|
|
21512
|
-
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
|
|
21513
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
|
|
21514
|
-
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
|
|
21515
|
-
]
|
|
21516
|
-
},
|
|
21517
|
-
item.id
|
|
21518
|
-
);
|
|
21519
|
-
})
|
|
21520
|
-
}
|
|
21521
|
-
),
|
|
21522
|
-
activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
|
|
21523
|
-
Box,
|
|
21524
|
-
{
|
|
21525
|
-
role: "tabpanel",
|
|
21526
|
-
id: `tabpanel-${activeTab}`,
|
|
21527
|
-
"aria-labelledby": `tab-${activeTab}`,
|
|
21528
|
-
className: "mt-4",
|
|
21529
|
-
children: activeTabContent
|
|
21530
|
-
}
|
|
21531
|
-
)
|
|
21532
|
-
] });
|
|
21533
|
-
};
|
|
21534
|
-
Tabs.displayName = "Tabs";
|
|
21535
|
-
}
|
|
21536
|
-
});
|
|
21537
|
-
function generateDiff(oldVal, newVal) {
|
|
21538
|
-
const oldLines = oldVal.split("\n");
|
|
21539
|
-
const newLines = newVal.split("\n");
|
|
21540
|
-
const diff = [];
|
|
21541
|
-
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
21542
|
-
for (let i = 0; i < maxLen; i++) {
|
|
21543
|
-
const oldLine = oldLines[i];
|
|
21544
|
-
const newLine = newLines[i];
|
|
21545
|
-
if (oldLine === newLine) {
|
|
21546
|
-
diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
|
|
21547
|
-
} else {
|
|
21548
|
-
if (oldLine !== void 0) {
|
|
21549
|
-
diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
|
|
21550
|
-
}
|
|
21551
|
-
if (newLine !== void 0) {
|
|
21552
|
-
diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
|
|
21553
|
-
}
|
|
21554
|
-
}
|
|
21555
|
-
}
|
|
21556
|
-
return diff;
|
|
21557
|
-
}
|
|
21558
|
-
var DIFF_STYLES, CodeViewer;
|
|
21559
|
-
var init_CodeViewer = __esm({
|
|
21560
|
-
"components/core/molecules/CodeViewer.tsx"() {
|
|
21561
|
-
"use client";
|
|
21562
|
-
init_cn();
|
|
21563
|
-
init_atoms2();
|
|
21564
|
-
init_Stack();
|
|
21565
|
-
init_LoadingState();
|
|
21566
|
-
init_ErrorState();
|
|
21567
|
-
init_EmptyState();
|
|
21568
|
-
init_Tabs();
|
|
21569
|
-
init_useEventBus();
|
|
21570
|
-
DIFF_STYLES = {
|
|
21571
|
-
add: {
|
|
21572
|
-
bg: "bg-success/10",
|
|
21573
|
-
prefix: "+",
|
|
21574
|
-
text: "text-success"
|
|
21575
|
-
},
|
|
21576
|
-
remove: {
|
|
21577
|
-
bg: "bg-error/10",
|
|
21578
|
-
prefix: "-",
|
|
21579
|
-
text: "text-error"
|
|
21580
|
-
},
|
|
21581
|
-
context: {
|
|
21582
|
-
bg: "",
|
|
21583
|
-
prefix: " ",
|
|
21584
|
-
text: "text-foreground"
|
|
21585
|
-
}
|
|
21586
|
-
};
|
|
21587
|
-
CodeViewer = ({
|
|
21588
|
-
title,
|
|
21589
|
-
code,
|
|
21590
|
-
language,
|
|
21591
|
-
diff: propDiff,
|
|
21592
|
-
oldValue,
|
|
21593
|
-
newValue,
|
|
21594
|
-
mode = "code",
|
|
21595
|
-
showLineNumbers = true,
|
|
21596
|
-
showCopy = true,
|
|
21597
|
-
wordWrap = false,
|
|
21598
|
-
maxHeight = 500,
|
|
21599
|
-
files,
|
|
21600
|
-
actions,
|
|
21601
|
-
entity,
|
|
21602
|
-
isLoading = false,
|
|
21603
|
-
error,
|
|
21604
|
-
className
|
|
21605
|
-
}) => {
|
|
21606
|
-
const eventBus = useEventBus();
|
|
21607
|
-
const { t } = useTranslate();
|
|
21608
|
-
const [copied, setCopied] = useState(false);
|
|
21609
|
-
const [wrap, setWrap] = useState(wordWrap);
|
|
21610
|
-
const [activeFileIndex, setActiveFileIndex] = useState(0);
|
|
21611
|
-
const handleAction = useCallback(
|
|
21612
|
-
(action) => {
|
|
21613
|
-
if (action.event) {
|
|
21614
|
-
eventBus.emit(`UI:${action.event}`, {});
|
|
21615
|
-
}
|
|
21616
|
-
},
|
|
21617
|
-
[eventBus]
|
|
21618
|
-
);
|
|
21619
|
-
const activeFile = files?.[activeFileIndex];
|
|
21620
|
-
const activeCode = activeFile?.code ?? code ?? "";
|
|
21621
|
-
const activeLanguage = activeFile?.language ?? language ?? "text";
|
|
21622
|
-
const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
|
|
21623
|
-
const diffLines = useMemo(() => {
|
|
21624
|
-
if (propDiff) return propDiff;
|
|
21625
|
-
if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
|
|
21626
|
-
return generateDiff(oldValue, newValue);
|
|
21627
|
-
}
|
|
21628
|
-
return null;
|
|
21629
|
-
}, [propDiff, mode, oldValue, newValue]);
|
|
21630
|
-
const handleCopy = useCallback(async () => {
|
|
21631
|
-
try {
|
|
21632
|
-
await navigator.clipboard.writeText(activeCode);
|
|
21633
|
-
setCopied(true);
|
|
21634
|
-
eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
|
|
21635
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
21636
|
-
} catch {
|
|
21637
|
-
}
|
|
21638
|
-
}, [activeCode, eventBus, activeLanguage]);
|
|
21639
|
-
const tabItems = files?.map((file, idx) => ({
|
|
21640
|
-
id: `file-${idx}`,
|
|
21641
|
-
label: file.label,
|
|
21642
|
-
content: null
|
|
21643
|
-
}));
|
|
21644
|
-
if (isLoading) {
|
|
21645
|
-
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
21646
|
-
}
|
|
21647
|
-
if (error) {
|
|
21648
|
-
return /* @__PURE__ */ jsx(
|
|
21649
|
-
ErrorState,
|
|
21650
|
-
{
|
|
21651
|
-
title: t("display.codeViewerError"),
|
|
21652
|
-
message: error.message,
|
|
21653
|
-
className
|
|
21654
|
-
}
|
|
21655
|
-
);
|
|
21656
|
-
}
|
|
21657
|
-
if (!activeCode && !diffLines) {
|
|
21658
|
-
return /* @__PURE__ */ jsx(
|
|
21659
|
-
EmptyState,
|
|
21660
|
-
{
|
|
21661
|
-
icon: Code,
|
|
21662
|
-
title: t("display.noCode"),
|
|
21663
|
-
description: "No code to display.",
|
|
21664
|
-
className
|
|
21665
|
-
}
|
|
21666
|
-
);
|
|
21667
|
-
}
|
|
21668
|
-
return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
21669
|
-
tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
|
|
21670
|
-
Tabs,
|
|
21671
|
-
{
|
|
21672
|
-
tabs: tabItems,
|
|
21673
|
-
activeTab: `file-${activeFileIndex}`,
|
|
21674
|
-
onTabChange: (id) => {
|
|
21675
|
-
const idx = parseInt(id.replace("file-", ""), 10);
|
|
21676
|
-
setActiveFileIndex(idx);
|
|
21677
|
-
}
|
|
21678
|
-
}
|
|
21679
|
-
) }),
|
|
21680
|
-
/* @__PURE__ */ jsxs(
|
|
21681
|
-
HStack,
|
|
21682
|
-
{
|
|
21683
|
-
gap: "sm",
|
|
21684
|
-
align: "center",
|
|
21685
|
-
justify: "between",
|
|
21686
|
-
className: "px-4 py-2 border-b border-border bg-muted/30",
|
|
21687
|
-
children: [
|
|
21688
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
21689
|
-
/* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
|
|
21690
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
|
|
21691
|
-
activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
|
|
21692
|
-
] }),
|
|
21693
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
21694
|
-
/* @__PURE__ */ jsx(
|
|
21695
|
-
Button,
|
|
21696
|
-
{
|
|
21697
|
-
variant: "ghost",
|
|
21698
|
-
size: "sm",
|
|
21699
|
-
icon: WrapText,
|
|
21700
|
-
onClick: () => setWrap(!wrap),
|
|
21701
|
-
className: cn(wrap && "text-primary")
|
|
21702
|
-
}
|
|
21703
|
-
),
|
|
21704
|
-
showCopy && /* @__PURE__ */ jsx(
|
|
21705
|
-
Button,
|
|
21706
|
-
{
|
|
21707
|
-
variant: "ghost",
|
|
21708
|
-
size: "sm",
|
|
21709
|
-
icon: copied ? Check : Copy,
|
|
21710
|
-
onClick: handleCopy,
|
|
21711
|
-
className: cn(copied && "text-success")
|
|
21712
|
-
}
|
|
21713
|
-
),
|
|
21714
|
-
actions?.map((action, idx) => /* @__PURE__ */ jsx(
|
|
21715
|
-
Badge,
|
|
21716
|
-
{
|
|
21717
|
-
variant: "default",
|
|
21718
|
-
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
21719
|
-
onClick: () => handleAction(action),
|
|
21720
|
-
children: action.label
|
|
21721
|
-
},
|
|
21722
|
-
idx
|
|
21723
|
-
))
|
|
21724
|
-
] })
|
|
21725
|
-
]
|
|
21726
|
-
}
|
|
21727
|
-
),
|
|
21728
|
-
/* @__PURE__ */ jsx(
|
|
21729
|
-
Box,
|
|
21730
|
-
{
|
|
21731
|
-
className: "overflow-auto bg-muted/20",
|
|
21732
|
-
style: { maxHeight },
|
|
21733
|
-
children: diffLines ? (
|
|
21734
|
-
/* Diff mode */
|
|
21735
|
-
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
21736
|
-
const style = DIFF_STYLES[line.type];
|
|
21737
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
21738
|
-
showLineNumbers && /* @__PURE__ */ jsx(
|
|
21739
|
-
Typography,
|
|
21740
|
-
{
|
|
21741
|
-
variant: "caption",
|
|
21742
|
-
color: "secondary",
|
|
21743
|
-
className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
|
|
21744
|
-
children: line.lineNumber ?? ""
|
|
21745
|
-
}
|
|
21746
|
-
),
|
|
21747
|
-
/* @__PURE__ */ jsxs(
|
|
21748
|
-
Typography,
|
|
21749
|
-
{
|
|
21750
|
-
variant: "caption",
|
|
21751
|
-
className: cn(
|
|
21752
|
-
"font-mono flex-1 min-w-0",
|
|
21753
|
-
style.text,
|
|
21754
|
-
wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
|
|
21755
|
-
),
|
|
21756
|
-
children: [
|
|
21757
|
-
/* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
|
|
21758
|
-
line.content
|
|
21759
|
-
]
|
|
21760
|
-
}
|
|
21761
|
-
)
|
|
21762
|
-
] }, idx);
|
|
21763
|
-
}) })
|
|
21764
|
-
) : (
|
|
21765
|
-
/* Code mode */
|
|
21766
|
-
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: lines.map((line, idx) => /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: "px-4 py-0.5 hover:bg-muted/50", children: [
|
|
21767
|
-
showLineNumbers && /* @__PURE__ */ jsx(
|
|
21768
|
-
Typography,
|
|
21769
|
-
{
|
|
21770
|
-
variant: "caption",
|
|
21771
|
-
color: "secondary",
|
|
21772
|
-
className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
|
|
21773
|
-
children: idx + 1
|
|
21774
|
-
}
|
|
21775
|
-
),
|
|
21776
|
-
/* @__PURE__ */ jsx(
|
|
21777
|
-
Typography,
|
|
21778
|
-
{
|
|
21779
|
-
variant: "caption",
|
|
21780
|
-
className: cn(
|
|
21781
|
-
"font-mono flex-1 min-w-0",
|
|
21782
|
-
wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
|
|
21783
|
-
),
|
|
21784
|
-
children: line || " "
|
|
21785
|
-
}
|
|
21786
|
-
)
|
|
21787
|
-
] }, idx)) })
|
|
21788
|
-
)
|
|
21789
|
-
}
|
|
21790
|
-
)
|
|
21791
|
-
] }) });
|
|
21792
|
-
};
|
|
21793
|
-
CodeViewer.displayName = "CodeViewer";
|
|
21794
|
-
}
|
|
21795
|
-
});
|
|
21796
21701
|
function CombatLog({
|
|
21797
21702
|
events: events2,
|
|
21798
21703
|
maxVisible = 50,
|
|
@@ -22267,7 +22172,7 @@ function CraftingRecipe({
|
|
|
22267
22172
|
className
|
|
22268
22173
|
}) {
|
|
22269
22174
|
const eventBus = useEventBus();
|
|
22270
|
-
const handleCraft =
|
|
22175
|
+
const handleCraft = React85.useCallback(() => {
|
|
22271
22176
|
onCraft?.();
|
|
22272
22177
|
if (craftEvent) {
|
|
22273
22178
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -22284,7 +22189,7 @@ function CraftingRecipe({
|
|
|
22284
22189
|
children: [
|
|
22285
22190
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
22286
22191
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
22287
|
-
return /* @__PURE__ */ jsxs(
|
|
22192
|
+
return /* @__PURE__ */ jsxs(React85.Fragment, { children: [
|
|
22288
22193
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
22289
22194
|
ItemSlot,
|
|
22290
22195
|
{
|
|
@@ -22347,8 +22252,8 @@ function DPad({
|
|
|
22347
22252
|
}) {
|
|
22348
22253
|
const eventBus = useEventBus();
|
|
22349
22254
|
const sizes = sizeMap15[size];
|
|
22350
|
-
const [activeDirections, setActiveDirections] =
|
|
22351
|
-
const handlePress =
|
|
22255
|
+
const [activeDirections, setActiveDirections] = React85.useState(/* @__PURE__ */ new Set());
|
|
22256
|
+
const handlePress = React85.useCallback(
|
|
22352
22257
|
(direction) => {
|
|
22353
22258
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
22354
22259
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -22356,7 +22261,7 @@ function DPad({
|
|
|
22356
22261
|
},
|
|
22357
22262
|
[directionEvent, eventBus, onDirection]
|
|
22358
22263
|
);
|
|
22359
|
-
const handleRelease =
|
|
22264
|
+
const handleRelease = React85.useCallback(
|
|
22360
22265
|
(direction) => {
|
|
22361
22266
|
setActiveDirections((prev) => {
|
|
22362
22267
|
const next = new Set(prev);
|
|
@@ -23042,14 +22947,14 @@ function useDataDnd(args) {
|
|
|
23042
22947
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
23043
22948
|
const enabled = isZone || Boolean(dndRoot);
|
|
23044
22949
|
const eventBus = useEventBus();
|
|
23045
|
-
const parentRoot =
|
|
22950
|
+
const parentRoot = React85__default.useContext(RootCtx);
|
|
23046
22951
|
const isRoot = enabled && parentRoot === null;
|
|
23047
|
-
const zoneId =
|
|
22952
|
+
const zoneId = React85__default.useId();
|
|
23048
22953
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
23049
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
23050
|
-
const optimisticOrdersRef =
|
|
22954
|
+
const [optimisticOrders, setOptimisticOrders] = React85__default.useState(() => /* @__PURE__ */ new Map());
|
|
22955
|
+
const optimisticOrdersRef = React85__default.useRef(optimisticOrders);
|
|
23051
22956
|
optimisticOrdersRef.current = optimisticOrders;
|
|
23052
|
-
const clearOptimisticOrder =
|
|
22957
|
+
const clearOptimisticOrder = React85__default.useCallback((group) => {
|
|
23053
22958
|
setOptimisticOrders((prev) => {
|
|
23054
22959
|
if (!prev.has(group)) return prev;
|
|
23055
22960
|
const next = new Map(prev);
|
|
@@ -23074,7 +22979,7 @@ function useDataDnd(args) {
|
|
|
23074
22979
|
const raw = it[dndItemIdField];
|
|
23075
22980
|
return String(raw ?? `__idx_${idx}`);
|
|
23076
22981
|
}).join("|");
|
|
23077
|
-
const itemIds =
|
|
22982
|
+
const itemIds = React85__default.useMemo(
|
|
23078
22983
|
() => orderedItems.map((it, idx) => {
|
|
23079
22984
|
const raw = it[dndItemIdField];
|
|
23080
22985
|
return raw ?? `__idx_${idx}`;
|
|
@@ -23082,7 +22987,7 @@ function useDataDnd(args) {
|
|
|
23082
22987
|
[itemIdsSignature]
|
|
23083
22988
|
);
|
|
23084
22989
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
23085
|
-
|
|
22990
|
+
React85__default.useEffect(() => {
|
|
23086
22991
|
const root = isRoot ? null : parentRoot;
|
|
23087
22992
|
if (root) {
|
|
23088
22993
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -23090,20 +22995,20 @@ function useDataDnd(args) {
|
|
|
23090
22995
|
clearOptimisticOrder(ownGroup);
|
|
23091
22996
|
}
|
|
23092
22997
|
}, [itemsContentSig, ownGroup]);
|
|
23093
|
-
const zonesRef =
|
|
23094
|
-
const registerZone =
|
|
22998
|
+
const zonesRef = React85__default.useRef(/* @__PURE__ */ new Map());
|
|
22999
|
+
const registerZone = React85__default.useCallback((zoneId2, meta2) => {
|
|
23095
23000
|
zonesRef.current.set(zoneId2, meta2);
|
|
23096
23001
|
}, []);
|
|
23097
|
-
const unregisterZone =
|
|
23002
|
+
const unregisterZone = React85__default.useCallback((zoneId2) => {
|
|
23098
23003
|
zonesRef.current.delete(zoneId2);
|
|
23099
23004
|
}, []);
|
|
23100
|
-
const [activeDrag, setActiveDrag] =
|
|
23101
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
23102
|
-
const meta =
|
|
23005
|
+
const [activeDrag, setActiveDrag] = React85__default.useState(null);
|
|
23006
|
+
const [overZoneGroup, setOverZoneGroup] = React85__default.useState(null);
|
|
23007
|
+
const meta = React85__default.useMemo(
|
|
23103
23008
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
23104
23009
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
23105
23010
|
);
|
|
23106
|
-
|
|
23011
|
+
React85__default.useEffect(() => {
|
|
23107
23012
|
const target = isRoot ? null : parentRoot;
|
|
23108
23013
|
if (!target) {
|
|
23109
23014
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -23122,7 +23027,7 @@ function useDataDnd(args) {
|
|
|
23122
23027
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
23123
23028
|
const sensors = useAlmadarDndSensors(true);
|
|
23124
23029
|
const collisionDetection = almadarDndCollisionDetection;
|
|
23125
|
-
const findZoneByItem =
|
|
23030
|
+
const findZoneByItem = React85__default.useCallback(
|
|
23126
23031
|
(id) => {
|
|
23127
23032
|
for (const z of zonesRef.current.values()) {
|
|
23128
23033
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -23131,7 +23036,7 @@ function useDataDnd(args) {
|
|
|
23131
23036
|
},
|
|
23132
23037
|
[]
|
|
23133
23038
|
);
|
|
23134
|
-
|
|
23039
|
+
React85__default.useCallback(
|
|
23135
23040
|
(group) => {
|
|
23136
23041
|
for (const z of zonesRef.current.values()) {
|
|
23137
23042
|
if (z.group === group) return z;
|
|
@@ -23140,7 +23045,7 @@ function useDataDnd(args) {
|
|
|
23140
23045
|
},
|
|
23141
23046
|
[]
|
|
23142
23047
|
);
|
|
23143
|
-
const handleDragEnd =
|
|
23048
|
+
const handleDragEnd = React85__default.useCallback(
|
|
23144
23049
|
(event) => {
|
|
23145
23050
|
const { active, over } = event;
|
|
23146
23051
|
const activeIdStr = String(active.id);
|
|
@@ -23231,8 +23136,8 @@ function useDataDnd(args) {
|
|
|
23231
23136
|
},
|
|
23232
23137
|
[eventBus]
|
|
23233
23138
|
);
|
|
23234
|
-
const sortableData =
|
|
23235
|
-
const SortableItem =
|
|
23139
|
+
const sortableData = React85__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23140
|
+
const SortableItem = React85__default.useCallback(
|
|
23236
23141
|
({ id, children }) => {
|
|
23237
23142
|
const {
|
|
23238
23143
|
attributes,
|
|
@@ -23272,7 +23177,7 @@ function useDataDnd(args) {
|
|
|
23272
23177
|
id: droppableId,
|
|
23273
23178
|
data: sortableData
|
|
23274
23179
|
});
|
|
23275
|
-
const ctx =
|
|
23180
|
+
const ctx = React85__default.useContext(RootCtx);
|
|
23276
23181
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
23277
23182
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
23278
23183
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -23287,7 +23192,7 @@ function useDataDnd(args) {
|
|
|
23287
23192
|
showForeignPlaceholder,
|
|
23288
23193
|
ctxAvailable: ctx != null
|
|
23289
23194
|
});
|
|
23290
|
-
|
|
23195
|
+
React85__default.useEffect(() => {
|
|
23291
23196
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
23292
23197
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
23293
23198
|
return /* @__PURE__ */ jsx(
|
|
@@ -23301,11 +23206,11 @@ function useDataDnd(args) {
|
|
|
23301
23206
|
}
|
|
23302
23207
|
);
|
|
23303
23208
|
};
|
|
23304
|
-
const rootContextValue =
|
|
23209
|
+
const rootContextValue = React85__default.useMemo(
|
|
23305
23210
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
23306
23211
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
23307
23212
|
);
|
|
23308
|
-
const handleDragStart =
|
|
23213
|
+
const handleDragStart = React85__default.useCallback((event) => {
|
|
23309
23214
|
const sourceZone = findZoneByItem(event.active.id);
|
|
23310
23215
|
const rect = event.active.rect.current.initial;
|
|
23311
23216
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -23324,7 +23229,7 @@ function useDataDnd(args) {
|
|
|
23324
23229
|
isRoot
|
|
23325
23230
|
});
|
|
23326
23231
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
23327
|
-
const handleDragOver =
|
|
23232
|
+
const handleDragOver = React85__default.useCallback((event) => {
|
|
23328
23233
|
const { active, over } = event;
|
|
23329
23234
|
const overData = over?.data?.current;
|
|
23330
23235
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -23394,7 +23299,7 @@ function useDataDnd(args) {
|
|
|
23394
23299
|
return next;
|
|
23395
23300
|
});
|
|
23396
23301
|
}, []);
|
|
23397
|
-
const handleDragCancel =
|
|
23302
|
+
const handleDragCancel = React85__default.useCallback((event) => {
|
|
23398
23303
|
setActiveDrag(null);
|
|
23399
23304
|
setOverZoneGroup(null);
|
|
23400
23305
|
dndLog.warn("dragCancel", {
|
|
@@ -23402,12 +23307,12 @@ function useDataDnd(args) {
|
|
|
23402
23307
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
23403
23308
|
});
|
|
23404
23309
|
}, []);
|
|
23405
|
-
const handleDragEndWithCleanup =
|
|
23310
|
+
const handleDragEndWithCleanup = React85__default.useCallback((event) => {
|
|
23406
23311
|
handleDragEnd(event);
|
|
23407
23312
|
setActiveDrag(null);
|
|
23408
23313
|
setOverZoneGroup(null);
|
|
23409
23314
|
}, [handleDragEnd]);
|
|
23410
|
-
const wrapContainer =
|
|
23315
|
+
const wrapContainer = React85__default.useCallback(
|
|
23411
23316
|
(children) => {
|
|
23412
23317
|
if (!enabled) return children;
|
|
23413
23318
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23461,7 +23366,7 @@ var init_useDataDnd = __esm({
|
|
|
23461
23366
|
init_useAlmadarDndCollision();
|
|
23462
23367
|
init_Box();
|
|
23463
23368
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23464
|
-
RootCtx =
|
|
23369
|
+
RootCtx = React85__default.createContext(null);
|
|
23465
23370
|
}
|
|
23466
23371
|
});
|
|
23467
23372
|
function fieldLabel2(key) {
|
|
@@ -23981,7 +23886,7 @@ function DataList({
|
|
|
23981
23886
|
}) {
|
|
23982
23887
|
const eventBus = useEventBus();
|
|
23983
23888
|
const { t } = useTranslate();
|
|
23984
|
-
const [visibleCount, setVisibleCount] =
|
|
23889
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize || Infinity);
|
|
23985
23890
|
const fieldDefs = fields ?? columns ?? [];
|
|
23986
23891
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23987
23892
|
const dnd = useDataDnd({
|
|
@@ -24000,7 +23905,7 @@ function DataList({
|
|
|
24000
23905
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
24001
23906
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
24002
23907
|
const hasRenderProp = typeof children === "function";
|
|
24003
|
-
|
|
23908
|
+
React85__default.useEffect(() => {
|
|
24004
23909
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
24005
23910
|
const childrenTypeOf = typeof children;
|
|
24006
23911
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -24105,7 +24010,7 @@ function DataList({
|
|
|
24105
24010
|
const items2 = data.map((item) => item);
|
|
24106
24011
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
24107
24012
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
24108
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24013
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
24109
24014
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
24110
24015
|
group.items.map((itemData, index) => {
|
|
24111
24016
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -24253,7 +24158,7 @@ function DataList({
|
|
|
24253
24158
|
className
|
|
24254
24159
|
),
|
|
24255
24160
|
children: [
|
|
24256
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24161
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
24257
24162
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
24258
24163
|
group.items.map(
|
|
24259
24164
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -25627,7 +25532,7 @@ var init_WizardProgress = __esm({
|
|
|
25627
25532
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25628
25533
|
const isActive = index === currentStep;
|
|
25629
25534
|
const isCompleted = index < currentStep;
|
|
25630
|
-
return /* @__PURE__ */ jsxs(
|
|
25535
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
25631
25536
|
/* @__PURE__ */ jsx(
|
|
25632
25537
|
"button",
|
|
25633
25538
|
{
|
|
@@ -26144,8 +26049,9 @@ var init_FormSectionHeader = __esm({
|
|
|
26144
26049
|
Box,
|
|
26145
26050
|
{
|
|
26146
26051
|
className: cn(
|
|
26147
|
-
"px-
|
|
26148
|
-
|
|
26052
|
+
"px-5 py-4 bg-muted/60 rounded-lg",
|
|
26053
|
+
"border border-border border-l-4 border-l-primary",
|
|
26054
|
+
isClickable && "cursor-pointer hover:bg-muted transition-colors",
|
|
26149
26055
|
className
|
|
26150
26056
|
),
|
|
26151
26057
|
onClick: isClickable ? onToggle : void 0,
|
|
@@ -26156,7 +26062,7 @@ var init_FormSectionHeader = __esm({
|
|
|
26156
26062
|
{
|
|
26157
26063
|
name: icon,
|
|
26158
26064
|
size: "md",
|
|
26159
|
-
className: "text-primary"
|
|
26065
|
+
className: "text-primary shrink-0"
|
|
26160
26066
|
}
|
|
26161
26067
|
),
|
|
26162
26068
|
statusIcon && /* @__PURE__ */ jsx(
|
|
@@ -26164,12 +26070,15 @@ var init_FormSectionHeader = __esm({
|
|
|
26164
26070
|
{
|
|
26165
26071
|
name: statusIcon,
|
|
26166
26072
|
size: "md",
|
|
26167
|
-
className:
|
|
26073
|
+
className: cn(
|
|
26074
|
+
"shrink-0",
|
|
26075
|
+
hasErrors ? "text-error" : "text-success"
|
|
26076
|
+
)
|
|
26168
26077
|
}
|
|
26169
26078
|
),
|
|
26170
26079
|
/* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
|
|
26171
|
-
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
|
|
26172
|
-
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
|
|
26080
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
|
|
26081
|
+
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
|
|
26173
26082
|
] })
|
|
26174
26083
|
] }),
|
|
26175
26084
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -26178,9 +26087,9 @@ var init_FormSectionHeader = __esm({
|
|
|
26178
26087
|
Icon,
|
|
26179
26088
|
{
|
|
26180
26089
|
name: "chevron-down",
|
|
26181
|
-
size: "
|
|
26090
|
+
size: "sm",
|
|
26182
26091
|
className: cn(
|
|
26183
|
-
"text-muted-foreground transition-transform",
|
|
26092
|
+
"text-muted-foreground transition-transform duration-200 shrink-0",
|
|
26184
26093
|
isCollapsed && "-rotate-90"
|
|
26185
26094
|
)
|
|
26186
26095
|
}
|
|
@@ -26682,7 +26591,7 @@ function InventoryGrid({
|
|
|
26682
26591
|
const eventBus = useEventBus();
|
|
26683
26592
|
const slotCount = totalSlots ?? items.length;
|
|
26684
26593
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
26685
|
-
const handleSelect =
|
|
26594
|
+
const handleSelect = React85.useCallback(
|
|
26686
26595
|
(id) => {
|
|
26687
26596
|
onSelect?.(id);
|
|
26688
26597
|
if (selectEvent) {
|
|
@@ -26899,31 +26808,31 @@ function GameCanvas2D({
|
|
|
26899
26808
|
assetBaseUrl = "",
|
|
26900
26809
|
className
|
|
26901
26810
|
}) {
|
|
26902
|
-
const canvasRef =
|
|
26903
|
-
const rafRef =
|
|
26904
|
-
const frameRef =
|
|
26905
|
-
const lastTimeRef =
|
|
26906
|
-
const imageCache =
|
|
26811
|
+
const canvasRef = React85.useRef(null);
|
|
26812
|
+
const rafRef = React85.useRef(0);
|
|
26813
|
+
const frameRef = React85.useRef(0);
|
|
26814
|
+
const lastTimeRef = React85.useRef(0);
|
|
26815
|
+
const imageCache = React85.useRef(/* @__PURE__ */ new Map());
|
|
26907
26816
|
const emit = useEmitEvent();
|
|
26908
|
-
const onDrawRef =
|
|
26817
|
+
const onDrawRef = React85.useRef(onDraw);
|
|
26909
26818
|
onDrawRef.current = onDraw;
|
|
26910
|
-
const onTickRef =
|
|
26819
|
+
const onTickRef = React85.useRef(onTick);
|
|
26911
26820
|
onTickRef.current = onTick;
|
|
26912
|
-
const tickEventRef =
|
|
26821
|
+
const tickEventRef = React85.useRef(tickEvent);
|
|
26913
26822
|
tickEventRef.current = tickEvent;
|
|
26914
|
-
const drawEventRef =
|
|
26823
|
+
const drawEventRef = React85.useRef(drawEvent);
|
|
26915
26824
|
drawEventRef.current = drawEvent;
|
|
26916
|
-
const emitRef =
|
|
26825
|
+
const emitRef = React85.useRef(emit);
|
|
26917
26826
|
emitRef.current = emit;
|
|
26918
|
-
const assetBaseUrlRef =
|
|
26827
|
+
const assetBaseUrlRef = React85.useRef(assetBaseUrl);
|
|
26919
26828
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
26920
|
-
const backgroundImageRef =
|
|
26829
|
+
const backgroundImageRef = React85.useRef(backgroundImage);
|
|
26921
26830
|
backgroundImageRef.current = backgroundImage;
|
|
26922
|
-
const widthRef =
|
|
26831
|
+
const widthRef = React85.useRef(width);
|
|
26923
26832
|
widthRef.current = width;
|
|
26924
|
-
const heightRef =
|
|
26833
|
+
const heightRef = React85.useRef(height);
|
|
26925
26834
|
heightRef.current = height;
|
|
26926
|
-
const loadImage =
|
|
26835
|
+
const loadImage = React85.useCallback((url) => {
|
|
26927
26836
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
26928
26837
|
const cached = imageCache.current.get(fullUrl);
|
|
26929
26838
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -26935,7 +26844,7 @@ function GameCanvas2D({
|
|
|
26935
26844
|
}
|
|
26936
26845
|
return null;
|
|
26937
26846
|
}, []);
|
|
26938
|
-
|
|
26847
|
+
React85.useEffect(() => {
|
|
26939
26848
|
const canvas = canvasRef.current;
|
|
26940
26849
|
if (!canvas) return;
|
|
26941
26850
|
const ctx = canvas.getContext("2d");
|
|
@@ -27238,7 +27147,7 @@ function TurnPanel({
|
|
|
27238
27147
|
className
|
|
27239
27148
|
}) {
|
|
27240
27149
|
const eventBus = useEventBus();
|
|
27241
|
-
const handleAction =
|
|
27150
|
+
const handleAction = React85.useCallback(
|
|
27242
27151
|
(event) => {
|
|
27243
27152
|
if (event) {
|
|
27244
27153
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -27384,7 +27293,7 @@ function UnitCommandBar({
|
|
|
27384
27293
|
className
|
|
27385
27294
|
}) {
|
|
27386
27295
|
const eventBus = useEventBus();
|
|
27387
|
-
const handleCommand =
|
|
27296
|
+
const handleCommand = React85.useCallback(
|
|
27388
27297
|
(event) => {
|
|
27389
27298
|
if (event) {
|
|
27390
27299
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -27869,7 +27778,7 @@ function GameMenu({
|
|
|
27869
27778
|
} catch {
|
|
27870
27779
|
}
|
|
27871
27780
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27872
|
-
const handleOptionClick =
|
|
27781
|
+
const handleOptionClick = React85.useCallback(
|
|
27873
27782
|
(option) => {
|
|
27874
27783
|
if (option.event && eventBus) {
|
|
27875
27784
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27983,7 +27892,7 @@ function GameOverScreen({
|
|
|
27983
27892
|
} catch {
|
|
27984
27893
|
}
|
|
27985
27894
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27986
|
-
const handleActionClick =
|
|
27895
|
+
const handleActionClick = React85.useCallback(
|
|
27987
27896
|
(action) => {
|
|
27988
27897
|
if (action.event && eventBus) {
|
|
27989
27898
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28977,7 +28886,7 @@ var init_StarRating = __esm({
|
|
|
28977
28886
|
name: "star",
|
|
28978
28887
|
className: cn(
|
|
28979
28888
|
styles.star,
|
|
28980
|
-
"text-
|
|
28889
|
+
"text-foreground/30",
|
|
28981
28890
|
"transition-colors duration-100"
|
|
28982
28891
|
),
|
|
28983
28892
|
strokeWidth: 1.5
|
|
@@ -29460,8 +29369,8 @@ function TableView({
|
|
|
29460
29369
|
}) {
|
|
29461
29370
|
const eventBus = useEventBus();
|
|
29462
29371
|
const { t } = useTranslate();
|
|
29463
|
-
const [visibleCount, setVisibleCount] =
|
|
29464
|
-
const [localSelected, setLocalSelected] =
|
|
29372
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
29373
|
+
const [localSelected, setLocalSelected] = React85__default.useState(/* @__PURE__ */ new Set());
|
|
29465
29374
|
const colDefs = columns ?? fields ?? [];
|
|
29466
29375
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29467
29376
|
const dnd = useDataDnd({
|
|
@@ -29656,12 +29565,12 @@ function TableView({
|
|
|
29656
29565
|
]
|
|
29657
29566
|
}
|
|
29658
29567
|
);
|
|
29659
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29568
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React85__default.Fragment, { children: rowInner }, id);
|
|
29660
29569
|
};
|
|
29661
29570
|
const items = data.map((row) => row);
|
|
29662
29571
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29663
29572
|
let runningIndex = 0;
|
|
29664
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29573
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
29665
29574
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29666
29575
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29667
29576
|
] }, gi)) });
|
|
@@ -31013,7 +30922,7 @@ var init_StepFlow = __esm({
|
|
|
31013
30922
|
className
|
|
31014
30923
|
}) => {
|
|
31015
30924
|
if (orientation === "vertical") {
|
|
31016
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30925
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React85__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
31017
30926
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
31018
30927
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31019
30928
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -31024,7 +30933,7 @@ var init_StepFlow = __esm({
|
|
|
31024
30933
|
] })
|
|
31025
30934
|
] }) }, index)) });
|
|
31026
30935
|
}
|
|
31027
|
-
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(
|
|
30936
|
+
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(React85__default.Fragment, { children: [
|
|
31028
30937
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
31029
30938
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
31030
30939
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31779,11 +31688,19 @@ function LatticeSVG({
|
|
|
31779
31688
|
function f2(n) {
|
|
31780
31689
|
return n.toFixed(2);
|
|
31781
31690
|
}
|
|
31782
|
-
var VARIANT_MAP2, EdgeDecoration;
|
|
31691
|
+
var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
|
|
31783
31692
|
var init_EdgeDecoration = __esm({
|
|
31784
31693
|
"components/core/molecules/EdgeDecoration.tsx"() {
|
|
31785
31694
|
"use client";
|
|
31786
31695
|
init_cn();
|
|
31696
|
+
colorTokenVars = {
|
|
31697
|
+
primary: "var(--color-primary)",
|
|
31698
|
+
secondary: "var(--color-secondary)",
|
|
31699
|
+
success: "var(--color-success)",
|
|
31700
|
+
warning: "var(--color-warning)",
|
|
31701
|
+
error: "var(--color-error)",
|
|
31702
|
+
muted: "var(--color-muted)"
|
|
31703
|
+
};
|
|
31787
31704
|
VARIANT_MAP2 = {
|
|
31788
31705
|
arch: ArchSVG,
|
|
31789
31706
|
vine: VineSVG,
|
|
@@ -31793,13 +31710,14 @@ var init_EdgeDecoration = __esm({
|
|
|
31793
31710
|
variant = "arch",
|
|
31794
31711
|
side = "both",
|
|
31795
31712
|
opacity = 0.15,
|
|
31796
|
-
color = "
|
|
31713
|
+
color = "primary",
|
|
31797
31714
|
strokeWidth = 0.5,
|
|
31798
31715
|
width = 15,
|
|
31799
31716
|
className
|
|
31800
31717
|
}) => {
|
|
31801
31718
|
const id = useId();
|
|
31802
31719
|
const Variant = VARIANT_MAP2[variant];
|
|
31720
|
+
const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
|
|
31803
31721
|
const sides = side === "both" ? ["left", "right"] : [side];
|
|
31804
31722
|
return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
|
|
31805
31723
|
"svg",
|
|
@@ -31822,7 +31740,7 @@ var init_EdgeDecoration = __esm({
|
|
|
31822
31740
|
facing: s,
|
|
31823
31741
|
w: 200,
|
|
31824
31742
|
h: 600,
|
|
31825
|
-
color,
|
|
31743
|
+
color: resolvedColor,
|
|
31826
31744
|
strokeWidth
|
|
31827
31745
|
}
|
|
31828
31746
|
)
|
|
@@ -32000,7 +31918,7 @@ var init_LikertScale = __esm({
|
|
|
32000
31918
|
md: "text-base",
|
|
32001
31919
|
lg: "text-lg"
|
|
32002
31920
|
};
|
|
32003
|
-
LikertScale =
|
|
31921
|
+
LikertScale = React85__default.forwardRef(
|
|
32004
31922
|
({
|
|
32005
31923
|
question,
|
|
32006
31924
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -32012,7 +31930,7 @@ var init_LikertScale = __esm({
|
|
|
32012
31930
|
variant = "radios",
|
|
32013
31931
|
className
|
|
32014
31932
|
}, ref) => {
|
|
32015
|
-
const groupId =
|
|
31933
|
+
const groupId = React85__default.useId();
|
|
32016
31934
|
const eventBus = useEventBus();
|
|
32017
31935
|
const handleSelect = useCallback(
|
|
32018
31936
|
(next) => {
|
|
@@ -33162,7 +33080,6 @@ function BlockRow({
|
|
|
33162
33080
|
onUpdate,
|
|
33163
33081
|
onDelete,
|
|
33164
33082
|
onDuplicate,
|
|
33165
|
-
onInsertAfter,
|
|
33166
33083
|
onChangeType
|
|
33167
33084
|
}) {
|
|
33168
33085
|
const { t } = useTranslate();
|
|
@@ -33438,34 +33355,16 @@ function BlockRow({
|
|
|
33438
33355
|
"data-block-id": block.id,
|
|
33439
33356
|
"data-block-type": block.type,
|
|
33440
33357
|
children: [
|
|
33441
|
-
!readOnly && showAffordances && /* @__PURE__ */
|
|
33442
|
-
|
|
33443
|
-
|
|
33444
|
-
|
|
33445
|
-
|
|
33446
|
-
|
|
33447
|
-
|
|
33448
|
-
|
|
33449
|
-
|
|
33450
|
-
|
|
33451
|
-
"opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
|
|
33452
|
-
"transition-opacity"
|
|
33453
|
-
),
|
|
33454
|
-
onClick: () => onInsertAfter("paragraph"),
|
|
33455
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
|
|
33456
|
-
}
|
|
33457
|
-
),
|
|
33458
|
-
/* @__PURE__ */ jsx(
|
|
33459
|
-
BlockMenu,
|
|
33460
|
-
{
|
|
33461
|
-
block,
|
|
33462
|
-
readOnly,
|
|
33463
|
-
onDelete,
|
|
33464
|
-
onDuplicate,
|
|
33465
|
-
onChangeType
|
|
33466
|
-
}
|
|
33467
|
-
)
|
|
33468
|
-
] }),
|
|
33358
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
|
|
33359
|
+
BlockMenu,
|
|
33360
|
+
{
|
|
33361
|
+
block,
|
|
33362
|
+
readOnly,
|
|
33363
|
+
onDelete,
|
|
33364
|
+
onDuplicate,
|
|
33365
|
+
onChangeType
|
|
33366
|
+
}
|
|
33367
|
+
) }),
|
|
33469
33368
|
/* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
|
|
33470
33369
|
]
|
|
33471
33370
|
}
|
|
@@ -33588,12 +33487,6 @@ var init_RichBlockEditor = __esm({
|
|
|
33588
33487
|
},
|
|
33589
33488
|
[blocks, commit]
|
|
33590
33489
|
);
|
|
33591
|
-
const handleInsertAfter = useCallback(
|
|
33592
|
-
(id, type) => {
|
|
33593
|
-
commit(insertAfter(blocks, id, createBlock(type)));
|
|
33594
|
-
},
|
|
33595
|
-
[blocks, commit]
|
|
33596
|
-
);
|
|
33597
33490
|
const handleChangeType = useCallback(
|
|
33598
33491
|
(id, type) => {
|
|
33599
33492
|
commit(
|
|
@@ -33650,7 +33543,6 @@ var init_RichBlockEditor = __esm({
|
|
|
33650
33543
|
onUpdate: (updater) => handleUpdate(block.id, updater),
|
|
33651
33544
|
onDelete: () => handleDelete(block.id),
|
|
33652
33545
|
onDuplicate: () => handleDuplicate(block.id),
|
|
33653
|
-
onInsertAfter: (type) => handleInsertAfter(block.id, type),
|
|
33654
33546
|
onChangeType: (type) => handleChangeType(block.id, type)
|
|
33655
33547
|
},
|
|
33656
33548
|
block.id
|
|
@@ -34320,7 +34212,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
34320
34212
|
"aria-label": t("aria.breadcrumb"),
|
|
34321
34213
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
34322
34214
|
const isLast = idx === items.length - 1;
|
|
34323
|
-
return /* @__PURE__ */ jsxs(
|
|
34215
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
34324
34216
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
34325
34217
|
Icon,
|
|
34326
34218
|
{
|
|
@@ -34367,108 +34259,6 @@ var init_DocBreadcrumb = __esm({
|
|
|
34367
34259
|
DocBreadcrumb.displayName = "DocBreadcrumb";
|
|
34368
34260
|
}
|
|
34369
34261
|
});
|
|
34370
|
-
function DocCodeBlock({
|
|
34371
|
-
code,
|
|
34372
|
-
language,
|
|
34373
|
-
title,
|
|
34374
|
-
showLineNumbers = false,
|
|
34375
|
-
className
|
|
34376
|
-
}) {
|
|
34377
|
-
const [copied, setCopied] = useState(false);
|
|
34378
|
-
const handleCopy = useCallback(() => {
|
|
34379
|
-
void navigator.clipboard.writeText(code).then(() => {
|
|
34380
|
-
setCopied(true);
|
|
34381
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
34382
|
-
});
|
|
34383
|
-
}, [code]);
|
|
34384
|
-
const lines = code.split("\n");
|
|
34385
|
-
return /* @__PURE__ */ jsxs(
|
|
34386
|
-
Box,
|
|
34387
|
-
{
|
|
34388
|
-
className: cn(
|
|
34389
|
-
"rounded-container border border-border overflow-hidden",
|
|
34390
|
-
className
|
|
34391
|
-
),
|
|
34392
|
-
position: "relative",
|
|
34393
|
-
children: [
|
|
34394
|
-
title ? /* @__PURE__ */ jsxs(
|
|
34395
|
-
HStack,
|
|
34396
|
-
{
|
|
34397
|
-
align: "center",
|
|
34398
|
-
justify: "between",
|
|
34399
|
-
className: "bg-muted px-4 py-2 border-b border-border",
|
|
34400
|
-
children: [
|
|
34401
|
-
/* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
|
|
34402
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
|
|
34403
|
-
language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
|
|
34404
|
-
] }),
|
|
34405
|
-
/* @__PURE__ */ jsx(
|
|
34406
|
-
Button,
|
|
34407
|
-
{
|
|
34408
|
-
variant: "ghost",
|
|
34409
|
-
size: "sm",
|
|
34410
|
-
onClick: handleCopy,
|
|
34411
|
-
leftIcon: copied ? "check" : "copy",
|
|
34412
|
-
children: copied ? "Copied!" : "Copy"
|
|
34413
|
-
}
|
|
34414
|
-
)
|
|
34415
|
-
]
|
|
34416
|
-
}
|
|
34417
|
-
) : null,
|
|
34418
|
-
!title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
|
|
34419
|
-
Button,
|
|
34420
|
-
{
|
|
34421
|
-
variant: "ghost",
|
|
34422
|
-
size: "sm",
|
|
34423
|
-
onClick: handleCopy,
|
|
34424
|
-
leftIcon: copied ? "check" : "copy",
|
|
34425
|
-
children: copied ? "Copied!" : "Copy"
|
|
34426
|
-
}
|
|
34427
|
-
) }) : null,
|
|
34428
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
|
|
34429
|
-
showLineNumbers ? /* @__PURE__ */ jsx(
|
|
34430
|
-
Box,
|
|
34431
|
-
{
|
|
34432
|
-
className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
|
|
34433
|
-
children: lines.map((_, i) => /* @__PURE__ */ jsx(
|
|
34434
|
-
Typography,
|
|
34435
|
-
{
|
|
34436
|
-
variant: "caption",
|
|
34437
|
-
color: "muted",
|
|
34438
|
-
className: "block font-mono text-right leading-6",
|
|
34439
|
-
as: "span",
|
|
34440
|
-
children: i + 1
|
|
34441
|
-
},
|
|
34442
|
-
i
|
|
34443
|
-
))
|
|
34444
|
-
}
|
|
34445
|
-
) : null,
|
|
34446
|
-
/* @__PURE__ */ jsx(
|
|
34447
|
-
Box,
|
|
34448
|
-
{
|
|
34449
|
-
as: "pre",
|
|
34450
|
-
className: cn(
|
|
34451
|
-
"p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
|
|
34452
|
-
!title && "pr-24"
|
|
34453
|
-
),
|
|
34454
|
-
children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
|
|
34455
|
-
}
|
|
34456
|
-
)
|
|
34457
|
-
] })
|
|
34458
|
-
]
|
|
34459
|
-
}
|
|
34460
|
-
);
|
|
34461
|
-
}
|
|
34462
|
-
var init_DocCodeBlock = __esm({
|
|
34463
|
-
"components/core/molecules/DocCodeBlock.tsx"() {
|
|
34464
|
-
"use client";
|
|
34465
|
-
init_cn();
|
|
34466
|
-
init_Box();
|
|
34467
|
-
init_Stack();
|
|
34468
|
-
init_Typography();
|
|
34469
|
-
init_Button();
|
|
34470
|
-
}
|
|
34471
|
-
});
|
|
34472
34262
|
function DocPagination({ prev, next, className }) {
|
|
34473
34263
|
if (!prev && !next) return null;
|
|
34474
34264
|
return /* @__PURE__ */ jsxs(
|
|
@@ -34905,17 +34695,25 @@ var init_DocTOC = __esm({
|
|
|
34905
34695
|
DocTOC.displayName = "DocTOC";
|
|
34906
34696
|
}
|
|
34907
34697
|
});
|
|
34908
|
-
var GradientDivider;
|
|
34698
|
+
var colorTokenVars2, GradientDivider;
|
|
34909
34699
|
var init_GradientDivider = __esm({
|
|
34910
34700
|
"components/core/molecules/GradientDivider.tsx"() {
|
|
34911
34701
|
"use client";
|
|
34912
34702
|
init_cn();
|
|
34913
34703
|
init_Box();
|
|
34704
|
+
colorTokenVars2 = {
|
|
34705
|
+
primary: "var(--color-primary)",
|
|
34706
|
+
secondary: "var(--color-secondary)",
|
|
34707
|
+
success: "var(--color-success)",
|
|
34708
|
+
warning: "var(--color-warning)",
|
|
34709
|
+
error: "var(--color-error)",
|
|
34710
|
+
muted: "var(--color-muted)"
|
|
34711
|
+
};
|
|
34914
34712
|
GradientDivider = ({
|
|
34915
34713
|
color,
|
|
34916
34714
|
className
|
|
34917
34715
|
}) => {
|
|
34918
|
-
const centerColor = color
|
|
34716
|
+
const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
|
|
34919
34717
|
return /* @__PURE__ */ jsx(
|
|
34920
34718
|
Box,
|
|
34921
34719
|
{
|
|
@@ -35284,7 +35082,7 @@ var init_MiniStateMachine = __esm({
|
|
|
35284
35082
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
35285
35083
|
const tc = transitionCounts[s.name] ?? 0;
|
|
35286
35084
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
35287
|
-
return /* @__PURE__ */ jsxs(
|
|
35085
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
35288
35086
|
/* @__PURE__ */ jsx(
|
|
35289
35087
|
AvlState,
|
|
35290
35088
|
{
|
|
@@ -35488,7 +35286,7 @@ var init_PageHeader = __esm({
|
|
|
35488
35286
|
info: "bg-info/10 text-info"
|
|
35489
35287
|
};
|
|
35490
35288
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35491
|
-
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(
|
|
35289
|
+
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(React85__default.Fragment, { children: [
|
|
35492
35290
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35493
35291
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35494
35292
|
"a",
|
|
@@ -36225,7 +36023,7 @@ var init_WizardContainer = __esm({
|
|
|
36225
36023
|
const isCompleted = index < currentStep;
|
|
36226
36024
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36227
36025
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36228
|
-
return /* @__PURE__ */ jsxs(
|
|
36026
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
36229
36027
|
/* @__PURE__ */ jsx(
|
|
36230
36028
|
Button,
|
|
36231
36029
|
{
|
|
@@ -38510,7 +38308,7 @@ var init_DetailPanel = __esm({
|
|
|
38510
38308
|
}
|
|
38511
38309
|
});
|
|
38512
38310
|
function extractTitle(children) {
|
|
38513
|
-
if (!
|
|
38311
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
38514
38312
|
const props = children.props;
|
|
38515
38313
|
if (typeof props.title === "string") {
|
|
38516
38314
|
return props.title;
|
|
@@ -38565,7 +38363,7 @@ function LinearView({
|
|
|
38565
38363
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
38566
38364
|
const isDone = i < currentIdx;
|
|
38567
38365
|
const isCurrent = i === currentIdx;
|
|
38568
|
-
return /* @__PURE__ */ jsxs(
|
|
38366
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
38569
38367
|
i > 0 && /* @__PURE__ */ jsx(
|
|
38570
38368
|
Typography,
|
|
38571
38369
|
{
|
|
@@ -39523,12 +39321,12 @@ var init_Form = __esm({
|
|
|
39523
39321
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39524
39322
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39525
39323
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39526
|
-
const normalizedInitialData =
|
|
39324
|
+
const normalizedInitialData = React85__default.useMemo(() => {
|
|
39527
39325
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39528
39326
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39529
39327
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39530
39328
|
}, [entity, initialData]);
|
|
39531
|
-
const entityDerivedFields =
|
|
39329
|
+
const entityDerivedFields = React85__default.useMemo(() => {
|
|
39532
39330
|
if (fields && fields.length > 0) return void 0;
|
|
39533
39331
|
if (!resolvedEntity) return void 0;
|
|
39534
39332
|
return resolvedEntity.fields.map(
|
|
@@ -39548,16 +39346,16 @@ var init_Form = __esm({
|
|
|
39548
39346
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39549
39347
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39550
39348
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39551
|
-
const [formData, setFormData] =
|
|
39349
|
+
const [formData, setFormData] = React85__default.useState(
|
|
39552
39350
|
normalizedInitialData
|
|
39553
39351
|
);
|
|
39554
|
-
const [collapsedSections, setCollapsedSections] =
|
|
39352
|
+
const [collapsedSections, setCollapsedSections] = React85__default.useState(
|
|
39555
39353
|
/* @__PURE__ */ new Set()
|
|
39556
39354
|
);
|
|
39557
|
-
const [submitError, setSubmitError] =
|
|
39558
|
-
const formRef =
|
|
39355
|
+
const [submitError, setSubmitError] = React85__default.useState(null);
|
|
39356
|
+
const formRef = React85__default.useRef(null);
|
|
39559
39357
|
const formMode = props.mode;
|
|
39560
|
-
const mountedRef =
|
|
39358
|
+
const mountedRef = React85__default.useRef(false);
|
|
39561
39359
|
if (!mountedRef.current) {
|
|
39562
39360
|
mountedRef.current = true;
|
|
39563
39361
|
debug("forms", "mount", {
|
|
@@ -39570,7 +39368,7 @@ var init_Form = __esm({
|
|
|
39570
39368
|
});
|
|
39571
39369
|
}
|
|
39572
39370
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39573
|
-
const evalContext =
|
|
39371
|
+
const evalContext = React85__default.useMemo(
|
|
39574
39372
|
() => ({
|
|
39575
39373
|
formValues: formData,
|
|
39576
39374
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39579,7 +39377,7 @@ var init_Form = __esm({
|
|
|
39579
39377
|
}),
|
|
39580
39378
|
[formData, externalContext]
|
|
39581
39379
|
);
|
|
39582
|
-
|
|
39380
|
+
React85__default.useEffect(() => {
|
|
39583
39381
|
debug("forms", "initialData-sync", {
|
|
39584
39382
|
mode: formMode,
|
|
39585
39383
|
normalizedInitialData,
|
|
@@ -39590,7 +39388,7 @@ var init_Form = __esm({
|
|
|
39590
39388
|
setFormData(normalizedInitialData);
|
|
39591
39389
|
}
|
|
39592
39390
|
}, [normalizedInitialData]);
|
|
39593
|
-
const processCalculations =
|
|
39391
|
+
const processCalculations = React85__default.useCallback(
|
|
39594
39392
|
(changedFieldId, newFormData) => {
|
|
39595
39393
|
if (!hiddenCalculations.length) return;
|
|
39596
39394
|
const context = {
|
|
@@ -39615,7 +39413,7 @@ var init_Form = __esm({
|
|
|
39615
39413
|
},
|
|
39616
39414
|
[hiddenCalculations, externalContext, eventBus]
|
|
39617
39415
|
);
|
|
39618
|
-
const checkViolations =
|
|
39416
|
+
const checkViolations = React85__default.useCallback(
|
|
39619
39417
|
(changedFieldId, newFormData) => {
|
|
39620
39418
|
if (!violationTriggers.length) return;
|
|
39621
39419
|
const context = {
|
|
@@ -39653,7 +39451,7 @@ var init_Form = __esm({
|
|
|
39653
39451
|
processCalculations(name, newFormData);
|
|
39654
39452
|
checkViolations(name, newFormData);
|
|
39655
39453
|
};
|
|
39656
|
-
const isFieldVisible =
|
|
39454
|
+
const isFieldVisible = React85__default.useCallback(
|
|
39657
39455
|
(fieldName) => {
|
|
39658
39456
|
const condition = conditionalFields[fieldName];
|
|
39659
39457
|
if (!condition) return true;
|
|
@@ -39661,7 +39459,7 @@ var init_Form = __esm({
|
|
|
39661
39459
|
},
|
|
39662
39460
|
[conditionalFields, evalContext]
|
|
39663
39461
|
);
|
|
39664
|
-
const isSectionVisible =
|
|
39462
|
+
const isSectionVisible = React85__default.useCallback(
|
|
39665
39463
|
(section) => {
|
|
39666
39464
|
if (!section.condition) return true;
|
|
39667
39465
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39737,7 +39535,7 @@ var init_Form = __esm({
|
|
|
39737
39535
|
eventBus.emit(`UI:${onCancel}`);
|
|
39738
39536
|
}
|
|
39739
39537
|
};
|
|
39740
|
-
const renderField =
|
|
39538
|
+
const renderField = React85__default.useCallback(
|
|
39741
39539
|
(field) => {
|
|
39742
39540
|
const fieldName = field.name || field.field;
|
|
39743
39541
|
if (!fieldName) return null;
|
|
@@ -39758,7 +39556,7 @@ var init_Form = __esm({
|
|
|
39758
39556
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39759
39557
|
);
|
|
39760
39558
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39761
|
-
const normalizedFields =
|
|
39559
|
+
const normalizedFields = React85__default.useMemo(() => {
|
|
39762
39560
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39763
39561
|
return effectiveFields.map((field) => {
|
|
39764
39562
|
if (typeof field === "string") {
|
|
@@ -39781,7 +39579,7 @@ var init_Form = __esm({
|
|
|
39781
39579
|
return field;
|
|
39782
39580
|
});
|
|
39783
39581
|
}, [effectiveFields, resolvedEntity]);
|
|
39784
|
-
const schemaFields =
|
|
39582
|
+
const schemaFields = React85__default.useMemo(() => {
|
|
39785
39583
|
if (normalizedFields.length === 0) return null;
|
|
39786
39584
|
if (isDebugEnabled()) {
|
|
39787
39585
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39791,7 +39589,7 @@ var init_Form = __esm({
|
|
|
39791
39589
|
}
|
|
39792
39590
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39793
39591
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39794
|
-
const sectionElements =
|
|
39592
|
+
const sectionElements = React85__default.useMemo(() => {
|
|
39795
39593
|
if (!sections || sections.length === 0) return null;
|
|
39796
39594
|
return sections.map((section) => {
|
|
39797
39595
|
if (!isSectionVisible(section)) {
|
|
@@ -41066,7 +40864,7 @@ var init_List = __esm({
|
|
|
41066
40864
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41067
40865
|
return [];
|
|
41068
40866
|
}, [entity]);
|
|
41069
|
-
const getItemActions =
|
|
40867
|
+
const getItemActions = React85__default.useCallback(
|
|
41070
40868
|
(item) => {
|
|
41071
40869
|
if (!itemActions) return [];
|
|
41072
40870
|
if (typeof itemActions === "function") {
|
|
@@ -41542,7 +41340,7 @@ var init_MediaGallery = __esm({
|
|
|
41542
41340
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41543
41341
|
);
|
|
41544
41342
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41545
|
-
const items =
|
|
41343
|
+
const items = React85__default.useMemo(() => {
|
|
41546
41344
|
if (propItems) return propItems;
|
|
41547
41345
|
if (entityData.length === 0) return [];
|
|
41548
41346
|
return entityData.map((record, idx) => ({
|
|
@@ -41703,7 +41501,7 @@ var init_MediaGallery = __esm({
|
|
|
41703
41501
|
}
|
|
41704
41502
|
});
|
|
41705
41503
|
function extractTitle2(children) {
|
|
41706
|
-
if (!
|
|
41504
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
41707
41505
|
const props = children.props;
|
|
41708
41506
|
if (typeof props.title === "string") {
|
|
41709
41507
|
return props.title;
|
|
@@ -42115,7 +41913,7 @@ var init_debugRegistry = __esm({
|
|
|
42115
41913
|
}
|
|
42116
41914
|
});
|
|
42117
41915
|
function useDebugData() {
|
|
42118
|
-
const [data, setData] =
|
|
41916
|
+
const [data, setData] = React85.useState(() => ({
|
|
42119
41917
|
traits: [],
|
|
42120
41918
|
ticks: [],
|
|
42121
41919
|
guards: [],
|
|
@@ -42129,7 +41927,7 @@ function useDebugData() {
|
|
|
42129
41927
|
},
|
|
42130
41928
|
lastUpdate: Date.now()
|
|
42131
41929
|
}));
|
|
42132
|
-
|
|
41930
|
+
React85.useEffect(() => {
|
|
42133
41931
|
const updateData = () => {
|
|
42134
41932
|
setData({
|
|
42135
41933
|
traits: getAllTraits(),
|
|
@@ -42238,12 +42036,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42238
42036
|
return positions;
|
|
42239
42037
|
}
|
|
42240
42038
|
function WalkMinimap() {
|
|
42241
|
-
const [walkStep, setWalkStep] =
|
|
42242
|
-
const [traits2, setTraits] =
|
|
42243
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42244
|
-
const [completedTraits, setCompletedTraits] =
|
|
42245
|
-
const prevTraitRef =
|
|
42246
|
-
|
|
42039
|
+
const [walkStep, setWalkStep] = React85.useState(null);
|
|
42040
|
+
const [traits2, setTraits] = React85.useState([]);
|
|
42041
|
+
const [coveredEdges, setCoveredEdges] = React85.useState([]);
|
|
42042
|
+
const [completedTraits, setCompletedTraits] = React85.useState(/* @__PURE__ */ new Set());
|
|
42043
|
+
const prevTraitRef = React85.useRef(null);
|
|
42044
|
+
React85.useEffect(() => {
|
|
42247
42045
|
const interval = setInterval(() => {
|
|
42248
42046
|
const w = window;
|
|
42249
42047
|
const step = w.__orbitalWalkStep;
|
|
@@ -42679,15 +42477,15 @@ var init_EntitiesTab = __esm({
|
|
|
42679
42477
|
});
|
|
42680
42478
|
function EventFlowTab({ events: events2 }) {
|
|
42681
42479
|
const { t } = useTranslate();
|
|
42682
|
-
const [filter, setFilter] =
|
|
42683
|
-
const containerRef =
|
|
42684
|
-
const [autoScroll, setAutoScroll] =
|
|
42685
|
-
|
|
42480
|
+
const [filter, setFilter] = React85.useState("all");
|
|
42481
|
+
const containerRef = React85.useRef(null);
|
|
42482
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
42483
|
+
React85.useEffect(() => {
|
|
42686
42484
|
if (autoScroll && containerRef.current) {
|
|
42687
42485
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42688
42486
|
}
|
|
42689
42487
|
}, [events2.length, autoScroll]);
|
|
42690
|
-
const filteredEvents =
|
|
42488
|
+
const filteredEvents = React85.useMemo(() => {
|
|
42691
42489
|
if (filter === "all") return events2;
|
|
42692
42490
|
return events2.filter((e) => e.type === filter);
|
|
42693
42491
|
}, [events2, filter]);
|
|
@@ -42803,7 +42601,7 @@ var init_EventFlowTab = __esm({
|
|
|
42803
42601
|
});
|
|
42804
42602
|
function GuardsPanel({ guards }) {
|
|
42805
42603
|
const { t } = useTranslate();
|
|
42806
|
-
const [filter, setFilter] =
|
|
42604
|
+
const [filter, setFilter] = React85.useState("all");
|
|
42807
42605
|
if (guards.length === 0) {
|
|
42808
42606
|
return /* @__PURE__ */ jsx(
|
|
42809
42607
|
EmptyState,
|
|
@@ -42816,7 +42614,7 @@ function GuardsPanel({ guards }) {
|
|
|
42816
42614
|
}
|
|
42817
42615
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42818
42616
|
const failedCount = guards.length - passedCount;
|
|
42819
|
-
const filteredGuards =
|
|
42617
|
+
const filteredGuards = React85.useMemo(() => {
|
|
42820
42618
|
if (filter === "all") return guards;
|
|
42821
42619
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42822
42620
|
return guards.filter((g) => !g.result);
|
|
@@ -42979,10 +42777,10 @@ function EffectBadge({ effect }) {
|
|
|
42979
42777
|
}
|
|
42980
42778
|
function TransitionTimeline({ transitions }) {
|
|
42981
42779
|
const { t } = useTranslate();
|
|
42982
|
-
const containerRef =
|
|
42983
|
-
const [autoScroll, setAutoScroll] =
|
|
42984
|
-
const [expandedId, setExpandedId] =
|
|
42985
|
-
|
|
42780
|
+
const containerRef = React85.useRef(null);
|
|
42781
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
42782
|
+
const [expandedId, setExpandedId] = React85.useState(null);
|
|
42783
|
+
React85.useEffect(() => {
|
|
42986
42784
|
if (autoScroll && containerRef.current) {
|
|
42987
42785
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42988
42786
|
}
|
|
@@ -43262,9 +43060,9 @@ function getAllEvents(traits2) {
|
|
|
43262
43060
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43263
43061
|
const eventBus = useEventBus();
|
|
43264
43062
|
const { t } = useTranslate();
|
|
43265
|
-
const [log12, setLog] =
|
|
43266
|
-
const prevStatesRef =
|
|
43267
|
-
|
|
43063
|
+
const [log12, setLog] = React85.useState([]);
|
|
43064
|
+
const prevStatesRef = React85.useRef(/* @__PURE__ */ new Map());
|
|
43065
|
+
React85.useEffect(() => {
|
|
43268
43066
|
for (const trait of traits2) {
|
|
43269
43067
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43270
43068
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43433,10 +43231,10 @@ function VerifyModePanel({
|
|
|
43433
43231
|
localCount
|
|
43434
43232
|
}) {
|
|
43435
43233
|
const { t } = useTranslate();
|
|
43436
|
-
const [expanded, setExpanded] =
|
|
43437
|
-
const scrollRef =
|
|
43438
|
-
const prevCountRef =
|
|
43439
|
-
|
|
43234
|
+
const [expanded, setExpanded] = React85.useState(true);
|
|
43235
|
+
const scrollRef = React85.useRef(null);
|
|
43236
|
+
const prevCountRef = React85.useRef(0);
|
|
43237
|
+
React85.useEffect(() => {
|
|
43440
43238
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43441
43239
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43442
43240
|
}
|
|
@@ -43493,10 +43291,10 @@ function RuntimeDebugger({
|
|
|
43493
43291
|
schema
|
|
43494
43292
|
}) {
|
|
43495
43293
|
const { t } = useTranslate();
|
|
43496
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43497
|
-
const [isVisible, setIsVisible] =
|
|
43294
|
+
const [isCollapsed, setIsCollapsed] = React85.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43295
|
+
const [isVisible, setIsVisible] = React85.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43498
43296
|
const debugData = useDebugData();
|
|
43499
|
-
|
|
43297
|
+
React85.useEffect(() => {
|
|
43500
43298
|
if (mode === "inline") return;
|
|
43501
43299
|
return onDebugToggle((enabled) => {
|
|
43502
43300
|
setIsVisible(enabled);
|
|
@@ -43505,7 +43303,7 @@ function RuntimeDebugger({
|
|
|
43505
43303
|
}
|
|
43506
43304
|
});
|
|
43507
43305
|
}, [mode]);
|
|
43508
|
-
|
|
43306
|
+
React85.useEffect(() => {
|
|
43509
43307
|
if (mode === "inline") return;
|
|
43510
43308
|
const handleKeyDown = (e) => {
|
|
43511
43309
|
if (e.key === "`" && isVisible) {
|
|
@@ -43954,7 +43752,7 @@ function SequenceBar({
|
|
|
43954
43752
|
onSlotRemove(index);
|
|
43955
43753
|
}, [onSlotRemove, playing]);
|
|
43956
43754
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
43957
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
43755
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
43958
43756
|
i > 0 && /* @__PURE__ */ jsx(
|
|
43959
43757
|
Typography,
|
|
43960
43758
|
{
|
|
@@ -44933,7 +44731,7 @@ var init_StatCard = __esm({
|
|
|
44933
44731
|
const labelToUse = propLabel ?? propTitle;
|
|
44934
44732
|
const eventBus = useEventBus();
|
|
44935
44733
|
const { t } = useTranslate();
|
|
44936
|
-
const handleActionClick =
|
|
44734
|
+
const handleActionClick = React85__default.useCallback(() => {
|
|
44937
44735
|
if (action?.event) {
|
|
44938
44736
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44939
44737
|
}
|
|
@@ -44944,7 +44742,7 @@ var init_StatCard = __esm({
|
|
|
44944
44742
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44945
44743
|
const isLoading = externalLoading ?? false;
|
|
44946
44744
|
const error = externalError;
|
|
44947
|
-
const computeMetricValue =
|
|
44745
|
+
const computeMetricValue = React85__default.useCallback(
|
|
44948
44746
|
(metric, items) => {
|
|
44949
44747
|
if (metric.value !== void 0) {
|
|
44950
44748
|
return metric.value;
|
|
@@ -44983,7 +44781,7 @@ var init_StatCard = __esm({
|
|
|
44983
44781
|
},
|
|
44984
44782
|
[]
|
|
44985
44783
|
);
|
|
44986
|
-
const schemaStats =
|
|
44784
|
+
const schemaStats = React85__default.useMemo(() => {
|
|
44987
44785
|
if (!metrics || metrics.length === 0) return null;
|
|
44988
44786
|
return metrics.map((metric) => ({
|
|
44989
44787
|
label: metric.label,
|
|
@@ -44991,7 +44789,7 @@ var init_StatCard = __esm({
|
|
|
44991
44789
|
format: metric.format
|
|
44992
44790
|
}));
|
|
44993
44791
|
}, [metrics, data, computeMetricValue]);
|
|
44994
|
-
const calculatedTrend =
|
|
44792
|
+
const calculatedTrend = React85__default.useMemo(() => {
|
|
44995
44793
|
if (manualTrend !== void 0) return manualTrend;
|
|
44996
44794
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44997
44795
|
return void 0;
|
|
@@ -45272,6 +45070,37 @@ var init_VariablePanel = __esm({
|
|
|
45272
45070
|
VariablePanel.displayName = "VariablePanel";
|
|
45273
45071
|
}
|
|
45274
45072
|
});
|
|
45073
|
+
function StateJsonView({
|
|
45074
|
+
data,
|
|
45075
|
+
label,
|
|
45076
|
+
defaultExpanded = false,
|
|
45077
|
+
className
|
|
45078
|
+
}) {
|
|
45079
|
+
const { t } = useTranslate();
|
|
45080
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
45081
|
+
const jsonString = JSON.stringify(data, null, 2);
|
|
45082
|
+
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
45083
|
+
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
45084
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
45085
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
|
|
45086
|
+
] }),
|
|
45087
|
+
expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
45088
|
+
Typography,
|
|
45089
|
+
{
|
|
45090
|
+
variant: "caption",
|
|
45091
|
+
className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
|
|
45092
|
+
children: jsonString
|
|
45093
|
+
}
|
|
45094
|
+
) })
|
|
45095
|
+
] });
|
|
45096
|
+
}
|
|
45097
|
+
var init_StateJsonView = __esm({
|
|
45098
|
+
"components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
|
|
45099
|
+
init_atoms2();
|
|
45100
|
+
init_cn();
|
|
45101
|
+
StateJsonView.displayName = "StateJsonView";
|
|
45102
|
+
}
|
|
45103
|
+
});
|
|
45275
45104
|
function layoutStates(states, width, height) {
|
|
45276
45105
|
const cx = width / 2;
|
|
45277
45106
|
const cy = height / 2;
|
|
@@ -45563,7 +45392,7 @@ function StateArchitectBoard({
|
|
|
45563
45392
|
!r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
|
|
45564
45393
|
] }, i))
|
|
45565
45394
|
] }),
|
|
45566
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
45395
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
|
|
45567
45396
|
] })
|
|
45568
45397
|
] }),
|
|
45569
45398
|
playState === "success" && /* @__PURE__ */ jsx(Box, { className: "p-4 rounded-container bg-success/20 border border-success text-center", children: /* @__PURE__ */ jsx(Typography, { variant: "h5", className: "text-success", children: str(resolved.successMessage) || t("stateArchitect.allPassed") }) }),
|
|
@@ -45600,7 +45429,7 @@ var init_StateArchitectBoard = __esm({
|
|
|
45600
45429
|
init_StateNode();
|
|
45601
45430
|
init_TransitionArrow();
|
|
45602
45431
|
init_VariablePanel();
|
|
45603
|
-
|
|
45432
|
+
init_StateJsonView();
|
|
45604
45433
|
init_boardEntity();
|
|
45605
45434
|
ENCOURAGEMENT_KEYS3 = [
|
|
45606
45435
|
"puzzle.tryAgain1",
|
|
@@ -45925,7 +45754,7 @@ var init_Timeline = __esm({
|
|
|
45925
45754
|
}) => {
|
|
45926
45755
|
const { t } = useTranslate();
|
|
45927
45756
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45928
|
-
const items =
|
|
45757
|
+
const items = React85__default.useMemo(() => {
|
|
45929
45758
|
if (propItems) return propItems;
|
|
45930
45759
|
if (entityData.length === 0) return [];
|
|
45931
45760
|
return entityData.map((record, idx) => {
|
|
@@ -46032,7 +45861,7 @@ var init_Timeline = __esm({
|
|
|
46032
45861
|
}
|
|
46033
45862
|
});
|
|
46034
45863
|
function extractToastProps(children) {
|
|
46035
|
-
if (!
|
|
45864
|
+
if (!React85__default.isValidElement(children)) {
|
|
46036
45865
|
if (typeof children === "string") {
|
|
46037
45866
|
return { message: children };
|
|
46038
45867
|
}
|
|
@@ -46070,7 +45899,7 @@ var init_ToastSlot = __esm({
|
|
|
46070
45899
|
eventBus.emit("UI:CLOSE");
|
|
46071
45900
|
};
|
|
46072
45901
|
if (!isVisible) return null;
|
|
46073
|
-
const isCustomContent =
|
|
45902
|
+
const isCustomContent = React85__default.isValidElement(children) && !message;
|
|
46074
45903
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
46075
45904
|
Toast,
|
|
46076
45905
|
{
|
|
@@ -46580,12 +46409,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
46580
46409
|
}
|
|
46581
46410
|
});
|
|
46582
46411
|
function lazyThree(name, loader) {
|
|
46583
|
-
const Lazy =
|
|
46412
|
+
const Lazy = React85__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46584
46413
|
function ThreeWrapper(props) {
|
|
46585
|
-
return
|
|
46586
|
-
|
|
46414
|
+
return React85__default.createElement(
|
|
46415
|
+
React85__default.Suspense,
|
|
46587
46416
|
{ fallback: null },
|
|
46588
|
-
|
|
46417
|
+
React85__default.createElement(Lazy, props)
|
|
46589
46418
|
);
|
|
46590
46419
|
}
|
|
46591
46420
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -46633,8 +46462,6 @@ var init_component_registry_generated = __esm({
|
|
|
46633
46462
|
init_ChoiceButton();
|
|
46634
46463
|
init_ClassifierBoard();
|
|
46635
46464
|
init_CodeBlock();
|
|
46636
|
-
init_CodeView();
|
|
46637
|
-
init_CodeViewer();
|
|
46638
46465
|
init_CombatLog();
|
|
46639
46466
|
init_ComboCounter();
|
|
46640
46467
|
init_CommunityLinks();
|
|
@@ -46662,7 +46489,6 @@ var init_component_registry_generated = __esm({
|
|
|
46662
46489
|
init_DialogueBox();
|
|
46663
46490
|
init_DialogueBubble();
|
|
46664
46491
|
init_DocBreadcrumb();
|
|
46665
|
-
init_DocCodeBlock();
|
|
46666
46492
|
init_DocPagination();
|
|
46667
46493
|
init_DocSearch();
|
|
46668
46494
|
init_DocSidebar();
|
|
@@ -46917,8 +46743,6 @@ var init_component_registry_generated = __esm({
|
|
|
46917
46743
|
"ChoiceButton": ChoiceButton,
|
|
46918
46744
|
"ClassifierBoard": ClassifierBoard,
|
|
46919
46745
|
"CodeBlock": CodeBlock,
|
|
46920
|
-
"CodeView": CodeView,
|
|
46921
|
-
"CodeViewer": CodeViewer,
|
|
46922
46746
|
"CombatLog": CombatLog,
|
|
46923
46747
|
"ComboCounter": ComboCounter,
|
|
46924
46748
|
"CommunityLinks": CommunityLinks,
|
|
@@ -46950,7 +46774,6 @@ var init_component_registry_generated = __esm({
|
|
|
46950
46774
|
"Divider": DividerPattern,
|
|
46951
46775
|
"DividerPattern": DividerPattern,
|
|
46952
46776
|
"DocBreadcrumb": DocBreadcrumb,
|
|
46953
|
-
"DocCodeBlock": DocCodeBlock,
|
|
46954
46777
|
"DocPagination": DocPagination,
|
|
46955
46778
|
"DocSearch": DocSearch,
|
|
46956
46779
|
"DocSidebar": DocSidebar,
|
|
@@ -47201,7 +47024,7 @@ function SuspenseConfigProvider({
|
|
|
47201
47024
|
config,
|
|
47202
47025
|
children
|
|
47203
47026
|
}) {
|
|
47204
|
-
return
|
|
47027
|
+
return React85__default.createElement(
|
|
47205
47028
|
SuspenseConfigContext.Provider,
|
|
47206
47029
|
{ value: config },
|
|
47207
47030
|
children
|
|
@@ -47691,7 +47514,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47691
47514
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47692
47515
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47693
47516
|
}
|
|
47694
|
-
return /* @__PURE__ */ jsx(
|
|
47517
|
+
return /* @__PURE__ */ jsx(React85__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47695
47518
|
}
|
|
47696
47519
|
if (!child || typeof child !== "object") return null;
|
|
47697
47520
|
const childId = `${parentId}-${index}`;
|
|
@@ -47731,14 +47554,14 @@ function isPatternConfig(value) {
|
|
|
47731
47554
|
if (value === null || value === void 0) return false;
|
|
47732
47555
|
if (typeof value !== "object") return false;
|
|
47733
47556
|
if (Array.isArray(value)) return false;
|
|
47734
|
-
if (
|
|
47557
|
+
if (React85__default.isValidElement(value)) return false;
|
|
47735
47558
|
if (value instanceof Date) return false;
|
|
47736
47559
|
if (typeof value === "function") return false;
|
|
47737
47560
|
const record = value;
|
|
47738
47561
|
return "type" in record && typeof record.type === "string";
|
|
47739
47562
|
}
|
|
47740
47563
|
function isPlainConfigObject(value) {
|
|
47741
|
-
if (
|
|
47564
|
+
if (React85__default.isValidElement(value)) return false;
|
|
47742
47565
|
if (value instanceof Date) return false;
|
|
47743
47566
|
const proto = Object.getPrototypeOf(value);
|
|
47744
47567
|
return proto === Object.prototype || proto === null;
|