@almadar/ui 5.151.0 → 5.152.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/{UISlotContext-D8_SoDsD.d.cts → UISlotContext-BlRDbHDy.d.cts} +1 -1
- package/dist/{UISlotContext-C1FsU9GB.d.ts → UISlotContext-CB89mv7N.d.ts} +1 -1
- package/dist/avl/index.cjs +292 -71
- package/dist/avl/index.js +295 -74
- package/dist/components/index.cjs +293 -71
- package/dist/components/index.d.cts +77 -11
- package/dist/components/index.d.ts +77 -11
- package/dist/components/index.js +296 -75
- package/dist/context/index.d.cts +2 -2
- package/dist/context/index.d.ts +2 -2
- package/dist/hooks/index.d.cts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/lib/index.cjs +11 -2
- package/dist/lib/index.d.cts +8 -1
- package/dist/lib/index.d.ts +8 -1
- package/dist/lib/index.js +11 -3
- package/dist/providers/index.cjs +292 -71
- package/dist/providers/index.js +295 -74
- package/dist/runtime/index.cjs +292 -71
- package/dist/runtime/index.d.cts +2 -2
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.js +295 -74
- package/dist/{useUISlots-BesZYMks.d.cts → useUISlots-GNwGLlW2.d.cts} +1 -1
- package/dist/{useUISlots-BesZYMks.d.ts → useUISlots-GNwGLlW2.d.ts} +1 -1
- package/package.json +4 -4
package/dist/components/index.js
CHANGED
|
@@ -7,12 +7,12 @@ import { EventBusContext, useTraitScopeChain, useCurrentPagePath, useGameAudioCo
|
|
|
7
7
|
export { GameAudioContext, GameAudioProvider, useGameAudioContext } from '@almadar/ui/providers';
|
|
8
8
|
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
9
9
|
import * as LucideIcons2 from 'lucide-react';
|
|
10
|
-
import { X, List, Printer, ChevronRight, ChevronLeft, Check, Copy, RotateCcw, Play, Terminal, CheckCircle, XCircle, ChevronDown, Search, ChevronUp, MoreHorizontal, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Loader2, Code, FileText, WrapText, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, ArrowRight, Trash,
|
|
10
|
+
import { X, List, Printer, ChevronRight, ChevronLeft, Check, Copy, RotateCcw, Play, Terminal, CheckCircle, XCircle, ChevronDown, Search, ChevronUp, MoreHorizontal, ArrowLeft, DollarSign, Package, Calendar, Pencil, Eye, Image as Image$1, Upload, ZoomIn, TrendingUp, TrendingDown, Minus, AlertCircle, Circle, Clock, CheckCircle2, Loader2, Code, FileText, WrapText, HelpCircle, Type, Heading1, Heading2, Heading3, ListOrdered, Quote, GitBranch, Plus, ArrowRight, Trash, Menu as Menu$1, AlertTriangle, Trash2, Eraser, ZoomOut, Download, Lightbulb, PauseCircle, Link2, Tag, User } from 'lucide-react';
|
|
11
11
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
12
12
|
import { useUISlots, useTheme } from '@almadar/ui/context';
|
|
13
13
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
14
14
|
import { createContextFromBindings, interpolateValue } from '@almadar/runtime';
|
|
15
|
-
import { mergeEntityFrame, isInlineTrait, isRenderBindingMarker, ANIMATION_NAMES } from '@almadar/core';
|
|
15
|
+
import { mergeEntityFrame, isFileValue, isInlineTrait, isRenderBindingMarker, ANIMATION_NAMES } from '@almadar/core';
|
|
16
16
|
import { createPortal } from 'react-dom';
|
|
17
17
|
import { wrapCallbackForEvent } from '@almadar/runtime/ui';
|
|
18
18
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
@@ -76,7 +76,7 @@ import { CSS } from '@dnd-kit/utilities';
|
|
|
76
76
|
import { ordered, lib } from 'emojilib';
|
|
77
77
|
import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
|
|
78
78
|
import { forceSimulation, forceLink, forceManyBody, forceCollide, forceX, forceY } from 'd3-force';
|
|
79
|
-
import { isDrawHostPattern, getPatternDefinition as getPatternDefinition$1, getComponentForPattern as getComponentForPattern$1 } from '@almadar/core/patterns';
|
|
79
|
+
import { isDrawHostPattern, getPatternDefinition as getPatternDefinition$1, getPatternFieldsContract, getComponentForPattern as getComponentForPattern$1 } from '@almadar/core/patterns';
|
|
80
80
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
81
81
|
|
|
82
82
|
var __defProp = Object.defineProperty;
|
|
@@ -9139,7 +9139,7 @@ var init_AlgoGraphCanvas = __esm({
|
|
|
9139
9139
|
}
|
|
9140
9140
|
const badgeGeoms = [];
|
|
9141
9141
|
for (const g of nodeGeoms) {
|
|
9142
|
-
if (!g.badge) continue;
|
|
9142
|
+
if (!g.badge || g.badge.text === "") continue;
|
|
9143
9143
|
const w = Math.min(42, Math.max(18, g.badge.text.length * 6 + 10));
|
|
9144
9144
|
badgeGeoms.push({
|
|
9145
9145
|
cx: g.x + g.radius * 0.75,
|
|
@@ -9205,7 +9205,7 @@ var init_AlgoGraphCanvas = __esm({
|
|
|
9205
9205
|
};
|
|
9206
9206
|
}
|
|
9207
9207
|
});
|
|
9208
|
-
var DEFAULT_BAR_COLOR, DEFAULT_CELL_COLOR, DEFAULT_POINTER_COLOR, POINTER_BAND, TOP_PAD, PANEL_FAMILY_ORDER, RANGE_COLOR_DEFAULT, RANGE_FILL_OPACITY, BRACKET_TOP_OFFSET, BRACKET_ROW_H, BRACKET_TICK_H, BRACKET_LABEL_OFFSET, SLOT_EMPTY_FILL, SLOT_EMPTY_STROKE, SLOT_FILLED_STROKE, SLOT_HIGHLIGHT_DEFAULT, SLOT_VALUE_TEXT_COLOR, FRAME_ACTIVE_COLOR, FRAME_RETURNING_COLOR, FRAME_DONE_COLOR, FRAME_LABEL_COLOR, FRAME_DETAIL_COLOR, FRAME_TWO_LINE_MIN_H, BUCKET_INDEX_FILL, BUCKET_INDEX_STROKE, BUCKET_INDEX_TEXT, BUCKET_ENTRY_TEXT, BUCKET_ENTRY_DEFAULT, BUCKET_ENTRY_HIGHLIGHT, BUCKET_ENTRY_PROBING, BUCKET_ENTRY_MIN_W, BUCKET_ENTRY_MAX_W, AXIS_LABEL_COLOR, AXIS_LABEL_FONT_SIZE, CORNER_TEXT_COLOR, CORNER_FONT_SIZE, CORNER_MIN_CELL, CORNER_INSET_X, CORNER_INSET_Y, AUX_PRIMARY_RATIO, AUX_LABEL_BAND, AUX_BASELINE_PAD, AlgorithmCanvas;
|
|
9208
|
+
var DEFAULT_BAR_COLOR, DEFAULT_CELL_COLOR, DEFAULT_POINTER_COLOR, POINTER_BAND, TOP_PAD, PANEL_FAMILY_ORDER, RANGE_COLOR_DEFAULT, RANGE_FILL_OPACITY, BRACKET_TOP_OFFSET, BRACKET_ROW_H, BRACKET_TICK_H, BRACKET_LABEL_OFFSET, SLOT_EMPTY_FILL, SLOT_EMPTY_STROKE, SLOT_FILLED_STROKE, SLOT_HIGHLIGHT_DEFAULT, SLOT_VALUE_TEXT_COLOR, FRAME_ACTIVE_COLOR, FRAME_RETURNING_COLOR, FRAME_DONE_COLOR, FRAME_RIM_COLOR, FRAME_LABEL_COLOR, FRAME_DETAIL_COLOR, FRAME_TWO_LINE_MIN_H, FRAME_STRIP_H, FRAME_GAP, FRAME_BOTTOM_PAD, FRAME_MIN_H, BUCKET_INDEX_FILL, BUCKET_INDEX_STROKE, BUCKET_INDEX_TEXT, BUCKET_ENTRY_TEXT, BUCKET_ENTRY_DEFAULT, BUCKET_ENTRY_HIGHLIGHT, BUCKET_ENTRY_PROBING, BUCKET_ENTRY_MIN_W, BUCKET_ENTRY_MAX_W, AXIS_LABEL_COLOR, AXIS_LABEL_FONT_SIZE, CORNER_TEXT_COLOR, CORNER_FONT_SIZE, CORNER_MIN_CELL, CORNER_INSET_X, CORNER_INSET_Y, AUX_PRIMARY_RATIO, AUX_LABEL_BAND, AUX_BASELINE_PAD, AlgorithmCanvas;
|
|
9209
9209
|
var init_AlgorithmCanvas = __esm({
|
|
9210
9210
|
"components/learning/molecules/AlgorithmCanvas.tsx"() {
|
|
9211
9211
|
"use client";
|
|
@@ -9232,9 +9232,18 @@ var init_AlgorithmCanvas = __esm({
|
|
|
9232
9232
|
FRAME_ACTIVE_COLOR = "#3b82f6";
|
|
9233
9233
|
FRAME_RETURNING_COLOR = "#f59e0b";
|
|
9234
9234
|
FRAME_DONE_COLOR = "#94a3b8";
|
|
9235
|
+
FRAME_RIM_COLOR = {
|
|
9236
|
+
active: "#1d4ed8",
|
|
9237
|
+
returning: "#b45309",
|
|
9238
|
+
done: "#64748b"
|
|
9239
|
+
};
|
|
9235
9240
|
FRAME_LABEL_COLOR = "#ffffff";
|
|
9236
9241
|
FRAME_DETAIL_COLOR = "#e2e8f0";
|
|
9237
9242
|
FRAME_TWO_LINE_MIN_H = 22;
|
|
9243
|
+
FRAME_STRIP_H = 44;
|
|
9244
|
+
FRAME_GAP = 6;
|
|
9245
|
+
FRAME_BOTTOM_PAD = 8;
|
|
9246
|
+
FRAME_MIN_H = 12;
|
|
9238
9247
|
BUCKET_INDEX_FILL = "#e2e8f0";
|
|
9239
9248
|
BUCKET_INDEX_STROKE = "#9ca3af";
|
|
9240
9249
|
BUCKET_INDEX_TEXT = "#374151";
|
|
@@ -9731,14 +9740,18 @@ var init_AlgorithmCanvas = __esm({
|
|
|
9731
9740
|
if (frames.length > 0) {
|
|
9732
9741
|
const panelYFrames = panelY.frames;
|
|
9733
9742
|
const n = frames.length;
|
|
9734
|
-
const
|
|
9743
|
+
const maxStride = (panelHeight - FRAME_BOTTOM_PAD - TOP_PAD) / n;
|
|
9744
|
+
const stride = Math.min(FRAME_STRIP_H + FRAME_GAP, maxStride);
|
|
9745
|
+
const frameH = Math.max(FRAME_MIN_H, stride - FRAME_GAP);
|
|
9735
9746
|
const x = 8;
|
|
9736
9747
|
const w = width - 16;
|
|
9748
|
+
const bottom = panelYFrames + panelHeight - FRAME_BOTTOM_PAD;
|
|
9737
9749
|
frames.forEach((f3, i) => {
|
|
9738
|
-
const y =
|
|
9750
|
+
const y = bottom - i * stride - frameH;
|
|
9739
9751
|
const state = f3.state ?? "active";
|
|
9740
9752
|
const fill = state === "returning" ? f3.color ?? FRAME_RETURNING_COLOR : state === "done" ? f3.color ?? FRAME_DONE_COLOR : f3.color ?? FRAME_ACTIVE_COLOR;
|
|
9741
|
-
|
|
9753
|
+
const rim = f3.color ?? FRAME_RIM_COLOR[state] ?? FRAME_RIM_COLOR.active;
|
|
9754
|
+
out.push({ type: "rect", id: `frame-${i}`, x, y, width: w, height: frameH, color: rim, fill });
|
|
9742
9755
|
if (frameH >= FRAME_TWO_LINE_MIN_H) {
|
|
9743
9756
|
out.push({
|
|
9744
9757
|
type: "text",
|
|
@@ -9746,14 +9759,14 @@ var init_AlgorithmCanvas = __esm({
|
|
|
9746
9759
|
y: y + frameH * 0.35,
|
|
9747
9760
|
text: f3.label,
|
|
9748
9761
|
color: FRAME_LABEL_COLOR,
|
|
9749
|
-
fontSize:
|
|
9762
|
+
fontSize: 11,
|
|
9750
9763
|
align: "left"
|
|
9751
9764
|
});
|
|
9752
9765
|
if (f3.detail) {
|
|
9753
9766
|
out.push({
|
|
9754
9767
|
type: "text",
|
|
9755
9768
|
x: 16,
|
|
9756
|
-
y: y + frameH * 0.
|
|
9769
|
+
y: y + frameH * 0.72,
|
|
9757
9770
|
text: f3.detail,
|
|
9758
9771
|
color: FRAME_DETAIL_COLOR,
|
|
9759
9772
|
fontSize: 10,
|
|
@@ -16269,8 +16282,6 @@ var init_ButtonGroup = __esm({
|
|
|
16269
16282
|
ButtonGroup.displayName = "ButtonGroup";
|
|
16270
16283
|
}
|
|
16271
16284
|
});
|
|
16272
|
-
|
|
16273
|
-
// lib/getNestedValue.ts
|
|
16274
16285
|
function getNestedValue(obj, path) {
|
|
16275
16286
|
if (obj === null || obj === void 0 || !path) {
|
|
16276
16287
|
return void 0;
|
|
@@ -16291,6 +16302,15 @@ function getNestedValue(obj, path) {
|
|
|
16291
16302
|
}
|
|
16292
16303
|
return value;
|
|
16293
16304
|
}
|
|
16305
|
+
function resolveImageUrl(value) {
|
|
16306
|
+
if (typeof value === "string") {
|
|
16307
|
+
return value;
|
|
16308
|
+
}
|
|
16309
|
+
if (isFileValue(value)) {
|
|
16310
|
+
return value.url;
|
|
16311
|
+
}
|
|
16312
|
+
return void 0;
|
|
16313
|
+
}
|
|
16294
16314
|
var init_getNestedValue = __esm({
|
|
16295
16315
|
"lib/getNestedValue.ts"() {
|
|
16296
16316
|
}
|
|
@@ -19333,8 +19353,8 @@ var init_CardGrid = __esm({
|
|
|
19333
19353
|
actionPayload: { row: itemData },
|
|
19334
19354
|
children: [
|
|
19335
19355
|
imageField && (() => {
|
|
19336
|
-
const imgUrl = getNestedValue(itemData, imageField);
|
|
19337
|
-
if (!imgUrl
|
|
19356
|
+
const imgUrl = resolveImageUrl(getNestedValue(itemData, imageField));
|
|
19357
|
+
if (!imgUrl) return null;
|
|
19338
19358
|
return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
|
|
19339
19359
|
"img",
|
|
19340
19360
|
{
|
|
@@ -23737,8 +23757,8 @@ function DataGrid({
|
|
|
23737
23757
|
),
|
|
23738
23758
|
children: [
|
|
23739
23759
|
imageField && (() => {
|
|
23740
|
-
const imgUrl = getNestedValue(itemData, imageField);
|
|
23741
|
-
if (!imgUrl
|
|
23760
|
+
const imgUrl = resolveImageUrl(getNestedValue(itemData, imageField));
|
|
23761
|
+
if (!imgUrl) return null;
|
|
23742
23762
|
return /* @__PURE__ */ jsx(Box, { className: "w-full aspect-video overflow-hidden rounded-t-lg", children: /* @__PURE__ */ jsx(
|
|
23743
23763
|
"img",
|
|
23744
23764
|
{
|
|
@@ -27264,7 +27284,7 @@ var init_SearchInput = __esm({
|
|
|
27264
27284
|
/* @__PURE__ */ jsx(
|
|
27265
27285
|
Input,
|
|
27266
27286
|
{
|
|
27267
|
-
type: "
|
|
27287
|
+
type: "search",
|
|
27268
27288
|
value: searchValue,
|
|
27269
27289
|
onChange: handleChange,
|
|
27270
27290
|
placeholder: resolvedPlaceholder,
|
|
@@ -31024,6 +31044,7 @@ var MathCanvas;
|
|
|
31024
31044
|
var init_MathCanvas = __esm({
|
|
31025
31045
|
"components/learning/molecules/MathCanvas.tsx"() {
|
|
31026
31046
|
"use client";
|
|
31047
|
+
init_useEventBus();
|
|
31027
31048
|
init_atoms();
|
|
31028
31049
|
init_Stack();
|
|
31029
31050
|
init_LearningCanvas();
|
|
@@ -31055,9 +31076,32 @@ var init_MathCanvas = __esm({
|
|
|
31055
31076
|
interactive = false,
|
|
31056
31077
|
animate = false,
|
|
31057
31078
|
onShapeClick,
|
|
31079
|
+
keyMap,
|
|
31080
|
+
keyUpMap,
|
|
31058
31081
|
isLoading,
|
|
31059
31082
|
error
|
|
31060
31083
|
}) => {
|
|
31084
|
+
const eventBus = useEventBus();
|
|
31085
|
+
useEffect(() => {
|
|
31086
|
+
if (!keyMap && !keyUpMap) return;
|
|
31087
|
+
const onDown = (e) => {
|
|
31088
|
+
const ev = keyMap?.[e.code];
|
|
31089
|
+
if (ev) {
|
|
31090
|
+
eventBus.emit(`UI:${ev}`, {});
|
|
31091
|
+
e.preventDefault();
|
|
31092
|
+
}
|
|
31093
|
+
};
|
|
31094
|
+
const onUp = (e) => {
|
|
31095
|
+
const ev = keyUpMap?.[e.code];
|
|
31096
|
+
if (ev) eventBus.emit(`UI:${ev}`, {});
|
|
31097
|
+
};
|
|
31098
|
+
window.addEventListener("keydown", onDown);
|
|
31099
|
+
window.addEventListener("keyup", onUp);
|
|
31100
|
+
return () => {
|
|
31101
|
+
window.removeEventListener("keydown", onDown);
|
|
31102
|
+
window.removeEventListener("keyup", onUp);
|
|
31103
|
+
};
|
|
31104
|
+
}, [keyMap, keyUpMap, eventBus]);
|
|
31061
31105
|
const derivedShapes = useMemo(() => {
|
|
31062
31106
|
const out = [];
|
|
31063
31107
|
const margin = 24;
|
|
@@ -31070,11 +31114,11 @@ var init_MathCanvas = __esm({
|
|
|
31070
31114
|
if (showGrid) {
|
|
31071
31115
|
for (let x = Math.ceil(xMin / gridStep) * gridStep; x <= xMax; x += gridStep) {
|
|
31072
31116
|
const px = mapX(x);
|
|
31073
|
-
out.push({ type: "line", x1: px, y1: margin, x2: px, y2: height - margin, color: "#
|
|
31117
|
+
out.push({ type: "line", x1: px, y1: margin, x2: px, y2: height - margin, color: "#9ca3af", opacity: 0.35, lineWidth: 1 });
|
|
31074
31118
|
}
|
|
31075
31119
|
for (let y = Math.ceil(yMin / gridStep) * gridStep; y <= yMax; y += gridStep) {
|
|
31076
31120
|
const py = mapY(y);
|
|
31077
|
-
out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color: "#
|
|
31121
|
+
out.push({ type: "line", x1: margin, y1: py, x2: width - margin, y2: py, color: "#9ca3af", opacity: 0.35, lineWidth: 1 });
|
|
31078
31122
|
}
|
|
31079
31123
|
}
|
|
31080
31124
|
if (showTickLabels) {
|
|
@@ -32549,13 +32593,13 @@ var init_MapView = __esm({
|
|
|
32549
32593
|
shadowSize: [41, 41]
|
|
32550
32594
|
});
|
|
32551
32595
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
32552
|
-
const { useEffect:
|
|
32596
|
+
const { useEffect: useEffect67, useRef: useRef65, useCallback: useCallback108, useState: useState104 } = React77__default;
|
|
32553
32597
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
32554
32598
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
32555
32599
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
32556
32600
|
const map = useMap();
|
|
32557
32601
|
const prevRef = useRef65({ centerLat, centerLng, zoom });
|
|
32558
|
-
|
|
32602
|
+
useEffect67(() => {
|
|
32559
32603
|
const prev = prevRef.current;
|
|
32560
32604
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
32561
32605
|
map.setView([centerLat, centerLng], zoom);
|
|
@@ -32566,7 +32610,7 @@ var init_MapView = __esm({
|
|
|
32566
32610
|
}
|
|
32567
32611
|
function MapClickHandler({ onMapClick }) {
|
|
32568
32612
|
const map = useMap();
|
|
32569
|
-
|
|
32613
|
+
useEffect67(() => {
|
|
32570
32614
|
if (!onMapClick) return;
|
|
32571
32615
|
const handler = (e) => {
|
|
32572
32616
|
onMapClick(e.latlng.lat, e.latlng.lng);
|
|
@@ -39382,6 +39426,7 @@ var init_PageHeader = __esm({
|
|
|
39382
39426
|
className
|
|
39383
39427
|
}) => {
|
|
39384
39428
|
const eventBus = useEventBus();
|
|
39429
|
+
const statusBadge = typeof status === "string" ? status ? { label: status } : void 0 : status;
|
|
39385
39430
|
const handleBack = () => {
|
|
39386
39431
|
eventBus.emit(`UI:${backEvent}`);
|
|
39387
39432
|
};
|
|
@@ -39429,15 +39474,15 @@ var init_PageHeader = __esm({
|
|
|
39429
39474
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
39430
39475
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-3", children: [
|
|
39431
39476
|
/* @__PURE__ */ jsx(Typography, { variant: "h1", className: "text-2xl font-bold text-foreground", children: title != null ? String(title) : "" }),
|
|
39432
|
-
|
|
39477
|
+
statusBadge && /* @__PURE__ */ jsx(
|
|
39433
39478
|
Typography,
|
|
39434
39479
|
{
|
|
39435
39480
|
variant: "small",
|
|
39436
39481
|
className: cn(
|
|
39437
39482
|
"px-2.5 py-1 rounded-full text-xs font-medium",
|
|
39438
|
-
statusColors2[
|
|
39483
|
+
statusColors2[statusBadge.variant || "default"]
|
|
39439
39484
|
),
|
|
39440
|
-
children:
|
|
39485
|
+
children: statusBadge.label
|
|
39441
39486
|
}
|
|
39442
39487
|
)
|
|
39443
39488
|
] }),
|
|
@@ -42890,7 +42935,7 @@ function formatFieldValue2(value, fieldName) {
|
|
|
42890
42935
|
}
|
|
42891
42936
|
return String(value);
|
|
42892
42937
|
}
|
|
42893
|
-
function renderRichFieldValue(value, fieldName, fieldType) {
|
|
42938
|
+
function renderRichFieldValue(value, fieldName, fieldType, meta) {
|
|
42894
42939
|
if (value === void 0 || value === null) return "\u2014";
|
|
42895
42940
|
const str2 = String(value);
|
|
42896
42941
|
switch (fieldType) {
|
|
@@ -42957,19 +43002,58 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
42957
43002
|
}
|
|
42958
43003
|
);
|
|
42959
43004
|
case "date":
|
|
42960
|
-
case "datetime":
|
|
43005
|
+
case "datetime":
|
|
43006
|
+
case "timestamp": {
|
|
42961
43007
|
const d = new Date(str2);
|
|
42962
43008
|
if (!isNaN(d.getTime())) {
|
|
42963
43009
|
return d.toLocaleDateString(void 0, {
|
|
42964
43010
|
year: "numeric",
|
|
42965
43011
|
month: "long",
|
|
42966
43012
|
day: "numeric",
|
|
42967
|
-
...fieldType
|
|
43013
|
+
...fieldType !== "date" ? { hour: "2-digit", minute: "2-digit" } : {}
|
|
42968
43014
|
});
|
|
42969
43015
|
}
|
|
42970
43016
|
return str2;
|
|
42971
43017
|
}
|
|
43018
|
+
case "money": {
|
|
43019
|
+
const n = typeof value === "number" ? value : Number(str2);
|
|
43020
|
+
if (!isNaN(n)) {
|
|
43021
|
+
return new Intl.NumberFormat(void 0, {
|
|
43022
|
+
style: "currency",
|
|
43023
|
+
currency: "USD"
|
|
43024
|
+
}).format(n);
|
|
43025
|
+
}
|
|
43026
|
+
return str2;
|
|
43027
|
+
}
|
|
43028
|
+
case "relation": {
|
|
43029
|
+
const match = meta?.options?.find((opt) => opt.value === str2);
|
|
43030
|
+
return match ? match.label : str2;
|
|
43031
|
+
}
|
|
43032
|
+
case "file": {
|
|
43033
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
43034
|
+
const file = value;
|
|
43035
|
+
const label = typeof file.name === "string" && file.name ? file.name : "file";
|
|
43036
|
+
const size = typeof file.sizeBytes === "number" ? ` \xB7 ${formatFileSize(file.sizeBytes)}` : "";
|
|
43037
|
+
return /* @__PURE__ */ jsxs(
|
|
43038
|
+
"a",
|
|
43039
|
+
{
|
|
43040
|
+
href: typeof file.url === "string" ? file.url : void 0,
|
|
43041
|
+
download: label,
|
|
43042
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1 text-sm text-foreground no-underline hover:bg-accent",
|
|
43043
|
+
children: [
|
|
43044
|
+
/* @__PURE__ */ jsx(Icon, { icon: FileText, size: "sm", className: "text-muted-foreground" }),
|
|
43045
|
+
label,
|
|
43046
|
+
size && /* @__PURE__ */ jsx(Typography, { as: "span", variant: "caption", color: "muted", children: size })
|
|
43047
|
+
]
|
|
43048
|
+
}
|
|
43049
|
+
);
|
|
43050
|
+
}
|
|
43051
|
+
return str2;
|
|
43052
|
+
}
|
|
42972
43053
|
default:
|
|
43054
|
+
if (meta?.values && meta.values.length > 0 && meta.values.includes(str2)) {
|
|
43055
|
+
return /* @__PURE__ */ jsx(Badge, { variant: getBadgeVariant(fieldName, str2), children: humanizeEnumValue(str2) });
|
|
43056
|
+
}
|
|
42973
43057
|
return formatFieldValue2(value, fieldName);
|
|
42974
43058
|
}
|
|
42975
43059
|
}
|
|
@@ -42996,8 +43080,18 @@ function buildFieldTypeMap(fields) {
|
|
|
42996
43080
|
const map = {};
|
|
42997
43081
|
if (!fields) return map;
|
|
42998
43082
|
for (const f3 of fields) {
|
|
42999
|
-
if (typeof f3 === "object" &&
|
|
43000
|
-
map[f3.name] = f3.type;
|
|
43083
|
+
if (typeof f3 === "object" && f3.type !== void 0) {
|
|
43084
|
+
map["name" in f3 ? f3.name : f3.key] = f3.type;
|
|
43085
|
+
}
|
|
43086
|
+
}
|
|
43087
|
+
return map;
|
|
43088
|
+
}
|
|
43089
|
+
function buildFieldMetaMap(fields) {
|
|
43090
|
+
const map = {};
|
|
43091
|
+
if (!fields) return map;
|
|
43092
|
+
for (const f3 of fields) {
|
|
43093
|
+
if (typeof f3 === "object" && (f3.type !== void 0 || f3.values !== void 0 || f3.relation !== void 0)) {
|
|
43094
|
+
map["name" in f3 ? f3.name : f3.key] = { type: f3.type, values: f3.values, relation: f3.relation };
|
|
43001
43095
|
}
|
|
43002
43096
|
}
|
|
43003
43097
|
return map;
|
|
@@ -43017,6 +43111,7 @@ var init_DetailPanel = __esm({
|
|
|
43017
43111
|
init_format();
|
|
43018
43112
|
init_getNestedValue();
|
|
43019
43113
|
init_useEventBus();
|
|
43114
|
+
init_UploadDropZone();
|
|
43020
43115
|
formatFieldLabel = humanizeFieldName;
|
|
43021
43116
|
ReactMarkdown2 = lazy(() => import('react-markdown'));
|
|
43022
43117
|
DetailPanel = ({
|
|
@@ -43026,6 +43121,7 @@ var init_DetailPanel = __esm({
|
|
|
43026
43121
|
avatar,
|
|
43027
43122
|
sections: propSections,
|
|
43028
43123
|
actions,
|
|
43124
|
+
backAction,
|
|
43029
43125
|
footer,
|
|
43030
43126
|
slideOver = false,
|
|
43031
43127
|
className,
|
|
@@ -43034,7 +43130,8 @@ var init_DetailPanel = __esm({
|
|
|
43034
43130
|
fieldNames,
|
|
43035
43131
|
initialData,
|
|
43036
43132
|
isLoading = false,
|
|
43037
|
-
error
|
|
43133
|
+
error,
|
|
43134
|
+
relationsData
|
|
43038
43135
|
}) => {
|
|
43039
43136
|
const eventBus = useEventBus();
|
|
43040
43137
|
const { t } = useTranslate();
|
|
@@ -43045,8 +43142,15 @@ var init_DetailPanel = __esm({
|
|
|
43045
43142
|
};
|
|
43046
43143
|
const effectiveFieldNames = isFieldDefArray(propFields) ? normalizeFieldDefs(propFields) : fieldNames;
|
|
43047
43144
|
const fieldTypeMap = isFieldDefArray(propFields) ? buildFieldTypeMap(propFields) : {};
|
|
43145
|
+
const fieldMetaMap = isFieldDefArray(propFields) ? buildFieldMetaMap(propFields) : {};
|
|
43048
43146
|
const fieldLabelMap = isFieldDefArray(propFields) ? buildFieldLabelMap(propFields) : {};
|
|
43049
43147
|
const labelFor = (field) => fieldLabelMap[field] ?? formatFieldLabel(field);
|
|
43148
|
+
const metaFor = (field) => {
|
|
43149
|
+
const base = fieldMetaMap[field];
|
|
43150
|
+
const options = relationsData?.[field];
|
|
43151
|
+
if (!base && !options) return void 0;
|
|
43152
|
+
return { ...base, options };
|
|
43153
|
+
};
|
|
43050
43154
|
const handleActionClick = useCallback(
|
|
43051
43155
|
(action, data2) => {
|
|
43052
43156
|
if (action.navigatesTo) {
|
|
@@ -43125,7 +43229,7 @@ var init_DetailPanel = __esm({
|
|
|
43125
43229
|
if (value !== void 0 && value !== null) {
|
|
43126
43230
|
overviewFields.push({
|
|
43127
43231
|
label: labelFor(field),
|
|
43128
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
43232
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field)),
|
|
43129
43233
|
icon: getFieldIcon(field)
|
|
43130
43234
|
});
|
|
43131
43235
|
}
|
|
@@ -43141,7 +43245,7 @@ var init_DetailPanel = __esm({
|
|
|
43141
43245
|
if (value !== void 0 && value !== null) {
|
|
43142
43246
|
metricsFields.push({
|
|
43143
43247
|
label: labelFor(field),
|
|
43144
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
43248
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field)),
|
|
43145
43249
|
icon: getFieldIcon(field)
|
|
43146
43250
|
});
|
|
43147
43251
|
}
|
|
@@ -43157,7 +43261,7 @@ var init_DetailPanel = __esm({
|
|
|
43157
43261
|
if (value !== void 0 && value !== null) {
|
|
43158
43262
|
timelineFields.push({
|
|
43159
43263
|
label: labelFor(field),
|
|
43160
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
43264
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field)),
|
|
43161
43265
|
icon: getFieldIcon(field)
|
|
43162
43266
|
});
|
|
43163
43267
|
}
|
|
@@ -43173,7 +43277,7 @@ var init_DetailPanel = __esm({
|
|
|
43173
43277
|
if (value !== void 0 && value !== null) {
|
|
43174
43278
|
descFields.push({
|
|
43175
43279
|
label: labelFor(field),
|
|
43176
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
43280
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field)),
|
|
43177
43281
|
icon: getFieldIcon(field)
|
|
43178
43282
|
});
|
|
43179
43283
|
}
|
|
@@ -43221,7 +43325,7 @@ var init_DetailPanel = __esm({
|
|
|
43221
43325
|
const value = normalizedData ? getNestedValue(normalizedData, field) : void 0;
|
|
43222
43326
|
allFields.push({
|
|
43223
43327
|
label: labelFor(field),
|
|
43224
|
-
value: renderRichFieldValue(value, field, fieldTypeMap[field]),
|
|
43328
|
+
value: renderRichFieldValue(value, field, fieldTypeMap[field], metaFor(field)),
|
|
43225
43329
|
icon: getFieldIcon(field)
|
|
43226
43330
|
});
|
|
43227
43331
|
} else {
|
|
@@ -43236,34 +43340,49 @@ var init_DetailPanel = __esm({
|
|
|
43236
43340
|
const otherActions = actions?.filter((a) => a !== closeAction) ?? [];
|
|
43237
43341
|
const effectiveCloseAction = closeAction ?? { event: void 0};
|
|
43238
43342
|
const content = /* @__PURE__ */ jsx(Card, { variant: "elevated", children: /* @__PURE__ */ jsxs(VStack, { gap: "md", className: "p-6", children: [
|
|
43239
|
-
/* @__PURE__ */ jsxs(HStack, { justify: "
|
|
43240
|
-
|
|
43241
|
-
Button,
|
|
43242
|
-
{
|
|
43243
|
-
variant: action.variant || "secondary",
|
|
43244
|
-
size: "sm",
|
|
43245
|
-
action: action.navigatesTo ? void 0 : action.event,
|
|
43246
|
-
actionPayload: { row: normalizedData },
|
|
43247
|
-
onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
|
|
43248
|
-
icon: action.icon,
|
|
43249
|
-
"data-testid": action.event ? `action-${action.event}` : void 0,
|
|
43250
|
-
"data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
|
|
43251
|
-
children: action.label
|
|
43252
|
-
},
|
|
43253
|
-
idx
|
|
43254
|
-
)),
|
|
43255
|
-
/* @__PURE__ */ jsx(
|
|
43343
|
+
/* @__PURE__ */ jsxs(HStack, { justify: "between", align: "center", gap: "xs", children: [
|
|
43344
|
+
/* @__PURE__ */ jsx(HStack, { align: "center", gap: "xs", children: backAction && /* @__PURE__ */ jsx(
|
|
43256
43345
|
Button,
|
|
43257
43346
|
{
|
|
43258
|
-
variant: "ghost",
|
|
43347
|
+
variant: backAction.variant || "ghost",
|
|
43259
43348
|
size: "sm",
|
|
43260
|
-
action:
|
|
43349
|
+
action: backAction.navigatesTo ? void 0 : backAction.event,
|
|
43261
43350
|
actionPayload: { row: normalizedData },
|
|
43262
|
-
onClick:
|
|
43263
|
-
icon:
|
|
43264
|
-
"data-testid":
|
|
43351
|
+
onClick: backAction.navigatesTo ? () => handleActionClick(backAction, normalizedData) : void 0,
|
|
43352
|
+
icon: backAction.icon ?? ArrowLeft,
|
|
43353
|
+
"data-testid": backAction.event ? `action-${backAction.event}` : "action-back",
|
|
43354
|
+
children: backAction.label
|
|
43265
43355
|
}
|
|
43266
|
-
)
|
|
43356
|
+
) }),
|
|
43357
|
+
/* @__PURE__ */ jsxs(HStack, { justify: "end", align: "center", gap: "xs", children: [
|
|
43358
|
+
otherActions.map((action, idx) => /* @__PURE__ */ jsx(
|
|
43359
|
+
Button,
|
|
43360
|
+
{
|
|
43361
|
+
variant: action.variant || "secondary",
|
|
43362
|
+
size: "sm",
|
|
43363
|
+
action: action.navigatesTo ? void 0 : action.event,
|
|
43364
|
+
actionPayload: { row: normalizedData },
|
|
43365
|
+
onClick: action.navigatesTo ? () => handleActionClick(action, normalizedData) : void 0,
|
|
43366
|
+
icon: action.icon,
|
|
43367
|
+
"data-testid": action.event ? `action-${action.event}` : void 0,
|
|
43368
|
+
"data-row-id": normalizedData?.id !== void 0 ? String(normalizedData.id) : void 0,
|
|
43369
|
+
children: action.label
|
|
43370
|
+
},
|
|
43371
|
+
idx
|
|
43372
|
+
)),
|
|
43373
|
+
/* @__PURE__ */ jsx(
|
|
43374
|
+
Button,
|
|
43375
|
+
{
|
|
43376
|
+
variant: "ghost",
|
|
43377
|
+
size: "sm",
|
|
43378
|
+
action: effectiveCloseAction.event,
|
|
43379
|
+
actionPayload: { row: normalizedData },
|
|
43380
|
+
onClick: effectiveCloseAction.event ? void 0 : handleClose,
|
|
43381
|
+
icon: X,
|
|
43382
|
+
"data-testid": effectiveCloseAction.event ? `action-${effectiveCloseAction.event}` : "action-close"
|
|
43383
|
+
}
|
|
43384
|
+
)
|
|
43385
|
+
] })
|
|
43267
43386
|
] }),
|
|
43268
43387
|
avatar,
|
|
43269
43388
|
/* @__PURE__ */ jsx(Typography, { variant: "h2", weight: "bold", children: title || "Details" }),
|
|
@@ -43578,6 +43697,10 @@ function determineInputType(field) {
|
|
|
43578
43697
|
return "password";
|
|
43579
43698
|
case "url":
|
|
43580
43699
|
return "url";
|
|
43700
|
+
case "file":
|
|
43701
|
+
return "file";
|
|
43702
|
+
case "money":
|
|
43703
|
+
return "currency";
|
|
43581
43704
|
case "number":
|
|
43582
43705
|
case "integer":
|
|
43583
43706
|
case "float":
|
|
@@ -43639,6 +43762,7 @@ var init_Form = __esm({
|
|
|
43639
43762
|
init_Typography();
|
|
43640
43763
|
init_Icon();
|
|
43641
43764
|
init_RelationSelect();
|
|
43765
|
+
init_UploadDropZone();
|
|
43642
43766
|
init_Alert();
|
|
43643
43767
|
init_useEventBus();
|
|
43644
43768
|
init_debug();
|
|
@@ -43681,6 +43805,7 @@ var init_Form = __esm({
|
|
|
43681
43805
|
cancelEvent = "CANCEL",
|
|
43682
43806
|
relationsData = {},
|
|
43683
43807
|
relationsLoading = {},
|
|
43808
|
+
fieldOverrides,
|
|
43684
43809
|
// Inspection form extensions - may come as boolean true from generated code (meaning enabled but config loaded separately)
|
|
43685
43810
|
conditionalFields: conditionalFieldsRaw = {},
|
|
43686
43811
|
hiddenCalculations: hiddenCalculationsRaw = [],
|
|
@@ -43927,7 +44052,8 @@ var init_Form = __esm({
|
|
|
43927
44052
|
label,
|
|
43928
44053
|
field.required && /* @__PURE__ */ jsx(Typography, { as: "span", color: "error", className: "ml-1", children: "*" })
|
|
43929
44054
|
] }),
|
|
43930
|
-
renderFieldInput(field, fieldName, inputType, currentValue2, label)
|
|
44055
|
+
renderFieldInput(field, fieldName, inputType, currentValue2, label),
|
|
44056
|
+
field.hint && /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: field.hint })
|
|
43931
44057
|
] }, fieldName);
|
|
43932
44058
|
},
|
|
43933
44059
|
[formData, isFieldVisible, relationsData, relationsLoading, isLoading]
|
|
@@ -43943,6 +44069,7 @@ var init_Form = __esm({
|
|
|
43943
44069
|
name: field,
|
|
43944
44070
|
type: entityField.type,
|
|
43945
44071
|
required: entityField.required,
|
|
44072
|
+
hint: entityField.description,
|
|
43946
44073
|
// EntityField.default is typed `unknown` upstream — safe cast: schema defaults are always FieldValues.
|
|
43947
44074
|
defaultValue: entityField.default,
|
|
43948
44075
|
// EntityField is a discriminated union — `values` lives on Scalar/Enum, `relation` lives on Relation.
|
|
@@ -43955,8 +44082,18 @@ var init_Form = __esm({
|
|
|
43955
44082
|
return { name: field, type: "string" };
|
|
43956
44083
|
}
|
|
43957
44084
|
return field;
|
|
44085
|
+
}).map((field) => {
|
|
44086
|
+
const fieldName = field.name || field.field;
|
|
44087
|
+
const override = fieldOverrides?.find((o) => o.name === fieldName);
|
|
44088
|
+
if (!override) return field;
|
|
44089
|
+
return {
|
|
44090
|
+
...field,
|
|
44091
|
+
...override.label !== void 0 ? { label: override.label } : {},
|
|
44092
|
+
...override.placeholder !== void 0 ? { placeholder: override.placeholder } : {},
|
|
44093
|
+
...override.hint !== void 0 ? { hint: override.hint } : {}
|
|
44094
|
+
};
|
|
43958
44095
|
});
|
|
43959
|
-
}, [effectiveFields, resolvedEntity]);
|
|
44096
|
+
}, [effectiveFields, resolvedEntity, fieldOverrides]);
|
|
43960
44097
|
const schemaFields = React77__default.useMemo(() => {
|
|
43961
44098
|
if (normalizedFields.length === 0) return null;
|
|
43962
44099
|
if (isDebugEnabled()) {
|
|
@@ -44080,6 +44217,44 @@ var init_Form = __esm({
|
|
|
44080
44217
|
max: field.max
|
|
44081
44218
|
}
|
|
44082
44219
|
);
|
|
44220
|
+
case "currency":
|
|
44221
|
+
return /* @__PURE__ */ jsx(
|
|
44222
|
+
Input,
|
|
44223
|
+
{
|
|
44224
|
+
...commonProps,
|
|
44225
|
+
type: "number",
|
|
44226
|
+
step: "0.01",
|
|
44227
|
+
icon: DollarSign,
|
|
44228
|
+
value: currentValue2 !== void 0 && currentValue2 !== "" ? String(currentValue2) : "",
|
|
44229
|
+
onChange: (e) => handleChange(
|
|
44230
|
+
fieldName,
|
|
44231
|
+
e.target.value ? Number(e.target.value) : void 0
|
|
44232
|
+
),
|
|
44233
|
+
min: field.min,
|
|
44234
|
+
max: field.max
|
|
44235
|
+
}
|
|
44236
|
+
);
|
|
44237
|
+
case "file":
|
|
44238
|
+
return /* @__PURE__ */ jsx(
|
|
44239
|
+
UploadDropZone,
|
|
44240
|
+
{
|
|
44241
|
+
accept: field.pattern,
|
|
44242
|
+
maxFiles: 1,
|
|
44243
|
+
disabled: isLoading,
|
|
44244
|
+
onFiles: (files) => {
|
|
44245
|
+
const f3 = files[0];
|
|
44246
|
+
if (!f3) return;
|
|
44247
|
+
const reader = new FileReader();
|
|
44248
|
+
reader.onload = () => handleChange(fieldName, {
|
|
44249
|
+
name: f3.name,
|
|
44250
|
+
mimeType: f3.type,
|
|
44251
|
+
sizeBytes: f3.size,
|
|
44252
|
+
url: typeof reader.result === "string" ? reader.result : ""
|
|
44253
|
+
});
|
|
44254
|
+
reader.readAsDataURL(f3);
|
|
44255
|
+
}
|
|
44256
|
+
}
|
|
44257
|
+
);
|
|
44083
44258
|
case "date":
|
|
44084
44259
|
return /* @__PURE__ */ jsx(
|
|
44085
44260
|
Input,
|
|
@@ -45112,6 +45287,7 @@ var COLUMN_CLASSES, ASPECT_CLASSES, MediaGallery;
|
|
|
45112
45287
|
var init_MediaGallery = __esm({
|
|
45113
45288
|
"components/core/organisms/MediaGallery.tsx"() {
|
|
45114
45289
|
"use client";
|
|
45290
|
+
init_getNestedValue();
|
|
45115
45291
|
init_cn();
|
|
45116
45292
|
init_atoms();
|
|
45117
45293
|
init_Stack();
|
|
@@ -45180,9 +45356,9 @@ var init_MediaGallery = __esm({
|
|
|
45180
45356
|
return entityData.map((record, idx) => {
|
|
45181
45357
|
return {
|
|
45182
45358
|
id: String(record.id ?? idx),
|
|
45183
|
-
src:
|
|
45359
|
+
src: resolveImageUrl(record.src ?? ("url" in record ? record.url : void 0) ?? ("image" in record ? record.image : void 0)) ?? "",
|
|
45184
45360
|
alt: record.alt ? String(record.alt) : void 0,
|
|
45185
|
-
thumbnail:
|
|
45361
|
+
thumbnail: resolveImageUrl(record.thumbnail),
|
|
45186
45362
|
caption: record.caption ? String(record.caption) : "title" in record ? String(record.title) : void 0
|
|
45187
45363
|
};
|
|
45188
45364
|
});
|
|
@@ -49525,7 +49701,8 @@ __export(UISlotRenderer_exports, {
|
|
|
49525
49701
|
SlotContentRenderer: () => SlotContentRenderer,
|
|
49526
49702
|
SuspenseConfigProvider: () => SuspenseConfigProvider,
|
|
49527
49703
|
UISlotComponent: () => UISlotComponent,
|
|
49528
|
-
UISlotRenderer: () => UISlotRenderer
|
|
49704
|
+
UISlotRenderer: () => UISlotRenderer,
|
|
49705
|
+
renderPatternValue: () => renderPatternValue
|
|
49529
49706
|
});
|
|
49530
49707
|
function SuspenseConfigProvider({
|
|
49531
49708
|
config,
|
|
@@ -49561,6 +49738,9 @@ function enrichFormFields(fields, entityDef) {
|
|
|
49561
49738
|
type: entityField.type,
|
|
49562
49739
|
required: entityField.required ?? false
|
|
49563
49740
|
};
|
|
49741
|
+
if (entityField.description) {
|
|
49742
|
+
enriched.hint = entityField.description;
|
|
49743
|
+
}
|
|
49564
49744
|
if (entityField.values && entityField.values.length > 0) {
|
|
49565
49745
|
enriched.values = entityField.values;
|
|
49566
49746
|
} else if (entityField.enumValues && entityField.enumValues.length > 0) {
|
|
@@ -49584,6 +49764,9 @@ function enrichFormFields(fields, entityDef) {
|
|
|
49584
49764
|
if (entityField.required && !("required" in obj)) {
|
|
49585
49765
|
enriched.required = true;
|
|
49586
49766
|
}
|
|
49767
|
+
if (entityField.description && !obj.hint && !obj.help) {
|
|
49768
|
+
enriched.hint = entityField.description;
|
|
49769
|
+
}
|
|
49587
49770
|
if (!obj.values && !obj.options) {
|
|
49588
49771
|
if (entityField.values && entityField.values.length > 0) {
|
|
49589
49772
|
enriched.values = entityField.values;
|
|
@@ -49599,6 +49782,32 @@ function enrichFormFields(fields, entityDef) {
|
|
|
49599
49782
|
return field;
|
|
49600
49783
|
});
|
|
49601
49784
|
}
|
|
49785
|
+
function enrichDetailFields(fields, entityDef) {
|
|
49786
|
+
const fieldMap = new Map(entityDef.fields.map((f3) => [f3.name, f3]));
|
|
49787
|
+
const metaFor = (name) => {
|
|
49788
|
+
const entityField = fieldMap.get(name);
|
|
49789
|
+
if (!entityField) return void 0;
|
|
49790
|
+
const meta = { type: entityField.type };
|
|
49791
|
+
const values = entityField.values ?? entityField.enumValues;
|
|
49792
|
+
if (values && values.length > 0) meta.values = values;
|
|
49793
|
+
if (entityField.relation) meta.relation = entityField.relation.entity;
|
|
49794
|
+
return meta;
|
|
49795
|
+
};
|
|
49796
|
+
return fields.map((field) => {
|
|
49797
|
+
if (typeof field === "string") {
|
|
49798
|
+
const meta = metaFor(field);
|
|
49799
|
+
return meta ? { key: field, ...meta } : field;
|
|
49800
|
+
}
|
|
49801
|
+
if (field && typeof field === "object" && !Array.isArray(field) && !React77__default.isValidElement(field) && !(field instanceof Date)) {
|
|
49802
|
+
const obj = field;
|
|
49803
|
+
const fieldName = typeof obj.key === "string" ? obj.key : typeof obj.name === "string" ? obj.name : void 0;
|
|
49804
|
+
if (!fieldName || obj.type) return field;
|
|
49805
|
+
const meta = metaFor(fieldName);
|
|
49806
|
+
return meta ? { ...obj, ...meta } : field;
|
|
49807
|
+
}
|
|
49808
|
+
return field;
|
|
49809
|
+
});
|
|
49810
|
+
}
|
|
49602
49811
|
function renderContainedPortal(t, slot, content, onDismiss) {
|
|
49603
49812
|
const slotContent = /* @__PURE__ */ jsx(MaybeTraitScope, { sourceTrait: content.sourceTrait, children: /* @__PURE__ */ jsx(SlotContentRenderer, { content, onDismiss }) });
|
|
49604
49813
|
const slotId = `slot-${slot}`;
|
|
@@ -50108,6 +50317,24 @@ function isPatternConfig(value) {
|
|
|
50108
50317
|
const record = value;
|
|
50109
50318
|
return "type" in record && typeof record.type === "string" && getComponentForPattern$1(record.type) !== null;
|
|
50110
50319
|
}
|
|
50320
|
+
function renderPatternValue(value) {
|
|
50321
|
+
if (value === null || value === void 0) return null;
|
|
50322
|
+
if (typeof value === "boolean" || typeof value === "function") return null;
|
|
50323
|
+
if (typeof value === "number") return value;
|
|
50324
|
+
if (typeof value === "string") return renderPatternChildren(value, () => {
|
|
50325
|
+
});
|
|
50326
|
+
if (value instanceof Date) return value.toLocaleString();
|
|
50327
|
+
if (React77__default.isValidElement(value)) return value;
|
|
50328
|
+
if (Array.isArray(value)) {
|
|
50329
|
+
return value.map((item, index) => /* @__PURE__ */ jsx(React77__default.Fragment, { children: renderPatternValue(item) }, index));
|
|
50330
|
+
}
|
|
50331
|
+
if (isPatternConfig(value)) {
|
|
50332
|
+
const { type, ...props } = value;
|
|
50333
|
+
return renderPatternChildren({ type, props }, () => {
|
|
50334
|
+
});
|
|
50335
|
+
}
|
|
50336
|
+
return null;
|
|
50337
|
+
}
|
|
50111
50338
|
function isPlainConfigObject(value) {
|
|
50112
50339
|
if (React77__default.isValidElement(value)) return false;
|
|
50113
50340
|
if (value instanceof Date) return false;
|
|
@@ -50309,9 +50536,9 @@ function SlotContentRenderer({
|
|
|
50309
50536
|
finalProps.fields = keys.map((k, i) => ({ name: k, variant: i === 0 ? "h4" : "body" }));
|
|
50310
50537
|
}
|
|
50311
50538
|
}
|
|
50312
|
-
const
|
|
50313
|
-
if (
|
|
50314
|
-
finalProps.fields = enrichFormFields([...finalProps.fields], entityDef);
|
|
50539
|
+
const fieldsContract = getPatternFieldsContract(content.pattern) ?? (getPatternDefinition$1(content.pattern) === null && content.pattern.includes("form") ? "form" : void 0);
|
|
50540
|
+
if (fieldsContract && entityDef && Array.isArray(finalProps.fields) && finalProps.fields[0] !== "fn") {
|
|
50541
|
+
finalProps.fields = fieldsContract === "form" ? enrichFormFields([...finalProps.fields], entityDef) : enrichDetailFields([...finalProps.fields], entityDef);
|
|
50315
50542
|
}
|
|
50316
50543
|
const acceptsChildren = PATTERNS_WITH_CHILDREN.has(content.pattern);
|
|
50317
50544
|
return /* @__PURE__ */ jsx(
|
|
@@ -50421,7 +50648,7 @@ function UISlotRenderer({
|
|
|
50421
50648
|
}
|
|
50422
50649
|
return wrapped;
|
|
50423
50650
|
}
|
|
50424
|
-
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP,
|
|
50651
|
+
var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, SELF_OVERLAY_PATTERNS, CONTENT_NODE_SLOTS, PATTERNS_WITH_CHILDREN;
|
|
50425
50652
|
var init_UISlotRenderer = __esm({
|
|
50426
50653
|
"components/core/organisms/UISlotRenderer.tsx"() {
|
|
50427
50654
|
"use client";
|
|
@@ -50452,12 +50679,6 @@ var init_UISlotRenderer = __esm({
|
|
|
50452
50679
|
modal: "form",
|
|
50453
50680
|
drawer: "form"
|
|
50454
50681
|
};
|
|
50455
|
-
FORM_PATTERNS = /* @__PURE__ */ new Set([
|
|
50456
|
-
"form",
|
|
50457
|
-
"form-section",
|
|
50458
|
-
"inline-edit-form",
|
|
50459
|
-
"wizard-step"
|
|
50460
|
-
]);
|
|
50461
50682
|
SELF_OVERLAY_PATTERNS = /* @__PURE__ */ new Set(["modal", "confirm-dialog"]);
|
|
50462
50683
|
CONTENT_NODE_SLOTS = /* @__PURE__ */ new Set([
|
|
50463
50684
|
"logo",
|
|
@@ -52980,4 +53201,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
|
|
|
52980
53201
|
});
|
|
52981
53202
|
}
|
|
52982
53203
|
|
|
52983
|
-
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgoGraphCanvas, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmojiPicker, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, LearningScene3D, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, arrowBetween, billboardLabel, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, cylinderBetween, get3DClickPayload, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, meshSphere, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate114 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
|
|
53204
|
+
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgoGraphCanvas, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmojiPicker, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, ImportPreviewTree, ImportProgress, ImportSourcePicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, LearningScene3D, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, arrowBetween, billboardLabel, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, cylinderBetween, get3DClickPayload, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, meshSphere, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, renderPatternValue, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useMediaQuery, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate114 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
|