@almadar/ui 5.155.0 → 5.157.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/{NavStackContext-BoVV9nWb.d.cts → NavStackContext-bw2nlBgT.d.cts} +4 -0
- package/dist/{NavStackContext-BoVV9nWb.d.ts → NavStackContext-bw2nlBgT.d.ts} +4 -0
- package/dist/avl/index.cjs +254 -132
- package/dist/avl/index.js +256 -134
- package/dist/components/index.cjs +259 -134
- package/dist/components/index.d.cts +34 -12
- package/dist/components/index.d.ts +34 -12
- package/dist/components/index.js +262 -137
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/{offline-executor-Qz4b6GpF.d.cts → offline-executor-QUdKOj7f.d.cts} +1 -1
- package/dist/{offline-executor-Qz4b6GpF.d.ts → offline-executor-QUdKOj7f.d.ts} +1 -1
- package/dist/providers/index.cjs +291 -137
- package/dist/providers/index.d.cts +26 -4
- package/dist/providers/index.d.ts +26 -4
- package/dist/providers/index.js +291 -139
- package/dist/renderer/index.d.cts +2 -2
- package/dist/renderer/index.d.ts +2 -2
- package/dist/runtime/index.cjs +254 -132
- package/dist/runtime/index.js +256 -134
- package/package.json +4 -4
- package/themes/_fonts-kenney.css +11 -0
- package/themes/index.css +3 -0
package/dist/providers/index.cjs
CHANGED
|
@@ -7867,10 +7867,21 @@ function ControlGrid({
|
|
|
7867
7867
|
directionAssets,
|
|
7868
7868
|
size = "md",
|
|
7869
7869
|
disabled,
|
|
7870
|
+
visibility = "auto",
|
|
7870
7871
|
className
|
|
7871
7872
|
}) {
|
|
7872
7873
|
const eventBus = useEventBus();
|
|
7873
7874
|
const [active, setActive] = React87__namespace.useState(/* @__PURE__ */ new Set());
|
|
7875
|
+
const [coarse, setCoarse] = React87__namespace.useState(
|
|
7876
|
+
() => typeof window !== "undefined" && window.matchMedia("(pointer: coarse)").matches
|
|
7877
|
+
);
|
|
7878
|
+
React87__namespace.useEffect(() => {
|
|
7879
|
+
if (visibility !== "auto" || typeof window === "undefined") return;
|
|
7880
|
+
const mq = window.matchMedia("(pointer: coarse)");
|
|
7881
|
+
const onChange = (e) => setCoarse(e.matches);
|
|
7882
|
+
mq.addEventListener("change", onChange);
|
|
7883
|
+
return () => mq.removeEventListener("change", onChange);
|
|
7884
|
+
}, [visibility]);
|
|
7874
7885
|
const handlePress = React87__namespace.useCallback(
|
|
7875
7886
|
(id) => {
|
|
7876
7887
|
setActive((prev) => new Set(prev).add(id));
|
|
@@ -7903,6 +7914,7 @@ function ControlGrid({
|
|
|
7903
7914
|
},
|
|
7904
7915
|
[kind, actionEvent, directionEvent, directionReleaseEvents, eventBus, onAction, onDirection]
|
|
7905
7916
|
);
|
|
7917
|
+
if (visibility === "auto" && !coarse) return null;
|
|
7906
7918
|
if (kind === "dpad") {
|
|
7907
7919
|
const ds = dpadSizeMap[size];
|
|
7908
7920
|
const dir = (d) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8052,7 +8064,7 @@ function StatBadge({
|
|
|
8052
8064
|
assetUrl,
|
|
8053
8065
|
iconUrl,
|
|
8054
8066
|
label,
|
|
8055
|
-
value
|
|
8067
|
+
value,
|
|
8056
8068
|
max,
|
|
8057
8069
|
format = "number",
|
|
8058
8070
|
icon,
|
|
@@ -8063,6 +8075,7 @@ function StatBadge({
|
|
|
8063
8075
|
source: _source,
|
|
8064
8076
|
field: _field
|
|
8065
8077
|
}) {
|
|
8078
|
+
const hasValue = value !== void 0 && value !== null;
|
|
8066
8079
|
const numValue = typeof value === "number" ? value : parseInt(String(value), 10) || 0;
|
|
8067
8080
|
const resolvedAsset = iconUrl ?? assetUrl;
|
|
8068
8081
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -8076,8 +8089,8 @@ function StatBadge({
|
|
|
8076
8089
|
),
|
|
8077
8090
|
children: [
|
|
8078
8091
|
resolvedAsset ? /* @__PURE__ */ jsxRuntime.jsx(GameIcon, { assetUrl: resolvedAsset, icon: "image", size: 16, className: "flex-shrink-0" }) : icon ? /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", className: "flex-shrink-0 text-lg", children: typeof icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, className: "w-4 h-4" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, className: "w-4 h-4" }) }) : null,
|
|
8079
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", className: "text-muted-foreground font-medium", children: label }),
|
|
8080
|
-
format === "hearts" && max && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8092
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", className: "text-muted-foreground font-medium text-xs", children: label }),
|
|
8093
|
+
hasValue && format === "hearts" && max && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8081
8094
|
HealthBar,
|
|
8082
8095
|
{
|
|
8083
8096
|
current: numValue,
|
|
@@ -8086,7 +8099,7 @@ function StatBadge({
|
|
|
8086
8099
|
size: size === "lg" ? "md" : "sm"
|
|
8087
8100
|
}
|
|
8088
8101
|
),
|
|
8089
|
-
format === "bar" && max && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8102
|
+
hasValue && format === "bar" && max && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8090
8103
|
HealthBar,
|
|
8091
8104
|
{
|
|
8092
8105
|
current: numValue,
|
|
@@ -8095,14 +8108,15 @@ function StatBadge({
|
|
|
8095
8108
|
size: size === "lg" ? "md" : "sm"
|
|
8096
8109
|
}
|
|
8097
8110
|
),
|
|
8098
|
-
format === "number" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8111
|
+
hasValue && format === "number" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
8099
8112
|
ScoreDisplay,
|
|
8100
8113
|
{
|
|
8101
8114
|
value: numValue,
|
|
8102
|
-
size: size === "lg" ? "md" : "sm"
|
|
8115
|
+
size: size === "lg" ? "md" : "sm",
|
|
8116
|
+
className: "font-display"
|
|
8103
8117
|
}
|
|
8104
8118
|
),
|
|
8105
|
-
format === "text" && /* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", className: "font-bold text-foreground", children: value })
|
|
8119
|
+
hasValue && format === "text" && /* @__PURE__ */ jsxRuntime.jsx(Typography, { as: "span", className: "font-bold text-foreground", children: value })
|
|
8106
8120
|
]
|
|
8107
8121
|
}
|
|
8108
8122
|
);
|
|
@@ -8118,6 +8132,7 @@ var init_StatBadge = __esm({
|
|
|
8118
8132
|
init_HealthBar();
|
|
8119
8133
|
init_ScoreDisplay();
|
|
8120
8134
|
sizeMap6 = {
|
|
8135
|
+
xs: "text-xs px-1.5 py-0.5",
|
|
8121
8136
|
sm: "text-xs px-2 py-1",
|
|
8122
8137
|
md: "text-sm px-3 py-1.5",
|
|
8123
8138
|
lg: "text-base px-4 py-2"
|
|
@@ -8160,6 +8175,7 @@ function GameHud({
|
|
|
8160
8175
|
items,
|
|
8161
8176
|
elements,
|
|
8162
8177
|
size = "md",
|
|
8178
|
+
variant = "floating",
|
|
8163
8179
|
className,
|
|
8164
8180
|
transparent = true
|
|
8165
8181
|
}) {
|
|
@@ -8174,7 +8190,7 @@ function GameHud({
|
|
|
8174
8190
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { position: "absolute", className: "top-4 right-4 flex flex-col gap-2 items-end pointer-events-auto", children: rightStats.map((stat, i) => /* @__PURE__ */ jsxRuntime.jsx(StatBadge, { ...stat, size }, i)) })
|
|
8175
8191
|
] });
|
|
8176
8192
|
}
|
|
8177
|
-
if (position === "top" || position === "bottom") {
|
|
8193
|
+
if ((position === "top" || position === "bottom") && variant === "bar") {
|
|
8178
8194
|
const mid = Math.ceil(stats.length / 2);
|
|
8179
8195
|
const leftStats = stats.slice(0, mid);
|
|
8180
8196
|
const rightStats = stats.slice(mid);
|
|
@@ -11662,7 +11678,7 @@ var init_StateJsonView = __esm({
|
|
|
11662
11678
|
StateJsonView.displayName = "StateJsonView";
|
|
11663
11679
|
}
|
|
11664
11680
|
});
|
|
11665
|
-
var
|
|
11681
|
+
var GAME_FONTS, GameShell;
|
|
11666
11682
|
var init_GameShell = __esm({
|
|
11667
11683
|
"components/game/templates/GameShell.tsx"() {
|
|
11668
11684
|
init_cn();
|
|
@@ -11670,7 +11686,6 @@ var init_GameShell = __esm({
|
|
|
11670
11686
|
init_Card();
|
|
11671
11687
|
init_Typography();
|
|
11672
11688
|
init_AtlasImage();
|
|
11673
|
-
FONT_BASE = "https://almadar-kflow-assets.web.app/shared/_shared/kenney-fonts/fonts";
|
|
11674
11689
|
GAME_FONTS = {
|
|
11675
11690
|
future: "Kenney Future",
|
|
11676
11691
|
"future-narrow": "Kenney Future Narrow",
|
|
@@ -11678,14 +11693,6 @@ var init_GameShell = __esm({
|
|
|
11678
11693
|
blocks: "Kenney Blocks",
|
|
11679
11694
|
mini: "Kenney Mini"
|
|
11680
11695
|
};
|
|
11681
|
-
FONT_FACES = `
|
|
11682
|
-
@font-face { font-family: 'Kenney Future'; src: url('${FONT_BASE}/Kenney%20Future.ttf') format('truetype'); font-display: swap; }
|
|
11683
|
-
@font-face { font-family: 'Kenney Future Narrow'; src: url('${FONT_BASE}/Kenney%20Future%20Narrow.ttf') format('truetype'); font-display: swap; }
|
|
11684
|
-
@font-face { font-family: 'Kenney Pixel'; src: url('${FONT_BASE}/Kenney%20Pixel.ttf') format('truetype'); font-display: swap; }
|
|
11685
|
-
@font-face { font-family: 'Kenney Blocks'; src: url('${FONT_BASE}/Kenney%20Blocks.ttf') format('truetype'); font-display: swap; }
|
|
11686
|
-
@font-face { font-family: 'Kenney Mini'; src: url('${FONT_BASE}/Kenney%20Mini.ttf') format('truetype'); font-display: swap; }
|
|
11687
|
-
.game-shell, .game-shell * { font-family: inherit; }
|
|
11688
|
-
`;
|
|
11689
11696
|
GameShell = ({
|
|
11690
11697
|
appName = "Game",
|
|
11691
11698
|
hud,
|
|
@@ -11712,10 +11719,12 @@ var init_GameShell = __esm({
|
|
|
11712
11719
|
overflow: "hidden",
|
|
11713
11720
|
background: "var(--color-background, #0a0a0f)",
|
|
11714
11721
|
color: "var(--color-foreground, #e0e0e0)",
|
|
11715
|
-
fontFamily
|
|
11722
|
+
// The fontFamily knob is a scoped override of the theme contract's
|
|
11723
|
+
// display slot: titles/numerics take the game face, body text keeps
|
|
11724
|
+
// the active theme's --font-family-body.
|
|
11725
|
+
"--font-family-display": `'${font}', ui-sans-serif, system-ui, sans-serif`
|
|
11716
11726
|
},
|
|
11717
11727
|
children: [
|
|
11718
|
-
/* @__PURE__ */ jsxRuntime.jsx("style", { children: FONT_FACES }),
|
|
11719
11728
|
backgroundAsset && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11720
11729
|
AtlasPanel,
|
|
11721
11730
|
{
|
|
@@ -11753,6 +11762,7 @@ var init_GameShell = __esm({
|
|
|
11753
11762
|
Typography,
|
|
11754
11763
|
{
|
|
11755
11764
|
as: "span",
|
|
11765
|
+
className: "font-display",
|
|
11756
11766
|
style: {
|
|
11757
11767
|
fontWeight: 700,
|
|
11758
11768
|
fontSize: "1.05rem",
|
|
@@ -11833,6 +11843,11 @@ var init_molecules = __esm({
|
|
|
11833
11843
|
init_puzzleObject();
|
|
11834
11844
|
}
|
|
11835
11845
|
});
|
|
11846
|
+
function themeBodyFont(el) {
|
|
11847
|
+
if (typeof getComputedStyle !== "function") return "system-ui, sans-serif";
|
|
11848
|
+
const v = getComputedStyle(el).getPropertyValue("--font-family-body").trim();
|
|
11849
|
+
return v || "system-ui, sans-serif";
|
|
11850
|
+
}
|
|
11836
11851
|
function resolveColor2(color, ctx, fallback) {
|
|
11837
11852
|
if (!color) return fallback;
|
|
11838
11853
|
if (color.startsWith("var(")) {
|
|
@@ -12021,6 +12036,8 @@ function drawShape(ctx, shape, width, height, allShapes) {
|
|
|
12021
12036
|
case "path": {
|
|
12022
12037
|
if (!shape.path) break;
|
|
12023
12038
|
const p = new Path2D(shape.path);
|
|
12039
|
+
ctx.lineJoin = "round";
|
|
12040
|
+
ctx.lineCap = "round";
|
|
12024
12041
|
if (fill) {
|
|
12025
12042
|
ctx.fillStyle = fill;
|
|
12026
12043
|
ctx.fill(p);
|
|
@@ -12032,7 +12049,7 @@ function drawShape(ctx, shape, width, height, allShapes) {
|
|
|
12032
12049
|
case "text": {
|
|
12033
12050
|
if (shape.x == null || shape.y == null || !shape.text) break;
|
|
12034
12051
|
ctx.fillStyle = stroke;
|
|
12035
|
-
ctx.font = `${shape.fontSize ?? 14}px
|
|
12052
|
+
ctx.font = `${shape.fontSize ?? 14}px ${themeBodyFont(ctx.canvas)}`;
|
|
12036
12053
|
ctx.textAlign = shape.align ?? "left";
|
|
12037
12054
|
ctx.textBaseline = "middle";
|
|
12038
12055
|
ctx.fillText(shape.text, shape.x, shape.y);
|
|
@@ -12229,7 +12246,7 @@ var init_LearningCanvas = __esm({
|
|
|
12229
12246
|
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
12230
12247
|
ctx.clearRect(0, 0, width, height);
|
|
12231
12248
|
if (backgroundColor) {
|
|
12232
|
-
ctx.fillStyle = backgroundColor;
|
|
12249
|
+
ctx.fillStyle = resolveColor2(backgroundColor, ctx, backgroundColor);
|
|
12233
12250
|
ctx.fillRect(0, 0, width, height);
|
|
12234
12251
|
}
|
|
12235
12252
|
for (const shape of derivedShapes) {
|
|
@@ -21766,7 +21783,22 @@ function eventStartDate(event, startField) {
|
|
|
21766
21783
|
const raw = getNestedValue(event, startField);
|
|
21767
21784
|
return new Date(raw ?? "");
|
|
21768
21785
|
}
|
|
21769
|
-
function
|
|
21786
|
+
function eventEndDate(event, endField) {
|
|
21787
|
+
const raw = getNestedValue(event, endField);
|
|
21788
|
+
if (raw === void 0 || raw === null || raw === "") return null;
|
|
21789
|
+
const end = new Date(raw);
|
|
21790
|
+
return Number.isNaN(end.getTime()) ? null : end;
|
|
21791
|
+
}
|
|
21792
|
+
function eventContinuesInSlot(event, day, slotTime, startField, endField) {
|
|
21793
|
+
const eventStart = eventStartDate(event, startField);
|
|
21794
|
+
const eventEnd = eventEndDate(event, endField);
|
|
21795
|
+
if (eventEnd === null || Number.isNaN(eventStart.getTime())) return false;
|
|
21796
|
+
const [slotHour] = slotTime.split(":").map(Number);
|
|
21797
|
+
const slotStart = new Date(day);
|
|
21798
|
+
slotStart.setHours(slotHour, 0, 0, 0);
|
|
21799
|
+
return slotStart.getTime() > eventStart.getTime() && slotStart.getTime() < eventEnd.getTime();
|
|
21800
|
+
}
|
|
21801
|
+
function generateDefaultTimeSlots(events2, startField, endField) {
|
|
21770
21802
|
let first = DEFAULT_FIRST_HOUR;
|
|
21771
21803
|
let last = DEFAULT_LAST_HOUR;
|
|
21772
21804
|
for (const ev of events2) {
|
|
@@ -21775,6 +21807,11 @@ function generateDefaultTimeSlots(events2, startField) {
|
|
|
21775
21807
|
const hour = start.getHours();
|
|
21776
21808
|
if (hour < first) first = hour;
|
|
21777
21809
|
if (hour > last) last = hour;
|
|
21810
|
+
const end = eventEndDate(ev, endField);
|
|
21811
|
+
if (end && end.toDateString() === start.toDateString()) {
|
|
21812
|
+
const endHour = end.getMinutes() === 0 && end.getSeconds() === 0 ? end.getHours() - 1 : end.getHours();
|
|
21813
|
+
if (endHour > last) last = endHour;
|
|
21814
|
+
}
|
|
21778
21815
|
}
|
|
21779
21816
|
const slots = [];
|
|
21780
21817
|
for (let hour = first; hour <= last; hour++) {
|
|
@@ -21803,6 +21840,7 @@ function CalendarGrid({
|
|
|
21803
21840
|
dayWindow = "auto",
|
|
21804
21841
|
titleField = "title",
|
|
21805
21842
|
startField = "startTime",
|
|
21843
|
+
endField = "endTime",
|
|
21806
21844
|
colorField = "color",
|
|
21807
21845
|
children,
|
|
21808
21846
|
renderItem
|
|
@@ -21820,8 +21858,8 @@ function CalendarGrid({
|
|
|
21820
21858
|
[resolvedWeekStart]
|
|
21821
21859
|
);
|
|
21822
21860
|
const resolvedTimeSlots = React87.useMemo(
|
|
21823
|
-
() => timeSlots ?? generateDefaultTimeSlots(evs, startField),
|
|
21824
|
-
[timeSlots, evs, startField]
|
|
21861
|
+
() => timeSlots ?? generateDefaultTimeSlots(evs, startField, endField),
|
|
21862
|
+
[timeSlots, evs, startField, endField]
|
|
21825
21863
|
);
|
|
21826
21864
|
const visibleCount = useDayWindow(dayWindow);
|
|
21827
21865
|
const [dayOffset, setDayOffset] = React87.useState(0);
|
|
@@ -21981,12 +22019,15 @@ function CalendarGrid({
|
|
|
21981
22019
|
const slotEvents = evs.filter(
|
|
21982
22020
|
(ev) => eventInSlot(ev, day, time, startField)
|
|
21983
22021
|
);
|
|
22022
|
+
const continuingEvents = evs.filter(
|
|
22023
|
+
(ev) => eventContinuesInSlot(ev, day, time, startField, endField)
|
|
22024
|
+
);
|
|
21984
22025
|
const isToday = day.toDateString() === (/* @__PURE__ */ new Date()).toDateString();
|
|
21985
22026
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
21986
22027
|
TimeSlotCell,
|
|
21987
22028
|
{
|
|
21988
22029
|
time,
|
|
21989
|
-
isOccupied: slotEvents.length > 0,
|
|
22030
|
+
isOccupied: slotEvents.length > 0 || continuingEvents.length > 0,
|
|
21990
22031
|
onClick: () => handleSlotClick(day, time),
|
|
21991
22032
|
className: cn(
|
|
21992
22033
|
"border-l border-border",
|
|
@@ -21997,7 +22038,25 @@ function CalendarGrid({
|
|
|
21997
22038
|
onPointerUp: clearLongPress,
|
|
21998
22039
|
onPointerCancel: clearLongPress
|
|
21999
22040
|
} : {},
|
|
22000
|
-
children: /* @__PURE__ */ jsxRuntime.
|
|
22041
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
22042
|
+
slotEvents.map(renderEvent),
|
|
22043
|
+
continuingEvents.map((event) => {
|
|
22044
|
+
const color = getNestedValue(event, colorField);
|
|
22045
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22046
|
+
Box,
|
|
22047
|
+
{
|
|
22048
|
+
rounded: "sm",
|
|
22049
|
+
border: true,
|
|
22050
|
+
className: cn(
|
|
22051
|
+
"cursor-pointer h-2",
|
|
22052
|
+
color ? cn(color, "opacity-50") : "bg-primary/10 border-primary/20"
|
|
22053
|
+
),
|
|
22054
|
+
onClick: (e) => handleEventClick(event, e)
|
|
22055
|
+
},
|
|
22056
|
+
`${event.id}-cont`
|
|
22057
|
+
);
|
|
22058
|
+
})
|
|
22059
|
+
] })
|
|
22001
22060
|
},
|
|
22002
22061
|
`${day.toISOString()}-${time}`
|
|
22003
22062
|
);
|
|
@@ -30523,6 +30582,9 @@ var init_MathCanvas = __esm({
|
|
|
30523
30582
|
showAxes = true,
|
|
30524
30583
|
showGrid = true,
|
|
30525
30584
|
gridStep = 1,
|
|
30585
|
+
backgroundColor,
|
|
30586
|
+
gridColor = "var(--color-border, #9ca3af)",
|
|
30587
|
+
axisColor = "var(--color-muted-foreground, #374151)",
|
|
30526
30588
|
showTickLabels = false,
|
|
30527
30589
|
showCurveLabels = false,
|
|
30528
30590
|
curves = [],
|
|
@@ -30577,11 +30639,11 @@ var init_MathCanvas = __esm({
|
|
|
30577
30639
|
if (showGrid) {
|
|
30578
30640
|
for (let x = Math.ceil(xMin / gridStep) * gridStep; x <= xMax; x += gridStep) {
|
|
30579
30641
|
const px = mapX(x);
|
|
30580
|
-
out.push({ type: "line", x1: px, y1: margin, x2: px, y2: height - margin, color:
|
|
30642
|
+
out.push({ type: "line", x1: px, y1: margin, x2: px, y2: height - margin, color: gridColor, opacity: 0.35, lineWidth: 1 });
|
|
30581
30643
|
}
|
|
30582
30644
|
for (let y = Math.ceil(yMin / gridStep) * gridStep; y <= yMax; y += gridStep) {
|
|
30583
30645
|
const py = mapY(y);
|
|
30584
|
-
out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color:
|
|
30646
|
+
out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color: gridColor, opacity: 0.35, lineWidth: 1 });
|
|
30585
30647
|
}
|
|
30586
30648
|
}
|
|
30587
30649
|
if (showTickLabels) {
|
|
@@ -30652,8 +30714,8 @@ var init_MathCanvas = __esm({
|
|
|
30652
30714
|
});
|
|
30653
30715
|
}
|
|
30654
30716
|
if (showAxes) {
|
|
30655
|
-
out.push({ type: "line", x1: margin, y1: xAxisY, x2: width - margin, y2: xAxisY, color:
|
|
30656
|
-
out.push({ type: "line", x1: yAxisX, y1: margin, x2: yAxisX, y2: height - margin, color:
|
|
30717
|
+
out.push({ type: "line", x1: margin, y1: xAxisY, x2: width - margin, y2: xAxisY, color: axisColor, lineWidth: 2 });
|
|
30718
|
+
out.push({ type: "line", x1: yAxisX, y1: margin, x2: yAxisX, y2: height - margin, color: axisColor, lineWidth: 2 });
|
|
30657
30719
|
}
|
|
30658
30720
|
for (const guide of guides) {
|
|
30659
30721
|
const color = guide.color ?? "#9ca3af";
|
|
@@ -30676,23 +30738,36 @@ var init_MathCanvas = __esm({
|
|
|
30676
30738
|
}
|
|
30677
30739
|
for (const curve of curves) {
|
|
30678
30740
|
if (!curve.samples || curve.samples.length < 2) continue;
|
|
30741
|
+
let d = "";
|
|
30742
|
+
let penDown = false;
|
|
30679
30743
|
let lastInRange;
|
|
30680
30744
|
for (let i = 1; i < curve.samples.length; i++) {
|
|
30681
30745
|
const a = curve.samples[i - 1];
|
|
30682
30746
|
const b = curve.samples[i];
|
|
30683
|
-
if (a.x < xMin
|
|
30684
|
-
|
|
30685
|
-
|
|
30686
|
-
|
|
30687
|
-
|
|
30688
|
-
|
|
30689
|
-
|
|
30690
|
-
|
|
30691
|
-
|
|
30692
|
-
|
|
30693
|
-
|
|
30694
|
-
|
|
30695
|
-
|
|
30747
|
+
if (a.x < xMin && b.x < xMin || a.x > xMax && b.x > xMax) {
|
|
30748
|
+
penDown = false;
|
|
30749
|
+
continue;
|
|
30750
|
+
}
|
|
30751
|
+
const clip = (p, q, xLim) => {
|
|
30752
|
+
const t = q.x === p.x ? 0 : (xLim - p.x) / (q.x - p.x);
|
|
30753
|
+
return { x: xLim, y: p.y + t * (q.y - p.y) };
|
|
30754
|
+
};
|
|
30755
|
+
const ca = a.x < xMin ? clip(a, b, xMin) : a.x > xMax ? clip(a, b, xMax) : a;
|
|
30756
|
+
const cb = b.x < xMin ? clip(a, b, xMin) : b.x > xMax ? clip(a, b, xMax) : b;
|
|
30757
|
+
const pax = mapX(ca.x);
|
|
30758
|
+
const pay = mapY(ca.y);
|
|
30759
|
+
d += `${penDown ? "L" : "M"} ${pax} ${pay} L ${mapX(cb.x)} ${mapY(cb.y)} `;
|
|
30760
|
+
penDown = true;
|
|
30761
|
+
if (b.x >= xMin && b.x <= xMax) lastInRange = b;
|
|
30762
|
+
}
|
|
30763
|
+
if (!d) continue;
|
|
30764
|
+
out.push({
|
|
30765
|
+
type: "path",
|
|
30766
|
+
path: d,
|
|
30767
|
+
color: curve.color ?? "#2563eb",
|
|
30768
|
+
lineWidth: 2,
|
|
30769
|
+
dash: curve.dash
|
|
30770
|
+
});
|
|
30696
30771
|
if (showCurveLabels && curve.label && lastInRange) {
|
|
30697
30772
|
out.push({
|
|
30698
30773
|
type: "text",
|
|
@@ -30807,6 +30882,8 @@ var init_MathCanvas = __esm({
|
|
|
30807
30882
|
showAxes,
|
|
30808
30883
|
showGrid,
|
|
30809
30884
|
gridStep,
|
|
30885
|
+
gridColor,
|
|
30886
|
+
axisColor,
|
|
30810
30887
|
showTickLabels,
|
|
30811
30888
|
showCurveLabels,
|
|
30812
30889
|
curves,
|
|
@@ -30826,6 +30903,7 @@ var init_MathCanvas = __esm({
|
|
|
30826
30903
|
{
|
|
30827
30904
|
width,
|
|
30828
30905
|
height,
|
|
30906
|
+
backgroundColor,
|
|
30829
30907
|
shapes: derivedShapes,
|
|
30830
30908
|
readouts,
|
|
30831
30909
|
traces,
|
|
@@ -32056,13 +32134,13 @@ var init_MapView = __esm({
|
|
|
32056
32134
|
shadowSize: [41, 41]
|
|
32057
32135
|
});
|
|
32058
32136
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32059
|
-
const { useEffect:
|
|
32137
|
+
const { useEffect: useEffect67, useRef: useRef64, useCallback: useCallback97, useState: useState95 } = React87__namespace.default;
|
|
32060
32138
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32061
32139
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32062
32140
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32063
32141
|
const map = useMap();
|
|
32064
32142
|
const prevRef = useRef64({ centerLat, centerLng, zoom });
|
|
32065
|
-
|
|
32143
|
+
useEffect67(() => {
|
|
32066
32144
|
const prev = prevRef.current;
|
|
32067
32145
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32068
32146
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32073,7 +32151,7 @@ var init_MapView = __esm({
|
|
|
32073
32151
|
}
|
|
32074
32152
|
function MapClickHandler({ onMapClick }) {
|
|
32075
32153
|
const map = useMap();
|
|
32076
|
-
|
|
32154
|
+
useEffect67(() => {
|
|
32077
32155
|
if (!onMapClick) return;
|
|
32078
32156
|
const handler = (e) => {
|
|
32079
32157
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -32602,14 +32680,34 @@ var init_UploadDropZone = __esm({
|
|
|
32602
32680
|
if (valid.length > 0) {
|
|
32603
32681
|
onFiles?.(valid);
|
|
32604
32682
|
if (action) {
|
|
32605
|
-
|
|
32606
|
-
|
|
32607
|
-
|
|
32683
|
+
void Promise.all(
|
|
32684
|
+
valid.map(
|
|
32685
|
+
(f3) => new Promise(
|
|
32686
|
+
(resolvePayload, rejectPayload) => {
|
|
32687
|
+
const reader = new FileReader();
|
|
32688
|
+
reader.onload = () => resolvePayload({
|
|
32689
|
+
name: f3.name,
|
|
32690
|
+
size: f3.size,
|
|
32691
|
+
type: f3.type,
|
|
32692
|
+
content: String(reader.result ?? "")
|
|
32693
|
+
});
|
|
32694
|
+
reader.onerror = () => rejectPayload(reader.error);
|
|
32695
|
+
reader.readAsDataURL(f3);
|
|
32696
|
+
}
|
|
32697
|
+
)
|
|
32698
|
+
)
|
|
32699
|
+
).then((payloadFiles) => {
|
|
32700
|
+
eventBus.emit(`UI:${action}`, {
|
|
32701
|
+
...actionPayload,
|
|
32702
|
+
files: payloadFiles
|
|
32703
|
+
});
|
|
32704
|
+
}).catch(() => {
|
|
32705
|
+
setError(t("Could not read the selected file"));
|
|
32608
32706
|
});
|
|
32609
32707
|
}
|
|
32610
32708
|
}
|
|
32611
32709
|
},
|
|
32612
|
-
[validateFiles, onFiles, action, actionPayload, eventBus]
|
|
32710
|
+
[validateFiles, onFiles, action, actionPayload, eventBus, t]
|
|
32613
32711
|
);
|
|
32614
32712
|
const handleDragOver = (e) => {
|
|
32615
32713
|
e.preventDefault();
|
|
@@ -42126,22 +42224,6 @@ var init_DataTable = __esm({
|
|
|
42126
42224
|
DataTable.displayName = "DataTable";
|
|
42127
42225
|
}
|
|
42128
42226
|
});
|
|
42129
|
-
function getFieldIcon(fieldName) {
|
|
42130
|
-
const name = fieldName.toLowerCase();
|
|
42131
|
-
if (name.includes("date") || name.includes("time")) return LucideIcons2.Calendar;
|
|
42132
|
-
if (name.includes("status")) return LucideIcons2.Tag;
|
|
42133
|
-
if (name.includes("priority")) return LucideIcons2.AlertCircle;
|
|
42134
|
-
if (name.includes("progress") || name.includes("percent")) return LucideIcons2.TrendingUp;
|
|
42135
|
-
if (name.includes("assignee") || name.includes("owner") || name.includes("user") || name.includes("member"))
|
|
42136
|
-
return LucideIcons2.User;
|
|
42137
|
-
if (name.includes("due")) return LucideIcons2.Clock;
|
|
42138
|
-
if (name.includes("complete")) return LucideIcons2.CheckCircle2;
|
|
42139
|
-
if (name.includes("budget") || name.includes("cost") || name.includes("price"))
|
|
42140
|
-
return LucideIcons2.DollarSign;
|
|
42141
|
-
if (name.includes("description") || name.includes("note") || name.includes("comment"))
|
|
42142
|
-
return LucideIcons2.FileText;
|
|
42143
|
-
return LucideIcons2.Package;
|
|
42144
|
-
}
|
|
42145
42227
|
function getBadgeVariant(fieldName, value) {
|
|
42146
42228
|
const name = fieldName.toLowerCase();
|
|
42147
42229
|
const val = String(value).toLowerCase();
|
|
@@ -42191,6 +42273,18 @@ function renderRichFieldValue(value, fieldName, fieldType, meta) {
|
|
|
42191
42273
|
}
|
|
42192
42274
|
) });
|
|
42193
42275
|
}
|
|
42276
|
+
if (fieldType === "url" && /^https?:\/\//i.test(str)) {
|
|
42277
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42278
|
+
"a",
|
|
42279
|
+
{
|
|
42280
|
+
href: str,
|
|
42281
|
+
target: "_blank",
|
|
42282
|
+
rel: "noreferrer",
|
|
42283
|
+
className: "text-primary hover:underline break-all",
|
|
42284
|
+
children: str
|
|
42285
|
+
}
|
|
42286
|
+
);
|
|
42287
|
+
}
|
|
42194
42288
|
return str;
|
|
42195
42289
|
}
|
|
42196
42290
|
case "markdown":
|
|
@@ -42289,6 +42383,23 @@ function renderRichFieldValue(value, fieldName, fieldType, meta) {
|
|
|
42289
42383
|
}
|
|
42290
42384
|
return str;
|
|
42291
42385
|
}
|
|
42386
|
+
case "boolean": {
|
|
42387
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
42388
|
+
if (str === "true") return "Yes";
|
|
42389
|
+
if (str === "false") return "No";
|
|
42390
|
+
return str;
|
|
42391
|
+
}
|
|
42392
|
+
case "array": {
|
|
42393
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
42394
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", wrap: true, children: value.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", children: String(item) }, i)) });
|
|
42395
|
+
}
|
|
42396
|
+
if (Array.isArray(value)) return "\u2014";
|
|
42397
|
+
return str;
|
|
42398
|
+
}
|
|
42399
|
+
case "email":
|
|
42400
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${str}`, className: "text-primary hover:underline break-all", children: str });
|
|
42401
|
+
case "phone":
|
|
42402
|
+
return /* @__PURE__ */ jsxRuntime.jsx("a", { href: `tel:${str}`, className: "text-primary hover:underline", children: str });
|
|
42292
42403
|
default:
|
|
42293
42404
|
if (meta?.values && meta.values.length > 0 && meta.values.includes(str)) {
|
|
42294
42405
|
return /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getBadgeVariant(fieldName, str), children: humanizeEnumValue(str) });
|
|
@@ -42361,10 +42472,11 @@ var init_DetailPanel = __esm({
|
|
|
42361
42472
|
avatar,
|
|
42362
42473
|
sections: propSections,
|
|
42363
42474
|
actions,
|
|
42364
|
-
maxInlineActions,
|
|
42475
|
+
maxInlineActions = 2,
|
|
42365
42476
|
backAction,
|
|
42366
42477
|
footer,
|
|
42367
42478
|
slideOver = false,
|
|
42479
|
+
showActions = true,
|
|
42368
42480
|
className,
|
|
42369
42481
|
entity,
|
|
42370
42482
|
fields: propFields,
|
|
@@ -42412,9 +42524,6 @@ var init_DetailPanel = __esm({
|
|
|
42412
42524
|
},
|
|
42413
42525
|
[eventBus]
|
|
42414
42526
|
);
|
|
42415
|
-
const handleClose = React87.useCallback(() => {
|
|
42416
|
-
eventBus.emit("UI:CLOSE", {});
|
|
42417
|
-
}, [eventBus]);
|
|
42418
42527
|
const entityRecord = Array.isArray(entity) ? entity[0] : entity;
|
|
42419
42528
|
const data = entityRecord ?? initialData;
|
|
42420
42529
|
let title = propTitle;
|
|
@@ -42428,8 +42537,7 @@ var init_DetailPanel = __esm({
|
|
|
42428
42537
|
const value = getNestedValue(normalizedData, field);
|
|
42429
42538
|
return {
|
|
42430
42539
|
label: labelFor(field),
|
|
42431
|
-
value: formatFieldValue2(value, field)
|
|
42432
|
-
icon: getFieldIcon(field)
|
|
42540
|
+
value: formatFieldValue2(value, field)
|
|
42433
42541
|
};
|
|
42434
42542
|
}
|
|
42435
42543
|
return field;
|
|
@@ -42463,15 +42571,14 @@ var init_DetailPanel = __esm({
|
|
|
42463
42571
|
(f3) => (!titleDerivedFromPrimary || f3 !== primaryField) && !statusFields.includes(f3) && !progressFields.includes(f3) && !metricFields.includes(f3) && !dateFields.includes(f3) && !descriptionFields.includes(f3)
|
|
42464
42572
|
);
|
|
42465
42573
|
sections = [];
|
|
42466
|
-
if (
|
|
42574
|
+
if (otherFields.length > 0) {
|
|
42467
42575
|
const overviewFields = [];
|
|
42468
|
-
|
|
42576
|
+
otherFields.forEach((field) => {
|
|
42469
42577
|
const value = getNestedValue(normalizedData, field);
|
|
42470
42578
|
if (value !== void 0 && value !== null) {
|
|
42471
42579
|
overviewFields.push({
|
|
42472
42580
|
label: labelFor(field),
|
|
42473
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42474
|
-
icon: getFieldIcon(field)
|
|
42581
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42475
42582
|
});
|
|
42476
42583
|
}
|
|
42477
42584
|
});
|
|
@@ -42486,8 +42593,7 @@ var init_DetailPanel = __esm({
|
|
|
42486
42593
|
if (value !== void 0 && value !== null) {
|
|
42487
42594
|
metricsFields.push({
|
|
42488
42595
|
label: labelFor(field),
|
|
42489
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42490
|
-
icon: getFieldIcon(field)
|
|
42596
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42491
42597
|
});
|
|
42492
42598
|
}
|
|
42493
42599
|
});
|
|
@@ -42502,8 +42608,7 @@ var init_DetailPanel = __esm({
|
|
|
42502
42608
|
if (value !== void 0 && value !== null) {
|
|
42503
42609
|
timelineFields.push({
|
|
42504
42610
|
label: labelFor(field),
|
|
42505
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42506
|
-
icon: getFieldIcon(field)
|
|
42611
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42507
42612
|
});
|
|
42508
42613
|
}
|
|
42509
42614
|
});
|
|
@@ -42518,8 +42623,7 @@ var init_DetailPanel = __esm({
|
|
|
42518
42623
|
if (value !== void 0 && value !== null) {
|
|
42519
42624
|
descFields.push({
|
|
42520
42625
|
label: labelFor(field),
|
|
42521
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42522
|
-
icon: getFieldIcon(field)
|
|
42626
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42523
42627
|
});
|
|
42524
42628
|
}
|
|
42525
42629
|
});
|
|
@@ -42528,6 +42632,15 @@ var init_DetailPanel = __esm({
|
|
|
42528
42632
|
}
|
|
42529
42633
|
}
|
|
42530
42634
|
}
|
|
42635
|
+
const renderSlot = providers.useRenderSlot();
|
|
42636
|
+
const navStack = providers.useNavStack();
|
|
42637
|
+
const { setCurrentLabel } = navStack;
|
|
42638
|
+
const resolvedTitle = normalizedData ? title : void 0;
|
|
42639
|
+
React87.useEffect(() => {
|
|
42640
|
+
if (renderSlot === "main" && !slideOver && resolvedTitle) {
|
|
42641
|
+
setCurrentLabel(resolvedTitle);
|
|
42642
|
+
}
|
|
42643
|
+
}, [renderSlot, slideOver, resolvedTitle, setCurrentLabel]);
|
|
42531
42644
|
if (isLoading) {
|
|
42532
42645
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42533
42646
|
LoadingState,
|
|
@@ -42566,8 +42679,7 @@ var init_DetailPanel = __esm({
|
|
|
42566
42679
|
const value = normalizedData ? getNestedValue(normalizedData, field) : void 0;
|
|
42567
42680
|
allFields.push({
|
|
42568
42681
|
label: labelFor(field),
|
|
42569
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42570
|
-
icon: getFieldIcon(field)
|
|
42682
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field))
|
|
42571
42683
|
});
|
|
42572
42684
|
} else {
|
|
42573
42685
|
allFields.push(field);
|
|
@@ -42579,24 +42691,50 @@ var init_DetailPanel = __esm({
|
|
|
42579
42691
|
(a) => a.event === "CLOSE" || a.event === "CANCEL" || a.label?.toLowerCase() === "close"
|
|
42580
42692
|
);
|
|
42581
42693
|
const otherActions = actions?.filter((a) => a !== closeAction) ?? [];
|
|
42582
|
-
const
|
|
42583
|
-
|
|
42584
|
-
|
|
42585
|
-
|
|
42586
|
-
|
|
42694
|
+
const statusBadges = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
42695
|
+
normalizedData && effectiveFieldNames && effectiveFieldNames.filter(
|
|
42696
|
+
(f3) => f3.toLowerCase().includes("status") || f3.toLowerCase().includes("priority")
|
|
42697
|
+
).map((field) => {
|
|
42698
|
+
const value = getNestedValue(normalizedData, field);
|
|
42699
|
+
if (!value) return null;
|
|
42700
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42701
|
+
Badge,
|
|
42587
42702
|
{
|
|
42588
|
-
variant:
|
|
42589
|
-
|
|
42590
|
-
|
|
42591
|
-
|
|
42592
|
-
|
|
42593
|
-
|
|
42594
|
-
|
|
42595
|
-
|
|
42596
|
-
|
|
42597
|
-
|
|
42598
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, {
|
|
42599
|
-
|
|
42703
|
+
variant: getBadgeVariant(field, String(value)),
|
|
42704
|
+
children: humanizeEnumValue(String(value))
|
|
42705
|
+
},
|
|
42706
|
+
field
|
|
42707
|
+
);
|
|
42708
|
+
}),
|
|
42709
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: status.variant ?? "default", children: status.label })
|
|
42710
|
+
] });
|
|
42711
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx(Card, { variant: "elevated", children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "md", className: "p-6", children: [
|
|
42712
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "between", align: "start", gap: "md", children: [
|
|
42713
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "start", gap: "sm", className: "min-w-0", children: [
|
|
42714
|
+
backAction && /* @__PURE__ */ jsxRuntime.jsx(
|
|
42715
|
+
Button,
|
|
42716
|
+
{
|
|
42717
|
+
variant: backAction.variant || "ghost",
|
|
42718
|
+
size: "sm",
|
|
42719
|
+
action: backAction.navigatesTo ? void 0 : backAction.event,
|
|
42720
|
+
actionPayload: { row: normalizedData },
|
|
42721
|
+
onClick: backAction.navigatesTo ? () => handleActionClick(backAction, normalizedData) : void 0,
|
|
42722
|
+
icon: backAction.icon ?? LucideIcons2.ArrowLeft,
|
|
42723
|
+
"data-testid": backAction.event ? `action-${backAction.event}` : "action-back",
|
|
42724
|
+
children: backAction.label
|
|
42725
|
+
}
|
|
42726
|
+
),
|
|
42727
|
+
avatar,
|
|
42728
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "min-w-0", children: [
|
|
42729
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "center", gap: "sm", wrap: true, children: [
|
|
42730
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h2", weight: "bold", children: title || "Details" }),
|
|
42731
|
+
statusBadges
|
|
42732
|
+
] }),
|
|
42733
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: subtitle })
|
|
42734
|
+
] })
|
|
42735
|
+
] }),
|
|
42736
|
+
showActions && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { justify: "end", align: "center", gap: "xs", className: "shrink-0", children: [
|
|
42737
|
+
otherActions.slice(0, maxInlineActions).map((action, idx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
42600
42738
|
Button,
|
|
42601
42739
|
{
|
|
42602
42740
|
variant: action.variant || "secondary",
|
|
@@ -42611,7 +42749,7 @@ var init_DetailPanel = __esm({
|
|
|
42611
42749
|
},
|
|
42612
42750
|
idx
|
|
42613
42751
|
)),
|
|
42614
|
-
|
|
42752
|
+
otherActions.length > maxInlineActions && /* @__PURE__ */ jsxRuntime.jsx(
|
|
42615
42753
|
Menu,
|
|
42616
42754
|
{
|
|
42617
42755
|
position: "bottom-end",
|
|
@@ -42627,40 +42765,20 @@ var init_DetailPanel = __esm({
|
|
|
42627
42765
|
}))
|
|
42628
42766
|
}
|
|
42629
42767
|
),
|
|
42630
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
42768
|
+
closeAction && /* @__PURE__ */ jsxRuntime.jsx(
|
|
42631
42769
|
Button,
|
|
42632
42770
|
{
|
|
42633
42771
|
variant: "ghost",
|
|
42634
42772
|
size: "sm",
|
|
42635
|
-
action:
|
|
42773
|
+
action: closeAction.event,
|
|
42636
42774
|
actionPayload: { row: normalizedData },
|
|
42637
|
-
onClick:
|
|
42775
|
+
onClick: closeAction.event ? void 0 : () => handleActionClick(closeAction, normalizedData),
|
|
42638
42776
|
icon: LucideIcons2.X,
|
|
42639
|
-
"data-testid":
|
|
42777
|
+
"data-testid": closeAction.event ? `action-${closeAction.event}` : "action-close"
|
|
42640
42778
|
}
|
|
42641
42779
|
)
|
|
42642
42780
|
] })
|
|
42643
42781
|
] }),
|
|
42644
|
-
avatar,
|
|
42645
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h2", weight: "bold", children: title || "Details" }),
|
|
42646
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: subtitle }),
|
|
42647
|
-
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", wrap: true, children: [
|
|
42648
|
-
normalizedData && effectiveFieldNames && effectiveFieldNames.filter(
|
|
42649
|
-
(f3) => f3.toLowerCase().includes("status") || f3.toLowerCase().includes("priority")
|
|
42650
|
-
).map((field) => {
|
|
42651
|
-
const value = getNestedValue(normalizedData, field);
|
|
42652
|
-
if (!value) return null;
|
|
42653
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
42654
|
-
Badge,
|
|
42655
|
-
{
|
|
42656
|
-
variant: getBadgeVariant(field, String(value)),
|
|
42657
|
-
children: String(value)
|
|
42658
|
-
},
|
|
42659
|
-
field
|
|
42660
|
-
);
|
|
42661
|
-
}),
|
|
42662
|
-
status && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: status.variant ?? "default", children: status.label })
|
|
42663
|
-
] }),
|
|
42664
42782
|
normalizedData && effectiveFieldNames && effectiveFieldNames.filter(
|
|
42665
42783
|
(f3) => f3.toLowerCase().includes("progress") || f3.toLowerCase().includes("percent")
|
|
42666
42784
|
).map((field) => {
|
|
@@ -42693,9 +42811,10 @@ var init_DetailPanel = __esm({
|
|
|
42693
42811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
42694
42812
|
Typography,
|
|
42695
42813
|
{
|
|
42696
|
-
variant: "
|
|
42697
|
-
color: "
|
|
42814
|
+
variant: "caption",
|
|
42815
|
+
color: "muted",
|
|
42698
42816
|
weight: "medium",
|
|
42817
|
+
className: "uppercase tracking-wider",
|
|
42699
42818
|
children: field.label
|
|
42700
42819
|
}
|
|
42701
42820
|
),
|
|
@@ -42764,7 +42883,7 @@ var init_DrawerSlot = __esm({
|
|
|
42764
42883
|
position,
|
|
42765
42884
|
width: size,
|
|
42766
42885
|
className,
|
|
42767
|
-
children
|
|
42886
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(providers.RenderSlotProvider, { slot: "drawer", children })
|
|
42768
42887
|
}
|
|
42769
42888
|
);
|
|
42770
42889
|
};
|
|
@@ -44811,7 +44930,7 @@ var init_ModalSlot = __esm({
|
|
|
44811
44930
|
title,
|
|
44812
44931
|
size,
|
|
44813
44932
|
className,
|
|
44814
|
-
children
|
|
44933
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(providers.RenderSlotProvider, { slot: "modal", children })
|
|
44815
44934
|
}
|
|
44816
44935
|
);
|
|
44817
44936
|
};
|
|
@@ -49214,7 +49333,10 @@ function MaybeTraitScope({
|
|
|
49214
49333
|
}
|
|
49215
49334
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
49216
49335
|
}
|
|
49217
|
-
function UISlotComponent({
|
|
49336
|
+
function UISlotComponent(props) {
|
|
49337
|
+
return /* @__PURE__ */ jsxRuntime.jsx(providers.RenderSlotProvider, { slot: props.slot, children: /* @__PURE__ */ jsxRuntime.jsx(UISlotComponentInner, { ...props }) });
|
|
49338
|
+
}
|
|
49339
|
+
function UISlotComponentInner({
|
|
49218
49340
|
slot,
|
|
49219
49341
|
portal = false,
|
|
49220
49342
|
position,
|
|
@@ -50783,6 +50905,12 @@ var CurrentPagePathProvider = ({
|
|
|
50783
50905
|
}) => /* @__PURE__ */ jsxRuntime.jsx(CurrentPagePathContext.Provider, { value, children });
|
|
50784
50906
|
CurrentPagePathProvider.displayName = "CurrentPagePathProvider";
|
|
50785
50907
|
var useCurrentPagePath2 = () => React87.useContext(CurrentPagePathContext);
|
|
50908
|
+
var RenderSlotContext = React87.createContext("main");
|
|
50909
|
+
var RenderSlotProvider4 = ({ slot, children }) => /* @__PURE__ */ jsxRuntime.jsx(RenderSlotContext.Provider, { value: slot, children });
|
|
50910
|
+
RenderSlotProvider4.displayName = "RenderSlotProvider";
|
|
50911
|
+
function useRenderSlot2() {
|
|
50912
|
+
return React87.useContext(RenderSlotContext);
|
|
50913
|
+
}
|
|
50786
50914
|
var EntitySchemaContext = React87.createContext(null);
|
|
50787
50915
|
function EntitySchemaProvider({
|
|
50788
50916
|
entities,
|
|
@@ -51573,6 +51701,18 @@ function syncNavStack(state, pages, path, pending) {
|
|
|
51573
51701
|
}
|
|
51574
51702
|
return { state: { ...state, [page.orbital]: stack }, orbital: page.orbital };
|
|
51575
51703
|
}
|
|
51704
|
+
function relabelCurrent(state, pages, path, label) {
|
|
51705
|
+
const normalized = normalizePath(path);
|
|
51706
|
+
const page = matchNavPage(pages, normalized);
|
|
51707
|
+
if (!page || !label) return state;
|
|
51708
|
+
const stack = state[page.orbital];
|
|
51709
|
+
if (!stack || stack.length === 0) return state;
|
|
51710
|
+
const idx = stack.findIndex((e) => e.href === normalized);
|
|
51711
|
+
if (idx < 0 || stack[idx].label === label) return state;
|
|
51712
|
+
const next = [...stack];
|
|
51713
|
+
next[idx] = { href: normalized, label };
|
|
51714
|
+
return { ...state, [page.orbital]: next };
|
|
51715
|
+
}
|
|
51576
51716
|
function previousEntry(state, pages, path) {
|
|
51577
51717
|
const page = matchNavPage(pages, normalizePath(path));
|
|
51578
51718
|
if (!page) return null;
|
|
@@ -51589,10 +51729,11 @@ var INERT_API = {
|
|
|
51589
51729
|
canGoBack: false,
|
|
51590
51730
|
beginNavigate: () => void 0,
|
|
51591
51731
|
back: () => void 0,
|
|
51592
|
-
goTo: () => void 0
|
|
51732
|
+
goTo: () => void 0,
|
|
51733
|
+
setCurrentLabel: () => void 0
|
|
51593
51734
|
};
|
|
51594
51735
|
var NavStackContext = React87.createContext(INERT_API);
|
|
51595
|
-
function
|
|
51736
|
+
function useNavStack3() {
|
|
51596
51737
|
return React87.useContext(NavStackContext);
|
|
51597
51738
|
}
|
|
51598
51739
|
function loadStored(storageKey) {
|
|
@@ -51649,6 +51790,16 @@ var NavStackProvider = ({
|
|
|
51649
51790
|
},
|
|
51650
51791
|
[navigate]
|
|
51651
51792
|
);
|
|
51793
|
+
const setCurrentLabel = React87.useCallback(
|
|
51794
|
+
(label) => {
|
|
51795
|
+
setState((prev) => {
|
|
51796
|
+
const next = relabelCurrent(prev, pages, currentPath, label);
|
|
51797
|
+
if (next !== prev) persistStored(storageKey, next);
|
|
51798
|
+
return next;
|
|
51799
|
+
});
|
|
51800
|
+
},
|
|
51801
|
+
[pages, currentPath, storageKey]
|
|
51802
|
+
);
|
|
51652
51803
|
const entries = React87.useMemo(
|
|
51653
51804
|
() => entriesFor(state, pages, currentPath),
|
|
51654
51805
|
[state, pages, currentPath]
|
|
@@ -51659,9 +51810,10 @@ var NavStackProvider = ({
|
|
|
51659
51810
|
canGoBack: previousEntry(state, pages, currentPath) !== null,
|
|
51660
51811
|
beginNavigate,
|
|
51661
51812
|
back,
|
|
51662
|
-
goTo
|
|
51813
|
+
goTo,
|
|
51814
|
+
setCurrentLabel
|
|
51663
51815
|
}),
|
|
51664
|
-
[entries, state, pages, currentPath, beginNavigate, back, goTo]
|
|
51816
|
+
[entries, state, pages, currentPath, beginNavigate, back, goTo, setCurrentLabel]
|
|
51665
51817
|
);
|
|
51666
51818
|
return /* @__PURE__ */ jsxRuntime.jsx(NavStackContext.Provider, { value: api, children });
|
|
51667
51819
|
};
|
|
@@ -51718,6 +51870,7 @@ exports.NavigationProvider = NavigationProvider2;
|
|
|
51718
51870
|
exports.OfflineModeProvider = OfflineModeProvider;
|
|
51719
51871
|
exports.OrbitalProvider = OrbitalProvider;
|
|
51720
51872
|
exports.OrbitalThemeProvider = OrbitalThemeProvider;
|
|
51873
|
+
exports.RenderSlotProvider = RenderSlotProvider4;
|
|
51721
51874
|
exports.SelectionContext = SelectionContext;
|
|
51722
51875
|
exports.SelectionProvider = SelectionProvider;
|
|
51723
51876
|
exports.ServerBridgeProvider = ServerBridgeProvider;
|
|
@@ -51746,13 +51899,14 @@ exports.useGameAudioContextOptional = useGameAudioContextOptional2;
|
|
|
51746
51899
|
exports.useHasPermission = useHasPermission;
|
|
51747
51900
|
exports.useHasRole = useHasRole;
|
|
51748
51901
|
exports.useInitPayload = useInitPayload2;
|
|
51749
|
-
exports.useNavStack =
|
|
51902
|
+
exports.useNavStack = useNavStack3;
|
|
51750
51903
|
exports.useNavigateTo = useNavigateTo2;
|
|
51751
51904
|
exports.useNavigation = useNavigation2;
|
|
51752
51905
|
exports.useNavigationId = useNavigationId2;
|
|
51753
51906
|
exports.useNavigationState = useNavigationState2;
|
|
51754
51907
|
exports.useOfflineMode = useOfflineMode;
|
|
51755
51908
|
exports.useOptionalOfflineMode = useOptionalOfflineMode;
|
|
51909
|
+
exports.useRenderSlot = useRenderSlot2;
|
|
51756
51910
|
exports.useSelection = useSelection;
|
|
51757
51911
|
exports.useSelectionOptional = useSelectionOptional;
|
|
51758
51912
|
exports.useServerBridge = useServerBridge;
|