@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/runtime/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React84 from 'react';
|
|
2
|
+
import React84__default, { createContext, useMemo, useContext, useRef, useEffect, useCallback, Suspense, useState, useSyncExternalStore, useLayoutEffect, lazy, useId } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -393,7 +393,7 @@ var init_Box = __esm({
|
|
|
393
393
|
fixed: "fixed",
|
|
394
394
|
sticky: "sticky"
|
|
395
395
|
};
|
|
396
|
-
Box =
|
|
396
|
+
Box = React84__default.forwardRef(
|
|
397
397
|
({
|
|
398
398
|
padding,
|
|
399
399
|
paddingX,
|
|
@@ -443,7 +443,7 @@ var init_Box = __esm({
|
|
|
443
443
|
onMouseLeave?.(e);
|
|
444
444
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
445
445
|
const isClickable = action || onClick;
|
|
446
|
-
return
|
|
446
|
+
return React84__default.createElement(
|
|
447
447
|
Component,
|
|
448
448
|
{
|
|
449
449
|
ref,
|
|
@@ -1182,12 +1182,20 @@ function doResolve(name) {
|
|
|
1182
1182
|
if (asIs && typeof asIs === "object") return asIs;
|
|
1183
1183
|
return LucideIcons2.HelpCircle;
|
|
1184
1184
|
}
|
|
1185
|
-
var iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
1185
|
+
var colorTokenClasses, iconAliases, resolvedCache, sizeClasses, animationClasses, Icon;
|
|
1186
1186
|
var init_Icon = __esm({
|
|
1187
1187
|
"components/core/atoms/Icon.tsx"() {
|
|
1188
1188
|
"use client";
|
|
1189
1189
|
init_cn();
|
|
1190
1190
|
init_iconFamily();
|
|
1191
|
+
colorTokenClasses = {
|
|
1192
|
+
primary: "text-primary",
|
|
1193
|
+
secondary: "text-secondary",
|
|
1194
|
+
success: "text-success",
|
|
1195
|
+
warning: "text-warning",
|
|
1196
|
+
error: "text-error",
|
|
1197
|
+
muted: "text-muted-foreground"
|
|
1198
|
+
};
|
|
1191
1199
|
iconAliases = {
|
|
1192
1200
|
"close": LucideIcons2.X,
|
|
1193
1201
|
"trash": LucideIcons2.Trash2,
|
|
@@ -1226,7 +1234,7 @@ var init_Icon = __esm({
|
|
|
1226
1234
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
1227
1235
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
1228
1236
|
const family = useIconFamily();
|
|
1229
|
-
const RenderedComponent =
|
|
1237
|
+
const RenderedComponent = React84__default.useMemo(() => {
|
|
1230
1238
|
if (directIcon) return null;
|
|
1231
1239
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
1232
1240
|
}, [directIcon, effectiveName, family]);
|
|
@@ -1235,10 +1243,11 @@ var init_Icon = __esm({
|
|
|
1235
1243
|
...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
|
|
1236
1244
|
...style
|
|
1237
1245
|
};
|
|
1246
|
+
const resolvedColor = color ? color in colorTokenClasses ? colorTokenClasses[color] : color : "text-current";
|
|
1238
1247
|
const composedClassName = cn(
|
|
1239
1248
|
sizeClasses[size],
|
|
1240
1249
|
animationClasses[animation],
|
|
1241
|
-
|
|
1250
|
+
resolvedColor,
|
|
1242
1251
|
className
|
|
1243
1252
|
);
|
|
1244
1253
|
if (directIcon) {
|
|
@@ -1284,7 +1293,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
1284
1293
|
const IconComp = value;
|
|
1285
1294
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
1286
1295
|
}
|
|
1287
|
-
if (
|
|
1296
|
+
if (React84__default.isValidElement(value)) {
|
|
1288
1297
|
return value;
|
|
1289
1298
|
}
|
|
1290
1299
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -1360,7 +1369,7 @@ var init_Button = __esm({
|
|
|
1360
1369
|
md: "h-icon-default w-icon-default",
|
|
1361
1370
|
lg: "h-icon-default w-icon-default"
|
|
1362
1371
|
};
|
|
1363
|
-
Button =
|
|
1372
|
+
Button = React84__default.forwardRef(
|
|
1364
1373
|
({
|
|
1365
1374
|
className,
|
|
1366
1375
|
variant = "primary",
|
|
@@ -1425,7 +1434,7 @@ var Dialog;
|
|
|
1425
1434
|
var init_Dialog = __esm({
|
|
1426
1435
|
"components/core/atoms/Dialog.tsx"() {
|
|
1427
1436
|
init_cn();
|
|
1428
|
-
Dialog =
|
|
1437
|
+
Dialog = React84__default.forwardRef(
|
|
1429
1438
|
({
|
|
1430
1439
|
role = "dialog",
|
|
1431
1440
|
"aria-modal": ariaModal = true,
|
|
@@ -1566,43 +1575,6 @@ var init_Typography = __esm({
|
|
|
1566
1575
|
Typography.displayName = "Typography";
|
|
1567
1576
|
}
|
|
1568
1577
|
});
|
|
1569
|
-
var Overlay;
|
|
1570
|
-
var init_Overlay = __esm({
|
|
1571
|
-
"components/core/atoms/Overlay.tsx"() {
|
|
1572
|
-
"use client";
|
|
1573
|
-
init_cn();
|
|
1574
|
-
init_useEventBus();
|
|
1575
|
-
Overlay = ({
|
|
1576
|
-
isVisible = true,
|
|
1577
|
-
onClick,
|
|
1578
|
-
className,
|
|
1579
|
-
blur = false,
|
|
1580
|
-
action
|
|
1581
|
-
}) => {
|
|
1582
|
-
const eventBus = useEventBus();
|
|
1583
|
-
if (!isVisible) return null;
|
|
1584
|
-
const handleClick = (e) => {
|
|
1585
|
-
if (action) {
|
|
1586
|
-
eventBus.emit(`UI:${action}`, {});
|
|
1587
|
-
}
|
|
1588
|
-
onClick?.(e);
|
|
1589
|
-
};
|
|
1590
|
-
return /* @__PURE__ */ jsx(
|
|
1591
|
-
"div",
|
|
1592
|
-
{
|
|
1593
|
-
className: cn(
|
|
1594
|
-
"fixed inset-0 z-40",
|
|
1595
|
-
blur && "backdrop-blur-sm",
|
|
1596
|
-
className
|
|
1597
|
-
),
|
|
1598
|
-
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
1599
|
-
onClick: action || onClick ? handleClick : void 0,
|
|
1600
|
-
"aria-hidden": "true"
|
|
1601
|
-
}
|
|
1602
|
-
);
|
|
1603
|
-
};
|
|
1604
|
-
}
|
|
1605
|
-
});
|
|
1606
1578
|
var sizeClasses2, minWidthClasses, lookStyles, Modal;
|
|
1607
1579
|
var init_Modal = __esm({
|
|
1608
1580
|
"components/core/molecules/Modal.tsx"() {
|
|
@@ -1611,7 +1583,6 @@ var init_Modal = __esm({
|
|
|
1611
1583
|
init_Button();
|
|
1612
1584
|
init_Dialog();
|
|
1613
1585
|
init_Typography();
|
|
1614
|
-
init_Overlay();
|
|
1615
1586
|
init_cn();
|
|
1616
1587
|
init_useEventBus();
|
|
1617
1588
|
sizeClasses2 = {
|
|
@@ -1701,130 +1672,160 @@ var init_Modal = __esm({
|
|
|
1701
1672
|
}
|
|
1702
1673
|
};
|
|
1703
1674
|
return createPortal(
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1675
|
+
/* @__PURE__ */ jsx(
|
|
1676
|
+
"div",
|
|
1677
|
+
{
|
|
1678
|
+
className: cn(
|
|
1679
|
+
"fixed inset-0 z-[1000]",
|
|
1680
|
+
"flex items-start justify-center px-4 pb-4 pt-[10vh]",
|
|
1681
|
+
"max-sm:items-stretch max-sm:p-0 max-sm:pt-0"
|
|
1682
|
+
),
|
|
1683
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
1684
|
+
onClick: handleOverlayClick,
|
|
1685
|
+
"aria-hidden": "true",
|
|
1686
|
+
children: /* @__PURE__ */ jsxs(
|
|
1687
|
+
Dialog,
|
|
1688
|
+
{
|
|
1689
|
+
ref: modalRef,
|
|
1690
|
+
open: true,
|
|
1691
|
+
className: cn(
|
|
1692
|
+
// Reset browser-default dialog chrome — we own styling. `static`
|
|
1693
|
+
// overrides the user-agent `position: absolute` so the parent
|
|
1694
|
+
// flex container's `justify-center` actually centers the dialog
|
|
1695
|
+
// (without this, the dialog drops out of flex flow and `m-0`
|
|
1696
|
+
// kills the user-agent's `margin: auto` centering, pinning the
|
|
1697
|
+
// dialog to top-left).
|
|
1698
|
+
"static m-0 p-0 border-0 bg-transparent",
|
|
1699
|
+
// Pre-existing dialog frame
|
|
1700
|
+
"pointer-events-auto w-full flex flex-col bg-surface border shadow-elevation-dialog rounded-container",
|
|
1701
|
+
// Desktop sizing + viewport-aware floor.
|
|
1702
|
+
sizeClasses2[size],
|
|
1703
|
+
minWidthClasses[size],
|
|
1704
|
+
"max-h-[80vh]",
|
|
1705
|
+
// Mobile: take the entire screen. Override desktop max-w cap,
|
|
1706
|
+
// full height, no rounded corners, no min-width.
|
|
1707
|
+
"max-sm:max-w-none max-sm:max-h-none max-sm:w-full max-sm:h-full max-sm:rounded-none",
|
|
1708
|
+
lookStyles[look],
|
|
1709
|
+
className
|
|
1710
|
+
),
|
|
1711
|
+
style: dragY > 0 ? {
|
|
1712
|
+
transform: `translateY(${dragY}px)`,
|
|
1713
|
+
transition: isDragging.current ? "none" : "transform 200ms ease-out"
|
|
1714
|
+
} : void 0,
|
|
1715
|
+
...title && { "aria-labelledby": "modal-title" },
|
|
1716
|
+
children: [
|
|
1717
|
+
/* @__PURE__ */ jsx(
|
|
1718
|
+
Box,
|
|
1719
|
+
{
|
|
1720
|
+
className: "hidden max-sm:flex justify-center py-2 cursor-grab active:cursor-grabbing touch-none",
|
|
1721
|
+
onPointerDown: (e) => {
|
|
1722
|
+
if (!swipeDownToClose) return;
|
|
1723
|
+
dragStartY.current = e.clientY;
|
|
1724
|
+
isDragging.current = true;
|
|
1725
|
+
e.target.setPointerCapture(e.pointerId);
|
|
1726
|
+
},
|
|
1727
|
+
onPointerMove: (e) => {
|
|
1728
|
+
if (!isDragging.current) return;
|
|
1729
|
+
const dy = Math.max(0, e.clientY - dragStartY.current);
|
|
1730
|
+
setDragY(dy);
|
|
1731
|
+
},
|
|
1732
|
+
onPointerUp: () => {
|
|
1733
|
+
if (!isDragging.current) return;
|
|
1734
|
+
isDragging.current = false;
|
|
1735
|
+
if (dragY > 100) {
|
|
1736
|
+
handleClose();
|
|
1737
|
+
}
|
|
1738
|
+
setDragY(0);
|
|
1739
|
+
},
|
|
1740
|
+
onPointerCancel: () => {
|
|
1741
|
+
isDragging.current = false;
|
|
1742
|
+
setDragY(0);
|
|
1743
|
+
},
|
|
1744
|
+
children: /* @__PURE__ */ jsx(Box, { className: "w-10 h-1 rounded-full bg-border" })
|
|
1745
|
+
}
|
|
1745
1746
|
),
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
const dy = Math.max(0, e.clientY - dragStartY.current);
|
|
1765
|
-
setDragY(dy);
|
|
1766
|
-
},
|
|
1767
|
-
onPointerUp: () => {
|
|
1768
|
-
if (!isDragging.current) return;
|
|
1769
|
-
isDragging.current = false;
|
|
1770
|
-
if (dragY > 100) {
|
|
1771
|
-
handleClose();
|
|
1747
|
+
(title || showCloseButton) && /* @__PURE__ */ jsxs(
|
|
1748
|
+
Box,
|
|
1749
|
+
{
|
|
1750
|
+
className: cn(
|
|
1751
|
+
"px-6 py-4 flex items-center justify-between",
|
|
1752
|
+
"border-b-[length:var(--border-width)] border-border"
|
|
1753
|
+
),
|
|
1754
|
+
children: [
|
|
1755
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "h4", as: "h2", id: "modal-title", children: title }),
|
|
1756
|
+
showCloseButton && /* @__PURE__ */ jsx(
|
|
1757
|
+
Button,
|
|
1758
|
+
{
|
|
1759
|
+
variant: "ghost",
|
|
1760
|
+
size: "sm",
|
|
1761
|
+
icon: "x",
|
|
1762
|
+
onClick: handleClose,
|
|
1763
|
+
"data-event": "CLOSE",
|
|
1764
|
+
"aria-label": t("aria.closeModal")
|
|
1772
1765
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
{
|
|
1794
|
-
variant: "ghost",
|
|
1795
|
-
size: "sm",
|
|
1796
|
-
icon: "x",
|
|
1797
|
-
onClick: handleClose,
|
|
1798
|
-
"data-event": "CLOSE",
|
|
1799
|
-
"aria-label": t("aria.closeModal")
|
|
1800
|
-
}
|
|
1801
|
-
)
|
|
1802
|
-
]
|
|
1803
|
-
}
|
|
1804
|
-
),
|
|
1805
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
|
|
1806
|
-
footer && /* @__PURE__ */ jsx(
|
|
1807
|
-
Box,
|
|
1808
|
-
{
|
|
1809
|
-
className: cn(
|
|
1810
|
-
"px-6 py-4 bg-muted",
|
|
1811
|
-
"border-t-[length:var(--border-width)] border-border"
|
|
1812
|
-
),
|
|
1813
|
-
children: footer
|
|
1814
|
-
}
|
|
1815
|
-
)
|
|
1816
|
-
]
|
|
1817
|
-
}
|
|
1818
|
-
)
|
|
1819
|
-
}
|
|
1820
|
-
)
|
|
1821
|
-
] }),
|
|
1766
|
+
)
|
|
1767
|
+
]
|
|
1768
|
+
}
|
|
1769
|
+
),
|
|
1770
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto p-6", children }),
|
|
1771
|
+
footer && /* @__PURE__ */ jsx(
|
|
1772
|
+
Box,
|
|
1773
|
+
{
|
|
1774
|
+
className: cn(
|
|
1775
|
+
"px-6 py-4 bg-muted",
|
|
1776
|
+
"border-t-[length:var(--border-width)] border-border"
|
|
1777
|
+
),
|
|
1778
|
+
children: footer
|
|
1779
|
+
}
|
|
1780
|
+
)
|
|
1781
|
+
]
|
|
1782
|
+
}
|
|
1783
|
+
)
|
|
1784
|
+
}
|
|
1785
|
+
),
|
|
1822
1786
|
document.body
|
|
1823
1787
|
);
|
|
1824
1788
|
};
|
|
1825
1789
|
Modal.displayName = "Modal";
|
|
1826
1790
|
}
|
|
1827
1791
|
});
|
|
1792
|
+
var Overlay;
|
|
1793
|
+
var init_Overlay = __esm({
|
|
1794
|
+
"components/core/atoms/Overlay.tsx"() {
|
|
1795
|
+
"use client";
|
|
1796
|
+
init_cn();
|
|
1797
|
+
init_useEventBus();
|
|
1798
|
+
Overlay = ({
|
|
1799
|
+
isVisible = true,
|
|
1800
|
+
onClick,
|
|
1801
|
+
className,
|
|
1802
|
+
blur = false,
|
|
1803
|
+
action
|
|
1804
|
+
}) => {
|
|
1805
|
+
const eventBus = useEventBus();
|
|
1806
|
+
if (!isVisible) return null;
|
|
1807
|
+
const handleClick = (e) => {
|
|
1808
|
+
if (action) {
|
|
1809
|
+
eventBus.emit(`UI:${action}`, {});
|
|
1810
|
+
}
|
|
1811
|
+
onClick?.(e);
|
|
1812
|
+
};
|
|
1813
|
+
return /* @__PURE__ */ jsx(
|
|
1814
|
+
"div",
|
|
1815
|
+
{
|
|
1816
|
+
className: cn(
|
|
1817
|
+
"fixed inset-0 z-40",
|
|
1818
|
+
blur && "backdrop-blur-sm",
|
|
1819
|
+
className
|
|
1820
|
+
),
|
|
1821
|
+
style: { backgroundColor: "rgba(0, 0, 0, 0.6)" },
|
|
1822
|
+
onClick: action || onClick ? handleClick : void 0,
|
|
1823
|
+
"aria-hidden": "true"
|
|
1824
|
+
}
|
|
1825
|
+
);
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
});
|
|
1828
1829
|
var sizeWidths, Drawer;
|
|
1829
1830
|
var init_Drawer = __esm({
|
|
1830
1831
|
"components/core/molecules/Drawer.tsx"() {
|
|
@@ -2047,7 +2048,7 @@ var init_Badge = __esm({
|
|
|
2047
2048
|
md: "px-2.5 py-1 text-sm",
|
|
2048
2049
|
lg: "px-3 py-1.5 text-base"
|
|
2049
2050
|
};
|
|
2050
|
-
Badge =
|
|
2051
|
+
Badge = React84__default.forwardRef(
|
|
2051
2052
|
({ className, variant = "default", size = "sm", amount, label, icon, children, onRemove, removeLabel, ...props }, ref) => {
|
|
2052
2053
|
const iconSizes3 = {
|
|
2053
2054
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2363,7 +2364,7 @@ var init_SvgFlow = __esm({
|
|
|
2363
2364
|
opacity = 1,
|
|
2364
2365
|
className
|
|
2365
2366
|
}) => {
|
|
2366
|
-
const markerId =
|
|
2367
|
+
const markerId = React84__default.useMemo(() => {
|
|
2367
2368
|
flowIdCounter += 1;
|
|
2368
2369
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2369
2370
|
}, []);
|
|
@@ -2906,7 +2907,7 @@ var init_SvgRing = __esm({
|
|
|
2906
2907
|
className,
|
|
2907
2908
|
label
|
|
2908
2909
|
}) => {
|
|
2909
|
-
const gradientId =
|
|
2910
|
+
const gradientId = React84__default.useMemo(() => {
|
|
2910
2911
|
ringIdCounter += 1;
|
|
2911
2912
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2912
2913
|
}, []);
|
|
@@ -3068,7 +3069,7 @@ var init_Input = __esm({
|
|
|
3068
3069
|
"components/core/atoms/Input.tsx"() {
|
|
3069
3070
|
init_cn();
|
|
3070
3071
|
init_Icon();
|
|
3071
|
-
Input =
|
|
3072
|
+
Input = React84__default.forwardRef(
|
|
3072
3073
|
({
|
|
3073
3074
|
className,
|
|
3074
3075
|
inputType,
|
|
@@ -3189,7 +3190,7 @@ var Label;
|
|
|
3189
3190
|
var init_Label = __esm({
|
|
3190
3191
|
"components/core/atoms/Label.tsx"() {
|
|
3191
3192
|
init_cn();
|
|
3192
|
-
Label =
|
|
3193
|
+
Label = React84__default.forwardRef(
|
|
3193
3194
|
({ className, required, children, ...props }, ref) => {
|
|
3194
3195
|
return /* @__PURE__ */ jsxs(
|
|
3195
3196
|
"label",
|
|
@@ -3215,7 +3216,7 @@ var Textarea;
|
|
|
3215
3216
|
var init_Textarea = __esm({
|
|
3216
3217
|
"components/core/atoms/Textarea.tsx"() {
|
|
3217
3218
|
init_cn();
|
|
3218
|
-
Textarea =
|
|
3219
|
+
Textarea = React84__default.forwardRef(
|
|
3219
3220
|
({ className, error, ...props }, ref) => {
|
|
3220
3221
|
return /* @__PURE__ */ jsx(
|
|
3221
3222
|
"textarea",
|
|
@@ -3245,7 +3246,7 @@ var init_Select = __esm({
|
|
|
3245
3246
|
"components/core/atoms/Select.tsx"() {
|
|
3246
3247
|
init_cn();
|
|
3247
3248
|
init_Icon();
|
|
3248
|
-
Select =
|
|
3249
|
+
Select = React84__default.forwardRef(
|
|
3249
3250
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
3250
3251
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
3251
3252
|
/* @__PURE__ */ jsxs(
|
|
@@ -3287,7 +3288,7 @@ var Checkbox;
|
|
|
3287
3288
|
var init_Checkbox = __esm({
|
|
3288
3289
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3289
3290
|
init_cn();
|
|
3290
|
-
Checkbox =
|
|
3291
|
+
Checkbox = React84__default.forwardRef(
|
|
3291
3292
|
({ className, label, id, ...props }, ref) => {
|
|
3292
3293
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3293
3294
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -3378,7 +3379,7 @@ var init_Card = __esm({
|
|
|
3378
3379
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3379
3380
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3380
3381
|
};
|
|
3381
|
-
Card =
|
|
3382
|
+
Card = React84__default.forwardRef(
|
|
3382
3383
|
({
|
|
3383
3384
|
className,
|
|
3384
3385
|
variant = "bordered",
|
|
@@ -3416,9 +3417,9 @@ var init_Card = __esm({
|
|
|
3416
3417
|
}
|
|
3417
3418
|
);
|
|
3418
3419
|
Card.displayName = "Card";
|
|
3419
|
-
CardHeader =
|
|
3420
|
+
CardHeader = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3420
3421
|
CardHeader.displayName = "CardHeader";
|
|
3421
|
-
CardTitle =
|
|
3422
|
+
CardTitle = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3422
3423
|
"h3",
|
|
3423
3424
|
{
|
|
3424
3425
|
ref,
|
|
@@ -3431,11 +3432,11 @@ var init_Card = __esm({
|
|
|
3431
3432
|
}
|
|
3432
3433
|
));
|
|
3433
3434
|
CardTitle.displayName = "CardTitle";
|
|
3434
|
-
CardContent =
|
|
3435
|
+
CardContent = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3435
3436
|
CardContent.displayName = "CardContent";
|
|
3436
3437
|
CardBody = CardContent;
|
|
3437
3438
|
CardBody.displayName = "CardBody";
|
|
3438
|
-
CardFooter =
|
|
3439
|
+
CardFooter = React84__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3439
3440
|
"div",
|
|
3440
3441
|
{
|
|
3441
3442
|
ref,
|
|
@@ -3490,7 +3491,7 @@ var init_FilterPill = __esm({
|
|
|
3490
3491
|
md: "w-3.5 h-3.5",
|
|
3491
3492
|
lg: "w-4 h-4"
|
|
3492
3493
|
};
|
|
3493
|
-
FilterPill =
|
|
3494
|
+
FilterPill = React84__default.forwardRef(
|
|
3494
3495
|
({
|
|
3495
3496
|
className,
|
|
3496
3497
|
variant = "default",
|
|
@@ -3567,7 +3568,7 @@ var init_Spinner = __esm({
|
|
|
3567
3568
|
md: "h-6 w-6",
|
|
3568
3569
|
lg: "h-8 w-8"
|
|
3569
3570
|
};
|
|
3570
|
-
Spinner =
|
|
3571
|
+
Spinner = React84__default.forwardRef(
|
|
3571
3572
|
({ className, size = "md", ...props }, ref) => {
|
|
3572
3573
|
return /* @__PURE__ */ jsx(
|
|
3573
3574
|
"div",
|
|
@@ -3646,13 +3647,12 @@ var init_Avatar = __esm({
|
|
|
3646
3647
|
actionPayload
|
|
3647
3648
|
}) => {
|
|
3648
3649
|
const eventBus = useEventBus();
|
|
3649
|
-
const [imgFailed, setImgFailed] =
|
|
3650
|
-
|
|
3650
|
+
const [imgFailed, setImgFailed] = React84__default.useState(false);
|
|
3651
|
+
React84__default.useEffect(() => {
|
|
3651
3652
|
setImgFailed(false);
|
|
3652
3653
|
}, [src]);
|
|
3653
3654
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
3654
3655
|
const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
|
|
3655
|
-
const hasImage = !!src && !imgFailed;
|
|
3656
3656
|
const hasIcon = !!IconComponent;
|
|
3657
3657
|
const hasInitials = !!initials && !(hasIcon && !providedInitials);
|
|
3658
3658
|
const getInitialsBackground = () => "bg-primary text-primary-foreground";
|
|
@@ -3678,15 +3678,13 @@ var init_Avatar = __esm({
|
|
|
3678
3678
|
onClick: isClickable ? handleClick : void 0,
|
|
3679
3679
|
role: isClickable ? "button" : void 0,
|
|
3680
3680
|
tabIndex: isClickable ? 0 : void 0,
|
|
3681
|
-
children:
|
|
3681
|
+
children: src && !imgFailed ? /* @__PURE__ */ jsx(
|
|
3682
3682
|
"img",
|
|
3683
3683
|
{
|
|
3684
3684
|
src,
|
|
3685
3685
|
alt: alt || "Avatar",
|
|
3686
3686
|
className: "w-full h-full object-cover",
|
|
3687
|
-
onError: () =>
|
|
3688
|
-
setImgFailed(true);
|
|
3689
|
-
}
|
|
3687
|
+
onError: () => setImgFailed(true)
|
|
3690
3688
|
}
|
|
3691
3689
|
) : hasInitials ? /* @__PURE__ */ jsx(
|
|
3692
3690
|
"div",
|
|
@@ -3867,6 +3865,7 @@ var init_ProgressBar = __esm({
|
|
|
3867
3865
|
primary: "bg-primary",
|
|
3868
3866
|
success: "bg-success",
|
|
3869
3867
|
warning: "bg-warning",
|
|
3868
|
+
error: "bg-error",
|
|
3870
3869
|
danger: "bg-error"
|
|
3871
3870
|
};
|
|
3872
3871
|
circularSizeClasses = {
|
|
@@ -4032,7 +4031,7 @@ var init_Radio = __esm({
|
|
|
4032
4031
|
md: "w-2.5 h-2.5",
|
|
4033
4032
|
lg: "w-3 h-3"
|
|
4034
4033
|
};
|
|
4035
|
-
Radio =
|
|
4034
|
+
Radio = React84__default.forwardRef(
|
|
4036
4035
|
({
|
|
4037
4036
|
label,
|
|
4038
4037
|
helperText,
|
|
@@ -4049,12 +4048,12 @@ var init_Radio = __esm({
|
|
|
4049
4048
|
onChange,
|
|
4050
4049
|
...props
|
|
4051
4050
|
}, ref) => {
|
|
4052
|
-
const reactId =
|
|
4051
|
+
const reactId = React84__default.useId();
|
|
4053
4052
|
const baseId = id || `radio-${reactId}`;
|
|
4054
4053
|
const hasError = !!error;
|
|
4055
4054
|
const eventBus = useEventBus();
|
|
4056
|
-
const [selected, setSelected] =
|
|
4057
|
-
|
|
4055
|
+
const [selected, setSelected] = React84__default.useState(value);
|
|
4056
|
+
React84__default.useEffect(() => {
|
|
4058
4057
|
if (value !== void 0) setSelected(value);
|
|
4059
4058
|
}, [value]);
|
|
4060
4059
|
const pick = (next, e) => {
|
|
@@ -4236,7 +4235,7 @@ var init_Switch = __esm({
|
|
|
4236
4235
|
"components/core/atoms/Switch.tsx"() {
|
|
4237
4236
|
"use client";
|
|
4238
4237
|
init_cn();
|
|
4239
|
-
Switch =
|
|
4238
|
+
Switch = React84.forwardRef(
|
|
4240
4239
|
({
|
|
4241
4240
|
checked,
|
|
4242
4241
|
defaultChecked = false,
|
|
@@ -4247,10 +4246,10 @@ var init_Switch = __esm({
|
|
|
4247
4246
|
name,
|
|
4248
4247
|
className
|
|
4249
4248
|
}, ref) => {
|
|
4250
|
-
const [isChecked, setIsChecked] =
|
|
4249
|
+
const [isChecked, setIsChecked] = React84.useState(
|
|
4251
4250
|
checked !== void 0 ? checked : defaultChecked
|
|
4252
4251
|
);
|
|
4253
|
-
|
|
4252
|
+
React84.useEffect(() => {
|
|
4254
4253
|
if (checked !== void 0) {
|
|
4255
4254
|
setIsChecked(checked);
|
|
4256
4255
|
}
|
|
@@ -4781,7 +4780,7 @@ var Aside;
|
|
|
4781
4780
|
var init_Aside = __esm({
|
|
4782
4781
|
"components/core/atoms/Aside.tsx"() {
|
|
4783
4782
|
init_cn();
|
|
4784
|
-
Aside =
|
|
4783
|
+
Aside = React84__default.forwardRef(
|
|
4785
4784
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4786
4785
|
);
|
|
4787
4786
|
Aside.displayName = "Aside";
|
|
@@ -4859,8 +4858,8 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4859
4858
|
className
|
|
4860
4859
|
}) => {
|
|
4861
4860
|
const { t } = useTranslate();
|
|
4862
|
-
const [isVisible, setIsVisible] =
|
|
4863
|
-
const timeoutRef =
|
|
4861
|
+
const [isVisible, setIsVisible] = React84__default.useState(false);
|
|
4862
|
+
const timeoutRef = React84__default.useRef(null);
|
|
4864
4863
|
const handleMouseEnter = () => {
|
|
4865
4864
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4866
4865
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4869,7 +4868,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4869
4868
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4870
4869
|
setIsVisible(false);
|
|
4871
4870
|
};
|
|
4872
|
-
|
|
4871
|
+
React84__default.useEffect(() => {
|
|
4873
4872
|
return () => {
|
|
4874
4873
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4875
4874
|
};
|
|
@@ -5079,7 +5078,7 @@ var init_StatusDot = __esm({
|
|
|
5079
5078
|
md: "w-2.5 h-2.5",
|
|
5080
5079
|
lg: "w-3 h-3"
|
|
5081
5080
|
};
|
|
5082
|
-
StatusDot =
|
|
5081
|
+
StatusDot = React84__default.forwardRef(
|
|
5083
5082
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5084
5083
|
return /* @__PURE__ */ jsx(
|
|
5085
5084
|
"span",
|
|
@@ -5133,7 +5132,7 @@ var init_TrendIndicator = __esm({
|
|
|
5133
5132
|
down: "trending-down",
|
|
5134
5133
|
flat: "arrow-right"
|
|
5135
5134
|
};
|
|
5136
|
-
TrendIndicator =
|
|
5135
|
+
TrendIndicator = React84__default.forwardRef(
|
|
5137
5136
|
({
|
|
5138
5137
|
className,
|
|
5139
5138
|
value,
|
|
@@ -5200,7 +5199,7 @@ var init_RangeSlider = __esm({
|
|
|
5200
5199
|
md: "w-4 h-4",
|
|
5201
5200
|
lg: "w-5 h-5"
|
|
5202
5201
|
};
|
|
5203
|
-
RangeSlider =
|
|
5202
|
+
RangeSlider = React84__default.forwardRef(
|
|
5204
5203
|
({
|
|
5205
5204
|
className,
|
|
5206
5205
|
min = 0,
|
|
@@ -5708,7 +5707,7 @@ var init_ContentSection = __esm({
|
|
|
5708
5707
|
md: "py-16",
|
|
5709
5708
|
lg: "py-24"
|
|
5710
5709
|
};
|
|
5711
|
-
ContentSection =
|
|
5710
|
+
ContentSection = React84__default.forwardRef(
|
|
5712
5711
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5713
5712
|
return /* @__PURE__ */ jsx(
|
|
5714
5713
|
Box,
|
|
@@ -6242,7 +6241,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6242
6241
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6243
6242
|
"none": {}
|
|
6244
6243
|
};
|
|
6245
|
-
AnimatedReveal =
|
|
6244
|
+
AnimatedReveal = React84__default.forwardRef(
|
|
6246
6245
|
({
|
|
6247
6246
|
trigger = "scroll",
|
|
6248
6247
|
animation = "fade-up",
|
|
@@ -6402,7 +6401,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6402
6401
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6403
6402
|
"use client";
|
|
6404
6403
|
init_cn();
|
|
6405
|
-
AnimatedGraphic =
|
|
6404
|
+
AnimatedGraphic = React84__default.forwardRef(
|
|
6406
6405
|
({
|
|
6407
6406
|
src,
|
|
6408
6407
|
svgContent,
|
|
@@ -6425,7 +6424,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6425
6424
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6426
6425
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6427
6426
|
const prevAnimateRef = useRef(animate);
|
|
6428
|
-
const setRef =
|
|
6427
|
+
const setRef = React84__default.useCallback(
|
|
6429
6428
|
(node) => {
|
|
6430
6429
|
containerRef.current = node;
|
|
6431
6430
|
if (typeof ref === "function") ref(node);
|
|
@@ -6650,9 +6649,9 @@ function ScoreDisplay({
|
|
|
6650
6649
|
...rest
|
|
6651
6650
|
}) {
|
|
6652
6651
|
const resolvedValue = typeof value === "number" && !Number.isNaN(value) ? value : typeof rest.score === "number" && !Number.isNaN(rest.score) ? rest.score : 0;
|
|
6653
|
-
const [displayValue, setDisplayValue] =
|
|
6654
|
-
const [isAnimating, setIsAnimating] =
|
|
6655
|
-
|
|
6652
|
+
const [displayValue, setDisplayValue] = React84.useState(resolvedValue);
|
|
6653
|
+
const [isAnimating, setIsAnimating] = React84.useState(false);
|
|
6654
|
+
React84.useEffect(() => {
|
|
6656
6655
|
if (!animated || displayValue === resolvedValue) {
|
|
6657
6656
|
setDisplayValue(resolvedValue);
|
|
6658
6657
|
return;
|
|
@@ -6722,9 +6721,9 @@ function ControlButton({
|
|
|
6722
6721
|
className
|
|
6723
6722
|
}) {
|
|
6724
6723
|
const eventBus = useEventBus();
|
|
6725
|
-
const [isPressed, setIsPressed] =
|
|
6724
|
+
const [isPressed, setIsPressed] = React84.useState(false);
|
|
6726
6725
|
const actualPressed = pressed ?? isPressed;
|
|
6727
|
-
const handlePointerDown =
|
|
6726
|
+
const handlePointerDown = React84.useCallback(
|
|
6728
6727
|
(e) => {
|
|
6729
6728
|
e.preventDefault();
|
|
6730
6729
|
if (disabled) return;
|
|
@@ -6734,7 +6733,7 @@ function ControlButton({
|
|
|
6734
6733
|
},
|
|
6735
6734
|
[disabled, pressEvent, eventBus, onPress]
|
|
6736
6735
|
);
|
|
6737
|
-
const handlePointerUp =
|
|
6736
|
+
const handlePointerUp = React84.useCallback(
|
|
6738
6737
|
(e) => {
|
|
6739
6738
|
e.preventDefault();
|
|
6740
6739
|
if (disabled) return;
|
|
@@ -6744,7 +6743,7 @@ function ControlButton({
|
|
|
6744
6743
|
},
|
|
6745
6744
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
6746
6745
|
);
|
|
6747
|
-
const handlePointerLeave =
|
|
6746
|
+
const handlePointerLeave = React84.useCallback(
|
|
6748
6747
|
(e) => {
|
|
6749
6748
|
if (isPressed) {
|
|
6750
6749
|
setIsPressed(false);
|
|
@@ -7015,7 +7014,7 @@ function ResourceCounter({
|
|
|
7015
7014
|
children: [
|
|
7016
7015
|
icon && /* @__PURE__ */ jsx("span", { className: cn("flex-shrink-0", sizes.icon), children: icon }),
|
|
7017
7016
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: label }),
|
|
7018
|
-
/* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color), children: [
|
|
7017
|
+
/* @__PURE__ */ jsxs("span", { className: cn("font-bold tabular-nums", color && (color in colorTokenClasses2 ? colorTokenClasses2[color] : color)), children: [
|
|
7019
7018
|
value,
|
|
7020
7019
|
max != null && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
7021
7020
|
"/",
|
|
@@ -7026,10 +7025,18 @@ function ResourceCounter({
|
|
|
7026
7025
|
}
|
|
7027
7026
|
);
|
|
7028
7027
|
}
|
|
7029
|
-
var sizeMap5;
|
|
7028
|
+
var colorTokenClasses2, sizeMap5;
|
|
7030
7029
|
var init_ResourceCounter = __esm({
|
|
7031
7030
|
"components/game/atoms/ResourceCounter.tsx"() {
|
|
7032
7031
|
init_cn();
|
|
7032
|
+
colorTokenClasses2 = {
|
|
7033
|
+
primary: "text-primary",
|
|
7034
|
+
secondary: "text-secondary",
|
|
7035
|
+
success: "text-success",
|
|
7036
|
+
warning: "text-warning",
|
|
7037
|
+
error: "text-error",
|
|
7038
|
+
muted: "text-muted-foreground"
|
|
7039
|
+
};
|
|
7033
7040
|
sizeMap5 = {
|
|
7034
7041
|
sm: { wrapper: "text-xs gap-1 px-1.5 py-0.5", icon: "text-sm" },
|
|
7035
7042
|
md: { wrapper: "text-sm gap-1.5 px-2 py-1", icon: "text-base" },
|
|
@@ -7233,14 +7240,20 @@ function XPBar({
|
|
|
7233
7240
|
}) {
|
|
7234
7241
|
const sizes = sizeMap9[size];
|
|
7235
7242
|
const percentage = max > 0 ? Math.max(0, Math.min(100, current / max * 100)) : 0;
|
|
7236
|
-
const [fillWidth, setFillWidth] =
|
|
7237
|
-
|
|
7243
|
+
const [fillWidth, setFillWidth] = React84.useState(animated ? 0 : percentage);
|
|
7244
|
+
React84.useEffect(() => {
|
|
7238
7245
|
if (!animated) {
|
|
7239
7246
|
setFillWidth(percentage);
|
|
7240
7247
|
return;
|
|
7241
7248
|
}
|
|
7242
|
-
|
|
7243
|
-
|
|
7249
|
+
let frame2;
|
|
7250
|
+
const frame1 = requestAnimationFrame(() => {
|
|
7251
|
+
frame2 = requestAnimationFrame(() => setFillWidth(percentage));
|
|
7252
|
+
});
|
|
7253
|
+
return () => {
|
|
7254
|
+
cancelAnimationFrame(frame1);
|
|
7255
|
+
cancelAnimationFrame(frame2);
|
|
7256
|
+
};
|
|
7244
7257
|
}, [animated, percentage]);
|
|
7245
7258
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
7246
7259
|
level != null && /* @__PURE__ */ jsxs(
|
|
@@ -7278,7 +7291,7 @@ function XPBar({
|
|
|
7278
7291
|
)
|
|
7279
7292
|
}
|
|
7280
7293
|
),
|
|
7281
|
-
showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-
|
|
7294
|
+
showLabel && /* @__PURE__ */ jsxs("span", { className: cn("text-foreground/70 tabular-nums", sizes.text), children: [
|
|
7282
7295
|
current,
|
|
7283
7296
|
" / ",
|
|
7284
7297
|
max,
|
|
@@ -7396,7 +7409,7 @@ function StatusEffect({
|
|
|
7396
7409
|
),
|
|
7397
7410
|
title: label,
|
|
7398
7411
|
children: [
|
|
7399
|
-
/* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: icon }),
|
|
7412
|
+
/* @__PURE__ */ jsx("span", { className: cn("flex items-center justify-center", sizes.icon), children: /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }) }),
|
|
7400
7413
|
duration !== void 0 && /* @__PURE__ */ jsx(
|
|
7401
7414
|
"span",
|
|
7402
7415
|
{
|
|
@@ -7427,6 +7440,7 @@ var sizeMap11, variantStyles7;
|
|
|
7427
7440
|
var init_StatusEffect = __esm({
|
|
7428
7441
|
"components/game/atoms/StatusEffect.tsx"() {
|
|
7429
7442
|
init_cn();
|
|
7443
|
+
init_Icon();
|
|
7430
7444
|
sizeMap11 = {
|
|
7431
7445
|
sm: { container: "w-8 h-8", icon: "text-sm", badge: "text-xs -top-1 -right-1 w-4 h-4", timer: "text-[9px]" },
|
|
7432
7446
|
md: { container: "w-10 h-10", icon: "text-base", badge: "text-xs -top-1 -right-1 w-5 h-5", timer: "text-xs" },
|
|
@@ -7660,9 +7674,9 @@ function MiniMap({
|
|
|
7660
7674
|
viewportRect,
|
|
7661
7675
|
className
|
|
7662
7676
|
}) {
|
|
7663
|
-
const canvasRef =
|
|
7664
|
-
const frameRef =
|
|
7665
|
-
|
|
7677
|
+
const canvasRef = React84.useRef(null);
|
|
7678
|
+
const frameRef = React84.useRef(0);
|
|
7679
|
+
React84.useEffect(() => {
|
|
7666
7680
|
const canvas = canvasRef.current;
|
|
7667
7681
|
if (!canvas) return;
|
|
7668
7682
|
const ctx = canvas.getContext("2d");
|
|
@@ -7836,7 +7850,7 @@ var init_ErrorBoundary = __esm({
|
|
|
7836
7850
|
}
|
|
7837
7851
|
);
|
|
7838
7852
|
};
|
|
7839
|
-
ErrorBoundary = class extends
|
|
7853
|
+
ErrorBoundary = class extends React84__default.Component {
|
|
7840
7854
|
constructor(props) {
|
|
7841
7855
|
super(props);
|
|
7842
7856
|
__publicField(this, "reset", () => {
|
|
@@ -8915,7 +8929,7 @@ var init_Tooltip = __esm({
|
|
|
8915
8929
|
setIsVisible(false);
|
|
8916
8930
|
}, hideDelay);
|
|
8917
8931
|
};
|
|
8918
|
-
|
|
8932
|
+
useLayoutEffect(() => {
|
|
8919
8933
|
if (isVisible) {
|
|
8920
8934
|
updatePosition();
|
|
8921
8935
|
}
|
|
@@ -8926,8 +8940,8 @@ var init_Tooltip = __esm({
|
|
|
8926
8940
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
8927
8941
|
};
|
|
8928
8942
|
}, []);
|
|
8929
|
-
const triggerElement =
|
|
8930
|
-
const trigger =
|
|
8943
|
+
const triggerElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
8944
|
+
const trigger = React84__default.cloneElement(triggerElement, {
|
|
8931
8945
|
ref: triggerRef,
|
|
8932
8946
|
onMouseEnter: handleMouseEnter,
|
|
8933
8947
|
onMouseLeave: handleMouseLeave,
|
|
@@ -9074,8 +9088,8 @@ var init_Popover = __esm({
|
|
|
9074
9088
|
onMouseEnter: handleOpen,
|
|
9075
9089
|
onMouseLeave: handleClose
|
|
9076
9090
|
};
|
|
9077
|
-
const childElement =
|
|
9078
|
-
const triggerElement =
|
|
9091
|
+
const childElement = React84__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
9092
|
+
const triggerElement = React84__default.cloneElement(
|
|
9079
9093
|
childElement,
|
|
9080
9094
|
{
|
|
9081
9095
|
ref: triggerRef,
|
|
@@ -9091,7 +9105,10 @@ var init_Popover = __esm({
|
|
|
9091
9105
|
"bg-card border-2 border-border shadow-elevation-popover",
|
|
9092
9106
|
className
|
|
9093
9107
|
),
|
|
9094
|
-
style:
|
|
9108
|
+
style: {
|
|
9109
|
+
...computePopoverStyle(position, triggerRect, popoverWidth),
|
|
9110
|
+
...popoverWidth === 0 ? { visibility: "hidden" } : void 0
|
|
9111
|
+
},
|
|
9095
9112
|
role: "dialog",
|
|
9096
9113
|
onMouseEnter: trigger === "hover" ? handleOpen : void 0,
|
|
9097
9114
|
onMouseLeave: trigger === "hover" ? handleClose : void 0,
|
|
@@ -9201,8 +9218,8 @@ var init_Menu = __esm({
|
|
|
9201
9218
|
};
|
|
9202
9219
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
9203
9220
|
const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
|
|
9204
|
-
const triggerChild =
|
|
9205
|
-
const triggerElement =
|
|
9221
|
+
const triggerChild = React84__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
9222
|
+
const triggerElement = React84__default.cloneElement(
|
|
9206
9223
|
triggerChild,
|
|
9207
9224
|
{
|
|
9208
9225
|
ref: triggerRef,
|
|
@@ -9609,7 +9626,7 @@ var init_MapView = __esm({
|
|
|
9609
9626
|
shadowSize: [41, 41]
|
|
9610
9627
|
});
|
|
9611
9628
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
9612
|
-
const { useEffect: useEffect72, useRef: useRef66, useCallback:
|
|
9629
|
+
const { useEffect: useEffect72, useRef: useRef66, useCallback: useCallback112, useState: useState102 } = React84__default;
|
|
9613
9630
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
9614
9631
|
const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
9615
9632
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
@@ -9654,8 +9671,8 @@ var init_MapView = __esm({
|
|
|
9654
9671
|
showAttribution = true
|
|
9655
9672
|
}) {
|
|
9656
9673
|
const eventBus = useEventBus3();
|
|
9657
|
-
const [clickedPosition, setClickedPosition] =
|
|
9658
|
-
const handleMapClick =
|
|
9674
|
+
const [clickedPosition, setClickedPosition] = useState102(null);
|
|
9675
|
+
const handleMapClick = useCallback112((lat, lng) => {
|
|
9659
9676
|
if (showClickedPin) {
|
|
9660
9677
|
setClickedPosition({ lat, lng });
|
|
9661
9678
|
}
|
|
@@ -9664,7 +9681,7 @@ var init_MapView = __esm({
|
|
|
9664
9681
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
9665
9682
|
}
|
|
9666
9683
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
9667
|
-
const handleMarkerClick =
|
|
9684
|
+
const handleMarkerClick = useCallback112((marker) => {
|
|
9668
9685
|
onMarkerClick?.(marker);
|
|
9669
9686
|
if (markerClickEvent) {
|
|
9670
9687
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -9673,7 +9690,7 @@ var init_MapView = __esm({
|
|
|
9673
9690
|
return /* @__PURE__ */ jsx(
|
|
9674
9691
|
Box,
|
|
9675
9692
|
{
|
|
9676
|
-
className: cn("relative isolate w-full overflow-hidden rounded-lg", className),
|
|
9693
|
+
className: cn("relative isolate z-0 w-full overflow-hidden rounded-lg", className),
|
|
9677
9694
|
style: { height },
|
|
9678
9695
|
"data-testid": "map-view",
|
|
9679
9696
|
children: /* @__PURE__ */ jsxs(
|
|
@@ -9855,7 +9872,7 @@ function InputPattern({
|
|
|
9855
9872
|
fieldName
|
|
9856
9873
|
}) {
|
|
9857
9874
|
const { emit } = useEventBus();
|
|
9858
|
-
const [localValue, setLocalValue] =
|
|
9875
|
+
const [localValue, setLocalValue] = React84__default.useState(value);
|
|
9859
9876
|
const handleChange = (e) => {
|
|
9860
9877
|
setLocalValue(e.target.value);
|
|
9861
9878
|
if (onChange) {
|
|
@@ -9893,7 +9910,7 @@ function TextareaPattern({
|
|
|
9893
9910
|
fieldName
|
|
9894
9911
|
}) {
|
|
9895
9912
|
const { emit } = useEventBus();
|
|
9896
|
-
const [localValue, setLocalValue] =
|
|
9913
|
+
const [localValue, setLocalValue] = React84__default.useState(value);
|
|
9897
9914
|
const handleChange = (e) => {
|
|
9898
9915
|
setLocalValue(e.target.value);
|
|
9899
9916
|
if (onChange) {
|
|
@@ -9925,7 +9942,7 @@ function SelectPattern({
|
|
|
9925
9942
|
fieldName
|
|
9926
9943
|
}) {
|
|
9927
9944
|
const { emit } = useEventBus();
|
|
9928
|
-
const [localValue, setLocalValue] =
|
|
9945
|
+
const [localValue, setLocalValue] = React84__default.useState(value);
|
|
9929
9946
|
const handleChange = (e) => {
|
|
9930
9947
|
setLocalValue(e.target.value);
|
|
9931
9948
|
if (onChange) {
|
|
@@ -9954,7 +9971,7 @@ function CheckboxPattern({
|
|
|
9954
9971
|
className
|
|
9955
9972
|
}) {
|
|
9956
9973
|
const { emit } = useEventBus();
|
|
9957
|
-
const [localChecked, setLocalChecked] =
|
|
9974
|
+
const [localChecked, setLocalChecked] = React84__default.useState(checked);
|
|
9958
9975
|
const handleChange = (e) => {
|
|
9959
9976
|
setLocalChecked(e.target.checked);
|
|
9960
9977
|
if (onChange) {
|
|
@@ -10186,8 +10203,8 @@ function ActionButtons({
|
|
|
10186
10203
|
disabled
|
|
10187
10204
|
}) {
|
|
10188
10205
|
const eventBus = useEventBus();
|
|
10189
|
-
const [activeButtons, setActiveButtons] =
|
|
10190
|
-
const handlePress =
|
|
10206
|
+
const [activeButtons, setActiveButtons] = React84.useState(/* @__PURE__ */ new Set());
|
|
10207
|
+
const handlePress = React84.useCallback(
|
|
10191
10208
|
(id) => {
|
|
10192
10209
|
setActiveButtons((prev) => new Set(prev).add(id));
|
|
10193
10210
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -10195,7 +10212,7 @@ function ActionButtons({
|
|
|
10195
10212
|
},
|
|
10196
10213
|
[actionEvent, eventBus, onAction]
|
|
10197
10214
|
);
|
|
10198
|
-
const handleRelease =
|
|
10215
|
+
const handleRelease = React84.useCallback(
|
|
10199
10216
|
(id) => {
|
|
10200
10217
|
setActiveButtons((prev) => {
|
|
10201
10218
|
const next = new Set(prev);
|
|
@@ -13188,6 +13205,263 @@ var init_katex_min = __esm({
|
|
|
13188
13205
|
"node_modules/katex/dist/katex.min.css"() {
|
|
13189
13206
|
}
|
|
13190
13207
|
});
|
|
13208
|
+
var Tabs;
|
|
13209
|
+
var init_Tabs = __esm({
|
|
13210
|
+
"components/core/molecules/Tabs.tsx"() {
|
|
13211
|
+
"use client";
|
|
13212
|
+
init_Icon();
|
|
13213
|
+
init_Badge();
|
|
13214
|
+
init_Typography();
|
|
13215
|
+
init_Box();
|
|
13216
|
+
init_cn();
|
|
13217
|
+
init_useEventBus();
|
|
13218
|
+
Tabs = ({
|
|
13219
|
+
items,
|
|
13220
|
+
tabs,
|
|
13221
|
+
defaultActiveTab,
|
|
13222
|
+
activeTab: controlledActiveTab,
|
|
13223
|
+
onTabChange,
|
|
13224
|
+
tabChangeEvent,
|
|
13225
|
+
variant = "default",
|
|
13226
|
+
orientation = "horizontal",
|
|
13227
|
+
className
|
|
13228
|
+
}) => {
|
|
13229
|
+
const rawItems = items ?? tabs ?? [];
|
|
13230
|
+
const safeItems = rawItems.map(({ id, value, ...rest }) => ({
|
|
13231
|
+
...rest,
|
|
13232
|
+
id: id || value || ""
|
|
13233
|
+
}));
|
|
13234
|
+
const eventBus = useEventBus();
|
|
13235
|
+
const { t } = useTranslate();
|
|
13236
|
+
const initialActive = safeItems.find((item) => item.active)?.id;
|
|
13237
|
+
const [internalActiveTab, setInternalActiveTab] = useState(
|
|
13238
|
+
defaultActiveTab || initialActive || safeItems[0]?.id || ""
|
|
13239
|
+
);
|
|
13240
|
+
const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
|
|
13241
|
+
const tabRefs = useRef({});
|
|
13242
|
+
const handleTabChange = (tabId, tabEvent) => {
|
|
13243
|
+
if (controlledActiveTab === void 0) {
|
|
13244
|
+
setInternalActiveTab(tabId);
|
|
13245
|
+
}
|
|
13246
|
+
onTabChange?.(tabId);
|
|
13247
|
+
if (tabChangeEvent) {
|
|
13248
|
+
eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
|
|
13249
|
+
}
|
|
13250
|
+
if (tabEvent) {
|
|
13251
|
+
eventBus.emit(`UI:${tabEvent}`, { tabId });
|
|
13252
|
+
}
|
|
13253
|
+
};
|
|
13254
|
+
const handleKeyDown = (e, index) => {
|
|
13255
|
+
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
13256
|
+
e.preventDefault();
|
|
13257
|
+
const direction = e.key === "ArrowLeft" ? -1 : 1;
|
|
13258
|
+
const nextIndex = (index + direction + safeItems.length) % safeItems.length;
|
|
13259
|
+
const nextTab = safeItems[nextIndex];
|
|
13260
|
+
if (nextTab && !nextTab.disabled) {
|
|
13261
|
+
handleTabChange(nextTab.id);
|
|
13262
|
+
tabRefs.current[nextTab.id]?.focus();
|
|
13263
|
+
}
|
|
13264
|
+
} else if (e.key === "Home" || e.key === "End") {
|
|
13265
|
+
e.preventDefault();
|
|
13266
|
+
const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
|
|
13267
|
+
const targetTab = safeItems[targetIndex];
|
|
13268
|
+
if (targetTab && !targetTab.disabled) {
|
|
13269
|
+
handleTabChange(targetTab.id);
|
|
13270
|
+
tabRefs.current[targetTab.id]?.focus();
|
|
13271
|
+
}
|
|
13272
|
+
}
|
|
13273
|
+
};
|
|
13274
|
+
const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
|
|
13275
|
+
if (safeItems.length === 0) {
|
|
13276
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
|
|
13277
|
+
}
|
|
13278
|
+
const variantClasses2 = {
|
|
13279
|
+
default: [
|
|
13280
|
+
"border-b-[length:var(--border-width)] border-transparent",
|
|
13281
|
+
"hover:border-muted-foreground",
|
|
13282
|
+
"data-[active=true]:border-primary"
|
|
13283
|
+
].join(" "),
|
|
13284
|
+
pills: [
|
|
13285
|
+
"rounded-sm",
|
|
13286
|
+
"data-[active=true]:bg-primary",
|
|
13287
|
+
"data-[active=true]:text-primary-foreground"
|
|
13288
|
+
].join(" "),
|
|
13289
|
+
underline: [
|
|
13290
|
+
"border-b-[length:var(--border-width)] border-transparent",
|
|
13291
|
+
"data-[active=true]:border-primary"
|
|
13292
|
+
].join(" ")
|
|
13293
|
+
};
|
|
13294
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
|
|
13295
|
+
/* @__PURE__ */ jsx(
|
|
13296
|
+
Box,
|
|
13297
|
+
{
|
|
13298
|
+
role: "tablist",
|
|
13299
|
+
className: cn(
|
|
13300
|
+
"flex",
|
|
13301
|
+
// Horizontal tab strip becomes a horizontally-scrollable lane
|
|
13302
|
+
// below its container width — phones with many tabs scroll
|
|
13303
|
+
// instead of clipping. `snap-x` snaps to each tab; the
|
|
13304
|
+
// scrollbar is hidden for a cleaner affordance (the swipe
|
|
13305
|
+
// gesture is the discoverability cue).
|
|
13306
|
+
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",
|
|
13307
|
+
variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
|
|
13308
|
+
variant === "underline" && orientation === "vertical" && "border-b-0"
|
|
13309
|
+
),
|
|
13310
|
+
children: safeItems.map((item, index) => {
|
|
13311
|
+
const isActive = item.id === activeTab;
|
|
13312
|
+
const isDisabled = item.disabled;
|
|
13313
|
+
return /* @__PURE__ */ jsxs(
|
|
13314
|
+
Box,
|
|
13315
|
+
{
|
|
13316
|
+
as: "button",
|
|
13317
|
+
ref: (el) => {
|
|
13318
|
+
tabRefs.current[item.id] = el;
|
|
13319
|
+
},
|
|
13320
|
+
role: "tab",
|
|
13321
|
+
"aria-selected": isActive,
|
|
13322
|
+
"aria-controls": `tabpanel-${item.id}`,
|
|
13323
|
+
"aria-disabled": isDisabled,
|
|
13324
|
+
onClick: () => !isDisabled && handleTabChange(item.id, item.event),
|
|
13325
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
13326
|
+
"data-active": isActive,
|
|
13327
|
+
className: cn(
|
|
13328
|
+
"flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
|
|
13329
|
+
orientation === "horizontal" && "snap-start shrink-0",
|
|
13330
|
+
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
13331
|
+
isDisabled && "opacity-50 cursor-not-allowed",
|
|
13332
|
+
variantClasses2[variant],
|
|
13333
|
+
isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
|
|
13334
|
+
),
|
|
13335
|
+
children: [
|
|
13336
|
+
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
|
|
13337
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
|
|
13338
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
|
|
13339
|
+
]
|
|
13340
|
+
},
|
|
13341
|
+
item.id
|
|
13342
|
+
);
|
|
13343
|
+
})
|
|
13344
|
+
}
|
|
13345
|
+
),
|
|
13346
|
+
activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
|
|
13347
|
+
Box,
|
|
13348
|
+
{
|
|
13349
|
+
role: "tabpanel",
|
|
13350
|
+
id: `tabpanel-${activeTab}`,
|
|
13351
|
+
"aria-labelledby": `tab-${activeTab}`,
|
|
13352
|
+
className: "mt-4",
|
|
13353
|
+
children: activeTabContent
|
|
13354
|
+
}
|
|
13355
|
+
)
|
|
13356
|
+
] });
|
|
13357
|
+
};
|
|
13358
|
+
Tabs.displayName = "Tabs";
|
|
13359
|
+
}
|
|
13360
|
+
});
|
|
13361
|
+
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
13362
|
+
var init_EmptyState = __esm({
|
|
13363
|
+
"components/core/molecules/EmptyState.tsx"() {
|
|
13364
|
+
"use client";
|
|
13365
|
+
init_cn();
|
|
13366
|
+
init_atoms2();
|
|
13367
|
+
init_Box();
|
|
13368
|
+
init_Icon();
|
|
13369
|
+
init_Stack();
|
|
13370
|
+
init_Typography();
|
|
13371
|
+
init_useEventBus();
|
|
13372
|
+
ICON_NAME_ALIASES = {
|
|
13373
|
+
check: "check-circle",
|
|
13374
|
+
error: "x-circle",
|
|
13375
|
+
warning: "alert-circle"
|
|
13376
|
+
};
|
|
13377
|
+
lookStyles3 = {
|
|
13378
|
+
"icon-only": "",
|
|
13379
|
+
illustrated: "[&_svg]:w-32 [&_svg]:h-32",
|
|
13380
|
+
"text-only": "[&_svg]:hidden",
|
|
13381
|
+
mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
|
|
13382
|
+
};
|
|
13383
|
+
EmptyState = ({
|
|
13384
|
+
icon,
|
|
13385
|
+
title,
|
|
13386
|
+
message,
|
|
13387
|
+
description,
|
|
13388
|
+
actionLabel,
|
|
13389
|
+
onAction,
|
|
13390
|
+
className,
|
|
13391
|
+
destructive,
|
|
13392
|
+
variant,
|
|
13393
|
+
actionEvent,
|
|
13394
|
+
look = "icon-only"
|
|
13395
|
+
}) => {
|
|
13396
|
+
const eventBus = useEventBus();
|
|
13397
|
+
const { t } = useTranslate();
|
|
13398
|
+
const handleAction = () => {
|
|
13399
|
+
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
|
|
13400
|
+
onAction?.();
|
|
13401
|
+
};
|
|
13402
|
+
const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
|
|
13403
|
+
const iconComponent = typeof icon === "function" ? icon : void 0;
|
|
13404
|
+
const hasIcon = Boolean(iconName || iconComponent);
|
|
13405
|
+
const isDestructive = destructive || variant === "error";
|
|
13406
|
+
const isSuccess = variant === "success";
|
|
13407
|
+
const displayText = title || message || t("empty.noItems");
|
|
13408
|
+
return /* @__PURE__ */ jsxs(
|
|
13409
|
+
VStack,
|
|
13410
|
+
{
|
|
13411
|
+
align: "center",
|
|
13412
|
+
className: cn(
|
|
13413
|
+
"justify-center py-12 text-center",
|
|
13414
|
+
lookStyles3[look],
|
|
13415
|
+
className
|
|
13416
|
+
),
|
|
13417
|
+
children: [
|
|
13418
|
+
hasIcon && /* @__PURE__ */ jsx(
|
|
13419
|
+
Box,
|
|
13420
|
+
{
|
|
13421
|
+
className: cn(
|
|
13422
|
+
"mb-4 rounded-full p-3",
|
|
13423
|
+
isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
|
|
13424
|
+
),
|
|
13425
|
+
children: /* @__PURE__ */ jsx(
|
|
13426
|
+
Icon,
|
|
13427
|
+
{
|
|
13428
|
+
...iconName ? { name: iconName } : { icon: iconComponent },
|
|
13429
|
+
className: cn(
|
|
13430
|
+
"h-8 w-8",
|
|
13431
|
+
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
|
|
13432
|
+
)
|
|
13433
|
+
}
|
|
13434
|
+
)
|
|
13435
|
+
}
|
|
13436
|
+
),
|
|
13437
|
+
/* @__PURE__ */ jsx(
|
|
13438
|
+
Typography,
|
|
13439
|
+
{
|
|
13440
|
+
variant: "h3",
|
|
13441
|
+
className: cn(
|
|
13442
|
+
"text-lg font-medium",
|
|
13443
|
+
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
|
|
13444
|
+
),
|
|
13445
|
+
children: displayText
|
|
13446
|
+
}
|
|
13447
|
+
),
|
|
13448
|
+
description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
|
|
13449
|
+
actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
|
|
13450
|
+
Button,
|
|
13451
|
+
{
|
|
13452
|
+
className: "mt-4",
|
|
13453
|
+
variant: isDestructive ? "danger" : "primary",
|
|
13454
|
+
onClick: handleAction,
|
|
13455
|
+
children: actionLabel
|
|
13456
|
+
}
|
|
13457
|
+
)
|
|
13458
|
+
]
|
|
13459
|
+
}
|
|
13460
|
+
);
|
|
13461
|
+
};
|
|
13462
|
+
EmptyState.displayName = "EmptyState";
|
|
13463
|
+
}
|
|
13464
|
+
});
|
|
13191
13465
|
function computeFoldRegions(code) {
|
|
13192
13466
|
const lines = code.split("\n");
|
|
13193
13467
|
const regions = [];
|
|
@@ -13225,9 +13499,32 @@ function computeFoldRegions(code) {
|
|
|
13225
13499
|
function toCodeLanguage(value) {
|
|
13226
13500
|
return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
|
|
13227
13501
|
}
|
|
13228
|
-
|
|
13502
|
+
function generateDiff(oldVal, newVal) {
|
|
13503
|
+
const oldLines = oldVal.split("\n");
|
|
13504
|
+
const newLines = newVal.split("\n");
|
|
13505
|
+
const diff = [];
|
|
13506
|
+
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
13507
|
+
for (let i = 0; i < maxLen; i++) {
|
|
13508
|
+
const oldLine = oldLines[i];
|
|
13509
|
+
const newLine = newLines[i];
|
|
13510
|
+
if (oldLine === newLine) {
|
|
13511
|
+
diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
|
|
13512
|
+
} else {
|
|
13513
|
+
if (oldLine !== void 0) diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
|
|
13514
|
+
if (newLine !== void 0) diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
|
|
13515
|
+
}
|
|
13516
|
+
}
|
|
13517
|
+
return diff;
|
|
13518
|
+
}
|
|
13519
|
+
var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
|
|
13229
13520
|
var init_CodeBlock = __esm({
|
|
13230
13521
|
"components/core/molecules/markdown/CodeBlock.tsx"() {
|
|
13522
|
+
init_cn();
|
|
13523
|
+
init_atoms2();
|
|
13524
|
+
init_Tabs();
|
|
13525
|
+
init_LoadingState();
|
|
13526
|
+
init_ErrorState();
|
|
13527
|
+
init_EmptyState();
|
|
13231
13528
|
init_Box();
|
|
13232
13529
|
init_Button();
|
|
13233
13530
|
init_Badge();
|
|
@@ -13334,9 +13631,14 @@ var init_CodeBlock = __esm({
|
|
|
13334
13631
|
"lolo"
|
|
13335
13632
|
];
|
|
13336
13633
|
CODE_LANGUAGE_SET = new Set(CODE_LANGUAGES);
|
|
13634
|
+
DIFF_STYLES = {
|
|
13635
|
+
add: { bg: "bg-success/10", prefix: "+", text: "text-success" },
|
|
13636
|
+
remove: { bg: "bg-error/10", prefix: "-", text: "text-error" },
|
|
13637
|
+
context: { bg: "", prefix: " ", text: "text-foreground" }
|
|
13638
|
+
};
|
|
13337
13639
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
13338
13640
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
13339
|
-
CodeBlock =
|
|
13641
|
+
CodeBlock = React84__default.memo(
|
|
13340
13642
|
({
|
|
13341
13643
|
code: rawCode,
|
|
13342
13644
|
language = "text",
|
|
@@ -13347,7 +13649,20 @@ var init_CodeBlock = __esm({
|
|
|
13347
13649
|
className,
|
|
13348
13650
|
editable = false,
|
|
13349
13651
|
onChange,
|
|
13350
|
-
errorLines
|
|
13652
|
+
errorLines,
|
|
13653
|
+
// viewer props
|
|
13654
|
+
title,
|
|
13655
|
+
mode = "code",
|
|
13656
|
+
diff: propDiff,
|
|
13657
|
+
oldValue,
|
|
13658
|
+
newValue,
|
|
13659
|
+
showLineNumbers = false,
|
|
13660
|
+
wordWrap = false,
|
|
13661
|
+
files,
|
|
13662
|
+
actions,
|
|
13663
|
+
isLoading = false,
|
|
13664
|
+
error,
|
|
13665
|
+
showCopy
|
|
13351
13666
|
}) => {
|
|
13352
13667
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
13353
13668
|
const isOrb = language === "orb";
|
|
@@ -13359,6 +13674,20 @@ var init_CodeBlock = __esm({
|
|
|
13359
13674
|
const codeRef = useRef(null);
|
|
13360
13675
|
const savedScrollLeftRef = useRef(0);
|
|
13361
13676
|
const [copied, setCopied] = useState(false);
|
|
13677
|
+
const [wrap, setWrap] = useState(wordWrap);
|
|
13678
|
+
const [activeFileIndex, setActiveFileIndex] = useState(0);
|
|
13679
|
+
const activeFile = files?.[activeFileIndex];
|
|
13680
|
+
const activeCode = activeFile?.code ?? code;
|
|
13681
|
+
const activeLanguage = activeFile?.language ?? language;
|
|
13682
|
+
const diffLines = useMemo(() => {
|
|
13683
|
+
if (propDiff) return propDiff;
|
|
13684
|
+
if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
|
|
13685
|
+
return generateDiff(oldValue, newValue);
|
|
13686
|
+
}
|
|
13687
|
+
return null;
|
|
13688
|
+
}, [propDiff, mode, oldValue, newValue]);
|
|
13689
|
+
const isViewerMode = !!(title || files || showLineNumbers || diffLines || mode === "diff" || actions);
|
|
13690
|
+
const effectiveCopy = showCopy ?? showCopyButton;
|
|
13362
13691
|
const [editableValue, setEditableValue] = useState(code);
|
|
13363
13692
|
const [editableTextareaKey, setEditableTextareaKey] = useState(0);
|
|
13364
13693
|
const lastPropCodeRef = useRef(code);
|
|
@@ -13529,13 +13858,13 @@ var init_CodeBlock = __esm({
|
|
|
13529
13858
|
}, [language, code]);
|
|
13530
13859
|
const handleCopy = async () => {
|
|
13531
13860
|
try {
|
|
13532
|
-
await navigator.clipboard.writeText(
|
|
13861
|
+
await navigator.clipboard.writeText(activeCode);
|
|
13533
13862
|
setCopied(true);
|
|
13534
|
-
eventBus.emit("UI:COPY_CODE", { language, success: true });
|
|
13863
|
+
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: true });
|
|
13535
13864
|
setTimeout(() => setCopied(false), 2e3);
|
|
13536
13865
|
} catch (err) {
|
|
13537
13866
|
log7.error("Failed to copy code", { error: err instanceof Error ? err : String(err) });
|
|
13538
|
-
eventBus.emit("UI:COPY_CODE", { language, success: false });
|
|
13867
|
+
eventBus.emit("UI:COPY_CODE", { language: activeLanguage, success: false });
|
|
13539
13868
|
}
|
|
13540
13869
|
};
|
|
13541
13870
|
const handleSelectionCopy = useCallback((e) => {
|
|
@@ -13588,11 +13917,134 @@ var init_CodeBlock = __esm({
|
|
|
13588
13917
|
}
|
|
13589
13918
|
});
|
|
13590
13919
|
}
|
|
13591
|
-
const full =
|
|
13920
|
+
const full = activeCode.split("\n").slice(a, endLine + 1).join("\n");
|
|
13592
13921
|
e.clipboardData.setData("text/plain", full);
|
|
13593
13922
|
e.preventDefault();
|
|
13594
13923
|
}, [code]);
|
|
13595
|
-
|
|
13924
|
+
if (isLoading) {
|
|
13925
|
+
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
13926
|
+
}
|
|
13927
|
+
if (error) {
|
|
13928
|
+
return /* @__PURE__ */ jsx(ErrorState, { title: t("display.codeViewerError"), message: error.message, className });
|
|
13929
|
+
}
|
|
13930
|
+
if (isViewerMode && !activeCode && !diffLines) {
|
|
13931
|
+
return /* @__PURE__ */ jsx(EmptyState, { icon: Code, title: t("display.noCode"), description: "No code to display.", className });
|
|
13932
|
+
}
|
|
13933
|
+
if (isViewerMode) {
|
|
13934
|
+
const tabItems = files?.map((file, idx) => ({
|
|
13935
|
+
id: `file-${idx}`,
|
|
13936
|
+
label: file.label,
|
|
13937
|
+
content: null
|
|
13938
|
+
}));
|
|
13939
|
+
const lines = activeCode.split("\n");
|
|
13940
|
+
return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
|
|
13941
|
+
tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
|
|
13942
|
+
Tabs,
|
|
13943
|
+
{
|
|
13944
|
+
tabs: tabItems,
|
|
13945
|
+
activeTab: `file-${activeFileIndex}`,
|
|
13946
|
+
onTabChange: (id) => {
|
|
13947
|
+
const idx = parseInt(id.replace("file-", ""), 10);
|
|
13948
|
+
setActiveFileIndex(idx);
|
|
13949
|
+
}
|
|
13950
|
+
}
|
|
13951
|
+
) }),
|
|
13952
|
+
/* @__PURE__ */ jsxs(
|
|
13953
|
+
HStack,
|
|
13954
|
+
{
|
|
13955
|
+
gap: "sm",
|
|
13956
|
+
align: "center",
|
|
13957
|
+
justify: "between",
|
|
13958
|
+
className: "px-4 py-2 border-b border-border bg-muted/30",
|
|
13959
|
+
children: [
|
|
13960
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
13961
|
+
/* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
|
|
13962
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
|
|
13963
|
+
activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
|
|
13964
|
+
] }),
|
|
13965
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
13966
|
+
/* @__PURE__ */ jsx(
|
|
13967
|
+
Button,
|
|
13968
|
+
{
|
|
13969
|
+
variant: "ghost",
|
|
13970
|
+
size: "sm",
|
|
13971
|
+
icon: WrapText,
|
|
13972
|
+
onClick: () => setWrap(!wrap),
|
|
13973
|
+
className: cn(wrap && "text-primary")
|
|
13974
|
+
}
|
|
13975
|
+
),
|
|
13976
|
+
effectiveCopy && /* @__PURE__ */ jsx(
|
|
13977
|
+
Button,
|
|
13978
|
+
{
|
|
13979
|
+
variant: "ghost",
|
|
13980
|
+
size: "sm",
|
|
13981
|
+
icon: copied ? Check : Copy,
|
|
13982
|
+
onClick: handleCopy,
|
|
13983
|
+
className: cn(copied && "text-success")
|
|
13984
|
+
}
|
|
13985
|
+
),
|
|
13986
|
+
actions?.map((action, idx) => /* @__PURE__ */ jsx(
|
|
13987
|
+
Badge,
|
|
13988
|
+
{
|
|
13989
|
+
variant: "default",
|
|
13990
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
13991
|
+
onClick: () => {
|
|
13992
|
+
if (action.event) eventBus.emit(`UI:${action.event}`, {});
|
|
13993
|
+
},
|
|
13994
|
+
children: action.label
|
|
13995
|
+
},
|
|
13996
|
+
idx
|
|
13997
|
+
))
|
|
13998
|
+
] })
|
|
13999
|
+
]
|
|
14000
|
+
}
|
|
14001
|
+
),
|
|
14002
|
+
/* @__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) => {
|
|
14003
|
+
const style = DIFF_STYLES[line.type];
|
|
14004
|
+
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
14005
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
14006
|
+
Typography,
|
|
14007
|
+
{
|
|
14008
|
+
variant: "caption",
|
|
14009
|
+
color: "secondary",
|
|
14010
|
+
className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
|
|
14011
|
+
children: line.lineNumber ?? ""
|
|
14012
|
+
}
|
|
14013
|
+
),
|
|
14014
|
+
/* @__PURE__ */ jsxs(
|
|
14015
|
+
Typography,
|
|
14016
|
+
{
|
|
14017
|
+
variant: "caption",
|
|
14018
|
+
className: cn("font-mono flex-1 min-w-0", style.text, wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
|
|
14019
|
+
children: [
|
|
14020
|
+
/* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
|
|
14021
|
+
line.content
|
|
14022
|
+
]
|
|
14023
|
+
}
|
|
14024
|
+
)
|
|
14025
|
+
] }, idx);
|
|
14026
|
+
}) }) : /* @__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: [
|
|
14027
|
+
showLineNumbers && /* @__PURE__ */ jsx(
|
|
14028
|
+
Typography,
|
|
14029
|
+
{
|
|
14030
|
+
variant: "caption",
|
|
14031
|
+
color: "secondary",
|
|
14032
|
+
className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
|
|
14033
|
+
children: idx + 1
|
|
14034
|
+
}
|
|
14035
|
+
),
|
|
14036
|
+
/* @__PURE__ */ jsx(
|
|
14037
|
+
Typography,
|
|
14038
|
+
{
|
|
14039
|
+
variant: "caption",
|
|
14040
|
+
className: cn("font-mono flex-1 min-w-0", wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"),
|
|
14041
|
+
children: line || " "
|
|
14042
|
+
}
|
|
14043
|
+
)
|
|
14044
|
+
] }, idx)) }) })
|
|
14045
|
+
] }) });
|
|
14046
|
+
}
|
|
14047
|
+
const hasHeader = showLanguageBadge || effectiveCopy;
|
|
13596
14048
|
return /* @__PURE__ */ jsxs(Box, { className: `relative group ${className || ""}`, style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
13597
14049
|
hasHeader && /* @__PURE__ */ jsxs(
|
|
13598
14050
|
HStack,
|
|
@@ -13602,7 +14054,7 @@ var init_CodeBlock = __esm({
|
|
|
13602
14054
|
className: "px-3 py-2 bg-[var(--color-card)] rounded-t-lg border-b border-gray-700",
|
|
13603
14055
|
children: [
|
|
13604
14056
|
showLanguageBadge && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: language }),
|
|
13605
|
-
|
|
14057
|
+
effectiveCopy && /* @__PURE__ */ jsx(
|
|
13606
14058
|
Button,
|
|
13607
14059
|
{
|
|
13608
14060
|
variant: "ghost",
|
|
@@ -13761,7 +14213,7 @@ var init_CodeBlock = __esm({
|
|
|
13761
14213
|
)
|
|
13762
14214
|
] });
|
|
13763
14215
|
},
|
|
13764
|
-
(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
|
|
14216
|
+
(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
|
|
13765
14217
|
);
|
|
13766
14218
|
CodeBlock.displayName = "CodeBlock";
|
|
13767
14219
|
}
|
|
@@ -13773,7 +14225,7 @@ var init_MarkdownContent = __esm({
|
|
|
13773
14225
|
init_Box();
|
|
13774
14226
|
init_CodeBlock();
|
|
13775
14227
|
init_cn();
|
|
13776
|
-
MarkdownContent =
|
|
14228
|
+
MarkdownContent = React84__default.memo(
|
|
13777
14229
|
({ content, direction, className }) => {
|
|
13778
14230
|
const { t: _t } = useTranslate();
|
|
13779
14231
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -14869,7 +15321,7 @@ var init_StateMachineView = __esm({
|
|
|
14869
15321
|
style: { top: title ? 30 : 0 },
|
|
14870
15322
|
children: [
|
|
14871
15323
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
14872
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
15324
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React84__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
14873
15325
|
StateNode,
|
|
14874
15326
|
{
|
|
14875
15327
|
state,
|
|
@@ -16018,110 +16470,6 @@ var init_BookTableOfContents = __esm({
|
|
|
16018
16470
|
BookTableOfContents.displayName = "BookTableOfContents";
|
|
16019
16471
|
}
|
|
16020
16472
|
});
|
|
16021
|
-
var ICON_NAME_ALIASES, lookStyles3, EmptyState;
|
|
16022
|
-
var init_EmptyState = __esm({
|
|
16023
|
-
"components/core/molecules/EmptyState.tsx"() {
|
|
16024
|
-
"use client";
|
|
16025
|
-
init_cn();
|
|
16026
|
-
init_atoms2();
|
|
16027
|
-
init_Box();
|
|
16028
|
-
init_Icon();
|
|
16029
|
-
init_Stack();
|
|
16030
|
-
init_Typography();
|
|
16031
|
-
init_useEventBus();
|
|
16032
|
-
ICON_NAME_ALIASES = {
|
|
16033
|
-
check: "check-circle",
|
|
16034
|
-
error: "x-circle",
|
|
16035
|
-
warning: "alert-circle"
|
|
16036
|
-
};
|
|
16037
|
-
lookStyles3 = {
|
|
16038
|
-
"icon-only": "",
|
|
16039
|
-
illustrated: "[&_svg]:w-32 [&_svg]:h-32",
|
|
16040
|
-
"text-only": "[&_svg]:hidden",
|
|
16041
|
-
mascot: "[&_svg]:w-24 [&_svg]:h-24 [&_svg]:rounded-pill"
|
|
16042
|
-
};
|
|
16043
|
-
EmptyState = ({
|
|
16044
|
-
icon,
|
|
16045
|
-
title,
|
|
16046
|
-
message,
|
|
16047
|
-
description,
|
|
16048
|
-
actionLabel,
|
|
16049
|
-
onAction,
|
|
16050
|
-
className,
|
|
16051
|
-
destructive,
|
|
16052
|
-
variant,
|
|
16053
|
-
actionEvent,
|
|
16054
|
-
look = "icon-only"
|
|
16055
|
-
}) => {
|
|
16056
|
-
const eventBus = useEventBus();
|
|
16057
|
-
const { t } = useTranslate();
|
|
16058
|
-
const handleAction = () => {
|
|
16059
|
-
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
|
|
16060
|
-
onAction?.();
|
|
16061
|
-
};
|
|
16062
|
-
const iconName = typeof icon === "string" ? ICON_NAME_ALIASES[icon] ?? icon : void 0;
|
|
16063
|
-
const iconComponent = typeof icon === "function" ? icon : void 0;
|
|
16064
|
-
const hasIcon = Boolean(iconName || iconComponent);
|
|
16065
|
-
const isDestructive = destructive || variant === "error";
|
|
16066
|
-
const isSuccess = variant === "success";
|
|
16067
|
-
const displayText = title || message || t("empty.noItems");
|
|
16068
|
-
return /* @__PURE__ */ jsxs(
|
|
16069
|
-
VStack,
|
|
16070
|
-
{
|
|
16071
|
-
align: "center",
|
|
16072
|
-
className: cn(
|
|
16073
|
-
"justify-center py-12 text-center",
|
|
16074
|
-
lookStyles3[look],
|
|
16075
|
-
className
|
|
16076
|
-
),
|
|
16077
|
-
children: [
|
|
16078
|
-
hasIcon && /* @__PURE__ */ jsx(
|
|
16079
|
-
Box,
|
|
16080
|
-
{
|
|
16081
|
-
className: cn(
|
|
16082
|
-
"mb-4 rounded-full p-3",
|
|
16083
|
-
isDestructive ? "bg-error/10" : isSuccess ? "bg-success/10" : "bg-muted"
|
|
16084
|
-
),
|
|
16085
|
-
children: /* @__PURE__ */ jsx(
|
|
16086
|
-
Icon,
|
|
16087
|
-
{
|
|
16088
|
-
...iconName ? { name: iconName } : { icon: iconComponent },
|
|
16089
|
-
className: cn(
|
|
16090
|
-
"h-8 w-8",
|
|
16091
|
-
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-muted-foreground"
|
|
16092
|
-
)
|
|
16093
|
-
}
|
|
16094
|
-
)
|
|
16095
|
-
}
|
|
16096
|
-
),
|
|
16097
|
-
/* @__PURE__ */ jsx(
|
|
16098
|
-
Typography,
|
|
16099
|
-
{
|
|
16100
|
-
variant: "h3",
|
|
16101
|
-
className: cn(
|
|
16102
|
-
"text-lg font-medium",
|
|
16103
|
-
isDestructive ? "text-error" : isSuccess ? "text-success" : "text-foreground"
|
|
16104
|
-
),
|
|
16105
|
-
children: displayText
|
|
16106
|
-
}
|
|
16107
|
-
),
|
|
16108
|
-
description && /* @__PURE__ */ jsx(Typography, { variant: "small", className: "mt-1 text-muted-foreground max-w-sm", children: description }),
|
|
16109
|
-
actionLabel && (onAction || actionEvent) && /* @__PURE__ */ jsx(
|
|
16110
|
-
Button,
|
|
16111
|
-
{
|
|
16112
|
-
className: "mt-4",
|
|
16113
|
-
variant: isDestructive ? "danger" : "primary",
|
|
16114
|
-
onClick: handleAction,
|
|
16115
|
-
children: actionLabel
|
|
16116
|
-
}
|
|
16117
|
-
)
|
|
16118
|
-
]
|
|
16119
|
-
}
|
|
16120
|
-
);
|
|
16121
|
-
};
|
|
16122
|
-
EmptyState.displayName = "EmptyState";
|
|
16123
|
-
}
|
|
16124
|
-
});
|
|
16125
16473
|
|
|
16126
16474
|
// components/core/organisms/book/types.ts
|
|
16127
16475
|
function resolveFieldMap(fieldMap) {
|
|
@@ -16474,7 +16822,7 @@ var init_Grid = __esm({
|
|
|
16474
16822
|
as: Component = "div"
|
|
16475
16823
|
}) => {
|
|
16476
16824
|
const mergedStyle = rows2 ? { gridTemplateRows: `repeat(${rows2}, minmax(0, 1fr))`, ...style } : style;
|
|
16477
|
-
return
|
|
16825
|
+
return React84__default.createElement(
|
|
16478
16826
|
Component,
|
|
16479
16827
|
{
|
|
16480
16828
|
className: cn(
|
|
@@ -20917,449 +21265,6 @@ var init_ClassifierBoard = __esm({
|
|
|
20917
21265
|
ClassifierBoard.displayName = "ClassifierBoard";
|
|
20918
21266
|
}
|
|
20919
21267
|
});
|
|
20920
|
-
function CodeView({
|
|
20921
|
-
data,
|
|
20922
|
-
label,
|
|
20923
|
-
defaultExpanded = false,
|
|
20924
|
-
className
|
|
20925
|
-
}) {
|
|
20926
|
-
const { t } = useTranslate();
|
|
20927
|
-
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
20928
|
-
const jsonString = JSON.stringify(data, null, 2);
|
|
20929
|
-
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
20930
|
-
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
20931
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
20932
|
-
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
|
|
20933
|
-
] }),
|
|
20934
|
-
expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
20935
|
-
Typography,
|
|
20936
|
-
{
|
|
20937
|
-
variant: "caption",
|
|
20938
|
-
className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
|
|
20939
|
-
children: jsonString
|
|
20940
|
-
}
|
|
20941
|
-
) })
|
|
20942
|
-
] });
|
|
20943
|
-
}
|
|
20944
|
-
var init_CodeView = __esm({
|
|
20945
|
-
"components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
|
|
20946
|
-
init_atoms2();
|
|
20947
|
-
init_cn();
|
|
20948
|
-
CodeView.displayName = "CodeView";
|
|
20949
|
-
}
|
|
20950
|
-
});
|
|
20951
|
-
var Tabs;
|
|
20952
|
-
var init_Tabs = __esm({
|
|
20953
|
-
"components/core/molecules/Tabs.tsx"() {
|
|
20954
|
-
"use client";
|
|
20955
|
-
init_Icon();
|
|
20956
|
-
init_Badge();
|
|
20957
|
-
init_Typography();
|
|
20958
|
-
init_Box();
|
|
20959
|
-
init_cn();
|
|
20960
|
-
init_useEventBus();
|
|
20961
|
-
Tabs = ({
|
|
20962
|
-
items,
|
|
20963
|
-
tabs,
|
|
20964
|
-
defaultActiveTab,
|
|
20965
|
-
activeTab: controlledActiveTab,
|
|
20966
|
-
onTabChange,
|
|
20967
|
-
tabChangeEvent,
|
|
20968
|
-
variant = "default",
|
|
20969
|
-
orientation = "horizontal",
|
|
20970
|
-
className
|
|
20971
|
-
}) => {
|
|
20972
|
-
const rawItems = items ?? tabs ?? [];
|
|
20973
|
-
const safeItems = rawItems.map(({ id, value, ...rest }) => ({
|
|
20974
|
-
...rest,
|
|
20975
|
-
id: id || value || ""
|
|
20976
|
-
}));
|
|
20977
|
-
const eventBus = useEventBus();
|
|
20978
|
-
const { t } = useTranslate();
|
|
20979
|
-
const initialActive = safeItems.find((item) => item.active)?.id;
|
|
20980
|
-
const [internalActiveTab, setInternalActiveTab] = useState(
|
|
20981
|
-
defaultActiveTab || initialActive || safeItems[0]?.id || ""
|
|
20982
|
-
);
|
|
20983
|
-
const activeTab = controlledActiveTab !== void 0 ? controlledActiveTab : internalActiveTab;
|
|
20984
|
-
const tabRefs = useRef({});
|
|
20985
|
-
const handleTabChange = (tabId, tabEvent) => {
|
|
20986
|
-
if (controlledActiveTab === void 0) {
|
|
20987
|
-
setInternalActiveTab(tabId);
|
|
20988
|
-
}
|
|
20989
|
-
onTabChange?.(tabId);
|
|
20990
|
-
if (tabChangeEvent) {
|
|
20991
|
-
eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
|
|
20992
|
-
}
|
|
20993
|
-
if (tabEvent) {
|
|
20994
|
-
eventBus.emit(`UI:${tabEvent}`, { tabId });
|
|
20995
|
-
}
|
|
20996
|
-
};
|
|
20997
|
-
const handleKeyDown = (e, index) => {
|
|
20998
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
20999
|
-
e.preventDefault();
|
|
21000
|
-
const direction = e.key === "ArrowLeft" ? -1 : 1;
|
|
21001
|
-
const nextIndex = (index + direction + safeItems.length) % safeItems.length;
|
|
21002
|
-
const nextTab = safeItems[nextIndex];
|
|
21003
|
-
if (nextTab && !nextTab.disabled) {
|
|
21004
|
-
handleTabChange(nextTab.id);
|
|
21005
|
-
tabRefs.current[nextTab.id]?.focus();
|
|
21006
|
-
}
|
|
21007
|
-
} else if (e.key === "Home" || e.key === "End") {
|
|
21008
|
-
e.preventDefault();
|
|
21009
|
-
const targetIndex = e.key === "Home" ? 0 : safeItems.length - 1;
|
|
21010
|
-
const targetTab = safeItems[targetIndex];
|
|
21011
|
-
if (targetTab && !targetTab.disabled) {
|
|
21012
|
-
handleTabChange(targetTab.id);
|
|
21013
|
-
tabRefs.current[targetTab.id]?.focus();
|
|
21014
|
-
}
|
|
21015
|
-
}
|
|
21016
|
-
};
|
|
21017
|
-
const activeTabContent = safeItems.find((item) => item.id === activeTab)?.content;
|
|
21018
|
-
if (safeItems.length === 0) {
|
|
21019
|
-
return /* @__PURE__ */ jsx(Box, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", className: "py-4", children: t("empty.noItems") }) });
|
|
21020
|
-
}
|
|
21021
|
-
const variantClasses2 = {
|
|
21022
|
-
default: [
|
|
21023
|
-
"border-b-[length:var(--border-width)] border-transparent",
|
|
21024
|
-
"hover:border-muted-foreground",
|
|
21025
|
-
"data-[active=true]:border-primary"
|
|
21026
|
-
].join(" "),
|
|
21027
|
-
pills: [
|
|
21028
|
-
"rounded-sm",
|
|
21029
|
-
"data-[active=true]:bg-primary",
|
|
21030
|
-
"data-[active=true]:text-primary-foreground"
|
|
21031
|
-
].join(" "),
|
|
21032
|
-
underline: [
|
|
21033
|
-
"border-b-[length:var(--border-width)] border-transparent",
|
|
21034
|
-
"data-[active=true]:border-primary"
|
|
21035
|
-
].join(" ")
|
|
21036
|
-
};
|
|
21037
|
-
return /* @__PURE__ */ jsxs(Box, { className: cn("w-full", className), children: [
|
|
21038
|
-
/* @__PURE__ */ jsx(
|
|
21039
|
-
Box,
|
|
21040
|
-
{
|
|
21041
|
-
role: "tablist",
|
|
21042
|
-
className: cn(
|
|
21043
|
-
"flex",
|
|
21044
|
-
// Horizontal tab strip becomes a horizontally-scrollable lane
|
|
21045
|
-
// below its container width — phones with many tabs scroll
|
|
21046
|
-
// instead of clipping. `snap-x` snaps to each tab; the
|
|
21047
|
-
// scrollbar is hidden for a cleaner affordance (the swipe
|
|
21048
|
-
// gesture is the discoverability cue).
|
|
21049
|
-
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",
|
|
21050
|
-
variant === "pills" && "gap-1 p-1 bg-muted border-0 rounded-md",
|
|
21051
|
-
variant === "underline" && orientation === "vertical" && "border-b-0"
|
|
21052
|
-
),
|
|
21053
|
-
children: safeItems.map((item, index) => {
|
|
21054
|
-
const isActive = item.id === activeTab;
|
|
21055
|
-
const isDisabled = item.disabled;
|
|
21056
|
-
return /* @__PURE__ */ jsxs(
|
|
21057
|
-
Box,
|
|
21058
|
-
{
|
|
21059
|
-
as: "button",
|
|
21060
|
-
ref: (el) => {
|
|
21061
|
-
tabRefs.current[item.id] = el;
|
|
21062
|
-
},
|
|
21063
|
-
role: "tab",
|
|
21064
|
-
"aria-selected": isActive,
|
|
21065
|
-
"aria-controls": `tabpanel-${item.id}`,
|
|
21066
|
-
"aria-disabled": isDisabled,
|
|
21067
|
-
onClick: () => !isDisabled && handleTabChange(item.id, item.event),
|
|
21068
|
-
onKeyDown: (e) => handleKeyDown(e, index),
|
|
21069
|
-
"data-active": isActive,
|
|
21070
|
-
className: cn(
|
|
21071
|
-
"flex items-center gap-2 px-4 py-2 text-sm font-medium transition-all whitespace-nowrap",
|
|
21072
|
-
orientation === "horizontal" && "snap-start shrink-0",
|
|
21073
|
-
"focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
21074
|
-
isDisabled && "opacity-50 cursor-not-allowed",
|
|
21075
|
-
variantClasses2[variant],
|
|
21076
|
-
isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
|
|
21077
|
-
),
|
|
21078
|
-
children: [
|
|
21079
|
-
item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
|
|
21080
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
|
|
21081
|
-
item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
|
|
21082
|
-
]
|
|
21083
|
-
},
|
|
21084
|
-
item.id
|
|
21085
|
-
);
|
|
21086
|
-
})
|
|
21087
|
-
}
|
|
21088
|
-
),
|
|
21089
|
-
activeTabContent !== void 0 && activeTabContent !== null && /* @__PURE__ */ jsx(
|
|
21090
|
-
Box,
|
|
21091
|
-
{
|
|
21092
|
-
role: "tabpanel",
|
|
21093
|
-
id: `tabpanel-${activeTab}`,
|
|
21094
|
-
"aria-labelledby": `tab-${activeTab}`,
|
|
21095
|
-
className: "mt-4",
|
|
21096
|
-
children: activeTabContent
|
|
21097
|
-
}
|
|
21098
|
-
)
|
|
21099
|
-
] });
|
|
21100
|
-
};
|
|
21101
|
-
Tabs.displayName = "Tabs";
|
|
21102
|
-
}
|
|
21103
|
-
});
|
|
21104
|
-
function generateDiff(oldVal, newVal) {
|
|
21105
|
-
const oldLines = oldVal.split("\n");
|
|
21106
|
-
const newLines = newVal.split("\n");
|
|
21107
|
-
const diff = [];
|
|
21108
|
-
const maxLen = Math.max(oldLines.length, newLines.length);
|
|
21109
|
-
for (let i = 0; i < maxLen; i++) {
|
|
21110
|
-
const oldLine = oldLines[i];
|
|
21111
|
-
const newLine = newLines[i];
|
|
21112
|
-
if (oldLine === newLine) {
|
|
21113
|
-
diff.push({ type: "context", content: oldLine ?? "", lineNumber: i + 1 });
|
|
21114
|
-
} else {
|
|
21115
|
-
if (oldLine !== void 0) {
|
|
21116
|
-
diff.push({ type: "remove", content: oldLine, lineNumber: i + 1 });
|
|
21117
|
-
}
|
|
21118
|
-
if (newLine !== void 0) {
|
|
21119
|
-
diff.push({ type: "add", content: newLine, lineNumber: i + 1 });
|
|
21120
|
-
}
|
|
21121
|
-
}
|
|
21122
|
-
}
|
|
21123
|
-
return diff;
|
|
21124
|
-
}
|
|
21125
|
-
var DIFF_STYLES, CodeViewer;
|
|
21126
|
-
var init_CodeViewer = __esm({
|
|
21127
|
-
"components/core/molecules/CodeViewer.tsx"() {
|
|
21128
|
-
"use client";
|
|
21129
|
-
init_cn();
|
|
21130
|
-
init_atoms2();
|
|
21131
|
-
init_Stack();
|
|
21132
|
-
init_LoadingState();
|
|
21133
|
-
init_ErrorState();
|
|
21134
|
-
init_EmptyState();
|
|
21135
|
-
init_Tabs();
|
|
21136
|
-
init_useEventBus();
|
|
21137
|
-
DIFF_STYLES = {
|
|
21138
|
-
add: {
|
|
21139
|
-
bg: "bg-success/10",
|
|
21140
|
-
prefix: "+",
|
|
21141
|
-
text: "text-success"
|
|
21142
|
-
},
|
|
21143
|
-
remove: {
|
|
21144
|
-
bg: "bg-error/10",
|
|
21145
|
-
prefix: "-",
|
|
21146
|
-
text: "text-error"
|
|
21147
|
-
},
|
|
21148
|
-
context: {
|
|
21149
|
-
bg: "",
|
|
21150
|
-
prefix: " ",
|
|
21151
|
-
text: "text-foreground"
|
|
21152
|
-
}
|
|
21153
|
-
};
|
|
21154
|
-
CodeViewer = ({
|
|
21155
|
-
title,
|
|
21156
|
-
code,
|
|
21157
|
-
language,
|
|
21158
|
-
diff: propDiff,
|
|
21159
|
-
oldValue,
|
|
21160
|
-
newValue,
|
|
21161
|
-
mode = "code",
|
|
21162
|
-
showLineNumbers = true,
|
|
21163
|
-
showCopy = true,
|
|
21164
|
-
wordWrap = false,
|
|
21165
|
-
maxHeight = 500,
|
|
21166
|
-
files,
|
|
21167
|
-
actions,
|
|
21168
|
-
entity,
|
|
21169
|
-
isLoading = false,
|
|
21170
|
-
error,
|
|
21171
|
-
className
|
|
21172
|
-
}) => {
|
|
21173
|
-
const eventBus = useEventBus();
|
|
21174
|
-
const { t } = useTranslate();
|
|
21175
|
-
const [copied, setCopied] = useState(false);
|
|
21176
|
-
const [wrap, setWrap] = useState(wordWrap);
|
|
21177
|
-
const [activeFileIndex, setActiveFileIndex] = useState(0);
|
|
21178
|
-
const handleAction = useCallback(
|
|
21179
|
-
(action) => {
|
|
21180
|
-
if (action.event) {
|
|
21181
|
-
eventBus.emit(`UI:${action.event}`, {});
|
|
21182
|
-
}
|
|
21183
|
-
},
|
|
21184
|
-
[eventBus]
|
|
21185
|
-
);
|
|
21186
|
-
const activeFile = files?.[activeFileIndex];
|
|
21187
|
-
const activeCode = activeFile?.code ?? code ?? "";
|
|
21188
|
-
const activeLanguage = activeFile?.language ?? language ?? "text";
|
|
21189
|
-
const lines = useMemo(() => activeCode.split("\n"), [activeCode]);
|
|
21190
|
-
const diffLines = useMemo(() => {
|
|
21191
|
-
if (propDiff) return propDiff;
|
|
21192
|
-
if (mode === "diff" && oldValue !== void 0 && newValue !== void 0) {
|
|
21193
|
-
return generateDiff(oldValue, newValue);
|
|
21194
|
-
}
|
|
21195
|
-
return null;
|
|
21196
|
-
}, [propDiff, mode, oldValue, newValue]);
|
|
21197
|
-
const handleCopy = useCallback(async () => {
|
|
21198
|
-
try {
|
|
21199
|
-
await navigator.clipboard.writeText(activeCode);
|
|
21200
|
-
setCopied(true);
|
|
21201
|
-
eventBus.emit("UI:CODE_COPY", { language: activeLanguage });
|
|
21202
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
21203
|
-
} catch {
|
|
21204
|
-
}
|
|
21205
|
-
}, [activeCode, eventBus, activeLanguage]);
|
|
21206
|
-
const tabItems = files?.map((file, idx) => ({
|
|
21207
|
-
id: `file-${idx}`,
|
|
21208
|
-
label: file.label,
|
|
21209
|
-
content: null
|
|
21210
|
-
}));
|
|
21211
|
-
if (isLoading) {
|
|
21212
|
-
return /* @__PURE__ */ jsx(LoadingState, { message: t("common.loading"), className });
|
|
21213
|
-
}
|
|
21214
|
-
if (error) {
|
|
21215
|
-
return /* @__PURE__ */ jsx(
|
|
21216
|
-
ErrorState,
|
|
21217
|
-
{
|
|
21218
|
-
title: t("display.codeViewerError"),
|
|
21219
|
-
message: error.message,
|
|
21220
|
-
className
|
|
21221
|
-
}
|
|
21222
|
-
);
|
|
21223
|
-
}
|
|
21224
|
-
if (!activeCode && !diffLines) {
|
|
21225
|
-
return /* @__PURE__ */ jsx(
|
|
21226
|
-
EmptyState,
|
|
21227
|
-
{
|
|
21228
|
-
icon: Code,
|
|
21229
|
-
title: t("display.noCode"),
|
|
21230
|
-
description: "No code to display.",
|
|
21231
|
-
className
|
|
21232
|
-
}
|
|
21233
|
-
);
|
|
21234
|
-
}
|
|
21235
|
-
return /* @__PURE__ */ jsx(Card, { className: cn("overflow-hidden", className), children: /* @__PURE__ */ jsxs(VStack, { gap: "none", children: [
|
|
21236
|
-
tabItems && tabItems.length > 1 && /* @__PURE__ */ jsx(Box, { className: "border-b border-border", children: /* @__PURE__ */ jsx(
|
|
21237
|
-
Tabs,
|
|
21238
|
-
{
|
|
21239
|
-
tabs: tabItems,
|
|
21240
|
-
activeTab: `file-${activeFileIndex}`,
|
|
21241
|
-
onTabChange: (id) => {
|
|
21242
|
-
const idx = parseInt(id.replace("file-", ""), 10);
|
|
21243
|
-
setActiveFileIndex(idx);
|
|
21244
|
-
}
|
|
21245
|
-
}
|
|
21246
|
-
) }),
|
|
21247
|
-
/* @__PURE__ */ jsxs(
|
|
21248
|
-
HStack,
|
|
21249
|
-
{
|
|
21250
|
-
gap: "sm",
|
|
21251
|
-
align: "center",
|
|
21252
|
-
justify: "between",
|
|
21253
|
-
className: "px-4 py-2 border-b border-border bg-muted/30",
|
|
21254
|
-
children: [
|
|
21255
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
21256
|
-
/* @__PURE__ */ jsx(Icon, { icon: mode === "diff" ? FileText : Code, size: "sm", className: "text-muted-foreground" }),
|
|
21257
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "small", weight: "medium", className: "truncate", children: title }),
|
|
21258
|
-
activeLanguage && activeLanguage !== "text" && /* @__PURE__ */ jsx(Badge, { variant: "default", children: activeLanguage })
|
|
21259
|
-
] }),
|
|
21260
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
21261
|
-
/* @__PURE__ */ jsx(
|
|
21262
|
-
Button,
|
|
21263
|
-
{
|
|
21264
|
-
variant: "ghost",
|
|
21265
|
-
size: "sm",
|
|
21266
|
-
icon: WrapText,
|
|
21267
|
-
onClick: () => setWrap(!wrap),
|
|
21268
|
-
className: cn(wrap && "text-primary")
|
|
21269
|
-
}
|
|
21270
|
-
),
|
|
21271
|
-
showCopy && /* @__PURE__ */ jsx(
|
|
21272
|
-
Button,
|
|
21273
|
-
{
|
|
21274
|
-
variant: "ghost",
|
|
21275
|
-
size: "sm",
|
|
21276
|
-
icon: copied ? Check : Copy,
|
|
21277
|
-
onClick: handleCopy,
|
|
21278
|
-
className: cn(copied && "text-success")
|
|
21279
|
-
}
|
|
21280
|
-
),
|
|
21281
|
-
actions?.map((action, idx) => /* @__PURE__ */ jsx(
|
|
21282
|
-
Badge,
|
|
21283
|
-
{
|
|
21284
|
-
variant: "default",
|
|
21285
|
-
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
21286
|
-
onClick: () => handleAction(action),
|
|
21287
|
-
children: action.label
|
|
21288
|
-
},
|
|
21289
|
-
idx
|
|
21290
|
-
))
|
|
21291
|
-
] })
|
|
21292
|
-
]
|
|
21293
|
-
}
|
|
21294
|
-
),
|
|
21295
|
-
/* @__PURE__ */ jsx(
|
|
21296
|
-
Box,
|
|
21297
|
-
{
|
|
21298
|
-
className: "overflow-auto bg-muted/20",
|
|
21299
|
-
style: { maxHeight },
|
|
21300
|
-
children: diffLines ? (
|
|
21301
|
-
/* Diff mode */
|
|
21302
|
-
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "font-mono text-xs", children: diffLines.map((line, idx) => {
|
|
21303
|
-
const style = DIFF_STYLES[line.type];
|
|
21304
|
-
return /* @__PURE__ */ jsxs(HStack, { gap: "none", align: "start", className: cn(style.bg, "px-4 py-0.5"), children: [
|
|
21305
|
-
showLineNumbers && /* @__PURE__ */ jsx(
|
|
21306
|
-
Typography,
|
|
21307
|
-
{
|
|
21308
|
-
variant: "caption",
|
|
21309
|
-
color: "secondary",
|
|
21310
|
-
className: "w-8 text-right mr-3 select-none tabular-nums flex-shrink-0",
|
|
21311
|
-
children: line.lineNumber ?? ""
|
|
21312
|
-
}
|
|
21313
|
-
),
|
|
21314
|
-
/* @__PURE__ */ jsxs(
|
|
21315
|
-
Typography,
|
|
21316
|
-
{
|
|
21317
|
-
variant: "caption",
|
|
21318
|
-
className: cn(
|
|
21319
|
-
"font-mono flex-1 min-w-0",
|
|
21320
|
-
style.text,
|
|
21321
|
-
wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
|
|
21322
|
-
),
|
|
21323
|
-
children: [
|
|
21324
|
-
/* @__PURE__ */ jsx(Box, { as: "span", className: "select-none opacity-50 mr-2", children: style.prefix }),
|
|
21325
|
-
line.content
|
|
21326
|
-
]
|
|
21327
|
-
}
|
|
21328
|
-
)
|
|
21329
|
-
] }, idx);
|
|
21330
|
-
}) })
|
|
21331
|
-
) : (
|
|
21332
|
-
/* Code mode */
|
|
21333
|
-
/* @__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: [
|
|
21334
|
-
showLineNumbers && /* @__PURE__ */ jsx(
|
|
21335
|
-
Typography,
|
|
21336
|
-
{
|
|
21337
|
-
variant: "caption",
|
|
21338
|
-
color: "secondary",
|
|
21339
|
-
className: "w-8 text-right mr-4 select-none tabular-nums flex-shrink-0",
|
|
21340
|
-
children: idx + 1
|
|
21341
|
-
}
|
|
21342
|
-
),
|
|
21343
|
-
/* @__PURE__ */ jsx(
|
|
21344
|
-
Typography,
|
|
21345
|
-
{
|
|
21346
|
-
variant: "caption",
|
|
21347
|
-
className: cn(
|
|
21348
|
-
"font-mono flex-1 min-w-0",
|
|
21349
|
-
wrap ? "whitespace-pre-wrap break-all" : "whitespace-pre"
|
|
21350
|
-
),
|
|
21351
|
-
children: line || " "
|
|
21352
|
-
}
|
|
21353
|
-
)
|
|
21354
|
-
] }, idx)) })
|
|
21355
|
-
)
|
|
21356
|
-
}
|
|
21357
|
-
)
|
|
21358
|
-
] }) });
|
|
21359
|
-
};
|
|
21360
|
-
CodeViewer.displayName = "CodeViewer";
|
|
21361
|
-
}
|
|
21362
|
-
});
|
|
21363
21268
|
function CombatLog({
|
|
21364
21269
|
events: events2,
|
|
21365
21270
|
maxVisible = 50,
|
|
@@ -21834,7 +21739,7 @@ function CraftingRecipe({
|
|
|
21834
21739
|
className
|
|
21835
21740
|
}) {
|
|
21836
21741
|
const eventBus = useEventBus();
|
|
21837
|
-
const handleCraft =
|
|
21742
|
+
const handleCraft = React84.useCallback(() => {
|
|
21838
21743
|
onCraft?.();
|
|
21839
21744
|
if (craftEvent) {
|
|
21840
21745
|
eventBus.emit(craftEvent, { output: output.label });
|
|
@@ -21851,7 +21756,7 @@ function CraftingRecipe({
|
|
|
21851
21756
|
children: [
|
|
21852
21757
|
/* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap items-center", children: inputs.map((ingredient, index) => {
|
|
21853
21758
|
const hasSufficient = ingredient.available >= ingredient.required;
|
|
21854
|
-
return /* @__PURE__ */ jsxs(
|
|
21759
|
+
return /* @__PURE__ */ jsxs(React84.Fragment, { children: [
|
|
21855
21760
|
/* @__PURE__ */ jsx(Box, { className: "relative", children: /* @__PURE__ */ jsx(
|
|
21856
21761
|
ItemSlot,
|
|
21857
21762
|
{
|
|
@@ -21914,8 +21819,8 @@ function DPad({
|
|
|
21914
21819
|
}) {
|
|
21915
21820
|
const eventBus = useEventBus();
|
|
21916
21821
|
const sizes = sizeMap15[size];
|
|
21917
|
-
const [activeDirections, setActiveDirections] =
|
|
21918
|
-
const handlePress =
|
|
21822
|
+
const [activeDirections, setActiveDirections] = React84.useState(/* @__PURE__ */ new Set());
|
|
21823
|
+
const handlePress = React84.useCallback(
|
|
21919
21824
|
(direction) => {
|
|
21920
21825
|
setActiveDirections((prev) => new Set(prev).add(direction));
|
|
21921
21826
|
if (directionEvent) eventBus.emit(`UI:${directionEvent}`, { direction, pressed: true });
|
|
@@ -21923,7 +21828,7 @@ function DPad({
|
|
|
21923
21828
|
},
|
|
21924
21829
|
[directionEvent, eventBus, onDirection]
|
|
21925
21830
|
);
|
|
21926
|
-
const handleRelease =
|
|
21831
|
+
const handleRelease = React84.useCallback(
|
|
21927
21832
|
(direction) => {
|
|
21928
21833
|
setActiveDirections((prev) => {
|
|
21929
21834
|
const next = new Set(prev);
|
|
@@ -22609,14 +22514,14 @@ function useDataDnd(args) {
|
|
|
22609
22514
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22610
22515
|
const enabled = isZone || Boolean(dndRoot);
|
|
22611
22516
|
const eventBus = useEventBus();
|
|
22612
|
-
const parentRoot =
|
|
22517
|
+
const parentRoot = React84__default.useContext(RootCtx);
|
|
22613
22518
|
const isRoot = enabled && parentRoot === null;
|
|
22614
|
-
const zoneId =
|
|
22519
|
+
const zoneId = React84__default.useId();
|
|
22615
22520
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22616
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22617
|
-
const optimisticOrdersRef =
|
|
22521
|
+
const [optimisticOrders, setOptimisticOrders] = React84__default.useState(() => /* @__PURE__ */ new Map());
|
|
22522
|
+
const optimisticOrdersRef = React84__default.useRef(optimisticOrders);
|
|
22618
22523
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22619
|
-
const clearOptimisticOrder =
|
|
22524
|
+
const clearOptimisticOrder = React84__default.useCallback((group) => {
|
|
22620
22525
|
setOptimisticOrders((prev) => {
|
|
22621
22526
|
if (!prev.has(group)) return prev;
|
|
22622
22527
|
const next = new Map(prev);
|
|
@@ -22641,7 +22546,7 @@ function useDataDnd(args) {
|
|
|
22641
22546
|
const raw = it[dndItemIdField];
|
|
22642
22547
|
return String(raw ?? `__idx_${idx}`);
|
|
22643
22548
|
}).join("|");
|
|
22644
|
-
const itemIds =
|
|
22549
|
+
const itemIds = React84__default.useMemo(
|
|
22645
22550
|
() => orderedItems.map((it, idx) => {
|
|
22646
22551
|
const raw = it[dndItemIdField];
|
|
22647
22552
|
return raw ?? `__idx_${idx}`;
|
|
@@ -22649,7 +22554,7 @@ function useDataDnd(args) {
|
|
|
22649
22554
|
[itemIdsSignature]
|
|
22650
22555
|
);
|
|
22651
22556
|
const itemsContentSig = items.map((it, idx) => String(it[dndItemIdField] ?? `__${idx}`)).join("|");
|
|
22652
|
-
|
|
22557
|
+
React84__default.useEffect(() => {
|
|
22653
22558
|
const root = isRoot ? null : parentRoot;
|
|
22654
22559
|
if (root) {
|
|
22655
22560
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22657,20 +22562,20 @@ function useDataDnd(args) {
|
|
|
22657
22562
|
clearOptimisticOrder(ownGroup);
|
|
22658
22563
|
}
|
|
22659
22564
|
}, [itemsContentSig, ownGroup]);
|
|
22660
|
-
const zonesRef =
|
|
22661
|
-
const registerZone =
|
|
22565
|
+
const zonesRef = React84__default.useRef(/* @__PURE__ */ new Map());
|
|
22566
|
+
const registerZone = React84__default.useCallback((zoneId2, meta2) => {
|
|
22662
22567
|
zonesRef.current.set(zoneId2, meta2);
|
|
22663
22568
|
}, []);
|
|
22664
|
-
const unregisterZone =
|
|
22569
|
+
const unregisterZone = React84__default.useCallback((zoneId2) => {
|
|
22665
22570
|
zonesRef.current.delete(zoneId2);
|
|
22666
22571
|
}, []);
|
|
22667
|
-
const [activeDrag, setActiveDrag] =
|
|
22668
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22669
|
-
const meta =
|
|
22572
|
+
const [activeDrag, setActiveDrag] = React84__default.useState(null);
|
|
22573
|
+
const [overZoneGroup, setOverZoneGroup] = React84__default.useState(null);
|
|
22574
|
+
const meta = React84__default.useMemo(
|
|
22670
22575
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22671
22576
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22672
22577
|
);
|
|
22673
|
-
|
|
22578
|
+
React84__default.useEffect(() => {
|
|
22674
22579
|
const target = isRoot ? null : parentRoot;
|
|
22675
22580
|
if (!target) {
|
|
22676
22581
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22689,7 +22594,7 @@ function useDataDnd(args) {
|
|
|
22689
22594
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22690
22595
|
const sensors = useAlmadarDndSensors(true);
|
|
22691
22596
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22692
|
-
const findZoneByItem =
|
|
22597
|
+
const findZoneByItem = React84__default.useCallback(
|
|
22693
22598
|
(id) => {
|
|
22694
22599
|
for (const z of zonesRef.current.values()) {
|
|
22695
22600
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22698,7 +22603,7 @@ function useDataDnd(args) {
|
|
|
22698
22603
|
},
|
|
22699
22604
|
[]
|
|
22700
22605
|
);
|
|
22701
|
-
|
|
22606
|
+
React84__default.useCallback(
|
|
22702
22607
|
(group) => {
|
|
22703
22608
|
for (const z of zonesRef.current.values()) {
|
|
22704
22609
|
if (z.group === group) return z;
|
|
@@ -22707,7 +22612,7 @@ function useDataDnd(args) {
|
|
|
22707
22612
|
},
|
|
22708
22613
|
[]
|
|
22709
22614
|
);
|
|
22710
|
-
const handleDragEnd =
|
|
22615
|
+
const handleDragEnd = React84__default.useCallback(
|
|
22711
22616
|
(event) => {
|
|
22712
22617
|
const { active, over } = event;
|
|
22713
22618
|
const activeIdStr = String(active.id);
|
|
@@ -22798,8 +22703,8 @@ function useDataDnd(args) {
|
|
|
22798
22703
|
},
|
|
22799
22704
|
[eventBus]
|
|
22800
22705
|
);
|
|
22801
|
-
const sortableData =
|
|
22802
|
-
const SortableItem =
|
|
22706
|
+
const sortableData = React84__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
22707
|
+
const SortableItem = React84__default.useCallback(
|
|
22803
22708
|
({ id, children }) => {
|
|
22804
22709
|
const {
|
|
22805
22710
|
attributes,
|
|
@@ -22839,7 +22744,7 @@ function useDataDnd(args) {
|
|
|
22839
22744
|
id: droppableId,
|
|
22840
22745
|
data: sortableData
|
|
22841
22746
|
});
|
|
22842
|
-
const ctx =
|
|
22747
|
+
const ctx = React84__default.useContext(RootCtx);
|
|
22843
22748
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22844
22749
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22845
22750
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22854,7 +22759,7 @@ function useDataDnd(args) {
|
|
|
22854
22759
|
showForeignPlaceholder,
|
|
22855
22760
|
ctxAvailable: ctx != null
|
|
22856
22761
|
});
|
|
22857
|
-
|
|
22762
|
+
React84__default.useEffect(() => {
|
|
22858
22763
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22859
22764
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22860
22765
|
return /* @__PURE__ */ jsx(
|
|
@@ -22868,11 +22773,11 @@ function useDataDnd(args) {
|
|
|
22868
22773
|
}
|
|
22869
22774
|
);
|
|
22870
22775
|
};
|
|
22871
|
-
const rootContextValue =
|
|
22776
|
+
const rootContextValue = React84__default.useMemo(
|
|
22872
22777
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22873
22778
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22874
22779
|
);
|
|
22875
|
-
const handleDragStart =
|
|
22780
|
+
const handleDragStart = React84__default.useCallback((event) => {
|
|
22876
22781
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22877
22782
|
const rect = event.active.rect.current.initial;
|
|
22878
22783
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22891,7 +22796,7 @@ function useDataDnd(args) {
|
|
|
22891
22796
|
isRoot
|
|
22892
22797
|
});
|
|
22893
22798
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22894
|
-
const handleDragOver =
|
|
22799
|
+
const handleDragOver = React84__default.useCallback((event) => {
|
|
22895
22800
|
const { active, over } = event;
|
|
22896
22801
|
const overData = over?.data?.current;
|
|
22897
22802
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -22961,7 +22866,7 @@ function useDataDnd(args) {
|
|
|
22961
22866
|
return next;
|
|
22962
22867
|
});
|
|
22963
22868
|
}, []);
|
|
22964
|
-
const handleDragCancel =
|
|
22869
|
+
const handleDragCancel = React84__default.useCallback((event) => {
|
|
22965
22870
|
setActiveDrag(null);
|
|
22966
22871
|
setOverZoneGroup(null);
|
|
22967
22872
|
dndLog.warn("dragCancel", {
|
|
@@ -22969,12 +22874,12 @@ function useDataDnd(args) {
|
|
|
22969
22874
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
22970
22875
|
});
|
|
22971
22876
|
}, []);
|
|
22972
|
-
const handleDragEndWithCleanup =
|
|
22877
|
+
const handleDragEndWithCleanup = React84__default.useCallback((event) => {
|
|
22973
22878
|
handleDragEnd(event);
|
|
22974
22879
|
setActiveDrag(null);
|
|
22975
22880
|
setOverZoneGroup(null);
|
|
22976
22881
|
}, [handleDragEnd]);
|
|
22977
|
-
const wrapContainer =
|
|
22882
|
+
const wrapContainer = React84__default.useCallback(
|
|
22978
22883
|
(children) => {
|
|
22979
22884
|
if (!enabled) return children;
|
|
22980
22885
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -23028,7 +22933,7 @@ var init_useDataDnd = __esm({
|
|
|
23028
22933
|
init_useAlmadarDndCollision();
|
|
23029
22934
|
init_Box();
|
|
23030
22935
|
dndLog = createLogger("almadar:ui:dnd");
|
|
23031
|
-
RootCtx =
|
|
22936
|
+
RootCtx = React84__default.createContext(null);
|
|
23032
22937
|
}
|
|
23033
22938
|
});
|
|
23034
22939
|
function fieldLabel2(key) {
|
|
@@ -23548,7 +23453,7 @@ function DataList({
|
|
|
23548
23453
|
}) {
|
|
23549
23454
|
const eventBus = useEventBus();
|
|
23550
23455
|
const { t } = useTranslate();
|
|
23551
|
-
const [visibleCount, setVisibleCount] =
|
|
23456
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize || Infinity);
|
|
23552
23457
|
const fieldDefs = fields ?? columns ?? [];
|
|
23553
23458
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23554
23459
|
const dnd = useDataDnd({
|
|
@@ -23567,7 +23472,7 @@ function DataList({
|
|
|
23567
23472
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23568
23473
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23569
23474
|
const hasRenderProp = typeof children === "function";
|
|
23570
|
-
|
|
23475
|
+
React84__default.useEffect(() => {
|
|
23571
23476
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23572
23477
|
const childrenTypeOf = typeof children;
|
|
23573
23478
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23672,7 +23577,7 @@ function DataList({
|
|
|
23672
23577
|
const items2 = data.map((item) => item);
|
|
23673
23578
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
23674
23579
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
23675
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23580
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
23676
23581
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23677
23582
|
group.items.map((itemData, index) => {
|
|
23678
23583
|
const id = itemData.id || `${gi}-${index}`;
|
|
@@ -23820,7 +23725,7 @@ function DataList({
|
|
|
23820
23725
|
className
|
|
23821
23726
|
),
|
|
23822
23727
|
children: [
|
|
23823
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
23728
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
23824
23729
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23825
23730
|
group.items.map(
|
|
23826
23731
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -25194,7 +25099,7 @@ var init_WizardProgress = __esm({
|
|
|
25194
25099
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25195
25100
|
const isActive = index === currentStep;
|
|
25196
25101
|
const isCompleted = index < currentStep;
|
|
25197
|
-
return /* @__PURE__ */ jsxs(
|
|
25102
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
25198
25103
|
/* @__PURE__ */ jsx(
|
|
25199
25104
|
"button",
|
|
25200
25105
|
{
|
|
@@ -25711,8 +25616,9 @@ var init_FormSectionHeader = __esm({
|
|
|
25711
25616
|
Box,
|
|
25712
25617
|
{
|
|
25713
25618
|
className: cn(
|
|
25714
|
-
"px-
|
|
25715
|
-
|
|
25619
|
+
"px-5 py-4 bg-muted/60 rounded-lg",
|
|
25620
|
+
"border border-border border-l-4 border-l-primary",
|
|
25621
|
+
isClickable && "cursor-pointer hover:bg-muted transition-colors",
|
|
25716
25622
|
className
|
|
25717
25623
|
),
|
|
25718
25624
|
onClick: isClickable ? onToggle : void 0,
|
|
@@ -25723,7 +25629,7 @@ var init_FormSectionHeader = __esm({
|
|
|
25723
25629
|
{
|
|
25724
25630
|
name: icon,
|
|
25725
25631
|
size: "md",
|
|
25726
|
-
className: "text-primary"
|
|
25632
|
+
className: "text-primary shrink-0"
|
|
25727
25633
|
}
|
|
25728
25634
|
),
|
|
25729
25635
|
statusIcon && /* @__PURE__ */ jsx(
|
|
@@ -25731,12 +25637,15 @@ var init_FormSectionHeader = __esm({
|
|
|
25731
25637
|
{
|
|
25732
25638
|
name: statusIcon,
|
|
25733
25639
|
size: "md",
|
|
25734
|
-
className:
|
|
25640
|
+
className: cn(
|
|
25641
|
+
"shrink-0",
|
|
25642
|
+
hasErrors ? "text-error" : "text-success"
|
|
25643
|
+
)
|
|
25735
25644
|
}
|
|
25736
25645
|
),
|
|
25737
25646
|
/* @__PURE__ */ jsxs(Box, { className: "space-y-0.5", children: [
|
|
25738
|
-
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", children: title }),
|
|
25739
|
-
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: subtitle })
|
|
25647
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subheading", weight: "semibold", className: "text-foreground", children: title }),
|
|
25648
|
+
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", className: "leading-snug", children: subtitle })
|
|
25740
25649
|
] })
|
|
25741
25650
|
] }),
|
|
25742
25651
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
@@ -25745,9 +25654,9 @@ var init_FormSectionHeader = __esm({
|
|
|
25745
25654
|
Icon,
|
|
25746
25655
|
{
|
|
25747
25656
|
name: "chevron-down",
|
|
25748
|
-
size: "
|
|
25657
|
+
size: "sm",
|
|
25749
25658
|
className: cn(
|
|
25750
|
-
"text-muted-foreground transition-transform",
|
|
25659
|
+
"text-muted-foreground transition-transform duration-200 shrink-0",
|
|
25751
25660
|
isCollapsed && "-rotate-90"
|
|
25752
25661
|
)
|
|
25753
25662
|
}
|
|
@@ -26249,7 +26158,7 @@ function InventoryGrid({
|
|
|
26249
26158
|
const eventBus = useEventBus();
|
|
26250
26159
|
const slotCount = totalSlots ?? items.length;
|
|
26251
26160
|
const emptySlotCount = Math.max(0, slotCount - items.length);
|
|
26252
|
-
const handleSelect =
|
|
26161
|
+
const handleSelect = React84.useCallback(
|
|
26253
26162
|
(id) => {
|
|
26254
26163
|
onSelect?.(id);
|
|
26255
26164
|
if (selectEvent) {
|
|
@@ -26466,31 +26375,31 @@ function GameCanvas2D({
|
|
|
26466
26375
|
assetBaseUrl = "",
|
|
26467
26376
|
className
|
|
26468
26377
|
}) {
|
|
26469
|
-
const canvasRef =
|
|
26470
|
-
const rafRef =
|
|
26471
|
-
const frameRef =
|
|
26472
|
-
const lastTimeRef =
|
|
26473
|
-
const imageCache =
|
|
26378
|
+
const canvasRef = React84.useRef(null);
|
|
26379
|
+
const rafRef = React84.useRef(0);
|
|
26380
|
+
const frameRef = React84.useRef(0);
|
|
26381
|
+
const lastTimeRef = React84.useRef(0);
|
|
26382
|
+
const imageCache = React84.useRef(/* @__PURE__ */ new Map());
|
|
26474
26383
|
const emit = useEmitEvent();
|
|
26475
|
-
const onDrawRef =
|
|
26384
|
+
const onDrawRef = React84.useRef(onDraw);
|
|
26476
26385
|
onDrawRef.current = onDraw;
|
|
26477
|
-
const onTickRef =
|
|
26386
|
+
const onTickRef = React84.useRef(onTick);
|
|
26478
26387
|
onTickRef.current = onTick;
|
|
26479
|
-
const tickEventRef =
|
|
26388
|
+
const tickEventRef = React84.useRef(tickEvent);
|
|
26480
26389
|
tickEventRef.current = tickEvent;
|
|
26481
|
-
const drawEventRef =
|
|
26390
|
+
const drawEventRef = React84.useRef(drawEvent);
|
|
26482
26391
|
drawEventRef.current = drawEvent;
|
|
26483
|
-
const emitRef =
|
|
26392
|
+
const emitRef = React84.useRef(emit);
|
|
26484
26393
|
emitRef.current = emit;
|
|
26485
|
-
const assetBaseUrlRef =
|
|
26394
|
+
const assetBaseUrlRef = React84.useRef(assetBaseUrl);
|
|
26486
26395
|
assetBaseUrlRef.current = assetBaseUrl;
|
|
26487
|
-
const backgroundImageRef =
|
|
26396
|
+
const backgroundImageRef = React84.useRef(backgroundImage);
|
|
26488
26397
|
backgroundImageRef.current = backgroundImage;
|
|
26489
|
-
const widthRef =
|
|
26398
|
+
const widthRef = React84.useRef(width);
|
|
26490
26399
|
widthRef.current = width;
|
|
26491
|
-
const heightRef =
|
|
26400
|
+
const heightRef = React84.useRef(height);
|
|
26492
26401
|
heightRef.current = height;
|
|
26493
|
-
const loadImage =
|
|
26402
|
+
const loadImage = React84.useCallback((url) => {
|
|
26494
26403
|
const fullUrl = url.startsWith("http") ? url : `${assetBaseUrlRef.current}${url}`;
|
|
26495
26404
|
const cached = imageCache.current.get(fullUrl);
|
|
26496
26405
|
if (cached?.complete && cached.naturalWidth > 0) return cached;
|
|
@@ -26502,7 +26411,7 @@ function GameCanvas2D({
|
|
|
26502
26411
|
}
|
|
26503
26412
|
return null;
|
|
26504
26413
|
}, []);
|
|
26505
|
-
|
|
26414
|
+
React84.useEffect(() => {
|
|
26506
26415
|
const canvas = canvasRef.current;
|
|
26507
26416
|
if (!canvas) return;
|
|
26508
26417
|
const ctx = canvas.getContext("2d");
|
|
@@ -26805,7 +26714,7 @@ function TurnPanel({
|
|
|
26805
26714
|
className
|
|
26806
26715
|
}) {
|
|
26807
26716
|
const eventBus = useEventBus();
|
|
26808
|
-
const handleAction =
|
|
26717
|
+
const handleAction = React84.useCallback(
|
|
26809
26718
|
(event) => {
|
|
26810
26719
|
if (event) {
|
|
26811
26720
|
eventBus.emit(event, { turn: currentTurn, phase, activeTeam });
|
|
@@ -26951,7 +26860,7 @@ function UnitCommandBar({
|
|
|
26951
26860
|
className
|
|
26952
26861
|
}) {
|
|
26953
26862
|
const eventBus = useEventBus();
|
|
26954
|
-
const handleCommand =
|
|
26863
|
+
const handleCommand = React84.useCallback(
|
|
26955
26864
|
(event) => {
|
|
26956
26865
|
if (event) {
|
|
26957
26866
|
eventBus.emit(event, { unitId: selectedUnitId });
|
|
@@ -27436,7 +27345,7 @@ function GameMenu({
|
|
|
27436
27345
|
} catch {
|
|
27437
27346
|
}
|
|
27438
27347
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27439
|
-
const handleOptionClick =
|
|
27348
|
+
const handleOptionClick = React84.useCallback(
|
|
27440
27349
|
(option) => {
|
|
27441
27350
|
if (option.event && eventBus) {
|
|
27442
27351
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -27550,7 +27459,7 @@ function GameOverScreen({
|
|
|
27550
27459
|
} catch {
|
|
27551
27460
|
}
|
|
27552
27461
|
const eventBus = eventBusProp || eventBusFromHook;
|
|
27553
|
-
const handleActionClick =
|
|
27462
|
+
const handleActionClick = React84.useCallback(
|
|
27554
27463
|
(action) => {
|
|
27555
27464
|
if (action.event && eventBus) {
|
|
27556
27465
|
eventBus.emit(`UI:${action.event}`, { action });
|
|
@@ -28544,7 +28453,7 @@ var init_StarRating = __esm({
|
|
|
28544
28453
|
name: "star",
|
|
28545
28454
|
className: cn(
|
|
28546
28455
|
styles.star,
|
|
28547
|
-
"text-
|
|
28456
|
+
"text-foreground/30",
|
|
28548
28457
|
"transition-colors duration-100"
|
|
28549
28458
|
),
|
|
28550
28459
|
strokeWidth: 1.5
|
|
@@ -29027,8 +28936,8 @@ function TableView({
|
|
|
29027
28936
|
}) {
|
|
29028
28937
|
const eventBus = useEventBus();
|
|
29029
28938
|
const { t } = useTranslate();
|
|
29030
|
-
const [visibleCount, setVisibleCount] =
|
|
29031
|
-
const [localSelected, setLocalSelected] =
|
|
28939
|
+
const [visibleCount, setVisibleCount] = React84__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28940
|
+
const [localSelected, setLocalSelected] = React84__default.useState(/* @__PURE__ */ new Set());
|
|
29032
28941
|
const colDefs = columns ?? fields ?? [];
|
|
29033
28942
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
29034
28943
|
const dnd = useDataDnd({
|
|
@@ -29223,12 +29132,12 @@ function TableView({
|
|
|
29223
29132
|
]
|
|
29224
29133
|
}
|
|
29225
29134
|
);
|
|
29226
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
29135
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React84__default.Fragment, { children: rowInner }, id);
|
|
29227
29136
|
};
|
|
29228
29137
|
const items = data.map((row) => row);
|
|
29229
29138
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
29230
29139
|
let runningIndex = 0;
|
|
29231
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
29140
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
29232
29141
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
29233
29142
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
29234
29143
|
] }, gi)) });
|
|
@@ -30580,7 +30489,7 @@ var init_StepFlow = __esm({
|
|
|
30580
30489
|
className
|
|
30581
30490
|
}) => {
|
|
30582
30491
|
if (orientation === "vertical") {
|
|
30583
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30492
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React84__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
30584
30493
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
30585
30494
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30586
30495
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -30591,7 +30500,7 @@ var init_StepFlow = __esm({
|
|
|
30591
30500
|
] })
|
|
30592
30501
|
] }) }, index)) });
|
|
30593
30502
|
}
|
|
30594
|
-
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(
|
|
30503
|
+
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(React84__default.Fragment, { children: [
|
|
30595
30504
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
30596
30505
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
30597
30506
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -31346,11 +31255,19 @@ function LatticeSVG({
|
|
|
31346
31255
|
function f2(n) {
|
|
31347
31256
|
return n.toFixed(2);
|
|
31348
31257
|
}
|
|
31349
|
-
var VARIANT_MAP2, EdgeDecoration;
|
|
31258
|
+
var colorTokenVars, VARIANT_MAP2, EdgeDecoration;
|
|
31350
31259
|
var init_EdgeDecoration = __esm({
|
|
31351
31260
|
"components/core/molecules/EdgeDecoration.tsx"() {
|
|
31352
31261
|
"use client";
|
|
31353
31262
|
init_cn();
|
|
31263
|
+
colorTokenVars = {
|
|
31264
|
+
primary: "var(--color-primary)",
|
|
31265
|
+
secondary: "var(--color-secondary)",
|
|
31266
|
+
success: "var(--color-success)",
|
|
31267
|
+
warning: "var(--color-warning)",
|
|
31268
|
+
error: "var(--color-error)",
|
|
31269
|
+
muted: "var(--color-muted)"
|
|
31270
|
+
};
|
|
31354
31271
|
VARIANT_MAP2 = {
|
|
31355
31272
|
arch: ArchSVG,
|
|
31356
31273
|
vine: VineSVG,
|
|
@@ -31360,13 +31277,14 @@ var init_EdgeDecoration = __esm({
|
|
|
31360
31277
|
variant = "arch",
|
|
31361
31278
|
side = "both",
|
|
31362
31279
|
opacity = 0.15,
|
|
31363
|
-
color = "
|
|
31280
|
+
color = "primary",
|
|
31364
31281
|
strokeWidth = 0.5,
|
|
31365
31282
|
width = 15,
|
|
31366
31283
|
className
|
|
31367
31284
|
}) => {
|
|
31368
31285
|
const id = useId();
|
|
31369
31286
|
const Variant = VARIANT_MAP2[variant];
|
|
31287
|
+
const resolvedColor = color in colorTokenVars ? colorTokenVars[color] : color;
|
|
31370
31288
|
const sides = side === "both" ? ["left", "right"] : [side];
|
|
31371
31289
|
return /* @__PURE__ */ jsx(Fragment, { children: sides.map((s) => /* @__PURE__ */ jsx(
|
|
31372
31290
|
"svg",
|
|
@@ -31389,7 +31307,7 @@ var init_EdgeDecoration = __esm({
|
|
|
31389
31307
|
facing: s,
|
|
31390
31308
|
w: 200,
|
|
31391
31309
|
h: 600,
|
|
31392
|
-
color,
|
|
31310
|
+
color: resolvedColor,
|
|
31393
31311
|
strokeWidth
|
|
31394
31312
|
}
|
|
31395
31313
|
)
|
|
@@ -31567,7 +31485,7 @@ var init_LikertScale = __esm({
|
|
|
31567
31485
|
md: "text-base",
|
|
31568
31486
|
lg: "text-lg"
|
|
31569
31487
|
};
|
|
31570
|
-
LikertScale =
|
|
31488
|
+
LikertScale = React84__default.forwardRef(
|
|
31571
31489
|
({
|
|
31572
31490
|
question,
|
|
31573
31491
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -31579,7 +31497,7 @@ var init_LikertScale = __esm({
|
|
|
31579
31497
|
variant = "radios",
|
|
31580
31498
|
className
|
|
31581
31499
|
}, ref) => {
|
|
31582
|
-
const groupId =
|
|
31500
|
+
const groupId = React84__default.useId();
|
|
31583
31501
|
const eventBus = useEventBus();
|
|
31584
31502
|
const handleSelect = useCallback(
|
|
31585
31503
|
(next) => {
|
|
@@ -32729,7 +32647,6 @@ function BlockRow({
|
|
|
32729
32647
|
onUpdate,
|
|
32730
32648
|
onDelete,
|
|
32731
32649
|
onDuplicate,
|
|
32732
|
-
onInsertAfter,
|
|
32733
32650
|
onChangeType
|
|
32734
32651
|
}) {
|
|
32735
32652
|
const { t } = useTranslate();
|
|
@@ -33005,34 +32922,16 @@ function BlockRow({
|
|
|
33005
32922
|
"data-block-id": block.id,
|
|
33006
32923
|
"data-block-type": block.type,
|
|
33007
32924
|
children: [
|
|
33008
|
-
!readOnly && showAffordances && /* @__PURE__ */
|
|
33009
|
-
|
|
33010
|
-
|
|
33011
|
-
|
|
33012
|
-
|
|
33013
|
-
|
|
33014
|
-
|
|
33015
|
-
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
"opacity-0 group-hover:opacity-100 focus-visible:opacity-100",
|
|
33019
|
-
"transition-opacity"
|
|
33020
|
-
),
|
|
33021
|
-
onClick: () => onInsertAfter("paragraph"),
|
|
33022
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "plus", className: "w-3.5 h-3.5" })
|
|
33023
|
-
}
|
|
33024
|
-
),
|
|
33025
|
-
/* @__PURE__ */ jsx(
|
|
33026
|
-
BlockMenu,
|
|
33027
|
-
{
|
|
33028
|
-
block,
|
|
33029
|
-
readOnly,
|
|
33030
|
-
onDelete,
|
|
33031
|
-
onDuplicate,
|
|
33032
|
-
onChangeType
|
|
33033
|
-
}
|
|
33034
|
-
)
|
|
33035
|
-
] }),
|
|
32925
|
+
!readOnly && showAffordances && /* @__PURE__ */ jsx(Box, { className: "flex w-8 shrink-0 items-center pt-1", children: /* @__PURE__ */ jsx(
|
|
32926
|
+
BlockMenu,
|
|
32927
|
+
{
|
|
32928
|
+
block,
|
|
32929
|
+
readOnly,
|
|
32930
|
+
onDelete,
|
|
32931
|
+
onDuplicate,
|
|
32932
|
+
onChangeType
|
|
32933
|
+
}
|
|
32934
|
+
) }),
|
|
33036
32935
|
/* @__PURE__ */ jsx(Box, { className: "min-w-0 flex-1", children: renderBody() })
|
|
33037
32936
|
]
|
|
33038
32937
|
}
|
|
@@ -33155,12 +33054,6 @@ var init_RichBlockEditor = __esm({
|
|
|
33155
33054
|
},
|
|
33156
33055
|
[blocks, commit]
|
|
33157
33056
|
);
|
|
33158
|
-
const handleInsertAfter = useCallback(
|
|
33159
|
-
(id, type) => {
|
|
33160
|
-
commit(insertAfter(blocks, id, createBlock(type)));
|
|
33161
|
-
},
|
|
33162
|
-
[blocks, commit]
|
|
33163
|
-
);
|
|
33164
33057
|
const handleChangeType = useCallback(
|
|
33165
33058
|
(id, type) => {
|
|
33166
33059
|
commit(
|
|
@@ -33217,7 +33110,6 @@ var init_RichBlockEditor = __esm({
|
|
|
33217
33110
|
onUpdate: (updater) => handleUpdate(block.id, updater),
|
|
33218
33111
|
onDelete: () => handleDelete(block.id),
|
|
33219
33112
|
onDuplicate: () => handleDuplicate(block.id),
|
|
33220
|
-
onInsertAfter: (type) => handleInsertAfter(block.id, type),
|
|
33221
33113
|
onChangeType: (type) => handleChangeType(block.id, type)
|
|
33222
33114
|
},
|
|
33223
33115
|
block.id
|
|
@@ -33887,7 +33779,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33887
33779
|
"aria-label": t("aria.breadcrumb"),
|
|
33888
33780
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33889
33781
|
const isLast = idx === items.length - 1;
|
|
33890
|
-
return /* @__PURE__ */ jsxs(
|
|
33782
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
33891
33783
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33892
33784
|
Icon,
|
|
33893
33785
|
{
|
|
@@ -33934,108 +33826,6 @@ var init_DocBreadcrumb = __esm({
|
|
|
33934
33826
|
DocBreadcrumb.displayName = "DocBreadcrumb";
|
|
33935
33827
|
}
|
|
33936
33828
|
});
|
|
33937
|
-
function DocCodeBlock({
|
|
33938
|
-
code,
|
|
33939
|
-
language,
|
|
33940
|
-
title,
|
|
33941
|
-
showLineNumbers = false,
|
|
33942
|
-
className
|
|
33943
|
-
}) {
|
|
33944
|
-
const [copied, setCopied] = useState(false);
|
|
33945
|
-
const handleCopy = useCallback(() => {
|
|
33946
|
-
void navigator.clipboard.writeText(code).then(() => {
|
|
33947
|
-
setCopied(true);
|
|
33948
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
33949
|
-
});
|
|
33950
|
-
}, [code]);
|
|
33951
|
-
const lines = code.split("\n");
|
|
33952
|
-
return /* @__PURE__ */ jsxs(
|
|
33953
|
-
Box,
|
|
33954
|
-
{
|
|
33955
|
-
className: cn(
|
|
33956
|
-
"rounded-container border border-border overflow-hidden",
|
|
33957
|
-
className
|
|
33958
|
-
),
|
|
33959
|
-
position: "relative",
|
|
33960
|
-
children: [
|
|
33961
|
-
title ? /* @__PURE__ */ jsxs(
|
|
33962
|
-
HStack,
|
|
33963
|
-
{
|
|
33964
|
-
align: "center",
|
|
33965
|
-
justify: "between",
|
|
33966
|
-
className: "bg-muted px-4 py-2 border-b border-border",
|
|
33967
|
-
children: [
|
|
33968
|
-
/* @__PURE__ */ jsxs(HStack, { align: "center", gap: "sm", children: [
|
|
33969
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: title }),
|
|
33970
|
-
language ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: language }) : null
|
|
33971
|
-
] }),
|
|
33972
|
-
/* @__PURE__ */ jsx(
|
|
33973
|
-
Button,
|
|
33974
|
-
{
|
|
33975
|
-
variant: "ghost",
|
|
33976
|
-
size: "sm",
|
|
33977
|
-
onClick: handleCopy,
|
|
33978
|
-
leftIcon: copied ? "check" : "copy",
|
|
33979
|
-
children: copied ? "Copied!" : "Copy"
|
|
33980
|
-
}
|
|
33981
|
-
)
|
|
33982
|
-
]
|
|
33983
|
-
}
|
|
33984
|
-
) : null,
|
|
33985
|
-
!title ? /* @__PURE__ */ jsx(Box, { position: "absolute", className: "top-2 right-2 z-10", children: /* @__PURE__ */ jsx(
|
|
33986
|
-
Button,
|
|
33987
|
-
{
|
|
33988
|
-
variant: "ghost",
|
|
33989
|
-
size: "sm",
|
|
33990
|
-
onClick: handleCopy,
|
|
33991
|
-
leftIcon: copied ? "check" : "copy",
|
|
33992
|
-
children: copied ? "Copied!" : "Copy"
|
|
33993
|
-
}
|
|
33994
|
-
) }) : null,
|
|
33995
|
-
/* @__PURE__ */ jsxs(HStack, { gap: "none", className: "bg-foreground overflow-x-auto", children: [
|
|
33996
|
-
showLineNumbers ? /* @__PURE__ */ jsx(
|
|
33997
|
-
Box,
|
|
33998
|
-
{
|
|
33999
|
-
className: "py-4 pl-4 pr-3 select-none border-r border-border flex-shrink-0",
|
|
34000
|
-
children: lines.map((_, i) => /* @__PURE__ */ jsx(
|
|
34001
|
-
Typography,
|
|
34002
|
-
{
|
|
34003
|
-
variant: "caption",
|
|
34004
|
-
color: "muted",
|
|
34005
|
-
className: "block font-mono text-right leading-6",
|
|
34006
|
-
as: "span",
|
|
34007
|
-
children: i + 1
|
|
34008
|
-
},
|
|
34009
|
-
i
|
|
34010
|
-
))
|
|
34011
|
-
}
|
|
34012
|
-
) : null,
|
|
34013
|
-
/* @__PURE__ */ jsx(
|
|
34014
|
-
Box,
|
|
34015
|
-
{
|
|
34016
|
-
as: "pre",
|
|
34017
|
-
className: cn(
|
|
34018
|
-
"p-4 font-mono text-sm text-background leading-6 flex-1 min-w-0",
|
|
34019
|
-
!title && "pr-24"
|
|
34020
|
-
),
|
|
34021
|
-
children: /* @__PURE__ */ jsx(Box, { as: "code", className: "whitespace-pre", children: code })
|
|
34022
|
-
}
|
|
34023
|
-
)
|
|
34024
|
-
] })
|
|
34025
|
-
]
|
|
34026
|
-
}
|
|
34027
|
-
);
|
|
34028
|
-
}
|
|
34029
|
-
var init_DocCodeBlock = __esm({
|
|
34030
|
-
"components/core/molecules/DocCodeBlock.tsx"() {
|
|
34031
|
-
"use client";
|
|
34032
|
-
init_cn();
|
|
34033
|
-
init_Box();
|
|
34034
|
-
init_Stack();
|
|
34035
|
-
init_Typography();
|
|
34036
|
-
init_Button();
|
|
34037
|
-
}
|
|
34038
|
-
});
|
|
34039
33829
|
function DocPagination({ prev, next, className }) {
|
|
34040
33830
|
if (!prev && !next) return null;
|
|
34041
33831
|
return /* @__PURE__ */ jsxs(
|
|
@@ -34472,17 +34262,25 @@ var init_DocTOC = __esm({
|
|
|
34472
34262
|
DocTOC.displayName = "DocTOC";
|
|
34473
34263
|
}
|
|
34474
34264
|
});
|
|
34475
|
-
var GradientDivider;
|
|
34265
|
+
var colorTokenVars2, GradientDivider;
|
|
34476
34266
|
var init_GradientDivider = __esm({
|
|
34477
34267
|
"components/core/molecules/GradientDivider.tsx"() {
|
|
34478
34268
|
"use client";
|
|
34479
34269
|
init_cn();
|
|
34480
34270
|
init_Box();
|
|
34271
|
+
colorTokenVars2 = {
|
|
34272
|
+
primary: "var(--color-primary)",
|
|
34273
|
+
secondary: "var(--color-secondary)",
|
|
34274
|
+
success: "var(--color-success)",
|
|
34275
|
+
warning: "var(--color-warning)",
|
|
34276
|
+
error: "var(--color-error)",
|
|
34277
|
+
muted: "var(--color-muted)"
|
|
34278
|
+
};
|
|
34481
34279
|
GradientDivider = ({
|
|
34482
34280
|
color,
|
|
34483
34281
|
className
|
|
34484
34282
|
}) => {
|
|
34485
|
-
const centerColor = color
|
|
34283
|
+
const centerColor = color ? color in colorTokenVars2 ? colorTokenVars2[color] : color : "var(--color-primary)";
|
|
34486
34284
|
return /* @__PURE__ */ jsx(
|
|
34487
34285
|
Box,
|
|
34488
34286
|
{
|
|
@@ -34851,7 +34649,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34851
34649
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34852
34650
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34853
34651
|
const role = getStateRole(s.name, s.isInitial, s.isTerminal, tc, maxTC);
|
|
34854
|
-
return /* @__PURE__ */ jsxs(
|
|
34652
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
34855
34653
|
/* @__PURE__ */ jsx(
|
|
34856
34654
|
AvlState,
|
|
34857
34655
|
{
|
|
@@ -35055,7 +34853,7 @@ var init_PageHeader = __esm({
|
|
|
35055
34853
|
info: "bg-info/10 text-info"
|
|
35056
34854
|
};
|
|
35057
34855
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
35058
|
-
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(
|
|
34856
|
+
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(React84__default.Fragment, { children: [
|
|
35059
34857
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
35060
34858
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
35061
34859
|
"a",
|
|
@@ -35792,7 +35590,7 @@ var init_WizardContainer = __esm({
|
|
|
35792
35590
|
const isCompleted = index < currentStep;
|
|
35793
35591
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35794
35592
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35795
|
-
return /* @__PURE__ */ jsxs(
|
|
35593
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
35796
35594
|
/* @__PURE__ */ jsx(
|
|
35797
35595
|
Button,
|
|
35798
35596
|
{
|
|
@@ -38077,7 +37875,7 @@ var init_DetailPanel = __esm({
|
|
|
38077
37875
|
}
|
|
38078
37876
|
});
|
|
38079
37877
|
function extractTitle(children) {
|
|
38080
|
-
if (!
|
|
37878
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
38081
37879
|
const props = children.props;
|
|
38082
37880
|
if (typeof props.title === "string") {
|
|
38083
37881
|
return props.title;
|
|
@@ -38132,7 +37930,7 @@ function LinearView({
|
|
|
38132
37930
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
38133
37931
|
const isDone = i < currentIdx;
|
|
38134
37932
|
const isCurrent = i === currentIdx;
|
|
38135
|
-
return /* @__PURE__ */ jsxs(
|
|
37933
|
+
return /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
38136
37934
|
i > 0 && /* @__PURE__ */ jsx(
|
|
38137
37935
|
Typography,
|
|
38138
37936
|
{
|
|
@@ -39090,12 +38888,12 @@ var init_Form = __esm({
|
|
|
39090
38888
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
39091
38889
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
39092
38890
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
39093
|
-
const normalizedInitialData =
|
|
38891
|
+
const normalizedInitialData = React84__default.useMemo(() => {
|
|
39094
38892
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
39095
38893
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
39096
38894
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
39097
38895
|
}, [entity, initialData]);
|
|
39098
|
-
const entityDerivedFields =
|
|
38896
|
+
const entityDerivedFields = React84__default.useMemo(() => {
|
|
39099
38897
|
if (fields && fields.length > 0) return void 0;
|
|
39100
38898
|
if (!resolvedEntity) return void 0;
|
|
39101
38899
|
return resolvedEntity.fields.map(
|
|
@@ -39115,16 +38913,16 @@ var init_Form = __esm({
|
|
|
39115
38913
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
39116
38914
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
39117
38915
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
39118
|
-
const [formData, setFormData] =
|
|
38916
|
+
const [formData, setFormData] = React84__default.useState(
|
|
39119
38917
|
normalizedInitialData
|
|
39120
38918
|
);
|
|
39121
|
-
const [collapsedSections, setCollapsedSections] =
|
|
38919
|
+
const [collapsedSections, setCollapsedSections] = React84__default.useState(
|
|
39122
38920
|
/* @__PURE__ */ new Set()
|
|
39123
38921
|
);
|
|
39124
|
-
const [submitError, setSubmitError] =
|
|
39125
|
-
const formRef =
|
|
38922
|
+
const [submitError, setSubmitError] = React84__default.useState(null);
|
|
38923
|
+
const formRef = React84__default.useRef(null);
|
|
39126
38924
|
const formMode = props.mode;
|
|
39127
|
-
const mountedRef =
|
|
38925
|
+
const mountedRef = React84__default.useRef(false);
|
|
39128
38926
|
if (!mountedRef.current) {
|
|
39129
38927
|
mountedRef.current = true;
|
|
39130
38928
|
debug("forms", "mount", {
|
|
@@ -39137,7 +38935,7 @@ var init_Form = __esm({
|
|
|
39137
38935
|
});
|
|
39138
38936
|
}
|
|
39139
38937
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
39140
|
-
const evalContext =
|
|
38938
|
+
const evalContext = React84__default.useMemo(
|
|
39141
38939
|
() => ({
|
|
39142
38940
|
formValues: formData,
|
|
39143
38941
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -39146,7 +38944,7 @@ var init_Form = __esm({
|
|
|
39146
38944
|
}),
|
|
39147
38945
|
[formData, externalContext]
|
|
39148
38946
|
);
|
|
39149
|
-
|
|
38947
|
+
React84__default.useEffect(() => {
|
|
39150
38948
|
debug("forms", "initialData-sync", {
|
|
39151
38949
|
mode: formMode,
|
|
39152
38950
|
normalizedInitialData,
|
|
@@ -39157,7 +38955,7 @@ var init_Form = __esm({
|
|
|
39157
38955
|
setFormData(normalizedInitialData);
|
|
39158
38956
|
}
|
|
39159
38957
|
}, [normalizedInitialData]);
|
|
39160
|
-
const processCalculations =
|
|
38958
|
+
const processCalculations = React84__default.useCallback(
|
|
39161
38959
|
(changedFieldId, newFormData) => {
|
|
39162
38960
|
if (!hiddenCalculations.length) return;
|
|
39163
38961
|
const context = {
|
|
@@ -39182,7 +38980,7 @@ var init_Form = __esm({
|
|
|
39182
38980
|
},
|
|
39183
38981
|
[hiddenCalculations, externalContext, eventBus]
|
|
39184
38982
|
);
|
|
39185
|
-
const checkViolations =
|
|
38983
|
+
const checkViolations = React84__default.useCallback(
|
|
39186
38984
|
(changedFieldId, newFormData) => {
|
|
39187
38985
|
if (!violationTriggers.length) return;
|
|
39188
38986
|
const context = {
|
|
@@ -39220,7 +39018,7 @@ var init_Form = __esm({
|
|
|
39220
39018
|
processCalculations(name, newFormData);
|
|
39221
39019
|
checkViolations(name, newFormData);
|
|
39222
39020
|
};
|
|
39223
|
-
const isFieldVisible =
|
|
39021
|
+
const isFieldVisible = React84__default.useCallback(
|
|
39224
39022
|
(fieldName) => {
|
|
39225
39023
|
const condition = conditionalFields[fieldName];
|
|
39226
39024
|
if (!condition) return true;
|
|
@@ -39228,7 +39026,7 @@ var init_Form = __esm({
|
|
|
39228
39026
|
},
|
|
39229
39027
|
[conditionalFields, evalContext]
|
|
39230
39028
|
);
|
|
39231
|
-
const isSectionVisible =
|
|
39029
|
+
const isSectionVisible = React84__default.useCallback(
|
|
39232
39030
|
(section) => {
|
|
39233
39031
|
if (!section.condition) return true;
|
|
39234
39032
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -39304,7 +39102,7 @@ var init_Form = __esm({
|
|
|
39304
39102
|
eventBus.emit(`UI:${onCancel}`);
|
|
39305
39103
|
}
|
|
39306
39104
|
};
|
|
39307
|
-
const renderField =
|
|
39105
|
+
const renderField = React84__default.useCallback(
|
|
39308
39106
|
(field) => {
|
|
39309
39107
|
const fieldName = field.name || field.field;
|
|
39310
39108
|
if (!fieldName) return null;
|
|
@@ -39325,7 +39123,7 @@ var init_Form = __esm({
|
|
|
39325
39123
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
39326
39124
|
);
|
|
39327
39125
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
39328
|
-
const normalizedFields =
|
|
39126
|
+
const normalizedFields = React84__default.useMemo(() => {
|
|
39329
39127
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
39330
39128
|
return effectiveFields.map((field) => {
|
|
39331
39129
|
if (typeof field === "string") {
|
|
@@ -39348,7 +39146,7 @@ var init_Form = __esm({
|
|
|
39348
39146
|
return field;
|
|
39349
39147
|
});
|
|
39350
39148
|
}, [effectiveFields, resolvedEntity]);
|
|
39351
|
-
const schemaFields =
|
|
39149
|
+
const schemaFields = React84__default.useMemo(() => {
|
|
39352
39150
|
if (normalizedFields.length === 0) return null;
|
|
39353
39151
|
if (isDebugEnabled()) {
|
|
39354
39152
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -39358,7 +39156,7 @@ var init_Form = __esm({
|
|
|
39358
39156
|
}
|
|
39359
39157
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
39360
39158
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
39361
|
-
const sectionElements =
|
|
39159
|
+
const sectionElements = React84__default.useMemo(() => {
|
|
39362
39160
|
if (!sections || sections.length === 0) return null;
|
|
39363
39161
|
return sections.map((section) => {
|
|
39364
39162
|
if (!isSectionVisible(section)) {
|
|
@@ -40633,7 +40431,7 @@ var init_List = __esm({
|
|
|
40633
40431
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
40634
40432
|
return [];
|
|
40635
40433
|
}, [entity]);
|
|
40636
|
-
const getItemActions =
|
|
40434
|
+
const getItemActions = React84__default.useCallback(
|
|
40637
40435
|
(item) => {
|
|
40638
40436
|
if (!itemActions) return [];
|
|
40639
40437
|
if (typeof itemActions === "function") {
|
|
@@ -41109,7 +40907,7 @@ var init_MediaGallery = __esm({
|
|
|
41109
40907
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41110
40908
|
);
|
|
41111
40909
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41112
|
-
const items =
|
|
40910
|
+
const items = React84__default.useMemo(() => {
|
|
41113
40911
|
if (propItems) return propItems;
|
|
41114
40912
|
if (entityData.length === 0) return [];
|
|
41115
40913
|
return entityData.map((record, idx) => ({
|
|
@@ -41270,7 +41068,7 @@ var init_MediaGallery = __esm({
|
|
|
41270
41068
|
}
|
|
41271
41069
|
});
|
|
41272
41070
|
function extractTitle2(children) {
|
|
41273
|
-
if (!
|
|
41071
|
+
if (!React84__default.isValidElement(children)) return void 0;
|
|
41274
41072
|
const props = children.props;
|
|
41275
41073
|
if (typeof props.title === "string") {
|
|
41276
41074
|
return props.title;
|
|
@@ -41701,7 +41499,7 @@ var init_debugRegistry = __esm({
|
|
|
41701
41499
|
}
|
|
41702
41500
|
});
|
|
41703
41501
|
function useDebugData() {
|
|
41704
|
-
const [data, setData] =
|
|
41502
|
+
const [data, setData] = React84.useState(() => ({
|
|
41705
41503
|
traits: [],
|
|
41706
41504
|
ticks: [],
|
|
41707
41505
|
guards: [],
|
|
@@ -41715,7 +41513,7 @@ function useDebugData() {
|
|
|
41715
41513
|
},
|
|
41716
41514
|
lastUpdate: Date.now()
|
|
41717
41515
|
}));
|
|
41718
|
-
|
|
41516
|
+
React84.useEffect(() => {
|
|
41719
41517
|
const updateData = () => {
|
|
41720
41518
|
setData({
|
|
41721
41519
|
traits: getAllTraits(),
|
|
@@ -41824,12 +41622,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
41824
41622
|
return positions;
|
|
41825
41623
|
}
|
|
41826
41624
|
function WalkMinimap() {
|
|
41827
|
-
const [walkStep, setWalkStep] =
|
|
41828
|
-
const [traits2, setTraits] =
|
|
41829
|
-
const [coveredEdges, setCoveredEdges] =
|
|
41830
|
-
const [completedTraits, setCompletedTraits] =
|
|
41831
|
-
const prevTraitRef =
|
|
41832
|
-
|
|
41625
|
+
const [walkStep, setWalkStep] = React84.useState(null);
|
|
41626
|
+
const [traits2, setTraits] = React84.useState([]);
|
|
41627
|
+
const [coveredEdges, setCoveredEdges] = React84.useState([]);
|
|
41628
|
+
const [completedTraits, setCompletedTraits] = React84.useState(/* @__PURE__ */ new Set());
|
|
41629
|
+
const prevTraitRef = React84.useRef(null);
|
|
41630
|
+
React84.useEffect(() => {
|
|
41833
41631
|
const interval = setInterval(() => {
|
|
41834
41632
|
const w = window;
|
|
41835
41633
|
const step = w.__orbitalWalkStep;
|
|
@@ -42265,15 +42063,15 @@ var init_EntitiesTab = __esm({
|
|
|
42265
42063
|
});
|
|
42266
42064
|
function EventFlowTab({ events: events2 }) {
|
|
42267
42065
|
const { t } = useTranslate();
|
|
42268
|
-
const [filter, setFilter] =
|
|
42269
|
-
const containerRef =
|
|
42270
|
-
const [autoScroll, setAutoScroll] =
|
|
42271
|
-
|
|
42066
|
+
const [filter, setFilter] = React84.useState("all");
|
|
42067
|
+
const containerRef = React84.useRef(null);
|
|
42068
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
42069
|
+
React84.useEffect(() => {
|
|
42272
42070
|
if (autoScroll && containerRef.current) {
|
|
42273
42071
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42274
42072
|
}
|
|
42275
42073
|
}, [events2.length, autoScroll]);
|
|
42276
|
-
const filteredEvents =
|
|
42074
|
+
const filteredEvents = React84.useMemo(() => {
|
|
42277
42075
|
if (filter === "all") return events2;
|
|
42278
42076
|
return events2.filter((e) => e.type === filter);
|
|
42279
42077
|
}, [events2, filter]);
|
|
@@ -42389,7 +42187,7 @@ var init_EventFlowTab = __esm({
|
|
|
42389
42187
|
});
|
|
42390
42188
|
function GuardsPanel({ guards }) {
|
|
42391
42189
|
const { t } = useTranslate();
|
|
42392
|
-
const [filter, setFilter] =
|
|
42190
|
+
const [filter, setFilter] = React84.useState("all");
|
|
42393
42191
|
if (guards.length === 0) {
|
|
42394
42192
|
return /* @__PURE__ */ jsx(
|
|
42395
42193
|
EmptyState,
|
|
@@ -42402,7 +42200,7 @@ function GuardsPanel({ guards }) {
|
|
|
42402
42200
|
}
|
|
42403
42201
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42404
42202
|
const failedCount = guards.length - passedCount;
|
|
42405
|
-
const filteredGuards =
|
|
42203
|
+
const filteredGuards = React84.useMemo(() => {
|
|
42406
42204
|
if (filter === "all") return guards;
|
|
42407
42205
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42408
42206
|
return guards.filter((g) => !g.result);
|
|
@@ -42565,10 +42363,10 @@ function EffectBadge({ effect }) {
|
|
|
42565
42363
|
}
|
|
42566
42364
|
function TransitionTimeline({ transitions }) {
|
|
42567
42365
|
const { t } = useTranslate();
|
|
42568
|
-
const containerRef =
|
|
42569
|
-
const [autoScroll, setAutoScroll] =
|
|
42570
|
-
const [expandedId, setExpandedId] =
|
|
42571
|
-
|
|
42366
|
+
const containerRef = React84.useRef(null);
|
|
42367
|
+
const [autoScroll, setAutoScroll] = React84.useState(true);
|
|
42368
|
+
const [expandedId, setExpandedId] = React84.useState(null);
|
|
42369
|
+
React84.useEffect(() => {
|
|
42572
42370
|
if (autoScroll && containerRef.current) {
|
|
42573
42371
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42574
42372
|
}
|
|
@@ -42848,9 +42646,9 @@ function getAllEvents(traits2) {
|
|
|
42848
42646
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
42849
42647
|
const eventBus = useEventBus();
|
|
42850
42648
|
const { t } = useTranslate();
|
|
42851
|
-
const [log12, setLog] =
|
|
42852
|
-
const prevStatesRef =
|
|
42853
|
-
|
|
42649
|
+
const [log12, setLog] = React84.useState([]);
|
|
42650
|
+
const prevStatesRef = React84.useRef(/* @__PURE__ */ new Map());
|
|
42651
|
+
React84.useEffect(() => {
|
|
42854
42652
|
for (const trait of traits2) {
|
|
42855
42653
|
const prev = prevStatesRef.current.get(trait.id);
|
|
42856
42654
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43019,10 +42817,10 @@ function VerifyModePanel({
|
|
|
43019
42817
|
localCount
|
|
43020
42818
|
}) {
|
|
43021
42819
|
const { t } = useTranslate();
|
|
43022
|
-
const [expanded, setExpanded] =
|
|
43023
|
-
const scrollRef =
|
|
43024
|
-
const prevCountRef =
|
|
43025
|
-
|
|
42820
|
+
const [expanded, setExpanded] = React84.useState(true);
|
|
42821
|
+
const scrollRef = React84.useRef(null);
|
|
42822
|
+
const prevCountRef = React84.useRef(0);
|
|
42823
|
+
React84.useEffect(() => {
|
|
43026
42824
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43027
42825
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43028
42826
|
}
|
|
@@ -43079,10 +42877,10 @@ function RuntimeDebugger({
|
|
|
43079
42877
|
schema
|
|
43080
42878
|
}) {
|
|
43081
42879
|
const { t } = useTranslate();
|
|
43082
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43083
|
-
const [isVisible, setIsVisible] =
|
|
42880
|
+
const [isCollapsed, setIsCollapsed] = React84.useState(mode === "verify" ? true : defaultCollapsed);
|
|
42881
|
+
const [isVisible, setIsVisible] = React84.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43084
42882
|
const debugData = useDebugData();
|
|
43085
|
-
|
|
42883
|
+
React84.useEffect(() => {
|
|
43086
42884
|
if (mode === "inline") return;
|
|
43087
42885
|
return onDebugToggle((enabled) => {
|
|
43088
42886
|
setIsVisible(enabled);
|
|
@@ -43091,7 +42889,7 @@ function RuntimeDebugger({
|
|
|
43091
42889
|
}
|
|
43092
42890
|
});
|
|
43093
42891
|
}, [mode]);
|
|
43094
|
-
|
|
42892
|
+
React84.useEffect(() => {
|
|
43095
42893
|
if (mode === "inline") return;
|
|
43096
42894
|
const handleKeyDown = (e) => {
|
|
43097
42895
|
if (e.key === "`" && isVisible) {
|
|
@@ -43540,7 +43338,7 @@ function SequenceBar({
|
|
|
43540
43338
|
onSlotRemove(index);
|
|
43541
43339
|
}, [onSlotRemove, playing]);
|
|
43542
43340
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
43543
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
43341
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React84__default.Fragment, { children: [
|
|
43544
43342
|
i > 0 && /* @__PURE__ */ jsx(
|
|
43545
43343
|
Typography,
|
|
43546
43344
|
{
|
|
@@ -44519,7 +44317,7 @@ var init_StatCard = __esm({
|
|
|
44519
44317
|
const labelToUse = propLabel ?? propTitle;
|
|
44520
44318
|
const eventBus = useEventBus();
|
|
44521
44319
|
const { t } = useTranslate();
|
|
44522
|
-
const handleActionClick =
|
|
44320
|
+
const handleActionClick = React84__default.useCallback(() => {
|
|
44523
44321
|
if (action?.event) {
|
|
44524
44322
|
eventBus.emit(`UI:${action.event}`, {});
|
|
44525
44323
|
}
|
|
@@ -44530,7 +44328,7 @@ var init_StatCard = __esm({
|
|
|
44530
44328
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
44531
44329
|
const isLoading = externalLoading ?? false;
|
|
44532
44330
|
const error = externalError;
|
|
44533
|
-
const computeMetricValue =
|
|
44331
|
+
const computeMetricValue = React84__default.useCallback(
|
|
44534
44332
|
(metric, items) => {
|
|
44535
44333
|
if (metric.value !== void 0) {
|
|
44536
44334
|
return metric.value;
|
|
@@ -44569,7 +44367,7 @@ var init_StatCard = __esm({
|
|
|
44569
44367
|
},
|
|
44570
44368
|
[]
|
|
44571
44369
|
);
|
|
44572
|
-
const schemaStats =
|
|
44370
|
+
const schemaStats = React84__default.useMemo(() => {
|
|
44573
44371
|
if (!metrics || metrics.length === 0) return null;
|
|
44574
44372
|
return metrics.map((metric) => ({
|
|
44575
44373
|
label: metric.label,
|
|
@@ -44577,7 +44375,7 @@ var init_StatCard = __esm({
|
|
|
44577
44375
|
format: metric.format
|
|
44578
44376
|
}));
|
|
44579
44377
|
}, [metrics, data, computeMetricValue]);
|
|
44580
|
-
const calculatedTrend =
|
|
44378
|
+
const calculatedTrend = React84__default.useMemo(() => {
|
|
44581
44379
|
if (manualTrend !== void 0) return manualTrend;
|
|
44582
44380
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44583
44381
|
return void 0;
|
|
@@ -44858,6 +44656,37 @@ var init_VariablePanel = __esm({
|
|
|
44858
44656
|
VariablePanel.displayName = "VariablePanel";
|
|
44859
44657
|
}
|
|
44860
44658
|
});
|
|
44659
|
+
function StateJsonView({
|
|
44660
|
+
data,
|
|
44661
|
+
label,
|
|
44662
|
+
defaultExpanded = false,
|
|
44663
|
+
className
|
|
44664
|
+
}) {
|
|
44665
|
+
const { t } = useTranslate();
|
|
44666
|
+
const [expanded, setExpanded] = useState(defaultExpanded);
|
|
44667
|
+
const jsonString = JSON.stringify(data, null, 2);
|
|
44668
|
+
return /* @__PURE__ */ jsxs(VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
|
|
44669
|
+
/* @__PURE__ */ jsxs(HStack, { className: "items-center justify-between p-2 bg-muted", gap: "sm", children: [
|
|
44670
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground font-medium", children: label ?? t("stateArchitect.viewCode") }),
|
|
44671
|
+
/* @__PURE__ */ jsx(Button, { variant: "ghost", onClick: () => setExpanded(!expanded), className: "text-xs", children: expanded ? t("stateArchitect.hideJson") : t("stateArchitect.showJson") })
|
|
44672
|
+
] }),
|
|
44673
|
+
expanded && /* @__PURE__ */ jsx(Box, { className: "p-3 bg-background overflow-x-auto", children: /* @__PURE__ */ jsx(
|
|
44674
|
+
Typography,
|
|
44675
|
+
{
|
|
44676
|
+
variant: "caption",
|
|
44677
|
+
className: "text-foreground font-mono whitespace-pre text-xs leading-relaxed block",
|
|
44678
|
+
children: jsonString
|
|
44679
|
+
}
|
|
44680
|
+
) })
|
|
44681
|
+
] });
|
|
44682
|
+
}
|
|
44683
|
+
var init_StateJsonView = __esm({
|
|
44684
|
+
"components/game/organisms/puzzles/state-architect/StateJsonView.tsx"() {
|
|
44685
|
+
init_atoms2();
|
|
44686
|
+
init_cn();
|
|
44687
|
+
StateJsonView.displayName = "StateJsonView";
|
|
44688
|
+
}
|
|
44689
|
+
});
|
|
44861
44690
|
function layoutStates(states, width, height) {
|
|
44862
44691
|
const cx = width / 2;
|
|
44863
44692
|
const cy = height / 2;
|
|
@@ -45149,7 +44978,7 @@ function StateArchitectBoard({
|
|
|
45149
44978
|
!r.passed && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-error", children: t("stateArchitect.gotState", { state: r.actualState }) })
|
|
45150
44979
|
] }, i))
|
|
45151
44980
|
] }),
|
|
45152
|
-
resolved.showCodeView !== false && /* @__PURE__ */ jsx(
|
|
44981
|
+
resolved.showCodeView !== false && /* @__PURE__ */ jsx(StateJsonView, { data: codeData, label: "View Code" })
|
|
45153
44982
|
] })
|
|
45154
44983
|
] }),
|
|
45155
44984
|
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") }) }),
|
|
@@ -45186,7 +45015,7 @@ var init_StateArchitectBoard = __esm({
|
|
|
45186
45015
|
init_StateNode();
|
|
45187
45016
|
init_TransitionArrow();
|
|
45188
45017
|
init_VariablePanel();
|
|
45189
|
-
|
|
45018
|
+
init_StateJsonView();
|
|
45190
45019
|
init_boardEntity();
|
|
45191
45020
|
ENCOURAGEMENT_KEYS3 = [
|
|
45192
45021
|
"puzzle.tryAgain1",
|
|
@@ -45511,7 +45340,7 @@ var init_Timeline = __esm({
|
|
|
45511
45340
|
}) => {
|
|
45512
45341
|
const { t } = useTranslate();
|
|
45513
45342
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
45514
|
-
const items =
|
|
45343
|
+
const items = React84__default.useMemo(() => {
|
|
45515
45344
|
if (propItems) return propItems;
|
|
45516
45345
|
if (entityData.length === 0) return [];
|
|
45517
45346
|
return entityData.map((record, idx) => {
|
|
@@ -45618,7 +45447,7 @@ var init_Timeline = __esm({
|
|
|
45618
45447
|
}
|
|
45619
45448
|
});
|
|
45620
45449
|
function extractToastProps(children) {
|
|
45621
|
-
if (!
|
|
45450
|
+
if (!React84__default.isValidElement(children)) {
|
|
45622
45451
|
if (typeof children === "string") {
|
|
45623
45452
|
return { message: children };
|
|
45624
45453
|
}
|
|
@@ -45656,7 +45485,7 @@ var init_ToastSlot = __esm({
|
|
|
45656
45485
|
eventBus.emit("UI:CLOSE");
|
|
45657
45486
|
};
|
|
45658
45487
|
if (!isVisible) return null;
|
|
45659
|
-
const isCustomContent =
|
|
45488
|
+
const isCustomContent = React84__default.isValidElement(children) && !message;
|
|
45660
45489
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45661
45490
|
Toast,
|
|
45662
45491
|
{
|
|
@@ -46166,12 +45995,12 @@ var init_WorldMapTemplate = __esm({
|
|
|
46166
45995
|
}
|
|
46167
45996
|
});
|
|
46168
45997
|
function lazyThree(name, loader) {
|
|
46169
|
-
const Lazy =
|
|
45998
|
+
const Lazy = React84__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
46170
45999
|
function ThreeWrapper(props) {
|
|
46171
|
-
return
|
|
46172
|
-
|
|
46000
|
+
return React84__default.createElement(
|
|
46001
|
+
React84__default.Suspense,
|
|
46173
46002
|
{ fallback: null },
|
|
46174
|
-
|
|
46003
|
+
React84__default.createElement(Lazy, props)
|
|
46175
46004
|
);
|
|
46176
46005
|
}
|
|
46177
46006
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -46219,8 +46048,6 @@ var init_component_registry_generated = __esm({
|
|
|
46219
46048
|
init_ChoiceButton();
|
|
46220
46049
|
init_ClassifierBoard();
|
|
46221
46050
|
init_CodeBlock();
|
|
46222
|
-
init_CodeView();
|
|
46223
|
-
init_CodeViewer();
|
|
46224
46051
|
init_CombatLog();
|
|
46225
46052
|
init_ComboCounter();
|
|
46226
46053
|
init_CommunityLinks();
|
|
@@ -46248,7 +46075,6 @@ var init_component_registry_generated = __esm({
|
|
|
46248
46075
|
init_DialogueBox();
|
|
46249
46076
|
init_DialogueBubble();
|
|
46250
46077
|
init_DocBreadcrumb();
|
|
46251
|
-
init_DocCodeBlock();
|
|
46252
46078
|
init_DocPagination();
|
|
46253
46079
|
init_DocSearch();
|
|
46254
46080
|
init_DocSidebar();
|
|
@@ -46503,8 +46329,6 @@ var init_component_registry_generated = __esm({
|
|
|
46503
46329
|
"ChoiceButton": ChoiceButton,
|
|
46504
46330
|
"ClassifierBoard": ClassifierBoard,
|
|
46505
46331
|
"CodeBlock": CodeBlock,
|
|
46506
|
-
"CodeView": CodeView,
|
|
46507
|
-
"CodeViewer": CodeViewer,
|
|
46508
46332
|
"CombatLog": CombatLog,
|
|
46509
46333
|
"ComboCounter": ComboCounter,
|
|
46510
46334
|
"CommunityLinks": CommunityLinks,
|
|
@@ -46536,7 +46360,6 @@ var init_component_registry_generated = __esm({
|
|
|
46536
46360
|
"Divider": DividerPattern,
|
|
46537
46361
|
"DividerPattern": DividerPattern,
|
|
46538
46362
|
"DocBreadcrumb": DocBreadcrumb,
|
|
46539
|
-
"DocCodeBlock": DocCodeBlock,
|
|
46540
46363
|
"DocPagination": DocPagination,
|
|
46541
46364
|
"DocSearch": DocSearch,
|
|
46542
46365
|
"DocSidebar": DocSidebar,
|
|
@@ -46787,7 +46610,7 @@ function SuspenseConfigProvider({
|
|
|
46787
46610
|
config,
|
|
46788
46611
|
children
|
|
46789
46612
|
}) {
|
|
46790
|
-
return
|
|
46613
|
+
return React84__default.createElement(
|
|
46791
46614
|
SuspenseConfigContext.Provider,
|
|
46792
46615
|
{ value: config },
|
|
46793
46616
|
children
|
|
@@ -47277,7 +47100,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
47277
47100
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
47278
47101
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
47279
47102
|
}
|
|
47280
|
-
return /* @__PURE__ */ jsx(
|
|
47103
|
+
return /* @__PURE__ */ jsx(React84__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
47281
47104
|
}
|
|
47282
47105
|
if (!child || typeof child !== "object") return null;
|
|
47283
47106
|
const childId = `${parentId}-${index}`;
|
|
@@ -47317,14 +47140,14 @@ function isPatternConfig(value) {
|
|
|
47317
47140
|
if (value === null || value === void 0) return false;
|
|
47318
47141
|
if (typeof value !== "object") return false;
|
|
47319
47142
|
if (Array.isArray(value)) return false;
|
|
47320
|
-
if (
|
|
47143
|
+
if (React84__default.isValidElement(value)) return false;
|
|
47321
47144
|
if (value instanceof Date) return false;
|
|
47322
47145
|
if (typeof value === "function") return false;
|
|
47323
47146
|
const record = value;
|
|
47324
47147
|
return "type" in record && typeof record.type === "string";
|
|
47325
47148
|
}
|
|
47326
47149
|
function isPlainConfigObject(value) {
|
|
47327
|
-
if (
|
|
47150
|
+
if (React84__default.isValidElement(value)) return false;
|
|
47328
47151
|
if (value instanceof Date) return false;
|
|
47329
47152
|
const proto = Object.getPrototypeOf(value);
|
|
47330
47153
|
return proto === Object.prototype || proto === null;
|
|
@@ -47734,7 +47557,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
47734
47557
|
if (Array.isArray(body)) {
|
|
47735
47558
|
return body.map((b) => recur(b));
|
|
47736
47559
|
}
|
|
47737
|
-
if (body !== null && typeof body === "object" && !
|
|
47560
|
+
if (body !== null && typeof body === "object" && !React84__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
47738
47561
|
const out = {};
|
|
47739
47562
|
for (const [k, v] of Object.entries(body)) {
|
|
47740
47563
|
out[k] = recur(v);
|
|
@@ -47753,7 +47576,7 @@ function getSlotContentRenderer2() {
|
|
|
47753
47576
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
47754
47577
|
return (item, index) => {
|
|
47755
47578
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
47756
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
47579
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React84__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
47757
47580
|
return null;
|
|
47758
47581
|
}
|
|
47759
47582
|
const record = resolvedBody;
|
|
@@ -47772,7 +47595,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
47772
47595
|
props: childProps,
|
|
47773
47596
|
priority: 0
|
|
47774
47597
|
};
|
|
47775
|
-
return
|
|
47598
|
+
return React84__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
47776
47599
|
};
|
|
47777
47600
|
}
|
|
47778
47601
|
function convertNode(node, callerKey) {
|
|
@@ -47791,7 +47614,7 @@ function convertNode(node, callerKey) {
|
|
|
47791
47614
|
});
|
|
47792
47615
|
return anyChanged ? mapped : node;
|
|
47793
47616
|
}
|
|
47794
|
-
if (typeof node === "object" && !
|
|
47617
|
+
if (typeof node === "object" && !React84__default.isValidElement(node) && !(node instanceof Date)) {
|
|
47795
47618
|
return convertObjectProps(node);
|
|
47796
47619
|
}
|
|
47797
47620
|
return node;
|