@object-ui/plugin-detail 4.0.12 → 4.3.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/CHANGELOG.md +8 -0
- package/dist/index.js +232 -112
- package/dist/index.umd.cjs +3 -3
- package/dist/packages/plugin-detail/src/DetailView.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/RecordMetaFooter.d.ts +30 -0
- package/dist/packages/plugin-detail/src/RecordMetaFooter.d.ts.map +1 -0
- package/dist/packages/plugin-detail/src/index.d.ts +2 -0
- package/dist/packages/plugin-detail/src/index.d.ts.map +1 -1
- package/dist/packages/plugin-detail/src/useDetailTranslation.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { ComponentRegistry as e, buildExpandFields as t } from "@object-ui/core"
|
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import r from "react";
|
|
4
4
|
import { AlertDialog as i, AlertDialogAction as a, AlertDialogCancel as o, AlertDialogContent as s, AlertDialogDescription as c, AlertDialogFooter as l, AlertDialogHeader as u, AlertDialogTitle as d, Badge as f, Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Collapsible as v, CollapsibleContent as y, CollapsibleTrigger as b, Input as x, Sheet as S, SheetContent as C, SheetHeader as w, SheetTitle as T, Skeleton as E, Tabs as D, TabsContent as O, TabsList as k, TabsTrigger as A, Tooltip as j, TooltipContent as M, TooltipProvider as N, TooltipTrigger as P, cn as F, useIsMobile as I } from "@object-ui/components";
|
|
5
|
-
import { Activity as L, ArrowLeft as ee, ArrowRight as R, ArrowRightLeft as te, ArrowUpDown as z, AtSign as B, Bell as ne, BellOff as re, Bold as V, Calendar as H, Check as ie, CheckSquare as U, ChevronDown as ae, ChevronLeft as oe, ChevronRight as
|
|
5
|
+
import { Activity as L, ArrowLeft as ee, ArrowRight as R, ArrowRightLeft as te, ArrowUpDown as z, AtSign as B, Bell as ne, BellOff as re, Bold as V, Calendar as H, Check as ie, CheckSquare as U, ChevronDown as ae, ChevronLeft as oe, ChevronRight as se, ChevronsLeft as ce, ChevronsRight as le, Code as W, Columns2 as ue, Copy as de, Edit as G, ExternalLink as fe, Eye as K, EyeOff as pe, File as me, FileArchive as he, FileText as ge, History as q, Image as _e, Inbox as ve, Italic as ye, Link as J, List as be, Loader2 as xe, Mail as Se, MessageSquare as Y, Network as Ce, PanelRightClose as we, PanelRightOpen as Te, Paperclip as Ee, Phone as De, Pin as Oe, Plus as ke, PlusCircle as Ae, RotateCcw as je, Rows3 as Me, Search as Ne, Send as Pe, SmilePlus as Fe, Star as Ie, Trash2 as Le, Upload as Re, X as ze, Zap as Be, icons as Ve } from "lucide-react";
|
|
6
6
|
import { SchemaRenderer as He, useObjectTranslation as Ue, useSafeFieldLabel as We } from "@object-ui/react";
|
|
7
7
|
import { BooleanField as Ge, SelectField as Ke, getCellRenderer as qe, resolveCellRendererType as Je } from "@object-ui/fields";
|
|
8
8
|
import { Fragment as X, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
@@ -130,6 +130,8 @@ var tt = {
|
|
|
130
130
|
"detail.minutesAgo": "{{count}}m ago",
|
|
131
131
|
"detail.hoursAgo": "{{count}}h ago",
|
|
132
132
|
"detail.daysAgo": "{{count}}d ago",
|
|
133
|
+
"detail.createdBy": "Created by",
|
|
134
|
+
"detail.updatedBy": "Updated by",
|
|
133
135
|
"detail.dropFilesToUpload": "Drop files here or click to upload",
|
|
134
136
|
"detail.attachmentCount": "{{count}} attachment",
|
|
135
137
|
"detail.attachmentCountPlural": "{{count}} attachments",
|
|
@@ -306,10 +308,10 @@ var rt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
306
308
|
re.length,
|
|
307
309
|
oe
|
|
308
310
|
]);
|
|
309
|
-
let
|
|
311
|
+
let ce = S === void 0 ? re : re.slice(0, S), le = L > 0 && (e.hideEmpty || B), W = /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("div", {
|
|
310
312
|
className: F("grid gap-3 sm:gap-4", V === 1 ? "grid-cols-1" : V === 2 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"),
|
|
311
|
-
children:
|
|
312
|
-
}),
|
|
313
|
+
children: ce.map(H)
|
|
314
|
+
}), le && /* @__PURE__ */ Z("div", {
|
|
313
315
|
className: "mt-3 -ml-2",
|
|
314
316
|
children: /* @__PURE__ */ Q(p, {
|
|
315
317
|
type: "button",
|
|
@@ -325,7 +327,7 @@ var rt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
325
327
|
})] });
|
|
326
328
|
return !e.title && !e.collapsible && e.showBorder === !1 ? /* @__PURE__ */ Z("div", {
|
|
327
329
|
className: F(r),
|
|
328
|
-
children:
|
|
330
|
+
children: W
|
|
329
331
|
}) : e.collapsible ? /* @__PURE__ */ Z(v, {
|
|
330
332
|
open: !l,
|
|
331
333
|
onOpenChange: (e) => u(!e),
|
|
@@ -352,7 +354,7 @@ var rt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
352
354
|
]
|
|
353
355
|
}), /* @__PURE__ */ Z("div", {
|
|
354
356
|
className: "flex items-center gap-2",
|
|
355
|
-
children: Z(l ?
|
|
357
|
+
children: Z(l ? se : ae, { className: "h-4 w-4 text-muted-foreground" })
|
|
356
358
|
})]
|
|
357
359
|
}), e.description && !l && /* @__PURE__ */ Z("p", {
|
|
358
360
|
className: "text-sm text-muted-foreground mt-1.5",
|
|
@@ -361,7 +363,7 @@ var rt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
361
363
|
})
|
|
362
364
|
}), /* @__PURE__ */ Z(y, { children: /* @__PURE__ */ Z(h, {
|
|
363
365
|
className: "pt-4 sm:pt-6 px-3 sm:px-6",
|
|
364
|
-
children:
|
|
366
|
+
children: W
|
|
365
367
|
}) })] })
|
|
366
368
|
}) : /* @__PURE__ */ Q(m, {
|
|
367
369
|
className: F(e.showBorder === !1 ? "border-none shadow-none" : "", r),
|
|
@@ -382,7 +384,7 @@ var rt = ({ section: e, data: t, className: r, objectSchema: i, objectName: a, i
|
|
|
382
384
|
})]
|
|
383
385
|
}), /* @__PURE__ */ Z(h, {
|
|
384
386
|
className: "pt-4 sm:pt-6 px-3 sm:px-6",
|
|
385
|
-
children:
|
|
387
|
+
children: W
|
|
386
388
|
})]
|
|
387
389
|
});
|
|
388
390
|
}, it = ({ tabs: e, data: t, className: r }) => {
|
|
@@ -434,7 +436,7 @@ function at(e) {
|
|
|
434
436
|
return e && Ve[e.split(/[-_\s]/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join("")] || ve;
|
|
435
437
|
}
|
|
436
438
|
var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className: S, dataSource: C, objectName: w, onNew: T, onViewAll: E, onRowEdit: D, onRowDelete: O, onRowClick: k, maxColumns: A = 6, pageSize: j, sortable: M = !1, filterable: N = !1, collapsible: P = !1, defaultCollapsed: I = !1, referenceField: L, icon: ee }) => {
|
|
437
|
-
let R = v !== void 0, te = v ?? [], [B, ne] = n.useState(te), [re, V] = n.useState(!1), [H, ie] = n.useState(0), [U,
|
|
439
|
+
let R = v !== void 0, te = v ?? [], [B, ne] = n.useState(te), [re, V] = n.useState(!1), [H, ie] = n.useState(0), [U, ce] = n.useState(null), [le, W] = n.useState("asc"), [ue, de] = n.useState(""), [G, K] = n.useState(null), [pe, me] = n.useState(I), [he, ge] = n.useState({}), { t: q } = $(), { fieldLabel: _e } = We();
|
|
438
440
|
n.useEffect(() => {
|
|
439
441
|
R && ne(v ?? []);
|
|
440
442
|
}, [v, R]), n.useEffect(() => {
|
|
@@ -523,21 +525,21 @@ var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
|
|
|
523
525
|
if (n == null) return 1;
|
|
524
526
|
if (r == null) return -1;
|
|
525
527
|
let i = String(n).localeCompare(String(r), void 0, { numeric: !0 });
|
|
526
|
-
return
|
|
528
|
+
return le === "asc" ? i : -i;
|
|
527
529
|
}) : ve, [
|
|
528
530
|
ve,
|
|
529
531
|
U,
|
|
530
|
-
|
|
532
|
+
le
|
|
531
533
|
]), J = j && j > 0 ? j : 0, be = J ? Math.max(1, Math.ceil(ye.length / J)) : 1, xe = J ? ye.slice(H * J, (H + 1) * J) : ye;
|
|
532
534
|
n.useEffect(() => {
|
|
533
535
|
ie(0);
|
|
534
536
|
}, [
|
|
535
537
|
ue,
|
|
536
538
|
U,
|
|
537
|
-
|
|
539
|
+
le
|
|
538
540
|
]);
|
|
539
541
|
let Se = n.useCallback((e) => {
|
|
540
|
-
U === e ?
|
|
542
|
+
U === e ? W((e) => e === "asc" ? "desc" : "asc") : (ce(e), W("asc"));
|
|
541
543
|
}, [U]), [Y, Ce] = n.useState(null), we = n.useCallback((e) => {
|
|
542
544
|
Ce(e);
|
|
543
545
|
}, []), Te = n.useCallback(() => {
|
|
@@ -663,7 +665,7 @@ var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
|
|
|
663
665
|
children: [/* @__PURE__ */ Q("div", {
|
|
664
666
|
className: "flex items-center gap-2 min-w-0",
|
|
665
667
|
children: [
|
|
666
|
-
P && Z(pe ?
|
|
668
|
+
P && Z(pe ? se : ae, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
667
669
|
/* @__PURE__ */ Z(Me, {
|
|
668
670
|
className: "h-4 w-4 text-muted-foreground shrink-0",
|
|
669
671
|
"aria-hidden": !0
|
|
@@ -719,7 +721,7 @@ var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
|
|
|
719
721
|
children: [
|
|
720
722
|
/* @__PURE__ */ Z(z, { className: "h-3 w-3" }),
|
|
721
723
|
n,
|
|
722
|
-
r && (
|
|
724
|
+
r && (le === "asc" ? " ↑" : " ↓")
|
|
723
725
|
]
|
|
724
726
|
}, t);
|
|
725
727
|
})
|
|
@@ -771,7 +773,7 @@ var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
|
|
|
771
773
|
className: "h-7 text-xs gap-1",
|
|
772
774
|
disabled: H >= be - 1,
|
|
773
775
|
onClick: () => ie((e) => Math.min(be - 1, e + 1)),
|
|
774
|
-
children: [q("detail.nextPage"), /* @__PURE__ */ Z(
|
|
776
|
+
children: [q("detail.nextPage"), /* @__PURE__ */ Z(se, { className: "h-3 w-3" })]
|
|
775
777
|
})
|
|
776
778
|
]
|
|
777
779
|
}),
|
|
@@ -823,7 +825,7 @@ var ot = ({ title: e, type: t, api: r, data: v, schema: y, columns: b, className
|
|
|
823
825
|
children: /* @__PURE__ */ Q("div", {
|
|
824
826
|
className: "flex items-center gap-2 pb-2 border-b cursor-pointer hover:bg-muted/50 transition-colors rounded-t-md px-2 py-1.5",
|
|
825
827
|
children: [
|
|
826
|
-
Z(l ?
|
|
828
|
+
Z(l ? se : ae, { className: "h-4 w-4 text-muted-foreground shrink-0" }),
|
|
827
829
|
e.icon && /* @__PURE__ */ Z("span", {
|
|
828
830
|
className: "text-muted-foreground",
|
|
829
831
|
children: e.icon
|
|
@@ -1159,8 +1161,118 @@ var ht = {
|
|
|
1159
1161
|
})]
|
|
1160
1162
|
})] })]
|
|
1161
1163
|
});
|
|
1162
|
-
}, _t =
|
|
1163
|
-
|
|
1164
|
+
}, _t = {
|
|
1165
|
+
createdAt: "created_at",
|
|
1166
|
+
createdBy: "created_by",
|
|
1167
|
+
updatedAt: "updated_at",
|
|
1168
|
+
updatedBy: "updated_by"
|
|
1169
|
+
};
|
|
1170
|
+
function vt(e) {
|
|
1171
|
+
if (!e) return null;
|
|
1172
|
+
if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
|
|
1173
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
1174
|
+
let t = new Date(e);
|
|
1175
|
+
return isNaN(t.getTime()) ? null : t;
|
|
1176
|
+
}
|
|
1177
|
+
return null;
|
|
1178
|
+
}
|
|
1179
|
+
function yt(e, t) {
|
|
1180
|
+
let n = Date.now() - e.getTime(), r = Math.max(0, Math.floor(n / 1e3));
|
|
1181
|
+
if (r < 60) return t("detail.justNow");
|
|
1182
|
+
let i = Math.floor(r / 60);
|
|
1183
|
+
if (i < 60) return t("detail.minutesAgo", { count: i });
|
|
1184
|
+
let a = Math.floor(i / 60);
|
|
1185
|
+
return a < 24 ? t("detail.hoursAgo", { count: a }) : t("detail.daysAgo", { count: Math.floor(a / 24) });
|
|
1186
|
+
}
|
|
1187
|
+
function bt(e) {
|
|
1188
|
+
try {
|
|
1189
|
+
return new Intl.DateTimeFormat(void 0, {
|
|
1190
|
+
dateStyle: "medium",
|
|
1191
|
+
timeStyle: "short"
|
|
1192
|
+
}).format(e);
|
|
1193
|
+
} catch {
|
|
1194
|
+
return e.toISOString();
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
var xt = ({ value: e, objectSchema: t, fieldName: n }) => {
|
|
1198
|
+
if (e == null || e === "") return null;
|
|
1199
|
+
let r = t?.fields?.[n], i = r?.reference_to || r?.reference, a = {
|
|
1200
|
+
name: n,
|
|
1201
|
+
type: r?.type || (i ? "lookup" : "text"),
|
|
1202
|
+
...i && { reference_to: i },
|
|
1203
|
+
...r?.reference_field && { reference_field: r.reference_field }
|
|
1204
|
+
}, o = Je(a) || a.type;
|
|
1205
|
+
if (o) {
|
|
1206
|
+
let t = qe(o);
|
|
1207
|
+
if (t) return /* @__PURE__ */ Z("span", {
|
|
1208
|
+
className: "inline-flex items-center [&_a]:text-inherit [&_a]:hover:underline",
|
|
1209
|
+
children: /* @__PURE__ */ Z(t, {
|
|
1210
|
+
value: e,
|
|
1211
|
+
field: a
|
|
1212
|
+
})
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
return /* @__PURE__ */ Z("span", { children: String(e) });
|
|
1216
|
+
}, St = ({ label: e, user: t, date: n, objectSchema: r, userField: i, t: a }) => {
|
|
1217
|
+
if (!t && !n) return null;
|
|
1218
|
+
let o = n ? /* @__PURE__ */ Z(N, {
|
|
1219
|
+
delayDuration: 200,
|
|
1220
|
+
children: /* @__PURE__ */ Q(j, { children: [/* @__PURE__ */ Z(P, {
|
|
1221
|
+
asChild: !0,
|
|
1222
|
+
children: /* @__PURE__ */ Z("time", {
|
|
1223
|
+
dateTime: n.toISOString(),
|
|
1224
|
+
className: "cursor-default underline decoration-dotted decoration-muted-foreground/40 underline-offset-2",
|
|
1225
|
+
children: yt(n, a)
|
|
1226
|
+
})
|
|
1227
|
+
}), /* @__PURE__ */ Z(M, {
|
|
1228
|
+
side: "top",
|
|
1229
|
+
children: bt(n)
|
|
1230
|
+
})] })
|
|
1231
|
+
}) : null;
|
|
1232
|
+
return /* @__PURE__ */ Q("span", {
|
|
1233
|
+
className: "inline-flex items-center gap-1.5",
|
|
1234
|
+
children: [
|
|
1235
|
+
/* @__PURE__ */ Z("span", {
|
|
1236
|
+
className: "text-muted-foreground/70",
|
|
1237
|
+
children: e
|
|
1238
|
+
}),
|
|
1239
|
+
t ? /* @__PURE__ */ Z(xt, {
|
|
1240
|
+
value: t,
|
|
1241
|
+
objectSchema: r,
|
|
1242
|
+
fieldName: i
|
|
1243
|
+
}) : null,
|
|
1244
|
+
t && o ? /* @__PURE__ */ Z("span", {
|
|
1245
|
+
className: "text-muted-foreground/40",
|
|
1246
|
+
children: "·"
|
|
1247
|
+
}) : null,
|
|
1248
|
+
o
|
|
1249
|
+
]
|
|
1250
|
+
});
|
|
1251
|
+
}, Ct = ({ data: e, objectSchema: t, objectName: n, className: r }) => {
|
|
1252
|
+
let { t: i } = $();
|
|
1253
|
+
if (!e) return null;
|
|
1254
|
+
let a = vt(e[_t.createdAt]), o = vt(e[_t.updatedAt]), s = e[_t.createdBy], c = e[_t.updatedBy], l = !!(a || s), u = a && o && Math.abs(o.getTime() - a.getTime()) < 2e3, d = !!(o || c) && !(u && (s != null && c != null && String(s) === String(c) || !c));
|
|
1255
|
+
return !l && !d ? null : /* @__PURE__ */ Q("div", {
|
|
1256
|
+
className: F("mt-6 pt-3 border-t border-border/40", "flex flex-wrap items-center gap-x-4 gap-y-1", "text-xs text-muted-foreground", r),
|
|
1257
|
+
"data-testid": "record-meta-footer",
|
|
1258
|
+
children: [l && /* @__PURE__ */ Z(St, {
|
|
1259
|
+
label: i("detail.createdBy"),
|
|
1260
|
+
user: s,
|
|
1261
|
+
date: a,
|
|
1262
|
+
objectSchema: t,
|
|
1263
|
+
userField: _t.createdBy,
|
|
1264
|
+
t: i
|
|
1265
|
+
}), d && /* @__PURE__ */ Z(St, {
|
|
1266
|
+
label: i("detail.updatedBy"),
|
|
1267
|
+
user: c,
|
|
1268
|
+
date: o,
|
|
1269
|
+
objectSchema: t,
|
|
1270
|
+
userField: _t.updatedBy,
|
|
1271
|
+
t: i
|
|
1272
|
+
})]
|
|
1273
|
+
});
|
|
1274
|
+
}, wt = 5;
|
|
1275
|
+
function Tt(e, t, n, r) {
|
|
1164
1276
|
if (e && typeof e == "object") {
|
|
1165
1277
|
if (t.primaryField) {
|
|
1166
1278
|
let n = e[t.primaryField];
|
|
@@ -1195,7 +1307,7 @@ function vt(e, t, n, r) {
|
|
|
1195
1307
|
}
|
|
1196
1308
|
return r;
|
|
1197
1309
|
}
|
|
1198
|
-
var
|
|
1310
|
+
var Et = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBack: s, inlineEdit: c = !1, onFieldSave: l, discussionSlot: u, rightRail: d, objectLabel: m, onDataLoaded: h }) => {
|
|
1199
1311
|
let [g, _] = n.useState(e.data), [v, y] = n.useState(!e.data && !!(e.api && e.resourceId || r && e.objectName && e.resourceId)), [b, x] = n.useState(!1), [S, C] = n.useState(!1), [w, T] = n.useState({}), [I, L] = n.useState(null), [R, te] = n.useState(!1), { t: z } = $(), { fieldOptionLabel: B } = We();
|
|
1200
1312
|
n.useEffect(() => {
|
|
1201
1313
|
g && h && h(g);
|
|
@@ -1292,7 +1404,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1292
1404
|
}, [a, e]), ae = n.useCallback(() => {
|
|
1293
1405
|
let t = e.deleteConfirmation || z("detail.deleteConfirmation");
|
|
1294
1406
|
window.confirm(t) && (o?.(), e.onNavigate && e.objectName && e.onNavigate(`/${e.objectName}`, { replace: !0 }));
|
|
1295
|
-
}, [o, e]),
|
|
1407
|
+
}, [o, e]), ce = n.useCallback(() => {
|
|
1296
1408
|
navigator.share && e.objectName && e.resourceId ? navigator.share({
|
|
1297
1409
|
title: e.title || z("detail.details"),
|
|
1298
1410
|
text: `${e.objectName} #${e.resourceId}`,
|
|
@@ -1300,9 +1412,9 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1300
1412
|
}).catch((e) => console.log("Share failed:", e)) : navigator.clipboard.writeText(window.location.href).then(() => {
|
|
1301
1413
|
console.log("Link copied to clipboard");
|
|
1302
1414
|
});
|
|
1303
|
-
}, [e]),
|
|
1415
|
+
}, [e]), le = n.useCallback(() => {
|
|
1304
1416
|
x(!b);
|
|
1305
|
-
}, [b]),
|
|
1417
|
+
}, [b]), W = n.useCallback(() => {
|
|
1306
1418
|
if (S) {
|
|
1307
1419
|
let e = Object.entries(w);
|
|
1308
1420
|
if (e.length > 0) {
|
|
@@ -1345,7 +1457,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1345
1457
|
label: z("detail.share"),
|
|
1346
1458
|
icon: "share-2",
|
|
1347
1459
|
type: "script",
|
|
1348
|
-
onClick:
|
|
1460
|
+
onClick: ce
|
|
1349
1461
|
}), e.showEdit && t.push({
|
|
1350
1462
|
name: "sys_edit_mobile",
|
|
1351
1463
|
label: z("detail.edit"),
|
|
@@ -1359,7 +1471,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1359
1471
|
icon: "edit",
|
|
1360
1472
|
type: "script",
|
|
1361
1473
|
className: "sm:hidden",
|
|
1362
|
-
onClick:
|
|
1474
|
+
onClick: W
|
|
1363
1475
|
}), e.showDelete && t.push({
|
|
1364
1476
|
name: "sys_delete",
|
|
1365
1477
|
label: z("detail.delete"),
|
|
@@ -1375,9 +1487,9 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1375
1487
|
e.showDelete,
|
|
1376
1488
|
c,
|
|
1377
1489
|
S,
|
|
1378
|
-
|
|
1490
|
+
ce,
|
|
1379
1491
|
U,
|
|
1380
|
-
|
|
1492
|
+
W,
|
|
1381
1493
|
ae
|
|
1382
1494
|
]), me = n.useMemo(() => {
|
|
1383
1495
|
let t = e.actions ?? [];
|
|
@@ -1449,7 +1561,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1449
1561
|
children: [
|
|
1450
1562
|
/* @__PURE__ */ Z("h1", {
|
|
1451
1563
|
className: "text-xl sm:text-2xl font-bold truncate",
|
|
1452
|
-
children:
|
|
1564
|
+
children: Tt(g, e, I, z("detail.details"))
|
|
1453
1565
|
}),
|
|
1454
1566
|
re.map((t) => {
|
|
1455
1567
|
let n = g?.[t];
|
|
@@ -1513,7 +1625,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1513
1625
|
variant: "ghost",
|
|
1514
1626
|
size: "icon",
|
|
1515
1627
|
className: "h-6 w-6 shrink-0",
|
|
1516
|
-
onClick:
|
|
1628
|
+
onClick: le,
|
|
1517
1629
|
"aria-label": z(b ? "detail.removeFromFavorites" : "detail.addToFavorites"),
|
|
1518
1630
|
children: b ? /* @__PURE__ */ Z(Ie, { className: "h-4 w-4 fill-yellow-400 text-yellow-400" }) : /* @__PURE__ */ Z(Ie, { className: "h-4 w-4 text-muted-foreground" })
|
|
1519
1631
|
})
|
|
@@ -1575,7 +1687,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1575
1687
|
let t = e.recordNavigation;
|
|
1576
1688
|
t.currentIndex < t.recordIds.length - 1 && t.onNavigate(t.recordIds[t.currentIndex + 1]);
|
|
1577
1689
|
},
|
|
1578
|
-
children: /* @__PURE__ */ Z(
|
|
1690
|
+
children: /* @__PURE__ */ Z(se, { className: "h-4 w-4" })
|
|
1579
1691
|
})
|
|
1580
1692
|
}), /* @__PURE__ */ Z(M, { children: z("detail.nextRecord") })] })
|
|
1581
1693
|
]
|
|
@@ -1597,7 +1709,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1597
1709
|
children: /* @__PURE__ */ Z(p, {
|
|
1598
1710
|
variant: S ? "default" : "outline",
|
|
1599
1711
|
size: "sm",
|
|
1600
|
-
onClick:
|
|
1712
|
+
onClick: W,
|
|
1601
1713
|
className: "gap-2 hidden sm:inline-flex",
|
|
1602
1714
|
children: S ? /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(ie, { className: "h-4 w-4" }), /* @__PURE__ */ Z("span", {
|
|
1603
1715
|
className: "hidden sm:inline",
|
|
@@ -1755,7 +1867,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1755
1867
|
onRowEdit: e.onRowEdit,
|
|
1756
1868
|
onRowDelete: e.onRowDelete,
|
|
1757
1869
|
collapsible: !0,
|
|
1758
|
-
pageSize:
|
|
1870
|
+
pageSize: wt
|
|
1759
1871
|
}, t))
|
|
1760
1872
|
})
|
|
1761
1873
|
}),
|
|
@@ -1839,7 +1951,7 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1839
1951
|
onRowEdit: e.onRowEdit,
|
|
1840
1952
|
onRowDelete: e.onRowDelete,
|
|
1841
1953
|
collapsible: !0,
|
|
1842
|
-
pageSize:
|
|
1954
|
+
pageSize: wt
|
|
1843
1955
|
}, t))]
|
|
1844
1956
|
}),
|
|
1845
1957
|
e.comments && /* @__PURE__ */ Z(ut, {
|
|
@@ -1848,13 +1960,21 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1848
1960
|
}),
|
|
1849
1961
|
e.activities && e.activities.length > 0 && /* @__PURE__ */ Z(gt, { activities: e.activities })
|
|
1850
1962
|
] }),
|
|
1963
|
+
/* @__PURE__ */ Z(Ct, {
|
|
1964
|
+
data: {
|
|
1965
|
+
...g,
|
|
1966
|
+
...w
|
|
1967
|
+
},
|
|
1968
|
+
objectSchema: I,
|
|
1969
|
+
objectName: e.objectName
|
|
1970
|
+
}),
|
|
1851
1971
|
e.footer && /* @__PURE__ */ Z("div", { children: /* @__PURE__ */ Z(He, {
|
|
1852
1972
|
schema: e.footer,
|
|
1853
1973
|
data: g
|
|
1854
1974
|
}) })
|
|
1855
1975
|
]
|
|
1856
1976
|
}) });
|
|
1857
|
-
},
|
|
1977
|
+
}, Dt = new Set([
|
|
1858
1978
|
"id",
|
|
1859
1979
|
"_id",
|
|
1860
1980
|
"__v",
|
|
@@ -1869,15 +1989,15 @@ var yt = ({ schema: e, dataSource: r, className: i, onEdit: a, onDelete: o, onBa
|
|
|
1869
1989
|
"owner_id",
|
|
1870
1990
|
"deleted_at",
|
|
1871
1991
|
"is_deleted"
|
|
1872
|
-
]),
|
|
1873
|
-
function
|
|
1992
|
+
]), Ot = 480, kt = 95;
|
|
1993
|
+
function At({ open: e, onClose: t, title: n, record: i, objectName: a, recordId: o, dataSource: s, objectSchema: c, width: l = "min(960px, 60vw)", columns: u = 2, systemFields: d = Dt, onFieldSave: f, onDelete: p, resizable: m = !0, fullPageHref: h }) {
|
|
1874
1994
|
let { t: g } = $(), _ = `objectui.drawerWidth.${a}`, [v, y] = r.useState(() => {
|
|
1875
1995
|
if (typeof window > "u" || !m) return null;
|
|
1876
1996
|
try {
|
|
1877
1997
|
let e = window.localStorage.getItem(_);
|
|
1878
1998
|
if (e) {
|
|
1879
1999
|
let t = parseInt(e, 10);
|
|
1880
|
-
if (Number.isFinite(t) && t >=
|
|
2000
|
+
if (Number.isFinite(t) && t >= Ot) return t;
|
|
1881
2001
|
}
|
|
1882
2002
|
} catch {}
|
|
1883
2003
|
return null;
|
|
@@ -1899,7 +2019,7 @@ function Ct({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
1899
2019
|
let n = (e) => {
|
|
1900
2020
|
let t = E.current;
|
|
1901
2021
|
if (!t) return;
|
|
1902
|
-
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth *
|
|
2022
|
+
let n = t.startX - e.clientX, r = typeof window < "u" ? window.innerWidth * kt / 100 : 1600, i = Math.min(r, Math.max(Ot, t.startWidth + n));
|
|
1903
2023
|
y(Math.round(i));
|
|
1904
2024
|
}, r = () => {
|
|
1905
2025
|
E.current, E.current = null, window.removeEventListener("pointermove", n), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", r);
|
|
@@ -1955,7 +2075,7 @@ function Ct({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
1955
2075
|
}),
|
|
1956
2076
|
/* @__PURE__ */ Z("div", {
|
|
1957
2077
|
className: "px-6 pt-6 pb-6",
|
|
1958
|
-
children: /* @__PURE__ */ Z(
|
|
2078
|
+
children: /* @__PURE__ */ Z(Et, {
|
|
1959
2079
|
dataSource: s,
|
|
1960
2080
|
inlineEdit: !0,
|
|
1961
2081
|
schema: {
|
|
@@ -1998,14 +2118,14 @@ function Ct({ open: e, onClose: t, title: n, record: i, objectName: a, recordId:
|
|
|
1998
2118
|
})
|
|
1999
2119
|
});
|
|
2000
2120
|
}
|
|
2001
|
-
function
|
|
2121
|
+
function jt(e, t) {
|
|
2002
2122
|
if (typeof window > "u") return null;
|
|
2003
2123
|
let n = window.location.pathname, r = `/${e}`, i = n.indexOf(r);
|
|
2004
2124
|
return `${i >= 0 ? n.slice(0, i) : n.replace(/\/$/, "")}/${e}/record/${encodeURIComponent(String(t))}`;
|
|
2005
2125
|
}
|
|
2006
2126
|
//#endregion
|
|
2007
2127
|
//#region src/InlineCreateRelated.tsx
|
|
2008
|
-
var
|
|
2128
|
+
var Mt = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, onLinkRecord: a, onSearch: o, existingRecords: s = [], className: c }) => {
|
|
2009
2129
|
let [l, u] = n.useState(!1), [d, f] = n.useState("create"), [v, y] = n.useState({}), [b, S] = n.useState(""), [C, w] = n.useState(s), [T, E] = n.useState(!1), [j, M] = n.useState(!1), N = n.useMemo(() => {
|
|
2010
2130
|
if (!b.trim()) return C;
|
|
2011
2131
|
let e = b.toLowerCase();
|
|
@@ -2178,11 +2298,11 @@ var Tt = ({ objectName: e, relationshipField: t, fields: r, onCreateRecord: i, o
|
|
|
2178
2298
|
};
|
|
2179
2299
|
//#endregion
|
|
2180
2300
|
//#region src/RichTextCommentInput.tsx
|
|
2181
|
-
function
|
|
2301
|
+
function Nt(e) {
|
|
2182
2302
|
let t = e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/```([\s\S]*?)```/g, "<pre class=\"bg-muted rounded p-2 text-xs font-mono my-1 overflow-x-auto\">$1</pre>").replace(/`([^`]+)`/g, "<code class=\"bg-muted rounded px-1 py-0.5 text-xs font-mono\">$1</code>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/@(\w+)/g, "<span class=\"text-primary font-medium\">@$1</span>").replace(/^- (.+)$/gm, "<li class=\"ml-4 list-disc\">$1</li>").replace(/\n/g, "<br/>");
|
|
2183
2303
|
return t = t.replace(/(<li[^>]*>.*?<\/li>(?:<br\/>)?)+/g, (e) => `<ul class="my-1">${e.replace(/<br\/>/g, "")}</ul>`), t;
|
|
2184
2304
|
}
|
|
2185
|
-
var
|
|
2305
|
+
var Pt = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], placeholder: a, className: o, disabled: s = !1 }) => {
|
|
2186
2306
|
let { t: c } = $(), [l, u] = n.useState(!1), [d, f] = n.useState(!1), [m, h] = n.useState(""), [g, _] = n.useState(0), v = n.useRef(null), y = n.useMemo(() => {
|
|
2187
2307
|
if (!m) return i;
|
|
2188
2308
|
let e = m.toLowerCase();
|
|
@@ -2281,7 +2401,7 @@ var Dt = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
|
|
|
2281
2401
|
onClick: w,
|
|
2282
2402
|
disabled: s || l,
|
|
2283
2403
|
title: c("detail.inlineCode"),
|
|
2284
|
-
children: /* @__PURE__ */ Z(
|
|
2404
|
+
children: /* @__PURE__ */ Z(W, { className: "h-3.5 w-3.5" })
|
|
2285
2405
|
}),
|
|
2286
2406
|
/* @__PURE__ */ Z(p, {
|
|
2287
2407
|
variant: "ghost",
|
|
@@ -2315,7 +2435,7 @@ var Dt = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
|
|
|
2315
2435
|
className: "relative",
|
|
2316
2436
|
children: l ? /* @__PURE__ */ Z("div", {
|
|
2317
2437
|
className: "min-h-[80px] px-3 py-2 text-sm prose prose-sm max-w-none",
|
|
2318
|
-
dangerouslySetInnerHTML: { __html:
|
|
2438
|
+
dangerouslySetInnerHTML: { __html: Nt(e) }
|
|
2319
2439
|
}) : /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z("textarea", {
|
|
2320
2440
|
ref: v,
|
|
2321
2441
|
className: "w-full min-h-[80px] px-3 py-2 text-sm bg-transparent resize-none focus:outline-none placeholder:text-muted-foreground",
|
|
@@ -2347,7 +2467,7 @@ var Dt = ({ value: e, onChange: t, onSubmit: r, mentionSuggestions: i = [], plac
|
|
|
2347
2467
|
};
|
|
2348
2468
|
//#endregion
|
|
2349
2469
|
//#region src/DiffView.tsx
|
|
2350
|
-
function
|
|
2470
|
+
function Ft(e, t) {
|
|
2351
2471
|
if (e == null) return ["(empty)"];
|
|
2352
2472
|
switch (t) {
|
|
2353
2473
|
case "json": try {
|
|
@@ -2366,7 +2486,7 @@ function Ot(e, t) {
|
|
|
2366
2486
|
default: return String(e).split("\n");
|
|
2367
2487
|
}
|
|
2368
2488
|
}
|
|
2369
|
-
function
|
|
2489
|
+
function It(e, t) {
|
|
2370
2490
|
let n = [], r = Math.max(e.length, t.length);
|
|
2371
2491
|
for (let i = 0; i < r; i++) {
|
|
2372
2492
|
let r = i < e.length ? e[i] : void 0, a = i < t.length ? t[i] : void 0;
|
|
@@ -2383,16 +2503,16 @@ function kt(e, t) {
|
|
|
2383
2503
|
}
|
|
2384
2504
|
return n;
|
|
2385
2505
|
}
|
|
2386
|
-
var
|
|
2506
|
+
var Lt = {
|
|
2387
2507
|
added: "bg-green-50 text-green-800 dark:bg-green-950/30 dark:text-green-300",
|
|
2388
2508
|
removed: "bg-red-50 text-red-800 dark:bg-red-950/30 dark:text-red-300",
|
|
2389
2509
|
unchanged: "text-muted-foreground"
|
|
2390
|
-
},
|
|
2510
|
+
}, Rt = {
|
|
2391
2511
|
added: "+",
|
|
2392
2512
|
removed: "-",
|
|
2393
2513
|
unchanged: " "
|
|
2394
|
-
},
|
|
2395
|
-
let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() =>
|
|
2514
|
+
}, zt = ({ oldValue: e, newValue: t, fieldName: r, fieldType: i = "string", mode: a = "unified", className: o }) => {
|
|
2515
|
+
let { t: s } = $(), [c, l] = n.useState(a), u = n.useMemo(() => Ft(e, i), [e, i]), d = n.useMemo(() => Ft(t, i), [t, i]), f = n.useMemo(() => It(u, d), [u, d]), v = f.some((e) => e.type !== "unchanged"), y = n.useMemo(() => {
|
|
2396
2516
|
if (c !== "side-by-side") return [];
|
|
2397
2517
|
let e = [], t = 0;
|
|
2398
2518
|
for (; t < f.length;) {
|
|
@@ -2450,10 +2570,10 @@ var At = {
|
|
|
2450
2570
|
children: v ? c === "unified" ? /* @__PURE__ */ Z("div", {
|
|
2451
2571
|
className: "font-mono text-xs overflow-x-auto",
|
|
2452
2572
|
children: f.map((e, t) => /* @__PURE__ */ Q("div", {
|
|
2453
|
-
className: F("px-4 py-0.5 whitespace-pre-wrap border-l-2",
|
|
2573
|
+
className: F("px-4 py-0.5 whitespace-pre-wrap border-l-2", Lt[e.type], e.type === "added" && "border-l-green-500", e.type === "removed" && "border-l-red-500", e.type === "unchanged" && "border-l-transparent"),
|
|
2454
2574
|
children: [/* @__PURE__ */ Z("span", {
|
|
2455
2575
|
className: "select-none mr-2 inline-block w-3 text-center opacity-60",
|
|
2456
|
-
children:
|
|
2576
|
+
children: Rt[e.type]
|
|
2457
2577
|
}), e.value]
|
|
2458
2578
|
}, t))
|
|
2459
2579
|
}) : /* @__PURE__ */ Z("div", {
|
|
@@ -2470,10 +2590,10 @@ var At = {
|
|
|
2470
2590
|
children: s("detail.currentVersion")
|
|
2471
2591
|
}),
|
|
2472
2592
|
y.map((e, t) => /* @__PURE__ */ Q(n.Fragment, { children: [/* @__PURE__ */ Z("div", {
|
|
2473
|
-
className: F("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ?
|
|
2593
|
+
className: F("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.left ? Lt[e.left.type] : "bg-muted/20"),
|
|
2474
2594
|
children: e.left?.value ?? ""
|
|
2475
2595
|
}), /* @__PURE__ */ Z("div", {
|
|
2476
|
-
className: F("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ?
|
|
2596
|
+
className: F("px-3 py-0.5 whitespace-pre-wrap min-h-[1.5em]", e.right ? Lt[e.right.type] : "bg-muted/20"),
|
|
2477
2597
|
children: e.right?.value ?? ""
|
|
2478
2598
|
})] }, t))
|
|
2479
2599
|
]
|
|
@@ -2484,7 +2604,7 @@ var At = {
|
|
|
2484
2604
|
})
|
|
2485
2605
|
})]
|
|
2486
2606
|
});
|
|
2487
|
-
},
|
|
2607
|
+
}, Bt = ({ currentIndex: e, totalRecords: t, recordIds: r, onNavigate: i, onSearch: a, className: o }) => {
|
|
2488
2608
|
let { t: s } = $(), [c, l] = n.useState(""), [u, d] = n.useState(!1), f = n.useRef(null), m = e > 0, h = e > 0, g = e < t - 1, _ = e < t - 1, v = n.useCallback(() => {
|
|
2489
2609
|
m && i(r[0]);
|
|
2490
2610
|
}, [
|
|
@@ -2561,7 +2681,7 @@ var At = {
|
|
|
2561
2681
|
disabled: !m,
|
|
2562
2682
|
onClick: v,
|
|
2563
2683
|
title: s("detail.firstRecord"),
|
|
2564
|
-
children: /* @__PURE__ */ Z(
|
|
2684
|
+
children: /* @__PURE__ */ Z(ce, { className: "h-4 w-4" })
|
|
2565
2685
|
}),
|
|
2566
2686
|
/* @__PURE__ */ Z(p, {
|
|
2567
2687
|
variant: "outline",
|
|
@@ -2586,7 +2706,7 @@ var At = {
|
|
|
2586
2706
|
disabled: !g,
|
|
2587
2707
|
onClick: b,
|
|
2588
2708
|
title: s("detail.nextRecordKey"),
|
|
2589
|
-
children: /* @__PURE__ */ Z(
|
|
2709
|
+
children: /* @__PURE__ */ Z(se, { className: "h-4 w-4" })
|
|
2590
2710
|
}),
|
|
2591
2711
|
/* @__PURE__ */ Z(p, {
|
|
2592
2712
|
variant: "outline",
|
|
@@ -2595,7 +2715,7 @@ var At = {
|
|
|
2595
2715
|
disabled: !_,
|
|
2596
2716
|
onClick: S,
|
|
2597
2717
|
title: s("detail.lastRecord"),
|
|
2598
|
-
children: /* @__PURE__ */ Z(
|
|
2718
|
+
children: /* @__PURE__ */ Z(le, { className: "h-4 w-4" })
|
|
2599
2719
|
}),
|
|
2600
2720
|
a && /* @__PURE__ */ Q(X, { children: [/* @__PURE__ */ Z(p, {
|
|
2601
2721
|
variant: u ? "secondary" : "ghost",
|
|
@@ -2617,18 +2737,18 @@ var At = {
|
|
|
2617
2737
|
})] })
|
|
2618
2738
|
]
|
|
2619
2739
|
});
|
|
2620
|
-
},
|
|
2740
|
+
}, Vt = 28, Ht = [
|
|
2621
2741
|
"fill-primary stroke-primary",
|
|
2622
2742
|
"fill-blue-500 stroke-blue-500",
|
|
2623
2743
|
"fill-emerald-500 stroke-emerald-500",
|
|
2624
2744
|
"fill-amber-500 stroke-amber-500"
|
|
2625
|
-
],
|
|
2745
|
+
], Ut = [
|
|
2626
2746
|
"fill-primary-foreground",
|
|
2627
2747
|
"fill-white",
|
|
2628
2748
|
"fill-white",
|
|
2629
2749
|
"fill-white"
|
|
2630
2750
|
];
|
|
2631
|
-
function
|
|
2751
|
+
function Wt(e, t, n, r, i) {
|
|
2632
2752
|
let a = [], o = [], s = /* @__PURE__ */ new Set(), c = r / 2, l = i / 2;
|
|
2633
2753
|
a.push({
|
|
2634
2754
|
id: e.id,
|
|
@@ -2692,10 +2812,10 @@ function Lt(e, t, n, r, i) {
|
|
|
2692
2812
|
edges: o
|
|
2693
2813
|
};
|
|
2694
2814
|
}
|
|
2695
|
-
function
|
|
2815
|
+
function Gt(e, t = 6) {
|
|
2696
2816
|
return e.length <= t ? e : e.slice(0, t - 1) + "…";
|
|
2697
2817
|
}
|
|
2698
|
-
var
|
|
2818
|
+
var Kt = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, className: a }) => {
|
|
2699
2819
|
let o = n.useRef(null), [s, c] = n.useState({
|
|
2700
2820
|
width: 500,
|
|
2701
2821
|
height: 400
|
|
@@ -2716,7 +2836,7 @@ var zt = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
2716
2836
|
});
|
|
2717
2837
|
return n.observe(t), () => n.disconnect();
|
|
2718
2838
|
}, []);
|
|
2719
|
-
let { nodes: d, edges: f } = n.useMemo(() =>
|
|
2839
|
+
let { nodes: d, edges: f } = n.useMemo(() => Wt(e, t, r, s.width, s.height), [
|
|
2720
2840
|
e,
|
|
2721
2841
|
t,
|
|
2722
2842
|
r,
|
|
@@ -2758,7 +2878,7 @@ var zt = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
2758
2878
|
strokeWidth: 1.5,
|
|
2759
2879
|
strokeOpacity: .5
|
|
2760
2880
|
}, `edge-${t}`)), d.map((e) => {
|
|
2761
|
-
let t = l === e.id, n =
|
|
2881
|
+
let t = l === e.id, n = Ht[Math.min(e.level, Ht.length - 1)], r = Ut[Math.min(e.level, Ut.length - 1)], a = e.level === 0 ? Vt + 6 : Vt;
|
|
2762
2882
|
return /* @__PURE__ */ Q("g", {
|
|
2763
2883
|
className: F("cursor-pointer transition-transform", i && "hover:opacity-80"),
|
|
2764
2884
|
onClick: () => i?.(e.id),
|
|
@@ -2780,7 +2900,7 @@ var zt = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
2780
2900
|
textAnchor: "middle",
|
|
2781
2901
|
dominantBaseline: "central",
|
|
2782
2902
|
className: F("text-[10px] font-medium pointer-events-none", r),
|
|
2783
|
-
children:
|
|
2903
|
+
children: Gt(e.label)
|
|
2784
2904
|
}),
|
|
2785
2905
|
e.type && /* @__PURE__ */ Z("text", {
|
|
2786
2906
|
x: e.x,
|
|
@@ -2814,16 +2934,16 @@ var zt = ({ record: e, relatedRecords: t, levels: r = 1, onNodeClick: i, classNa
|
|
|
2814
2934
|
};
|
|
2815
2935
|
//#endregion
|
|
2816
2936
|
//#region src/CommentAttachment.tsx
|
|
2817
|
-
function
|
|
2937
|
+
function qt(e) {
|
|
2818
2938
|
return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
|
|
2819
2939
|
}
|
|
2820
|
-
function
|
|
2940
|
+
function Jt(e) {
|
|
2821
2941
|
return e.startsWith("image/");
|
|
2822
2942
|
}
|
|
2823
|
-
function
|
|
2824
|
-
return
|
|
2943
|
+
function Yt(e) {
|
|
2944
|
+
return Jt(e) ? _e : e.includes("pdf") || e.includes("document") || e.includes("text") ? ge : e.includes("zip") || e.includes("archive") || e.includes("compressed") ? he : me;
|
|
2825
2945
|
}
|
|
2826
|
-
var
|
|
2946
|
+
var Xt = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a = !1 }) => {
|
|
2827
2947
|
let { t: o } = $(), [s, c] = n.useState(!1), l = n.useRef(null), u = n.useCallback((e) => {
|
|
2828
2948
|
e.preventDefault(), e.stopPropagation(), c(!0);
|
|
2829
2949
|
}, []), d = n.useCallback((e) => {
|
|
@@ -2868,7 +2988,7 @@ var Ut = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
|
|
|
2868
2988
|
}), /* @__PURE__ */ Z("div", {
|
|
2869
2989
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-2",
|
|
2870
2990
|
children: e.map((e) => {
|
|
2871
|
-
let t =
|
|
2991
|
+
let t = Jt(e.type), n = Yt(e.type);
|
|
2872
2992
|
return /* @__PURE__ */ Q("div", {
|
|
2873
2993
|
className: "flex items-center gap-2 rounded-md border px-2.5 py-2 bg-muted/30 group",
|
|
2874
2994
|
children: [
|
|
@@ -2887,7 +3007,7 @@ var Ut = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
|
|
|
2887
3007
|
children: e.name
|
|
2888
3008
|
}), /* @__PURE__ */ Z("p", {
|
|
2889
3009
|
className: "text-[10px] text-muted-foreground",
|
|
2890
|
-
children:
|
|
3010
|
+
children: qt(e.size)
|
|
2891
3011
|
})]
|
|
2892
3012
|
}),
|
|
2893
3013
|
r && !a && /* @__PURE__ */ Z(p, {
|
|
@@ -2907,7 +3027,7 @@ var Ut = ({ attachments: e, onUpload: t, onRemove: r, className: i, readOnly: a
|
|
|
2907
3027
|
};
|
|
2908
3028
|
//#endregion
|
|
2909
3029
|
//#region src/PointInTimeRestore.tsx
|
|
2910
|
-
function
|
|
3030
|
+
function Zt(e) {
|
|
2911
3031
|
try {
|
|
2912
3032
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
2913
3033
|
if (r < 1) return "just now";
|
|
@@ -2918,7 +3038,7 @@ function Wt(e) {
|
|
|
2918
3038
|
return e;
|
|
2919
3039
|
}
|
|
2920
3040
|
}
|
|
2921
|
-
var
|
|
3041
|
+
var Qt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
2922
3042
|
let [a, o] = n.useState(null), [s, c] = n.useState(!1), [l, u] = n.useState(!1), d = n.useMemo(() => t.find((e) => e.id === a) ?? null, [t, a]), f = n.useCallback(async () => {
|
|
2923
3043
|
if (!(!d || !r)) {
|
|
2924
3044
|
if (!s) {
|
|
@@ -2980,7 +3100,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
2980
3100
|
},
|
|
2981
3101
|
children: [/* @__PURE__ */ Z("div", {
|
|
2982
3102
|
className: F("shrink-0 h-6 w-6 rounded-full border-2 flex items-center justify-center z-10 mt-0.5", t ? "border-primary bg-primary" : "border-border bg-background"),
|
|
2983
|
-
children: t && /* @__PURE__ */ Z(
|
|
3103
|
+
children: t && /* @__PURE__ */ Z(se, { className: "h-3 w-3 text-primary-foreground" })
|
|
2984
3104
|
}), /* @__PURE__ */ Q("div", {
|
|
2985
3105
|
className: "flex-1 min-w-0",
|
|
2986
3106
|
children: [/* @__PURE__ */ Q("div", {
|
|
@@ -2990,7 +3110,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
2990
3110
|
children: e.user
|
|
2991
3111
|
}), /* @__PURE__ */ Z("span", {
|
|
2992
3112
|
className: "text-xs text-muted-foreground",
|
|
2993
|
-
children:
|
|
3113
|
+
children: Zt(e.timestamp)
|
|
2994
3114
|
})]
|
|
2995
3115
|
}), /* @__PURE__ */ Q("p", {
|
|
2996
3116
|
className: "text-xs text-muted-foreground mt-0.5",
|
|
@@ -3028,7 +3148,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
3028
3148
|
className: "line-through text-red-600 dark:text-red-400 truncate max-w-[120px]",
|
|
3029
3149
|
children: e.oldValue == null ? "(empty)" : String(e.oldValue)
|
|
3030
3150
|
}),
|
|
3031
|
-
/* @__PURE__ */ Z(
|
|
3151
|
+
/* @__PURE__ */ Z(se, { className: "h-3 w-3 text-muted-foreground shrink-0" }),
|
|
3032
3152
|
/* @__PURE__ */ Z("span", {
|
|
3033
3153
|
className: "text-green-600 dark:text-green-400 truncate max-w-[120px]",
|
|
3034
3154
|
children: e.newValue == null ? "(empty)" : String(e.newValue)
|
|
@@ -3063,7 +3183,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
3063
3183
|
children: [
|
|
3064
3184
|
"This will restore the record to its state at",
|
|
3065
3185
|
" ",
|
|
3066
|
-
|
|
3186
|
+
Zt(d.timestamp),
|
|
3067
3187
|
". Continue?"
|
|
3068
3188
|
]
|
|
3069
3189
|
}), /* @__PURE__ */ Q("div", {
|
|
@@ -3094,7 +3214,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
3094
3214
|
})]
|
|
3095
3215
|
}) })]
|
|
3096
3216
|
});
|
|
3097
|
-
},
|
|
3217
|
+
}, $t = ({ change: e, className: t }) => {
|
|
3098
3218
|
let n = e.fieldLabel ?? e.field.charAt(0).toUpperCase() + e.field.slice(1).replace(/_/g, " "), r = e.oldDisplayValue ?? (e.oldValue == null ? "(empty)" : String(e.oldValue)), i = e.newDisplayValue ?? (e.newValue == null ? "(empty)" : String(e.newValue));
|
|
3099
3219
|
return /* @__PURE__ */ Q("div", {
|
|
3100
3220
|
className: F("flex items-center gap-1.5 text-sm flex-wrap", t),
|
|
@@ -3114,14 +3234,14 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
3114
3234
|
})
|
|
3115
3235
|
]
|
|
3116
3236
|
});
|
|
3117
|
-
},
|
|
3237
|
+
}, en = [
|
|
3118
3238
|
"👍",
|
|
3119
3239
|
"❤️",
|
|
3120
3240
|
"🎉",
|
|
3121
3241
|
"😂",
|
|
3122
3242
|
"😮",
|
|
3123
3243
|
"😢"
|
|
3124
|
-
],
|
|
3244
|
+
], tn = ({ reactions: e, onToggleReaction: t, emojiOptions: r = en, className: i }) => {
|
|
3125
3245
|
let [a, o] = n.useState(!1), s = n.useCallback((e) => {
|
|
3126
3246
|
t?.(e), o(!1);
|
|
3127
3247
|
}, [t]);
|
|
@@ -3161,7 +3281,7 @@ var Gt = ({ recordId: e, revisions: t, onRestore: r, className: i }) => {
|
|
|
3161
3281
|
};
|
|
3162
3282
|
//#endregion
|
|
3163
3283
|
//#region src/ThreadedReplies.tsx
|
|
3164
|
-
function
|
|
3284
|
+
function nn(e) {
|
|
3165
3285
|
try {
|
|
3166
3286
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
3167
3287
|
if (r < 1) return "just now";
|
|
@@ -3174,7 +3294,7 @@ function Yt(e) {
|
|
|
3174
3294
|
return e;
|
|
3175
3295
|
}
|
|
3176
3296
|
}
|
|
3177
|
-
var
|
|
3297
|
+
var rn = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, className: a }) => {
|
|
3178
3298
|
let { t: o } = $(), [s, c] = n.useState(!1), [l, u] = n.useState(""), [d, f] = n.useState(!1), m = n.useCallback(async () => {
|
|
3179
3299
|
let t = l.trim();
|
|
3180
3300
|
if (!(!t || !r)) {
|
|
@@ -3201,7 +3321,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3201
3321
|
onClick: () => c(!s),
|
|
3202
3322
|
"aria-expanded": s,
|
|
3203
3323
|
children: [
|
|
3204
|
-
Z(s ? ae :
|
|
3324
|
+
Z(s ? ae : se, { className: "h-3 w-3" }),
|
|
3205
3325
|
/* @__PURE__ */ Z(Y, { className: "h-3 w-3" }),
|
|
3206
3326
|
/* @__PURE__ */ Z("span", { children: t.length === 1 ? o("detail.replyCount", { count: t.length }) : o("detail.replyCountPlural", { count: t.length }) })
|
|
3207
3327
|
]
|
|
@@ -3229,7 +3349,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3229
3349
|
children: e.actor
|
|
3230
3350
|
}), /* @__PURE__ */ Z("span", {
|
|
3231
3351
|
className: "text-[10px] text-muted-foreground",
|
|
3232
|
-
children:
|
|
3352
|
+
children: nn(e.createdAt)
|
|
3233
3353
|
})]
|
|
3234
3354
|
}), /* @__PURE__ */ Z("p", {
|
|
3235
3355
|
className: "text-xs whitespace-pre-wrap break-words",
|
|
@@ -3259,7 +3379,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3259
3379
|
})
|
|
3260
3380
|
]
|
|
3261
3381
|
});
|
|
3262
|
-
},
|
|
3382
|
+
}, an = ({ subscription: e, onToggle: t, className: r }) => {
|
|
3263
3383
|
let { t: i } = $(), [a, o] = n.useState(!1), s = n.useCallback(async () => {
|
|
3264
3384
|
if (t) {
|
|
3265
3385
|
o(!0);
|
|
@@ -3280,7 +3400,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3280
3400
|
title: e.subscribed ? i("detail.subscribedTooltip") : i("detail.unsubscribedTooltip"),
|
|
3281
3401
|
children: e.subscribed ? /* @__PURE__ */ Z(ne, { className: "h-4 w-4 text-primary" }) : /* @__PURE__ */ Z(re, { className: "h-4 w-4 text-muted-foreground" })
|
|
3282
3402
|
});
|
|
3283
|
-
},
|
|
3403
|
+
}, on = {
|
|
3284
3404
|
comment: Y,
|
|
3285
3405
|
field_change: G,
|
|
3286
3406
|
task: U,
|
|
@@ -3288,7 +3408,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3288
3408
|
system: Be,
|
|
3289
3409
|
email: Se,
|
|
3290
3410
|
call: De
|
|
3291
|
-
},
|
|
3411
|
+
}, sn = {
|
|
3292
3412
|
comment: "bg-purple-100 text-purple-600",
|
|
3293
3413
|
field_change: "bg-blue-100 text-blue-600",
|
|
3294
3414
|
task: "bg-green-100 text-green-600",
|
|
@@ -3297,7 +3417,7 @@ var Xt = ({ parentItem: e, replies: t, onAddReply: r, showReplyInput: i = !0, cl
|
|
|
3297
3417
|
email: "bg-indigo-100 text-indigo-600",
|
|
3298
3418
|
call: "bg-teal-100 text-teal-600"
|
|
3299
3419
|
};
|
|
3300
|
-
function
|
|
3420
|
+
function cn(e) {
|
|
3301
3421
|
return [
|
|
3302
3422
|
{
|
|
3303
3423
|
value: "all",
|
|
@@ -3317,7 +3437,7 @@ function en(e) {
|
|
|
3317
3437
|
}
|
|
3318
3438
|
];
|
|
3319
3439
|
}
|
|
3320
|
-
function
|
|
3440
|
+
function ln(e) {
|
|
3321
3441
|
try {
|
|
3322
3442
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 6e4);
|
|
3323
3443
|
if (r < 1) return "just now";
|
|
@@ -3330,7 +3450,7 @@ function tn(e) {
|
|
|
3330
3450
|
return e;
|
|
3331
3451
|
}
|
|
3332
3452
|
}
|
|
3333
|
-
function
|
|
3453
|
+
function un(e, t) {
|
|
3334
3454
|
switch (t) {
|
|
3335
3455
|
case "comments_only": return e.filter((e) => e.type === "comment");
|
|
3336
3456
|
case "changes_only": return e.filter((e) => e.type === "field_change");
|
|
@@ -3338,8 +3458,8 @@ function nn(e, t) {
|
|
|
3338
3458
|
default: return e;
|
|
3339
3459
|
}
|
|
3340
3460
|
}
|
|
3341
|
-
var
|
|
3342
|
-
let { t: b } = $(), [x, S] = n.useState("all"), [C, w] = n.useState(""), [T, E] = n.useState(!1), [D, O] = n.useState(!1), k = r ?? x, A = t?.showFilterToggle !== !1, j = t?.showCommentInput !== !1 && !!c, M = t?.enableReactions ?? !1, N = t?.enableThreading ?? !1, P = t?.showSubscriptionToggle ?? !1, I = n.useMemo(() =>
|
|
3461
|
+
var dn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a = !1, onLoadMore: o, loading: s = !1, onAddComment: c, onAddReply: l, onToggleReaction: u, subscription: d, onToggleSubscription: f, collapseWhenEmpty: v = !1, className: y }) => {
|
|
3462
|
+
let { t: b } = $(), [x, S] = n.useState("all"), [C, w] = n.useState(""), [T, E] = n.useState(!1), [D, O] = n.useState(!1), k = r ?? x, A = t?.showFilterToggle !== !1, j = t?.showCommentInput !== !1 && !!c, M = t?.enableReactions ?? !1, N = t?.enableThreading ?? !1, P = t?.showSubscriptionToggle ?? !1, I = n.useMemo(() => un(e, k), [e, k]), ee = n.useMemo(() => N ? I.filter((e) => !e.parentId) : I, [I, N]), R = n.useMemo(() => {
|
|
3343
3463
|
if (!N) return /* @__PURE__ */ new Map();
|
|
3344
3464
|
let e = /* @__PURE__ */ new Map();
|
|
3345
3465
|
for (let t of I) if (t.parentId) {
|
|
@@ -3391,7 +3511,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3391
3511
|
]
|
|
3392
3512
|
}), /* @__PURE__ */ Z("div", {
|
|
3393
3513
|
className: "flex items-center gap-1",
|
|
3394
|
-
children: P && d && /* @__PURE__ */ Z(
|
|
3514
|
+
children: P && d && /* @__PURE__ */ Z(an, {
|
|
3395
3515
|
subscription: d,
|
|
3396
3516
|
onToggle: f
|
|
3397
3517
|
})
|
|
@@ -3406,7 +3526,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3406
3526
|
value: k,
|
|
3407
3527
|
onChange: (e) => te(e.target.value),
|
|
3408
3528
|
"aria-label": b("detail.filterActivity"),
|
|
3409
|
-
children:
|
|
3529
|
+
children: cn(b).map((e) => /* @__PURE__ */ Z("option", {
|
|
3410
3530
|
value: e.value,
|
|
3411
3531
|
children: e.label
|
|
3412
3532
|
}, e.value))
|
|
@@ -3439,7 +3559,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3439
3559
|
children: [/* @__PURE__ */ Z("div", { className: "absolute left-4 top-2 bottom-2 w-px bg-border" }), /* @__PURE__ */ Z("div", {
|
|
3440
3560
|
className: "space-y-4",
|
|
3441
3561
|
children: ee.map((e) => {
|
|
3442
|
-
let t =
|
|
3562
|
+
let t = on[e.type] || Be, n = sn[e.type] || "bg-gray-100 text-gray-600", r = R.get(e.id) ?? [];
|
|
3443
3563
|
return /* @__PURE__ */ Q("div", { children: [/* @__PURE__ */ Q("div", {
|
|
3444
3564
|
className: "flex gap-3 relative",
|
|
3445
3565
|
children: [/* @__PURE__ */ Z("div", {
|
|
@@ -3465,7 +3585,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3465
3585
|
}),
|
|
3466
3586
|
/* @__PURE__ */ Z("span", {
|
|
3467
3587
|
className: "text-xs text-muted-foreground",
|
|
3468
|
-
children:
|
|
3588
|
+
children: ln(e.createdAt)
|
|
3469
3589
|
}),
|
|
3470
3590
|
e.edited && /* @__PURE__ */ Z("span", {
|
|
3471
3591
|
className: "text-xs text-muted-foreground italic",
|
|
@@ -3483,25 +3603,25 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3483
3603
|
}),
|
|
3484
3604
|
e.type === "field_change" && e.fieldChanges && /* @__PURE__ */ Z("div", {
|
|
3485
3605
|
className: "space-y-1 mt-1",
|
|
3486
|
-
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z(
|
|
3606
|
+
children: e.fieldChanges.map((e, t) => /* @__PURE__ */ Z($t, { change: e }, t))
|
|
3487
3607
|
}),
|
|
3488
3608
|
M && e.reactions && e.reactions.length > 0 && /* @__PURE__ */ Z("div", {
|
|
3489
3609
|
className: "mt-1.5",
|
|
3490
|
-
children: /* @__PURE__ */ Z(
|
|
3610
|
+
children: /* @__PURE__ */ Z(tn, {
|
|
3491
3611
|
reactions: e.reactions,
|
|
3492
3612
|
onToggleReaction: u ? (t) => u(e.id, t) : void 0
|
|
3493
3613
|
})
|
|
3494
3614
|
}),
|
|
3495
3615
|
M && (!e.reactions || e.reactions.length === 0) && u && /* @__PURE__ */ Z("div", {
|
|
3496
3616
|
className: "mt-1.5",
|
|
3497
|
-
children: /* @__PURE__ */ Z(
|
|
3617
|
+
children: /* @__PURE__ */ Z(tn, {
|
|
3498
3618
|
reactions: [],
|
|
3499
3619
|
onToggleReaction: (t) => u(e.id, t)
|
|
3500
3620
|
})
|
|
3501
3621
|
})
|
|
3502
3622
|
]
|
|
3503
3623
|
})]
|
|
3504
|
-
}), N && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(
|
|
3624
|
+
}), N && (e.replyCount ?? 0) > 0 && /* @__PURE__ */ Z(rn, {
|
|
3505
3625
|
parentItem: e,
|
|
3506
3626
|
replies: r,
|
|
3507
3627
|
onAddReply: l,
|
|
@@ -3524,7 +3644,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3524
3644
|
]
|
|
3525
3645
|
})]
|
|
3526
3646
|
});
|
|
3527
|
-
},
|
|
3647
|
+
}, fn = ({ config: e, items: t, hasMore: r, onLoadMore: i, loading: a, onAddComment: o, onAddReply: s, onToggleReaction: c, subscription: l, onToggleSubscription: u, filterMode: d, onFilterChange: f, collapseWhenEmpty: m = !1, className: h }) => {
|
|
3528
3648
|
let g = e?.position ?? "right", _ = e?.width ?? "360px", v = e?.collapsible ?? !0, y = m && t.length === 0 || (e?.defaultCollapsed ?? !1), { t: b } = $(), [x, S] = n.useState(y);
|
|
3529
3649
|
return g === "right" || g === "left" ? x && v ? /* @__PURE__ */ Z("div", {
|
|
3530
3650
|
className: F("flex items-start pt-4", g === "right" ? "border-l" : "border-r", h),
|
|
@@ -3560,7 +3680,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3560
3680
|
})]
|
|
3561
3681
|
}), /* @__PURE__ */ Z("div", {
|
|
3562
3682
|
className: "flex-1 overflow-y-auto",
|
|
3563
|
-
children: /* @__PURE__ */ Z(
|
|
3683
|
+
children: /* @__PURE__ */ Z(dn, {
|
|
3564
3684
|
items: t,
|
|
3565
3685
|
config: e?.feed,
|
|
3566
3686
|
hasMore: r,
|
|
@@ -3598,7 +3718,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3598
3718
|
"aria-label": b("detail.hideDiscussion"),
|
|
3599
3719
|
children: /* @__PURE__ */ Z(we, { className: "h-3.5 w-3.5" })
|
|
3600
3720
|
})]
|
|
3601
|
-
}), /* @__PURE__ */ Z(
|
|
3721
|
+
}), /* @__PURE__ */ Z(dn, {
|
|
3602
3722
|
items: t,
|
|
3603
3723
|
config: e?.feed,
|
|
3604
3724
|
hasMore: r,
|
|
@@ -3614,7 +3734,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3614
3734
|
collapseWhenEmpty: m
|
|
3615
3735
|
})] })
|
|
3616
3736
|
});
|
|
3617
|
-
},
|
|
3737
|
+
}, pn = ({ onSubmit: e, placeholder: t = "Leave a comment…", disabled: r = !1, className: i }) => {
|
|
3618
3738
|
let [a, o] = n.useState(""), [s, c] = n.useState(!1), l = n.useCallback(async () => {
|
|
3619
3739
|
let t = a.trim();
|
|
3620
3740
|
if (t) {
|
|
@@ -3647,7 +3767,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3647
3767
|
children: /* @__PURE__ */ Z(Pe, { className: "h-4 w-4" })
|
|
3648
3768
|
})]
|
|
3649
3769
|
});
|
|
3650
|
-
},
|
|
3770
|
+
}, mn = ({ query: e, suggestions: t, onSelect: r, visible: i = !0, activeIndex: a = 0, className: o }) => {
|
|
3651
3771
|
let s = n.useMemo(() => {
|
|
3652
3772
|
if (!e) return t;
|
|
3653
3773
|
let n = e.toLowerCase();
|
|
@@ -3689,7 +3809,7 @@ var rn = ({ items: e, config: t, filterMode: r, onFilterChange: i, hasMore: a =
|
|
|
3689
3809
|
}, e.id))
|
|
3690
3810
|
});
|
|
3691
3811
|
};
|
|
3692
|
-
function
|
|
3812
|
+
function hn(e, t, n) {
|
|
3693
3813
|
return {
|
|
3694
3814
|
type: e.type,
|
|
3695
3815
|
id: e.id,
|
|
@@ -3698,7 +3818,7 @@ function cn(e, t, n) {
|
|
|
3698
3818
|
length: n
|
|
3699
3819
|
};
|
|
3700
3820
|
}
|
|
3701
|
-
e.register("detail-view",
|
|
3821
|
+
e.register("detail-view", Et, {
|
|
3702
3822
|
namespace: "plugin-detail",
|
|
3703
3823
|
label: "Detail View",
|
|
3704
3824
|
category: "Views",
|
|
@@ -3926,7 +4046,7 @@ e.register("detail-view", yt, {
|
|
|
3926
4046
|
label: "Columns"
|
|
3927
4047
|
}
|
|
3928
4048
|
]
|
|
3929
|
-
}), e.register("detail",
|
|
4049
|
+
}), e.register("detail", Et, {
|
|
3930
4050
|
namespace: "view",
|
|
3931
4051
|
category: "view",
|
|
3932
4052
|
label: "Detail",
|
|
@@ -3951,4 +4071,4 @@ e.register("detail-view", yt, {
|
|
|
3951
4071
|
]
|
|
3952
4072
|
});
|
|
3953
4073
|
//#endregion
|
|
3954
|
-
export { gt as ActivityTimeline,
|
|
4074
|
+
export { gt as ActivityTimeline, Xt as CommentAttachment, pn as CommentInput, tt as DETAIL_DEFAULT_TRANSLATIONS, rt as DetailSection, it as DetailTabs, Et as DetailView, zt as DiffView, $t as FieldChangeItem, ct as HeaderHighlight, Mt as InlineCreateRelated, mn as MentionAutocomplete, Qt as PointInTimeRestore, tn as ReactionPicker, dn as RecordActivityTimeline, fn as RecordChatterPanel, ut as RecordComments, At as RecordDetailDrawer, Ct as RecordMetaFooter, Bt as RecordNavigationEnhanced, ot as RelatedList, Kt as RelationshipGraph, Pt as RichTextCommentInput, st as SectionGroup, an as SubscriptionToggle, rn as ThreadedReplies, Qe as applyAutoSpan, $e as applyDetailAutoLayout, hn as createMentionFromSuggestion, et as createSafeTranslationHook, jt as deriveRecordPageHref, Ze as inferDetailColumns, Xe as isWideFieldType, $ as useDetailTranslation };
|