@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/avl/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React92 from 'react';
|
|
3
|
+
import React92__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, useSyncExternalStore, lazy, useId } from 'react';
|
|
4
4
|
import { getAllPages, matchPathAmong, OrbitalProvider, EventBusContext, useTraitScopeChain, ServerBridgeProvider, VerificationProvider, EntitySchemaProvider, OrbitalThemeProvider, useServerBridge, useEntitySchema, useEntitySchemaOptional, TraitScopeProvider, useCurrentPagePath, useGameAudioContextOptional } from '@almadar/ui/providers';
|
|
5
5
|
import { createLogger, setNamespaceLevel, isLogLevelEnabled } from '@almadar/logger';
|
|
6
6
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
@@ -3112,6 +3112,61 @@ var init_cn = __esm({
|
|
|
3112
3112
|
}
|
|
3113
3113
|
});
|
|
3114
3114
|
|
|
3115
|
+
// lib/format.ts
|
|
3116
|
+
function humanizeFieldName(name) {
|
|
3117
|
+
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();
|
|
3118
|
+
}
|
|
3119
|
+
function humanizeEnumValue(value) {
|
|
3120
|
+
return /^[a-z0-9]+(?:[_-][a-z0-9]+)+$/.test(value) ? humanizeFieldName(value) : value;
|
|
3121
|
+
}
|
|
3122
|
+
function formatDate(value) {
|
|
3123
|
+
if (!value) return "";
|
|
3124
|
+
const d = new Date(String(value));
|
|
3125
|
+
if (isNaN(d.getTime())) return String(value);
|
|
3126
|
+
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
3127
|
+
}
|
|
3128
|
+
function formatTime(value) {
|
|
3129
|
+
if (!value) return "";
|
|
3130
|
+
const d = new Date(String(value));
|
|
3131
|
+
if (isNaN(d.getTime())) return String(value);
|
|
3132
|
+
return d.toLocaleTimeString(void 0, { hour: "numeric", minute: "2-digit" });
|
|
3133
|
+
}
|
|
3134
|
+
function formatDateTime(value) {
|
|
3135
|
+
if (!value) return "";
|
|
3136
|
+
const d = new Date(String(value));
|
|
3137
|
+
if (isNaN(d.getTime())) return String(value);
|
|
3138
|
+
return `${formatDate(value)} ${formatTime(value)}`;
|
|
3139
|
+
}
|
|
3140
|
+
function asYesNo(value) {
|
|
3141
|
+
return value === false || value === 0 || String(value) === "false" ? "No" : "Yes";
|
|
3142
|
+
}
|
|
3143
|
+
function formatValue(value, format) {
|
|
3144
|
+
if (value === void 0 || value === null) return "";
|
|
3145
|
+
if (typeof value === "boolean") return asYesNo(value);
|
|
3146
|
+
switch (format) {
|
|
3147
|
+
case "date":
|
|
3148
|
+
return formatDate(value);
|
|
3149
|
+
case "time":
|
|
3150
|
+
return formatTime(value);
|
|
3151
|
+
case "datetime":
|
|
3152
|
+
return formatDateTime(value);
|
|
3153
|
+
case "currency":
|
|
3154
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
3155
|
+
case "number":
|
|
3156
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
3157
|
+
case "percent":
|
|
3158
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
3159
|
+
case "boolean":
|
|
3160
|
+
return asYesNo(value);
|
|
3161
|
+
default:
|
|
3162
|
+
return String(value);
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
var init_format = __esm({
|
|
3166
|
+
"lib/format.ts"() {
|
|
3167
|
+
}
|
|
3168
|
+
});
|
|
3169
|
+
|
|
3115
3170
|
// components/core/atoms/Typography.tsx
|
|
3116
3171
|
var Typography_exports = {};
|
|
3117
3172
|
__export(Typography_exports, {
|
|
@@ -3121,6 +3176,7 @@ var variantStyles, colorStyles, weightStyles, defaultElements, typographySizeSty
|
|
|
3121
3176
|
var init_Typography = __esm({
|
|
3122
3177
|
"components/core/atoms/Typography.tsx"() {
|
|
3123
3178
|
init_cn();
|
|
3179
|
+
init_format();
|
|
3124
3180
|
variantStyles = {
|
|
3125
3181
|
h1: "text-4xl font-bold tracking-tight text-foreground",
|
|
3126
3182
|
h2: "text-3xl font-bold tracking-tight text-foreground",
|
|
@@ -3208,12 +3264,17 @@ var init_Typography = __esm({
|
|
|
3208
3264
|
id,
|
|
3209
3265
|
className,
|
|
3210
3266
|
style,
|
|
3267
|
+
format,
|
|
3211
3268
|
content,
|
|
3212
3269
|
children
|
|
3213
3270
|
}) => {
|
|
3214
3271
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3215
3272
|
const Component = as || defaultElements[variant];
|
|
3216
|
-
|
|
3273
|
+
let body = children ?? content;
|
|
3274
|
+
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
3275
|
+
body = formatValue(body, format);
|
|
3276
|
+
}
|
|
3277
|
+
return React92__default.createElement(
|
|
3217
3278
|
Component,
|
|
3218
3279
|
{
|
|
3219
3280
|
id,
|
|
@@ -3229,7 +3290,7 @@ var init_Typography = __esm({
|
|
|
3229
3290
|
),
|
|
3230
3291
|
style
|
|
3231
3292
|
},
|
|
3232
|
-
|
|
3293
|
+
body
|
|
3233
3294
|
);
|
|
3234
3295
|
};
|
|
3235
3296
|
Typography.displayName = "Typography";
|
|
@@ -3559,7 +3620,7 @@ var init_Box = __esm({
|
|
|
3559
3620
|
fixed: "fixed",
|
|
3560
3621
|
sticky: "sticky"
|
|
3561
3622
|
};
|
|
3562
|
-
Box =
|
|
3623
|
+
Box = React92__default.forwardRef(
|
|
3563
3624
|
({
|
|
3564
3625
|
padding,
|
|
3565
3626
|
paddingX,
|
|
@@ -3624,7 +3685,7 @@ var init_Box = __esm({
|
|
|
3624
3685
|
onPointerDown?.(e);
|
|
3625
3686
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3626
3687
|
const isClickable = action || onClick;
|
|
3627
|
-
return
|
|
3688
|
+
return React92__default.createElement(
|
|
3628
3689
|
Component,
|
|
3629
3690
|
{
|
|
3630
3691
|
ref,
|
|
@@ -3720,7 +3781,7 @@ var init_Stack = __esm({
|
|
|
3720
3781
|
};
|
|
3721
3782
|
const isHorizontal = direction === "horizontal";
|
|
3722
3783
|
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";
|
|
3723
|
-
return
|
|
3784
|
+
return React92__default.createElement(
|
|
3724
3785
|
Component,
|
|
3725
3786
|
{
|
|
3726
3787
|
className: cn(
|
|
@@ -4212,7 +4273,7 @@ var init_MiniStateMachine = __esm({
|
|
|
4212
4273
|
const x = 2 + i * (NODE_W + GAP + ARROW_W + GAP);
|
|
4213
4274
|
const tc = transitionCounts[s.name] ?? 0;
|
|
4214
4275
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
4215
|
-
return /* @__PURE__ */ jsxs(
|
|
4276
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
4216
4277
|
/* @__PURE__ */ jsx(
|
|
4217
4278
|
AvlState,
|
|
4218
4279
|
{
|
|
@@ -4663,7 +4724,7 @@ var init_Icon = __esm({
|
|
|
4663
4724
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
4664
4725
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
4665
4726
|
const family = useIconFamily();
|
|
4666
|
-
const RenderedComponent =
|
|
4727
|
+
const RenderedComponent = React92__default.useMemo(() => {
|
|
4667
4728
|
if (directIcon) return null;
|
|
4668
4729
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
4669
4730
|
}, [directIcon, effectiveName, family]);
|
|
@@ -4783,7 +4844,7 @@ var init_atlasSlice = __esm({
|
|
|
4783
4844
|
}
|
|
4784
4845
|
});
|
|
4785
4846
|
function useAtlasSliceDataUrl(asset) {
|
|
4786
|
-
const [, bump] =
|
|
4847
|
+
const [, bump] = React92.useReducer((x) => x + 1, 0);
|
|
4787
4848
|
if (!isAtlasAsset(asset)) return void 0;
|
|
4788
4849
|
const key = `${asset.atlas}#${asset.sprite}`;
|
|
4789
4850
|
const cached = sliceDataUrlCache.get(key);
|
|
@@ -4846,13 +4907,13 @@ function AtlasImage({
|
|
|
4846
4907
|
style,
|
|
4847
4908
|
"aria-hidden": ariaHidden
|
|
4848
4909
|
}) {
|
|
4849
|
-
const [, bump] =
|
|
4850
|
-
const canvasRef =
|
|
4910
|
+
const [, bump] = React92.useReducer((x) => x + 1, 0);
|
|
4911
|
+
const canvasRef = React92.useRef(null);
|
|
4851
4912
|
const sliced = isAtlasAsset(asset);
|
|
4852
4913
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
4853
4914
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
4854
4915
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
4855
|
-
|
|
4916
|
+
React92.useEffect(() => {
|
|
4856
4917
|
const canvas = canvasRef.current;
|
|
4857
4918
|
if (!canvas || !img || !rect) return;
|
|
4858
4919
|
canvas.width = rect.sw;
|
|
@@ -4928,7 +4989,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4928
4989
|
const IconComp = value;
|
|
4929
4990
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
4930
4991
|
}
|
|
4931
|
-
if (
|
|
4992
|
+
if (React92__default.isValidElement(value)) {
|
|
4932
4993
|
return value;
|
|
4933
4994
|
}
|
|
4934
4995
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5005,7 +5066,7 @@ var init_Button = __esm({
|
|
|
5005
5066
|
md: "h-icon-default w-icon-default",
|
|
5006
5067
|
lg: "h-icon-default w-icon-default"
|
|
5007
5068
|
};
|
|
5008
|
-
Button =
|
|
5069
|
+
Button = React92__default.forwardRef(
|
|
5009
5070
|
({
|
|
5010
5071
|
className,
|
|
5011
5072
|
variant = "primary",
|
|
@@ -5075,7 +5136,7 @@ var Dialog;
|
|
|
5075
5136
|
var init_Dialog = __esm({
|
|
5076
5137
|
"components/core/atoms/Dialog.tsx"() {
|
|
5077
5138
|
init_cn();
|
|
5078
|
-
Dialog =
|
|
5139
|
+
Dialog = React92__default.forwardRef(
|
|
5079
5140
|
({
|
|
5080
5141
|
role = "dialog",
|
|
5081
5142
|
"aria-modal": ariaModal = true,
|
|
@@ -5638,7 +5699,7 @@ var init_Badge = __esm({
|
|
|
5638
5699
|
md: "px-2.5 py-1 text-sm",
|
|
5639
5700
|
lg: "px-3 py-1.5 text-base"
|
|
5640
5701
|
};
|
|
5641
|
-
Badge =
|
|
5702
|
+
Badge = React92__default.forwardRef(
|
|
5642
5703
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5643
5704
|
const iconSizes3 = {
|
|
5644
5705
|
sm: "h-icon-default w-icon-default",
|
|
@@ -5988,7 +6049,7 @@ var init_SvgFlow = __esm({
|
|
|
5988
6049
|
width = 100,
|
|
5989
6050
|
height = 100
|
|
5990
6051
|
}) => {
|
|
5991
|
-
const markerId =
|
|
6052
|
+
const markerId = React92__default.useMemo(() => {
|
|
5992
6053
|
flowIdCounter += 1;
|
|
5993
6054
|
return `almadar-flow-arrow-${flowIdCounter}`;
|
|
5994
6055
|
}, []);
|
|
@@ -6581,7 +6642,7 @@ var init_SvgRing = __esm({
|
|
|
6581
6642
|
width = 100,
|
|
6582
6643
|
height = 100
|
|
6583
6644
|
}) => {
|
|
6584
|
-
const gradientId =
|
|
6645
|
+
const gradientId = React92__default.useMemo(() => {
|
|
6585
6646
|
ringIdCounter += 1;
|
|
6586
6647
|
return `almadar-ring-glow-${ringIdCounter}`;
|
|
6587
6648
|
}, []);
|
|
@@ -6762,7 +6823,7 @@ var init_Input = __esm({
|
|
|
6762
6823
|
init_cn();
|
|
6763
6824
|
init_Icon();
|
|
6764
6825
|
init_useEventBus();
|
|
6765
|
-
Input =
|
|
6826
|
+
Input = React92__default.forwardRef(
|
|
6766
6827
|
({
|
|
6767
6828
|
className,
|
|
6768
6829
|
inputType,
|
|
@@ -6930,7 +6991,7 @@ var Label;
|
|
|
6930
6991
|
var init_Label = __esm({
|
|
6931
6992
|
"components/core/atoms/Label.tsx"() {
|
|
6932
6993
|
init_cn();
|
|
6933
|
-
Label =
|
|
6994
|
+
Label = React92__default.forwardRef(
|
|
6934
6995
|
({ className, required, children, ...props }, ref) => {
|
|
6935
6996
|
return /* @__PURE__ */ jsxs(
|
|
6936
6997
|
"label",
|
|
@@ -6957,7 +7018,7 @@ var init_Textarea = __esm({
|
|
|
6957
7018
|
"components/core/atoms/Textarea.tsx"() {
|
|
6958
7019
|
init_cn();
|
|
6959
7020
|
init_useEventBus();
|
|
6960
|
-
Textarea =
|
|
7021
|
+
Textarea = React92__default.forwardRef(
|
|
6961
7022
|
({ className, error, onChange, ...props }, ref) => {
|
|
6962
7023
|
const eventBus = useEventBus();
|
|
6963
7024
|
const handleChange = (e) => {
|
|
@@ -7196,7 +7257,7 @@ var init_Select = __esm({
|
|
|
7196
7257
|
init_cn();
|
|
7197
7258
|
init_Icon();
|
|
7198
7259
|
init_useEventBus();
|
|
7199
|
-
Select =
|
|
7260
|
+
Select = React92__default.forwardRef(
|
|
7200
7261
|
(props, _ref) => {
|
|
7201
7262
|
const { multiple, searchable, clearable } = props;
|
|
7202
7263
|
if (multiple || searchable || clearable) {
|
|
@@ -7213,7 +7274,7 @@ var init_Checkbox = __esm({
|
|
|
7213
7274
|
"components/core/atoms/Checkbox.tsx"() {
|
|
7214
7275
|
init_cn();
|
|
7215
7276
|
init_useEventBus();
|
|
7216
|
-
Checkbox =
|
|
7277
|
+
Checkbox = React92__default.forwardRef(
|
|
7217
7278
|
({ className, label, id, onChange, ...props }, ref) => {
|
|
7218
7279
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
7219
7280
|
const eventBus = useEventBus();
|
|
@@ -7267,7 +7328,7 @@ var init_Spinner = __esm({
|
|
|
7267
7328
|
md: "h-6 w-6",
|
|
7268
7329
|
lg: "h-8 w-8"
|
|
7269
7330
|
};
|
|
7270
|
-
Spinner =
|
|
7331
|
+
Spinner = React92__default.forwardRef(
|
|
7271
7332
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
7272
7333
|
if (overlay) {
|
|
7273
7334
|
return /* @__PURE__ */ jsx(
|
|
@@ -7357,7 +7418,7 @@ var init_Card = __esm({
|
|
|
7357
7418
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
7358
7419
|
"tile-image-first": "p-0 overflow-hidden"
|
|
7359
7420
|
};
|
|
7360
|
-
Card =
|
|
7421
|
+
Card = React92__default.forwardRef(
|
|
7361
7422
|
({
|
|
7362
7423
|
className,
|
|
7363
7424
|
variant = "bordered",
|
|
@@ -7406,9 +7467,9 @@ var init_Card = __esm({
|
|
|
7406
7467
|
}
|
|
7407
7468
|
);
|
|
7408
7469
|
Card.displayName = "Card";
|
|
7409
|
-
CardHeader =
|
|
7470
|
+
CardHeader = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
7410
7471
|
CardHeader.displayName = "CardHeader";
|
|
7411
|
-
CardTitle =
|
|
7472
|
+
CardTitle = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7412
7473
|
"h3",
|
|
7413
7474
|
{
|
|
7414
7475
|
ref,
|
|
@@ -7421,11 +7482,11 @@ var init_Card = __esm({
|
|
|
7421
7482
|
}
|
|
7422
7483
|
));
|
|
7423
7484
|
CardTitle.displayName = "CardTitle";
|
|
7424
|
-
CardContent =
|
|
7485
|
+
CardContent = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
7425
7486
|
CardContent.displayName = "CardContent";
|
|
7426
7487
|
CardBody = CardContent;
|
|
7427
7488
|
CardBody.displayName = "CardBody";
|
|
7428
|
-
CardFooter =
|
|
7489
|
+
CardFooter = React92__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7429
7490
|
"div",
|
|
7430
7491
|
{
|
|
7431
7492
|
ref,
|
|
@@ -7512,7 +7573,7 @@ var init_FilterPill = __esm({
|
|
|
7512
7573
|
md: "w-3.5 h-3.5",
|
|
7513
7574
|
lg: "w-4 h-4"
|
|
7514
7575
|
};
|
|
7515
|
-
FilterPill =
|
|
7576
|
+
FilterPill = React92__default.forwardRef(
|
|
7516
7577
|
({
|
|
7517
7578
|
className,
|
|
7518
7579
|
variant = "default",
|
|
@@ -7641,8 +7702,8 @@ var init_Avatar = __esm({
|
|
|
7641
7702
|
actionPayload
|
|
7642
7703
|
}) => {
|
|
7643
7704
|
const eventBus = useEventBus();
|
|
7644
|
-
const [imgFailed, setImgFailed] =
|
|
7645
|
-
|
|
7705
|
+
const [imgFailed, setImgFailed] = React92__default.useState(false);
|
|
7706
|
+
React92__default.useEffect(() => {
|
|
7646
7707
|
setImgFailed(false);
|
|
7647
7708
|
}, [src]);
|
|
7648
7709
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -7755,7 +7816,7 @@ var init_Center = __esm({
|
|
|
7755
7816
|
as: Component = "div"
|
|
7756
7817
|
}) => {
|
|
7757
7818
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
7758
|
-
return
|
|
7819
|
+
return React92__default.createElement(Component, {
|
|
7759
7820
|
className: cn(
|
|
7760
7821
|
inline ? "inline-flex" : "flex",
|
|
7761
7822
|
horizontal && "justify-center",
|
|
@@ -8023,7 +8084,7 @@ var init_Radio = __esm({
|
|
|
8023
8084
|
md: "w-2.5 h-2.5",
|
|
8024
8085
|
lg: "w-3 h-3"
|
|
8025
8086
|
};
|
|
8026
|
-
Radio =
|
|
8087
|
+
Radio = React92__default.forwardRef(
|
|
8027
8088
|
({
|
|
8028
8089
|
label,
|
|
8029
8090
|
helperText,
|
|
@@ -8040,12 +8101,12 @@ var init_Radio = __esm({
|
|
|
8040
8101
|
onChange,
|
|
8041
8102
|
...props
|
|
8042
8103
|
}, ref) => {
|
|
8043
|
-
const reactId =
|
|
8104
|
+
const reactId = React92__default.useId();
|
|
8044
8105
|
const baseId = id || `radio-${reactId}`;
|
|
8045
8106
|
const hasError = !!error;
|
|
8046
8107
|
const eventBus = useEventBus();
|
|
8047
|
-
const [selected, setSelected] =
|
|
8048
|
-
|
|
8108
|
+
const [selected, setSelected] = React92__default.useState(value);
|
|
8109
|
+
React92__default.useEffect(() => {
|
|
8049
8110
|
if (value !== void 0) setSelected(value);
|
|
8050
8111
|
}, [value]);
|
|
8051
8112
|
const pick = (next, e) => {
|
|
@@ -8227,7 +8288,7 @@ var init_Switch = __esm({
|
|
|
8227
8288
|
"components/core/atoms/Switch.tsx"() {
|
|
8228
8289
|
"use client";
|
|
8229
8290
|
init_cn();
|
|
8230
|
-
Switch =
|
|
8291
|
+
Switch = React92.forwardRef(
|
|
8231
8292
|
({
|
|
8232
8293
|
checked,
|
|
8233
8294
|
defaultChecked = false,
|
|
@@ -8238,10 +8299,10 @@ var init_Switch = __esm({
|
|
|
8238
8299
|
name,
|
|
8239
8300
|
className
|
|
8240
8301
|
}, ref) => {
|
|
8241
|
-
const [isChecked, setIsChecked] =
|
|
8302
|
+
const [isChecked, setIsChecked] = React92.useState(
|
|
8242
8303
|
checked !== void 0 ? checked : defaultChecked
|
|
8243
8304
|
);
|
|
8244
|
-
|
|
8305
|
+
React92.useEffect(() => {
|
|
8245
8306
|
if (checked !== void 0) {
|
|
8246
8307
|
setIsChecked(checked);
|
|
8247
8308
|
}
|
|
@@ -8519,7 +8580,7 @@ var Aside;
|
|
|
8519
8580
|
var init_Aside = __esm({
|
|
8520
8581
|
"components/core/atoms/Aside.tsx"() {
|
|
8521
8582
|
init_cn();
|
|
8522
|
-
Aside =
|
|
8583
|
+
Aside = React92__default.forwardRef(
|
|
8523
8584
|
({ className, children, ...rest }, ref) => /* @__PURE__ */ jsx("aside", { ref, className: cn(className), ...rest, children })
|
|
8524
8585
|
);
|
|
8525
8586
|
Aside.displayName = "Aside";
|
|
@@ -8598,9 +8659,9 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8598
8659
|
className
|
|
8599
8660
|
}) => {
|
|
8600
8661
|
const { t } = useTranslate();
|
|
8601
|
-
const [isVisible, setIsVisible] =
|
|
8602
|
-
const timeoutRef =
|
|
8603
|
-
const triggerRef =
|
|
8662
|
+
const [isVisible, setIsVisible] = React92__default.useState(false);
|
|
8663
|
+
const timeoutRef = React92__default.useRef(null);
|
|
8664
|
+
const triggerRef = React92__default.useRef(null);
|
|
8604
8665
|
const handleMouseEnter = () => {
|
|
8605
8666
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8606
8667
|
timeoutRef.current = setTimeout(() => setIsVisible(true), 200);
|
|
@@ -8611,7 +8672,7 @@ var init_LawReferenceTooltip = __esm({
|
|
|
8611
8672
|
};
|
|
8612
8673
|
const { revealed, triggerProps } = useTapReveal({ refs: [triggerRef] });
|
|
8613
8674
|
const open = isVisible || revealed;
|
|
8614
|
-
|
|
8675
|
+
React92__default.useEffect(() => {
|
|
8615
8676
|
return () => {
|
|
8616
8677
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
8617
8678
|
};
|
|
@@ -8821,7 +8882,7 @@ var init_StatusDot = __esm({
|
|
|
8821
8882
|
md: "w-2.5 h-2.5",
|
|
8822
8883
|
lg: "w-3 h-3"
|
|
8823
8884
|
};
|
|
8824
|
-
StatusDot =
|
|
8885
|
+
StatusDot = React92__default.forwardRef(
|
|
8825
8886
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
8826
8887
|
return /* @__PURE__ */ jsx(
|
|
8827
8888
|
"span",
|
|
@@ -8875,7 +8936,7 @@ var init_TrendIndicator = __esm({
|
|
|
8875
8936
|
down: "trending-down",
|
|
8876
8937
|
flat: "arrow-right"
|
|
8877
8938
|
};
|
|
8878
|
-
TrendIndicator =
|
|
8939
|
+
TrendIndicator = React92__default.forwardRef(
|
|
8879
8940
|
({
|
|
8880
8941
|
className,
|
|
8881
8942
|
value,
|
|
@@ -8944,7 +9005,7 @@ var init_RangeSlider = __esm({
|
|
|
8944
9005
|
md: "w-4 h-4",
|
|
8945
9006
|
lg: "w-5 h-5"
|
|
8946
9007
|
};
|
|
8947
|
-
RangeSlider =
|
|
9008
|
+
RangeSlider = React92__default.forwardRef(
|
|
8948
9009
|
({
|
|
8949
9010
|
className,
|
|
8950
9011
|
min = 0,
|
|
@@ -9555,7 +9616,7 @@ var init_ContentSection = __esm({
|
|
|
9555
9616
|
md: "py-16",
|
|
9556
9617
|
lg: "py-24"
|
|
9557
9618
|
};
|
|
9558
|
-
ContentSection =
|
|
9619
|
+
ContentSection = React92__default.forwardRef(
|
|
9559
9620
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
9560
9621
|
return /* @__PURE__ */ jsx(
|
|
9561
9622
|
Box,
|
|
@@ -10089,7 +10150,7 @@ var init_AnimatedReveal = __esm({
|
|
|
10089
10150
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
10090
10151
|
"none": {}
|
|
10091
10152
|
};
|
|
10092
|
-
AnimatedReveal =
|
|
10153
|
+
AnimatedReveal = React92__default.forwardRef(
|
|
10093
10154
|
({
|
|
10094
10155
|
trigger = "scroll",
|
|
10095
10156
|
animation = "fade-up",
|
|
@@ -10249,7 +10310,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10249
10310
|
"components/marketing/atoms/AnimatedGraphic.tsx"() {
|
|
10250
10311
|
"use client";
|
|
10251
10312
|
init_cn();
|
|
10252
|
-
AnimatedGraphic =
|
|
10313
|
+
AnimatedGraphic = React92__default.forwardRef(
|
|
10253
10314
|
({
|
|
10254
10315
|
src,
|
|
10255
10316
|
svgContent,
|
|
@@ -10272,7 +10333,7 @@ var init_AnimatedGraphic = __esm({
|
|
|
10272
10333
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
10273
10334
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
10274
10335
|
const prevAnimateRef = useRef(animate);
|
|
10275
|
-
const setRef =
|
|
10336
|
+
const setRef = React92__default.useCallback(
|
|
10276
10337
|
(node) => {
|
|
10277
10338
|
containerRef.current = node;
|
|
10278
10339
|
if (typeof ref === "function") ref(node);
|
|
@@ -11000,9 +11061,9 @@ function ControlButton({
|
|
|
11000
11061
|
className
|
|
11001
11062
|
}) {
|
|
11002
11063
|
const eventBus = useEventBus();
|
|
11003
|
-
const [isPressed, setIsPressed] =
|
|
11064
|
+
const [isPressed, setIsPressed] = React92.useState(false);
|
|
11004
11065
|
const actualPressed = pressed ?? isPressed;
|
|
11005
|
-
const handlePointerDown =
|
|
11066
|
+
const handlePointerDown = React92.useCallback(
|
|
11006
11067
|
(e) => {
|
|
11007
11068
|
e.preventDefault();
|
|
11008
11069
|
if (disabled) return;
|
|
@@ -11012,7 +11073,7 @@ function ControlButton({
|
|
|
11012
11073
|
},
|
|
11013
11074
|
[disabled, pressEvent, eventBus, onPress]
|
|
11014
11075
|
);
|
|
11015
|
-
const handlePointerUp =
|
|
11076
|
+
const handlePointerUp = React92.useCallback(
|
|
11016
11077
|
(e) => {
|
|
11017
11078
|
e.preventDefault();
|
|
11018
11079
|
if (disabled) return;
|
|
@@ -11022,7 +11083,7 @@ function ControlButton({
|
|
|
11022
11083
|
},
|
|
11023
11084
|
[disabled, releaseEvent, eventBus, onRelease]
|
|
11024
11085
|
);
|
|
11025
|
-
const handlePointerLeave =
|
|
11086
|
+
const handlePointerLeave = React92.useCallback(
|
|
11026
11087
|
(e) => {
|
|
11027
11088
|
if (isPressed) {
|
|
11028
11089
|
setIsPressed(false);
|
|
@@ -11093,7 +11154,7 @@ var init_ControlButton = __esm({
|
|
|
11093
11154
|
ControlButton.displayName = "ControlButton";
|
|
11094
11155
|
}
|
|
11095
11156
|
});
|
|
11096
|
-
function
|
|
11157
|
+
function formatTime2(seconds, format) {
|
|
11097
11158
|
const clamped = Math.max(0, Math.floor(seconds));
|
|
11098
11159
|
if (format === "ss") {
|
|
11099
11160
|
return `${clamped}s`;
|
|
@@ -11130,7 +11191,7 @@ function TimerDisplay({
|
|
|
11130
11191
|
),
|
|
11131
11192
|
children: [
|
|
11132
11193
|
iconAsset && /* @__PURE__ */ jsx(GameIcon, { assetUrl: iconAsset, icon: "image", size: 16, className: "w-4 h-4 object-contain flex-shrink-0" }),
|
|
11133
|
-
|
|
11194
|
+
formatTime2(seconds, format)
|
|
11134
11195
|
]
|
|
11135
11196
|
}
|
|
11136
11197
|
);
|
|
@@ -11263,6 +11324,210 @@ var init_ChoiceButton = __esm({
|
|
|
11263
11324
|
ChoiceButton.displayName = "ChoiceButton";
|
|
11264
11325
|
}
|
|
11265
11326
|
});
|
|
11327
|
+
function SvgStage({
|
|
11328
|
+
cols,
|
|
11329
|
+
rows,
|
|
11330
|
+
tileSize = 32,
|
|
11331
|
+
background = "var(--color-background)",
|
|
11332
|
+
tileClickEvent,
|
|
11333
|
+
tileHoverEvent,
|
|
11334
|
+
tileLeaveEvent,
|
|
11335
|
+
keyMap,
|
|
11336
|
+
keyUpMap,
|
|
11337
|
+
className,
|
|
11338
|
+
children
|
|
11339
|
+
}) {
|
|
11340
|
+
const eventBus = useEventBus();
|
|
11341
|
+
const svgRef = useRef(null);
|
|
11342
|
+
const pointerDownRef = useRef(null);
|
|
11343
|
+
const cellFromClient = useCallback((clientX, clientY) => {
|
|
11344
|
+
const svg = svgRef.current;
|
|
11345
|
+
if (!svg) return null;
|
|
11346
|
+
const rect = svg.getBoundingClientRect();
|
|
11347
|
+
if (rect.width === 0 || rect.height === 0) return null;
|
|
11348
|
+
const vbW = cols * tileSize;
|
|
11349
|
+
const vbH = rows * tileSize;
|
|
11350
|
+
const meet = Math.min(rect.width / vbW, rect.height / vbH);
|
|
11351
|
+
const offsetX = (rect.width - vbW * meet) / 2;
|
|
11352
|
+
const offsetY = (rect.height - vbH * meet) / 2;
|
|
11353
|
+
const svgX = (clientX - rect.left - offsetX) / meet;
|
|
11354
|
+
const svgY = (clientY - rect.top - offsetY) / meet;
|
|
11355
|
+
return {
|
|
11356
|
+
x: Math.min(Math.max(Math.floor(svgX / tileSize), 0), cols - 1),
|
|
11357
|
+
y: Math.min(Math.max(Math.floor(svgY / tileSize), 0), rows - 1)
|
|
11358
|
+
};
|
|
11359
|
+
}, [cols, rows, tileSize]);
|
|
11360
|
+
const handlePointerDown = useCallback((e) => {
|
|
11361
|
+
pointerDownRef.current = { clientX: e.clientX, clientY: e.clientY };
|
|
11362
|
+
}, []);
|
|
11363
|
+
const handlePointerUp = useCallback((e) => {
|
|
11364
|
+
const down = pointerDownRef.current;
|
|
11365
|
+
pointerDownRef.current = null;
|
|
11366
|
+
if (!tileClickEvent) return;
|
|
11367
|
+
if (down && Math.hypot(e.clientX - down.clientX, e.clientY - down.clientY) > 5) return;
|
|
11368
|
+
const cell = cellFromClient(e.clientX, e.clientY);
|
|
11369
|
+
if (cell) eventBus.emit(`UI:${tileClickEvent}`, cell);
|
|
11370
|
+
}, [cellFromClient, tileClickEvent, eventBus]);
|
|
11371
|
+
const handlePointerMove = useCallback((e) => {
|
|
11372
|
+
if (!tileHoverEvent) return;
|
|
11373
|
+
const cell = cellFromClient(e.clientX, e.clientY);
|
|
11374
|
+
if (cell) eventBus.emit(`UI:${tileHoverEvent}`, cell);
|
|
11375
|
+
}, [cellFromClient, tileHoverEvent, eventBus]);
|
|
11376
|
+
const handlePointerLeave = useCallback(() => {
|
|
11377
|
+
pointerDownRef.current = null;
|
|
11378
|
+
if (tileLeaveEvent) eventBus.emit(`UI:${tileLeaveEvent}`, {});
|
|
11379
|
+
}, [tileLeaveEvent, eventBus]);
|
|
11380
|
+
useEffect(() => {
|
|
11381
|
+
if (!keyMap && !keyUpMap) return;
|
|
11382
|
+
const onDown = (e) => {
|
|
11383
|
+
const ev = keyMap?.[e.code];
|
|
11384
|
+
if (ev) {
|
|
11385
|
+
eventBus.emit(`UI:${ev}`, {});
|
|
11386
|
+
e.preventDefault();
|
|
11387
|
+
}
|
|
11388
|
+
};
|
|
11389
|
+
const onUp = (e) => {
|
|
11390
|
+
const ev = keyUpMap?.[e.code];
|
|
11391
|
+
if (ev) eventBus.emit(`UI:${ev}`, {});
|
|
11392
|
+
};
|
|
11393
|
+
window.addEventListener("keydown", onDown);
|
|
11394
|
+
window.addEventListener("keyup", onUp);
|
|
11395
|
+
return () => {
|
|
11396
|
+
window.removeEventListener("keydown", onDown);
|
|
11397
|
+
window.removeEventListener("keyup", onUp);
|
|
11398
|
+
};
|
|
11399
|
+
}, [keyMap, keyUpMap, eventBus]);
|
|
11400
|
+
useEffect(() => {
|
|
11401
|
+
if (!keyMap && !keyUpMap) return;
|
|
11402
|
+
svgRef.current?.focus();
|
|
11403
|
+
}, [keyMap, keyUpMap]);
|
|
11404
|
+
const stageContext = useMemo(() => ({ tileSize }), [tileSize]);
|
|
11405
|
+
return /* @__PURE__ */ jsxs(
|
|
11406
|
+
"svg",
|
|
11407
|
+
{
|
|
11408
|
+
ref: svgRef,
|
|
11409
|
+
"data-testid": "svg-stage",
|
|
11410
|
+
viewBox: `0 0 ${cols * tileSize} ${rows * tileSize}`,
|
|
11411
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
11412
|
+
className: cn("block h-full w-full", className),
|
|
11413
|
+
tabIndex: keyMap || keyUpMap ? 0 : void 0,
|
|
11414
|
+
onPointerDown: handlePointerDown,
|
|
11415
|
+
onPointerMove: handlePointerMove,
|
|
11416
|
+
onPointerUp: handlePointerUp,
|
|
11417
|
+
onPointerLeave: handlePointerLeave,
|
|
11418
|
+
children: [
|
|
11419
|
+
/* @__PURE__ */ jsx("rect", { width: cols * tileSize, height: rows * tileSize, fill: background }),
|
|
11420
|
+
/* @__PURE__ */ jsx(SvgStageContext.Provider, { value: stageContext, children })
|
|
11421
|
+
]
|
|
11422
|
+
}
|
|
11423
|
+
);
|
|
11424
|
+
}
|
|
11425
|
+
var SvgStageContext;
|
|
11426
|
+
var init_SvgStage = __esm({
|
|
11427
|
+
"components/game/molecules/SvgStage.tsx"() {
|
|
11428
|
+
"use client";
|
|
11429
|
+
init_cn();
|
|
11430
|
+
init_useEventBus();
|
|
11431
|
+
SvgStageContext = React92.createContext({ tileSize: 1 });
|
|
11432
|
+
SvgStage.displayName = "SvgStage";
|
|
11433
|
+
}
|
|
11434
|
+
});
|
|
11435
|
+
function SvgDrawShape({
|
|
11436
|
+
shape,
|
|
11437
|
+
x,
|
|
11438
|
+
y,
|
|
11439
|
+
width,
|
|
11440
|
+
height,
|
|
11441
|
+
radius,
|
|
11442
|
+
radiusY,
|
|
11443
|
+
points,
|
|
11444
|
+
d,
|
|
11445
|
+
x2,
|
|
11446
|
+
y2,
|
|
11447
|
+
fill,
|
|
11448
|
+
stroke,
|
|
11449
|
+
strokeWidth,
|
|
11450
|
+
opacity,
|
|
11451
|
+
className
|
|
11452
|
+
}) {
|
|
11453
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
11454
|
+
const cell = (v) => v === void 0 ? void 0 : v * tileSize;
|
|
11455
|
+
const paint = {
|
|
11456
|
+
fill: fill ?? (stroke === void 0 ? "var(--color-primary)" : "none"),
|
|
11457
|
+
stroke,
|
|
11458
|
+
strokeWidth,
|
|
11459
|
+
opacity,
|
|
11460
|
+
className
|
|
11461
|
+
};
|
|
11462
|
+
return /* @__PURE__ */ jsxs("g", { transform: `translate(${x * tileSize} ${y * tileSize})`, children: [
|
|
11463
|
+
shape === "rect" && /* @__PURE__ */ jsx("rect", { width: cell(width), height: cell(height), ...paint }),
|
|
11464
|
+
shape === "circle" && /* @__PURE__ */ jsx("circle", { r: cell(radius), ...paint }),
|
|
11465
|
+
shape === "ellipse" && /* @__PURE__ */ jsx("ellipse", { rx: cell(radius), ry: cell(radiusY ?? radius), ...paint }),
|
|
11466
|
+
shape === "polygon" && /* @__PURE__ */ jsx("polygon", { points, ...paint }),
|
|
11467
|
+
shape === "polyline" && /* @__PURE__ */ jsx("polyline", { points, ...paint }),
|
|
11468
|
+
shape === "path" && /* @__PURE__ */ jsx("path", { d, ...paint }),
|
|
11469
|
+
shape === "line" && /* @__PURE__ */ jsx("line", { x2: cell(x2), y2: cell(y2), ...paint })
|
|
11470
|
+
] });
|
|
11471
|
+
}
|
|
11472
|
+
var init_SvgDrawShape = __esm({
|
|
11473
|
+
"components/game/atoms/SvgDrawShape.tsx"() {
|
|
11474
|
+
"use client";
|
|
11475
|
+
init_SvgStage();
|
|
11476
|
+
SvgDrawShape.displayName = "SvgDrawShape";
|
|
11477
|
+
}
|
|
11478
|
+
});
|
|
11479
|
+
function SvgDrawGroup({
|
|
11480
|
+
x = 0,
|
|
11481
|
+
y = 0,
|
|
11482
|
+
scale,
|
|
11483
|
+
rotate,
|
|
11484
|
+
opacity,
|
|
11485
|
+
className,
|
|
11486
|
+
children
|
|
11487
|
+
}) {
|
|
11488
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
11489
|
+
const transforms = [`translate(${x * tileSize} ${y * tileSize})`];
|
|
11490
|
+
if (rotate !== void 0) transforms.push(`rotate(${rotate})`);
|
|
11491
|
+
if (scale !== void 0) transforms.push(`scale(${scale})`);
|
|
11492
|
+
return /* @__PURE__ */ jsx("g", { transform: transforms.join(" "), opacity, className, children });
|
|
11493
|
+
}
|
|
11494
|
+
var init_SvgDrawGroup = __esm({
|
|
11495
|
+
"components/game/atoms/SvgDrawGroup.tsx"() {
|
|
11496
|
+
"use client";
|
|
11497
|
+
init_SvgStage();
|
|
11498
|
+
SvgDrawGroup.displayName = "SvgDrawGroup";
|
|
11499
|
+
}
|
|
11500
|
+
});
|
|
11501
|
+
function SvgDrawText({
|
|
11502
|
+
x,
|
|
11503
|
+
y,
|
|
11504
|
+
text,
|
|
11505
|
+
size = 12,
|
|
11506
|
+
fill = "var(--color-foreground)",
|
|
11507
|
+
anchor = "middle",
|
|
11508
|
+
className
|
|
11509
|
+
}) {
|
|
11510
|
+
const { tileSize } = useContext(SvgStageContext);
|
|
11511
|
+
return /* @__PURE__ */ jsx(
|
|
11512
|
+
"text",
|
|
11513
|
+
{
|
|
11514
|
+
x: x * tileSize,
|
|
11515
|
+
y: y * tileSize,
|
|
11516
|
+
fontSize: size,
|
|
11517
|
+
fill,
|
|
11518
|
+
textAnchor: anchor,
|
|
11519
|
+
className,
|
|
11520
|
+
children: text
|
|
11521
|
+
}
|
|
11522
|
+
);
|
|
11523
|
+
}
|
|
11524
|
+
var init_SvgDrawText = __esm({
|
|
11525
|
+
"components/game/atoms/SvgDrawText.tsx"() {
|
|
11526
|
+
"use client";
|
|
11527
|
+
init_SvgStage();
|
|
11528
|
+
SvgDrawText.displayName = "SvgDrawText";
|
|
11529
|
+
}
|
|
11530
|
+
});
|
|
11266
11531
|
function ControlGrid({
|
|
11267
11532
|
kind,
|
|
11268
11533
|
buttons = DEFAULT_BUTTONS,
|
|
@@ -11280,8 +11545,8 @@ function ControlGrid({
|
|
|
11280
11545
|
className
|
|
11281
11546
|
}) {
|
|
11282
11547
|
const eventBus = useEventBus();
|
|
11283
|
-
const [active, setActive] =
|
|
11284
|
-
const handlePress =
|
|
11548
|
+
const [active, setActive] = React92.useState(/* @__PURE__ */ new Set());
|
|
11549
|
+
const handlePress = React92.useCallback(
|
|
11285
11550
|
(id) => {
|
|
11286
11551
|
setActive((prev) => new Set(prev).add(id));
|
|
11287
11552
|
if (actionEvent) eventBus.emit(`UI:${actionEvent}`, { id, pressed: true });
|
|
@@ -11295,7 +11560,7 @@ function ControlGrid({
|
|
|
11295
11560
|
},
|
|
11296
11561
|
[kind, actionEvent, directionEvent, directionEvents, eventBus, onAction, onDirection]
|
|
11297
11562
|
);
|
|
11298
|
-
const handleRelease =
|
|
11563
|
+
const handleRelease = React92.useCallback(
|
|
11299
11564
|
(id) => {
|
|
11300
11565
|
setActive((prev) => {
|
|
11301
11566
|
const next = new Set(prev);
|
|
@@ -11653,7 +11918,7 @@ function GameMenu({
|
|
|
11653
11918
|
}) {
|
|
11654
11919
|
const resolvedOptions = (options?.length ? options : void 0) ?? (menuItems?.length ? menuItems : void 0) ?? DEFAULT_MENU_OPTIONS;
|
|
11655
11920
|
const eventBus = useEventBus();
|
|
11656
|
-
const handleOptionClick =
|
|
11921
|
+
const handleOptionClick = React92.useCallback(
|
|
11657
11922
|
(option) => {
|
|
11658
11923
|
if (option.event) {
|
|
11659
11924
|
eventBus.emit(`UI:${option.event}`, { option });
|
|
@@ -11889,7 +12154,7 @@ function StateGraph({
|
|
|
11889
12154
|
}) {
|
|
11890
12155
|
const eventBus = useEventBus();
|
|
11891
12156
|
const nodes = states ?? [];
|
|
11892
|
-
const positions =
|
|
12157
|
+
const positions = React92.useMemo(() => layoutStates(nodes, width, height), [nodes, width, height]);
|
|
11893
12158
|
return /* @__PURE__ */ jsxs(
|
|
11894
12159
|
Box,
|
|
11895
12160
|
{
|
|
@@ -11960,8 +12225,8 @@ function MiniMap({
|
|
|
11960
12225
|
tileAssets,
|
|
11961
12226
|
unitAssets
|
|
11962
12227
|
}) {
|
|
11963
|
-
const canvasRef =
|
|
11964
|
-
const imgCacheRef =
|
|
12228
|
+
const canvasRef = React92.useRef(null);
|
|
12229
|
+
const imgCacheRef = React92.useRef(/* @__PURE__ */ new Map());
|
|
11965
12230
|
function loadImg(url) {
|
|
11966
12231
|
const cached = imgCacheRef.current.get(url);
|
|
11967
12232
|
if (cached) return cached.complete ? cached : null;
|
|
@@ -11976,7 +12241,7 @@ function MiniMap({
|
|
|
11976
12241
|
imgCacheRef.current.set(url, img);
|
|
11977
12242
|
return null;
|
|
11978
12243
|
}
|
|
11979
|
-
|
|
12244
|
+
React92.useEffect(() => {
|
|
11980
12245
|
const canvas = canvasRef.current;
|
|
11981
12246
|
if (!canvas) return;
|
|
11982
12247
|
const ctx = canvas.getContext("2d");
|
|
@@ -13288,6 +13553,32 @@ var init_Canvas = __esm({
|
|
|
13288
13553
|
Canvas.displayName = "Canvas";
|
|
13289
13554
|
}
|
|
13290
13555
|
});
|
|
13556
|
+
function SvgDrawShapeLayer({
|
|
13557
|
+
items,
|
|
13558
|
+
fill,
|
|
13559
|
+
stroke,
|
|
13560
|
+
strokeWidth,
|
|
13561
|
+
opacity
|
|
13562
|
+
}) {
|
|
13563
|
+
return /* @__PURE__ */ jsx("g", { children: items.map(({ id, ...shape }) => /* @__PURE__ */ jsx(
|
|
13564
|
+
SvgDrawShape,
|
|
13565
|
+
{
|
|
13566
|
+
...shape,
|
|
13567
|
+
fill: shape.fill ?? fill,
|
|
13568
|
+
stroke: shape.stroke ?? stroke,
|
|
13569
|
+
strokeWidth: shape.strokeWidth ?? strokeWidth,
|
|
13570
|
+
opacity: shape.opacity ?? opacity
|
|
13571
|
+
},
|
|
13572
|
+
id
|
|
13573
|
+
)) });
|
|
13574
|
+
}
|
|
13575
|
+
var init_SvgDrawShapeLayer = __esm({
|
|
13576
|
+
"components/game/molecules/SvgDrawShapeLayer.tsx"() {
|
|
13577
|
+
"use client";
|
|
13578
|
+
init_SvgDrawShape();
|
|
13579
|
+
SvgDrawShapeLayer.displayName = "SvgDrawShapeLayer";
|
|
13580
|
+
}
|
|
13581
|
+
});
|
|
13291
13582
|
function GameAudioToggle({
|
|
13292
13583
|
size = "sm",
|
|
13293
13584
|
className,
|
|
@@ -13404,7 +13695,7 @@ function LinearView({
|
|
|
13404
13695
|
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap items-center", gap: "xs", children: trait.states.map((state, i) => {
|
|
13405
13696
|
const isDone = i < currentIdx;
|
|
13406
13697
|
const isCurrent = i === currentIdx;
|
|
13407
|
-
return /* @__PURE__ */ jsxs(
|
|
13698
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
13408
13699
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13409
13700
|
Typography,
|
|
13410
13701
|
{
|
|
@@ -13939,7 +14230,7 @@ function SequenceBar({
|
|
|
13939
14230
|
else onSlotRemove?.(index);
|
|
13940
14231
|
}, [emit, slotRemoveEvent, onSlotRemove, playing]);
|
|
13941
14232
|
const paddedSlots = Array.from({ length: maxSlots }, (_, i) => slots[i]);
|
|
13942
|
-
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(
|
|
14233
|
+
return /* @__PURE__ */ jsx(HStack, { className: cn("items-center", className), gap: "sm", children: paddedSlots.map((slot, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
13943
14234
|
i > 0 && /* @__PURE__ */ jsx(
|
|
13944
14235
|
Typography,
|
|
13945
14236
|
{
|
|
@@ -14588,7 +14879,7 @@ var init_ErrorBoundary = __esm({
|
|
|
14588
14879
|
}
|
|
14589
14880
|
);
|
|
14590
14881
|
};
|
|
14591
|
-
ErrorBoundary = class extends
|
|
14882
|
+
ErrorBoundary = class extends React92__default.Component {
|
|
14592
14883
|
constructor(props) {
|
|
14593
14884
|
super(props);
|
|
14594
14885
|
__publicField(this, "reset", () => {
|
|
@@ -14857,7 +15148,7 @@ var init_Container = __esm({
|
|
|
14857
15148
|
as: Component = "div"
|
|
14858
15149
|
}) => {
|
|
14859
15150
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
14860
|
-
return
|
|
15151
|
+
return React92__default.createElement(
|
|
14861
15152
|
Component,
|
|
14862
15153
|
{
|
|
14863
15154
|
className: cn(
|
|
@@ -16995,7 +17286,7 @@ var init_CodeBlock = __esm({
|
|
|
16995
17286
|
DIFF_STYLE_FALLBACK = { bg: "", prefix: " ", text: "text-foreground" };
|
|
16996
17287
|
LINE_PROPS_FN = (n) => ({ "data-line": String(n - 1) });
|
|
16997
17288
|
HIDDEN_LINE_NUMBERS = { display: "none" };
|
|
16998
|
-
CodeBlock =
|
|
17289
|
+
CodeBlock = React92__default.memo(
|
|
16999
17290
|
({
|
|
17000
17291
|
code: rawCode,
|
|
17001
17292
|
language = "text",
|
|
@@ -17583,7 +17874,7 @@ var init_MarkdownContent = __esm({
|
|
|
17583
17874
|
init_Box();
|
|
17584
17875
|
init_CodeBlock();
|
|
17585
17876
|
init_cn();
|
|
17586
|
-
MarkdownContent =
|
|
17877
|
+
MarkdownContent = React92__default.memo(
|
|
17587
17878
|
({ content, direction = "ltr", className }) => {
|
|
17588
17879
|
const { t: _t } = useTranslate();
|
|
17589
17880
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -18910,7 +19201,7 @@ var init_StateMachineView = __esm({
|
|
|
18910
19201
|
style: { top: title ? 30 : 0 },
|
|
18911
19202
|
children: [
|
|
18912
19203
|
entity && /* @__PURE__ */ jsx(EntityBox, { entity, config }),
|
|
18913
|
-
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(
|
|
19204
|
+
states.map((state) => renderStateNode ? /* @__PURE__ */ jsx(React92__default.Fragment, { children: renderStateNode(state, config) }, state.id) : /* @__PURE__ */ jsx(
|
|
18914
19205
|
StateNode2,
|
|
18915
19206
|
{
|
|
18916
19207
|
state,
|
|
@@ -21655,9 +21946,6 @@ function normalizeFields(fields) {
|
|
|
21655
21946
|
if (!fields) return [];
|
|
21656
21947
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
21657
21948
|
}
|
|
21658
|
-
function fieldLabel(key) {
|
|
21659
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
21660
|
-
}
|
|
21661
21949
|
function asBooleanValue(value) {
|
|
21662
21950
|
if (typeof value === "boolean") return value;
|
|
21663
21951
|
if (value === "true") return true;
|
|
@@ -21668,12 +21956,6 @@ function isDateField(key) {
|
|
|
21668
21956
|
const lower = key.toLowerCase();
|
|
21669
21957
|
return lower.includes("date") || lower.includes("time") || lower.endsWith("at") || lower.endsWith("_at");
|
|
21670
21958
|
}
|
|
21671
|
-
function formatDate(value) {
|
|
21672
|
-
if (!value) return "";
|
|
21673
|
-
const d = new Date(String(value));
|
|
21674
|
-
if (isNaN(d.getTime())) return String(value);
|
|
21675
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
21676
|
-
}
|
|
21677
21959
|
function statusVariant(value) {
|
|
21678
21960
|
const v = value.toLowerCase();
|
|
21679
21961
|
if (["active", "completed", "done", "approved", "published", "resolved", "open"].includes(v)) return "success";
|
|
@@ -21682,11 +21964,12 @@ function statusVariant(value) {
|
|
|
21682
21964
|
if (["new", "created", "scheduled", "queued"].includes(v)) return "info";
|
|
21683
21965
|
return "default";
|
|
21684
21966
|
}
|
|
21685
|
-
var STATUS_FIELDS, gapStyles3, alignStyles2, CardGrid;
|
|
21967
|
+
var fieldLabel, STATUS_FIELDS, gapStyles3, alignStyles2, CardGrid;
|
|
21686
21968
|
var init_CardGrid = __esm({
|
|
21687
21969
|
"components/core/organisms/CardGrid.tsx"() {
|
|
21688
21970
|
"use client";
|
|
21689
21971
|
init_cn();
|
|
21972
|
+
init_format();
|
|
21690
21973
|
init_getNestedValue();
|
|
21691
21974
|
init_useEventBus();
|
|
21692
21975
|
init_atoms();
|
|
@@ -21695,6 +21978,7 @@ var init_CardGrid = __esm({
|
|
|
21695
21978
|
init_Typography();
|
|
21696
21979
|
init_Stack();
|
|
21697
21980
|
init_Pagination();
|
|
21981
|
+
fieldLabel = humanizeFieldName;
|
|
21698
21982
|
STATUS_FIELDS = /* @__PURE__ */ new Set(["status", "state", "priority", "type", "category", "role", "level", "tier"]);
|
|
21699
21983
|
gapStyles3 = {
|
|
21700
21984
|
none: "gap-0",
|
|
@@ -22202,7 +22486,7 @@ var init_CaseStudyOrganism = __esm({
|
|
|
22202
22486
|
CaseStudyOrganism.displayName = "CaseStudyOrganism";
|
|
22203
22487
|
}
|
|
22204
22488
|
});
|
|
22205
|
-
var CHART_COLORS, seriesColor, monthFormatter, formatTimeLabel, BarChart, PieChart, LineChart, ScatterChart, LOOK_FROM_CHART_TYPE, Chart;
|
|
22489
|
+
var CHART_COLORS, seriesColor, barColor, monthFormatter, formatTimeLabel, BarChart, PieChart, LineChart, ScatterChart, LOOK_FROM_CHART_TYPE, Chart;
|
|
22206
22490
|
var init_Chart = __esm({
|
|
22207
22491
|
"components/core/molecules/Chart.tsx"() {
|
|
22208
22492
|
"use client";
|
|
@@ -22222,6 +22506,7 @@ var init_Chart = __esm({
|
|
|
22222
22506
|
"var(--color-accent)"
|
|
22223
22507
|
];
|
|
22224
22508
|
seriesColor = (series, idx) => series.color ?? CHART_COLORS[idx % CHART_COLORS.length];
|
|
22509
|
+
barColor = (series, sIdx, catIdx, seriesCount) => series.color ?? CHART_COLORS[(seriesCount === 1 ? catIdx : sIdx) % CHART_COLORS.length];
|
|
22225
22510
|
monthFormatter = new Intl.DateTimeFormat(void 0, {
|
|
22226
22511
|
month: "short",
|
|
22227
22512
|
year: "2-digit"
|
|
@@ -22294,7 +22579,7 @@ var init_Chart = __esm({
|
|
|
22294
22579
|
children: series.map((s, sIdx) => {
|
|
22295
22580
|
const value = valueAt(s, label);
|
|
22296
22581
|
const ratio = stack === "normalize" ? total === 0 ? 0 : value / total * 100 : value / maxValue * 100;
|
|
22297
|
-
const color =
|
|
22582
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
22298
22583
|
return /* @__PURE__ */ jsx(
|
|
22299
22584
|
Box,
|
|
22300
22585
|
{
|
|
@@ -22349,7 +22634,7 @@ var init_Chart = __esm({
|
|
|
22349
22634
|
/* @__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) => {
|
|
22350
22635
|
const value = valueAt(s, label);
|
|
22351
22636
|
const barHeight = value / maxValue * 100;
|
|
22352
|
-
const color =
|
|
22637
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
22353
22638
|
return /* @__PURE__ */ jsx(
|
|
22354
22639
|
Box,
|
|
22355
22640
|
{
|
|
@@ -22400,7 +22685,7 @@ var init_Chart = __esm({
|
|
|
22400
22685
|
/* @__PURE__ */ jsx(VStack, { gap: "none", className: "w-full flex-1 min-h-0", justify: "end", children: series.map((s, sIdx) => {
|
|
22401
22686
|
const value = valueAt(s, label);
|
|
22402
22687
|
const ratio = stack === "normalize" ? total === 0 ? 0 : value / total * 100 : value / maxValue * 100;
|
|
22403
|
-
const color =
|
|
22688
|
+
const color = barColor(s, sIdx, catIdx, series.length);
|
|
22404
22689
|
return /* @__PURE__ */ jsx(
|
|
22405
22690
|
Box,
|
|
22406
22691
|
{
|
|
@@ -24738,8 +25023,8 @@ var init_Menu = __esm({
|
|
|
24738
25023
|
"bottom-end": "bottom-start"
|
|
24739
25024
|
};
|
|
24740
25025
|
const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
|
|
24741
|
-
const triggerChild =
|
|
24742
|
-
const triggerElement =
|
|
25026
|
+
const triggerChild = React92__default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsx(Typography, { variant: "small", as: "span", children: trigger });
|
|
25027
|
+
const triggerElement = React92__default.cloneElement(
|
|
24743
25028
|
triggerChild,
|
|
24744
25029
|
{
|
|
24745
25030
|
ref: triggerRef,
|
|
@@ -24834,14 +25119,14 @@ function useDataDnd(args) {
|
|
|
24834
25119
|
const isZone = Boolean(dragGroup || accepts || sortable);
|
|
24835
25120
|
const enabled = isZone || Boolean(dndRoot);
|
|
24836
25121
|
const eventBus = useEventBus();
|
|
24837
|
-
const parentRoot =
|
|
25122
|
+
const parentRoot = React92__default.useContext(RootCtx);
|
|
24838
25123
|
const isRoot = enabled && parentRoot === null;
|
|
24839
|
-
const zoneId =
|
|
25124
|
+
const zoneId = React92__default.useId();
|
|
24840
25125
|
const ownGroup = dragGroup ?? accepts ?? zoneId;
|
|
24841
|
-
const [optimisticOrders, setOptimisticOrders] =
|
|
24842
|
-
const optimisticOrdersRef =
|
|
25126
|
+
const [optimisticOrders, setOptimisticOrders] = React92__default.useState(() => /* @__PURE__ */ new Map());
|
|
25127
|
+
const optimisticOrdersRef = React92__default.useRef(optimisticOrders);
|
|
24843
25128
|
optimisticOrdersRef.current = optimisticOrders;
|
|
24844
|
-
const clearOptimisticOrder =
|
|
25129
|
+
const clearOptimisticOrder = React92__default.useCallback((group) => {
|
|
24845
25130
|
setOptimisticOrders((prev) => {
|
|
24846
25131
|
if (!prev.has(group)) return prev;
|
|
24847
25132
|
const next = new Map(prev);
|
|
@@ -24866,7 +25151,7 @@ function useDataDnd(args) {
|
|
|
24866
25151
|
const raw = it[dndItemIdField];
|
|
24867
25152
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
24868
25153
|
}).join("|");
|
|
24869
|
-
const itemIds =
|
|
25154
|
+
const itemIds = React92__default.useMemo(
|
|
24870
25155
|
() => orderedItems.map((it, idx) => {
|
|
24871
25156
|
const raw = it[dndItemIdField];
|
|
24872
25157
|
return raw != null ? String(raw) : `__idx_${idx}`;
|
|
@@ -24877,7 +25162,7 @@ function useDataDnd(args) {
|
|
|
24877
25162
|
const raw = it[dndItemIdField];
|
|
24878
25163
|
return raw != null ? String(raw) : `__${idx}`;
|
|
24879
25164
|
}).join("|");
|
|
24880
|
-
|
|
25165
|
+
React92__default.useEffect(() => {
|
|
24881
25166
|
const root = isRoot ? null : parentRoot;
|
|
24882
25167
|
if (root) {
|
|
24883
25168
|
root.clearOptimisticOrder(ownGroup);
|
|
@@ -24885,20 +25170,20 @@ function useDataDnd(args) {
|
|
|
24885
25170
|
clearOptimisticOrder(ownGroup);
|
|
24886
25171
|
}
|
|
24887
25172
|
}, [itemsContentSig, ownGroup]);
|
|
24888
|
-
const zonesRef =
|
|
24889
|
-
const registerZone =
|
|
25173
|
+
const zonesRef = React92__default.useRef(/* @__PURE__ */ new Map());
|
|
25174
|
+
const registerZone = React92__default.useCallback((zoneId2, meta2) => {
|
|
24890
25175
|
zonesRef.current.set(zoneId2, meta2);
|
|
24891
25176
|
}, []);
|
|
24892
|
-
const unregisterZone =
|
|
25177
|
+
const unregisterZone = React92__default.useCallback((zoneId2) => {
|
|
24893
25178
|
zonesRef.current.delete(zoneId2);
|
|
24894
25179
|
}, []);
|
|
24895
|
-
const [activeDrag, setActiveDrag] =
|
|
24896
|
-
const [overZoneGroup, setOverZoneGroup] =
|
|
24897
|
-
const meta =
|
|
25180
|
+
const [activeDrag, setActiveDrag] = React92__default.useState(null);
|
|
25181
|
+
const [overZoneGroup, setOverZoneGroup] = React92__default.useState(null);
|
|
25182
|
+
const meta = React92__default.useMemo(
|
|
24898
25183
|
() => ({ group: ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, rawItems: items, idField: dndItemIdField }),
|
|
24899
25184
|
[ownGroup, dropEvent, reorderEvent, positionEvent, itemIds, items, dndItemIdField]
|
|
24900
25185
|
);
|
|
24901
|
-
|
|
25186
|
+
React92__default.useEffect(() => {
|
|
24902
25187
|
const target = isRoot ? null : parentRoot;
|
|
24903
25188
|
if (!target) {
|
|
24904
25189
|
zonesRef.current.set(zoneId, meta);
|
|
@@ -24917,7 +25202,7 @@ function useDataDnd(args) {
|
|
|
24917
25202
|
}, [parentRoot, isRoot, zoneId, meta]);
|
|
24918
25203
|
const sensors = useAlmadarDndSensors(true);
|
|
24919
25204
|
const collisionDetection = almadarDndCollisionDetection;
|
|
24920
|
-
const findZoneByItem =
|
|
25205
|
+
const findZoneByItem = React92__default.useCallback(
|
|
24921
25206
|
(id) => {
|
|
24922
25207
|
for (const z of zonesRef.current.values()) {
|
|
24923
25208
|
if (z.itemIds.includes(id)) return z;
|
|
@@ -24926,7 +25211,7 @@ function useDataDnd(args) {
|
|
|
24926
25211
|
},
|
|
24927
25212
|
[]
|
|
24928
25213
|
);
|
|
24929
|
-
|
|
25214
|
+
React92__default.useCallback(
|
|
24930
25215
|
(group) => {
|
|
24931
25216
|
for (const z of zonesRef.current.values()) {
|
|
24932
25217
|
if (z.group === group) return z;
|
|
@@ -24935,7 +25220,7 @@ function useDataDnd(args) {
|
|
|
24935
25220
|
},
|
|
24936
25221
|
[]
|
|
24937
25222
|
);
|
|
24938
|
-
const handleDragEnd =
|
|
25223
|
+
const handleDragEnd = React92__default.useCallback(
|
|
24939
25224
|
(event) => {
|
|
24940
25225
|
const { active, over } = event;
|
|
24941
25226
|
const activeIdStr = String(active.id);
|
|
@@ -25026,8 +25311,8 @@ function useDataDnd(args) {
|
|
|
25026
25311
|
},
|
|
25027
25312
|
[eventBus]
|
|
25028
25313
|
);
|
|
25029
|
-
const sortableData =
|
|
25030
|
-
const SortableItem =
|
|
25314
|
+
const sortableData = React92__default.useMemo(() => ({ dndGroup: ownGroup }), [ownGroup]);
|
|
25315
|
+
const SortableItem = React92__default.useCallback(
|
|
25031
25316
|
({ id, children }) => {
|
|
25032
25317
|
const {
|
|
25033
25318
|
attributes,
|
|
@@ -25067,7 +25352,7 @@ function useDataDnd(args) {
|
|
|
25067
25352
|
id: droppableId,
|
|
25068
25353
|
data: sortableData
|
|
25069
25354
|
});
|
|
25070
|
-
const ctx =
|
|
25355
|
+
const ctx = React92__default.useContext(RootCtx);
|
|
25071
25356
|
const activeDrag2 = ctx?.activeDrag ?? null;
|
|
25072
25357
|
const overZoneGroup2 = ctx?.overZoneGroup ?? null;
|
|
25073
25358
|
const isThisZoneOver = overZoneGroup2 === ownGroup;
|
|
@@ -25082,7 +25367,7 @@ function useDataDnd(args) {
|
|
|
25082
25367
|
showForeignPlaceholder,
|
|
25083
25368
|
ctxAvailable: ctx != null
|
|
25084
25369
|
});
|
|
25085
|
-
|
|
25370
|
+
React92__default.useEffect(() => {
|
|
25086
25371
|
dndLog.info("dropzone:isOver:change", { droppableId, group: ownGroup, isOver, isThisZoneOver, showForeignPlaceholder, activeDragSourceGroup: activeDrag2?.sourceGroup ?? null });
|
|
25087
25372
|
}, [droppableId, isOver, isThisZoneOver, showForeignPlaceholder]);
|
|
25088
25373
|
return /* @__PURE__ */ jsx(
|
|
@@ -25096,11 +25381,11 @@ function useDataDnd(args) {
|
|
|
25096
25381
|
}
|
|
25097
25382
|
);
|
|
25098
25383
|
};
|
|
25099
|
-
const rootContextValue =
|
|
25384
|
+
const rootContextValue = React92__default.useMemo(
|
|
25100
25385
|
() => ({ registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder }),
|
|
25101
25386
|
[registerZone, unregisterZone, activeDrag, overZoneGroup, optimisticOrders, clearOptimisticOrder]
|
|
25102
25387
|
);
|
|
25103
|
-
const handleDragStart =
|
|
25388
|
+
const handleDragStart = React92__default.useCallback((event) => {
|
|
25104
25389
|
const sourceZone = findZoneByItem(event.active.id);
|
|
25105
25390
|
const rect = event.active.rect.current.initial;
|
|
25106
25391
|
const height = rect?.height && rect.height > 0 ? rect.height : 64;
|
|
@@ -25119,7 +25404,7 @@ function useDataDnd(args) {
|
|
|
25119
25404
|
isRoot
|
|
25120
25405
|
});
|
|
25121
25406
|
}, [findZoneByItem, isRoot, zoneId]);
|
|
25122
|
-
const handleDragOver =
|
|
25407
|
+
const handleDragOver = React92__default.useCallback((event) => {
|
|
25123
25408
|
const { active, over } = event;
|
|
25124
25409
|
const overData = over?.data?.current;
|
|
25125
25410
|
const overGroup = overData?.dndGroup ?? null;
|
|
@@ -25189,7 +25474,7 @@ function useDataDnd(args) {
|
|
|
25189
25474
|
return next;
|
|
25190
25475
|
});
|
|
25191
25476
|
}, []);
|
|
25192
|
-
const handleDragCancel =
|
|
25477
|
+
const handleDragCancel = React92__default.useCallback((event) => {
|
|
25193
25478
|
setActiveDrag(null);
|
|
25194
25479
|
setOverZoneGroup(null);
|
|
25195
25480
|
dndLog.warn("dragCancel", {
|
|
@@ -25197,12 +25482,12 @@ function useDataDnd(args) {
|
|
|
25197
25482
|
reason: "dnd-kit cancelled the drag (escape key, pointer interrupted, or external)"
|
|
25198
25483
|
});
|
|
25199
25484
|
}, []);
|
|
25200
|
-
const handleDragEndWithCleanup =
|
|
25485
|
+
const handleDragEndWithCleanup = React92__default.useCallback((event) => {
|
|
25201
25486
|
handleDragEnd(event);
|
|
25202
25487
|
setActiveDrag(null);
|
|
25203
25488
|
setOverZoneGroup(null);
|
|
25204
25489
|
}, [handleDragEnd]);
|
|
25205
|
-
const wrapContainer =
|
|
25490
|
+
const wrapContainer = React92__default.useCallback(
|
|
25206
25491
|
(children) => {
|
|
25207
25492
|
if (!enabled) return children;
|
|
25208
25493
|
const strategy = layout === "grid" ? rectSortingStrategy : verticalListSortingStrategy;
|
|
@@ -25256,15 +25541,12 @@ var init_useDataDnd = __esm({
|
|
|
25256
25541
|
init_useAlmadarDndCollision();
|
|
25257
25542
|
init_Box();
|
|
25258
25543
|
dndLog = createLogger("almadar:ui:dnd");
|
|
25259
|
-
RootCtx =
|
|
25544
|
+
RootCtx = React92__default.createContext(null);
|
|
25260
25545
|
}
|
|
25261
25546
|
});
|
|
25262
25547
|
function renderIconInput(icon, props) {
|
|
25263
25548
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
25264
25549
|
}
|
|
25265
|
-
function fieldLabel2(key) {
|
|
25266
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
25267
|
-
}
|
|
25268
25550
|
function statusVariant2(value) {
|
|
25269
25551
|
const v = value.toLowerCase();
|
|
25270
25552
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
@@ -25283,29 +25565,6 @@ function resolveBadgeVariant(field, value) {
|
|
|
25283
25565
|
}
|
|
25284
25566
|
return statusVariant2(value);
|
|
25285
25567
|
}
|
|
25286
|
-
function formatDate2(value) {
|
|
25287
|
-
if (!value) return "";
|
|
25288
|
-
const d = new Date(String(value));
|
|
25289
|
-
if (isNaN(d.getTime())) return String(value);
|
|
25290
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
25291
|
-
}
|
|
25292
|
-
function formatValue(value, format) {
|
|
25293
|
-
if (value === void 0 || value === null) return "";
|
|
25294
|
-
switch (format) {
|
|
25295
|
-
case "date":
|
|
25296
|
-
return formatDate2(value);
|
|
25297
|
-
case "currency":
|
|
25298
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
25299
|
-
case "number":
|
|
25300
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
25301
|
-
case "percent":
|
|
25302
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
25303
|
-
case "boolean":
|
|
25304
|
-
return value ? "Yes" : "No";
|
|
25305
|
-
default:
|
|
25306
|
-
return String(value);
|
|
25307
|
-
}
|
|
25308
|
-
}
|
|
25309
25568
|
function DataGrid({
|
|
25310
25569
|
entity,
|
|
25311
25570
|
fields,
|
|
@@ -25592,7 +25851,7 @@ function DataGrid({
|
|
|
25592
25851
|
if (val === void 0 || val === null || val === "") return null;
|
|
25593
25852
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
25594
25853
|
field.icon && renderIconInput(field.icon, { size: "xs" }),
|
|
25595
|
-
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: formatValue(val, field.format) })
|
|
25854
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: humanizeEnumValue(formatValue(val, field.format)) })
|
|
25596
25855
|
] }, field.name);
|
|
25597
25856
|
}) })
|
|
25598
25857
|
] }),
|
|
@@ -25702,11 +25961,12 @@ function DataGrid({
|
|
|
25702
25961
|
] })
|
|
25703
25962
|
);
|
|
25704
25963
|
}
|
|
25705
|
-
var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
|
|
25964
|
+
var dataGridLog, fieldLabel2, BADGE_VARIANTS, gapStyles5, lookStyles5;
|
|
25706
25965
|
var init_DataGrid = __esm({
|
|
25707
25966
|
"components/core/molecules/DataGrid.tsx"() {
|
|
25708
25967
|
"use client";
|
|
25709
25968
|
init_cn();
|
|
25969
|
+
init_format();
|
|
25710
25970
|
init_getNestedValue();
|
|
25711
25971
|
init_useEventBus();
|
|
25712
25972
|
init_Box();
|
|
@@ -25719,6 +25979,7 @@ var init_DataGrid = __esm({
|
|
|
25719
25979
|
init_Menu();
|
|
25720
25980
|
init_useDataDnd();
|
|
25721
25981
|
dataGridLog = createLogger("almadar:ui:data-grid");
|
|
25982
|
+
fieldLabel2 = humanizeFieldName;
|
|
25722
25983
|
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
25723
25984
|
"default",
|
|
25724
25985
|
"primary",
|
|
@@ -25750,9 +26011,6 @@ var init_DataGrid = __esm({
|
|
|
25750
26011
|
function renderIconInput2(icon, props) {
|
|
25751
26012
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
25752
26013
|
}
|
|
25753
|
-
function fieldLabel3(key) {
|
|
25754
|
-
return key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
25755
|
-
}
|
|
25756
26014
|
function statusVariant3(value) {
|
|
25757
26015
|
const v = value.toLowerCase();
|
|
25758
26016
|
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online"].includes(v)) return "success";
|
|
@@ -25761,28 +26019,12 @@ function statusVariant3(value) {
|
|
|
25761
26019
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
25762
26020
|
return "default";
|
|
25763
26021
|
}
|
|
25764
|
-
function formatDate3(value) {
|
|
25765
|
-
if (!value) return "";
|
|
25766
|
-
const d = new Date(String(value));
|
|
25767
|
-
if (isNaN(d.getTime())) return String(value);
|
|
25768
|
-
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
25769
|
-
}
|
|
25770
26022
|
function formatValue2(value, format, boolLabels) {
|
|
25771
|
-
if (value
|
|
25772
|
-
|
|
25773
|
-
|
|
25774
|
-
return formatDate3(value);
|
|
25775
|
-
case "currency":
|
|
25776
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
25777
|
-
case "number":
|
|
25778
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
25779
|
-
case "percent":
|
|
25780
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
25781
|
-
case "boolean":
|
|
25782
|
-
return value ? boolLabels?.yes ?? "Yes" : boolLabels?.no ?? "No";
|
|
25783
|
-
default:
|
|
25784
|
-
return String(value);
|
|
26023
|
+
if (value !== void 0 && value !== null && (format === "boolean" || typeof value === "boolean")) {
|
|
26024
|
+
const isNo = value === false || value === 0 || String(value) === "false";
|
|
26025
|
+
return isNo ? boolLabels?.no ?? "No" : boolLabels?.yes ?? "Yes";
|
|
25785
26026
|
}
|
|
26027
|
+
return formatValue(value, format);
|
|
25786
26028
|
}
|
|
25787
26029
|
function groupData(items, field) {
|
|
25788
26030
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -25805,7 +26047,9 @@ function DataList({
|
|
|
25805
26047
|
variant = "default",
|
|
25806
26048
|
groupBy,
|
|
25807
26049
|
senderField,
|
|
26050
|
+
senderLabelField,
|
|
25808
26051
|
currentUser,
|
|
26052
|
+
emptyMessage,
|
|
25809
26053
|
className,
|
|
25810
26054
|
isLoading = false,
|
|
25811
26055
|
error = null,
|
|
@@ -25837,7 +26081,7 @@ function DataList({
|
|
|
25837
26081
|
}) {
|
|
25838
26082
|
const eventBus = useEventBus();
|
|
25839
26083
|
const { t } = useTranslate();
|
|
25840
|
-
const [visibleCount, setVisibleCount] =
|
|
26084
|
+
const [visibleCount, setVisibleCount] = React92__default.useState(pageSize || Infinity);
|
|
25841
26085
|
const fieldDefs = fields ?? columns ?? [];
|
|
25842
26086
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
25843
26087
|
const dnd = useDataDnd({
|
|
@@ -25856,7 +26100,7 @@ function DataList({
|
|
|
25856
26100
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
25857
26101
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
25858
26102
|
const hasRenderProp = typeof children === "function";
|
|
25859
|
-
|
|
26103
|
+
React92__default.useEffect(() => {
|
|
25860
26104
|
const renderItemTypeOf = typeof schemaRenderItem;
|
|
25861
26105
|
const childrenTypeOf = typeof children;
|
|
25862
26106
|
if (data.length > 0 && !hasRenderProp) {
|
|
@@ -25944,7 +26188,7 @@ function DataList({
|
|
|
25944
26188
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) });
|
|
25945
26189
|
}
|
|
25946
26190
|
if (data.length === 0) {
|
|
25947
|
-
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("empty.noItems") }) });
|
|
26191
|
+
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") }) });
|
|
25948
26192
|
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
25949
26193
|
}
|
|
25950
26194
|
const gapClass = {
|
|
@@ -25960,51 +26204,93 @@ function DataList({
|
|
|
25960
26204
|
const items2 = [...data];
|
|
25961
26205
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
25962
26206
|
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
25963
|
-
|
|
25964
|
-
|
|
25965
|
-
|
|
25966
|
-
|
|
25967
|
-
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25971
|
-
|
|
25972
|
-
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
|
|
25976
|
-
|
|
25977
|
-
|
|
25978
|
-
|
|
25979
|
-
|
|
25980
|
-
|
|
25981
|
-
|
|
25982
|
-
|
|
25983
|
-
|
|
25984
|
-
|
|
25985
|
-
|
|
25986
|
-
|
|
25987
|
-
|
|
25988
|
-
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
|
|
25992
|
-
|
|
25993
|
-
|
|
25994
|
-
|
|
25995
|
-
|
|
25996
|
-
|
|
25997
|
-
|
|
25998
|
-
|
|
25999
|
-
|
|
26000
|
-
|
|
26001
|
-
|
|
26002
|
-
|
|
26003
|
-
|
|
26004
|
-
|
|
26005
|
-
|
|
26006
|
-
|
|
26007
|
-
|
|
26207
|
+
const senderLabel = (itemData, raw) => {
|
|
26208
|
+
if (!senderLabelField) return raw;
|
|
26209
|
+
const v = getNestedValue(itemData, senderLabelField);
|
|
26210
|
+
return v === void 0 || v === null || v === "" ? raw : String(v);
|
|
26211
|
+
};
|
|
26212
|
+
return /* @__PURE__ */ jsxs(VStack, { gap: "sm", className: cn("py-2", className), children: [
|
|
26213
|
+
groups2.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
26214
|
+
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
26215
|
+
group.items.map((itemData, index) => {
|
|
26216
|
+
const id = itemData.id || `${gi}-${index}`;
|
|
26217
|
+
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
26218
|
+
const isSent = Boolean(currentUser && sender === currentUser);
|
|
26219
|
+
const content = getNestedValue(itemData, contentField);
|
|
26220
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
26221
|
+
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
26222
|
+
const metaFields = fieldDefs.filter(
|
|
26223
|
+
(f3) => f3.name !== contentField && f3.name !== timestampField?.name
|
|
26224
|
+
);
|
|
26225
|
+
return /* @__PURE__ */ jsx(
|
|
26226
|
+
Box,
|
|
26227
|
+
{
|
|
26228
|
+
"data-entity-row": true,
|
|
26229
|
+
"data-entity-id": id,
|
|
26230
|
+
onClick: itemClickEvent ? handleRowClick(itemData) : void 0,
|
|
26231
|
+
className: cn(
|
|
26232
|
+
"flex px-4 group/rowactions",
|
|
26233
|
+
itemClickEvent && "cursor-pointer",
|
|
26234
|
+
isSent ? "justify-end" : "justify-start"
|
|
26235
|
+
),
|
|
26236
|
+
children: /* @__PURE__ */ jsxs(
|
|
26237
|
+
Box,
|
|
26238
|
+
{
|
|
26239
|
+
className: cn(
|
|
26240
|
+
"max-w-[75%] px-4 py-2",
|
|
26241
|
+
isSent ? "bg-primary text-primary-foreground rounded-2xl rounded-br-sm" : "bg-muted text-foreground rounded-2xl rounded-bl-sm"
|
|
26242
|
+
),
|
|
26243
|
+
children: [
|
|
26244
|
+
!isSent && senderField && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "font-semibold mb-0.5", children: senderLabel(itemData, sender) }),
|
|
26245
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body", className: cn(isSent && "text-primary-foreground"), children: content !== void 0 && content !== null ? String(content) : "" }),
|
|
26246
|
+
metaFields.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1 flex-wrap", children: metaFields.map((f3) => {
|
|
26247
|
+
const v = getNestedValue(itemData, f3.name);
|
|
26248
|
+
if (v === void 0 || v === null || v === "") return null;
|
|
26249
|
+
return f3.variant === "badge" ? /* @__PURE__ */ jsx(Badge, { variant: statusVariant3(String(v)), children: String(v) }, f3.name) : /* @__PURE__ */ jsx(
|
|
26250
|
+
Typography,
|
|
26251
|
+
{
|
|
26252
|
+
variant: "caption",
|
|
26253
|
+
className: cn("text-xs", isSent ? "opacity-70" : "text-muted-foreground"),
|
|
26254
|
+
children: formatValue2(v, f3.format)
|
|
26255
|
+
},
|
|
26256
|
+
f3.name
|
|
26257
|
+
);
|
|
26258
|
+
}) }),
|
|
26259
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "mt-1 items-center justify-between", children: [
|
|
26260
|
+
timestamp != null ? /* @__PURE__ */ jsx(
|
|
26261
|
+
Typography,
|
|
26262
|
+
{
|
|
26263
|
+
variant: "caption",
|
|
26264
|
+
className: cn("text-xs", isSent ? "opacity-70" : "text-muted-foreground"),
|
|
26265
|
+
children: formatDate(timestamp)
|
|
26266
|
+
}
|
|
26267
|
+
) : /* @__PURE__ */ jsx("span", {}),
|
|
26268
|
+
renderItemActions(itemData)
|
|
26269
|
+
] })
|
|
26270
|
+
]
|
|
26271
|
+
}
|
|
26272
|
+
)
|
|
26273
|
+
},
|
|
26274
|
+
id
|
|
26275
|
+
);
|
|
26276
|
+
})
|
|
26277
|
+
] }, gi)),
|
|
26278
|
+
hasMoreLocal && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(
|
|
26279
|
+
Button,
|
|
26280
|
+
{
|
|
26281
|
+
variant: "ghost",
|
|
26282
|
+
size: "sm",
|
|
26283
|
+
onClick: () => setVisibleCount((prev) => prev + (pageSize || 5)),
|
|
26284
|
+
children: [
|
|
26285
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
26286
|
+
t("common.showMore"),
|
|
26287
|
+
" (",
|
|
26288
|
+
t("common.remaining", { count: allData.length - visibleCount }),
|
|
26289
|
+
")"
|
|
26290
|
+
]
|
|
26291
|
+
}
|
|
26292
|
+
) })
|
|
26293
|
+
] });
|
|
26008
26294
|
}
|
|
26009
26295
|
const items = [...data];
|
|
26010
26296
|
const groups = groupBy ? groupData(items, groupBy) : [{ label: "", items }];
|
|
@@ -26119,7 +26405,7 @@ function DataList({
|
|
|
26119
26405
|
className
|
|
26120
26406
|
),
|
|
26121
26407
|
children: [
|
|
26122
|
-
groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
26408
|
+
groups.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
26123
26409
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-4" : "mt-0" }),
|
|
26124
26410
|
group.items.map(
|
|
26125
26411
|
(itemData, index) => renderItem(itemData, index, gi === groups.length - 1 && index === group.items.length - 1)
|
|
@@ -26153,11 +26439,12 @@ function DataList({
|
|
|
26153
26439
|
)
|
|
26154
26440
|
);
|
|
26155
26441
|
}
|
|
26156
|
-
var dataListLog, listLookStyles;
|
|
26442
|
+
var dataListLog, fieldLabel3, listLookStyles;
|
|
26157
26443
|
var init_DataList = __esm({
|
|
26158
26444
|
"components/core/molecules/DataList.tsx"() {
|
|
26159
26445
|
"use client";
|
|
26160
26446
|
init_cn();
|
|
26447
|
+
init_format();
|
|
26161
26448
|
init_getNestedValue();
|
|
26162
26449
|
init_useEventBus();
|
|
26163
26450
|
init_Box();
|
|
@@ -26172,6 +26459,7 @@ var init_DataList = __esm({
|
|
|
26172
26459
|
init_Menu();
|
|
26173
26460
|
init_useDataDnd();
|
|
26174
26461
|
dataListLog = createLogger("almadar:ui:data-list");
|
|
26462
|
+
fieldLabel3 = humanizeFieldName;
|
|
26175
26463
|
listLookStyles = {
|
|
26176
26464
|
dense: "[&_[data-entity-row]>div]:!py-1 [&_[data-entity-row]>div]:!px-3",
|
|
26177
26465
|
spacious: "[&_[data-entity-row]>div]:!py-5 [&_[data-entity-row]>div]:!px-8",
|
|
@@ -26204,7 +26492,7 @@ var init_FormSection = __esm({
|
|
|
26204
26492
|
columns = 1,
|
|
26205
26493
|
className
|
|
26206
26494
|
}) => {
|
|
26207
|
-
const [collapsed, setCollapsed] =
|
|
26495
|
+
const [collapsed, setCollapsed] = React92__default.useState(defaultCollapsed);
|
|
26208
26496
|
const { t } = useTranslate();
|
|
26209
26497
|
const eventBus = useEventBus();
|
|
26210
26498
|
const gridClass = {
|
|
@@ -26212,7 +26500,7 @@ var init_FormSection = __esm({
|
|
|
26212
26500
|
2: "grid-cols-1 md:grid-cols-2",
|
|
26213
26501
|
3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
|
|
26214
26502
|
}[columns];
|
|
26215
|
-
|
|
26503
|
+
React92__default.useCallback(() => {
|
|
26216
26504
|
if (collapsible) {
|
|
26217
26505
|
setCollapsed((prev) => !prev);
|
|
26218
26506
|
eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
|
|
@@ -27081,7 +27369,7 @@ var init_Flex = __esm({
|
|
|
27081
27369
|
flexStyle.flexBasis = typeof basis === "number" ? `${basis}px` : basis;
|
|
27082
27370
|
}
|
|
27083
27371
|
}
|
|
27084
|
-
return
|
|
27372
|
+
return React92__default.createElement(Component, {
|
|
27085
27373
|
className: cn(
|
|
27086
27374
|
inline ? "inline-flex" : "flex",
|
|
27087
27375
|
directionStyles[direction],
|
|
@@ -27200,7 +27488,7 @@ var init_Grid = __esm({
|
|
|
27200
27488
|
as: Component = "div"
|
|
27201
27489
|
}) => {
|
|
27202
27490
|
const mergedStyle = rows ? { gridTemplateRows: `repeat(${rows}, minmax(0, 1fr))`, ...style } : style;
|
|
27203
|
-
return
|
|
27491
|
+
return React92__default.createElement(
|
|
27204
27492
|
Component,
|
|
27205
27493
|
{
|
|
27206
27494
|
className: cn(
|
|
@@ -27408,9 +27696,9 @@ var init_Popover = __esm({
|
|
|
27408
27696
|
onMouseLeave: handleClose,
|
|
27409
27697
|
onPointerDown: tapTriggerProps.onPointerDown
|
|
27410
27698
|
};
|
|
27411
|
-
const childElement =
|
|
27699
|
+
const childElement = React92__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
27412
27700
|
const childPointerDown = childElement.props.onPointerDown;
|
|
27413
|
-
const triggerElement =
|
|
27701
|
+
const triggerElement = React92__default.cloneElement(
|
|
27414
27702
|
childElement,
|
|
27415
27703
|
{
|
|
27416
27704
|
ref: triggerRef,
|
|
@@ -28019,9 +28307,9 @@ var init_Tooltip = __esm({
|
|
|
28019
28307
|
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
28020
28308
|
};
|
|
28021
28309
|
}, []);
|
|
28022
|
-
const triggerElement =
|
|
28310
|
+
const triggerElement = React92__default.isValidElement(children) ? children : /* @__PURE__ */ jsx("span", { children });
|
|
28023
28311
|
const childPointerDown = triggerElement.props.onPointerDown;
|
|
28024
|
-
const trigger =
|
|
28312
|
+
const trigger = React92__default.cloneElement(triggerElement, {
|
|
28025
28313
|
ref: triggerRef,
|
|
28026
28314
|
onMouseEnter: handleMouseEnter,
|
|
28027
28315
|
onMouseLeave: handleMouseLeave,
|
|
@@ -28111,7 +28399,7 @@ var init_WizardProgress = __esm({
|
|
|
28111
28399
|
children: /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: normalizedSteps.map((step, index) => {
|
|
28112
28400
|
const isActive = index === currentStep;
|
|
28113
28401
|
const isCompleted = index < currentStep;
|
|
28114
|
-
return /* @__PURE__ */ jsxs(
|
|
28402
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
28115
28403
|
/* @__PURE__ */ jsx(
|
|
28116
28404
|
"button",
|
|
28117
28405
|
{
|
|
@@ -29672,13 +29960,13 @@ var init_MapView = __esm({
|
|
|
29672
29960
|
shadowSize: [41, 41]
|
|
29673
29961
|
});
|
|
29674
29962
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29675
|
-
const { useEffect:
|
|
29963
|
+
const { useEffect: useEffect64, useRef: useRef63, useCallback: useCallback95, useState: useState97 } = React92__default;
|
|
29676
29964
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29677
29965
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29678
29966
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29679
29967
|
const map = useMap();
|
|
29680
|
-
const prevRef =
|
|
29681
|
-
|
|
29968
|
+
const prevRef = useRef63({ centerLat, centerLng, zoom });
|
|
29969
|
+
useEffect64(() => {
|
|
29682
29970
|
const prev = prevRef.current;
|
|
29683
29971
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
29684
29972
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -29689,7 +29977,7 @@ var init_MapView = __esm({
|
|
|
29689
29977
|
}
|
|
29690
29978
|
function MapClickHandler({ onMapClick }) {
|
|
29691
29979
|
const map = useMap();
|
|
29692
|
-
|
|
29980
|
+
useEffect64(() => {
|
|
29693
29981
|
if (!onMapClick) return;
|
|
29694
29982
|
const handler = (e) => {
|
|
29695
29983
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -29718,7 +30006,7 @@ var init_MapView = __esm({
|
|
|
29718
30006
|
}) {
|
|
29719
30007
|
const eventBus = useEventBus2();
|
|
29720
30008
|
const [clickedPosition, setClickedPosition] = useState97(null);
|
|
29721
|
-
const handleMapClick =
|
|
30009
|
+
const handleMapClick = useCallback95((lat, lng) => {
|
|
29722
30010
|
if (showClickedPin) {
|
|
29723
30011
|
setClickedPosition({ lat, lng });
|
|
29724
30012
|
}
|
|
@@ -29727,7 +30015,7 @@ var init_MapView = __esm({
|
|
|
29727
30015
|
eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
|
|
29728
30016
|
}
|
|
29729
30017
|
}, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
|
|
29730
|
-
const handleMarkerClick =
|
|
30018
|
+
const handleMarkerClick = useCallback95((marker) => {
|
|
29731
30019
|
onMarkerClick?.(marker);
|
|
29732
30020
|
if (markerClickEvent) {
|
|
29733
30021
|
eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
|
|
@@ -30527,7 +30815,7 @@ function renderIconInput3(icon, props) {
|
|
|
30527
30815
|
return typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: icon, ...props }) : /* @__PURE__ */ jsx(Icon, { icon, ...props });
|
|
30528
30816
|
}
|
|
30529
30817
|
function columnLabel(col) {
|
|
30530
|
-
return col.header ?? col.label ?? col.key
|
|
30818
|
+
return col.header ?? col.label ?? humanizeFieldName(col.key);
|
|
30531
30819
|
}
|
|
30532
30820
|
function asFieldValue(v) {
|
|
30533
30821
|
if (v === void 0 || v === null) return v;
|
|
@@ -30546,25 +30834,6 @@ function statusVariant4(value) {
|
|
|
30546
30834
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
30547
30835
|
return "default";
|
|
30548
30836
|
}
|
|
30549
|
-
function formatCell(value, format) {
|
|
30550
|
-
if (value === void 0 || value === null) return "";
|
|
30551
|
-
switch (format) {
|
|
30552
|
-
case "date": {
|
|
30553
|
-
const d = new Date(String(value));
|
|
30554
|
-
return isNaN(d.getTime()) ? String(value) : d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
30555
|
-
}
|
|
30556
|
-
case "currency":
|
|
30557
|
-
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
30558
|
-
case "number":
|
|
30559
|
-
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
30560
|
-
case "percent":
|
|
30561
|
-
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
30562
|
-
case "boolean":
|
|
30563
|
-
return value ? "Yes" : "No";
|
|
30564
|
-
default:
|
|
30565
|
-
return String(value);
|
|
30566
|
-
}
|
|
30567
|
-
}
|
|
30568
30837
|
function groupData2(items, field) {
|
|
30569
30838
|
const groups = /* @__PURE__ */ new Map();
|
|
30570
30839
|
for (const item of items) {
|
|
@@ -30608,9 +30877,10 @@ function TableView({
|
|
|
30608
30877
|
}) {
|
|
30609
30878
|
const eventBus = useEventBus();
|
|
30610
30879
|
const { t } = useTranslate();
|
|
30611
|
-
const [visibleCount, setVisibleCount] =
|
|
30612
|
-
const [localSelected, setLocalSelected] =
|
|
30613
|
-
const colDefs = columns ?? fields ?? [];
|
|
30880
|
+
const [visibleCount, setVisibleCount] = React92__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
30881
|
+
const [localSelected, setLocalSelected] = React92__default.useState(/* @__PURE__ */ new Set());
|
|
30882
|
+
const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
|
|
30883
|
+
const actionDefs = Array.isArray(itemActions) ? itemActions : [];
|
|
30614
30884
|
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
30615
30885
|
const dnd = useDataDnd({
|
|
30616
30886
|
items: allDataRaw,
|
|
@@ -30630,6 +30900,23 @@ function TableView({
|
|
|
30630
30900
|
const hasRenderProp = typeof children === "function";
|
|
30631
30901
|
const idField = dndItemIdField ?? "id";
|
|
30632
30902
|
const isCoarsePointer = useMediaQuery("(pointer: coarse)");
|
|
30903
|
+
React92__default.useEffect(() => {
|
|
30904
|
+
tableViewLog.debug("render", {
|
|
30905
|
+
rowCount: data.length,
|
|
30906
|
+
colCount: colDefs.length,
|
|
30907
|
+
look,
|
|
30908
|
+
isLoading: Boolean(isLoading),
|
|
30909
|
+
hasError: Boolean(error),
|
|
30910
|
+
dnd: dnd.enabled
|
|
30911
|
+
});
|
|
30912
|
+
if (data.length > 0 && !hasRenderProp && colDefs.length === 0) {
|
|
30913
|
+
tableViewLog.warn("columns-unresolved", {
|
|
30914
|
+
rowCount: data.length,
|
|
30915
|
+
columnsIsArray: Array.isArray(columns),
|
|
30916
|
+
fieldsIsArray: Array.isArray(fields)
|
|
30917
|
+
});
|
|
30918
|
+
}
|
|
30919
|
+
}, [data, colDefs, look, isLoading, error, dnd.enabled, hasRenderProp, columns, fields]);
|
|
30633
30920
|
const selected = selectedIds ? new Set(selectedIds) : localSelected;
|
|
30634
30921
|
const emitSelection = (next) => {
|
|
30635
30922
|
if (!selectedIds) setLocalSelected(next);
|
|
@@ -30662,7 +30949,7 @@ function TableView({
|
|
|
30662
30949
|
};
|
|
30663
30950
|
eventBus.emit(`UI:${action.event}`, payload);
|
|
30664
30951
|
};
|
|
30665
|
-
const colFloors =
|
|
30952
|
+
const colFloors = React92__default.useMemo(
|
|
30666
30953
|
() => colDefs.map((col) => {
|
|
30667
30954
|
const longest = data.reduce((widest, row) => {
|
|
30668
30955
|
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
@@ -30673,21 +30960,12 @@ function TableView({
|
|
|
30673
30960
|
}),
|
|
30674
30961
|
[colDefs, data]
|
|
30675
30962
|
);
|
|
30676
|
-
|
|
30677
|
-
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") }) });
|
|
30678
|
-
}
|
|
30679
|
-
if (error) {
|
|
30680
|
-
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) });
|
|
30681
|
-
}
|
|
30682
|
-
if (data.length === 0) {
|
|
30683
|
-
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") }) });
|
|
30684
|
-
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
30685
|
-
}
|
|
30963
|
+
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;
|
|
30686
30964
|
const lk = LOOKS[look];
|
|
30687
|
-
const hasActions =
|
|
30965
|
+
const hasActions = actionDefs.length > 0;
|
|
30688
30966
|
const effectiveMaxInline = isCoarsePointer ? 0 : maxInlineActions;
|
|
30689
|
-
const inlineActionCount = hasActions ? effectiveMaxInline != null ? Math.min(
|
|
30690
|
-
const hasOverflowActions = hasActions && effectiveMaxInline != null &&
|
|
30967
|
+
const inlineActionCount = hasActions ? effectiveMaxInline != null ? Math.min(actionDefs.length, effectiveMaxInline) : actionDefs.length : 0;
|
|
30968
|
+
const hasOverflowActions = hasActions && effectiveMaxInline != null && actionDefs.length > effectiveMaxInline;
|
|
30691
30969
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
30692
30970
|
const gridTemplateColumns = [
|
|
30693
30971
|
selectable ? "auto" : null,
|
|
@@ -30775,11 +31053,11 @@ function TableView({
|
|
|
30775
31053
|
col.className
|
|
30776
31054
|
);
|
|
30777
31055
|
if (col.format === "badge" && raw != null && raw !== "") {
|
|
30778
|
-
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);
|
|
31056
|
+
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);
|
|
30779
31057
|
}
|
|
30780
31058
|
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format) }) }, col.key);
|
|
30781
31059
|
}),
|
|
30782
|
-
|
|
31060
|
+
hasActions && /* @__PURE__ */ jsxs(
|
|
30783
31061
|
HStack,
|
|
30784
31062
|
{
|
|
30785
31063
|
gap: "xs",
|
|
@@ -30791,7 +31069,7 @@ function TableView({
|
|
|
30791
31069
|
lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
|
|
30792
31070
|
),
|
|
30793
31071
|
children: [
|
|
30794
|
-
(effectiveMaxInline != null ?
|
|
31072
|
+
(effectiveMaxInline != null ? actionDefs.slice(0, effectiveMaxInline) : actionDefs).map((action, i) => /* @__PURE__ */ jsxs(
|
|
30795
31073
|
Button,
|
|
30796
31074
|
{
|
|
30797
31075
|
variant: action.variant === "primary" ? "primary" : "ghost",
|
|
@@ -30807,12 +31085,12 @@ function TableView({
|
|
|
30807
31085
|
},
|
|
30808
31086
|
i
|
|
30809
31087
|
)),
|
|
30810
|
-
effectiveMaxInline != null &&
|
|
31088
|
+
effectiveMaxInline != null && actionDefs.length > effectiveMaxInline && /* @__PURE__ */ jsx(
|
|
30811
31089
|
Menu,
|
|
30812
31090
|
{
|
|
30813
31091
|
position: "bottom-end",
|
|
30814
31092
|
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" }) }),
|
|
30815
|
-
items:
|
|
31093
|
+
items: actionDefs.slice(effectiveMaxInline).map((action) => ({
|
|
30816
31094
|
label: action.label,
|
|
30817
31095
|
icon: action.icon,
|
|
30818
31096
|
event: action.event,
|
|
@@ -30830,24 +31108,25 @@ function TableView({
|
|
|
30830
31108
|
]
|
|
30831
31109
|
}
|
|
30832
31110
|
);
|
|
30833
|
-
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(
|
|
31111
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React92__default.Fragment, { children: rowInner }, id);
|
|
30834
31112
|
};
|
|
30835
31113
|
const items = Array.from(data);
|
|
30836
31114
|
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
30837
31115
|
let runningIndex = 0;
|
|
30838
|
-
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(
|
|
31116
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
30839
31117
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
30840
31118
|
group.items.map((row) => renderRow(row, runningIndex++))
|
|
30841
31119
|
] }, gi)) });
|
|
31120
|
+
const showHeader = colDefs.length > 0 || hasRenderProp;
|
|
30842
31121
|
return /* @__PURE__ */ jsxs(
|
|
30843
31122
|
Box,
|
|
30844
31123
|
{
|
|
30845
31124
|
role: "table",
|
|
30846
31125
|
className: cn("w-full text-sm", className),
|
|
30847
31126
|
children: [
|
|
30848
|
-
header,
|
|
30849
|
-
dnd.wrapContainer(body),
|
|
30850
|
-
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: [
|
|
31127
|
+
showHeader && header,
|
|
31128
|
+
dnd.wrapContainer(statusNode ? /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: statusNode }) : body),
|
|
31129
|
+
!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: [
|
|
30851
31130
|
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
30852
31131
|
t("common.showMore"),
|
|
30853
31132
|
" (",
|
|
@@ -30858,11 +31137,12 @@ function TableView({
|
|
|
30858
31137
|
}
|
|
30859
31138
|
);
|
|
30860
31139
|
}
|
|
30861
|
-
var MAX_MEASURED_COL_CH, BADGE_CHROME_CH, alignClass, weightClass, LOOKS;
|
|
31140
|
+
var tableViewLog, formatCell, MAX_MEASURED_COL_CH, BADGE_CHROME_CH, alignClass, weightClass, LOOKS;
|
|
30862
31141
|
var init_TableView = __esm({
|
|
30863
31142
|
"components/core/molecules/TableView.tsx"() {
|
|
30864
31143
|
"use client";
|
|
30865
31144
|
init_cn();
|
|
31145
|
+
init_format();
|
|
30866
31146
|
init_getNestedValue();
|
|
30867
31147
|
init_useEventBus();
|
|
30868
31148
|
init_useMediaQuery();
|
|
@@ -30876,7 +31156,8 @@ var init_TableView = __esm({
|
|
|
30876
31156
|
init_Divider();
|
|
30877
31157
|
init_Menu();
|
|
30878
31158
|
init_useDataDnd();
|
|
30879
|
-
createLogger("almadar:ui:table-view");
|
|
31159
|
+
tableViewLog = createLogger("almadar:ui:table-view");
|
|
31160
|
+
formatCell = (value, format) => formatValue(value, format);
|
|
30880
31161
|
MAX_MEASURED_COL_CH = 32;
|
|
30881
31162
|
BADGE_CHROME_CH = 4;
|
|
30882
31163
|
alignClass = {
|
|
@@ -32195,7 +32476,7 @@ var init_StepFlow = __esm({
|
|
|
32195
32476
|
className
|
|
32196
32477
|
}) => {
|
|
32197
32478
|
if (orientation === "vertical") {
|
|
32198
|
-
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(
|
|
32479
|
+
return /* @__PURE__ */ jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsx(React92__default.Fragment, { children: /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
32199
32480
|
/* @__PURE__ */ jsxs(VStack, { gap: "none", align: "center", children: [
|
|
32200
32481
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32201
32482
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -32206,7 +32487,7 @@ var init_StepFlow = __esm({
|
|
|
32206
32487
|
] })
|
|
32207
32488
|
] }) }, index)) });
|
|
32208
32489
|
}
|
|
32209
|
-
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(
|
|
32490
|
+
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(React92__default.Fragment, { children: [
|
|
32210
32491
|
/* @__PURE__ */ jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
32211
32492
|
/* @__PURE__ */ jsx(StepCircle, { step, index }),
|
|
32212
32493
|
/* @__PURE__ */ jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -33196,7 +33477,7 @@ var init_LikertScale = __esm({
|
|
|
33196
33477
|
md: "text-base",
|
|
33197
33478
|
lg: "text-lg"
|
|
33198
33479
|
};
|
|
33199
|
-
LikertScale =
|
|
33480
|
+
LikertScale = React92__default.forwardRef(
|
|
33200
33481
|
({
|
|
33201
33482
|
question,
|
|
33202
33483
|
options = DEFAULT_LIKERT_OPTIONS,
|
|
@@ -33208,7 +33489,7 @@ var init_LikertScale = __esm({
|
|
|
33208
33489
|
variant = "radios",
|
|
33209
33490
|
className
|
|
33210
33491
|
}, ref) => {
|
|
33211
|
-
const groupId =
|
|
33492
|
+
const groupId = React92__default.useId();
|
|
33212
33493
|
const eventBus = useEventBus();
|
|
33213
33494
|
const handleSelect = useCallback(
|
|
33214
33495
|
(next) => {
|
|
@@ -35497,7 +35778,7 @@ var init_DocBreadcrumb = __esm({
|
|
|
35497
35778
|
"aria-label": t("aria.breadcrumb"),
|
|
35498
35779
|
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", wrap: true, children: items.map((item, idx) => {
|
|
35499
35780
|
const isLast = idx === items.length - 1;
|
|
35500
|
-
return /* @__PURE__ */ jsxs(
|
|
35781
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
35501
35782
|
idx > 0 && /* @__PURE__ */ jsx(
|
|
35502
35783
|
Icon,
|
|
35503
35784
|
{
|
|
@@ -36161,7 +36442,7 @@ var init_PageHeader = __esm({
|
|
|
36161
36442
|
info: "bg-info/10 text-info"
|
|
36162
36443
|
};
|
|
36163
36444
|
return /* @__PURE__ */ jsxs(Box, { className: cn("mb-6", className), children: [
|
|
36164
|
-
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(
|
|
36445
|
+
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(React92__default.Fragment, { children: [
|
|
36165
36446
|
idx > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "muted", children: "/" }),
|
|
36166
36447
|
crumb.href ? /* @__PURE__ */ jsx(
|
|
36167
36448
|
"a",
|
|
@@ -36519,7 +36800,7 @@ var init_Section = __esm({
|
|
|
36519
36800
|
as: Component = "section"
|
|
36520
36801
|
}) => {
|
|
36521
36802
|
const hasHeader = title || description || action;
|
|
36522
|
-
return
|
|
36803
|
+
return React92__default.createElement(
|
|
36523
36804
|
Component,
|
|
36524
36805
|
{
|
|
36525
36806
|
className: cn(
|
|
@@ -36893,7 +37174,7 @@ var init_WizardContainer = __esm({
|
|
|
36893
37174
|
const isCompleted = index < currentStep;
|
|
36894
37175
|
const stepKey = step.id ?? step.tabId ?? `step-${index}`;
|
|
36895
37176
|
const stepTitle = step.title ?? step.name ?? `Step ${index + 1}`;
|
|
36896
|
-
return /* @__PURE__ */ jsxs(
|
|
37177
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
36897
37178
|
/* @__PURE__ */ jsx(
|
|
36898
37179
|
Button,
|
|
36899
37180
|
{
|
|
@@ -37851,6 +38132,7 @@ var init_GraphCanvas = __esm({
|
|
|
37851
38132
|
title,
|
|
37852
38133
|
nodes: propNodes = NO_NODES,
|
|
37853
38134
|
edges: propEdges = NO_EDGES,
|
|
38135
|
+
proposedEdges = NO_EDGES,
|
|
37854
38136
|
similarity: propSimilarity = NO_SIM,
|
|
37855
38137
|
height = 400,
|
|
37856
38138
|
showLabels = true,
|
|
@@ -37858,6 +38140,7 @@ var init_GraphCanvas = __esm({
|
|
|
37858
38140
|
draggable = true,
|
|
37859
38141
|
actions,
|
|
37860
38142
|
onNodeClick,
|
|
38143
|
+
onMarkClick,
|
|
37861
38144
|
onNodeDoubleClick,
|
|
37862
38145
|
onBadgeClick,
|
|
37863
38146
|
nodeClickEvent,
|
|
@@ -37886,6 +38169,18 @@ var init_GraphCanvas = __esm({
|
|
|
37886
38169
|
const laidOutRef = useRef(false);
|
|
37887
38170
|
const [, forceUpdate] = useState(0);
|
|
37888
38171
|
const [logicalW, setLogicalW] = useState(800);
|
|
38172
|
+
const hasProposed = useMemo(() => propNodes.some((n) => n.mark?.kind === "proposed"), [propNodes]);
|
|
38173
|
+
const [pulseTick, setPulseTick] = useState(0);
|
|
38174
|
+
useEffect(() => {
|
|
38175
|
+
if (!hasProposed) return;
|
|
38176
|
+
let raf = 0;
|
|
38177
|
+
const loop = () => {
|
|
38178
|
+
setPulseTick((t2) => (t2 + 1) % 1e6);
|
|
38179
|
+
raf = requestAnimationFrame(loop);
|
|
38180
|
+
};
|
|
38181
|
+
raf = requestAnimationFrame(loop);
|
|
38182
|
+
return () => cancelAnimationFrame(raf);
|
|
38183
|
+
}, [hasProposed]);
|
|
37889
38184
|
useEffect(() => {
|
|
37890
38185
|
const canvas = canvasRef.current;
|
|
37891
38186
|
if (!canvas || typeof ResizeObserver === "undefined") return;
|
|
@@ -38187,18 +38482,38 @@ var init_GraphCanvas = __esm({
|
|
|
38187
38482
|
}
|
|
38188
38483
|
}
|
|
38189
38484
|
ctx.globalAlpha = 1;
|
|
38485
|
+
ctx.setLineDash([4, 4]);
|
|
38486
|
+
for (const edge of proposedEdges) {
|
|
38487
|
+
const source = nodes.find((n) => n.id === edge.source);
|
|
38488
|
+
const target = nodes.find((n) => n.id === edge.target);
|
|
38489
|
+
if (!source || !target) continue;
|
|
38490
|
+
ctx.globalAlpha = 0.4;
|
|
38491
|
+
ctx.beginPath();
|
|
38492
|
+
ctx.moveTo(source.x, source.y);
|
|
38493
|
+
ctx.lineTo(target.x, target.y);
|
|
38494
|
+
ctx.strokeStyle = edge.color || mutedColor;
|
|
38495
|
+
ctx.lineWidth = 1;
|
|
38496
|
+
ctx.stroke();
|
|
38497
|
+
}
|
|
38498
|
+
ctx.setLineDash([]);
|
|
38499
|
+
ctx.globalAlpha = 1;
|
|
38190
38500
|
for (const node of nodes) {
|
|
38191
38501
|
const size = node.size || 8;
|
|
38192
38502
|
const color = resolveColor3(node.color || getGroupColor(node.group, groups), canvas);
|
|
38193
38503
|
const isHovered = hoveredNode === node.id;
|
|
38194
38504
|
const isSelected = selectedNodeId !== void 0 && node.id === selectedNodeId;
|
|
38195
|
-
|
|
38505
|
+
const mark = node.mark;
|
|
38506
|
+
ctx.globalAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : mark?.kind === "proposed" ? 0.55 : 1;
|
|
38196
38507
|
const radius = isSelected ? size + 4 : isHovered ? size + 2 : size;
|
|
38197
38508
|
ctx.beginPath();
|
|
38198
38509
|
ctx.arc(node.x, node.y, radius, 0, Math.PI * 2);
|
|
38199
|
-
ctx.fillStyle = color;
|
|
38510
|
+
ctx.fillStyle = mark?.kind === "proposed" ? mutedColor : color;
|
|
38200
38511
|
ctx.fill();
|
|
38201
|
-
if (
|
|
38512
|
+
if (mark?.kind === "proposed") {
|
|
38513
|
+
ctx.setLineDash([3, 3]);
|
|
38514
|
+
ctx.strokeStyle = resolveColor3(mark.tint ?? "var(--color-warning)", canvas);
|
|
38515
|
+
ctx.lineWidth = 1.5;
|
|
38516
|
+
} else if (isSelected) {
|
|
38202
38517
|
ctx.strokeStyle = accentColor;
|
|
38203
38518
|
ctx.lineWidth = 3;
|
|
38204
38519
|
} else {
|
|
@@ -38206,6 +38521,28 @@ var init_GraphCanvas = __esm({
|
|
|
38206
38521
|
ctx.lineWidth = isHovered ? 2 : 1;
|
|
38207
38522
|
}
|
|
38208
38523
|
ctx.stroke();
|
|
38524
|
+
ctx.setLineDash([]);
|
|
38525
|
+
if (mark?.kind === "suggested") {
|
|
38526
|
+
ctx.beginPath();
|
|
38527
|
+
ctx.arc(node.x, node.y, radius + 3, 0, Math.PI * 2);
|
|
38528
|
+
ctx.strokeStyle = accentColor;
|
|
38529
|
+
ctx.lineWidth = 2;
|
|
38530
|
+
ctx.stroke();
|
|
38531
|
+
ctx.beginPath();
|
|
38532
|
+
ctx.arc(node.x + radius * 0.7, node.y - radius * 0.7, 2.5, 0, Math.PI * 2);
|
|
38533
|
+
ctx.fillStyle = accentColor;
|
|
38534
|
+
ctx.fill();
|
|
38535
|
+
} else if (mark?.kind === "proposed") {
|
|
38536
|
+
const phase = pulseTick % 60 / 60;
|
|
38537
|
+
const baseAlpha = hoveredNode && !neighbors.has(node.id) ? 0.2 : 0.55;
|
|
38538
|
+
ctx.globalAlpha = baseAlpha * (0.4 + 0.4 * (1 - Math.abs(phase * 2 - 1)));
|
|
38539
|
+
ctx.beginPath();
|
|
38540
|
+
ctx.arc(node.x, node.y, radius + 6 + Math.sin(phase * Math.PI * 2) * 3, 0, Math.PI * 2);
|
|
38541
|
+
ctx.strokeStyle = resolveColor3(mark.tint ?? "var(--color-warning)", canvas);
|
|
38542
|
+
ctx.lineWidth = 1.5;
|
|
38543
|
+
ctx.stroke();
|
|
38544
|
+
ctx.globalAlpha = baseAlpha;
|
|
38545
|
+
}
|
|
38209
38546
|
if (showLabels && node.label) {
|
|
38210
38547
|
const displayLabel = truncateLabel(node.label);
|
|
38211
38548
|
ctx.font = `${isSelected || isHovered ? "700" : "600"} 12px ${fontFamily}`;
|
|
@@ -38340,11 +38677,15 @@ var init_GraphCanvas = __esm({
|
|
|
38340
38677
|
return;
|
|
38341
38678
|
}
|
|
38342
38679
|
}
|
|
38680
|
+
if (node.mark && onMarkClick) {
|
|
38681
|
+
onMarkClick(node);
|
|
38682
|
+
return;
|
|
38683
|
+
}
|
|
38343
38684
|
handleNodeClick(node);
|
|
38344
38685
|
}
|
|
38345
38686
|
}
|
|
38346
38687
|
},
|
|
38347
|
-
[toCoords, nodeAt, handleNodeClick, onBadgeClick, selectedNodeId]
|
|
38688
|
+
[toCoords, nodeAt, handleNodeClick, onBadgeClick, onMarkClick, selectedNodeId]
|
|
38348
38689
|
);
|
|
38349
38690
|
const handlePointerLeave = useCallback(() => {
|
|
38350
38691
|
setHoveredNode(null);
|
|
@@ -38620,7 +38961,7 @@ var init_ImportPreviewTree = __esm({
|
|
|
38620
38961
|
const renderUnit = (unit, childrenByParent, depth) => {
|
|
38621
38962
|
const summary = fieldSummary(unit);
|
|
38622
38963
|
const children = childrenByParent.get(unit.ref) ?? [];
|
|
38623
|
-
return /* @__PURE__ */ jsxs(
|
|
38964
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
38624
38965
|
/* @__PURE__ */ jsxs(
|
|
38625
38966
|
Box,
|
|
38626
38967
|
{
|
|
@@ -38717,7 +39058,7 @@ var init_ImportProgress = __esm({
|
|
|
38717
39058
|
PIPELINE.map((key, index) => {
|
|
38718
39059
|
const isComplete = index < currentIndex;
|
|
38719
39060
|
const isActive = index === currentIndex;
|
|
38720
|
-
return /* @__PURE__ */ jsxs(
|
|
39061
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
38721
39062
|
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
38722
39063
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
38723
39064
|
/* @__PURE__ */ jsx(
|
|
@@ -38871,9 +39212,6 @@ var init_types2 = __esm({
|
|
|
38871
39212
|
};
|
|
38872
39213
|
}
|
|
38873
39214
|
});
|
|
38874
|
-
function humanizeFieldName(name) {
|
|
38875
|
-
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();
|
|
38876
|
-
}
|
|
38877
39215
|
function normalizeColumns(columns) {
|
|
38878
39216
|
return columns.map((col) => {
|
|
38879
39217
|
if (typeof col === "string") {
|
|
@@ -38935,7 +39273,17 @@ function DataTable({
|
|
|
38935
39273
|
const currentPageSize = pageSize ?? 20;
|
|
38936
39274
|
const total = totalCount ?? items.length;
|
|
38937
39275
|
const totalPages = Math.ceil(total / currentPageSize);
|
|
38938
|
-
const
|
|
39276
|
+
const withEventClick = (action) => {
|
|
39277
|
+
if (action.onClick || !action.event) return action;
|
|
39278
|
+
const event = action.event;
|
|
39279
|
+
return {
|
|
39280
|
+
...action,
|
|
39281
|
+
onClick: (row) => {
|
|
39282
|
+
eventBus.emit(`UI:${event}`, { row });
|
|
39283
|
+
}
|
|
39284
|
+
};
|
|
39285
|
+
};
|
|
39286
|
+
const rowActions = (externalRowActions ?? itemActions?.filter((a) => a.placement !== "bulk").map((action) => ({
|
|
38939
39287
|
label: action.label,
|
|
38940
39288
|
icon: action.icon,
|
|
38941
39289
|
variant: action.variant,
|
|
@@ -38955,7 +39303,17 @@ function DataTable({
|
|
|
38955
39303
|
});
|
|
38956
39304
|
}
|
|
38957
39305
|
}
|
|
38958
|
-
}));
|
|
39306
|
+
})))?.map(withEventClick);
|
|
39307
|
+
const normalizedBulkActions = bulkActions?.map((action) => {
|
|
39308
|
+
if (action.onClick || !action.event) return action;
|
|
39309
|
+
const event = action.event;
|
|
39310
|
+
return {
|
|
39311
|
+
...action,
|
|
39312
|
+
onClick: (selectedRows2) => {
|
|
39313
|
+
eventBus.emit(`UI:${event}`, { rows: selectedRows2 });
|
|
39314
|
+
}
|
|
39315
|
+
};
|
|
39316
|
+
});
|
|
38959
39317
|
const viewAction = itemActions?.find(
|
|
38960
39318
|
(a) => a.event === "VIEW" || a.navigatesTo
|
|
38961
39319
|
);
|
|
@@ -39063,7 +39421,7 @@ function DataTable({
|
|
|
39063
39421
|
}
|
|
39064
39422
|
)
|
|
39065
39423
|
] }),
|
|
39066
|
-
|
|
39424
|
+
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: [
|
|
39067
39425
|
/* @__PURE__ */ jsx(
|
|
39068
39426
|
Typography,
|
|
39069
39427
|
{
|
|
@@ -39074,13 +39432,13 @@ function DataTable({
|
|
|
39074
39432
|
})
|
|
39075
39433
|
}
|
|
39076
39434
|
),
|
|
39077
|
-
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap gap-2", children:
|
|
39435
|
+
/* @__PURE__ */ jsx(HStack, { className: "flex-wrap gap-2", children: normalizedBulkActions.map((action, idx) => /* @__PURE__ */ jsx(
|
|
39078
39436
|
Button,
|
|
39079
39437
|
{
|
|
39080
39438
|
variant: action.variant === "danger" ? "danger" : "secondary",
|
|
39081
39439
|
size: "sm",
|
|
39082
39440
|
leftIcon: action.icon,
|
|
39083
|
-
onClick: () => action.onClick(selectedRows),
|
|
39441
|
+
onClick: () => action.onClick?.(selectedRows),
|
|
39084
39442
|
children: action.label
|
|
39085
39443
|
},
|
|
39086
39444
|
idx
|
|
@@ -39242,7 +39600,7 @@ function DataTable({
|
|
|
39242
39600
|
),
|
|
39243
39601
|
onClick: (e) => {
|
|
39244
39602
|
e.stopPropagation();
|
|
39245
|
-
action.onClick(row);
|
|
39603
|
+
action.onClick?.(row);
|
|
39246
39604
|
setOpenActionMenu(null);
|
|
39247
39605
|
},
|
|
39248
39606
|
children: [
|
|
@@ -39278,6 +39636,7 @@ var init_DataTable = __esm({
|
|
|
39278
39636
|
"components/core/organisms/DataTable.tsx"() {
|
|
39279
39637
|
"use client";
|
|
39280
39638
|
init_cn();
|
|
39639
|
+
init_format();
|
|
39281
39640
|
init_getNestedValue();
|
|
39282
39641
|
init_atoms();
|
|
39283
39642
|
init_Box();
|
|
@@ -39330,9 +39689,6 @@ function getBadgeVariant(fieldName, value) {
|
|
|
39330
39689
|
}
|
|
39331
39690
|
return "default";
|
|
39332
39691
|
}
|
|
39333
|
-
function formatFieldLabel(fieldName) {
|
|
39334
|
-
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
39335
|
-
}
|
|
39336
39692
|
function formatFieldValue2(value, fieldName) {
|
|
39337
39693
|
if (typeof value === "number") {
|
|
39338
39694
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
@@ -39460,7 +39816,7 @@ function buildFieldTypeMap(fields) {
|
|
|
39460
39816
|
}
|
|
39461
39817
|
return map;
|
|
39462
39818
|
}
|
|
39463
|
-
var ReactMarkdown2, DetailPanel;
|
|
39819
|
+
var formatFieldLabel, ReactMarkdown2, DetailPanel;
|
|
39464
39820
|
var init_DetailPanel = __esm({
|
|
39465
39821
|
"components/core/organisms/DetailPanel.tsx"() {
|
|
39466
39822
|
"use client";
|
|
@@ -39472,8 +39828,10 @@ var init_DetailPanel = __esm({
|
|
|
39472
39828
|
init_ErrorState();
|
|
39473
39829
|
init_EmptyState();
|
|
39474
39830
|
init_cn();
|
|
39831
|
+
init_format();
|
|
39475
39832
|
init_getNestedValue();
|
|
39476
39833
|
init_useEventBus();
|
|
39834
|
+
formatFieldLabel = humanizeFieldName;
|
|
39477
39835
|
ReactMarkdown2 = lazy(() => import('react-markdown'));
|
|
39478
39836
|
DetailPanel = ({
|
|
39479
39837
|
title: propTitle,
|
|
@@ -39803,7 +40161,7 @@ var init_DetailPanel = __esm({
|
|
|
39803
40161
|
}
|
|
39804
40162
|
});
|
|
39805
40163
|
function extractTitle(children) {
|
|
39806
|
-
if (!
|
|
40164
|
+
if (!React92__default.isValidElement(children)) return void 0;
|
|
39807
40165
|
const props = children.props;
|
|
39808
40166
|
if (typeof props.title === "string") {
|
|
39809
40167
|
return props.title;
|
|
@@ -40153,12 +40511,12 @@ var init_Form = __esm({
|
|
|
40153
40511
|
const isSchemaEntity = isOrbitalEntitySchema(entity);
|
|
40154
40512
|
const resolvedEntity = isSchemaEntity ? entity : void 0;
|
|
40155
40513
|
const entityName = typeof entity === "string" ? entity : resolvedEntity?.name;
|
|
40156
|
-
const normalizedInitialData =
|
|
40514
|
+
const normalizedInitialData = React92__default.useMemo(() => {
|
|
40157
40515
|
const entityRowAsInitial = isPlainEntityRow(entity) ? entity : void 0;
|
|
40158
40516
|
const callerInitial = initialData !== null && typeof initialData === "object" && !Array.isArray(initialData) ? initialData : {};
|
|
40159
40517
|
return entityRowAsInitial !== void 0 ? { ...entityRowAsInitial, ...callerInitial } : callerInitial;
|
|
40160
40518
|
}, [entity, initialData]);
|
|
40161
|
-
const entityDerivedFields =
|
|
40519
|
+
const entityDerivedFields = React92__default.useMemo(() => {
|
|
40162
40520
|
if (fields && fields.length > 0) return void 0;
|
|
40163
40521
|
if (!resolvedEntity) return void 0;
|
|
40164
40522
|
return resolvedEntity.fields.map(
|
|
@@ -40179,16 +40537,16 @@ var init_Form = __esm({
|
|
|
40179
40537
|
const conditionalFields = typeof conditionalFieldsRaw === "boolean" ? {} : conditionalFieldsRaw;
|
|
40180
40538
|
const hiddenCalculations = typeof hiddenCalculationsRaw === "boolean" ? [] : hiddenCalculationsRaw;
|
|
40181
40539
|
const violationTriggers = typeof violationTriggersRaw === "boolean" ? [] : violationTriggersRaw;
|
|
40182
|
-
const [formData, setFormData] =
|
|
40540
|
+
const [formData, setFormData] = React92__default.useState(
|
|
40183
40541
|
normalizedInitialData
|
|
40184
40542
|
);
|
|
40185
|
-
const [collapsedSections, setCollapsedSections] =
|
|
40543
|
+
const [collapsedSections, setCollapsedSections] = React92__default.useState(
|
|
40186
40544
|
/* @__PURE__ */ new Set()
|
|
40187
40545
|
);
|
|
40188
|
-
const [submitError, setSubmitError] =
|
|
40189
|
-
const formRef =
|
|
40546
|
+
const [submitError, setSubmitError] = React92__default.useState(null);
|
|
40547
|
+
const formRef = React92__default.useRef(null);
|
|
40190
40548
|
const formMode = props.mode;
|
|
40191
|
-
const mountedRef =
|
|
40549
|
+
const mountedRef = React92__default.useRef(false);
|
|
40192
40550
|
if (!mountedRef.current) {
|
|
40193
40551
|
mountedRef.current = true;
|
|
40194
40552
|
debug("forms", "mount", {
|
|
@@ -40201,7 +40559,7 @@ var init_Form = __esm({
|
|
|
40201
40559
|
});
|
|
40202
40560
|
}
|
|
40203
40561
|
const shouldShowCancel = showCancel ?? (fields && fields.length > 0);
|
|
40204
|
-
const evalContext =
|
|
40562
|
+
const evalContext = React92__default.useMemo(
|
|
40205
40563
|
() => ({
|
|
40206
40564
|
formValues: formData,
|
|
40207
40565
|
globalVariables: externalContext?.globalVariables ?? {},
|
|
@@ -40210,7 +40568,7 @@ var init_Form = __esm({
|
|
|
40210
40568
|
}),
|
|
40211
40569
|
[formData, externalContext]
|
|
40212
40570
|
);
|
|
40213
|
-
|
|
40571
|
+
React92__default.useEffect(() => {
|
|
40214
40572
|
debug("forms", "initialData-sync", {
|
|
40215
40573
|
mode: formMode,
|
|
40216
40574
|
normalizedInitialData,
|
|
@@ -40221,7 +40579,7 @@ var init_Form = __esm({
|
|
|
40221
40579
|
setFormData(normalizedInitialData);
|
|
40222
40580
|
}
|
|
40223
40581
|
}, [normalizedInitialData]);
|
|
40224
|
-
const processCalculations =
|
|
40582
|
+
const processCalculations = React92__default.useCallback(
|
|
40225
40583
|
(changedFieldId, newFormData) => {
|
|
40226
40584
|
if (!hiddenCalculations.length) return;
|
|
40227
40585
|
const context = {
|
|
@@ -40246,7 +40604,7 @@ var init_Form = __esm({
|
|
|
40246
40604
|
},
|
|
40247
40605
|
[hiddenCalculations, externalContext, eventBus]
|
|
40248
40606
|
);
|
|
40249
|
-
const checkViolations =
|
|
40607
|
+
const checkViolations = React92__default.useCallback(
|
|
40250
40608
|
(changedFieldId, newFormData) => {
|
|
40251
40609
|
if (!violationTriggers.length) return;
|
|
40252
40610
|
const context = {
|
|
@@ -40284,7 +40642,7 @@ var init_Form = __esm({
|
|
|
40284
40642
|
processCalculations(name, newFormData);
|
|
40285
40643
|
checkViolations(name, newFormData);
|
|
40286
40644
|
};
|
|
40287
|
-
const isFieldVisible =
|
|
40645
|
+
const isFieldVisible = React92__default.useCallback(
|
|
40288
40646
|
(fieldName) => {
|
|
40289
40647
|
const condition = conditionalFields[fieldName];
|
|
40290
40648
|
if (!condition) return true;
|
|
@@ -40292,7 +40650,7 @@ var init_Form = __esm({
|
|
|
40292
40650
|
},
|
|
40293
40651
|
[conditionalFields, evalContext]
|
|
40294
40652
|
);
|
|
40295
|
-
const isSectionVisible =
|
|
40653
|
+
const isSectionVisible = React92__default.useCallback(
|
|
40296
40654
|
(section) => {
|
|
40297
40655
|
if (!section.condition) return true;
|
|
40298
40656
|
return Boolean(evaluateFormExpression(section.condition, evalContext));
|
|
@@ -40368,7 +40726,7 @@ var init_Form = __esm({
|
|
|
40368
40726
|
eventBus.emit(`UI:${onCancel}`);
|
|
40369
40727
|
}
|
|
40370
40728
|
};
|
|
40371
|
-
const renderField =
|
|
40729
|
+
const renderField = React92__default.useCallback(
|
|
40372
40730
|
(field) => {
|
|
40373
40731
|
const fieldName = field.name || field.field;
|
|
40374
40732
|
if (!fieldName) return null;
|
|
@@ -40389,7 +40747,7 @@ var init_Form = __esm({
|
|
|
40389
40747
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
40390
40748
|
);
|
|
40391
40749
|
const effectiveFields = entityDerivedFields ?? fields;
|
|
40392
|
-
const normalizedFields =
|
|
40750
|
+
const normalizedFields = React92__default.useMemo(() => {
|
|
40393
40751
|
if (!effectiveFields || effectiveFields.length === 0) return [];
|
|
40394
40752
|
return effectiveFields.map((field) => {
|
|
40395
40753
|
if (typeof field === "string") {
|
|
@@ -40413,7 +40771,7 @@ var init_Form = __esm({
|
|
|
40413
40771
|
return field;
|
|
40414
40772
|
});
|
|
40415
40773
|
}, [effectiveFields, resolvedEntity]);
|
|
40416
|
-
const schemaFields =
|
|
40774
|
+
const schemaFields = React92__default.useMemo(() => {
|
|
40417
40775
|
if (normalizedFields.length === 0) return null;
|
|
40418
40776
|
if (isDebugEnabled()) {
|
|
40419
40777
|
debugGroup(`Form: ${entityName || "unknown"}`);
|
|
@@ -40423,7 +40781,7 @@ var init_Form = __esm({
|
|
|
40423
40781
|
}
|
|
40424
40782
|
return normalizedFields.map(renderField).filter(Boolean);
|
|
40425
40783
|
}, [normalizedFields, renderField, entityName, conditionalFields]);
|
|
40426
|
-
const sectionElements =
|
|
40784
|
+
const sectionElements = React92__default.useMemo(() => {
|
|
40427
40785
|
if (!sections || sections.length === 0) return null;
|
|
40428
40786
|
return sections.map((section) => {
|
|
40429
40787
|
if (!isSectionVisible(section)) {
|
|
@@ -41002,7 +41360,7 @@ function formatValue3(value, fieldName) {
|
|
|
41002
41360
|
return String(value);
|
|
41003
41361
|
}
|
|
41004
41362
|
function formatFieldLabel2(fieldName) {
|
|
41005
|
-
return fieldName
|
|
41363
|
+
return humanizeFieldName(fieldName).replace(/\sId$/, "").trim();
|
|
41006
41364
|
}
|
|
41007
41365
|
var STATUS_STYLES, StatusBadge, ProgressIndicator, List3;
|
|
41008
41366
|
var init_List = __esm({
|
|
@@ -41014,6 +41372,7 @@ var init_List = __esm({
|
|
|
41014
41372
|
init_EmptyState();
|
|
41015
41373
|
init_LoadingState();
|
|
41016
41374
|
init_cn();
|
|
41375
|
+
init_format();
|
|
41017
41376
|
init_getNestedValue();
|
|
41018
41377
|
init_useEventBus();
|
|
41019
41378
|
init_types2();
|
|
@@ -41148,7 +41507,7 @@ var init_List = __esm({
|
|
|
41148
41507
|
if (entity && typeof entity === "object" && "id" in entity) return [entity];
|
|
41149
41508
|
return [];
|
|
41150
41509
|
}, [entity]);
|
|
41151
|
-
const getItemActions =
|
|
41510
|
+
const getItemActions = React92__default.useCallback(
|
|
41152
41511
|
(item) => {
|
|
41153
41512
|
if (!itemActions) return [];
|
|
41154
41513
|
if (typeof itemActions === "function") {
|
|
@@ -41629,7 +41988,7 @@ var init_MediaGallery = __esm({
|
|
|
41629
41988
|
[selectable, selectedItems, selectionEvent, eventBus]
|
|
41630
41989
|
);
|
|
41631
41990
|
const entityData = Array.isArray(entity) ? entity : [];
|
|
41632
|
-
const items =
|
|
41991
|
+
const items = React92__default.useMemo(() => {
|
|
41633
41992
|
if (propItems && propItems.length > 0) return propItems;
|
|
41634
41993
|
if (entityData.length === 0) return [];
|
|
41635
41994
|
return entityData.map((record, idx) => {
|
|
@@ -41794,7 +42153,7 @@ var init_MediaGallery = __esm({
|
|
|
41794
42153
|
}
|
|
41795
42154
|
});
|
|
41796
42155
|
function extractTitle2(children) {
|
|
41797
|
-
if (!
|
|
42156
|
+
if (!React92__default.isValidElement(children)) return void 0;
|
|
41798
42157
|
const props = children.props;
|
|
41799
42158
|
if (typeof props.title === "string") {
|
|
41800
42159
|
return props.title;
|
|
@@ -42068,7 +42427,7 @@ var init_debugRegistry = __esm({
|
|
|
42068
42427
|
}
|
|
42069
42428
|
});
|
|
42070
42429
|
function useDebugData() {
|
|
42071
|
-
const [data, setData] =
|
|
42430
|
+
const [data, setData] = React92.useState(() => ({
|
|
42072
42431
|
traits: [],
|
|
42073
42432
|
ticks: [],
|
|
42074
42433
|
guards: [],
|
|
@@ -42082,7 +42441,7 @@ function useDebugData() {
|
|
|
42082
42441
|
},
|
|
42083
42442
|
lastUpdate: Date.now()
|
|
42084
42443
|
}));
|
|
42085
|
-
|
|
42444
|
+
React92.useEffect(() => {
|
|
42086
42445
|
const updateData = () => {
|
|
42087
42446
|
setData({
|
|
42088
42447
|
traits: getAllTraits(),
|
|
@@ -42191,12 +42550,12 @@ function layoutGraph(states, transitions, initialState, width, height) {
|
|
|
42191
42550
|
return positions;
|
|
42192
42551
|
}
|
|
42193
42552
|
function WalkMinimap() {
|
|
42194
|
-
const [walkStep, setWalkStep] =
|
|
42195
|
-
const [traits2, setTraits] =
|
|
42196
|
-
const [coveredEdges, setCoveredEdges] =
|
|
42197
|
-
const [completedTraits, setCompletedTraits] =
|
|
42198
|
-
const prevTraitRef =
|
|
42199
|
-
|
|
42553
|
+
const [walkStep, setWalkStep] = React92.useState(null);
|
|
42554
|
+
const [traits2, setTraits] = React92.useState([]);
|
|
42555
|
+
const [coveredEdges, setCoveredEdges] = React92.useState([]);
|
|
42556
|
+
const [completedTraits, setCompletedTraits] = React92.useState(/* @__PURE__ */ new Set());
|
|
42557
|
+
const prevTraitRef = React92.useRef(null);
|
|
42558
|
+
React92.useEffect(() => {
|
|
42200
42559
|
const interval = setInterval(() => {
|
|
42201
42560
|
const w = window;
|
|
42202
42561
|
const step = w.__orbitalWalkStep;
|
|
@@ -42494,7 +42853,7 @@ function TicksTab({ ticks: ticks2 }) {
|
|
|
42494
42853
|
}
|
|
42495
42854
|
);
|
|
42496
42855
|
}
|
|
42497
|
-
const
|
|
42856
|
+
const formatTime3 = (ms) => {
|
|
42498
42857
|
if (ms === 0) return "never";
|
|
42499
42858
|
const seconds = Math.floor((Date.now() - ms) / 1e3);
|
|
42500
42859
|
if (seconds < 1) return "just now";
|
|
@@ -42520,7 +42879,7 @@ function TicksTab({ ticks: ticks2 }) {
|
|
|
42520
42879
|
tick.executionTime.toFixed(1),
|
|
42521
42880
|
"ms exec"
|
|
42522
42881
|
] }),
|
|
42523
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
42882
|
+
/* @__PURE__ */ jsx("span", { children: formatTime3(tick.lastRun) })
|
|
42524
42883
|
] }),
|
|
42525
42884
|
tick.guardName && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxs(Badge, { variant: tick.guardPassed ? "success" : "danger", size: "sm", children: [
|
|
42526
42885
|
tick.guardName,
|
|
@@ -42632,19 +42991,19 @@ var init_EntitiesTab = __esm({
|
|
|
42632
42991
|
});
|
|
42633
42992
|
function EventFlowTab({ events: events2 }) {
|
|
42634
42993
|
const { t } = useTranslate();
|
|
42635
|
-
const [filter, setFilter] =
|
|
42636
|
-
const containerRef =
|
|
42637
|
-
const [autoScroll, setAutoScroll] =
|
|
42638
|
-
|
|
42994
|
+
const [filter, setFilter] = React92.useState("all");
|
|
42995
|
+
const containerRef = React92.useRef(null);
|
|
42996
|
+
const [autoScroll, setAutoScroll] = React92.useState(true);
|
|
42997
|
+
React92.useEffect(() => {
|
|
42639
42998
|
if (autoScroll && containerRef.current) {
|
|
42640
42999
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42641
43000
|
}
|
|
42642
43001
|
}, [events2.length, autoScroll]);
|
|
42643
|
-
const filteredEvents =
|
|
43002
|
+
const filteredEvents = React92.useMemo(() => {
|
|
42644
43003
|
if (filter === "all") return events2;
|
|
42645
43004
|
return events2.filter((e) => e.type === filter);
|
|
42646
43005
|
}, [events2, filter]);
|
|
42647
|
-
const
|
|
43006
|
+
const formatTime3 = (timestamp) => {
|
|
42648
43007
|
const date = new Date(timestamp);
|
|
42649
43008
|
return date.toLocaleTimeString("en-US", {
|
|
42650
43009
|
hour12: false,
|
|
@@ -42720,7 +43079,7 @@ function EventFlowTab({ events: events2 }) {
|
|
|
42720
43079
|
{
|
|
42721
43080
|
className: "flex items-start gap-2 text-xs py-1 hover:bg-muted/50 rounded px-1",
|
|
42722
43081
|
children: [
|
|
42723
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children:
|
|
43082
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime3(event.timestamp) }),
|
|
42724
43083
|
/* @__PURE__ */ jsx("span", { children: icon }),
|
|
42725
43084
|
/* @__PURE__ */ jsx(Badge, { variant, size: "sm", className: "min-w-[60px] justify-center", children: event.source }),
|
|
42726
43085
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: event.message })
|
|
@@ -42756,7 +43115,7 @@ var init_EventFlowTab = __esm({
|
|
|
42756
43115
|
});
|
|
42757
43116
|
function GuardsPanel({ guards }) {
|
|
42758
43117
|
const { t } = useTranslate();
|
|
42759
|
-
const [filter, setFilter] =
|
|
43118
|
+
const [filter, setFilter] = React92.useState("all");
|
|
42760
43119
|
if (guards.length === 0) {
|
|
42761
43120
|
return /* @__PURE__ */ jsx(
|
|
42762
43121
|
EmptyState,
|
|
@@ -42769,12 +43128,12 @@ function GuardsPanel({ guards }) {
|
|
|
42769
43128
|
}
|
|
42770
43129
|
const passedCount = guards.filter((g) => g.result).length;
|
|
42771
43130
|
const failedCount = guards.length - passedCount;
|
|
42772
|
-
const filteredGuards =
|
|
43131
|
+
const filteredGuards = React92.useMemo(() => {
|
|
42773
43132
|
if (filter === "all") return guards;
|
|
42774
43133
|
if (filter === "passed") return guards.filter((g) => g.result);
|
|
42775
43134
|
return guards.filter((g) => !g.result);
|
|
42776
43135
|
}, [guards, filter]);
|
|
42777
|
-
const
|
|
43136
|
+
const formatTime3 = (timestamp) => {
|
|
42778
43137
|
const date = new Date(timestamp);
|
|
42779
43138
|
return date.toLocaleTimeString("en-US", {
|
|
42780
43139
|
hour12: false,
|
|
@@ -42789,7 +43148,7 @@ function GuardsPanel({ guards }) {
|
|
|
42789
43148
|
/* @__PURE__ */ jsx(Badge, { variant: guard.result ? "success" : "danger", size: "sm", children: guard.result ? "\u2713" : "\u2717" }),
|
|
42790
43149
|
/* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", className: "text-warning", children: guard.guardName }),
|
|
42791
43150
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground", children: guard.context.type === "transition" ? `${guard.context.transitionFrom} \u2192 ${guard.context.transitionTo}` : guard.context.tickName }),
|
|
42792
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children:
|
|
43151
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground ml-auto", children: formatTime3(guard.timestamp) })
|
|
42793
43152
|
] }),
|
|
42794
43153
|
content: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
|
|
42795
43154
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -42932,10 +43291,10 @@ function EffectBadge({ effect }) {
|
|
|
42932
43291
|
}
|
|
42933
43292
|
function TransitionTimeline({ transitions }) {
|
|
42934
43293
|
const { t } = useTranslate();
|
|
42935
|
-
const containerRef =
|
|
42936
|
-
const [autoScroll, setAutoScroll] =
|
|
42937
|
-
const [expandedId, setExpandedId] =
|
|
42938
|
-
|
|
43294
|
+
const containerRef = React92.useRef(null);
|
|
43295
|
+
const [autoScroll, setAutoScroll] = React92.useState(true);
|
|
43296
|
+
const [expandedId, setExpandedId] = React92.useState(null);
|
|
43297
|
+
React92.useEffect(() => {
|
|
42939
43298
|
if (autoScroll && containerRef.current) {
|
|
42940
43299
|
containerRef.current.scrollTop = containerRef.current.scrollHeight;
|
|
42941
43300
|
}
|
|
@@ -42950,7 +43309,7 @@ function TransitionTimeline({ transitions }) {
|
|
|
42950
43309
|
}
|
|
42951
43310
|
);
|
|
42952
43311
|
}
|
|
42953
|
-
const
|
|
43312
|
+
const formatTime3 = (ts) => {
|
|
42954
43313
|
const d = new Date(ts);
|
|
42955
43314
|
return d.toLocaleTimeString("en-US", {
|
|
42956
43315
|
hour12: false,
|
|
@@ -42998,7 +43357,7 @@ function TransitionTimeline({ transitions }) {
|
|
|
42998
43357
|
${hasFailedEffects ? "bg-error" : allPassed ? "bg-success" : "bg-muted-foreground"}
|
|
42999
43358
|
` }),
|
|
43000
43359
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs py-1 px-2", children: [
|
|
43001
|
-
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children:
|
|
43360
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground font-mono min-w-[65px]", children: formatTime3(trace.timestamp) }),
|
|
43002
43361
|
/* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", className: "min-w-[60px] justify-center", children: trace.traitName }),
|
|
43003
43362
|
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "font-mono text-muted-foreground", children: [
|
|
43004
43363
|
trace.from,
|
|
@@ -43073,7 +43432,7 @@ function ServerBridgeTab({ bridge }) {
|
|
|
43073
43432
|
}
|
|
43074
43433
|
);
|
|
43075
43434
|
}
|
|
43076
|
-
const
|
|
43435
|
+
const formatTime3 = (ts) => {
|
|
43077
43436
|
if (ts === 0) return t("debug.never");
|
|
43078
43437
|
const d = new Date(ts);
|
|
43079
43438
|
return d.toLocaleTimeString("en-US", {
|
|
@@ -43116,7 +43475,7 @@ function ServerBridgeTab({ bridge }) {
|
|
|
43116
43475
|
StatRow,
|
|
43117
43476
|
{
|
|
43118
43477
|
label: t("debug.lastHeartbeat"),
|
|
43119
|
-
value:
|
|
43478
|
+
value: formatTime3(bridge.lastHeartbeat)
|
|
43120
43479
|
}
|
|
43121
43480
|
)
|
|
43122
43481
|
] })
|
|
@@ -43215,9 +43574,9 @@ function getAllEvents(traits2) {
|
|
|
43215
43574
|
function EventDispatcherTab({ traits: traits2, schema }) {
|
|
43216
43575
|
const eventBus = useEventBus();
|
|
43217
43576
|
const { t } = useTranslate();
|
|
43218
|
-
const [log11, setLog] =
|
|
43219
|
-
const prevStatesRef =
|
|
43220
|
-
|
|
43577
|
+
const [log11, setLog] = React92.useState([]);
|
|
43578
|
+
const prevStatesRef = React92.useRef(/* @__PURE__ */ new Map());
|
|
43579
|
+
React92.useEffect(() => {
|
|
43221
43580
|
for (const trait of traits2) {
|
|
43222
43581
|
const prev = prevStatesRef.current.get(trait.id);
|
|
43223
43582
|
if (prev && prev !== trait.currentState) {
|
|
@@ -43386,10 +43745,10 @@ function VerifyModePanel({
|
|
|
43386
43745
|
localCount
|
|
43387
43746
|
}) {
|
|
43388
43747
|
const { t } = useTranslate();
|
|
43389
|
-
const [expanded, setExpanded] =
|
|
43390
|
-
const scrollRef =
|
|
43391
|
-
const prevCountRef =
|
|
43392
|
-
|
|
43748
|
+
const [expanded, setExpanded] = React92.useState(true);
|
|
43749
|
+
const scrollRef = React92.useRef(null);
|
|
43750
|
+
const prevCountRef = React92.useRef(0);
|
|
43751
|
+
React92.useEffect(() => {
|
|
43393
43752
|
if (expanded && transitions.length > prevCountRef.current && scrollRef.current) {
|
|
43394
43753
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
43395
43754
|
}
|
|
@@ -43446,10 +43805,10 @@ function RuntimeDebugger({
|
|
|
43446
43805
|
schema
|
|
43447
43806
|
}) {
|
|
43448
43807
|
const { t } = useTranslate();
|
|
43449
|
-
const [isCollapsed, setIsCollapsed] =
|
|
43450
|
-
const [isVisible, setIsVisible] =
|
|
43808
|
+
const [isCollapsed, setIsCollapsed] = React92.useState(mode === "verify" ? true : defaultCollapsed);
|
|
43809
|
+
const [isVisible, setIsVisible] = React92.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
|
|
43451
43810
|
const debugData = useDebugData();
|
|
43452
|
-
|
|
43811
|
+
React92.useEffect(() => {
|
|
43453
43812
|
if (mode === "inline") return;
|
|
43454
43813
|
return onDebugToggle((enabled) => {
|
|
43455
43814
|
setIsVisible(enabled);
|
|
@@ -43458,7 +43817,7 @@ function RuntimeDebugger({
|
|
|
43458
43817
|
}
|
|
43459
43818
|
});
|
|
43460
43819
|
}, [mode]);
|
|
43461
|
-
|
|
43820
|
+
React92.useEffect(() => {
|
|
43462
43821
|
if (mode === "inline") return;
|
|
43463
43822
|
const handleKeyDown = (e) => {
|
|
43464
43823
|
if (e.key === "`" && isVisible) {
|
|
@@ -43978,7 +44337,7 @@ var init_StatCard = __esm({
|
|
|
43978
44337
|
const labelToUse = propLabel ?? propTitle;
|
|
43979
44338
|
const eventBus = useEventBus();
|
|
43980
44339
|
const { t } = useTranslate();
|
|
43981
|
-
const handleActionClick =
|
|
44340
|
+
const handleActionClick = React92__default.useCallback(() => {
|
|
43982
44341
|
if (action?.event) {
|
|
43983
44342
|
eventBus.emit(`UI:${action.event}`, {});
|
|
43984
44343
|
}
|
|
@@ -43989,7 +44348,7 @@ var init_StatCard = __esm({
|
|
|
43989
44348
|
const data = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
43990
44349
|
const isLoading = externalLoading ?? false;
|
|
43991
44350
|
const error = externalError;
|
|
43992
|
-
const computeMetricValue =
|
|
44351
|
+
const computeMetricValue = React92__default.useCallback(
|
|
43993
44352
|
(metric, items) => {
|
|
43994
44353
|
if (metric.value !== void 0) {
|
|
43995
44354
|
return metric.value;
|
|
@@ -44028,7 +44387,7 @@ var init_StatCard = __esm({
|
|
|
44028
44387
|
},
|
|
44029
44388
|
[]
|
|
44030
44389
|
);
|
|
44031
|
-
const schemaStats =
|
|
44390
|
+
const schemaStats = React92__default.useMemo(() => {
|
|
44032
44391
|
if (!metrics || metrics.length === 0) return null;
|
|
44033
44392
|
return metrics.map((metric) => ({
|
|
44034
44393
|
label: metric.label,
|
|
@@ -44036,7 +44395,7 @@ var init_StatCard = __esm({
|
|
|
44036
44395
|
format: metric.format
|
|
44037
44396
|
}));
|
|
44038
44397
|
}, [metrics, data, computeMetricValue]);
|
|
44039
|
-
const calculatedTrend =
|
|
44398
|
+
const calculatedTrend = React92__default.useMemo(() => {
|
|
44040
44399
|
if (manualTrend !== void 0) return manualTrend;
|
|
44041
44400
|
if (previousValue === void 0 || currentValue === void 0)
|
|
44042
44401
|
return void 0;
|
|
@@ -44676,8 +45035,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44676
45035
|
] });
|
|
44677
45036
|
};
|
|
44678
45037
|
InlineActivityStream = ({ activities, autoScroll = true, className }) => {
|
|
44679
|
-
const endRef =
|
|
44680
|
-
|
|
45038
|
+
const endRef = React92__default.useRef(null);
|
|
45039
|
+
React92__default.useEffect(() => {
|
|
44681
45040
|
if (!autoScroll) return;
|
|
44682
45041
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44683
45042
|
}, [activities.length, autoScroll]);
|
|
@@ -44771,7 +45130,7 @@ var init_SubagentTracePanel = __esm({
|
|
|
44771
45130
|
};
|
|
44772
45131
|
SubagentRichCard = ({ subagent }) => {
|
|
44773
45132
|
const { t } = useTranslate();
|
|
44774
|
-
const activities =
|
|
45133
|
+
const activities = React92__default.useMemo(
|
|
44775
45134
|
() => subagentMessagesToActivities(subagent.messages),
|
|
44776
45135
|
[subagent.messages]
|
|
44777
45136
|
);
|
|
@@ -44848,8 +45207,8 @@ var init_SubagentTracePanel = __esm({
|
|
|
44848
45207
|
] });
|
|
44849
45208
|
};
|
|
44850
45209
|
CoordinatorConversation = ({ messages, autoScroll = true, className }) => {
|
|
44851
|
-
const endRef =
|
|
44852
|
-
|
|
45210
|
+
const endRef = React92__default.useRef(null);
|
|
45211
|
+
React92__default.useEffect(() => {
|
|
44853
45212
|
if (!autoScroll) return;
|
|
44854
45213
|
endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
44855
45214
|
}, [messages.length, autoScroll]);
|
|
@@ -45228,7 +45587,7 @@ var init_TeamOrganism = __esm({
|
|
|
45228
45587
|
TeamOrganism.displayName = "TeamOrganism";
|
|
45229
45588
|
}
|
|
45230
45589
|
});
|
|
45231
|
-
function
|
|
45590
|
+
function formatDate2(value) {
|
|
45232
45591
|
const d = new Date(value);
|
|
45233
45592
|
if (isNaN(d.getTime())) return value;
|
|
45234
45593
|
return d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
@@ -45284,7 +45643,7 @@ var init_Timeline = __esm({
|
|
|
45284
45643
|
}) => {
|
|
45285
45644
|
const { t } = useTranslate();
|
|
45286
45645
|
const entityData = entity ?? [];
|
|
45287
|
-
const items =
|
|
45646
|
+
const items = React92__default.useMemo(() => {
|
|
45288
45647
|
if (propItems) return propItems;
|
|
45289
45648
|
if (entityData.length === 0) return [];
|
|
45290
45649
|
return entityData.map((record, idx) => {
|
|
@@ -45360,7 +45719,7 @@ var init_Timeline = __esm({
|
|
|
45360
45719
|
/* @__PURE__ */ jsxs(VStack, { gap: "xs", className: cn("flex-1 min-w-0", !isLast && "pb-6"), children: [
|
|
45361
45720
|
/* @__PURE__ */ jsxs(HStack, { justify: "between", align: "start", wrap: true, children: [
|
|
45362
45721
|
/* @__PURE__ */ jsx(Typography, { variant: "body", weight: "semibold", children: item.title }),
|
|
45363
|
-
item.date && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "flex-shrink-0", children:
|
|
45722
|
+
item.date && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", className: "flex-shrink-0", children: formatDate2(item.date) })
|
|
45364
45723
|
] }),
|
|
45365
45724
|
item.description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
45366
45725
|
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)) }),
|
|
@@ -45386,7 +45745,7 @@ var init_Timeline = __esm({
|
|
|
45386
45745
|
}
|
|
45387
45746
|
});
|
|
45388
45747
|
function extractToastProps(children) {
|
|
45389
|
-
if (!
|
|
45748
|
+
if (!React92__default.isValidElement(children)) {
|
|
45390
45749
|
if (typeof children === "string") {
|
|
45391
45750
|
return { message: children };
|
|
45392
45751
|
}
|
|
@@ -45428,7 +45787,7 @@ var init_ToastSlot = __esm({
|
|
|
45428
45787
|
eventBus.emit(`${prefix}CLOSE`);
|
|
45429
45788
|
};
|
|
45430
45789
|
if (!isVisible) return null;
|
|
45431
|
-
const isCustomContent =
|
|
45790
|
+
const isCustomContent = React92__default.isValidElement(children) && !message;
|
|
45432
45791
|
return /* @__PURE__ */ jsx(Box, { className: "fixed bottom-4 right-4 z-50", children: isCustomContent ? children : /* @__PURE__ */ jsx(
|
|
45433
45792
|
Toast,
|
|
45434
45793
|
{
|
|
@@ -45666,6 +46025,10 @@ var init_component_registry_generated = __esm({
|
|
|
45666
46025
|
init_SubagentTracePanel();
|
|
45667
46026
|
init_SvgBranch();
|
|
45668
46027
|
init_SvgConnection();
|
|
46028
|
+
init_SvgDrawGroup();
|
|
46029
|
+
init_SvgDrawShape();
|
|
46030
|
+
init_SvgDrawShapeLayer();
|
|
46031
|
+
init_SvgDrawText();
|
|
45669
46032
|
init_SvgFlow();
|
|
45670
46033
|
init_SvgGrid();
|
|
45671
46034
|
init_SvgLobe();
|
|
@@ -45676,6 +46039,7 @@ var init_component_registry_generated = __esm({
|
|
|
45676
46039
|
init_SvgRing();
|
|
45677
46040
|
init_SvgShield();
|
|
45678
46041
|
init_SvgStack();
|
|
46042
|
+
init_SvgStage();
|
|
45679
46043
|
init_SwipeableRow();
|
|
45680
46044
|
init_Switch();
|
|
45681
46045
|
init_TabbedContainer();
|
|
@@ -45937,6 +46301,10 @@ var init_component_registry_generated = __esm({
|
|
|
45937
46301
|
"SubagentTracePanel": SubagentTracePanel,
|
|
45938
46302
|
"SvgBranch": SvgBranch,
|
|
45939
46303
|
"SvgConnection": SvgConnection,
|
|
46304
|
+
"SvgDrawGroup": SvgDrawGroup,
|
|
46305
|
+
"SvgDrawShape": SvgDrawShape,
|
|
46306
|
+
"SvgDrawShapeLayer": SvgDrawShapeLayer,
|
|
46307
|
+
"SvgDrawText": SvgDrawText,
|
|
45940
46308
|
"SvgFlow": SvgFlow,
|
|
45941
46309
|
"SvgGrid": SvgGrid,
|
|
45942
46310
|
"SvgLobe": SvgLobe,
|
|
@@ -45947,6 +46315,7 @@ var init_component_registry_generated = __esm({
|
|
|
45947
46315
|
"SvgRing": SvgRing,
|
|
45948
46316
|
"SvgShield": SvgShield,
|
|
45949
46317
|
"SvgStack": SvgStack,
|
|
46318
|
+
"SvgStage": SvgStage,
|
|
45950
46319
|
"SwipeableRow": SwipeableRow,
|
|
45951
46320
|
"Switch": Switch,
|
|
45952
46321
|
"TabbedContainer": TabbedContainer,
|
|
@@ -45997,7 +46366,7 @@ function SuspenseConfigProvider({
|
|
|
45997
46366
|
config,
|
|
45998
46367
|
children
|
|
45999
46368
|
}) {
|
|
46000
|
-
return
|
|
46369
|
+
return React92__default.createElement(
|
|
46001
46370
|
SuspenseConfigContext.Provider,
|
|
46002
46371
|
{ value: config },
|
|
46003
46372
|
children
|
|
@@ -46023,7 +46392,7 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46023
46392
|
if (entityField) {
|
|
46024
46393
|
const enriched = {
|
|
46025
46394
|
name: field,
|
|
46026
|
-
label: field
|
|
46395
|
+
label: humanizeFieldName(field),
|
|
46027
46396
|
type: entityField.type,
|
|
46028
46397
|
required: entityField.required ?? false
|
|
46029
46398
|
};
|
|
@@ -46037,9 +46406,9 @@ function enrichFormFields(fields, entityDef) {
|
|
|
46037
46406
|
}
|
|
46038
46407
|
return enriched;
|
|
46039
46408
|
}
|
|
46040
|
-
return { name: field, label: field
|
|
46409
|
+
return { name: field, label: humanizeFieldName(field) };
|
|
46041
46410
|
}
|
|
46042
|
-
if (field && typeof field === "object" && !Array.isArray(field) && !
|
|
46411
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React92__default.isValidElement(field) && !(field instanceof Date)) {
|
|
46043
46412
|
const obj = field;
|
|
46044
46413
|
const fieldName = typeof obj.name === "string" ? obj.name : typeof obj.field === "string" ? obj.field : void 0;
|
|
46045
46414
|
if (!fieldName) return field;
|
|
@@ -46499,7 +46868,7 @@ function renderPatternChildren(children, onDismiss, parentId = "root", parentPat
|
|
|
46499
46868
|
const key = `${parentId}-${index}-trait:${traitName}`;
|
|
46500
46869
|
return /* @__PURE__ */ jsx(TraitFrame, { traitName }, key);
|
|
46501
46870
|
}
|
|
46502
|
-
return /* @__PURE__ */ jsx(
|
|
46871
|
+
return /* @__PURE__ */ jsx(React92__default.Fragment, { children: child }, `${parentId}-${index}`);
|
|
46503
46872
|
}
|
|
46504
46873
|
if (!child || typeof child !== "object") return null;
|
|
46505
46874
|
const childId = `${parentId}-${index}`;
|
|
@@ -46556,14 +46925,14 @@ function isPatternConfig(value) {
|
|
|
46556
46925
|
if (value === null || value === void 0) return false;
|
|
46557
46926
|
if (typeof value !== "object") return false;
|
|
46558
46927
|
if (Array.isArray(value)) return false;
|
|
46559
|
-
if (
|
|
46928
|
+
if (React92__default.isValidElement(value)) return false;
|
|
46560
46929
|
if (value instanceof Date) return false;
|
|
46561
46930
|
if (typeof value === "function") return false;
|
|
46562
46931
|
const record = value;
|
|
46563
46932
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
46564
46933
|
}
|
|
46565
46934
|
function isPlainConfigObject(value) {
|
|
46566
|
-
if (
|
|
46935
|
+
if (React92__default.isValidElement(value)) return false;
|
|
46567
46936
|
if (value instanceof Date) return false;
|
|
46568
46937
|
const proto = Object.getPrototypeOf(value);
|
|
46569
46938
|
return proto === Object.prototype || proto === null;
|
|
@@ -46691,10 +47060,11 @@ function SlotContentRenderer({
|
|
|
46691
47060
|
for (const slotKey of CONTENT_NODE_SLOTS) {
|
|
46692
47061
|
const slotVal = restProps[slotKey];
|
|
46693
47062
|
if (slotVal === void 0 || slotVal === null) continue;
|
|
46694
|
-
if (
|
|
46695
|
-
|
|
47063
|
+
if (React92__default.isValidElement(slotVal) || typeof slotVal === "string" || typeof slotVal === "number" || typeof slotVal === "boolean") continue;
|
|
47064
|
+
const typelessChildren = !Array.isArray(slotVal) && typeof slotVal === "object" && !("type" in slotVal) && Array.isArray(slotVal.children) ? slotVal.children : void 0;
|
|
47065
|
+
if (typelessChildren !== void 0 || Array.isArray(slotVal) || typeof slotVal === "object" && "type" in slotVal) {
|
|
46696
47066
|
nodeSlotOverrides[slotKey] = renderPatternChildren(
|
|
46697
|
-
slotVal,
|
|
47067
|
+
typelessChildren ?? slotVal,
|
|
46698
47068
|
onDismiss,
|
|
46699
47069
|
`${content.id}-${slotKey}`,
|
|
46700
47070
|
`${myPath}.${slotKey}`,
|
|
@@ -46744,7 +47114,7 @@ function SlotContentRenderer({
|
|
|
46744
47114
|
const resolvedItems = Array.isArray(entityVal) && entityVal[0] !== "fn" ? entityVal : null;
|
|
46745
47115
|
if (resolvedItems && resolvedItems.length > 0 && !finalProps.fields && !finalProps.columns) {
|
|
46746
47116
|
const sample = resolvedItems[0];
|
|
46747
|
-
if (sample && typeof sample === "object" && !Array.isArray(sample) && !
|
|
47117
|
+
if (sample && typeof sample === "object" && !Array.isArray(sample) && !React92__default.isValidElement(sample) && !(sample instanceof Date)) {
|
|
46748
47118
|
const keys = Object.keys(sample).filter((k) => k !== "id" && k !== "_id");
|
|
46749
47119
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
46750
47120
|
}
|
|
@@ -46873,6 +47243,7 @@ var init_UISlotRenderer = __esm({
|
|
|
46873
47243
|
init_useEventBus();
|
|
46874
47244
|
init_slot_types();
|
|
46875
47245
|
init_cn();
|
|
47246
|
+
init_format();
|
|
46876
47247
|
init_ErrorBoundary();
|
|
46877
47248
|
init_Skeleton();
|
|
46878
47249
|
init_renderer();
|
|
@@ -47109,7 +47480,7 @@ var AvlTransition = ({
|
|
|
47109
47480
|
opacity = 1,
|
|
47110
47481
|
className
|
|
47111
47482
|
}) => {
|
|
47112
|
-
const ids =
|
|
47483
|
+
const ids = React92__default.useMemo(() => {
|
|
47113
47484
|
avlTransitionId += 1;
|
|
47114
47485
|
return { arrow: `avl-tr-${avlTransitionId}-arrow` };
|
|
47115
47486
|
}, []);
|
|
@@ -47670,7 +48041,7 @@ var AvlStateMachine = ({
|
|
|
47670
48041
|
color = "var(--color-primary)",
|
|
47671
48042
|
animated = false
|
|
47672
48043
|
}) => {
|
|
47673
|
-
const ids =
|
|
48044
|
+
const ids = React92__default.useMemo(() => {
|
|
47674
48045
|
avlSmId += 1;
|
|
47675
48046
|
const base = `avl-sm-${avlSmId}`;
|
|
47676
48047
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -47869,7 +48240,7 @@ var AvlOrbitalUnit = ({
|
|
|
47869
48240
|
color = "var(--color-primary)",
|
|
47870
48241
|
animated = false
|
|
47871
48242
|
}) => {
|
|
47872
|
-
const ids =
|
|
48243
|
+
const ids = React92__default.useMemo(() => {
|
|
47873
48244
|
avlOuId += 1;
|
|
47874
48245
|
const base = `avl-ou-${avlOuId}`;
|
|
47875
48246
|
return { glow: `${base}-glow`, grad: `${base}-grad` };
|
|
@@ -47965,7 +48336,7 @@ var AvlClosedCircuit = ({
|
|
|
47965
48336
|
color = "var(--color-primary)",
|
|
47966
48337
|
animated = false
|
|
47967
48338
|
}) => {
|
|
47968
|
-
const ids =
|
|
48339
|
+
const ids = React92__default.useMemo(() => {
|
|
47969
48340
|
avlCcId += 1;
|
|
47970
48341
|
const base = `avl-cc-${avlCcId}`;
|
|
47971
48342
|
return { glow: `${base}-glow`, grad: `${base}-grad`, arrow: `${base}-arrow` };
|
|
@@ -48120,7 +48491,7 @@ var AvlEmitListen = ({
|
|
|
48120
48491
|
color = "var(--color-primary)",
|
|
48121
48492
|
animated = false
|
|
48122
48493
|
}) => {
|
|
48123
|
-
const ids =
|
|
48494
|
+
const ids = React92__default.useMemo(() => {
|
|
48124
48495
|
avlElId += 1;
|
|
48125
48496
|
const base = `avl-el-${avlElId}`;
|
|
48126
48497
|
return { arrow: `${base}-arrow`, grad: `${base}-grad` };
|
|
@@ -48394,7 +48765,7 @@ function renderNode(node, color, glowId) {
|
|
|
48394
48765
|
const baseR = node.type === "operator" ? 20 : 16;
|
|
48395
48766
|
const r2 = Math.max(baseR, labelLen * 3.5 + 6);
|
|
48396
48767
|
const nc = nodeColor(node.type, color);
|
|
48397
|
-
return /* @__PURE__ */ jsxs(
|
|
48768
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
48398
48769
|
node.children.map((child, i) => {
|
|
48399
48770
|
const childR = Math.max(
|
|
48400
48771
|
child.type === "operator" ? 20 : 16,
|
|
@@ -48451,7 +48822,7 @@ var AvlExprTree = ({
|
|
|
48451
48822
|
className,
|
|
48452
48823
|
color = "var(--color-primary)"
|
|
48453
48824
|
}) => {
|
|
48454
|
-
const ids =
|
|
48825
|
+
const ids = React92__default.useMemo(() => {
|
|
48455
48826
|
avlEtId += 1;
|
|
48456
48827
|
return { glow: `avl-et-${avlEtId}-glow` };
|
|
48457
48828
|
}, []);
|
|
@@ -49286,7 +49657,7 @@ var SystemNode = ({ data }) => {
|
|
|
49286
49657
|
stateChain.length > 0 && /* @__PURE__ */ jsx("svg", { width: stateChain.length * 14 + 2, height: 10, viewBox: `0 0 ${stateChain.length * 14 + 2} 10`, children: stateChain.map((s, i) => {
|
|
49287
49658
|
const tc = transitionCounts[s.name] ?? 0;
|
|
49288
49659
|
const role = getStateRole(s.name, s.isInitial ?? void 0, s.isTerminal ?? void 0, tc, maxTC);
|
|
49289
|
-
return /* @__PURE__ */ jsxs(
|
|
49660
|
+
return /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
49290
49661
|
/* @__PURE__ */ jsx(AvlState, { x: i * 14 + 1, y: 1, width: 10, height: 8, name: "", role, isInitial: s.isInitial ?? void 0, isTerminal: s.isTerminal ?? void 0 }),
|
|
49291
49662
|
i < stateChain.length - 1 && /* @__PURE__ */ jsx("line", { x1: i * 14 + 12, y1: 5, x2: i * 14 + 15, y2: 5, stroke: "var(--color-border)", strokeWidth: 0.5 })
|
|
49292
49663
|
] }, s.name);
|
|
@@ -50370,7 +50741,7 @@ function resolveLambdaBindings(body, params, item, index) {
|
|
|
50370
50741
|
}
|
|
50371
50742
|
return substituted;
|
|
50372
50743
|
}
|
|
50373
|
-
if (body !== null && typeof body === "object" && !
|
|
50744
|
+
if (body !== null && typeof body === "object" && !React92__default.isValidElement(body) && !(body instanceof Date) && typeof body !== "function") {
|
|
50374
50745
|
const out = {};
|
|
50375
50746
|
for (const [k, v] of Object.entries(body)) {
|
|
50376
50747
|
out[k] = recur(v);
|
|
@@ -50389,7 +50760,7 @@ function getSlotContentRenderer2() {
|
|
|
50389
50760
|
function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
50390
50761
|
return (item, index) => {
|
|
50391
50762
|
const resolvedBody = resolveLambdaBindings(lambdaBody, params, item, index);
|
|
50392
|
-
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" ||
|
|
50763
|
+
if (resolvedBody === null || typeof resolvedBody !== "object" || Array.isArray(resolvedBody) || typeof resolvedBody === "function" || React92__default.isValidElement(resolvedBody) || resolvedBody instanceof Date) {
|
|
50393
50764
|
return null;
|
|
50394
50765
|
}
|
|
50395
50766
|
const record = resolvedBody;
|
|
@@ -50408,7 +50779,7 @@ function makeLambdaFn(params, lambdaBody, callerKey) {
|
|
|
50408
50779
|
props: childProps,
|
|
50409
50780
|
priority: 0
|
|
50410
50781
|
};
|
|
50411
|
-
return
|
|
50782
|
+
return React92__default.createElement(SlotContentRenderer2, { content: childContent });
|
|
50412
50783
|
};
|
|
50413
50784
|
}
|
|
50414
50785
|
function convertNode(node, callerKey) {
|
|
@@ -50427,7 +50798,7 @@ function convertNode(node, callerKey) {
|
|
|
50427
50798
|
});
|
|
50428
50799
|
return anyChanged ? mapped : node;
|
|
50429
50800
|
}
|
|
50430
|
-
if (typeof node === "object" && !
|
|
50801
|
+
if (typeof node === "object" && !React92__default.isValidElement(node) && !(node instanceof Date)) {
|
|
50431
50802
|
return convertObjectProps(node);
|
|
50432
50803
|
}
|
|
50433
50804
|
return node;
|
|
@@ -51595,7 +51966,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
51595
51966
|
return;
|
|
51596
51967
|
}
|
|
51597
51968
|
crossTraitLog.debug("self:fire", { traitName, busKey: selfBusKey, eventKey });
|
|
51598
|
-
enqueueAndDrain(eventKey, event.payload);
|
|
51969
|
+
enqueueAndDrain(eventKey, event.payload, traitName);
|
|
51599
51970
|
});
|
|
51600
51971
|
unsubscribes.push(() => {
|
|
51601
51972
|
crossTraitLog.debug("self:unsubscribe", { traitName, busKey: selfBusKey, eventKey });
|
|
@@ -52342,8 +52713,8 @@ function CanvasDndProvider({
|
|
|
52342
52713
|
}) {
|
|
52343
52714
|
const eventBus = useEventBus();
|
|
52344
52715
|
const sensors = useAlmadarDndSensors(false);
|
|
52345
|
-
const [activePayload, setActivePayload] =
|
|
52346
|
-
const handleDragStart =
|
|
52716
|
+
const [activePayload, setActivePayload] = React92__default.useState(null);
|
|
52717
|
+
const handleDragStart = React92__default.useCallback((e) => {
|
|
52347
52718
|
const data = e.active.data.current;
|
|
52348
52719
|
const payload = data?.payload;
|
|
52349
52720
|
if (payload) {
|
|
@@ -52354,7 +52725,7 @@ function CanvasDndProvider({
|
|
|
52354
52725
|
log9.warn("dragStart:missing-payload", { id: e.active.id });
|
|
52355
52726
|
}
|
|
52356
52727
|
}, [eventBus]);
|
|
52357
|
-
const handleDragEnd =
|
|
52728
|
+
const handleDragEnd = React92__default.useCallback((e) => {
|
|
52358
52729
|
setActivePayload(null);
|
|
52359
52730
|
const activeData = e.active.data.current;
|
|
52360
52731
|
const payload = activeData?.payload;
|
|
@@ -52383,7 +52754,7 @@ function CanvasDndProvider({
|
|
|
52383
52754
|
const suppressed = onDrop ? onDrop(drop) === true : false;
|
|
52384
52755
|
if (!suppressed) defaultEmit(eventBus, drop);
|
|
52385
52756
|
}, [eventBus, onDrop]);
|
|
52386
|
-
const handleDragCancel =
|
|
52757
|
+
const handleDragCancel = React92__default.useCallback(() => {
|
|
52387
52758
|
setActivePayload(null);
|
|
52388
52759
|
log9.info("dragCancel");
|
|
52389
52760
|
}, []);
|
|
@@ -53141,7 +53512,7 @@ var OrbPreviewNodeInner = (props) => {
|
|
|
53141
53512
|
}
|
|
53142
53513
|
);
|
|
53143
53514
|
};
|
|
53144
|
-
var OrbPreviewNode =
|
|
53515
|
+
var OrbPreviewNode = React92__default.memo(OrbPreviewNodeInner);
|
|
53145
53516
|
OrbPreviewNode.displayName = "OrbPreviewNode";
|
|
53146
53517
|
orbPreviewLog.debug("export-resolved", () => ({
|
|
53147
53518
|
type: typeof OrbPreviewNode,
|
|
@@ -53246,7 +53617,7 @@ var EventFlowEdgeInner = (props) => {
|
|
|
53246
53617
|
) })
|
|
53247
53618
|
] });
|
|
53248
53619
|
};
|
|
53249
|
-
var EventFlowEdge =
|
|
53620
|
+
var EventFlowEdge = React92__default.memo(EventFlowEdgeInner);
|
|
53250
53621
|
EventFlowEdge.displayName = "EventFlowEdge";
|
|
53251
53622
|
|
|
53252
53623
|
// components/avl/molecules/BehaviorComposeNode.tsx
|
|
@@ -53393,7 +53764,7 @@ var BehaviorComposeNodeInner = (props) => {
|
|
|
53393
53764
|
}
|
|
53394
53765
|
);
|
|
53395
53766
|
};
|
|
53396
|
-
var BehaviorComposeNode =
|
|
53767
|
+
var BehaviorComposeNode = React92__default.memo(BehaviorComposeNodeInner);
|
|
53397
53768
|
BehaviorComposeNode.displayName = "BehaviorComposeNode";
|
|
53398
53769
|
|
|
53399
53770
|
// components/avl/lib/avl-behavior-compose-converter.ts
|
|
@@ -54419,7 +54790,7 @@ var TraitCardNodeInner = (props) => {
|
|
|
54419
54790
|
}
|
|
54420
54791
|
);
|
|
54421
54792
|
};
|
|
54422
|
-
var TraitCardNode =
|
|
54793
|
+
var TraitCardNode = React92__default.memo(TraitCardNodeInner);
|
|
54423
54794
|
TraitCardNode.displayName = "TraitCardNode";
|
|
54424
54795
|
|
|
54425
54796
|
// components/avl/organisms/FlowCanvas.tsx
|
|
@@ -54500,7 +54871,7 @@ function FlowCanvasInner({
|
|
|
54500
54871
|
initialOrbital
|
|
54501
54872
|
);
|
|
54502
54873
|
const [expandedBehaviorAlias, setExpandedBehaviorAlias] = useState(void 0);
|
|
54503
|
-
const screenSizeUserOverrideRef =
|
|
54874
|
+
const screenSizeUserOverrideRef = React92__default.useRef(false);
|
|
54504
54875
|
const [screenSize, setScreenSize] = useState(
|
|
54505
54876
|
() => typeof window === "undefined" ? "laptop" : detectScreenSize(window.innerWidth)
|
|
54506
54877
|
);
|
|
@@ -54884,7 +55255,7 @@ var ZoomBreadcrumb = ({
|
|
|
54884
55255
|
if (eventName && band === "detail") {
|
|
54885
55256
|
segments.push({ icon: "\u26A1", label: eventName });
|
|
54886
55257
|
}
|
|
54887
|
-
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(
|
|
55258
|
+
return /* @__PURE__ */ jsx("div", { className: "absolute top-2 left-2 z-10 flex items-center gap-1 px-2 py-1 rounded-md bg-card/90 border border-border text-xs text-muted-foreground backdrop-blur-sm", children: segments.map((seg, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
54888
55259
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-40", children: ">" }),
|
|
54889
55260
|
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: seg.icon }),
|
|
54890
55261
|
/* @__PURE__ */ jsx("span", { children: seg.label })
|
|
@@ -55225,7 +55596,7 @@ var EventWireOverlay = ({
|
|
|
55225
55596
|
containerW,
|
|
55226
55597
|
containerH
|
|
55227
55598
|
}) => {
|
|
55228
|
-
const ids =
|
|
55599
|
+
const ids = React92__default.useMemo(() => {
|
|
55229
55600
|
avlOczWireId += 1;
|
|
55230
55601
|
return { arrow: `avl-ocz-wire-${avlOczWireId}-arrow` };
|
|
55231
55602
|
}, []);
|
|
@@ -55592,7 +55963,7 @@ var AvlOrbitalsCosmicZoom = ({
|
|
|
55592
55963
|
borderRadius: 6,
|
|
55593
55964
|
border: `1px solid ${color}`
|
|
55594
55965
|
},
|
|
55595
|
-
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
55966
|
+
children: /* @__PURE__ */ jsx(HStack, { gap: "xs", align: "center", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React92__default.Fragment, { children: [
|
|
55596
55967
|
i > 0 && /* @__PURE__ */ jsx(Typography, { variant: "small", style: { opacity: 0.5, color }, children: "/" }),
|
|
55597
55968
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsx(
|
|
55598
55969
|
Box,
|