@almadar/ui 5.132.0 → 5.134.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 +1735 -1364
- package/dist/avl/index.js +793 -422
- package/dist/components/index.cjs +580 -199
- package/dist/components/index.d.cts +227 -4
- package/dist/components/index.d.ts +227 -4
- package/dist/components/index.js +576 -200
- package/dist/lib/drawable/three/index.cjs +53 -1
- package/dist/lib/drawable/three/index.js +53 -1
- package/dist/lib/index.cjs +57 -0
- package/dist/lib/index.d.cts +30 -1
- package/dist/lib/index.d.ts +30 -1
- package/dist/lib/index.js +52 -1
- package/dist/marketing/index.cjs +53 -1
- package/dist/marketing/index.d.cts +6 -0
- package/dist/marketing/index.d.ts +6 -0
- package/dist/marketing/index.js +53 -1
- package/dist/providers/index.cjs +1616 -1245
- package/dist/providers/index.js +768 -397
- package/dist/runtime/index.cjs +1596 -1225
- package/dist/runtime/index.js +773 -402
- package/package.json +4 -4
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React85 from 'react';
|
|
2
|
+
import React85__default, { createContext, useContext, useMemo, useRef, useEffect, useCallback, Suspense, useState, useLayoutEffect, lazy, useId, useSyncExternalStore } from 'react';
|
|
3
3
|
import { EventBusContext, useTraitScopeChain, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
|
|
4
4
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
@@ -430,7 +430,7 @@ var init_Box = __esm({
|
|
|
430
430
|
fixed: "fixed",
|
|
431
431
|
sticky: "sticky"
|
|
432
432
|
};
|
|
433
|
-
Box =
|
|
433
|
+
Box = React85__default.forwardRef(
|
|
434
434
|
({
|
|
435
435
|
padding,
|
|
436
436
|
paddingX,
|
|
@@ -495,7 +495,7 @@ var init_Box = __esm({
|
|
|
495
495
|
onPointerDown?.(e);
|
|
496
496
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
497
497
|
const isClickable = action || onClick;
|
|
498
|
-
return
|
|
498
|
+
return React85__default.createElement(
|
|
499
499
|
Component,
|
|
500
500
|
{
|
|
501
501
|
ref,
|
|
@@ -712,7 +712,7 @@ var init_Icon = __esm({
|
|
|
712
712
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
713
713
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
714
714
|
const family = useIconFamily();
|
|
715
|
-
const RenderedComponent =
|
|
715
|
+
const RenderedComponent = React85__default.useMemo(() => {
|
|
716
716
|
if (directIcon) return null;
|
|
717
717
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
718
718
|
}, [directIcon, effectiveName, family]);
|
|
@@ -832,7 +832,7 @@ var init_atlasSlice = __esm({
|
|
|
832
832
|
}
|
|
833
833
|
});
|
|
834
834
|
function useAtlasSliceDataUrl(asset) {
|
|
835
|
-
const [, bump] =
|
|
835
|
+
const [, bump] = React85.useReducer((x) => x + 1, 0);
|
|
836
836
|
if (!isAtlasAsset(asset)) return void 0;
|
|
837
837
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
838
838
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -895,13 +895,13 @@ function AtlasImage({
|
|
|
895
895
|
style,
|
|
896
896
|
"aria-hidden": ariaHidden
|
|
897
897
|
}) {
|
|
898
|
-
const [, bump] =
|
|
899
|
-
const canvasRef =
|
|
898
|
+
const [, bump] = React85.useReducer((x) => x + 1, 0);
|
|
899
|
+
const canvasRef = React85.useRef(null);
|
|
900
900
|
const sliced = isAtlasAsset(asset);
|
|
901
901
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
902
902
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
903
903
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
904
|
-
|
|
904
|
+
React85.useEffect(() => {
|
|
905
905
|
const canvas = canvasRef.current;
|
|
906
906
|
if (!canvas || !img || !rect) return;
|
|
907
907
|
canvas.width = rect.sw;
|
|
@@ -977,7 +977,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
977
977
|
const IconComp = value;
|
|
978
978
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
979
979
|
}
|
|
980
|
-
if (
|
|
980
|
+
if (React85__default.isValidElement(value)) {
|
|
981
981
|
return value;
|
|
982
982
|
}
|
|
983
983
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -1054,7 +1054,7 @@ var init_Button = __esm({
|
|
|
1054
1054
|
md: "h-icon-default w-icon-default",
|
|
1055
1055
|
lg: "h-icon-default w-icon-default"
|
|
1056
1056
|
};
|
|
1057
|
-
Button =
|
|
1057
|
+
Button = React85__default.forwardRef(
|
|
1058
1058
|
({
|
|
1059
1059
|
className,
|
|
1060
1060
|
variant = "primary",
|
|
@@ -1124,7 +1124,7 @@ var Dialog;
|
|
|
1124
1124
|
var init_Dialog = __esm({
|
|
1125
1125
|
"components/core/atoms/Dialog.tsx"() {
|
|
1126
1126
|
init_cn();
|
|
1127
|
-
Dialog =
|
|
1127
|
+
Dialog = React85__default.forwardRef(
|
|
1128
1128
|
({
|
|
1129
1129
|
role = "dialog",
|
|
1130
1130
|
"aria-modal": ariaModal = true,
|
|
@@ -1147,6 +1147,61 @@ var init_Dialog = __esm({
|
|
|
1147
1147
|
}
|
|
1148
1148
|
});
|
|
1149
1149
|
|
|
1150
|
+
// lib/format.ts
|
|
1151
|
+
function humanizeFieldName(name) {
|
|
1152
|
+
return name.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/\b([A-Z])([A-Z]+)\b/g, (_, first, rest) => first + rest.toLowerCase()).trim();
|
|
1153
|
+
}
|
|
1154
|
+
function humanizeEnumValue(value) {
|
|
1155
|
+
return /^[a-z0-9]+(?:[_-][a-z0-9]+)+$/.test(value) ? humanizeFieldName(value) : value;
|
|
1156
|
+
}
|
|
1157
|
+
function formatDate(value) {
|
|
1158
|
+
if (!value) return "";
|
|
1159
|
+
const d = new Date(String(value));
|
|
1160
|
+
if (isNaN(d.getTime())) return String(value);
|
|
1161
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
1162
|
+
}
|
|
1163
|
+
function formatTime(value) {
|
|
1164
|
+
if (!value) return "";
|
|
1165
|
+
const d = new Date(String(value));
|
|
1166
|
+
if (isNaN(d.getTime())) return String(value);
|
|
1167
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
1168
|
+
}
|
|
1169
|
+
function formatDateTime(value) {
|
|
1170
|
+
if (!value) return "";
|
|
1171
|
+
const d = new Date(String(value));
|
|
1172
|
+
if (isNaN(d.getTime())) return String(value);
|
|
1173
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
1174
|
+
}
|
|
1175
|
+
function asYesNo(value) {
|
|
1176
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
1177
|
+
}
|
|
1178
|
+
function formatValue(value, format) {
|
|
1179
|
+
if (value === void 0 || value === null) return "";
|
|
1180
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
1181
|
+
switch (format) {
|
|
1182
|
+
case "date":
|
|
1183
|
+
return formatDate(value);
|
|
1184
|
+
case "time":
|
|
1185
|
+
return formatTime(value);
|
|
1186
|
+
case "datetime":
|
|
1187
|
+
return formatDateTime(value);
|
|
1188
|
+
case "currency":
|
|
1189
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
1190
|
+
case "number":
|
|
1191
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
1192
|
+
case "percent":
|
|
1193
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
1194
|
+
case "boolean":
|
|
1195
|
+
return asYesNo(value);
|
|
1196
|
+
default:
|
|
1197
|
+
return String(value);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
var init_format = __esm({
|
|
1201
|
+
"lib/format.ts"() {
|
|
1202
|
+
}
|
|
1203
|
+
});
|
|
1204
|
+
|
|
1150
1205
|
// components/core/atoms/Typography.tsx
|
|
1151
1206
|
var Typography_exports = {};
|
|
1152
1207
|
__export(Typography_exports, {
|
|
@@ -1156,6 +1211,7 @@ var variantStyles2, colorStyles, weightStyles, defaultElements, typographySizeSt
|
|
|
1156
1211
|
var init_Typography = __esm({
|
|
1157
1212
|
"components/core/atoms/Typography.tsx"() {
|
|
1158
1213
|
init_cn();
|
|
1214
|
+
init_format();
|
|
1159
1215
|
variantStyles2 = {
|
|
1160
1216
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
1161
1217
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -1243,12 +1299,17 @@ var init_Typography = __esm({
|
|
|
1243
1299
|
id,
|
|
1244
1300
|
className,
|
|
1245
1301
|
style,
|
|
1302
|
+
format,
|
|
1246
1303
|
content,
|
|
1247
1304
|
children
|
|
1248
1305
|
}) => {
|
|
1249
1306
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
1250
1307
|
const Component = as || defaultElements[variant];
|
|
1251
|
-
|
|
1308
|
+
let body = children ?? content;
|
|
1309
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
1310
|
+
body = formatValue(body, format);
|
|
1311
|
+
}
|
|
1312
|
+
return React85__default.createElement(
|
|
1252
1313
|
Component,
|
|
1253
1314
|
{
|
|
1254
1315
|
id,
|
|
@@ -1264,7 +1325,7 @@ var init_Typography = __esm({
|
|
|
1264
1325
|
),
|
|
1265
1326
|
style
|
|
1266
1327
|
},
|
|
1267
|
-
|
|
1328
|
+
body
|
|
1268
1329
|
);
|
|
1269
1330
|
};
|
|
1270
1331
|
Typography.displayName = "Typography";
|
|
@@ -1811,7 +1872,7 @@ var init_Badge = __esm({
|
|
|
1811
1872
|
md: "px-2.5 py-1 text-sm",
|
|
1812
1873
|
lg: "px-3 py-1.5 text-base"
|
|
1813
1874
|
};
|
|
1814
|
-
Badge =
|
|
1875
|
+
Badge = React85__default.forwardRef(
|
|
1815
1876
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
1816
1877
|
const iconSizes3 = {
|
|
1817
1878
|
sm: "h-icon-default w-icon-default",
|
|
@@ -2161,7 +2222,7 @@ var init_SvgFlow = __esm({
|
|
|
2161
2222
|
width = 100,
|
|
2162
2223
|
height = 100
|
|
2163
2224
|
}) => {
|
|
2164
|
-
const markerId =
|
|
2225
|
+
const markerId = React85__default.useMemo(() => {
|
|
2165
2226
|
flowIdCounter += 1;
|
|
2166
2227
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
2167
2228
|
}, []);
|
|
@@ -2754,7 +2815,7 @@ var init_SvgRing = __esm({
|
|
|
2754
2815
|
width = 100,
|
|
2755
2816
|
height = 100
|
|
2756
2817
|
}) => {
|
|
2757
|
-
const gradientId =
|
|
2818
|
+
const gradientId = React85__default.useMemo(() => {
|
|
2758
2819
|
ringIdCounter += 1;
|
|
2759
2820
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
2760
2821
|
}, []);
|
|
@@ -2935,7 +2996,7 @@ var init_Input = __esm({
|
|
|
2935
2996
|
init_cn();
|
|
2936
2997
|
init_Icon();
|
|
2937
2998
|
init_useEventBus();
|
|
2938
|
-
Input =
|
|
2999
|
+
Input = React85__default.forwardRef(
|
|
2939
3000
|
({
|
|
2940
3001
|
className,
|
|
2941
3002
|
inputType,
|
|
@@ -3103,7 +3164,7 @@ var Label;
|
|
|
3103
3164
|
var init_Label = __esm({
|
|
3104
3165
|
"components/core/atoms/Label.tsx"() {
|
|
3105
3166
|
init_cn();
|
|
3106
|
-
Label =
|
|
3167
|
+
Label = React85__default.forwardRef(
|
|
3107
3168
|
({ className, required, children, ...props }, ref) => {
|
|
3108
3169
|
return /* @__PURE__ */ jsxs(
|
|
3109
3170
|
"label",
|
|
@@ -3130,7 +3191,7 @@ var init_Textarea = __esm({
|
|
|
3130
3191
|
"components/core/atoms/Textarea.tsx"() {
|
|
3131
3192
|
init_cn();
|
|
3132
3193
|
init_useEventBus();
|
|
3133
|
-
Textarea =
|
|
3194
|
+
Textarea = React85__default.forwardRef(
|
|
3134
3195
|
({ className, error, onChange, ...props }, ref) => {
|
|
3135
3196
|
const eventBus = useEventBus();
|
|
3136
3197
|
const handleChange = (e) => {
|
|
@@ -3369,7 +3430,7 @@ var init_Select = __esm({
|
|
|
3369
3430
|
init_cn();
|
|
3370
3431
|
init_Icon();
|
|
3371
3432
|
init_useEventBus();
|
|
3372
|
-
Select =
|
|
3433
|
+
Select = React85__default.forwardRef(
|
|
3373
3434
|
(props, _ref) => {
|
|
3374
3435
|
const { multiple, searchable, clearable } = props;
|
|
3375
3436
|
if (multiple || searchable || clearable) {
|
|
@@ -3386,7 +3447,7 @@ var init_Checkbox = __esm({
|
|
|
3386
3447
|
"components/core/atoms/Checkbox.tsx"() {
|
|
3387
3448
|
init_cn();
|
|
3388
3449
|
init_useEventBus();
|
|
3389
|
-
Checkbox =
|
|
3450
|
+
Checkbox = React85__default.forwardRef(
|
|
3390
3451
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
3391
3452
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
3392
3453
|
const eventBus = useEventBus();
|
|
@@ -3440,7 +3501,7 @@ var init_Spinner = __esm({
|
|
|
3440
3501
|
md: "h-6 w-6",
|
|
3441
3502
|
lg: "h-8 w-8"
|
|
3442
3503
|
};
|
|
3443
|
-
Spinner =
|
|
3504
|
+
Spinner = React85__default.forwardRef(
|
|
3444
3505
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
3445
3506
|
if (overlay) {
|
|
3446
3507
|
return /* @__PURE__ */ jsx(
|
|
@@ -3530,7 +3591,7 @@ var init_Card = __esm({
|
|
|
3530
3591
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
3531
3592
|
"tile-image-first": "p-0 overflow-hidden"
|
|
3532
3593
|
};
|
|
3533
|
-
Card =
|
|
3594
|
+
Card = React85__default.forwardRef(
|
|
3534
3595
|
({
|
|
3535
3596
|
className,
|
|
3536
3597
|
variant = "bordered",
|
|
@@ -3579,9 +3640,9 @@ var init_Card = __esm({
|
|
|
3579
3640
|
}
|
|
3580
3641
|
);
|
|
3581
3642
|
Card.displayName = "Card";
|
|
3582
|
-
CardHeader =
|
|
3643
|
+
CardHeader = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
3583
3644
|
CardHeader.displayName = "CardHeader";
|
|
3584
|
-
CardTitle =
|
|
3645
|
+
CardTitle = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3585
3646
|
"h3",
|
|
3586
3647
|
{
|
|
3587
3648
|
ref,
|
|
@@ -3594,11 +3655,11 @@ var init_Card = __esm({
|
|
|
3594
3655
|
}
|
|
3595
3656
|
));
|
|
3596
3657
|
CardTitle.displayName = "CardTitle";
|
|
3597
|
-
CardContent =
|
|
3658
|
+
CardContent = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
3598
3659
|
CardContent.displayName = "CardContent";
|
|
3599
3660
|
CardBody = CardContent;
|
|
3600
3661
|
CardBody.displayName = "CardBody";
|
|
3601
|
-
CardFooter =
|
|
3662
|
+
CardFooter = React85__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3602
3663
|
"div",
|
|
3603
3664
|
{
|
|
3604
3665
|
ref,
|
|
@@ -3685,7 +3746,7 @@ var init_FilterPill = __esm({
|
|
|
3685
3746
|
md: "w-3.5 h-3.5",
|
|
3686
3747
|
lg: "w-4 h-4"
|
|
3687
3748
|
};
|
|
3688
|
-
FilterPill =
|
|
3749
|
+
FilterPill = React85__default.forwardRef(
|
|
3689
3750
|
({
|
|
3690
3751
|
className,
|
|
3691
3752
|
variant = "default",
|
|
@@ -3814,8 +3875,8 @@ var init_Avatar = __esm({
|
|
|
3814
3875
|
actionPayload
|
|
3815
3876
|
}) => {
|
|
3816
3877
|
const eventBus = useEventBus();
|
|
3817
|
-
const [imgFailed, setImgFailed] =
|
|
3818
|
-
|
|
3878
|
+
const [imgFailed, setImgFailed] = React85__default.useState(false);
|
|
3879
|
+
React85__default.useEffect(() => {
|
|
3819
3880
|
setImgFailed(false);
|
|
3820
3881
|
}, [src]);
|
|
3821
3882
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -3928,7 +3989,7 @@ var init_Center = __esm({
|
|
|
3928
3989
|
as: Component = "div"
|
|
3929
3990
|
}) => {
|
|
3930
3991
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
3931
|
-
return
|
|
3992
|
+
return React85__default.createElement(Component, {
|
|
3932
3993
|
className: cn(
|
|
3933
3994
|
inline ? "inline-flex" : "flex",
|
|
3934
3995
|
horizontal && "justify-center",
|
|
@@ -4196,7 +4257,7 @@ var init_Radio = __esm({
|
|
|
4196
4257
|
md: "w-2.5 h-2.5",
|
|
4197
4258
|
lg: "w-3 h-3"
|
|
4198
4259
|
};
|
|
4199
|
-
Radio =
|
|
4260
|
+
Radio = React85__default.forwardRef(
|
|
4200
4261
|
({
|
|
4201
4262
|
label,
|
|
4202
4263
|
helperText,
|
|
@@ -4213,12 +4274,12 @@ var init_Radio = __esm({
|
|
|
4213
4274
|
onChange,
|
|
4214
4275
|
...props
|
|
4215
4276
|
}, ref) => {
|
|
4216
|
-
const reactId =
|
|
4277
|
+
const reactId = React85__default.useId();
|
|
4217
4278
|
const baseId = id || `radio-${reactId}`;
|
|
4218
4279
|
const hasError = !!error;
|
|
4219
4280
|
const eventBus = useEventBus();
|
|
4220
|
-
const [selected, setSelected] =
|
|
4221
|
-
|
|
4281
|
+
const [selected, setSelected] = React85__default.useState(value);
|
|
4282
|
+
React85__default.useEffect(() => {
|
|
4222
4283
|
if (value !== void 0) setSelected(value);
|
|
4223
4284
|
}, [value]);
|
|
4224
4285
|
const pick = (next, e) => {
|
|
@@ -4400,7 +4461,7 @@ var init_Switch = __esm({
|
|
|
4400
4461
|
"components/core/atoms/Switch.tsx"() {
|
|
4401
4462
|
"use client";
|
|
4402
4463
|
init_cn();
|
|
4403
|
-
Switch =
|
|
4464
|
+
Switch = React85.forwardRef(
|
|
4404
4465
|
({
|
|
4405
4466
|
checked,
|
|
4406
4467
|
defaultChecked = false,
|
|
@@ -4411,10 +4472,10 @@ var init_Switch = __esm({
|
|
|
4411
4472
|
name,
|
|
4412
4473
|
className
|
|
4413
4474
|
}, ref) => {
|
|
4414
|
-
const [isChecked, setIsChecked] =
|
|
4475
|
+
const [isChecked, setIsChecked] = React85.useState(
|
|
4415
4476
|
checked !== void 0 ? checked : defaultChecked
|
|
4416
4477
|
);
|
|
4417
|
-
|
|
4478
|
+
React85.useEffect(() => {
|
|
4418
4479
|
if (checked !== void 0) {
|
|
4419
4480
|
setIsChecked(checked);
|
|
4420
4481
|
}
|
|
@@ -4577,7 +4638,7 @@ var init_Stack = __esm({
|
|
|
4577
4638
|
};
|
|
4578
4639
|
const isHorizontal = direction === "horizontal";
|
|
4579
4640
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
4580
|
-
return
|
|
4641
|
+
return React85__default.createElement(
|
|
4581
4642
|
Component,
|
|
4582
4643
|
{
|
|
4583
4644
|
className: cn(
|
|
@@ -4777,7 +4838,7 @@ var Aside;
|
|
|
4777
4838
|
var init_Aside = __esm({
|
|
4778
4839
|
"components/core/atoms/Aside.tsx"() {
|
|
4779
4840
|
init_cn();
|
|
4780
|
-
Aside =
|
|
4841
|
+
Aside = React85__default.forwardRef(
|
|
4781
4842
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
4782
4843
|
);
|
|
4783
4844
|
Aside.displayName = "Aside";
|
|
@@ -4856,9 +4917,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4856
4917
|
className
|
|
4857
4918
|
}) => {
|
|
4858
4919
|
const { t } = useTranslate();
|
|
4859
|
-
const [isVisible, setIsVisible] =
|
|
4860
|
-
const timeoutRef =
|
|
4861
|
-
const triggerRef =
|
|
4920
|
+
const [isVisible, setIsVisible] = React85__default.useState(false);
|
|
4921
|
+
const timeoutRef = React85__default.useRef(null);
|
|
4922
|
+
const triggerRef = React85__default.useRef(null);
|
|
4862
4923
|
const handleMouseEnter = () => {
|
|
4863
4924
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4864
4925
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -4869,7 +4930,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
4869
4930
|
};
|
|
4870
4931
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
4871
4932
|
const open = isVisible || revealed;
|
|
4872
|
-
|
|
4933
|
+
React85__default.useEffect(() => {
|
|
4873
4934
|
return () => {
|
|
4874
4935
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4875
4936
|
};
|
|
@@ -5079,7 +5140,7 @@ var init_StatusDot = __esm({
|
|
|
5079
5140
|
md: "w-2.5 h-2.5",
|
|
5080
5141
|
lg: "w-3 h-3"
|
|
5081
5142
|
};
|
|
5082
|
-
StatusDot =
|
|
5143
|
+
StatusDot = React85__default.forwardRef(
|
|
5083
5144
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
5084
5145
|
return /* @__PURE__ */ jsx(
|
|
5085
5146
|
"span",
|
|
@@ -5133,7 +5194,7 @@ var init_TrendIndicator = __esm({
|
|
|
5133
5194
|
down: "trending-down",
|
|
5134
5195
|
flat: "arrow-right"
|
|
5135
5196
|
};
|
|
5136
|
-
TrendIndicator =
|
|
5197
|
+
TrendIndicator = React85__default.forwardRef(
|
|
5137
5198
|
({
|
|
5138
5199
|
className,
|
|
5139
5200
|
value,
|
|
@@ -5202,7 +5263,7 @@ var init_RangeSlider = __esm({
|
|
|
5202
5263
|
md: "w-4 h-4",
|
|
5203
5264
|
lg: "w-5 h-5"
|
|
5204
5265
|
};
|
|
5205
|
-
RangeSlider =
|
|
5266
|
+
RangeSlider = React85__default.forwardRef(
|
|
5206
5267
|
({
|
|
5207
5268
|
className,
|
|
5208
5269
|
min = 0,
|
|
@@ -5813,7 +5874,7 @@ var init_ContentSection = __esm({
|
|
|
5813
5874
|
md: "py-16",
|
|
5814
5875
|
lg: "py-24"
|
|
5815
5876
|
};
|
|
5816
|
-
ContentSection =
|
|
5877
|
+
ContentSection = React85__default.forwardRef(
|
|
5817
5878
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
5818
5879
|
return /* @__PURE__ */ jsx(
|
|
5819
5880
|
Box,
|
|
@@ -6347,7 +6408,7 @@ var init_AnimatedReveal = __esm({
|
|
|
6347
6408
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6348
6409
|
"none": {}
|
|
6349
6410
|
};
|
|
6350
|
-
AnimatedReveal =
|
|
6411
|
+
AnimatedReveal = React85__default.forwardRef(
|
|
6351
6412
|
({
|
|
6352
6413
|
trigger = "scroll",
|
|
6353
6414
|
animation = "fade-up",
|
|
@@ -6507,7 +6568,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6507
6568
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
6508
6569
|
"use client";
|
|
6509
6570
|
init_cn();
|
|
6510
|
-
AnimatedGraphic =
|
|
6571
|
+
AnimatedGraphic = React85__default.forwardRef(
|
|
6511
6572
|
({
|
|
6512
6573
|
src,
|
|
6513
6574
|
svgContent,
|
|
@@ -6530,7 +6591,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
6530
6591
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6531
6592
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6532
6593
|
const prevAnimateRef = useRef(animate);
|
|
6533
|
-
const setRef =
|
|
6594
|
+
const setRef = React85__default.useCallback(
|
|
6534
6595
|
(node) => {
|
|
6535
6596
|
containerRef.current = node;
|
|
6536
6597
|
if (typeof ref === "function") ref(node);
|
|
@@ -7259,9 +7320,9 @@ function ControlButton({
|
|
|
7259
7320
|
className
|
|
7260
7321
|
}) {
|
|
7261
7322
|
const eventBus = useEventBus();
|
|
7262
|
-
const [isPressed, setIsPressed] =
|
|
7323
|
+
const [isPressed, setIsPressed] = React85.useState(false);
|
|
7263
7324
|
const actualPressed = pressed ?? isPressed;
|
|
7264
|
-
const handlePointerDown =
|
|
7325
|
+
const handlePointerDown = React85.useCallback(
|
|
7265
7326
|
(e) => {
|
|
7266
7327
|
e.preventDefault();
|
|
7267
7328
|
if (disabled) return;
|
|
@@ -7271,7 +7332,7 @@ function ControlButton({
|
|
|
7271
7332
|
},
|
|
7272
7333
|
[disabled, pressEvent, eventBus, onPress]
|
|
7273
7334
|
);
|
|
7274
|
-
const handlePointerUp =
|
|
7335
|
+
const handlePointerUp = React85.useCallback(
|
|
7275
7336
|
(e) => {
|
|
7276
7337
|
e.preventDefault();
|
|
7277
7338
|
if (disabled) return;
|
|
@@ -7281,7 +7342,7 @@ function ControlButton({
|
|
|
7281
7342
|
},
|
|
7282
7343
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
7283
7344
|
);
|
|
7284
|
-
const handlePointerLeave =
|
|
7345
|
+
const handlePointerLeave = React85.useCallback(
|
|
7285
7346
|
(e) => {
|
|
7286
7347
|
if (isPressed) {
|
|
7287
7348
|
setIsPressed(false);
|
|
@@ -7352,7 +7413,7 @@ var init_ControlButton = __esm({
|
|
|
7352
7413
|
ControlButton.displayName = "ControlButton";
|
|
7353
7414
|
}
|
|
7354
7415
|
});
|
|
7355
|
-
function
|
|
7416
|
+
function formatTime2(seconds, format) {
|
|
7356
7417
|
const clamped = Math.max(0, Math.floor(seconds));
|
|
7357
7418
|
if (format === "ss") {
|
|
7358
7419
|
return `${clamped}s`;
|
|
@@ -7389,7 +7450,7 @@ function TimerDisplay({
|
|
|
7389
7450
|
),
|
|
7390
7451
|
children: [
|
|
7391
7452
|
iconAsset && /* @__PURE__ */ jsx(GameIcon, { assetUrl: iconAsset, icon: "image", size: 16, className: "w-4 h-4 object-contain flex-shrink-0" }),
|
|
7392
|
-
|
|
7453
|
+
formatTime2(seconds, format)
|
|
7393
7454
|
]
|
|
7394
7455
|
}
|
|
7395
7456
|
);
|
|
@@ -7522,6 +7583,210 @@ var init_ChoiceButton = __esm({
|
|
|
7522
7583
|
ChoiceButton.displayName = "ChoiceButton";
|
|
7523
7584
|
}
|
|
7524
7585
|
});
|
|
7586
|
+
function SvgStage({
|
|
7587
|
+
cols,
|
|
7588
|
+
rows,
|
|
7589
|
+
tileSize = 32,
|
|
7590
|
+
background = "var(--color-background)",
|
|
7591
|
+
tileClickEvent,
|
|
7592
|
+
tileHoverEvent,
|
|
7593
|
+
tileLeaveEvent,
|
|
7594
|
+
keyMap,
|
|
7595
|
+
keyUpMap,
|
|
7596
|
+
className,
|
|
7597
|
+
children
|
|
7598
|
+
}) {
|
|
7599
|
+
const eventBus = useEventBus();
|
|
7600
|
+
const svgRef = useRef(null);
|
|
7601
|
+
const pointerDownRef = useRef(null);
|
|
7602
|
+
const cellFromClient = useCallback((clientX, clientY) => {
|
|
7603
|
+
const svg = svgRef.current;
|
|
7604
|
+
if (!svg) return null;
|
|
7605
|
+
const rect = svg.getBoundingClientRect();
|
|
7606
|
+
if (rect.width === 0 || rect.height === 0) return null;
|
|
7607
|
+
const vbW = cols * tileSize;
|
|
7608
|
+
const vbH = rows * tileSize;
|
|
7609
|
+
const meet = Math.min(rect.width / vbW, rect.height / vbH);
|
|
7610
|
+
const offsetX = (rect.width - vbW * meet) / 2;
|
|
7611
|
+
const offsetY = (rect.height - vbH * meet) / 2;
|
|
7612
|
+
const svgX = (clientX - rect.left - offsetX) / meet;
|
|
7613
|
+
const svgY = (clientY - rect.top - offsetY) / meet;
|
|
7614
|
+
return {
|
|
7615
|
+
x: Math.min(Math.max(Math.floor(svgX / tileSize), 0), cols - 1),
|
|
7616
|
+
y: Math.min(Math.max(Math.floor(svgY / tileSize), 0), rows - 1)
|
|
7617
|
+
};
|
|
7618
|
+
}, [cols, rows, tileSize]);
|
|
7619
|
+
const handlePointerDown = useCallback((e) => {
|
|
7620
|
+
pointerDownRef.current = { clientX: e.clientX, clientY: e.clientY };
|
|
7621
|
+
}, []);
|
|
7622
|
+
const handlePointerUp = useCallback((e) => {
|
|
7623
|
+
const down = pointerDownRef.current;
|
|
7624
|
+
pointerDownRef.current = null;
|
|
7625
|
+
if (!tileClickEvent) return;
|
|
7626
|
+
if (down && Math.hypot(e.clientX - down.clientX, e.clientY - down.clientY) > 5) return;
|
|
7627
|
+
const cell = cellFromClient(e.clientX, e.clientY);
|
|
7628
|
+
if (cell) eventBus.emit(`UI:${tileClickEvent}`, cell);
|
|
7629
|
+
}, [cellFromClient, tileClickEvent, eventBus]);
|
|
7630
|
+
const handlePointerMove = useCallback((e) => {
|
|
7631
|
+
if (!tileHoverEvent) return;
|
|
7632
|
+
const cell = cellFromClient(e.clientX, e.clientY);
|
|
7633
|
+
if (cell) eventBus.emit(`UI:${tileHoverEvent}`, cell);
|
|
7634
|
+
}, [cellFromClient, tileHoverEvent, eventBus]);
|
|
7635
|
+
const handlePointerLeave = useCallback(() => {
|
|
7636
|
+
pointerDownRef.current = null;
|
|
7637
|
+
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
7638
|
+
}, [tileLeaveEvent, eventBus]);
|
|
7639
|
+
useEffect(() => {
|
|
7640
|
+
if (!keyMap && !keyUpMap) return;
|
|
7641
|
+
const onDown = (e) => {
|
|
7642
|
+
const ev = keyMap?.[e.code];
|
|
7643
|
+
if (ev) {
|
|
7644
|
+
eventBus.emit(`UI:${ev}`, {});
|
|
7645
|
+
e.preventDefault();
|
|
7646
|
+
}
|
|
7647
|
+
};
|
|
7648
|
+
const onUp = (e) => {
|
|
7649
|
+
const ev = keyUpMap?.[e.code];
|
|
7650
|
+
if (ev) eventBus.emit(`UI:${ev}`, {});
|
|
7651
|
+
};
|
|
7652
|
+
window.addEventListener("keydown", onDown);
|
|
7653
|
+
window.addEventListener("keyup", onUp);
|
|
7654
|
+
return () => {
|
|
7655
|
+
window.removeEventListener("keydown", onDown);
|
|
7656
|
+
window.removeEventListener("keyup", onUp);
|
|
7657
|
+
};
|
|
7658
|
+
}, [keyMap, keyUpMap, eventBus]);
|
|
7659
|
+
useEffect(() => {
|
|
7660
|
+
if (!keyMap && !keyUpMap) return;
|
|
7661
|
+
svgRef.current?.focus();
|
|
7662
|
+
}, [keyMap, keyUpMap]);
|
|
7663
|
+
const stageContext = useMemo(() => ({ tileSize }), [tileSize]);
|
|
7664
|
+
return /* @__PURE__ */ jsxs(
|
|
7665
|
+
"svg",
|
|
7666
|
+
{
|
|
7667
|
+
ref: svgRef,
|
|
7668
|
+
"data-testid": "svg-stage",
|
|
7669
|
+
viewBox: `0 0 ${cols * tileSize} ${rows * tileSize}`,
|
|
7670
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
7671
|
+
className: cn("block h-full w-full", className),
|
|
7672
|
+
tabIndex: keyMap || keyUpMap ? 0 : void 0,
|
|
7673
|
+
onPointerDown: handlePointerDown,
|
|
7674
|
+
onPointerMove: handlePointerMove,
|
|
7675
|
+
onPointerUp: handlePointerUp,
|
|
7676
|
+
onPointerLeave: handlePointerLeave,
|
|
7677
|
+
children: [
|
|
7678
|
+
/* @__PURE__ */ jsx("rect", { width: cols * tileSize, height: rows * tileSize, fill: background }),
|
|
7679
|
+
/* @__PURE__ */ jsx(SvgStageContext.Provider, { value: stageContext, children })
|
|
7680
|
+
]
|
|
7681
|
+
}
|
|
7682
|
+
);
|
|
7683
|
+
}
|
|
7684
|
+
var SvgStageContext;
|
|
7685
|
+
var init_SvgStage = __esm({
|
|
7686
|
+
"components/game/molecules/SvgStage.tsx"() {
|
|
7687
|
+
"use client";
|
|
7688
|
+
init_cn();
|
|
7689
|
+
init_useEventBus();
|
|
7690
|
+
SvgStageContext = React85.createContext({ tileSize: 1 });
|
|
7691
|
+
SvgStage.displayName = "SvgStage";
|
|
7692
|
+
}
|
|
7693
|
+
});
|
|
7694
|
+
function SvgDrawShape({
|
|
7695
|
+
shape,
|
|
7696
|
+
x,
|
|
7697
|
+
y,
|
|
7698
|
+
width,
|
|
7699
|
+
height,
|
|
7700
|
+
radius,
|
|
7701
|
+
radiusY,
|
|
7702
|
+
points,
|
|
7703
|
+
d,
|
|
7704
|
+
x2,
|
|
7705
|
+
y2,
|
|
7706
|
+
fill,
|
|
7707
|
+
stroke,
|
|
7708
|
+
strokeWidth,
|
|
7709
|
+
opacity,
|
|
7710
|
+
className
|
|
7711
|
+
}) {
|
|
7712
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
7713
|
+
const cell = (v) => v === void 0 ? void 0 : v * tileSize;
|
|
7714
|
+
const paint = {
|
|
7715
|
+
fill: fill ?? (stroke === void 0 ? "var(--color-primary)" : "none"),
|
|
7716
|
+
stroke,
|
|
7717
|
+
strokeWidth,
|
|
7718
|
+
opacity,
|
|
7719
|
+
className
|
|
7720
|
+
};
|
|
7721
|
+
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x * tileSize} ${y * tileSize})`, children: [
|
|
7722
|
+
shape === "rect" && /* @__PURE__ */ jsx("rect", { width: cell(width), height: cell(height), ...paint }),
|
|
7723
|
+
shape === "circle" && /* @__PURE__ */ jsx("circle", { r: cell(radius), ...paint }),
|
|
7724
|
+
shape === "ellipse" && /* @__PURE__ */ jsx("ellipse", { rx: cell(radius), ry: cell(radiusY ?? radius), ...paint }),
|
|
7725
|
+
shape === "polygon" && /* @__PURE__ */ jsx("polygon", { points, ...paint }),
|
|
7726
|
+
shape === "polyline" && /* @__PURE__ */ jsx("polyline", { points, ...paint }),
|
|
7727
|
+
shape === "path" && /* @__PURE__ */ jsx("path", { d, ...paint }),
|
|
7728
|
+
shape === "line" && /* @__PURE__ */ jsx("line", { x2: cell(x2), y2: cell(y2), ...paint })
|
|
7729
|
+
] });
|
|
7730
|
+
}
|
|
7731
|
+
var init_SvgDrawShape = __esm({
|
|
7732
|
+
"components/game/atoms/SvgDrawShape.tsx"() {
|
|
7733
|
+
"use client";
|
|
7734
|
+
init_SvgStage();
|
|
7735
|
+
SvgDrawShape.displayName = "SvgDrawShape";
|
|
7736
|
+
}
|
|
7737
|
+
});
|
|
7738
|
+
function SvgDrawGroup({
|
|
7739
|
+
x = 0,
|
|
7740
|
+
y = 0,
|
|
7741
|
+
scale,
|
|
7742
|
+
rotate,
|
|
7743
|
+
opacity,
|
|
7744
|
+
className,
|
|
7745
|
+
children
|
|
7746
|
+
}) {
|
|
7747
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
7748
|
+
const transforms = [`translate(${x * tileSize} ${y * tileSize})`];
|
|
7749
|
+
if (rotate !== void 0) transforms.push(`rotate(${rotate})`);
|
|
7750
|
+
if (scale !== void 0) transforms.push(`scale(${scale})`);
|
|
7751
|
+
return /* @__PURE__ */ jsx("g", { transform: transforms.join(" "), opacity, className, children });
|
|
7752
|
+
}
|
|
7753
|
+
var init_SvgDrawGroup = __esm({
|
|
7754
|
+
"components/game/atoms/SvgDrawGroup.tsx"() {
|
|
7755
|
+
"use client";
|
|
7756
|
+
init_SvgStage();
|
|
7757
|
+
SvgDrawGroup.displayName = "SvgDrawGroup";
|
|
7758
|
+
}
|
|
7759
|
+
});
|
|
7760
|
+
function SvgDrawText({
|
|
7761
|
+
x,
|
|
7762
|
+
y,
|
|
7763
|
+
text,
|
|
7764
|
+
size = 12,
|
|
7765
|
+
fill = "var(--color-foreground)",
|
|
7766
|
+
anchor = "middle",
|
|
7767
|
+
className
|
|
7768
|
+
}) {
|
|
7769
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
7770
|
+
return /* @__PURE__ */ jsx(
|
|
7771
|
+
"text",
|
|
7772
|
+
{
|
|
7773
|
+
x: x * tileSize,
|
|
7774
|
+
y: y * tileSize,
|
|
7775
|
+
fontSize: size,
|
|
7776
|
+
fill,
|
|
7777
|
+
textAnchor: anchor,
|
|
7778
|
+
className,
|
|
7779
|
+
children: text
|
|
7780
|
+
}
|
|
7781
|
+
);
|
|
7782
|
+
}
|
|
7783
|
+
var init_SvgDrawText = __esm({
|
|
7784
|
+
"components/game/atoms/SvgDrawText.tsx"() {
|
|
7785
|
+
"use client";
|
|
7786
|
+
init_SvgStage();
|
|
7787
|
+
SvgDrawText.displayName = "SvgDrawText";
|
|
7788
|
+
}
|
|
7789
|
+
});
|
|
7525
7790
|
function ControlGrid({
|
|
7526
7791
|
kind,
|
|
7527
7792
|
buttons = DEFAULT_BUTTONS,
|
|
@@ -7539,8 +7804,8 @@ function ControlGrid({
|
|
|
7539
7804
|
className
|
|
7540
7805
|
}) {
|
|
7541
7806
|
const eventBus = useEventBus();
|
|
7542
|
-
const [active, setActive] =
|
|
7543
|
-
const handlePress =
|
|
7807
|
+
const [active, setActive] = React85.useState(/* @__PURE__ */ new Set());
|
|
7808
|
+
const handlePress = React85.useCallback(
|
|
7544
7809
|
(id) => {
|
|
7545
7810
|
setActive((prev) => new Set(prev).add(id));
|
|
7546
7811
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -7554,7 +7819,7 @@ function ControlGrid({
|
|
|
7554
7819
|
},
|
|
7555
7820
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
7556
7821
|
);
|
|
7557
|
-
const handleRelease =
|
|
7822
|
+
const handleRelease = React85.useCallback(
|
|
7558
7823
|
(id) => {
|
|
7559
7824
|
setActive((prev) => {
|
|
7560
7825
|
const next = new Set(prev);
|
|
@@ -7912,7 +8177,7 @@ function GameMenu({
|
|
|
7912
8177
|
}) {
|
|
7913
8178
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
7914
8179
|
const eventBus = useEventBus();
|
|
7915
|
-
const handleOptionClick =
|
|
8180
|
+
const handleOptionClick = React85.useCallback(
|
|
7916
8181
|
(option) => {
|
|
7917
8182
|
if (option.event) {
|
|
7918
8183
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -8148,7 +8413,7 @@ function StateGraph({
|
|
|
8148
8413
|
}) {
|
|
8149
8414
|
const eventBus = useEventBus();
|
|
8150
8415
|
const nodes = states ?? [];
|
|
8151
|
-
const positions =
|
|
8416
|
+
const positions = React85.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
8152
8417
|
return /* @__PURE__ */ jsxs(
|
|
8153
8418
|
Box,
|
|
8154
8419
|
{
|
|
@@ -8219,8 +8484,8 @@ function MiniMap({
|
|
|
8219
8484
|
tileAssets,
|
|
8220
8485
|
unitAssets
|
|
8221
8486
|
}) {
|
|
8222
|
-
const canvasRef =
|
|
8223
|
-
const imgCacheRef =
|
|
8487
|
+
const canvasRef = React85.useRef(null);
|
|
8488
|
+
const imgCacheRef = React85.useRef(/* @__PURE__ */ new Map());
|
|
8224
8489
|
function loadImg(url) {
|
|
8225
8490
|
const cached = imgCacheRef.current.get(url);
|
|
8226
8491
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -8235,7 +8500,7 @@ function MiniMap({
|
|
|
8235
8500
|
imgCacheRef.current.set(url, img);
|
|
8236
8501
|
return null;
|
|
8237
8502
|
}
|
|
8238
|
-
|
|
8503
|
+
React85.useEffect(() => {
|
|
8239
8504
|
const canvas = canvasRef.current;
|
|
8240
8505
|
if (!canvas) return;
|
|
8241
8506
|
const ctx = canvas.getContext("2d");
|
|
@@ -9547,6 +9812,32 @@ var init_Canvas = __esm({
|
|
|
9547
9812
|
Canvas.displayName = "Canvas";
|
|
9548
9813
|
}
|
|
9549
9814
|
});
|
|
9815
|
+
function SvgDrawShapeLayer({
|
|
9816
|
+
items,
|
|
9817
|
+
fill,
|
|
9818
|
+
stroke,
|
|
9819
|
+
strokeWidth,
|
|
9820
|
+
opacity
|
|
9821
|
+
}) {
|
|
9822
|
+
return /* @__PURE__ */ jsx("g", { children: items.map(({ id, ...shape }) => /* @__PURE__ */ jsx(
|
|
9823
|
+
SvgDrawShape,
|
|
9824
|
+
{
|
|
9825
|
+
...shape,
|
|
9826
|
+
fill: shape.fill ?? fill,
|
|
9827
|
+
stroke: shape.stroke ?? stroke,
|
|
9828
|
+
strokeWidth: shape.strokeWidth ?? strokeWidth,
|
|
9829
|
+
opacity: shape.opacity ?? opacity
|
|
9830
|
+
},
|
|
9831
|
+
id
|
|
9832
|
+
)) });
|
|
9833
|
+
}
|
|
9834
|
+
var init_SvgDrawShapeLayer = __esm({
|
|
9835
|
+
"components/game/molecules/SvgDrawShapeLayer.tsx"() {
|
|
9836
|
+
"use client";
|
|
9837
|
+
init_SvgDrawShape();
|
|
9838
|
+
SvgDrawShapeLayer.displayName = "SvgDrawShapeLayer";
|
|
9839
|
+
}
|
|
9840
|
+
});
|
|
9550
9841
|
function GameAudioToggle({
|
|
9551
9842
|
size = "sm",
|
|
9552
9843
|
className,
|
|
@@ -9930,7 +10221,7 @@ function LinearView({
|
|
|
9930
10221
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
9931
10222
|
const isDone = i < currentIdx;
|
|
9932
10223
|
const isCurrent = i === currentIdx;
|
|
9933
|
-
return /* @__PURE__ */ jsxs(
|
|
10224
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
9934
10225
|
i > 0 && /* @__PURE__ */ jsx(
|
|
9935
10226
|
Typography,
|
|
9936
10227
|
{
|
|
@@ -10465,7 +10756,7 @@ function SequenceBar({
|
|
|
10465
10756
|
else onSlotRemove?.(index);
|
|
10466
10757
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
10467
10758
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
10468
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
10759
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
10469
10760
|
i > 0 && /* @__PURE__ */ jsx(
|
|
10470
10761
|
Typography,
|
|
10471
10762
|
{
|
|
@@ -11114,7 +11405,7 @@ var init_ErrorBoundary = __esm({
|
|
|
11114
11405
|
}
|
|
11115
11406
|
);
|
|
11116
11407
|
};
|
|
11117
|
-
ErrorBoundary = class extends
|
|
11408
|
+
ErrorBoundary = class extends React85__default.Component {
|
|
11118
11409
|
constructor(props) {
|
|
11119
11410
|
super(props);
|
|
11120
11411
|
__publicField(this, "reset", () => {
|
|
@@ -11766,7 +12057,7 @@ var init_Container = __esm({
|
|
|
11766
12057
|
as: Component = "div"
|
|
11767
12058
|
}) => {
|
|
11768
12059
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
11769
|
-
return
|
|
12060
|
+
return React85__default.createElement(
|
|
11770
12061
|
Component,
|
|
11771
12062
|
{
|
|
11772
12063
|
className: cn(
|
|
@@ -14731,7 +15022,7 @@ var init_CodeBlock = __esm({
|
|
|
14731
15022
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
14732
15023
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
14733
15024
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
14734
|
-
CodeBlock =
|
|
15025
|
+
CodeBlock = React85__default.memo(
|
|
14735
15026
|
({
|
|
14736
15027
|
code: rawCode,
|
|
14737
15028
|
language = "text",
|
|
@@ -15319,7 +15610,7 @@ var init_MarkdownContent = __esm({
|
|
|
15319
15610
|
init_Box();
|
|
15320
15611
|
init_CodeBlock();
|
|
15321
15612
|
init_cn();
|
|
15322
|
-
MarkdownContent =
|
|
15613
|
+
MarkdownContent = React85__default.memo(
|
|
15323
15614
|
({ content, direction = "ltr", className }) => {
|
|
15324
15615
|
const { t: _t } = useTranslate();
|
|
15325
15616
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -16646,7 +16937,7 @@ var init_StateMachineView = __esm({
|
|
|
16646
16937
|
style: { top: title ? 30 : 0 },
|
|
16647
16938
|
children: [
|
|
16648
16939
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
16649
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
16940
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React85__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
16650
16941
|
StateNode2,
|
|
16651
16942
|
{
|
|
16652
16943
|
state,
|
|
@@ -19391,9 +19682,6 @@ function normalizeFields(fields) {
|
|
|
19391
19682
|
if (!fields) return [];
|
|
19392
19683
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
19393
19684
|
}
|
|
19394
|
-
function fieldLabel(key) {
|
|
19395
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
19396
|
-
}
|
|
19397
19685
|
function asBooleanValue(value) {
|
|
19398
19686
|
if (typeof value === "boolean") return value;
|
|
19399
19687
|
if (value === "true") return true;
|
|
@@ -19404,12 +19692,6 @@ function isDateField(key) {
|
|
|
19404
19692
|
const lower = key.toLowerCase();
|
|
19405
19693
|
return lower.includes("date") || lower.includes("time") || lower.endsWith("at") || lower.endsWith("_at");
|
|
19406
19694
|
}
|
|
19407
|
-
function formatDate(value) {
|
|
19408
|
-
if (!value) return "";
|
|
19409
|
-
const d = new Date(String(value));
|
|
19410
|
-
if (isNaN(d.getTime())) return String(value);
|
|
19411
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
19412
|
-
}
|
|
19413
19695
|
function statusVariant(value) {
|
|
19414
19696
|
const v = value.toLowerCase();
|
|
19415
19697
|
if (["active", "completed", "done", "approved", "published", "resolved", "open"].includes(v)) return "success";
|
|
@@ -19418,11 +19700,12 @@ function statusVariant(value) {
|
|
|
19418
19700
|
if (["new", "created", "scheduled", "queued"].includes(v)) return "info";
|
|
19419
19701
|
return "default";
|
|
19420
19702
|
}
|
|
19421
|
-
var STATUS_FIELDS, gapStyles3, alignStyles2, CardGrid;
|
|
19703
|
+
var fieldLabel, STATUS_FIELDS, gapStyles3, alignStyles2, CardGrid;
|
|
19422
19704
|
var init_CardGrid = __esm({
|
|
19423
19705
|
"components/core/organisms/CardGrid.tsx"() {
|
|
19424
19706
|
"use client";
|
|
19425
19707
|
init_cn();
|
|
19708
|
+
init_format();
|
|
19426
19709
|
init_getNestedValue();
|
|
19427
19710
|
init_useEventBus();
|
|
19428
19711
|
init_atoms();
|
|
@@ -19431,6 +19714,7 @@ var init_CardGrid = __esm({
|
|
|
19431
19714
|
init_Typography();
|
|
19432
19715
|
init_Stack();
|
|
19433
19716
|
init_Pagination();
|
|
19717
|
+
fieldLabel = humanizeFieldName;
|
|
19434
19718
|
STATUS_FIELDS = /* @__PURE__ */ new Set(["status", "state", "priority", "type", "category", "role", "level", "tier"]);
|
|
19435
19719
|
gapStyles3 = {
|
|
19436
19720
|
none: "gap-0",
|
|
@@ -19938,7 +20222,7 @@ var init_CaseStudyOrganism = __esm({
|
|
|
19938
20222
|
CaseStudyOrganism.displayName = "CaseStudyOrganism";
|
|
19939
20223
|
}
|
|
19940
20224
|
});
|
|
19941
|
-
var CHART_COLORS, seriesColor, monthFormatter, formatTimeLabel, BarChart, PieChart, LineChart, ScatterChart, LOOK_FROM_CHART_TYPE, Chart;
|
|
20225
|
+
var CHART_COLORS, seriesColor, barColor, monthFormatter, formatTimeLabel, BarChart, PieChart, LineChart, ScatterChart, LOOK_FROM_CHART_TYPE, Chart;
|
|
19942
20226
|
var init_Chart = __esm({
|
|
19943
20227
|
"components/core/molecules/Chart.tsx"() {
|
|
19944
20228
|
"use client";
|
|
@@ -19958,6 +20242,7 @@ var init_Chart = __esm({
|
|
|
19958
20242
|
"var(--color-accent)"
|
|
19959
20243
|
];
|
|
19960
20244
|
seriesColor = (series, idx) => series.color ?? CHART_COLORS[idx % CHART_COLORS.length];
|
|
20245
|
+
barColor = (series, sIdx, catIdx, seriesCount) => series.color ?? CHART_COLORS[(seriesCount === 1 ? catIdx : sIdx) % CHART_COLORS.length];
|
|
19961
20246
|
monthFormatter = new Intl.DateTimeFormat(void 0, {
|
|
19962
20247
|
month: "short",
|
|
19963
20248
|
year: "2-digit"
|
|
@@ -20030,7 +20315,7 @@ var init_Chart = __esm({
|
|
|
20030
20315
|
children: series.map((s, sIdx) => {
|
|
20031
20316
|
const value = valueAt(s, label);
|
|
20032
20317
|
const ratio = stack === "normalize" ? total === 0 ? 0 : value / total * 100 : value / maxValue * 100;
|
|
20033
|
-
const color =
|
|
20318
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
20034
20319
|
return /* @__PURE__ */ jsx(
|
|
20035
20320
|
Box,
|
|
20036
20321
|
{
|
|
@@ -20085,7 +20370,7 @@ var init_Chart = __esm({
|
|
|
20085
20370
|
/* @__PURE__ */ jsx(HStack, { gap: histogram ? "none" : "xs", align: "end", justify: histogram ? void 0 : "center", className: "w-full flex-1 min-h-0", children: series.map((s, sIdx) => {
|
|
20086
20371
|
const value = valueAt(s, label);
|
|
20087
20372
|
const barHeight = value / maxValue * 100;
|
|
20088
|
-
const color =
|
|
20373
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
20089
20374
|
return /* @__PURE__ */ jsx(
|
|
20090
20375
|
Box,
|
|
20091
20376
|
{
|
|
@@ -20136,7 +20421,7 @@ var init_Chart = __esm({
|
|
|
20136
20421
|
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "w-full flex-1 min-h-0", justify: "end", children: series.map((s, sIdx) => {
|
|
20137
20422
|
const value = valueAt(s, label);
|
|
20138
20423
|
const ratio = stack === "normalize" ? total === 0 ? 0 : value / total * 100 : value / maxValue * 100;
|
|
20139
|
-
const color =
|
|
20424
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
20140
20425
|
return /* @__PURE__ */ jsx(
|
|
20141
20426
|
Box,
|
|
20142
20427
|
{
|
|
@@ -22474,8 +22759,8 @@ var init_Menu = __esm({
|
|
|
22474
22759
|
"bottom-end": "bottom-start"
|
|
22475
22760
|
};
|
|
22476
22761
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
22477
|
-
const triggerChild =
|
|
22478
|
-
const triggerElement =
|
|
22762
|
+
const triggerChild = React85__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
22763
|
+
const triggerElement = React85__default.cloneElement(
|
|
22479
22764
|
triggerChild,
|
|
22480
22765
|
{
|
|
22481
22766
|
ref: triggerRef,
|
|
@@ -22570,14 +22855,14 @@ function useDataDnd(args) {
|
|
|
22570
22855
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
22571
22856
|
const enabled = isZone || Boolean(dndRoot);
|
|
22572
22857
|
const eventBus = useEventBus();
|
|
22573
|
-
const parentRoot =
|
|
22858
|
+
const parentRoot = React85__default.useContext(RootCtx);
|
|
22574
22859
|
const isRoot = enabled && parentRoot === null;
|
|
22575
|
-
const zoneId =
|
|
22860
|
+
const zoneId = React85__default.useId();
|
|
22576
22861
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
22577
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
22578
|
-
const optimisticOrdersRef =
|
|
22862
|
+
const [optimisticOrders, setOptimisticOrders] = React85__default.useState(() => /* @__PURE__ */ new Map());
|
|
22863
|
+
const optimisticOrdersRef = React85__default.useRef(optimisticOrders);
|
|
22579
22864
|
optimisticOrdersRef.current = optimisticOrders;
|
|
22580
|
-
const clearOptimisticOrder =
|
|
22865
|
+
const clearOptimisticOrder = React85__default.useCallback((group) => {
|
|
22581
22866
|
setOptimisticOrders((prev) => {
|
|
22582
22867
|
if (!prev.has(group)) return prev;
|
|
22583
22868
|
const next = new Map(prev);
|
|
@@ -22602,7 +22887,7 @@ function useDataDnd(args) {
|
|
|
22602
22887
|
const raw = it[dndItemIdField];
|
|
22603
22888
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
22604
22889
|
}).join("|");
|
|
22605
|
-
const itemIds =
|
|
22890
|
+
const itemIds = React85__default.useMemo(
|
|
22606
22891
|
() => orderedItems.map((it, idx) => {
|
|
22607
22892
|
const raw = it[dndItemIdField];
|
|
22608
22893
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -22613,7 +22898,7 @@ function useDataDnd(args) {
|
|
|
22613
22898
|
const raw = it[dndItemIdField];
|
|
22614
22899
|
return raw != null ? String(raw) : `__${idx}`;
|
|
22615
22900
|
}).join("|");
|
|
22616
|
-
|
|
22901
|
+
React85__default.useEffect(() => {
|
|
22617
22902
|
const root = isRoot ? null : parentRoot;
|
|
22618
22903
|
if (root) {
|
|
22619
22904
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -22621,20 +22906,20 @@ function useDataDnd(args) {
|
|
|
22621
22906
|
clearOptimisticOrder(ownGroup);
|
|
22622
22907
|
}
|
|
22623
22908
|
}, [itemsContentSig, ownGroup]);
|
|
22624
|
-
const zonesRef =
|
|
22625
|
-
const registerZone =
|
|
22909
|
+
const zonesRef = React85__default.useRef(/* @__PURE__ */ new Map());
|
|
22910
|
+
const registerZone = React85__default.useCallback((zoneId2, meta2) => {
|
|
22626
22911
|
zonesRef.current.set(zoneId2, meta2);
|
|
22627
22912
|
}, []);
|
|
22628
|
-
const unregisterZone =
|
|
22913
|
+
const unregisterZone = React85__default.useCallback((zoneId2) => {
|
|
22629
22914
|
zonesRef.current.delete(zoneId2);
|
|
22630
22915
|
}, []);
|
|
22631
|
-
const [activeDrag, setActiveDrag] =
|
|
22632
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
22633
|
-
const meta =
|
|
22916
|
+
const [activeDrag, setActiveDrag] = React85__default.useState(null);
|
|
22917
|
+
const [overZoneGroup, setOverZoneGroup] = React85__default.useState(null);
|
|
22918
|
+
const meta = React85__default.useMemo(
|
|
22634
22919
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
22635
22920
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
22636
22921
|
);
|
|
22637
|
-
|
|
22922
|
+
React85__default.useEffect(() => {
|
|
22638
22923
|
const target = isRoot ? null : parentRoot;
|
|
22639
22924
|
if (!target) {
|
|
22640
22925
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -22653,7 +22938,7 @@ function useDataDnd(args) {
|
|
|
22653
22938
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
22654
22939
|
const sensors = useAlmadarDndSensors(true);
|
|
22655
22940
|
const collisionDetection = almadarDndCollisionDetection;
|
|
22656
|
-
const findZoneByItem =
|
|
22941
|
+
const findZoneByItem = React85__default.useCallback(
|
|
22657
22942
|
(id) => {
|
|
22658
22943
|
for (const z of zonesRef.current.values()) {
|
|
22659
22944
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -22662,7 +22947,7 @@ function useDataDnd(args) {
|
|
|
22662
22947
|
},
|
|
22663
22948
|
[]
|
|
22664
22949
|
);
|
|
22665
|
-
|
|
22950
|
+
React85__default.useCallback(
|
|
22666
22951
|
(group) => {
|
|
22667
22952
|
for (const z of zonesRef.current.values()) {
|
|
22668
22953
|
if (z.group === group) return z;
|
|
@@ -22671,7 +22956,7 @@ function useDataDnd(args) {
|
|
|
22671
22956
|
},
|
|
22672
22957
|
[]
|
|
22673
22958
|
);
|
|
22674
|
-
const handleDragEnd =
|
|
22959
|
+
const handleDragEnd = React85__default.useCallback(
|
|
22675
22960
|
(event) => {
|
|
22676
22961
|
const { active, over } = event;
|
|
22677
22962
|
const activeIdStr = String(active.id);
|
|
@@ -22762,8 +23047,8 @@ function useDataDnd(args) {
|
|
|
22762
23047
|
},
|
|
22763
23048
|
[eventBus]
|
|
22764
23049
|
);
|
|
22765
|
-
const sortableData =
|
|
22766
|
-
const SortableItem =
|
|
23050
|
+
const sortableData = React85__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
23051
|
+
const SortableItem = React85__default.useCallback(
|
|
22767
23052
|
({ id, children }) => {
|
|
22768
23053
|
const {
|
|
22769
23054
|
attributes,
|
|
@@ -22803,7 +23088,7 @@ function useDataDnd(args) {
|
|
|
22803
23088
|
id: droppableId,
|
|
22804
23089
|
data: sortableData
|
|
22805
23090
|
});
|
|
22806
|
-
const ctx =
|
|
23091
|
+
const ctx = React85__default.useContext(RootCtx);
|
|
22807
23092
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
22808
23093
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
22809
23094
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -22818,7 +23103,7 @@ function useDataDnd(args) {
|
|
|
22818
23103
|
showForeignPlaceholder,
|
|
22819
23104
|
ctxAvailable: ctx != null
|
|
22820
23105
|
});
|
|
22821
|
-
|
|
23106
|
+
React85__default.useEffect(() => {
|
|
22822
23107
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
22823
23108
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
22824
23109
|
return /* @__PURE__ */ jsx(
|
|
@@ -22832,11 +23117,11 @@ function useDataDnd(args) {
|
|
|
22832
23117
|
}
|
|
22833
23118
|
);
|
|
22834
23119
|
};
|
|
22835
|
-
const rootContextValue =
|
|
23120
|
+
const rootContextValue = React85__default.useMemo(
|
|
22836
23121
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
22837
23122
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
22838
23123
|
);
|
|
22839
|
-
const handleDragStart =
|
|
23124
|
+
const handleDragStart = React85__default.useCallback((event) => {
|
|
22840
23125
|
const sourceZone = findZoneByItem(event.active.id);
|
|
22841
23126
|
const rect = event.active.rect.current.initial;
|
|
22842
23127
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -22855,7 +23140,7 @@ function useDataDnd(args) {
|
|
|
22855
23140
|
isRoot
|
|
22856
23141
|
});
|
|
22857
23142
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
22858
|
-
const handleDragOver =
|
|
23143
|
+
const handleDragOver = React85__default.useCallback((event) => {
|
|
22859
23144
|
const { active, over } = event;
|
|
22860
23145
|
const overData = over?.data?.current;
|
|
22861
23146
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -22925,7 +23210,7 @@ function useDataDnd(args) {
|
|
|
22925
23210
|
return next;
|
|
22926
23211
|
});
|
|
22927
23212
|
}, []);
|
|
22928
|
-
const handleDragCancel =
|
|
23213
|
+
const handleDragCancel = React85__default.useCallback((event) => {
|
|
22929
23214
|
setActiveDrag(null);
|
|
22930
23215
|
setOverZoneGroup(null);
|
|
22931
23216
|
dndLog.warn("dragCancel", {
|
|
@@ -22933,12 +23218,12 @@ function useDataDnd(args) {
|
|
|
22933
23218
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
22934
23219
|
});
|
|
22935
23220
|
}, []);
|
|
22936
|
-
const handleDragEndWithCleanup =
|
|
23221
|
+
const handleDragEndWithCleanup = React85__default.useCallback((event) => {
|
|
22937
23222
|
handleDragEnd(event);
|
|
22938
23223
|
setActiveDrag(null);
|
|
22939
23224
|
setOverZoneGroup(null);
|
|
22940
23225
|
}, [handleDragEnd]);
|
|
22941
|
-
const wrapContainer =
|
|
23226
|
+
const wrapContainer = React85__default.useCallback(
|
|
22942
23227
|
(children) => {
|
|
22943
23228
|
if (!enabled) return children;
|
|
22944
23229
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -22992,15 +23277,12 @@ var init_useDataDnd = __esm({
|
|
|
22992
23277
|
init_useAlmadarDndCollision();
|
|
22993
23278
|
init_Box();
|
|
22994
23279
|
dndLog = createLogger("almadar:ui:dnd");
|
|
22995
|
-
RootCtx =
|
|
23280
|
+
RootCtx = React85__default.createContext(null);
|
|
22996
23281
|
}
|
|
22997
23282
|
});
|
|
22998
23283
|
function renderIconInput(icon, props) {
|
|
22999
23284
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
23000
23285
|
}
|
|
23001
|
-
function fieldLabel2(key) {
|
|
23002
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
23003
|
-
}
|
|
23004
23286
|
function statusVariant2(value) {
|
|
23005
23287
|
const v = value.toLowerCase();
|
|
23006
23288
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
@@ -23019,29 +23301,6 @@ function resolveBadgeVariant(field, value) {
|
|
|
23019
23301
|
}
|
|
23020
23302
|
return statusVariant2(value);
|
|
23021
23303
|
}
|
|
23022
|
-
function formatDate2(value) {
|
|
23023
|
-
if (!value) return "";
|
|
23024
|
-
const d = new Date(String(value));
|
|
23025
|
-
if (isNaN(d.getTime())) return String(value);
|
|
23026
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
23027
|
-
}
|
|
23028
|
-
function formatValue(value, format) {
|
|
23029
|
-
if (value === void 0 || value === null) return "";
|
|
23030
|
-
switch (format) {
|
|
23031
|
-
case "date":
|
|
23032
|
-
return formatDate2(value);
|
|
23033
|
-
case "currency":
|
|
23034
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
23035
|
-
case "number":
|
|
23036
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
23037
|
-
case "percent":
|
|
23038
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
23039
|
-
case "boolean":
|
|
23040
|
-
return value ? "Yes" : "No";
|
|
23041
|
-
default:
|
|
23042
|
-
return String(value);
|
|
23043
|
-
}
|
|
23044
|
-
}
|
|
23045
23304
|
function DataGrid({
|
|
23046
23305
|
entity,
|
|
23047
23306
|
fields,
|
|
@@ -23328,7 +23587,7 @@ function DataGrid({
|
|
|
23328
23587
|
if (val === void 0 || val === null || val === "") return null;
|
|
23329
23588
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
23330
23589
|
field.icon && renderIconInput(field.icon, { size: "xs" }),
|
|
23331
|
-
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: formatValue(val, field.format) })
|
|
23590
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: humanizeEnumValue(formatValue(val, field.format)) })
|
|
23332
23591
|
] }, field.name);
|
|
23333
23592
|
}) })
|
|
23334
23593
|
] }),
|
|
@@ -23438,11 +23697,12 @@ function DataGrid({
|
|
|
23438
23697
|
] })
|
|
23439
23698
|
);
|
|
23440
23699
|
}
|
|
23441
|
-
var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
|
|
23700
|
+
var dataGridLog, fieldLabel2, BADGE_VARIANTS, gapStyles5, lookStyles5;
|
|
23442
23701
|
var init_DataGrid = __esm({
|
|
23443
23702
|
"components/core/molecules/DataGrid.tsx"() {
|
|
23444
23703
|
"use client";
|
|
23445
23704
|
init_cn();
|
|
23705
|
+
init_format();
|
|
23446
23706
|
init_getNestedValue();
|
|
23447
23707
|
init_useEventBus();
|
|
23448
23708
|
init_Box();
|
|
@@ -23455,6 +23715,7 @@ var init_DataGrid = __esm({
|
|
|
23455
23715
|
init_Menu();
|
|
23456
23716
|
init_useDataDnd();
|
|
23457
23717
|
dataGridLog = createLogger("almadar:ui:data-grid");
|
|
23718
|
+
fieldLabel2 = humanizeFieldName;
|
|
23458
23719
|
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
23459
23720
|
"default",
|
|
23460
23721
|
"primary",
|
|
@@ -23486,9 +23747,6 @@ var init_DataGrid = __esm({
|
|
|
23486
23747
|
function renderIconInput2(icon, props) {
|
|
23487
23748
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
23488
23749
|
}
|
|
23489
|
-
function fieldLabel3(key) {
|
|
23490
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
23491
|
-
}
|
|
23492
23750
|
function statusVariant3(value) {
|
|
23493
23751
|
const v = value.toLowerCase();
|
|
23494
23752
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
@@ -23497,28 +23755,12 @@ function statusVariant3(value) {
|
|
|
23497
23755
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
23498
23756
|
return "default";
|
|
23499
23757
|
}
|
|
23500
|
-
function formatDate3(value) {
|
|
23501
|
-
if (!value) return "";
|
|
23502
|
-
const d = new Date(String(value));
|
|
23503
|
-
if (isNaN(d.getTime())) return String(value);
|
|
23504
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
23505
|
-
}
|
|
23506
23758
|
function formatValue2(value, format, boolLabels) {
|
|
23507
|
-
if (value
|
|
23508
|
-
|
|
23509
|
-
|
|
23510
|
-
return formatDate3(value);
|
|
23511
|
-
case "currency":
|
|
23512
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
23513
|
-
case "number":
|
|
23514
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
23515
|
-
case "percent":
|
|
23516
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
23517
|
-
case "boolean":
|
|
23518
|
-
return value ? boolLabels?.yes ?? "Yes" : boolLabels?.no ?? "No";
|
|
23519
|
-
default:
|
|
23520
|
-
return String(value);
|
|
23759
|
+
if (value !== void 0 && value !== null && (format === "boolean" || typeof value === "boolean")) {
|
|
23760
|
+
const isNo = value === false || value === 0 || String(value) === "false";
|
|
23761
|
+
return isNo ? boolLabels?.no ?? "No" : boolLabels?.yes ?? "Yes";
|
|
23521
23762
|
}
|
|
23763
|
+
return formatValue(value, format);
|
|
23522
23764
|
}
|
|
23523
23765
|
function groupData(items, field) {
|
|
23524
23766
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -23541,7 +23783,9 @@ function DataList({
|
|
|
23541
23783
|
variant = "default",
|
|
23542
23784
|
groupBy,
|
|
23543
23785
|
senderField,
|
|
23786
|
+
senderLabelField,
|
|
23544
23787
|
currentUser,
|
|
23788
|
+
emptyMessage,
|
|
23545
23789
|
className,
|
|
23546
23790
|
isLoading = false,
|
|
23547
23791
|
error = null,
|
|
@@ -23573,7 +23817,7 @@ function DataList({
|
|
|
23573
23817
|
}) {
|
|
23574
23818
|
const eventBus = useEventBus();
|
|
23575
23819
|
const { t } = useTranslate();
|
|
23576
|
-
const [visibleCount, setVisibleCount] =
|
|
23820
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize || Infinity);
|
|
23577
23821
|
const fieldDefs = fields ?? columns ?? [];
|
|
23578
23822
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
23579
23823
|
const dnd = useDataDnd({
|
|
@@ -23592,7 +23836,7 @@ function DataList({
|
|
|
23592
23836
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
23593
23837
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
23594
23838
|
const hasRenderProp = typeof children === "function";
|
|
23595
|
-
|
|
23839
|
+
React85__default.useEffect(() => {
|
|
23596
23840
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
23597
23841
|
const childrenTypeOf = typeof children;
|
|
23598
23842
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -23680,7 +23924,7 @@ function DataList({
|
|
|
23680
23924
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) });
|
|
23681
23925
|
}
|
|
23682
23926
|
if (data.length === 0) {
|
|
23683
|
-
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") }) });
|
|
23927
|
+
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") }) });
|
|
23684
23928
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
23685
23929
|
}
|
|
23686
23930
|
const gapClass = {
|
|
@@ -23696,51 +23940,93 @@ function DataList({
|
|
|
23696
23940
|
const items2 = [...data];
|
|
23697
23941
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
23698
23942
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
23699
|
-
|
|
23700
|
-
|
|
23701
|
-
|
|
23702
|
-
|
|
23703
|
-
|
|
23704
|
-
|
|
23705
|
-
|
|
23706
|
-
|
|
23707
|
-
|
|
23708
|
-
|
|
23709
|
-
|
|
23710
|
-
|
|
23711
|
-
|
|
23712
|
-
|
|
23713
|
-
|
|
23714
|
-
|
|
23715
|
-
|
|
23716
|
-
|
|
23717
|
-
|
|
23718
|
-
|
|
23719
|
-
|
|
23720
|
-
|
|
23721
|
-
|
|
23722
|
-
|
|
23723
|
-
|
|
23724
|
-
|
|
23725
|
-
|
|
23726
|
-
|
|
23727
|
-
|
|
23728
|
-
|
|
23729
|
-
|
|
23730
|
-
|
|
23731
|
-
|
|
23732
|
-
|
|
23733
|
-
|
|
23734
|
-
|
|
23735
|
-
|
|
23736
|
-
|
|
23737
|
-
|
|
23738
|
-
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
23742
|
-
|
|
23743
|
-
|
|
23943
|
+
const senderLabel = (itemData, raw) => {
|
|
23944
|
+
if (!senderLabelField) return raw;
|
|
23945
|
+
const v = getNestedValue(itemData, senderLabelField);
|
|
23946
|
+
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
23947
|
+
};
|
|
23948
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
23949
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
23950
|
+
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
23951
|
+
group.items.map((itemData, index) => {
|
|
23952
|
+
const id = itemData.id || `${gi}-${index}`;
|
|
23953
|
+
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
23954
|
+
const isSent = Boolean(currentUser && sender === currentUser);
|
|
23955
|
+
const content = getNestedValue(itemData, contentField);
|
|
23956
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
23957
|
+
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
23958
|
+
const metaFields = fieldDefs.filter(
|
|
23959
|
+
(f3) => f3.name !== contentField && f3.name !== timestampField?.name
|
|
23960
|
+
);
|
|
23961
|
+
return /* @__PURE__ */ jsx(
|
|
23962
|
+
Box,
|
|
23963
|
+
{
|
|
23964
|
+
"data-entity-row": true,
|
|
23965
|
+
"data-entity-id": id,
|
|
23966
|
+
onClick: itemClickEvent ? handleRowClick(itemData) : void 0,
|
|
23967
|
+
className: cn(
|
|
23968
|
+
"flex px-4 group/rowactions",
|
|
23969
|
+
itemClickEvent && "cursor-pointer",
|
|
23970
|
+
isSent ? "justify-end" : "justify-start"
|
|
23971
|
+
),
|
|
23972
|
+
children: /* @__PURE__ */ jsxs(
|
|
23973
|
+
Box,
|
|
23974
|
+
{
|
|
23975
|
+
className: cn(
|
|
23976
|
+
"max-w-[75%] px-4 py-2",
|
|
23977
|
+
isSent ? "bg-primary text-primary-foreground rounded-2xl rounded-br-sm" : "bg-muted text-foreground rounded-2xl rounded-bl-sm"
|
|
23978
|
+
),
|
|
23979
|
+
children: [
|
|
23980
|
+
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: senderLabel(itemData, sender) }),
|
|
23981
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
23982
|
+
metaFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1 flex-wrap", children: metaFields.map((f3) => {
|
|
23983
|
+
const v = getNestedValue(itemData, f3.name);
|
|
23984
|
+
if (v === void 0 || v === null || v === "") return null;
|
|
23985
|
+
return f3.variant === "badge" ? /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(v)), children: String(v) }, f3.name) : /* @__PURE__ */ jsx(
|
|
23986
|
+
Typography,
|
|
23987
|
+
{
|
|
23988
|
+
variant: "caption",
|
|
23989
|
+
className: cn("text-xs", isSent ? "opacity-70" : "text-muted-foreground"),
|
|
23990
|
+
children: formatValue2(v, f3.format)
|
|
23991
|
+
},
|
|
23992
|
+
f3.name
|
|
23993
|
+
);
|
|
23994
|
+
}) }),
|
|
23995
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "mt-1 items-center justify-between", children: [
|
|
23996
|
+
timestamp != null ? /* @__PURE__ */ jsx(
|
|
23997
|
+
Typography,
|
|
23998
|
+
{
|
|
23999
|
+
variant: "caption",
|
|
24000
|
+
className: cn("text-xs", isSent ? "opacity-70" : "text-muted-foreground"),
|
|
24001
|
+
children: formatDate(timestamp)
|
|
24002
|
+
}
|
|
24003
|
+
) : /* @__PURE__ */ jsx("span", {}),
|
|
24004
|
+
renderItemActions(itemData)
|
|
24005
|
+
] })
|
|
24006
|
+
]
|
|
24007
|
+
}
|
|
24008
|
+
)
|
|
24009
|
+
},
|
|
24010
|
+
id
|
|
24011
|
+
);
|
|
24012
|
+
})
|
|
24013
|
+
] }, gi)),
|
|
24014
|
+
hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
|
|
24015
|
+
Button,
|
|
24016
|
+
{
|
|
24017
|
+
variant: "ghost",
|
|
24018
|
+
size: "sm",
|
|
24019
|
+
onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
24020
|
+
children: [
|
|
24021
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
24022
|
+
t("common.showMore"),
|
|
24023
|
+
" (",
|
|
24024
|
+
t("common.remaining", { count: allData.length - visibleCount }),
|
|
24025
|
+
")"
|
|
24026
|
+
]
|
|
24027
|
+
}
|
|
24028
|
+
) })
|
|
24029
|
+
] });
|
|
23744
24030
|
}
|
|
23745
24031
|
const items = [...data];
|
|
23746
24032
|
const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
|
|
@@ -23855,7 +24141,7 @@ function DataList({
|
|
|
23855
24141
|
className
|
|
23856
24142
|
),
|
|
23857
24143
|
children: [
|
|
23858
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
24144
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
23859
24145
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
23860
24146
|
group.items.map(
|
|
23861
24147
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -23889,11 +24175,12 @@ function DataList({
|
|
|
23889
24175
|
)
|
|
23890
24176
|
);
|
|
23891
24177
|
}
|
|
23892
|
-
var dataListLog, listLookStyles;
|
|
24178
|
+
var dataListLog, fieldLabel3, listLookStyles;
|
|
23893
24179
|
var init_DataList = __esm({
|
|
23894
24180
|
"components/core/molecules/DataList.tsx"() {
|
|
23895
24181
|
"use client";
|
|
23896
24182
|
init_cn();
|
|
24183
|
+
init_format();
|
|
23897
24184
|
init_getNestedValue();
|
|
23898
24185
|
init_useEventBus();
|
|
23899
24186
|
init_Box();
|
|
@@ -23908,6 +24195,7 @@ var init_DataList = __esm({
|
|
|
23908
24195
|
init_Menu();
|
|
23909
24196
|
init_useDataDnd();
|
|
23910
24197
|
dataListLog = createLogger("almadar:ui:data-list");
|
|
24198
|
+
fieldLabel3 = humanizeFieldName;
|
|
23911
24199
|
listLookStyles = {
|
|
23912
24200
|
dense: "[&_[data-entity-row]>div]:!py-1 [&_[data-entity-row]>div]:!px-3",
|
|
23913
24201
|
spacious: "[&_[data-entity-row]>div]:!py-5 [&_[data-entity-row]>div]:!px-8",
|
|
@@ -23940,7 +24228,7 @@ var init_FormSection = __esm({
|
|
|
23940
24228
|
columns = 1,
|
|
23941
24229
|
className
|
|
23942
24230
|
}) => {
|
|
23943
|
-
const [collapsed, setCollapsed] =
|
|
24231
|
+
const [collapsed, setCollapsed] = React85__default.useState(defaultCollapsed);
|
|
23944
24232
|
const { t } = useTranslate();
|
|
23945
24233
|
const eventBus = useEventBus();
|
|
23946
24234
|
const gridClass = {
|
|
@@ -23948,7 +24236,7 @@ var init_FormSection = __esm({
|
|
|
23948
24236
|
2: "grid-cols-1 md:grid-cols-2",
|
|
23949
24237
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
23950
24238
|
}[columns];
|
|
23951
|
-
|
|
24239
|
+
React85__default.useCallback(() => {
|
|
23952
24240
|
if (collapsible) {
|
|
23953
24241
|
setCollapsed((prev) => !prev);
|
|
23954
24242
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -24817,7 +25105,7 @@ var init_Flex = __esm({
|
|
|
24817
25105
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
24818
25106
|
}
|
|
24819
25107
|
}
|
|
24820
|
-
return
|
|
25108
|
+
return React85__default.createElement(Component, {
|
|
24821
25109
|
className: cn(
|
|
24822
25110
|
inline ? "inline-flex" : "flex",
|
|
24823
25111
|
directionStyles[direction],
|
|
@@ -24936,7 +25224,7 @@ var init_Grid = __esm({
|
|
|
24936
25224
|
as: Component = "div"
|
|
24937
25225
|
}) => {
|
|
24938
25226
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
24939
|
-
return
|
|
25227
|
+
return React85__default.createElement(
|
|
24940
25228
|
Component,
|
|
24941
25229
|
{
|
|
24942
25230
|
className: cn(
|
|
@@ -25144,9 +25432,9 @@ var init_Popover = __esm({
|
|
|
25144
25432
|
onMouseLeave: handleClose,
|
|
25145
25433
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
25146
25434
|
};
|
|
25147
|
-
const childElement =
|
|
25435
|
+
const childElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25148
25436
|
const childPointerDown = childElement.props.onPointerDown;
|
|
25149
|
-
const triggerElement =
|
|
25437
|
+
const triggerElement = React85__default.cloneElement(
|
|
25150
25438
|
childElement,
|
|
25151
25439
|
{
|
|
25152
25440
|
ref: triggerRef,
|
|
@@ -25755,9 +26043,9 @@ var init_Tooltip = __esm({
|
|
|
25755
26043
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
25756
26044
|
};
|
|
25757
26045
|
}, []);
|
|
25758
|
-
const triggerElement =
|
|
26046
|
+
const triggerElement = React85__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
25759
26047
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
25760
|
-
const trigger =
|
|
26048
|
+
const trigger = React85__default.cloneElement(triggerElement, {
|
|
25761
26049
|
ref: triggerRef,
|
|
25762
26050
|
onMouseEnter: handleMouseEnter,
|
|
25763
26051
|
onMouseLeave: handleMouseLeave,
|
|
@@ -25847,7 +26135,7 @@ var init_WizardProgress = __esm({
|
|
|
25847
26135
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
25848
26136
|
const isActive = index === currentStep;
|
|
25849
26137
|
const isCompleted = index < currentStep;
|
|
25850
|
-
return /* @__PURE__ */ jsxs(
|
|
26138
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
25851
26139
|
/* @__PURE__ */ jsx(
|
|
25852
26140
|
"button",
|
|
25853
26141
|
{
|
|
@@ -27408,13 +27696,13 @@ var init_MapView = __esm({
|
|
|
27408
27696
|
shadowSize: [41, 41]
|
|
27409
27697
|
});
|
|
27410
27698
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
27411
|
-
const { useEffect:
|
|
27699
|
+
const { useEffect: useEffect63, useRef: useRef61, useCallback: useCallback95, useState: useState91 } = React85__default;
|
|
27412
27700
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
27413
27701
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
27414
27702
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
27415
27703
|
const map = useMap();
|
|
27416
|
-
const prevRef =
|
|
27417
|
-
|
|
27704
|
+
const prevRef = useRef61({ centerLat, centerLng, zoom });
|
|
27705
|
+
useEffect63(() => {
|
|
27418
27706
|
const prev = prevRef.current;
|
|
27419
27707
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
27420
27708
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -27425,7 +27713,7 @@ var init_MapView = __esm({
|
|
|
27425
27713
|
}
|
|
27426
27714
|
function MapClickHandler({ onMapClick }) {
|
|
27427
27715
|
const map = useMap();
|
|
27428
|
-
|
|
27716
|
+
useEffect63(() => {
|
|
27429
27717
|
if (!onMapClick) return;
|
|
27430
27718
|
const handler = (e) => {
|
|
27431
27719
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -27454,7 +27742,7 @@ var init_MapView = __esm({
|
|
|
27454
27742
|
}) {
|
|
27455
27743
|
const eventBus = useEventBus2();
|
|
27456
27744
|
const [clickedPosition, setClickedPosition] = useState91(null);
|
|
27457
|
-
const handleMapClick =
|
|
27745
|
+
const handleMapClick = useCallback95((lat, lng) => {
|
|
27458
27746
|
if (showClickedPin) {
|
|
27459
27747
|
setClickedPosition({ lat, lng });
|
|
27460
27748
|
}
|
|
@@ -27463,7 +27751,7 @@ var init_MapView = __esm({
|
|
|
27463
27751
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
27464
27752
|
}
|
|
27465
27753
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
27466
|
-
const handleMarkerClick =
|
|
27754
|
+
const handleMarkerClick = useCallback95((marker) => {
|
|
27467
27755
|
onMarkerClick?.(marker);
|
|
27468
27756
|
if (markerClickEvent) {
|
|
27469
27757
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -28263,7 +28551,7 @@ function renderIconInput3(icon, props) {
|
|
|
28263
28551
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
28264
28552
|
}
|
|
28265
28553
|
function columnLabel(col) {
|
|
28266
|
-
return col.header ?? col.label ?? col.key
|
|
28554
|
+
return col.header ?? col.label ?? humanizeFieldName(col.key);
|
|
28267
28555
|
}
|
|
28268
28556
|
function asFieldValue(v) {
|
|
28269
28557
|
if (v === void 0 || v === null) return v;
|
|
@@ -28282,25 +28570,6 @@ function statusVariant4(value) {
|
|
|
28282
28570
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
28283
28571
|
return "default";
|
|
28284
28572
|
}
|
|
28285
|
-
function formatCell(value, format) {
|
|
28286
|
-
if (value === void 0 || value === null) return "";
|
|
28287
|
-
switch (format) {
|
|
28288
|
-
case "date": {
|
|
28289
|
-
const d = new Date(String(value));
|
|
28290
|
-
return isNaN(d.getTime()) ? String(value) : d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
28291
|
-
}
|
|
28292
|
-
case "currency":
|
|
28293
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
28294
|
-
case "number":
|
|
28295
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
28296
|
-
case "percent":
|
|
28297
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
28298
|
-
case "boolean":
|
|
28299
|
-
return value ? "Yes" : "No";
|
|
28300
|
-
default:
|
|
28301
|
-
return String(value);
|
|
28302
|
-
}
|
|
28303
|
-
}
|
|
28304
28573
|
function groupData2(items, field) {
|
|
28305
28574
|
const groups = /* @__PURE__ */ new Map();
|
|
28306
28575
|
for (const item of items) {
|
|
@@ -28344,9 +28613,10 @@ function TableView({
|
|
|
28344
28613
|
}) {
|
|
28345
28614
|
const eventBus = useEventBus();
|
|
28346
28615
|
const { t } = useTranslate();
|
|
28347
|
-
const [visibleCount, setVisibleCount] =
|
|
28348
|
-
const [localSelected, setLocalSelected] =
|
|
28349
|
-
const colDefs = columns ?? fields ?? [];
|
|
28616
|
+
const [visibleCount, setVisibleCount] = React85__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28617
|
+
const [localSelected, setLocalSelected] = React85__default.useState(/* @__PURE__ */ new Set());
|
|
28618
|
+
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
28619
|
+
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
28350
28620
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
28351
28621
|
const dnd = useDataDnd({
|
|
28352
28622
|
items: allDataRaw,
|
|
@@ -28366,6 +28636,23 @@ function TableView({
|
|
|
28366
28636
|
const hasRenderProp = typeof children === "function";
|
|
28367
28637
|
const idField = dndItemIdField ?? "id";
|
|
28368
28638
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
28639
|
+
React85__default.useEffect(() => {
|
|
28640
|
+
tableViewLog.debug("render", {
|
|
28641
|
+
rowCount: data.length,
|
|
28642
|
+
colCount: colDefs.length,
|
|
28643
|
+
look,
|
|
28644
|
+
isLoading: Boolean(isLoading),
|
|
28645
|
+
hasError: Boolean(error),
|
|
28646
|
+
dnd: dnd.enabled
|
|
28647
|
+
});
|
|
28648
|
+
if (data.length > 0 && !hasRenderProp && colDefs.length === 0) {
|
|
28649
|
+
tableViewLog.warn("columns-unresolved", {
|
|
28650
|
+
rowCount: data.length,
|
|
28651
|
+
columnsIsArray: Array.isArray(columns),
|
|
28652
|
+
fieldsIsArray: Array.isArray(fields)
|
|
28653
|
+
});
|
|
28654
|
+
}
|
|
28655
|
+
}, [data, colDefs, look, isLoading, error, dnd.enabled, hasRenderProp, columns, fields]);
|
|
28369
28656
|
const selected = selectedIds ? new Set(selectedIds) : localSelected;
|
|
28370
28657
|
const emitSelection = (next) => {
|
|
28371
28658
|
if (!selectedIds) setLocalSelected(next);
|
|
@@ -28398,7 +28685,7 @@ function TableView({
|
|
|
28398
28685
|
};
|
|
28399
28686
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
28400
28687
|
};
|
|
28401
|
-
const colFloors =
|
|
28688
|
+
const colFloors = React85__default.useMemo(
|
|
28402
28689
|
() => colDefs.map((col) => {
|
|
28403
28690
|
const longest = data.reduce((widest, row) => {
|
|
28404
28691
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -28409,21 +28696,12 @@ function TableView({
|
|
|
28409
28696
|
}),
|
|
28410
28697
|
[colDefs, data]
|
|
28411
28698
|
);
|
|
28412
|
-
|
|
28413
|
-
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") }) });
|
|
28414
|
-
}
|
|
28415
|
-
if (error) {
|
|
28416
|
-
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) });
|
|
28417
|
-
}
|
|
28418
|
-
if (data.length === 0) {
|
|
28419
|
-
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") }) });
|
|
28420
|
-
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
28421
|
-
}
|
|
28699
|
+
const statusNode = isLoading ? /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") }) }) : error ? /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) }) : data.length === 0 ? /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") }) }) : null;
|
|
28422
28700
|
const lk = LOOKS[look];
|
|
28423
|
-
const hasActions =
|
|
28701
|
+
const hasActions = actionDefs.length > 0;
|
|
28424
28702
|
const effectiveMaxInline = isCoarsePointer ? 0 : maxInlineActions;
|
|
28425
|
-
const inlineActionCount = hasActions ? effectiveMaxInline != null ? Math.min(
|
|
28426
|
-
const hasOverflowActions = hasActions && effectiveMaxInline != null &&
|
|
28703
|
+
const inlineActionCount = hasActions ? effectiveMaxInline != null ? Math.min(actionDefs.length, effectiveMaxInline) : actionDefs.length : 0;
|
|
28704
|
+
const hasOverflowActions = hasActions && effectiveMaxInline != null && actionDefs.length > effectiveMaxInline;
|
|
28427
28705
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
28428
28706
|
const gridTemplateColumns = [
|
|
28429
28707
|
selectable ? "auto" : null,
|
|
@@ -28511,11 +28789,11 @@ function TableView({
|
|
|
28511
28789
|
col.className
|
|
28512
28790
|
);
|
|
28513
28791
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
28514
|
-
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", className: "whitespace-nowrap", children: String(raw) }) }, col.key);
|
|
28792
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", className: "whitespace-nowrap", children: humanizeEnumValue(String(raw)) }) }, col.key);
|
|
28515
28793
|
}
|
|
28516
28794
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format) }) }, col.key);
|
|
28517
28795
|
}),
|
|
28518
|
-
|
|
28796
|
+
hasActions && /* @__PURE__ */ jsxs(
|
|
28519
28797
|
HStack,
|
|
28520
28798
|
{
|
|
28521
28799
|
gap: "xs",
|
|
@@ -28527,7 +28805,7 @@ function TableView({
|
|
|
28527
28805
|
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
28528
28806
|
),
|
|
28529
28807
|
children: [
|
|
28530
|
-
(effectiveMaxInline != null ?
|
|
28808
|
+
(effectiveMaxInline != null ? actionDefs.slice(0, effectiveMaxInline) : actionDefs).map((action, i) => /* @__PURE__ */ jsxs(
|
|
28531
28809
|
Button,
|
|
28532
28810
|
{
|
|
28533
28811
|
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
@@ -28543,12 +28821,12 @@ function TableView({
|
|
|
28543
28821
|
},
|
|
28544
28822
|
i
|
|
28545
28823
|
)),
|
|
28546
|
-
effectiveMaxInline != null &&
|
|
28824
|
+
effectiveMaxInline != null && actionDefs.length > effectiveMaxInline && /* @__PURE__ */ jsx(
|
|
28547
28825
|
Menu,
|
|
28548
28826
|
{
|
|
28549
28827
|
position: "bottom-end",
|
|
28550
28828
|
trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
|
|
28551
|
-
items:
|
|
28829
|
+
items: actionDefs.slice(effectiveMaxInline).map((action) => ({
|
|
28552
28830
|
label: action.label,
|
|
28553
28831
|
icon: action.icon,
|
|
28554
28832
|
event: action.event,
|
|
@@ -28566,24 +28844,25 @@ function TableView({
|
|
|
28566
28844
|
]
|
|
28567
28845
|
}
|
|
28568
28846
|
);
|
|
28569
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
28847
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React85__default.Fragment, { children: rowInner }, id);
|
|
28570
28848
|
};
|
|
28571
28849
|
const items = Array.from(data);
|
|
28572
28850
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
28573
28851
|
let runningIndex = 0;
|
|
28574
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
28852
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
28575
28853
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
28576
28854
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
28577
28855
|
] }, gi)) });
|
|
28856
|
+
const showHeader = colDefs.length > 0 || hasRenderProp;
|
|
28578
28857
|
return /* @__PURE__ */ jsxs(
|
|
28579
28858
|
Box,
|
|
28580
28859
|
{
|
|
28581
28860
|
role: "table",
|
|
28582
28861
|
className: cn("w-full text-sm", className),
|
|
28583
28862
|
children: [
|
|
28584
|
-
header,
|
|
28585
|
-
dnd.wrapContainer(body),
|
|
28586
|
-
hasMore && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((p) => p + (pageSize || 5)), children: [
|
|
28863
|
+
showHeader && header,
|
|
28864
|
+
dnd.wrapContainer(statusNode ? /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: statusNode }) : body),
|
|
28865
|
+
!statusNode && hasMore && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((p) => p + (pageSize || 5)), children: [
|
|
28587
28866
|
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
28588
28867
|
t("common.showMore"),
|
|
28589
28868
|
" (",
|
|
@@ -28594,11 +28873,12 @@ function TableView({
|
|
|
28594
28873
|
}
|
|
28595
28874
|
);
|
|
28596
28875
|
}
|
|
28597
|
-
var MAX_MEASURED_COL_CH, BADGE_CHROME_CH, alignClass, weightClass, LOOKS;
|
|
28876
|
+
var tableViewLog, formatCell, MAX_MEASURED_COL_CH, BADGE_CHROME_CH, alignClass, weightClass, LOOKS;
|
|
28598
28877
|
var init_TableView = __esm({
|
|
28599
28878
|
"components/core/molecules/TableView.tsx"() {
|
|
28600
28879
|
"use client";
|
|
28601
28880
|
init_cn();
|
|
28881
|
+
init_format();
|
|
28602
28882
|
init_getNestedValue();
|
|
28603
28883
|
init_useEventBus();
|
|
28604
28884
|
init_useMediaQuery();
|
|
@@ -28612,7 +28892,8 @@ var init_TableView = __esm({
|
|
|
28612
28892
|
init_Divider();
|
|
28613
28893
|
init_Menu();
|
|
28614
28894
|
init_useDataDnd();
|
|
28615
|
-
createLogger("almadar:ui:table-view");
|
|
28895
|
+
tableViewLog = createLogger("almadar:ui:table-view");
|
|
28896
|
+
formatCell = (value, format) => formatValue(value, format);
|
|
28616
28897
|
MAX_MEASURED_COL_CH = 32;
|
|
28617
28898
|
BADGE_CHROME_CH = 4;
|
|
28618
28899
|
alignClass = {
|
|
@@ -29931,7 +30212,7 @@ var init_StepFlow = __esm({
|
|
|
29931
30212
|
className
|
|
29932
30213
|
}) => {
|
|
29933
30214
|
if (orientation === "vertical") {
|
|
29934
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
30215
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React85__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
29935
30216
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
29936
30217
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29937
30218
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -29942,7 +30223,7 @@ var init_StepFlow = __esm({
|
|
|
29942
30223
|
] })
|
|
29943
30224
|
] }) }, index)) });
|
|
29944
30225
|
}
|
|
29945
|
-
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(
|
|
30226
|
+
return /* @__PURE__ */ jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
29946
30227
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
29947
30228
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
29948
30229
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -30932,7 +31213,7 @@ var init_LikertScale = __esm({
|
|
|
30932
31213
|
md: "text-base",
|
|
30933
31214
|
lg: "text-lg"
|
|
30934
31215
|
};
|
|
30935
|
-
LikertScale =
|
|
31216
|
+
LikertScale = React85__default.forwardRef(
|
|
30936
31217
|
({
|
|
30937
31218
|
question,
|
|
30938
31219
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -30944,7 +31225,7 @@ var init_LikertScale = __esm({
|
|
|
30944
31225
|
variant = "radios",
|
|
30945
31226
|
className
|
|
30946
31227
|
}, ref) => {
|
|
30947
|
-
const groupId =
|
|
31228
|
+
const groupId = React85__default.useId();
|
|
30948
31229
|
const eventBus = useEventBus();
|
|
30949
31230
|
const handleSelect = useCallback(
|
|
30950
31231
|
(next) => {
|
|
@@ -33233,7 +33514,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
33233
33514
|
"aria-label": t("aria.breadcrumb"),
|
|
33234
33515
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
33235
33516
|
const isLast = idx === items.length - 1;
|
|
33236
|
-
return /* @__PURE__ */ jsxs(
|
|
33517
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
33237
33518
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
33238
33519
|
Icon,
|
|
33239
33520
|
{
|
|
@@ -34102,7 +34383,7 @@ var init_MiniStateMachine = __esm({
|
|
|
34102
34383
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
34103
34384
|
const tc = transitionCounts[s.name] ?? 0;
|
|
34104
34385
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
34105
|
-
return /* @__PURE__ */ jsxs(
|
|
34386
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
34106
34387
|
/* @__PURE__ */ jsx(
|
|
34107
34388
|
AvlState,
|
|
34108
34389
|
{
|
|
@@ -34306,7 +34587,7 @@ var init_PageHeader = __esm({
|
|
|
34306
34587
|
info: "bg-info/10 text-info"
|
|
34307
34588
|
};
|
|
34308
34589
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
34309
|
-
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(
|
|
34590
|
+
breadcrumbs && breadcrumbs.length > 0 && /* @__PURE__ */ jsx(Box, { as: "nav", className: "mb-4", children: /* @__PURE__ */ jsx(Box, { as: "ol", className: "flex items-center gap-2 text-sm", children: breadcrumbs.map((crumb, idx) => /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
34310
34591
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
34311
34592
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
34312
34593
|
"a",
|
|
@@ -34664,7 +34945,7 @@ var init_Section = __esm({
|
|
|
34664
34945
|
as: Component = "section"
|
|
34665
34946
|
}) => {
|
|
34666
34947
|
const hasHeader = title || description || action;
|
|
34667
|
-
return
|
|
34948
|
+
return React85__default.createElement(
|
|
34668
34949
|
Component,
|
|
34669
34950
|
{
|
|
34670
34951
|
className: cn(
|
|
@@ -35038,7 +35319,7 @@ var init_WizardContainer = __esm({
|
|
|
35038
35319
|
const isCompleted = index < currentStep;
|
|
35039
35320
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
35040
35321
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
35041
|
-
return /* @__PURE__ */ jsxs(
|
|
35322
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
35042
35323
|
/* @__PURE__ */ jsx(
|
|
35043
35324
|
Button,
|
|
35044
35325
|
{
|
|
@@ -35996,6 +36277,7 @@ var init_GraphCanvas = __esm({
|
|
|
35996
36277
|
title,
|
|
35997
36278
|
nodes: propNodes = NO_NODES,
|
|
35998
36279
|
edges: propEdges = NO_EDGES,
|
|
36280
|
+
proposedEdges = NO_EDGES,
|
|
35999
36281
|
similarity: propSimilarity = NO_SIM,
|
|
36000
36282
|
height = 400,
|
|
36001
36283
|
showLabels = true,
|
|
@@ -36003,6 +36285,7 @@ var init_GraphCanvas = __esm({
|
|
|
36003
36285
|
draggable = true,
|
|
36004
36286
|
actions,
|
|
36005
36287
|
onNodeClick,
|
|
36288
|
+
onMarkClick,
|
|
36006
36289
|
onNodeDoubleClick,
|
|
36007
36290
|
onBadgeClick,
|
|
36008
36291
|
nodeClickEvent,
|
|
@@ -36031,6 +36314,18 @@ var init_GraphCanvas = __esm({
|
|
|
36031
36314
|
const laidOutRef = useRef(false);
|
|
36032
36315
|
const [, forceUpdate] = useState(0);
|
|
36033
36316
|
const [logicalW, setLogicalW] = useState(800);
|
|
36317
|
+
const hasProposed = useMemo(() => propNodes.some((n) => n.mark?.kind === "proposed"), [propNodes]);
|
|
36318
|
+
const [pulseTick, setPulseTick] = useState(0);
|
|
36319
|
+
useEffect(() => {
|
|
36320
|
+
if (!hasProposed) return;
|
|
36321
|
+
let raf = 0;
|
|
36322
|
+
const loop = () => {
|
|
36323
|
+
setPulseTick((t2) => (t2 + 1) % 1e6);
|
|
36324
|
+
raf = requestAnimationFrame(loop);
|
|
36325
|
+
};
|
|
36326
|
+
raf = requestAnimationFrame(loop);
|
|
36327
|
+
return () => cancelAnimationFrame(raf);
|
|
36328
|
+
}, [hasProposed]);
|
|
36034
36329
|
useEffect(() => {
|
|
36035
36330
|
const canvas = canvasRef.current;
|
|
36036
36331
|
if (!canvas || typeof ResizeObserver === "undefined") return;
|
|
@@ -36332,18 +36627,38 @@ var init_GraphCanvas = __esm({
|
|
|
36332
36627
|
}
|
|
36333
36628
|
}
|
|
36334
36629
|
ctx.globalAlpha = 1;
|
|
36630
|
+
ctx.setLineDash([4, 4]);
|
|
36631
|
+
for (const edge of proposedEdges) {
|
|
36632
|
+
const source = nodes.find((n) => n.id === edge.source);
|
|
36633
|
+
const target = nodes.find((n) => n.id === edge.target);
|
|
36634
|
+
if (!source || !target) continue;
|
|
36635
|
+
ctx.globalAlpha = 0.4;
|
|
36636
|
+
ctx.beginPath();
|
|
36637
|
+
ctx.moveTo(source.x, source.y);
|
|
36638
|
+
ctx.lineTo(target.x, target.y);
|
|
36639
|
+
ctx.strokeStyle = edge.color || mutedColor;
|
|
36640
|
+
ctx.lineWidth = 1;
|
|
36641
|
+
ctx.stroke();
|
|
36642
|
+
}
|
|
36643
|
+
ctx.setLineDash([]);
|
|
36644
|
+
ctx.globalAlpha = 1;
|
|
36335
36645
|
for (const node of nodes) {
|
|
36336
36646
|
const size = node.size || 8;
|
|
36337
36647
|
const color = resolveColor3(node.color || getGroupColor(node.group, groups), canvas);
|
|
36338
36648
|
const isHovered = hoveredNode === node.id;
|
|
36339
36649
|
const isSelected = selectedNodeId !== void 0 && node.id === selectedNodeId;
|
|
36340
|
-
|
|
36650
|
+
const mark = node.mark;
|
|
36651
|
+
ctx.globalAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : mark?.kind === "proposed" ? 0.55 : 1;
|
|
36341
36652
|
const radius = isSelected ? size + 4 : isHovered ? size + 2 : size;
|
|
36342
36653
|
ctx.beginPath();
|
|
36343
36654
|
ctx.arc(node.x, node.y, radius, 0, Math.PI * 2);
|
|
36344
|
-
ctx.fillStyle = color;
|
|
36655
|
+
ctx.fillStyle = mark?.kind === "proposed" ? mutedColor : color;
|
|
36345
36656
|
ctx.fill();
|
|
36346
|
-
if (
|
|
36657
|
+
if (mark?.kind === "proposed") {
|
|
36658
|
+
ctx.setLineDash([3, 3]);
|
|
36659
|
+
ctx.strokeStyle = resolveColor3(mark.tint ?? "var(--color-warning)", canvas);
|
|
36660
|
+
ctx.lineWidth = 1.5;
|
|
36661
|
+
} else if (isSelected) {
|
|
36347
36662
|
ctx.strokeStyle = accentColor;
|
|
36348
36663
|
ctx.lineWidth = 3;
|
|
36349
36664
|
} else {
|
|
@@ -36351,6 +36666,28 @@ var init_GraphCanvas = __esm({
|
|
|
36351
36666
|
ctx.lineWidth = isHovered ? 2 : 1;
|
|
36352
36667
|
}
|
|
36353
36668
|
ctx.stroke();
|
|
36669
|
+
ctx.setLineDash([]);
|
|
36670
|
+
if (mark?.kind === "suggested") {
|
|
36671
|
+
ctx.beginPath();
|
|
36672
|
+
ctx.arc(node.x, node.y, radius + 3, 0, Math.PI * 2);
|
|
36673
|
+
ctx.strokeStyle = accentColor;
|
|
36674
|
+
ctx.lineWidth = 2;
|
|
36675
|
+
ctx.stroke();
|
|
36676
|
+
ctx.beginPath();
|
|
36677
|
+
ctx.arc(node.x + radius * 0.7, node.y - radius * 0.7, 2.5, 0, Math.PI * 2);
|
|
36678
|
+
ctx.fillStyle = accentColor;
|
|
36679
|
+
ctx.fill();
|
|
36680
|
+
} else if (mark?.kind === "proposed") {
|
|
36681
|
+
const phase = pulseTick % 60 / 60;
|
|
36682
|
+
const baseAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : 0.55;
|
|
36683
|
+
ctx.globalAlpha = baseAlpha * (0.4 + 0.4 * (1 - Math.abs(phase * 2 - 1)));
|
|
36684
|
+
ctx.beginPath();
|
|
36685
|
+
ctx.arc(node.x, node.y, radius + 6 + Math.sin(phase * Math.PI * 2) * 3, 0, Math.PI * 2);
|
|
36686
|
+
ctx.strokeStyle = resolveColor3(mark.tint ?? "var(--color-warning)", canvas);
|
|
36687
|
+
ctx.lineWidth = 1.5;
|
|
36688
|
+
ctx.stroke();
|
|
36689
|
+
ctx.globalAlpha = baseAlpha;
|
|
36690
|
+
}
|
|
36354
36691
|
if (showLabels && node.label) {
|
|
36355
36692
|
const displayLabel = truncateLabel(node.label);
|
|
36356
36693
|
ctx.font = `${isSelected || isHovered ? "700" : "600"} 12px ${fontFamily}`;
|
|
@@ -36485,11 +36822,15 @@ var init_GraphCanvas = __esm({
|
|
|
36485
36822
|
return;
|
|
36486
36823
|
}
|
|
36487
36824
|
}
|
|
36825
|
+
if (node.mark && onMarkClick) {
|
|
36826
|
+
onMarkClick(node);
|
|
36827
|
+
return;
|
|
36828
|
+
}
|
|
36488
36829
|
handleNodeClick(node);
|
|
36489
36830
|
}
|
|
36490
36831
|
}
|
|
36491
36832
|
},
|
|
36492
|
-
[toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
|
|
36833
|
+
[toCoords, nodeAt, handleNodeClick, onBadgeClick, onMarkClick, selectedNodeId]
|
|
36493
36834
|
);
|
|
36494
36835
|
const handlePointerLeave = useCallback(() => {
|
|
36495
36836
|
setHoveredNode(null);
|
|
@@ -36765,7 +37106,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
36765
37106
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
36766
37107
|
const summary = fieldSummary(unit);
|
|
36767
37108
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
36768
|
-
return /* @__PURE__ */ jsxs(
|
|
37109
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
36769
37110
|
/* @__PURE__ */ jsxs(
|
|
36770
37111
|
Box,
|
|
36771
37112
|
{
|
|
@@ -36862,7 +37203,7 @@ var init_ImportProgress = __esm({
|
|
|
36862
37203
|
PIPELINE.map((key, index) => {
|
|
36863
37204
|
const isComplete = index < currentIndex;
|
|
36864
37205
|
const isActive = index === currentIndex;
|
|
36865
|
-
return /* @__PURE__ */ jsxs(
|
|
37206
|
+
return /* @__PURE__ */ jsxs(React85__default.Fragment, { children: [
|
|
36866
37207
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
36867
37208
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
36868
37209
|
/* @__PURE__ */ jsx(
|
|
@@ -37016,9 +37357,6 @@ var init_types2 = __esm({
|
|
|
37016
37357
|
};
|
|
37017
37358
|
}
|
|
37018
37359
|
});
|
|
37019
|
-
function humanizeFieldName(name) {
|
|
37020
|
-
return name.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase()).replace(/\b([A-Z])([A-Z]+)\b/g, (_, first, rest) => first + rest.toLowerCase()).trim();
|
|
37021
|
-
}
|
|
37022
37360
|
function normalizeColumns(columns) {
|
|
37023
37361
|
return columns.map((col) => {
|
|
37024
37362
|
if (typeof col === "string") {
|
|
@@ -37080,7 +37418,17 @@ function DataTable({
|
|
|
37080
37418
|
const currentPageSize = pageSize ?? 20;
|
|
37081
37419
|
const total = totalCount ?? items.length;
|
|
37082
37420
|
const totalPages = Math.ceil(total / currentPageSize);
|
|
37083
|
-
const
|
|
37421
|
+
const withEventClick = (action) => {
|
|
37422
|
+
if (action.onClick || !action.event) return action;
|
|
37423
|
+
const event = action.event;
|
|
37424
|
+
return {
|
|
37425
|
+
...action,
|
|
37426
|
+
onClick: (row) => {
|
|
37427
|
+
eventBus.emit(`UI:${event}`, { row });
|
|
37428
|
+
}
|
|
37429
|
+
};
|
|
37430
|
+
};
|
|
37431
|
+
const rowActions = (externalRowActions ?? itemActions?.filter((a) => a.placement !== "bulk").map((action) => ({
|
|
37084
37432
|
label: action.label,
|
|
37085
37433
|
icon: action.icon,
|
|
37086
37434
|
variant: action.variant,
|
|
@@ -37100,7 +37448,17 @@ function DataTable({
|
|
|
37100
37448
|
});
|
|
37101
37449
|
}
|
|
37102
37450
|
}
|
|
37103
|
-
}));
|
|
37451
|
+
})))?.map(withEventClick);
|
|
37452
|
+
const normalizedBulkActions = bulkActions?.map((action) => {
|
|
37453
|
+
if (action.onClick || !action.event) return action;
|
|
37454
|
+
const event = action.event;
|
|
37455
|
+
return {
|
|
37456
|
+
...action,
|
|
37457
|
+
onClick: (selectedRows2) => {
|
|
37458
|
+
eventBus.emit(`UI:${event}`, { rows: selectedRows2 });
|
|
37459
|
+
}
|
|
37460
|
+
};
|
|
37461
|
+
});
|
|
37104
37462
|
const viewAction = itemActions?.find(
|
|
37105
37463
|
(a) => a.event === "VIEW" || a.navigatesTo
|
|
37106
37464
|
);
|
|
@@ -37208,7 +37566,7 @@ function DataTable({
|
|
|
37208
37566
|
}
|
|
37209
37567
|
)
|
|
37210
37568
|
] }),
|
|
37211
|
-
|
|
37569
|
+
normalizedBulkActions && selectedIds.length > 0 && /* @__PURE__ */ jsxs(HStack, { className: "items-center gap-2 pl-0 sm:pl-3 border-l-0 sm:border-l border-border", children: [
|
|
37212
37570
|
/* @__PURE__ */ jsx(
|
|
37213
37571
|
Typography,
|
|
37214
37572
|
{
|
|
@@ -37219,13 +37577,13 @@ function DataTable({
|
|
|
37219
37577
|
})
|
|
37220
37578
|
}
|
|
37221
37579
|
),
|
|
37222
|
-
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap gap-2", children:
|
|
37580
|
+
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap gap-2", children: normalizedBulkActions.map((action, idx) => /* @__PURE__ */ jsx(
|
|
37223
37581
|
Button,
|
|
37224
37582
|
{
|
|
37225
37583
|
variant: action.variant === "danger" ? "danger" : "secondary",
|
|
37226
37584
|
size: "sm",
|
|
37227
37585
|
leftIcon: action.icon,
|
|
37228
|
-
onClick: () => action.onClick(selectedRows),
|
|
37586
|
+
onClick: () => action.onClick?.(selectedRows),
|
|
37229
37587
|
children: action.label
|
|
37230
37588
|
},
|
|
37231
37589
|
idx
|
|
@@ -37387,7 +37745,7 @@ function DataTable({
|
|
|
37387
37745
|
),
|
|
37388
37746
|
onClick: (e) => {
|
|
37389
37747
|
e.stopPropagation();
|
|
37390
|
-
action.onClick(row);
|
|
37748
|
+
action.onClick?.(row);
|
|
37391
37749
|
setOpenActionMenu(null);
|
|
37392
37750
|
},
|
|
37393
37751
|
children: [
|
|
@@ -37423,6 +37781,7 @@ var init_DataTable = __esm({
|
|
|
37423
37781
|
"components/core/organisms/DataTable.tsx"() {
|
|
37424
37782
|
"use client";
|
|
37425
37783
|
init_cn();
|
|
37784
|
+
init_format();
|
|
37426
37785
|
init_getNestedValue();
|
|
37427
37786
|
init_atoms();
|
|
37428
37787
|
init_Box();
|
|
@@ -37475,9 +37834,6 @@ function getBadgeVariant(fieldName, value) {
|
|
|
37475
37834
|
}
|
|
37476
37835
|
return "default";
|
|
37477
37836
|
}
|
|
37478
|
-
function formatFieldLabel(fieldName) {
|
|
37479
|
-
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
37480
|
-
}
|
|
37481
37837
|
function formatFieldValue2(value, fieldName) {
|
|
37482
37838
|
if (typeof value === "number") {
|
|
37483
37839
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
@@ -37605,7 +37961,7 @@ function buildFieldTypeMap(fields) {
|
|
|
37605
37961
|
}
|
|
37606
37962
|
return map;
|
|
37607
37963
|
}
|
|
37608
|
-
var ReactMarkdown2, DetailPanel;
|
|
37964
|
+
var formatFieldLabel, ReactMarkdown2, DetailPanel;
|
|
37609
37965
|
var init_DetailPanel = __esm({
|
|
37610
37966
|
"components/core/organisms/DetailPanel.tsx"() {
|
|
37611
37967
|
"use client";
|
|
@@ -37617,8 +37973,10 @@ var init_DetailPanel = __esm({
|
|
|
37617
37973
|
init_ErrorState();
|
|
37618
37974
|
init_EmptyState();
|
|
37619
37975
|
init_cn();
|
|
37976
|
+
init_format();
|
|
37620
37977
|
init_getNestedValue();
|
|
37621
37978
|
init_useEventBus();
|
|
37979
|
+
formatFieldLabel = humanizeFieldName;
|
|
37622
37980
|
ReactMarkdown2 = lazy(() => import('react-markdown'));
|
|
37623
37981
|
DetailPanel = ({
|
|
37624
37982
|
title: propTitle,
|
|
@@ -37948,7 +38306,7 @@ var init_DetailPanel = __esm({
|
|
|
37948
38306
|
}
|
|
37949
38307
|
});
|
|
37950
38308
|
function extractTitle(children) {
|
|
37951
|
-
if (!
|
|
38309
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
37952
38310
|
const props = children.props;
|
|
37953
38311
|
if (typeof props.title === "string") {
|
|
37954
38312
|
return props.title;
|
|
@@ -38298,12 +38656,12 @@ var init_Form = __esm({
|
|
|
38298
38656
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
38299
38657
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
38300
38658
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
38301
|
-
const normalizedInitialData =
|
|
38659
|
+
const normalizedInitialData = React85__default.useMemo(() => {
|
|
38302
38660
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
38303
38661
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
38304
38662
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
38305
38663
|
}, [entity, initialData]);
|
|
38306
|
-
const entityDerivedFields =
|
|
38664
|
+
const entityDerivedFields = React85__default.useMemo(() => {
|
|
38307
38665
|
if (fields && fields.length > 0) return void 0;
|
|
38308
38666
|
if (!resolvedEntity) return void 0;
|
|
38309
38667
|
return resolvedEntity.fields.map(
|
|
@@ -38324,16 +38682,16 @@ var init_Form = __esm({
|
|
|
38324
38682
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
38325
38683
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
38326
38684
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
38327
|
-
const [formData, setFormData] =
|
|
38685
|
+
const [formData, setFormData] = React85__default.useState(
|
|
38328
38686
|
normalizedInitialData
|
|
38329
38687
|
);
|
|
38330
|
-
const [collapsedSections, setCollapsedSections] =
|
|
38688
|
+
const [collapsedSections, setCollapsedSections] = React85__default.useState(
|
|
38331
38689
|
/* @__PURE__ */ new Set()
|
|
38332
38690
|
);
|
|
38333
|
-
const [submitError, setSubmitError] =
|
|
38334
|
-
const formRef =
|
|
38691
|
+
const [submitError, setSubmitError] = React85__default.useState(null);
|
|
38692
|
+
const formRef = React85__default.useRef(null);
|
|
38335
38693
|
const formMode = props.mode;
|
|
38336
|
-
const mountedRef =
|
|
38694
|
+
const mountedRef = React85__default.useRef(false);
|
|
38337
38695
|
if (!mountedRef.current) {
|
|
38338
38696
|
mountedRef.current = true;
|
|
38339
38697
|
debug("forms", "mount", {
|
|
@@ -38346,7 +38704,7 @@ var init_Form = __esm({
|
|
|
38346
38704
|
});
|
|
38347
38705
|
}
|
|
38348
38706
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
38349
|
-
const evalContext =
|
|
38707
|
+
const evalContext = React85__default.useMemo(
|
|
38350
38708
|
() => ({
|
|
38351
38709
|
formValues: formData,
|
|
38352
38710
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -38355,7 +38713,7 @@ var init_Form = __esm({
|
|
|
38355
38713
|
}),
|
|
38356
38714
|
[formData, externalContext]
|
|
38357
38715
|
);
|
|
38358
|
-
|
|
38716
|
+
React85__default.useEffect(() => {
|
|
38359
38717
|
debug("forms", "initialData-sync", {
|
|
38360
38718
|
mode: formMode,
|
|
38361
38719
|
normalizedInitialData,
|
|
@@ -38366,7 +38724,7 @@ var init_Form = __esm({
|
|
|
38366
38724
|
setFormData(normalizedInitialData);
|
|
38367
38725
|
}
|
|
38368
38726
|
}, [normalizedInitialData]);
|
|
38369
|
-
const processCalculations =
|
|
38727
|
+
const processCalculations = React85__default.useCallback(
|
|
38370
38728
|
(changedFieldId, newFormData) => {
|
|
38371
38729
|
if (!hiddenCalculations.length) return;
|
|
38372
38730
|
const context = {
|
|
@@ -38391,7 +38749,7 @@ var init_Form = __esm({
|
|
|
38391
38749
|
},
|
|
38392
38750
|
[hiddenCalculations, externalContext, eventBus]
|
|
38393
38751
|
);
|
|
38394
|
-
const checkViolations =
|
|
38752
|
+
const checkViolations = React85__default.useCallback(
|
|
38395
38753
|
(changedFieldId, newFormData) => {
|
|
38396
38754
|
if (!violationTriggers.length) return;
|
|
38397
38755
|
const context = {
|
|
@@ -38429,7 +38787,7 @@ var init_Form = __esm({
|
|
|
38429
38787
|
processCalculations(name, newFormData);
|
|
38430
38788
|
checkViolations(name, newFormData);
|
|
38431
38789
|
};
|
|
38432
|
-
const isFieldVisible =
|
|
38790
|
+
const isFieldVisible = React85__default.useCallback(
|
|
38433
38791
|
(fieldName) => {
|
|
38434
38792
|
const condition = conditionalFields[fieldName];
|
|
38435
38793
|
if (!condition) return true;
|
|
@@ -38437,7 +38795,7 @@ var init_Form = __esm({
|
|
|
38437
38795
|
},
|
|
38438
38796
|
[conditionalFields, evalContext]
|
|
38439
38797
|
);
|
|
38440
|
-
const isSectionVisible =
|
|
38798
|
+
const isSectionVisible = React85__default.useCallback(
|
|
38441
38799
|
(section) => {
|
|
38442
38800
|
if (!section.condition) return true;
|
|
38443
38801
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -38513,7 +38871,7 @@ var init_Form = __esm({
|
|
|
38513
38871
|
eventBus.emit(`UI:${onCancel}`);
|
|
38514
38872
|
}
|
|
38515
38873
|
};
|
|
38516
|
-
const renderField =
|
|
38874
|
+
const renderField = React85__default.useCallback(
|
|
38517
38875
|
(field) => {
|
|
38518
38876
|
const fieldName = field.name || field.field;
|
|
38519
38877
|
if (!fieldName) return null;
|
|
@@ -38534,7 +38892,7 @@ var init_Form = __esm({
|
|
|
38534
38892
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
38535
38893
|
);
|
|
38536
38894
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
38537
|
-
const normalizedFields =
|
|
38895
|
+
const normalizedFields = React85__default.useMemo(() => {
|
|
38538
38896
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
38539
38897
|
return effectiveFields.map((field) => {
|
|
38540
38898
|
if (typeof field === "string") {
|
|
@@ -38558,7 +38916,7 @@ var init_Form = __esm({
|
|
|
38558
38916
|
return field;
|
|
38559
38917
|
});
|
|
38560
38918
|
}, [effectiveFields, resolvedEntity]);
|
|
38561
|
-
const schemaFields =
|
|
38919
|
+
const schemaFields = React85__default.useMemo(() => {
|
|
38562
38920
|
if (normalizedFields.length === 0) return null;
|
|
38563
38921
|
if (isDebugEnabled()) {
|
|
38564
38922
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -38568,7 +38926,7 @@ var init_Form = __esm({
|
|
|
38568
38926
|
}
|
|
38569
38927
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
38570
38928
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
38571
|
-
const sectionElements =
|
|
38929
|
+
const sectionElements = React85__default.useMemo(() => {
|
|
38572
38930
|
if (!sections || sections.length === 0) return null;
|
|
38573
38931
|
return sections.map((section) => {
|
|
38574
38932
|
if (!isSectionVisible(section)) {
|
|
@@ -39147,7 +39505,7 @@ function formatValue3(value, fieldName) {
|
|
|
39147
39505
|
return String(value);
|
|
39148
39506
|
}
|
|
39149
39507
|
function formatFieldLabel2(fieldName) {
|
|
39150
|
-
return fieldName
|
|
39508
|
+
return humanizeFieldName(fieldName).replace(/\sId$/, "").trim();
|
|
39151
39509
|
}
|
|
39152
39510
|
var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
|
|
39153
39511
|
var init_List = __esm({
|
|
@@ -39159,6 +39517,7 @@ var init_List = __esm({
|
|
|
39159
39517
|
init_EmptyState();
|
|
39160
39518
|
init_LoadingState();
|
|
39161
39519
|
init_cn();
|
|
39520
|
+
init_format();
|
|
39162
39521
|
init_getNestedValue();
|
|
39163
39522
|
init_useEventBus();
|
|
39164
39523
|
init_types2();
|
|
@@ -39293,7 +39652,7 @@ var init_List = __esm({
|
|
|
39293
39652
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
39294
39653
|
return [];
|
|
39295
39654
|
}, [entity]);
|
|
39296
|
-
const getItemActions =
|
|
39655
|
+
const getItemActions = React85__default.useCallback(
|
|
39297
39656
|
(item) => {
|
|
39298
39657
|
if (!itemActions) return [];
|
|
39299
39658
|
if (typeof itemActions === "function") {
|
|
@@ -39774,7 +40133,7 @@ var init_MediaGallery = __esm({
|
|
|
39774
40133
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
39775
40134
|
);
|
|
39776
40135
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
39777
|
-
const items =
|
|
40136
|
+
const items = React85__default.useMemo(() => {
|
|
39778
40137
|
if (propItems && propItems.length > 0) return propItems;
|
|
39779
40138
|
if (entityData.length === 0) return [];
|
|
39780
40139
|
return entityData.map((record, idx) => {
|
|
@@ -39939,7 +40298,7 @@ var init_MediaGallery = __esm({
|
|
|
39939
40298
|
}
|
|
39940
40299
|
});
|
|
39941
40300
|
function extractTitle2(children) {
|
|
39942
|
-
if (!
|
|
40301
|
+
if (!React85__default.isValidElement(children)) return void 0;
|
|
39943
40302
|
const props = children.props;
|
|
39944
40303
|
if (typeof props.title === "string") {
|
|
39945
40304
|
return props.title;
|
|
@@ -40194,7 +40553,7 @@ var init_debugRegistry = __esm({
|
|
|
40194
40553
|
}
|
|
40195
40554
|
});
|
|
40196
40555
|
function useDebugData() {
|
|
40197
|
-
const [data, setData] =
|
|
40556
|
+
const [data, setData] = React85.useState(() => ({
|
|
40198
40557
|
traits: [],
|
|
40199
40558
|
ticks: [],
|
|
40200
40559
|
guards: [],
|
|
@@ -40208,7 +40567,7 @@ function useDebugData() {
|
|
|
40208
40567
|
},
|
|
40209
40568
|
lastUpdate: Date.now()
|
|
40210
40569
|
}));
|
|
40211
|
-
|
|
40570
|
+
React85.useEffect(() => {
|
|
40212
40571
|
const updateData = () => {
|
|
40213
40572
|
setData({
|
|
40214
40573
|
traits: getAllTraits(),
|
|
@@ -40317,12 +40676,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
40317
40676
|
return positions;
|
|
40318
40677
|
}
|
|
40319
40678
|
function WalkMinimap() {
|
|
40320
|
-
const [walkStep, setWalkStep] =
|
|
40321
|
-
const [traits2, setTraits] =
|
|
40322
|
-
const [coveredEdges, setCoveredEdges] =
|
|
40323
|
-
const [completedTraits, setCompletedTraits] =
|
|
40324
|
-
const prevTraitRef =
|
|
40325
|
-
|
|
40679
|
+
const [walkStep, setWalkStep] = React85.useState(null);
|
|
40680
|
+
const [traits2, setTraits] = React85.useState([]);
|
|
40681
|
+
const [coveredEdges, setCoveredEdges] = React85.useState([]);
|
|
40682
|
+
const [completedTraits, setCompletedTraits] = React85.useState(/* @__PURE__ */ new Set());
|
|
40683
|
+
const prevTraitRef = React85.useRef(null);
|
|
40684
|
+
React85.useEffect(() => {
|
|
40326
40685
|
const interval = setInterval(() => {
|
|
40327
40686
|
const w = window;
|
|
40328
40687
|
const step = w.__orbitalWalkStep;
|
|
@@ -40620,7 +40979,7 @@ function TicksTab({ ticks: ticks2 }) {
|
|
|
40620
40979
|
}
|
|
40621
40980
|
);
|
|
40622
40981
|
}
|
|
40623
|
-
const
|
|
40982
|
+
const formatTime3 = (ms) => {
|
|
40624
40983
|
if (ms === 0) return "never";
|
|
40625
40984
|
const seconds = Math.floor((Date.now() - ms) / 1e3);
|
|
40626
40985
|
if (seconds < 1) return "just now";
|
|
@@ -40646,7 +41005,7 @@ function TicksTab({ ticks: ticks2 }) {
|
|
|
40646
41005
|
tick.executionTime.toFixed(1),
|
|
40647
41006
|
"ms exec"
|
|
40648
41007
|
] }),
|
|
40649
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
41008
|
+
/* @__PURE__ */ jsx("span", { children: formatTime3(tick.lastRun) })
|
|
40650
41009
|
] }),
|
|
40651
41010
|
tick.guardName && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs(Badge, { variant: tick.guardPassed ? "success" : "danger", size: "sm", children: [
|
|
40652
41011
|
tick.guardName,
|
|
@@ -40758,19 +41117,19 @@ var init_EntitiesTab = __esm({
|
|
|
40758
41117
|
});
|
|
40759
41118
|
function EventFlowTab({ events: events2 }) {
|
|
40760
41119
|
const { t } = useTranslate();
|
|
40761
|
-
const [filter, setFilter] =
|
|
40762
|
-
const containerRef =
|
|
40763
|
-
const [autoScroll, setAutoScroll] =
|
|
40764
|
-
|
|
41120
|
+
const [filter, setFilter] = React85.useState("all");
|
|
41121
|
+
const containerRef = React85.useRef(null);
|
|
41122
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
41123
|
+
React85.useEffect(() => {
|
|
40765
41124
|
if (autoScroll && containerRef.current) {
|
|
40766
41125
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
40767
41126
|
}
|
|
40768
41127
|
}, [events2.length, autoScroll]);
|
|
40769
|
-
const filteredEvents =
|
|
41128
|
+
const filteredEvents = React85.useMemo(() => {
|
|
40770
41129
|
if (filter === "all") return events2;
|
|
40771
41130
|
return events2.filter((e) => e.type === filter);
|
|
40772
41131
|
}, [events2, filter]);
|
|
40773
|
-
const
|
|
41132
|
+
const formatTime3 = (timestamp) => {
|
|
40774
41133
|
const date = new Date(timestamp);
|
|
40775
41134
|
return date.toLocaleTimeString("en-US", {
|
|
40776
41135
|
hour12: false,
|
|
@@ -40846,7 +41205,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
40846
41205
|
{
|
|
40847
41206
|
className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
|
|
40848
41207
|
children: [
|
|
40849
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children:
|
|
41208
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime3(event.timestamp) }),
|
|
40850
41209
|
/* @__PURE__ */ jsx("span", { children: icon }),
|
|
40851
41210
|
/* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
|
|
40852
41211
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
|
|
@@ -40882,7 +41241,7 @@ var init_EventFlowTab = __esm({
|
|
|
40882
41241
|
});
|
|
40883
41242
|
function GuardsPanel({ guards }) {
|
|
40884
41243
|
const { t } = useTranslate();
|
|
40885
|
-
const [filter, setFilter] =
|
|
41244
|
+
const [filter, setFilter] = React85.useState("all");
|
|
40886
41245
|
if (guards.length === 0) {
|
|
40887
41246
|
return /* @__PURE__ */ jsx(
|
|
40888
41247
|
EmptyState,
|
|
@@ -40895,12 +41254,12 @@ function GuardsPanel({ guards }) {
|
|
|
40895
41254
|
}
|
|
40896
41255
|
const passedCount = guards.filter((g) => g.result).length;
|
|
40897
41256
|
const failedCount = guards.length - passedCount;
|
|
40898
|
-
const filteredGuards =
|
|
41257
|
+
const filteredGuards = React85.useMemo(() => {
|
|
40899
41258
|
if (filter === "all") return guards;
|
|
40900
41259
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
40901
41260
|
return guards.filter((g) => !g.result);
|
|
40902
41261
|
}, [guards, filter]);
|
|
40903
|
-
const
|
|
41262
|
+
const formatTime3 = (timestamp) => {
|
|
40904
41263
|
const date = new Date(timestamp);
|
|
40905
41264
|
return date.toLocaleTimeString("en-US", {
|
|
40906
41265
|
hour12: false,
|
|
@@ -40915,7 +41274,7 @@ function GuardsPanel({ guards }) {
|
|
|
40915
41274
|
/* @__PURE__ */ jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
|
|
40916
41275
|
/* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
|
|
40917
41276
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
|
|
40918
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children:
|
|
41277
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime3(guard.timestamp) })
|
|
40919
41278
|
] }),
|
|
40920
41279
|
content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
40921
41280
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -41058,10 +41417,10 @@ function EffectBadge({ effect }) {
|
|
|
41058
41417
|
}
|
|
41059
41418
|
function TransitionTimeline({ transitions }) {
|
|
41060
41419
|
const { t } = useTranslate();
|
|
41061
|
-
const containerRef =
|
|
41062
|
-
const [autoScroll, setAutoScroll] =
|
|
41063
|
-
const [expandedId, setExpandedId] =
|
|
41064
|
-
|
|
41420
|
+
const containerRef = React85.useRef(null);
|
|
41421
|
+
const [autoScroll, setAutoScroll] = React85.useState(true);
|
|
41422
|
+
const [expandedId, setExpandedId] = React85.useState(null);
|
|
41423
|
+
React85.useEffect(() => {
|
|
41065
41424
|
if (autoScroll && containerRef.current) {
|
|
41066
41425
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
41067
41426
|
}
|
|
@@ -41076,7 +41435,7 @@ function TransitionTimeline({ transitions }) {
|
|
|
41076
41435
|
}
|
|
41077
41436
|
);
|
|
41078
41437
|
}
|
|
41079
|
-
const
|
|
41438
|
+
const formatTime3 = (ts) => {
|
|
41080
41439
|
const d = new Date(ts);
|
|
41081
41440
|
return d.toLocaleTimeString("en-US", {
|
|
41082
41441
|
hour12: false,
|
|
@@ -41124,7 +41483,7 @@ function TransitionTimeline({ transitions }) {
|
|
|
41124
41483
|
${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
|
|
41125
41484
|
` }),
|
|
41126
41485
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
|
|
41127
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children:
|
|
41486
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime3(trace.timestamp) }),
|
|
41128
41487
|
/* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
|
|
41129
41488
|
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
|
|
41130
41489
|
trace.from,
|
|
@@ -41199,7 +41558,7 @@ function ServerBridgeTab({ bridge }) {
|
|
|
41199
41558
|
}
|
|
41200
41559
|
);
|
|
41201
41560
|
}
|
|
41202
|
-
const
|
|
41561
|
+
const formatTime3 = (ts) => {
|
|
41203
41562
|
if (ts === 0) return t("debug.never");
|
|
41204
41563
|
const d = new Date(ts);
|
|
41205
41564
|
return d.toLocaleTimeString("en-US", {
|
|
@@ -41242,7 +41601,7 @@ function ServerBridgeTab({ bridge }) {
|
|
|
41242
41601
|
StatRow,
|
|
41243
41602
|
{
|
|
41244
41603
|
label: t("debug.lastHeartbeat"),
|
|
41245
|
-
value:
|
|
41604
|
+
value: formatTime3(bridge.lastHeartbeat)
|
|
41246
41605
|
}
|
|
41247
41606
|
)
|
|
41248
41607
|
] })
|
|
@@ -41341,9 +41700,9 @@ function getAllEvents(traits2) {
|
|
|
41341
41700
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
41342
41701
|
const eventBus = useEventBus();
|
|
41343
41702
|
const { t } = useTranslate();
|
|
41344
|
-
const [log13, setLog] =
|
|
41345
|
-
const prevStatesRef =
|
|
41346
|
-
|
|
41703
|
+
const [log13, setLog] = React85.useState([]);
|
|
41704
|
+
const prevStatesRef = React85.useRef(/* @__PURE__ */ new Map());
|
|
41705
|
+
React85.useEffect(() => {
|
|
41347
41706
|
for (const trait of traits2) {
|
|
41348
41707
|
const prev = prevStatesRef.current.get(trait.id);
|
|
41349
41708
|
if (prev && prev !== trait.currentState) {
|
|
@@ -41512,10 +41871,10 @@ function VerifyModePanel({
|
|
|
41512
41871
|
localCount
|
|
41513
41872
|
}) {
|
|
41514
41873
|
const { t } = useTranslate();
|
|
41515
|
-
const [expanded, setExpanded] =
|
|
41516
|
-
const scrollRef =
|
|
41517
|
-
const prevCountRef =
|
|
41518
|
-
|
|
41874
|
+
const [expanded, setExpanded] = React85.useState(true);
|
|
41875
|
+
const scrollRef = React85.useRef(null);
|
|
41876
|
+
const prevCountRef = React85.useRef(0);
|
|
41877
|
+
React85.useEffect(() => {
|
|
41519
41878
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
41520
41879
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
41521
41880
|
}
|
|
@@ -41572,10 +41931,10 @@ function RuntimeDebugger({
|
|
|
41572
41931
|
schema
|
|
41573
41932
|
}) {
|
|
41574
41933
|
const { t } = useTranslate();
|
|
41575
|
-
const [isCollapsed, setIsCollapsed] =
|
|
41576
|
-
const [isVisible, setIsVisible] =
|
|
41934
|
+
const [isCollapsed, setIsCollapsed] = React85.useState(mode === "verify" ? true : defaultCollapsed);
|
|
41935
|
+
const [isVisible, setIsVisible] = React85.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
41577
41936
|
const debugData = useDebugData();
|
|
41578
|
-
|
|
41937
|
+
React85.useEffect(() => {
|
|
41579
41938
|
if (mode === "inline") return;
|
|
41580
41939
|
return onDebugToggle((enabled) => {
|
|
41581
41940
|
setIsVisible(enabled);
|
|
@@ -41584,7 +41943,7 @@ function RuntimeDebugger({
|
|
|
41584
41943
|
}
|
|
41585
41944
|
});
|
|
41586
41945
|
}, [mode]);
|
|
41587
|
-
|
|
41946
|
+
React85.useEffect(() => {
|
|
41588
41947
|
if (mode === "inline") return;
|
|
41589
41948
|
const handleKeyDown = (e) => {
|
|
41590
41949
|
if (e.key === "`" && isVisible) {
|
|
@@ -42104,7 +42463,7 @@ var init_StatCard = __esm({
|
|
|
42104
42463
|
const labelToUse = propLabel ?? propTitle;
|
|
42105
42464
|
const eventBus = useEventBus();
|
|
42106
42465
|
const { t } = useTranslate();
|
|
42107
|
-
const handleActionClick =
|
|
42466
|
+
const handleActionClick = React85__default.useCallback(() => {
|
|
42108
42467
|
if (action?.event) {
|
|
42109
42468
|
eventBus.emit(`UI:${action.event}`, {});
|
|
42110
42469
|
}
|
|
@@ -42115,7 +42474,7 @@ var init_StatCard = __esm({
|
|
|
42115
42474
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
42116
42475
|
const isLoading = externalLoading ?? false;
|
|
42117
42476
|
const error = externalError;
|
|
42118
|
-
const computeMetricValue =
|
|
42477
|
+
const computeMetricValue = React85__default.useCallback(
|
|
42119
42478
|
(metric, items) => {
|
|
42120
42479
|
if (metric.value !== void 0) {
|
|
42121
42480
|
return metric.value;
|
|
@@ -42154,7 +42513,7 @@ var init_StatCard = __esm({
|
|
|
42154
42513
|
},
|
|
42155
42514
|
[]
|
|
42156
42515
|
);
|
|
42157
|
-
const schemaStats =
|
|
42516
|
+
const schemaStats = React85__default.useMemo(() => {
|
|
42158
42517
|
if (!metrics || metrics.length === 0) return null;
|
|
42159
42518
|
return metrics.map((metric) => ({
|
|
42160
42519
|
label: metric.label,
|
|
@@ -42162,7 +42521,7 @@ var init_StatCard = __esm({
|
|
|
42162
42521
|
format: metric.format
|
|
42163
42522
|
}));
|
|
42164
42523
|
}, [metrics, data, computeMetricValue]);
|
|
42165
|
-
const calculatedTrend =
|
|
42524
|
+
const calculatedTrend = React85__default.useMemo(() => {
|
|
42166
42525
|
if (manualTrend !== void 0) return manualTrend;
|
|
42167
42526
|
if (previousValue === void 0 || currentValue === void 0)
|
|
42168
42527
|
return void 0;
|
|
@@ -42802,8 +43161,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
42802
43161
|
] });
|
|
42803
43162
|
};
|
|
42804
43163
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
42805
|
-
const endRef =
|
|
42806
|
-
|
|
43164
|
+
const endRef = React85__default.useRef(null);
|
|
43165
|
+
React85__default.useEffect(() => {
|
|
42807
43166
|
if (!autoScroll) return;
|
|
42808
43167
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
42809
43168
|
}, [activities.length, autoScroll]);
|
|
@@ -42897,7 +43256,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
42897
43256
|
};
|
|
42898
43257
|
SubagentRichCard = ({ subagent }) => {
|
|
42899
43258
|
const { t } = useTranslate();
|
|
42900
|
-
const activities =
|
|
43259
|
+
const activities = React85__default.useMemo(
|
|
42901
43260
|
() => subagentMessagesToActivities(subagent.messages),
|
|
42902
43261
|
[subagent.messages]
|
|
42903
43262
|
);
|
|
@@ -42974,8 +43333,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
42974
43333
|
] });
|
|
42975
43334
|
};
|
|
42976
43335
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
42977
|
-
const endRef =
|
|
42978
|
-
|
|
43336
|
+
const endRef = React85__default.useRef(null);
|
|
43337
|
+
React85__default.useEffect(() => {
|
|
42979
43338
|
if (!autoScroll) return;
|
|
42980
43339
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
42981
43340
|
}, [messages.length, autoScroll]);
|
|
@@ -43354,7 +43713,7 @@ var init_TeamOrganism = __esm({
|
|
|
43354
43713
|
TeamOrganism.displayName = "TeamOrganism";
|
|
43355
43714
|
}
|
|
43356
43715
|
});
|
|
43357
|
-
function
|
|
43716
|
+
function formatDate2(value) {
|
|
43358
43717
|
const d = new Date(value);
|
|
43359
43718
|
if (isNaN(d.getTime())) return value;
|
|
43360
43719
|
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
@@ -43410,7 +43769,7 @@ var init_Timeline = __esm({
|
|
|
43410
43769
|
}) => {
|
|
43411
43770
|
const { t } = useTranslate();
|
|
43412
43771
|
const entityData = entity ?? [];
|
|
43413
|
-
const items =
|
|
43772
|
+
const items = React85__default.useMemo(() => {
|
|
43414
43773
|
if (propItems) return propItems;
|
|
43415
43774
|
if (entityData.length === 0) return [];
|
|
43416
43775
|
return entityData.map((record, idx) => {
|
|
@@ -43486,7 +43845,7 @@ var init_Timeline = __esm({
|
|
|
43486
43845
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: cn("flex-1 min-w-0", !isLast && "pb-6"), children: [
|
|
43487
43846
|
/* @__PURE__ */ jsxs(HStack, { justify: "between", align: "start", wrap: true, children: [
|
|
43488
43847
|
/* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", children: item.title }),
|
|
43489
|
-
item.date && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "flex-shrink-0", children:
|
|
43848
|
+
item.date && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "flex-shrink-0", children: formatDate2(item.date) })
|
|
43490
43849
|
] }),
|
|
43491
43850
|
item.description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
43492
43851
|
item.tags && item.tags.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", wrap: true, children: item.tags.map((tag, tagIdx) => /* @__PURE__ */ jsx(Badge, { variant: "default", children: tag }, tagIdx)) }),
|
|
@@ -43512,7 +43871,7 @@ var init_Timeline = __esm({
|
|
|
43512
43871
|
}
|
|
43513
43872
|
});
|
|
43514
43873
|
function extractToastProps(children) {
|
|
43515
|
-
if (!
|
|
43874
|
+
if (!React85__default.isValidElement(children)) {
|
|
43516
43875
|
if (typeof children === "string") {
|
|
43517
43876
|
return { message: children };
|
|
43518
43877
|
}
|
|
@@ -43554,7 +43913,7 @@ var init_ToastSlot = __esm({
|
|
|
43554
43913
|
eventBus.emit(`${prefix}CLOSE`);
|
|
43555
43914
|
};
|
|
43556
43915
|
if (!isVisible) return null;
|
|
43557
|
-
const isCustomContent =
|
|
43916
|
+
const isCustomContent = React85__default.isValidElement(children) && !message;
|
|
43558
43917
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
43559
43918
|
Toast,
|
|
43560
43919
|
{
|
|
@@ -43792,6 +44151,10 @@ var init_component_registry_generated = __esm({
|
|
|
43792
44151
|
init_SubagentTracePanel();
|
|
43793
44152
|
init_SvgBranch();
|
|
43794
44153
|
init_SvgConnection();
|
|
44154
|
+
init_SvgDrawGroup();
|
|
44155
|
+
init_SvgDrawShape();
|
|
44156
|
+
init_SvgDrawShapeLayer();
|
|
44157
|
+
init_SvgDrawText();
|
|
43795
44158
|
init_SvgFlow();
|
|
43796
44159
|
init_SvgGrid();
|
|
43797
44160
|
init_SvgLobe();
|
|
@@ -43802,6 +44165,7 @@ var init_component_registry_generated = __esm({
|
|
|
43802
44165
|
init_SvgRing();
|
|
43803
44166
|
init_SvgShield();
|
|
43804
44167
|
init_SvgStack();
|
|
44168
|
+
init_SvgStage();
|
|
43805
44169
|
init_SwipeableRow();
|
|
43806
44170
|
init_Switch();
|
|
43807
44171
|
init_TabbedContainer();
|
|
@@ -44063,6 +44427,10 @@ var init_component_registry_generated = __esm({
|
|
|
44063
44427
|
"SubagentTracePanel": SubagentTracePanel,
|
|
44064
44428
|
"SvgBranch": SvgBranch,
|
|
44065
44429
|
"SvgConnection": SvgConnection,
|
|
44430
|
+
"SvgDrawGroup": SvgDrawGroup,
|
|
44431
|
+
"SvgDrawShape": SvgDrawShape,
|
|
44432
|
+
"SvgDrawShapeLayer": SvgDrawShapeLayer,
|
|
44433
|
+
"SvgDrawText": SvgDrawText,
|
|
44066
44434
|
"SvgFlow": SvgFlow,
|
|
44067
44435
|
"SvgGrid": SvgGrid,
|
|
44068
44436
|
"SvgLobe": SvgLobe,
|
|
@@ -44073,6 +44441,7 @@ var init_component_registry_generated = __esm({
|
|
|
44073
44441
|
"SvgRing": SvgRing,
|
|
44074
44442
|
"SvgShield": SvgShield,
|
|
44075
44443
|
"SvgStack": SvgStack,
|
|
44444
|
+
"SvgStage": SvgStage,
|
|
44076
44445
|
"SwipeableRow": SwipeableRow,
|
|
44077
44446
|
"Switch": Switch,
|
|
44078
44447
|
"TabbedContainer": TabbedContainer,
|
|
@@ -44123,7 +44492,7 @@ function SuspenseConfigProvider({
|
|
|
44123
44492
|
config,
|
|
44124
44493
|
children
|
|
44125
44494
|
}) {
|
|
44126
|
-
return
|
|
44495
|
+
return React85__default.createElement(
|
|
44127
44496
|
SuspenseConfigContext.Provider,
|
|
44128
44497
|
{ value: config },
|
|
44129
44498
|
children
|
|
@@ -44149,7 +44518,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44149
44518
|
if (entityField) {
|
|
44150
44519
|
const enriched = {
|
|
44151
44520
|
name: field,
|
|
44152
|
-
label: field
|
|
44521
|
+
label: humanizeFieldName(field),
|
|
44153
44522
|
type: entityField.type,
|
|
44154
44523
|
required: entityField.required ?? false
|
|
44155
44524
|
};
|
|
@@ -44163,9 +44532,9 @@ function enrichFormFields(fields, entityDef) {
|
|
|
44163
44532
|
}
|
|
44164
44533
|
return enriched;
|
|
44165
44534
|
}
|
|
44166
|
-
return { name: field, label: field
|
|
44535
|
+
return { name: field, label: humanizeFieldName(field) };
|
|
44167
44536
|
}
|
|
44168
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
44537
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React85__default.isValidElement(field) && !(field instanceof Date)) {
|
|
44169
44538
|
const obj = field;
|
|
44170
44539
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
44171
44540
|
if (!fieldName) return field;
|
|
@@ -44625,7 +44994,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
44625
44994
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
44626
44995
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
44627
44996
|
}
|
|
44628
|
-
return /* @__PURE__ */ jsx(
|
|
44997
|
+
return /* @__PURE__ */ jsx(React85__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
44629
44998
|
}
|
|
44630
44999
|
if (!child || typeof child !== "object") return null;
|
|
44631
45000
|
const childId = `${parentId}-${index}`;
|
|
@@ -44682,14 +45051,14 @@ function isPatternConfig(value) {
|
|
|
44682
45051
|
if (value === null || value === void 0) return false;
|
|
44683
45052
|
if (typeof value !== "object") return false;
|
|
44684
45053
|
if (Array.isArray(value)) return false;
|
|
44685
|
-
if (
|
|
45054
|
+
if (React85__default.isValidElement(value)) return false;
|
|
44686
45055
|
if (value instanceof Date) return false;
|
|
44687
45056
|
if (typeof value === "function") return false;
|
|
44688
45057
|
const record = value;
|
|
44689
45058
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
44690
45059
|
}
|
|
44691
45060
|
function isPlainConfigObject(value) {
|
|
44692
|
-
if (
|
|
45061
|
+
if (React85__default.isValidElement(value)) return false;
|
|
44693
45062
|
if (value instanceof Date) return false;
|
|
44694
45063
|
const proto = Object.getPrototypeOf(value);
|
|
44695
45064
|
return proto === Object.prototype || proto === null;
|
|
@@ -44817,10 +45186,11 @@ function SlotContentRenderer({
|
|
|
44817
45186
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
44818
45187
|
const slotVal = restProps[slotKey];
|
|
44819
45188
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
44820
|
-
if (
|
|
44821
|
-
|
|
45189
|
+
if (React85__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
45190
|
+
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
45191
|
+
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
44822
45192
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
44823
|
-
slotVal,
|
|
45193
|
+
typelessChildren ?? slotVal,
|
|
44824
45194
|
onDismiss,
|
|
44825
45195
|
`${content.id}-${slotKey}`,
|
|
44826
45196
|
`${myPath}.${slotKey}`,
|
|
@@ -44870,7 +45240,7 @@ function SlotContentRenderer({
|
|
|
44870
45240
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
44871
45241
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
44872
45242
|
const sample = resolvedItems[0];
|
|
44873
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
45243
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React85__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
44874
45244
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
44875
45245
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
44876
45246
|
}
|
|
@@ -44999,6 +45369,7 @@ var init_UISlotRenderer = __esm({
|
|
|
44999
45369
|
init_useEventBus();
|
|
45000
45370
|
init_slot_types();
|
|
45001
45371
|
init_cn();
|
|
45372
|
+
init_format();
|
|
45002
45373
|
init_ErrorBoundary();
|
|
45003
45374
|
init_Skeleton();
|
|
45004
45375
|
init_renderer();
|